@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
@@ -2154,7 +2154,9 @@ const STATIC_CUSTOMISATION_CLASSES = {
2154
2154
  closeButton: prefix + '-close-button',
2155
2155
  scheduleDetails: prefix + '-schedule-details',
2156
2156
  scheduleTotal: prefix + '-schedule-total',
2157
- scheduleCredit: prefix + '-schedule-credit'
2157
+ scheduleCredit: prefix + '-schedule-credit',
2158
+ cardContainer: prefix + '-card-logos',
2159
+ summary: prefix + '-summary'
2158
2160
  };
2159
2161
 
2160
2162
  const _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
@@ -2346,7 +2348,7 @@ const EligibilityPlansButtons = ({
2346
2348
  onClick: () => setCurrentPlanIndex(index)
2347
2349
  }, paymentPlanShorthandName(eligibilityPlan))));
2348
2350
 
2349
- var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","creditCost":"_1ZIgu","creditMessage":"_1BUr8"};
2351
+ var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary":"_65ZpD","creditCost":"_1ZIgu","creditCostAmount":"_tUTZp","creditMessage":"_1BUr8"};
2350
2352
 
2351
2353
  const Schedule = ({
2352
2354
  currentPlan
@@ -2357,9 +2359,27 @@ const Schedule = ({
2357
2359
  const customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
2358
2360
  const isCredit = currentPlan && currentPlan.installments_count > 4;
2359
2361
  const intl = useIntl();
2360
- return /*#__PURE__*/React.createElement("div", {
2362
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2361
2363
  className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
2362
2364
  "data-testid": "modal-installments-element"
2365
+ }, ((currentPlan == null ? void 0 : currentPlan.payment_plan) || []).map((installment, index) => /*#__PURE__*/React.createElement("div", {
2366
+ className: s$3.scheduleLine,
2367
+ key: index
2368
+ }, /*#__PURE__*/React.createElement("span", null, isToday(installment.due_date * 1000) ? /*#__PURE__*/React.createElement(FormattedMessage, {
2369
+ id: "installments.today",
2370
+ defaultMessage: "Aujourd'hui"
2371
+ }) : /*#__PURE__*/React.createElement(FormattedDate, {
2372
+ value: installment.due_date * 1000,
2373
+ day: "numeric",
2374
+ month: "long",
2375
+ year: "numeric"
2376
+ })), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedNumber, {
2377
+ value: priceFromCents(installment.total_amount),
2378
+ style: "currency",
2379
+ currency: "EUR"
2380
+ }))))), /*#__PURE__*/React.createElement("div", {
2381
+ className: cx(s$3.summary, STATIC_CUSTOMISATION_CLASSES.summary),
2382
+ "data-testid": "modal-summary"
2363
2383
  }, /*#__PURE__*/React.createElement("div", {
2364
2384
  className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
2365
2385
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2377,7 +2397,9 @@ const Schedule = ({
2377
2397
  })) : /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
2378
2398
  id: "eligibility-modal.cost",
2379
2399
  defaultMessage: "Dont frais"
2380
- })), /*#__PURE__*/React.createElement("span", null, isCredit ? /*#__PURE__*/React.createElement(FormattedMessage, {
2400
+ })), /*#__PURE__*/React.createElement("span", {
2401
+ className: s$3.creditCostAmount
2402
+ }, isCredit ? /*#__PURE__*/React.createElement(FormattedMessage, {
2381
2403
  id: "eligibility-modal.credit-cost-amount",
2382
2404
  defaultMessage: "{creditCost} (TAEG {TAEG})",
2383
2405
  values: {
@@ -2394,38 +2416,182 @@ const Schedule = ({
2394
2416
  value: customerFees,
2395
2417
  style: "currency",
2396
2418
  currency: "EUR"
2397
- }))), ((currentPlan == null ? void 0 : currentPlan.payment_plan) || []).map((installment, index) => /*#__PURE__*/React.createElement("div", {
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", {
2419
+ }))), isCredit && /*#__PURE__*/React.createElement("p", {
2413
2420
  className: s$3.creditMessage
2414
2421
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2415
2422
  id: "eligibility-modal.credit-commitment",
2416
2423
  defaultMessage: "Un cr\u00E9dit vous engage et doit \u00EAtre rembours\u00E9. V\u00E9rifiez vos capacit\u00E9s de remboursement\n avant de vous engager."
2417
- })));
2424
+ }))));
2425
+ };
2426
+
2427
+ const AmexCard = () => /*#__PURE__*/React.createElement("svg", {
2428
+ xmlns: "http://www.w3.org/2000/svg",
2429
+ width: "24",
2430
+ height: "16",
2431
+ viewBox: "0 0 24 16"
2432
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
2433
+ id: "cardamex",
2434
+ x1: "10.914%",
2435
+ x2: "87.432%",
2436
+ y1: "86.279%",
2437
+ y2: "15.035%"
2438
+ }, /*#__PURE__*/React.createElement("stop", {
2439
+ offset: "0%",
2440
+ stopColor: "#3FA9F5"
2441
+ }), /*#__PURE__*/React.createElement("stop", {
2442
+ offset: "100%",
2443
+ stopColor: "#0071BC"
2444
+ }))), /*#__PURE__*/React.createElement("g", {
2445
+ fill: "none",
2446
+ fillRule: "evenodd"
2447
+ }, /*#__PURE__*/React.createElement("path", {
2448
+ fill: "url(#cardamex)",
2449
+ fillRule: "nonzero",
2450
+ 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"
2451
+ }), /*#__PURE__*/React.createElement("g", {
2452
+ fill: "#FFF"
2453
+ }, /*#__PURE__*/React.createElement("path", {
2454
+ 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"
2455
+ }), /*#__PURE__*/React.createElement("path", {
2456
+ fillRule: "nonzero",
2457
+ 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"
2458
+ }))));
2459
+
2460
+ const VisaCard = () => /*#__PURE__*/React.createElement("svg", {
2461
+ xmlns: "http://www.w3.org/2000/svg",
2462
+ width: "24",
2463
+ height: "16",
2464
+ viewBox: "0 0 24 16"
2465
+ }, /*#__PURE__*/React.createElement("g", {
2466
+ fill: "none",
2467
+ fillRule: "nonzero"
2468
+ }, /*#__PURE__*/React.createElement("path", {
2469
+ fill: "#FCFCFC",
2470
+ 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"
2471
+ }), ' ', /*#__PURE__*/React.createElement("path", {
2472
+ fill: "#005098",
2473
+ 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"
2474
+ }), /*#__PURE__*/React.createElement("path", {
2475
+ fill: "#F6A500",
2476
+ 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"
2477
+ }), /*#__PURE__*/React.createElement("path", {
2478
+ fill: "#0A5296",
2479
+ d: "M23.937 3.23H0V1.316C0 .598.627 0 1.379 0H22.62C23.373 0 24 .598 24 1.316V3.23h-.063z"
2480
+ }), /*#__PURE__*/React.createElement("path", {
2481
+ fill: "#F4A428",
2482
+ d: "M.063 13H24v1.8c0 .655-.625 1.2-1.375 1.2H1.375C.625 16 0 15.455 0 14.8V13h.063z"
2483
+ })));
2484
+
2485
+ const MasterCard = () => /*#__PURE__*/React.createElement("svg", {
2486
+ width: "24px",
2487
+ height: "16px",
2488
+ viewBox: "0 0 24 16",
2489
+ version: "1.1",
2490
+ xmlns: "http://www.w3.org/2000/svg"
2491
+ }, /*#__PURE__*/React.createElement("g", {
2492
+ id: "Parcours-1C-B",
2493
+ stroke: "none",
2494
+ strokeWidth: "1",
2495
+ fill: "none",
2496
+ fillRule: "evenodd"
2497
+ }, /*#__PURE__*/React.createElement("g", {
2498
+ id: "mobile-1C-Paiement-V1",
2499
+ transform: "translate(-269.000000, -313.000000)"
2500
+ }, /*#__PURE__*/React.createElement("g", {
2501
+ id: "mastercard",
2502
+ transform: "translate(269.000000, 313.000000)"
2503
+ }, /*#__PURE__*/React.createElement("rect", {
2504
+ id: "Rectangle",
2505
+ fill: "#FFFFFF",
2506
+ x: "0",
2507
+ y: "0",
2508
+ width: "24",
2509
+ height: "16",
2510
+ rx: "1"
2511
+ }), /*#__PURE__*/React.createElement("g", {
2512
+ id: "Group-6",
2513
+ transform: "translate(4.000000, 3.000000)"
2514
+ }, /*#__PURE__*/React.createElement("circle", {
2515
+ id: "Oval-4-Copy",
2516
+ fill: "#EA001B",
2517
+ cx: "5.05263158",
2518
+ cy: "5.05263158",
2519
+ r: "5.05263158"
2520
+ }), /*#__PURE__*/React.createElement("circle", {
2521
+ id: "Oval-4",
2522
+ fillOpacity: "0.25",
2523
+ fill: "#F79F1A",
2524
+ cx: "10.9473684",
2525
+ cy: "5.05263158",
2526
+ r: "5.05263158"
2527
+ }), /*#__PURE__*/React.createElement("circle", {
2528
+ id: "Oval-4-Copy-2",
2529
+ fillOpacity: "0.9",
2530
+ fill: "#F79F1A",
2531
+ cx: "10.9473684",
2532
+ cy: "5.05263158",
2533
+ r: "5.05263158"
2534
+ }), /*#__PURE__*/React.createElement("circle", {
2535
+ id: "Oval-4-Copy-3",
2536
+ fillOpacity: "0.3",
2537
+ fill: "#EA001B",
2538
+ cx: "5.05263158",
2539
+ cy: "5.05263158",
2540
+ r: "5.05263158"
2541
+ }))))));
2542
+
2543
+ const CbCard = () => /*#__PURE__*/React.createElement("svg", {
2544
+ xmlns: "http://www.w3.org/2000/svg",
2545
+ width: "24",
2546
+ height: "16",
2547
+ viewBox: "0 0 24 16"
2548
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
2549
+ id: "cardcb",
2550
+ x1: "5.842%",
2551
+ x2: "95.393%",
2552
+ y1: "81.753%",
2553
+ y2: "17.344%"
2554
+ }, /*#__PURE__*/React.createElement("stop", {
2555
+ offset: "0%",
2556
+ stopColor: "#39B54A"
2557
+ }), ' ', /*#__PURE__*/React.createElement("stop", {
2558
+ offset: "100%",
2559
+ stopColor: "#0A5296"
2560
+ }))), /*#__PURE__*/React.createElement("g", {
2561
+ fill: "none",
2562
+ fillRule: "nonzero"
2563
+ }, /*#__PURE__*/React.createElement("path", {
2564
+ fill: "url(#cardcb)",
2565
+ 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"
2566
+ }), /*#__PURE__*/React.createElement("g", {
2567
+ fill: "#FFF"
2568
+ }, /*#__PURE__*/React.createElement("path", {
2569
+ 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"
2570
+ }))));
2571
+
2572
+ var s$4 = {"cardContainer":"_1N3yO","card":"_83cGn"};
2573
+
2574
+ const Cards = ({
2575
+ cards
2576
+ }) => {
2577
+ return /*#__PURE__*/React.createElement("div", {
2578
+ className: cx(s$4.cardContainer, STATIC_CUSTOMISATION_CLASSES.cardContainer)
2579
+ }, cards.map(card => /*#__PURE__*/React.createElement("div", {
2580
+ key: card,
2581
+ className: s$4.card,
2582
+ "data-testid": `card-logo-${card}`
2583
+ }, 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
2584
  };
2419
2585
 
2420
- var s$4 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2586
+ var s$5 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2421
2587
 
2422
2588
  const Info = () => /*#__PURE__*/React.createElement("div", {
2423
- className: cx(s$4.list, STATIC_CUSTOMISATION_CLASSES.info),
2589
+ className: cx(s$5.list, STATIC_CUSTOMISATION_CLASSES.info),
2424
2590
  "data-testid": "modal-info-element"
2425
2591
  }, /*#__PURE__*/React.createElement("div", {
2426
- className: s$4.listItem
2592
+ className: s$5.listItem
2427
2593
  }, /*#__PURE__*/React.createElement("div", {
2428
- className: s$4.bullet
2594
+ className: s$5.bullet
2429
2595
  }, "1"), /*#__PURE__*/React.createElement("div", {
2430
2596
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2431
2597
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2435,9 +2601,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2435
2601
  strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
2436
2602
  }
2437
2603
  }))), /*#__PURE__*/React.createElement("div", {
2438
- className: s$4.listItem
2604
+ className: s$5.listItem
2439
2605
  }, /*#__PURE__*/React.createElement("div", {
2440
- className: s$4.bullet
2606
+ className: s$5.bullet
2441
2607
  }, "2"), /*#__PURE__*/React.createElement("div", {
2442
2608
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2443
2609
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2447,9 +2613,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2447
2613
  strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
2448
2614
  }
2449
2615
  }))), /*#__PURE__*/React.createElement("div", {
2450
- className: s$4.listItem
2616
+ className: s$5.listItem
2451
2617
  }, /*#__PURE__*/React.createElement("div", {
2452
- className: s$4.bullet
2618
+ className: s$5.bullet
2453
2619
  }, "3"), /*#__PURE__*/React.createElement("div", {
2454
2620
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2455
2621
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2492,20 +2658,20 @@ function LogoIcon({
2492
2658
  }));
2493
2659
  }
2494
2660
 
2495
- var s$5 = {"logo":"_3Oyv_"};
2661
+ var s$6 = {"logo":"_3Oyv_"};
2496
2662
 
2497
2663
  const Logo = () => /*#__PURE__*/React.createElement("div", {
2498
- className: s$5.logo
2664
+ className: s$6.logo
2499
2665
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2500
2666
  underlineColor: "#FF414D"
2501
2667
  }));
