@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.
Files changed (43) hide show
  1. package/dist/raw/widgets.css +23 -2
  2. package/dist/raw/widgets.js +260 -69
  3. package/dist/raw/widgets.js.map +1 -1
  4. package/dist/raw/widgets.m.js +260 -69
  5. package/dist/raw/widgets.m.js.map +1 -1
  6. package/dist/raw/widgets.modern.js +255 -73
  7. package/dist/raw/widgets.modern.js.map +1 -1
  8. package/dist/raw/widgets.umd.js +260 -69
  9. package/dist/raw/widgets.umd.js.map +1 -1
  10. package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +2 -0
  11. package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +2 -0
  12. package/dist/types/Widgets/EligibilityModal/ModalContainer.d.ts +2 -1
  13. package/dist/types/Widgets/EligibilityModal/ModalContainer.test.d.ts +1 -0
  14. package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +2 -0
  15. package/dist/types/Widgets/EligibilityModal/components/Cards/index.d.ts +7 -0
  16. package/dist/types/Widgets/EligibilityModal/index.d.ts +2 -1
  17. package/dist/types/Widgets/EligibilityModal/modal.test.d.ts +1 -0
  18. package/dist/types/Widgets/PaymentPlans/__tests__/Basics.test.d.ts +1 -0
  19. package/dist/types/Widgets/PaymentPlans/__tests__/Credit.test.d.ts +1 -0
  20. package/dist/types/Widgets/PaymentPlans/__tests__/CustomTransitionDelay.test.d.ts +1 -0
  21. package/dist/types/Widgets/PaymentPlans/__tests__/HideWidget.test.d.ts +1 -0
  22. package/dist/types/Widgets/PaymentPlans/__tests__/IneligibleOptions.test.d.ts +1 -0
  23. package/dist/types/Widgets/PaymentPlans/__tests__/LanguageCheck.test.d.ts +1 -0
  24. package/dist/types/Widgets/PaymentPlans/__tests__/LaunchModal.test.d.ts +1 -0
  25. package/dist/types/Widgets/PaymentPlans/__tests__/SuggestedPaymentPlan.test.d.ts +1 -0
  26. package/dist/types/Widgets/PaymentPlans/__tests__/WithoutPlans.test.d.ts +1 -0
  27. package/dist/types/Widgets/PaymentPlans/index.d.ts +2 -1
  28. package/dist/types/assets/cards/amex.d.ts +3 -0
  29. package/dist/types/assets/cards/cb.d.ts +3 -0
  30. package/dist/types/assets/cards/mastercard.d.ts +3 -0
  31. package/dist/types/assets/cards/visa.d.ts +3 -0
  32. package/dist/types/types.d.ts +3 -0
  33. package/dist/types/utils/index.test.d.ts +1 -0
  34. package/dist/widgets.css +3 -2
  35. package/dist/widgets.js +1 -1
  36. package/dist/widgets.js.map +1 -1
  37. package/dist/widgets.m.js +1 -1
  38. package/dist/widgets.m.js.map +1 -1
  39. package/dist/widgets.modern.js +1 -1
  40. package/dist/widgets.modern.js.map +1 -1
  41. package/dist/widgets.umd.js +1 -1
  42. package/dist/widgets.umd.js.map +1 -1
  43. package/package.json +1 -1
@@ -2193,7 +2193,9 @@ var STATIC_CUSTOMISATION_CLASSES = {
2193
2193
  closeButton: prefix + '-close-button',
2194
2194
  scheduleDetails: prefix + '-schedule-details',
2195
2195
  scheduleTotal: prefix + '-schedule-total',
2196
- scheduleCredit: prefix + '-schedule-credit'
2196
+ scheduleCredit: prefix + '-schedule-credit',
2197
+ cardContainer: prefix + '-card-logos',
2198
+ summary: prefix + '-summary'
2197
2199
  };
2198
2200
 
2199
2201
  var _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
@@ -2391,7 +2393,7 @@ var EligibilityPlansButtons = function EligibilityPlansButtons(_ref) {
2391
2393
  }));
2392
2394
  };
2393
2395
 
2394
- var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","creditCost":"_1ZIgu","creditMessage":"_1BUr8"};
2396
+ var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary":"_65ZpD","creditCost":"_1ZIgu","creditCostAmount":"_tUTZp","creditMessage":"_1BUr8"};
2395
2397
 
