@nok-integration/storefront-react 0.17.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -483,18 +483,18 @@ function requireParseUtil() {
483
483
  if (this.value !== "aborted")
484
484
  this.value = "aborted";
485
485
  }
486
- static mergeArray(status2, results) {
486
+ static mergeArray(status, results) {
487
487
  const arrayValue = [];
488
488
  for (const s of results) {
489
489
  if (s.status === "aborted")
490
490
  return exports.INVALID;
491
491
  if (s.status === "dirty")
492
- status2.dirty();
492
+ status.dirty();
493
493
  arrayValue.push(s.value);
494
494
  }
495
- return { status: status2.value, value: arrayValue };
495
+ return { status: status.value, value: arrayValue };
496
496
  }
497
- static async mergeObjectAsync(status2, pairs) {
497
+ static async mergeObjectAsync(status, pairs) {
498
498
  const syncPairs = [];
499
499
  for (const pair of pairs) {
500
500
  const key = await pair.key;
@@ -504,9 +504,9 @@ function requireParseUtil() {
504
504
  value: value2
505
505
  });
506
506
  }
507
- return ParseStatus.mergeObjectSync(status2, syncPairs);
507
+ return ParseStatus.mergeObjectSync(status, syncPairs);
508
508
  }
509
- static mergeObjectSync(status2, pairs) {
509
+ static mergeObjectSync(status, pairs) {
510
510
  const finalObject = {};
511
511
  for (const pair of pairs) {
512
512
  const { key, value: value2 } = pair;
@@ -515,14 +515,14 @@ function requireParseUtil() {
515
515
  if (value2.status === "aborted")
516
516
  return exports.INVALID;
517
517
  if (key.status === "dirty")
518
- status2.dirty();
518
+ status.dirty();
519
519
  if (value2.status === "dirty")
520
- status2.dirty();
520
+ status.dirty();
521
521
  if (key.value !== "__proto__" && (typeof value2.value !== "undefined" || pair.alwaysSet)) {
522
522
  finalObject[key.value] = value2.value;
523
523
  }
524
524
  }
525
- return { status: status2.value, value: finalObject };
525
+ return { status: status.value, value: finalObject };
526
526
  }
527
527
  }
528
528
  exports.ParseStatus = ParseStatus;
@@ -764,7 +764,7 @@ function requireTypes() {
764
764
  const result = await ((0, parseUtil_js_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
765
765
  return handleResult(ctx, result);
766
766
  }
767
- refine(check, message2) {
767
+ refine(check2, message2) {
768
768
  const getIssueProperties = (val) => {
769
769
  if (typeof message2 === "string" || typeof message2 === "undefined") {
770
770
  return { message: message2 };
@@ -775,7 +775,7 @@ function requireTypes() {
775
775
  }
776
776
  };
777
777
  return this._refinement((val, ctx) => {
778
- const result = check(val);
778
+ const result = check2(val);
779
779
  const setError = () => ctx.addIssue({
780
780
  code: ZodError_js_1.ZodIssueCode.custom,
781
781
  ...getIssueProperties(val)
@@ -798,9 +798,9 @@ function requireTypes() {
798
798
  }
799
799
  });
800
800
  }
801
- refinement(check, refinementData) {
801
+ refinement(check2, refinementData) {
802
802
  return this._refinement((val, ctx) => {
803
- if (!check(val)) {
803
+ if (!check2(val)) {
804
804
  ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
805
805
  return false;
806
806
  } else {
@@ -1023,72 +1023,72 @@ function requireTypes() {
1023
1023
  });
1024
1024
  return parseUtil_js_1.INVALID;
1025
1025
  }
1026
- const status2 = new parseUtil_js_1.ParseStatus();
1026
+ const status = new parseUtil_js_1.ParseStatus();
1027
1027
  let ctx = void 0;
1028
- for (const check of this._def.checks) {
1029
- if (check.kind === "min") {
1030
- if (input.data.length < check.value) {
1028
+ for (const check2 of this._def.checks) {
1029
+ if (check2.kind === "min") {
1030
+ if (input.data.length < check2.value) {
1031
1031
  ctx = this._getOrReturnCtx(input, ctx);
1032
1032
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1033
1033
  code: ZodError_js_1.ZodIssueCode.too_small,
1034
- minimum: check.value,
1034
+ minimum: check2.value,
1035
1035
  type: "string",
1036
1036
  inclusive: true,
1037
1037
  exact: false,
1038
- message: check.message
1038
+ message: check2.message
1039
1039
  });
1040
- status2.dirty();
1040
+ status.dirty();
1041
1041
  }
1042
- } else if (check.kind === "max") {
1043
- if (input.data.length > check.value) {
1042
+ } else if (check2.kind === "max") {
1043
+ if (input.data.length > check2.value) {
1044
1044
  ctx = this._getOrReturnCtx(input, ctx);
1045
1045
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1046
1046
  code: ZodError_js_1.ZodIssueCode.too_big,
1047
- maximum: check.value,
1047
+ maximum: check2.value,
1048
1048
  type: "string",
1049
1049
  inclusive: true,
1050
1050
  exact: false,
1051
- message: check.message
1051
+ message: check2.message
1052
1052
  });
1053
- status2.dirty();
1053
+ status.dirty();
1054
1054
  }
1055
- } else if (check.kind === "length") {
1056
- const tooBig = input.data.length > check.value;
1057
- const tooSmall = input.data.length < check.value;
1055
+ } else if (check2.kind === "length") {
1056
+ const tooBig = input.data.length > check2.value;
1057
+ const tooSmall = input.data.length < check2.value;
1058
1058
  if (tooBig || tooSmall) {
1059
1059
  ctx = this._getOrReturnCtx(input, ctx);
1060
1060
  if (tooBig) {
1061
1061
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1062
1062
  code: ZodError_js_1.ZodIssueCode.too_big,
1063
- maximum: check.value,
1063
+ maximum: check2.value,
1064
1064
  type: "string",
1065
1065
  inclusive: true,
1066
1066
  exact: true,
1067
- message: check.message
1067
+ message: check2.message
1068
1068
  });
1069
1069
  } else if (tooSmall) {
1070
1070
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1071
1071
  code: ZodError_js_1.ZodIssueCode.too_small,
1072
- minimum: check.value,
1072
+ minimum: check2.value,
1073
1073
  type: "string",
1074
1074
  inclusive: true,
1075
1075
  exact: true,
1076
- message: check.message
1076
+ message: check2.message
1077
1077
  });
1078
1078
  }
1079
- status2.dirty();
1079
+ status.dirty();
1080
1080
  }
1081
- } else if (check.kind === "email") {
1081
+ } else if (check2.kind === "email") {
1082
1082
  if (!emailRegex.test(input.data)) {
1083
1083
  ctx = this._getOrReturnCtx(input, ctx);
1084
1084
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1085
1085
  validation: "email",
1086
1086
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1087
- message: check.message
1087
+ message: check2.message
1088
1088
  });
1089
- status2.dirty();
1089
+ status.dirty();
1090
1090
  }
1091
- } else if (check.kind === "emoji") {
1091
+ } else if (check2.kind === "emoji") {
1092
1092
  if (!emojiRegex) {
1093
1093
  emojiRegex = new RegExp(_emojiRegex, "u");
1094
1094
  }
@@ -1097,61 +1097,61 @@ function requireTypes() {
1097
1097
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1098
1098
  validation: "emoji",
1099
1099
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1100
- message: check.message
1100
+ message: check2.message
1101
1101
  });
1102
- status2.dirty();
1102
+ status.dirty();
1103
1103
  }
1104
- } else if (check.kind === "uuid") {
1104
+ } else if (check2.kind === "uuid") {
1105
1105
  if (!uuidRegex.test(input.data)) {
1106
1106
  ctx = this._getOrReturnCtx(input, ctx);
1107
1107
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1108
1108
  validation: "uuid",
1109
1109
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1110
- message: check.message
1110
+ message: check2.message
1111
1111
  });
1112
- status2.dirty();
1112
+ status.dirty();
1113
1113
  }
1114
- } else if (check.kind === "nanoid") {
1114
+ } else if (check2.kind === "nanoid") {
1115
1115
  if (!nanoidRegex.test(input.data)) {
1116
1116
  ctx = this._getOrReturnCtx(input, ctx);
1117
1117
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1118
1118
  validation: "nanoid",
1119
1119
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1120
- message: check.message
1120
+ message: check2.message
1121
1121
  });
1122
- status2.dirty();
1122
+ status.dirty();
1123
1123
  }
1124
- } else if (check.kind === "cuid") {
1124
+ } else if (check2.kind === "cuid") {
1125
1125
  if (!cuidRegex.test(input.data)) {
1126
1126
  ctx = this._getOrReturnCtx(input, ctx);
1127
1127
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1128
1128
  validation: "cuid",
1129
1129
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1130
- message: check.message
1130
+ message: check2.message
1131
1131
  });
1132
- status2.dirty();
1132
+ status.dirty();
1133
1133
  }
1134
- } else if (check.kind === "cuid2") {
1134
+ } else if (check2.kind === "cuid2") {
1135
1135
  if (!cuid2Regex.test(input.data)) {
1136
1136
  ctx = this._getOrReturnCtx(input, ctx);
1137
1137
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1138
1138
  validation: "cuid2",
1139
1139
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1140
- message: check.message
1140
+ message: check2.message
1141
1141
  });
1142
- status2.dirty();
1142
+ status.dirty();
1143
1143
  }
1144
- } else if (check.kind === "ulid") {
1144
+ } else if (check2.kind === "ulid") {
1145
1145
  if (!ulidRegex.test(input.data)) {
1146
1146
  ctx = this._getOrReturnCtx(input, ctx);
1147
1147
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1148
1148
  validation: "ulid",
1149
1149
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1150
- message: check.message
1150
+ message: check2.message
1151
1151
  });
1152
- status2.dirty();
1152
+ status.dirty();
1153
1153
  }
1154
- } else if (check.kind === "url") {
1154
+ } else if (check2.kind === "url") {
1155
1155
  try {
1156
1156
  new URL(input.data);
1157
1157
  } catch {
@@ -1159,156 +1159,156 @@ function requireTypes() {
1159
1159
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1160
1160
  validation: "url",
1161
1161
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1162
- message: check.message
1162
+ message: check2.message
1163
1163
  });
1164
- status2.dirty();
1164
+ status.dirty();
1165
1165
  }
1166
- } else if (check.kind === "regex") {
1167
- check.regex.lastIndex = 0;
1168
- const testResult = check.regex.test(input.data);
1166
+ } else if (check2.kind === "regex") {
1167
+ check2.regex.lastIndex = 0;
1168
+ const testResult = check2.regex.test(input.data);
1169
1169
  if (!testResult) {
1170
1170
  ctx = this._getOrReturnCtx(input, ctx);
1171
1171
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1172
1172
  validation: "regex",
1173
1173
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1174
- message: check.message
1174
+ message: check2.message
1175
1175
  });
1176
- status2.dirty();
1176
+ status.dirty();
1177
1177
  }
1178
- } else if (check.kind === "trim") {
1178
+ } else if (check2.kind === "trim") {
1179
1179
  input.data = input.data.trim();
1180
- } else if (check.kind === "includes") {
1181
- if (!input.data.includes(check.value, check.position)) {
1180
+ } else if (check2.kind === "includes") {
1181
+ if (!input.data.includes(check2.value, check2.position)) {
1182
1182
  ctx = this._getOrReturnCtx(input, ctx);
1183
1183
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1184
1184
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1185
- validation: { includes: check.value, position: check.position },
1186
- message: check.message
1185
+ validation: { includes: check2.value, position: check2.position },
1186
+ message: check2.message
1187
1187
  });
1188
- status2.dirty();
1188
+ status.dirty();
1189
1189
  }
1190
- } else if (check.kind === "toLowerCase") {
1190
+ } else if (check2.kind === "toLowerCase") {
1191
1191
  input.data = input.data.toLowerCase();
1192
- } else if (check.kind === "toUpperCase") {
1192
+ } else if (check2.kind === "toUpperCase") {
1193
1193
  input.data = input.data.toUpperCase();
1194
- } else if (check.kind === "startsWith") {
1195
- if (!input.data.startsWith(check.value)) {
1194
+ } else if (check2.kind === "startsWith") {
1195
+ if (!input.data.startsWith(check2.value)) {
1196
1196
  ctx = this._getOrReturnCtx(input, ctx);
1197
1197
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1198
1198
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1199
- validation: { startsWith: check.value },
1200
- message: check.message
1199
+ validation: { startsWith: check2.value },
1200
+ message: check2.message
1201
1201
  });
1202
- status2.dirty();
1202
+ status.dirty();
1203
1203
  }
1204
- } else if (check.kind === "endsWith") {
1205
- if (!input.data.endsWith(check.value)) {
1204
+ } else if (check2.kind === "endsWith") {
1205
+ if (!input.data.endsWith(check2.value)) {
1206
1206
  ctx = this._getOrReturnCtx(input, ctx);
1207
1207
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1208
1208
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1209
- validation: { endsWith: check.value },
1210
- message: check.message
1209
+ validation: { endsWith: check2.value },
1210
+ message: check2.message
1211
1211
  });
1212
- status2.dirty();
1212
+ status.dirty();
1213
1213
  }
1214
- } else if (check.kind === "datetime") {
1215
- const regex = datetimeRegex(check);
1214
+ } else if (check2.kind === "datetime") {
1215
+ const regex = datetimeRegex(check2);
1216
1216
  if (!regex.test(input.data)) {
1217
1217
  ctx = this._getOrReturnCtx(input, ctx);
1218
1218
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1219
1219
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1220
1220
  validation: "datetime",
1221
- message: check.message
1221
+ message: check2.message
1222
1222
  });
1223
- status2.dirty();
1223
+ status.dirty();
1224
1224
  }
1225
- } else if (check.kind === "date") {
1225
+ } else if (check2.kind === "date") {
1226
1226
  const regex = dateRegex;
1227
1227
  if (!regex.test(input.data)) {
1228
1228
  ctx = this._getOrReturnCtx(input, ctx);
1229
1229
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1230
1230
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1231
1231
  validation: "date",
1232
- message: check.message
1232
+ message: check2.message
1233
1233
  });
1234
- status2.dirty();
1234
+ status.dirty();
1235
1235
  }
1236
- } else if (check.kind === "time") {
1237
- const regex = timeRegex(check);
1236
+ } else if (check2.kind === "time") {
1237
+ const regex = timeRegex(check2);
1238
1238
  if (!regex.test(input.data)) {
1239
1239
  ctx = this._getOrReturnCtx(input, ctx);
1240
1240
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1241
1241
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1242
1242
  validation: "time",
1243
- message: check.message
1243
+ message: check2.message
1244
1244
  });
1245
- status2.dirty();
1245
+ status.dirty();
1246
1246
  }
1247
- } else if (check.kind === "duration") {
1247
+ } else if (check2.kind === "duration") {
1248
1248
  if (!durationRegex.test(input.data)) {
1249
1249
  ctx = this._getOrReturnCtx(input, ctx);
1250
1250
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1251
1251
  validation: "duration",
1252
1252
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1253
- message: check.message
1253
+ message: check2.message
1254
1254
  });
1255
- status2.dirty();
1255
+ status.dirty();
1256
1256
  }
1257
- } else if (check.kind === "ip") {
1258
- if (!isValidIP(input.data, check.version)) {
1257
+ } else if (check2.kind === "ip") {
1258
+ if (!isValidIP(input.data, check2.version)) {
1259
1259
  ctx = this._getOrReturnCtx(input, ctx);
1260
1260
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1261
1261
  validation: "ip",
1262
1262
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1263
- message: check.message
1263
+ message: check2.message
1264
1264
  });
1265
- status2.dirty();
1265
+ status.dirty();
1266
1266
  }
1267
- } else if (check.kind === "jwt") {
1268
- if (!isValidJWT(input.data, check.alg)) {
1267
+ } else if (check2.kind === "jwt") {
1268
+ if (!isValidJWT(input.data, check2.alg)) {
1269
1269
  ctx = this._getOrReturnCtx(input, ctx);
1270
1270
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1271
1271
  validation: "jwt",
1272
1272
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1273
- message: check.message
1273
+ message: check2.message
1274
1274
  });
1275
- status2.dirty();
1275
+ status.dirty();
1276
1276
  }
1277
- } else if (check.kind === "cidr") {
1278
- if (!isValidCidr(input.data, check.version)) {
1277
+ } else if (check2.kind === "cidr") {
1278
+ if (!isValidCidr(input.data, check2.version)) {
1279
1279
  ctx = this._getOrReturnCtx(input, ctx);
1280
1280
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1281
1281
  validation: "cidr",
1282
1282
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1283
- message: check.message
1283
+ message: check2.message
1284
1284
  });
1285
- status2.dirty();
1285
+ status.dirty();
1286
1286
  }
1287
- } else if (check.kind === "base64") {
1287
+ } else if (check2.kind === "base64") {
1288
1288
  if (!base64Regex.test(input.data)) {
1289
1289
  ctx = this._getOrReturnCtx(input, ctx);
1290
1290
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1291
1291
  validation: "base64",
1292
1292
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1293
- message: check.message
1293
+ message: check2.message
1294
1294
  });
1295
- status2.dirty();
1295
+ status.dirty();
1296
1296
  }
1297
- } else if (check.kind === "base64url") {
1297
+ } else if (check2.kind === "base64url") {
1298
1298
  if (!base64urlRegex.test(input.data)) {
1299
1299
  ctx = this._getOrReturnCtx(input, ctx);
1300
1300
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1301
1301
  validation: "base64url",
1302
1302
  code: ZodError_js_1.ZodIssueCode.invalid_string,
1303
- message: check.message
1303
+ message: check2.message
1304
1304
  });
1305
- status2.dirty();
1305
+ status.dirty();
1306
1306
  }
1307
1307
  } else {
1308
- util_js_1.util.assertNever(check);
1308
+ util_js_1.util.assertNever(check2);
1309
1309
  }
1310
1310
  }
1311
- return { status: status2.value, value: input.data };
1311
+ return { status: status.value, value: input.data };
1312
1312
  }
1313
1313
  _regex(regex, validation, message2) {
1314
1314
  return this.refinement((data) => regex.test(data), {
@@ -1317,10 +1317,10 @@ function requireTypes() {
1317
1317
  ...errorUtil_js_1.errorUtil.errToObj(message2)
1318
1318
  });
1319
1319
  }
1320
- _addCheck(check) {
1320
+ _addCheck(check2) {
1321
1321
  return new ZodString({
1322
1322
  ...this._def,
1323
- checks: [...this._def.checks, check]
1323
+ checks: [...this._def.checks, check2]
1324
1324
  });
1325
1325
  }
1326
1326
  email(message2) {
@@ -1555,12 +1555,12 @@ function requireTypes() {
1555
1555
  ...processCreateParams(params)
1556
1556
  });
1557
1557
  };
1558
- function floatSafeRemainder(val, step) {
1558
+ function floatSafeRemainder(val, step3) {
1559
1559
  const valDecCount = (val.toString().split(".")[1] || "").length;
1560
- const stepDecCount = (step.toString().split(".")[1] || "").length;
1560
+ const stepDecCount = (step3.toString().split(".")[1] || "").length;
1561
1561
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1562
1562
  const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
1563
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
1563
+ const stepInt = Number.parseInt(step3.toFixed(decCount).replace(".", ""));
1564
1564
  return valInt % stepInt / 10 ** decCount;
1565
1565
  }
1566
1566
  class ZodNumber extends ZodType {
@@ -1585,71 +1585,71 @@ function requireTypes() {
1585
1585
  return parseUtil_js_1.INVALID;
1586
1586
  }
1587
1587
  let ctx = void 0;
1588
- const status2 = new parseUtil_js_1.ParseStatus();
1589
- for (const check of this._def.checks) {
1590
- if (check.kind === "int") {
1588
+ const status = new parseUtil_js_1.ParseStatus();
1589
+ for (const check2 of this._def.checks) {
1590
+ if (check2.kind === "int") {
1591
1591
  if (!util_js_1.util.isInteger(input.data)) {
1592
1592
  ctx = this._getOrReturnCtx(input, ctx);
1593
1593
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1594
1594
  code: ZodError_js_1.ZodIssueCode.invalid_type,
1595
1595
  expected: "integer",
1596
1596
  received: "float",
1597
- message: check.message
1597
+ message: check2.message
1598
1598
  });
1599
- status2.dirty();
1599
+ status.dirty();
1600
1600
  }
1601
- } else if (check.kind === "min") {
1602
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1601
+ } else if (check2.kind === "min") {
1602
+ const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
1603
1603
  if (tooSmall) {
1604
1604
  ctx = this._getOrReturnCtx(input, ctx);
1605
1605
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1606
1606
  code: ZodError_js_1.ZodIssueCode.too_small,
1607
- minimum: check.value,
1607
+ minimum: check2.value,
1608
1608
  type: "number",
1609
- inclusive: check.inclusive,
1609
+ inclusive: check2.inclusive,
1610
1610
  exact: false,
1611
- message: check.message
1611
+ message: check2.message
1612
1612
  });
1613
- status2.dirty();
1613
+ status.dirty();
1614
1614
  }
1615
- } else if (check.kind === "max") {
1616
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1615
+ } else if (check2.kind === "max") {
1616
+ const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
1617
1617
  if (tooBig) {
1618
1618
  ctx = this._getOrReturnCtx(input, ctx);
1619
1619
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1620
1620
  code: ZodError_js_1.ZodIssueCode.too_big,
1621
- maximum: check.value,
1621
+ maximum: check2.value,
1622
1622
  type: "number",
1623
- inclusive: check.inclusive,
1623
+ inclusive: check2.inclusive,
1624
1624
  exact: false,
1625
- message: check.message
1625
+ message: check2.message
1626
1626
  });
1627
- status2.dirty();
1627
+ status.dirty();
1628
1628
  }
1629
- } else if (check.kind === "multipleOf") {
1630
- if (floatSafeRemainder(input.data, check.value) !== 0) {
1629
+ } else if (check2.kind === "multipleOf") {
1630
+ if (floatSafeRemainder(input.data, check2.value) !== 0) {
1631
1631
  ctx = this._getOrReturnCtx(input, ctx);
1632
1632
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1633
1633
  code: ZodError_js_1.ZodIssueCode.not_multiple_of,
1634
- multipleOf: check.value,
1635
- message: check.message
1634
+ multipleOf: check2.value,
1635
+ message: check2.message
1636
1636
  });
1637
- status2.dirty();
1637
+ status.dirty();
1638
1638
  }
1639
- } else if (check.kind === "finite") {
1639
+ } else if (check2.kind === "finite") {
1640
1640
  if (!Number.isFinite(input.data)) {
1641
1641
  ctx = this._getOrReturnCtx(input, ctx);
1642
1642
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1643
1643
  code: ZodError_js_1.ZodIssueCode.not_finite,
1644
- message: check.message
1644
+ message: check2.message
1645
1645
  });
1646
- status2.dirty();
1646
+ status.dirty();
1647
1647
  }
1648
1648
  } else {
1649
- util_js_1.util.assertNever(check);
1649
+ util_js_1.util.assertNever(check2);
1650
1650
  }
1651
1651
  }
1652
- return { status: status2.value, value: input.data };
1652
+ return { status: status.value, value: input.data };
1653
1653
  }
1654
1654
  gte(value2, message2) {
1655
1655
  return this.setLimit("min", value2, true, errorUtil_js_1.errorUtil.toString(message2));
@@ -1677,10 +1677,10 @@ function requireTypes() {
1677
1677
  ]
1678
1678
  });
1679
1679
  }
1680
- _addCheck(check) {
1680
+ _addCheck(check2) {
1681
1681
  return new ZodNumber({
1682
1682
  ...this._def,
1683
- checks: [...this._def.checks, check]
1683
+ checks: [...this._def.checks, check2]
1684
1684
  });
1685
1685
  }
1686
1686
  int(message2) {
@@ -1815,49 +1815,49 @@ function requireTypes() {
1815
1815
  return this._getInvalidInput(input);
1816
1816
  }
1817
1817
  let ctx = void 0;
1818
- const status2 = new parseUtil_js_1.ParseStatus();
1819
- for (const check of this._def.checks) {
1820
- if (check.kind === "min") {
1821
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1818
+ const status = new parseUtil_js_1.ParseStatus();
1819
+ for (const check2 of this._def.checks) {
1820
+ if (check2.kind === "min") {
1821
+ const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
1822
1822
  if (tooSmall) {
1823
1823
  ctx = this._getOrReturnCtx(input, ctx);
1824
1824
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1825
1825
  code: ZodError_js_1.ZodIssueCode.too_small,
1826
1826
  type: "bigint",
1827
- minimum: check.value,
1828
- inclusive: check.inclusive,
1829
- message: check.message
1827
+ minimum: check2.value,
1828
+ inclusive: check2.inclusive,
1829
+ message: check2.message
1830
1830
  });
1831
- status2.dirty();
1831
+ status.dirty();
1832
1832
  }
1833
- } else if (check.kind === "max") {
1834
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1833
+ } else if (check2.kind === "max") {
1834
+ const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
1835
1835
  if (tooBig) {
1836
1836
  ctx = this._getOrReturnCtx(input, ctx);
1837
1837
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1838
1838
  code: ZodError_js_1.ZodIssueCode.too_big,
1839
1839
  type: "bigint",
1840
- maximum: check.value,
1841
- inclusive: check.inclusive,
1842
- message: check.message
1840
+ maximum: check2.value,
1841
+ inclusive: check2.inclusive,
1842
+ message: check2.message
1843
1843
  });
1844
- status2.dirty();
1844
+ status.dirty();
1845
1845
  }
1846
- } else if (check.kind === "multipleOf") {
1847
- if (input.data % check.value !== BigInt(0)) {
1846
+ } else if (check2.kind === "multipleOf") {
1847
+ if (input.data % check2.value !== BigInt(0)) {
1848
1848
  ctx = this._getOrReturnCtx(input, ctx);
1849
1849
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
1850
1850
  code: ZodError_js_1.ZodIssueCode.not_multiple_of,
1851
- multipleOf: check.value,
1852
- message: check.message
1851
+ multipleOf: check2.value,
1852
+ message: check2.message
1853
1853
  });
1854
- status2.dirty();
1854
+ status.dirty();
1855
1855
  }
1856
1856
  } else {
1857
- util_js_1.util.assertNever(check);
1857
+ util_js_1.util.assertNever(check2);
1858
1858
  }
1859
1859
  }
1860
- return { status: status2.value, value: input.data };
1860
+ return { status: status.value, value: input.data };
1861
1861
  }
1862
1862
  _getInvalidInput(input) {
1863
1863
  const ctx = this._getOrReturnCtx(input);
@@ -1894,10 +1894,10 @@ function requireTypes() {
1894
1894
  ]
1895
1895
  });
1896
1896
  }
1897
- _addCheck(check) {
1897
+ _addCheck(check2) {
1898
1898
  return new ZodBigInt({
1899
1899
  ...this._def,
1900
- checks: [...this._def.checks, check]
1900
+ checks: [...this._def.checks, check2]
1901
1901
  });
1902
1902
  }
1903
1903
  positive(message2) {
@@ -2017,48 +2017,48 @@ function requireTypes() {
2017
2017
  });
2018
2018
  return parseUtil_js_1.INVALID;
2019
2019
  }
2020
- const status2 = new parseUtil_js_1.ParseStatus();
2020
+ const status = new parseUtil_js_1.ParseStatus();
2021
2021
  let ctx = void 0;
2022
- for (const check of this._def.checks) {
2023
- if (check.kind === "min") {
2024
- if (input.data.getTime() < check.value) {
2022
+ for (const check2 of this._def.checks) {
2023
+ if (check2.kind === "min") {
2024
+ if (input.data.getTime() < check2.value) {
2025
2025
  ctx = this._getOrReturnCtx(input, ctx);
2026
2026
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
2027
2027
  code: ZodError_js_1.ZodIssueCode.too_small,
2028
- message: check.message,
2028
+ message: check2.message,
2029
2029
  inclusive: true,
2030
2030
  exact: false,
2031
- minimum: check.value,
2031
+ minimum: check2.value,
2032
2032
  type: "date"
2033
2033
  });
2034
- status2.dirty();
2034
+ status.dirty();
2035
2035
  }
2036
- } else if (check.kind === "max") {
2037
- if (input.data.getTime() > check.value) {
2036
+ } else if (check2.kind === "max") {
2037
+ if (input.data.getTime() > check2.value) {
2038
2038
  ctx = this._getOrReturnCtx(input, ctx);
2039
2039
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
2040
2040
  code: ZodError_js_1.ZodIssueCode.too_big,
2041
- message: check.message,
2041
+ message: check2.message,
2042
2042
  inclusive: true,
2043
2043
  exact: false,
2044
- maximum: check.value,
2044
+ maximum: check2.value,
2045
2045
  type: "date"
2046
2046
  });
2047
- status2.dirty();
2047
+ status.dirty();
2048
2048
  }
2049
2049
  } else {
2050
- util_js_1.util.assertNever(check);
2050
+ util_js_1.util.assertNever(check2);
2051
2051
  }
2052
2052
  }
2053
2053
  return {
2054
- status: status2.value,
2054
+ status: status.value,
2055
2055
  value: new Date(input.data.getTime())
2056
2056
  };
2057
2057
  }
2058
- _addCheck(check) {
2058
+ _addCheck(check2) {
2059
2059
  return new ZodDate({
2060
2060
  ...this._def,
2061
- checks: [...this._def.checks, check]
2061
+ checks: [...this._def.checks, check2]
2062
2062
  });
2063
2063
  }
2064
2064
  min(minDate, message2) {
@@ -2245,7 +2245,7 @@ function requireTypes() {
2245
2245
  };
2246
2246
  class ZodArray extends ZodType {
2247
2247
  _parse(input) {
2248
- const { ctx, status: status2 } = this._processInputParams(input);
2248
+ const { ctx, status } = this._processInputParams(input);
2249
2249
  const def = this._def;
2250
2250
  if (ctx.parsedType !== util_js_1.ZodParsedType.array) {
2251
2251
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
@@ -2268,7 +2268,7 @@ function requireTypes() {
2268
2268
  exact: true,
2269
2269
  message: def.exactLength.message
2270
2270
  });
2271
- status2.dirty();
2271
+ status.dirty();
2272
2272
  }
2273
2273
  }
2274
2274
  if (def.minLength !== null) {
@@ -2281,7 +2281,7 @@ function requireTypes() {
2281
2281
  exact: false,
2282
2282
  message: def.minLength.message
2283
2283
  });
2284
- status2.dirty();
2284
+ status.dirty();
2285
2285
  }
2286
2286
  }
2287
2287
  if (def.maxLength !== null) {
@@ -2294,20 +2294,20 @@ function requireTypes() {
2294
2294
  exact: false,
2295
2295
  message: def.maxLength.message
2296
2296
  });
2297
- status2.dirty();
2297
+ status.dirty();
2298
2298
  }
2299
2299
  }
2300
2300
  if (ctx.common.async) {
2301
2301
  return Promise.all([...ctx.data].map((item2, i) => {
2302
2302
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item2, ctx.path, i));
2303
2303
  })).then((result2) => {
2304
- return parseUtil_js_1.ParseStatus.mergeArray(status2, result2);
2304
+ return parseUtil_js_1.ParseStatus.mergeArray(status, result2);
2305
2305
  });
2306
2306
  }
2307
2307
  const result = [...ctx.data].map((item2, i) => {
2308
2308
  return def.type._parseSync(new ParseInputLazyPath(ctx, item2, ctx.path, i));
2309
2309
  });
