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