@zonos/elements 1.3.121 → 1.3.123
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/cjs/{CheckoutConfig-222be92b.js → CheckoutConfig-00c7333a.js} +1 -1
- package/dist/cjs/{cart-b2ba04a6.js → cart-d2676914.js} +38 -16
- package/dist/cjs/{handleFetch-bd39d5cc.js → handleFetch-83c97d08.js} +1 -1
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{paypal-1209340d.js → paypal-617669c3.js} +2 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +5 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
- package/dist/collection/__tests__/build-utils/urlCheckOne.js +7 -15
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -1
- package/dist/collection/components/store/checkout/stripe.js +37 -15
- package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
- package/dist/collection/types/generated/graphql.internal.types.js +37 -4
- package/dist/collection/utils/formattedUrl.js +2 -1
- package/dist/esm/{CheckoutConfig-f3f1d468.js → CheckoutConfig-5cde3ee4.js} +1 -1
- package/dist/esm/{cart-c2a7dbf4.js → cart-5346e4d9.js} +38 -17
- package/dist/esm/{handleFetch-752697c2.js → handleFetch-7424d200.js} +1 -1
- package/dist/esm/index.js +10 -10
- package/dist/esm/{paypal-47ce80b4.js → paypal-db99e15a.js} +2 -2
- package/dist/esm/zonos-address_7.entry.js +2 -2
- package/dist/esm/zonos-cart-items_13.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +5 -4
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm-es5/{CheckoutConfig-f3f1d468.js → CheckoutConfig-5cde3ee4.js} +1 -1
- package/dist/esm-es5/cart-5346e4d9.js +1 -0
- package/dist/esm-es5/handleFetch-7424d200.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-47ce80b4.js → paypal-db99e15a.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.d.ts +2 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/__tests__/build-utils/urlCheckOne.d.ts +1 -3
- package/dist/types/components/store/checkout/cart.d.ts +1 -0
- package/dist/types/components/store/checkout/stripe.d.ts +2 -1
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +2 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +47 -7
- package/dist/types/types/generated/graphql.internal.types.ts +60 -8
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-02495901.entry.js → p-06636f62.entry.js} +1 -1
- package/dist/zonos-elements/{p-76251f26.system.entry.js → p-20411dc5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3a3dd0a7.entry.js +1 -0
- package/dist/zonos-elements/p-3ef38f02.system.js +1 -0
- package/dist/zonos-elements/{p-2251fc7e.entry.js → p-4f5da154.entry.js} +1 -1
- package/dist/zonos-elements/{p-d4ae2bd4.system.js → p-5fe1e3f6.system.js} +2 -2
- package/dist/zonos-elements/{p-34fb869f.js → p-62384488.js} +1 -1
- package/dist/zonos-elements/{p-9af218f8.entry.js → p-6efffc06.entry.js} +1 -1
- package/dist/zonos-elements/p-81055154.system.js +1 -0
- package/dist/zonos-elements/p-8231711f.js +1 -0
- package/dist/zonos-elements/{p-0af2a53c.entry.js → p-860716a1.entry.js} +1 -1
- package/dist/zonos-elements/{p-b8e00fdf.system.js → p-8c7715aa.system.js} +1 -1
- package/dist/zonos-elements/{p-c0fc4490.js → p-8e317f73.js} +1 -1
- package/dist/zonos-elements/{p-f4b06db0.system.entry.js → p-8f7935f6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b1b7ac58.system.entry.js → p-97334e5a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d8e4b363.entry.js → p-9afea72c.entry.js} +1 -1
- package/dist/zonos-elements/{p-8a64b0c4.system.entry.js → p-9ea5037d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3a70faa7.system.entry.js → p-b00508d3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-81dbd74c.entry.js → p-b3b1c105.entry.js} +1 -1
- package/dist/zonos-elements/p-b98e54b2.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9b5f28ba.system.js → p-bc2efe24.system.js} +1 -1
- package/dist/zonos-elements/{p-b1373482.system.entry.js → p-c504e50e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-addf0048.entry.js → p-c97b9a45.entry.js} +1 -1
- package/dist/zonos-elements/{p-9143b174.entry.js → p-ccfd1d50.entry.js} +1 -1
- package/dist/zonos-elements/{p-3f464965.entry.js → p-cfaac5aa.entry.js} +1 -1
- package/dist/zonos-elements/{p-14b0dc71.system.entry.js → p-d1f1f84d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d5bd3c3a.system.entry.js → p-d5cf05b7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-63e67e78.system.entry.js → p-eb94b8c5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f3cdaa23.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-c2a7dbf4.js +0 -1
- package/dist/esm-es5/handleFetch-752697c2.js +0 -1
- package/dist/zonos-elements/p-1cdec61a.system.js +0 -1
- package/dist/zonos-elements/p-6cbcdee3.system.js +0 -1
- package/dist/zonos-elements/p-7780ded7.entry.js +0 -1
- package/dist/zonos-elements/p-a70da456.system.entry.js +0 -1
- package/dist/zonos-elements/p-d4110fa4.js +0 -1
- package/dist/zonos-elements/p-ee89e172.js +0 -1
|
@@ -325,10 +325,6 @@ export const classifyMissingHsCodesStatus = {
|
|
|
325
325
|
Disabled: 'DISABLED',
|
|
326
326
|
Enabled: 'ENABLED',
|
|
327
327
|
};
|
|
328
|
-
export const clearanceType = {
|
|
329
|
-
Commercial: 'COMMERCIAL',
|
|
330
|
-
Postal: 'POSTAL',
|
|
331
|
-
};
|
|
332
328
|
export const collectFeeCalculationType = {
|
|
333
329
|
Flat: 'FLAT',
|
|
334
330
|
Percent: 'PERCENT',
|
|
@@ -1076,11 +1072,17 @@ export const customsDocumentType = {
|
|
|
1076
1072
|
export const customsSpecAttributeType = {
|
|
1077
1073
|
AccountNumber: 'ACCOUNT_NUMBER',
|
|
1078
1074
|
B13A: 'B13A',
|
|
1075
|
+
DutyTaxBillingAccountNumber: 'DUTY_TAX_BILLING_ACCOUNT_NUMBER',
|
|
1079
1076
|
Eccn: 'ECCN',
|
|
1080
1077
|
Eori: 'EORI',
|
|
1078
|
+
Gst: 'GST',
|
|
1079
|
+
Ioss: 'IOSS',
|
|
1081
1080
|
Itn: 'ITN',
|
|
1082
1081
|
OrderNumber: 'ORDER_NUMBER',
|
|
1083
1082
|
PurchaseOrderNumber: 'PURCHASE_ORDER_NUMBER',
|
|
1083
|
+
ShippingBillingAccountNumber: 'SHIPPING_BILLING_ACCOUNT_NUMBER',
|
|
1084
|
+
Vat: 'VAT',
|
|
1085
|
+
Voec: 'VOEC',
|
|
1084
1086
|
};
|
|
1085
1087
|
export const customsSpecSourceType = {
|
|
1086
1088
|
ApiRequest: 'API_REQUEST',
|
|
@@ -1182,6 +1184,7 @@ export const elementsUiTheme = {
|
|
|
1182
1184
|
System: 'SYSTEM',
|
|
1183
1185
|
};
|
|
1184
1186
|
export const emailTemplateProviderType = {
|
|
1187
|
+
Custom: 'CUSTOM',
|
|
1185
1188
|
Sendgrid: 'SENDGRID',
|
|
1186
1189
|
};
|
|
1187
1190
|
export const emailTemplateStatus = {
|
|
@@ -1192,7 +1195,10 @@ export const emailTemplateType = {
|
|
|
1192
1195
|
AbandonedCart: 'ABANDONED_CART',
|
|
1193
1196
|
CatalogExport: 'CATALOG_EXPORT',
|
|
1194
1197
|
ClassificationExport: 'CLASSIFICATION_EXPORT',
|
|
1198
|
+
Custom: 'CUSTOM',
|
|
1199
|
+
InclusivePriceExport: 'INCLUSIVE_PRICE_EXPORT',
|
|
1195
1200
|
ManualClassificationExport: 'MANUAL_CLASSIFICATION_EXPORT',
|
|
1201
|
+
MerchantOrderConfirmation: 'MERCHANT_ORDER_CONFIRMATION',
|
|
1196
1202
|
OrderCanceled: 'ORDER_CANCELED',
|
|
1197
1203
|
OrderConfirmation: 'ORDER_CONFIRMATION',
|
|
1198
1204
|
OrderReceipt: 'ORDER_RECEIPT',
|
|
@@ -1357,6 +1363,12 @@ export const inclusivePriceCatalogValidationJobComplianceStatus = {
|
|
|
1357
1363
|
NonCompliant: 'NON_COMPLIANT',
|
|
1358
1364
|
Pending: 'PENDING',
|
|
1359
1365
|
};
|
|
1366
|
+
export const inclusivePriceExportJobStatus = {
|
|
1367
|
+
Completed: 'COMPLETED',
|
|
1368
|
+
Error: 'ERROR',
|
|
1369
|
+
Initialized: 'INITIALIZED',
|
|
1370
|
+
Processing: 'PROCESSING',
|
|
1371
|
+
};
|
|
1360
1372
|
export const inclusivePriceHistoryCsvJobStatus = {
|
|
1361
1373
|
Completed: 'COMPLETED',
|
|
1362
1374
|
Error: 'ERROR',
|
|
@@ -1866,6 +1878,18 @@ export const packageLocation = {
|
|
|
1866
1878
|
Rear: 'REAR',
|
|
1867
1879
|
Side: 'SIDE',
|
|
1868
1880
|
};
|
|
1881
|
+
export const packagingOptionBulkExportJobStatus = {
|
|
1882
|
+
Completed: 'COMPLETED',
|
|
1883
|
+
CompletedWithErrors: 'COMPLETED_WITH_ERRORS',
|
|
1884
|
+
Error: 'ERROR',
|
|
1885
|
+
Initialized: 'INITIALIZED',
|
|
1886
|
+
};
|
|
1887
|
+
export const packagingOptionBulkJobStatus = {
|
|
1888
|
+
Completed: 'COMPLETED',
|
|
1889
|
+
CompletedWithErrors: 'COMPLETED_WITH_ERRORS',
|
|
1890
|
+
Error: 'ERROR',
|
|
1891
|
+
Initialized: 'INITIALIZED',
|
|
1892
|
+
};
|
|
1869
1893
|
export const packagingOptionDeleteAction = {
|
|
1870
1894
|
Delete: 'DELETE',
|
|
1871
1895
|
Disable: 'DISABLE',
|
|
@@ -1970,6 +1994,10 @@ export const propertyType = {
|
|
|
1970
1994
|
Residental: 'RESIDENTAL',
|
|
1971
1995
|
Residential: 'RESIDENTIAL',
|
|
1972
1996
|
};
|
|
1997
|
+
export const providedHsCodeSource = {
|
|
1998
|
+
Classify: 'CLASSIFY',
|
|
1999
|
+
User: 'USER',
|
|
2000
|
+
};
|
|
1973
2001
|
export const providedHsCodeVisibilityStatus = {
|
|
1974
2002
|
NotVisible: 'NOT_VISIBLE',
|
|
1975
2003
|
Visible: 'VISIBLE',
|
|
@@ -2218,6 +2246,10 @@ export const trackingEventTypeCode = {
|
|
|
2218
2246
|
PickedUp: 'PICKED_UP',
|
|
2219
2247
|
PreTransit: 'PRE_TRANSIT',
|
|
2220
2248
|
};
|
|
2249
|
+
export const trackingType = {
|
|
2250
|
+
Package: 'PACKAGE',
|
|
2251
|
+
Shipment: 'SHIPMENT',
|
|
2252
|
+
};
|
|
2221
2253
|
export const transactionFeeType = {
|
|
2222
2254
|
DutyTax: 'DUTY_TAX',
|
|
2223
2255
|
LcgPerShipment: 'LCG_PER_SHIPMENT',
|
|
@@ -2307,6 +2339,7 @@ export const webhookType = {
|
|
|
2307
2339
|
IpSettingStatusChanged: 'IP_SETTING_STATUS_CHANGED',
|
|
2308
2340
|
OrderCanceled: 'ORDER_CANCELED',
|
|
2309
2341
|
OrderCreated: 'ORDER_CREATED',
|
|
2342
|
+
OrderShipping: 'ORDER_SHIPPING',
|
|
2310
2343
|
OrderStatusChanged: 'ORDER_STATUS_CHANGED',
|
|
2311
2344
|
OrderUpdated: 'ORDER_UPDATED',
|
|
2312
2345
|
ShipmentCanceled: 'SHIPMENT_CANCELED',
|
|
@@ -62,7 +62,8 @@ export const formattedUrl = ({ branchName, inCI: _inCI, inVercel: _inVercel, isV
|
|
|
62
62
|
}
|
|
63
63
|
const version = type === 'major' ? `${_packageVersion === null || _packageVersion === void 0 ? void 0 : _packageVersion.split('.')[0]}` : _packageVersion;
|
|
64
64
|
const isVersionedUrl = domainOnlyUrl === null || domainOnlyUrl === void 0 ? void 0 : domainOnlyUrl.startsWith('v');
|
|
65
|
-
|
|
65
|
+
// Should not add version prefix to the API as the API is versionless
|
|
66
|
+
const shouldAddVersion = (isProdBranch || _inCI) && !isVersionedUrl && !isServerless;
|
|
66
67
|
/**
|
|
67
68
|
* Trimming the `qa` from the domain url only when we add version prefix
|
|
68
69
|
* @reason We've now introduced alpha versioning for the QA branch deployment.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as handleFetch, l as log, a as logError } from './handleFetch-
|
|
1
|
+
import { h as handleFetch, l as log, a as logError } from './handleFetch-7424d200.js';
|
|
2
2
|
|
|
3
3
|
const getTempCartById = async ({ cartId, retries, }) => {
|
|
4
4
|
const urlParams = new URLSearchParams(window.location.search);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-6b5bd87c.js';
|
|
2
|
-
import { h as handleFetch, a as logError, l as log, f as fallbackApiList, j as jsonParse } from './handleFetch-
|
|
2
|
+
import { h as handleFetch, a as logError, l as log, f as fallbackApiList, s as sendErrorLog, j as jsonParse } from './handleFetch-7424d200.js';
|
|
3
3
|
import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
|
|
5
5
|
|
|
@@ -9638,7 +9638,7 @@ const getStripeOptions = ({ clientSecret, overrideBorderRadius, overridePrimaryC
|
|
|
9638
9638
|
const themeBasedColor = primaryColor && isDarkColor(primaryColor) ? 'night' : 'flat';
|
|
9639
9639
|
// if overrideTheme is provided, use it. Otherwise, use theme based on primary color
|
|
9640
9640
|
const theme = overrideTheme === 'DARK' ? 'night' : 'flat';
|
|
9641
|
-
const
|
|
9641
|
+
const paypalPaymentType = paypalEnabled ? ['external_paypal'] : [];
|
|
9642
9642
|
return {
|
|
9643
9643
|
appearance: {
|
|
9644
9644
|
labels: 'floating',
|
|
@@ -9653,7 +9653,7 @@ const getStripeOptions = ({ clientSecret, overrideBorderRadius, overridePrimaryC
|
|
|
9653
9653
|
colorPrimary: secondaryColor }),
|
|
9654
9654
|
},
|
|
9655
9655
|
clientSecret,
|
|
9656
|
-
externalPaymentMethodTypes: [...
|
|
9656
|
+
externalPaymentMethodTypes: [...paypalPaymentType],
|
|
9657
9657
|
locale: localizationStore.selectedLocale,
|
|
9658
9658
|
};
|
|
9659
9659
|
};
|
|
@@ -9787,7 +9787,7 @@ const stripeCalculateLandedCost = async () => {
|
|
|
9787
9787
|
}
|
|
9788
9788
|
};
|
|
9789
9789
|
const stripeStorePrefetchLandedCost = async (params) => {
|
|
9790
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
9790
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9791
9791
|
const applyingPromocode = !!(params === null || params === void 0 ? void 0 : params.applyingPromocode);
|
|
9792
9792
|
const stripeAddressReady = !!((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete);
|
|
9793
9793
|
const stripeLinkReady = !!((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.complete);
|
|
@@ -9840,6 +9840,22 @@ const stripeStorePrefetchLandedCost = async (params) => {
|
|
|
9840
9840
|
// default to empty array if we failed to fetch landed cost, so we can show the error message
|
|
9841
9841
|
cartStore.landedCostData = [];
|
|
9842
9842
|
cartStore.shippingData = [];
|
|
9843
|
+
const excludeErrors = [
|
|
9844
|
+
'The landed cost calculation request was aborted to initiate a new one.',
|
|
9845
|
+
];
|
|
9846
|
+
if (err instanceof Error &&
|
|
9847
|
+
err.message &&
|
|
9848
|
+
!excludeErrors.includes(err.message)) {
|
|
9849
|
+
const shipToAddress = (_h = stripeStore.stripeAddressUsedWhenFetchingLC) === null || _h === void 0 ? void 0 : _h.value;
|
|
9850
|
+
void sendErrorLog({
|
|
9851
|
+
endpoint: 'Failed to fetch landed cost',
|
|
9852
|
+
errors: [err.message],
|
|
9853
|
+
metadata: {
|
|
9854
|
+
cartId: window.Zonos.cartId,
|
|
9855
|
+
shipToAddress,
|
|
9856
|
+
},
|
|
9857
|
+
});
|
|
9858
|
+
}
|
|
9843
9859
|
logError(err);
|
|
9844
9860
|
}
|
|
9845
9861
|
stripeStore.isFetchingLandedCost = false;
|
|
@@ -10040,18 +10056,9 @@ const stripeStoreConfirmPayment = async () => {
|
|
|
10040
10056
|
}
|
|
10041
10057
|
}
|
|
10042
10058
|
};
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
* @returns {boolean} whether or not the checkout session is successfully created
|
|
10046
|
-
*/
|
|
10047
|
-
const stripeStoreInitCheckoutSession = async () => {
|
|
10048
|
-
var _a, _b;
|
|
10059
|
+
const getCheckoutSessionBody = () => {
|
|
10060
|
+
var _a;
|
|
10049
10061
|
const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
|
|
10050
|
-
if (!localizationStore.targetCurrency) {
|
|
10051
|
-
logError(`Failed to create checkout session - missing localizationStore.targetCurrency`);
|
|
10052
|
-
return false;
|
|
10053
|
-
}
|
|
10054
|
-
stripeStore.isFetchingSession = true;
|
|
10055
10062
|
const body = {
|
|
10056
10063
|
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
10057
10064
|
cartId: window.Zonos.cartId,
|
|
@@ -10077,6 +10084,20 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
10077
10084
|
],
|
|
10078
10085
|
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
10079
10086
|
};
|
|
10087
|
+
return body;
|
|
10088
|
+
};
|
|
10089
|
+
/**
|
|
10090
|
+
* Init checkout session
|
|
10091
|
+
* @returns {boolean} whether or not the checkout session is successfully created
|
|
10092
|
+
*/
|
|
10093
|
+
const stripeStoreInitCheckoutSession = async () => {
|
|
10094
|
+
var _a;
|
|
10095
|
+
if (!localizationStore.targetCurrency) {
|
|
10096
|
+
logError(`Failed to create checkout session - missing localizationStore.targetCurrency`);
|
|
10097
|
+
return false;
|
|
10098
|
+
}
|
|
10099
|
+
stripeStore.isFetchingSession = true;
|
|
10100
|
+
const body = getCheckoutSessionBody();
|
|
10080
10101
|
log('Checkout session body', 'info', body);
|
|
10081
10102
|
const { errors, json } = await handleFetch('/api/zonos-elements/create-checkout-session', {
|
|
10082
10103
|
body,
|
|
@@ -10092,7 +10113,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
10092
10113
|
cartStoreSetCheckoutSession(result);
|
|
10093
10114
|
stripeStore.clientSecret = result.clientSecret;
|
|
10094
10115
|
cartStoreApplySubtotals({
|
|
10095
|
-
method: ((
|
|
10116
|
+
method: ((_a = result.landedCost) === null || _a === void 0 ? void 0 : _a.method) || 'DDP',
|
|
10096
10117
|
subtotals: result.subtotals,
|
|
10097
10118
|
});
|
|
10098
10119
|
log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
|
|
@@ -10655,4 +10676,4 @@ const cartStoreResetTabItems = () => {
|
|
|
10655
10676
|
cartStoreResetSelectedShippingOption();
|
|
10656
10677
|
};
|
|
10657
10678
|
|
|
10658
|
-
export {
|
|
10679
|
+
export { localizationStoreOnUpdate as A, isValidSelector as B, initLocalizationStore as C, setZCountryUrlParam as D, currencyDisplay as E, currencyConvertAndFormat as F, currencyConvert as G, currencyFormat as H, cartStoreHasOneEligibleItem as I, stripeStoreApplyPromoCode as J, stripeStoreRemovePromoCode as K, stripeStoreRetrievePayment as L, stripeStoreResetPromoCode as M, stripeStoreMessageBasedOnStatus as N, stripeStoreTranslateAddressToLatin as O, cartStoreUpdateSelectedShippingOption as P, cartStoreGetShippingTransitInfo as Q, sortServiceLevelOptionsByAmount as R, getFallbackDefaultCountryCode as S, localizationStoreUpdateSelectedLocale as T, localizationStoreUpdateSelectedCountryCode as a, stripeStoreCleanupDomesticShippingSession as b, stripeStoreSaveDomesticShippingSession as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, cartStoreResetTabItems as g, cartStoreClearCheckoutInterval as h, initStripeElements as i, stripeStore as j, stripeStoreInitCheckoutSession as k, localizationStore as l, cartStoreStartCheckoutInterval as m, getCheckoutSessionBody as n, cartStoreUpdateToErrorState as o, translate as p, getZCountryUrlParam as q, cartStoreSetCheckoutSession as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStorePrefetchLandedCost as u, cartStoreNextStep as v, stripeStoreHandleInventoryCheck as w, stripeStoreConfirmPayment as x, stripeStoreHandleInventoryRefund as y, stripeStoreReset as z };
|
|
@@ -87,7 +87,7 @@ const fallbackApiType = ['cloudflare', 'vercel'];
|
|
|
87
87
|
const MAIN_BASE_API_TYPE = fallbackApiType[0];
|
|
88
88
|
const fallbackApiList = {
|
|
89
89
|
cloudflare: "https://route.elements.zonos.com",
|
|
90
|
-
vercel: "https://
|
|
90
|
+
vercel: "https://route.js.zonos.com",
|
|
91
91
|
};
|
|
92
92
|
const MAIN_BASE_API = fallbackApiList[MAIN_BASE_API_TYPE];
|
|
93
93
|
/**
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as log, a as logError } from './handleFetch-
|
|
2
|
-
import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-
|
|
3
|
-
export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-
|
|
1
|
+
import { l as log, a as logError } from './handleFetch-7424d200.js';
|
|
2
|
+
import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-5cde3ee4.js';
|
|
3
|
+
export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-5cde3ee4.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Get the load version and url based on the loadScriptSrc and version
|
|
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
97
|
-
const cdnUrl = "https://v1.3.
|
|
97
|
+
const cdnUrl = "https://v1.3.123.js.zonos.com";
|
|
98
98
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
99
99
|
if (!qaUrl &&
|
|
100
100
|
(cdnUrl.includes('test.') ||
|
|
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
|
|
|
278
278
|
}
|
|
279
279
|
return null;
|
|
280
280
|
})();
|
|
281
|
-
const ZONOS_URL = "https://v1.3.
|
|
282
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
283
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
284
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
281
|
+
const ZONOS_URL = "https://v1.3.123.js.zonos.com";
|
|
282
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.123";
|
|
283
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.123";
|
|
284
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.123";
|
|
285
285
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
286
286
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
287
287
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -296,7 +296,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
296
296
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
297
297
|
Zonos._paypalMockResponse = null;
|
|
298
298
|
Zonos.isBigCommerce = false;
|
|
299
|
-
Zonos.releaseDate = "
|
|
299
|
+
Zonos.releaseDate = "1730930859534";
|
|
300
300
|
Zonos.isLegacyCheckout = false;
|
|
301
301
|
Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
302
302
|
window.location.search.includes('zonosShowBaseForeign');
|
|
@@ -306,7 +306,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
|
306
306
|
Zonos.isNpm = true;
|
|
307
307
|
Zonos.zonosQaUrl = null;
|
|
308
308
|
Zonos.zonosQaUrlApi = null;
|
|
309
|
-
Zonos.version = `v${"1.3.
|
|
309
|
+
Zonos.version = `v${"1.3.123"}`;
|
|
310
310
|
Zonos.modeAlerted = false;
|
|
311
311
|
Zonos.cartData = null;
|
|
312
312
|
Zonos.paypal = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-6b5bd87c.js';
|
|
2
|
-
import { d as cartStore,
|
|
3
|
-
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-
|
|
2
|
+
import { d as cartStore, w as stripeStoreHandleInventoryCheck, p as translate, v as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-5346e4d9.js';
|
|
3
|
+
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-7424d200.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-dc08fa26.js';
|
|
5
5
|
|
|
6
6
|
/*!
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { j as stripeStore,
|
|
2
|
+
import { j as stripeStore, S as getFallbackDefaultCountryCode, l as localizationStore, p as translate } from './cart-5346e4d9.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
|
-
import { a as logError, l as log } from './handleFetch-
|
|
4
|
+
import { a as logError, l as log } from './handleFetch-7424d200.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
6
6
|
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { d as cartStore,
|
|
2
|
+
import { d as cartStore, H as currencyFormat, p as translate, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, z as stripeStoreReset, j as stripeStore, L as stripeStoreRetrievePayment, t as trackConversionEvent, M as stripeStoreResetPromoCode, N as stripeStoreMessageBasedOnStatus, l as localizationStore, O as stripeStoreTranslateAddressToLatin, P as cartStoreUpdateSelectedShippingOption, Q as cartStoreGetShippingTransitInfo, R as sortServiceLevelOptionsByAmount } from './cart-5346e4d9.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { s as submitGtag, b as paypalStore, c as paypalStoreReset, i as isContrastColor } from './paypal-
|
|
4
|
+
import { s as submitGtag, b as paypalStore, c as paypalStoreReset, i as isContrastColor } from './paypal-db99e15a.js';
|
|
5
5
|
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
6
6
|
import { c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-31a792d3.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
|
|
8
|
-
import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, b as allLogs } from './handleFetch-
|
|
8
|
+
import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, b as allLogs } from './handleFetch-7424d200.js';
|
|
9
9
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
10
10
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
11
11
|
import { i as isDarkColor, t as tinycolor } from './isDarkColor-dc08fa26.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, t as trackConversionEvent, n as
|
|
3
|
-
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, t as trackConversionEvent, n as getCheckoutSessionBody, o as cartStoreUpdateToErrorState, p as translate, q as getZCountryUrlParam, r as cartStoreSetCheckoutSession, u as stripeStorePrefetchLandedCost, v as cartStoreNextStep, w as stripeStoreHandleInventoryCheck, x as stripeStoreConfirmPayment, y as stripeStoreHandleInventoryRefund, z as stripeStoreReset, A as localizationStoreOnUpdate } from './cart-5346e4d9.js';
|
|
3
|
+
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-db99e15a.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-6b5bd87c.js';
|
|
5
|
-
import { h as handleFetch, l as log, a as logError, s as sendErrorLog, g as getElapsedTime, b as allLogs, j as jsonParse } from './handleFetch-
|
|
5
|
+
import { h as handleFetch, l as log, a as logError, s as sendErrorLog, g as getElapsedTime, b as allLogs, j as jsonParse } from './handleFetch-7424d200.js';
|
|
6
6
|
import { c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-31a792d3.js';
|
|
7
7
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
9
9
|
import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
|
|
10
10
|
import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
|
|
11
|
-
import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-
|
|
11
|
+
import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-5cde3ee4.js';
|
|
12
12
|
import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -530,6 +530,7 @@ const ZonosCheckout = class {
|
|
|
530
530
|
metadata: {
|
|
531
531
|
allLogs,
|
|
532
532
|
cartId: window.Zonos.cartId,
|
|
533
|
+
checkoutSessionBody: getCheckoutSessionBody(),
|
|
533
534
|
href: window.location.href,
|
|
534
535
|
storeBaseUrl: (_a = window.Zonos.cartData) === null || _a === void 0 ? void 0 : _a.storeBaseUrl,
|
|
535
536
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import {
|
|
2
|
+
import { B as isValidSelector, j as stripeStore, C as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-5346e4d9.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
4
|
-
import { h as handleFetch, a as logError, l as log } from './handleFetch-
|
|
4
|
+
import { h as handleFetch, a as logError, l as log } from './handleFetch-7424d200.js';
|
|
5
5
|
import './isDarkColor-dc08fa26.js';
|
|
6
6
|
import './getBorderRadius-008516a4.js';
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-5346e4d9.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import './handleFetch-
|
|
5
|
+
import './handleFetch-7424d200.js';
|
|
6
6
|
import './isDarkColor-dc08fa26.js';
|
|
7
7
|
import './getBorderRadius-008516a4.js';
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { a as localizationStoreUpdateSelectedCountryCode,
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, p as translate, l as localizationStore } from './cart-5346e4d9.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
|
|
6
6
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
7
|
-
import './handleFetch-
|
|
7
|
+
import './handleFetch-7424d200.js';
|
|
8
8
|
import './getBorderRadius-008516a4.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import {
|
|
2
|
+
import { p as translate, l as localizationStore, H as currencyFormat } from './cart-5346e4d9.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-6b5bd87c.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
7
|
-
import './handleFetch-
|
|
7
|
+
import './handleFetch-7424d200.js';
|
|
8
8
|
import './isDarkColor-dc08fa26.js';
|
|
9
9
|
import './getBorderRadius-008516a4.js';
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-6b5bd87c.js';
|
|
3
|
-
import { l as localizationStore,
|
|
3
|
+
import { l as localizationStore, B as isValidSelector, p as translate, q as getZCountryUrlParam, D as setZCountryUrlParam, E as currencyDisplay, F as currencyConvertAndFormat, G as currencyConvert, H as currencyFormat } from './cart-5346e4d9.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import { h as handleFetch, a as logError, l as log } from './handleFetch-
|
|
5
|
+
import { h as handleFetch, a as logError, l as log } from './handleFetch-7424d200.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
7
7
|
import './isDarkColor-dc08fa26.js';
|
|
8
8
|
import './getBorderRadius-008516a4.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import {
|
|
2
|
+
import { T as localizationStoreUpdateSelectedLocale, p as translate, l as localizationStore } from './cart-5346e4d9.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
|
-
import './handleFetch-
|
|
5
|
+
import './handleFetch-7424d200.js';
|
|
6
6
|
import './isDarkColor-dc08fa26.js';
|
|
7
7
|
import './getBorderRadius-008516a4.js';
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement, c as createEvent } from './index-86b8247e.js';
|
|
2
2
|
import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { j as stripeStore } from './cart-
|
|
5
|
-
import { a as logError, l as log } from './handleFetch-
|
|
6
|
-
import { d as paypalStoreInitButtons } from './paypal-
|
|
4
|
+
import { j as stripeStore } from './cart-5346e4d9.js';
|
|
5
|
+
import { a as logError, l as log } from './handleFetch-7424d200.js';
|
|
6
|
+
import { d as paypalStoreInitButtons } from './paypal-db99e15a.js';
|
|
7
7
|
import './isDarkColor-dc08fa26.js';
|
|
8
8
|
import './getBorderRadius-008516a4.js';
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function c(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?r(e.value):a(e.value).then(i,c)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,a&&(o=c[0]&2?a["return"]:c[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,c[1])).done)return o;if(a=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;a=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1];o=c;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(c);break}if(o[2])r.ops.pop();r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e];a=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function c(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?r(e.value):a(e.value).then(i,c)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,a&&(o=c[0]&2?a["return"]:c[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,c[1])).done)return o;if(a=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;a=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1];o=c;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(c);break}if(o[2])r.ops.pop();r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e];a=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-7424d200.js";var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var t,r,n,a,o,i;var c=e.cartId,s=e.retries;return __generator(this,(function(e){switch(e.label){case 0:t=new URLSearchParams(window.location.search);r=t.get("zonosTestMode")==="1";return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:r,tempCartUUID:c},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:n=e.sent(),a=n.errors,o=n.json;i=!o||a.length;if(!(i&&s))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:c,retries:s-1})];case 3:if(i){return[2,null]}return[2,o]}}))}))};var baseRe=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;var uuidRe=new RegExp("^".concat(baseRe.source,"$"));var cartUuidRe=new RegExp("^cart_".concat(baseRe.source,"$"));var _getIsValidCartId=function(e){if(!e){return{isDgsCartId:false,isLegacyCartId:false}}if(cartUuidRe.test(e)){return{isDgsCartId:true,isLegacyCartId:false}}if(uuidRe.test(e)){return{isDgsCartId:false,isLegacyCartId:true}}return{isDgsCartId:false,isLegacyCartId:false}};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:t=_getIsValidCartId(e),r=t.isDgsCartId,n=t.isLegacyCartId;if(!n&&!r){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:a=o.sent();log("[ZONOS - loadZonos] getting temp cart data","info",a);if(!a){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:a.cartData,storeFavicon:a.storeFaviconUrl,storeId:a.cartData.storeId,storeLogo:a.storeLogoUrl,zonosApiKey:a.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};
|