@alma/widgets 3.2.1 → 3.2.2
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.js +155 -72
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +155 -72
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +105 -30
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +155 -72
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +4 -2
- package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +4 -2
- package/dist/types/Widgets/EligibilityModal/components/Info/index.d.ts +3 -1
- package/dist/types/utils/index.d.ts +2 -0
- 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.js
CHANGED
|
@@ -1554,6 +1554,9 @@ function formatCents(cents) {
|
|
|
1554
1554
|
return String(priceFromCents(cents)).replace('.', ',');
|
|
1555
1555
|
}
|
|
1556
1556
|
var desktopWidth = 800;
|
|
1557
|
+
var isP1X = function isP1X(plan) {
|
|
1558
|
+
return (plan == null ? void 0 : plan.installments_count) === 1 && (plan == null ? void 0 : plan.deferred_days) === 0 && (plan == null ? void 0 : plan.deferred_months) === 0;
|
|
1559
|
+
};
|
|
1557
1560
|
|
|
1558
1561
|
/* eslint-disable */
|
|
1559
1562
|
|
|
@@ -1886,8 +1889,11 @@ var messagesDE = {
|
|
|
1886
1889
|
"credit-features.total-credit-cost": "Davon Kreditkosten",
|
|
1887
1890
|
"eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong> beim Check-out. ",
|
|
1888
1891
|
"eligibility-modal.bullet-2": "Lassen Sie sich führen und bestätigen Sie Ihre Zahlung in <strong>2 Minuten.</strong>",
|
|
1889
|
-
"eligibility-modal.bullet-3": "
|
|
1892
|
+
"eligibility-modal.bullet-3": "</strong>Verlieren Sie nicht die Kontrolle,</strong> indem Sie Ihre Fälligkeitstermine nach Ihrem eigenen Tempo vor- oder zurückverlegen.",
|
|
1890
1893
|
"eligibility-modal.no-eligibility": "Ups, die Prüfung hat anscheinend nicht funktioniert.",
|
|
1894
|
+
"eligibility-modal.p1x-bullet-1": "Wählen Sie <strong>Alma - 1X</strong> beim Check-out.",
|
|
1895
|
+
"eligibility-modal.p1x-bullet-2": "Tragen Sie Ihre <strong>Kreditkarteninformationen ein.</strong>",
|
|
1896
|
+
"eligibility-modal.p1x-bullet-3": "<strong> Ihre Zahlung wird sofort bestätigt! </strong>",
|
|
1891
1897
|
"eligibility-modal.title-deferred-plan": "Zahlen Sie mit Alma in Raten oder später.",
|
|
1892
1898
|
"eligibility-modal.title-normal": "Zahlen Sie mit Alma in mehreren Raten.",
|
|
1893
1899
|
"installments.today": "Heute",
|
|
@@ -1900,7 +1906,8 @@ var messagesDE = {
|
|
|
1900
1906
|
"payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
|
|
1901
1907
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1902
1908
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1903
|
-
"payment-plan-strings.no-fee": "(0% Finanzierung)"
|
|
1909
|
+
"payment-plan-strings.no-fee": "(0% Finanzierung)",
|
|
1910
|
+
"payment-plan-strings.pay-now": "Zahlen Sie jetzt {totalAmount}"
|
|
1904
1911
|
};
|
|
1905
1912
|
|
|
1906
1913
|
var messagesEN = {
|
|
@@ -1911,6 +1918,9 @@ var messagesEN = {
|
|
|
1911
1918
|
"eligibility-modal.bullet-2": "Let us guide you and validate your payment in <strong>2 minutes.</strong>",
|
|
1912
1919
|
"eligibility-modal.bullet-3": "<strong>Stay in control</strong> by moving your deadlines forward or backward at your own pace.",
|
|
1913
1920
|
"eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
|
|
1921
|
+
"eligibility-modal.p1x-bullet-1": "Choose <strong>Alma - 1X</strong> at checkout.",
|
|
1922
|
+
"eligibility-modal.p1x-bullet-2": "Fill in your <strong>credit card information.</strong>",
|
|
1923
|
+
"eligibility-modal.p1x-bullet-3": "<strong>The validation </strong> of your payment is instantaneous!",
|
|
1914
1924
|
"eligibility-modal.title-deferred-plan": "Pay in installments or later by credit card with Alma.",
|
|
1915
1925
|
"eligibility-modal.title-normal": "Pay in installments by credit card with Alma.",
|
|
1916
1926
|
"installments.today": "Today",
|
|
@@ -1923,7 +1933,8 @@ var messagesEN = {
|
|
|
1923
1933
|
"payment-plan-strings.ineligible-lower-than-min": "From {minAmount}",
|
|
1924
1934
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1925
1935
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1926
|
-
"payment-plan-strings.no-fee": "(free of charge)"
|
|
1936
|
+
"payment-plan-strings.no-fee": "(free of charge)",
|
|
1937
|
+
"payment-plan-strings.pay-now": "Pay now {totalAmount}"
|
|
1927
1938
|
};
|
|
1928
1939
|
|
|
1929
1940
|
var messagesES = {
|
|
@@ -1934,6 +1945,9 @@ var messagesES = {
|
|
|
1934
1945
|
"eligibility-modal.bullet-2": "Déjese guiar y valide su pago en <strong>2 minutos.</strong>",
|
|
1935
1946
|
"eligibility-modal.bullet-3": "<strong>Mantenga el control</strong> adelantando o retrasando los plazos a su propio ritmo.",
|
|
1936
1947
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1948
|
+
"eligibility-modal.p1x-bullet-1": "Elija <strong>Alma - 1X</strong> en la caja.",
|
|
1949
|
+
"eligibility-modal.p1x-bullet-2": "Introduzca los datos de su tarjeta de crédito en <strong>.</strong>",
|
|
1950
|
+
"eligibility-modal.p1x-bullet-3": "<strong>¡La validación </strong> de su pago es instantánea!",
|
|
1937
1951
|
"eligibility-modal.title-deferred-plan": "Paga a plazos o posteriormente con tarjeta bancaria con Alma.",
|
|
1938
1952
|
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta bancaria con Alma.",
|
|
1939
1953
|
"installments.today": "Hoy",
|
|
@@ -1946,7 +1960,8 @@ var messagesES = {
|
|
|
1946
1960
|
"payment-plan-strings.ineligible-lower-than-min": "Desde {minAmount}",
|
|
1947
1961
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} hoy, después {numberOfRemainingInstallments} mensualidad de {othersInstallmentAmount}} other {{firstInstallmentAmount} hoy, después {numberOfRemainingInstallments} mensualidades de {othersInstallmentAmount}}}",
|
|
1948
1962
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} plazos de {totalAmount}",
|
|
1949
|
-
"payment-plan-strings.no-fee": "(sin intereses)"
|
|
1963
|
+
"payment-plan-strings.no-fee": "(sin intereses)",
|
|
1964
|
+
"payment-plan-strings.pay-now": "Pague ahora {totalAmount}"
|
|
1950
1965
|
};
|
|
1951
1966
|
|
|
1952
1967
|
var messagesFR = {
|
|
@@ -1957,6 +1972,9 @@ var messagesFR = {
|
|
|
1957
1972
|
"eligibility-modal.bullet-2": "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
1958
1973
|
"eligibility-modal.bullet-3": "<strong>Gardez le contrôle</strong> en avançant ou reculant vos échéances à votre rythme.",
|
|
1959
1974
|
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
|
|
1975
|
+
"eligibility-modal.p1x-bullet-1": "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
1976
|
+
"eligibility-modal.p1x-bullet-2": "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
1977
|
+
"eligibility-modal.p1x-bullet-3": "<strong>La validation </strong> de votre paiement est instantanée !",
|
|
1960
1978
|
"eligibility-modal.title-deferred-plan": "Payez en plusieurs fois ou plus tard par carte bancaire avec Alma.",
|
|
1961
1979
|
"eligibility-modal.title-normal": "Payez en plusieurs fois par carte bancaire avec Alma.",
|
|
1962
1980
|
"installments.today": "Aujourd'hui",
|
|
@@ -1969,30 +1987,35 @@ var messagesFR = {
|
|
|
1969
1987
|
"payment-plan-strings.ineligible-lower-than-min": "À partir de {minAmount}",
|
|
1970
1988
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1971
1989
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1972
|
-
"payment-plan-strings.no-fee": "(sans frais)"
|
|
1990
|
+
"payment-plan-strings.no-fee": "(sans frais)",
|
|
1991
|
+
"payment-plan-strings.pay-now": "Payez maintenant {totalAmount}"
|
|
1973
1992
|
};
|
|
1974
1993
|
|
|
1975
1994
|
var messagesIT = {
|
|
1976
1995
|
"credit-features.credit-cost-display": "{creditCost} (TAEG {taegPercentage})",
|
|
1977
1996
|
"credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua disponibilità finanziaria prima di impegnarti.",
|
|
1978
1997
|
"credit-features.total-credit-cost": "Di cui commissioni",
|
|
1979
|
-
"eligibility-modal.bullet-1": "
|
|
1980
|
-
"eligibility-modal.bullet-2": "
|
|
1981
|
-
"eligibility-modal.bullet-3": "<strong>
|
|
1998
|
+
"eligibility-modal.bullet-1": "Seleziona <strong>Alma</strong> come metodo di pagamento.",
|
|
1999
|
+
"eligibility-modal.bullet-2": "Segui le istruzioni e completa l'acquisto <strong>in meno di 2 minuti.</strong>",
|
|
2000
|
+
"eligibility-modal.bullet-3": "<strong>Gestisci il tuo piano di pagamento</strong> e modifica le scadenze secondo le tue esigenze.",
|
|
1982
2001
|
"eligibility-modal.no-eligibility": "Ops, sembra che qualcosa non abbia funzionato.",
|
|
1983
|
-
"eligibility-modal.
|
|
2002
|
+
"eligibility-modal.p1x-bullet-1": "Scegli <strong>Alma - 1X</strong> alla cassa.",
|
|
2003
|
+
"eligibility-modal.p1x-bullet-2": "Inserisci i dati della tua <strong>carta bancaria.</strong>",
|
|
2004
|
+
"eligibility-modal.p1x-bullet-3": "Ricevi la conferma di pagamento <strong>istantaneamente!</strong>",
|
|
2005
|
+
"eligibility-modal.title-deferred-plan": "Paga a rate con Alma, senza registrazione.",
|
|
1984
2006
|
"eligibility-modal.title-normal": "Paga a rate con Alma, senza registrazione.",
|
|
1985
2007
|
"installments.today": "Oggi",
|
|
1986
2008
|
"installments.total-amount": "Totale",
|
|
1987
2009
|
"installments.total-fees": "Di cui commissioni",
|
|
1988
2010
|
"payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
|
|
1989
|
-
"payment-plan-strings.default-message": "Paga a rate con Alma",
|
|
2011
|
+
"payment-plan-strings.default-message": "Paga a rate con Alma, senza registrazione.",
|
|
1990
2012
|
"payment-plan-strings.deferred": "{totalAmount} da pagare il {dueDate}",
|
|
1991
2013
|
"payment-plan-strings.ineligible-greater-than-max": "Disponibile fino a {maxAmount}",
|
|
1992
2014
|
"payment-plan-strings.ineligible-lower-than-min": "Pagamento rateale disponibile a partire da {minAmount}",
|
|
1993
2015
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {Oggi paghi {firstInstallmentAmount} poi tra {numberOfRemainingInstallments} mese {othersInstallmentAmount}} other {Oggi paghi {firstInstallmentAmount} poi {numberOfRemainingInstallments} rate mensili di {othersInstallmentAmount}}}",
|
|
1994
2016
|
"payment-plan-strings.multiple-installments-same-amount": "In {installmentsCount} rate mensili di {totalAmount}",
|
|
1995
|
-
"payment-plan-strings.no-fee": "(senza interessi)"
|
|
2017
|
+
"payment-plan-strings.no-fee": "(senza interessi)",
|
|
2018
|
+
"payment-plan-strings.pay-now": "Paga ora {totalAmount}"
|
|
1996
2019
|
};
|
|
1997
2020
|
|
|
1998
2021
|
var messagesNL = {
|
|
@@ -2003,6 +2026,9 @@ var messagesNL = {
|
|
|
2003
2026
|
"eligibility-modal.bullet-2": "Laat ons u begeleiden en uw betaling valideren in <strong>2 minuten.</strong>",
|
|
2004
2027
|
"eligibility-modal.bullet-3": "<strong>Houd de controle op</strong> door uw deadlines in uw eigen tempo vooruit of achteruit te schuiven.",
|
|
2005
2028
|
"eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
|
|
2029
|
+
"eligibility-modal.p1x-bullet-1": "Kies <strong>Alma - 1X</strong> bij het afrekenen.",
|
|
2030
|
+
"eligibility-modal.p1x-bullet-2": "Vul uw <strong>creditcardgegevens in.</strong>",
|
|
2031
|
+
"eligibility-modal.p1x-bullet-3": "<strong>De validatie </strong> van uw betaling is onmiddellijk!",
|
|
2006
2032
|
"eligibility-modal.title-deferred-plan": "Betaal in termijnen of later per creditcard met Alma.",
|
|
2007
2033
|
"eligibility-modal.title-normal": "Betaal in termijnen met een creditcard bij Alma.",
|
|
2008
2034
|
"installments.today": "Tegenwoordig",
|
|
@@ -2015,7 +2041,8 @@ var messagesNL = {
|
|
|
2015
2041
|
"payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
|
|
2016
2042
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
2017
2043
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
2018
|
-
"payment-plan-strings.no-fee": "(zonder kosten)"
|
|
2044
|
+
"payment-plan-strings.no-fee": "(zonder kosten)",
|
|
2045
|
+
"payment-plan-strings.pay-now": "Betaal nu {totalAmount}"
|
|
2019
2046
|
};
|
|
2020
2047
|
|
|
2021
2048
|
var messagesPT = {
|
|
@@ -2026,6 +2053,9 @@ var messagesPT = {
|
|
|
2026
2053
|
"eligibility-modal.bullet-2": "Deixe-nos guiá-lo e validar o seu pagamento em <strong>2 minutos.</strong>",
|
|
2027
2054
|
"eligibility-modal.bullet-3": "<strong>Mantenha-se em controlo</strong> avançando ou recuando os seus prazos ao seu próprio ritmo.",
|
|
2028
2055
|
"eligibility-modal.no-eligibility": "Ups, parece que a simulação não funcionou.",
|
|
2056
|
+
"eligibility-modal.p1x-bullet-1": "Escolher <strong>Alma - 1X</strong> no checkout.",
|
|
2057
|
+
"eligibility-modal.p1x-bullet-2": "Preencha as informações do seu <strong>cartão de crédito.</strong>",
|
|
2058
|
+
"eligibility-modal.p1x-bullet-3": "<strong>A validação </strong> do seu pagamento é instantânea!",
|
|
2029
2059
|
"eligibility-modal.title-deferred-plan": "Pagar em prestações ou mais tarde por cartão de crédito com Alma.",
|
|
2030
2060
|
"eligibility-modal.title-normal": "Pagar em prestações por cartão de crédito com Alma.",
|
|
2031
2061
|
"installments.today": "Hoje",
|
|
@@ -2038,7 +2068,8 @@ var messagesPT = {
|
|
|
2038
2068
|
"payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
|
|
2039
2069
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
2040
2070
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
2041
|
-
"payment-plan-strings.no-fee": "(sem encargos)"
|
|
2071
|
+
"payment-plan-strings.no-fee": "(sem encargos)",
|
|
2072
|
+
"payment-plan-strings.pay-now": "Pague agora {totalAmount}"
|
|
2042
2073
|
};
|
|
2043
2074
|
|
|
2044
2075
|
var getTranslationsByLocale = function getTranslationsByLocale(locale) {
|
|
@@ -2158,17 +2189,15 @@ var getPaymentPlanBoundaries = function getPaymentPlanBoundaries(plan, configPla
|
|
|
2158
2189
|
};
|
|
2159
2190
|
|
|
2160
2191
|
var filterELigibility = function filterELigibility(eligibilities, configPlans) {
|
|
2161
|
-
// Remove
|
|
2162
|
-
var filteredEligibilityPlans = eligibilities.filter(function (plan) {
|
|
2163
|
-
return !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0);
|
|
2164
|
-
}); // If no configPlans was provided, return eligibility response
|
|
2165
|
-
|
|
2192
|
+
// Remove P1X if no configuration is provided
|
|
2166
2193
|
if (!configPlans) {
|
|
2167
|
-
return
|
|
2194
|
+
return eligibilities.filter(function (plan) {
|
|
2195
|
+
return !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0);
|
|
2196
|
+
});
|
|
2168
2197
|
} // Else check if the plan is eligible regarding the related configPlan
|
|
2169
2198
|
|
|
2170
2199
|
|
|
2171
|
-
return
|
|
2200
|
+
return eligibilities.map(function (plan) {
|
|
2172
2201
|
var eligibilityDeferredDays = (plan.deferred_months ? plan.deferred_months : 0) * 30 + (plan.deferred_days ? plan.deferred_days : 0); // find the related configPlan
|
|
2173
2202
|
|
|
2174
2203
|
var relatedConfigPlan = configPlans.find(function (configPlan) {
|
|
@@ -2402,7 +2431,8 @@ var paymentPlanShorthandName = function paymentPlanShorthandName(payment) {
|
|
|
2402
2431
|
installmentsCount = payment.installments_count;
|
|
2403
2432
|
var deferredDaysCount = deferred_days + deferred_months * 30;
|
|
2404
2433
|
|
|
2405
|
-
if (installmentsCount === 1) {
|
|
2434
|
+
if (installmentsCount === 1 && deferredDaysCount > 0) {
|
|
2435
|
+
// For now there is no distinction between deferred days and deferred months, it will be J+ anyway
|
|
2406
2436
|
return /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2407
2437
|
id: "payment-plan-strings.day-abbreviation",
|
|
2408
2438
|
defaultMessage: "J{numberOfDeferredDays}",
|
|
@@ -2491,6 +2521,21 @@ var paymentPlanInfoText = function paymentPlanInfoText(payment) {
|
|
|
2491
2521
|
return index === 0 || installment.total_amount === payment_plan[0].total_amount;
|
|
2492
2522
|
});
|
|
2493
2523
|
|
|
2524
|
+
if (isP1X(payment)) {
|
|
2525
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2526
|
+
id: "payment-plan-strings.pay-now",
|
|
2527
|
+
defaultMessage: "Payez maintenant {totalAmount}",
|
|
2528
|
+
values: {
|
|
2529
|
+
totalAmount: /*#__PURE__*/React__default.createElement(reactIntl.FormattedNumber, {
|
|
2530
|
+
value: priceFromCents(payment_plan[0].total_amount),
|
|
2531
|
+
style: "currency",
|
|
2532
|
+
currency: "EUR"
|
|
2533
|
+
}),
|
|
2534
|
+
installmentsCount: installmentsCount
|
|
2535
|
+
}
|
|
2536
|
+
}), withNoFee(payment));
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2494
2539
|
if (areInstallmentsOfSameAmount) {
|
|
2495
2540
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2496
2541
|
id: "payment-plan-strings.multiple-installments-same-amount",
|
|
@@ -2797,53 +2842,82 @@ var Cards = function Cards(_ref) {
|
|
|
2797
2842
|
|
|
2798
2843
|
var s$7 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2799
2844
|
|
|
2800
|
-
var Info = function Info() {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2845
|
+
var Info = function Info(_ref) {
|
|
2846
|
+
var isCurrentPlanP1X = _ref.isCurrentPlanP1X;
|
|
2847
|
+
return (
|
|
2848
|
+
/*#__PURE__*/
|
|
2849
|
+
// TODO: refactor this component into subcomponent to factorise code and be cleaner
|
|
2850
|
+
React__default.createElement("div", {
|
|
2851
|
+
className: cx(s$7.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2852
|
+
"data-testid": "modal-info-element"
|
|
2853
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2854
|
+
className: s$7.listItem
|
|
2855
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2856
|
+
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2857
|
+
}, "1"), /*#__PURE__*/React__default.createElement("div", {
|
|
2858
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2859
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2860
|
+
id: "eligibility-modal.p1x-bullet-1",
|
|
2861
|
+
defaultMessage: "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
2862
|
+
values: {
|
|
2863
|
+
strong: function strong() {
|
|
2864
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2865
|
+
}
|
|
2816
2866
|
}
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
}, /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2825
|
-
id: "eligibility-modal.bullet-2",
|
|
2826
|
-
defaultMessage: "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
2827
|
-
values: {
|
|
2828
|
-
strong: function strong() {
|
|
2829
|
-
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2867
|
+
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2868
|
+
id: "eligibility-modal.bullet-1",
|
|
2869
|
+
defaultMessage: "Choisissez <strong>Alma</strong> au moment du paiement.",
|
|
2870
|
+
values: {
|
|
2871
|
+
strong: function strong() {
|
|
2872
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2873
|
+
}
|
|
2830
2874
|
}
|
|
2831
|
-
}
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2875
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2876
|
+
className: s$7.listItem
|
|
2877
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2878
|
+
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2879
|
+
}, "2"), /*#__PURE__*/React__default.createElement("div", {
|
|
2880
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2881
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2882
|
+
id: "eligibility-modal.p1x-bullet-2",
|
|
2883
|
+
defaultMessage: "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
2884
|
+
values: {
|
|
2885
|
+
strong: function strong() {
|
|
2886
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2887
|
+
}
|
|
2844
2888
|
}
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2889
|
+
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2890
|
+
id: "eligibility-modal.bullet-2",
|
|
2891
|
+
defaultMessage: "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
2892
|
+
values: {
|
|
2893
|
+
strong: function strong() {
|
|
2894
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2898
|
+
className: s$7.listItem
|
|
2899
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2900
|
+
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2901
|
+
}, "3"), /*#__PURE__*/React__default.createElement("div", {
|
|
2902
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2903
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2904
|
+
id: "eligibility-modal.p1x-bullet-3",
|
|
2905
|
+
defaultMessage: "<strong>La validation </strong> de votre paiement est instantan\xE9e !",
|
|
2906
|
+
values: {
|
|
2907
|
+
strong: function strong() {
|
|
2908
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
}) : /*#__PURE__*/React__default.createElement(reactIntl.FormattedMessage, {
|
|
2912
|
+
id: "eligibility-modal.bullet-3",
|
|
2913
|
+
defaultMessage: "<strong>Gardez le contr\xF4le</strong> en avan\xE7ant ou reculant vos \xE9ch\xE9ances \xE0 votre rythme.",
|
|
2914
|
+
values: {
|
|
2915
|
+
strong: function strong() {
|
|
2916
|
+
return /*#__PURE__*/React__default.createElement("strong", null, [].slice.call(arguments));
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
}))))
|
|
2920
|
+
);
|
|
2847
2921
|
};
|
|
2848
2922
|
|
|
2849
2923
|
var s$8 = {"title":"_3ERx-"};
|
|
@@ -2867,7 +2941,8 @@ var s$9 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC","logo":"_xW3wt"
|
|
|
2867
2941
|
var DesktopModal = function DesktopModal(_ref) {
|
|
2868
2942
|
var children = _ref.children,
|
|
2869
2943
|
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2870
|
-
cards = _ref.cards
|
|
2944
|
+
cards = _ref.cards,
|
|
2945
|
+
isCurrentPlanP1X = _ref.isCurrentPlanP1X;
|
|
2871
2946
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2872
2947
|
className: cx(s$9.container, STATIC_CUSTOMISATION_CLASSES.desktopModal),
|
|
2873
2948
|
"data-testid": "modal-container"
|
|
@@ -2875,7 +2950,9 @@ var DesktopModal = function DesktopModal(_ref) {
|
|
|
2875
2950
|
className: cx([s$9.block, s$9.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2876
2951
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
2877
2952
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2878
|
-
}), /*#__PURE__*/React__default.createElement(Info,
|
|
2953
|
+
}), /*#__PURE__*/React__default.createElement(Info, {
|
|
2954
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2955
|
+
}), cards && /*#__PURE__*/React__default.createElement(Cards, {
|
|
2879
2956
|
cards: cards
|
|
2880
2957
|
}), /*#__PURE__*/React__default.createElement(AlmaLogo, {
|
|
2881
2958
|
className: s$9.logo,
|
|
@@ -2892,13 +2969,16 @@ var s$b = {"container":"_2G7Ch","logo":"_2779r"};
|
|
|
2892
2969
|
var MobileModal = function MobileModal(_ref) {
|
|
2893
2970
|
var children = _ref.children,
|
|
2894
2971
|
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2895
|
-
cards = _ref.cards
|
|
2972
|
+
cards = _ref.cards,
|
|
2973
|
+
isCurrentPlanP1X = _ref.isCurrentPlanP1X;
|
|
2896
2974
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2897
2975
|
className: cx(s$b.container, STATIC_CUSTOMISATION_CLASSES.mobileModal),
|
|
2898
2976
|
"data-testid": "modal-container"
|
|
2899
2977
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
2900
2978
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2901
|
-
}), children, /*#__PURE__*/React__default.createElement(Info,
|
|
2979
|
+
}), children, /*#__PURE__*/React__default.createElement(Info, {
|
|
2980
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2981
|
+
}), cards && /*#__PURE__*/React__default.createElement(Cards, {
|
|
2902
2982
|
cards: cards
|
|
2903
2983
|
}), /*#__PURE__*/React__default.createElement(AlmaLogo, {
|
|
2904
2984
|
className: s$b.logo,
|
|
@@ -2935,7 +3015,8 @@ var EligibilityModal = function EligibilityModal(_ref) {
|
|
|
2935
3015
|
isOpen: true
|
|
2936
3016
|
}, /*#__PURE__*/React__default.createElement(ModalComponent, {
|
|
2937
3017
|
isSomePlanDeferred: isSomePlanDeferred,
|
|
2938
|
-
cards: cards
|
|
3018
|
+
cards: cards,
|
|
3019
|
+
isCurrentPlanP1X: isP1X(currentPlan)
|
|
2939
3020
|
}, status === apiStatus.PENDING && /*#__PURE__*/React__default.createElement("div", {
|
|
2940
3021
|
className: s$a.loader
|
|
2941
3022
|
}, /*#__PURE__*/React__default.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3052,7 +3133,9 @@ var getIndexOfActivePlan = function getIndexOfActivePlan(_ref) {
|
|
|
3052
3133
|
var _loop = function _loop(index) {
|
|
3053
3134
|
var installmentsCount = suggestedPaymentPlanArray[index];
|
|
3054
3135
|
var planFound = eligibilityPlans.findIndex(function (plan) {
|
|
3055
|
-
return plan.installments_count === installmentsCount && plan.eligible
|
|
3136
|
+
return plan.installments_count === installmentsCount && plan.eligible && // Remove the PayLater plans from the plan to target, we will code a better solution later
|
|
3137
|
+
// To differentiate P1X from PayLater while using the `suggestedPaymentPlan` property.
|
|
3138
|
+
!plan.deferred_days && !plan.deferred_months;
|
|
3056
3139
|
});
|
|
3057
3140
|
|
|
3058
3141
|
if (planFound !== -1) {
|
|
@@ -3091,7 +3174,7 @@ var STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
3091
3174
|
|
|
3092
3175
|
var s$d = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","monochrome":"_2hx83","notEligible":"_3O1bg","hideBorder":"_3_qcn","info":"_25GrF","loader":"_30j1O","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
|
|
3093
3176
|
|
|
3094
|
-
var VERY_LONG_TIME_IN_MS = 1000 * 3600
|
|
3177
|
+
var VERY_LONG_TIME_IN_MS = 1000 * 3600;
|
|
3095
3178
|
var DEFAULT_TRANSITION_TIME = 5500;
|
|
3096
3179
|
|
|
3097
3180
|
var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|