2310
- return parseUtil_js_1.ParseStatus.mergeArray(status2, result);
2310
+ return parseUtil_js_1.ParseStatus.mergeArray(status, result);
2311
2311
  }
2312
2312
  get element() {
2313
2313
  return this._def.type;
@@ -2397,7 +2397,7 @@ function requireTypes() {
2397
2397
  });
2398
2398
  return parseUtil_js_1.INVALID;
2399
2399
  }
2400
- const { status: status2, ctx } = this._processInputParams(input);
2400
+ const { status, ctx } = this._processInputParams(input);
2401
2401
  const { shape, keys: shapeKeys } = this._getCached();
2402
2402
  const extraKeys = [];
2403
2403
  if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
@@ -2432,7 +2432,7 @@ function requireTypes() {
2432
2432
  code: ZodError_js_1.ZodIssueCode.unrecognized_keys,
2433
2433
  keys: extraKeys
2434
2434
  });
2435
- status2.dirty();
2435
+ status.dirty();
2436
2436
  }
2437
2437
  } else if (unknownKeys === "strip") ;
2438
2438
  else {
@@ -2466,10 +2466,10 @@ function requireTypes() {
2466
2466
  }
2467
2467
  return syncPairs;
2468
2468
  }).then((syncPairs) => {
2469
- return parseUtil_js_1.ParseStatus.mergeObjectSync(status2, syncPairs);
2469
+ return parseUtil_js_1.ParseStatus.mergeObjectSync(status, syncPairs);
2470
2470
  });
2471
2471
  } else {
2472
- return parseUtil_js_1.ParseStatus.mergeObjectSync(status2, pairs);
2472
+ return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);
2473
2473
  }
2474
2474
  }
