@merchi/cart 1.4.4
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/LICENSE +21 -0
- package/README.md +134 -0
- package/esm/Cart.js +62 -0
- package/esm/CartAlert.js +47 -0
- package/esm/CartHeader.js +29 -0
- package/esm/CartProvider.js +1101 -0
- package/esm/CartTotals.js +89 -0
- package/esm/assets/merchi-monster-loader.gif +0 -0
- package/esm/assets/merchi-swipe-outline.png +0 -0
- package/esm/assets/product-not-found.png +0 -0
- package/esm/assets/stripe-payment-secure.png +0 -0
- package/esm/buttons/Button.js +23 -0
- package/esm/buttons/ButtonBack.js +35 -0
- package/esm/buttons/ButtonClearCart.js +17 -0
- package/esm/buttons/ButtonInvoiceDownload.js +88 -0
- package/esm/buttons/ButtonNext.js +39 -0
- package/esm/buttons/ButtonNextDynamic.js +19 -0
- package/esm/buttons/ButtonOpenCartMerchiCartModal.js +47 -0
- package/esm/buttons/ButtonPay.js +26 -0
- package/esm/buttons/ButtonShipmentTabNext.js +28 -0
- package/esm/buttons/index.js +7 -0
- package/esm/components/Alert.js +26 -0
- package/esm/components/CartBody.js +14 -0
- package/esm/components/CartClient.js +62 -0
- package/esm/components/CartFooter.js +12 -0
- package/esm/components/CartItemRow.js +230 -0
- package/esm/components/CartPaymentSettingsInvalid.js +13 -0
- package/esm/components/CartShipment.js +52 -0
- package/esm/components/CartTabContent.js +12 -0
- package/esm/components/CartTabPanel.js +25 -0
- package/esm/components/CartTableContainer.js +12 -0
- package/esm/components/CartTitle.js +26 -0
- package/esm/components/CartTotalsListGroup.js +71 -0
- package/esm/components/Collapse.js +32 -0
- package/esm/components/CustomCartProductForm.js +128 -0
- package/esm/components/CustomerCheckoutMethodTabs.js +94 -0
- package/esm/components/DiscountInputGroup.js +293 -0
- package/esm/components/LoadingTemplate.js +23 -0
- package/esm/components/NoCartItems.js +20 -0
- package/esm/components/ShipmentGroupCard.js +207 -0
- package/esm/components/Table.js +13 -0
- package/esm/components/containers.js +31 -0
- package/esm/components/index.js +18 -0
- package/esm/components/product-form-sdk-externals.js +36 -0
- package/esm/forms/FormNewCustomer.js +243 -0
- package/esm/forms/FormReturningCustomer.js +165 -0
- package/esm/forms/FormShipmentAddressAndNotes.js +195 -0
- package/esm/forms/FormSquarePayment.js +19 -0
- package/esm/forms/FormStripePayment.js +19 -0
- package/esm/forms/FormWhatsappCustomer.js +253 -0
- package/esm/forms/InputAcceptUserTermsAndConditions.js +35 -0
- package/esm/forms/InputError.js +16 -0
- package/esm/forms/InputSelect.js +48 -0
- package/esm/forms/InputText.js +56 -0
- package/esm/forms/InputsAddress.js +476 -0
- package/esm/forms/index.js +8 -0
- package/esm/index.js +13 -0
- package/esm/modals.js +51 -0
- package/esm/panels/PanelCartItems.js +49 -0
- package/esm/panels/PanelCartShipment.js +66 -0
- package/esm/panels/PanelClearCart.js +56 -0
- package/esm/panels/PanelClientCheckout.js +81 -0
- package/esm/panels/PanelEditCartItem.js +199 -0
- package/esm/panels/PanelPaymentSuccess.js +63 -0
- package/esm/panels/index.js +7 -0
- package/esm/square/SquareCard.js +106 -0
- package/esm/stripe/LegacyStripeCardForm.js +157 -0
- package/esm/stripe/StripeCardFields.js +126 -0
- package/esm/stripe/StripeCardForm.js +33 -0
- package/esm/stripe/StripePaymentButtons.js +98 -0
- package/esm/stripe/actions.js +192 -0
- package/esm/stripe/utils.js +20 -0
- package/esm/styles/globals.css +463 -0
- package/esm/styles/globals.css.map +1 -0
- package/esm/tabs/CartNav.js +28 -0
- package/esm/tabs/NavTab.js +31 -0
- package/esm/types/assets.d.js +0 -0
- package/esm/types/index.js +1 -0
- package/esm/types/merchi_product_form/index.d.js +0 -0
- package/esm/types/merchi_sdk_ts/index.d.js +0 -0
- package/esm/types/react-redux/index.d.js +0 -0
- package/esm/utilities/address.js +457 -0
- package/esm/utilities/area.js +297 -0
- package/esm/utilities/cart.js +95 -0
- package/esm/utilities/company.js +6 -0
- package/esm/utilities/cookie.js +156 -0
- package/esm/utilities/currency.js +219 -0
- package/esm/utilities/customForm.js +57 -0
- package/esm/utilities/helpers.js +229 -0
- package/esm/utilities/index.js +14 -0
- package/esm/utilities/invoice.js +112 -0
- package/esm/utilities/job.js +9 -0
- package/esm/utilities/local_storage.js +85 -0
- package/esm/utilities/product.js +13 -0
- package/esm/utilities/shipment.js +11 -0
- package/esm/utilities/tabs.js +51 -0
- package/esm/utilities/user.js +65 -0
- package/esm/utilities/variations.js +58 -0
- package/lib/Cart.d.ts +9 -0
- package/lib/Cart.js +69 -0
- package/lib/CartAlert.d.ts +3 -0
- package/lib/CartAlert.js +53 -0
- package/lib/CartHeader.d.ts +3 -0
- package/lib/CartHeader.js +37 -0
- package/lib/CartProvider.d.ts +236 -0
- package/lib/CartProvider.js +1107 -0
- package/lib/CartTotals.d.ts +7 -0
- package/lib/CartTotals.js +96 -0
- package/lib/assets/merchi-monster-loader.gif +0 -0
- package/lib/assets/merchi-swipe-outline.png +0 -0
- package/lib/assets/product-not-found.png +0 -0
- package/lib/assets/stripe-payment-secure.png +0 -0
- package/lib/buttons/Button.d.ts +11 -0
- package/lib/buttons/Button.js +31 -0
- package/lib/buttons/ButtonBack.d.ts +6 -0
- package/lib/buttons/ButtonBack.js +44 -0
- package/lib/buttons/ButtonClearCart.d.ts +3 -0
- package/lib/buttons/ButtonClearCart.js +24 -0
- package/lib/buttons/ButtonInvoiceDownload.d.ts +3 -0
- package/lib/buttons/ButtonInvoiceDownload.js +96 -0
- package/lib/buttons/ButtonNext.d.ts +3 -0
- package/lib/buttons/ButtonNext.js +48 -0
- package/lib/buttons/ButtonNextDynamic.d.ts +3 -0
- package/lib/buttons/ButtonNextDynamic.js +28 -0
- package/lib/buttons/ButtonOpenCartMerchiCartModal.d.ts +9 -0
- package/lib/buttons/ButtonOpenCartMerchiCartModal.js +57 -0
- package/lib/buttons/ButtonPay.d.ts +7 -0
- package/lib/buttons/ButtonPay.js +35 -0
- package/lib/buttons/ButtonShipmentTabNext.d.ts +2 -0
- package/lib/buttons/ButtonShipmentTabNext.js +37 -0
- package/lib/buttons/index.d.ts +7 -0
- package/lib/buttons/index.js +48 -0
- package/lib/components/Alert.d.ts +7 -0
- package/lib/components/Alert.js +34 -0
- package/lib/components/CartBody.d.ts +7 -0
- package/lib/components/CartBody.js +22 -0
- package/lib/components/CartClient.d.ts +4 -0
- package/lib/components/CartClient.js +71 -0
- package/lib/components/CartFooter.d.ts +6 -0
- package/lib/components/CartFooter.js +20 -0
- package/lib/components/CartItemRow.d.ts +7 -0
- package/lib/components/CartItemRow.js +236 -0
- package/lib/components/CartPaymentSettingsInvalid.d.ts +2 -0
- package/lib/components/CartPaymentSettingsInvalid.js +21 -0
- package/lib/components/CartShipment.d.ts +6 -0
- package/lib/components/CartShipment.js +59 -0
- package/lib/components/CartTabContent.d.ts +6 -0
- package/lib/components/CartTabContent.js +20 -0
- package/lib/components/CartTabPanel.d.ts +7 -0
- package/lib/components/CartTabPanel.js +31 -0
- package/lib/components/CartTableContainer.d.ts +6 -0
- package/lib/components/CartTableContainer.js +20 -0
- package/lib/components/CartTitle.d.ts +2 -0
- package/lib/components/CartTitle.js +34 -0
- package/lib/components/CartTotalsListGroup.d.ts +3 -0
- package/lib/components/CartTotalsListGroup.js +78 -0
- package/lib/components/Collapse.d.ts +3 -0
- package/lib/components/Collapse.js +40 -0
- package/lib/components/CustomCartProductForm.d.ts +18 -0
- package/lib/components/CustomCartProductForm.js +136 -0
- package/lib/components/CustomerCheckoutMethodTabs.d.ts +6 -0
- package/lib/components/CustomerCheckoutMethodTabs.js +103 -0
- package/lib/components/DiscountInputGroup.d.ts +2 -0
- package/lib/components/DiscountInputGroup.js +301 -0
- package/lib/components/LoadingTemplate.d.ts +7 -0
- package/lib/components/LoadingTemplate.js +30 -0
- package/lib/components/NoCartItems.d.ts +3 -0
- package/lib/components/NoCartItems.js +27 -0
- package/lib/components/ShipmentGroupCard.d.ts +7 -0
- package/lib/components/ShipmentGroupCard.js +215 -0
- package/lib/components/Table.d.ts +7 -0
- package/lib/components/Table.js +19 -0
- package/lib/components/containers.d.ts +14 -0
- package/lib/components/containers.js +40 -0
- package/lib/components/index.d.ts +18 -0
- package/lib/components/index.js +133 -0
- package/lib/components/product-form-sdk-externals.d.ts +46 -0
- package/lib/components/product-form-sdk-externals.js +43 -0
- package/lib/forms/FormNewCustomer.d.ts +4 -0
- package/lib/forms/FormNewCustomer.js +252 -0
- package/lib/forms/FormReturningCustomer.d.ts +3 -0
- package/lib/forms/FormReturningCustomer.js +173 -0
- package/lib/forms/FormShipmentAddressAndNotes.d.ts +15 -0
- package/lib/forms/FormShipmentAddressAndNotes.js +203 -0
- package/lib/forms/FormSquarePayment.d.ts +3 -0
- package/lib/forms/FormSquarePayment.js +27 -0
- package/lib/forms/FormStripePayment.d.ts +3 -0
- package/lib/forms/FormStripePayment.js +27 -0
- package/lib/forms/FormWhatsappCustomer.d.ts +3 -0
- package/lib/forms/FormWhatsappCustomer.js +261 -0
- package/lib/forms/InputAcceptUserTermsAndConditions.d.ts +7 -0
- package/lib/forms/InputAcceptUserTermsAndConditions.js +41 -0
- package/lib/forms/InputError.d.ts +8 -0
- package/lib/forms/InputError.js +24 -0
- package/lib/forms/InputSelect.d.ts +14 -0
- package/lib/forms/InputSelect.js +55 -0
- package/lib/forms/InputText.d.ts +12 -0
- package/lib/forms/InputText.js +63 -0
- package/lib/forms/InputsAddress.d.ts +11 -0
- package/lib/forms/InputsAddress.js +485 -0
- package/lib/forms/index.d.ts +8 -0
- package/lib/forms/index.js +63 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +93 -0
- package/lib/modals.d.ts +17 -0
- package/lib/modals.js +59 -0
- package/lib/panels/PanelCartItems.d.ts +3 -0
- package/lib/panels/PanelCartItems.js +56 -0
- package/lib/panels/PanelCartShipment.d.ts +3 -0
- package/lib/panels/PanelCartShipment.js +72 -0
- package/lib/panels/PanelClearCart.d.ts +3 -0
- package/lib/panels/PanelClearCart.js +62 -0
- package/lib/panels/PanelClientCheckout.d.ts +3 -0
- package/lib/panels/PanelClientCheckout.js +88 -0
- package/lib/panels/PanelEditCartItem.d.ts +6 -0
- package/lib/panels/PanelEditCartItem.js +206 -0
- package/lib/panels/PanelPaymentSuccess.d.ts +3 -0
- package/lib/panels/PanelPaymentSuccess.js +69 -0
- package/lib/panels/index.d.ts +7 -0
- package/lib/panels/index.js +48 -0
- package/lib/square/SquareCard.d.ts +3 -0
- package/lib/square/SquareCard.js +114 -0
- package/lib/stripe/LegacyStripeCardForm.d.ts +3 -0
- package/lib/stripe/LegacyStripeCardForm.js +166 -0
- package/lib/stripe/StripeCardFields.d.ts +15 -0
- package/lib/stripe/StripeCardFields.js +135 -0
- package/lib/stripe/StripeCardForm.d.ts +2 -0
- package/lib/stripe/StripeCardForm.js +42 -0
- package/lib/stripe/StripePaymentButtons.d.ts +8 -0
- package/lib/stripe/StripePaymentButtons.js +106 -0
- package/lib/stripe/actions.d.ts +4 -0
- package/lib/stripe/actions.js +200 -0
- package/lib/stripe/utils.d.ts +18 -0
- package/lib/stripe/utils.js +27 -0
- package/lib/styles/globals.css +463 -0
- package/lib/styles/globals.css.map +1 -0
- package/lib/tabs/CartNav.d.ts +3 -0
- package/lib/tabs/CartNav.js +36 -0
- package/lib/tabs/NavTab.d.ts +9 -0
- package/lib/tabs/NavTab.js +39 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.js +1 -0
- package/lib/utilities/address.d.ts +30 -0
- package/lib/utilities/address.js +468 -0
- package/lib/utilities/area.d.ts +77 -0
- package/lib/utilities/area.js +328 -0
- package/lib/utilities/cart.d.ts +9 -0
- package/lib/utilities/cart.js +108 -0
- package/lib/utilities/company.d.ts +2 -0
- package/lib/utilities/company.js +13 -0
- package/lib/utilities/cookie.d.ts +4 -0
- package/lib/utilities/cookie.js +165 -0
- package/lib/utilities/currency.d.ts +5 -0
- package/lib/utilities/currency.js +229 -0
- package/lib/utilities/customForm.d.ts +17 -0
- package/lib/utilities/customForm.js +64 -0
- package/lib/utilities/helpers.d.ts +24 -0
- package/lib/utilities/helpers.js +240 -0
- package/lib/utilities/index.d.ts +14 -0
- package/lib/utilities/index.js +159 -0
- package/lib/utilities/invoice.d.ts +3 -0
- package/lib/utilities/invoice.js +118 -0
- package/lib/utilities/job.d.ts +1 -0
- package/lib/utilities/job.js +15 -0
- package/lib/utilities/local_storage.d.ts +31 -0
- package/lib/utilities/local_storage.js +96 -0
- package/lib/utilities/product.d.ts +2 -0
- package/lib/utilities/product.js +21 -0
- package/lib/utilities/shipment.d.ts +2 -0
- package/lib/utilities/shipment.js +18 -0
- package/lib/utilities/tabs.d.ts +14 -0
- package/lib/utilities/tabs.js +60 -0
- package/lib/utilities/user.d.ts +5 -0
- package/lib/utilities/user.js +75 -0
- package/lib/utilities/variations.d.ts +18 -0
- package/lib/utilities/variations.js +66 -0
- package/package.json +109 -0
- package/src/Cart.tsx +96 -0
- package/src/CartAlert.tsx +35 -0
- package/src/CartHeader.tsx +28 -0
- package/src/CartProvider.tsx +992 -0
- package/src/CartTotals.tsx +102 -0
- package/src/assets/merchi-monster-loader.gif +0 -0
- package/src/assets/merchi-swipe-outline.png +0 -0
- package/src/assets/product-not-found.png +0 -0
- package/src/assets/stripe-payment-secure.png +0 -0
- package/src/buttons/Button.tsx +35 -0
- package/src/buttons/ButtonBack.tsx +42 -0
- package/src/buttons/ButtonClearCart.tsx +17 -0
- package/src/buttons/ButtonInvoiceDownload.tsx +60 -0
- package/src/buttons/ButtonNext.tsx +35 -0
- package/src/buttons/ButtonNextDynamic.tsx +31 -0
- package/src/buttons/ButtonOpenCartMerchiCartModal.tsx +61 -0
- package/src/buttons/ButtonPay.tsx +32 -0
- package/src/buttons/ButtonShipmentTabNext.tsx +24 -0
- package/src/buttons/index.ts +15 -0
- package/src/components/Alert.tsx +31 -0
- package/src/components/CartBody.tsx +16 -0
- package/src/components/CartClient.tsx +52 -0
- package/src/components/CartFooter.tsx +15 -0
- package/src/components/CartItemRow.tsx +212 -0
- package/src/components/CartPaymentSettingsInvalid.tsx +12 -0
- package/src/components/CartShipment.tsx +56 -0
- package/src/components/CartTabContent.tsx +15 -0
- package/src/components/CartTabPanel.tsx +25 -0
- package/src/components/CartTableContainer.tsx +15 -0
- package/src/components/CartTitle.tsx +22 -0
- package/src/components/CartTotalsListGroup.tsx +58 -0
- package/src/components/Collapse.tsx +23 -0
- package/src/components/CustomCartProductForm.tsx +123 -0
- package/src/components/CustomerCheckoutMethodTabs.tsx +106 -0
- package/src/components/DiscountInputGroup.tsx +160 -0
- package/src/components/LoadingTemplate.tsx +22 -0
- package/src/components/NoCartItems.tsx +20 -0
- package/src/components/ShipmentGroupCard.tsx +170 -0
- package/src/components/Table.tsx +15 -0
- package/src/components/containers.tsx +40 -0
- package/src/components/index.ts +38 -0
- package/src/components/product-form-sdk-externals.ts +67 -0
- package/src/forms/FormNewCustomer.tsx +170 -0
- package/src/forms/FormReturningCustomer.tsx +117 -0
- package/src/forms/FormShipmentAddressAndNotes.tsx +165 -0
- package/src/forms/FormSquarePayment.tsx +19 -0
- package/src/forms/FormStripePayment.tsx +19 -0
- package/src/forms/FormWhatsappCustomer.tsx +179 -0
- package/src/forms/InputAcceptUserTermsAndConditions.tsx +43 -0
- package/src/forms/InputError.tsx +23 -0
- package/src/forms/InputSelect.tsx +58 -0
- package/src/forms/InputText.tsx +56 -0
- package/src/forms/InputsAddress.tsx +438 -0
- package/src/forms/index.ts +18 -0
- package/src/index.ts +31 -0
- package/src/modals.tsx +65 -0
- package/src/panels/PanelCartItems.tsx +56 -0
- package/src/panels/PanelCartShipment.tsx +86 -0
- package/src/panels/PanelClearCart.tsx +50 -0
- package/src/panels/PanelClientCheckout.tsx +102 -0
- package/src/panels/PanelEditCartItem.tsx +172 -0
- package/src/panels/PanelPaymentSuccess.tsx +66 -0
- package/src/panels/index.ts +15 -0
- package/src/square/SquareCard.tsx +84 -0
- package/src/stripe/LegacyStripeCardForm.tsx +91 -0
- package/src/stripe/StripeCardFields.tsx +173 -0
- package/src/stripe/StripeCardForm.tsx +18 -0
- package/src/stripe/StripePaymentButtons.tsx +117 -0
- package/src/stripe/actions.ts +94 -0
- package/src/stripe/utils.ts +22 -0
- package/src/styles/globals.scss +475 -0
- package/src/tabs/CartNav.tsx +18 -0
- package/src/tabs/NavTab.tsx +36 -0
- package/src/types/assets.d.ts +4 -0
- package/src/types/index.ts +15 -0
- package/src/types/merchi_product_form/index.d.ts +1 -0
- package/src/types/merchi_sdk_ts/index.d.ts +1 -0
- package/src/types/react-redux/index.d.ts +0 -0
- package/src/utilities/address.ts +463 -0
- package/src/utilities/area.ts +359 -0
- package/src/utilities/cart.ts +80 -0
- package/src/utilities/company.ts +8 -0
- package/src/utilities/cookie.ts +58 -0
- package/src/utilities/currency.ts +216 -0
- package/src/utilities/customForm.ts +71 -0
- package/src/utilities/helpers.ts +213 -0
- package/src/utilities/index.ts +14 -0
- package/src/utilities/invoice.ts +60 -0
- package/src/utilities/job.ts +13 -0
- package/src/utilities/local_storage.ts +130 -0
- package/src/utilities/product.ts +14 -0
- package/src/utilities/shipment.ts +11 -0
- package/src/utilities/tabs.ts +38 -0
- package/src/utilities/user.ts +33 -0
- package/src/utilities/variations.ts +80 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.calculateTotalWithTax = calculateTotalWithTax;
|
|
7
|
+
exports.cartItemCurrencyAndCost = cartItemCurrencyAndCost;
|
|
8
|
+
exports.currencyMap = void 0;
|
|
9
|
+
exports.currencyTaxAndCost = currencyTaxAndCost;
|
|
10
|
+
exports.formatCurrency = formatCurrency;
|
|
11
|
+
var currencyMap = exports.currencyMap = {
|
|
12
|
+
ALL: 'L',
|
|
13
|
+
AFN: '؋',
|
|
14
|
+
ARS: '$',
|
|
15
|
+
AWG: 'ƒ',
|
|
16
|
+
AUD: '$',
|
|
17
|
+
AZN: '₼',
|
|
18
|
+
BSD: '$',
|
|
19
|
+
BBD: '$',
|
|
20
|
+
BYR: 'p.',
|
|
21
|
+
BZD: 'BZ$',
|
|
22
|
+
BMD: '$',
|
|
23
|
+
BOB: 'Bs.',
|
|
24
|
+
BAM: 'KM',
|
|
25
|
+
BWP: 'P',
|
|
26
|
+
BGN: 'лв',
|
|
27
|
+
BRL: 'R$',
|
|
28
|
+
BND: '$',
|
|
29
|
+
KHR: '៛',
|
|
30
|
+
CAD: '$',
|
|
31
|
+
KYD: '$',
|
|
32
|
+
CLP: '$',
|
|
33
|
+
CNY: '¥',
|
|
34
|
+
COP: '$',
|
|
35
|
+
CRC: '₡',
|
|
36
|
+
HRK: 'kn',
|
|
37
|
+
CUP: '₱',
|
|
38
|
+
CZK: 'Kč',
|
|
39
|
+
DKK: 'kr',
|
|
40
|
+
DOP: 'RD$',
|
|
41
|
+
XCD: '$',
|
|
42
|
+
EGP: '£',
|
|
43
|
+
SVC: '$',
|
|
44
|
+
EEK: 'kr',
|
|
45
|
+
EUR: '€',
|
|
46
|
+
FKP: '£',
|
|
47
|
+
FJD: '$',
|
|
48
|
+
GHC: '₵',
|
|
49
|
+
GIP: '£',
|
|
50
|
+
GTQ: 'Q',
|
|
51
|
+
GGP: '£',
|
|
52
|
+
GYD: '$',
|
|
53
|
+
HNL: 'L',
|
|
54
|
+
HKD: '$',
|
|
55
|
+
HUF: 'Ft',
|
|
56
|
+
ISK: 'kr',
|
|
57
|
+
INR: '₹',
|
|
58
|
+
IDR: 'Rp',
|
|
59
|
+
IRR: '﷼',
|
|
60
|
+
IMP: '£',
|
|
61
|
+
ILS: '₪',
|
|
62
|
+
JMD: '`J$',
|
|
63
|
+
JPY: '¥',
|
|
64
|
+
JEP: '£',
|
|
65
|
+
KES: 'KSh',
|
|
66
|
+
KZT: 'лв',
|
|
67
|
+
KPW: '₩',
|
|
68
|
+
KRW: '₩',
|
|
69
|
+
KGS: 'лв',
|
|
70
|
+
LAK: '₭',
|
|
71
|
+
LVL: 'Ls',
|
|
72
|
+
LBP: '£',
|
|
73
|
+
LRD: '$',
|
|
74
|
+
LTL: 'Lt',
|
|
75
|
+
MKD: 'ден',
|
|
76
|
+
MYR: 'RM',
|
|
77
|
+
MUR: '₨',
|
|
78
|
+
MXN: '$',
|
|
79
|
+
MNT: '₮',
|
|
80
|
+
MZN: 'MT',
|
|
81
|
+
NAD: '$',
|
|
82
|
+
NPR: '₨',
|
|
83
|
+
ANG: 'ƒ',
|
|
84
|
+
NZD: '$',
|
|
85
|
+
NIO: 'C$',
|
|
86
|
+
NGN: '₦',
|
|
87
|
+
NOK: 'kr',
|
|
88
|
+
OMR: '﷼',
|
|
89
|
+
PKR: '₨',
|
|
90
|
+
PAB: 'B/.',
|
|
91
|
+
PYG: 'Gs',
|
|
92
|
+
PEN: 'S/.',
|
|
93
|
+
PHP: '₱',
|
|
94
|
+
PLN: 'zł',
|
|
95
|
+
QAR: '﷼',
|
|
96
|
+
RON: 'lei',
|
|
97
|
+
RUB: '₽',
|
|
98
|
+
RMB: '¥',
|
|
99
|
+
SHP: '£',
|
|
100
|
+
SAR: '﷼',
|
|
101
|
+
RSD: 'Дин.',
|
|
102
|
+
SCR: '₨',
|
|
103
|
+
SGD: '$',
|
|
104
|
+
SBD: '$',
|
|
105
|
+
SOS: 'S',
|
|
106
|
+
ZAR: 'R',
|
|
107
|
+
LKR: '₨',
|
|
108
|
+
SEK: 'kr',
|
|
109
|
+
CHF: 'CHF',
|
|
110
|
+
SRD: '$',
|
|
111
|
+
SYP: '£',
|
|
112
|
+
TZS: 'TSh',
|
|
113
|
+
TWD: 'NT$',
|
|
114
|
+
THB: '฿',
|
|
115
|
+
TTD: 'TT$',
|
|
116
|
+
TRY: '₺',
|
|
117
|
+
TRL: '₤',
|
|
118
|
+
TVD: '$',
|
|
119
|
+
UGX: 'USh',
|
|
120
|
+
UAH: '₴',
|
|
121
|
+
GBP: '£',
|
|
122
|
+
USD: '$',
|
|
123
|
+
UYU: '$U',
|
|
124
|
+
UZS: 'лв',
|
|
125
|
+
VEF: 'Bs',
|
|
126
|
+
VND: '₫',
|
|
127
|
+
YER: '﷼',
|
|
128
|
+
ZWD: 'Z$'
|
|
129
|
+
};
|
|
130
|
+
function formatCurrency(amount, options) {
|
|
131
|
+
/*
|
|
132
|
+
* Example usage:
|
|
133
|
+
formatCurrency(-222.123456, {currency: 'EGP',
|
|
134
|
+
showCodeIfNoSymbol: true,
|
|
135
|
+
financialNegative: true,
|
|
136
|
+
decimalPlaces: 3})
|
|
137
|
+
--> '(£222.123)'
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
var symbol;
|
|
141
|
+
var negative = false;
|
|
142
|
+
var result;
|
|
143
|
+
options = options || {};
|
|
144
|
+
options.currency = options.currency || 'AUD';
|
|
145
|
+
options.showCodeIfNoSymbol = options.showCodeIfNoSymbol || true;
|
|
146
|
+
options.symbolAfterAmount = options.symbolAfterAmount || false;
|
|
147
|
+
options.financialNegative = options.financialNegative || false;
|
|
148
|
+
options.codeAfterSymbol = options.codeAfterSymbol || false;
|
|
149
|
+
options.codeBeforeSymbol = options.codeBeforeSymbol || false;
|
|
150
|
+
options.spaceBetweenSymbol = options.spaceBetweenSymbol || false;
|
|
151
|
+
options.decimalPlaces = options.decimalPlaces || 2;
|
|
152
|
+
options.decimalSeperator = options.decimalSeperator || '.';
|
|
153
|
+
options.codeAfterAmount = options.codeAfterAmount || false;
|
|
154
|
+
if (amount < 0.0) {
|
|
155
|
+
negative = true;
|
|
156
|
+
amount *= -1.0; // eslint-disable-line
|
|
157
|
+
}
|
|
158
|
+
if (Object.prototype.hasOwnProperty.call(currencyMap, options.currency)) {
|
|
159
|
+
symbol = currencyMap[options.currency];
|
|
160
|
+
if (options.codeAfterSymbol) {
|
|
161
|
+
symbol += '(' + options.currency + ') ';
|
|
162
|
+
}
|
|
163
|
+
if (options.codeBeforeSymbol) {
|
|
164
|
+
symbol = "(".concat(options.currency, ") ").concat(symbol);
|
|
165
|
+
}
|
|
166
|
+
} else if (options.showCodeIfNoSymbol) {
|
|
167
|
+
symbol = options.currency;
|
|
168
|
+
} else {
|
|
169
|
+
symbol = '';
|
|
170
|
+
}
|
|
171
|
+
amount = amount.toFixed(options.decimalPlaces);
|
|
172
|
+
amount = amount.replace('.', options.decimalSeperator);
|
|
173
|
+
if (options.symbolAfterAmount) {
|
|
174
|
+
result = amount;
|
|
175
|
+
if (options.spaceBetweenSymbol) {
|
|
176
|
+
result += ' ';
|
|
177
|
+
}
|
|
178
|
+
result += symbol;
|
|
179
|
+
} else {
|
|
180
|
+
result = symbol;
|
|
181
|
+
if (options.spaceBetweenSymbol) {
|
|
182
|
+
result += ' ';
|
|
183
|
+
}
|
|
184
|
+
result += amount;
|
|
185
|
+
}
|
|
186
|
+
if (negative) {
|
|
187
|
+
if (options.financialNegative) {
|
|
188
|
+
result = "(".concat(result, ")");
|
|
189
|
+
} else {
|
|
190
|
+
result = "-".concat(result);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (options.codeAfterAmount === true) {
|
|
194
|
+
result += " (".concat(options.currency, ")");
|
|
195
|
+
}
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
function formatCountryTax(countryTax) {
|
|
199
|
+
var taxName = countryTax.taxName,
|
|
200
|
+
taxPercent = countryTax.taxPercent;
|
|
201
|
+
return taxPercent > 0 ? " inc ".concat(taxName, " (").concat(taxPercent, "%)") : '';
|
|
202
|
+
}
|
|
203
|
+
function calculateTotalWithTax(total, tax) {
|
|
204
|
+
var taxMultiplier = 1.0;
|
|
205
|
+
if (tax && tax.taxPercent() > 0) {
|
|
206
|
+
taxMultiplier += tax.taxPercent() / 100;
|
|
207
|
+
taxMultiplier = parseFloat(taxMultiplier.toFixed(2));
|
|
208
|
+
}
|
|
209
|
+
var grandTotal = total * taxMultiplier;
|
|
210
|
+
return parseFloat(grandTotal.toFixed(2));
|
|
211
|
+
}
|
|
212
|
+
function cartItemCurrencyAndCost(cartItem) {
|
|
213
|
+
var currency = cartItem.currency,
|
|
214
|
+
totalCost = cartItem.totalCost,
|
|
215
|
+
taxType = cartItem.taxType;
|
|
216
|
+
var tax = taxType ? formatCountryTax(taxType) : '';
|
|
217
|
+
return "".concat(currency, " ").concat(formatCurrency(totalCost, {
|
|
218
|
+
currency: currency,
|
|
219
|
+
showCodeIfNoSymbol: false
|
|
220
|
+
}), " ").concat(tax);
|
|
221
|
+
}
|
|
222
|
+
function currencyTaxAndCost(currency, tax, theCost) {
|
|
223
|
+
var totalCost = calculateTotalWithTax(theCost, tax);
|
|
224
|
+
var _tax = tax ? formatCountryTax(tax) : '';
|
|
225
|
+
return "".concat(currency, " ").concat(formatCurrency(totalCost, {
|
|
226
|
+
currency: currency,
|
|
227
|
+
showCodeIfNoSymbol: false
|
|
228
|
+
}), " ").concat(_tax);
|
|
229
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for loading a product's published custom form bundle in cart edit.
|
|
3
|
+
* Mirrors the product-embed loader: SRI script tag → window.MERCHI_PRODUCT_FORM_<id>.
|
|
4
|
+
*/
|
|
5
|
+
import type { ComponentType } from 'react';
|
|
6
|
+
export interface FormBundleRef {
|
|
7
|
+
url: string;
|
|
8
|
+
integrity?: string;
|
|
9
|
+
globalName: string;
|
|
10
|
+
}
|
|
11
|
+
/** If the product has a published custom form with a compiled bundle, return
|
|
12
|
+
* the info needed to load it; otherwise null (caller falls back). */
|
|
13
|
+
export declare function publishedFormBundle(product: any): FormBundleRef | null;
|
|
14
|
+
/** Dynamically load a compiled form bundle and resolve its default export. */
|
|
15
|
+
export declare function loadFormBundle(bundle: FormBundleRef, opts?: {
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
}): Promise<ComponentType<any>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.loadFormBundle = loadFormBundle;
|
|
7
|
+
exports.publishedFormBundle = publishedFormBundle;
|
|
8
|
+
/**
|
|
9
|
+
* Helpers for loading a product's published custom form bundle in cart edit.
|
|
10
|
+
* Mirrors the product-embed loader: SRI script tag → window.MERCHI_PRODUCT_FORM_<id>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** If the product has a published custom form with a compiled bundle, return
|
|
14
|
+
* the info needed to load it; otherwise null (caller falls back). */
|
|
15
|
+
function publishedFormBundle(product) {
|
|
16
|
+
var form = product === null || product === void 0 ? void 0 : product.productForm;
|
|
17
|
+
if (!form || form.status !== 'published') return null;
|
|
18
|
+
var version = form.activeVersion;
|
|
19
|
+
if (!version || !version.compiledBundleUrl) return null;
|
|
20
|
+
return {
|
|
21
|
+
url: version.compiledBundleUrl,
|
|
22
|
+
integrity: version.bundleSha || undefined,
|
|
23
|
+
globalName: "MERCHI_PRODUCT_FORM_".concat(form.id)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Dynamically load a compiled form bundle and resolve its default export. */
|
|
28
|
+
function loadFormBundle(bundle) {
|
|
29
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
30
|
+
var url = bundle.url,
|
|
31
|
+
integrity = bundle.integrity,
|
|
32
|
+
globalName = bundle.globalName;
|
|
33
|
+
var timeoutMs = opts.timeoutMs || 15000;
|
|
34
|
+
var w = window;
|
|
35
|
+
var existing = w[globalName] && w[globalName]["default"];
|
|
36
|
+
if (existing) return Promise.resolve(existing);
|
|
37
|
+
return new Promise(function (resolve, reject) {
|
|
38
|
+
var settled = false;
|
|
39
|
+
var finish = function finish(fn, arg) {
|
|
40
|
+
if (settled) return;
|
|
41
|
+
settled = true;
|
|
42
|
+
clearTimeout(timer);
|
|
43
|
+
fn(arg);
|
|
44
|
+
};
|
|
45
|
+
var timer = setTimeout(function () {
|
|
46
|
+
return finish(reject, new Error("form bundle ".concat(globalName, " timed out")));
|
|
47
|
+
}, timeoutMs);
|
|
48
|
+
var script = document.createElement('script');
|
|
49
|
+
script.src = url;
|
|
50
|
+
if (integrity) script.integrity = integrity;
|
|
51
|
+
script.crossOrigin = 'anonymous';
|
|
52
|
+
script.async = true;
|
|
53
|
+
script.onload = function () {
|
|
54
|
+
var mod = w[globalName];
|
|
55
|
+
if (mod && mod["default"]) finish(resolve, mod["default"]);else {
|
|
56
|
+
finish(reject, new Error("form bundle ".concat(globalName, " did not register a default export")));
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
script.onerror = function () {
|
|
60
|
+
return finish(reject, new Error("failed to load form bundle ".concat(globalName)));
|
|
61
|
+
};
|
|
62
|
+
document.head.appendChild(script);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface JsonObject {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
interface Counter {
|
|
5
|
+
value: number;
|
|
6
|
+
}
|
|
7
|
+
interface SerialiseOptions {
|
|
8
|
+
existing?: FormData;
|
|
9
|
+
excludeOld?: boolean;
|
|
10
|
+
_prefix?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function unpackRecursiveJsonIter(jsonObject: JsonObject, options?: SerialiseOptions, fileIndex?: Counter): FormData;
|
|
13
|
+
export declare function encodeMerchiApiData(dataDict: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}): {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
export declare const phoneOptions: {
|
|
19
|
+
value: string;
|
|
20
|
+
label: any;
|
|
21
|
+
}[];
|
|
22
|
+
export declare function appendStyleSheetText(css: string, callback?: () => void): void;
|
|
23
|
+
export declare const cartEmbed: any;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.appendStyleSheetText = appendStyleSheetText;
|
|
7
|
+
exports.cartEmbed = void 0;
|
|
8
|
+
exports.encodeMerchiApiData = encodeMerchiApiData;
|
|
9
|
+
exports.phoneOptions = void 0;
|
|
10
|
+
exports.unpackRecursiveJsonIter = unpackRecursiveJsonIter;
|
|
11
|
+
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
|
|
12
|
+
var _snakeCase = _interopRequireDefault(require("lodash/snakeCase"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
18
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
+
var TransformationType = /*#__PURE__*/function (TransformationType) {
|
|
22
|
+
TransformationType["CAMEL"] = "camel";
|
|
23
|
+
TransformationType["UNDERSCORE"] = "underscore";
|
|
24
|
+
return TransformationType;
|
|
25
|
+
}(TransformationType || {});
|
|
26
|
+
var functionDict = _defineProperty(_defineProperty({}, TransformationType.CAMEL, _camelCase["default"]), TransformationType.UNDERSCORE, _snakeCase["default"]);
|
|
27
|
+
function parseJsonKeyNames(jsonObject, standard) {
|
|
28
|
+
if (_typeof(jsonObject) === 'object' && jsonObject !== null) {
|
|
29
|
+
if (Array.isArray(jsonObject)) {
|
|
30
|
+
var _iterator = _createForOfIteratorHelper(jsonObject),
|
|
31
|
+
_step;
|
|
32
|
+
try {
|
|
33
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
34
|
+
var item = _step.value;
|
|
35
|
+
parseJsonKeyNames(item, standard);
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
_iterator.e(err);
|
|
39
|
+
} finally {
|
|
40
|
+
_iterator.f();
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
var oldKeys = Object.keys(jsonObject);
|
|
44
|
+
for (var _i = 0, _oldKeys = oldKeys; _i < _oldKeys.length; _i++) {
|
|
45
|
+
var old = _oldKeys[_i];
|
|
46
|
+
var newKey = functionDict[standard](old);
|
|
47
|
+
if (newKey !== old) {
|
|
48
|
+
jsonObject[newKey] = jsonObject[old];
|
|
49
|
+
delete jsonObject[old];
|
|
50
|
+
parseJsonKeyNames(jsonObject[newKey], standard);
|
|
51
|
+
} else {
|
|
52
|
+
parseJsonKeyNames(jsonObject[old], standard);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return jsonObject;
|
|
58
|
+
}
|
|
59
|
+
function parseJsonKeyCamel(jsonObject) {
|
|
60
|
+
return parseJsonKeyNames(jsonObject, TransformationType.CAMEL);
|
|
61
|
+
}
|
|
62
|
+
function unpackRecursiveJsonIter(jsonObject, options, fileIndex) {
|
|
63
|
+
if (!options) options = {};
|
|
64
|
+
var result = options.existing || new FormData();
|
|
65
|
+
var prefix = options._prefix || '';
|
|
66
|
+
if (!fileIndex) fileIndex = {
|
|
67
|
+
value: 0
|
|
68
|
+
};
|
|
69
|
+
var appendData = function appendData(name, value) {
|
|
70
|
+
if (prefix) {
|
|
71
|
+
name = prefix + '-' + name;
|
|
72
|
+
}
|
|
73
|
+
if (value !== undefined && value !== null) {
|
|
74
|
+
result.set(name, value.toString()); // Convert to string since FormData accepts only strings or Blobs.
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var processSingleEntityProperty = function processSingleEntityProperty(key, value) {
|
|
78
|
+
var innerPrefix = key + '-0';
|
|
79
|
+
if (prefix) {
|
|
80
|
+
innerPrefix = prefix + '-' + innerPrefix;
|
|
81
|
+
}
|
|
82
|
+
unpackRecursiveJsonIter(value, {
|
|
83
|
+
existing: result,
|
|
84
|
+
_prefix: innerPrefix
|
|
85
|
+
}, fileIndex);
|
|
86
|
+
appendData(key + '-count', '1');
|
|
87
|
+
};
|
|
88
|
+
var _loop = function _loop(_key) {
|
|
89
|
+
if ([undefined, '', null].includes(jsonObject[_key]) || _key === 'rights') {
|
|
90
|
+
return 1; // continue
|
|
91
|
+
}
|
|
92
|
+
if (Array.isArray(jsonObject[_key])) {
|
|
93
|
+
jsonObject[_key].forEach(function (item, index) {
|
|
94
|
+
if ((_typeof(item) === "object" || Array.isArray(item)) && item !== null) {
|
|
95
|
+
var arrayPrefix = prefix ? "".concat(prefix, "-").concat(_key, "-").concat(index) : "".concat(_key, "-").concat(index);
|
|
96
|
+
unpackRecursiveJsonIter(item, {
|
|
97
|
+
existing: result,
|
|
98
|
+
_prefix: arrayPrefix
|
|
99
|
+
}, fileIndex);
|
|
100
|
+
} else {
|
|
101
|
+
appendData("".concat(_key, "-").concat(index), item);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
appendData(_key + '-count', jsonObject[_key].length.toString());
|
|
105
|
+
} else if (_typeof(jsonObject[_key]) === "object" && jsonObject[_key] !== null) {
|
|
106
|
+
processSingleEntityProperty(_key, jsonObject[_key]);
|
|
107
|
+
} else {
|
|
108
|
+
appendData(_key, jsonObject[_key]);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
for (var _key in jsonObject) {
|
|
112
|
+
if (_loop(_key)) continue;
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
function encodeMerchiApiData(dataDict) {
|
|
117
|
+
var dataJson = parseJsonKeyCamel(dataDict);
|
|
118
|
+
return unpackRecursiveJsonIter(dataJson);
|
|
119
|
+
}
|
|
120
|
+
var supportedNumbers = {
|
|
121
|
+
AU: 'Australia (+61)',
|
|
122
|
+
AE: 'United Arab Emirates (+971)',
|
|
123
|
+
BH: 'Bahrain (+973)',
|
|
124
|
+
CN: 'China (+86)',
|
|
125
|
+
DK: 'Denmark (+45)',
|
|
126
|
+
ES: 'Spain (+34)',
|
|
127
|
+
FR: 'France (+33)',
|
|
128
|
+
GB: 'United Kingdom (+44)',
|
|
129
|
+
HK: 'Hong Kong (+852)',
|
|
130
|
+
ID: 'Indonesia (+62)',
|
|
131
|
+
IN: 'India (+91)',
|
|
132
|
+
IT: 'Italy (+39)',
|
|
133
|
+
KR: 'South Korea (+82)',
|
|
134
|
+
NC: 'New Caledonia (+687)',
|
|
135
|
+
NZ: 'New Zealand (+64)',
|
|
136
|
+
OM: 'Oman (+968)',
|
|
137
|
+
PH: 'Philippines (+63)',
|
|
138
|
+
PT: 'Portugal (+351)',
|
|
139
|
+
QA: 'Qatar (+974)',
|
|
140
|
+
SE: 'Sweden (+46)',
|
|
141
|
+
SG: 'Singapore (+65)',
|
|
142
|
+
TH: 'Thailand (+66)',
|
|
143
|
+
US: 'United States (+1)',
|
|
144
|
+
ZA: 'South Africa (+27)'
|
|
145
|
+
};
|
|
146
|
+
var phoneOptions = exports.phoneOptions = Object.keys(supportedNumbers).map(function (key) {
|
|
147
|
+
return {
|
|
148
|
+
value: key,
|
|
149
|
+
label: supportedNumbers[key]
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
function appendStyleSheetText(css, callback) {
|
|
153
|
+
if (document && document !== undefined) {
|
|
154
|
+
var newStyleSheet = document.createElement('style');
|
|
155
|
+
newStyleSheet.textContent = css;
|
|
156
|
+
if (callback) {
|
|
157
|
+
newStyleSheet.onload = callback;
|
|
158
|
+
}
|
|
159
|
+
document.head.appendChild(newStyleSheet);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
var optionsEmbed = {
|
|
163
|
+
options: {
|
|
164
|
+
linkedFile: {},
|
|
165
|
+
variationCostDiscountGroup: {},
|
|
166
|
+
variationUnitCostDiscountGroup: {}
|
|
167
|
+
},
|
|
168
|
+
variationCostDiscountGroup: {},
|
|
169
|
+
variationUnitCostDiscountGroup: {}
|
|
170
|
+
};
|
|
171
|
+
var variationsEmbed = {
|
|
172
|
+
selectedOptions: {},
|
|
173
|
+
variationField: optionsEmbed,
|
|
174
|
+
variationFiles: {}
|
|
175
|
+
};
|
|
176
|
+
var variationsGroupsEmbed = {
|
|
177
|
+
variations: variationsEmbed
|
|
178
|
+
};
|
|
179
|
+
var productWithImagesEmbed = {
|
|
180
|
+
domain: {
|
|
181
|
+
company: {
|
|
182
|
+
defaultTaxType: {},
|
|
183
|
+
taxTypes: {}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
featureImage: {},
|
|
187
|
+
groupVariationFields: {
|
|
188
|
+
options: {
|
|
189
|
+
linkedFile: {}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
images: {},
|
|
193
|
+
independentVariationFields: {
|
|
194
|
+
options: {
|
|
195
|
+
linkedFile: {}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
// Published custom form pointer for cart-item edit (same shape as product embed).
|
|
199
|
+
productForm: {
|
|
200
|
+
activeVersion: {}
|
|
201
|
+
},
|
|
202
|
+
taxType: {}
|
|
203
|
+
};
|
|
204
|
+
var cartShipmentQuote = {
|
|
205
|
+
shipmentMethod: {
|
|
206
|
+
originAddress: {},
|
|
207
|
+
taxType: {}
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
var cartEmbed = exports.cartEmbed = {
|
|
211
|
+
cartItems: {
|
|
212
|
+
product: productWithImagesEmbed,
|
|
213
|
+
taxType: {},
|
|
214
|
+
variations: variationsEmbed,
|
|
215
|
+
variationsGroups: variationsGroupsEmbed
|
|
216
|
+
},
|
|
217
|
+
client: {
|
|
218
|
+
emailAddresses: {},
|
|
219
|
+
phoneNumbers: {},
|
|
220
|
+
profilePicture: {}
|
|
221
|
+
},
|
|
222
|
+
clientCompany: {},
|
|
223
|
+
discountItems: {},
|
|
224
|
+
domain: {
|
|
225
|
+
company: {
|
|
226
|
+
defaultTaxType: {},
|
|
227
|
+
isStripeAccountEnabled: {},
|
|
228
|
+
taxTypes: {}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
invoice: {},
|
|
232
|
+
receiverAddress: {},
|
|
233
|
+
shipmentGroups: {
|
|
234
|
+
cartItems: {
|
|
235
|
+
product: {}
|
|
236
|
+
},
|
|
237
|
+
quotes: cartShipmentQuote,
|
|
238
|
+
selectedQuote: cartShipmentQuote
|
|
239
|
+
}
|
|
240
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './address';
|
|
2
|
+
export * from './cart';
|
|
3
|
+
export * from './company';
|
|
4
|
+
export * from './cookie';
|
|
5
|
+
export * from './currency';
|
|
6
|
+
export * from './helpers';
|
|
7
|
+
export * from './invoice';
|
|
8
|
+
export * from './job';
|
|
9
|
+
export * from './local_storage';
|
|
10
|
+
export * from './product';
|
|
11
|
+
export * from './shipment';
|
|
12
|
+
export * from './tabs';
|
|
13
|
+
export * from './user';
|
|
14
|
+
export * from './variations';
|