@alma/widgets 2.5.0 → 2.7.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/dist/raw/widgets.css +23 -2
- package/dist/raw/widgets.js +260 -69
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +260 -69
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +255 -73
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +260 -69
- 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/ModalContainer.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/EligibilityModal/modal.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/Basics.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/Credit.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/CustomTransitionDelay.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/HideWidget.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/IneligibleOptions.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/LanguageCheck.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/LaunchModal.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/SuggestedPaymentPlan.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/__tests__/WithoutPlans.test.d.ts +1 -0
- 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/utils/index.test.d.ts +1 -0
- 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
package/dist/raw/widgets.css
CHANGED
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
|
|
320
320
|
._MPKjS {
|
|
321
321
|
padding: 32px 24px;
|
|
322
|
-
margin-bottom:
|
|
322
|
+
margin-bottom: 16px;
|
|
323
323
|
border-top: 1px solid var(--gray-300);
|
|
324
324
|
border-bottom: 1px solid var(--gray-300);
|
|
325
325
|
}
|
|
@@ -337,6 +337,13 @@
|
|
|
337
337
|
font-size: 18px;
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
+
._65ZpD {
|
|
341
|
+
background: var(--gray-200);
|
|
342
|
+
padding: 24px;
|
|
343
|
+
margin: 24px 0px;
|
|
344
|
+
border-radius: 8px;
|
|
345
|
+
}
|
|
346
|
+
|
|
340
347
|
._1ZIgu {
|
|
341
348
|
font-family: 'Eina04', sans-serif;
|
|
342
349
|
font-weight: 600;
|
|
@@ -344,6 +351,10 @@
|
|
|
344
351
|
margin-bottom: 24px;
|
|
345
352
|
}
|
|
346
353
|
|
|
354
|
+
._tUTZp {
|
|
355
|
+
text-align: right;
|
|
356
|
+
}
|
|
357
|
+
|
|
347
358
|
._1BUr8 {
|
|
348
359
|
margin-top: 8px;
|
|
349
360
|
}
|
|
@@ -354,9 +365,20 @@
|
|
|
354
365
|
margin: 0;
|
|
355
366
|
border-bottom: 1px solid transparent;
|
|
356
367
|
height: 100%;
|
|
368
|
+
max-height: 180px;
|
|
357
369
|
}
|
|
358
370
|
}
|
|
359
371
|
|
|
372
|
+
._1N3yO {
|
|
373
|
+
display: flex;
|
|
374
|
+
flex-direction: row;
|
|
375
|
+
width: 100%;
|
|
376
|
+
justify-content: center;
|
|
377
|
+
}
|
|
378
|
+
._83cGn {
|
|
379
|
+
margin: 8px 10px 0 0;
|
|
380
|
+
}
|
|
381
|
+
|
|
360
382
|
._180ro {
|
|
361
383
|
display: flex;
|
|
362
384
|
flex-direction: column;
|
|
@@ -440,7 +462,6 @@
|
|
|
440
462
|
height: 100%;
|
|
441
463
|
display: flex;
|
|
442
464
|
flex-direction: column;
|
|
443
|
-
justify-content: space-between;
|
|
444
465
|
width: 100%;
|
|
445
466
|
}
|
|
446
467
|
|
package/dist/raw/widgets.js
CHANGED
|
@@ -2196,7 +2196,9 @@ var STATIC_CUSTOMISATION_CLASSES = {
|
|
|
2196
2196
|
closeButton: prefix + '-close-button',
|
|
2197
2197
|
scheduleDetails: prefix + '-schedule-details',
|
|
2198
2198
|
scheduleTotal: prefix + '-schedule-total',
|
|
2199
|
-
scheduleCredit: prefix + '-schedule-credit'
|
|
2199
|
+
scheduleCredit: prefix + '-schedule-credit',
|
|
2200
|
+
cardContainer: prefix + '-card-logos',
|
|
2201
|
+
summary: prefix + '-summary'
|
|
2200
2202
|
};
|
|
2201
2203
|
|
|
2202
2204
|
var _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
|
|
@@ -2394,7 +2396,7 @@ var EligibilityPlansButtons = function EligibilityPlansButtons(_ref) {
|
|
|
2394
2396
|
}));
|
|
2395
2397
|
};
|
|
2396
2398
|
|
|
2397
|
-
var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","creditCost":"_1ZIgu","creditMessage":"_1BUr8"};
|
|
2399
|
+
var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary":"_65ZpD","creditCost":"_1ZIgu","creditCostAmount":"_tUTZp","creditMessage":"_1BUr8"};
|
|
2398
2400
|
|
|
2399
2401
|
var Schedule = function Schedule(_ref) {
|
|
2400
2402
|
var currentPlan = _ref.currentPlan;
|
|
@@ -2404,9 +2406,29 @@ var Schedule = function Schedule(_ref) {
|
|
|
2404
2406
|
var customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
|
|
2405
2407
|
var isCredit = currentPlan && currentPlan.installments_count > 4;
|
|
2406
2408
|
var intl = reactIntl.useIntl();
|
|
2407
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2409
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
2408
2410
|
className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
|
|
2409
2411
|
"data-testid": "modal-installments-element"
|
|
2412
|
+
}, ((currentPlan == null ? void 0 : currentPlan.payment_plan) || []).map(function (installment, index) {
|
|
2413
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2414
|
+
className: s$3.scheduleLine,
|
|
2415
|
+
key: index
|
|
2416
|
+
}, /*#__PURE__*/React__default.createElement("span", null, dateFns.isToday(installment.due_date * 1000) ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2417
|
+
id: "installments.today",
|
|
2418
|
+
defaultMessage: "Aujourd'hui"
|
|
2419
|
+
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedDate, {
|
|
2420
|
+
value: installment.due_date * 1000,
|
|
2421
|
+
day: "numeric",
|
|
2422
|
+
month: "long",
|
|
2423
|
+
year: "numeric"
|
|
2424
|
+
})), /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
|
|
2425
|
+
value: priceFromCents(installment.total_amount),
|
|
2426
|
+
style: "currency",
|
|
2427
|
+
currency: "EUR"
|
|
2428
|
+
})));
|
|
2429
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
2430
|
+
className: cx(s$3.summary, STATIC_CUSTOMISATION_CLASSES.summary),
|
|
2431
|
+
"data-testid": "modal-summary"
|
|
2410
2432
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2411
2433
|
className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
|
|
2412
2434
|
}, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
@@ -2424,7 +2446,9 @@ var Schedule = function Schedule(_ref) {
|
|
|
2424
2446
|
})) : /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2425
2447
|
id: "eligibility-modal.cost",
|
|
2426
2448
|
defaultMessage: "Dont frais"
|
|
2427
|
-
})), /*#__PURE__*/React__default.createElement("span",
|
|
2449
|
+
})), /*#__PURE__*/React__default.createElement("span", {
|
|
2450
|
+
className: s$3.creditCostAmount
|
|
2451
|
+
}, isCredit ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2428
2452
|
id: "eligibility-modal.credit-cost-amount",
|
|
2429
2453
|
defaultMessage: "{creditCost} (TAEG {TAEG})",
|
|
2430
2454
|
values: {
|
|
@@ -2441,41 +2465,192 @@ var Schedule = function Schedule(_ref) {
|
|
|
2441
2465
|
value: customerFees,
|
|
2442
2466
|
style: "currency",
|
|
2443
2467
|
currency: "EUR"
|
|
2444
|
-
}))),
|
|
2445
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2446
|
-
className: s$3.scheduleLine,
|
|
2447
|
-
key: index
|
|
2448
|
-
}, /*#__PURE__*/React__default.createElement("span", null, dateFns.isToday(installment.due_date * 1000) ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2449
|
-
id: "installments.today",
|
|
2450
|
-
defaultMessage: "Aujourd'hui"
|
|
2451
|
-
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedDate, {
|
|
2452
|
-
value: installment.due_date * 1000,
|
|
2453
|
-
day: "numeric",
|
|
2454
|
-
month: "long",
|
|
2455
|
-
year: "numeric"
|
|
2456
|
-
})), /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
|
|
2457
|
-
value: priceFromCents(installment.total_amount),
|
|
2458
|
-
style: "currency",
|
|
2459
|
-
currency: "EUR"
|
|
2460
|
-
})));
|
|
2461
|
-
}), isCredit && /*#__PURE__*/React__default.createElement("p", {
|
|
2468
|
+
}))), isCredit && /*#__PURE__*/React__default.createElement("p", {
|
|
2462
2469
|
className: s$3.creditMessage
|
|
2463
2470
|
}, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2464
2471
|
id: "eligibility-modal.credit-commitment",
|
|
2465
2472
|
defaultMessage: "Un cr\xE9dit vous engage et doit \xEAtre rembours\xE9. V\xE9rifiez vos capacit\xE9s de remboursement\n avant de vous engager."
|
|
2473
|
+
}))));
|
|
2474
|
+
};
|
|
2475
|
+
|
|
2476
|
+
var AmexCard = function AmexCard() {
|
|
2477
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
2478
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2479
|
+
width: "24",
|
|
2480
|
+
height: "16",
|
|
2481
|
+
viewBox: "0 0 24 16"
|
|
2482
|
+
}, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
|
2483
|
+
id: "cardamex",
|
|
2484
|
+
x1: "10.914%",
|
|
2485
|
+
x2: "87.432%",
|
|
2486
|
+
y1: "86.279%",
|
|
2487
|
+
y2: "15.035%"
|
|
2488
|
+
}, /*#__PURE__*/React__default.createElement("stop", {
|
|
2489
|
+
offset: "0%",
|
|
2490
|
+
stopColor: "#3FA9F5"
|
|
2491
|
+
}), /*#__PURE__*/React__default.createElement("stop", {
|
|
2492
|
+
offset: "100%",
|
|
2493
|
+
stopColor: "#0071BC"
|
|
2494
|
+
}))), /*#__PURE__*/React__default.createElement("g", {
|
|
2495
|
+
fill: "none",
|
|
2496
|
+
fillRule: "evenodd"
|
|
2497
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2498
|
+
fill: "url(#cardamex)",
|
|
2499
|
+
fillRule: "nonzero",
|
|
2500
|
+
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"
|
|
2501
|
+
}), /*#__PURE__*/React__default.createElement("g", {
|
|
2502
|
+
fill: "#FFF"
|
|
2503
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2504
|
+
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"
|
|
2505
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
2506
|
+
fillRule: "nonzero",
|
|
2507
|
+
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"
|
|
2508
|
+
}))));
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
var VisaCard = function VisaCard() {
|
|
2512
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
2513
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2514
|
+
width: "24",
|
|
2515
|
+
height: "16",
|
|
2516
|
+
viewBox: "0 0 24 16"
|
|
2517
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
2518
|
+
fill: "none",
|
|
2519
|
+
fillRule: "nonzero"
|
|
2520
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2521
|
+
fill: "#FCFCFC",
|
|
2522
|
+
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"
|
|
2523
|
+
}), ' ', /*#__PURE__*/React__default.createElement("path", {
|
|
2524
|
+
fill: "#005098",
|
|
2525
|
+
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"
|
|
2526
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
2527
|
+
fill: "#F6A500",
|
|
2528
|
+
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"
|
|
2529
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
2530
|
+
fill: "#0A5296",
|
|
2531
|
+
d: "M23.937 3.23H0V1.316C0 .598.627 0 1.379 0H22.62C23.373 0 24 .598 24 1.316V3.23h-.063z"
|
|
2532
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
2533
|
+
fill: "#F4A428",
|
|
2534
|
+
d: "M.063 13H24v1.8c0 .655-.625 1.2-1.375 1.2H1.375C.625 16 0 15.455 0 14.8V13h.063z"
|
|
2466
2535
|
})));
|
|
2467
2536
|
};
|
|
2468
2537
|
|
|
2469
|
-
var
|
|
2538
|
+
var MasterCard = function MasterCard() {
|
|
2539
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
2540
|
+
width: "24px",
|
|
2541
|
+
height: "16px",
|
|
2542
|
+
viewBox: "0 0 24 16",
|
|
2543
|
+
version: "1.1",
|
|
2544
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2545
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
2546
|
+
id: "Parcours-1C-B",
|
|
2547
|
+
stroke: "none",
|
|
2548
|
+
strokeWidth: "1",
|
|
2549
|
+
fill: "none",
|
|
2550
|
+
fillRule: "evenodd"
|
|
2551
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
2552
|
+
id: "mobile-1C-Paiement-V1",
|
|
2553
|
+
transform: "translate(-269.000000, -313.000000)"
|
|
2554
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
2555
|
+
id: "mastercard",
|
|
2556
|
+
transform: "translate(269.000000, 313.000000)"
|
|
2557
|
+
}, /*#__PURE__*/React__default.createElement("rect", {
|
|
2558
|
+
id: "Rectangle",
|
|
2559
|
+
fill: "#FFFFFF",
|
|
2560
|
+
x: "0",
|
|
2561
|
+
y: "0",
|
|
2562
|
+
width: "24",
|
|
2563
|
+
height: "16",
|
|
2564
|
+
rx: "1"
|
|
2565
|
+
}), /*#__PURE__*/React__default.createElement("g", {
|
|
2566
|
+
id: "Group-6",
|
|
2567
|
+
transform: "translate(4.000000, 3.000000)"
|
|
2568
|
+
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
2569
|
+
id: "Oval-4-Copy",
|
|
2570
|
+
fill: "#EA001B",
|
|
2571
|
+
cx: "5.05263158",
|
|
2572
|
+
cy: "5.05263158",
|
|
2573
|
+
r: "5.05263158"
|
|
2574
|
+
}), /*#__PURE__*/React__default.createElement("circle", {
|
|
2575
|
+
id: "Oval-4",
|
|
2576
|
+
fillOpacity: "0.25",
|
|
2577
|
+
fill: "#F79F1A",
|
|
2578
|
+
cx: "10.9473684",
|
|
2579
|
+
cy: "5.05263158",
|
|
2580
|
+
r: "5.05263158"
|
|
2581
|
+
}), /*#__PURE__*/React__default.createElement("circle", {
|
|
2582
|
+
id: "Oval-4-Copy-2",
|
|
2583
|
+
fillOpacity: "0.9",
|
|
2584
|
+
fill: "#F79F1A",
|
|
2585
|
+
cx: "10.9473684",
|
|
2586
|
+
cy: "5.05263158",
|
|
2587
|
+
r: "5.05263158"
|
|
2588
|
+
}), /*#__PURE__*/React__default.createElement("circle", {
|
|
2589
|
+
id: "Oval-4-Copy-3",
|
|
2590
|
+
fillOpacity: "0.3",
|
|
2591
|
+
fill: "#EA001B",
|
|
2592
|
+
cx: "5.05263158",
|
|
2593
|
+
cy: "5.05263158",
|
|
2594
|
+
r: "5.05263158"
|
|
2595
|
+
}))))));
|
|
2596
|
+
};
|
|
2597
|
+
|
|
2598
|
+
var CbCard = function CbCard() {
|
|
2599
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
2600
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2601
|
+
width: "24",
|
|
2602
|
+
height: "16",
|
|
2603
|
+
viewBox: "0 0 24 16"
|
|
2604
|
+
}, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
|
2605
|
+
id: "cardcb",
|
|
2606
|
+
x1: "5.842%",
|
|
2607
|
+
x2: "95.393%",
|
|
2608
|
+
y1: "81.753%",
|
|
2609
|
+
y2: "17.344%"
|
|
2610
|
+
}, /*#__PURE__*/React__default.createElement("stop", {
|
|
2611
|
+
offset: "0%",
|
|
2612
|
+
stopColor: "#39B54A"
|
|
2613
|
+
}), ' ', /*#__PURE__*/React__default.createElement("stop", {
|
|
2614
|
+
offset: "100%",
|
|
2615
|
+
stopColor: "#0A5296"
|
|
2616
|
+
}))), /*#__PURE__*/React__default.createElement("g", {
|
|
2617
|
+
fill: "none",
|
|
2618
|
+
fillRule: "nonzero"
|
|
2619
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2620
|
+
fill: "url(#cardcb)",
|
|
2621
|
+
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"
|
|
2622
|
+
}), /*#__PURE__*/React__default.createElement("g", {
|
|
2623
|
+
fill: "#FFF"
|
|
2624
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2625
|
+
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"
|
|
2626
|
+
}))));
|
|
2627
|
+
};
|
|
2628
|
+
|
|
2629
|
+
var s$4 = {"cardContainer":"_1N3yO","card":"_83cGn"};
|
|
2630
|
+
|
|
2631
|
+
var Cards = function Cards(_ref) {
|
|
2632
|
+
var cards = _ref.cards;
|
|
2633
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2634
|
+
className: cx(s$4.cardContainer, STATIC_CUSTOMISATION_CLASSES.cardContainer)
|
|
2635
|
+
}, cards.map(function (card) {
|
|
2636
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2637
|
+
key: card,
|
|
2638
|
+
className: s$4.card,
|
|
2639
|
+
"data-testid": "card-logo-" + card
|
|
2640
|
+
}, card === 'cb' && /*#__PURE__*/React__default.createElement(CbCard, null), card === 'amex' && /*#__PURE__*/React__default.createElement(AmexCard, null), card === 'mastercard' && /*#__PURE__*/React__default.createElement(MasterCard, null), card === 'visa' && /*#__PURE__*/React__default.createElement(VisaCard, null));
|
|
2641
|
+
}));
|
|
2642
|
+
};
|
|
2643
|
+
|
|
2644
|
+
var s$5 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2470
2645
|
|
|
2471
2646
|
var Info = function Info() {
|
|
2472
2647
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2473
|
-
className: cx(s$
|
|
2648
|
+
className: cx(s$5.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2474
2649
|
"data-testid": "modal-info-element"
|
|
2475
2650
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2476
|
-
className: s$
|
|
2651
|
+
className: s$5.listItem
|
|
2477
2652
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2478
|
-
className: s$
|
|
2653
|
+
className: s$5.bullet
|
|
2479
2654
|
}, "1"), /*#__PURE__*/React__default.createElement("div", {
|
|
2480
2655
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2481
2656
|
}, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
@@ -2487,9 +2662,9 @@ var Info = function Info() {
|
|
|
2487
2662
|
}
|
|
2488
2663
|
}
|
|
2489
2664
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2490
|
-
className: s$
|
|
2665
|
+
className: s$5.listItem
|
|
2491
2666
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2492
|
-
className: s$
|
|
2667
|
+
className: s$5.bullet
|
|
2493
2668
|
}, "2"), /*#__PURE__*/React__default.createElement("div", {
|
|
2494
2669
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2495
2670
|
}, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
@@ -2501,9 +2676,9 @@ var Info = function Info() {
|
|
|
2501
2676
|
}
|
|
2502
2677
|
}
|
|
2503
2678
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2504
|
-
className: s$
|
|
2679
|
+
className: s$5.listItem
|
|
2505
2680
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2506
|
-
className: s$
|
|
2681
|
+
className: s$5.bullet
|
|
2507
2682
|
}, "3"), /*#__PURE__*/React__default.createElement("div", {
|
|
2508
2683
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2509
2684
|
}, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
@@ -2550,22 +2725,22 @@ function LogoIcon(_ref) {
|
|
|
2550
2725
|
}));
|
|
2551
2726
|
}
|
|
2552
2727
|
|
|
2553
|
-
var s$
|
|
2728
|
+
var s$6 = {"logo":"_3Oyv_"};
|
|
2554
2729
|
|
|
2555
2730
|
var Logo = function Logo() {
|
|
2556
2731
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2557
|
-
className: s$
|
|
2732
|
+
className: s$6.logo
|
|
2558
2733
|
}, /*#__PURE__*/React__default.createElement(LogoIcon, {
|
|
2559
2734
|
underlineColor: "#FF414D"
|
|
2560
2735
|
}));
|
|
2561
2736
|
};
|
|
2562
2737
|
|
|
2563
|
-
var s$
|
|
2738
|
+
var s$7 = {"title":"_3ERx-"};
|
|
2564
2739
|
|
|
2565
2740
|
var Title = function Title(_ref) {
|
|
2566
2741
|
var isSomePlanDeferred = _ref.isSomePlanDeferred;
|
|
2567
2742
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2568
|
-
className: cx(s$
|
|
2743
|
+
className: cx(s$7.title, STATIC_CUSTOMISATION_CLASSES.title),
|
|
2569
2744
|
"data-testid": "modal-title-element"
|
|
2570
2745
|
}, isSomePlanDeferred ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2571
2746
|
id: 'eligibility-modal.title-deferred',
|
|
@@ -2586,43 +2761,50 @@ var Title = function Title(_ref) {
|
|
|
2586
2761
|
}));
|
|
2587
2762
|
};
|
|
2588
2763
|
|
|
2589
|
-
var s$
|
|
2764
|
+
var s$8 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
|
|
2590
2765
|
|
|
2591
2766
|
var DesktopModal = function DesktopModal(_ref) {
|
|
2592
2767
|
var children = _ref.children,
|
|
2593
|
-
isSomePlanDeferred = _ref.isSomePlanDeferred
|
|
2768
|
+
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2769
|
+
cards = _ref.cards;
|
|
2594
2770
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2595
|
-
className: s$
|
|
2771
|
+
className: s$8.container,
|
|
2596
2772
|
"data-testid": "modal-container"
|
|
2597
2773
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2598
|
-
className: cx([s$
|
|
2774
|
+
className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2599
2775
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
2600
2776
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2601
|
-
}), /*#__PURE__*/React__default.createElement(Info, null),
|
|
2602
|
-
|
|
2777
|
+
}), /*#__PURE__*/React__default.createElement(Info, null), cards && /*#__PURE__*/React__default.createElement(Cards, {
|
|
2778
|
+
cards: cards
|
|
2779
|
+
}), /*#__PURE__*/React__default.createElement(Logo, null)), /*#__PURE__*/React__default.createElement("div", {
|
|
2780
|
+
className: cx(s$8.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
|
|
2603
2781
|
}, children));
|
|
2604
2782
|
};
|
|
2605
2783
|
|
|
2606
|
-
var s$
|
|
2784
|
+
var s$9 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
|
|
2607
2785
|
|
|
2608
|
-
var s$
|
|
2786
|
+
var s$a = {"container":"_2G7Ch"};
|
|
2609
2787
|
|
|
2610
2788
|
var MobileModal = function MobileModal(_ref) {
|
|
2611
2789
|
var children = _ref.children,
|
|
2612
|
-
isSomePlanDeferred = _ref.isSomePlanDeferred
|
|
2790
|
+
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2791
|
+
cards = _ref.cards;
|
|
2613
2792
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2614
|
-
className: s$
|
|
2793
|
+
className: s$a.container,
|
|
2615
2794
|
"data-testid": "modal-container"
|
|
2616
2795
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
2617
2796
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2618
|
-
}), children, /*#__PURE__*/React__default.createElement(Info, null), /*#__PURE__*/React__default.createElement(
|
|
2797
|
+
}), children, /*#__PURE__*/React__default.createElement(Info, null), cards && /*#__PURE__*/React__default.createElement(Cards, {
|
|
2798
|
+
cards: cards
|
|
2799
|
+
}), /*#__PURE__*/React__default.createElement(Logo, null));
|
|
2619
2800
|
};
|
|
2620
2801
|
|
|
2621
2802
|
var EligibilityModal = function EligibilityModal(_ref) {
|
|
2622
2803
|
var initialPlanIndex = _ref.initialPlanIndex,
|
|
2623
2804
|
onClose = _ref.onClose,
|
|
2624
2805
|
eligibilityPlans = _ref.eligibilityPlans,
|
|
2625
|
-
status = _ref.status
|
|
2806
|
+
status = _ref.status,
|
|
2807
|
+
cards = _ref.cards;
|
|
2626
2808
|
|
|
2627
2809
|
var _useState = React.useState(initialPlanIndex || 0),
|
|
2628
2810
|
currentPlanIndex = _useState[0],
|
|
@@ -2645,11 +2827,12 @@ var EligibilityModal = function EligibilityModal(_ref) {
|
|
|
2645
2827
|
scrollable: true,
|
|
2646
2828
|
isOpen: true
|
|
2647
2829
|
}, /*#__PURE__*/React__default.createElement(ModalComponent, {
|
|
2648
|
-
isSomePlanDeferred: isSomePlanDeferred
|
|
2830
|
+
isSomePlanDeferred: isSomePlanDeferred,
|
|
2831
|
+
cards: cards
|
|
2649
2832
|
}, status === apiStatus.PENDING && /*#__PURE__*/React__default.createElement("div", {
|
|
2650
|
-
className: s$
|
|
2833
|
+
className: s$9.loader
|
|
2651
2834
|
}, /*#__PURE__*/React__default.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
2652
|
-
className: s$
|
|
2835
|
+
className: s$9.noEligibility
|
|
2653
2836
|
}, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2654
2837
|
id: "eligibility-modal.no-eligibility",
|
|
2655
2838
|
defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\xE9."
|
|
@@ -2670,7 +2853,8 @@ var ModalContainer = function ModalContainer(_ref) {
|
|
|
2670
2853
|
var purchaseAmount = _ref.purchaseAmount,
|
|
2671
2854
|
apiData = _ref.apiData,
|
|
2672
2855
|
configPlans = _ref.configPlans,
|
|
2673
|
-
onClose = _ref.onClose
|
|
2856
|
+
onClose = _ref.onClose,
|
|
2857
|
+
cards = _ref.cards;
|
|
2674
2858
|
|
|
2675
2859
|
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
|
|
2676
2860
|
eligibilityPlans = _useFetchEligibility[0],
|
|
@@ -2680,21 +2864,22 @@ var ModalContainer = function ModalContainer(_ref) {
|
|
|
2680
2864
|
initialPlanIndex: 0,
|
|
2681
2865
|
onClose: onClose,
|
|
2682
2866
|
eligibilityPlans: eligibilityPlans,
|
|
2683
|
-
status: status
|
|
2867
|
+
status: status,
|
|
2868
|
+
cards: cards
|
|
2684
2869
|
});
|
|
2685
2870
|
};
|
|
2686
2871
|
|
|
2687
|
-
var s$
|
|
2872
|
+
var s$b = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
|
|
2688
2873
|
|
|
2689
2874
|
var Loader = function Loader(_ref) {
|
|
2690
2875
|
var className = _ref.className;
|
|
2691
2876
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2692
|
-
className: cx(s$
|
|
2877
|
+
className: cx(s$b.loadingIndicator, className),
|
|
2693
2878
|
"data-testid": "loader"
|
|
2694
2879
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2695
|
-
className: s$
|
|
2880
|
+
className: s$b.line1
|
|
2696
2881
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
2697
|
-
className: s$
|
|
2882
|
+
className: s$b.line2
|
|
2698
2883
|
}));
|
|
2699
2884
|
};
|
|
2700
2885
|
|
|
@@ -2787,7 +2972,7 @@ var STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
2787
2972
|
activeOption: prefix$1 + '-active-option'
|
|
2788
2973
|
};
|
|
2789
2974
|
|
|
2790
|
-
var s$
|
|
2975
|
+
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"};
|
|
2791
2976
|
|
|
2792
2977
|
var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
|
|
2793
2978
|
var DEFAULT_TRANSITION_TIME = 5500;
|
|
@@ -2800,7 +2985,8 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
2800
2985
|
configPlans = _ref.configPlans,
|
|
2801
2986
|
transitionDelay = _ref.transitionDelay,
|
|
2802
2987
|
hideIfNotEligible = _ref.hideIfNotEligible,
|
|
2803
|
-
suggestedPaymentPlan = _ref.suggestedPaymentPlan
|
|
2988
|
+
suggestedPaymentPlan = _ref.suggestedPaymentPlan,
|
|
2989
|
+
cards = _ref.cards;
|
|
2804
2990
|
|
|
2805
2991
|
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
|
|
2806
2992
|
eligibilityPlans = _useFetchEligibility[0],
|
|
@@ -2880,7 +3066,7 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
2880
3066
|
|
|
2881
3067
|
if (status === apiStatus.PENDING) {
|
|
2882
3068
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2883
|
-
className: cx(s$
|
|
3069
|
+
className: cx(s$c.widgetButton, s$c.pending)
|
|
2884
3070
|
}, /*#__PURE__*/React__default.createElement(Loader, null));
|
|
2885
3071
|
}
|
|
2886
3072
|
|
|
@@ -2898,14 +3084,14 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
2898
3084
|
|
|
2899
3085
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
2900
3086
|
onClick: handleOpenModal,
|
|
2901
|
-
className: cx(s$
|
|
3087
|
+
className: cx(s$c.widgetButton, (_cx = {}, _cx[s$c.clickable] = eligiblePlans.length > 0, _cx[s$c.unClickable] = eligiblePlans.length === 0, _cx), STATIC_CUSTOMISATION_CLASSES$1.container),
|
|
2902
3088
|
"data-testid": "widget-button"
|
|
2903
3089
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2904
|
-
className: cx(s$
|
|
3090
|
+
className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
|
|
2905
3091
|
}, /*#__PURE__*/React__default.createElement(LogoIcon, {
|
|
2906
|
-
className: s$
|
|
3092
|
+
className: s$c.logo
|
|
2907
3093
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
2908
|
-
className: cx(s$
|
|
3094
|
+
className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
|
|
2909
3095
|
}, eligibilityPlans.map(function (eligibilityPlan, key) {
|
|
2910
3096
|
var _cx2;
|
|
2911
3097
|
|
|
@@ -2915,15 +3101,16 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
2915
3101
|
return onHover(key);
|
|
2916
3102
|
},
|
|
2917
3103
|
onMouseOut: onLeave,
|
|
2918
|
-
className: cx(s$
|
|
3104
|
+
className: cx(s$c.plan, (_cx2 = {}, _cx2[cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = current === key, _cx2[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
|
|
2919
3105
|
}, paymentPlanShorthandName(eligibilityPlan));
|
|
2920
3106
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2921
|
-
className: cx(s$
|
|
3107
|
+
className: cx(s$c.info, (_cx3 = {}, _cx3[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3), STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
|
|
2922
3108
|
}, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React__default.createElement(EligibilityModal, {
|
|
2923
3109
|
initialPlanIndex: getIndexWithinEligiblePlans(current),
|
|
2924
3110
|
onClose: closeModal,
|
|
2925
3111
|
eligibilityPlans: eligiblePlans,
|
|
2926
|
-
status: status
|
|
3112
|
+
status: status,
|
|
3113
|
+
cards: cards
|
|
2927
3114
|
}));
|
|
2928
3115
|
};
|
|
2929
3116
|
|
|
@@ -2951,7 +3138,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
2951
3138
|
hideIfNotEligible = options.hideIfNotEligible,
|
|
2952
3139
|
suggestedPaymentPlan = options.suggestedPaymentPlan,
|
|
2953
3140
|
_options$locale = options.locale,
|
|
2954
|
-
locale = _options$locale === void 0 ? Locale.en : _options$locale
|
|
3141
|
+
locale = _options$locale === void 0 ? Locale.en : _options$locale,
|
|
3142
|
+
cards = options.cards;
|
|
2955
3143
|
|
|
2956
3144
|
if (containerDiv) {
|
|
2957
3145
|
reactDom.render( /*#__PURE__*/React__default.createElement(Provider, {
|
|
@@ -2962,7 +3150,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
2962
3150
|
configPlans: plans,
|
|
2963
3151
|
transitionDelay: transitionDelay,
|
|
2964
3152
|
hideIfNotEligible: hideIfNotEligible,
|
|
2965
|
-
suggestedPaymentPlan: suggestedPaymentPlan
|
|
3153
|
+
suggestedPaymentPlan: suggestedPaymentPlan,
|
|
3154
|
+
cards: cards
|
|
2966
3155
|
})), document.querySelector(container));
|
|
2967
3156
|
}
|
|
2968
3157
|
}
|
|
@@ -2973,7 +3162,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
2973
3162
|
_purchaseAmount = options.purchaseAmount,
|
|
2974
3163
|
_plans = options.plans,
|
|
2975
3164
|
_options$locale2 = options.locale,
|
|
2976
|
-
_locale = _options$locale2 === void 0 ? Locale.en : _options$locale2
|
|
3165
|
+
_locale = _options$locale2 === void 0 ? Locale.en : _options$locale2,
|
|
3166
|
+
_cards = options.cards;
|
|
2977
3167
|
|
|
2978
3168
|
var close = function close() {
|
|
2979
3169
|
return containerDiv && reactDom.unmountComponentAtNode(containerDiv);
|
|
@@ -2986,7 +3176,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
2986
3176
|
purchaseAmount: _purchaseAmount,
|
|
2987
3177
|
apiData: _this.apiData,
|
|
2988
3178
|
configPlans: _plans,
|
|
2989
|
-
onClose: close
|
|
3179
|
+
onClose: close,
|
|
3180
|
+
cards: _cards
|
|
2990
3181
|
})), document.querySelector(_container));
|
|
2991
3182
|
}; // if clickableSelector is provided, add an onClick event handler to open the Modal.
|
|
2992
3183
|
|