2396
2398
  var Schedule = function Schedule(_ref) {
2397
2399
  var currentPlan = _ref.currentPlan;
@@ -2401,9 +2403,29 @@ var Schedule = function Schedule(_ref) {
2401
2403
  var customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
2402
2404
  var isCredit = currentPlan && currentPlan.installments_count > 4;
2403
2405
  var intl = useIntl();
2404
- return /*#__PURE__*/React.createElement("div", {
2406
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2405
2407
  className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
2406
2408
  "data-testid": "modal-installments-element"
2409
+ }, ((currentPlan == null ? void 0 : currentPlan.payment_plan) || []).map(function (installment, index) {
2410
+ return /*#__PURE__*/React.createElement("div", {
2411
+ className: s$3.scheduleLine,
2412
+ key: index
2413
+ }, /*#__PURE__*/React.createElement("span", null, isToday(installment.due_date * 1000) ? /*#__PURE__*/React.createElement(FormattedMessage, {
2414
+ id: "installments.today",
2415
+ defaultMessage: "Aujourd'hui"
2416
+ }) : /*#__PURE__*/React.createElement(FormattedDate, {
2417
+ value: installment.due_date * 1000,
2418
+ day: "numeric",
2419
+ month: "long",
2420
+ year: "numeric"
2421
+ })), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedNumber, {
2422
+ value: priceFromCents(installment.total_amount),
2423
+ style: "currency",
2424
+ currency: "EUR"
2425
+ })));
2426
+ })), /*#__PURE__*/React.createElement("div", {
2427
+ className: cx(s$3.summary, STATIC_CUSTOMISATION_CLASSES.summary),
2428
+ "data-testid": "modal-summary"
2407
2429
  }, /*#__PURE__*/React.createElement("div", {
2408
2430
  className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
2409
2431
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2421,7 +2443,9 @@ var Schedule = function Schedule(_ref) {
2421
2443
  })) : /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
2422
2444
  id: "eligibility-modal.cost",
2423
2445
  defaultMessage: "Dont frais"
2424
- })), /*#__PURE__*/React.createElement("span", null, isCredit ? /*#__PURE__*/React.createElement(FormattedMessage, {
2446
+ })), /*#__PURE__*/React.createElement("span", {
2447
+ className: s$3.creditCostAmount
2448
+ }, isCredit ? /*#__PURE__*/React.createElement(FormattedMessage, {
2425
2449
  id: "eligibility-modal.credit-cost-amount",
2426
2450
  defaultMessage: "{creditCost} (TAEG {TAEG})",
2427
2451
  values: {
@@ -2438,41 +2462,192 @@ var Schedule = function Schedule(_ref) {
2438
2462
  value: customerFees,
2439
2463
  style: "currency",
2440
2464
  currency: "EUR"
2441
- }))), ((currentPlan == null ? void 0 : currentPlan.payment_plan) || []).map(function (installment, index) {
2442
- return /*#__PURE__*/React.createElement("div", {
2443
- className: s$3.scheduleLine,
2444
- key: index
2445
- }, /*#__PURE__*/React.createElement("span", null, isToday(installment.due_date * 1000) ? /*#__PURE__*/React.createElement(FormattedMessage, {
2446
- id: "installments.today",
2447
- defaultMessage: "Aujourd'hui"
2448
- }) : /*#__PURE__*/React.createElement(FormattedDate, {
2449
- value: installment.due_date * 1000,
2450
- day: "numeric",
2451
- month: "long",
2452
- year: "numeric"
2453
- })), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedNumber, {
2454
- value: priceFromCents(installment.total_amount),
2455
- style: "currency",
2456
- currency: "EUR"
2457
- })));
2458
- }), isCredit && /*#__PURE__*/React.createElement("p", {
2465
+ }))), isCredit && /*#__PURE__*/React.createElement("p", {
2459
2466
  className: s$3.creditMessage
2460
2467
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2461
2468
  id: "eligibility-modal.credit-commitment",
2462
2469
  defaultMessage: "Un cr\xE9dit vous engage et doit \xEAtre rembours\xE9. V\xE9rifiez vos capacit\xE9s de remboursement\n avant de vous engager."
2470
+ }))));
2471
+ };
2472
+
2473
+ var AmexCard = function AmexCard() {
2474
+ return /*#__PURE__*/React.createElement("svg", {
2475
+ xmlns: "http://www.w3.org/2000/svg",
2476
+ width: "24",
2477
+ height: "16",
2478
+ viewBox: "0 0 24 16"
2479
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
2480
+ id: "cardamex",
2481
+ x1: "10.914%",
2482
+ x2: "87.432%",
2483
+ y1: "86.279%",
2484
+ y2: "15.035%"
2485
+ }, /*#__PURE__*/React.createElement("stop", {
2486
+ offset: "0%",
2487
+ stopColor: "#3FA9F5"
2488
+ }), /*#__PURE__*/React.createElement("stop", {
2489
+ offset: "100%",
2490
+ stopColor: "#0071BC"
2491
+ }))), /*#__PURE__*/React.createElement("g", {
2492
+ fill: "none",
2493
+ fillRule: "evenodd"
2494
+ }, /*#__PURE__*/React.createElement("path", {
2495
+ fill: "url(#cardamex)",
2496
+ fillRule: "nonzero",
2497
+ 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"
2498
+ }), /*#__PURE__*/React.createElement("g", {
2499
+ fill: "#FFF"
2500
+ }, /*#__PURE__*/React.createElement("path", {
2501
+ 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"
2502
+ }), /*#__PURE__*/React.createElement("path", {
2503
+ fillRule: "nonzero",
2504
+ 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"
2505
+ }))));
2506
+ };
2507
+
2508
+ var VisaCard = function VisaCard() {
2509
+ return /*#__PURE__*/React.createElement("svg", {
2510
+ xmlns: "http://www.w3.org/2000/svg",
2511
+ width: "24",
2512
+ height: "16",
2513
+ viewBox: "0 0 24 16"
2514
+ }, /*#__PURE__*/React.createElement("g", {
2515
+ fill: "none",
2516
+ fillRule: "nonzero"
2517
+ }, /*#__PURE__*/React.createElement("path", {
2518
+ fill: "#FCFCFC",
2519
+ 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"
2520
+ }), ' ', /*#__PURE__*/React.createElement("path", {
2521
+ fill: "#005098",
2522
+ 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"
2523
+ }), /*#__PURE__*/React.createElement("path", {
2524
+ fill: "#F6A500",
2525
+ 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"
2526
+ }), /*#__PURE__*/React.createElement("path", {
2527
+ fill: "#0A5296",
2528
+ d: "M23.937 3.23H0V1.316C0 .598.627 0 1.379 0H22.62C23.373 0 24 .598 24 1.316V3.23h-.063z"
2529
+ }), /*#__PURE__*/React.createElement("path", {
2530
+ fill: "#F4A428",
2531
+ d: "M.063 13H24v1.8c0 .655-.625 1.2-1.375 1.2H1.375C.625 16 0 15.455 0 14.8V13h.063z"
2463
2532
  })));
2464
2533
  };