2502
2668
 
2503
- var s$6 = {"title":"_3ERx-"};
2669
+ var s$7 = {"title":"_3ERx-"};
2504
2670
 
2505
2671
  const Title = ({
2506
2672
  isSomePlanDeferred
2507
2673
  }) => /*#__PURE__*/React.createElement("div", {
2508
- className: cx(s$6.title, STATIC_CUSTOMISATION_CLASSES.title),
2674
+ className: cx(s$7.title, STATIC_CUSTOMISATION_CLASSES.title),
2509
2675
  "data-testid": "modal-title-element"
2510
2676
  }, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
2511
2677
  id: 'eligibility-modal.title-deferred',
@@ -2521,41 +2687,48 @@ const Title = ({
2521
2687
  }
2522
2688
  }));
2523
2689
 
2524
- var s$7 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2690
+ var s$8 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2525
2691
 
2526
2692
  const DesktopModal = ({
2527
2693
  children,
2528
- isSomePlanDeferred
2694
+ isSomePlanDeferred,
2695
+ cards
2529
2696
  }) => /*#__PURE__*/React.createElement("div", {
2530
- className: s$7.container,
2697
+ className: s$8.container,
2531
2698
  "data-testid": "modal-container"
2532
2699
  }, /*#__PURE__*/React.createElement("div", {
2533
- className: cx([s$7.block, s$7.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2700
+ className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2534
2701
  }, /*#__PURE__*/React.createElement(Title, {
2535
2702
  isSomePlanDeferred: isSomePlanDeferred
2536
- }), /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2537
- className: cx(s$7.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2703
+ }), /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
2704
+ cards: cards
2705
+ }), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2706
+ className: cx(s$8.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2538
2707
  }, children));
