@zonos/elements 1.2.4-alpha.6 → 1.2.4-alpha.8
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/{cart-7ad04cdb.js → cart-90f7c8c0.js} +36 -8
- package/dist/cjs/{getBorderRadius-a97a5f75.js → getBorderRadius-bf4a4276.js} +1 -1
- package/dist/cjs/{index-20cb112f.js → index-0dcccc22.js} +27 -16
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/{isDarkColor-261fcf3d.js → isDarkColor-ff6ff183.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{localization-5069ab0b.js → localization-9caf3397.js} +7 -7
- package/dist/cjs/{submitGtag-44e938ff.js → submitGtag-b141b45d.js} +2 -2
- package/dist/cjs/zonos-address_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +50 -8
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +8 -8
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-elements.cjs.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
- package/dist/cjs/zonos-icon.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification.cjs.entry.js +2 -2
- package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/{zonosStore-a0fa5b77.js → zonosStore-b43ef5db.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +48 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +5 -2
- package/dist/collection/components/common/zonos-notification/zonos-notification.js +3 -2
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +9 -6
- package/dist/collection/components/main/zonos-controller.js +16 -14
- package/dist/collection/components/store/checkout/cart.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +3 -2
- package/dist/collection/components/utils/api/calculateLandedCost.js +9 -1
- package/dist/collection/components/utils/api/checkItemRestrictions.js +1 -1
- package/dist/collection/components/utils/api/getCountries.js +1 -1
- package/dist/collection/components/utils/api/getCountryLandedCost.js +1 -1
- package/dist/collection/components/utils/api/getExchangeRate.js +1 -1
- package/dist/collection/components/utils/api/getLocaleMessages.js +1 -1
- package/dist/collection/components/utils/api/getLocalization.js +1 -1
- package/dist/collection/components/utils/api/getShippingZones.js +1 -1
- package/dist/collection/components/utils/api/getZonosSetting.js +1 -1
- package/dist/collection/components/utils/api/triggerBuildLandedCost.js +22 -0
- package/dist/collection/types/generated/graphql.customer.types.js +89 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +80 -6
- package/dist/components/cart.js +33 -5
- package/dist/components/localization.js +6 -6
- package/dist/components/zonos-checkout-finish2.js +47 -4
- package/dist/components/zonos-checkout.js +2 -0
- package/dist/components/zonos-controller.js +2 -2
- package/dist/components/zonos-hello.js +1 -1
- package/dist/esm/{cart-face98c8.js → cart-b439be00.js} +36 -8
- package/dist/esm/{getBorderRadius-35e8acce.js → getBorderRadius-178a0a05.js} +1 -1
- package/dist/esm/{index-3617e24c.js → index-36ff6342.js} +27 -16
- package/dist/esm/index.js +6 -6
- package/dist/esm/{isDarkColor-44e9e451.js → isDarkColor-416d6047.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{localization-ed07b7f0.js → localization-a51ccbc2.js} +7 -7
- package/dist/esm/{submitGtag-5b553683.js → submitGtag-521826a2.js} +2 -2
- package/dist/esm/zonos-address_2.entry.js +6 -6
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_2.entry.js +4 -4
- package/dist/esm/zonos-card_2.entry.js +2 -2
- package/dist/esm/zonos-cart-items_10.entry.js +50 -8
- package/dist/esm/zonos-checkout.entry.js +9 -7
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +8 -8
- package/dist/esm/zonos-country-flag_4.entry.js +4 -4
- package/dist/esm/zonos-elements.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +4 -4
- package/dist/esm/zonos-icon.entry.js +2 -2
- package/dist/esm/zonos-notification.entry.js +2 -2
- package/dist/esm/zonos-payment.entry.js +6 -6
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/{zonosStore-e0b7a5cf.js → zonosStore-61e74f58.js} +1 -1
- package/dist/esm-es5/cart-b439be00.js +1 -0
- package/dist/esm-es5/{getBorderRadius-35e8acce.js → getBorderRadius-178a0a05.js} +1 -1
- package/dist/esm-es5/index-36ff6342.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-44e9e451.js → isDarkColor-416d6047.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{localization-ed07b7f0.js → localization-a51ccbc2.js} +1 -1
- package/dist/esm-es5/{submitGtag-5b553683.js → submitGtag-521826a2.js} +1 -1
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.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-icon.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e0b7a5cf.js → zonosStore-61e74f58.js} +1 -1
- package/dist/scripts/loadZonos.js +3 -3
- package/dist/scripts/zonos.js +3 -3
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +5 -1
- package/dist/types/components/store/checkout/stripe.d.ts +1 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +5 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +254 -7
- package/dist/types/types/generated/graphql.customer.types.ts +310 -7
- package/dist/types/types/generated/graphql.frontend.types.d.ts +210 -11
- package/dist/types/types/generated/graphql.frontend.types.ts +358 -11
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-d8daeec4.system.entry.js → p-06fb9d1f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-77a7929b.js → p-089ba905.js} +1 -1
- package/dist/zonos-elements/{p-f0f9c43a.js → p-1685c8df.js} +1 -1
- package/dist/zonos-elements/p-18904b7c.system.js +2 -0
- package/dist/zonos-elements/p-19942abb.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b8d11094.entry.js → p-1d4a970b.entry.js} +1 -1
- package/dist/zonos-elements/{p-80ba24a8.system.js → p-24eed2a8.system.js} +1 -1
- package/dist/zonos-elements/{p-bec21999.system.js → p-24fbe845.system.js} +1 -1
- package/dist/zonos-elements/{p-55f1da18.entry.js → p-2801d868.entry.js} +1 -1
- package/dist/zonos-elements/{p-1dbaf24b.system.entry.js → p-2f43da39.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-99c9bd01.js → p-3c6988d7.js} +1 -1
- package/dist/zonos-elements/p-3cea383b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-86580e70.system.entry.js → p-47390db7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4846796a.js +1 -0
- package/dist/zonos-elements/p-494c77a7.entry.js +1 -0
- package/dist/zonos-elements/{p-00c99619.entry.js → p-49f09b91.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e396855.system.entry.js → p-4a15c5c7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-507e1954.system.entry.js → p-4bee0bff.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3eb33ba6.entry.js → p-4d93275c.entry.js} +1 -1
- package/dist/zonos-elements/{p-f09eb5c5.entry.js → p-4ed71bd7.entry.js} +1 -1
- package/dist/zonos-elements/{p-8bbad467.js → p-55f49f1e.js} +1 -1
- package/dist/zonos-elements/{p-114d8a14.system.entry.js → p-560aa686.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-03df1466.entry.js → p-639396bb.entry.js} +1 -1
- package/dist/zonos-elements/{p-3c64448f.system.entry.js → p-67154df2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9dbbacd9.entry.js → p-684ed483.entry.js} +1 -1
- package/dist/zonos-elements/{p-c743e43f.entry.js → p-89c210d6.entry.js} +1 -1
- package/dist/zonos-elements/{p-5aefdcdc.system.js → p-8c48b75e.system.js} +1 -1
- package/dist/zonos-elements/{p-4138e220.system.entry.js → p-8c5595d9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-263c1639.entry.js → p-938803f4.entry.js} +1 -1
- package/dist/zonos-elements/p-956efa27.js +2 -0
- package/dist/zonos-elements/{p-bca3d02f.entry.js → p-a0e36ed3.entry.js} +1 -1
- package/dist/zonos-elements/{p-b5bc4851.entry.js → p-a376a37f.entry.js} +1 -1
- package/dist/zonos-elements/p-a3a8b5e7.entry.js +1 -0
- package/dist/zonos-elements/{p-94f03799.system.js → p-a504f64f.system.js} +1 -1
- package/dist/zonos-elements/p-afe26069.entry.js +1 -0
- package/dist/zonos-elements/{p-f2ed98bb.system.entry.js → p-b4601210.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4db8bd2e.system.js → p-b51de536.system.js} +1 -1
- package/dist/zonos-elements/{p-9fa111f1.entry.js → p-b6148206.entry.js} +1 -1
- package/dist/zonos-elements/{p-643eeb24.system.js → p-b85be1ab.system.js} +1 -1
- package/dist/zonos-elements/{p-06ec9556.system.entry.js → p-c9348bb0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d2217f09.system.js +1 -0
- package/dist/zonos-elements/{p-7bd0ab43.system.entry.js → p-d856a200.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-754bdfdb.system.js → p-da060b1c.system.js} +1 -1
- package/dist/zonos-elements/{p-6f6d24da.entry.js → p-e1f6ab97.entry.js} +1 -1
- package/dist/zonos-elements/{p-3a7546f0.system.entry.js → p-e5ae22a9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4c0f4461.system.entry.js → p-e98be2d0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e9b832c5.entry.js +1 -0
- package/dist/zonos-elements/{p-b2984730.system.entry.js → p-f141519c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-39ae023c.system.entry.js → p-f367f2fe.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ff95f098.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +7 -6
- package/dist/esm-es5/cart-face98c8.js +0 -1
- package/dist/esm-es5/index-3617e24c.js +0 -2
- package/dist/zonos-elements/p-39dfc72b.entry.js +0 -1
- package/dist/zonos-elements/p-3c40bb08.entry.js +0 -1
- package/dist/zonos-elements/p-47c110a4.system.js +0 -1
- package/dist/zonos-elements/p-5e6be2a3.entry.js +0 -1
- package/dist/zonos-elements/p-aeeaaa7a.system.entry.js +0 -1
- package/dist/zonos-elements/p-b944303a.system.entry.js +0 -1
- package/dist/zonos-elements/p-bec05c21.system.js +0 -2
- package/dist/zonos-elements/p-c6ed3777.js +0 -1
- package/dist/zonos-elements/p-cf8aaa17.js +0 -2
- package/dist/zonos-elements/p-d9ed23ec.entry.js +0 -1
- package/dist/zonos-elements/p-e1de2a1f.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const zonosStore = require('./zonosStore-
|
|
4
|
-
const localization = require('./localization-
|
|
5
|
-
const isDarkColor = require('./isDarkColor-
|
|
6
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
3
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
4
|
+
const localization = require('./localization-9caf3397.js');
|
|
5
|
+
const isDarkColor = require('./isDarkColor-ff6ff183.js');
|
|
6
|
+
const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
|
|
7
7
|
|
|
8
8
|
const prepCalculateLandedCost = () => {
|
|
9
9
|
// maybe we don't need email now for prefetch the landed cost
|
|
@@ -34,9 +34,36 @@ const prepCalculateLandedCost = () => {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
const triggerBuildLandedCost = async (buildLandedCost) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const data = prepCalculateLandedCost();
|
|
40
|
+
const landedCost = await buildLandedCost(data.checkoutSessionId, data.contact, data.shippingAddress);
|
|
41
|
+
if (!landedCost) {
|
|
42
|
+
throw new Error('Failed to build landed cost');
|
|
43
|
+
}
|
|
44
|
+
// Validate the landed cost object to make sure the returned value from buildLandedCost has a valid schema
|
|
45
|
+
const { errors, json } = await localization.handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/validate-landed-cost`, {
|
|
46
|
+
body: landedCost,
|
|
47
|
+
headers: {
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
},
|
|
50
|
+
method: 'POST',
|
|
51
|
+
});
|
|
52
|
+
if (!json || errors.length) {
|
|
53
|
+
throw new Error(`Invalid landed cost object: ${((_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message) || 'Unknown error'}`);
|
|
54
|
+
}
|
|
55
|
+
return landedCost;
|
|
56
|
+
};
|
|
57
|
+
|
|
37
58
|
const calculateLandedCost = async (abortController) => {
|
|
59
|
+
// If buildLandedCost callback is supplied, use that instead of our regular request to '/calculate-landed-cost'
|
|
60
|
+
const buildLandedCost = zonosStore.zonosStore.checkoutSettings.buildLandedCost;
|
|
61
|
+
if (buildLandedCost) {
|
|
62
|
+
const json = await triggerBuildLandedCost(buildLandedCost);
|
|
63
|
+
return json;
|
|
64
|
+
}
|
|
38
65
|
// request to get landed cost info
|
|
39
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/calculate-landed-cost`;
|
|
66
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/calculate-landed-cost`;
|
|
40
67
|
const { errors, json } = await localization.handleFetch(url, {
|
|
41
68
|
body: prepCalculateLandedCost(),
|
|
42
69
|
method: 'POST',
|
|
@@ -91,6 +118,7 @@ const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = zonosStore
|
|
|
91
118
|
stripeAddressElement: null,
|
|
92
119
|
stripeAddressEventData: null,
|
|
93
120
|
stripeAddressUsedWhenFetchingLC: null,
|
|
121
|
+
stripeBillingAddressElement: null,
|
|
94
122
|
stripeElements: null,
|
|
95
123
|
stripeElementsOptions: null,
|
|
96
124
|
stripeLinkElement: null,
|
|
@@ -336,7 +364,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
336
364
|
return false;
|
|
337
365
|
}
|
|
338
366
|
stripeStore.isFetchingSession = true;
|
|
339
|
-
const { errors, json } = await localization.handleFetch(`${"https://v1.route.js.zonos.com"}/api/create-checkout-session`, {
|
|
367
|
+
const { errors, json } = await localization.handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/create-checkout-session`, {
|
|
340
368
|
body: {
|
|
341
369
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
342
370
|
itemsAmount: total,
|
|
@@ -364,7 +392,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
364
392
|
const stripeStoreUpdateCheckoutSession = async ({ currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
|
|
365
393
|
// No need to set loading state here because this function will be called under the hood to update
|
|
366
394
|
// landed cost id for the section.
|
|
367
|
-
const { errors, json } = await localization.handleFetch(`${"https://v1.route.js.zonos.com"}/api/update-checkout-session`, {
|
|
395
|
+
const { errors, json } = await localization.handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/update-checkout-session`, {
|
|
368
396
|
body: {
|
|
369
397
|
currency,
|
|
370
398
|
id,
|
|
@@ -476,7 +504,7 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
|
|
|
476
504
|
}
|
|
477
505
|
// update checkout session
|
|
478
506
|
if (!cartStore.checkoutSessionId) {
|
|
479
|
-
localization.logError('Could update cart total without checkout session id');
|
|
507
|
+
localization.logError('Could not update cart total without checkout session id');
|
|
480
508
|
return false;
|
|
481
509
|
}
|
|
482
510
|
const { json } = await stripeStoreUpdateCheckoutSession({
|
|
@@ -655,6 +655,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
+
// This needs to always happen so we can hide nodes that are projected
|
|
659
|
+
// to another component but don't end up in a slot
|
|
660
|
+
elm['s-hn'] = hostTagName;
|
|
658
661
|
return elm;
|
|
659
662
|
};
|
|
660
663
|
/**
|
|
@@ -779,8 +782,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
779
782
|
* @param oldCh the old children of the parent node
|
|
780
783
|
* @param newVNode the new VNode which will replace the parent
|
|
781
784
|
* @param newCh the new children of the parent node
|
|
785
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
782
786
|
*/
|
|
783
|
-
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
787
|
+
const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
|
|
784
788
|
let oldStartIdx = 0;
|
|
785
789
|
let newStartIdx = 0;
|
|
786
790
|
let idxInOld = 0;
|
|
@@ -807,25 +811,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
807
811
|
else if (newEndVnode == null) {
|
|
808
812
|
newEndVnode = newCh[--newEndIdx];
|
|
809
813
|
}
|
|
810
|
-
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
814
|
+
else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
811
815
|
// if the start nodes are the same then we should patch the new VNode
|
|
812
816
|
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
813
817
|
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
814
818
|
// since things are matched up in order.
|
|
815
|
-
patch(oldStartVnode, newStartVnode);
|
|
819
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
816
820
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
817
821
|
newStartVnode = newCh[++newStartIdx];
|
|
818
822
|
}
|
|
819
|
-
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
823
|
+
else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
820
824
|
// likewise, if the end nodes are the same we patch new onto old and
|
|
821
825
|
// decrement our end indices, and also likewise in this case we don't
|
|
822
826
|
// need to move any DOM Nodes.
|
|
823
|
-
patch(oldEndVnode, newEndVnode);
|
|
827
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
824
828
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
825
829
|
newEndVnode = newCh[--newEndIdx];
|
|
826
830
|
}
|
|
827
|
-
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
828
|
-
patch(oldStartVnode, newEndVnode);
|
|
831
|
+
else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
832
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
829
833
|
// We need to move the element for `oldStartVnode` into a position which
|
|
830
834
|
// will be appropriate for `newEndVnode`. For this we can use
|
|
831
835
|
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
@@ -847,8 +851,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
847
851
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
848
852
|
newEndVnode = newCh[--newEndIdx];
|
|
849
853
|
}
|
|
850
|
-
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
851
|
-
patch(oldEndVnode, newStartVnode);
|
|
854
|
+
else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
855
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
852
856
|
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
853
857
|
// the same node, so since we're here we know that they are not. Thus we
|
|
854
858
|
// can move the element for `oldEndVnode` _before_ the element for
|
|
@@ -885,7 +889,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
885
889
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
886
890
|
}
|
|
887
891
|
else {
|
|
888
|
-
patch(elmToMove, newStartVnode);
|
|
892
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
889
893
|
// invalidate the matching old node so that we won't try to update it
|
|
890
894
|
// again later on
|
|
891
895
|
oldCh[idxInOld] = undefined;
|
|
@@ -936,16 +940,22 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
936
940
|
*
|
|
937
941
|
* @param leftVNode the first VNode to check
|
|
938
942
|
* @param rightVNode the second VNode to check
|
|
943
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
939
944
|
* @returns whether they're equal or not
|
|
940
945
|
*/
|
|
941
|
-
const isSameVnode = (leftVNode, rightVNode) => {
|
|
946
|
+
const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
942
947
|
// compare if two vnode to see if they're "technically" the same
|
|
943
948
|
// need to have the same element tag, and same key to be the same
|
|
944
949
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
945
|
-
// this will be set if
|
|
946
|
-
|
|
950
|
+
// this will be set if JSX tags in the build have `key` attrs set on them
|
|
951
|
+
// we only want to check this if we're not on the first render since on
|
|
952
|
+
// first render `leftVNode.$key$` will always be `null`, so we can be led
|
|
953
|
+
// astray and, for instance, accidentally delete a DOM node that we want to
|
|
954
|
+
// keep around.
|
|
955
|
+
if (!isInitialRender) {
|
|
947
956
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
948
957
|
}
|
|
958
|
+
return true;
|
|
949
959
|
}
|
|
950
960
|
return false;
|
|
951
961
|
};
|
|
@@ -956,8 +966,9 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
956
966
|
*
|
|
957
967
|
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
958
968
|
* @param newVNode a new VNode representing an updated version of the old one
|
|
969
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
959
970
|
*/
|
|
960
|
-
const patch = (oldVNode, newVNode) => {
|
|
971
|
+
const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
961
972
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
962
973
|
const oldChildren = oldVNode.$children$;
|
|
963
974
|
const newChildren = newVNode.$children$;
|
|
@@ -982,7 +993,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
982
993
|
if (oldChildren !== null && newChildren !== null) {
|
|
983
994
|
// looks like there's child vnodes for both the old and new vnodes
|
|
984
995
|
// so we need to call `updateChildren` to reconcile them
|
|
985
|
-
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
996
|
+
updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
|
|
986
997
|
}
|
|
987
998
|
else if (newChildren !== null) {
|
|
988
999
|
// no old child vnodes, but there are new child vnodes to add
|
|
@@ -1072,7 +1083,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1072
1083
|
scopeId = hostElm['s-sc'];
|
|
1073
1084
|
}
|
|
1074
1085
|
// synchronous patch
|
|
1075
|
-
patch(oldVNode, rootVnode);
|
|
1086
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1076
1087
|
};
|
|
1077
1088
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1078
1089
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const cart = require('./cart-
|
|
6
|
-
require('./zonosStore-
|
|
7
|
-
require('./index-
|
|
8
|
-
require('./localization-
|
|
9
|
-
require('./isDarkColor-
|
|
10
|
-
require('./getBorderRadius-
|
|
5
|
+
const cart = require('./cart-90f7c8c0.js');
|
|
6
|
+
require('./zonosStore-b43ef5db.js');
|
|
7
|
+
require('./index-0dcccc22.js');
|
|
8
|
+
require('./localization-9caf3397.js');
|
|
9
|
+
require('./isDarkColor-ff6ff183.js');
|
|
10
|
+
require('./getBorderRadius-bf4a4276.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const zonosStore = require('./zonosStore-
|
|
3
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
4
4
|
|
|
5
5
|
var tinycolor = zonosStore.createCommonjsModule(function (module, exports) {
|
|
6
6
|
// This file is autogenerated. It's used to publish CJS to npm.
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello.cjs",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog.cjs",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10.cjs",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello.cjs",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog.cjs",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10.cjs",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"order":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const zonosStore = require('./zonosStore-
|
|
3
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
4
4
|
|
|
5
5
|
const stringsArabic = {
|
|
6
6
|
'Above de minimis threshold for': {
|
|
@@ -3194,7 +3194,7 @@ const handleFetch = async (url, _opts) => {
|
|
|
3194
3194
|
|
|
3195
3195
|
const getCountries = async () => {
|
|
3196
3196
|
try {
|
|
3197
|
-
const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/get-countries`, {
|
|
3197
|
+
const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/get-countries`, {
|
|
3198
3198
|
method: 'GET',
|
|
3199
3199
|
});
|
|
3200
3200
|
if (errors.length || !json) {
|
|
@@ -3217,7 +3217,7 @@ const getCountryLandedCost = async (countryCode) => {
|
|
|
3217
3217
|
if (!countryCode) {
|
|
3218
3218
|
return null;
|
|
3219
3219
|
}
|
|
3220
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/country-landed-cost/${countryCode}`;
|
|
3220
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/country-landed-cost/${countryCode}`;
|
|
3221
3221
|
const { errors, json } = await handleFetch(url);
|
|
3222
3222
|
if (errors.length || !json) {
|
|
3223
3223
|
logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
@@ -3232,7 +3232,7 @@ const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCu
|
|
|
3232
3232
|
if (sourceCurrency === targetCurrency && !isGuaranteed) {
|
|
3233
3233
|
return { exchangeRate: null, maxAge: null };
|
|
3234
3234
|
}
|
|
3235
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}
|
|
3235
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}`;
|
|
3236
3236
|
const { errors, json } = await handleFetch(url);
|
|
3237
3237
|
if (errors.length || !json) {
|
|
3238
3238
|
logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
@@ -3249,7 +3249,7 @@ const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCu
|
|
|
3249
3249
|
|
|
3250
3250
|
const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
|
|
3251
3251
|
var _a;
|
|
3252
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/locale-messages?countryCode=${countryCode}&storeId=${storeId}&localeTo=${localeTo}`;
|
|
3252
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/locale-messages?countryCode=${countryCode}&storeId=${storeId}&localeTo=${localeTo}`;
|
|
3253
3253
|
const { errors, json } = await handleFetch(url);
|
|
3254
3254
|
if (errors.length || !json) {
|
|
3255
3255
|
// eslint-disable-next-line no-console
|
|
@@ -3271,7 +3271,7 @@ const getLocalization = async () => {
|
|
|
3271
3271
|
// load and use country from session storage when zCountry query param is not present
|
|
3272
3272
|
const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
|
|
3273
3273
|
const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
|
|
3274
|
-
const localizationUrl = new URL(`${"https://v1.route.js.zonos.com"}/api/localization`);
|
|
3274
|
+
const localizationUrl = new URL(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/localization`);
|
|
3275
3275
|
if (zCountry) {
|
|
3276
3276
|
localizationUrl.searchParams.set('zCountry', zCountry);
|
|
3277
3277
|
}
|
|
@@ -3294,7 +3294,7 @@ const getLocalization = async () => {
|
|
|
3294
3294
|
|
|
3295
3295
|
const getShippingZones = async () => {
|
|
3296
3296
|
var _a, _b;
|
|
3297
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/shipping-zones`;
|
|
3297
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/shipping-zones`;
|
|
3298
3298
|
const { errors, json } = await handleFetch(url);
|
|
3299
3299
|
if (errors.length || !json) {
|
|
3300
3300
|
logError(`Error fetching shipping zones: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const zonosStore = require('./zonosStore-
|
|
4
|
-
const localization = require('./localization-
|
|
3
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
4
|
+
const localization = require('./localization-9caf3397.js');
|
|
5
5
|
|
|
6
6
|
const checkoutBreakpoint = 890;
|
|
7
7
|
const isCheckoutMobile = (isMobile) => {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const localization = require('./localization-
|
|
8
|
-
require('./zonosStore-
|
|
9
|
-
require('./isDarkColor-
|
|
10
|
-
require('./getBorderRadius-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const cart = require('./cart-90f7c8c0.js');
|
|
7
|
+
const localization = require('./localization-9caf3397.js');
|
|
8
|
+
require('./zonosStore-b43ef5db.js');
|
|
9
|
+
require('./isDarkColor-ff6ff183.js');
|
|
10
|
+
require('./getBorderRadius-bf4a4276.js');
|
|
11
11
|
|
|
12
12
|
const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:var(--amino-space-16)}";
|
|
13
13
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosBadgeCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .zonos--badge-content{display:-ms-flexbox;display:flex;gap:var(--amino-space-8);font-size:var(--amino-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--amino-radius-6);background-color:var(--amino-gray-100);color:var(--amino-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--amino-gray-600);color:var(--amino-gray-100)}:host .blue{background-color:var(--amino-blue-100);color:var(--amino-blue-800)}:host .blue.bold{background-color:var(--amino-blue-600);color:var(--amino-blue-100)}:host .green{background-color:var(--amino-green-100);color:var(--amino-green-800)}:host .green.bold{background-color:var(--amino-green-600);color:var(--amino-green-100)}:host .red{background-color:var(--amino-red-100);color:var(--amino-red-800)}:host .red.bold{background-color:var(--amino-red-600);color:var(--amino-red-100)}:host .orange{background-color:var(--amino-orange-100);color:var(--amino-orange-800)}:host .orange.bold{background-color:var(--amino-orange-600);color:var(--amino-orange-100)}:host .purple{background-color:var(--amino-purple-100);color:var(--amino-purple-800)}:host .purple.bold{background-color:var(--amino-purple-600);color:var(--amino-purple-100)}:host .cyan{background-color:var(--amino-cyan-100);color:var(--amino-cyan-800)}:host .cyan.bold{background-color:var(--amino-cyan-600);color:var(--amino-cyan-100)}";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosBannerCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{border-radius:var(--amino-radius-10);padding:var(--amino-space-16);background:var(--amino-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:\"icon header\" \". content\";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:var(--amino-space-0);grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:var(--amino-space-4)}:host(.info){background-color:var(--amino-blue-100);border:1px solid var(--amino-blue-200)}:host(.success){background-color:var(--amino-green-100);border:1px solid var(--amino-green-200)}:host(.error){background-color:var(--amino-red-100);border:1px solid var(--amino-red-200)}:host(.warning){background-color:var(--amino-orange-100);border:1px solid var(--amino-orange-200)}";
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
8
|
+
const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
|
|
9
9
|
const isColorVariable = require('./isColorVariable-41cacd82.js');
|
|
10
|
-
const isDarkColor = require('./isDarkColor-
|
|
10
|
+
const isDarkColor = require('./isDarkColor-ff6ff183.js');
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Get theme for button text based on background color
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosCardCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .styled-card{border:var(--amino-border);border-radius:var(--amino-radius-6);padding:var(--spacing, var(--amino-space-24));text-align:left}:host .styled-card hr{margin-left:calc(var(--spacing, var(--amino-space-24)) * -1);margin-right:calc(var(--spacing, var(--amino-space-24)) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, var(--amino-space-24)) * -1);padding:var(--spacing, var(--amino-space-24));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, var(--amino-space-24));border-bottom:var(--amino-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, var(--amino-space-24)) * -1);padding:var(--spacing, var(--amino-space-24));border-top:var(--amino-border);background:var(--amino-surface-color-secondary);margin-top:var(--spacing, var(--amino-space-24));border-bottom-left-radius:var(--amino-radius-8);border-bottom-right-radius:var(--amino-radius-8);height:var(--footerHeight)}";
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const localization = require('./localization-
|
|
8
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
9
|
-
const submitGtag = require('./submitGtag-
|
|
10
|
-
const zonosStore = require('./zonosStore-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const cart = require('./cart-90f7c8c0.js');
|
|
7
|
+
const localization = require('./localization-9caf3397.js');
|
|
8
|
+
const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
|
|
9
|
+
const submitGtag = require('./submitGtag-b141b45d.js');
|
|
10
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
11
11
|
const classes = require('./classes-b7918f56.js');
|
|
12
|
-
require('./isDarkColor-
|
|
12
|
+
require('./isDarkColor-ff6ff183.js');
|
|
13
13
|
|
|
14
14
|
const formatCurrency = ({ amount, currency, showCurrencyText, }) => showCurrencyText
|
|
15
15
|
? `${new Intl.NumberFormat('en-US', {
|
|
@@ -105,6 +105,36 @@ const ZonosCheckoutFinish = class {
|
|
|
105
105
|
constructor(hostRef) {
|
|
106
106
|
index.registerInstance(this, hostRef);
|
|
107
107
|
this.closeClick = index.createEvent(this, "closeClick", 7);
|
|
108
|
+
this.pullOrder = async () => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
const baseUrl = "https://v1.route.js.zonos.com";
|
|
111
|
+
const checkoutSessionId = cart.cartStore.checkoutSessionId;
|
|
112
|
+
const { errors, json } = await localization.handleFetch(`${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`);
|
|
113
|
+
if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
// TODO: This method of triggering /success for BigCommerce is for MVP. Remove when eventRegistry is fixed to handle by webhooks
|
|
117
|
+
if (window.Zonos.isBigCommerce) {
|
|
118
|
+
const orderId = json === null || json === void 0 ? void 0 : json.id;
|
|
119
|
+
const storeHash = (_b = (_a = json === null || json === void 0 ? void 0 : json.metadata) === null || _a === void 0 ? void 0 : _a.find(x => (x === null || x === void 0 ? void 0 : x.key) === 'storeHash')) === null || _b === void 0 ? void 0 : _b.value;
|
|
120
|
+
if (!orderId || !storeHash) {
|
|
121
|
+
return localization.logError('Unable to trigger BigCommerce /success: Missing orderId or storeHash');
|
|
122
|
+
}
|
|
123
|
+
void localization.handleFetch(`${baseUrl}/api/bigcommerce/success?orderId=${orderId}&storeHash=${storeHash}`);
|
|
124
|
+
}
|
|
125
|
+
return json;
|
|
126
|
+
};
|
|
127
|
+
this.getPullOrder = async (attempts = 0) => {
|
|
128
|
+
const order = await this.pullOrder();
|
|
129
|
+
if (order) {
|
|
130
|
+
this.order = order;
|
|
131
|
+
}
|
|
132
|
+
else if (!order && attempts < 5) {
|
|
133
|
+
// Wait for 1 second before the next attempt
|
|
134
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
135
|
+
await this.getPullOrder(attempts + 1);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
108
138
|
this.checkPaymentStatus = async () => {
|
|
109
139
|
this.isLoading = true;
|
|
110
140
|
const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || cart.stripeStore.clientSecret;
|
|
@@ -130,6 +160,10 @@ const ZonosCheckoutFinish = class {
|
|
|
130
160
|
});
|
|
131
161
|
document.dispatchEvent(successEvent);
|
|
132
162
|
}
|
|
163
|
+
// Attempt to pull the order details from the graph every second on 5 attempts
|
|
164
|
+
if (this.notificationType === 'success') {
|
|
165
|
+
void this.getPullOrder();
|
|
166
|
+
}
|
|
133
167
|
}
|
|
134
168
|
cart.stripeStoreReset();
|
|
135
169
|
this.isLoading = false;
|
|
@@ -144,6 +178,7 @@ const ZonosCheckoutFinish = class {
|
|
|
144
178
|
this.notificationType = 'success';
|
|
145
179
|
this.notificationTitle = '';
|
|
146
180
|
this.notificationMessages = [];
|
|
181
|
+
this.order = null;
|
|
147
182
|
}
|
|
148
183
|
componentDidLoad() {
|
|
149
184
|
if (this.overrideNotification) {
|
|
@@ -157,9 +192,16 @@ const ZonosCheckoutFinish = class {
|
|
|
157
192
|
void this.checkPaymentStatus();
|
|
158
193
|
}
|
|
159
194
|
render() {
|
|
195
|
+
// TODO: Keeping this code for when we have a UI for order details
|
|
196
|
+
// const orderTotal = this.order?.amountSubtotals
|
|
197
|
+
// ? Object.values(this.order.amountSubtotals).reduce((a, b) => a + b, 0)
|
|
198
|
+
// : 0;
|
|
199
|
+
// const totalItems = this.order?.items?.reduce((acc, item) => {
|
|
200
|
+
// return acc + item.quantity;
|
|
201
|
+
// }, 0);
|
|
160
202
|
return (index.h(index.Host, { class: "zonos--checkout-finish zonos--elements", style: {
|
|
161
203
|
'--border-radius': getBorderRadius.getBorderRadius(this.borderRadius),
|
|
162
|
-
} }, this.isLoading && (index.h("div", { class: "loading-wrapper" }, index.h("zonos-spinner", null))), !this.isLoading && (index.h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { color: 'blue-800', content: SuccessIcon, size: 50 })) : (index.h("zonos-icon", { color: 'red-800', content: RemoveIcon$1, size: 50 })), index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", null, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), index.h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, localization.translate('Keep shopping'))))));
|
|
204
|
+
} }, this.isLoading && (index.h("div", { class: "loading-wrapper" }, index.h("zonos-spinner", null))), !this.isLoading && (index.h(index.Fragment, null, index.h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { color: 'blue-800', content: SuccessIcon, size: 50 })) : (index.h("zonos-icon", { color: 'red-800', content: RemoveIcon$1, size: 50 })), index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", null, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), index.h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, localization.translate('Keep shopping')))))));
|
|
163
205
|
}
|
|
164
206
|
static get assetsDirs() { return ["assets"]; }
|
|
165
207
|
};
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const localization = require('./localization-
|
|
8
|
-
const zonosStore = require('./zonosStore-
|
|
9
|
-
const submitGtag = require('./submitGtag-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const cart = require('./cart-90f7c8c0.js');
|
|
7
|
+
const localization = require('./localization-9caf3397.js');
|
|
8
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
9
|
+
const submitGtag = require('./submitGtag-b141b45d.js');
|
|
10
10
|
const classes = require('./classes-b7918f56.js');
|
|
11
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
12
|
-
const isDarkColor = require('./isDarkColor-
|
|
11
|
+
const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
|
|
12
|
+
const isDarkColor = require('./isDarkColor-ff6ff183.js');
|
|
13
13
|
|
|
14
14
|
const LeftArrow = `<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
15
15
|
|
|
@@ -295,6 +295,8 @@ const ZonosCheckout = class {
|
|
|
295
295
|
// Update the URL without query parameters
|
|
296
296
|
window.history.replaceState({}, document.title, cleanUrl);
|
|
297
297
|
this.open = false;
|
|
298
|
+
// Reload the page
|
|
299
|
+
window.location.reload();
|
|
298
300
|
}
|
|
299
301
|
async handleBackClick() {
|
|
300
302
|
// close the modal if back button is clicked on customer info step
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
6
|
|
|
7
7
|
function format(first, middle, last) {
|
|
8
8
|
return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const localization = require('./localization-
|
|
8
|
-
const zonosStore = require('./zonosStore-
|
|
9
|
-
require('./isDarkColor-
|
|
10
|
-
require('./getBorderRadius-
|
|
5
|
+
const index = require('./index-0dcccc22.js');
|
|
6
|
+
const cart = require('./cart-90f7c8c0.js');
|
|
7
|
+
const localization = require('./localization-9caf3397.js');
|
|
8
|
+
const zonosStore = require('./zonosStore-b43ef5db.js');
|
|
9
|
+
require('./isDarkColor-ff6ff183.js');
|
|
10
|
+
require('./getBorderRadius-bf4a4276.js');
|
|
11
11
|
|
|
12
12
|
const getZonosSetting = async () => {
|
|
13
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-
|
|
13
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
|
|
14
14
|
const { errors, json } = await localization.handleFetch(url);
|
|
15
15
|
if (errors.length) {
|
|
16
16
|
localization.logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
|
|
@@ -151,7 +151,7 @@ const ZonosController = class {
|
|
|
151
151
|
zonosStore.zonosStore.appearance = Object.assign(Object.assign({}, zonosStore.zonosStore.appearance), { fontFamily: overrideFont });
|
|
152
152
|
}
|
|
153
153
|
const routeUrl = "https://v1.route.js.zonos.com";
|
|
154
|
-
const { errors, json } = await localization.handleFetch(`${routeUrl}/api/get-font-detail?family=${fontSelected}`);
|
|
154
|
+
const { errors, json } = await localization.handleFetch(`${routeUrl}/api/zonos-elements/get-font-detail?family=${fontSelected}`);
|
|
155
155
|
if (errors.length > 0 || !json) {
|
|
156
156
|
localization.log(`Failed to load font ${fontSelected}`, 'warn');
|
|
157
157
|
return;
|