2465
2534
 
2466
- var s$4 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2535
+ var MasterCard = function MasterCard() {
2536
+ return /*#__PURE__*/React.createElement("svg", {
2537
+ width: "24px",
2538
+ height: "16px",
2539
+ viewBox: "0 0 24 16",
2540
+ version: "1.1",
2541
+ xmlns: "http://www.w3.org/2000/svg"
2542
+ }, /*#__PURE__*/React.createElement("g", {
2543
+ id: "Parcours-1C-B",
2544
+ stroke: "none",
2545
+ strokeWidth: "1",
2546
+ fill: "none",
2547
+ fillRule: "evenodd"
2548
+ }, /*#__PURE__*/React.createElement("g", {
2549
+ id: "mobile-1C-Paiement-V1",
2550
+ transform: "translate(-269.000000, -313.000000)"
2551
+ }, /*#__PURE__*/React.createElement("g", {
2552
+ id: "mastercard",
2553
+ transform: "translate(269.000000, 313.000000)"
2554
+ }, /*#__PURE__*/React.createElement("rect", {
2555
+ id: "Rectangle",
2556
+ fill: "#FFFFFF",
2557
+ x: "0",
2558
+ y: "0",
2559
+ width: "24",
2560
+ height: "16",
2561
+ rx: "1"
2562
+ }), /*#__PURE__*/React.createElement("g", {
2563
+ id: "Group-6",
2564
+ transform: "translate(4.000000, 3.000000)"
2565
+ }, /*#__PURE__*/React.createElement("circle", {
2566
+ id: "Oval-4-Copy",
2567
+ fill: "#EA001B",
2568
+ cx: "5.05263158",
2569
+ cy: "5.05263158",
2570
+ r: "5.05263158"
2571
+ }), /*#__PURE__*/React.createElement("circle", {
2572
+ id: "Oval-4",
2573
+ fillOpacity: "0.25",
2574
+ fill: "#F79F1A",
2575
+ cx: "10.9473684",
2576
+ cy: "5.05263158",
2577
+ r: "5.05263158"
2578
+ }), /*#__PURE__*/React.createElement("circle", {
2579
+ id: "Oval-4-Copy-2",
2580
+ fillOpacity: "0.9",
2581
+ fill: "#F79F1A",
2582
+ cx: "10.9473684",
2583
+ cy: "5.05263158",
2584
+ r: "5.05263158"
2585
+ }), /*#__PURE__*/React.createElement("circle", {
2586
+ id: "Oval-4-Copy-3",
2587
+ fillOpacity: "0.3",
2588
+ fill: "#EA001B",
2589
+ cx: "5.05263158",
2590
+ cy: "5.05263158",
2591
+ r: "5.05263158"
2592
+ }))))));
2593
+ };
2594
+
2595
+ var CbCard = function CbCard() {
2596
+ return /*#__PURE__*/React.createElement("svg", {
2597
+ xmlns: "http://www.w3.org/2000/svg",
2598
+ width: "24",
2599
+ height: "16",
2600
+ viewBox: "0 0 24 16"
2601
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
2602
+ id: "cardcb",
2603
+ x1: "5.842%",
2604
+ x2: "95.393%",
2605
+ y1: "81.753%",
2606
+ y2: "17.344%"
2607
+ }, /*#__PURE__*/React.createElement("stop", {
2608
+ offset: "0%",
2609
+ stopColor: "#39B54A"
2610
+ }), ' ', /*#__PURE__*/React.createElement("stop", {
2611
+ offset: "100%",
2612
+ stopColor: "#0A5296"
2613
+ }))), /*#__PURE__*/React.createElement("g", {
2614
+ fill: "none",
2615
+ fillRule: "nonzero"
2616
+ }, /*#__PURE__*/React.createElement("path", {
2617
+ fill: "url(#cardcb)",
2618
+ 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"
2619
+ }), /*#__PURE__*/React.createElement("g", {
2620
+ fill: "#FFF"
2621
+ }, /*#__PURE__*/React.createElement("path", {
2622
+ 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"
2623
+ }))));
2624
+ };
2625
+
2626
+ var s$4 = {"cardContainer":"_1N3yO","card":"_83cGn"};
2627
+
2628
+ var Cards = function Cards(_ref) {
2629
+ var cards = _ref.cards;
2630
+ return /*#__PURE__*/React.createElement("div", {
2631
+ className: cx(s$4.cardContainer, STATIC_CUSTOMISATION_CLASSES.cardContainer)
2632
+ }, cards.map(function (card) {
2633
+ return /*#__PURE__*/React.createElement("div", {
2634
+ key: card,
2635
+ className: s$4.card,
2636
+ "data-testid": "card-logo-" + card
2637
+ }, 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));
2638
+ }));
2639
+ };
2640
+
2641
+ var s$5 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2467
2642
 
