@sezzle/sezzle-react-widget 2.0.0
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/README.md +82 -0
- package/dist/index.es.js +473 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +477 -0
- package/dist/index.js.map +1 -0
- package/package.json +70 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
[]()
|
|
2
|
+
|
|
3
|
+
`sezzle-react-widget` is a react based component to render Sezzle's widget on react platforms.
|
|
4
|
+
|
|
5
|
+
# Usage
|
|
6
|
+
______________________________________________________________________
|
|
7
|
+
`var SezzleWidget = require('sezzle-react-widget')`
|
|
8
|
+
|
|
9
|
+
If you use ES modules:
|
|
10
|
+
|
|
11
|
+
`import SezzleWidget from 'sezzle-react-widget'`
|
|
12
|
+
|
|
13
|
+
# Available Props
|
|
14
|
+
______________________________________________________________________
|
|
15
|
+
- **{price} (Required)**
|
|
16
|
+
- Type: String
|
|
17
|
+
|
|
18
|
+
- **{merchantId} (Required)**
|
|
19
|
+
- Purpose: Site's 36-character Merchant ID, found in the Business Settings of Sezzle Merchant Dashboard.
|
|
20
|
+
- Type: String
|
|
21
|
+
|
|
22
|
+
- **{theme}** (Optional)
|
|
23
|
+
- Purpose: To control the Sezzle image variant. Use light or black-flat for light backgrounds, dark or white-flat for dark backgrounds.
|
|
24
|
+
- Type: String
|
|
25
|
+
- Options: light, dark, white-flat, black-flat
|
|
26
|
+
- Default: light
|
|
27
|
+
|
|
28
|
+
- **{alignment}** (Optional)
|
|
29
|
+
- Type: String
|
|
30
|
+
- Options: auto, left, center, right
|
|
31
|
+
- Default: auto
|
|
32
|
+
|
|
33
|
+
- **{fontWeight}** (Optional)
|
|
34
|
+
- Type: Number
|
|
35
|
+
- Default: 500
|
|
36
|
+
|
|
37
|
+
- **{fontFamily}** (Optional)
|
|
38
|
+
- Type: String
|
|
39
|
+
- Default: inherit
|
|
40
|
+
|
|
41
|
+
- **{fontSize}** (Optional)
|
|
42
|
+
- Type: Number
|
|
43
|
+
- Default: 14
|
|
44
|
+
|
|
45
|
+
- **{textColor}** (Optional)
|
|
46
|
+
- Type: String
|
|
47
|
+
- Default: inherit
|
|
48
|
+
|
|
49
|
+
- **{logoSize}** (Optional)
|
|
50
|
+
- Purpose: To scale the logo (1 = 100%)
|
|
51
|
+
- Type: Number
|
|
52
|
+
- Default: 1
|
|
53
|
+
|
|
54
|
+
- **{includeAPModal}** (Optional)
|
|
55
|
+
- Purpose: To enable Afterpay's logo within the Sezzle widget
|
|
56
|
+
- Type: Boolean
|
|
57
|
+
- Default: false
|
|
58
|
+
|
|
59
|
+
- **{minPrice}** (Optional)
|
|
60
|
+
- Purpose to display a checkout minimum within the Sezzle widget
|
|
61
|
+
- Type: Number
|
|
62
|
+
- Default: 0
|
|
63
|
+
|
|
64
|
+
# Example
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
<SezzleWidget config={
|
|
68
|
+
{
|
|
69
|
+
price: '$29.99',
|
|
70
|
+
merchantId: '12a34bc5-6de7-890f-g123-4hi5678jk901',
|
|
71
|
+
theme: 'light',
|
|
72
|
+
alignment: 'auto',
|
|
73
|
+
fontWeight: '500',
|
|
74
|
+
fontFamily: 'inherit',
|
|
75
|
+
fontSize: 14,
|
|
76
|
+
textColor: 'inherit',
|
|
77
|
+
logoSize: 1,
|
|
78
|
+
includeAPModal: true,
|
|
79
|
+
minPrice: 35
|
|
80
|
+
}
|
|
81
|
+
}/>
|
|
82
|
+
```
|
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This function will return the price string
|
|
6
|
+
* @param price - string value
|
|
7
|
+
* @return string
|
|
8
|
+
*/
|
|
9
|
+
function parsePriceString(price) {
|
|
10
|
+
var formattedPrice = '';
|
|
11
|
+
if (!price) return formattedPrice;
|
|
12
|
+
for (var i = 0; i < price.length; i++) {
|
|
13
|
+
if (isNumeric(price[i]) || price[i] === '.' || price[i] === ',') {
|
|
14
|
+
// Ignore actual sentence punctuation
|
|
15
|
+
if (i > 0 && price[i] === '.' && isAlphabet(price[i - 1])) continue;
|
|
16
|
+
|
|
17
|
+
formattedPrice += price[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return formattedPrice;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Function parses the price from string to float
|
|
25
|
+
* @param price -> String
|
|
26
|
+
* @return float
|
|
27
|
+
*/
|
|
28
|
+
function parsePrice(price) {
|
|
29
|
+
return parseFloat(parsePriceString(price));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This is helper function for formatPrice
|
|
34
|
+
* @param n char value
|
|
35
|
+
* @return boolean [if it's numeric or not]
|
|
36
|
+
*/
|
|
37
|
+
function isNumeric(n) {
|
|
38
|
+
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* This is helper function for formatPrice
|
|
43
|
+
* @param n char value
|
|
44
|
+
* @return boolean [if it's alphabet or not]
|
|
45
|
+
*/
|
|
46
|
+
function isAlphabet(n) {
|
|
47
|
+
return (/^[a-zA-Z()]+$/.test(n)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getFormattedPrice(price, numberOfPayments) {
|
|
52
|
+
var priceString = parsePriceString(price);
|
|
53
|
+
var priceReplacer = parsePrice(price);
|
|
54
|
+
|
|
55
|
+
var formatter = price.replace(priceString, '{price}');
|
|
56
|
+
|
|
57
|
+
var sezzleInstallmentPrice = (priceReplacer / numberOfPayments).toFixed(2);
|
|
58
|
+
|
|
59
|
+
var sezzleInstallmentFormattedPrice = formatter.replace('{price}', sezzleInstallmentPrice);
|
|
60
|
+
|
|
61
|
+
return sezzleInstallmentFormattedPrice;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var modalEnglishHTML = "\n<style>@import url(\"https://fonts.googleapis.com/css?family=Comfortaa\");\n@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@600&display=swap\");\n.sezzle-modal-open {\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n}\n\n.sezzle-checkout-modal-hidden {\n width: 100%;\n height: 100%;\n -webkit-font-smoothing: antialiased;\n transition: all 0.4s ease;\n margin-top: 0;\n}\n@media screen and (min-width: 0px) and (max-width: 280px) {\n .sezzle-checkout-modal-hidden {\n display: none;\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n position: absolute;\n box-shadow: 0 10px 20px rgba(5, 31, 52, 0.19), 0 6px 6px rgba(5, 31, 52, 0.2);\n height: auto;\n max-height: 90%;\n width: 343px;\n color: #000000;\n font-family: Comfortaa, \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n background-color: #fff;\n overflow: auto;\n padding: 20px 0;\n border-radius: 10px;\n box-sizing: border-box;\n}\n@media screen and (max-width: 374px) {\n .sezzle-checkout-modal-hidden .sezzle-modal {\n transform: scale(0.9) translate(-55%, -55%);\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal {\n position: absolute;\n right: 16px;\n top: 16px;\n width: 24px;\n height: 24px;\n opacity: 0.2;\n cursor: pointer;\n padding: 0;\n outline: 0;\n background: 0 0;\n border: none;\n box-shadow: none;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal:hover {\n opacity: 1;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal:focus {\n opacity: 0.5;\n}\n@media screen and (max-width: 600px) {\n .sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal {\n opacity: 0.8;\n }\n .sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal:focus {\n opacity: 1;\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal::before {\n position: absolute;\n left: 10px;\n content: \" \";\n top: 0;\n transform: rotate(45deg);\n background-color: #595959;\n width: 2px;\n height: 15px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal::after {\n position: absolute;\n left: 10px;\n content: \" \";\n top: 0;\n transform: rotate(-45deg);\n background-color: #595959;\n width: 2px;\n height: 15px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-logo {\n display: block;\n height: 24px;\n width: 98px;\n margin: 10px auto 0;\n background-image: url(https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg);\n background-repeat: no-repeat;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content {\n height: auto;\n text-align: center;\n padding: 0px 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-header {\n display: block;\n text-align: center;\n font-style: normal;\n font-size: 24px;\n font-weight: 700;\n line-height: 30px;\n font-family: \"Comfortaa\";\n color: #000000;\n margin-top: 24px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-row {\n text-align: center;\n font-style: normal;\n font-size: 15px;\n font-weight: 400;\n line-height: 20px;\n color: #000000;\n letter-spacing: -0.3px;\n margin: 16px auto;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay {\n display: flex;\n flex-direction: column;\n align-items: center;\n background: rgba(131, 51, 212, 0.05);\n border-radius: 16px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-row {\n text-align: center;\n font-style: normal;\n font-size: 14px;\n font-weight: 700;\n line-height: 16px;\n font-family: \"Comfortaa\";\n color: #000000;\n margin: 16px 0px 0px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 16px 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .due-today {\n display: flex;\n flex-direction: column;\n align-items: center;\n background: #FFFFFF;\n border: 1px solid #8333D4;\n border-radius: 8px;\n margin: 0px 4px;\n padding: 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .future-payments {\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #FFFFFF;\n border: 1px solid #8333D4;\n border-radius: 8px;\n margin: 0px 4px;\n padding: 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item :first-child {\n padding: 0px 6px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item .breakdown-row {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 0px;\n padding: 8px 0px 0px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item .breakdown-row .percentage {\n text-align: center;\n font-style: normal;\n font-size: 15px;\n font-weight: 600;\n line-height: 20px;\n color: #8333D4;\n font-family: \"Nunito Sans\";\n align-items: center;\n letter-spacing: -0.3px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item .breakdown-row .due {\n text-align: center;\n font-style: normal;\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n color: #5E5E5E;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-features {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-features .single-feature {\n text-align: center;\n font-style: normal;\n font-size: 17px;\n font-weight: 600;\n line-height: 22px;\n color: #000000;\n letter-spacing: -0.3px;\n margin: 8px auto;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo {\n font-size: 14px;\n color: #000000;\n}\n@media screen and (max-width: 600px) {\n .sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo {\n font-size: 12px;\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo::first-letter {\n text-transform: capitalize;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo a {\n color: #000000;\n text-decoration: underline;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo a:visited {\n color: #037269;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo a:hover {\n color: #af0fda;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .terms {\n text-align: center;\n font-style: normal;\n font-size: 11px;\n font-weight: 400;\n line-height: 13px;\n color: #5E5E5E;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal {\n background-image: none;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-logo {\n width: 98px;\n background-image: url(https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg);\n background-repeat: no-repeat;\n background-position: 50%;\n height: 24px;\n margin: 10px auto 20px auto;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content {\n height: auto;\n width: auto;\n text-align: center;\n padding: 0px 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-header {\n font-size: 24px;\n line-height: 30px;\n margin: 10px auto;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-row {\n font-size: 15px;\n line-height: 20px;\n margin: 8px auto;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments {\n height: fit-content;\n margin: 20px auto;\n padding: 20px 0 0;\n border: 1px solid #e5e5e5;\n border-radius: 5px;\n max-width: 502px;\n display: block;\n flex-direction: column;\n align-items: center;\n padding: 0px;\n gap: 24px;\n font-family: \"Nunito sans\";\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-header {\n font-family: \"Nunito Sans\";\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 20px;\n display: block;\n align-items: center;\n text-align: center;\n padding: 15px;\n letter-spacing: -0.3px;\n border-bottom: 1px solid #e5e5e5;\n color: #000000;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-header span {\n font-size: 17px;\n line-height: 22px;\n font-weight: 700;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options {\n font-size: 12px;\n line-height: 14px;\n margin: 0px 20px 0;\n padding: 20px 0px;\n border-bottom: 1px solid #e5e5e5;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan {\n display: flex;\n justify-content: space-between;\n padding-bottom: 10px;\n font-size: 12px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan .monthly-amount span {\n font-size: 17px;\n line-height: 22px;\n color: #8333D4;\n font-weight: 600;\n letter-spacing: -0.3px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan .monthly-amount .per-month {\n font-size: 13px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan .term-length {\n border-radius: 100px;\n background: rgba(41, 211, 162, 0.1);\n color: #00804A;\n padding: 2px 8px;\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details {\n display: flex;\n justify-content: space-between;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .adjusted-total {\n color: #5E5E5E;\n font-size: 12px;\n width: fit-content;\n text-align: left;\n font-weight: 400;\n line-height: 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .adjusted-total span {\n display: block;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .interest-amount {\n color: #5E5E5E;\n font-size: 12px;\n width: fit-content;\n text-align: left;\n font-weight: 400;\n line-height: 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .interest-amount span {\n display: block;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .sample-apr {\n color: #5E5E5E;\n font-size: 12px;\n width: fit-content;\n text-align: left;\n font-weight: 400;\n line-height: 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .sample-apr span {\n display: block;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments:last-child {\n border: none;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .details {\n font-size: 17px;\n line-height: 22px;\n margin: 16px auto;\n font-weight: 600;\n font-family: \"Nunito Sans\";\n letter-spacing: -0.3px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .terms {\n font-size: 11px;\n line-height: 13px;\n color: #5E5E5E;\n margin: 10px auto 0;\n padding: 24px 0 0;\n border-top: 1px solid #e5e5e5;\n text-align: center;\n font-family: \"Nunito Sans\";\n}</style>\n<section class=\"sezzle-checkout-modal-lightbox close-sezzle-modal\" role=\"dialog\" aria-label=\"Sezzle Information\" lang=\"en\" style=\"display: none; max-height: 100%;\"><div id=\"sezzle-modal-container\" role=\"dialog\" aria-label=\"Sezzle Modal\" aria-description=\"Learn more about Sezzle\" class=\"sezzle-checkout-modal-hidden\"><div class=\"sezzle-modal sezzle-checkout-modal-hidden\"><div><button role=\"button\" aria-label=\"Close Sezzle Modal\" class=\"close-sezzle-modal\"></button></div><div class=\"sezzle-logo\" title=\"Sezzle\"></div><div id=\"sezzle-modal-core-content\" class=\"sezzle-modal-content\">\n <header class=\"sezzle-header\">Buy Now. Pay Later.</header>\n <p class=\"sezzle-row\">Select Sezzle as your payment method at checkout.</p>\n\n <div class=\"sezzle-four-pay\">\n <p class=\"sezzle-row\">Split your order into 4 or more!</p>\n <div class=\"sezzle-pie-area\">\n <div class=\"due-today\">\n <div class=\"payment-item\">\n <div title=\"pie at 25%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\" fill-opacity=\"0.05\"></path>\n <path d=\"M20 -7.62939e-05C22.6264 -7.64088e-05 25.2272 0.51724 27.6537 1.52233C30.0802 2.52743 32.285 4.00062 34.1421 5.85779C35.9993 7.71496 37.4725 9.91974 38.4776 12.3463C39.4827 14.7728 40 17.3735 40 19.9999L30 19.9999C30 18.6867 29.7413 17.3863 29.2388 16.1731C28.7362 14.9598 27.9997 13.8574 27.0711 12.9289C26.1425 12.0003 25.0401 11.2637 23.8268 10.7611C22.6136 10.2586 21.3132 9.99992 20 9.99992L20 -7.62939e-05Z\" fill=\"#8333D4\"></path>\n <path d=\"M40 19.9999C40 22.7613 37.7614 24.9998 35 24.9998C32.2386 24.9998 30 22.7613 30 19.9999C30 17.2385 32.2386 14.9998 35 14.9998C37.7614 14.9998 40 17.2385 40 19.9999Z\" fill=\"#8333D4\"></path>\n <circle cx=\"35\" cy=\"20\" r=\"5\" fill=\"#8333D4\"></circle>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Today</span>\n </p>\n </div>\n </div>\n <div class=\"future-payments\">\n <div class=\"payment-item\">\n <div title=\"pie at 50%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\" fill-opacity=\"0.05\"></path>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M40 20C40 31.0457 31.0457 40 20 40C17.2386 40 15 37.7614 15 35C15 32.2386 17.2386 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10V0C31.0457 0 40 8.9543 40 20Z\" fill=\"#8333D4\"></path>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Week 2</span>\n </p>\n </div>\n <div class=\"payment-item\">\n <div title=\"pie at 75%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\" fill-opacity=\"0.05\"></path>\n <path d=\"M20 -8.74228e-07C23.9556 -1.04713e-06 27.8224 1.17298 31.1114 3.37061C34.4004 5.56824 36.9638 8.69181 38.4776 12.3463C39.9913 16.0009 40.3874 20.0222 39.6157 23.9018C38.844 27.7814 36.9392 31.3451 34.1421 34.1421C31.3451 36.9392 27.7814 38.844 23.9018 39.6157C20.0222 40.3874 16.0009 39.9913 12.3463 38.4776C8.69181 36.9638 5.56824 34.4004 3.37061 31.1114C1.17298 27.8224 -7.48492e-07 23.9556 -8.74228e-07 20L10 20C10 21.9778 10.5865 23.9112 11.6853 25.5557C12.7841 27.2002 14.3459 28.4819 16.1732 29.2388C18.0004 29.9957 20.0111 30.1937 21.9509 29.8079C23.8907 29.422 25.6725 28.4696 27.0711 27.0711C28.4696 25.6725 29.422 23.8907 29.8079 21.9509C30.1937 20.0111 29.9957 18.0004 29.2388 16.1732C28.4819 14.3459 27.2002 12.7841 25.5557 11.6853C23.9112 10.5865 21.9778 10 20 10L20 -8.74228e-07Z\" fill=\"#8333D4\"></path>\n <path d=\"M10 20C10 22.7614 7.76142 25 5 25C2.23858 25 -8.74228e-07 22.7614 -8.74228e-07 20C-8.74228e-07 17.2386 2.23858 15 5 15C7.76142 15 10 17.2386 10 20Z\" fill=\"#8333D4\"></path>\n <circle cx=\"5\" cy=\"20\" r=\"5\" fill=\"#8333D4\"></circle>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Week 4</span>\n </p>\n </div>\n <div class=\"payment-item\">\n <div title=\"pie at 100%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\"></path>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Week 6</span>\n </p>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"sezzle-features\">\n <p class=\"single-feature\">Build your credit with Sezzle*</p>\n <p class=\"single-feature\">Flexible payment options</p>\n <p class=\"single-feature\">Trusted by over 10 million consumers</p>\n </div>\n\n <p class=\"terms\">* Sezzle Up is a free credit reporting program shoppers can opt into to have payments reported to credit bureaus.</p>\n <p class=\"terms\">Subject to approval. First payment date and amount may fluctuate based on eligibility and time of merchant order completion.</p>\n </div></div></div>\n </section>\n\n";
|
|
65
|
+
|
|
66
|
+
var modalFrenchHTML = "\n<style>@import url(\"https://fonts.googleapis.com/css?family=Comfortaa\");\n@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@600&display=swap\");\n.sezzle-modal-open {\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n}\n\n.sezzle-checkout-modal-hidden {\n width: 100%;\n height: 100%;\n -webkit-font-smoothing: antialiased;\n transition: all 0.4s ease;\n margin-top: 0;\n}\n@media screen and (min-width: 0px) and (max-width: 280px) {\n .sezzle-checkout-modal-hidden {\n display: none;\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n position: absolute;\n box-shadow: 0 10px 20px rgba(5, 31, 52, 0.19), 0 6px 6px rgba(5, 31, 52, 0.2);\n height: auto;\n max-height: 90%;\n width: 343px;\n color: #000000;\n font-family: Comfortaa, \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n background-color: #fff;\n overflow: auto;\n padding: 20px 0;\n border-radius: 10px;\n box-sizing: border-box;\n}\n@media screen and (max-width: 374px) {\n .sezzle-checkout-modal-hidden .sezzle-modal {\n transform: scale(0.9) translate(-55%, -55%);\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal {\n position: absolute;\n right: 16px;\n top: 16px;\n width: 24px;\n height: 24px;\n opacity: 0.2;\n cursor: pointer;\n padding: 0;\n outline: 0;\n background: 0 0;\n border: none;\n box-shadow: none;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal:hover {\n opacity: 1;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal:focus {\n opacity: 0.5;\n}\n@media screen and (max-width: 600px) {\n .sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal {\n opacity: 0.8;\n }\n .sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal:focus {\n opacity: 1;\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal::before {\n position: absolute;\n left: 10px;\n content: \" \";\n top: 0;\n transform: rotate(45deg);\n background-color: #595959;\n width: 2px;\n height: 15px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal div button.close-sezzle-modal::after {\n position: absolute;\n left: 10px;\n content: \" \";\n top: 0;\n transform: rotate(-45deg);\n background-color: #595959;\n width: 2px;\n height: 15px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-logo {\n display: block;\n height: 24px;\n width: 98px;\n margin: 10px auto 0;\n background-image: url(https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg);\n background-repeat: no-repeat;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content {\n height: auto;\n text-align: center;\n padding: 0px 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-header {\n display: block;\n text-align: center;\n font-style: normal;\n font-size: 24px;\n font-weight: 700;\n line-height: 30px;\n font-family: \"Comfortaa\";\n color: #000000;\n margin-top: 24px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-row {\n text-align: center;\n font-style: normal;\n font-size: 15px;\n font-weight: 400;\n line-height: 20px;\n color: #000000;\n letter-spacing: -0.3px;\n margin: 16px auto;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay {\n display: flex;\n flex-direction: column;\n align-items: center;\n background: rgba(131, 51, 212, 0.05);\n border-radius: 16px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-row {\n text-align: center;\n font-style: normal;\n font-size: 14px;\n font-weight: 700;\n line-height: 16px;\n font-family: \"Comfortaa\";\n color: #000000;\n margin: 16px 0px 0px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding: 16px 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .due-today {\n display: flex;\n flex-direction: column;\n align-items: center;\n background: #FFFFFF;\n border: 1px solid #8333D4;\n border-radius: 8px;\n margin: 0px 4px;\n padding: 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .future-payments {\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #FFFFFF;\n border: 1px solid #8333D4;\n border-radius: 8px;\n margin: 0px 4px;\n padding: 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item :first-child {\n padding: 0px 6px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item .breakdown-row {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 0px;\n padding: 8px 0px 0px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item .breakdown-row .percentage {\n text-align: center;\n font-style: normal;\n font-size: 15px;\n font-weight: 600;\n line-height: 20px;\n color: #8333D4;\n font-family: \"Nunito Sans\";\n align-items: center;\n letter-spacing: -0.3px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-four-pay .sezzle-pie-area .payment-item .breakdown-row .due {\n text-align: center;\n font-style: normal;\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n color: #5E5E5E;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-features {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 8px;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .sezzle-features .single-feature {\n text-align: center;\n font-style: normal;\n font-size: 17px;\n font-weight: 600;\n line-height: 22px;\n color: #000000;\n letter-spacing: -0.3px;\n margin: 8px auto;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo {\n font-size: 14px;\n color: #000000;\n}\n@media screen and (max-width: 600px) {\n .sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo {\n font-size: 12px;\n }\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo::first-letter {\n text-transform: capitalize;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo a {\n color: #000000;\n text-decoration: underline;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo a:visited {\n color: #037269;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .promo a:hover {\n color: #af0fda;\n}\n.sezzle-checkout-modal-hidden .sezzle-modal .sezzle-modal-content .terms {\n text-align: center;\n font-style: normal;\n font-size: 11px;\n font-weight: 400;\n line-height: 13px;\n color: #5E5E5E;\n font-family: \"Nunito Sans\";\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal {\n background-image: none;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-logo {\n width: 98px;\n background-image: url(https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg);\n background-repeat: no-repeat;\n background-position: 50%;\n height: 24px;\n margin: 10px auto 20px auto;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content {\n height: auto;\n width: auto;\n text-align: center;\n padding: 0px 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-header {\n font-size: 24px;\n line-height: 30px;\n margin: 10px auto;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-row {\n font-size: 15px;\n line-height: 20px;\n margin: 8px auto;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments {\n height: fit-content;\n margin: 20px auto;\n padding: 20px 0 0;\n border: 1px solid #e5e5e5;\n border-radius: 5px;\n max-width: 502px;\n display: block;\n flex-direction: column;\n align-items: center;\n padding: 0px;\n gap: 24px;\n font-family: \"Nunito sans\";\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-header {\n font-family: \"Nunito Sans\";\n font-style: normal;\n font-weight: 600;\n font-size: 15px;\n line-height: 20px;\n display: block;\n align-items: center;\n text-align: center;\n padding: 15px;\n letter-spacing: -0.3px;\n border-bottom: 1px solid #e5e5e5;\n color: #000000;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-header span {\n font-size: 17px;\n line-height: 22px;\n font-weight: 700;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options {\n font-size: 12px;\n line-height: 14px;\n margin: 0px 20px 0;\n padding: 20px 0px;\n border-bottom: 1px solid #e5e5e5;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan {\n display: flex;\n justify-content: space-between;\n padding-bottom: 10px;\n font-size: 12px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan .monthly-amount span {\n font-size: 17px;\n line-height: 22px;\n color: #8333D4;\n font-weight: 600;\n letter-spacing: -0.3px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan .monthly-amount .per-month {\n font-size: 13px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan .term-length {\n border-radius: 100px;\n background: rgba(41, 211, 162, 0.1);\n color: #00804A;\n padding: 2px 8px;\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details {\n display: flex;\n justify-content: space-between;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .adjusted-total {\n color: #5E5E5E;\n font-size: 12px;\n width: fit-content;\n text-align: left;\n font-weight: 400;\n line-height: 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .adjusted-total span {\n display: block;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .interest-amount {\n color: #5E5E5E;\n font-size: 12px;\n width: fit-content;\n text-align: left;\n font-weight: 400;\n line-height: 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .interest-amount span {\n display: block;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .sample-apr {\n color: #5E5E5E;\n font-size: 12px;\n width: fit-content;\n text-align: left;\n font-weight: 400;\n line-height: 16px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments .sezzle-lt-payment-options .plan-details .sample-apr span {\n display: block;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .sezzle-lt-payments:last-child {\n border: none;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .details {\n font-size: 17px;\n line-height: 22px;\n margin: 16px auto;\n font-weight: 600;\n font-family: \"Nunito Sans\";\n letter-spacing: -0.3px;\n}\n.sezzle-checkout-modal-hidden.long-term .sezzle-modal .sezzle-modal-content .terms {\n font-size: 11px;\n line-height: 13px;\n color: #5E5E5E;\n margin: 10px auto 0;\n padding: 24px 0 0;\n border-top: 1px solid #e5e5e5;\n text-align: center;\n font-family: \"Nunito Sans\";\n}</style>\n<section class=\"sezzle-checkout-modal-lightbox close-sezzle-modal\" role=\"dialog\" aria-label=\"Sezzle Information\" lang=\"en\" style=\"display: none; max-height: 100%;\"><div id=\"sezzle-modal-container\" role=\"dialog\" aria-label=\"Sezzle Modal\" aria-description=\"Learn more about Sezzle\" class=\"sezzle-checkout-modal-hidden\"><div class=\"sezzle-modal sezzle-checkout-modal-hidden\"><div><button role=\"button\" aria-label=\"Close Sezzle Modal\" class=\"close-sezzle-modal\"></button></div><div class=\"sezzle-logo\" title=\"Sezzle\"></div><div id=\"sezzle-modal-core-content\" class=\"sezzle-modal-content\">\n <header class=\"sezzle-header\">Acheter maintenant. Payer plus tard.</header>\n <p class=\"sezzle-row\">S\xE9lectionnez Sezzle comme mode de paiement lors du paiement.</p>\n\n <div class=\"sezzle-four-pay\">\n <p class=\"sezzle-row\">Divisez votre commande en 4 ou plus !</p>\n <div class=\"sezzle-pie-area\">\n <div class=\"due-today\">\n <div class=\"payment-item\">\n <div title=\"graphique circulaire \xE0 25%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\" fill-opacity=\"0.05\"></path>\n <path d=\"M20 -7.62939e-05C22.6264 -7.64088e-05 25.2272 0.51724 27.6537 1.52233C30.0802 2.52743 32.285 4.00062 34.1421 5.85779C35.9993 7.71496 37.4725 9.91974 38.4776 12.3463C39.4827 14.7728 40 17.3735 40 19.9999L30 19.9999C30 18.6867 29.7413 17.3863 29.2388 16.1731C28.7362 14.9598 27.9997 13.8574 27.0711 12.9289C26.1425 12.0003 25.0401 11.2637 23.8268 10.7611C22.6136 10.2586 21.3132 9.99992 20 9.99992L20 -7.62939e-05Z\" fill=\"#8333D4\"></path>\n <path d=\"M40 19.9999C40 22.7613 37.7614 24.9998 35 24.9998C32.2386 24.9998 30 22.7613 30 19.9999C30 17.2385 32.2386 14.9998 35 14.9998C37.7614 14.9998 40 17.2385 40 19.9999Z\" fill=\"#8333D4\"></path>\n <circle cx=\"35\" cy=\"20\" r=\"5\" fill=\"#8333D4\"></circle>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Aujourd'hui</span>\n </p>\n </div>\n </div>\n <div class=\"future-payments\">\n <div class=\"payment-item\">\n <div title=\"graphique circulaire \xE0 50%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\" fill-opacity=\"0.05\"></path>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M40 20C40 31.0457 31.0457 40 20 40C17.2386 40 15 37.7614 15 35C15 32.2386 17.2386 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10V0C31.0457 0 40 8.9543 40 20Z\" fill=\"#8333D4\"></path>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Semaine 2</span>\n </p>\n </div>\n <div class=\"payment-item\">\n <div title=\"graphique circulaire \xE0 75%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\" fill-opacity=\"0.05\"></path>\n <path d=\"M20 -8.74228e-07C23.9556 -1.04713e-06 27.8224 1.17298 31.1114 3.37061C34.4004 5.56824 36.9638 8.69181 38.4776 12.3463C39.9913 16.0009 40.3874 20.0222 39.6157 23.9018C38.844 27.7814 36.9392 31.3451 34.1421 34.1421C31.3451 36.9392 27.7814 38.844 23.9018 39.6157C20.0222 40.3874 16.0009 39.9913 12.3463 38.4776C8.69181 36.9638 5.56824 34.4004 3.37061 31.1114C1.17298 27.8224 -7.48492e-07 23.9556 -8.74228e-07 20L10 20C10 21.9778 10.5865 23.9112 11.6853 25.5557C12.7841 27.2002 14.3459 28.4819 16.1732 29.2388C18.0004 29.9957 20.0111 30.1937 21.9509 29.8079C23.8907 29.422 25.6725 28.4696 27.0711 27.0711C28.4696 25.6725 29.422 23.8907 29.8079 21.9509C30.1937 20.0111 29.9957 18.0004 29.2388 16.1732C28.4819 14.3459 27.2002 12.7841 25.5557 11.6853C23.9112 10.5865 21.9778 10 20 10L20 -8.74228e-07Z\" fill=\"#8333D4\"></path>\n <path d=\"M10 20C10 22.7614 7.76142 25 5 25C2.23858 25 -8.74228e-07 22.7614 -8.74228e-07 20C-8.74228e-07 17.2386 2.23858 15 5 15C7.76142 15 10 17.2386 10 20Z\" fill=\"#8333D4\"></path>\n <circle cx=\"5\" cy=\"20\" r=\"5\" fill=\"#8333D4\"></circle>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Semaine 4</span>\n </p>\n </div>\n <div class=\"payment-item\">\n <div title=\"graphique circulaire \xE0 100%\">\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M40 20C40 31.0457 31.0457 40 20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20ZM10 20C10 25.5228 14.4772 30 20 30C25.5228 30 30 25.5228 30 20C30 14.4772 25.5228 10 20 10C14.4772 10 10 14.4772 10 20Z\" fill=\"#8333D4\"></path>\n </svg>\n </div>\n <p class=\"breakdown-row\">\n <span class=\"percentage\">25%</span>\n <span class=\"due\">Semaine 6</span>\n </p>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"sezzle-features\">\n <p class=\"single-feature\">Construisez votre cr\xE9dit avec Sezzle*</p>\n <p class=\"single-feature\">Options de paiement flexibles</p>\n <p class=\"single-feature\">Reconnu par plus de 10 millions de consommateurs</p>\n </div>\n\n <p class=\"terms\">* Sezzle Up est un programme gratuit d'\xE9valuation du cr\xE9dit auquel les acheteurs peuvent opter pour que les paiements soient signal\xE9s aux bureaux de cr\xE9dit.</p>\n <p class=\"terms\">Soumis \xE0 l'approbation. La date et le montant du premier paiement peuvent varier en fonction de l'\xE9ligibilit\xE9 et de l'heure \xE0 laquelle la commande du marchand est termin\xE9e.</p>\n </div></div></div></section>\n";
|
|
67
|
+
|
|
68
|
+
var apModalHTML = '<div id="afterpay-popup-wrapper" style="position: fixed; z-index: 2147483647; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: auto;"><div id="afterpay-popup-outer" style="display: flex; place-content: center; align-items: center; width: 100%; min-height: 100%; background-color: rgba(0, 0, 0, 0.8);"><div id="afterpay-popup-inner" style="position: relative; background-color: rgb(255, 255, 255);"><a href="https://www.afterpay.com/purchase-payment-agreement" target="_blank" style="display: block;"><img src="https://static.afterpay.com/us-popup-medium.png" srcset="https://static.afterpay.com/us-popup-medium.png 1x, https://static.afterpay.com/us-popup-medium@2x.png 2x" style="max-width: 597px; display: block; width: 100%;"></a><a href="#" style="position: absolute; right: 8px; top: 8px;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" version="1.1" width="32px" height="32px"><g id="surface1"><path style=" " d="M 16 3 C 8.832031 3 3 8.832031 3 16 C 3 23.167969 8.832031 29 16 29 C 23.167969 29 29 23.167969 29 16 C 29 8.832031 23.167969 3 16 3 Z M 16 5 C 22.085938 5 27 9.914063 27 16 C 27 22.085938 22.085938 27 16 27 C 9.914063 27 5 22.085938 5 16 C 5 9.914063 9.914063 5 16 5 Z M 12.21875 10.78125 L 10.78125 12.21875 L 14.5625 16 L 10.78125 19.78125 L 12.21875 21.21875 L 16 17.4375 L 19.78125 21.21875 L 21.21875 19.78125 L 17.4375 16 L 21.21875 12.21875 L 19.78125 10.78125 L 16 14.5625 Z "></path></g></svg></a></div></div></div>';
|
|
69
|
+
|
|
70
|
+
var classCallCheck = function (instance, Constructor) {
|
|
71
|
+
if (!(instance instanceof Constructor)) {
|
|
72
|
+
throw new TypeError("Cannot call a class as a function");
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var createClass = function () {
|
|
77
|
+
function defineProperties(target, props) {
|
|
78
|
+
for (var i = 0; i < props.length; i++) {
|
|
79
|
+
var descriptor = props[i];
|
|
80
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
81
|
+
descriptor.configurable = true;
|
|
82
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
83
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return function (Constructor, protoProps, staticProps) {
|
|
88
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
89
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
90
|
+
return Constructor;
|
|
91
|
+
};
|
|
92
|
+
}();
|
|
93
|
+
|
|
94
|
+
var _extends = Object.assign || function (target) {
|
|
95
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
96
|
+
var source = arguments[i];
|
|
97
|
+
|
|
98
|
+
for (var key in source) {
|
|
99
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
100
|
+
target[key] = source[key];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return target;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var inherits = function (subClass, superClass) {
|
|
109
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
110
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
114
|
+
constructor: {
|
|
115
|
+
value: subClass,
|
|
116
|
+
enumerable: false,
|
|
117
|
+
writable: true,
|
|
118
|
+
configurable: true
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var possibleConstructorReturn = function (self, call) {
|
|
125
|
+
if (!self) {
|
|
126
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
var Modal = function (_React$Component) {
|
|
133
|
+
inherits(Modal, _React$Component);
|
|
134
|
+
|
|
135
|
+
function Modal(props) {
|
|
136
|
+
classCallCheck(this, Modal);
|
|
137
|
+
|
|
138
|
+
var _this = possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, props));
|
|
139
|
+
|
|
140
|
+
_this.toggleModalVisibility = function (isModalVisible) {
|
|
141
|
+
isModalVisible ? _this.setState({ modalElement: { style: { display: 'block' } } }) : _this.setState({ modalElement: { style: { display: 'none' } } });
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
_this.modalCloseHandler = function (event) {
|
|
145
|
+
_this.props.callbackModalClose(_this.props.modalType);
|
|
146
|
+
_this.setState({ modalElement: { style: { display: 'none' } } });
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
_this.state = {
|
|
150
|
+
modalElement: null
|
|
151
|
+
};
|
|
152
|
+
return _this;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
createClass(Modal, [{
|
|
156
|
+
key: 'componentDidMount',
|
|
157
|
+
value: function componentDidMount() {
|
|
158
|
+
var _this2 = this;
|
|
159
|
+
|
|
160
|
+
document.querySelector('html').appendChild(this.state.modalElement);
|
|
161
|
+
|
|
162
|
+
var sezzleModal = void 0;
|
|
163
|
+
if (this.props.modalType === 'afterpay') {
|
|
164
|
+
sezzleModal = document.querySelector('.sezzle-ap-modal');
|
|
165
|
+
} else {
|
|
166
|
+
sezzleModal = document.querySelector('.sezzle-modal');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
sezzleModal.addEventListener('click', function (event) {
|
|
170
|
+
return event.stopPropagation();
|
|
171
|
+
});
|
|
172
|
+
document.querySelectorAll('.close-sezzle-modal').length && document.querySelectorAll('.close-sezzle-modal').forEach(function (modal) {
|
|
173
|
+
return modal.addEventListener('click', function (event) {
|
|
174
|
+
return _this2.modalCloseHandler(event);
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
key: 'componentDidUpdate',
|
|
180
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
181
|
+
this.toggleModalVisibility(this.props.toggleModalVisibility);
|
|
182
|
+
}
|
|
183
|
+
}, {
|
|
184
|
+
key: 'componentWillUnmount',
|
|
185
|
+
value: function componentWillUnmount() {
|
|
186
|
+
var modals = document.querySelector('html').getElementsByClassName('sezzle-checkout-modal-lightbox');
|
|
187
|
+
for (var i = 0; i < modals.length; i++) {
|
|
188
|
+
document.querySelector('html').removeChild(modals[i]);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}, {
|
|
192
|
+
key: 'render',
|
|
193
|
+
value: function render() {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}], [{
|
|
197
|
+
key: 'getDerivedStateFromProps',
|
|
198
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
199
|
+
if (state.modalElement) return state;
|
|
200
|
+
var modalElement = void 0;
|
|
201
|
+
switch (props.modalType) {
|
|
202
|
+
case 'afterpay':
|
|
203
|
+
modalElement = document.createElement('div');
|
|
204
|
+
modalElement.className = 'sezzle-checkout-modal-lightbox close-sezzle-modal sezzle-ap-modal';
|
|
205
|
+
modalElement.innerHTML = apModalHTML;
|
|
206
|
+
modalElement.style.display = 'none';
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
modalElement = document.createElement('div');
|
|
210
|
+
modalElement.className = 'sezzle-checkout-modal-lightbox close-sezzle-modal';
|
|
211
|
+
modalElement.innerHTML = document.querySelector('html').lang && document.querySelector('html').lang.substring(0, 2).toLowerCase() === "fr" ? modalFrenchHTML : modalEnglishHTML;
|
|
212
|
+
modalElement.style.display = 'none';
|
|
213
|
+
}
|
|
214
|
+
state = _extends({}, state, { modalElement: modalElement });
|
|
215
|
+
return state;
|
|
216
|
+
}
|
|
217
|
+
}]);
|
|
218
|
+
return Modal;
|
|
219
|
+
}(React.Component);
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
Modal.propTypes = {
|
|
223
|
+
toggleModalVisibility: PropTypes.bool,
|
|
224
|
+
modalType: PropTypes.string,
|
|
225
|
+
callbackModalClose: PropTypes.func
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
function styleInject(css, ref) {
|
|
229
|
+
if ( ref === void 0 ) ref = {};
|
|
230
|
+
var insertAt = ref.insertAt;
|
|
231
|
+
|
|
232
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
233
|
+
|
|
234
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
235
|
+
var style = document.createElement('style');
|
|
236
|
+
style.type = 'text/css';
|
|
237
|
+
|
|
238
|
+
if (insertAt === 'top') {
|
|
239
|
+
if (head.firstChild) {
|
|
240
|
+
head.insertBefore(style, head.firstChild);
|
|
241
|
+
} else {
|
|
242
|
+
head.appendChild(style);
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
head.appendChild(style);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (style.styleSheet) {
|
|
249
|
+
style.styleSheet.cssText = css;
|
|
250
|
+
} else {
|
|
251
|
+
style.appendChild(document.createTextNode(css));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
var css = ".sezzle-checkout-modal-lightbox * {\n\tvertical-align: baseline;\n\tbox-sizing: border-box;\n\tline-height: normal;\n }\n\n .sezzle-checkout-modal-lightbox {\n\tdisplay: none;\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tz-index: 99999998;\n\tbackground-color: rgba(5, 31, 52, 0.57);\n\twidth: 100vw;\n\theight: 100vh;\n\toverflow-y: auto;\n\toverflow-x: hidden;\n\tcolor: unset;\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal-hidden {\n\ttransition: all 0.4s ease;\n\tmargin-top: 0;\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal {\n\tposition: fixed;\n\ttop: 50%;\n\tleft: 50%;\n\tmargin-top: -384px;\n\tmargin-left: -325px;\n\tz-index: 99999998;\n\tbackground-color: #fff;\n\tbox-shadow: 0 10px 20px rgba(5, 31, 52, 0.19), 0 6px 6px rgba(5, 31, 52, 0.2);\n\tborder-radius: 20px;\n\tcolor: #000;\n\tfont-family: Helvetica Neue, Helvetica, Arial, sans-serif;\n\ttransition: all 0.4s ease;\n\twidth: 650px;\n }\n @media (max-width: 650px) {\n\t.sezzle-checkout-modal-lightbox .sezzle-checkout-modal {\n\t position: relative;\n\t top: 0px;\n\t left: 0px;\n\t padding: 50px 20px;\n\t margin: 0;\n\t border-radius: 0;\n\t height: 100%;\n\t font-size: 15px;\n\t max-width: 100%;\n\t min-width: 320px;\n\t overflow: auto;\n\t}\n }\n @media (max-height: 767px) and (min-width: 651px) {\n\t.sezzle-checkout-modal-lightbox .sezzle-checkout-modal {\n\t position: relative;\n\t top: 0px;\n\t left: 0px;\n\t margin: 20px auto;\n\t}\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal h1 {\n\tfont-size: 18px;\n\ttext-align: center;\n\tmargin: 0 auto;\n }\n @media (max-width: 450px) {\n\t.sezzle-checkout-modal-lightbox .sezzle-checkout-modal h1 .sezzle-checkout-modal h1 {\n\t font-size: 16px;\n\t}\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal p {\n\tdisplay: block;\n\ttext-align: center;\n\ttext-transform: none;\n\tfont-size: 12pt;\n\tline-height: 25px;\n\tfont-weight: 300;\n\tbox-sizing: border-box;\n\tcolor: #7d8588;\n\tmargin: 5px 0 !important;\n\tletter-spacing: 0.25px;\n }\n @media (max-width: 768px) {\n\t.sezzle-checkout-modal-lightbox .sezzle-checkout-modal p {\n\t text-align: center;\n\t}\n }\n @media (max-width: 450px) {\n\t.sezzle-checkout-modal-lightbox .sezzle-checkout-modal p {\n\t font-size: 11pt;\n\t text-align: center;\n\t letter-spacing: 0.5px;\n\t line-height: 18px;\n\t}\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal p small {\n\tdisplay: block;\n\tbox-sizing: border-box;\n\tfont-size: 11pt;\n\topacity: 0.8;\n }\n @media (max-width: 450px) {\n\t.sezzle-checkout-modal-lightbox .sezzle-checkout-modal p small {\n\t font-size: 7.5pt;\n\t}\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal a {\n\tdisplay: block;\n\tmargin: 4px auto 0;\n\tcolor: #17ce6a;\n\tfont-size: 8pt;\n\tfont-weight: 500;\n\ttext-transform: lowercase;\n\ttext-align: left;\n\tletter-spacing: 0.25px;\n\ttext-decoration: none;\n\ttransition: 0.15s;\n\topacity: 0.65;\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal a:hover {\n\ttransition: 0.1s;\n\topacity: 1;\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal h2 {\n\tfont-size: 18px;\n\ttext-align: center;\n\tmargin: 0 auto;\n\tcolor: unset;\n }\n @media (max-width: 768px) {\n\t.sezzle-checkout-modal-lightbox .sezzle-checkout-modal h2 {\n\t text-align: center;\n\t}\n }\n .sezzle-checkout-modal-lightbox .sezzle-checkout-modal h2 img {\n\tmargin: 0 4px;\n\tdisplay: inline-block;\n\theight: 30px !important;\n\twidth: auto;\n\tposition: relative;\n\ttop: 6px;\n\tvertical-align: initial;\n }\n\n .sezzle-shopify-info-button {\n\tdisplay: block;\n\toverflow: hidden;\n\tmargin: 0;\n\tborder: none;\n\tpadding: 0;\n\tbackground: none;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper {\n\tdisplay: block;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tborder: none;\n\tpadding: 0;\n\tbackground: none;\n\tcolor: inherit;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper:focus {\n\toutline: 5px auto;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper.sezzle-left {\n\ttext-align: left;\n\tfloat: left;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper.sezzle-center {\n\ttext-align: center;\n\tfloat: none;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper.sezzle-right {\n\ttext-align: right;\n\tfloat: right;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text {\n\twidth: unset;\n\tmargin: auto;\n\tborder: 0;\n\tpadding: 0;\n\tbackground: none;\n\tvertical-align: baseline;\n\tword-wrap: normal;\n\tline-height: 18px;\n\tfont-size: 14px;\n\tfont-weight: 500;\n\tfont-family: inherit;\n\tcolor: inherit;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text.sezzle-left {\n\ttext-align: left;\n\tmargin: 0;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text.sezzle-center {\n\ttext-align: center;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text.sezzle-right {\n\tfloat: right;\n\ttext-align: right;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text .sezzle-payment-amount {\n\tzoom: 1;\n\tfloat: none;\n\tmargin: 0;\n\tborder: 0;\n\tpadding: 0;\n\tbackground: none;\n\tvertical-align: baseline;\n\tfont-weight: 900;\n\tfont-size: 1.2em;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text .sezzle-logo {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\theight: 18px;\n\twidth: auto;\n\topacity: 1;\n\tfloat: none;\n\tmargin: 0;\n\tmargin-bottom: -3px;\n\tborder: 0;\n\tpadding: 0;\n\tbackground: none;\n\tvertical-align: baseline;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text .sezzle-info-icon {\n\tdisplay: inline;\n\twidth: auto;\n\tmargin: 0;\n\tbox-shadow: none;\n\tborder: none;\n\tpadding: 0px 0px 0px 3px;\n\tbackground: none;\n\tvertical-align: baseline;\n\tline-height: initial;\n\tfont-size: inherit;\n\tcolor: inherit;\n\tcursor: pointer;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text .sezzle-ap-logo {\n\theight: 45px;\n\tmargin: 0;\n\tborder: 0;\n\tpadding: 0;\n\tvertical-align: middle;\n }\n .sezzle-shopify-info-button .sezzle-checkout-button-wrapper .sezzle-button-text button.ap-modal-info-link {\n\tdisplay: inline;\n\twidth: auto;\n\tmargin: 0;\n\tbox-shadow: none;\n\tborder: none;\n\tpadding: 0;\n\tbackground: none;\n\tvertical-align: middle;\n\tline-height: inherit;\n\tfont-size: inherit;\n\tcolor: inherit;\n\tcursor: pointer;\n }\n\n .sezzle-hidden {\n\tdisplay: none;\n\tvisibility: hidden;\n }\n";
|
|
256
|
+
styleInject(css);
|
|
257
|
+
|
|
258
|
+
var SezzleWidgetText = function (_React$Component) {
|
|
259
|
+
inherits(SezzleWidgetText, _React$Component);
|
|
260
|
+
|
|
261
|
+
function SezzleWidgetText(props) {
|
|
262
|
+
classCallCheck(this, SezzleWidgetText);
|
|
263
|
+
|
|
264
|
+
var _this = possibleConstructorReturn(this, (SezzleWidgetText.__proto__ || Object.getPrototypeOf(SezzleWidgetText)).call(this, props));
|
|
265
|
+
|
|
266
|
+
_this.state = {
|
|
267
|
+
config: _this.props.config,
|
|
268
|
+
sezzle: false,
|
|
269
|
+
afterpay: false,
|
|
270
|
+
modalsToShow: ['sezzle', 'afterpay']
|
|
271
|
+
};
|
|
272
|
+
return _this;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
createClass(SezzleWidgetText, [{
|
|
276
|
+
key: 'renderSezzleWidgetText',
|
|
277
|
+
value: function renderSezzleWidgetText() {
|
|
278
|
+
var _this2 = this;
|
|
279
|
+
|
|
280
|
+
var numberOfPayments = 4;
|
|
281
|
+
var logoURLs = {
|
|
282
|
+
'light': 'https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg',
|
|
283
|
+
'dark': 'https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor_WhiteWM.svg',
|
|
284
|
+
'black-flat': 'https://media.sezzle.com/branding/2.0/Sezzle_Logo_BlackAlt.svg',
|
|
285
|
+
'white-flat': 'https://media.sezzle.com/branding/2.0/Sezzle_Logo_WhiteAlt.svg'
|
|
286
|
+
};
|
|
287
|
+
var template = {
|
|
288
|
+
en: 'or ' + numberOfPayments + ' interest-free payments of %%price%% with %%logo%%%%afterpay%%%%min-price%% %%info%%',
|
|
289
|
+
fr: 'ou ' + numberOfPayments + ' paiements de %%price%% sans int\xE9r\xEAts avec %%logo%%%%afterpay%%%%min-price%% %%info%%'
|
|
290
|
+
};
|
|
291
|
+
var clickHere = {
|
|
292
|
+
en: 'Click here to learn more about Sezzle',
|
|
293
|
+
fr: 'Cliquez pour en savoir plus sur Sezzle'
|
|
294
|
+
};
|
|
295
|
+
var ordersOver = {
|
|
296
|
+
en: ' for orders over',
|
|
297
|
+
fr: ' pour les achats de plus de'
|
|
298
|
+
};
|
|
299
|
+
var language = document.querySelector('html').lang.substring(0, 2).toLowerCase() || 'en';
|
|
300
|
+
var subtemplates = [];
|
|
301
|
+
template[language].split('%%').forEach(function (subTemplate, index) {
|
|
302
|
+
switch (subTemplate) {
|
|
303
|
+
case 'price':
|
|
304
|
+
var priceElement = React.createElement(
|
|
305
|
+
'span',
|
|
306
|
+
{ className: 'sezzle-payment-amount sezzle-button-text', key: index },
|
|
307
|
+
getFormattedPrice(_this2.state.config.price, numberOfPayments)
|
|
308
|
+
);
|
|
309
|
+
subtemplates.push(priceElement);
|
|
310
|
+
break;
|
|
311
|
+
case 'logo':
|
|
312
|
+
var logoElement = React.createElement('img', { alt: 'Sezzle',
|
|
313
|
+
className: 'sezzle-logo szl-' + (_this2.state.config.theme === 'dark' || _this2.state.config.theme === 'white-flat' ? 'dark' : 'light') + '-image', src: logoURLs[_this2.state.config.theme] || logoURLs.light,
|
|
314
|
+
style: { transformOrigin: 'top-' + _this2.state.config.alignment, transform: 'scale(' + _this2.state.config.logoSize + ')', cursor: 'pointer', width: '74px', height: '18px' },
|
|
315
|
+
key: index, onClick: function onClick() {
|
|
316
|
+
return _this2.openModal('sezzle');
|
|
317
|
+
} });
|
|
318
|
+
subtemplates.push(logoElement);
|
|
319
|
+
break;
|
|
320
|
+
case 'info':
|
|
321
|
+
var infoElement = React.createElement(
|
|
322
|
+
'div',
|
|
323
|
+
{ 'aria-label': '' + clickHere[language], className: 'sezzle-info-icon', key: index, onClick: function onClick() {
|
|
324
|
+
return _this2.openModal('sezzle');
|
|
325
|
+
} },
|
|
326
|
+
'\u24D8'
|
|
327
|
+
);
|
|
328
|
+
subtemplates.push(infoElement);
|
|
329
|
+
break;
|
|
330
|
+
case 'afterpay':
|
|
331
|
+
if (_this2.state.config.includeAPModal) {
|
|
332
|
+
subtemplates.push(language === "fr" ? "ou" : " or ");
|
|
333
|
+
var apLogo = React.createElement('img', { className: 'sezzle-ap-logo ap-modal-info-link no-sezzle-info',
|
|
334
|
+
src: 'https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-black-on-mint.svg',
|
|
335
|
+
onClick: function onClick() {
|
|
336
|
+
return _this2.openModal('afterpay');
|
|
337
|
+
}, key: index,
|
|
338
|
+
alt: 'Afterpay'
|
|
339
|
+
});
|
|
340
|
+
subtemplates.push(apLogo);
|
|
341
|
+
}
|
|
342
|
+
break;
|
|
343
|
+
case 'min-price':
|
|
344
|
+
if (_this2.state.config.minPrice && !_this2.state.config.includeAPModal) {
|
|
345
|
+
subtemplates.push(ordersOver[language] + ' $' + _this2.state.config.minPrice);
|
|
346
|
+
}
|
|
347
|
+
break;
|
|
348
|
+
default:
|
|
349
|
+
subtemplates.push(subTemplate);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
return subtemplates;
|
|
353
|
+
}
|
|
354
|
+
}, {
|
|
355
|
+
key: 'openModal',
|
|
356
|
+
value: function openModal(modalType) {
|
|
357
|
+
modalType === 'afterpay' ? this.setState({ afterpay: true }) : this.setState({ sezzle: true });
|
|
358
|
+
}
|
|
359
|
+
}, {
|
|
360
|
+
key: 'closeModal',
|
|
361
|
+
value: function closeModal(modalType) {
|
|
362
|
+
modalType === 'afterpay' ? this.setState({ afterpay: false }) : this.setState({ sezzle: false });
|
|
363
|
+
}
|
|
364
|
+
}, {
|
|
365
|
+
key: 'render',
|
|
366
|
+
value: function render() {
|
|
367
|
+
var _this3 = this;
|
|
368
|
+
|
|
369
|
+
return React.createElement(
|
|
370
|
+
'div',
|
|
371
|
+
{ className: 'sezzle-shopify-info-button sezzle-' + (this.state.config.merchantId || '') },
|
|
372
|
+
React.createElement(
|
|
373
|
+
'div',
|
|
374
|
+
{ 'aria-haspopup': 'dialog', role: 'button', tabIndex: '0', className: 'sezzle-checkout-button-wrapper sezzle-modal-link sezzle-' + (this.state.config.merchantId || '') + ' sezzle-' + (this.state.config.alignment || 'auto'), style: { cursor: 'pointer' } },
|
|
375
|
+
React.createElement(
|
|
376
|
+
'div',
|
|
377
|
+
{ className: 'sezzle-button-text sezzle-' + (this.state.config.alignment || 'auto') + ' szl-' + (this.state.config.theme === 'dark' || this.state.config.theme === 'white-flat' ? 'dark' : 'light'), style: { fontWeight: this.state.config.fontWeight || 500, fontFamily: this.state.config.fontFamily || 'inherit', fontSize: (this.state.config.fontSize || 14) + 'px', color: this.state.config.textColor || 'inherit' } },
|
|
378
|
+
this.renderSezzleWidgetText()
|
|
379
|
+
)
|
|
380
|
+
),
|
|
381
|
+
this.state.modalsToShow.map(function (modal, index) {
|
|
382
|
+
return React.createElement(Modal, { modalType: modal, key: index, toggleModalVisibility: _this3.state[modal], callbackModalClose: function callbackModalClose(modal) {
|
|
383
|
+
return _this3.closeModal(modal);
|
|
384
|
+
} });
|
|
385
|
+
})
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
}], [{
|
|
389
|
+
key: 'getDerivedStateFromProps',
|
|
390
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
391
|
+
var config = props.config;
|
|
392
|
+
state = _extends({}, state, { config: config });
|
|
393
|
+
|
|
394
|
+
return state;
|
|
395
|
+
}
|
|
396
|
+
}]);
|
|
397
|
+
return SezzleWidgetText;
|
|
398
|
+
}(React.Component);
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
SezzleWidgetText.propTypes = {
|
|
402
|
+
config: PropTypes.object
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
var SezzleWidgetWrapper = function (_React$Component) {
|
|
406
|
+
inherits(SezzleWidgetWrapper, _React$Component);
|
|
407
|
+
|
|
408
|
+
function SezzleWidgetWrapper(props) {
|
|
409
|
+
classCallCheck(this, SezzleWidgetWrapper);
|
|
410
|
+
|
|
411
|
+
var _this = possibleConstructorReturn(this, (SezzleWidgetWrapper.__proto__ || Object.getPrototypeOf(SezzleWidgetWrapper)).call(this, props));
|
|
412
|
+
|
|
413
|
+
_this.state = {
|
|
414
|
+
sezzleConfig: {
|
|
415
|
+
price: _this.props.price || 0,
|
|
416
|
+
merchantId: _this.props.merchantId || '',
|
|
417
|
+
includeAPModal: _this.props.includeAPModal || false,
|
|
418
|
+
minPrice: _this.props.minPrice || 0,
|
|
419
|
+
theme: _this.props.theme || 'light',
|
|
420
|
+
alignment: _this.props.alignment || 'auto',
|
|
421
|
+
fontWeight: _this.props.fontWeight || 500,
|
|
422
|
+
fontFamily: _this.props.fontFamily || 'inherit',
|
|
423
|
+
fontSize: _this.props.fontSize || 14,
|
|
424
|
+
textColor: _this.props.textColor || 'inherit',
|
|
425
|
+
logoSize: _this.props.logoSize || 1,
|
|
426
|
+
modalsToShow: ['sezzle']
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
return _this;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
createClass(SezzleWidgetWrapper, [{
|
|
433
|
+
key: 'render',
|
|
434
|
+
value: function render() {
|
|
435
|
+
return React.createElement(
|
|
436
|
+
'div',
|
|
437
|
+
null,
|
|
438
|
+
React.createElement(SezzleWidgetText, { config: this.state.sezzleConfig })
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
}], [{
|
|
442
|
+
key: 'getDerivedStateFromProps',
|
|
443
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
444
|
+
if (props.price !== state.sezzleConfig.price) {
|
|
445
|
+
var updateState = state;
|
|
446
|
+
updateState.sezzleConfig.price = props.price;
|
|
447
|
+
return updateState;
|
|
448
|
+
}
|
|
449
|
+
state = _extends({}, state);
|
|
450
|
+
|
|
451
|
+
if (props.includeAPModal) state.sezzleConfig.modalsToShow.push('afterpay');
|
|
452
|
+
return state;
|
|
453
|
+
}
|
|
454
|
+
}]);
|
|
455
|
+
return SezzleWidgetWrapper;
|
|
456
|
+
}(React.Component);
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
SezzleWidgetWrapper.propTypes = {
|
|
460
|
+
price: PropTypes.string.isRequired,
|
|
461
|
+
merchantId: PropTypes.string.isRequired,
|
|
462
|
+
theme: PropTypes.string,
|
|
463
|
+
alignment: PropTypes.string,
|
|
464
|
+
fontWeight: PropTypes.number,
|
|
465
|
+
fontFamily: PropTypes.string,
|
|
466
|
+
fontSize: PropTypes.number,
|
|
467
|
+
textColor: PropTypes.string,
|
|
468
|
+
logoSize: PropTypes.number,
|
|
469
|
+
includeAPModal: PropTypes.bool
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
export default SezzleWidgetWrapper;
|
|
473
|
+
//# sourceMappingURL=index.es.js.map
|