2539
2708
 
2540
- var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2709
+ var s$9 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2541
2710
 
2542
- var s$9 = {"container":"_2G7Ch"};
2711
+ var s$a = {"container":"_2G7Ch"};
2543
2712
 
2544
2713
  const MobileModal = ({
2545
2714
  children,
2546
- isSomePlanDeferred
2715
+ isSomePlanDeferred,
2716
+ cards
2547
2717
  }) => /*#__PURE__*/React.createElement("div", {
2548
- className: s$9.container,
2718
+ className: s$a.container,
2549
2719
  "data-testid": "modal-container"
2550
2720
  }, /*#__PURE__*/React.createElement(Title, {
2551
2721
  isSomePlanDeferred: isSomePlanDeferred
2552
- }), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null));
2722
+ }), children, /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
2723
+ cards: cards
2724
+ }), /*#__PURE__*/React.createElement(Logo, null));
2553
2725
 
2554
2726
  const EligibilityModal = ({
2555
2727
  initialPlanIndex,
2556
2728
  onClose,
2557
2729
  eligibilityPlans,
2558
- status
2730
+ status,
2731
+ cards
2559
2732
  }) => {
2560
2733
  const [currentPlanIndex, setCurrentPlanIndex] = useState(initialPlanIndex || 0);
2561
2734
  const isBigScreen = useMediaQuery({
@@ -2571,11 +2744,12 @@ const EligibilityModal = ({
2571
2744
  scrollable: true,
2572
2745
  isOpen: true
2573
2746
  }, /*#__PURE__*/React.createElement(ModalComponent, {
2574
- isSomePlanDeferred: isSomePlanDeferred
2747
+ isSomePlanDeferred: isSomePlanDeferred,
2748
+ cards: cards
2575
2749
  }, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
2576
- className: s$8.loader
2750
+ className: s$9.loader
2577
2751
  }, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
2578
- className: s$8.noEligibility
2752
+ className: s$9.noEligibility
2579
2753
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2580
2754
  id: "eligibility-modal.no-eligibility",
2581
2755
  defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\u00E9."
@@ -2596,29 +2770,31 @@ const ModalContainer = ({
2596
2770
  purchaseAmount,
2597
2771
  apiData,
2598
2772
  configPlans,
2599
- onClose
2773
+ onClose,
2774
+ cards
2600
2775
  }) => {
2601
2776
  const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
2602
2777
  return /*#__PURE__*/React.createElement(EligibilityModal, {
2603
2778
  initialPlanIndex: 0,
2604
2779
  onClose: onClose,
2605
2780
  eligibilityPlans: eligibilityPlans,
2606
- status: status
2781
+ status: status,
2782
+ cards: cards
2607
2783
  });
2608
2784
  };
2609
2785
 
2610
- var s$a = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
2786
+ var s$b = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
2611
2787
 
2612
2788
  const Loader = ({
2613
2789
  className
2614
2790
  }) => {
2615
2791
  return /*#__PURE__*/React.createElement("div", {
2616
- className: cx(s$a.loadingIndicator, className),
2792
+ className: cx(s$b.loadingIndicator, className),
2617
2793
  "data-testid": "loader"
2618
2794
  }, /*#__PURE__*/React.createElement("div", {
2619
- className: s$a.line1
2795
+ className: s$b.line1
2620
2796
  }), /*#__PURE__*/React.createElement("div", {
2621
- className: s$a.line2
2797
+ className: s$b.line2
2622
2798
  }));
2623
2799
  };
2624
2800
 
@@ -2698,7 +2874,7 @@ const STATIC_CUSTOMISATION_CLASSES$1 = {
2698
2874
  activeOption: prefix$1 + '-active-option'
2699
2875
  };
2700
2876
 
2701
- 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"};
2877
+ 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
2878
 
2703
2879
  const VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
2704
2880
  const DEFAULT_TRANSITION_TIME = 5500;
@@ -2709,7 +2885,8 @@ const PaymentPlanWidget = ({
2709
2885
  configPlans,
2710
2886
  transitionDelay,
2711
2887
  hideIfNotEligible,
2712
- suggestedPaymentPlan
2888
+ suggestedPaymentPlan,
2889
+ cards
2713
2890
  }) => {
2714
2891
  const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
2715
2892
  const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
@@ -2774,7 +2951,7 @@ const PaymentPlanWidget = ({
2774
2951
 
2775
2952
  if (status === apiStatus.PENDING) {
2776
2953
  return /*#__PURE__*/React.createElement("div", {
2777
- className: cx(s$b.widgetButton, s$b.pending)
2954
+ className: cx(s$c.widgetButton, s$c.pending)
2778
2955
  }, /*#__PURE__*/React.createElement(Loader, null));
2779
2956
  }
2780
2957
 
@@ -2792,36 +2969,37 @@ const PaymentPlanWidget = ({
2792
2969
 
2793
2970
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2794
2971
  onClick: handleOpenModal,
2795
- className: cx(s$b.widgetButton, {
2796
- [s$b.clickable]: eligiblePlans.length > 0,
2797
- [s$b.unClickable]: eligiblePlans.length === 0
2972
+ className: cx(s$c.widgetButton, {
2973
+ [s$c.clickable]: eligiblePlans.length > 0,
2974
+ [s$c.unClickable]: eligiblePlans.length === 0
2798
2975
  }, STATIC_CUSTOMISATION_CLASSES$1.container),
2799
2976
  "data-testid": "widget-button"
2800
2977
  }, /*#__PURE__*/React.createElement("div", {
2801
- className: cx(s$b.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2978
+ className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2802
2979
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2803
- className: s$b.logo
2980
+ className: s$c.logo
2804
2981
  }), /*#__PURE__*/React.createElement("div", {
2805
- className: cx(s$b.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2982
+ className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2806
2983
  }, eligibilityPlans.map((eligibilityPlan, key) => {
2807
2984
  return /*#__PURE__*/React.createElement("div", {
2808
2985
  key: key,
2809
2986
  onMouseEnter: () => onHover(key),
2810
2987
  onMouseOut: onLeave,
2811
- className: cx(s$b.plan, {
2812
- [cx(s$b.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: current === key,
2813
- [cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
2988
+ className: cx(s$c.plan, {
2989
+ [cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: current === key,
2990
+ [cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
2814
2991
  })
2815
2992
  }, paymentPlanShorthandName(eligibilityPlan));
2816
2993
  }))), /*#__PURE__*/React.createElement("div", {
2817
- className: cx(s$b.info, {
2818
- [cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: eligibilityPlans[current] && !eligibilityPlans[current].eligible
2994
+ className: cx(s$c.info, {
2995
+ [cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: eligibilityPlans[current] && !eligibilityPlans[current].eligible
2819
2996
  }, STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
2820
2997
  }, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React.createElement(EligibilityModal, {
2821
2998
  initialPlanIndex: getIndexWithinEligiblePlans(current),
2822
2999
  onClose: closeModal,
2823
3000
  eligibilityPlans: eligiblePlans,
2824
- status: status
3001
+ status: status,
3002
+ cards: cards
2825
3003
  }));
2826
3004
  };
2827
3005
 
@@ -2845,7 +3023,8 @@ class WidgetsController {
2845
3023
  transitionDelay,
2846
3024
  hideIfNotEligible,
2847
3025
  suggestedPaymentPlan,
2848
- locale = Locale.en
3026
+ locale = Locale.en,
3027
+ cards
2849
3028
  } = options;
2850
3029
 
2851
3030
  if (containerDiv) {
@@ -2857,7 +3036,8 @@ class WidgetsController {
2857
3036
  configPlans: plans,
2858
3037
  transitionDelay: transitionDelay,
2859
3038
  hideIfNotEligible: hideIfNotEligible,
2860
- suggestedPaymentPlan: suggestedPaymentPlan
3039
+ suggestedPaymentPlan: suggestedPaymentPlan,
3040
+ cards: cards
2861
3041
  })), document.querySelector(container));
2862
3042
  }
2863
3043
  }
@@ -2868,7 +3048,8 @@ class WidgetsController {
2868
3048
  clickableSelector,
2869
3049
  purchaseAmount,
2870
3050
  plans,
2871
- locale = Locale.en
3051
+ locale = Locale.en,
3052
+ cards
2872
3053
  } = options;
2873
3054
 
2874
3055
  const close = () => containerDiv && unmountComponentAtNode(containerDiv);
@@ -2880,7 +3061,8 @@ class WidgetsController {
2880
3061
  purchaseAmount: purchaseAmount,
2881
3062
  apiData: this.apiData,
2882
3063
  configPlans: plans,
2883
- onClose: close
3064
+ onClose: close,
3065
+ cards: cards
2884
3066
  })), document.querySelector(container));
2885
3067
  }; // if clickableSelector is provided, add an onClick event handler to open the Modal.
2886
3068