2468
2643
  var Info = function Info() {
2469
2644
  return /*#__PURE__*/React.createElement("div", {
2470
- className: cx(s$4.list, STATIC_CUSTOMISATION_CLASSES.info),
2645
+ className: cx(s$5.list, STATIC_CUSTOMISATION_CLASSES.info),
2471
2646
  "data-testid": "modal-info-element"
2472
2647
  }, /*#__PURE__*/React.createElement("div", {
2473
- className: s$4.listItem
2648
+ className: s$5.listItem
2474
2649
  }, /*#__PURE__*/React.createElement("div", {
2475
- className: s$4.bullet
2650
+ className: s$5.bullet
2476
2651
  }, "1"), /*#__PURE__*/React.createElement("div", {
2477
2652
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2478
2653
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2484,9 +2659,9 @@ var Info = function Info() {
2484
2659
  }
2485
2660
  }
2486
2661
  }))), /*#__PURE__*/React.createElement("div", {
2487
- className: s$4.listItem
2662
+ className: s$5.listItem
2488
2663
  }, /*#__PURE__*/React.createElement("div", {
2489
- className: s$4.bullet
2664
+ className: s$5.bullet
2490
2665
  }, "2"), /*#__PURE__*/React.createElement("div", {
2491
2666
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2492
2667
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2498,9 +2673,9 @@ var Info = function Info() {
2498
2673
  }
2499
2674
  }
2500
2675
  }))), /*#__PURE__*/React.createElement("div", {
2501
- className: s$4.listItem
2676
+ className: s$5.listItem
2502
2677
  }, /*#__PURE__*/React.createElement("div", {
2503
- className: s$4.bullet
2678
+ className: s$5.bullet
2504
2679
  }, "3"), /*#__PURE__*/React.createElement("div", {
2505
2680
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2506
2681
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2547,22 +2722,22 @@ function LogoIcon(_ref) {
2547
2722
  }));
2548
2723
  }
