@zonos/elements 1.3.285 → 1.3.286

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.
Files changed (145) hide show
  1. package/dist/cjs/{cart-94908542.js → cart-0cf8897b.js} +26 -3
  2. package/dist/cjs/{collect-0c05e2b4.js → collect-79131e52.js} +1 -1
  3. package/dist/cjs/{getMissingRequiredShippingFields-124b3f20.js → getMissingRequiredShippingFields-a8f04267.js} +1 -1
  4. package/dist/cjs/index.cjs.js +7 -7
  5. package/dist/cjs/{invoice-205fb5bc.js → invoice-254ae23b.js} +1 -1
  6. package/dist/cjs/{paypal-45ca5301.js → paypal-8ca67278.js} +1 -1
  7. package/dist/cjs/{placeTestOrder-302b6862.js → placeTestOrder-12b63822.js} +1 -1
  8. package/dist/cjs/{renderCheckoutCurrency-1b0cd5f2.js → renderCheckoutCurrency-a1f71587.js} +1 -1
  9. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +2 -2
  10. package/dist/cjs/zonos-address_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-card_5.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +21 -9
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +103 -5
  15. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +1 -1
  16. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +5 -5
  17. package/dist/cjs/zonos-collect.cjs.entry.js +3 -3
  18. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  19. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +3 -3
  20. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-invoice.cjs.entry.js +3 -3
  22. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +2 -2
  23. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +17 -5
  24. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +104 -5
  25. package/dist/collection/components/store/checkout/cart.js +14 -1
  26. package/dist/collection/components/utils/validateCheckoutSession.js +11 -3
  27. package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
  28. package/dist/collection/types/generated/graphql.internal.types.js +71 -6
  29. package/dist/esm/{cart-2e407f7b.js → cart-d04742f5.js} +25 -4
  30. package/dist/esm/{collect-19428e18.js → collect-4c310a16.js} +1 -1
  31. package/dist/esm/{getMissingRequiredShippingFields-719b206f.js → getMissingRequiredShippingFields-f0878e32.js} +1 -1
  32. package/dist/esm/index.js +7 -7
  33. package/dist/esm/{invoice-67a47785.js → invoice-86487dac.js} +1 -1
  34. package/dist/esm/{paypal-6dca6567.js → paypal-997935ab.js} +1 -1
  35. package/dist/esm/{placeTestOrder-9563c89a.js → placeTestOrder-a53f2056.js} +1 -1
  36. package/dist/esm/{renderCheckoutCurrency-282384f0.js → renderCheckoutCurrency-e0e16eb7.js} +1 -1
  37. package/dist/esm/zonos-address-completion-dialog_7.entry.js +2 -2
  38. package/dist/esm/zonos-address_4.entry.js +1 -1
  39. package/dist/esm/zonos-airwallex-payment.entry.js +2 -2
  40. package/dist/esm/zonos-card_5.entry.js +2 -2
  41. package/dist/esm/zonos-cart-items_12.entry.js +21 -9
  42. package/dist/esm/zonos-checkout.entry.js +103 -5
  43. package/dist/esm/zonos-collect-cart-items_3.entry.js +1 -1
  44. package/dist/esm/zonos-collect-finish_6.entry.js +5 -5
  45. package/dist/esm/zonos-collect.entry.js +3 -3
  46. package/dist/esm/zonos-controller.entry.js +1 -1
  47. package/dist/esm/zonos-invoice-cart-items_2.entry.js +3 -3
  48. package/dist/esm/zonos-invoice-finish_5.entry.js +5 -5
  49. package/dist/esm/zonos-invoice.entry.js +3 -3
  50. package/dist/esm/zonos-policy-consent_2.entry.js +2 -2
  51. package/dist/esm-es5/cart-d04742f5.js +1 -0
  52. package/dist/esm-es5/{collect-19428e18.js → collect-4c310a16.js} +1 -1
  53. package/dist/esm-es5/getMissingRequiredShippingFields-f0878e32.js +1 -0
  54. package/dist/esm-es5/index.js +1 -1
  55. package/dist/esm-es5/{invoice-67a47785.js → invoice-86487dac.js} +1 -1
  56. package/dist/esm-es5/{paypal-6dca6567.js → paypal-997935ab.js} +1 -1
  57. package/dist/esm-es5/{placeTestOrder-9563c89a.js → placeTestOrder-a53f2056.js} +1 -1
  58. package/dist/esm-es5/{renderCheckoutCurrency-282384f0.js → renderCheckoutCurrency-e0e16eb7.js} +1 -1
  59. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
  60. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  61. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  62. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  63. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  64. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  65. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  66. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  67. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  68. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  69. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  70. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  71. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  72. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  73. package/dist/scripts/index.d.ts +37 -34
  74. package/dist/scripts/index.js +1 -1
  75. package/dist/scripts/loadZonos.js +1 -1
  76. package/dist/scripts/zonos.js +1 -1
  77. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +14 -0
  78. package/dist/types/components/store/checkout/cart.d.ts +10 -1
  79. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +24 -24
  80. package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
  81. package/dist/types/types/generated/graphql.frontend.types.ts +2 -0
  82. package/dist/types/types/generated/graphql.internal.types.d.ts +188 -98
  83. package/dist/types/types/generated/graphql.internal.types.ts +200 -93
  84. package/dist/zonos-elements/index.esm.js +1 -1
  85. package/dist/zonos-elements/{p-dd3c00d6.system.entry.js → p-0c327a57.system.entry.js} +1 -1
  86. package/dist/zonos-elements/{p-e32ee011.system.entry.js → p-117953db.system.entry.js} +1 -1
  87. package/dist/zonos-elements/{p-260ad739.system.entry.js → p-1cfb5c2a.system.entry.js} +1 -1
  88. package/dist/zonos-elements/{p-f4acce01.js → p-277b77e3.js} +1 -1
  89. package/dist/zonos-elements/{p-ae0de3e4.entry.js → p-278abdcf.entry.js} +1 -1
  90. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  91. package/dist/zonos-elements/{p-e5c76a9b.js → p-344a6278.js} +2 -2
  92. package/dist/zonos-elements/{p-f59a0129.system.entry.js → p-3a26e5e7.system.entry.js} +1 -1
  93. package/dist/zonos-elements/{p-94722bf6.system.entry.js → p-40af92a1.system.entry.js} +1 -1
  94. package/dist/zonos-elements/{p-e8587f9f.system.entry.js → p-41f1697a.system.entry.js} +1 -1
  95. package/dist/zonos-elements/{p-e2b4c082.system.entry.js → p-490d7fec.system.entry.js} +1 -1
  96. package/dist/zonos-elements/{p-1277abac.system.entry.js → p-4941c096.system.entry.js} +1 -1
  97. package/dist/zonos-elements/{p-d20fe2c2.system.entry.js → p-50d088f7.system.entry.js} +1 -1
  98. package/dist/zonos-elements/{p-8311edc7.entry.js → p-5227aa69.entry.js} +1 -1
  99. package/dist/zonos-elements/{p-bced320e.entry.js → p-5d110c2b.entry.js} +1 -1
  100. package/dist/zonos-elements/{p-b1e95f95.entry.js → p-6de2f9c9.entry.js} +1 -1
  101. package/dist/zonos-elements/{p-6dde1e85.system.entry.js → p-6eaf7c9e.system.entry.js} +1 -1
  102. package/dist/zonos-elements/p-7352abe9.js +1 -0
  103. package/dist/zonos-elements/{p-fe5f05fc.system.js → p-74230da8.system.js} +1 -1
  104. package/dist/zonos-elements/{p-22e10b7d.entry.js → p-77993ba1.entry.js} +1 -1
  105. package/dist/zonos-elements/p-78f8e594.entry.js +1 -0
  106. package/dist/zonos-elements/p-7b525c75.system.js +1 -0
  107. package/dist/zonos-elements/p-7f688485.system.entry.js +1 -0
  108. package/dist/zonos-elements/p-8861d47e.js +1 -0
  109. package/dist/zonos-elements/p-8d14cb66.entry.js +1 -0
  110. package/dist/zonos-elements/{p-a07e5011.entry.js → p-944c1fb3.entry.js} +1 -1
  111. package/dist/zonos-elements/{p-cb49dcfe.entry.js → p-96ab529e.entry.js} +1 -1
  112. package/dist/zonos-elements/{p-eb5f3451.system.js → p-998975a3.system.js} +1 -1
  113. package/dist/zonos-elements/p-a4c7ee17.js +1 -0
  114. package/dist/zonos-elements/{p-3a13e58c.system.js → p-c0af11fe.system.js} +1 -1
  115. package/dist/zonos-elements/p-c112fa12.system.entry.js +1 -0
  116. package/dist/zonos-elements/{p-2b8c96e3.system.js → p-c4321a1a.system.js} +1 -1
  117. package/dist/zonos-elements/{p-aecb5d61.entry.js → p-c7329333.entry.js} +1 -1
  118. package/dist/zonos-elements/{p-6695de06.system.js → p-c756a59d.system.js} +1 -1
  119. package/dist/zonos-elements/p-d1a51fac.js +1 -0
  120. package/dist/zonos-elements/{p-d42bd250.system.entry.js → p-d75726e5.system.entry.js} +1 -1
  121. package/dist/zonos-elements/p-dd866ca3.system.entry.js +1 -0
  122. package/dist/zonos-elements/{p-8bfe5b2b.entry.js → p-dd8a7bf4.entry.js} +1 -1
  123. package/dist/zonos-elements/p-e4dc24e1.system.js +1 -0
  124. package/dist/zonos-elements/{p-60a6b71d.system.js → p-e5865ad9.system.js} +1 -1
  125. package/dist/zonos-elements/{p-65c1f51e.entry.js → p-e7d7afda.entry.js} +1 -1
  126. package/dist/zonos-elements/p-f9346f1c.entry.js +1 -0
  127. package/dist/zonos-elements/{p-0c9fec73.js → p-fc5f6113.js} +1 -1
  128. package/dist/zonos-elements/p-fe28dbe6.entry.js +1 -0
  129. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  130. package/package.json +1 -1
  131. package/dist/esm-es5/cart-2e407f7b.js +0 -1
  132. package/dist/esm-es5/getMissingRequiredShippingFields-719b206f.js +0 -1
  133. package/dist/zonos-elements/p-2c2afed4.entry.js +0 -1
  134. package/dist/zonos-elements/p-2cdd1b49.system.entry.js +0 -1
  135. package/dist/zonos-elements/p-46cd14e5.js +0 -1
  136. package/dist/zonos-elements/p-4a20893e.system.js +0 -1
  137. package/dist/zonos-elements/p-5a491f28.js +0 -1
  138. package/dist/zonos-elements/p-5ebb7ae6.entry.js +0 -1
  139. package/dist/zonos-elements/p-62f6a757.entry.js +0 -1
  140. package/dist/zonos-elements/p-8b298971.system.entry.js +0 -1
  141. package/dist/zonos-elements/p-a9ad74e5.system.entry.js +0 -1
  142. package/dist/zonos-elements/p-c1631c9c.js +0 -1
  143. package/dist/zonos-elements/p-cb4cb5a3.system.js +0 -1
  144. package/dist/zonos-elements/p-dc80cb87.js +0 -1
  145. package/dist/zonos-elements/p-ff4e6811.entry.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { Fragment, h, Host } from "@stencil/core";
