@zonos/elements 1.3.51 → 1.3.52
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-65376e00.js +40 -0
- package/dist/cjs/{cart-546d1602.js → cart-61a8983d.js} +238 -375
- package/dist/cjs/{createCustomEvent-9b91480b.js → createCustomEvent-228027b5.js} +3 -2
- package/dist/cjs/handleFetch-842c95b0.js +322 -0
- package/dist/cjs/index.cjs.js +75 -35
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-83f49f9a.js → paypal-f1eb6621.js} +16 -16
- package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
- package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-badge_13.cjs.entry.js} +41 -9
- package/dist/cjs/zonos-checkout.cjs.entry.js +75 -174
- package/dist/cjs/zonos-controller.cjs.entry.js +27 -25
- 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-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +11 -11
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +9 -9
- package/dist/cjs/zonos-tooltip.cjs.entry.js +27 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +5 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +44 -20
- package/dist/collection/components/store/checkout/cart.js +14 -2
- package/dist/collection/components/store/checkout/stripe.js +9 -4
- package/dist/collection/components/store/translationStore/strings.arabic.js +3 -3
- package/dist/collection/components/store/translationStore/strings.base.js +3 -3
- package/dist/collection/components/store/translationStore/strings.chinese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.danish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.dutch.js +3 -3
- package/dist/collection/components/store/translationStore/strings.french.js +3 -3
- package/dist/collection/components/store/translationStore/strings.german.js +3 -3
- package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -3
- package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.italian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.japanese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.korean.js +3 -3
- package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.polish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.russian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.spanish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.swedish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.turkish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -3
- package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +14 -14
- package/dist/collection/components/utils/api/calculateLandedCostNormalized.js +28 -0
- package/dist/collection/components/utils/api/cartCalculateLandedCost.js +19 -0
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +65 -0
- package/dist/collection/components/utils/checkout/initCheckout.js +4 -2
- package/dist/collection/environment.js +1 -1
- package/dist/collection/scripts/_getNextFallbackUrl.js +1 -0
- package/dist/collection/scripts/_getTempCartById.js +14 -0
- package/dist/collection/scripts/_zonosBase.js +39 -10
- package/dist/collection/scripts/cart/_getCartIdFromParam.js +9 -0
- package/dist/collection/scripts/cart/_setupCartData.js +18 -0
- package/dist/collection/types/checkout/CheckoutConfig.js +2 -1
- package/dist/collection/types/generated/graphql.customer.types.js +12 -0
- package/dist/collection/utils/formattedCloudflareApiUrl.js +8 -2
- package/dist/collection/utils/generateCloudflareDeployUrl.js +3 -0
- package/dist/esm/CheckoutConfig-57350b28.js +36 -0
- package/dist/esm/{cart-51529af2.js → cart-45d2861f.js} +193 -327
- package/dist/esm/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +2 -1
- package/dist/esm/handleFetch-37cea185.js +315 -0
- package/dist/esm/index.js +56 -17
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-905325d0.js → paypal-ee310945.js} +2 -2
- package/dist/esm/zonos-address_8.entry.js +2 -2
- package/dist/esm/{zonos-cart-items_12.entry.js → zonos-badge_13.entry.js} +40 -9
- package/dist/esm/zonos-checkout.entry.js +61 -160
- package/dist/esm/zonos-controller.entry.js +6 -4
- 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-elements.js +1 -1
- 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/zonos-tooltip.entry.js +23 -0
- package/dist/esm-es5/CheckoutConfig-57350b28.js +1 -0
- package/dist/esm-es5/cart-45d2861f.js +1 -0
- package/dist/esm-es5/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +1 -1
- package/dist/esm-es5/handleFetch-37cea185.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-905325d0.js → paypal-ee310945.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -0
- 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-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-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -0
- package/dist/scripts/index.d.ts +74 -87
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +0 -2
- package/dist/types/components/store/checkout/cart.d.ts +13 -3
- package/dist/types/components/store/checkout/stripe.d.ts +3 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.base.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.french.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.german.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -3
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +8 -3
- package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +2 -0
- package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +5 -0
- package/dist/types/components/utils/api/prepCalculateLandedCost.d.ts +5 -1
- package/dist/types/components/utils/checkout/getIsTestMode.d.ts +1 -1
- package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -0
- package/dist/types/scripts/_getTempCartById.d.ts +8 -0
- package/dist/types/scripts/_zonosBase.d.ts +15 -12
- package/dist/types/scripts/cart/_getCartIdFromParam.d.ts +4 -0
- package/dist/types/scripts/cart/_setupCartData.d.ts +7 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +18 -3
- package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +42 -1
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +37 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +249 -2
- package/dist/types/types/generated/graphql.customer.types.ts +251 -3
- package/dist/types/utils/formattedCloudflareApiUrl.d.ts +2 -2
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-042c466d.system.entry.js +1 -0
- package/dist/zonos-elements/p-10cb0064.entry.js +1 -0
- package/dist/zonos-elements/{p-5e56828a.entry.js → p-259ccf8d.entry.js} +1 -1
- package/dist/zonos-elements/p-2a47d2cc.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ffd76226.entry.js → p-31eb835c.entry.js} +1 -1
- package/dist/zonos-elements/{p-58d9803d.entry.js → p-36360905.entry.js} +1 -1
- package/dist/zonos-elements/{p-1828a4ff.system.entry.js → p-3703b814.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4146feec.js +1 -0
- package/dist/zonos-elements/p-446c8f02.system.entry.js +1 -0
- package/dist/zonos-elements/{p-2c323311.system.js → p-5590f90c.system.js} +1 -1
- package/dist/zonos-elements/p-588396df.js +1 -0
- package/dist/zonos-elements/{p-aa5d669b.js → p-6e59c6e4.js} +2 -2
- package/dist/zonos-elements/p-6eedc3f8.entry.js +1 -0
- package/dist/zonos-elements/p-747eed39.entry.js +1 -0
- package/dist/zonos-elements/{p-00100b17.system.entry.js → p-8228e87c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-827868e6.entry.js +1 -0
- package/dist/zonos-elements/{p-cc7a4fca.entry.js → p-88005b94.entry.js} +1 -1
- package/dist/zonos-elements/p-895fdefb.js +1 -0
- package/dist/zonos-elements/p-8f7773b0.system.js +1 -0
- package/dist/zonos-elements/{p-9a0401fd.entry.js → p-8fa49d94.entry.js} +1 -1
- package/dist/zonos-elements/p-a74a7afa.system.js +1 -0
- package/dist/zonos-elements/p-b1861e64.system.js +1 -0
- package/dist/zonos-elements/{p-8473f99a.system.entry.js → p-b842b96a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e976332.entry.js → p-bb186075.entry.js} +1 -1
- package/dist/zonos-elements/{p-b1a8b874.system.entry.js → p-c008648a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-6b42fa1b.system.entry.js → p-cd4ad1be.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-59e85369.system.entry.js → p-d62e6bb0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-496e040f.system.entry.js → p-dc12f30a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-eb2aedd0.js +1 -0
- package/dist/zonos-elements/{p-c89859cf.system.js → p-f124e459.system.js} +2 -2
- package/dist/zonos-elements/p-f527cd5b.entry.js +1 -0
- package/dist/zonos-elements/p-f826b979.system.entry.js +1 -0
- package/dist/zonos-elements/p-f87a635b.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/logError-4e2f2020.js +0 -58
- package/dist/cjs/zonos-badge_2.cjs.entry.js +0 -57
- package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +0 -66
- package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +0 -58
- package/dist/esm/logError-c456c092.js +0 -55
- package/dist/esm/zonos-badge_2.entry.js +0 -52
- package/dist/esm-es5/cart-51529af2.js +0 -1
- package/dist/esm-es5/logError-c456c092.js +0 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +0 -1
- package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +0 -11
- package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +0 -7
- package/dist/types/types/checkout/api/TempCart.d.ts +0 -80
- package/dist/zonos-elements/p-101c41bf.entry.js +0 -1
- package/dist/zonos-elements/p-3c4eec63.system.entry.js +0 -1
- package/dist/zonos-elements/p-47945026.system.entry.js +0 -1
- package/dist/zonos-elements/p-47c72c50.system.entry.js +0 -1
- package/dist/zonos-elements/p-4e77ed65.system.entry.js +0 -1
- package/dist/zonos-elements/p-6013e370.entry.js +0 -1
- package/dist/zonos-elements/p-63db40b9.system.js +0 -1
- package/dist/zonos-elements/p-8b8ef484.entry.js +0 -1
- package/dist/zonos-elements/p-b57d24f2.entry.js +0 -1
- package/dist/zonos-elements/p-ba0289f9.entry.js +0 -1
- package/dist/zonos-elements/p-c8a3303b.js +0 -1
- package/dist/zonos-elements/p-d413cd13.js +0 -1
- package/dist/zonos-elements/p-e758ec31.system.js +0 -1
- package/dist/zonos-elements/p-eaa335e1.js +0 -1
- package/dist/zonos-elements/p-fcfde531.system.js +0 -1
- /package/dist/collection/types/checkout/api/{TempCart.js → NormalizedTempCart.js} +0 -0
|
@@ -68,6 +68,9 @@ export const stringsChinese = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: '送货选项',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: '折扣',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: '不要关',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsChinese = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: '门口无需付款',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: '订单超过关税和税款的最低征税门槛',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: '订单总计',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsDanish = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Leveringsmuligheder',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Rabat',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Luk ikke',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsDanish = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Intet at betale ved døren',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Ordre er over de minimis-grænsen for både told og skat',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Ordresum',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsDutch = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Bezorgopties',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Kortingen',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Niet sluiten',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsDutch = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Niets te betalen aan de deur',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Bestelling overschrijdt de minimale drempel voor zowel heffing als belasting',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Totaal bestelling',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsFrench = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Options de livraison',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Réductions',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Ne pas fermer',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsFrench = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Rien à payer à la porte',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'La commande dépasse le seuil de minimis pour les droits et les taxes',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Total de la commande',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsGerman = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Lieferoptionen',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Rabatte',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Nicht schließen',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsGerman = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'An der Tür nichts zu bezahlen',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Bestellung überschreitet Mindestgrenze sowohl für Zoll als auch Steuer',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Bestellsumme',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsHebrew = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'אפשרויות משלוח',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'הנחות',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'אל תסגור',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsHebrew = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'אין כלום לשלם בדלת',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'ההזמנה חורגת מסף המינימום גם למכס וגם למס',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'סה"כ ההזמנה',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsIndonesian = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Opsi pengiriman',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Diskon',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Jangan tutup',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsIndonesian = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Tidak ada yang harus dibayar di pintu',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Pesanan melebihi ambang batas de minimis untuk bea masuk dan pajak',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Total pesanan',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsItalian = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Opzioni di consegna',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Sconti',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Non chiudere',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsItalian = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Nulla da pagare alla porta',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: "L'ordine supera la soglia di minimis sia per i dazi che per le tasse",
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Totale ordine',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsJapanese = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: '配送オプション',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: '割引',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: '閉めないでください',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsJapanese = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'ドアでの支払いはありません',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: '注文が関税と税金のデミニマス閾値を超えています',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'ご注文合計',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsKorean = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: '배송 옵션',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: '할인',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: '닫지 마세요',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsKorean = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: '문 앞에 납부할 것이 없습니다',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: '주문 금액이 관세와 세금의 최저 임계값을 초과합니다',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: '주문 총액',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsNorwegian = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Leveringsalternativer',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Rabatter',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Ikke lukk',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsNorwegian = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Ingenting å betale ved døren',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Bestillingen er over minstegrensen for både avgift og skatt',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Totalt beløp',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsPolish = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Opcje dostawy',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Zniżki',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Nie zamykaj',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsPolish = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Nic do zapłacenia przy drzwiach',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Zamówienie przekracza próg minimalny zarówno dla cła, jak i podatku',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Łączna kwota zamówienia',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsPortuguese = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Opções de entrega',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Descontos',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Não fechar',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsPortuguese = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Nada a pagar na porta',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'O pedido ultrapassa o limite de isenção tanto para impostos quanto para taxas',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Total do pedido',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsRussian = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Варианты доставки',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Скидки',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Не закрывайте',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsRussian = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'На двери ничего не должно',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Заказ превышает минимальный порог как для пошлины, так и для налога',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Итого',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsSpanish = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Opciones de entrega',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Descuentos',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'No cerrar',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsSpanish = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Nada debido en la puerta',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'El pedido supera el umbral mínimo tanto para impuestos como para aranceles',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Total del pedido',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsSwedish = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Leveransalternativ',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Rabatter',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Stäng inte',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsSwedish = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Ingenting att betala vid dörren',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Beställningen överstiger minimibeloppet för både tull och skatt',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Totalt belopp för beställningen',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsTurkish = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Teslimat seçenekleri',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'İndirimler',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Kapatma',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsTurkish = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Kapıda ödenecek bir şey yok',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Sipariş hem gümrük hem vergi için minimum sınırın üzerinde',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Sipariş toplamı',
|
|
154
154
|
},
|
|
@@ -68,6 +68,9 @@ export const stringsVietnamese = {
|
|
|
68
68
|
'Delivery options': {
|
|
69
69
|
value: 'Tùy chọn giao hàng',
|
|
70
70
|
},
|
|
71
|
+
Discounts: {
|
|
72
|
+
value: 'Giảm giá',
|
|
73
|
+
},
|
|
71
74
|
"Don't close": {
|
|
72
75
|
value: 'Đừng đóng',
|
|
73
76
|
},
|
|
@@ -146,9 +149,6 @@ export const stringsVietnamese = {
|
|
|
146
149
|
'Nothing due at the door': {
|
|
147
150
|
value: 'Không có gì phải trả tại cửa',
|
|
148
151
|
},
|
|
149
|
-
'Order is over the de minimis threshold for both duty and tax': {
|
|
150
|
-
value: 'Đơn hàng vượt ngưỡng miễn thuế cho cả thuế nhập khẩu và thuế',
|
|
151
|
-
},
|
|
152
152
|
'Order total': {
|
|
153
153
|
value: 'Tổng đơn hàng',
|
|
154
154
|
},
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { getAttributes } from "./tempCartItem/getAttributes";
|
|
2
|
-
import { getMeasurements } from "./tempCartItem/getMeasurements";
|
|
3
1
|
/**
|
|
4
2
|
* Map the items from tempCart like how we do it in dgs
|
|
5
3
|
* @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L393
|
|
6
4
|
*/
|
|
7
5
|
export const buildCartItemsByTempCart = (tempCartData) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
attributes: getAttributes(item),
|
|
6
|
+
const tempCartItems = tempCartData.items.map(item => ({
|
|
7
|
+
amount: item.amount,
|
|
8
|
+
attributes: item.attributes || [],
|
|
12
9
|
countryOfOrigin: item.countryOfOrigin || undefined,
|
|
13
|
-
currencyCode:
|
|
14
|
-
description: item.
|
|
15
|
-
imageUrl: item.
|
|
16
|
-
itemType: 'PHYSICAL_GOOD',
|
|
17
|
-
measurements:
|
|
18
|
-
name: item.description || '',
|
|
10
|
+
currencyCode: item.currencyCode,
|
|
11
|
+
description: item.description || '',
|
|
12
|
+
imageUrl: item.imageUrl || '',
|
|
13
|
+
itemType: item.itemType || 'PHYSICAL_GOOD',
|
|
14
|
+
measurements: item.measurements || [],
|
|
15
|
+
name: item.name || item.description || '',
|
|
19
16
|
productId: item.productId || '',
|
|
20
17
|
quantity: item.quantity || 0,
|
|
21
18
|
sku: item.sku || '',
|
|
22
|
-
}))
|
|
23
|
-
return
|
|
19
|
+
})) || [];
|
|
20
|
+
return {
|
|
21
|
+
adjustments: tempCartData.adjustments,
|
|
22
|
+
cartItems: tempCartItems,
|
|
23
|
+
};
|
|
24
24
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s)
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { calculateLandedCost } from "./calculateLandedCost";
|
|
14
|
+
import { cartCalculateLandedCost } from "./cartCalculateLandedCost";
|
|
15
|
+
export const calculateLandedCostNormalized = async (abortController) => {
|
|
16
|
+
const cartId = window.Zonos.cartId;
|
|
17
|
+
// Calculate landed cost as usual if no cartId is available
|
|
18
|
+
if (!cartId) {
|
|
19
|
+
const landedCostResult = await calculateLandedCost(abortController);
|
|
20
|
+
return landedCostResult;
|
|
21
|
+
}
|
|
22
|
+
// Calculate landed cost using cartId
|
|
23
|
+
const _a = await cartCalculateLandedCost({
|
|
24
|
+
abortController,
|
|
25
|
+
cartId,
|
|
26
|
+
}), { cartWorkflow } = _a, rest = __rest(_a, ["cartWorkflow"]);
|
|
27
|
+
return Object.assign(Object.assign({}, rest), { itemCreateWorkflow: cartWorkflow.items });
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { prepCartCalculateLandedCost } from "./prepCalculateLandedCost";
|
|
2
|
+
import { handleFetch } from "../handleFetch";
|
|
3
|
+
export const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
|
|
4
|
+
var _a;
|
|
5
|
+
// request to get landed cost info
|
|
6
|
+
const { errors, json } = await handleFetch('/api/zonos-elements/cart-calculate-landed-cost', {
|
|
7
|
+
body: prepCartCalculateLandedCost(cartId),
|
|
8
|
+
method: 'POST',
|
|
9
|
+
signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
|
|
10
|
+
});
|
|
11
|
+
if (errors.length || !json) {
|
|
12
|
+
const isAbortedRequest = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'The user aborted a request.';
|
|
13
|
+
const errorMessage = isAbortedRequest
|
|
14
|
+
? 'The landed cost calculation request was aborted to initiate a new one.'
|
|
15
|
+
: 'Failed to calculate landed cost';
|
|
16
|
+
throw new Error(errorMessage);
|
|
17
|
+
}
|
|
18
|
+
return json;
|
|
19
|
+
};
|
|
@@ -19,6 +19,71 @@ const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
|
|
|
19
19
|
state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Similar to prepCalculateLandedCost except it only uses
|
|
24
|
+
*/
|
|
25
|
+
export const prepCartCalculateLandedCost = (cartId) => {
|
|
26
|
+
var _a;
|
|
27
|
+
// maybe we don't need email now for prefetch the landed cost
|
|
28
|
+
const stripeLinkData = stripeStore.stripeLinkEventData;
|
|
29
|
+
const stripeAddressData = stripeStore.stripeAddressEventData;
|
|
30
|
+
const stripeBillingAddressData = stripeStore.stripeShippingSameAsBilling
|
|
31
|
+
? stripeStore.stripeAddressEventData
|
|
32
|
+
: stripeStore.stripeBillingAddressEventData;
|
|
33
|
+
if (!(stripeAddressData === null || stripeAddressData === void 0 ? void 0 : stripeAddressData.complete) || !(stripeBillingAddressData === null || stripeBillingAddressData === void 0 ? void 0 : stripeBillingAddressData.complete)) {
|
|
34
|
+
throw new Error('Missing stripe address data');
|
|
35
|
+
}
|
|
36
|
+
// Attempt to get translated address if available
|
|
37
|
+
const translatedShippingAddress = getTranslatedAddress({
|
|
38
|
+
currentAddress: stripeAddressData,
|
|
39
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
40
|
+
});
|
|
41
|
+
const shippingFirstName = translatedShippingAddress.name.split(' ')[0] || '';
|
|
42
|
+
const shippingLastName = translatedShippingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
43
|
+
const translatedBillingAddress = getTranslatedAddress({
|
|
44
|
+
currentAddress: stripeBillingAddressData,
|
|
45
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
46
|
+
});
|
|
47
|
+
const billingFirstName = translatedBillingAddress.name.split(' ')[0] || '';
|
|
48
|
+
const billingLastName = translatedBillingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
49
|
+
return {
|
|
50
|
+
billingAddress: {
|
|
51
|
+
addressLine1: translatedBillingAddress.line1,
|
|
52
|
+
addressLine2: translatedBillingAddress.line2 || '',
|
|
53
|
+
city: translatedBillingAddress.city,
|
|
54
|
+
country: translatedBillingAddress.country,
|
|
55
|
+
postalCode: translatedBillingAddress.postal_code,
|
|
56
|
+
state: translatedBillingAddress.state,
|
|
57
|
+
},
|
|
58
|
+
billingContact: {
|
|
59
|
+
// firstName and lastName should be valid now since stripe only mark
|
|
60
|
+
// the address as complete when both fields are filled.
|
|
61
|
+
firstName: billingFirstName,
|
|
62
|
+
lastName: billingLastName,
|
|
63
|
+
phone: translatedBillingAddress.phone,
|
|
64
|
+
},
|
|
65
|
+
// Use the first item's currency code
|
|
66
|
+
cartCurrencyCode: (_a = cartStore.items[0]) === null || _a === void 0 ? void 0 : _a.currencyCode,
|
|
67
|
+
cartId,
|
|
68
|
+
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
69
|
+
contact: {
|
|
70
|
+
email: stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email,
|
|
71
|
+
// firstName and lastName should be valid now since stripe only mark
|
|
72
|
+
// the address as complete when both fields are filled.
|
|
73
|
+
firstName: shippingFirstName,
|
|
74
|
+
lastName: shippingLastName,
|
|
75
|
+
phone: translatedShippingAddress.phone,
|
|
76
|
+
},
|
|
77
|
+
shippingAddress: {
|
|
78
|
+
addressLine1: translatedShippingAddress.line1,
|
|
79
|
+
addressLine2: translatedShippingAddress.line2,
|
|
80
|
+
city: translatedShippingAddress.city,
|
|
81
|
+
country: translatedShippingAddress.country,
|
|
82
|
+
postalCode: translatedShippingAddress.postal_code,
|
|
83
|
+
state: translatedShippingAddress.state,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
};
|
|
22
87
|
export const prepCalculateLandedCost = () => {
|
|
23
88
|
// maybe we don't need email now for prefetch the landed cost
|
|
24
89
|
const stripeLinkData = stripeStore.stripeLinkEventData;
|
|
@@ -9,12 +9,14 @@ const injectCheckoutElement = () => {
|
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
export const initCheckout = (config) => {
|
|
12
|
-
if (
|
|
12
|
+
// allow to load checkout if cartData is ready (Checkout can be loaded right awaiy if tempCartUUID is in the URL)
|
|
13
|
+
if (!config.placeOrderButtonSelector && !window.Zonos.cartData) {
|
|
13
14
|
// do nothing if checkout button anchor is not set
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
16
17
|
// check if checkout button anchor selector user pass in is valid
|
|
17
|
-
if (
|
|
18
|
+
if (config.placeOrderButtonSelector &&
|
|
19
|
+
!isValidSelector(config.placeOrderButtonSelector)) {
|
|
18
20
|
logError(`Selector checkoutButtonAnchor "${config.placeOrderButtonSelector}" is not a valid selector`);
|
|
19
21
|
return;
|
|
20
22
|
}
|
|
@@ -100,9 +100,9 @@ export const env = createEnv({
|
|
|
100
100
|
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: formattedCloudflareApiUrl({
|
|
101
101
|
branchName: currentBranch,
|
|
102
102
|
inCI,
|
|
103
|
+
inGithubAction: inGithubActions,
|
|
103
104
|
inVercel,
|
|
104
105
|
isVercelPreview,
|
|
105
|
-
projectName: 'zonos-elements',
|
|
106
106
|
url: process.env.NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL,
|
|
107
107
|
}),
|
|
108
108
|
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: JS_DELIVR_ZONOS_URL,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { handleFetch } from "../components/utils/handleFetch";
|
|
2
|
+
export const getTempCartById = async (cartId) => {
|
|
3
|
+
const { errors, json } = await handleFetch('/api/zonos-elements/get-temp-cart', {
|
|
4
|
+
body: { tempCartUUID: cartId },
|
|
5
|
+
headers: {
|
|
6
|
+
'Content-Type': 'application/json',
|
|
7
|
+
},
|
|
8
|
+
method: 'POST',
|
|
9
|
+
});
|
|
10
|
+
if (!json || errors.length) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return json;
|
|
14
|
+
};
|