2549
2724
 
2550
- var s$5 = {"logo":"_3Oyv_"};
2725
+ var s$6 = {"logo":"_3Oyv_"};
2551
2726
 
2552
2727
  var Logo = function Logo() {
2553
2728
  return /*#__PURE__*/React.createElement("div", {
2554
- className: s$5.logo
2729
+ className: s$6.logo
2555
2730
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2556
2731
  underlineColor: "#FF414D"
2557
2732
  }));
2558
2733
  };
2559
2734
 
2560
- var s$6 = {"title":"_3ERx-"};
2735
+ var s$7 = {"title":"_3ERx-"};
2561
2736
 
2562
2737
  var Title = function Title(_ref) {
2563
2738
  var isSomePlanDeferred = _ref.isSomePlanDeferred;
2564
2739
  return /*#__PURE__*/React.createElement("div", {
2565
- className: cx(s$6.title, STATIC_CUSTOMISATION_CLASSES.title),
2740
+ className: cx(s$7.title, STATIC_CUSTOMISATION_CLASSES.title),
2566
2741
  "data-testid": "modal-title-element"
2567
2742
  }, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
2568
2743
  id: 'eligibility-modal.title-deferred',
@@ -2583,43 +2758,50 @@ var Title = function Title(_ref) {
2583
2758
  }));
2584
2759
  };
2585
2760
 
2586
- var s$7 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2761
+ var s$8 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2587
2762
 
2588
2763
  var DesktopModal = function DesktopModal(_ref) {
2589
2764
  var children = _ref.children,
2590
- isSomePlanDeferred = _ref.isSomePlanDeferred;
2765
+ isSomePlanDeferred = _ref.isSomePlanDeferred,
2766
+ cards = _ref.cards;
2591
2767
  return /*#__PURE__*/React.createElement("div", {
2592
- className: s$7.container,
2768
+ className: s$8.container,
2593
2769
  "data-testid": "modal-container"
2594
2770
  }, /*#__PURE__*/React.createElement("div", {
2595
- className: cx([s$7.block, s$7.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2771
+ className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2596
2772
  }, /*#__PURE__*/React.createElement(Title, {
2597
2773
  isSomePlanDeferred: isSomePlanDeferred
2598
- }), /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2599
- className: cx(s$7.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2774
+ }), /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
2775
+ cards: cards
2776
+ }), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2777
+ className: cx(s$8.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2600
2778
  }, children));
2601
2779
  };
2602
2780
 
2603
- var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2781
+ var s$9 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2604
2782
 
2605
- var s$9 = {"container":"_2G7Ch"};
2783
+ var s$a = {"container":"_2G7Ch"};
2606
2784
 
2607
2785
  var MobileModal = function MobileModal(_ref) {
2608
2786
  var children = _ref.children,
2609
- isSomePlanDeferred = _ref.isSomePlanDeferred;
2787
+ isSomePlanDeferred = _ref.isSomePlanDeferred,
2788
+ cards = _ref.cards;
2610
2789
  return /*#__PURE__*/React.createElement("div", {
2611
- className: s$9.container,
2790
+ className: s$a.container,
2612
2791
  "data-testid": "modal-container"
2613
2792
  }, /*#__PURE__*/React.createElement(Title, {
2614
2793
  isSomePlanDeferred: isSomePlanDeferred
2615
- }), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null));
2794
+ }), children, /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
2795
+ cards: cards
2796
+ }), /*#__PURE__*/React.createElement(Logo, null));
2616
2797
  };