2
- import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout/cart";
2
+ import { cartStore, cartStoreHasOneEligibleItem, cartStoreIsOrderModificationPaymentOnlySession, } from "../../../store/checkout/cart";
3
3
  import { stripeStore, stripeStoreApplyPromoCode, stripeStoreRemovePromoCode, } from "../../../store/checkout/stripe";
4
4
  import { localizationStore } from "../../../store/hello/localization";
5
5
  import { translate } from "../../../store/translationStore";
@@ -111,7 +111,14 @@ export class ZonosCartSubtotal {
111
111
  const cartTotal = cartStore.step === 'customer-info'
112
112
  ? cartStore.subtotal + cartStore.adjustmentTotal
113
113
  : cartStore.total;
114
- const showDutyTaxesInfo = cartStore.step === 'payment' || cartStore.step === 'shipping';
114
+ // Order-modification payment-only sessions have no landedCost at all
115
+ // (see validateCheckoutSession) - they're paying a flat delta, not a
116
+ // shipment - so duty/tax/shipping figures here would just be
117
+ // meaningless zeros rather than real data.
118
+ const isOrderModificationPaymentOnlySession = cartStoreIsOrderModificationPaymentOnlySession();
119
+ const showDutyTaxesInfo = !isOrderModificationPaymentOnlySession &&
120
+ (cartStore.step === 'payment' || cartStore.step === 'shipping');
121
+ const showShippingRow = !isOrderModificationPaymentOnlySession;
115
122
  // EU 3-EUR cutover (05CHECK-893): when we collect and remit taxes for an EU
116
123
  // DAP quote, taxes and fees are included while duties are paid on delivery.
117
124
  const euDapDetails = this.getEuDapDetails();
@@ -123,7 +130,12 @@ export class ZonosCartSubtotal {
123
130
  // Store with no discount rules added in the dashboard, checkout would not display have promo code input
124
131
  !cartStore.shouldHideDiscountInput &&
125
132
  // Only show promo stuff if they are past customer info session in order to get landed cost with promo adjustment
126
- cartStore.step !== 'customer-info';
133
+ cartStore.step !== 'customer-info' &&
134
+ // Order-modification payment-only sessions skip straight to the payment
135
+ // step with no customer-info/shipping step behind them — applying a
136
+ // promo code here would re-quote against a landed cost these sessions
137
+ // never went through, with no shipping step to return to.
138
+ !isOrderModificationPaymentOnlySession;
127
139
  const appliedPromoCode = (_e = (_d = (_c = (_b = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.find(Boolean)) === null || _b === void 0 ? void 0 : _b.landedCost.appliedAdjustments) === null || _c === void 0 ? void 0 : _c.find(x => { var _a; return ((_a = x.adjustment) === null || _a === void 0 ? void 0 : _a.source) === 'PROMO_CODE'; })) === null || _d === void 0 ? void 0 : _d.adjustment) === null || _e === void 0 ? void 0 : _e.name;
128
140
  const applyPromoCode = async () => {
129
141
  // Promo code apply button is clicked
@@ -208,12 +220,12 @@ export class ZonosCartSubtotal {
208
220
  return (h(Host, { class: "zonos--cart-subtotal zonos--elements" }, h("table", { class: "zonos--cart-table" }, h("tr", { class: "zonos--row zonos--cart-subtotal" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { type: "semiBoldLabel" }, translate('Cart subtotal')), h("zonos-text", { class: "zonos--caption", type: "caption" }, this.getCartSubtotalSubtitle())), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
209
221
  amount: subtotal,
210
222
  isForeign: true,
211
- })))), h("tr", { class: "zonos--row zonos--cart-shipping" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, renderShippingInfo()), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, cartStore.shipping
223
+ })))), showShippingRow && (h("tr", { class: "zonos--row zonos--cart-shipping" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, renderShippingInfo()), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, cartStore.shipping
212
224
  ? renderCheckoutCurrency({
213
225
  amount: cartStore.shipping,
214
226
  isForeign: true,
215
227
  })
216
- : '-')), showDutyTaxesInfo &&
228
+ : '-'))), showDutyTaxesInfo &&
217
229
  (euDapDetails ? (
218
230
  // EU DAP remittance: taxes and fees are collected/included, duties
219
231
  // are estimated and paid upon delivery — show them on two lines.
@@ -1,5 +1,5 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
- import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreOnChange, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
2
+ import { cartStore, cartStoreClearCheckoutInterval, cartStoreIsOrderModificationPaymentOnlySession, cartStoreNextStep, cartStoreOnChange, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
3
3
  import { paypalInitScript, paypalStore, paypalStoreHasPaypalEnabled, } from "../../store/checkout/paypal";
4
4
  import { isPolicyConsentRequired, policyConsentStore, policyConsentStoreReset, } from "../../store/checkout/policyConsent";
5
5
  import { storeCreditStoreApplyCredit, storeCreditStoreCoversFullAmount, storeCreditStoreCreateOrder, storeCreditStoreGetEffectiveAmount, } from "../../store/checkout/storeCredit";
@@ -9,6 +9,7 @@ import { storageStore, storageStoreSetEnabledVariantTestKeys, VARIANT_TEST_KEY_E
9
9
  import { translate } from "../../store/translationStore";
10
10
  import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
11
11
  import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
12
+ import { getCheckoutSession } from "../../utils/api/getCheckoutSession";
12
13
  import { isStoreDiscountEnabled } from "../../utils/api/isStoreDiscountEnabl";
13
14
  import { selectVarianceTest } from "../../utils/api/selectVarianceTest";
14
15
  import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
@@ -232,6 +233,48 @@ export class ZonosCheckout {
232
233
  log('Payment intent is not succeeded, proceed to order');
233
234
  return { shouldAllowOrder: true };
234
235
  };
236
+ /**
237
+ * Recover an order-modification payment-only session that was already
238
+ * completed (or already paid but not yet completed) by the time this cart
239
+ * link is opened/reopened — e.g. the shopper paid, closed the tab before
240
+ * the async order-creation webhook finished, then reopened the same
241
+ * payment link. Without this, re-rendering the payment form would let them
242
+ * attempt to pay again against an already-resolved session. Mirrors
243
+ * zonos-collect's recoverCompletedCollectSession for its own no-shipping
244
+ * flow, minus the Airwallex branch (this checkout only supports Stripe).
245
+ *
246
+ * @returns `true` when it routed to the finish step, `false` when the
247
+ * caller should proceed with a normal init.
248
+ */
249
+ this.recoverCompletedOrderModificationSession = async (checkoutSessionId) => {
250
+ // getCheckoutSession() reads storageStore.checkoutSessionId internally.
251
+ storageStore.checkoutSessionId = checkoutSessionId;
252
+ const { errors, json } = await getCheckoutSession();
253
+ if (errors.length || !json) {
254
+ return false;
255
+ }
256
+ const { checkoutSession } = json;
257
+ // Session already finalized → straight to finish. An order-mod
258
+ // payment-only session always has `order` set *before* payment too (see
259
+ // isOrderModificationPaymentOnlySession) - checking `order` alone would
260
+ // treat every first-ever open as already paid, so both must be true.
261
+ if (checkoutSession.completedAt && checkoutSession.order) {
262
+ void this.setToFinishStep('succeeded');
263
+ return true;
264
+ }
265
+ // Not completed and no order yet — verify the live payment intent status.
266
+ if (checkoutSession.clientSecret) {
267
+ const { status } = await stripeStoreRetrievePayment({
268
+ clientSecret: checkoutSession.clientSecret,
269
+ });
270
+ if (status === 'processing' || status === 'succeeded') {
271
+ stripeStore.clientSecret = checkoutSession.clientSecret;
272
+ void this.setToFinishStep(status);
273
+ return true;
274
+ }
275
+ }
276
+ return false;
277
+ };
235
278
  this.initializeTestKeys = () => {
236
279
  // cleanup expired test keys
237
280
  storageStore.enabledVariantTestKeys = filterExpiredTests(storageStore.enabledVariantTestKeys || []);
@@ -581,6 +624,7 @@ export class ZonosCheckout {
581
624
  (_b = (_a = zonosStore.checkoutSettings).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
582
625
  }
583
626
  async buildCartAndInit() {
627
+ var _a;
584
628
  // if createCartId is provided, use it to build cart. Merchant will provide create a cart from their server side and give the cart id to us.
585
629
  if (typeof zonosStore.checkoutSettings.createCartId === 'function') {
586
630
  log('"createCartId" is provided, start building cart');
@@ -620,6 +664,37 @@ export class ZonosCheckout {
620
664
  // if tempCartUUID is provided, use it instead of buildCartDetail
621
665
  else if (window.Zonos.cartData) {
622
666
  log('tempCartUUID is provided, start building cart');
667
+ // A cart created against an already-existing checkout session (e.g. an
668
+ // order-modification payment request) must reuse that session instead
669
+ // of creating a fresh one — otherwise the reused cart's order/landedCost
670
+ // context (and, downstream, the payment-only step skip below) is lost.
671
+ // Mirrors the same reference lookup zonos-collect/zonos-invoice already
672
+ // do for their own cart types.
673
+ const cartCheckoutSessionId = (_a = window.Zonos.cartData.references) === null || _a === void 0 ? void 0 : _a.checkoutSessionId;
674
+ if (cartCheckoutSessionId) {
675
+ log('Setting checkout session id from cart reference', 'info', cartCheckoutSessionId);
676
+ // The shopper may be reopening this same payment link after already
677
+ // paying — e.g. they closed the tab before the async order-creation
678
+ // webhook finished. Check the session/payment-intent status before
679
+ // rendering the payment form again.
680
+ const recovered = await this.recoverCompletedOrderModificationSession(cartCheckoutSessionId);
681
+ if (recovered) {
682
+ // Recovery routes straight to the finish step, bypassing the
683
+ // cartStoreUpdateItems call below that would normally clear this -
684
+ // without it, the finish screen would spin forever (dialogLoading
685
+ // stays true while isFetchingSession is true).
686
+ stripeStore.isFetchingSession = false;
687
+ return true;
688
+ }
689
+ storageStore.checkoutSessionId = cartCheckoutSessionId;
690
+ }
691
+ else {
692
+ // Same as zonos-collect/zonos-invoice: without this, a checkout
693
+ // session id left over from a previous cart in this tab would leak
694
+ // into this unrelated one.
695
+ log('Clear checkout session id from storage so we start from a fresh session for this cart');
696
+ storageStore.checkoutSessionId = null;
697
+ }
623
698
  const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
624
699
  await cartStoreUpdateItems({ adjustments, cartItems });
625
700
  }
@@ -663,6 +738,17 @@ export class ZonosCheckout {
663
738
  successBehavior === 'REDIRECT_TO_SUCCESS_PAGE' ||
664
739
  (successBehavior === 'CLOSE_MODAL' && !!successRedirectUrl) ||
665
740
  !!cartStore.externalConfirmationPageURL;
741
+ // A session tied to an order that hasn't completed yet is an
742
+ // order-modification/adjustment collection: the shopper is only paying a
743
+ // delta against an already-approved landed cost, so the address/shipping
744
+ // steps (which would re-quote against the synthetic delta line item
745
+ // instead of the real shipment) are skipped in favor of jumping straight
746
+ // to payment, same as the Collect flow does for its own cart type. Lives
747
+ // here (rather than at each buildCartAndInit call site) so every caller
748
+ // gets it, including the forceDialogOpen/preview init path.
749
+ if (cartStoreIsOrderModificationPaymentOnlySession()) {
750
+ cartStore.step = 'payment';
751
+ }
666
752
  return true;
667
753
  }
668
754
  reloadCheckoutSession() {
@@ -1526,7 +1612,13 @@ export class ZonosCheckout {
1526
1612
  return;
1527
1613
  }
1528
1614
  try {
1529
- await stripeStoreConfirmPayment();
1615
+ // Order-modification payment-only sessions skip the shipping step,
1616
+ // so cartStore.selectedLandedCost is never populated — bypass the
1617
+ // landed-cost guard the same way zonos-collect does for its own
1618
+ // no-shipping-step flow.
1619
+ await stripeStoreConfirmPayment({
1620
+ noLandedCostCheck: cartStoreIsOrderModificationPaymentOnlySession(),
1621
+ });
1530
1622
  cartStoreNextStep();
1531
1623
  // clear the checkout session timeout timer when purchase is complete
1532
1624
  cartStoreClearCheckoutInterval();
@@ -1793,6 +1885,13 @@ export class ZonosCheckout {
1793
1885
  cartStore.step !== 'error' &&
1794
1886
  !stripeStore.stripeElements) ||
1795
1887
  stripeStore.isFetchingSession;
1888
+ // An order-modification/adjustment session (order attached, not yet
1889
+ // completed) skips straight to payment — see buildCartAndInit. The
1890
+ // customer-info/shipping steps never ran, so the progress tabs (which
1891
+ // track completion via cartStore.tabItems, only ever flipped by those
1892
+ // steps' own continue handlers) would otherwise show a stale, frozen
1893
+ // bar instead of reflecting that this is a single-step flow.
1894
+ const isPaymentOnlySession = cartStoreIsOrderModificationPaymentOnlySession();
1796
1895
  const { colorPrimary, colorSecondary, logoUrl, style } = mergeConfig(zonosStore.appearance, this.appearanceSettingsOverride || null);
1797
1896
  const hasFooter = zonosStore.appearance.zonosAttribution === 'ENABLED';
1798
1897
  const rightSideTheme = zonosStore.appearance.theme;
@@ -1823,9 +1922,9 @@ export class ZonosCheckout {
1823
1922
  const zonosDebug = urlParams.get('zonosDebug');
1824
1923
  const zonosE2ETest = urlParams.get('zonosE2ETest');
1825
1924
  const zonosStagingMode = this.overrideStagingMode || getIsStagingMode();
1826
- return (h("zonos-v-stack", null, h("div", { class: "zonos--logo-wrapper" }, renderLogo(), isTestMode && (h("zonos-badge", { badgeColor: "orange", size: "small" }, translate('Test mode'))), zonosStagingMode && (h("zonos-badge", { badgeColor: "red", size: "small" }, translate('Staging mode'))), zonosDebug === '1' && (h("zonos-badge", { badgeColor: "cyan", size: "small" }, "debug")), zonosQaUrl && (h("zonos-badge", { badgeColor: "purple", size: "small" }, zonosQaUrl)), zonosE2ETest && (h("zonos-badge", { badgeColor: "gray", size: "small" }, "E2E Test"))), h("zonos-checkout-progress-tabs", { backgroundColor:
1925
+ return (h("zonos-v-stack", null, h("div", { class: "zonos--logo-wrapper" }, renderLogo(), isTestMode && (h("zonos-badge", { badgeColor: "orange", size: "small" }, translate('Test mode'))), zonosStagingMode && (h("zonos-badge", { badgeColor: "red", size: "small" }, translate('Staging mode'))), zonosDebug === '1' && (h("zonos-badge", { badgeColor: "cyan", size: "small" }, "debug")), zonosQaUrl && (h("zonos-badge", { badgeColor: "purple", size: "small" }, zonosQaUrl)), zonosE2ETest && (h("zonos-badge", { badgeColor: "gray", size: "small" }, "E2E Test"))), !isPaymentOnlySession && (h("zonos-checkout-progress-tabs", { backgroundColor:
1827
1926
  // only use different contrast color when the secondary color is too off with the background in mobile
1828
- this.isMobile ? '--zonos-elements-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
1927
+ this.isMobile ? '--zonos-elements-gray-0' : null })), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
1829
1928
  };
1830
1929
  const renderContent = () => {
1831
1930
  if (cartStore.checkoutSessionTimeoutShow) {
@@ -2191,7 +2290,7 @@ export class ZonosCheckout {
2191
2290
  "signature": "(session: CheckoutSessionDetailsFragment) => Promise<void>",
2192
2291
  "parameters": [{
2193
2292
  "name": "session",
2194
- "type": "{ cartId: string | null; clientSecret: string; completedAt: string | null; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; name: string | null; phone: string | null; locality: string; postalCode: string; }[] | null; name: string | null; storeCreditBalance: number | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; appliedAdjustments: { adjustment: { name: string | null; source: AdjustmentSource | null; } | null; amount: number; type: LandedCostAdjustmentType | null; item: { amount: number; } | null; }[] | null; currencyCode: CurrencyCode; deMinimis: { type: DeMinimisType; threshold: DeMinimisThreshold; method: IncotermCode; note: string; formula: string; }[]; duties: { amount: number; currencyCode: CurrencyCode; }[]; fees: { amount: number; currencyCode: CurrencyCode; }[]; landedCostGuaranteeCode: LandedCostGuaranteeCode; id: string; method: IncotermCode; remittance: { amount: number; description: string; }[]; rootId: string; shipmentRating: { amount: number; currencyCode: CurrencyCode; displayName: string; id: string; shippingProfile: { serviceLevel: { code: string; deliveryType: DeliveryType | null; }; transitTime: { guaranteedDelivery: string | null; max: number | null; min: number | null; type: TransitTypeCode | null; } | null; } | null; }; taxes: { amount: number; currencyCode: CurrencyCode; }[]; } | null; metadata: ({ key: string; value: string; } | null)[] | null; organizationId: string; paymentProcessor: CheckoutPaymentProcessorType | null; references: { inclusivePriceConfigurationId: string | null; } | null; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; storeCredit: number; taxes: number; total: number; }; varianceTestResults: { selectedVariantKey: string; testKey: string; }[] | null; }",
2293
+ "type": "{ cartId: string | null; clientSecret: string; completedAt: string | null; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; locality: string; name: string | null; phone: string | null; postalCode: string; }[] | null; name: string | null; storeCreditBalance: number | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; appliedAdjustments: { adjustment: { name: string | null; source: AdjustmentSource | null; } | null; amount: number; item: { amount: number; } | null; type: LandedCostAdjustmentType | null; }[] | null; currencyCode: CurrencyCode; deMinimis: { formula: string; method: IncotermCode; note: string; threshold: DeMinimisThreshold; type: DeMinimisType; }[]; duties: { amount: number; currencyCode: CurrencyCode; }[]; fees: { amount: number; currencyCode: CurrencyCode; }[]; id: string; landedCostGuaranteeCode: LandedCostGuaranteeCode; method: IncotermCode; remittance: { amount: number; description: string; }[]; rootId: string; shipmentRating: { amount: number; currencyCode: CurrencyCode; displayName: string; id: string; shippingProfile: { serviceLevel: { code: string; deliveryType: DeliveryType | null; }; transitTime: { guaranteedDelivery: string | null; max: number | null; min: number | null; type: TransitTypeCode | null; } | null; } | null; }; taxes: { amount: number; currencyCode: CurrencyCode; }[]; } | null; metadata: ({ key: string; value: string; } | null)[] | null; order: { id: string; } | null; organizationId: string; paymentProcessor: CheckoutPaymentProcessorType | null; references: { inclusivePriceConfigurationId: string | null; } | null; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; storeCredit: number; taxes: number; total: number; }; varianceTestResults: { selectedVariantKey: string; testKey: string; }[] | null; }",
2195
2294
  "docs": ""
2196
2295
  }],
2197
2296
  "references": {
@@ -183,6 +183,19 @@ const cartStoreHasOneEligibleItem = () => {
183
183
  // if there is no item restricted found => all items are restricted
184
184
  return !!checkItems.find(item => !item.isRestricted);
185
185
  };
186
+ /**
187
+ * An order-modification payment-only session (skip-to-payment, no shipping
188
+ * step): a session tied to an order that hasn't completed yet, meaning the
189
+ * shopper is only paying a delta against an already-approved landed cost.
190
+ * Single source of truth for this detection — previously duplicated inline
191
+ * at each call site, which let one of them (the forceDialogOpen/preview init
192
+ * path) miss it entirely.
193
+ */
194
+ const cartStoreIsOrderModificationPaymentOnlySession = () => {
195
+ var _a, _b;
196
+ return !!(((_b = (_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.order) === null || _b === void 0 ? void 0 : _b.id) &&
197
+ !cartStore.checkoutSession.completedAt);
198
+ };
186
199
  const cartStoreSetCheckoutSession = (checkoutSession) => {
187
200
  var _a, _b, _c, _d, _e, _f, _g;
188
201
  // update stripe store with updated information
@@ -539,4 +552,4 @@ const cartStoreUpdateStoreCredit = () => {
539
552
  void cartStoreUpdateStoreCreditImmediate();
540
553
  }, 300);
541
554
  };
542
- export { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStoreClearCheckoutInterval, cartStoreGetMethod, cartStoreGetShippingTransitInfo, cartStoreHasOneEligibleItem, cartStoreNextStep, cartStoreOnChange, cartStorePreviousStep, cartStoreReCalculateTotal, cartStoreReset, cartStoreResetCartItems, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateSelectedShippingOption, cartStoreUpdateStoreCredit, cartStoreUpdateToErrorState, };
555
+ export { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStoreClearCheckoutInterval, cartStoreGetMethod, cartStoreGetShippingTransitInfo, cartStoreHasOneEligibleItem, cartStoreIsOrderModificationPaymentOnlySession, cartStoreNextStep, cartStoreOnChange, cartStorePreviousStep, cartStoreReCalculateTotal, cartStoreReset, cartStoreResetCartItems, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateSelectedShippingOption, cartStoreUpdateStoreCredit, cartStoreUpdateToErrorState, };
@@ -7,7 +7,7 @@ import { sendErrorLog } from "./logging/sendErrorLog";
7
7
  * Validate checkout session before confirming payment
8
8
  */
9
9
  export const validateCheckoutSession = async () => {
10
- var _a;
10
+ var _a, _b;
11
11
  // get checkout session info
12
12
  const { errors, json } = await getCheckoutSession();
13
13
  if (errors.length || !json) {
@@ -22,8 +22,16 @@ export const validateCheckoutSession = async () => {
22
22
  valid: false,
23
23
  };
24
24
  }
25
- // Make sure landed cost is found in the checkout session
26
- if (!((_a = json.checkoutSession.landedCost) === null || _a === void 0 ? void 0 : _a.id)) {
25
+ // Make sure landed cost is found in the checkout session. Order-modification
26
+ // payment-only sessions (skip-to-payment, no shipping step) never carry a
27
+ // landedCost on the checkout session — same reason stripeStoreConfirmPayment
28
+ // skips its own selectedLandedCost guard for this flow. Inferred here from
29
+ // the session itself (order attached + not completed) rather than a
30
+ // caller-supplied flag, so every call site behaves consistently without
31
+ // needing to know about this special case.
32
+ const isOrderModificationPaymentOnlySession = !!(((_a = json.checkoutSession.order) === null || _a === void 0 ? void 0 : _a.id) && !json.checkoutSession.completedAt);
33
+ if (!isOrderModificationPaymentOnlySession &&
34
+ !((_b = json.checkoutSession.landedCost) === null || _b === void 0 ? void 0 : _b.id)) {
27
35
  logError('Landed cost is not found in the checkout session before confirming payment.');
28
36
  void sendErrorLog({
29
37
  endpoint: 'validateCheckoutSession',
@@ -37,6 +37,7 @@ export const featureAspectKeyEnum = {
37
37
  NewPayoutReport: 'new_payout_report',
38
38
  NewRefundsUx: 'new_refunds_ux',
39
39
  OnboardingBeta: 'onboarding_beta',
40
+ OrderModifications: 'order_modifications',
40
41
  OrderReturns: 'order_returns',
41
42
  PageAuditor: 'page_auditor',
42
43
  PromptExplorer: 'prompt_explorer',
@@ -72,6 +73,7 @@ export const featureAudienceNameEnum = {
72
73
  NewRefundsUxMerchant: 'new_refunds_ux_merchant',
73
74
  Onboarding: 'onboarding',
74
75
  OnboardingBetaMerchant: 'onboarding_beta_merchant',
76
+ OrderModificationsMerchant: 'order_modifications_merchant',
75
77
  OrderReturnsMerchant: 'order_returns_merchant',
76
78
  PrincipalEngineer: 'principal_engineer',
77
79
  ProServeHead: 'pro_serve_head',
@@ -527,6 +527,12 @@ export const analyticsProviderType = {
527
527
  FacebookPixel: 'FACEBOOK_PIXEL',
528
528
  GoogleAnalytics: 'GOOGLE_ANALYTICS',
529
529
  };
530
+ export const animalDrugApplicationType = {
531
+ AbbreviatedNada: 'ABBREVIATED_NADA',
532
+ ConditionallyApprovedNada: 'CONDITIONALLY_APPROVED_NADA',
533
+ Nada: 'NADA',
534
+ Unspecified: 'UNSPECIFIED',
535
+ };
530
536
  export const answerProvenance = {
531
537
  Inferred: 'INFERRED',
532
538
  Manual: 'MANUAL',
@@ -832,9 +838,6 @@ export const brokerageNatureOfTransaction = {
832
838
  NotForResale: 'NOT_FOR_RESALE',
833
839
  Return: 'RETURN',
834
840
  };
835
- export const brokerageNotificationType = {
836
- ComplianceQuestionnaire: 'COMPLIANCE_QUESTIONNAIRE',
837
- };
838
841
  export const brokeragePgaAgency = {
839
842
  Other: 'OTHER',
840
843
  UsAtf: 'US_ATF',
@@ -2401,6 +2404,25 @@ export const detailGroupInputType = {
2401
2404
  PostalCredit: 'POSTAL_CREDIT',
2402
2405
  PostalOrderCancel: 'POSTAL_ORDER_CANCEL',
2403
2406
  };
2407
+ export const deviceClass = {
2408
+ ClassI: 'CLASS_I',
2409
+ ClassIi: 'CLASS_II',
2410
+ ClassIii: 'CLASS_III',
2411
+ NotClassified: 'NOT_CLASSIFIED',
2412
+ Unclassified: 'UNCLASSIFIED',
2413
+ Unspecified: 'UNSPECIFIED',
2414
+ };
2415
+ export const deviceEstablishmentRole = {
2416
+ ForeignExporter: 'FOREIGN_EXPORTER',
2417
+ ForeignManufacturer: 'FOREIGN_MANUFACTURER',
2418
+ UnitedStatesManufacturer: 'UNITED_STATES_MANUFACTURER',
2419
+ };
2420
+ export const devicePremarketStatus = {
2421
+ Exempt: 'EXEMPT',
2422
+ RequiredPma: 'REQUIRED_PMA',
2423
+ Required_510K: 'REQUIRED_510K',
2424
+ Unspecified: 'UNSPECIFIED',
2425
+ };
2404
2426
  export const dimensionalUnitCode = {
2405
2427
  Centimeter: 'CENTIMETER',
2406
2428
  Decimeter: 'DECIMETER',
@@ -2447,6 +2469,7 @@ export const documentReferenceType = {
2447
2469
  Product: 'PRODUCT',
2448
2470
  Shipment: 'SHIPMENT',
2449
2471
  Sku: 'SKU',
2472
+ TrackingNumber: 'TRACKING_NUMBER',
2450
2473
  };
2451
2474
  export const documentType = {
2452
2475
  CertificateOfOrigin: 'CERTIFICATE_OF_ORIGIN',
@@ -2476,6 +2499,10 @@ export const draftDetailEventTrigger = {
2476
2499
  PaymentCapture: 'PAYMENT_CAPTURE',
2477
2500
  TrackingNumber: 'TRACKING_NUMBER',
2478
2501
  };
2502
+ export const drugListingType = {
2503
+ Finished: 'FINISHED',
2504
+ Unfinished: 'UNFINISHED',
2505
+ };
2479
2506
  export const dutyTaxFeeConfiguration = {
2480
2507
  ExcludeAll: 'EXCLUDE_ALL',
2481
2508
  ExcludeDuty: 'EXCLUDE_DUTY',
@@ -4171,6 +4198,31 @@ export const landedCostWeightUnit = {
4171
4198
  Oz: 'OZ',
4172
4199
  T: 'T',
4173
4200
  };
4201
+ export const laneRuleAccess = {
4202
+ Ddp: 'DDP',
4203
+ LcGuarantee: 'LC_GUARANTEE',
4204
+ PostalOperator: 'POSTAL_OPERATOR',
4205
+ PostalOperatorMerchant: 'POSTAL_OPERATOR_MERCHANT',
4206
+ };
4207
+ export const laneRuleOperator = {
4208
+ Eq: 'EQ',
4209
+ Gt: 'GT',
4210
+ Gte: 'GTE',
4211
+ Lt: 'LT',
4212
+ Lte: 'LTE',
4213
+ Neq: 'NEQ',
4214
+ };
4215
+ export const laneRuleSubject = {
4216
+ Cif: 'CIF',
4217
+ Cost: 'COST',
4218
+ Duty: 'DUTY',
4219
+ ItemsTotal: 'ITEMS_TOTAL',
4220
+ Tax: 'TAX',
4221
+ };
4222
+ export const laneThresholdType = {
4223
+ Duty: 'DUTY',
4224
+ Tax: 'TAX',
4225
+ };
4174
4226
  export const languageCode = {
4175
4227
  Af: 'AF',
4176
4228
  Am: 'AM',
@@ -4388,6 +4440,14 @@ export const manualClassificationStatus = {
4388
4440
  Active: 'ACTIVE',
4389
4441
  Archived: 'ARCHIVED',
4390
4442
  };
4443
+ export const manualCredentialFieldRequirement = {
4444
+ Optional: 'OPTIONAL',
4445
+ Required: 'REQUIRED',
4446
+ };
4447
+ export const manualCredentialFieldType = {
4448
+ Password: 'PASSWORD',
4449
+ Text: 'TEXT',
4450
+ };
4391
4451
  export const markDraftPendingAtMonthStartStatus = {
4392
4452
  Disabled: 'DISABLED',
4393
4453
  Enabled: 'ENABLED',
@@ -4495,9 +4555,9 @@ export const orderMerchantOfRecordType = {
4495
4555
  Zonos: 'ZONOS',
4496
4556
  };
4497
4557
  export const orderModificationStatus = {
4498
- NoPaymentRequired: 'NO_PAYMENT_REQUIRED',
4499
- Paid: 'PAID',
4500
- PendingPayment: 'PENDING_PAYMENT',
4558
+ Committed: 'COMMITTED',
4559
+ Pending: 'PENDING',
4560
+ Voided: 'VOIDED',
4501
4561
  };
4502
4562
  export const orderNoteType = {
4503
4563
  Comment: 'COMMENT',
@@ -5969,6 +6029,11 @@ export const stripeTrialEndBehavior = {
5969
6029
  CreateInvoice: 'CREATE_INVOICE',
5970
6030
  Pause: 'PAUSE',
5971
6031
  };
6032
+ export const taxCalculationType = {
6033
+ Cif: 'CIF',
6034
+ Custom: 'CUSTOM',
6035
+ Fob: 'FOB',
6036
+ };
5972
6037
  export const taxIdType = {
5973
6038
  Cnp: 'CNP',
5974
6039
  Cuil: 'CUIL',
@@ -814,7 +814,7 @@ const sortServiceLevelOptionsByAmount = (serviceLevels) => {
814
814
  * Validate checkout session before confirming payment
815
815
  */
816
816
  const validateCheckoutSession = async () => {
817
- var _a;
817
+ var _a, _b;
818
818
  // get checkout session info
819
819
  const { errors, json } = await getCheckoutSession();
820
820
  if (errors.length || !json) {
@@ -829,8 +829,16 @@ const validateCheckoutSession = async () => {
829
829
  valid: false,
830
830
  };
831
831
  }
832
- // Make sure landed cost is found in the checkout session
833
- if (!((_a = json.checkoutSession.landedCost) === null || _a === void 0 ? void 0 : _a.id)) {
832
+ // Make sure landed cost is found in the checkout session. Order-modification
833
+ // payment-only sessions (skip-to-payment, no shipping step) never carry a
834
+ // landedCost on the checkout session — same reason stripeStoreConfirmPayment
835
+ // skips its own selectedLandedCost guard for this flow. Inferred here from
836
+ // the session itself (order attached + not completed) rather than a
837
+ // caller-supplied flag, so every call site behaves consistently without
838
+ // needing to know about this special case.
839
+ const isOrderModificationPaymentOnlySession = !!(((_a = json.checkoutSession.order) === null || _a === void 0 ? void 0 : _a.id) && !json.checkoutSession.completedAt);
840
+ if (!isOrderModificationPaymentOnlySession &&
841
+ !((_b = json.checkoutSession.landedCost) === null || _b === void 0 ? void 0 : _b.id)) {
834
842
  logError('Landed cost is not found in the checkout session before confirming payment.');
835
843
  void sendErrorLog({
836
844
  endpoint: 'validateCheckoutSession',
@@ -2372,6 +2380,19 @@ const cartStoreHasOneEligibleItem = () => {
2372
2380
  // if there is no item restricted found => all items are restricted
2373
2381
  return !!checkItems.find(item => !item.isRestricted);
2374
2382
  };
2383
+ /**
2384
+ * An order-modification payment-only session (skip-to-payment, no shipping
2385
+ * step): a session tied to an order that hasn't completed yet, meaning the
2386
+ * shopper is only paying a delta against an already-approved landed cost.
2387
+ * Single source of truth for this detection — previously duplicated inline
2388
+ * at each call site, which let one of them (the forceDialogOpen/preview init
2389
+ * path) miss it entirely.
2390
+ */
2391
+ const cartStoreIsOrderModificationPaymentOnlySession = () => {
2392
+ var _a, _b;
2393
+ return !!(((_b = (_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.order) === null || _b === void 0 ? void 0 : _b.id) &&
2394
+ !cartStore.checkoutSession.completedAt);
2395
+ };
2375
2396
  const cartStoreSetCheckoutSession = (checkoutSession) => {
2376
2397
  var _a, _b, _c, _d, _e, _f, _g;
2377
2398
  // update stripe store with updated information
@@ -2729,4 +2750,4 @@ const cartStoreUpdateStoreCredit = () => {
2729
2750
  }, 300);
2730
2751
  };
2731
2752
 
2732
- export { getEnabledPolicies as $, validateCheckoutSession as A, storeCreditStoreCreateOrder as B, stripeStoreConfirmPayment as C, stripeStoreHandleInventoryRefund as D, policyConsentStore as E, stripeStoreReset as F, cartStoreOnChange as G, stripeStoreOnChange as H, storeCreditStoreGetEffectiveAmount as I, stripeStoreRecordPolicyConsent as J, stripeStoreBuildAddressForPartyCreate as K, cartStoreUpdateSelectedShippingOption as L, cartStoreHasOneEligibleItem as M, isEuDapRemittance as N, stripeStoreApplyPromoCode as O, stripeStoreRemovePromoCode as P, stripeStoreResetPromoCode as Q, stripeStoreMessageBasedOnStatus as R, storeCreditStore as S, storeCreditStoreReset as T, extractName as U, stripeStoreTranslateAddressToLatin as V, getCountryField as W, stripeStoreAsyncAddressUpdate as X, cartStoreGetShippingTransitInfo as Y, cartStoreGetMethod as Z, sortServiceLevelOptionsByAmount as _, stripeStoreSaveDomesticShippingSession as a, storeCreditStoreSetEnabled as a0, storeCreditStoreSetUseFullBalance as a1, cartStoreUpdateStoreCredit as a2, storeCreditStoreSetAmount as a3, storeCreditStoreRefreshBalance as a4, stripeStore as b, stripeStoreRetrievePayment as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, cartStoreResetTabItems as g, cartStoreClearCheckoutInterval as h, initStripeElements as i, stripeStoreInitCheckoutSession as j, stripeStoreGetPaymentIntent as k, stripeStoreHandleInventoryCheck as l, cartStoreStartCheckoutInterval as m, getCheckoutSessionBody as n, cartStoreUpdateToErrorState as o, policyConsentStoreReset as p, stripeStoreCleanupDomesticShippingSession as q, cartStoreSetCheckoutSession as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStorePrefetchLandedCost as u, cartStoreNextStep as v, isPolicyConsentRequired as w, stripeStoreUpdateCheckoutSessionBaseCurrency as x, storeCreditStoreApplyCredit as y, storeCreditStoreCoversFullAmount as z };
2753
+ export { cartStoreGetMethod as $, storeCreditStoreApplyCredit as A, storeCreditStoreCoversFullAmount as B, validateCheckoutSession as C, storeCreditStoreCreateOrder as D, stripeStoreConfirmPayment as E, stripeStoreHandleInventoryRefund as F, policyConsentStore as G, stripeStoreReset as H, cartStoreOnChange as I, stripeStoreOnChange as J, storeCreditStoreGetEffectiveAmount as K, stripeStoreRecordPolicyConsent as L, stripeStoreBuildAddressForPartyCreate as M, cartStoreUpdateSelectedShippingOption as N, cartStoreHasOneEligibleItem as O, isEuDapRemittance as P, stripeStoreApplyPromoCode as Q, stripeStoreRemovePromoCode as R, stripeStoreResetPromoCode as S, stripeStoreMessageBasedOnStatus as T, storeCreditStore as U, storeCreditStoreReset as V, extractName as W, stripeStoreTranslateAddressToLatin as X, getCountryField as Y, stripeStoreAsyncAddressUpdate as Z, cartStoreGetShippingTransitInfo as _, stripeStoreSaveDomesticShippingSession as a, sortServiceLevelOptionsByAmount as a0, getEnabledPolicies as a1, storeCreditStoreSetEnabled as a2, storeCreditStoreSetUseFullBalance as a3, cartStoreUpdateStoreCredit as a4, storeCreditStoreSetAmount as a5, storeCreditStoreRefreshBalance as a6, stripeStore as b, stripeStoreRetrievePayment as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, getCheckoutSession as g, cartStoreResetTabItems as h, initStripeElements as i, cartStoreClearCheckoutInterval as j, stripeStoreInitCheckoutSession as k, stripeStoreGetPaymentIntent as l, cartStoreIsOrderModificationPaymentOnlySession as m, stripeStoreHandleInventoryCheck as n, cartStoreStartCheckoutInterval as o, policyConsentStoreReset as p, getCheckoutSessionBody as q, cartStoreUpdateToErrorState as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStoreCleanupDomesticShippingSession as u, cartStoreSetCheckoutSession as v, stripeStorePrefetchLandedCost as w, cartStoreNextStep as x, isPolicyConsentRequired as y, stripeStoreUpdateCheckoutSessionBaseCurrency as z };
@@ -2,7 +2,7 @@ import { c as createStore, z as zonosStore } from './zonosStore-eca1e364.js';
2
2
  import { t as translate, l as localizationStore, s as storageStore } from './localization-36a4dc22.js';
3
3
  import { l as logError$1, h as handleFetch, s as sendErrorLog } from './handleFetch-a844cac1.js';
4
4
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
5
- import { b as stripeStore, K as stripeStoreBuildAddressForPartyCreate, d as cartStore, L as cartStoreUpdateSelectedShippingOption } from './cart-2e407f7b.js';
5
+ import { b as stripeStore, M as stripeStoreBuildAddressForPartyCreate, d as cartStore, N as cartStoreUpdateSelectedShippingOption } from './cart-d04742f5.js';
6
6
 
7
7
  // src/constant/common.ts
8
8
  function _array_like_to_array(arr, len) {
@@ -1,4 +1,4 @@
1
- import { U as extractName } from './cart-2e407f7b.js';
1
+ import { W as extractName } from './cart-d04742f5.js';
2
2
 
3
3
  /**
4
4
  * Minimum number of characters we treat as a valid postal code. Mirrors the
package/dist/esm/index.js CHANGED
@@ -131,7 +131,7 @@ const getZonosQaUrl = () => {
131
131
  return null;
132
132
  }
133
133
  const qaUrl = extractZonosQaUrl(window.location.href);
134
- const cdnUrl = "https://v1.3.285.js.zonos.com";
134
+ const cdnUrl = "https://v1.3.286.js.zonos.com";
135
135
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
136
136
  if (!qaUrl &&
137
137
  (cdnUrl.includes('test.') ||
@@ -397,10 +397,10 @@ const zonosLoadUrl = (() => {
397
397
  return null;
398
398
  })();
399
399
  const startLoadTime = Date.now();
400
- const ZONOS_URL = "https://v1.3.285.js.zonos.com";
401
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.285";
402
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.285";
403
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.285";
400
+ const ZONOS_URL = "https://v1.3.286.js.zonos.com";
401
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.286";
402
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.286";
403
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.286";
404
404
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
405
405
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
406
406
  class Zonos {
@@ -418,7 +418,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
418
418
  ? new URLSearchParams(window.location.search).get('iframeLogType')
419
419
  : null;
420
420
  Zonos.isBigCommerce = false;
421
- Zonos.releaseDate = "1787351938302";
421
+ Zonos.releaseDate = "1788207564864";
422
422
  Zonos.isLegacyCheckout = false;
423
423
  Zonos.googleAnalyticId = null;
424
424
  Zonos.googleAnalyticReady = false;
@@ -443,7 +443,7 @@ Zonos.isNpm = true;
443
443
  Zonos.zonosQaUrl = null;
444
444
  Zonos.zonosQaUrlApi = null;
445
445
  Zonos.trackEventLogs = [];
446
- Zonos.version = `v${"1.3.285"}`;
446
+ Zonos.version = `v${"1.3.286"}`;
447
447
  Zonos.modeAlerted = false;
448
448
  Zonos.cartData = null;
449
449
  Zonos.paypal = null;
@@ -1,5 +1,5 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-eca1e364.js';
2
- import { b as stripeStore, K as stripeStoreBuildAddressForPartyCreate, d as cartStore, L as cartStoreUpdateSelectedShippingOption } from './cart-2e407f7b.js';
2
+ import { b as stripeStore, M as stripeStoreBuildAddressForPartyCreate, d as cartStore, N as cartStoreUpdateSelectedShippingOption } from './cart-d04742f5.js';
3
3
  import { s as storageStore } from './localization-36a4dc22.js';
4
4
  import { h as handleFetch, s as sendErrorLog, l as logError } from './handleFetch-a844cac1.js';
5
5
  import { b as allLogs } from './VarianceTest-572cecf5.js';
@@ -1,5 +1,5 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-eca1e364.js';
2
- import { t as trackConversionEvent, w as isPolicyConsentRequired, E as policyConsentStore, A as validateCheckoutSession, b as stripeStore, d as cartStore, l as stripeStoreHandleInventoryCheck, y as storeCreditStoreApplyCredit, J as stripeStoreRecordPolicyConsent, z as storeCreditStoreCoversFullAmount, B as storeCreditStoreCreateOrder, v as cartStoreNextStep, h as cartStoreClearCheckoutInterval, I as storeCreditStoreGetEffectiveAmount } from './cart-2e407f7b.js';
2
+ import { t as trackConversionEvent, y as isPolicyConsentRequired, G as policyConsentStore, C as validateCheckoutSession, b as stripeStore, d as cartStore, n as stripeStoreHandleInventoryCheck, A as storeCreditStoreApplyCredit, L as stripeStoreRecordPolicyConsent, B as storeCreditStoreCoversFullAmount, D as storeCreditStoreCreateOrder, x as cartStoreNextStep, j as cartStoreClearCheckoutInterval, K as storeCreditStoreGetEffectiveAmount } from './cart-d04742f5.js';
3
3
  import { t as translate, s as storageStore } from './localization-36a4dc22.js';
4
4
  import { h as handleFetch, g as getIsTestMode, l as logError, j as jsonParse } from './handleFetch-a844cac1.js';
5
5
  import { i as isContrastColor } from './isContrastColor-9fa0d013.js';
@@ -1,4 +1,4 @@
1
- import { d as cartStore } from './cart-2e407f7b.js';
1
+ import { d as cartStore } from './cart-d04742f5.js';
2
2
  import { s as storageStore } from './localization-36a4dc22.js';
3
3
  import { l as logError, h as handleFetch } from './handleFetch-a844cac1.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { d as cartStore } from './cart-2e407f7b.js';
1
+ import { d as cartStore } from './cart-d04742f5.js';
2
2
  import { x as applyInclusiveEffectiveRate, h as currencyFormat } from './localization-36a4dc22.js';
3
3
 
4
4
  const getDisplayCurrency = () => {
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, d as createEvent, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
2
  import { t as translate, s as storageStore, A as storageStoreOnChange, l as localizationStore } from './localization-36a4dc22.js';
3
3
  import { z as zonosStore, f as zonosStoreFontFamily } from './zonosStore-eca1e364.js';
4
- import { M as MIN_POSTAL_CODE_LENGTH } from './getMissingRequiredShippingFields-719b206f.js';
4
+ import { M as MIN_POSTAL_CODE_LENGTH } from './getMissingRequiredShippingFields-f0878e32.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
- import { U as extractName, b as stripeStore, u as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-2e407f7b.js';
6
+ import { W as extractName, b as stripeStore, w as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-d04742f5.js';
7
7
  import { R as RemoveIcon$1 } from './RemoveIcon-9dc5dd1a.js';
8
8
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
9
9
  import { g as getBorderRadius } from './getBorderRadius-1f7be586.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, d as createEvent, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
2
  import { t as throttle_1 } from './throttle-c4c24e86.js';
3
- import { U as extractName, b as stripeStore, t as trackConversionEvent, H as stripeStoreOnChange, u as stripeStorePrefetchLandedCost, d as cartStore } from './cart-2e407f7b.js';
3
+ import { W as extractName, b as stripeStore, t as trackConversionEvent, J as stripeStoreOnChange, w as stripeStorePrefetchLandedCost, d as cartStore } from './cart-d04742f5.js';
4
4
  import { s as storageStore, B as getFallbackDefaultCountryCode, t as translate, A as storageStoreOnChange, l as localizationStore } from './localization-36a4dc22.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-eca1e364.js';
6
6
  import { l as logError, i as isCheckoutMobile, s as sendErrorLog } from './handleFetch-a844cac1.js';