@alma/widgets 2.11.0 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1531,6 +1531,7 @@ var Locale;
1531
1531
  Locale["it"] = "it";
1532
1532
  Locale["es"] = "es";
1533
1533
  Locale["nl"] = "nl";
1534
+ Locale["pt"] = "pt";
1534
1535
  Locale["nl-NL"] = "nl-NL";
1535
1536
  Locale["nl-BE"] = "nl-BE";
1536
1537
  })(Locale || (Locale = {}));
@@ -1544,6 +1545,7 @@ function priceFromCents(cents) {
1544
1545
  function formatCents(cents) {
1545
1546
  return String(priceFromCents(cents)).replace('.', ',');
1546
1547
  }
1548
+ var desktopWidth = 800;
1547
1549
 
1548
1550
  /* eslint-disable */
1549
1551
 
@@ -1873,7 +1875,7 @@ if (!''.trim) String.prototype.trim = function () {
1873
1875
  var messagesDE = {
1874
1876
  "eligibility-modal.bullet-1": "Wählen Sie an der Kasse <strong>Alma</strong> .",
1875
1877
  "eligibility-modal.bullet-2": "Füllen Sie die <strong>angeforderten</strong> Informationen aus.",
1876
- "eligibility-modal.bullet-3": "Die Bestätigung Ihrer Zahlung <strong>sofort</strong> !",
1878
+ "eligibility-modal.bullet-3": "Die Bestätigung Ihrer Zahlung erfolgt <strong>sofort</strong> !",
1877
1879
  "eligibility-modal.cost": "Davon Kosten",
1878
1880
  "eligibility-modal.credit-commitment": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
1879
1881
  "eligibility-modal.credit-cost": "Davon Kreditkosten",
@@ -1896,7 +1898,7 @@ var messagesDE = {
1896
1898
  var messagesEN = {
1897
1899
  "eligibility-modal.bullet-1": "Choose <strong>Alma</strong> at checkout.",
1898
1900
  "eligibility-modal.bullet-2": "Fill in the <strong>information</strong> requested.",
1899
- "eligibility-modal.bullet-3": "Validation of your payment <strong>instantaneous</strong>!",
1901
+ "eligibility-modal.bullet-3": "The validation of your payment is <strong>instantaneous</strong> !",
1900
1902
  "eligibility-modal.cost": "Of which costs",
1901
1903
  "eligibility-modal.credit-commitment": "A loan commits you and must be repaid. Check your ability to repay before committing yourself.",
1902
1904
  "eligibility-modal.credit-cost": "Of which cost of credit",
@@ -1919,7 +1921,7 @@ var messagesEN = {
1919
1921
  var messagesES = {
1920
1922
  "eligibility-modal.bullet-1": "Elige <strong>Alma</strong> como método de pago.",
1921
1923
  "eligibility-modal.bullet-2": "Completa la <strong>información</strong> solicitada.",
1922
- "eligibility-modal.bullet-3": "¡Validación <strong>inmediata</strong> de tu pago!",
1924
+ "eligibility-modal.bullet-3": "¡La validación de su pago es <strong>instantánea</strong> !",
1923
1925
  "eligibility-modal.cost": "Gastos (incl. en el total)",
1924
1926
  "eligibility-modal.credit-commitment": "Un préstamo te compromete y debe ser devuelto. Comprueba tu capacidad financiera antes de comprometerte.",
1925
1927
  "eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
@@ -1942,7 +1944,7 @@ var messagesES = {
1942
1944
  var messagesFR = {
1943
1945
  "eligibility-modal.bullet-1": "Choisissez <strong>Alma</strong> au moment du paiement.",
1944
1946
  "eligibility-modal.bullet-2": "Renseignez les <strong>informations</strong> demandées.",
1945
- "eligibility-modal.bullet-3": "La validation de votre paiement <strong>instantanée</strong> !",
1947
+ "eligibility-modal.bullet-3": "La validation de votre paiement est <strong>instantanée</strong> !",
1946
1948
  "eligibility-modal.cost": "Dont frais",
1947
1949
  "eligibility-modal.credit-commitment": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
1948
1950
  "eligibility-modal.credit-cost": "Dont coût du crédit",
@@ -1965,7 +1967,7 @@ var messagesFR = {
1965
1967
  var messagesIT = {
1966
1968
  "eligibility-modal.bullet-1": "Scegli <strong>Alma</strong> alla cassa.",
1967
1969
  "eligibility-modal.bullet-2": "Compila le informazioni <strong></strong> richieste.",
1968
- "eligibility-modal.bullet-3": "Convalida del tuo pagamento <strong>istantanea</strong>!",
1970
+ "eligibility-modal.bullet-3": "La convalida del pagamento è <strong>istantanea</strong> !",
1969
1971
  "eligibility-modal.cost": "Di cui commissioni",
1970
1972
  "eligibility-modal.credit-commitment": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua capacità di rimborso prima di impegnarti.",
1971
1973
  "eligibility-modal.credit-cost": "Di cui commissioni",
@@ -1988,24 +1990,47 @@ var messagesIT = {
1988
1990
  var messagesNL = {
1989
1991
  "eligibility-modal.bullet-1": "Kies <strong>Alma</strong> bij het afrekenen.",
1990
1992
  "eligibility-modal.bullet-2": "Vul de <strong>gevraagde informatie</strong> in.",
1991
- "eligibility-modal.bullet-3": "Onmiddelijke validatie van uw betaling ",
1993
+ "eligibility-modal.bullet-3": "De validatie van uw betaling is <strong>onmiddellijk</strong> !",
1992
1994
  "eligibility-modal.cost": "Waarvan kosten",
1993
1995
  "eligibility-modal.credit-commitment": "Een lening bindt je en moet worden terugbetaald. Ga na of u kunt terugbetalen voordat u zich vastlegt.",
1994
1996
  "eligibility-modal.credit-cost": "Waarvan kosten van krediet",
1995
- "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1997
+ "eligibility-modal.credit-cost-amount": "{creditCost} (gemiddeld rente percentage {TAEG})",
1996
1998
  "eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
1997
- "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met kredietkaart bij Alma.",
1998
- "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
1999
+ "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met bank- en kredietkaart bij Alma.",
2000
+ "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per bank- en kredietkaart met Alma.",
1999
2001
  "eligibility-modal.total": "Totaal",
2000
2002
  "installments.today": "Tegenwoordig",
2001
- "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
2003
+ "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
2002
2004
  "payment-plan-strings.default-message": "Betaal in termijnen met Alma",
2003
2005
  "payment-plan-strings.deferred": "{totalAmount} te betalen op {dueDate}",
2004
2006
  "payment-plan-strings.ineligible-greater-than-max": "Tot {maxAmount}",
2005
2007
  "payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
2006
2008
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
2007
2009
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
2008
- "payment-plan-strings.no-fee": "(gratis)"
2010
+ "payment-plan-strings.no-fee": "(zonder kosten)"
2011
+ };
2012
+
2013
+ var messagesPT = {
2014
+ "eligibility-modal.bullet-1": "Escolha a <strong>Alma</strong> no checkout.",
2015
+ "eligibility-modal.bullet-2": "Preencha os <strong>dados</strong> solicitados.",
2016
+ "eligibility-modal.bullet-3": "A validação do seu pagamento é <strong>instantaneamente</strong> !",
2017
+ "eligibility-modal.cost": "Incluindo encargos",
2018
+ "eligibility-modal.credit-commitment": "Um crédito é um compromisso e deve ser reembolsado. Verifique a sua capacidade de pagar antes de se comprometer.",
2019
+ "eligibility-modal.credit-cost": "Incluindo custo do crédito",
2020
+ "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
2021
+ "eligibility-modal.no-eligibility": "Ups, parece que a simulação não funcionou.",
2022
+ "eligibility-modal.title": "<highlighted>Pague em prestações</highlighted> com cartão bancário através da Alma.",
2023
+ "eligibility-modal.title-deferred": "<highlighted>Pague em prestações</highlighted> ou mais tarde com cartão bancário através da Alma.",
2024
+ "eligibility-modal.total": "Total",
2025
+ "installments.today": "Hoje",
2026
+ "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
2027
+ "payment-plan-strings.default-message": "Pague em prestações através da Alma",
2028
+ "payment-plan-strings.deferred": "{totalAmount} a pagar em {dueDate}",
2029
+ "payment-plan-strings.ineligible-greater-than-max": "Até {maxAmount}",
2030
+ "payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
2031
+ "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
2032
+ "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
2033
+ "payment-plan-strings.no-fee": "(sem encargos)"
2009
2034
  };
2010
2035
 
2011
2036
  var getTranslationsByLocale = function getTranslationsByLocale(locale) {
@@ -2022,6 +2047,9 @@ var getTranslationsByLocale = function getTranslationsByLocale(locale) {
2022
2047
  case Locale.de:
2023
2048
  return messagesDE;
2024
2049
 
2050
+ case Locale.pt:
2051
+ return messagesPT;
2052
+
2025
2053
  case Locale.nl:
2026
2054
  case Locale['nl-BE']:
2027
2055
  case Locale['nl-NL']:
@@ -2223,7 +2251,10 @@ var prefix = 'alma-eligibility-modal';
2223
2251
  */
2224
2252
 
2225
2253
  var STATIC_CUSTOMISATION_CLASSES = {
2254
+ desktopModal: prefix + '-desktop-modal',
2255
+ mobileModal: prefix + '-mobile-modal',
2226
2256
  leftSide: prefix + '-left-side',
2257
+ bullet: prefix + '-bullet',
2227
2258
  rightSide: prefix + '-right-side',
2228
2259
  title: prefix + '-title',
2229
2260
  info: prefix + '-info',
@@ -2438,11 +2469,11 @@ var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary
2438
2469
 
2439
2470
  var Schedule = function Schedule(_ref) {
2440
2471
  var currentPlan = _ref.currentPlan;
2441
- var total = currentPlan && priceFromCents(currentPlan.purchase_amount + currentPlan.customer_total_cost_amount);
2442
- var creditCost = currentPlan ? priceFromCents(currentPlan.customer_total_cost_amount) : 0;
2472
+ var total = priceFromCents(currentPlan.purchase_amount + currentPlan.customer_total_cost_amount);
2473
+ var creditCost = priceFromCents(currentPlan.customer_total_cost_amount);
2443
2474
  var TAEG = (currentPlan == null ? void 0 : currentPlan.annual_interest_rate) && currentPlan.annual_interest_rate / 10000;
2444
- var customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
2445
- var isCredit = currentPlan && currentPlan.installments_count > 4;
2475
+ var customerFees = priceFromCents(currentPlan.customer_total_cost_amount);
2476
+ var isCredit = currentPlan.installments_count > 4;
2446
2477
  var intl = useIntl();
2447
2478
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2448
2479
  className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
@@ -2691,7 +2722,7 @@ var Info = function Info() {
2691
2722
  }, /*#__PURE__*/React.createElement("div", {
2692
2723
  className: s$5.listItem
2693
2724
  }, /*#__PURE__*/React.createElement("div", {
2694
- className: s$5.bullet
2725
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2695
2726
  }, "1"), /*#__PURE__*/React.createElement("div", {
2696
2727
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2697
2728
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2705,7 +2736,7 @@ var Info = function Info() {
2705
2736
  }))), /*#__PURE__*/React.createElement("div", {
2706
2737
  className: s$5.listItem
2707
2738
  }, /*#__PURE__*/React.createElement("div", {
2708
- className: s$5.bullet
2739
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2709
2740
  }, "2"), /*#__PURE__*/React.createElement("div", {
2710
2741
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2711
2742
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2719,12 +2750,12 @@ var Info = function Info() {
2719
2750
  }))), /*#__PURE__*/React.createElement("div", {
2720
2751
  className: s$5.listItem
2721
2752
  }, /*#__PURE__*/React.createElement("div", {
2722
- className: s$5.bullet
2753
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2723
2754
  }, "3"), /*#__PURE__*/React.createElement("div", {
2724
2755
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2725
2756
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2726
2757
  id: "eligibility-modal.bullet-3",
2727
- defaultMessage: "La validation de votre paiement <strong>instantan\xE9e</strong> !",
2758
+ defaultMessage: "La validation de votre paiement est <strong>instantan\xE9e</strong> !",
2728
2759
  values: {
2729
2760
  strong: function strong() {
2730
2761
  return /*#__PURE__*/React.createElement("strong", null, [].slice.call(arguments));
@@ -2818,7 +2849,7 @@ var DesktopModal = function DesktopModal(_ref) {
2818
2849
  isSomePlanDeferred = _ref.isSomePlanDeferred,
2819
2850
  cards = _ref.cards;
2820
2851
  return /*#__PURE__*/React.createElement("div", {
2821
- className: s$8.container,
2852
+ className: cx(s$8.container, STATIC_CUSTOMISATION_CLASSES.desktopModal),
2822
2853
  "data-testid": "modal-container"
2823
2854
  }, /*#__PURE__*/React.createElement("div", {
2824
2855
  className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
@@ -2840,7 +2871,7 @@ var MobileModal = function MobileModal(_ref) {
2840
2871
  isSomePlanDeferred = _ref.isSomePlanDeferred,
2841
2872
  cards = _ref.cards;
2842
2873
  return /*#__PURE__*/React.createElement("div", {
2843
- className: s$a.container,
2874
+ className: cx(s$a.container, STATIC_CUSTOMISATION_CLASSES.mobileModal),
2844
2875
  "data-testid": "modal-container"
2845
2876
  }, /*#__PURE__*/React.createElement(Title, {
2846
2877
  isSomePlanDeferred: isSomePlanDeferred
@@ -2861,7 +2892,7 @@ var EligibilityModal = function EligibilityModal(_ref) {
2861
2892
  setCurrentPlanIndex = _useState[1];
2862
2893
 
2863
2894
  var isBigScreen = useMediaQuery({
2864
- minWidth: 800
2895
+ minWidth: desktopWidth
2865
2896
  });
2866
2897
  var ModalComponent = isBigScreen ? DesktopModal : MobileModal;
2867
2898
  var eligiblePlans = eligibilityPlans.filter(function (plan) {