2617
2798
 
2618
2799
  var EligibilityModal = function EligibilityModal(_ref) {
2619
2800
  var initialPlanIndex = _ref.initialPlanIndex,
2620
2801
  onClose = _ref.onClose,
2621
2802
  eligibilityPlans = _ref.eligibilityPlans,
2622
- status = _ref.status;
2803
+ status = _ref.status,
2804
+ cards = _ref.cards;
2623
2805
 
2624
2806
  var _useState = useState(initialPlanIndex || 0),
2625
2807
  currentPlanIndex = _useState[0],
@@ -2642,11 +2824,12 @@ var EligibilityModal = function EligibilityModal(_ref) {
2642
2824
  scrollable: true,
2643
2825
  isOpen: true
2644
2826
  }, /*#__PURE__*/React.createElement(ModalComponent, {
2645
- isSomePlanDeferred: isSomePlanDeferred
2827
+ isSomePlanDeferred: isSomePlanDeferred,
2828
+ cards: cards
2646
2829
  }, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
2647
- className: s$8.loader
2830
+ className: s$9.loader
2648
2831
  }, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
2649
- className: s$8.noEligibility
2832
+ className: s$9.noEligibility
2650
2833
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2651
2834
  id: "eligibility-modal.no-eligibility",
2652
2835
  defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\xE9."
@@ -2667,7 +2850,8 @@ var ModalContainer = function ModalContainer(_ref) {
2667
2850
  var purchaseAmount = _ref.purchaseAmount,
2668
2851
  apiData = _ref.apiData,
2669
2852
  configPlans = _ref.configPlans,
2670
- onClose = _ref.onClose;
2853
+ onClose = _ref.onClose,
2854
+ cards = _ref.cards;
2671
2855
 
2672
2856
  var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
2673
2857
  eligibilityPlans = _useFetchEligibility[0],
@@ -2677,21 +2861,22 @@ var ModalContainer = function ModalContainer(_ref) {
2677
2861
  initialPlanIndex: 0,
2678
2862
  onClose: onClose,
2679
2863
  eligibilityPlans: eligibilityPlans,
2680
- status: status
2864
+ status: status,
2865
+ cards: cards
2681
2866
  });
2682
2867
  };
2683
2868
 
2684
- var s$a = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
2869
+ var s$b = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
2685
2870
 
2686
2871
  var Loader = function Loader(_ref) {
2687
2872
  var className = _ref.className;
2688
2873
  return /*#__PURE__*/React.createElement("div", {
2689
- className: cx(s$a.loadingIndicator, className),
2874
+ className: cx(s$b.loadingIndicator, className),
2690
2875
  "data-testid": "loader"
2691
2876
  }, /*#__PURE__*/React.createElement("div", {
2692
- className: s$a.line1
2877
+ className: s$b.line1
2693
2878
  }), /*#__PURE__*/React.createElement("div", {
2694
- className: s$a.line2
2879
+ className: s$b.line2
2695
2880
  }));
2696
2881
  };
2697
2882
 
@@ -2784,7 +2969,7 @@ var STATIC_CUSTOMISATION_CLASSES$1 = {
2784
2969
  activeOption: prefix$1 + '-active-option'
2785
2970
  };
2786
2971
 
2787
- var s$b = {"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"};
2972
+ 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"};
2788
2973
 
2789
2974
  var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
2790
2975
  var DEFAULT_TRANSITION_TIME = 5500;
@@ -2797,7 +2982,8 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2797
2982
  configPlans = _ref.configPlans,
2798
2983
  transitionDelay = _ref.transitionDelay,
2799
2984
  hideIfNotEligible = _ref.hideIfNotEligible,
2800
- suggestedPaymentPlan = _ref.suggestedPaymentPlan;
2985
+ suggestedPaymentPlan = _ref.suggestedPaymentPlan,
2986
+ cards = _ref.cards;
2801
2987
 
2802
2988
  var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
2803
2989
  eligibilityPlans = _useFetchEligibility[0],
@@ -2877,7 +3063,7 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2877
3063
 
2878
3064
  if (status === apiStatus.PENDING) {
2879
3065
  return /*#__PURE__*/React.createElement("div", {
2880
- className: cx(s$b.widgetButton, s$b.pending)
3066
+ className: cx(s$c.widgetButton, s$c.pending)
2881
3067
  }, /*#__PURE__*/React.createElement(Loader, null));
2882
3068
  }
