@alma/widgets 2.5.1 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/raw/widgets.css +23 -2
- package/dist/raw/widgets.js +269 -76
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +269 -76
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +264 -80
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +269 -76
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +2 -0
- package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +2 -0
- package/dist/types/Widgets/EligibilityModal/ModalContainer.d.ts +2 -1
- package/dist/types/Widgets/EligibilityModal/{modal.test.d.ts → __tests__/Basics.test.d.ts} +0 -0
- package/dist/types/Widgets/EligibilityModal/__tests__/Cards.test.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/__tests__/ModalContainer.test.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/__tests__/Plans.test.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +2 -0
- package/dist/types/Widgets/EligibilityModal/components/Cards/index.d.ts +7 -0
- package/dist/types/Widgets/EligibilityModal/index.d.ts +2 -1
- package/dist/types/Widgets/PaymentPlans/index.d.ts +2 -1
- package/dist/types/assets/cards/amex.d.ts +3 -0
- package/dist/types/assets/cards/cb.d.ts +3 -0
- package/dist/types/assets/cards/mastercard.d.ts +3 -0
- package/dist/types/assets/cards/visa.d.ts +3 -0
- package/dist/types/types.d.ts +3 -0
- package/dist/types/widgets_controller.d.ts +1 -2
- package/dist/widgets.css +3 -2
- package/dist/widgets.js +1 -1
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.m.js +1 -1
- package/dist/widgets.m.js.map +1 -1
- package/dist/widgets.modern.js +1 -1
- package/dist/widgets.modern.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1819,7 +1819,7 @@ var messagesDE = {
|
|
|
1819
1819
|
"eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
|
|
1820
1820
|
"eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
|
|
1821
1821
|
"eligibility-modal.total": "Insgesamt",
|
|
1822
|
-
"installments.today": "
|
|
1822
|
+
"installments.today": "Heute",
|
|
1823
1823
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
1824
1824
|
"payment-plan-strings.default-message": "Bezahlen Sie in Raten mit Alma",
|
|
1825
1825
|
"payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
|
|
@@ -1862,7 +1862,7 @@ var messagesES = {
|
|
|
1862
1862
|
"eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
|
|
1863
1863
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
|
|
1864
1864
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1865
|
-
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta
|
|
1865
|
+
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tu tarjeta, a través de Alma.",
|
|
1866
1866
|
"eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
|
|
1867
1867
|
"eligibility-modal.total": "Total",
|
|
1868
1868
|
"installments.today": "Hoy",
|
|
@@ -1908,8 +1908,8 @@ var messagesIT = {
|
|
|
1908
1908
|
"eligibility-modal.credit-cost": "Di cui commissioni",
|
|
1909
1909
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
|
|
1910
1910
|
"eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
|
|
1911
|
-
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con
|
|
1912
|
-
"eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted>
|
|
1911
|
+
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con Alma, senza interessi.",
|
|
1912
|
+
"eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> o posticipa il pagamento con Alma, senza interessi.",
|
|
1913
1913
|
"eligibility-modal.total": "Totale",
|
|
1914
1914
|
"installments.today": "Oggi",
|
|
1915
1915
|
"payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
|
|
@@ -1950,9 +1950,6 @@ const getTranslationsByLocale = locale => {
|
|
|
1950
1950
|
case Locale.fr:
|
|
1951
1951
|
return messagesFR;
|
|
1952
1952
|
|
|
1953
|
-
case Locale.en:
|
|
1954
|
-
return messagesEN;
|
|
1955
|
-
|
|
1956
1953
|
case Locale.es:
|
|
1957
1954
|
return messagesES;
|
|
1958
1955
|
|
|
@@ -1967,6 +1964,7 @@ const getTranslationsByLocale = locale => {
|
|
|
1967
1964
|
case Locale['nl-NL']:
|
|
1968
1965
|
return messagesNL;
|
|
1969
1966
|
|
|
1967
|
+
case Locale.en:
|
|
1970
1968
|
default:
|
|
1971
1969
|
return messagesEN;
|
|
1972
1970
|
}
|
|
@@ -2154,7 +2152,9 @@ const STATIC_CUSTOMISATION_CLASSES = {
|
|
|
2154
2152
|
closeButton: prefix + '-close-button',
|
|
2155
2153
|
scheduleDetails: prefix + '-schedule-details',
|
|
2156
2154
|
scheduleTotal: prefix + '-schedule-total',
|
|
2157
|
-
scheduleCredit: prefix + '-schedule-credit'
|
|
2155
|
+
scheduleCredit: prefix + '-schedule-credit',
|
|
2156
|
+
cardContainer: prefix + '-card-logos',
|
|
2157
|
+
summary: prefix + '-summary'
|
|
2158
2158
|
};
|
|
2159
2159
|
|
|
2160
2160
|
const _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
|
|
@@ -2170,6 +2170,7 @@ const ControlledModal = _ref => {
|
|
|
2170
2170
|
} = _ref,
|
|
2171
2171
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2172
2172
|
|
|
2173
|
+
/* istanbul ignore next */
|
|
2173
2174
|
Modal.setAppElement('body');
|
|
2174
2175
|
return /*#__PURE__*/React.createElement(Modal, Object.assign({
|
|
2175
2176
|
className: cx(s$1.modal, className),
|
|
@@ -2346,7 +2347,7 @@ const EligibilityPlansButtons = ({
|
|
|
2346
2347
|
onClick: () => setCurrentPlanIndex(index)
|
|
2347
2348
|
}, paymentPlanShorthandName(eligibilityPlan))));
|
|
2348
2349
|
|
|
2349
|
-
var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","creditCost":"_1ZIgu","creditMessage":"_1BUr8"};
|
|
2350
|
+
var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary":"_65ZpD","creditCost":"_1ZIgu","creditCostAmount":"_tUTZp","creditMessage":"_1BUr8"};
|
|
2350
2351
|
|
|
2351
2352
|
const Schedule = ({
|
|
2352
2353
|
currentPlan
|
|
@@ -2357,9 +2358,27 @@ const Schedule = ({
|
|
|
2357
2358
|
const customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
|
|
2358
2359
|
const isCredit = currentPlan && currentPlan.installments_count > 4;
|
|
2359
2360
|
const intl = useIntl();
|
|
2360
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2361
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
2361
2362
|
className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
|
|
2362
2363
|
"data-testid": "modal-installments-element"
|
|
2364
|
+
}, ((currentPlan == null ? void 0 : currentPlan.payment_plan) || []).map((installment, index) => /*#__PURE__*/React.createElement("div", {
|
|
2365
|
+
className: s$3.scheduleLine,
|
|
2366
|
+
key: index
|
|
2367
|
+
}, /*#__PURE__*/React.createElement("span", null, isToday(installment.due_date * 1000) ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2368
|
+
id: "installments.today",
|
|
2369
|
+
defaultMessage: "Aujourd'hui"
|
|
2370
|
+
}) : /*#__PURE__*/React.createElement(FormattedDate, {
|
|
2371
|
+
value: installment.due_date * 1000,
|
|
2372
|
+
day: "numeric",
|
|
2373
|
+
month: "long",
|
|
2374
|
+
year: "numeric"
|
|
2375
|
+
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
2376
|
+
value: priceFromCents(installment.total_amount),
|
|
2377
|
+
style: "currency",
|
|
2378
|
+
currency: "EUR"
|
|
2379
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
2380
|
+
className: cx(s$3.summary, STATIC_CUSTOMISATION_CLASSES.summary),
|
|
2381
|
+
"data-testid": "modal-summary"
|
|
2363
2382
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2364
2383
|
className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
|
|
2365
2384
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2377,7 +2396,9 @@ const Schedule = ({
|
|
|
2377
2396
|
})) : /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2378
2397
|
id: "eligibility-modal.cost",
|
|
2379
2398
|
defaultMessage: "Dont frais"
|
|
2380
|
-
})), /*#__PURE__*/React.createElement("span",
|
|
2399
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
2400
|
+
className: s$3.creditCostAmount
|
|
2401
|
+
}, isCredit ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2381
2402
|
id: "eligibility-modal.credit-cost-amount",
|
|
2382
2403
|
defaultMessage: "{creditCost} (TAEG {TAEG})",
|
|
2383
2404
|
values: {
|
|
@@ -2394,38 +2415,185 @@ const Schedule = ({
|
|
|
2394
2415
|
value: customerFees,
|
|
2395
2416
|
style: "currency",
|
|
2396
2417
|
currency: "EUR"
|
|
2397
|
-
}))),
|
|
2398
|
-
className: s$3.scheduleLine,
|
|
2399
|
-
key: index
|
|
2400
|
-
}, /*#__PURE__*/React.createElement("span", null, isToday(installment.due_date * 1000) ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2401
|
-
id: "installments.today",
|
|
2402
|
-
defaultMessage: "Aujourd'hui"
|
|
2403
|
-
}) : /*#__PURE__*/React.createElement(FormattedDate, {
|
|
2404
|
-
value: installment.due_date * 1000,
|
|
2405
|
-
day: "numeric",
|
|
2406
|
-
month: "long",
|
|
2407
|
-
year: "numeric"
|
|
2408
|
-
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
2409
|
-
value: priceFromCents(installment.total_amount),
|
|
2410
|
-
style: "currency",
|
|
2411
|
-
currency: "EUR"
|
|
2412
|
-
})))), isCredit && /*#__PURE__*/React.createElement("p", {
|
|
2418
|
+
}))), isCredit && /*#__PURE__*/React.createElement("p", {
|
|
2413
2419
|
className: s$3.creditMessage
|
|
2414
2420
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2415
2421
|
id: "eligibility-modal.credit-commitment",
|
|
2416
2422
|
defaultMessage: "Un cr\u00E9dit vous engage et doit \u00EAtre rembours\u00E9. V\u00E9rifiez vos capacit\u00E9s de remboursement\n avant de vous engager."
|
|
2417
|
-
})));
|
|
2423
|
+
}))));
|
|
2424
|
+
};
|
|
2425
|
+
|
|
2426
|
+
const AmexCard = () => /*#__PURE__*/React.createElement("svg", {
|
|
2427
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2428
|
+
width: "24",
|
|
2429
|
+
height: "16",
|
|
2430
|
+
viewBox: "0 0 24 16"
|
|
2431
|
+
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
2432
|
+
id: "cardamex",
|
|
2433
|
+
x1: "10.914%",
|
|
2434
|
+
x2: "87.432%",
|
|
2435
|
+
y1: "86.279%",
|
|
2436
|
+
y2: "15.035%"
|
|
2437
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
2438
|
+
offset: "0%",
|
|
2439
|
+
stopColor: "#3FA9F5"
|
|
2440
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
2441
|
+
offset: "100%",
|
|
2442
|
+
stopColor: "#0071BC"
|
|
2443
|
+
}))), /*#__PURE__*/React.createElement("g", {
|
|
2444
|
+
fill: "none",
|
|
2445
|
+
fillRule: "evenodd"
|
|
2446
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2447
|
+
fill: "url(#cardamex)",
|
|
2448
|
+
fillRule: "nonzero",
|
|
2449
|
+
d: "M22.559 16H1.379C.627 16 0 15.392 0 14.662V1.338C0 .608.627 0 1.379 0H22.62C23.373 0 24 .608 24 1.338v13.324c-.063.73-.627 1.338-1.441 1.338z"
|
|
2450
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
2451
|
+
fill: "#FFF"
|
|
2452
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2453
|
+
d: "M10.115 8.711L8.889 6.044H7.295v3.852L5.517 6.044H4.17l-1.778 4.03h1.103l.368-.889h2.023l.368.89h2.084V7.11l1.349 2.963h.92l1.348-2.904v2.904h.98v-4.03H11.28l-1.165 2.667zm-5.272-.474H4.23l.613-1.422v.06l.613 1.362h-.613z"
|
|
2454
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2455
|
+
fillRule: "nonzero",
|
|
2456
|
+
d: "M19.372 7.94l.735-.77 1.042-1.185h-1.287L18.697 7.23l-1.164-1.245h-3.985v3.97h3.923l1.226-1.303 1.165 1.304h1.287L20.107 8.71l-.735-.77zM16.92 9.186h-2.33v-.77h2.268v-.77H14.59v-.712h2.33L18.084 8 16.92 9.185z"
|
|
2457
|
+
}))));
|
|
2458
|
+
|
|
2459
|
+
const VisaCard = () => /*#__PURE__*/React.createElement("svg", {
|
|
2460
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2461
|
+
width: "24",
|
|
2462
|
+
height: "16",
|
|
2463
|
+
viewBox: "0 0 24 16"
|
|
2464
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2465
|
+
fill: "none",
|
|
2466
|
+
fillRule: "nonzero"
|
|
2467
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2468
|
+
fill: "#FCFCFC",
|
|
2469
|
+
d: "M22.684 16H1.38C.627 16 0 15.39 0 14.656V1.344C0 .61.627 0 1.379 0H22.62C23.373 0 24 .61 24 1.344v13.374c0 .671-.564 1.282-1.316 1.282z"
|
|
2470
|
+
}), ' ', /*#__PURE__*/React.createElement("path", {
|
|
2471
|
+
fill: "#005098",
|
|
2472
|
+
d: "M8.889 10.726l.948-5.393h1.482l-.949 5.393zM15.704 5.452a3.658 3.658 0 0 0-1.304-.237c-1.481 0-2.489.71-2.489 1.778 0 .77.711 1.185 1.304 1.481.592.237.77.415.77.652 0 .355-.474.533-.889.533-.592 0-.889-.059-1.363-.296l-.177-.06-.178 1.186c.355.178 1.007.296 1.659.296 1.54 0 2.548-.71 2.548-1.837 0-.592-.415-1.067-1.244-1.481-.534-.237-.83-.415-.83-.652 0-.237.237-.474.83-.474.474 0 .83.118 1.126.178l.118.059.119-1.126M19.496 5.333H18.37c-.355 0-.592.119-.77.474l-2.193 4.919h1.541s.237-.652.296-.83h1.897c.059.178.178.83.178.83h1.362l-1.185-5.393zM17.66 8.77l.593-1.481s.118-.296.178-.533l.118.474s.296 1.303.356 1.54h-1.245zM7.644 5.333L6.222 9.007l-.178-.77C5.748 7.348 4.92 6.459 4.03 5.985l1.303 4.682h1.541l2.311-5.393h-1.54"
|
|
2473
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2474
|
+
fill: "#F6A500",
|
|
2475
|
+
d: "M4.919 5.333h-2.37v.119c1.836.474 3.08 1.54 3.555 2.844L5.57 5.807c-.118-.414-.355-.474-.651-.474"
|
|
2476
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2477
|
+
fill: "#0A5296",
|
|
2478
|
+
d: "M23.937 3.23H0V1.316C0 .598.627 0 1.379 0H22.62C23.373 0 24 .598 24 1.316V3.23h-.063z"
|
|
2479
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2480
|
+
fill: "#F4A428",
|
|
2481
|
+
d: "M.063 13H24v1.8c0 .655-.625 1.2-1.375 1.2H1.375C.625 16 0 15.455 0 14.8V13h.063z"
|
|
2482
|
+
})));
|
|
2483
|
+
|
|
2484
|
+
const MasterCard = () => /*#__PURE__*/React.createElement("svg", {
|
|
2485
|
+
width: "24px",
|
|
2486
|
+
height: "16px",
|
|
2487
|
+
viewBox: "0 0 24 16",
|
|
2488
|
+
version: "1.1",
|
|
2489
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2490
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2491
|
+
id: "Parcours-1C-B",
|
|
2492
|
+
stroke: "none",
|
|
2493
|
+
strokeWidth: "1",
|
|
2494
|
+
fill: "none",
|
|
2495
|
+
fillRule: "evenodd"
|
|
2496
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2497
|
+
id: "mobile-1C-Paiement-V1",
|
|
2498
|
+
transform: "translate(-269.000000, -313.000000)"
|
|
2499
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2500
|
+
id: "mastercard",
|
|
2501
|
+
transform: "translate(269.000000, 313.000000)"
|
|
2502
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
2503
|
+
id: "Rectangle",
|
|
2504
|
+
fill: "#FFFFFF",
|
|
2505
|
+
x: "0",
|
|
2506
|
+
y: "0",
|
|
2507
|
+
width: "24",
|
|
2508
|
+
height: "16",
|
|
2509
|
+
rx: "1"
|
|
2510
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
2511
|
+
id: "Group-6",
|
|
2512
|
+
transform: "translate(4.000000, 3.000000)"
|
|
2513
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
2514
|
+
id: "Oval-4-Copy",
|
|
2515
|
+
fill: "#EA001B",
|
|
2516
|
+
cx: "5.05263158",
|
|
2517
|
+
cy: "5.05263158",
|
|
2518
|
+
r: "5.05263158"
|
|
2519
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
2520
|
+
id: "Oval-4",
|
|
2521
|
+
fillOpacity: "0.25",
|
|
2522
|
+
fill: "#F79F1A",
|
|
2523
|
+
cx: "10.9473684",
|
|
2524
|
+
cy: "5.05263158",
|
|
2525
|
+
r: "5.05263158"
|
|
2526
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
2527
|
+
id: "Oval-4-Copy-2",
|
|
2528
|
+
fillOpacity: "0.9",
|
|
2529
|
+
fill: "#F79F1A",
|
|
2530
|
+
cx: "10.9473684",
|
|
2531
|
+
cy: "5.05263158",
|
|
2532
|
+
r: "5.05263158"
|
|
2533
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
2534
|
+
id: "Oval-4-Copy-3",
|
|
2535
|
+
fillOpacity: "0.3",
|
|
2536
|
+
fill: "#EA001B",
|
|
2537
|
+
cx: "5.05263158",
|
|
2538
|
+
cy: "5.05263158",
|
|
2539
|
+
r: "5.05263158"
|
|
2540
|
+
}))))));
|
|
2541
|
+
|
|
2542
|
+
const CbCard = () => /*#__PURE__*/React.createElement("svg", {
|
|
2543
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2544
|
+
width: "24",
|
|
2545
|
+
height: "16",
|
|
2546
|
+
viewBox: "0 0 24 16"
|
|
2547
|
+
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
2548
|
+
id: "cardcb",
|
|
2549
|
+
x1: "5.842%",
|
|
2550
|
+
x2: "95.393%",
|
|
2551
|
+
y1: "81.753%",
|
|
2552
|
+
y2: "17.344%"
|
|
2553
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
2554
|
+
offset: "0%",
|
|
2555
|
+
stopColor: "#39B54A"
|
|
2556
|
+
}), ' ', /*#__PURE__*/React.createElement("stop", {
|
|
2557
|
+
offset: "100%",
|
|
2558
|
+
stopColor: "#0A5296"
|
|
2559
|
+
}))), /*#__PURE__*/React.createElement("g", {
|
|
2560
|
+
fill: "none",
|
|
2561
|
+
fillRule: "nonzero"
|
|
2562
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2563
|
+
fill: "url(#cardcb)",
|
|
2564
|
+
d: "M22.621 16H1.38C.627 16 0 15.392 0 14.662V1.338C0 .608.627 0 1.379 0H22.62C23.373 0 24 .608 24 1.338v13.324c-.063.73-.627 1.338-1.379 1.338z"
|
|
2565
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
2566
|
+
fill: "#FFF"
|
|
2567
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2568
|
+
d: "M19.094 4.03h-6.437V8h6.498c1.165 0 2.084-.889 2.084-2.015-.06-1.066-.98-1.955-2.145-1.955zM19.094 8.593h-6.437v3.97h6.498c1.165 0 2.084-.889 2.084-2.015-.06-1.067-.98-1.955-2.145-1.955zM7.017 8.06h4.966c-.245-2.371-2.391-4.267-4.966-4.267-2.758 0-5.027 2.074-5.027 4.681s2.269 4.682 5.027 4.682c2.698 0 4.904-2.015 5.027-4.563H7.017v-.534z"
|
|
2569
|
+
}))));
|
|
2570
|
+
|
|
2571
|
+
var s$4 = {"cardContainer":"_1N3yO","card":"_83cGn"};
|
|
2572
|
+
|
|
2573
|
+
const Cards = ({
|
|
2574
|
+
cards
|
|
2575
|
+
}) => {
|
|
2576
|
+
// We transform to a Set and back to avoid duplicate values (ex : amex, amex)
|
|
2577
|
+
const uniqueCards = Array.from(new Set(cards));
|
|
2578
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2579
|
+
"data-testid": "card-logos",
|
|
2580
|
+
className: cx(s$4.cardContainer, STATIC_CUSTOMISATION_CLASSES.cardContainer)
|
|
2581
|
+
}, uniqueCards.map(card => /*#__PURE__*/React.createElement("div", {
|
|
2582
|
+
key: card,
|
|
2583
|
+
className: s$4.card,
|
|
2584
|
+
"data-testid": `card-logo-${card}`
|
|
2585
|
+
}, card === 'cb' && /*#__PURE__*/React.createElement(CbCard, null), card === 'amex' && /*#__PURE__*/React.createElement(AmexCard, null), card === 'mastercard' && /*#__PURE__*/React.createElement(MasterCard, null), card === 'visa' && /*#__PURE__*/React.createElement(VisaCard, null))));
|
|
2418
2586
|
};
|
|
2419
2587
|
|
|
2420
|
-
var s$
|
|
2588
|
+
var s$5 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2421
2589
|
|
|
2422
2590
|
const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
2423
|
-
className: cx(s$
|
|
2591
|
+
className: cx(s$5.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2424
2592
|
"data-testid": "modal-info-element"
|
|
2425
2593
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2426
|
-
className: s$
|
|
2594
|
+
className: s$5.listItem
|
|
2427
2595
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2428
|
-
className: s$
|
|
2596
|
+
className: s$5.bullet
|
|
2429
2597
|
}, "1"), /*#__PURE__*/React.createElement("div", {
|
|
2430
2598
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2431
2599
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2435,9 +2603,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2435
2603
|
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2436
2604
|
}
|
|
2437
2605
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
2438
|
-
className: s$
|
|
2606
|
+
className: s$5.listItem
|
|
2439
2607
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2440
|
-
className: s$
|
|
2608
|
+
className: s$5.bullet
|
|
2441
2609
|
}, "2"), /*#__PURE__*/React.createElement("div", {
|
|
2442
2610
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2443
2611
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2447,9 +2615,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2447
2615
|
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2448
2616
|
}
|
|
2449
2617
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
2450
|
-
className: s$
|
|
2618
|
+
className: s$5.listItem
|
|
2451
2619
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2452
|
-
className: s$
|
|
2620
|
+
className: s$5.bullet
|
|
2453
2621
|
}, "3"), /*#__PURE__*/React.createElement("div", {
|
|
2454
2622
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2455
2623
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2492,20 +2660,20 @@ function LogoIcon({
|
|
|
2492
2660
|
}));
|
|
2493
2661
|
}
|
|
2494
2662
|
|
|
2495
|
-
var s$
|
|
2663
|
+
var s$6 = {"logo":"_3Oyv_"};
|
|
2496
2664
|
|
|
2497
2665
|
const Logo = () => /*#__PURE__*/React.createElement("div", {
|
|
2498
|
-
className: s$
|
|
2666
|
+
className: s$6.logo
|
|
2499
2667
|
}, /*#__PURE__*/React.createElement(LogoIcon, {
|
|
2500
2668
|
underlineColor: "#FF414D"
|
|
2501
2669
|
}));
|
|
2502
2670
|
|
|
2503
|
-
var s$
|
|
2671
|
+
var s$7 = {"title":"_3ERx-"};
|
|
2504
2672
|
|
|
2505
2673
|
const Title = ({
|
|
2506
2674
|
isSomePlanDeferred
|
|
2507
2675
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2508
|
-
className: cx(s$
|
|
2676
|
+
className: cx(s$7.title, STATIC_CUSTOMISATION_CLASSES.title),
|
|
2509
2677
|
"data-testid": "modal-title-element"
|
|
2510
2678
|
}, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2511
2679
|
id: 'eligibility-modal.title-deferred',
|
|
@@ -2521,41 +2689,48 @@ const Title = ({
|
|
|
2521
2689
|
}
|
|
2522
2690
|
}));
|
|
2523
2691
|
|
|
2524
|
-
var s$
|
|
2692
|
+
var s$8 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
|
|
2525
2693
|
|
|
2526
2694
|
const DesktopModal = ({
|
|
2527
2695
|
children,
|
|
2528
|
-
isSomePlanDeferred
|
|
2696
|
+
isSomePlanDeferred,
|
|
2697
|
+
cards
|
|
2529
2698
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2530
|
-
className: s$
|
|
2699
|
+
className: s$8.container,
|
|
2531
2700
|
"data-testid": "modal-container"
|
|
2532
2701
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2533
|
-
className: cx([s$
|
|
2702
|
+
className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2534
2703
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2535
2704
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2536
|
-
}), /*#__PURE__*/React.createElement(Info, null),
|
|
2537
|
-
|
|
2705
|
+
}), /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2706
|
+
cards: cards
|
|
2707
|
+
}), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
|
|
2708
|
+
className: cx(s$8.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
|
|
2538
2709
|
}, children));
|
|
2539
2710
|
|
|
2540
|
-
var s$
|
|
2711
|
+
var s$9 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
|
|
2541
2712
|
|
|
2542
|
-
var s$
|
|
2713
|
+
var s$a = {"container":"_2G7Ch"};
|
|
2543
2714
|
|
|
2544
2715
|
const MobileModal = ({
|
|
2545
2716
|
children,
|
|
2546
|
-
isSomePlanDeferred
|
|
2717
|
+
isSomePlanDeferred,
|
|
2718
|
+
cards
|
|
2547
2719
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2548
|
-
className: s$
|
|
2720
|
+
className: s$a.container,
|
|
2549
2721
|
"data-testid": "modal-container"
|
|
2550
2722
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2551
2723
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2552
|
-
}), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(
|
|
2724
|
+
}), children, /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2725
|
+
cards: cards
|
|
2726
|
+
}), /*#__PURE__*/React.createElement(Logo, null));
|
|
2553
2727
|
|
|
2554
2728
|
const EligibilityModal = ({
|
|
2555
2729
|
initialPlanIndex,
|
|
2556
2730
|
onClose,
|
|
2557
2731
|
eligibilityPlans,
|
|
2558
|
-
status
|
|
2732
|
+
status,
|
|
2733
|
+
cards
|
|
2559
2734
|
}) => {
|
|
2560
2735
|
const [currentPlanIndex, setCurrentPlanIndex] = useState(initialPlanIndex || 0);
|
|
2561
2736
|
const isBigScreen = useMediaQuery({
|
|
@@ -2571,11 +2746,12 @@ const EligibilityModal = ({
|
|
|
2571
2746
|
scrollable: true,
|
|
2572
2747
|
isOpen: true
|
|
2573
2748
|
}, /*#__PURE__*/React.createElement(ModalComponent, {
|
|
2574
|
-
isSomePlanDeferred: isSomePlanDeferred
|
|
2749
|
+
isSomePlanDeferred: isSomePlanDeferred,
|
|
2750
|
+
cards: cards
|
|
2575
2751
|
}, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
|
|
2576
|
-
className: s$
|
|
2752
|
+
className: s$9.loader
|
|
2577
2753
|
}, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
2578
|
-
className: s$
|
|
2754
|
+
className: s$9.noEligibility
|
|
2579
2755
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2580
2756
|
id: "eligibility-modal.no-eligibility",
|
|
2581
2757
|
defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\u00E9."
|
|
@@ -2596,29 +2772,31 @@ const ModalContainer = ({
|
|
|
2596
2772
|
purchaseAmount,
|
|
2597
2773
|
apiData,
|
|
2598
2774
|
configPlans,
|
|
2599
|
-
onClose
|
|
2775
|
+
onClose,
|
|
2776
|
+
cards
|
|
2600
2777
|
}) => {
|
|
2601
2778
|
const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
|
|
2602
2779
|
return /*#__PURE__*/React.createElement(EligibilityModal, {
|
|
2603
2780
|
initialPlanIndex: 0,
|
|
2604
2781
|
onClose: onClose,
|
|
2605
2782
|
eligibilityPlans: eligibilityPlans,
|
|
2606
|
-
status: status
|
|
2783
|
+
status: status,
|
|
2784
|
+
cards: cards
|
|
2607
2785
|
});
|
|
2608
2786
|
};
|
|
2609
2787
|
|
|
2610
|
-
var s$
|
|
2788
|
+
var s$b = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
|
|
2611
2789
|
|
|
2612
2790
|
const Loader = ({
|
|
2613
2791
|
className
|
|
2614
2792
|
}) => {
|
|
2615
2793
|
return /*#__PURE__*/React.createElement("div", {
|
|
2616
|
-
className: cx(s$
|
|
2794
|
+
className: cx(s$b.loadingIndicator, className),
|
|
2617
2795
|
"data-testid": "loader"
|
|
2618
2796
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2619
|
-
className: s$
|
|
2797
|
+
className: s$b.line1
|
|
2620
2798
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2621
|
-
className: s$
|
|
2799
|
+
className: s$b.line2
|
|
2622
2800
|
}));
|
|
2623
2801
|
};
|
|
2624
2802
|
|
|
@@ -2698,7 +2876,7 @@ const STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
2698
2876
|
activeOption: prefix$1 + '-active-option'
|
|
2699
2877
|
};
|
|
2700
2878
|
|
|
2701
|
-
var s$
|
|
2879
|
+
var s$c = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
|
|
2702
2880
|
|
|
2703
2881
|
const VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
|
|
2704
2882
|
const DEFAULT_TRANSITION_TIME = 5500;
|
|
@@ -2709,7 +2887,8 @@ const PaymentPlanWidget = ({
|
|
|
2709
2887
|
configPlans,
|
|
2710
2888
|
transitionDelay,
|
|
2711
2889
|
hideIfNotEligible,
|
|
2712
|
-
suggestedPaymentPlan
|
|
2890
|
+
suggestedPaymentPlan,
|
|
2891
|
+
cards
|
|
2713
2892
|
}) => {
|
|
2714
2893
|
const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
|
|
2715
2894
|
const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
|
|
@@ -2774,7 +2953,7 @@ const PaymentPlanWidget = ({
|
|
|
2774
2953
|
|
|
2775
2954
|
if (status === apiStatus.PENDING) {
|
|
2776
2955
|
return /*#__PURE__*/React.createElement("div", {
|
|
2777
|
-
className: cx(s$
|
|
2956
|
+
className: cx(s$c.widgetButton, s$c.pending)
|
|
2778
2957
|
}, /*#__PURE__*/React.createElement(Loader, null));
|
|
2779
2958
|
}
|
|
2780
2959
|
|
|
@@ -2792,36 +2971,37 @@ const PaymentPlanWidget = ({
|
|
|
2792
2971
|
|
|
2793
2972
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
2794
2973
|
onClick: handleOpenModal,
|
|
2795
|
-
className: cx(s$
|
|
2796
|
-
[s$
|
|
2797
|
-
[s$
|
|
2974
|
+
className: cx(s$c.widgetButton, {
|
|
2975
|
+
[s$c.clickable]: eligiblePlans.length > 0,
|
|
2976
|
+
[s$c.unClickable]: eligiblePlans.length === 0
|
|
2798
2977
|
}, STATIC_CUSTOMISATION_CLASSES$1.container),
|
|
2799
2978
|
"data-testid": "widget-button"
|
|
2800
2979
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2801
|
-
className: cx(s$
|
|
2980
|
+
className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
|
|
2802
2981
|
}, /*#__PURE__*/React.createElement(LogoIcon, {
|
|
2803
|
-
className: s$
|
|
2982
|
+
className: s$c.logo
|
|
2804
2983
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2805
|
-
className: cx(s$
|
|
2984
|
+
className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
|
|
2806
2985
|
}, eligibilityPlans.map((eligibilityPlan, key) => {
|
|
2807
2986
|
return /*#__PURE__*/React.createElement("div", {
|
|
2808
2987
|
key: key,
|
|
2809
2988
|
onMouseEnter: () => onHover(key),
|
|
2810
2989
|
onMouseOut: onLeave,
|
|
2811
|
-
className: cx(s$
|
|
2812
|
-
[cx(s$
|
|
2813
|
-
[cx(s$
|
|
2990
|
+
className: cx(s$c.plan, {
|
|
2991
|
+
[cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: current === key,
|
|
2992
|
+
[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
|
|
2814
2993
|
})
|
|
2815
2994
|
}, paymentPlanShorthandName(eligibilityPlan));
|
|
2816
2995
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
2817
|
-
className: cx(s$
|
|
2818
|
-
[cx(s$
|
|
2996
|
+
className: cx(s$c.info, {
|
|
2997
|
+
[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: eligibilityPlans[current] && !eligibilityPlans[current].eligible
|
|
2819
2998
|
}, STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
|
|
2820
2999
|
}, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React.createElement(EligibilityModal, {
|
|
2821
3000
|
initialPlanIndex: getIndexWithinEligiblePlans(current),
|
|
2822
3001
|
onClose: closeModal,
|
|
2823
3002
|
eligibilityPlans: eligiblePlans,
|
|
2824
|
-
status: status
|
|
3003
|
+
status: status,
|
|
3004
|
+
cards: cards
|
|
2825
3005
|
}));
|
|
2826
3006
|
};
|
|
2827
3007
|
|
|
@@ -2845,7 +3025,8 @@ class WidgetsController {
|
|
|
2845
3025
|
transitionDelay,
|
|
2846
3026
|
hideIfNotEligible,
|
|
2847
3027
|
suggestedPaymentPlan,
|
|
2848
|
-
locale = Locale.en
|
|
3028
|
+
locale = Locale.en,
|
|
3029
|
+
cards
|
|
2849
3030
|
} = options;
|
|
2850
3031
|
|
|
2851
3032
|
if (containerDiv) {
|
|
@@ -2857,7 +3038,8 @@ class WidgetsController {
|
|
|
2857
3038
|
configPlans: plans,
|
|
2858
3039
|
transitionDelay: transitionDelay,
|
|
2859
3040
|
hideIfNotEligible: hideIfNotEligible,
|
|
2860
|
-
suggestedPaymentPlan: suggestedPaymentPlan
|
|
3041
|
+
suggestedPaymentPlan: suggestedPaymentPlan,
|
|
3042
|
+
cards: cards
|
|
2861
3043
|
})), document.querySelector(container));
|
|
2862
3044
|
}
|
|
2863
3045
|
}
|
|
@@ -2868,7 +3050,8 @@ class WidgetsController {
|
|
|
2868
3050
|
clickableSelector,
|
|
2869
3051
|
purchaseAmount,
|
|
2870
3052
|
plans,
|
|
2871
|
-
locale = Locale.en
|
|
3053
|
+
locale = Locale.en,
|
|
3054
|
+
cards
|
|
2872
3055
|
} = options;
|
|
2873
3056
|
|
|
2874
3057
|
const close = () => containerDiv && unmountComponentAtNode(containerDiv);
|
|
@@ -2880,7 +3063,8 @@ class WidgetsController {
|
|
|
2880
3063
|
purchaseAmount: purchaseAmount,
|
|
2881
3064
|
apiData: this.apiData,
|
|
2882
3065
|
configPlans: plans,
|
|
2883
|
-
onClose: close
|
|
3066
|
+
onClose: close,
|
|
3067
|
+
cards: cards
|
|
2884
3068
|
})), document.querySelector(container));
|
|
2885
3069
|
}; // if clickableSelector is provided, add an onClick event handler to open the Modal.
|
|
2886
3070
|
|