2475
2475
  get shape() {
@@ -2950,7 +2950,7 @@ function requireTypes() {
2950
2950
  }
2951
2951
  class ZodIntersection extends ZodType {
2952
2952
  _parse(input) {
2953
- const { status: status2, ctx } = this._processInputParams(input);
2953
+ const { status, ctx } = this._processInputParams(input);
2954
2954
  const handleParsed = (parsedLeft, parsedRight) => {
2955
2955
  if ((0, parseUtil_js_1.isAborted)(parsedLeft) || (0, parseUtil_js_1.isAborted)(parsedRight)) {
2956
2956
  return parseUtil_js_1.INVALID;
@@ -2963,9 +2963,9 @@ function requireTypes() {
2963
2963
  return parseUtil_js_1.INVALID;
2964
2964
  }
2965
2965
  if ((0, parseUtil_js_1.isDirty)(parsedLeft) || (0, parseUtil_js_1.isDirty)(parsedRight)) {
2966
- status2.dirty();
2966
+ status.dirty();
2967
2967
  }
2968
- return { status: status2.value, value: merged.data };
2968
+ return { status: status.value, value: merged.data };
2969
2969
  };
2970
2970
  if (ctx.common.async) {
2971
2971
  return Promise.all([
@@ -3004,7 +3004,7 @@ function requireTypes() {
3004
3004
  };
3005
3005
  class ZodTuple extends ZodType {
3006
3006
  _parse(input) {
3007
- const { status: status2, ctx } = this._processInputParams(input);
3007
+ const { status, ctx } = this._processInputParams(input);
3008
3008
  if (ctx.parsedType !== util_js_1.ZodParsedType.array) {
3009
3009
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
3010
3010
  code: ZodError_js_1.ZodIssueCode.invalid_type,
@@ -3032,7 +3032,7 @@ function requireTypes() {
3032
3032
  exact: false,
3033
3033
  type: "array"
3034
3034
  });
3035
- status2.dirty();
3035
+ status.dirty();
3036
3036
  }
3037
3037
  const items2 = [...ctx.data].map((item2, itemIndex) => {
3038
3038
  const schema = this._def.items[itemIndex] || this._def.rest;
@@ -3042,10 +3042,10 @@ function requireTypes() {
3042
3042
  }).filter((x) => !!x);
3043
3043
  if (ctx.common.async) {
3044
3044
  return Promise.all(items2).then((results) => {
3045
- return parseUtil_js_1.ParseStatus.mergeArray(status2, results);
3045
+ return parseUtil_js_1.ParseStatus.mergeArray(status, results);
3046
3046
  });
3047
3047
  } else {
3048
- return parseUtil_js_1.ParseStatus.mergeArray(status2, items2);
3048
+ return parseUtil_js_1.ParseStatus.mergeArray(status, items2);
3049
3049
  }
3050
3050
  }
3051
3051
  get items() {
@@ -3078,7 +3078,7 @@ function requireTypes() {
3078
3078
  return this._def.valueType;
3079
3079
  }
3080
3080
  _parse(input) {
3081
- const { status: status2, ctx } = this._processInputParams(input);
3081
+ const { status, ctx } = this._processInputParams(input);
3082
3082
  if (ctx.parsedType !== util_js_1.ZodParsedType.object) {
3083
3083
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
3084
3084
  code: ZodError_js_1.ZodIssueCode.invalid_type,
@@ -3098,9 +3098,9 @@ function requireTypes() {
3098
3098
  });
3099
3099
  }
3100
3100
  if (ctx.common.async) {
3101
- return parseUtil_js_1.ParseStatus.mergeObjectAsync(status2, pairs);
3101
+ return parseUtil_js_1.ParseStatus.mergeObjectAsync(status, pairs);
3102
3102
  } else {
3103
- return parseUtil_js_1.ParseStatus.mergeObjectSync(status2, pairs);
3103
+ return parseUtil_js_1.ParseStatus.mergeObjectSync(status, pairs);
3104
3104
  }
3105
3105
  }
3106
3106
  get element() {
@@ -3132,7 +3132,7 @@ function requireTypes() {
3132
3132
  return this._def.valueType;
3133
3133
  }
3134
3134
  _parse(input) {
3135
- const { status: status2, ctx } = this._processInputParams(input);
3135
+ const { status, ctx } = this._processInputParams(input);
3136
3136
  if (ctx.parsedType !== util_js_1.ZodParsedType.map) {
3137
3137
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
3138
3138
  code: ZodError_js_1.ZodIssueCode.invalid_type,
@@ -3159,11 +3159,11 @@ function requireTypes() {
3159
3159
  return parseUtil_js_1.INVALID;
3160
3160
  }
3161
3161
  if (key.status === "dirty" || value2.status === "dirty") {
3162
- status2.dirty();
3162
+ status.dirty();
3163
3163
  }
3164
3164
  finalMap.set(key.value, value2.value);
3165
3165
  }
3166
- return { status: status2.value, value: finalMap };
3166
+ return { status: status.value, value: finalMap };
3167
3167
  });
3168
3168
  } else {
3169
3169
  const finalMap = /* @__PURE__ */ new Map();
@@ -3174,11 +3174,11 @@ function requireTypes() {
3174
3174
  return parseUtil_js_1.INVALID;
3175
3175
  }
3176
3176
  if (key.status === "dirty" || value2.status === "dirty") {
3177
- status2.dirty();
3177
+ status.dirty();
3178
3178
  }
3179
3179
  finalMap.set(key.value, value2.value);
3180
3180
  }
3181
- return { status: status2.value, value: finalMap };
3181
+ return { status: status.value, value: finalMap };
3182
3182
  }
3183
3183
  }
3184
3184
  }
@@ -3193,7 +3193,7 @@ function requireTypes() {
3193
3193
  };
3194
3194
  class ZodSet extends ZodType {
3195
3195
  _parse(input) {
3196
- const { status: status2, ctx } = this._processInputParams(input);
3196
+ const { status, ctx } = this._processInputParams(input);
3197
3197
  if (ctx.parsedType !== util_js_1.ZodParsedType.set) {
3198
3198
  (0, parseUtil_js_1.addIssueToContext)(ctx, {
3199
3199
  code: ZodError_js_1.ZodIssueCode.invalid_type,
@@ -3213,7 +3213,7 @@ function requireTypes() {
3213
3213
  exact: false,
3214
3214
  message: def.minSize.message
3215
3215
  });
3216
- status2.dirty();
3216
+ status.dirty();
3217
3217
  }
3218
3218
  }
3219
3219
  if (def.maxSize !== null) {
@@ -3226,7 +3226,7 @@ function requireTypes() {
3226
3226
  exact: false,
3227
3227
  message: def.maxSize.message
3228
3228
  });
3229
- status2.dirty();
3229
+ status.dirty();
3230
3230
  }
3231
3231
  }
3232
3232
  const valueType = this._def.valueType;
@@ -3236,10 +3236,10 @@ function requireTypes() {
3236
3236
  if (element.status === "aborted")
3237
3237
  return parseUtil_js_1.INVALID;
3238
3238
  if (element.status === "dirty")
3239
- status2.dirty();
3239
+ status.dirty();
3240
3240
  parsedSet.add(element.value);
3241
3241
  }
3242
- return { status: status2.value, value: parsedSet };
3242
+ return { status: status.value, value: parsedSet };
3243
3243
  }
3244
3244
  const elements = [...ctx.data.values()].map((item2, i) => valueType._parse(new ParseInputLazyPath(ctx, item2, ctx.path, i)));
3245
3245
  if (ctx.common.async) {
@@ -3577,15 +3577,15 @@ function requireTypes() {
3577
3577
  return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3578
3578
  }
3579
3579
  _parse(input) {
3580
- const { status: status2, ctx } = this._processInputParams(input);
3580
+ const { status, ctx } = this._processInputParams(input);
3581
3581
  const effect = this._def.effect || null;
3582
3582
  const checkCtx = {
3583
3583
  addIssue: (arg) => {
3584
3584
  (0, parseUtil_js_1.addIssueToContext)(ctx, arg);
3585
3585
  if (arg.fatal) {
3586
- status2.abort();
3586
+ status.abort();
3587
3587
  } else {
3588
- status2.dirty();
3588
+ status.dirty();
3589
3589
  }
3590
3590
  },
3591
3591
  get path() {
@@ -3597,7 +3597,7 @@ function requireTypes() {
3597
3597
  const processed = effect.transform(ctx.data, checkCtx);
3598
3598
  if (ctx.common.async) {
3599
3599
  return Promise.resolve(processed).then(async (processed2) => {
3600
- if (status2.value === "aborted")
3600
+ if (status.value === "aborted")
3601
3601
  return parseUtil_js_1.INVALID;
3602
3602
  const result = await this._def.schema._parseAsync({
3603
3603
  data: processed2,
@@ -3608,12 +3608,12 @@ function requireTypes() {
3608
3608
  return parseUtil_js_1.INVALID;
3609
3609
  if (result.status === "dirty")
3610
3610
  return (0, parseUtil_js_1.DIRTY)(result.value);
3611
- if (status2.value === "dirty")
3611
+ if (status.value === "dirty")
3612
3612
  return (0, parseUtil_js_1.DIRTY)(result.value);
3613
3613
  return result;
3614
3614
  });
3615
3615
  } else {
3616
- if (status2.value === "aborted")
3616
+ if (status.value === "aborted")
3617
3617
  return parseUtil_js_1.INVALID;
3618
3618
  const result = this._def.schema._parseSync({
3619
3619
  data: processed,
@@ -3624,7 +3624,7 @@ function requireTypes() {
3624
3624
  return parseUtil_js_1.INVALID;
3625
3625
  if (result.status === "dirty")
3626
3626
  return (0, parseUtil_js_1.DIRTY)(result.value);
3627
- if (status2.value === "dirty")
3627
+ if (status.value === "dirty")
3628
3628
  return (0, parseUtil_js_1.DIRTY)(result.value);
3629
3629
  return result;
3630
3630
  }
@@ -3649,17 +3649,17 @@ function requireTypes() {
3649
3649
  if (inner2.status === "aborted")
3650
3650
  return parseUtil_js_1.INVALID;
3651
3651
  if (inner2.status === "dirty")
3652
- status2.dirty();
3652
+ status.dirty();
3653
3653
  executeRefinement(inner2.value);
3654
- return { status: status2.value, value: inner2.value };
3654
+ return { status: status.value, value: inner2.value };
3655
3655
  } else {
3656
3656
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner2) => {
3657
3657
  if (inner2.status === "aborted")
3658
3658
  return parseUtil_js_1.INVALID;
3659
3659
  if (inner2.status === "dirty")
3660
- status2.dirty();
3660
+ status.dirty();
3661
3661
  return executeRefinement(inner2.value).then(() => {
3662
- return { status: status2.value, value: inner2.value };
3662
+ return { status: status.value, value: inner2.value };
3663
3663
  });
3664
3664
  });
3665
3665
  }
@@ -3677,13 +3677,13 @@ function requireTypes() {
3677
3677
  if (result instanceof Promise) {
3678
3678
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3679
3679
  }
3680
- return { status: status2.value, value: result };
3680
+ return { status: status.value, value: result };
3681
3681
  } else {
3682
3682
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3683
3683
  if (!(0, parseUtil_js_1.isValid)(base))
3684
3684
  return parseUtil_js_1.INVALID;
3685
3685
  return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3686
- status: status2.value,
3686
+ status: status.value,
3687
3687
  value: result
3688
3688
  }));
3689
3689
  });
@@ -3870,7 +3870,7 @@ function requireTypes() {
3870
3870
  types.ZodBranded = ZodBranded;
3871
3871
  class ZodPipeline extends ZodType {
3872
3872
  _parse(input) {
3873
- const { status: status2, ctx } = this._processInputParams(input);
3873
+ const { status, ctx } = this._processInputParams(input);
3874
3874
  if (ctx.common.async) {
3875
3875
  const handleAsync = async () => {
3876
3876
  const inResult = await this._def.in._parseAsync({
@@ -3881,7 +3881,7 @@ function requireTypes() {
3881
3881
  if (inResult.status === "aborted")
3882
3882
  return parseUtil_js_1.INVALID;
3883
3883
  if (inResult.status === "dirty") {
3884
- status2.dirty();
3884
+ status.dirty();
3885
3885
  return (0, parseUtil_js_1.DIRTY)(inResult.value);
3886
3886
  } else {
3887
3887
  return this._def.out._parseAsync({
@@ -3901,7 +3901,7 @@ function requireTypes() {
3901
3901
  if (inResult.status === "aborted")
3902
3902
  return parseUtil_js_1.INVALID;
3903
3903
  if (inResult.status === "dirty") {
3904
- status2.dirty();
3904
+ status.dirty();
3905
3905
  return {
3906
3906
  status: "dirty",
3907
3907
  value: inResult.value
@@ -3952,10 +3952,10 @@ function requireTypes() {
3952
3952
  const p2 = typeof p === "string" ? { message: p } : p;
3953
3953
  return p2;
3954
3954
  }
3955
- function custom(check, _params = {}, fatal) {
3956
- if (check)
3955
+ function custom(check2, _params = {}, fatal) {
3956
+ if (check2)
3957
3957
  return ZodAny.create().superRefine((data, ctx) => {
3958
- const r = check(data);
3958
+ const r = check2(data);
3959
3959
  if (r instanceof Promise) {
3960
3960
  return r.then((r2) => {
3961
3961
  if (!r2) {
@@ -4252,7 +4252,7 @@ function requireCatalog() {
4252
4252
  hasRequiredCatalog = 1;
4253
4253
  (function(exports) {
4254
4254
  Object.defineProperty(exports, "__esModule", { value: true });
4255
- exports.CatalogReadQuery = exports.ListProductsQuery = exports.RecommendationsResponse = exports.ProductListResponse = exports.Product = exports.SizeGuide = exports.ProductPromo = exports.ProductVariant = void 0;
4255
+ exports.CatalogReadQuery = exports.ListProductsQuery = exports.RecommendationsResponse = exports.ProductListResponse = exports.Product = exports.SizeGuide = exports.SizeGuideMeasurement = exports.SizeChartUnit = exports.ProductPromo = exports.ProductVariant = void 0;
4256
4256
  const zod_1 = /* @__PURE__ */ requireZod();
4257
4257
  const money_1 = requireMoney();
4258
4258
  const common_1 = requireCommon();
@@ -4276,12 +4276,40 @@ function requireCatalog() {
4276
4276
  /** ISO-8601 end time that drives the countdown; absent = show the message, no timer. */
4277
4277
  ends_at: common_1.Timestamp.optional()
4278
4278
  });
4279
+ exports.SizeChartUnit = zod_1.z.enum(["cm", "in"]);
4280
+ exports.SizeGuideMeasurement = zod_1.z.object({
4281
+ /** e.g. "Chest width". */
4282
+ label: zod_1.z.string().min(1),
4283
+ /** e.g. "Measured 2.5 cm below the armhole, garment flat." */
4284
+ description: zod_1.z.string().min(1)
4285
+ });
4279
4286
  exports.SizeGuide = zod_1.z.object({
4280
4287
  title: zod_1.z.string(),
4281
- /** Column headings for `rows`, e.g. `['Size', 'Chest (cm)', 'Length (cm)']`. */
4288
+ /** The fit this chart is for, e.g. "Oversized hoodies and zip-ups · Unisex". */
4289
+ subtitle: zod_1.z.string().min(1).optional(),
4290
+ /**
4291
+ * Column headings for `rows`, e.g. `['Size', 'Chest', 'Length']`.
4292
+ *
4293
+ * Bare nouns, with no unit in the heading: the unit belongs to the whole chart and is
4294
+ * named by `unit`, so that a consumer converting to the other unit does not leave
4295
+ * "Chest (cm)" written above a column of inches.
4296
+ */
4282
4297
  columns: zod_1.z.array(zod_1.z.string()).optional(),
4283
4298
  /** One row per size; each row's length matches `columns`. */
4284
4299
  rows: zod_1.z.array(zod_1.z.array(zod_1.z.string())).optional(),
4300
+ /**
4301
+ * The unit `rows` are written in.
4302
+ *
4303
+ * Absent means the numbers carry no declared unit — a consumer must then show them as
4304
+ * they are and offer no conversion, because it has nothing to convert from.
4305
+ */
4306
+ unit: exports.SizeChartUnit.optional(),
4307
+ /** The line under the table, e.g. "All measurements are taken from the garment laid flat, not from the body." */
4308
+ note: zod_1.z.string().min(1).optional(),
4309
+ /** The "How to measure" list. Absent/empty = the section is not drawn. */
4310
+ measurements: zod_1.z.array(exports.SizeGuideMeasurement).optional(),
4311
+ /** The fabric line, e.g. "100% cotton · 220–240 GSM · Oversized fit · Sizes XS–XL". */
4312
+ fabric: zod_1.z.string().min(1).optional(),
4285
4313
  /** Free-text fit guidance, e.g. "Relaxed, slightly oversized fit". */
4286
4314
  notes: zod_1.z.array(zod_1.z.string()).optional()
4287
4315
  });
@@ -4336,7 +4364,7 @@ function requireContent() {
4336
4364
  hasRequiredContent = 1;
4337
4365
  (function(exports) {
4338
4366
  Object.defineProperty(exports, "__esModule", { value: true });
4339
- exports.HomeContent = exports.HomeSlide = exports.CategoryPage = exports.CategoryBlock = exports.ExploreBlock = exports.WhyUsBlock = exports.ReviewBlock = exports.GridBlock = exports.LifestyleImageBlock = exports.FeaturedBlock = exports.LifestyleTextBlock = exports.RailBlock = exports.CategoryHero = void 0;
4367
+ exports.HomeContent = exports.HomeSlide = exports.CategoryPage = exports.CategoryBlock = exports.ProductGalleryBlock = exports.ExploreBlock = exports.WhyUsBlock = exports.ReviewBlock = exports.GridBlock = exports.LifestyleImageBlock = exports.FeaturedBlock = exports.LifestyleTextBlock = exports.RailBlock = exports.CategoryHero = void 0;
4340
4368
  const zod_1 = /* @__PURE__ */ requireZod();
4341
4369
  const common_1 = requireCommon();
4342
4370
  const catalog_1 = requireCatalog();
@@ -4366,7 +4394,7 @@ function requireContent() {
4366
4394
  });
4367
4395
  exports.GridBlock = zod_1.z.object({
4368
4396
  kind: zod_1.z.literal("grid"),
4369
- title: zod_1.z.string(),
4397
+ title: zod_1.z.string().min(1).optional(),
4370
4398
  products: zod_1.z.array(catalog_1.Product)
4371
4399
  });
4372
4400
  exports.ReviewBlock = zod_1.z.object({
@@ -4387,10 +4415,16 @@ function requireContent() {
4387
4415
  title: zod_1.z.string(),
4388
4416
  links: zod_1.z.array(zod_1.z.object({ label: zod_1.z.string(), code: zod_1.z.string() })).min(1)
4389
4417
  });
4418
+ exports.ProductGalleryBlock = zod_1.z.object({
4419
+ kind: zod_1.z.literal("product_gallery"),
4420
+ title: zod_1.z.string().min(1),
4421
+ product: catalog_1.Product
4422
+ });
4390
4423
  exports.CategoryBlock = zod_1.z.discriminatedUnion("kind", [
4391
4424
  exports.RailBlock,
4392
4425
  exports.LifestyleTextBlock,
4393
4426
  exports.FeaturedBlock,
4427
+ exports.ProductGalleryBlock,
4394
4428
  exports.LifestyleImageBlock,
4395
4429
  exports.GridBlock,
4396
4430
  exports.ReviewBlock,
@@ -4483,7 +4517,7 @@ function requireCart() {
4483
4517
  hasRequiredCart = 1;
4484
4518
  (function(exports) {
4485
4519
  Object.defineProperty(exports, "__esModule", { value: true });
4486
- exports.PartnerCart = exports.PartnerCartItem = exports.CartHandoffResponse = exports.UpdateCartItemRequest = exports.AddCartItemRequest = exports.Cart = exports.HiddenSummaryLine = exports.CartLock = exports.CartLockReason = exports.CartTotals = exports.CartItem = void 0;
4520
+ exports.PartnerCart = exports.PartnerCartItem = exports.CartHandoffResponse = exports.UpdateCartItemRequest = exports.AddCartItemRequest = exports.Cart = exports.HiddenSummaryLine = exports.CartHold = exports.CartLock = exports.CartLockReason = exports.CartTotals = exports.CartItem = void 0;
4487
4521
  const zod_1 = /* @__PURE__ */ requireZod();
4488
4522
  const money_1 = requireMoney();
4489
4523
  const ids_1 = requireIds();
@@ -4494,6 +4528,24 @@ function requireCart() {
4494
4528
  qty: zod_1.z.number().int().positive(),
4495
4529
  unit_price: money_1.Money,
4496
4530
  line_total: money_1.Money,
4531
+ /**
4532
+ * The undiscounted per-unit price, from the catalogue. Display only.
4533
+ *
4534
+ * Drawn as a struck-through figure under what the line costs now, with a `-NN%` badge
4535
+ * over the thumbnail — Figma's cart draws every discounted line that way and, until
4536
+ * this field existed, a consumer had no way to. The saving was simply invisible in the
4537
+ * basket and appeared for the first time at checkout.
4538
+ *
4539
+ * Absent means the line is at full price, which is the ordinary case. Present only when
4540
+ * it is strictly greater than `unit_price`: a compare-at equal to or below the live
4541
+ * price is not a sale, and drawing one would be an invented discount.
4542
+ *
4543
+ * **The catalogue's figure, not an order's.** `OrderItem.compare_at_unit_price` is the
4544
+ * one DAZN sent at intake and is frozen there, because a receipt whose struck price
4545
+ * moves next week is not a receipt. A cart is live, so this one moves with
4546
+ * merchandising — that is correct here and wrong there.
4547
+ */
4548
+ compare_at_unit_price: money_1.Money.optional(),
4497
4549
  /**
4498
4550
  * Product title for this line, e.g. "Signature Hoodie".
4499
4551
  *
@@ -4538,7 +4590,22 @@ function requireCart() {
4538
4590
  */
4539
4591
  available: zod_1.z.number().int().nonnegative().optional()
4540
4592
  });
4541
- exports.CartTotals = common_1.Pricing;
4593
+ exports.CartTotals = common_1.Pricing.extend({
4594
+ /**
4595
+ * What came off across the whole basket, as a **positive** amount. Absent means nothing
4596
+ * did; a zero is never sent.
4597
+ *
4598
+ * Positive rather than signed, and the surface that draws it owns the minus sign —
4599
+ * exactly as `OrderTotals.discount` does. A signed field invites a reader to add it to a
4600
+ * running total, and nothing here is a running total: every figure is server-computed
4601
+ * and `total` is never derived by a consumer from the parts.
4602
+ *
4603
+ * Kept out of `subtotal` deliberately. The design lists a subtotal and a discount as two
4604
+ * rows because the fan is owed both figures, and folding the saving into the subtotal
4605
+ * loses the one they came for.
4606
+ */
4607
+ discount: money_1.Money.optional()
4608
+ });
4542
4609
  exports.CartLockReason = zod_1.z.enum(["checkout_handoff"]);
4543
4610
  exports.CartLock = zod_1.z.object({
4544
4611
  since: zod_1.z.string().datetime(),
@@ -4546,6 +4613,10 @@ function requireCart() {
4546
4613
  expires_at: zod_1.z.string().datetime().optional(),
4547
4614
  reason: exports.CartLockReason
4548
4615
  });
4616
+ exports.CartHold = zod_1.z.object({
4617
+ taken_at: zod_1.z.string().datetime(),
4618
+ expires_at: zod_1.z.string().datetime()
4619
+ });
4549
4620
  exports.HiddenSummaryLine = zod_1.z.enum(["tax", "shipping"]);
4550
4621
  exports.Cart = zod_1.z.object({
4551
4622
  cart_id: ids_1.CartId,
@@ -4557,6 +4628,13 @@ function requireCart() {
4557
4628
  * consumer that has never heard of locking is unaffected.
4558
4629
  */
4559
4630
  locked: exports.CartLock.optional(),
4631
+ /**
4632
+ * Stock held for this cart while it sits in checkout. Absent = nothing held.
4633
+ *
4634
+ * Additive, and a consumer that has never heard of it is unaffected: the cart behaves
4635
+ * exactly as it did, and the hold does its work server-side either way.
4636
+ */
4637
+ hold: exports.CartHold.optional(),
4560
4638
  /**
4561
4639
  * Summary rows to leave undrawn, resolved server-side from the CMS setting.
4562
4640
  *
@@ -4702,6 +4780,12 @@ function requireOrders() {
4702
4780
  * never used to price, and never shown on a picking list.
4703
4781
  */
4704
4782
  customer_ref: zod_1.z.string().min(1),
4783
+ /**
4784
+ * The fan's own name, for support and the order queue. Optional, and absent on every
4785
+ * order placed before DAZN began sending it — the surfaces fall back to the recipient's
4786
+ * name rather than showing a blank, which is what they did for all of them until now.
4787
+ */
4788
+ name: zod_1.z.string().min(1).optional(),
4705
4789
  /**
4706
4790
  * For carrier despatch notifications only. Optional because not every market's carrier
4707
4791
  * takes one, and an address is what actually ships the parcel.
@@ -4819,7 +4903,7 @@ function requireOrderTracking() {
4819
4903
  hasRequiredOrderTracking = 1;
4820
4904
  (function(exports) {
4821
4905
  Object.defineProperty(exports, "__esModule", { value: true });
4822
- exports.OrderDetail = exports.OrderList = exports.OrderSummaryItem = exports.OrderItem = exports.OrderTracking = exports.OrderProgressEntry = exports.OrderProgressStep = void 0;
4906
+ exports.ReturnDetail = exports.ReturnItem = exports.ReturnProgressEntry = exports.CreateReturnRequest = exports.ReturnRequestItem = exports.FanReturnReason = exports.RequestCancellationRequest = exports.FanCancelReason = exports.OrderDetail = exports.ReturnSummary = exports.ReturnStatus = exports.OrderList = exports.OrderSummaryItem = exports.OrderItem = exports.OrderTracking = exports.OrderProgressEntry = exports.OrderProgressStep = void 0;
4823
4907
  const zod_1 = /* @__PURE__ */ requireZod();
4824
4908
  const money_1 = requireMoney();
4825
4909
  const ids_1 = requireIds();
@@ -4898,6 +4982,12 @@ function requireOrderTracking() {
4898
4982
  exports.OrderList = zod_1.z.object({
4899
4983
  orders: zod_1.z.array(exports.OrderSummaryItem)
4900
4984
  });
4985
+ exports.ReturnStatus = zod_1.z.enum(["reported", "package_received", "completed"]);
4986
+ exports.ReturnSummary = zod_1.z.object({
4987
+ return_ref: zod_1.z.string().min(1),
4988
+ status: exports.ReturnStatus,
4989
+ reported_at: common_1.Timestamp
4990
+ });
4901
4991
  exports.OrderDetail = zod_1.z.object({
4902
4992
  order_ref: ids_1.OrderRef,
4903
4993
  placed_at: common_1.Timestamp,
@@ -4923,7 +5013,72 @@ function requireOrderTracking() {
4923
5013
  ship_to: common_1.Address,
4924
5014
  payment: orders_1.OrderPaymentSummary.optional(),
4925
5015
  /** Exactly what DAZN charged, echoed. Never recomputed here. */
4926
- totals: orders_1.OrderTotals
5016
+ totals: orders_1.OrderTotals,
5017
+ /**
5018
+ * Whether this order can still be cancelled, and whether it can be returned.
5019
+ *
5020
+ * **Decided by the engine and sent, not derived by the consumer from `status`.** The
5021
+ * rule involves a dispatch cut-off and a returns window that a screen has no way of
5022
+ * knowing, and two consumers deriving it independently would disagree the day either
5023
+ * moves. Absent means no — an older engine that has never heard of either draws
5024
+ * neither button, which is the safe way round for an action that cannot be undone.
5025
+ */
5026
+ can_cancel: zod_1.z.boolean().optional(),
5027
+ can_return: zod_1.z.boolean().optional(),
5028
+ /** Returns already reported against this order. Absent/empty = none. */
5029
+ returns: zod_1.z.array(exports.ReturnSummary).optional()
5030
+ });
5031
+ exports.FanCancelReason = zod_1.z.enum([
5032
+ "changed_my_mind",
5033
+ "ordered_by_mistake",
5034
+ "delivery_too_long"
5035
+ ]);
5036
+ exports.RequestCancellationRequest = zod_1.z.object({ reason: exports.FanCancelReason }).strict();
5037
+ exports.FanReturnReason = zod_1.z.enum([
5038
+ "too_large",
5039
+ "too_small",
5040
+ "arrived_too_late",
5041
+ "item_damaged",
5042
+ "not_as_described",
5043
+ "changed_my_mind"
5044
+ ]);
5045
+ exports.ReturnRequestItem = zod_1.z.object({
5046
+ line_ref: zod_1.z.string().min(1),
5047
+ qty: zod_1.z.number().int().positive(),
5048
+ reason: exports.FanReturnReason
5049
+ });
5050
+ exports.CreateReturnRequest = zod_1.z.object({ items: zod_1.z.array(exports.ReturnRequestItem).min(1) }).strict();
5051
+ exports.ReturnProgressEntry = zod_1.z.object({
5052
+ step: exports.ReturnStatus,
5053
+ label: zod_1.z.string().min(1),
5054
+ /** When the step completed. Absent = not reached yet, never a projected date. */
5055
+ at: common_1.Timestamp.optional(),
5056
+ current: zod_1.z.boolean()
5057
+ });
5058
+ exports.ReturnItem = zod_1.z.object({
5059
+ line_ref: zod_1.z.string().min(1),
5060
+ sku: common_1.Sku,
5061
+ qty: zod_1.z.number().int().positive(),
5062
+ reason: exports.FanReturnReason,
5063
+ unit_price: money_1.Money,
5064
+ compare_at_unit_price: money_1.Money.optional(),
5065
+ title: zod_1.z.string().optional(),
5066
+ image: common_1.Url.optional(),
5067
+ attributes: common_1.Attributes.optional()
5068
+ });
5069
+ exports.ReturnDetail = zod_1.z.object({
5070
+ return_ref: zod_1.z.string().min(1),
5071
+ order_ref: ids_1.OrderRef,
5072
+ status: exports.ReturnStatus,
5073
+ reported_at: common_1.Timestamp,
5074
+ progress: zod_1.z.array(exports.ReturnProgressEntry).min(1),
5075
+ items: zod_1.z.array(exports.ReturnItem).min(1),
5076
+ label_url: common_1.Url.optional(),
5077
+ /**
5078
+ * Where the label PDF was sent, for the frame's "You'll receive a shipping label PDF to
5079
+ * your email as well" line. PII, like `OrderDetail.email`: render it, never log it.
5080
+ */
5081
+ label_email: zod_1.z.string().email().optional()
4927
5082
  });
4928
5083
  })(orderTracking);
4929
5084
  return orderTracking;
@@ -5098,10 +5253,10 @@ function requireClient() {
5098
5253
  code;
5099
5254
  requestId;
5100
5255
  body;
5101
- constructor(status2, parsed) {
5102
- super(parsed?.error.message ?? `DAZN API error (HTTP ${status2})`);
5256
+ constructor(status, parsed) {
5257
+ super(parsed?.error.message ?? `DAZN API error (HTTP ${status})`);
5103
5258
  this.name = "DaznApiError";
5104
- this.status = status2;
5259
+ this.status = status;
5105
5260
  this.code = parsed?.error.code;
5106
5261
  this.requestId = parsed?.request_id;
5107
5262
  this.body = parsed?.error;
@@ -5132,8 +5287,8 @@ function requireClient() {
5132
5287
  ...options2.defaultHeaders,
5133
5288
  ...config.headers
5134
5289
  };
5135
- const body2 = config.body === void 0 && config.method === "POST" ? {} : config.body;
5136
- if (body2 !== void 0)
5290
+ const body3 = config.body === void 0 && config.method === "POST" ? {} : config.body;
5291
+ if (body3 !== void 0)
5137
5292
  headers["content-type"] = "application/json";
5138
5293
  if (token)
5139
5294
  headers["authorization"] = `Bearer ${token}`;
@@ -5141,7 +5296,7 @@ function requireClient() {
5141
5296
  method: config.method,
5142
5297
  headers,
5143
5298
  credentials: options2.credentials ?? "include",
5144
- body: body2 !== void 0 ? JSON.stringify(body2) : void 0
5299
+ body: body3 !== void 0 ? JSON.stringify(body3) : void 0
5145
5300
  });
5146
5301
  if (!res.ok) {
5147
5302
  let parsed;
@@ -5234,11 +5389,11 @@ function requireClient() {
5234
5389
  cart: {
5235
5390
  create: () => request({ method: "POST", path: "/cart", schema: cart_1.Cart }),
5236
5391
  get: () => request({ method: "GET", path: "/cart", schema: cart_1.Cart }),
5237
- addItem: (body2) => request({ method: "POST", path: "/cart/items", body: body2, schema: cart_1.Cart }),
5238
- updateItem: (sku, body2) => request({
5392
+ addItem: (body3) => request({ method: "POST", path: "/cart/items", body: body3, schema: cart_1.Cart }),
5393
+ updateItem: (sku, body3) => request({
5239
5394
  method: "PATCH",
5240
5395
  path: `/cart/items/${encodeURIComponent(sku)}`,
5241
- body: body2,
5396
+ body: body3,
5242
5397
  schema: cart_1.Cart
5243
5398
  }),
5244
5399
  removeItem: (sku) => request({
@@ -5264,7 +5419,7 @@ function requireClient() {
5264
5419
  */
5265
5420
  stockAlerts: {
5266
5421
  /** "Remind me when available" — idempotent per SKU for the session's principal. */
5267
- create: (body2) => request({ method: "POST", path: "/stock-alerts", body: body2, schema: stock_alerts_1.StockAlert })
5422
+ create: (body3) => request({ method: "POST", path: "/stock-alerts", body: body3, schema: stock_alerts_1.StockAlert })
5268
5423
  },
5269
5424
  orders: {
5270
5425
  list: () => request({ method: "GET", path: "/orders", schema: order_tracking_1.OrderList }),
@@ -5272,6 +5427,32 @@ function requireClient() {
5272
5427
  method: "GET",
5273
5428
  path: `/orders/${encodeURIComponent(orderRef)}`,
5274
5429
  schema: order_tracking_1.OrderDetail
5430
+ }),
5431
+ /**
5432
+ * Ask for the order to be cancelled (ADR-0024). Returns the order as it now stands.
5433
+ *
5434
+ * A request, not a refund: DAZN are merchant of record and the money is theirs to
5435
+ * move. This records the fan's ask and hands it on.
5436
+ */
5437
+ requestCancellation: (orderRef, body3) => request({
5438
+ method: "POST",
5439
+ path: `/orders/${encodeURIComponent(orderRef)}/cancellation`,
5440
+ body: body3,
5441
+ schema: order_tracking_1.OrderDetail
5442
+ }),
5443
+ /** Report items coming back, and get the return — including its label when ready. */
5444
+ createReturn: (orderRef, body3) => request({
5445
+ method: "POST",
5446
+ path: `/orders/${encodeURIComponent(orderRef)}/returns`,
5447
+ body: body3,
5448
+ schema: order_tracking_1.ReturnDetail
5449
+ })
5450
+ },
5451
+ returns: {
5452
+ get: (returnRef) => request({
5453
+ method: "GET",
5454
+ path: `/returns/${encodeURIComponent(returnRef)}`,
5455
+ schema: order_tracking_1.ReturnDetail
5275
5456
  })
5276
5457
  },
5277
5458
  /**
@@ -5288,24 +5469,24 @@ function requireClient() {
5288
5469
  */
5289
5470
  uploadAttachment: (file) => upload("/support/attachments", file, support_1.SupportAttachment),
5290
5471
  /** File the ticket. Repeating an identical one within a few minutes returns the first. */
5291
- createTicket: (body2) => request({ method: "POST", path: "/support/tickets", body: body2, schema: support_1.SupportTicket })
5472
+ createTicket: (body3) => request({ method: "POST", path: "/support/tickets", body: body3, schema: support_1.SupportTicket })
5292
5473
  },
5293
5474
  auth: {
5294
5475
  /** Exchange a single-use DAZN identity JWT for a session (sets the cookie). */
5295
- exchangeSession: (body2) => request({
5476
+ exchangeSession: (body3) => request({
5296
5477
  method: "POST",
5297
5478
  path: "/auth/session",
5298
- body: body2,
5479
+ body: body3,
5299
5480
  schema: session_1.SessionExchangeResponse
5300
5481
  }),
5301
5482
  /**
5302
5483
  * Redeem the `session` + `code` a DAZN redirect arrives with (sets the cookie).
5303
5484
  * The entry path from the DAZN app; see `ShopSessionRequest`.
5304
5485
  */
5305
- redeemShopSession: (body2) => request({
5486
+ redeemShopSession: (body3) => request({
5306
5487
  method: "POST",
5307
5488
  path: "/auth/shop-session",
5308
- body: body2,
5489
+ body: body3,
5309
5490
  schema: session_1.ShopSessionResponse
5310
5491
  })
5311
5492
  }
@@ -5385,26 +5566,28 @@ function DaznShopProvider({
5385
5566
  listeners.current.delete(listener);
5386
5567
  };
5387
5568
  }, []);
5388
- const emit = useCallback(
5389
- (event) => {
5390
- for (const listener of listeners.current) {
5391
- try {
5392
- listener(event);
5393
- } catch {
5394
- }
5395
- }
5569
+ const onEventRef = useRef(onEvent);
5570
+ onEventRef.current = onEvent;
5571
+ const getTokenRef = useRef(getToken);
5572
+ getTokenRef.current = getToken;
5573
+ const stableGetToken = useCallback(() => getTokenRef.current(), []);
5574
+ const emit = useCallback((event) => {
5575
+ for (const listener of listeners.current) {
5396
5576
  try {
5397
- onEvent?.(event);
5577
+ listener(event);
5398
5578
  } catch {
5399
5579
  }
5400
- },
5401
- [onEvent]
5402
- );
5580
+ }
5581
+ try {
5582
+ onEventRef.current?.(event);
5583
+ } catch {
5584
+ }
5585
+ }, []);
5403
5586
  const api = useMemo(
5404
5587
  () => clientExports.createClient({
5405
5588
  baseUrl: apiBaseUrl,
5406
- getToken,
5407
- fetch: createShopFetch({ getToken, onEvent, sessionTransport }),
5589
+ getToken: stableGetToken,
5590
+ fetch: createShopFetch({ getToken: stableGetToken, onEvent: emit, sessionTransport }),
5408
5591
  /**
5409
5592
  * Mounted in a host's page we are cross-origin with the API and hold no cookie,
5410
5593
  * so `omit` is right and the bearer token is the whole session story.
@@ -5416,9 +5599,10 @@ function DaznShopProvider({
5416
5599
  */
5417
5600
  credentials: sessionTransport === "cookie" ? "include" : "omit"
5418
5601
  }),
5419
- // `onEvent` is intentionally absent see `emit` above.
5420
- // eslint-disable-next-line react-hooks/exhaustive-deps
5421
- [apiBaseUrl, getToken, sessionTransport]
5602
+ // Only the two things that genuinely change the client. `stableGetToken` and `emit`
5603
+ // are stable for the provider's lifetime by construction — see the refs above — so a
5604
+ // host's re-render can no longer drop every in-flight request.
5605
+ [apiBaseUrl, stableGetToken, emit, sessionTransport]
5422
5606
  );
5423
5607
  const navigate = useCallback(
5424
5608
  (to) => {
@@ -5535,29 +5719,29 @@ function ShopImage({
5535
5719
  }
5536
5720
  );
5537
5721
  }
5538
- const badge$4 = "_badge_1bagf_1";
5722
+ const badge$5 = "_badge_1bagf_1";
5539
5723
  const neutral$1 = "_neutral_1bagf_12";
5540
5724
  const success$1 = "_success_1bagf_17";
5541
5725
  const critical$1 = "_critical_1bagf_22";
5542
5726
  const promo = "_promo_1bagf_27";
5543
- const styles$I = {
5544
- badge: badge$4,
5727
+ const styles$P = {
5728
+ badge: badge$5,
5545
5729
  neutral: neutral$1,
5546
5730
  success: success$1,
5547
5731
  critical: critical$1,
5548
5732
  promo
5549
5733
  };
5550
5734
  function Badge({ tone = "neutral", children }) {
5551
- return /* @__PURE__ */ jsx("span", { className: [styles$I.badge, styles$I[tone]].join(" "), children });
5552
- }
5553
- const button$1 = "_button_tdhm8_1";
5554
- const fullWidth = "_fullWidth_tdhm8_25";
5555
- const primary = "_primary_tdhm8_29";
5556
- const secondary = "_secondary_tdhm8_34";
5557
- const ghost = "_ghost_tdhm8_40";
5558
- const spinner = "_spinner_tdhm8_62";
5559
- const spin = "_spin_tdhm8_62";
5560
- const styles$H = {
5735
+ return /* @__PURE__ */ jsx("span", { className: [styles$P.badge, styles$P[tone]].join(" "), children });
5736
+ }
5737
+ const button$1 = "_button_1u2uh_1";
5738
+ const fullWidth = "_fullWidth_1u2uh_25";
5739
+ const primary = "_primary_1u2uh_29";
5740
+ const secondary = "_secondary_1u2uh_34";
5741
+ const ghost = "_ghost_1u2uh_40";
5742
+ const spinner = "_spinner_1u2uh_83";
5743
+ const spin = "_spin_1u2uh_83";
5744
+ const styles$O = {
5561
5745
  button: button$1,
5562
5746
  fullWidth,
5563
5747
  primary,
@@ -5583,23 +5767,23 @@ const Button = forwardRef(function Button2({
5583
5767
  ref,
5584
5768
  type,
5585
5769
  className: [
5586
- styles$H.button,
5587
- styles$H[variant],
5588
- fullWidth2 ? styles$H.fullWidth : "",
5770
+ styles$O.button,
5771
+ styles$O[variant],
5772
+ fullWidth2 ? styles$O.fullWidth : "",
5589
5773
  className ?? ""
5590
5774
  ].filter(Boolean).join(" "),
5591
5775
  disabled: isDisabled,
5592
5776
  "aria-busy": loading || void 0,
5593
5777
  ...rest,
5594
5778
  children: [
5595
- loading && /* @__PURE__ */ jsx("span", { className: styles$H.spinner, "aria-hidden": "true" }),
5779
+ loading && /* @__PURE__ */ jsx("span", { className: styles$O.spinner, "aria-hidden": "true" }),
5596
5780
  /* @__PURE__ */ jsx("span", { children })
5597
5781
  ]
5598
5782
  }
5599
5783
  );
5600
5784
  });
5601
5785
  const skeleton = "_skeleton_1nxz7_1";
5602
- const styles$G = {
5786
+ const styles$N = {
5603
5787
  skeleton
5604
5788
  };
5605
5789
  function Skeleton({ width, height, radius, className, circle }) {
@@ -5612,24 +5796,32 @@ function Skeleton({ width, height, radius, className, circle }) {
5612
5796
  "span",
5613
5797
  {
5614
5798
  "aria-hidden": "true",
5615
- className: [styles$G.skeleton, className ?? ""].filter(Boolean).join(" "),
5799
+ className: [styles$N.skeleton, className ?? ""].filter(Boolean).join(" "),
5616
5800
  style
5617
5801
  }
5618
5802
  );
5619
5803
  }
5620
5804
  const surface$1 = "_surface_cfqo9_10";
5621
5805
  const fill = "_fill_cfqo9_35";
5622
- const styles$F = {
5806
+ const styles$M = {
5623
5807
  surface: surface$1,
5624
5808
  fill
5625
5809
  };
5810
+ function offsetFromViewportTop(el) {
5811
+ let top = el.getBoundingClientRect().top;
5812
+ for (let node = el.parentElement; node; node = node.parentElement) {
5813
+ top += node.scrollTop;
5814
+ if (getComputedStyle(node).position === "fixed") break;
5815
+ }
5816
+ const offset = Math.max(0, Math.round(top));
5817
+ return offset >= window.innerHeight ? 0 : offset;
5818
+ }
5626
5819
  function useTopOffset(ref, property, enabled = true) {
5627
5820
  useEffect(() => {
5628
5821
  const el = ref.current;
5629
5822
  if (!el || !enabled) return;
5630
5823
  const measure = () => {
5631
- const top = Math.max(0, Math.round(el.getBoundingClientRect().top + window.scrollY));
5632
- el.style.setProperty(property, `${top}px`);
5824
+ el.style.setProperty(property, `${offsetFromViewportTop(el)}px`);
5633
5825
  };
5634
5826
  measure();
5635
5827
  window.addEventListener("resize", measure);
@@ -5660,7 +5852,7 @@ const ShopSurface = forwardRef(function ShopSurface2({ tone, fill: fill2 = false
5660
5852
  ...rest,
5661
5853
  ref: attach,
5662
5854
  "data-shop-theme": tone,
5663
- className: [styles$F.surface, fill2 ? styles$F.fill : "", className ?? ""].filter(Boolean).join(" "),
5855
+ className: [styles$M.surface, fill2 ? styles$M.fill : "", className ?? ""].filter(Boolean).join(" "),
5664
5856
  children
5665
5857
  }
5666
5858
  );
@@ -5668,52 +5860,56 @@ const ShopSurface = forwardRef(function ShopSurface2({ tone, fill: fill2 = false
5668
5860
  const root$6 = "_root_ney0g_1";
5669
5861
  const inner = "_inner_ney0g_6";
5670
5862
  const media$3 = "_media_ney0g_20";
5671
- const lines$3 = "_lines_ney0g_32";
5863
+ const lines$2 = "_lines_ney0g_32";
5672
5864
  const lineWide = "_lineWide_ney0g_41";
5673
5865
  const lineMid = "_lineMid_ney0g_45";
5674
5866
  const lineNarrow = "_lineNarrow_ney0g_49";
5675
- const row$8 = "_row_ney0g_53";
5867
+ const row$9 = "_row_ney0g_53";
5676
5868
  const action$2 = "_action_ney0g_57";
5677
- const styles$E = {
5869
+ const styles$L = {
5678
5870
  root: root$6,
5679
5871
  inner,
5680
5872
  media: media$3,
5681
- lines: lines$3,
5873
+ lines: lines$2,
5682
5874
  lineWide,
5683
5875
  lineMid,
5684
5876
  lineNarrow,
5685
- row: row$8,
5877
+ row: row$9,
5686
5878
  action: action$2
5687
5879
  };
5688
5880
  function ScreenSkeleton({ tone, shape = "media" }) {
5689
- return /* @__PURE__ */ jsx(ShopSurface, { tone, fill: true, className: styles$E.root, children: /* @__PURE__ */ jsx("div", { className: styles$E.inner, role: "status", "aria-label": "Loading", children: shape === "media" ? /* @__PURE__ */ jsxs(Fragment, { children: [
5690
- /* @__PURE__ */ jsx(Skeleton, { className: styles$E.media }),
5691
- /* @__PURE__ */ jsxs("div", { className: styles$E.lines, children: [
5692
- /* @__PURE__ */ jsx(Skeleton, { height: 22, className: styles$E.lineWide }),
5693
- /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$E.lineMid }),
5694
- /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$E.lineNarrow })
5881
+ return /* @__PURE__ */ jsx(ShopSurface, { tone, fill: true, className: styles$L.root, children: /* @__PURE__ */ jsx("div", { className: styles$L.inner, role: "status", "aria-label": "Loading", children: shape === "media" ? /* @__PURE__ */ jsxs(Fragment, { children: [
5882
+ /* @__PURE__ */ jsx(Skeleton, { className: styles$L.media }),
5883
+ /* @__PURE__ */ jsxs("div", { className: styles$L.lines, children: [
5884
+ /* @__PURE__ */ jsx(Skeleton, { height: 22, className: styles$L.lineWide }),
5885
+ /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$L.lineMid }),
5886
+ /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$L.lineNarrow })
5695
5887
  ] }),
5696
- /* @__PURE__ */ jsx(Skeleton, { height: 48, radius: 8, className: styles$E.action })
5697
- ] }) : /* @__PURE__ */ jsx("div", { className: styles$E.lines, children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(Skeleton, { height: 72, className: styles$E.row }, i)) }) }) });
5698
- }
5699
- const root$5 = "_root_1u83t_1";
5700
- const icon$4 = "_icon_1u83t_10";
5701
- const title$j = "_title_1u83t_15";
5702
- const body$5 = "_body_1u83t_20";
5703
- const action$1 = "_action_1u83t_33";
5704
- const styles$D = {
5888
+ /* @__PURE__ */ jsx(Skeleton, { height: 48, radius: 8, className: styles$L.action })
5889
+ ] }) : /* @__PURE__ */ jsx("div", { className: styles$L.lines, children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(Skeleton, { height: 72, className: styles$L.row }, i)) }) }) });
5890
+ }
5891
+ const root$5 = "_root_ryf3q_6";
5892
+ const icon$4 = "_icon_ryf3q_15";
5893
+ const text$5 = "_text_ryf3q_21";
5894
+ const title$n = "_title_ryf3q_35";
5895
+ const body$8 = "_body_ryf3q_40";
5896
+ const action$1 = "_action_ryf3q_48";
5897
+ const styles$K = {
5705
5898
  root: root$5,
5706
5899
  icon: icon$4,
5707
- title: title$j,
5708
- body: body$5,
5900
+ text: text$5,
5901
+ title: title$n,
5902
+ body: body$8,
5709
5903
  action: action$1
5710
5904
  };
5711
- function EmptyState({ title: title2, body: body2, action: action2, icon: icon2 }) {
5712
- return /* @__PURE__ */ jsxs("div", { className: styles$D.root, role: "status", children: [
5713
- icon2 && /* @__PURE__ */ jsx("div", { className: styles$D.icon, children: icon2 }),
5714
- /* @__PURE__ */ jsx("h2", { className: styles$D.title, children: title2 }),
5715
- body2 && /* @__PURE__ */ jsx("p", { className: styles$D.body, children: body2 }),
5716
- action2 && /* @__PURE__ */ jsx("div", { className: styles$D.action, children: action2 })
5905
+ function EmptyState({ title: title2, body: body3, action: action2, icon: icon2 }) {
5906
+ return /* @__PURE__ */ jsxs("div", { className: styles$K.root, role: "status", children: [
5907
+ icon2 && /* @__PURE__ */ jsx("div", { className: styles$K.icon, children: icon2 }),
5908
+ /* @__PURE__ */ jsxs("div", { className: styles$K.text, children: [
5909
+ /* @__PURE__ */ jsx("h2", { className: styles$K.title, children: title2 }),
5910
+ body3 && /* @__PURE__ */ jsx("p", { className: styles$K.body, children: body3 })
5911
+ ] }),
5912
+ action2 && /* @__PURE__ */ jsx("div", { className: styles$K.action, children: action2 })
5717
5913
  ] });
5718
5914
  }
5719
5915
  const TREATMENTS = {
@@ -5784,9 +5980,13 @@ const TREATMENTS = {
5784
5980
  /**
5785
5981
  * Codes a fan cannot reach, kept because this map is exhaustive over `ErrorCode`.
5786
5982
  *
5787
- * `order_not_found` and `order_not_cancellable` belong to order intake, which DAZN
5788
- * calls server to server; `forbidden` and `invalid_transition` belong to the operations
5789
- * console. None of them can arrive on a storefront request.
5983
+ * `forbidden` and `invalid_transition` belong to the operations console and cannot
5984
+ * arrive on a storefront request.
5985
+ *
5986
+ * `order_not_found` and `order_not_cancellable` no longer belong to that list, and this
5987
+ * comment used to say they did. Both are fan-facing now: ADR-0024 gave us the cancel and
5988
+ * return requests, and the engine raises `order_not_cancellable` for a cancellation past
5989
+ * the dispatch cut-off AND for a return outside the window.
5790
5990
  *
5791
5991
  * They are given real copy rather than a shrug because the alternative is worse: this
5792
5992
  * map is a `Record<ErrorCode, …>` precisely so a new code fails the build here and gets
@@ -5850,19 +6050,19 @@ function isDuplicateOrder(err) {
5850
6050
  return codeOf(err) === "duplicate_order";
5851
6051
  }
5852
6052
  const root$4 = "_root_1lbpx_1";
5853
- const title$i = "_title_1lbpx_10";
5854
- const body$4 = "_body_1lbpx_15";
5855
- const styles$C = {
6053
+ const title$m = "_title_1lbpx_10";
6054
+ const body$7 = "_body_1lbpx_15";
6055
+ const styles$J = {
5856
6056
  root: root$4,
5857
- title: title$i,
5858
- body: body$4
6057
+ title: title$m,
6058
+ body: body$7
5859
6059
  };
5860
- function ErrorState({ code, title: title2, body: body2, onRetry, retryLabel }) {
6060
+ function ErrorState({ code, title: title2, body: body3, onRetry, retryLabel }) {
5861
6061
  const treatment = treatmentFor(code);
5862
6062
  const showRetry = Boolean(onRetry) && treatment.retriable;
5863
- return /* @__PURE__ */ jsxs("div", { className: styles$C.root, role: "alert", children: [
5864
- /* @__PURE__ */ jsx("h2", { className: styles$C.title, children: title2 ?? treatment.title }),
5865
- /* @__PURE__ */ jsx("p", { className: styles$C.body, children: body2 ?? treatment.body }),
6063
+ return /* @__PURE__ */ jsxs("div", { className: styles$J.root, role: "alert", children: [
6064
+ /* @__PURE__ */ jsx("h2", { className: styles$J.title, children: title2 ?? treatment.title }),
6065
+ /* @__PURE__ */ jsx("p", { className: styles$J.body, children: body3 ?? treatment.body }),
5866
6066
  showRetry && /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onRetry, children: retryLabel ?? "Try again" })
5867
6067
  ] });
5868
6068
  }
@@ -5882,9 +6082,9 @@ const STATUS_TONE = {
5882
6082
  cancelled: "critical",
5883
6083
  refunded: "critical"
5884
6084
  };
5885
- function StatusBadge({ status: status2 }) {
5886
- const tone = STATUS_TONE[status2] ?? "neutral";
5887
- const label2 = STATUS_LABEL[status2] ?? status2;
6085
+ function StatusBadge({ status }) {
6086
+ const tone = STATUS_TONE[status] ?? "neutral";
6087
+ const label2 = STATUS_LABEL[status] ?? status;
5888
6088
  return /* @__PURE__ */ jsx(Badge, { tone, children: label2 });
5889
6089
  }
5890
6090
  const viewport = "_viewport_5aafz_14";
@@ -5899,9 +6099,9 @@ const success = "_success_5aafz_163";
5899
6099
  const critical = "_critical_5aafz_168";
5900
6100
  const rich = "_rich_5aafz_183";
5901
6101
  const description = "_description_5aafz_198";
5902
- const thumb$2 = "_thumb_5aafz_216";
6102
+ const thumb$3 = "_thumb_5aafz_216";
5903
6103
  const thumbImage = "_thumbImage_5aafz_227";
5904
- const styles$B = {
6104
+ const styles$I = {
5905
6105
  viewport,
5906
6106
  anchor,
5907
6107
  caret,
@@ -5914,7 +6114,7 @@ const styles$B = {
5914
6114
  critical,
5915
6115
  rich,
5916
6116
  description,
5917
- thumb: thumb$2,
6117
+ thumb: thumb$3,
5918
6118
  thumbImage
5919
6119
  };
5920
6120
  const ToastContext = createContext(null);
@@ -6011,35 +6211,35 @@ function ToastProvider({ children }) {
6011
6211
  const api = useMemo(() => ({ show }), [show]);
6012
6212
  return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: api, children: [
6013
6213
  children,
6014
- /* @__PURE__ */ jsx("div", { className: styles$B.viewport, ref: viewportRef, "aria-live": "polite", "aria-atomic": "false", children: toasts.map((t) => {
6214
+ /* @__PURE__ */ jsx("div", { className: styles$I.viewport, ref: viewportRef, "aria-live": "polite", "aria-atomic": "false", children: toasts.map((t) => {
6015
6215
  const rich2 = Boolean(t.description || t.image);
6016
- return /* @__PURE__ */ jsxs("div", { className: styles$B.anchor, children: [
6017
- t.anchor === "cart" && /* @__PURE__ */ jsx("span", { className: styles$B.caret, children: /* @__PURE__ */ jsx(Caret, {}) }),
6216
+ return /* @__PURE__ */ jsxs("div", { className: styles$I.anchor, children: [
6217
+ t.anchor === "cart" && /* @__PURE__ */ jsx("span", { className: styles$I.caret, children: /* @__PURE__ */ jsx(Caret, {}) }),
6018
6218
  /* @__PURE__ */ jsxs(
6019
6219
  "div",
6020
6220
  {
6021
- className: [styles$B.toast, rich2 ? styles$B.rich : styles$B[t.tone]].join(" "),
6221
+ className: [styles$I.toast, rich2 ? styles$I.rich : styles$I[t.tone]].join(" "),
6022
6222
  role: "status",
6023
6223
  children: [
6024
- t.image && /* @__PURE__ */ jsx("span", { className: styles$B.thumb, children: /* @__PURE__ */ jsx(
6224
+ t.image && /* @__PURE__ */ jsx("span", { className: styles$I.thumb, children: /* @__PURE__ */ jsx(
6025
6225
  ShopImage,
6026
6226
  {
6027
6227
  src: t.image,
6028
6228
  alt: "",
6029
6229
  fill: true,
6030
6230
  sizes: "40px",
6031
- className: styles$B.thumbImage
6231
+ className: styles$I.thumbImage
6032
6232
  }
6033
6233
  ) }),
6034
- /* @__PURE__ */ jsxs("span", { className: styles$B.text, children: [
6035
- /* @__PURE__ */ jsx("span", { className: styles$B.message, children: t.message }),
6036
- t.description && /* @__PURE__ */ jsx("span", { className: styles$B.description, children: t.description })
6234
+ /* @__PURE__ */ jsxs("span", { className: styles$I.text, children: [
6235
+ /* @__PURE__ */ jsx("span", { className: styles$I.message, children: t.message }),
6236
+ t.description && /* @__PURE__ */ jsx("span", { className: styles$I.description, children: t.description })
6037
6237
  ] }),
6038
6238
  t.action && /* @__PURE__ */ jsx(
6039
6239
  "button",
6040
6240
  {
6041
6241
  type: "button",
6042
- className: styles$B.action,
6242
+ className: styles$I.action,
6043
6243
  onClick: () => {
6044
6244
  t.action?.onAction();
6045
6245
  dismiss(t.id);
@@ -6100,15 +6300,15 @@ function useLocale(override) {
6100
6300
  const shop = useShopOptional();
6101
6301
  return override ?? shop?.locale ?? shop?.market?.lang ?? (typeof navigator !== "undefined" ? navigator.language : void 0);
6102
6302
  }
6103
- const badge$3 = "_badge_156ya_2";
6303
+ const badge$4 = "_badge_156ya_2";
6104
6304
  const icon$3 = "_icon_156ya_18";
6105
- const styles$A = {
6106
- badge: badge$3,
6305
+ const styles$H = {
6306
+ badge: badge$4,
6107
6307
  icon: icon$3
6108
6308
  };
6109
6309
  function SaleBadge({ pct }) {
6110
- return /* @__PURE__ */ jsxs("span", { className: styles$A.badge, children: [
6111
- /* @__PURE__ */ jsxs("svg", { className: styles$A.icon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
6310
+ return /* @__PURE__ */ jsxs("span", { className: styles$H.badge, children: [
6311
+ /* @__PURE__ */ jsxs("svg", { className: styles$H.icon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
6112
6312
  /* @__PURE__ */ jsx(
6113
6313
  "path",
6114
6314
  {
@@ -6125,23 +6325,25 @@ function SaleBadge({ pct }) {
6125
6325
  "%"
6126
6326
  ] });
6127
6327
  }
6128
- const root$3 = "_root_n3nm5_1";
6129
- const center$1 = "_center_n3nm5_10";
6130
- const end = "_end_n3nm5_14";
6131
- const sm = "_sm_n3nm5_21";
6132
- const md = "_md_n3nm5_24";
6133
- const lg = "_lg_n3nm5_27";
6134
- const price$1 = "_price_n3nm5_31";
6135
- const compareAt = "_compareAt_n3nm5_36";
6136
- const strikethrough = "_strikethrough_n3nm5_44";
6137
- const styles$z = {
6328
+ const root$3 = "_root_rvfx9_1";
6329
+ const center$1 = "_center_rvfx9_10";
6330
+ const end = "_end_rvfx9_14";
6331
+ const sm = "_sm_rvfx9_28";
6332
+ const md = "_md_rvfx9_32";
6333
+ const lg = "_lg_rvfx9_36";
6334
+ const badge$3 = "_badge_rvfx9_48";
6335
+ const price$4 = "_price_rvfx9_52";
6336
+ const compareAt = "_compareAt_rvfx9_57";
6337
+ const strikethrough = "_strikethrough_rvfx9_65";
6338
+ const styles$G = {
6138
6339
  root: root$3,
6139
6340
  center: center$1,
6140
6341
  end,
6141
6342
  sm,
6142
6343
  md,
6143
6344
  lg,
6144
- price: price$1,
6345
+ badge: badge$3,
6346
+ price: price$4,
6145
6347
  compareAt,
6146
6348
  strikethrough
6147
6349
  };
@@ -6156,15 +6358,130 @@ function PriceBlock({
6156
6358
  const { format } = useMoney();
6157
6359
  const pct = discountPct$1 ?? discountPct(price2, compareAt2);
6158
6360
  const hasCompare = compareAt2 && compareAt2.amount > price2.amount;
6159
- return /* @__PURE__ */ jsxs("div", { className: [styles$z.root, styles$z[size], styles$z[align], styles$z[variant]].join(" "), children: [
6160
- /* @__PURE__ */ jsx("span", { className: styles$z.price, children: format(price2) }),
6161
- hasCompare && /* @__PURE__ */ jsxs("span", { className: styles$z.compareAt, children: [
6361
+ return /* @__PURE__ */ jsxs("div", { className: [styles$G.root, styles$G[size], styles$G[align], styles$G[variant]].join(" "), children: [
6362
+ /* @__PURE__ */ jsx("span", { className: styles$G.price, children: format(price2) }),
6363
+ hasCompare && /* @__PURE__ */ jsxs("span", { className: styles$G.compareAt, children: [
6162
6364
  /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(compareAt2)}` }),
6163
6365
  /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(compareAt2) })
6164
6366
  ] }),
6165
6367
  hasCompare && variant === "badge" && pct !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct })
6166
6368
  ] });
6167
6369
  }
6370
+ const timeline = "_timeline_1cum7_7";
6371
+ const row$8 = "_row_1cum7_15";
6372
+ const line$3 = "_line_1cum7_20";
6373
+ const marker = "_marker_1cum7_27";
6374
+ const tick = "_tick_1cum7_35";
6375
+ const pending$2 = "_pending_1cum7_44";
6376
+ const connector = "_connector_1cum7_68";
6377
+ const text$3 = "_text_1cum7_84";
6378
+ const label$2 = "_label_1cum7_101";
6379
+ const past = "_past_1cum7_113";
6380
+ const current = "_current_1cum7_118";
6381
+ const future = "_future_1cum7_133";
6382
+ const date$1 = "_date_1cum7_138";
6383
+ const styles$F = {
6384
+ timeline,
6385
+ row: row$8,
6386
+ line: line$3,
6387
+ marker,
6388
+ tick,
6389
+ pending: pending$2,
6390
+ connector,
6391
+ text: text$3,
6392
+ label: label$2,
6393
+ past,
6394
+ current,
6395
+ future,
6396
+ date: date$1
6397
+ };
6398
+ function OrderTimeline({
6399
+ progress: progress2,
6400
+ estimatedDelivery,
6401
+ locale: localeProp
6402
+ }) {
6403
+ const locale = useLocale(localeProp);
6404
+ const currentIndex = progress2.findIndex((e) => e.current);
6405
+ return /* @__PURE__ */ jsx("ol", { className: styles$F.timeline, children: progress2.map((entry, i) => {
6406
+ const state = stateOf(entry, i, currentIndex);
6407
+ const estimate = !entry.at && i === progress2.length - 1 && estimatedDelivery ? formatWindow(estimatedDelivery, locale) : void 0;
6408
+ return /* @__PURE__ */ jsxs(
6409
+ "li",
6410
+ {
6411
+ className: styles$F.row,
6412
+ "aria-current": entry.current ? "step" : void 0,
6413
+ children: [
6414
+ /* @__PURE__ */ jsxs("div", { className: styles$F.line, children: [
6415
+ /* @__PURE__ */ jsx("span", { className: styles$F.marker, children: state === "future" ? /* @__PURE__ */ jsx("span", { className: styles$F.pending, "aria-hidden": "true" }) : /* @__PURE__ */ jsx(StepTick, { tone: state }) }),
6416
+ /* @__PURE__ */ jsxs("span", { className: styles$F.text, children: [
6417
+ /* @__PURE__ */ jsx("span", { className: [styles$F.label, styles$F[state]].join(" "), children: entry.label }),
6418
+ entry.at ? /* @__PURE__ */ jsx("time", { className: styles$F.date, dateTime: entry.at, children: formatStepDate(entry.at, locale) }) : estimate && /* @__PURE__ */ jsx("span", { className: styles$F.date, children: estimate })
6419
+ ] })
6420
+ ] }),
6421
+ i < progress2.length - 1 && /* @__PURE__ */ jsx("span", { className: styles$F.connector, "aria-hidden": "true" })
6422
+ ]
6423
+ },
6424
+ entry.step
6425
+ );
6426
+ }) });
6427
+ }
6428
+ function stateOf(entry, index, currentIndex) {
6429
+ if (entry.current) return "current";
6430
+ if (currentIndex === -1) return entry.at ? "past" : "future";
6431
+ return index < currentIndex ? "past" : "future";
6432
+ }
6433
+ function StepTick({ tone }) {
6434
+ return /* @__PURE__ */ jsxs(
6435
+ "svg",
6436
+ {
6437
+ className: styles$F.tick,
6438
+ width: "28",
6439
+ height: "28",
6440
+ viewBox: "0 0 28 28",
6441
+ fill: "none",
6442
+ "aria-hidden": "true",
6443
+ children: [
6444
+ /* @__PURE__ */ jsx(
6445
+ "path",
6446
+ {
6447
+ d: "M14 1C21.1797 1 27 6.8203 27 14C27 21.1797 21.1797 27 14 27C6.8203 27 1 21.1797 1 14C1 6.8203 6.8203 1 14 1Z",
6448
+ fill: "#F9FAFA",
6449
+ stroke: "#F9FAFA",
6450
+ strokeWidth: "2"
6451
+ }
6452
+ ),
6453
+ /* @__PURE__ */ jsx(
6454
+ "path",
6455
+ {
6456
+ d: "M13.9943 26C12.3436 26 10.7913 25.6856 9.33743 25.0568C7.89115 24.4356 6.61903 23.5758 5.52106 22.4773C4.4231 21.3788 3.55987 20.1061 2.93138 18.6591C2.31046 17.2045 2 15.6515 2 14C2 12.3409 2.31046 10.7879 2.93138 9.34091C3.55987 7.88636 4.4231 6.60985 5.52106 5.51136C6.61903 4.41288 7.89115 3.55303 9.33743 2.93182C10.7913 2.31061 12.3436 2 13.9943 2C15.6526 2 17.2049 2.31061 18.6512 2.93182C20.1051 3.55303 21.381 4.41288 22.4789 5.51136C23.5769 6.60985 24.4363 7.88636 25.0573 9.34091C25.6858 10.7879 26 12.3409 26 14C26 15.6515 25.6858 17.2045 25.0573 18.6591C24.4363 20.1061 23.5769 21.3788 22.4789 22.4773C21.381 23.5758 20.1051 24.4356 18.6512 25.0568C17.2049 25.6856 15.6526 26 13.9943 26ZM12.7449 19.6932C12.9948 19.6932 13.222 19.6364 13.4264 19.5227C13.6384 19.4015 13.8202 19.2311 13.9716 19.0114L19.2532 10.9432C19.3441 10.7992 19.416 10.6515 19.469 10.5C19.5296 10.3485 19.5599 10.2008 19.5599 10.0568C19.5599 9.70833 19.4274 9.42045 19.1623 9.19318C18.9049 8.96591 18.6058 8.85227 18.265 8.85227C17.8183 8.85227 17.4434 9.0947 17.1406 9.57955L12.7222 16.6136L10.7345 14.1818C10.5831 13.9924 10.424 13.8561 10.2575 13.7727C10.0984 13.6894 9.91292 13.6477 9.7009 13.6477C9.36015 13.6477 9.06484 13.7727 8.81495 14.0227C8.56507 14.2652 8.44013 14.5606 8.44013 14.9091C8.44013 15.0758 8.47042 15.2348 8.531 15.3864C8.59158 15.5379 8.68623 15.6932 8.81495 15.8523L11.4728 19.0341C11.6545 19.2538 11.8476 19.4205 12.0521 19.5341C12.2565 19.6402 12.4875 19.6932 12.7449 19.6932Z",
6457
+ fill: tone === "current" ? "#0C161C" : "#B3B9BB"
6458
+ }
6459
+ )
6460
+ ]
6461
+ }
6462
+ );
6463
+ }
6464
+ function formatStepDate(iso, locale) {
6465
+ const date2 = new Date(iso);
6466
+ const weekday = date2.toLocaleDateString(locale, { weekday: "long" });
6467
+ const dayMonth = date2.toLocaleDateString(locale, { day: "numeric", month: "short" });
6468
+ return `${weekday}, ${dayMonth}`;
6469
+ }
6470
+ function formatWindow(window2, locale) {
6471
+ const from = new Date(window2.from);
6472
+ const to = new Date(window2.to);
6473
+ const utc = { timeZone: "UTC" };
6474
+ const weekday = from.toLocaleDateString(locale, { weekday: "long", ...utc });
6475
+ const dayMonth = (d) => d.toLocaleDateString(locale, { day: "numeric", month: "short", ...utc });
6476
+ const sameDay = from.getUTCFullYear() === to.getUTCFullYear() && from.getUTCMonth() === to.getUTCMonth() && from.getUTCDate() === to.getUTCDate();
6477
+ if (sameDay) return `${weekday}, ${dayMonth(from)}`;
6478
+ if (from.getUTCMonth() !== to.getUTCMonth()) {
6479
+ return `${weekday} ${dayMonth(from)} - ${dayMonth(to)}`;
6480
+ }
6481
+ const day = (d) => d.toLocaleDateString(locale, { day: "numeric", ...utc });
6482
+ const month = new Intl.DateTimeFormat(locale, { month: "short", ...utc }).formatToParts(from).find((part) => part.type === "month")?.value;
6483
+ return month ? `${weekday} ${day(from)}-${day(to)} ${month}` : `${weekday} ${dayMonth(from)} - ${dayMonth(to)}`;
6484
+ }
6168
6485
  const COLOUR_KEYS = ["colour", "color"];
6169
6486
  function colourKeyOf(variants) {
6170
6487
  return COLOUR_KEYS.find((k) => variants.some((v) => k in v.attributes)) ?? null;
@@ -6250,118 +6567,24 @@ const SWATCH_HEX = {
6250
6567
  green: "#147e4a",
6251
6568
  beige: "#e8e0d2"
6252
6569
  };
6253
- function swatchColour(name) {
6254
- return SWATCH_HEX[name.toLowerCase().trim()] ?? "#c9cdd0";
6570
+ function swatchColour(name2) {
6571
+ return SWATCH_HEX[name2.toLowerCase().trim()] ?? "#c9cdd0";
6255
6572
  }
6256
- const timeline = "_timeline_1cum7_7";
6257
- const row$7 = "_row_1cum7_15";
6258
- const line$2 = "_line_1cum7_20";
6259
- const marker = "_marker_1cum7_27";
6260
- const tick = "_tick_1cum7_35";
6261
- const pending$2 = "_pending_1cum7_44";
6262
- const connector = "_connector_1cum7_68";
6263
- const text$3 = "_text_1cum7_84";
6264
- const label$1 = "_label_1cum7_101";
6265
- const past = "_past_1cum7_113";
6266
- const current = "_current_1cum7_118";
6267
- const future = "_future_1cum7_133";
6268
- const date$1 = "_date_1cum7_138";
6269
- const styles$y = {
6270
- timeline,
6573
+ const summary = "_summary_1hsxt_2";
6574
+ const row$7 = "_row_1hsxt_16";
6575
+ const free = "_free_1hsxt_53";
6576
+ const pending$1 = "_pending_1hsxt_59";
6577
+ const discount = "_discount_1hsxt_69";
6578
+ const styles$E = {
6579
+ summary,
6271
6580
  row: row$7,
6272
- line: line$2,
6273
- marker,
6274
- tick,
6275
- pending: pending$2,
6276
- connector,
6277
- text: text$3,
6278
- label: label$1,
6279
- past,
6280
- current,
6281
- future,
6282
- date: date$1
6283
- };
6284
- function OrderTimeline({ progress: progress2, locale: localeProp }) {
6285
- const locale = useLocale(localeProp);
6286
- const currentIndex = progress2.findIndex((e) => e.current);
6287
- return /* @__PURE__ */ jsx("ol", { className: styles$y.timeline, children: progress2.map((entry, i) => {
6288
- const state = stateOf(entry, i, currentIndex);
6289
- return /* @__PURE__ */ jsxs(
6290
- "li",
6291
- {
6292
- className: styles$y.row,
6293
- "aria-current": entry.current ? "step" : void 0,
6294
- children: [
6295
- /* @__PURE__ */ jsxs("div", { className: styles$y.line, children: [
6296
- /* @__PURE__ */ jsx("span", { className: styles$y.marker, children: state === "future" ? /* @__PURE__ */ jsx("span", { className: styles$y.pending, "aria-hidden": "true" }) : /* @__PURE__ */ jsx(StepTick, { tone: state }) }),
6297
- /* @__PURE__ */ jsxs("span", { className: styles$y.text, children: [
6298
- /* @__PURE__ */ jsx("span", { className: [styles$y.label, styles$y[state]].join(" "), children: entry.label }),
6299
- entry.at && /* @__PURE__ */ jsx("time", { className: styles$y.date, dateTime: entry.at, children: formatStepDate(entry.at, locale) })
6300
- ] })
6301
- ] }),
6302
- i < progress2.length - 1 && /* @__PURE__ */ jsx("span", { className: styles$y.connector, "aria-hidden": "true" })
6303
- ]
6304
- },
6305
- entry.step
6306
- );
6307
- }) });
6308
- }
6309
- function stateOf(entry, index, currentIndex) {
6310
- if (entry.current) return "current";
6311
- if (currentIndex === -1) return entry.at ? "past" : "future";
6312
- return index < currentIndex ? "past" : "future";
6313
- }
6314
- function StepTick({ tone }) {
6315
- return /* @__PURE__ */ jsxs(
6316
- "svg",
6317
- {
6318
- className: styles$y.tick,
6319
- width: "28",
6320
- height: "28",
6321
- viewBox: "0 0 28 28",
6322
- fill: "none",
6323
- "aria-hidden": "true",
6324
- children: [
6325
- /* @__PURE__ */ jsx(
6326
- "path",
6327
- {
6328
- d: "M14 1C21.1797 1 27 6.8203 27 14C27 21.1797 21.1797 27 14 27C6.8203 27 1 21.1797 1 14C1 6.8203 6.8203 1 14 1Z",
6329
- fill: "#F9FAFA",
6330
- stroke: "#F9FAFA",
6331
- strokeWidth: "2"
6332
- }
6333
- ),
6334
- /* @__PURE__ */ jsx(
6335
- "path",
6336
- {
6337
- d: "M13.9943 26C12.3436 26 10.7913 25.6856 9.33743 25.0568C7.89115 24.4356 6.61903 23.5758 5.52106 22.4773C4.4231 21.3788 3.55987 20.1061 2.93138 18.6591C2.31046 17.2045 2 15.6515 2 14C2 12.3409 2.31046 10.7879 2.93138 9.34091C3.55987 7.88636 4.4231 6.60985 5.52106 5.51136C6.61903 4.41288 7.89115 3.55303 9.33743 2.93182C10.7913 2.31061 12.3436 2 13.9943 2C15.6526 2 17.2049 2.31061 18.6512 2.93182C20.1051 3.55303 21.381 4.41288 22.4789 5.51136C23.5769 6.60985 24.4363 7.88636 25.0573 9.34091C25.6858 10.7879 26 12.3409 26 14C26 15.6515 25.6858 17.2045 25.0573 18.6591C24.4363 20.1061 23.5769 21.3788 22.4789 22.4773C21.381 23.5758 20.1051 24.4356 18.6512 25.0568C17.2049 25.6856 15.6526 26 13.9943 26ZM12.7449 19.6932C12.9948 19.6932 13.222 19.6364 13.4264 19.5227C13.6384 19.4015 13.8202 19.2311 13.9716 19.0114L19.2532 10.9432C19.3441 10.7992 19.416 10.6515 19.469 10.5C19.5296 10.3485 19.5599 10.2008 19.5599 10.0568C19.5599 9.70833 19.4274 9.42045 19.1623 9.19318C18.9049 8.96591 18.6058 8.85227 18.265 8.85227C17.8183 8.85227 17.4434 9.0947 17.1406 9.57955L12.7222 16.6136L10.7345 14.1818C10.5831 13.9924 10.424 13.8561 10.2575 13.7727C10.0984 13.6894 9.91292 13.6477 9.7009 13.6477C9.36015 13.6477 9.06484 13.7727 8.81495 14.0227C8.56507 14.2652 8.44013 14.5606 8.44013 14.9091C8.44013 15.0758 8.47042 15.2348 8.531 15.3864C8.59158 15.5379 8.68623 15.6932 8.81495 15.8523L11.4728 19.0341C11.6545 19.2538 11.8476 19.4205 12.0521 19.5341C12.2565 19.6402 12.4875 19.6932 12.7449 19.6932Z",
6338
- fill: tone === "current" ? "#0C161C" : "#B3B9BB"
6339
- }
6340
- )
6341
- ]
6342
- }
6343
- );
6344
- }
6345
- function formatStepDate(iso, locale) {
6346
- const date2 = new Date(iso);
6347
- const weekday = date2.toLocaleDateString(locale, { weekday: "long" });
6348
- const dayMonth = date2.toLocaleDateString(locale, { day: "numeric", month: "short" });
6349
- return `${weekday}, ${dayMonth}`;
6350
- }
6351
- const summary = "_summary_1hsxt_2";
6352
- const row$6 = "_row_1hsxt_16";
6353
- const free = "_free_1hsxt_53";
6354
- const pending$1 = "_pending_1hsxt_59";
6355
- const discount = "_discount_1hsxt_69";
6356
- const styles$x = {
6357
- summary,
6358
- row: row$6,
6359
- free,
6360
- pending: pending$1,
6361
- discount
6581
+ free,
6582
+ pending: pending$1,
6583
+ discount
6362
6584
  };
6363
6585
  const CART_ROWS = [
6364
6586
  { label: "Subtotal", key: "subtotal" },
6587
+ { label: "Discount", key: "discount" },
6365
6588
  { label: "Delivery", key: "shipping" },
6366
6589
  { label: "Tax", key: "tax" },
6367
6590
  { label: "Total", key: "total" }
@@ -6375,109 +6598,378 @@ function OrderSummary({
6375
6598
  }) {
6376
6599
  const { format } = useMoney();
6377
6600
  const isDeferred = (key) => deferred.includes(key);
6378
- const anyDeferred = deferred.length > 0;
6379
- const visible = rows.filter((row2) => !hidden.includes(row2.key)).filter((row2) => row2.key !== "total" || !anyDeferred).filter((row2) => row2.key !== "discount" || discount2 !== void 0);
6380
- return /* @__PURE__ */ jsx("dl", { className: styles$x.summary, children: visible.map(({ label: label2, key }) => {
6601
+ const visible = rows.filter((row2) => !hidden.includes(row2.key)).filter((row2) => row2.key !== "discount" || discount2 !== void 0);
6602
+ return /* @__PURE__ */ jsx("dl", { className: styles$E.summary, children: visible.map(({ label: label2, key }) => {
6381
6603
  if (key === "discount" && discount2) {
6382
- return /* @__PURE__ */ jsxs("div", { className: [styles$x.row, styles$x.discount].join(" "), children: [
6604
+ return /* @__PURE__ */ jsxs("div", { className: [styles$E.row, styles$E.discount].join(" "), children: [
6383
6605
  /* @__PURE__ */ jsx("dt", { children: label2 }),
6384
6606
  /* @__PURE__ */ jsx("dd", { children: `−${format(discount2)}` })
6385
6607
  ] }, key);
6386
6608
  }
6387
6609
  const pending2 = key !== "total" && isDeferred(key);
6388
- return /* @__PURE__ */ jsxs("div", { className: styles$x.row, children: [
6610
+ return /* @__PURE__ */ jsxs("div", { className: styles$E.row, children: [
6389
6611
  /* @__PURE__ */ jsx("dt", { children: label2 }),
6390
- /* @__PURE__ */ jsx("dd", { className: pending2 ? styles$x.pending : void 0, children: pending2 ? "Calculated at checkout" : renderValue(key, pricing, format) })
6612
+ /* @__PURE__ */ jsx("dd", { className: pending2 ? styles$E.pending : void 0, children: pending2 ? "Calculated at checkout" : renderValue(key, pricing, format) })
6391
6613
  ] }, key);
6392
6614
  }) });
6393
6615
  }
6394
6616
  function renderValue(key, pricing, format) {
6395
6617
  if (key === "shipping" && pricing.shipping.amount === 0) {
6396
- return /* @__PURE__ */ jsx("span", { className: styles$x.free, children: "Free" });
6618
+ return /* @__PURE__ */ jsx("span", { className: styles$E.free, children: "Free" });
6397
6619
  }
6398
6620
  return key === "discount" ? null : format(pricing[key]);
6399
6621
  }
6400
- const page$3 = "_page_1eqkm_1";
6401
- const status = "_status_1eqkm_10";
6402
- const widget = "_widget_1eqkm_18";
6403
- const title$h = "_title_1eqkm_24";
6404
- const headline$1 = "_headline_1eqkm_30";
6405
- const subtitle$4 = "_subtitle_1eqkm_37";
6406
- const dot$3 = "_dot_1eqkm_48";
6407
- const trackButton = "_trackButton_1eqkm_58";
6408
- const srOnly = "_srOnly_1eqkm_78";
6409
- const itemsCard = "_itemsCard_1eqkm_92";
6410
- const cardHeader = "_cardHeader_1eqkm_100";
6411
- const cardTitle$1 = "_cardTitle_1eqkm_108";
6412
- const count$1 = "_count_1eqkm_115";
6413
- const lines$2 = "_lines_1eqkm_130";
6414
- const line$1 = "_line_1eqkm_130";
6415
- const thumb$1 = "_thumb_1eqkm_152";
6416
- const image$9 = "_image_1eqkm_162";
6417
- const placeholder$6 = "_placeholder_1eqkm_166";
6418
- const lineBody$1 = "_lineBody_1eqkm_172";
6419
- const lineText$1 = "_lineText_1eqkm_180";
6420
- const lineTitle$1 = "_lineTitle_1eqkm_189";
6421
- const lineDetails = "_lineDetails_1eqkm_197";
6422
- const linePrice$1 = "_linePrice_1eqkm_205";
6423
- const details$1 = "_details_1eqkm_215";
6424
- const detailBlock = "_detailBlock_1eqkm_228";
6425
- const payment = "_payment_1eqkm_235";
6426
- const detailLabel = "_detailLabel_1eqkm_239";
6427
- const detailValue = "_detailValue_1eqkm_245";
6428
- const last4 = "_last4_1eqkm_256";
6429
- const brand = "_brand_1eqkm_262";
6430
- const divider$2 = "_divider_1eqkm_268";
6431
- const summaryCard$1 = "_summaryCard_1eqkm_275";
6432
- const styles$w = {
6433
- page: page$3,
6434
- status,
6435
- widget,
6436
- title: title$h,
6437
- headline: headline$1,
6438
- subtitle: subtitle$4,
6439
- dot: dot$3,
6440
- trackButton,
6441
- srOnly,
6442
- itemsCard,
6443
- cardHeader,
6444
- cardTitle: cardTitle$1,
6445
- count: count$1,
6446
- lines: lines$2,
6447
- line: line$1,
6448
- thumb: thumb$1,
6622
+ const lines$1 = "_lines_7mr8w_19";
6623
+ const line$2 = "_line_7mr8w_19";
6624
+ const thumb$2 = "_thumb_7mr8w_34";
6625
+ const image$9 = "_image_7mr8w_44";
6626
+ const placeholder$8 = "_placeholder_7mr8w_48";
6627
+ const lineBody = "_lineBody_7mr8w_53";
6628
+ const lineText = "_lineText_7mr8w_62";
6629
+ const lineTitle = "_lineTitle_7mr8w_72";
6630
+ const lineMeta = "_lineMeta_7mr8w_91";
6631
+ const linePrice = "_linePrice_7mr8w_106";
6632
+ const paid$3 = "_paid_7mr8w_118";
6633
+ const was$4 = "_was_7mr8w_124";
6634
+ const card$4 = "_card_7mr8w_144";
6635
+ const cardTitle = "_cardTitle_7mr8w_152";
6636
+ const cardBody = "_cardBody_7mr8w_164";
6637
+ const summaryCard = "_summaryCard_7mr8w_136";
6638
+ const styles$D = {
6639
+ lines: lines$1,
6640
+ line: line$2,
6641
+ thumb: thumb$2,
6449
6642
  image: image$9,
6450
- placeholder: placeholder$6,
6451
- lineBody: lineBody$1,
6452
- lineText: lineText$1,
6453
- lineTitle: lineTitle$1,
6454
- lineDetails,
6455
- linePrice: linePrice$1,
6456
- details: details$1,
6457
- detailBlock,
6458
- payment,
6459
- detailLabel,
6460
- detailValue,
6461
- last4,
6462
- brand,
6463
- divider: divider$2,
6464
- summaryCard: summaryCard$1
6643
+ placeholder: placeholder$8,
6644
+ lineBody,
6645
+ lineText,
6646
+ lineTitle,
6647
+ lineMeta,
6648
+ linePrice,
6649
+ paid: paid$3,
6650
+ was: was$4,
6651
+ card: card$4,
6652
+ cardTitle,
6653
+ cardBody,
6654
+ summaryCard
6465
6655
  };
6466
- const SUMMARY_ROWS$1 = [
6656
+ const SUMMARY_ROWS = [
6467
6657
  { label: "Subtotal", key: "subtotal" },
6468
- { label: "Tax", key: "tax" },
6658
+ { label: "Discount", key: "discount" },
6469
6659
  { label: "Shipping", key: "shipping" },
6470
6660
  { label: "Total", key: "total" }
6471
6661
  ];
6662
+ function OrderLine({ item: item2 }) {
6663
+ const { format } = useMoney();
6664
+ const compareAt2 = item2.compare_at_unit_price;
6665
+ const pct = compareAt2 ? discountPct(item2.unit_price, compareAt2) : void 0;
6666
+ const details2 = detailsOf(item2);
6667
+ return /* @__PURE__ */ jsxs("li", { className: styles$D.line, children: [
6668
+ /* @__PURE__ */ jsx("div", { className: styles$D.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$D.image }) : /* @__PURE__ */ jsx("div", { className: styles$D.placeholder, "aria-hidden": "true" }) }),
6669
+ /* @__PURE__ */ jsxs("div", { className: styles$D.lineBody, children: [
6670
+ /* @__PURE__ */ jsxs("div", { className: styles$D.lineText, children: [
6671
+ /* @__PURE__ */ jsx("span", { className: styles$D.lineTitle, children: item2.title ?? item2.sku }),
6672
+ /* @__PURE__ */ jsxs("span", { className: styles$D.lineMeta, children: [
6673
+ details2.map((detail2) => /* @__PURE__ */ jsx("span", { children: detail2 }, detail2)),
6674
+ pct !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct })
6675
+ ] })
6676
+ ] }),
6677
+ /* @__PURE__ */ jsxs("span", { className: styles$D.linePrice, children: [
6678
+ /* @__PURE__ */ jsx("span", { className: styles$D.paid, children: format(item2.line_total) }),
6679
+ compareAt2 && /* @__PURE__ */ jsxs("span", { className: styles$D.was, children: [
6680
+ /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(compareAt2)}` }),
6681
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(compareAt2) })
6682
+ ] })
6683
+ ] })
6684
+ ] })
6685
+ ] });
6686
+ }
6687
+ function OrderLines({ order }) {
6688
+ return /* @__PURE__ */ jsx("ul", { className: styles$D.lines, "aria-label": "Items", children: order.items.map((item2) => /* @__PURE__ */ jsx(OrderLine, { item: item2 }, item2.line_ref)) });
6689
+ }
6690
+ function ShippingAddressCard({ order }) {
6691
+ return /* @__PURE__ */ jsxs("section", { className: styles$D.card, "aria-label": "Shipping address", children: [
6692
+ /* @__PURE__ */ jsx("h2", { className: styles$D.cardTitle, children: "Shipping address" }),
6693
+ /* @__PURE__ */ jsx("p", { className: styles$D.cardBody, children: formatAddress(order.ship_to) })
6694
+ ] });
6695
+ }
6696
+ function OrderSummaryCard({ order }) {
6697
+ return /* @__PURE__ */ jsxs("section", { className: [styles$D.card, styles$D.summaryCard].join(" "), "aria-label": "Order summary", children: [
6698
+ /* @__PURE__ */ jsx("h2", { className: styles$D.cardTitle, children: "Order summary" }),
6699
+ /* @__PURE__ */ jsx(OrderSummary, { pricing: toPricing(order), rows: rowsFor(order), discount: order.totals.discount })
6700
+ ] });
6701
+ }
6702
+ function detailsOf(item2) {
6703
+ const pairs = variantPairs(item2.attributes).map((p) => `${p.label}: ${p.value}`);
6704
+ return item2.qty > 1 ? [...pairs, `Qty: ${item2.qty}`] : pairs;
6705
+ }
6706
+ function rowsFor(order) {
6707
+ if (order.totals.tax.amount === 0) return SUMMARY_ROWS;
6708
+ return SUMMARY_ROWS.flatMap(
6709
+ (row2) => row2.key === "shipping" ? [row2, { label: "Tax", key: "tax" }] : [row2]
6710
+ );
6711
+ }
6712
+ function toPricing(order) {
6713
+ return {
6714
+ subtotal: order.totals.items,
6715
+ shipping: order.totals.shipping,
6716
+ tax: order.totals.tax,
6717
+ total: order.totals.grand_total
6718
+ };
6719
+ }
6720
+ function formatAddress(address) {
6721
+ return [address.line1, address.line2, address.postcode, address.city, address.country].filter(Boolean).join(", ");
6722
+ }
6723
+ const header$6 = "_header_1f3nh_7";
6724
+ const slot = "_slot_1f3nh_15";
6725
+ const handleSlot = "_handleSlot_1f3nh_23";
6726
+ const handle = "_handle_1f3nh_23";
6727
+ const closeSlot$1 = "_closeSlot_1f3nh_35";
6728
+ const close$2 = "_close_1f3nh_35";
6729
+ const styles$C = {
6730
+ header: header$6,
6731
+ slot,
6732
+ handleSlot,
6733
+ handle,
6734
+ closeSlot: closeSlot$1,
6735
+ close: close$2
6736
+ };
6737
+ function CloseIcon$1() {
6738
+ return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { transform: "translate(2.667 2.667)", children: /* @__PURE__ */ jsx(
6739
+ "path",
6740
+ {
6741
+ fillRule: "evenodd",
6742
+ clipRule: "evenodd",
6743
+ d: "M10.6667 1.12866L9.538 0L5.33333 4.21262L1.12866 0L0 1.12866L4.21262 5.33333L0 9.538L1.12866 10.6667L5.33333 6.45405L9.538 10.6667L10.6667 9.538L6.45405 5.33333L10.6667 1.12866Z",
6744
+ fill: "currentColor"
6745
+ }
6746
+ ) }) });
6747
+ }
6748
+ function SheetHeader({ onClose, closeLabel }) {
6749
+ return /* @__PURE__ */ jsxs("div", { className: styles$C.header, children: [
6750
+ /* @__PURE__ */ jsx("div", { className: styles$C.slot, "aria-hidden": "true" }),
6751
+ /* @__PURE__ */ jsx("div", { className: styles$C.handleSlot, "aria-hidden": "true", children: /* @__PURE__ */ jsx("div", { className: styles$C.handle }) }),
6752
+ /* @__PURE__ */ jsx("button", { type: "button", className: styles$C.closeSlot, onClick: onClose, "aria-label": closeLabel, children: /* @__PURE__ */ jsx("span", { className: styles$C.close, children: /* @__PURE__ */ jsx(CloseIcon$1, {}) }) })
6753
+ ] });
6754
+ }
6755
+ const FOCUSABLE = 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])';
6756
+ function useModalDialog(open, onClose, ref) {
6757
+ const handleKeyDown = useCallback(
6758
+ (e) => {
6759
+ if (e.key === "Escape") {
6760
+ e.preventDefault();
6761
+ onClose();
6762
+ return;
6763
+ }
6764
+ if (e.key !== "Tab") return;
6765
+ const dialog = ref.current;
6766
+ if (!dialog) return;
6767
+ const focusables = Array.from(dialog.querySelectorAll(FOCUSABLE)).filter(
6768
+ (el) => el.offsetParent !== null || el === document.activeElement
6769
+ );
6770
+ if (focusables.length === 0) {
6771
+ e.preventDefault();
6772
+ return;
6773
+ }
6774
+ const first = focusables[0];
6775
+ const last = focusables[focusables.length - 1];
6776
+ if (e.shiftKey && document.activeElement === first) {
6777
+ e.preventDefault();
6778
+ last.focus();
6779
+ } else if (!e.shiftKey && document.activeElement === last) {
6780
+ e.preventDefault();
6781
+ first.focus();
6782
+ }
6783
+ },
6784
+ [onClose, ref]
6785
+ );
6786
+ useEffect(() => {
6787
+ if (!open) return;
6788
+ const previouslyFocused = document.activeElement;
6789
+ document.addEventListener("keydown", handleKeyDown);
6790
+ ref.current?.querySelector(FOCUSABLE)?.focus();
6791
+ const { overflow } = document.body.style;
6792
+ document.body.style.overflow = "hidden";
6793
+ return () => {
6794
+ document.removeEventListener("keydown", handleKeyDown);
6795
+ document.body.style.overflow = overflow;
6796
+ previouslyFocused?.focus?.();
6797
+ };
6798
+ }, [open, handleKeyDown, ref]);
6799
+ }
6800
+ const scrim$5 = "_scrim_7on4q_8";
6801
+ const sheet$3 = "_sheet_7on4q_20";
6802
+ const body$6 = "_body_7on4q_32";
6803
+ const title$l = "_title_7on4q_46";
6804
+ const options$1 = "_options_7on4q_54";
6805
+ const option$1 = "_option_7on4q_54";
6806
+ const radio = "_radio_7on4q_88";
6807
+ const label$1 = "_label_7on4q_118";
6808
+ const footer$1 = "_footer_7on4q_127";
6809
+ const error$1 = "_error_7on4q_135";
6810
+ const styles$B = {
6811
+ scrim: scrim$5,
6812
+ sheet: sheet$3,
6813
+ body: body$6,
6814
+ title: title$l,
6815
+ options: options$1,
6816
+ option: option$1,
6817
+ radio,
6818
+ label: label$1,
6819
+ footer: footer$1,
6820
+ error: error$1
6821
+ };
6822
+ function ReasonSheet({
6823
+ title: title2,
6824
+ options: options2,
6825
+ ctaLabel,
6826
+ selected: selected2,
6827
+ onConfirm,
6828
+ onClose,
6829
+ closeLabel,
6830
+ busy = false,
6831
+ error: error2
6832
+ }) {
6833
+ const sheetRef = useRef(null);
6834
+ const [choice, setChoice] = useState(selected2);
6835
+ useModalDialog(true, onClose, sheetRef);
6836
+ return /* @__PURE__ */ jsx("div", { className: styles$B.scrim, onClick: onClose, children: /* @__PURE__ */ jsxs(
6837
+ ShopSurface,
6838
+ {
6839
+ tone: "light",
6840
+ ref: sheetRef,
6841
+ className: styles$B.sheet,
6842
+ role: "dialog",
6843
+ "aria-modal": "true",
6844
+ "aria-labelledby": "reason-sheet-title",
6845
+ onClick: (e) => e.stopPropagation(),
6846
+ children: [
6847
+ /* @__PURE__ */ jsx(SheetHeader, { onClose, closeLabel }),
6848
+ /* @__PURE__ */ jsxs("div", { className: styles$B.body, children: [
6849
+ /* @__PURE__ */ jsx("h2", { id: "reason-sheet-title", className: styles$B.title, children: title2 }),
6850
+ /* @__PURE__ */ jsx("div", { className: styles$B.options, role: "radiogroup", "aria-labelledby": "reason-sheet-title", children: options2.map((o) => /* @__PURE__ */ jsxs(
6851
+ "button",
6852
+ {
6853
+ type: "button",
6854
+ role: "radio",
6855
+ "aria-checked": o.value === choice,
6856
+ className: styles$B.option,
6857
+ onClick: () => setChoice(o.value),
6858
+ children: [
6859
+ /* @__PURE__ */ jsx("span", { className: styles$B.radio, "aria-hidden": "true", children: o.value === choice && /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
6860
+ /* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "10", fill: "currentColor" }),
6861
+ /* @__PURE__ */ jsx(
6862
+ "path",
6863
+ {
6864
+ d: "m5.8 10.3 2.7 2.7 5.7-5.7",
6865
+ stroke: "var(--color-text-strong)",
6866
+ strokeWidth: "1.8",
6867
+ strokeLinecap: "round",
6868
+ strokeLinejoin: "round"
6869
+ }
6870
+ )
6871
+ ] }) }),
6872
+ /* @__PURE__ */ jsx("span", { className: styles$B.label, children: o.label })
6873
+ ]
6874
+ },
6875
+ o.value
6876
+ )) })
6877
+ ] }),
6878
+ /* @__PURE__ */ jsxs("div", { className: styles$B.footer, children: [
6879
+ error2 && /* @__PURE__ */ jsx("p", { className: styles$B.error, role: "alert", children: error2 }),
6880
+ /* @__PURE__ */ jsx(
6881
+ Button,
6882
+ {
6883
+ variant: "primary",
6884
+ fullWidth: true,
6885
+ disabled: !choice,
6886
+ loading: busy,
6887
+ onClick: () => choice && onConfirm(choice),
6888
+ children: ctaLabel
6889
+ }
6890
+ )
6891
+ ] })
6892
+ ]
6893
+ }
6894
+ ) });
6895
+ }
6896
+ const page$6 = "_page_opefg_8";
6897
+ const widget = "_widget_opefg_18";
6898
+ const titleRow = "_titleRow_opefg_26";
6899
+ const headline$1 = "_headline_opefg_42";
6900
+ const track$5 = "_track_opefg_61";
6901
+ const rule = "_rule_opefg_86";
6902
+ const help = "_help_opefg_96";
6903
+ const helpTitle = "_helpTitle_opefg_102";
6904
+ const helpRows = "_helpRows_opefg_109";
6905
+ const helpRow = "_helpRow_opefg_109";
6906
+ const cancel = "_cancel_opefg_167";
6907
+ const cancelledHead = "_cancelledHead_opefg_191";
6908
+ const cancelledTitle = "_cancelledTitle_opefg_197";
6909
+ const cancelledMeta = "_cancelledMeta_opefg_206";
6910
+ const styles$A = {
6911
+ page: page$6,
6912
+ widget,
6913
+ titleRow,
6914
+ headline: headline$1,
6915
+ track: track$5,
6916
+ rule,
6917
+ help,
6918
+ helpTitle,
6919
+ helpRows,
6920
+ helpRow,
6921
+ cancel,
6922
+ cancelledHead,
6923
+ cancelledTitle,
6924
+ cancelledMeta
6925
+ };
6926
+ function RedirectLink() {
6927
+ return /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
6928
+ /* @__PURE__ */ jsx(
6929
+ "path",
6930
+ {
6931
+ d: "M3.37413 1.63539C2.84882 1.63539 2.39164 1.90422 2.08646 2.29534C1.78479 2.68228 1.63445 3.17776 1.63445 3.66795V3.67088L1.66569 10.3328C1.66636 10.8221 1.81652 11.3164 2.1177 11.7025C2.42287 12.0935 2.8802 12.3615 3.40537 12.3615L3.4044 12.3625L10.6248 12.3654C11.1499 12.3653 11.6063 12.0965 11.9115 11.7054C12.2134 11.3185 12.3644 10.8232 12.3645 10.3328V8.33347C12.3645 7.94707 12.0508 7.63363 11.6645 7.63349C11.278 7.63349 10.9645 7.94699 10.9645 8.33347V10.3328C10.9644 10.5489 10.8962 10.7317 10.8083 10.8444C10.7238 10.9526 10.6512 10.9654 10.6248 10.9654L3.40537 10.9625C3.37921 10.9625 3.30653 10.9498 3.22184 10.8415C3.13389 10.7287 3.06474 10.5461 3.06466 10.3299V10.327L3.03342 3.66405C3.03416 3.44927 3.10311 3.26759 3.1906 3.15542C3.27527 3.04709 3.34796 3.03436 3.37413 3.03436H5.44477C5.83092 3.03423 6.14439 2.72147 6.14474 2.33537C6.14474 1.94897 5.83113 1.63553 5.44477 1.63539H3.37413Z",
6932
+ fill: "currentColor"
6933
+ }
6934
+ ),
6935
+ /* @__PURE__ */ jsx(
6936
+ "path",
6937
+ {
6938
+ d: "M8.683 1.63442C8.29663 1.63442 7.9832 1.94806 7.98303 2.33439C7.98303 2.72087 8.29652 3.03436 8.683 3.03436H9.97458L6.504 6.50495C6.23093 6.77819 6.23093 7.22163 6.504 7.49487C6.77724 7.76794 7.22068 7.76794 7.49392 7.49487L10.9645 4.02331V5.31587C10.9645 5.70233 11.278 6.01582 11.6645 6.01584C12.0508 6.01571 12.3645 5.70226 12.3645 5.31587V2.33439C12.3643 2.04478 12.1878 1.79638 11.9369 1.69006L11.9271 1.68616C11.9116 1.67987 11.8951 1.67664 11.8793 1.67152C11.8526 1.66289 11.8261 1.6535 11.7982 1.64809C11.7924 1.64696 11.7865 1.64711 11.7807 1.64613C11.7428 1.63977 11.7042 1.63443 11.6645 1.63442H8.683Z",
6939
+ fill: "currentColor"
6940
+ }
6941
+ )
6942
+ ] });
6943
+ }
6944
+ function ChevronRight$1() {
6945
+ return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { transform: "translate(4.28 1.96)", children: /* @__PURE__ */ jsx(
6946
+ "path",
6947
+ {
6948
+ d: "M7.42763 6.03763C7.42763 5.83763 7.33763 5.64763 7.18763 5.51763L1.15763 0.177629C0.867628 -0.0823714 0.427629 -0.0523713 0.177629 0.237629C-0.0823713 0.527629 -0.0523714 0.967629 0.237629 1.22763L5.67763 6.04763L0.237629 10.8576C-0.0523709 11.1176 -0.0823709 11.5576 0.177629 11.8476C0.437629 12.1376 0.877629 12.1676 1.16763 11.9076L7.19763 6.56763C7.34763 6.43763 7.43763 6.24763 7.43763 6.04763L7.42763 6.03763Z",
6949
+ fill: "currentColor"
6950
+ }
6951
+ ) }) });
6952
+ }
6472
6953
  function OrderTrackingView(props) {
6473
6954
  return /* @__PURE__ */ jsx(ShopSurface, { tone: "light", fill: true, children: /* @__PURE__ */ jsx(OrderTrackingContent, { ...props }) });
6474
6955
  }
6475
- function OrderTrackingContent({ orderRef, locale: localeProp }) {
6956
+ function OrderTrackingContent({
6957
+ orderRef,
6958
+ locale: localeProp,
6959
+ onStartReturn,
6960
+ onContactSupport,
6961
+ onCancelled,
6962
+ onReorder
6963
+ }) {
6476
6964
  const { api } = useShop();
6477
6965
  const locale = useLocale(localeProp);
6478
6966
  const [order, setOrder] = useState(null);
6479
6967
  const [state, setState] = useState("loading");
6480
6968
  const [errorCode, setErrorCode] = useState(void 0);
6969
+ const [cancelOpen, setCancelOpen] = useState(false);
6970
+ const [cancelling, setCancelling] = useState(false);
6971
+ const [cancelError, setCancelError] = useState(null);
6972
+ const emit = useShopEvent();
6481
6973
  const load = useCallback(async () => {
6482
6974
  setState("loading");
6483
6975
  try {
@@ -6492,164 +6984,561 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
6492
6984
  void load();
6493
6985
  }, [load]);
6494
6986
  if (state === "loading") {
6495
- return /* @__PURE__ */ jsxs("div", { className: styles$w.page, children: [
6496
- /* @__PURE__ */ jsx(Skeleton, { height: 120, radius: 8 }),
6497
- /* @__PURE__ */ jsx(Skeleton, { height: 220, radius: 18 }),
6498
- /* @__PURE__ */ jsx(Skeleton, { height: 140, radius: 18 })
6987
+ return /* @__PURE__ */ jsxs("div", { className: styles$A.page, children: [
6988
+ /* @__PURE__ */ jsx(Skeleton, { height: 206, radius: 8 }),
6989
+ /* @__PURE__ */ jsx(Skeleton, { height: 48, radius: 8 }),
6990
+ /* @__PURE__ */ jsx(Skeleton, { height: 113, radius: 18 }),
6991
+ /* @__PURE__ */ jsx(Skeleton, { height: 240, radius: 18 })
6499
6992
  ] });
6500
6993
  }
6501
6994
  if (state === "error" || !order) {
6502
6995
  return /* @__PURE__ */ jsx(ErrorState, { code: errorCode, onRetry: () => void load() });
6503
6996
  }
6504
- return /* @__PURE__ */ jsxs("div", { className: styles$w.page, children: [
6505
- /* @__PURE__ */ jsxs("section", { className: styles$w.status, "aria-label": "Delivery status", children: [
6506
- /* @__PURE__ */ jsxs("div", { className: styles$w.title, children: [
6507
- /* @__PURE__ */ jsx("h1", { className: styles$w.headline, children: order.headline }),
6508
- /* @__PURE__ */ jsxs("p", { className: styles$w.subtitle, children: [
6509
- /* @__PURE__ */ jsx("span", { children: `Order #${shortRef$1(order.order_ref)}` }),
6510
- /* @__PURE__ */ jsx("span", { className: styles$w.dot, "aria-hidden": "true" }),
6511
- /* @__PURE__ */ jsx("span", { children: `Placed ${formatPlaced$1(order.placed_at, locale)}` })
6512
- ] })
6997
+ async function confirmCancellation(reason2) {
6998
+ setCancelling(true);
6999
+ setCancelError(null);
7000
+ try {
7001
+ const updated = await api.orders.requestCancellation(orderRef, { reason: reason2 });
7002
+ setOrder(updated);
7003
+ setCancelOpen(false);
7004
+ emit({ type: "order_cancellation_requested", orderRef, reason: reason2 });
7005
+ onCancelled?.(updated);
7006
+ } catch (err) {
7007
+ setCancelError(treatmentFor(codeOf(err)).body);
7008
+ } finally {
7009
+ setCancelling(false);
7010
+ }
7011
+ }
7012
+ if (order.status === "cancelled") {
7013
+ return /* @__PURE__ */ jsxs("div", { className: styles$A.page, children: [
7014
+ /* @__PURE__ */ jsxs("div", { className: styles$A.cancelledHead, children: [
7015
+ /* @__PURE__ */ jsx("h1", { className: styles$A.cancelledTitle, children: "Order cancelled" }),
7016
+ /* @__PURE__ */ jsx("p", { className: styles$A.cancelledMeta, children: `Order #${shortRef$1(order.order_ref)} · Placed ${placedOn(order.placed_at, locale)}` })
6513
7017
  ] }),
6514
- /* @__PURE__ */ jsxs("div", { className: styles$w.widget, children: [
6515
- /* @__PURE__ */ jsx(OrderTimeline, { progress: order.progress, locale }),
7018
+ onReorder && /* @__PURE__ */ jsx(
7019
+ Button,
7020
+ {
7021
+ variant: "primary",
7022
+ fullWidth: true,
7023
+ onClick: () => {
7024
+ emit({ type: "reorder_requested", orderRef: order.order_ref });
7025
+ onReorder();
7026
+ },
7027
+ children: "Reorder"
7028
+ }
7029
+ ),
7030
+ /* @__PURE__ */ jsx(OrderLines, { order }),
7031
+ /* @__PURE__ */ jsx(ShippingAddressCard, { order }),
7032
+ /* @__PURE__ */ jsx(OrderSummaryCard, { order })
7033
+ ] });
7034
+ }
7035
+ return /* @__PURE__ */ jsxs("div", { className: styles$A.page, children: [
7036
+ /* @__PURE__ */ jsxs("section", { className: styles$A.widget, "aria-label": "Delivery status", children: [
7037
+ /* @__PURE__ */ jsxs("div", { className: styles$A.titleRow, children: [
7038
+ /* @__PURE__ */ jsx("h1", { className: styles$A.headline, children: `Order #${shortRef$1(order.order_ref)}` }),
6516
7039
  order.tracking?.url && /* @__PURE__ */ jsxs(
6517
7040
  "a",
6518
7041
  {
6519
- className: styles$w.trackButton,
7042
+ className: styles$A.track,
6520
7043
  href: order.tracking.url,
6521
7044
  target: "_blank",
6522
7045
  rel: "noopener noreferrer",
6523
7046
  children: [
6524
- "Track order",
6525
- /* @__PURE__ */ jsx("span", { className: styles$w.srOnly, children: ` (opens ${order.tracking.carrier} in a new tab)` })
7047
+ "Track",
7048
+ /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: ` ${order.tracking.carrier}, opens in a new tab` }),
7049
+ /* @__PURE__ */ jsx(RedirectLink, {})
6526
7050
  ]
6527
7051
  }
6528
7052
  )
6529
- ] })
6530
- ] }),
6531
- /* @__PURE__ */ jsx(ItemsCard, { order }),
6532
- /* @__PURE__ */ jsxs("section", { className: styles$w.details, "aria-label": "Delivery and payment", children: [
6533
- /* @__PURE__ */ jsxs("div", { className: styles$w.detailBlock, children: [
6534
- /* @__PURE__ */ jsx("h2", { className: styles$w.detailLabel, children: "Shipping address" }),
6535
- /* @__PURE__ */ jsx("p", { className: styles$w.detailValue, children: formatAddress$1(order.ship_to) })
6536
7053
  ] }),
6537
- order.payment && /* @__PURE__ */ jsxs(Fragment, { children: [
6538
- /* @__PURE__ */ jsx("div", { className: styles$w.divider, role: "presentation" }),
6539
- /* @__PURE__ */ jsxs("div", { className: [styles$w.detailBlock, styles$w.payment].join(" "), children: [
6540
- /* @__PURE__ */ jsx("h2", { className: styles$w.detailLabel, children: "Payment" }),
6541
- /* @__PURE__ */ jsxs("p", { className: styles$w.detailValue, children: [
6542
- /* @__PURE__ */ jsx("span", { className: styles$w.brand, children: order.payment.brand }),
6543
- order.payment.last4 && /* @__PURE__ */ jsxs("span", { className: styles$w.last4, children: [
6544
- "•••• ",
6545
- order.payment.last4
6546
- ] })
6547
- ] })
6548
- ] })
6549
- ] })
7054
+ /* @__PURE__ */ jsx(
7055
+ OrderTimeline,
7056
+ {
7057
+ progress: order.progress,
7058
+ ...order.estimated_delivery ? { estimatedDelivery: order.estimated_delivery } : {},
7059
+ locale
7060
+ }
7061
+ ),
7062
+ order.can_return && onStartReturn && /* @__PURE__ */ jsx(Button, { variant: "secondary", fullWidth: true, onClick: onStartReturn, children: "Return items" })
6550
7063
  ] }),
6551
- /* @__PURE__ */ jsxs("section", { className: styles$w.summaryCard, "aria-label": "Order summary", children: [
6552
- /* @__PURE__ */ jsx("h2", { className: styles$w.cardTitle, children: "Order summary" }),
6553
- /* @__PURE__ */ jsx(OrderSummary, { pricing: toPricing$1(order), rows: SUMMARY_ROWS$1 })
7064
+ /* @__PURE__ */ jsx("hr", { className: styles$A.rule }),
7065
+ /* @__PURE__ */ jsx(OrderLines, { order }),
7066
+ /* @__PURE__ */ jsx(ShippingAddressCard, { order }),
7067
+ /* @__PURE__ */ jsx(OrderSummaryCard, { order }),
7068
+ order.can_cancel && /* @__PURE__ */ jsx("button", { type: "button", className: styles$A.cancel, onClick: () => setCancelOpen(true), children: "Cancel order" }),
7069
+ /* @__PURE__ */ jsx(
7070
+ NeedHelp,
7071
+ {
7072
+ order,
7073
+ ...onStartReturn ? { onStartReturn } : {},
7074
+ ...onContactSupport ? { onContactSupport } : {}
7075
+ }
7076
+ ),
7077
+ cancelOpen && /* @__PURE__ */ jsx(
7078
+ ReasonSheet,
7079
+ {
7080
+ title: "Reason for cancelling",
7081
+ options: CANCEL_REASONS,
7082
+ ctaLabel: "Cancel order",
7083
+ closeLabel: "Close reasons",
7084
+ busy: cancelling,
7085
+ onClose: () => setCancelOpen(false),
7086
+ onConfirm: (reason2) => void confirmCancellation(reason2),
7087
+ ...cancelError ? { error: cancelError } : {}
7088
+ }
7089
+ )
7090
+ ] });
7091
+ }
7092
+ const CANCEL_REASONS = [
7093
+ { value: "changed_my_mind", label: "Changed my mind" },
7094
+ { value: "ordered_by_mistake", label: "Ordered by mistake" },
7095
+ { value: "delivery_too_long", label: "Delivery takes too long" }
7096
+ ];
7097
+ function placedOn(iso, locale) {
7098
+ const d = new Date(iso);
7099
+ const day = d.getUTCDate();
7100
+ const month = new Intl.DateTimeFormat(locale, { month: "short", timeZone: "UTC" }).format(d);
7101
+ return `${day} ${month}, ${d.getUTCFullYear()}`;
7102
+ }
7103
+ function NeedHelp({
7104
+ order,
7105
+ onStartReturn,
7106
+ onContactSupport
7107
+ }) {
7108
+ const emit = useShopEvent();
7109
+ if (order.status !== "delivered") return null;
7110
+ return /* @__PURE__ */ jsxs("section", { className: styles$A.help, "aria-labelledby": "order-help", children: [
7111
+ /* @__PURE__ */ jsx("h2", { className: styles$A.helpTitle, id: "order-help", children: "Need help?" }),
7112
+ /* @__PURE__ */ jsxs("div", { className: styles$A.helpRows, children: [
7113
+ onStartReturn && /* @__PURE__ */ jsx(HelpRow, { label: "Start a return", onClick: onStartReturn }),
7114
+ /* @__PURE__ */ jsx(
7115
+ HelpRow,
7116
+ {
7117
+ label: "Contact support",
7118
+ onClick: () => {
7119
+ emit({ type: "support_requested", orderRef: order.order_ref });
7120
+ onContactSupport?.();
7121
+ }
7122
+ }
7123
+ )
6554
7124
  ] })
6555
7125
  ] });
6556
7126
  }
6557
- function ItemsCard({ order }) {
7127
+ function HelpRow({ label: label2, onClick }) {
7128
+ return /* @__PURE__ */ jsxs("button", { type: "button", className: styles$A.helpRow, onClick, children: [
7129
+ /* @__PURE__ */ jsx("span", { children: label2 }),
7130
+ /* @__PURE__ */ jsx(ChevronRight$1, {})
7131
+ ] });
7132
+ }
7133
+ function shortRef$1(orderRef) {
7134
+ return orderRef.replace(/^ord_/, "");
7135
+ }
7136
+ const page$5 = "_page_1c7ro_7";
7137
+ const titles$2 = "_titles_1c7ro_15";
7138
+ const title$k = "_title_1c7ro_15";
7139
+ const subtitle$7 = "_subtitle_1c7ro_30";
7140
+ const list$2 = "_list_1c7ro_38";
7141
+ const card$3 = "_card_1c7ro_48";
7142
+ const checkSlot = "_checkSlot_1c7ro_61";
7143
+ const check = "_check_1c7ro_61";
7144
+ const row$6 = "_row_1c7ro_105";
7145
+ const line$1 = "_line_1c7ro_113";
7146
+ const thumb$1 = "_thumb_1c7ro_119";
7147
+ const img$1 = "_img_1c7ro_129";
7148
+ const placeholder$7 = "_placeholder_1c7ro_133";
7149
+ const meta$2 = "_meta_1c7ro_138";
7150
+ const name$2 = "_name_1c7ro_147";
7151
+ const attrs$1 = "_attrs_1c7ro_159";
7152
+ const price$3 = "_price_1c7ro_167";
7153
+ const paid$2 = "_paid_1c7ro_176";
7154
+ const was$3 = "_was_1c7ro_184";
7155
+ const reason = "_reason_1c7ro_199";
7156
+ const reasonSet = "_reasonSet_1c7ro_217";
7157
+ const styles$z = {
7158
+ page: page$5,
7159
+ titles: titles$2,
7160
+ title: title$k,
7161
+ subtitle: subtitle$7,
7162
+ list: list$2,
7163
+ card: card$3,
7164
+ checkSlot,
7165
+ check,
7166
+ row: row$6,
7167
+ line: line$1,
7168
+ thumb: thumb$1,
7169
+ img: img$1,
7170
+ placeholder: placeholder$7,
7171
+ meta: meta$2,
7172
+ name: name$2,
7173
+ attrs: attrs$1,
7174
+ price: price$3,
7175
+ paid: paid$2,
7176
+ was: was$3,
7177
+ reason,
7178
+ reasonSet
7179
+ };
7180
+ function Chevron$1() {
7181
+ return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
7182
+ "path",
7183
+ {
7184
+ d: "m6.3 4.1 3.4 3.9-3.4 3.9",
7185
+ stroke: "currentColor",
7186
+ strokeWidth: "1.6",
7187
+ strokeLinecap: "round",
7188
+ strokeLinejoin: "round"
7189
+ }
7190
+ ) });
7191
+ }
7192
+ function Tick() {
7193
+ return /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
7194
+ /* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "10", fill: "currentColor" }),
7195
+ /* @__PURE__ */ jsx(
7196
+ "path",
7197
+ {
7198
+ d: "m5.8 10.3 2.7 2.7 5.7-5.7",
7199
+ stroke: "var(--color-text-strong)",
7200
+ strokeWidth: "1.8",
7201
+ strokeLinecap: "round",
7202
+ strokeLinejoin: "round"
7203
+ }
7204
+ )
7205
+ ] });
7206
+ }
7207
+ const RETURN_REASONS = [
7208
+ { value: "too_large", label: "Too large" },
7209
+ { value: "too_small", label: "Too small" },
7210
+ { value: "arrived_too_late", label: "Arrived too late" },
7211
+ { value: "item_damaged", label: "Item is damaged" },
7212
+ { value: "not_as_described", label: "Item doesn't match description" },
7213
+ { value: "changed_my_mind", label: "Changed my mind" }
7214
+ ];
7215
+ const REASON_LABEL = new Map(RETURN_REASONS.map((r) => [r.value, r.label]));
7216
+ function ReturnItemsView({ order, onSubmit, busy = false }) {
6558
7217
  const { format } = useMoney();
6559
- return /* @__PURE__ */ jsxs("section", { className: styles$w.itemsCard, "aria-label": "Items", children: [
6560
- /* @__PURE__ */ jsxs("div", { className: styles$w.cardHeader, children: [
6561
- /* @__PURE__ */ jsx("h2", { className: styles$w.cardTitle, children: "Items" }),
6562
- /* @__PURE__ */ jsx("span", { className: styles$w.count, children: order.items.reduce((n, i) => n + i.qty, 0) })
7218
+ const [chosen, setChosen] = useState({});
7219
+ const [reasonFor, setReasonFor] = useState(null);
7220
+ const returnable = useMemo(
7221
+ () => order.items.filter((i) => i.qty - i.cancelled_qty - i.refunded_qty > 0),
7222
+ [order.items]
7223
+ );
7224
+ const selected2 = Object.entries(chosen).filter(([, reason2]) => reason2 !== void 0);
7225
+ const canSubmit = selected2.length > 0;
7226
+ function remaining(item2) {
7227
+ return item2.qty - item2.cancelled_qty - item2.refunded_qty;
7228
+ }
7229
+ function toggle2(lineRef) {
7230
+ if (lineRef in chosen) {
7231
+ setChosen((prev) => {
7232
+ const next = { ...prev };
7233
+ delete next[lineRef];
7234
+ return next;
7235
+ });
7236
+ return;
7237
+ }
7238
+ setChosen((prev) => ({ ...prev, [lineRef]: void 0 }));
7239
+ setReasonFor(lineRef);
7240
+ }
7241
+ function submit() {
7242
+ const items2 = returnable.filter((i) => chosen[i.line_ref]).map((i) => ({
7243
+ line_ref: i.line_ref,
7244
+ qty: remaining(i),
7245
+ reason: chosen[i.line_ref]
7246
+ }));
7247
+ if (items2.length > 0) onSubmit(items2);
7248
+ }
7249
+ return /* @__PURE__ */ jsxs("div", { className: styles$z.page, children: [
7250
+ /* @__PURE__ */ jsxs("div", { className: styles$z.titles, children: [
7251
+ /* @__PURE__ */ jsx("h1", { className: styles$z.title, children: "What do you want to return?" }),
7252
+ /* @__PURE__ */ jsx("p", { className: styles$z.subtitle, children: "Select items you want to return" })
7253
+ ] }),
7254
+ /* @__PURE__ */ jsx("div", { className: styles$z.list, children: returnable.map((item2) => {
7255
+ const picked = item2.line_ref in chosen;
7256
+ const reason2 = chosen[item2.line_ref];
7257
+ return /* @__PURE__ */ jsxs("div", { className: styles$z.card, children: [
7258
+ /* @__PURE__ */ jsx(
7259
+ "button",
7260
+ {
7261
+ type: "button",
7262
+ role: "checkbox",
7263
+ "aria-checked": picked,
7264
+ "aria-label": item2.title ?? item2.sku,
7265
+ className: styles$z.checkSlot,
7266
+ onClick: () => toggle2(item2.line_ref),
7267
+ children: /* @__PURE__ */ jsx("span", { className: styles$z.check, children: picked ? /* @__PURE__ */ jsx(Tick, {}) : null })
7268
+ }
7269
+ ),
7270
+ /* @__PURE__ */ jsxs("div", { className: styles$z.row, children: [
7271
+ /* @__PURE__ */ jsxs("div", { className: styles$z.line, children: [
7272
+ /* @__PURE__ */ jsx("div", { className: styles$z.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$z.img }) : /* @__PURE__ */ jsx("div", { className: styles$z.placeholder, "aria-hidden": "true" }) }),
7273
+ /* @__PURE__ */ jsxs("div", { className: styles$z.meta, children: [
7274
+ /* @__PURE__ */ jsx("p", { className: styles$z.name, children: item2.title ?? item2.sku }),
7275
+ item2.attributes?.size && /* @__PURE__ */ jsx("p", { className: styles$z.attrs, children: `Size: ${item2.attributes.size}` })
7276
+ ] }),
7277
+ /* @__PURE__ */ jsxs("div", { className: styles$z.price, children: [
7278
+ /* @__PURE__ */ jsx("span", { className: styles$z.paid, children: format(item2.unit_price) }),
7279
+ item2.compare_at_unit_price && /* @__PURE__ */ jsx("span", { className: styles$z.was, children: format(item2.compare_at_unit_price) })
7280
+ ] })
7281
+ ] }),
7282
+ /* @__PURE__ */ jsxs(
7283
+ "button",
7284
+ {
7285
+ type: "button",
7286
+ className: `${styles$z.reason} ${reason2 ? styles$z.reasonSet : ""}`,
7287
+ onClick: () => setReasonFor(item2.line_ref),
7288
+ "aria-haspopup": "dialog",
7289
+ children: [
7290
+ /* @__PURE__ */ jsx("span", { children: reason2 ? REASON_LABEL.get(reason2) : "Select reason" }),
7291
+ /* @__PURE__ */ jsx(Chevron$1, {})
7292
+ ]
7293
+ }
7294
+ )
7295
+ ] })
7296
+ ] }, item2.line_ref);
7297
+ }) }),
7298
+ /* @__PURE__ */ jsx(Button, { variant: "primary", fullWidth: true, disabled: !canSubmit, loading: busy, onClick: submit, children: "Return selected items" }),
7299
+ reasonFor && /* @__PURE__ */ jsx(
7300
+ ReasonSheet,
7301
+ {
7302
+ title: "Reason for return",
7303
+ options: RETURN_REASONS,
7304
+ ctaLabel: "Select",
7305
+ ...chosen[reasonFor] ? { selected: chosen[reasonFor] } : {},
7306
+ closeLabel: "Close reasons",
7307
+ onClose: () => setReasonFor(null),
7308
+ onConfirm: (value2) => {
7309
+ setChosen((prev) => ({ ...prev, [reasonFor]: value2 }));
7310
+ setReasonFor(null);
7311
+ }
7312
+ }
7313
+ )
7314
+ ] });
7315
+ }
7316
+ const page$4 = "_page_1r0ea_7";
7317
+ const intro$1 = "_intro_1r0ea_15";
7318
+ const title$j = "_title_1r0ea_22";
7319
+ const subtitle$6 = "_subtitle_1r0ea_31";
7320
+ const card$2 = "_card_1r0ea_39";
7321
+ const step = "_step_1r0ea_49";
7322
+ const step2 = "_step2_1r0ea_56";
7323
+ const stepHead = "_stepHead_1r0ea_62";
7324
+ const number = "_number_1r0ea_69";
7325
+ const stepTitle = "_stepTitle_1r0ea_84";
7326
+ const body$5 = "_body_1r0ea_95";
7327
+ const body2 = "_body2_1r0ea_103";
7328
+ const download = "_download_1r0ea_121";
7329
+ const note$1 = "_note_1r0ea_143";
7330
+ const styles$y = {
7331
+ page: page$4,
7332
+ intro: intro$1,
7333
+ title: title$j,
7334
+ subtitle: subtitle$6,
7335
+ card: card$2,
7336
+ step,
7337
+ step2,
7338
+ stepHead,
7339
+ number,
7340
+ stepTitle,
7341
+ body: body$5,
7342
+ body2,
7343
+ download,
7344
+ note: note$1
7345
+ };
7346
+ function ReturnLabelView({ ret, onDone }) {
7347
+ return /* @__PURE__ */ jsxs("div", { className: styles$y.page, children: [
7348
+ /* @__PURE__ */ jsxs("div", { className: styles$y.intro, children: [
7349
+ /* @__PURE__ */ jsx("h1", { className: styles$y.title, children: "We’ve generated your return label" }),
7350
+ /* @__PURE__ */ jsx("p", { className: styles$y.subtitle, children: "Follow the instructions below to complete your return" })
6563
7351
  ] }),
6564
- /* @__PURE__ */ jsx("ul", { className: styles$w.lines, children: order.items.map((item2) => /* @__PURE__ */ jsxs("li", { className: styles$w.line, children: [
6565
- /* @__PURE__ */ jsx("div", { className: styles$w.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$w.image }) : /* @__PURE__ */ jsx("div", { className: styles$w.placeholder, "aria-hidden": "true" }) }),
6566
- /* @__PURE__ */ jsxs("div", { className: styles$w.lineBody, children: [
6567
- /* @__PURE__ */ jsxs("div", { className: styles$w.lineText, children: [
6568
- /* @__PURE__ */ jsx("span", { className: styles$w.lineTitle, children: item2.title ?? item2.sku }),
6569
- detailsOf$1(item2).length > 0 && /* @__PURE__ */ jsx("span", { className: styles$w.lineDetails, children: detailsOf$1(item2).map((detail2) => /* @__PURE__ */ jsx("span", { children: detail2 }, detail2)) })
7352
+ /* @__PURE__ */ jsxs("div", { className: styles$y.card, children: [
7353
+ /* @__PURE__ */ jsxs("section", { className: styles$y.step, children: [
7354
+ /* @__PURE__ */ jsxs("div", { className: styles$y.stepHead, children: [
7355
+ /* @__PURE__ */ jsx("span", { className: styles$y.number, "aria-hidden": "true", children: "1" }),
7356
+ /* @__PURE__ */ jsx("h2", { className: styles$y.stepTitle, children: "Download your return label" })
7357
+ ] }),
7358
+ /* @__PURE__ */ jsx("p", { className: styles$y.body, children: "Tap the button below to download your pre-paid return label" }),
7359
+ ret.label_url && /* @__PURE__ */ jsxs(
7360
+ "a",
7361
+ {
7362
+ className: styles$y.download,
7363
+ href: ret.label_url,
7364
+ target: "_blank",
7365
+ rel: "noopener noreferrer",
7366
+ children: [
7367
+ "Download return label",
7368
+ /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: " (opens in a new tab)" })
7369
+ ]
7370
+ }
7371
+ ),
7372
+ ret.label_email && /* @__PURE__ */ jsxs("p", { className: styles$y.note, children: [
7373
+ "You’ll receive a shipping label PDF to your email as well.",
7374
+ /* @__PURE__ */ jsx("br", {}),
7375
+ ret.label_email
7376
+ ] })
7377
+ ] }),
7378
+ /* @__PURE__ */ jsxs("section", { className: styles$y.step2, children: [
7379
+ /* @__PURE__ */ jsxs("div", { className: styles$y.stepHead, children: [
7380
+ /* @__PURE__ */ jsx("span", { className: styles$y.number, "aria-hidden": "true", children: "2" }),
7381
+ /* @__PURE__ */ jsx("h2", { className: styles$y.stepTitle, children: "Pack and ship the item" })
6570
7382
  ] }),
6571
- /* @__PURE__ */ jsx("span", { className: styles$w.linePrice, children: format(item2.line_total) })
7383
+ /* @__PURE__ */ jsxs("p", { className: styles$y.body2, children: [
7384
+ "Repackage the item securely and attach the return label to the outside of the package.",
7385
+ /* @__PURE__ */ jsx("br", {}),
7386
+ "Drop it off at your local carrier or post office."
7387
+ ] })
6572
7388
  ] })
6573
- ] }, item2.line_ref)) })
7389
+ ] }),
7390
+ onDone && /* @__PURE__ */ jsx(Button, { variant: "primary", fullWidth: true, onClick: onDone, children: "Done" })
6574
7391
  ] });
6575
7392
  }
6576
- function detailsOf$1(item2) {
6577
- const pairs = variantPairs(item2.attributes).map((p) => `${p.label}: ${p.value}`);
6578
- return item2.qty > 1 ? [...pairs, `Qty: ${item2.qty}`] : pairs;
6579
- }
6580
- function toPricing$1(order) {
6581
- return {
6582
- subtotal: order.totals.items,
6583
- shipping: order.totals.shipping,
6584
- tax: order.totals.tax,
6585
- total: order.totals.grand_total
6586
- };
6587
- }
6588
- function shortRef$1(orderRef) {
6589
- return orderRef.replace(/^ord_/, "");
7393
+ const page$3 = "_page_o44fl_8";
7394
+ const titles$1 = "_titles_o44fl_15";
7395
+ const title$i = "_title_o44fl_15";
7396
+ const subtitle$5 = "_subtitle_o44fl_30";
7397
+ const items$1 = "_items_o44fl_38";
7398
+ const item$1 = "_item_o44fl_38";
7399
+ const thumb = "_thumb_o44fl_53";
7400
+ const img = "_img_o44fl_63";
7401
+ const placeholder$6 = "_placeholder_o44fl_67";
7402
+ const meta$1 = "_meta_o44fl_72";
7403
+ const name$1 = "_name_o44fl_80";
7404
+ const attrs = "_attrs_o44fl_100";
7405
+ const price$2 = "_price_o44fl_115";
7406
+ const paid$1 = "_paid_o44fl_124";
7407
+ const was$2 = "_was_o44fl_132";
7408
+ const styles$x = {
7409
+ page: page$3,
7410
+ titles: titles$1,
7411
+ title: title$i,
7412
+ subtitle: subtitle$5,
7413
+ items: items$1,
7414
+ item: item$1,
7415
+ thumb,
7416
+ img,
7417
+ placeholder: placeholder$6,
7418
+ meta: meta$1,
7419
+ name: name$1,
7420
+ attrs,
7421
+ price: price$2,
7422
+ paid: paid$1,
7423
+ was: was$2
7424
+ };
7425
+ function pctOff(item2) {
7426
+ return item2.compare_at_unit_price ? discountPct(item2.unit_price, item2.compare_at_unit_price) : void 0;
6590
7427
  }
6591
- function formatPlaced$1(iso, locale) {
6592
- return new Date(iso).toLocaleDateString(locale, {
7428
+ function ReturnTrackingView({ ret, locale: localeProp }) {
7429
+ const locale = useLocale(localeProp);
7430
+ const { format } = useMoney();
7431
+ const reported = new Date(ret.reported_at).toLocaleDateString(locale, {
6593
7432
  day: "numeric",
6594
7433
  month: "short",
6595
- year: "numeric"
7434
+ year: "numeric",
7435
+ timeZone: "UTC"
6596
7436
  });
7437
+ return /* @__PURE__ */ jsx(ShopSurface, { tone: "light", fill: true, children: /* @__PURE__ */ jsxs("div", { className: styles$x.page, children: [
7438
+ /* @__PURE__ */ jsxs("div", { className: styles$x.titles, children: [
7439
+ /* @__PURE__ */ jsx("h1", { className: styles$x.title, children: "Return in progress" }),
7440
+ /* @__PURE__ */ jsx("p", { className: styles$x.subtitle, children: `Return #${ret.return_ref} · Reported ${reported}` })
7441
+ ] }),
7442
+ /* @__PURE__ */ jsx(OrderTimeline, { progress: ret.progress, locale }),
7443
+ /* @__PURE__ */ jsx("ul", { className: styles$x.items, children: ret.items.map((item2) => /* @__PURE__ */ jsxs("li", { className: styles$x.item, children: [
7444
+ /* @__PURE__ */ jsx("div", { className: styles$x.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$x.img }) : /* @__PURE__ */ jsx("div", { className: styles$x.placeholder, "aria-hidden": "true" }) }),
7445
+ /* @__PURE__ */ jsxs("div", { className: styles$x.meta, children: [
7446
+ /* @__PURE__ */ jsx("p", { className: styles$x.name, children: item2.title ?? item2.sku }),
7447
+ (item2.attributes?.size || pctOff(item2)) && /* @__PURE__ */ jsxs("p", { className: styles$x.attrs, children: [
7448
+ item2.attributes?.size && /* @__PURE__ */ jsx("span", { children: `Size: ${item2.attributes.size}` }),
7449
+ pctOff(item2) !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct: pctOff(item2) })
7450
+ ] })
7451
+ ] }),
7452
+ /* @__PURE__ */ jsxs("div", { className: styles$x.price, children: [
7453
+ /* @__PURE__ */ jsx("span", { className: styles$x.paid, children: format(item2.unit_price) }),
7454
+ item2.compare_at_unit_price && /* @__PURE__ */ jsx("span", { className: styles$x.was, children: format(item2.compare_at_unit_price) })
7455
+ ] })
7456
+ ] }, item2.line_ref)) })
7457
+ ] }) });
6597
7458
  }
6598
- function formatAddress$1(address) {
6599
- return [address.line1, address.line2, address.postcode, address.city, address.country].filter(Boolean).join(", ");
7459
+ function ReturnFlowView(props) {
7460
+ return /* @__PURE__ */ jsx(ShopSurface, { tone: "light", fill: true, children: /* @__PURE__ */ jsx(ReturnFlowContent, { ...props }) });
6600
7461
  }
6601
- const page$2 = "_page_8yxu9_6";
6602
- const confirmed = "_confirmed_8yxu9_16";
6603
- const title$g = "_title_8yxu9_22";
6604
- const headline = "_headline_8yxu9_47";
6605
- const subtitle$3 = "_subtitle_8yxu9_65";
6606
- const lines$1 = "_lines_8yxu9_88";
6607
- const line = "_line_8yxu9_88";
6608
- const thumb = "_thumb_8yxu9_103";
6609
- const image$8 = "_image_8yxu9_113";
6610
- const placeholder$5 = "_placeholder_8yxu9_117";
6611
- const lineBody = "_lineBody_8yxu9_122";
6612
- const lineText = "_lineText_8yxu9_131";
6613
- const lineTitle = "_lineTitle_8yxu9_141";
6614
- const lineMeta = "_lineMeta_8yxu9_160";
6615
- const linePrice = "_linePrice_8yxu9_175";
6616
- const paid = "_paid_8yxu9_187";
6617
- const was$1 = "_was_8yxu9_193";
6618
- const card$2 = "_card_8yxu9_213";
6619
- const cardTitle = "_cardTitle_8yxu9_221";
6620
- const cardBody = "_cardBody_8yxu9_233";
6621
- const summaryCard = "_summaryCard_8yxu9_205";
6622
- const done = "_done_8yxu9_261";
6623
- const styles$v = {
7462
+ function ReturnFlowContent({ orderRef, returnRef, onDone, locale }) {
7463
+ const { api } = useShop();
7464
+ const emit = useShopEvent();
7465
+ const [order, setOrder] = useState(null);
7466
+ const [ret, setRet] = useState(null);
7467
+ const [state, setState] = useState("loading");
7468
+ const [errorCode, setErrorCode] = useState(void 0);
7469
+ const [busy, setBusy] = useState(false);
7470
+ const load = useCallback(async () => {
7471
+ setState("loading");
7472
+ try {
7473
+ if (returnRef) {
7474
+ setRet(await api.returns.get(returnRef));
7475
+ } else if (orderRef) {
7476
+ setOrder(await api.orders.get(orderRef));
7477
+ }
7478
+ setState("ready");
7479
+ } catch (err) {
7480
+ setErrorCode(codeOf(err));
7481
+ setState("error");
7482
+ }
7483
+ }, [api, orderRef, returnRef]);
7484
+ useEffect(() => {
7485
+ void load();
7486
+ }, [load]);
7487
+ async function submit(items2) {
7488
+ if (!orderRef) return;
7489
+ setBusy(true);
7490
+ try {
7491
+ const created = await api.orders.createReturn(orderRef, { items: items2 });
7492
+ setRet(created);
7493
+ emit({ type: "return_requested", orderRef, returnRef: created.return_ref });
7494
+ } catch (err) {
7495
+ setErrorCode(codeOf(err));
7496
+ setState("error");
7497
+ setBusy(false);
7498
+ }
7499
+ }
7500
+ if (state === "loading") {
7501
+ return /* @__PURE__ */ jsx(
7502
+ "div",
7503
+ {
7504
+ style: {
7505
+ padding: "var(--space-16)",
7506
+ display: "flex",
7507
+ flexDirection: "column",
7508
+ gap: "var(--space-16)"
7509
+ },
7510
+ children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(Skeleton, { height: 88, radius: 8 }, i))
7511
+ }
7512
+ );
7513
+ }
7514
+ if (state === "error") {
7515
+ return /* @__PURE__ */ jsx(ErrorState, { code: errorCode, onRetry: () => void load() });
7516
+ }
7517
+ if (ret) {
7518
+ return ret.status === "reported" ? /* @__PURE__ */ jsx(ReturnLabelView, { ret, ...onDone ? { onDone } : {} }) : /* @__PURE__ */ jsx(ReturnTrackingView, { ret, ...locale ? { locale } : {} });
7519
+ }
7520
+ if (!order) {
7521
+ return /* @__PURE__ */ jsx(ErrorState, { code: errorCode, onRetry: () => void load() });
7522
+ }
7523
+ if (!order.can_return) {
7524
+ return /* @__PURE__ */ jsx(ErrorState, { code: "order_not_cancellable", onRetry: () => void load() });
7525
+ }
7526
+ return /* @__PURE__ */ jsx(ReturnItemsView, { order, onSubmit: (items2) => void submit(items2), busy });
7527
+ }
7528
+ const page$2 = "_page_1s8l9_6";
7529
+ const confirmed = "_confirmed_1s8l9_16";
7530
+ const title$h = "_title_1s8l9_22";
7531
+ const headline = "_headline_1s8l9_47";
7532
+ const subtitle$4 = "_subtitle_1s8l9_65";
7533
+ const done = "_done_1s8l9_87";
7534
+ const styles$w = {
6624
7535
  page: page$2,
6625
7536
  confirmed,
6626
- title: title$g,
7537
+ title: title$h,
6627
7538
  headline,
6628
- subtitle: subtitle$3,
6629
- lines: lines$1,
6630
- line,
6631
- thumb,
6632
- image: image$8,
6633
- placeholder: placeholder$5,
6634
- lineBody,
6635
- lineText,
6636
- lineTitle,
6637
- lineMeta,
6638
- linePrice,
6639
- paid,
6640
- was: was$1,
6641
- card: card$2,
6642
- cardTitle,
6643
- cardBody,
6644
- summaryCard,
7539
+ subtitle: subtitle$4,
6645
7540
  done
6646
7541
  };
6647
- const SUMMARY_ROWS = [
6648
- { label: "Subtotal", key: "subtotal" },
6649
- { label: "Discount", key: "discount" },
6650
- { label: "Shipping", key: "shipping" },
6651
- { label: "Total", key: "total" }
6652
- ];
6653
7542
  function OrderConfirmationView(props) {
6654
7543
  return /* @__PURE__ */ jsx(ShopSurface, { tone: "light", fill: true, children: /* @__PURE__ */ jsx(OrderConfirmationContent, { ...props }) });
6655
7544
  }
@@ -6673,7 +7562,7 @@ function OrderConfirmationContent({ orderRef, locale: localeProp, onDone }) {
6673
7562
  void load();
6674
7563
  }, [load]);
6675
7564
  if (state === "loading") {
6676
- return /* @__PURE__ */ jsxs("div", { className: styles$v.page, children: [
7565
+ return /* @__PURE__ */ jsxs("div", { className: styles$w.page, children: [
6677
7566
  /* @__PURE__ */ jsx(Skeleton, { height: 140, radius: 8 }),
6678
7567
  /* @__PURE__ */ jsx(Skeleton, { height: 72, radius: 8 }),
6679
7568
  /* @__PURE__ */ jsx(Skeleton, { height: 120, radius: 18 }),
@@ -6683,84 +7572,32 @@ function OrderConfirmationContent({ orderRef, locale: localeProp, onDone }) {
6683
7572
  if (state === "error" || !order) {
6684
7573
  return /* @__PURE__ */ jsx(ErrorState, { code: errorCode, onRetry: () => void load() });
6685
7574
  }
6686
- return /* @__PURE__ */ jsxs("div", { className: styles$v.page, children: [
6687
- /* @__PURE__ */ jsxs("section", { className: styles$v.confirmed, "aria-label": "Order confirmation", children: [
6688
- /* @__PURE__ */ jsxs("div", { className: styles$v.title, children: [
6689
- /* @__PURE__ */ jsx("h1", { className: styles$v.headline, children: "Your order is confirmed" }),
6690
- order.email && /* @__PURE__ */ jsx("p", { className: styles$v.subtitle, children: `We’ve sent a confirmation to ${order.email}` })
7575
+ return /* @__PURE__ */ jsxs("div", { className: styles$w.page, children: [
7576
+ /* @__PURE__ */ jsxs("section", { className: styles$w.confirmed, "aria-label": "Order confirmation", children: [
7577
+ /* @__PURE__ */ jsxs("div", { className: styles$w.title, children: [
7578
+ /* @__PURE__ */ jsx("h1", { className: styles$w.headline, children: "Your order is confirmed" }),
7579
+ order.email && /* @__PURE__ */ jsx("p", { className: styles$w.subtitle, children: `We’ve sent a confirmation to ${order.email}` })
6691
7580
  ] }),
6692
- /* @__PURE__ */ jsx(OrderTimeline, { progress: order.progress, locale })
6693
- ] }),
6694
- /* @__PURE__ */ jsx("ul", { className: styles$v.lines, "aria-label": "Items", children: order.items.map((item2) => /* @__PURE__ */ jsx(ConfirmationLine, { item: item2 }, item2.line_ref)) }),
6695
- /* @__PURE__ */ jsxs("section", { className: styles$v.card, "aria-label": "Shipping address", children: [
6696
- /* @__PURE__ */ jsx("h2", { className: styles$v.cardTitle, children: "Shipping address" }),
6697
- /* @__PURE__ */ jsx("p", { className: styles$v.cardBody, children: formatAddress(order.ship_to) })
6698
- ] }),
6699
- /* @__PURE__ */ jsxs("section", { className: [styles$v.card, styles$v.summaryCard].join(" "), "aria-label": "Order summary", children: [
6700
- /* @__PURE__ */ jsx("h2", { className: styles$v.cardTitle, children: "Order summary" }),
6701
7581
  /* @__PURE__ */ jsx(
6702
- OrderSummary,
7582
+ OrderTimeline,
6703
7583
  {
6704
- pricing: toPricing(order),
6705
- rows: rowsFor(order),
6706
- discount: order.totals.discount
7584
+ progress: order.progress,
7585
+ ...order.estimated_delivery ? { estimatedDelivery: order.estimated_delivery } : {},
7586
+ locale
6707
7587
  }
6708
7588
  )
6709
7589
  ] }),
6710
- onDone && /* @__PURE__ */ jsx(Button, { variant: "secondary", fullWidth: true, className: styles$v.done, onClick: onDone, children: "Done" })
6711
- ] });
6712
- }
6713
- function ConfirmationLine({ item: item2 }) {
6714
- const { format } = useMoney();
6715
- const compareAt2 = item2.compare_at_unit_price;
6716
- const pct = compareAt2 ? discountPct(item2.unit_price, compareAt2) : void 0;
6717
- const details2 = detailsOf(item2);
6718
- return /* @__PURE__ */ jsxs("li", { className: styles$v.line, children: [
6719
- /* @__PURE__ */ jsx("div", { className: styles$v.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$v.image }) : /* @__PURE__ */ jsx("div", { className: styles$v.placeholder, "aria-hidden": "true" }) }),
6720
- /* @__PURE__ */ jsxs("div", { className: styles$v.lineBody, children: [
6721
- /* @__PURE__ */ jsxs("div", { className: styles$v.lineText, children: [
6722
- /* @__PURE__ */ jsx("span", { className: styles$v.lineTitle, children: item2.title ?? item2.sku }),
6723
- /* @__PURE__ */ jsxs("span", { className: styles$v.lineMeta, children: [
6724
- details2.map((detail2) => /* @__PURE__ */ jsx("span", { children: detail2 }, detail2)),
6725
- pct !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct })
6726
- ] })
6727
- ] }),
6728
- /* @__PURE__ */ jsxs("span", { className: styles$v.linePrice, children: [
6729
- /* @__PURE__ */ jsx("span", { className: styles$v.paid, children: format(item2.line_total) }),
6730
- compareAt2 && /* @__PURE__ */ jsxs("span", { className: styles$v.was, children: [
6731
- /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(compareAt2)}` }),
6732
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(compareAt2) })
6733
- ] })
6734
- ] })
6735
- ] })
7590
+ /* @__PURE__ */ jsx(OrderLines, { order }),
7591
+ /* @__PURE__ */ jsx(ShippingAddressCard, { order }),
7592
+ /* @__PURE__ */ jsx(OrderSummaryCard, { order }),
7593
+ onDone && /* @__PURE__ */ jsx(Button, { variant: "secondary", fullWidth: true, className: styles$w.done, onClick: onDone, children: "Done" })
6736
7594
  ] });
6737
7595
  }
6738
- function detailsOf(item2) {
6739
- const pairs = variantPairs(item2.attributes).map((p) => `${p.label}: ${p.value}`);
6740
- return item2.qty > 1 ? [...pairs, `Qty: ${item2.qty}`] : pairs;
6741
- }
6742
- function rowsFor(order) {
6743
- if (order.totals.tax.amount === 0) return SUMMARY_ROWS;
6744
- return SUMMARY_ROWS.flatMap(
6745
- (row2) => row2.key === "shipping" ? [row2, { label: "Tax", key: "tax" }] : [row2]
6746
- );
6747
- }
6748
- function toPricing(order) {
6749
- return {
6750
- subtotal: order.totals.items,
6751
- shipping: order.totals.shipping,
6752
- tax: order.totals.tax,
6753
- total: order.totals.grand_total
6754
- };
6755
- }
6756
- function formatAddress(address) {
6757
- return [address.line1, address.line2, address.postcode, address.city, address.country].filter(Boolean).join(", ");
6758
- }
6759
7596
  const badge$2 = "_badge_ghd02_6";
6760
7597
  const progress = "_progress_ghd02_22";
6761
7598
  const delivered = "_delivered_ghd02_27";
6762
7599
  const cancelled = "_cancelled_ghd02_32";
6763
- const styles$u = {
7600
+ const styles$v = {
6764
7601
  badge: badge$2,
6765
7602
  progress,
6766
7603
  delivered,
@@ -6780,28 +7617,28 @@ const TONE = {
6780
7617
  delivered: "delivered",
6781
7618
  cancelled: "cancelled"
6782
7619
  };
6783
- function OrderStatusBadge({ status: status2 }) {
6784
- const label2 = LABEL[status2] ?? status2.replace(/_/g, " ");
6785
- const tone = TONE[status2] ?? "progress";
6786
- return /* @__PURE__ */ jsx("span", { className: [styles$u.badge, styles$u[tone]].join(" "), children: label2 });
6787
- }
6788
- const page$1 = "_page_y686q_2";
6789
- const empty = "_empty_y686q_11";
6790
- const cta$1 = "_cta_y686q_22";
6791
- const card$1 = "_card_y686q_45";
6792
- const tappable = "_tappable_y686q_60";
6793
- const head$1 = "_head_y686q_69";
6794
- const heading = "_heading_y686q_77";
6795
- const title$f = "_title_y686q_86";
6796
- const date = "_date_y686q_97";
6797
- const bottom$1 = "_bottom_y686q_102";
6798
- const strip = "_strip_y686q_110";
6799
- const tile$2 = "_tile_y686q_115";
6800
- const image$7 = "_image_y686q_125";
6801
- const placeholder$4 = "_placeholder_y686q_129";
6802
- const more = "_more_y686q_136";
6803
- const chevron$3 = "_chevron_y686q_149";
6804
- const styles$t = {
7620
+ function OrderStatusBadge({ status }) {
7621
+ const label2 = LABEL[status] ?? status.replace(/_/g, " ");
7622
+ const tone = TONE[status] ?? "progress";
7623
+ return /* @__PURE__ */ jsx("span", { className: [styles$v.badge, styles$v[tone]].join(" "), children: label2 });
7624
+ }
7625
+ const page$1 = "_page_6xodo_2";
7626
+ const empty = "_empty_6xodo_22";
7627
+ const cta$1 = "_cta_6xodo_32";
7628
+ const card$1 = "_card_6xodo_55";
7629
+ const tappable = "_tappable_6xodo_70";
7630
+ const head$1 = "_head_6xodo_79";
7631
+ const heading = "_heading_6xodo_87";
7632
+ const title$g = "_title_6xodo_96";
7633
+ const date = "_date_6xodo_115";
7634
+ const bottom$1 = "_bottom_6xodo_120";
7635
+ const strip = "_strip_6xodo_128";
7636
+ const tile$2 = "_tile_6xodo_133";
7637
+ const image$8 = "_image_6xodo_143";
7638
+ const placeholder$5 = "_placeholder_6xodo_147";
7639
+ const more = "_more_6xodo_154";
7640
+ const chevron$3 = "_chevron_6xodo_167";
7641
+ const styles$u = {
6805
7642
  page: page$1,
6806
7643
  empty,
6807
7644
  cta: cta$1,
@@ -6809,28 +7646,25 @@ const styles$t = {
6809
7646
  tappable,
6810
7647
  head: head$1,
6811
7648
  heading,
6812
- title: title$f,
7649
+ title: title$g,
6813
7650
  date,
6814
7651
  bottom: bottom$1,
6815
7652
  strip,
6816
7653
  tile: tile$2,
6817
- image: image$7,
6818
- placeholder: placeholder$4,
7654
+ image: image$8,
7655
+ placeholder: placeholder$5,
6819
7656
  more,
6820
7657
  chevron: chevron$3
6821
7658
  };
6822
7659
  const TILES = 3;
6823
7660
  function Chevron() {
6824
- return /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
7661
+ return /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { transform: "translate(8 4.82)", children: /* @__PURE__ */ jsx(
6825
7662
  "path",
6826
7663
  {
6827
- d: "M9 5.5l6.5 6.5L9 18.5",
6828
- stroke: "currentColor",
6829
- strokeWidth: "1.8",
6830
- strokeLinecap: "round",
6831
- strokeLinejoin: "round"
7664
+ d: "M0.292893 0.292893C0.683418 -0.0976311 1.31643 -0.0976311 1.70696 0.292893L7.70696 6.29289C8.09748 6.68342 8.09748 7.31643 7.70696 7.70696L1.70696 13.707C1.31643 14.0975 0.683417 14.0975 0.292893 13.707C-0.0976311 13.3164 -0.0976311 12.6834 0.292893 12.2929L5.58586 6.99992L0.292893 1.70696C-0.0976311 1.31643 -0.0976311 0.683418 0.292893 0.292893Z",
7665
+ fill: "currentColor"
6832
7666
  }
6833
- ) });
7667
+ ) }) });
6834
7668
  }
6835
7669
  function OrderListView(props) {
6836
7670
  return /* @__PURE__ */ jsx(ShopSurface, { tone: "light", fill: true, children: /* @__PURE__ */ jsx(OrderListContent, { ...props }) });
@@ -6856,7 +7690,7 @@ function OrderListContent({ onOpenOrder, onStartShopping, locale: localeProp })
6856
7690
  void load();
6857
7691
  }, [load]);
6858
7692
  if (state === "loading") {
6859
- return /* @__PURE__ */ jsxs("div", { className: styles$t.page, children: [
7693
+ return /* @__PURE__ */ jsxs("div", { className: styles$u.page, children: [
6860
7694
  /* @__PURE__ */ jsx(Skeleton, { height: 148, radius: 12 }),
6861
7695
  /* @__PURE__ */ jsx(Skeleton, { height: 148, radius: 12 }),
6862
7696
  /* @__PURE__ */ jsx(Skeleton, { height: 148, radius: 12 })
@@ -6866,18 +7700,18 @@ function OrderListContent({ onOpenOrder, onStartShopping, locale: localeProp })
6866
7700
  return /* @__PURE__ */ jsx(ErrorState, { code: errorCode, onRetry: () => void load() });
6867
7701
  }
6868
7702
  if (orders2.length === 0) {
6869
- return /* @__PURE__ */ jsx("div", { className: styles$t.empty, children: /* @__PURE__ */ jsx(
7703
+ return /* @__PURE__ */ jsx("div", { className: styles$u.empty, children: /* @__PURE__ */ jsx(
6870
7704
  EmptyState,
6871
7705
  {
6872
7706
  title: "Nothing here yet",
6873
7707
  body: "Your orders will show up here once you've shopped.",
6874
7708
  ...onStartShopping ? {
6875
- action: /* @__PURE__ */ jsx("button", { type: "button", className: styles$t.cta, onClick: onStartShopping, children: "Find my fit" })
7709
+ action: /* @__PURE__ */ jsx("button", { type: "button", className: styles$u.cta, onClick: onStartShopping, children: "Continue shopping" })
6876
7710
  } : {}
6877
7711
  }
6878
7712
  ) });
6879
7713
  }
6880
- return /* @__PURE__ */ jsx("ul", { className: styles$t.page, children: orders2.map((order) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
7714
+ return /* @__PURE__ */ jsx("ul", { className: styles$u.page, children: orders2.map((order) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
6881
7715
  OrderCard,
6882
7716
  {
6883
7717
  order,
@@ -6891,28 +7725,28 @@ function OrderCard({
6891
7725
  locale,
6892
7726
  onOpen
6893
7727
  }) {
6894
- const body2 = /* @__PURE__ */ jsxs(Fragment, { children: [
6895
- /* @__PURE__ */ jsxs("div", { className: styles$t.head, children: [
6896
- /* @__PURE__ */ jsxs("div", { className: styles$t.heading, children: [
6897
- /* @__PURE__ */ jsx("span", { className: styles$t.title, children: `Order #${shortRef(order.order_ref)}` }),
6898
- /* @__PURE__ */ jsx("span", { className: styles$t.date, children: formatPlaced(order.placed_at, locale) })
7728
+ const body3 = /* @__PURE__ */ jsxs(Fragment, { children: [
7729
+ /* @__PURE__ */ jsxs("div", { className: styles$u.head, children: [
7730
+ /* @__PURE__ */ jsxs("div", { className: styles$u.heading, children: [
7731
+ /* @__PURE__ */ jsx("span", { className: styles$u.title, children: `Order #${shortRef(order.order_ref)}` }),
7732
+ /* @__PURE__ */ jsx("span", { className: styles$u.date, children: formatPlaced(order.placed_at, locale) })
6899
7733
  ] }),
6900
7734
  /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.status })
6901
7735
  ] }),
6902
- /* @__PURE__ */ jsxs("div", { className: styles$t.bottom, children: [
7736
+ /* @__PURE__ */ jsxs("div", { className: styles$u.bottom, children: [
6903
7737
  /* @__PURE__ */ jsx(Thumbnails, { order }),
6904
- onOpen && /* @__PURE__ */ jsx("span", { className: styles$t.chevron, children: /* @__PURE__ */ jsx(Chevron, {}) })
7738
+ onOpen && /* @__PURE__ */ jsx("span", { className: styles$u.chevron, children: /* @__PURE__ */ jsx(Chevron, {}) })
6905
7739
  ] })
6906
7740
  ] });
6907
- if (!onOpen) return /* @__PURE__ */ jsx("div", { className: styles$t.card, children: body2 });
7741
+ if (!onOpen) return /* @__PURE__ */ jsx("div", { className: styles$u.card, children: body3 });
6908
7742
  return /* @__PURE__ */ jsx(
6909
7743
  "button",
6910
7744
  {
6911
7745
  type: "button",
6912
- className: [styles$t.card, styles$t.tappable].join(" "),
7746
+ className: [styles$u.card, styles$u.tappable].join(" "),
6913
7747
  onClick: onOpen,
6914
7748
  "aria-label": `Order ${shortRef(order.order_ref)}, ${order.headline}`,
6915
- children: body2
7749
+ children: body3
6916
7750
  }
6917
7751
  );
6918
7752
  }
@@ -6921,13 +7755,13 @@ function Thumbnails({ order }) {
6921
7755
  const hidden = order.item_count - TILES + 1;
6922
7756
  const overflow = images.length >= TILES && hidden > 1 ? hidden : 0;
6923
7757
  if (images.length === 0) {
6924
- return /* @__PURE__ */ jsx("div", { className: styles$t.strip, children: /* @__PURE__ */ jsx("div", { className: [styles$t.tile, styles$t.placeholder].join(" "), "aria-hidden": "true" }) });
7758
+ return /* @__PURE__ */ jsx("div", { className: styles$u.strip, children: /* @__PURE__ */ jsx("div", { className: [styles$u.tile, styles$u.placeholder].join(" "), "aria-hidden": "true" }) });
6925
7759
  }
6926
- return /* @__PURE__ */ jsx("div", { className: styles$t.strip, children: images.map((src, i) => {
7760
+ return /* @__PURE__ */ jsx("div", { className: styles$u.strip, children: images.map((src, i) => {
6927
7761
  const last = i === images.length - 1;
6928
- return /* @__PURE__ */ jsxs("div", { className: styles$t.tile, children: [
6929
- /* @__PURE__ */ jsx(ShopImage, { src, alt: "", fill: true, sizes: "56px", className: styles$t.image }),
6930
- overflow > 0 && last && /* @__PURE__ */ jsxs("span", { className: styles$t.more, children: [
7762
+ return /* @__PURE__ */ jsxs("div", { className: styles$u.tile, children: [
7763
+ /* @__PURE__ */ jsx(ShopImage, { src, alt: "", fill: true, sizes: "56px", className: styles$u.image }),
7764
+ overflow > 0 && last && /* @__PURE__ */ jsxs("span", { className: styles$u.more, children: [
6931
7765
  /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", children: [
6932
7766
  "+",
6933
7767
  overflow
@@ -6945,32 +7779,32 @@ function formatPlaced(iso, locale) {
6945
7779
  const day = date2.toLocaleDateString(locale, { day: "numeric", month: "short" });
6946
7780
  return `${day}, ${date2.toLocaleDateString(locale, { year: "numeric" })}`;
6947
7781
  }
6948
- const tile$1 = "_tile_1u9l8_3";
6949
- const media$2 = "_media_1u9l8_11";
6950
- const image$6 = "_image_1u9l8_21";
6951
- const placeholder$3 = "_placeholder_1u9l8_25";
6952
- const topBadge = "_topBadge_1u9l8_33";
6953
- const saleBadge$1 = "_saleBadge_1u9l8_56";
6954
- const oos$2 = "_oos_1u9l8_63";
6955
- const bottom = "_bottom_1u9l8_88";
6956
- const titlePrice$1 = "_titlePrice_1u9l8_1";
6957
- const title$e = "_title_1u9l8_1";
6958
- const swatches = "_swatches_1u9l8_119";
6959
- const swatch = "_swatch_1u9l8_119";
6960
- const swatchActive = "_swatchActive_1u9l8_132";
6961
- const swatchDot = "_swatchDot_1u9l8_136";
6962
- const large = "_large_1u9l8_147";
6963
- const styles$s = {
7782
+ const tile$1 = "_tile_1io44_7";
7783
+ const media$2 = "_media_1io44_15";
7784
+ const image$7 = "_image_1io44_25";
7785
+ const placeholder$4 = "_placeholder_1io44_29";
7786
+ const topBadge = "_topBadge_1io44_37";
7787
+ const saleBadge$2 = "_saleBadge_1io44_78";
7788
+ const oos$3 = "_oos_1io44_86";
7789
+ const bottom = "_bottom_1io44_113";
7790
+ const titlePrice$1 = "_titlePrice_1io44_100";
7791
+ const title$f = "_title_1io44_5";
7792
+ const swatches = "_swatches_1io44_179";
7793
+ const swatch = "_swatch_1io44_179";
7794
+ const swatchActive = "_swatchActive_1io44_196";
7795
+ const swatchDot = "_swatchDot_1io44_200";
7796
+ const large = "_large_1io44_211";
7797
+ const styles$t = {
6964
7798
  tile: tile$1,
6965
7799
  media: media$2,
6966
- image: image$6,
6967
- placeholder: placeholder$3,
7800
+ image: image$7,
7801
+ placeholder: placeholder$4,
6968
7802
  topBadge,
6969
- saleBadge: saleBadge$1,
6970
- oos: oos$2,
7803
+ saleBadge: saleBadge$2,
7804
+ oos: oos$3,
6971
7805
  bottom,
6972
7806
  titlePrice: titlePrice$1,
6973
- title: title$e,
7807
+ title: title$f,
6974
7808
  swatches,
6975
7809
  swatch,
6976
7810
  swatchActive,
@@ -6987,9 +7821,9 @@ function ProductTile({ product, priority, size = "default" }) {
6987
7821
  ShopLink,
6988
7822
  {
6989
7823
  to: `/product/${encodeURIComponent(product.sku)}`,
6990
- className: [styles$s.tile, size === "large" ? styles$s.large : ""].join(" "),
7824
+ className: [styles$t.tile, size === "large" ? styles$t.large : ""].join(" "),
6991
7825
  children: [
6992
- /* @__PURE__ */ jsxs("div", { className: styles$s.media, children: [
7826
+ /* @__PURE__ */ jsxs("div", { className: styles$t.media, children: [
6993
7827
  image2 ? /* @__PURE__ */ jsx(
6994
7828
  ShopImage,
6995
7829
  {
@@ -6997,17 +7831,17 @@ function ProductTile({ product, priority, size = "default" }) {
6997
7831
  alt: product.title,
6998
7832
  fill: true,
6999
7833
  sizes: size === "large" ? "(max-width: 480px) 100vw, 480px" : "(max-width: 480px) 45vw, 200px",
7000
- className: styles$s.image,
7834
+ className: styles$t.image,
7001
7835
  priority
7002
7836
  }
7003
- ) : /* @__PURE__ */ jsx("div", { className: styles$s.placeholder, "aria-hidden": "true" }),
7004
- anyInStock && topBadge2 && /* @__PURE__ */ jsx("span", { className: styles$s.topBadge, children: topBadge2 }),
7005
- anyInStock && pct !== void 0 && /* @__PURE__ */ jsx("span", { className: styles$s.saleBadge, children: /* @__PURE__ */ jsx(SaleBadge, { pct }) }),
7006
- !anyInStock && /* @__PURE__ */ jsx("span", { className: styles$s.oos, children: "Out of stock" })
7837
+ ) : /* @__PURE__ */ jsx("div", { className: styles$t.placeholder, "aria-hidden": "true" }),
7838
+ anyInStock && topBadge2 && /* @__PURE__ */ jsx("span", { className: styles$t.topBadge, children: topBadge2 }),
7839
+ anyInStock && pct !== void 0 && /* @__PURE__ */ jsx("span", { className: styles$t.saleBadge, children: /* @__PURE__ */ jsx(SaleBadge, { pct }) }),
7840
+ !anyInStock && /* @__PURE__ */ jsx("span", { className: styles$t.oos, children: "Out of stock" })
7007
7841
  ] }),
7008
- /* @__PURE__ */ jsxs("div", { className: styles$s.bottom, children: [
7009
- /* @__PURE__ */ jsxs("div", { className: styles$s.titlePrice, children: [
7010
- /* @__PURE__ */ jsx("span", { className: styles$s.title, children: product.title }),
7842
+ /* @__PURE__ */ jsxs("div", { className: styles$t.bottom, children: [
7843
+ /* @__PURE__ */ jsxs("div", { className: styles$t.titlePrice, children: [
7844
+ /* @__PURE__ */ jsx("span", { className: styles$t.title, children: product.title }),
7011
7845
  /* @__PURE__ */ jsx(
7012
7846
  PriceBlock,
7013
7847
  {
@@ -7019,11 +7853,11 @@ function ProductTile({ product, priority, size = "default" }) {
7019
7853
  }
7020
7854
  )
7021
7855
  ] }),
7022
- swatches2.length > 0 && /* @__PURE__ */ jsx("div", { className: styles$s.swatches, "aria-hidden": "true", children: swatches2.map((c, i) => /* @__PURE__ */ jsx(
7856
+ swatches2.length > 0 && /* @__PURE__ */ jsx("div", { className: styles$t.swatches, "aria-hidden": "true", children: swatches2.map((c, i) => /* @__PURE__ */ jsx(
7023
7857
  "span",
7024
7858
  {
7025
- className: [styles$s.swatch, i === 0 ? styles$s.swatchActive : ""].join(" "),
7026
- children: /* @__PURE__ */ jsx("span", { className: styles$s.swatchDot, style: { background: swatchColour(c.value) } })
7859
+ className: [styles$t.swatch, i === 0 ? styles$t.swatchActive : ""].join(" "),
7860
+ children: /* @__PURE__ */ jsx("span", { className: styles$t.swatchDot, style: { background: swatchColour(c.value) } })
7027
7861
  },
7028
7862
  c.value
7029
7863
  )) })
@@ -7032,6 +7866,72 @@ function ProductTile({ product, priority, size = "default" }) {
7032
7866
  }
7033
7867
  );
7034
7868
  }
7869
+ const section$3 = "_section_1n5an_5";
7870
+ const title$e = "_title_1n5an_17";
7871
+ const link = "_link_1n5an_26";
7872
+ const track$4 = "_track_1n5an_38";
7873
+ const frame = "_frame_1n5an_58";
7874
+ const image$6 = "_image_1n5an_69";
7875
+ const placeholder$3 = "_placeholder_1n5an_73";
7876
+ const saleBadge$1 = "_saleBadge_1n5an_85";
7877
+ const oos$2 = "_oos_1n5an_93";
7878
+ const caption = "_caption_1n5an_109";
7879
+ const name = "_name_1n5an_122";
7880
+ const price$1 = "_price_1n5an_135";
7881
+ const paid = "_paid_1n5an_144";
7882
+ const was$1 = "_was_1n5an_150";
7883
+ const styles$s = {
7884
+ section: section$3,
7885
+ title: title$e,
7886
+ link,
7887
+ track: track$4,
7888
+ frame,
7889
+ image: image$6,
7890
+ placeholder: placeholder$3,
7891
+ saleBadge: saleBadge$1,
7892
+ oos: oos$2,
7893
+ caption,
7894
+ name,
7895
+ price: price$1,
7896
+ paid,
7897
+ was: was$1
7898
+ };
7899
+ function ProductGallery({ title: title2, product }) {
7900
+ const { format } = useMoney();
7901
+ const pct = product.compare_at ? discountPct(product.price, product.compare_at) : void 0;
7902
+ const inStock = product.variants.some((v) => v.in_stock);
7903
+ const images = product.media.length > 0 ? product.media : [void 0];
7904
+ return /* @__PURE__ */ jsxs("section", { className: styles$s.section, "aria-labelledby": `gallery-${product.sku}`, children: [
7905
+ /* @__PURE__ */ jsx("h2", { className: styles$s.title, id: `gallery-${product.sku}`, children: title2 }),
7906
+ /* @__PURE__ */ jsxs(ShopLink, { to: `/product/${encodeURIComponent(product.sku)}`, className: styles$s.link, children: [
7907
+ /* @__PURE__ */ jsx("ul", { className: styles$s.track, "aria-label": `${product.title} photographs`, children: images.map((src, i) => /* @__PURE__ */ jsxs("li", { className: styles$s.frame, children: [
7908
+ src ? /* @__PURE__ */ jsx(
7909
+ ShopImage,
7910
+ {
7911
+ src,
7912
+ alt: "",
7913
+ fill: true,
7914
+ sizes: "165px",
7915
+ className: styles$s.image,
7916
+ ...i === 0 ? { priority: true } : {}
7917
+ }
7918
+ ) : /* @__PURE__ */ jsx("div", { className: styles$s.placeholder, "aria-hidden": "true" }),
7919
+ i === 0 && inStock && pct !== void 0 && /* @__PURE__ */ jsx("span", { className: styles$s.saleBadge, children: /* @__PURE__ */ jsx(SaleBadge, { pct }) }),
7920
+ i === 0 && !inStock && /* @__PURE__ */ jsx("span", { className: styles$s.oos, children: "Out of stock" })
7921
+ ] }, src ?? i)) }),
7922
+ /* @__PURE__ */ jsxs("div", { className: styles$s.caption, children: [
7923
+ /* @__PURE__ */ jsx("span", { className: styles$s.name, children: product.title }),
7924
+ /* @__PURE__ */ jsxs("span", { className: styles$s.price, children: [
7925
+ /* @__PURE__ */ jsx("span", { className: styles$s.paid, children: format(product.price) }),
7926
+ product.compare_at && /* @__PURE__ */ jsxs("span", { className: styles$s.was, children: [
7927
+ /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(product.compare_at)}` }),
7928
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(product.compare_at) })
7929
+ ] })
7930
+ ] })
7931
+ ] })
7932
+ ] })
7933
+ ] });
7934
+ }
7035
7935
  const bar$1 = "_bar_fn0g9_1";
7036
7936
  const chips$1 = "_chips_fn0g9_8";
7037
7937
  const chip$1 = "_chip_fn0g9_8";
@@ -7133,16 +8033,16 @@ function ProductGrid({
7133
8033
  /* @__PURE__ */ jsx("div", { ref: sentinelRef, "aria-hidden": "true" })
7134
8034
  ] });
7135
8035
  }
7136
- const rail = "_rail_5z5e9_2";
7137
- const header$6 = "_header_5z5e9_9";
7138
- const title$d = "_title_5z5e9_16";
7139
- const seeAll = "_seeAll_5z5e9_22";
7140
- const track$3 = "_track_5z5e9_28";
7141
- const item = "_item_5z5e9_45";
7142
- const inset = "_inset_5z5e9_57";
8036
+ const rail = "_rail_11l7h_7";
8037
+ const header$5 = "_header_11l7h_14";
8038
+ const title$d = "_title_11l7h_21";
8039
+ const seeAll = "_seeAll_11l7h_27";
8040
+ const track$3 = "_track_11l7h_33";
8041
+ const item = "_item_11l7h_50";
8042
+ const inset = "_inset_11l7h_62";
7143
8043
  const styles$p = {
7144
8044
  rail,
7145
- header: header$6,
8045
+ header: header$5,
7146
8046
  title: title$d,
7147
8047
  seeAll,
7148
8048
  track: track$3,
@@ -7159,71 +8059,26 @@ function RailCarousel({ title: title2, products, seeAllTo, inset: inset2 }) {
7159
8059
  /* @__PURE__ */ jsx("ul", { className: styles$p.track, children: products.map((product, i) => /* @__PURE__ */ jsx("li", { className: styles$p.item, children: /* @__PURE__ */ jsx(ProductTile, { product, priority: i < 2 }) }, product.sku)) })
7160
8060
  ] });
7161
8061
  }
7162
- const FOCUSABLE = 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])';
7163
- function useModalDialog(open, onClose, ref) {
7164
- const handleKeyDown = useCallback(
7165
- (e) => {
7166
- if (e.key === "Escape") {
7167
- e.preventDefault();
7168
- onClose();
7169
- return;
7170
- }
7171
- if (e.key !== "Tab") return;
7172
- const dialog = ref.current;
7173
- if (!dialog) return;
7174
- const focusables = Array.from(dialog.querySelectorAll(FOCUSABLE)).filter(
7175
- (el) => el.offsetParent !== null || el === document.activeElement
7176
- );
7177
- if (focusables.length === 0) {
7178
- e.preventDefault();
7179
- return;
7180
- }
7181
- const first = focusables[0];
7182
- const last = focusables[focusables.length - 1];
7183
- if (e.shiftKey && document.activeElement === first) {
7184
- e.preventDefault();
7185
- last.focus();
7186
- } else if (!e.shiftKey && document.activeElement === last) {
7187
- e.preventDefault();
7188
- first.focus();
7189
- }
7190
- },
7191
- [onClose, ref]
7192
- );
7193
- useEffect(() => {
7194
- if (!open) return;
7195
- const previouslyFocused = document.activeElement;
7196
- document.addEventListener("keydown", handleKeyDown);
7197
- ref.current?.querySelector(FOCUSABLE)?.focus();
7198
- const { overflow } = document.body.style;
7199
- document.body.style.overflow = "hidden";
7200
- return () => {
7201
- document.removeEventListener("keydown", handleKeyDown);
7202
- document.body.style.overflow = overflow;
7203
- previouslyFocused?.focus?.();
7204
- };
7205
- }, [open, handleKeyDown, ref]);
7206
- }
7207
8062
  const overlay$2 = "_overlay_s4eai_1";
7208
8063
  const scrim$4 = "_scrim_s4eai_10";
7209
8064
  const sheet$2 = "_sheet_s4eai_16";
7210
8065
  const grabArea = "_grabArea_s4eai_41";
7211
- const grabber$1 = "_grabber_s4eai_51";
7212
- const header$5 = "_header_s4eai_59";
8066
+ const grabber = "_grabber_s4eai_51";
8067
+ const header$4 = "_header_s4eai_59";
7213
8068
  const title$c = "_title_s4eai_67";
7214
- const close$2 = "_close_s4eai_71";
7215
- const body$3 = "_body_s4eai_84";
8069
+ const close$1 = "_close_s4eai_71";
8070
+ const body$4 = "_body_s4eai_84";
7216
8071
  const footer = "_footer_s4eai_90";
7217
8072
  const styles$o = {
7218
8073
  overlay: overlay$2,
7219
8074
  scrim: scrim$4,
7220
8075
  sheet: sheet$2,
7221
8076
  grabArea,
7222
- grabber: grabber$1,
7223
- header: header$5,
8077
+ grabber,
8078
+ header: header$4,
7224
8079
  title: title$c,
7225
- close: close$2,
7226
- body: body$3,
8080
+ close: close$1,
8081
+ body: body$4,
7227
8082
  footer
7228
8083
  };
7229
8084
  const DISMISS_THRESHOLD_PX = 96;
@@ -7298,6 +8153,18 @@ function BottomSheet({ open, onClose, title: title2, children, footer: footer2 }
7298
8153
  )
7299
8154
  ] });
7300
8155
  }
8156
+ const LOW_STOCK_THRESHOLD = 5;
8157
+ function isLowStock(available) {
8158
+ return available !== void 0 && available > 0 && available <= LOW_STOCK_THRESHOLD;
8159
+ }
8160
+ function lowStockLabel(available) {
8161
+ return `Only ${available} left`;
8162
+ }
8163
+ let idCounter = 0;
8164
+ function useStableId(prefix) {
8165
+ const [id] = useState(() => `${prefix}-${idCounter += 1}`);
8166
+ return id;
8167
+ }
7301
8168
  const wrap$1 = "_wrap_1rmip_1";
7302
8169
  const stepper = "_stepper_1rmip_10";
7303
8170
  const cap = "_cap_1rmip_23";
@@ -7310,11 +8177,6 @@ const styles$n = {
7310
8177
  button,
7311
8178
  value: value$1
7312
8179
  };
7313
- let idCounter = 0;
7314
- function useStableId(prefix) {
7315
- const [id] = useState(() => `${prefix}-${idCounter += 1}`);
7316
- return id;
7317
- }
7318
8180
  function TrashIcon() {
7319
8181
  return /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("g", { transform: "translate(3.8633 3.227)", fill: "currentColor", children: [
7320
8182
  /* @__PURE__ */ jsx("path", { d: "M4.92871 5.4375C5.31531 5.4375 5.62891 5.7511 5.62891 6.1377V9.7627C5.62841 10.1489 5.315 10.4619 4.92871 10.4619C4.54242 10.4619 4.22901 10.1489 4.22852 9.7627V6.1377C4.22852 5.7511 4.54211 5.4375 4.92871 5.4375Z" }),
@@ -7347,9 +8209,17 @@ function PlusIcon() {
7347
8209
  }
7348
8210
  ) }) });
7349
8211
  }
7350
- function QtyStepper({ qty, max, onChange, onRemove, disabled: disabled2 }) {
7351
- const capId = useStableId("qty-cap");
8212
+ function QtyStepper({
8213
+ qty,
8214
+ max,
8215
+ onChange,
8216
+ onRemove,
8217
+ disabled: disabled2,
8218
+ capDescribedBy
8219
+ }) {
8220
+ const ownCapId = useStableId("qty-cap");
7352
8221
  const atMax = max !== void 0 && qty >= max;
8222
+ const capId = capDescribedBy ?? ownCapId;
7353
8223
  const willDelete = qty <= 1;
7354
8224
  function decrement() {
7355
8225
  if (willDelete) {
@@ -7388,28 +8258,34 @@ function QtyStepper({ qty, max, onChange, onRemove, disabled: disabled2 }) {
7388
8258
  }
7389
8259
  )
7390
8260
  ] }),
7391
- atMax && /* @__PURE__ */ jsx("span", { id: capId, className: styles$n.cap, role: "status", children: max === 0 ? "Out of stock" : `Only ${max} left` })
8261
+ atMax && capDescribedBy === void 0 && /* @__PURE__ */ jsx("span", { id: ownCapId, className: styles$n.cap, role: "status", children: max === 0 ? "Out of stock" : lowStockLabel(max) })
7392
8262
  ] });
7393
8263
  }
7394
- const row$5 = "_row_1xbbn_1";
7395
- const pending = "_pending_1xbbn_7";
7396
- const media$1 = "_media_1xbbn_11";
7397
- const image$5 = "_image_1xbbn_21";
7398
- const placeholder$2 = "_placeholder_1xbbn_25";
7399
- const saleBadge = "_saleBadge_1xbbn_31";
7400
- const oos$1 = "_oos_1xbbn_45";
7401
- const info$1 = "_info_1xbbn_58";
7402
- const head = "_head_1xbbn_66";
7403
- const meta = "_meta_1xbbn_73";
7404
- const title$b = "_title_1xbbn_80";
7405
- const details = "_details_1xbbn_92";
7406
- const detail = "_detail_1xbbn_92";
7407
- const price = "_price_1xbbn_106";
7408
- const amount = "_amount_1xbbn_114";
7409
- const was = "_was_1xbbn_120";
8264
+ const line = "_line_1s2s6_6";
8265
+ const row$5 = "_row_1s2s6_12";
8266
+ const pending = "_pending_1s2s6_18";
8267
+ const labels = "_labels_1s2s6_24";
8268
+ const lowStock = "_lowStock_1s2s6_39";
8269
+ const media$1 = "_media_1s2s6_49";
8270
+ const image$5 = "_image_1s2s6_59";
8271
+ const placeholder$2 = "_placeholder_1s2s6_63";
8272
+ const saleBadge = "_saleBadge_1s2s6_76";
8273
+ const oos$1 = "_oos_1s2s6_91";
8274
+ const info$1 = "_info_1s2s6_104";
8275
+ const head = "_head_1s2s6_112";
8276
+ const meta = "_meta_1s2s6_119";
8277
+ const title$b = "_title_1s2s6_134";
8278
+ const details = "_details_1s2s6_152";
8279
+ const detail = "_detail_1s2s6_152";
8280
+ const price = "_price_1s2s6_171";
8281
+ const amount = "_amount_1s2s6_179";
8282
+ const was = "_was_1s2s6_188";
7410
8283
  const styles$m = {
8284
+ line,
7411
8285
  row: row$5,
7412
8286
  pending,
8287
+ labels,
8288
+ lowStock,
7413
8289
  media: media$1,
7414
8290
  image: image$5,
7415
8291
  placeholder: placeholder$2,
@@ -7430,7 +8306,7 @@ function CartLineItem({
7430
8306
  title: title2,
7431
8307
  image: image2,
7432
8308
  compareAt: compareAt2,
7433
- discountPct: discountPct2,
8309
+ discountPct: discountPct$1,
7434
8310
  maxQty,
7435
8311
  onQtyChange,
7436
8312
  onRemove,
@@ -7440,38 +8316,47 @@ function CartLineItem({
7440
8316
  const displayTitle = title2 ?? item2.title ?? item2.sku;
7441
8317
  const displayImage = image2 ?? item2.image;
7442
8318
  const pairs = variantPairs(item2.attributes);
7443
- const soldOut = item2.available === 0;
7444
- return /* @__PURE__ */ jsxs("div", { className: [styles$m.row, pending2 ? styles$m.pending : ""].join(" "), children: [
7445
- /* @__PURE__ */ jsxs("div", { className: styles$m.media, children: [
7446
- displayImage ? /* @__PURE__ */ jsx(ShopImage, { src: displayImage, alt: "", fill: true, sizes: "100px", className: styles$m.image }) : /* @__PURE__ */ jsx("div", { className: styles$m.placeholder, "aria-hidden": "true" }),
7447
- soldOut ? /* @__PURE__ */ jsx("span", { className: styles$m.oos, children: "Out of stock" }) : discountPct2 !== void 0 && /* @__PURE__ */ jsx("span", { className: styles$m.saleBadge, children: /* @__PURE__ */ jsx(SaleBadge, { pct: discountPct2 }) })
7448
- ] }),
7449
- /* @__PURE__ */ jsxs("div", { className: styles$m.info, children: [
7450
- /* @__PURE__ */ jsxs("div", { className: styles$m.head, children: [
7451
- /* @__PURE__ */ jsxs("div", { className: styles$m.meta, children: [
7452
- /* @__PURE__ */ jsx("span", { className: styles$m.title, children: displayTitle }),
7453
- pairs.length > 0 && /* @__PURE__ */ jsx("div", { className: styles$m.details, children: pairs.map(({ key, label: label2, value: value2 }) => /* @__PURE__ */ jsxs("span", { className: styles$m.detail, children: [
7454
- label2,
7455
- ": ",
7456
- value2
7457
- ] }, key)) })
7458
- ] }),
7459
- /* @__PURE__ */ jsxs("div", { className: styles$m.price, children: [
7460
- /* @__PURE__ */ jsx("span", { className: styles$m.amount, children: format(item2.line_total) }),
7461
- compareAt2 && /* @__PURE__ */ jsx("span", { className: styles$m.was, children: format(compareAt2) })
7462
- ] })
8319
+ const available = item2.available;
8320
+ const soldOut = available === 0;
8321
+ const lowStock2 = isLowStock(available);
8322
+ const pct = discountPct$1 ?? (compareAt2 ? discountPct(item2.unit_price, compareAt2) : void 0);
8323
+ const noticeId = useStableId("cart-line-stock");
8324
+ const notice = lowStock2 || soldOut ? noticeId : void 0;
8325
+ return /* @__PURE__ */ jsxs("div", { className: [styles$m.line, pending2 ? styles$m.pending : ""].join(" "), children: [
8326
+ /* @__PURE__ */ jsxs("div", { className: styles$m.row, children: [
8327
+ /* @__PURE__ */ jsxs("div", { className: styles$m.media, children: [
8328
+ displayImage ? /* @__PURE__ */ jsx(ShopImage, { src: displayImage, alt: "", fill: true, sizes: "100px", className: styles$m.image }) : /* @__PURE__ */ jsx("div", { className: styles$m.placeholder, "aria-hidden": "true" }),
8329
+ soldOut ? /* @__PURE__ */ jsx("span", { className: styles$m.oos, id: noticeId, children: "Out of stock" }) : pct !== void 0 && /* @__PURE__ */ jsx("span", { className: styles$m.saleBadge, children: /* @__PURE__ */ jsx(SaleBadge, { pct }) })
7463
8330
  ] }),
7464
- /* @__PURE__ */ jsx(
7465
- QtyStepper,
7466
- {
7467
- qty: item2.qty,
7468
- max: maxQty,
7469
- onChange: onQtyChange,
7470
- onRemove,
7471
- disabled: pending2
7472
- }
7473
- )
7474
- ] })
8331
+ /* @__PURE__ */ jsxs("div", { className: styles$m.info, children: [
8332
+ /* @__PURE__ */ jsxs("div", { className: styles$m.head, children: [
8333
+ /* @__PURE__ */ jsxs("div", { className: styles$m.meta, children: [
8334
+ /* @__PURE__ */ jsx("span", { className: styles$m.title, children: displayTitle }),
8335
+ pairs.length > 0 && /* @__PURE__ */ jsx("div", { className: styles$m.details, children: pairs.map(({ key, label: label2, value: value2 }) => /* @__PURE__ */ jsxs("span", { className: styles$m.detail, children: [
8336
+ label2,
8337
+ ": ",
8338
+ value2
8339
+ ] }, key)) })
8340
+ ] }),
8341
+ /* @__PURE__ */ jsxs("div", { className: styles$m.price, children: [
8342
+ /* @__PURE__ */ jsx("span", { className: styles$m.amount, children: format(item2.line_total) }),
8343
+ compareAt2 && /* @__PURE__ */ jsx("span", { className: styles$m.was, children: format(compareAt2) })
8344
+ ] })
8345
+ ] }),
8346
+ /* @__PURE__ */ jsx(
8347
+ QtyStepper,
8348
+ {
8349
+ qty: item2.qty,
8350
+ max: maxQty,
8351
+ onChange: onQtyChange,
8352
+ onRemove,
8353
+ disabled: pending2,
8354
+ capDescribedBy: notice
8355
+ }
8356
+ )
8357
+ ] })
8358
+ ] }),
8359
+ lowStock2 && /* @__PURE__ */ jsx("div", { className: styles$m.labels, children: /* @__PURE__ */ jsx("span", { id: noticeId, className: styles$m.lowStock, role: "status", children: lowStockLabel(available) }) })
7475
8360
  ] });
7476
8361
  }
7477
8362
  const box$1 = "_box_1cf1a_1";
@@ -7552,7 +8437,7 @@ function StickyCtaBar({ children, info: info2, variant = "floating" }) {
7552
8437
  }
7553
8438
  const surface = "_surface_1wfue_15";
7554
8439
  const screen = "_screen_1wfue_20";
7555
- const body$2 = "_body_1wfue_12";
8440
+ const body$3 = "_body_1wfue_12";
7556
8441
  const items = "_items_1wfue_34";
7557
8442
  const sectionHeader = "_sectionHeader_1wfue_40";
7558
8443
  const sectionTitle = "_sectionTitle_1wfue_46";
@@ -7561,7 +8446,7 @@ const lines = "_lines_1wfue_73";
7561
8446
  const styles$j = {
7562
8447
  surface,
7563
8448
  screen,
7564
- body: body$2,
8449
+ body: body$3,
7565
8450
  items,
7566
8451
  sectionHeader,
7567
8452
  sectionTitle,
@@ -7646,12 +8531,16 @@ function CartViewContent({
7646
8531
  ).then((ok) => {
7647
8532
  if (!ok || !removed) return;
7648
8533
  emit({ type: "remove_from_cart", sku, qty: removed.qty });
7649
- toast2.show("Item removed", "neutral", {
7650
- label: "Undo",
7651
- onAction: () => {
7652
- void mutate(sku, () => api.cart.addItem({ sku, qty: removed.qty })).then((undone) => {
7653
- if (undone) emit({ type: "add_to_cart", sku, qty: removed.qty });
7654
- });
8534
+ toast2.show("Removed from cart", {
8535
+ description: describeLine(removed),
8536
+ image: removed.image,
8537
+ action: {
8538
+ label: "Undo",
8539
+ onAction: () => {
8540
+ void mutate(sku, () => api.cart.addItem({ sku, qty: removed.qty })).then((undone) => {
8541
+ if (undone) emit({ type: "add_to_cart", sku, qty: removed.qty });
8542
+ });
8543
+ }
7655
8544
  }
7656
8545
  });
7657
8546
  });
@@ -7706,7 +8595,6 @@ function CartViewContent({
7706
8595
  setHandingOff(false);
7707
8596
  }
7708
8597
  }
7709
- const locked = cart2.locked !== void 0;
7710
8598
  const itemCount = cart2.items.reduce((n, i) => n + i.qty, 0);
7711
8599
  return /* @__PURE__ */ jsxs("div", { className: styles$j.screen, children: [
7712
8600
  /* @__PURE__ */ jsxs("div", { className: styles$j.body, children: [
@@ -7719,8 +8607,9 @@ function CartViewContent({
7719
8607
  CartLineItem,
7720
8608
  {
7721
8609
  item: item2,
8610
+ ...item2.compare_at_unit_price ? { compareAt: item2.compare_at_unit_price } : {},
7722
8611
  maxQty: item2.available,
7723
- pending: locked || pendingSku === item2.sku,
8612
+ pending: pendingSku === item2.sku,
7724
8613
  onQtyChange: (qty) => changeQty(item2.sku, qty),
7725
8614
  onRemove: () => remove(item2.sku)
7726
8615
  }
@@ -7732,21 +8621,18 @@ function CartViewContent({
7732
8621
  {
7733
8622
  pricing: cart2.totals,
7734
8623
  deferred: ["shipping", "tax"],
8624
+ ...cart2.totals.discount ? { discount: cart2.totals.discount } : {},
7735
8625
  hidden: cart2.hidden_lines
7736
8626
  }
7737
8627
  )
7738
8628
  ] }),
7739
- /* @__PURE__ */ jsx(StickyCtaBar, { variant: "divider", children: /* @__PURE__ */ jsx(
7740
- Button,
7741
- {
7742
- variant: "primary",
7743
- onClick: () => void handOff(cart2),
7744
- disabled: handingOff,
7745
- children: locked ? "Return to checkout" : checkoutLabel
7746
- }
7747
- ) })
8629
+ /* @__PURE__ */ jsx(StickyCtaBar, { variant: "divider", children: /* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => void handOff(cart2), disabled: handingOff, children: checkoutLabel }) })
7748
8630
  ] });
7749
8631
  }
8632
+ function describeLine(item2) {
8633
+ const size = item2.attributes?.size;
8634
+ return [item2.title, size && `Size ${size}`].filter(Boolean).join(" · ") || void 0;
8635
+ }
7750
8636
  const CartSheetContext = createContext(null);
7751
8637
  function useCartSheet() {
7752
8638
  return useContext(CartSheetContext);
@@ -7761,15 +8647,15 @@ function CartSheetProvider({ children }) {
7761
8647
  isOpen && /* @__PURE__ */ jsx(BottomSheet, { open: true, onClose: close2, title: "Cart", children: /* @__PURE__ */ jsx(CartView, { onContinueShopping: close2 }) })
7762
8648
  ] });
7763
8649
  }
7764
- const gallery = "_gallery_1e69n_1";
7765
- const track$2 = "_track_1e69n_8";
7766
- const slide$1 = "_slide_1e69n_25";
7767
- const image$4 = "_image_1e69n_32";
7768
- const placeholder$1 = "_placeholder_1e69n_36";
7769
- const share = "_share_1e69n_43";
7770
- const dots$2 = "_dots_1e69n_60";
7771
- const dot$2 = "_dot_1e69n_60";
7772
- const dotActive$2 = "_dotActive_1e69n_84";
8650
+ const gallery = "_gallery_10mch_1";
8651
+ const track$2 = "_track_10mch_8";
8652
+ const slide$1 = "_slide_10mch_32";
8653
+ const image$4 = "_image_10mch_39";
8654
+ const placeholder$1 = "_placeholder_10mch_43";
8655
+ const share = "_share_10mch_50";
8656
+ const dots$2 = "_dots_10mch_67";
8657
+ const dot$2 = "_dot_10mch_67";
8658
+ const dotActive$2 = "_dotActive_10mch_91";
7773
8659
  const styles$i = {
7774
8660
  gallery,
7775
8661
  track: track$2,
@@ -7852,79 +8738,141 @@ function MediaGallery({ media: media2, alt }) {
7852
8738
  )) })
7853
8739
  ] });
7854
8740
  }
7855
- const scrim$3 = "_scrim_8wz6r_6";
7856
- const sheet$1 = "_sheet_8wz6r_17";
7857
- const grabber = "_grabber_8wz6r_29";
7858
- const header$4 = "_header_8wz6r_37";
7859
- const title$a = "_title_8wz6r_45";
7860
- const close$1 = "_close_8wz6r_51";
7861
- const tableWrap = "_tableWrap_8wz6r_71";
7862
- const table = "_table_8wz6r_71";
7863
- const notes = "_notes_8wz6r_95";
8741
+ const scrim$3 = "_scrim_ddqa4_8";
8742
+ const sheet$1 = "_sheet_ddqa4_2";
8743
+ const body$2 = "_body_ddqa4_40";
8744
+ const titles = "_titles_ddqa4_60";
8745
+ const title$a = "_title_ddqa4_60";
8746
+ const subtitle$3 = "_subtitle_ddqa4_76";
8747
+ const units = "_units_ddqa4_89";
8748
+ const unit = "_unit_ddqa4_89";
8749
+ const unitOn = "_unitOn_ddqa4_123";
8750
+ const unitOff = "_unitOff_ddqa4_131";
8751
+ const tableWrap = "_tableWrap_ddqa4_140";
8752
+ const table = "_table_ddqa4_140";
8753
+ const col = "_col_ddqa4_165";
8754
+ const colEdge = "_colEdge_ddqa4_169";
8755
+ const note = "_note_ddqa4_237";
8756
+ const how = "_how_ddqa4_249";
8757
+ const howTitle = "_howTitle_ddqa4_255";
8758
+ const howList = "_howList_ddqa4_263";
8759
+ const howItem = "_howItem_ddqa4_270";
8760
+ const howLabel = "_howLabel_ddqa4_295";
8761
+ const howText = "_howText_ddqa4_305";
8762
+ const fabric = "_fabric_ddqa4_314";
8763
+ const fabricLabel = "_fabricLabel_ddqa4_322";
8764
+ const fabricText = "_fabricText_ddqa4_330";
8765
+ const notes = "_notes_ddqa4_341";
7864
8766
  const styles$h = {
7865
8767
  scrim: scrim$3,
7866
8768
  sheet: sheet$1,
7867
- grabber,
7868
- header: header$4,
8769
+ body: body$2,
8770
+ titles,
7869
8771
  title: title$a,
7870
- close: close$1,
8772
+ subtitle: subtitle$3,
8773
+ units,
8774
+ unit,
8775
+ unitOn,
8776
+ unitOff,
7871
8777
  tableWrap,
7872
8778
  table,
8779
+ col,
8780
+ colEdge,
8781
+ note,
8782
+ how,
8783
+ howTitle,
8784
+ howList,
8785
+ howItem,
8786
+ howLabel,
8787
+ howText,
8788
+ fabric,
8789
+ fabricLabel,
8790
+ fabricText,
7873
8791
  notes
7874
8792
  };
8793
+ const CM_PER_INCH = 2.54;
8794
+ const UNIT_LABEL = { cm: "cm", in: "inches" };
8795
+ function otherUnit(unit2) {
8796
+ return unit2 === "cm" ? "in" : "cm";
8797
+ }
8798
+ function convert(cell, from, to) {
8799
+ if (from === to) return cell;
8800
+ const n = Number(cell);
8801
+ if (cell.trim() === "" || !Number.isFinite(n)) return cell;
8802
+ return (to === "in" ? n / CM_PER_INCH : n * CM_PER_INCH).toFixed(1);
8803
+ }
7875
8804
  function SizeGuideSheet({ guide, onClose }) {
7876
- const closeRef = useRef(null);
7877
- useEffect(() => {
7878
- closeRef.current?.focus();
7879
- function onKey(e) {
7880
- if (e.key === "Escape") onClose();
7881
- }
7882
- document.addEventListener("keydown", onKey);
7883
- return () => document.removeEventListener("keydown", onKey);
7884
- }, [onClose]);
8805
+ const sheetRef = useRef(null);
7885
8806
  const columns = guide.columns ?? [];
7886
- const rows = guide.rows ?? [];
8807
+ const rows = useMemo(() => guide.rows ?? [], [guide.rows]);
8808
+ const measurements = guide.measurements ?? [];
7887
8809
  const notes2 = guide.notes ?? [];
7888
8810
  const hasTable = columns.length > 0 && rows.length > 0;
8811
+ const authored = guide.unit;
8812
+ const [unit2, setUnit] = useState(authored);
8813
+ const shown = useMemo(
8814
+ () => authored && unit2 && unit2 !== authored ? rows.map((row2) => row2.map((cell) => convert(cell, authored, unit2))) : rows,
8815
+ [rows, authored, unit2]
8816
+ );
8817
+ useModalDialog(true, onClose, sheetRef);
7889
8818
  return /* @__PURE__ */ jsx("div", { className: styles$h.scrim, onClick: onClose, children: /* @__PURE__ */ jsxs(
7890
- "div",
8819
+ ShopSurface,
7891
8820
  {
8821
+ tone: "light",
8822
+ ref: sheetRef,
7892
8823
  className: styles$h.sheet,
7893
8824
  role: "dialog",
7894
8825
  "aria-modal": "true",
7895
8826
  "aria-labelledby": "size-guide-title",
7896
8827
  onClick: (e) => e.stopPropagation(),
7897
8828
  children: [
7898
- /* @__PURE__ */ jsx("div", { className: styles$h.grabber, "aria-hidden": "true" }),
7899
- /* @__PURE__ */ jsxs("div", { className: styles$h.header, children: [
7900
- /* @__PURE__ */ jsx("h2", { id: "size-guide-title", className: styles$h.title, children: guide.title }),
7901
- /* @__PURE__ */ jsx(
8829
+ /* @__PURE__ */ jsx(SheetHeader, { onClose, closeLabel: "Close size guide" }),
8830
+ /* @__PURE__ */ jsxs("div", { className: styles$h.body, children: [
8831
+ /* @__PURE__ */ jsxs("div", { className: styles$h.titles, children: [
8832
+ /* @__PURE__ */ jsx("h2", { id: "size-guide-title", className: styles$h.title, children: guide.title }),
8833
+ guide.subtitle && /* @__PURE__ */ jsx("p", { className: styles$h.subtitle, children: guide.subtitle })
8834
+ ] }),
8835
+ hasTable && authored && unit2 && /* @__PURE__ */ jsx("div", { className: styles$h.units, role: "radiogroup", "aria-label": "Measurement unit", children: [authored, otherUnit(authored)].map((u) => /* @__PURE__ */ jsx(
7902
8836
  "button",
7903
8837
  {
7904
- ref: closeRef,
7905
8838
  type: "button",
7906
- className: styles$h.close,
7907
- onClick: onClose,
7908
- "aria-label": "Close size guide",
7909
- children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
7910
- "path",
7911
- {
7912
- d: "M4 4l8 8M12 4l-8 8",
7913
- stroke: "currentColor",
7914
- strokeWidth: "1.6",
7915
- strokeLinecap: "round"
7916
- }
7917
- ) })
7918
- }
7919
- )
7920
- ] }),
7921
- hasTable && /* @__PURE__ */ jsx("div", { className: styles$h.tableWrap, children: /* @__PURE__ */ jsxs("table", { className: styles$h.table, children: [
7922
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: columns.map((c) => /* @__PURE__ */ jsx("th", { scope: "col", children: c }, c)) }) }),
7923
- /* @__PURE__ */ jsx("tbody", { children: rows.map((row2) => /* @__PURE__ */ jsx("tr", { children: row2.map(
7924
- (cell, i) => i === 0 ? /* @__PURE__ */ jsx("th", { scope: "row", children: cell }, cell) : /* @__PURE__ */ jsx("td", { children: cell }, `${cell}-${i}`)
7925
- ) }, row2.join("|"))) })
7926
- ] }) }),
7927
- notes2.length > 0 && /* @__PURE__ */ jsx("ul", { className: styles$h.notes, children: notes2.map((n) => /* @__PURE__ */ jsx("li", { children: n }, n)) })
8839
+ role: "radio",
8840
+ "aria-checked": u === unit2,
8841
+ className: `${styles$h.unit} ${u === unit2 ? styles$h.unitOn : styles$h.unitOff}`,
8842
+ onClick: () => setUnit(u),
8843
+ children: UNIT_LABEL[u]
8844
+ },
8845
+ u
8846
+ )) }),
8847
+ hasTable && /* The chart can be wider than the sheet, so it scrolls inside its own
8848
+ container rather than making the sheet scroll sideways. */
8849
+ /* @__PURE__ */ jsx("div", { className: styles$h.tableWrap, children: /* @__PURE__ */ jsxs("table", { className: styles$h.table, children: [
8850
+ /* @__PURE__ */ jsx("colgroup", { children: columns.map((c, i) => /* @__PURE__ */ jsx(
8851
+ "col",
8852
+ {
8853
+ className: i === 0 || i === columns.length - 1 ? styles$h.colEdge : styles$h.col
8854
+ },
8855
+ c
8856
+ )) }),
8857
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: columns.map((c) => /* @__PURE__ */ jsx("th", { scope: "col", children: c }, c)) }) }),
8858
+ /* @__PURE__ */ jsx("tbody", { children: shown.map((row2, r) => /* @__PURE__ */ jsx("tr", { children: row2.map(
8859
+ (cell, i) => i === 0 ? /* @__PURE__ */ jsx("th", { scope: "row", children: cell }, cell) : /* @__PURE__ */ jsx("td", { children: cell }, `${cell}-${i}`)
8860
+ ) }, rows[r]?.join("|") ?? r)) })
8861
+ ] }) }),
8862
+ guide.note && /* @__PURE__ */ jsx("p", { className: styles$h.note, children: guide.note }),
8863
+ measurements.length > 0 && /* @__PURE__ */ jsxs("section", { className: styles$h.how, "aria-labelledby": "size-guide-how", children: [
8864
+ /* @__PURE__ */ jsx("h3", { id: "size-guide-how", className: styles$h.howTitle, children: "How to measure" }),
8865
+ /* @__PURE__ */ jsx("dl", { className: styles$h.howList, children: measurements.map((m) => /* @__PURE__ */ jsxs("div", { className: styles$h.howItem, children: [
8866
+ /* @__PURE__ */ jsx("dt", { className: styles$h.howLabel, children: m.label }),
8867
+ /* @__PURE__ */ jsx("dd", { className: styles$h.howText, children: m.description })
8868
+ ] }, m.label)) })
8869
+ ] }),
8870
+ guide.fabric && /* @__PURE__ */ jsxs("div", { className: styles$h.fabric, children: [
8871
+ /* @__PURE__ */ jsx("p", { className: styles$h.fabricLabel, children: "Fabric" }),
8872
+ /* @__PURE__ */ jsx("p", { className: styles$h.fabricText, children: guide.fabric })
8873
+ ] }),
8874
+ notes2.length > 0 && /* @__PURE__ */ jsx("ul", { className: styles$h.notes, children: notes2.map((n) => /* @__PURE__ */ jsx("li", { children: n }, n)) })
8875
+ ] })
7928
8876
  ]
7929
8877
  }
7930
8878
  ) });
@@ -8020,18 +8968,18 @@ function SizeSelector({
8020
8968
  guide && guideOpen && /* @__PURE__ */ jsx(SizeGuideSheet, { guide, onClose: () => setGuideOpen(false) })
8021
8969
  ] });
8022
8970
  }
8023
- const root$1 = "_root_1j4n8_1";
8024
- const header$2 = "_header_1j4n8_7";
8025
- const title$8 = "_title_1j4n8_14";
8026
- const value = "_value_1j4n8_19";
8027
- const tiles = "_tiles_1j4n8_24";
8028
- const tile = "_tile_1j4n8_24";
8029
- const selected$1 = "_selected_1j4n8_48";
8030
- const media = "_media_1j4n8_32";
8031
- const image$3 = "_image_1j4n8_60";
8032
- const placeholder = "_placeholder_1j4n8_64";
8033
- const scrim$2 = "_scrim_1j4n8_72";
8034
- const stockBadge = "_stockBadge_1j4n8_91";
8971
+ const root$1 = "_root_1h4ny_1";
8972
+ const header$2 = "_header_1h4ny_9";
8973
+ const title$8 = "_title_1h4ny_18";
8974
+ const value = "_value_1h4ny_23";
8975
+ const tiles = "_tiles_1h4ny_28";
8976
+ const tile = "_tile_1h4ny_28";
8977
+ const selected$1 = "_selected_1h4ny_52";
8978
+ const media = "_media_1h4ny_36";
8979
+ const image$3 = "_image_1h4ny_64";
8980
+ const placeholder = "_placeholder_1h4ny_68";
8981
+ const scrim$2 = "_scrim_1h4ny_76";
8982
+ const stockBadge = "_stockBadge_1h4ny_95";
8035
8983
  const styles$f = {
8036
8984
  root: root$1,
8037
8985
  header: header$2,
@@ -8056,7 +9004,7 @@ function ColorSelector({ colours, selected: selected2, onSelect }) {
8056
9004
  /* @__PURE__ */ jsx("div", { className: styles$f.tiles, role: "radiogroup", "aria-label": "Color", "aria-required": "true", children: colours.map((c) => {
8057
9005
  const isSelected = c.value === selected2;
8058
9006
  const soldOut = !c.available;
8059
- const lowStock = !soldOut && c.remaining !== void 0 && c.remaining > 0 && c.remaining <= 5;
9007
+ const lowStock2 = !soldOut && isLowStock(c.remaining);
8060
9008
  return /* @__PURE__ */ jsxs(
8061
9009
  "button",
8062
9010
  {
@@ -8071,7 +9019,7 @@ function ColorSelector({ colours, selected: selected2, onSelect }) {
8071
9019
  c.image ? /* @__PURE__ */ jsx(ShopImage, { src: c.image, alt: "", fill: true, sizes: "79px", className: styles$f.image }) : /* @__PURE__ */ jsx("span", { className: styles$f.placeholder, "aria-hidden": "true" }),
8072
9020
  soldOut && /* @__PURE__ */ jsx("span", { className: styles$f.scrim, "aria-hidden": "true", children: "Out of stock" })
8073
9021
  ] }),
8074
- lowStock && /* @__PURE__ */ jsx("span", { className: styles$f.stockBadge, "aria-hidden": "true", children: `${c.remaining} left` })
9022
+ lowStock2 && /* @__PURE__ */ jsx("span", { className: styles$f.stockBadge, "aria-hidden": "true", children: `${c.remaining} left` })
8075
9023
  ]
8076
9024
  },
8077
9025
  c.value
@@ -8156,14 +9104,34 @@ function paragraphsOf(description2) {
8156
9104
  }
8157
9105
  function ProductDetails({ description: description2 }) {
8158
9106
  const [expanded, setExpanded] = useState(false);
9107
+ const [clipped, setClipped] = useState(null);
9108
+ const bodyRef = useRef(null);
8159
9109
  const paragraphs = paragraphsOf(description2);
9110
+ useEffect(() => {
9111
+ if (expanded) return;
9112
+ const el = bodyRef.current;
9113
+ if (!el) return;
9114
+ const measure = () => setClipped(el.scrollHeight - el.clientHeight > 1);
9115
+ measure();
9116
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
9117
+ observer?.observe(el);
9118
+ const fonts = document.fonts;
9119
+ let live = true;
9120
+ void fonts?.ready.then(() => {
9121
+ if (live) measure();
9122
+ });
9123
+ return () => {
9124
+ live = false;
9125
+ observer?.disconnect();
9126
+ };
9127
+ }, [expanded, description2]);
8160
9128
  if (paragraphs.length === 0) return null;
8161
9129
  return /* @__PURE__ */ jsxs("section", { className: styles$d.root, "aria-labelledby": "details-heading", children: [
8162
9130
  /* @__PURE__ */ jsxs("div", { className: styles$d.group, children: [
8163
9131
  /* @__PURE__ */ jsx("h2", { id: "details-heading", className: styles$d.title, children: "Product details" }),
8164
- /* @__PURE__ */ jsx("div", { className: [styles$d.body, expanded ? "" : styles$d.clamped].join(" "), children: paragraphs.map((p) => /* @__PURE__ */ jsx("p", { className: styles$d.paragraph, children: p }, p)) })
9132
+ /* @__PURE__ */ jsx("div", { ref: bodyRef, className: [styles$d.body, expanded ? "" : styles$d.clamped].join(" "), children: paragraphs.map((p) => /* @__PURE__ */ jsx("p", { className: styles$d.paragraph, children: p }, p)) })
8165
9133
  ] }),
8166
- /* @__PURE__ */ jsx(
9134
+ clipped ? /* @__PURE__ */ jsx(
8167
9135
  "button",
8168
9136
  {
8169
9137
  type: "button",
@@ -8172,7 +9140,7 @@ function ProductDetails({ description: description2 }) {
8172
9140
  onClick: () => setExpanded((v) => !v),
8173
9141
  children: expanded ? "Less" : "more"
8174
9142
  }
8175
- )
9143
+ ) : null
8176
9144
  ] });
8177
9145
  }
8178
9146
  const row$3 = "_row_l4edh_1";
@@ -8392,9 +9360,9 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
8392
9360
  const inCart = selectedSku !== null && added.includes(selectedSku);
8393
9361
  const selectedVariant = hasVariants ? variants.find((v) => v.sku === selectedSku) : void 0;
8394
9362
  const available = selectedVariant?.available ?? inventory2?.available ?? 0;
8395
- const lowStock = available > 0 && available <= 5;
8396
- const stockNotice = !purchasable || lowStock;
8397
- const availabilityLabel = !purchasable ? "Out of stock" : lowStock ? `Only ${available} left` : "";
9363
+ const lowStock2 = isLowStock(available);
9364
+ const stockNotice = !purchasable || lowStock2;
9365
+ const availabilityLabel = !purchasable ? "Out of stock" : lowStock2 ? lowStockLabel(available) : "";
8398
9366
  const cta2 = purchasable ? (
8399
9367
  /*
8400
9368
  * Three labels, one button (5241:71382 / 5295:75115 / 5268:72907). "Adding to cart"
@@ -8587,15 +9555,15 @@ function LifestyleImage({ images }) {
8587
9555
  )) })
8588
9556
  ] }) });
8589
9557
  }
8590
- const section$2 = "_section_n8xka_1";
8591
- const track = "_track_n8xka_8";
8592
- const card = "_card_n8xka_38";
8593
- const quote = "_quote_n8xka_50";
8594
- const author = "_author_n8xka_58";
8595
- const dots = "_dots_n8xka_64";
8596
- const dot = "_dot_n8xka_64";
8597
- const dotActive = "_dotActive_n8xka_77";
8598
- const disclaimer = "_disclaimer_n8xka_83";
9558
+ const section$2 = "_section_kdf3c_1";
9559
+ const track = "_track_kdf3c_8";
9560
+ const card = "_card_kdf3c_38";
9561
+ const quote = "_quote_kdf3c_50";
9562
+ const author = "_author_kdf3c_58";
9563
+ const dots = "_dots_kdf3c_69";
9564
+ const dot = "_dot_kdf3c_69";
9565
+ const dotActive = "_dotActive_kdf3c_85";
9566
+ const disclaimer = "_disclaimer_kdf3c_91";
8599
9567
  const styles$6 = {
8600
9568
  section: section$2,
8601
9569
  track,
@@ -8630,10 +9598,10 @@ function ReviewCarousel({ quotes, disclaimer: disclaimer2 }) {
8630
9598
  disclaimer2 && /* @__PURE__ */ jsx("p", { className: styles$6.disclaimer, children: disclaimer2 })
8631
9599
  ] });
8632
9600
  }
8633
- const section$1 = "_section_145t0_1";
8634
- const row$2 = "_row_145t0_9";
8635
- const title$4 = "_title_145t0_21";
8636
- const body = "_body_145t0_29";
9601
+ const section$1 = "_section_1tevp_1";
9602
+ const row$2 = "_row_1tevp_9";
9603
+ const title$4 = "_title_1tevp_21";
9604
+ const body = "_body_1tevp_38";
8637
9605
  const styles$5 = {
8638
9606
  section: section$1,
8639
9607
  row: row$2,
@@ -8646,10 +9614,10 @@ function WhyUs({ items: items2 }) {
8646
9614
  /* @__PURE__ */ jsx("p", { className: styles$5.body, children: it.body })
8647
9615
  ] }, i)) });
8648
9616
  }
8649
- const section = "_section_opjfc_1";
8650
- const title$3 = "_title_opjfc_8";
8651
- const list$1 = "_list_opjfc_15";
8652
- const row$1 = "_row_opjfc_26";
9617
+ const section = "_section_snuuj_1";
9618
+ const title$3 = "_title_snuuj_10";
9619
+ const list$1 = "_list_snuuj_17";
9620
+ const row$1 = "_row_snuuj_32";
8653
9621
  const styles$4 = {
8654
9622
  section,
8655
9623
  title: title$3,
@@ -8690,11 +9658,13 @@ function Block({ block }) {
8690
9658
  block.title && /* @__PURE__ */ jsx("h2", { className: styles$3.blockTitle, children: block.title }),
8691
9659
  /* @__PURE__ */ jsx(ProductTile, { product: block.product, priority: true, size: "large" })
8692
9660
  ] });
9661
+ case "product_gallery":
9662
+ return /* @__PURE__ */ jsx(ProductGallery, { title: block.title, product: block.product });
8693
9663
  case "lifestyle_image":
8694
9664
  return /* @__PURE__ */ jsx(LifestyleImage, { images: block.images });
8695
9665
  case "grid":
8696
9666
  return /* @__PURE__ */ jsxs("div", { className: styles$3.gridBlock, children: [
8697
- /* @__PURE__ */ jsx("h2", { className: styles$3.blockTitle, children: block.title }),
9667
+ block.title && /* @__PURE__ */ jsx("h2", { className: styles$3.blockTitle, children: block.title }),
8698
9668
  /* @__PURE__ */ jsx("ul", { className: styles$3.grid, children: block.products.map((p) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(ProductTile, { product: p }) }, p.sku)) })
8699
9669
  ] });
8700
9670
  case "review":
@@ -9378,15 +10348,23 @@ export {
9378
10348
  PriceBlock,
9379
10349
  ProductDetail,
9380
10350
  ProductDetails,
10351
+ ProductGallery,
9381
10352
  ProductGrid,
9382
10353
  ProductTile,
9383
10354
  ProductView,
9384
10355
  PromoBanner,
9385
10356
  QtyStepper,
10357
+ RETURN_REASONS,
9386
10358
  RailCarousel,
10359
+ ReasonSheet,
10360
+ ReturnFlowView,
10361
+ ReturnItemsView,
10362
+ ReturnLabelView,
10363
+ ReturnTrackingView,
9387
10364
  ReviewCarousel,
9388
10365
  SaleBadge,
9389
10366
  ScreenSkeleton,
10367
+ SheetHeader,
9390
10368
  ShippingInfo,
9391
10369
  ShopHeader,
9392
10370
  HomeShowcase as ShopHome,