2883
3069
 
@@ -2895,14 +3081,14 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2895
3081
 
2896
3082
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2897
3083
  onClick: handleOpenModal,
2898
- className: cx(s$b.widgetButton, (_cx = {}, _cx[s$b.clickable] = eligiblePlans.length > 0, _cx[s$b.unClickable] = eligiblePlans.length === 0, _cx), STATIC_CUSTOMISATION_CLASSES$1.container),
3084
+ 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),
2899
3085
  "data-testid": "widget-button"
2900
3086
  }, /*#__PURE__*/React.createElement("div", {
2901
- className: cx(s$b.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
3087
+ className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2902
3088
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2903
- className: s$b.logo
3089
+ className: s$c.logo
2904
3090
  }), /*#__PURE__*/React.createElement("div", {
2905
- className: cx(s$b.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
3091
+ className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2906
3092
  }, eligibilityPlans.map(function (eligibilityPlan, key) {
2907
3093
  var _cx2;
2908
3094
 
@@ -2912,15 +3098,16 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2912
3098
  return onHover(key);
2913
3099
  },
2914
3100
  onMouseOut: onLeave,
2915
- className: cx(s$b.plan, (_cx2 = {}, _cx2[cx(s$b.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = current === key, _cx2[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
3101
+ 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))
2916
3102
  }, paymentPlanShorthandName(eligibilityPlan));
2917
3103
  }))), /*#__PURE__*/React.createElement("div", {
2918
- className: cx(s$b.info, (_cx3 = {}, _cx3[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3), STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
3104
+ 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)
2919
3105
  }, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React.createElement(EligibilityModal, {
2920
3106
  initialPlanIndex: getIndexWithinEligiblePlans(current),
2921
3107
  onClose: closeModal,
2922
3108
  eligibilityPlans: eligiblePlans,
2923
- status: status
3109
+ status: status,
3110
+ cards: cards
2924
3111
  }));
2925
3112
  };
2926
3113
 
@@ -2948,7 +3135,8 @@ var WidgetsController = /*#__PURE__*/function () {
2948
3135
  hideIfNotEligible = options.hideIfNotEligible,
2949
3136
  suggestedPaymentPlan = options.suggestedPaymentPlan,
2950
3137
  _options$locale = options.locale,
2951
- locale = _options$locale === void 0 ? Locale.en : _options$locale;
3138
+ locale = _options$locale === void 0 ? Locale.en : _options$locale,
3139
+ cards = options.cards;
2952
3140
 
2953
3141
  if (containerDiv) {
2954
3142
  render( /*#__PURE__*/React.createElement(Provider, {
@@ -2959,7 +3147,8 @@ var WidgetsController = /*#__PURE__*/function () {
2959
3147
  configPlans: plans,
2960
3148
  transitionDelay: transitionDelay,
2961
3149
  hideIfNotEligible: hideIfNotEligible,
2962
- suggestedPaymentPlan: suggestedPaymentPlan
3150
+ suggestedPaymentPlan: suggestedPaymentPlan,
3151
+ cards: cards
2963
3152
  })), document.querySelector(container));
2964
3153
  }
2965
3154
  }
@@ -2970,7 +3159,8 @@ var WidgetsController = /*#__PURE__*/function () {
2970
3159
  _purchaseAmount = options.purchaseAmount,
2971
3160
  _plans = options.plans,
2972
3161
  _options$locale2 = options.locale,
2973
- _locale = _options$locale2 === void 0 ? Locale.en : _options$locale2;
3162
+ _locale = _options$locale2 === void 0 ? Locale.en : _options$locale2,
3163
+ _cards = options.cards;
2974
3164
 
2975
3165
  var close = function close() {
2976
3166
  return containerDiv && unmountComponentAtNode(containerDiv);
@@ -2983,7 +3173,8 @@ var WidgetsController = /*#__PURE__*/function () {
2983
3173
  purchaseAmount: _purchaseAmount,
2984
3174
  apiData: _this.apiData,
2985
3175
  configPlans: _plans,
2986
- onClose: close
3176
+ onClose: close,
3177
+ cards: _cards
2987
3178
  })), document.querySelector(_container));
2988
3179
  }; // if clickableSelector is provided, add an onClick event handler to open the Modal.
2989
3180