@pelcro/react-pelcro-js 2.4.0-beta.8 → 2.6.0-beta.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.
- package/dist/index.cjs.js +826 -323
- package/dist/index.esm.js +820 -324
- package/dist/pelcro.css +119 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3462,6 +3462,7 @@ var paymentMethod_fr = {
|
|
|
3462
3462
|
};
|
|
3463
3463
|
|
|
3464
3464
|
var title$d = "Enter your email to subscribe to our newsletter";
|
|
3465
|
+
var updateTitle$1 = "Update newsletter selections";
|
|
3465
3466
|
var subtitle$7 = "We may use your email for other marketing communication";
|
|
3466
3467
|
var labels$l = {
|
|
3467
3468
|
submit: "Submit",
|
|
@@ -3473,22 +3474,21 @@ var labels$l = {
|
|
|
3473
3474
|
};
|
|
3474
3475
|
var messages$p = {
|
|
3475
3476
|
alreadyHaveAccount: "Already have an account?",
|
|
3477
|
+
success: "Newsletters were successfully updated",
|
|
3476
3478
|
loginHere: "Login here.",
|
|
3477
3479
|
createAnAccount: " Create an account by clicking ",
|
|
3478
3480
|
here: "here"
|
|
3479
3481
|
};
|
|
3480
|
-
var errors$b = {
|
|
3481
|
-
"": ""
|
|
3482
|
-
};
|
|
3483
3482
|
var newsletter_en = {
|
|
3484
3483
|
title: title$d,
|
|
3484
|
+
updateTitle: updateTitle$1,
|
|
3485
3485
|
subtitle: subtitle$7,
|
|
3486
3486
|
labels: labels$l,
|
|
3487
|
-
messages: messages$p
|
|
3488
|
-
errors: errors$b
|
|
3487
|
+
messages: messages$p
|
|
3489
3488
|
};
|
|
3490
3489
|
|
|
3491
3490
|
var title$c = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
|
|
3491
|
+
var updateTitle = "Mettre à jour son choix d'infolettres";
|
|
3492
3492
|
var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
|
|
3493
3493
|
var labels$k = {
|
|
3494
3494
|
submit: "Lire l’article !",
|
|
@@ -3500,19 +3500,17 @@ var labels$k = {
|
|
|
3500
3500
|
};
|
|
3501
3501
|
var messages$o = {
|
|
3502
3502
|
alreadyHaveAccount: "Vous avez déjà un compte ?",
|
|
3503
|
+
success: "Votre choix d'infolettres à été mis à jour",
|
|
3503
3504
|
loginHere: "Connectez-vous ici",
|
|
3504
3505
|
createAnAccount: " Créez un compte en cliquant ",
|
|
3505
3506
|
here: "ici"
|
|
3506
3507
|
};
|
|
3507
|
-
var errors$a = {
|
|
3508
|
-
"": ""
|
|
3509
|
-
};
|
|
3510
3508
|
var newsletter_fr = {
|
|
3511
3509
|
title: title$c,
|
|
3510
|
+
updateTitle: updateTitle,
|
|
3512
3511
|
subtitle: subtitle$6,
|
|
3513
3512
|
labels: labels$k,
|
|
3514
|
-
messages: messages$o
|
|
3515
|
-
errors: errors$a
|
|
3513
|
+
messages: messages$o
|
|
3516
3514
|
};
|
|
3517
3515
|
|
|
3518
3516
|
var labels$j = {
|
|
@@ -3529,7 +3527,7 @@ var messages$n = {
|
|
|
3529
3527
|
},
|
|
3530
3528
|
giftCreate: {
|
|
3531
3529
|
title: "Your gift has been sent",
|
|
3532
|
-
content: "
|
|
3530
|
+
content: "Your recipient will receive an email with instructions to redeem their gift soon."
|
|
3533
3531
|
},
|
|
3534
3532
|
giftRedeem: {
|
|
3535
3533
|
title: "Congratulations",
|
|
@@ -3559,7 +3557,7 @@ var messages$m = {
|
|
|
3559
3557
|
},
|
|
3560
3558
|
giftCreate: {
|
|
3561
3559
|
title: "Votre cadeau a été envoyé",
|
|
3562
|
-
content: "Le cadeau d
|
|
3560
|
+
content: "Le cadeau d'abonnement a été envoyé avec succès."
|
|
3563
3561
|
},
|
|
3564
3562
|
giftRedeem: {
|
|
3565
3563
|
title: "Félicitations",
|
|
@@ -3621,7 +3619,8 @@ var labels$h = {
|
|
|
3621
3619
|
code: "Coupon code",
|
|
3622
3620
|
"for": "for",
|
|
3623
3621
|
interval: "{{count}} {{interval}}",
|
|
3624
|
-
interval_plural: "{{count}} {{interval}}s"
|
|
3622
|
+
interval_plural: "{{count}} {{interval}}s",
|
|
3623
|
+
tax: "+ Tax"
|
|
3625
3624
|
};
|
|
3626
3625
|
var checkoutForm_en = {
|
|
3627
3626
|
messages: messages$j,
|
|
@@ -3646,7 +3645,8 @@ var labels$g = {
|
|
|
3646
3645
|
code: "Code promo",
|
|
3647
3646
|
"for": "pour",
|
|
3648
3647
|
interval: "{{count}} {{interval}}",
|
|
3649
|
-
interval_plural: "{{count}} {{interval}}s"
|
|
3648
|
+
interval_plural: "{{count}} {{interval}}s",
|
|
3649
|
+
tax: "+ Taxe"
|
|
3650
3650
|
};
|
|
3651
3651
|
var checkoutForm_fr = {
|
|
3652
3652
|
messages: messages$i,
|
|
@@ -4375,6 +4375,7 @@ var labels$3 = {
|
|
|
4375
4375
|
profile: "Profile",
|
|
4376
4376
|
updateProfile: "Edit profile",
|
|
4377
4377
|
changePassword: "Change password",
|
|
4378
|
+
editNewsletters: "Edit newsletters",
|
|
4378
4379
|
edit: "Edit",
|
|
4379
4380
|
gifts: "Gifts",
|
|
4380
4381
|
redeemGift: "Redeem gift",
|
|
@@ -4405,6 +4406,9 @@ var labels$3 = {
|
|
|
4405
4406
|
categories: "Categories",
|
|
4406
4407
|
details: "Details",
|
|
4407
4408
|
removeItem: "Remove"
|
|
4409
|
+
},
|
|
4410
|
+
subCancellation: {
|
|
4411
|
+
goBack: "Go back"
|
|
4408
4412
|
}
|
|
4409
4413
|
};
|
|
4410
4414
|
var messages$3 = {
|
|
@@ -4448,6 +4452,7 @@ var labels$2 = {
|
|
|
4448
4452
|
profile: "Profil",
|
|
4449
4453
|
updateProfile: "Mettre à jour le profil",
|
|
4450
4454
|
changePassword: "Changer le mot de passe",
|
|
4455
|
+
editNewsletters: "Modifier les newsletters",
|
|
4451
4456
|
edit: "Modifier",
|
|
4452
4457
|
gifts: "Cadeaux",
|
|
4453
4458
|
redeemGift: "Échanger un cadeau",
|
|
@@ -4478,6 +4483,9 @@ var labels$2 = {
|
|
|
4478
4483
|
categories: "Catégories",
|
|
4479
4484
|
details: "Détails",
|
|
4480
4485
|
removeItem: "Retirer"
|
|
4486
|
+
},
|
|
4487
|
+
subCancellation: {
|
|
4488
|
+
goBack: "Retourner"
|
|
4481
4489
|
}
|
|
4482
4490
|
};
|
|
4483
4491
|
var messages$2 = {
|
|
@@ -5921,7 +5929,7 @@ class PelcroActions {
|
|
|
5921
5929
|
view,
|
|
5922
5930
|
cartItems,
|
|
5923
5931
|
...otherStateFields
|
|
5924
|
-
} = initialState$
|
|
5932
|
+
} = initialState$g;
|
|
5925
5933
|
this.set(otherStateFields);
|
|
5926
5934
|
});
|
|
5927
5935
|
|
|
@@ -6211,7 +6219,7 @@ class PelcroCallbacks {
|
|
|
6211
6219
|
|
|
6212
6220
|
}
|
|
6213
6221
|
|
|
6214
|
-
const initialState$
|
|
6222
|
+
const initialState$g = {
|
|
6215
6223
|
// View
|
|
6216
6224
|
view: null,
|
|
6217
6225
|
// Plans
|
|
@@ -6239,7 +6247,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
|
|
|
6239
6247
|
return {
|
|
6240
6248
|
// Store setter
|
|
6241
6249
|
set,
|
|
6242
|
-
...initialState$
|
|
6250
|
+
...initialState$g,
|
|
6243
6251
|
// State actions
|
|
6244
6252
|
...actions,
|
|
6245
6253
|
// Callbacks
|
|
@@ -6370,11 +6378,40 @@ const calcAndFormatItemsTotal = (items, currency) => {
|
|
|
6370
6378
|
*/
|
|
6371
6379
|
|
|
6372
6380
|
const isValidViewFromURL = viewID => {
|
|
6373
|
-
if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart"].includes(viewID)) {
|
|
6381
|
+
if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart"].includes(viewID) || hasValidNewsletterUpdateUrl()) {
|
|
6374
6382
|
return true;
|
|
6375
6383
|
}
|
|
6376
6384
|
|
|
6377
6385
|
return false;
|
|
6386
|
+
|
|
6387
|
+
function hasValidNewsletterUpdateUrl() {
|
|
6388
|
+
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
6389
|
+
|
|
6390
|
+
if (viewID !== "newsletter-update") return false;
|
|
6391
|
+
const newsletters = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.newsletters;
|
|
6392
|
+
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
6393
|
+
|
|
6394
|
+
if (!siteHasNewslettersDefined) {
|
|
6395
|
+
return false;
|
|
6396
|
+
}
|
|
6397
|
+
|
|
6398
|
+
const queryParamEmail = window.Pelcro.helpers.getURLParameter("email");
|
|
6399
|
+
|
|
6400
|
+
if (queryParamEmail && window.Pelcro.user.isAuthenticated()) {
|
|
6401
|
+
var _window$Pelcro$user$r4;
|
|
6402
|
+
|
|
6403
|
+
if (queryParamEmail !== ((_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.email)) {
|
|
6404
|
+
console.error("email query parameter and user account email are different, url email query parameter must match user email if user is logged in");
|
|
6405
|
+
return false;
|
|
6406
|
+
}
|
|
6407
|
+
}
|
|
6408
|
+
|
|
6409
|
+
if (!queryParamEmail && !window.Pelcro.user.isAuthenticated()) {
|
|
6410
|
+
return false;
|
|
6411
|
+
}
|
|
6412
|
+
|
|
6413
|
+
return true;
|
|
6414
|
+
}
|
|
6378
6415
|
};
|
|
6379
6416
|
/**
|
|
6380
6417
|
* Returns the current stable viewID from all old variations
|
|
@@ -6406,7 +6443,7 @@ const disableScroll = () => {
|
|
|
6406
6443
|
}
|
|
6407
6444
|
};
|
|
6408
6445
|
const trackSubscriptionOnGA = () => {
|
|
6409
|
-
var _ReactGA$set, _window$Pelcro$user$
|
|
6446
|
+
var _ReactGA$set, _window$Pelcro$user$r5, _window$Pelcro$user$r6, _ReactGA$plugin, _ReactGA$plugin$execu, _ReactGA$plugin2, _ReactGA$plugin2$exec, _ReactGA$plugin3, _ReactGA$plugin3$exec, _ReactGA$event;
|
|
6410
6447
|
|
|
6411
6448
|
const {
|
|
6412
6449
|
product,
|
|
@@ -6428,7 +6465,7 @@ const trackSubscriptionOnGA = () => {
|
|
|
6428
6465
|
}
|
|
6429
6466
|
|
|
6430
6467
|
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$set = ReactGA.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA, {
|
|
6431
|
-
currencyCode: (_window$Pelcro$user$
|
|
6468
|
+
currencyCode: (_window$Pelcro$user$r5 = (_window$Pelcro$user$r6 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r6 === void 0 ? void 0 : _window$Pelcro$user$r6.currency) !== null && _window$Pelcro$user$r5 !== void 0 ? _window$Pelcro$user$r5 : plan.currency
|
|
6432
6469
|
});
|
|
6433
6470
|
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin = ReactGA.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$execu = _ReactGA$plugin.execute) === null || _ReactGA$plugin$execu === void 0 ? void 0 : _ReactGA$plugin$execu.call(_ReactGA$plugin, "ecommerce", "addTransaction", {
|
|
6434
6471
|
id: lastSubscriptionId,
|
|
@@ -6456,9 +6493,9 @@ const trackSubscriptionOnGA = () => {
|
|
|
6456
6493
|
*/
|
|
6457
6494
|
|
|
6458
6495
|
const userHasPaymentMethod = () => {
|
|
6459
|
-
var _window$Pelcro$user$
|
|
6496
|
+
var _window$Pelcro$user$r7, _window$Pelcro$user$r8;
|
|
6460
6497
|
|
|
6461
|
-
const sources = (_window$Pelcro$user$
|
|
6498
|
+
const sources = (_window$Pelcro$user$r7 = (_window$Pelcro$user$r8 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r8 === void 0 ? void 0 : _window$Pelcro$user$r8.sources) !== null && _window$Pelcro$user$r7 !== void 0 ? _window$Pelcro$user$r7 : [];
|
|
6462
6499
|
return sources.length > 0;
|
|
6463
6500
|
};
|
|
6464
6501
|
/**
|
|
@@ -6840,8 +6877,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
|
|
|
6840
6877
|
|
|
6841
6878
|
let e={data:""},t=t=>"undefined"!=typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,n=(e,t)=>{let r,l="",a="",o="";for(let c in e){let s=e[c];"object"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):c,a+="@"==c[0]?"f"==c[1]?n(s,c):c+"{"+n(s,"k"==c[1]?"":t)+"}":n(s,r)):"@"==c[0]&&"i"==c[1]?l=c+" "+s+";":(c=c.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=n.p?n.p(c,s):c+":"+s+";");}return o[0]?(r=t?t+"{"+o+"}":o,l+r+a):l+a},o={},c=e=>{let t="";for(let r in e)t+=r+("object"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p="object"==typeof e?c(e):e,u=o[p]||(o[p]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(p));if(!o[u]){let t="object"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,""));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{["@keyframes "+u]:t}:t,r?"":"."+u);}return ((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":n(e,""):e;}return e+l+(null==o?"":o)},"");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,f,d;p.bind({g:1});let b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,f=r,d=l;}function y(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=p.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=c.as||e;return d&&i[0]&&d(c),u(i,c)}return t?t(a):a}}
|
|
6842
6879
|
|
|
6843
|
-
function _extends$
|
|
6844
|
-
_extends$
|
|
6880
|
+
function _extends$u() {
|
|
6881
|
+
_extends$u = Object.assign || function (target) {
|
|
6845
6882
|
for (var i = 1; i < arguments.length; i++) {
|
|
6846
6883
|
var source = arguments[i];
|
|
6847
6884
|
|
|
@@ -6855,7 +6892,7 @@ function _extends$t() {
|
|
|
6855
6892
|
return target;
|
|
6856
6893
|
};
|
|
6857
6894
|
|
|
6858
|
-
return _extends$
|
|
6895
|
+
return _extends$u.apply(this, arguments);
|
|
6859
6896
|
}
|
|
6860
6897
|
|
|
6861
6898
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
@@ -6945,7 +6982,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
|
|
|
6945
6982
|
var reducer = function reducer(state, action) {
|
|
6946
6983
|
switch (action.type) {
|
|
6947
6984
|
case ActionType.ADD_TOAST:
|
|
6948
|
-
return _extends$
|
|
6985
|
+
return _extends$u({}, state, {
|
|
6949
6986
|
toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
|
|
6950
6987
|
});
|
|
6951
6988
|
|
|
@@ -6955,9 +6992,9 @@ var reducer = function reducer(state, action) {
|
|
|
6955
6992
|
clearFromRemoveQueue(action.toast.id);
|
|
6956
6993
|
}
|
|
6957
6994
|
|
|
6958
|
-
return _extends$
|
|
6995
|
+
return _extends$u({}, state, {
|
|
6959
6996
|
toasts: state.toasts.map(function (t) {
|
|
6960
|
-
return t.id === action.toast.id ? _extends$
|
|
6997
|
+
return t.id === action.toast.id ? _extends$u({}, t, action.toast) : t;
|
|
6961
6998
|
})
|
|
6962
6999
|
});
|
|
6963
7000
|
|
|
@@ -6984,9 +7021,9 @@ var reducer = function reducer(state, action) {
|
|
|
6984
7021
|
});
|
|
6985
7022
|
}
|
|
6986
7023
|
|
|
6987
|
-
return _extends$
|
|
7024
|
+
return _extends$u({}, state, {
|
|
6988
7025
|
toasts: state.toasts.map(function (t) {
|
|
6989
|
-
return t.id === toastId || toastId === undefined ? _extends$
|
|
7026
|
+
return t.id === toastId || toastId === undefined ? _extends$u({}, t, {
|
|
6990
7027
|
visible: false
|
|
6991
7028
|
}) : t;
|
|
6992
7029
|
})
|
|
@@ -6994,28 +7031,28 @@ var reducer = function reducer(state, action) {
|
|
|
6994
7031
|
|
|
6995
7032
|
case ActionType.REMOVE_TOAST:
|
|
6996
7033
|
if (action.toastId === undefined) {
|
|
6997
|
-
return _extends$
|
|
7034
|
+
return _extends$u({}, state, {
|
|
6998
7035
|
toasts: []
|
|
6999
7036
|
});
|
|
7000
7037
|
}
|
|
7001
7038
|
|
|
7002
|
-
return _extends$
|
|
7039
|
+
return _extends$u({}, state, {
|
|
7003
7040
|
toasts: state.toasts.filter(function (t) {
|
|
7004
7041
|
return t.id !== action.toastId;
|
|
7005
7042
|
})
|
|
7006
7043
|
});
|
|
7007
7044
|
|
|
7008
7045
|
case ActionType.START_PAUSE:
|
|
7009
|
-
return _extends$
|
|
7046
|
+
return _extends$u({}, state, {
|
|
7010
7047
|
pausedAt: action.time
|
|
7011
7048
|
});
|
|
7012
7049
|
|
|
7013
7050
|
case ActionType.END_PAUSE:
|
|
7014
7051
|
var diff = action.time - (state.pausedAt || 0);
|
|
7015
|
-
return _extends$
|
|
7052
|
+
return _extends$u({}, state, {
|
|
7016
7053
|
pausedAt: undefined,
|
|
7017
7054
|
toasts: state.toasts.map(function (t) {
|
|
7018
|
-
return _extends$
|
|
7055
|
+
return _extends$u({}, t, {
|
|
7019
7056
|
pauseDuration: t.pauseDuration + diff
|
|
7020
7057
|
});
|
|
7021
7058
|
})
|
|
@@ -7062,12 +7099,12 @@ var useStore = function useStore(toastOptions) {
|
|
|
7062
7099
|
var mergedToasts = state.toasts.map(function (t) {
|
|
7063
7100
|
var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
|
|
7064
7101
|
|
|
7065
|
-
return _extends$
|
|
7102
|
+
return _extends$u({}, toastOptions, toastOptions[t.type], t, {
|
|
7066
7103
|
duration: t.duration || ((_toastOptions$t$type = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type.duration) || ((_toastOptions = toastOptions) == null ? void 0 : _toastOptions.duration) || defaultTimeouts[t.type],
|
|
7067
|
-
style: _extends$
|
|
7104
|
+
style: _extends$u({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
|
|
7068
7105
|
});
|
|
7069
7106
|
});
|
|
7070
|
-
return _extends$
|
|
7107
|
+
return _extends$u({}, state, {
|
|
7071
7108
|
toasts: mergedToasts
|
|
7072
7109
|
});
|
|
7073
7110
|
};
|
|
@@ -7077,7 +7114,7 @@ var createToast = function createToast(message, type, opts) {
|
|
|
7077
7114
|
type = 'blank';
|
|
7078
7115
|
}
|
|
7079
7116
|
|
|
7080
|
-
return _extends$
|
|
7117
|
+
return _extends$u({
|
|
7081
7118
|
createdAt: Date.now(),
|
|
7082
7119
|
visible: true,
|
|
7083
7120
|
type: type,
|
|
@@ -7127,14 +7164,14 @@ toast.remove = function (toastId) {
|
|
|
7127
7164
|
};
|
|
7128
7165
|
|
|
7129
7166
|
toast.promise = function (promise, msgs, opts) {
|
|
7130
|
-
var id = toast.loading(msgs.loading, _extends$
|
|
7167
|
+
var id = toast.loading(msgs.loading, _extends$u({}, opts, opts == null ? void 0 : opts.loading));
|
|
7131
7168
|
promise.then(function (p) {
|
|
7132
|
-
toast.success(resolveValue(msgs.success, p), _extends$
|
|
7169
|
+
toast.success(resolveValue(msgs.success, p), _extends$u({
|
|
7133
7170
|
id: id
|
|
7134
7171
|
}, opts, opts == null ? void 0 : opts.success));
|
|
7135
7172
|
return p;
|
|
7136
7173
|
})["catch"](function (e) {
|
|
7137
|
-
toast.error(resolveValue(msgs.error, e), _extends$
|
|
7174
|
+
toast.error(resolveValue(msgs.error, e), _extends$u({
|
|
7138
7175
|
id: id
|
|
7139
7176
|
}, opts, opts == null ? void 0 : opts.error));
|
|
7140
7177
|
});
|
|
@@ -7473,7 +7510,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
7473
7510
|
var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
|
|
7474
7511
|
return React.createElement(ToastBarBase, {
|
|
7475
7512
|
className: toast.className,
|
|
7476
|
-
style: _extends$
|
|
7513
|
+
style: _extends$u({}, animationStyle, style, toast.style)
|
|
7477
7514
|
}, typeof children === 'function' ? children({
|
|
7478
7515
|
icon: icon,
|
|
7479
7516
|
message: message
|
|
@@ -7503,7 +7540,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
|
|
|
7503
7540
|
} : position.includes('right') ? {
|
|
7504
7541
|
justifyContent: 'flex-end'
|
|
7505
7542
|
} : {};
|
|
7506
|
-
return _extends$
|
|
7543
|
+
return _extends$u({
|
|
7507
7544
|
left: 0,
|
|
7508
7545
|
right: 0,
|
|
7509
7546
|
display: 'flex',
|
|
@@ -7530,7 +7567,7 @@ var Toaster = function Toaster(_ref) {
|
|
|
7530
7567
|
handlers = _useToaster.handlers;
|
|
7531
7568
|
|
|
7532
7569
|
return React.createElement("div", {
|
|
7533
|
-
style: _extends$
|
|
7570
|
+
style: _extends$u({
|
|
7534
7571
|
position: 'fixed',
|
|
7535
7572
|
zIndex: 9999,
|
|
7536
7573
|
top: DEFAULT_OFFSET,
|
|
@@ -7565,82 +7602,82 @@ var Toaster = function Toaster(_ref) {
|
|
|
7565
7602
|
}));
|
|
7566
7603
|
};
|
|
7567
7604
|
|
|
7568
|
-
var _path$
|
|
7605
|
+
var _path$r;
|
|
7569
7606
|
|
|
7570
|
-
function _extends$
|
|
7607
|
+
function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
|
|
7571
7608
|
|
|
7572
7609
|
function SvgCheckSolid(props) {
|
|
7573
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
7610
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
|
|
7574
7611
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7575
7612
|
className: "h-5 w-5",
|
|
7576
7613
|
viewBox: "0 0 20 20",
|
|
7577
7614
|
fill: "currentColor"
|
|
7578
|
-
}, props), _path$
|
|
7615
|
+
}, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
|
|
7579
7616
|
fillRule: "evenodd",
|
|
7580
7617
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
7581
7618
|
clipRule: "evenodd"
|
|
7582
7619
|
})));
|
|
7583
7620
|
}
|
|
7584
7621
|
|
|
7585
|
-
var _path$
|
|
7622
|
+
var _path$q;
|
|
7586
7623
|
|
|
7587
|
-
function _extends$
|
|
7624
|
+
function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
|
|
7588
7625
|
|
|
7589
7626
|
function SvgXIcon(props) {
|
|
7590
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
7627
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
|
|
7591
7628
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7592
7629
|
viewBox: "0 0 20 20",
|
|
7593
7630
|
fill: "currentColor"
|
|
7594
|
-
}, props), _path$
|
|
7631
|
+
}, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
|
|
7595
7632
|
fill: "evenodd",
|
|
7596
7633
|
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
7597
7634
|
clipRule: "evenodd"
|
|
7598
7635
|
})));
|
|
7599
7636
|
}
|
|
7600
7637
|
|
|
7601
|
-
var _path$
|
|
7638
|
+
var _path$p;
|
|
7602
7639
|
|
|
7603
|
-
function _extends$
|
|
7640
|
+
function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
|
|
7604
7641
|
|
|
7605
7642
|
function SvgXIconSolid(props) {
|
|
7606
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
7643
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
|
|
7607
7644
|
className: "plc-w-4 plc-h-4",
|
|
7608
7645
|
fill: "currentColor",
|
|
7609
7646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7610
7647
|
viewBox: "0 0 100 100"
|
|
7611
|
-
}, props), _path$
|
|
7648
|
+
}, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
|
|
7612
7649
|
d: "M94.842 48.408c0 24.852-20.148 44.999-45.002 44.999-24.851 0-44.997-20.146-44.997-44.999 0-24.854 20.146-45 44.997-45 24.853 0 45.002 20.146 45.002 45zM71.073 64.841L54.73 48.497l16.344-16.344-4.979-4.979-16.343 16.345-16.343-16.344-4.799 4.799 16.344 16.344L28.61 64.661l4.979 4.978 16.344-16.344 16.343 16.344 4.797-4.798z"
|
|
7613
7650
|
})));
|
|
7614
7651
|
}
|
|
7615
7652
|
|
|
7616
|
-
var _path$
|
|
7653
|
+
var _path$o;
|
|
7617
7654
|
|
|
7618
|
-
function _extends$
|
|
7655
|
+
function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
|
|
7619
7656
|
|
|
7620
7657
|
function SvgExclamation(props) {
|
|
7621
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
7658
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
|
|
7622
7659
|
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
7623
7660
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7624
7661
|
viewBox: "0 0 20 20",
|
|
7625
7662
|
fill: "currentColor"
|
|
7626
|
-
}, props), _path$
|
|
7663
|
+
}, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
|
|
7627
7664
|
fillRule: "evenodd",
|
|
7628
7665
|
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
|
|
7629
7666
|
clipRule: "evenodd"
|
|
7630
7667
|
})));
|
|
7631
7668
|
}
|
|
7632
7669
|
|
|
7633
|
-
var _path$
|
|
7670
|
+
var _path$n, _path2$3;
|
|
7634
7671
|
|
|
7635
|
-
function _extends$
|
|
7672
|
+
function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
|
|
7636
7673
|
|
|
7637
7674
|
function SvgSpinner(props) {
|
|
7638
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
7675
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
|
|
7639
7676
|
className: "plc-animate-spin",
|
|
7640
7677
|
viewBox: "0 0 24 24",
|
|
7641
7678
|
fill: "currentColor",
|
|
7642
7679
|
xmlns: "http://www.w3.org/2000/svg"
|
|
7643
|
-
}, props), _path$
|
|
7680
|
+
}, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
|
|
7644
7681
|
opacity: 0.2,
|
|
7645
7682
|
fill: "evenodd",
|
|
7646
7683
|
clipRule: "evenodd",
|
|
@@ -7767,7 +7804,11 @@ toast.confirm = (onConfirm, {
|
|
|
7767
7804
|
loadingMessage,
|
|
7768
7805
|
successMessage,
|
|
7769
7806
|
errorMessage
|
|
7770
|
-
},
|
|
7807
|
+
}, {
|
|
7808
|
+
confirmButtonLabel,
|
|
7809
|
+
closeButtonLabel,
|
|
7810
|
+
...options
|
|
7811
|
+
} = {}) => {
|
|
7771
7812
|
const translations = i18next.t("notification:confirm", {
|
|
7772
7813
|
returnObjects: true
|
|
7773
7814
|
});
|
|
@@ -7781,11 +7822,11 @@ toast.confirm = (onConfirm, {
|
|
|
7781
7822
|
variant: "solid",
|
|
7782
7823
|
className: "plc-text-xs plc-bg-red-500 hover:plc-bg-red-600",
|
|
7783
7824
|
onClick: onConfirmClick
|
|
7784
|
-
}, translations.labels.confirm), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
7825
|
+
}, confirmButtonLabel !== null && confirmButtonLabel !== void 0 ? confirmButtonLabel : translations.labels.confirm), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
7785
7826
|
className: "plc-text-xs",
|
|
7786
7827
|
variant: "outline",
|
|
7787
7828
|
onClick: () => toast.dismiss(t.id)
|
|
7788
|
-
}, translations.labels.close))), {
|
|
7829
|
+
}, closeButtonLabel !== null && closeButtonLabel !== void 0 ? closeButtonLabel : translations.labels.close))), {
|
|
7789
7830
|
type: "confirm",
|
|
7790
7831
|
...options
|
|
7791
7832
|
});
|
|
@@ -7862,6 +7903,16 @@ const init$1 = () => {
|
|
|
7862
7903
|
}
|
|
7863
7904
|
}
|
|
7864
7905
|
|
|
7906
|
+
const pelcroUpdateNewslettersButtons = document.getElementsByClassName("pelcro-update-newsletters-button");
|
|
7907
|
+
|
|
7908
|
+
if (pelcroUpdateNewslettersButtons.length !== 0) {
|
|
7909
|
+
for (let i = 0; i < pelcroUpdateNewslettersButtons.length; i++) {
|
|
7910
|
+
pelcroUpdateNewslettersButtons[i].addEventListener("click", () => {
|
|
7911
|
+
switchView("newsletter-update");
|
|
7912
|
+
});
|
|
7913
|
+
}
|
|
7914
|
+
}
|
|
7915
|
+
|
|
7865
7916
|
const pelcroCartButtonsByClass = document.getElementsByClassName("pelcro-cart-button");
|
|
7866
7917
|
|
|
7867
7918
|
if (pelcroCartButtonsByClass.length !== 0) {
|
|
@@ -8077,87 +8128,71 @@ function Link({
|
|
|
8077
8128
|
|
|
8078
8129
|
const init = () => {
|
|
8079
8130
|
const {
|
|
8080
|
-
whenSiteReady,
|
|
8081
|
-
view,
|
|
8082
|
-
resetView,
|
|
8083
8131
|
switchView,
|
|
8084
8132
|
set
|
|
8085
8133
|
} = usePelcro.getStore();
|
|
8086
|
-
|
|
8087
|
-
const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
|
|
8134
|
+
const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
|
|
8088
8135
|
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8136
|
+
if (entitlementsProtectedElements.length === 0) {
|
|
8137
|
+
return false;
|
|
8138
|
+
}
|
|
8092
8139
|
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8140
|
+
if (!allElemsHaveSameEntitlements(entitlementsProtectedElements)) {
|
|
8141
|
+
console.error("not all elements protected by entitlements have the same entitlements, all elements protected by entitlements must have the exact same data-pelcro-entitlements attribute value");
|
|
8142
|
+
return false;
|
|
8143
|
+
}
|
|
8097
8144
|
|
|
8098
|
-
|
|
8099
|
-
|
|
8145
|
+
for (const elem of entitlementsProtectedElements) {
|
|
8146
|
+
const entitlements = getEntitlementsFromElem(elem);
|
|
8100
8147
|
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8148
|
+
if (entitlements.length === 0) {
|
|
8149
|
+
console.error("invalid data-pelcro-entitlements attribute value", elem);
|
|
8150
|
+
return false;
|
|
8151
|
+
}
|
|
8105
8152
|
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8153
|
+
if (window.Pelcro.product.getByEntitlements(entitlements).length === 0) {
|
|
8154
|
+
console.warn("user can't subscribe to any plan that has any of the entitlement(s) needed, this is usually unintentional, make sure that the entitlements are spelled correctly, entitlements are case sensitive. make sure that your plans are configured in a way that allows users from all supported countries, using all supported currencies, to have access to your content by subscribing to certain plans that provide the needed entitlement(s)");
|
|
8155
|
+
}
|
|
8109
8156
|
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8157
|
+
if (shouldBlurContent(entitlements)) {
|
|
8158
|
+
// remove all event listeners from the elem by replacing it with a deep clone of itself
|
|
8159
|
+
const elemDeepClone = elem.cloneNode(true);
|
|
8160
|
+
elem.replaceWith(elemDeepClone);
|
|
8161
|
+
disableKeyboardInteractions(elemDeepClone);
|
|
8162
|
+
elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
|
|
8163
|
+
unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
|
|
8164
|
+
const NOTIFICATION_ID = "entitlement";
|
|
8165
|
+
notify( /*#__PURE__*/React__default['default'].createElement("p", null, /*#__PURE__*/React__default['default'].createElement(Trans, {
|
|
8166
|
+
i18nKey: "messages:entitlement"
|
|
8167
|
+
}, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default['default'].createElement(Link, {
|
|
8168
|
+
onClick: () => {
|
|
8169
|
+
const productId = Number(elem.dataset.productId);
|
|
8170
|
+
const planId = Number(elem.dataset.planId);
|
|
8171
|
+
const selectedProduct = window.Pelcro.product.getById(productId);
|
|
8172
|
+
const selectedPlan = window.Pelcro.plan.getById(planId);
|
|
8173
|
+
const hasValidProductAndPlan = Boolean(selectedProduct && selectedPlan);
|
|
8122
8174
|
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8175
|
+
if (hasValidProductAndPlan) {
|
|
8176
|
+
set({
|
|
8177
|
+
product: selectedProduct,
|
|
8178
|
+
plan: selectedPlan
|
|
8179
|
+
});
|
|
8180
|
+
}
|
|
8126
8181
|
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
if (hasValidProductAndPlan) {
|
|
8139
|
-
set({
|
|
8140
|
-
product: selectedProduct,
|
|
8141
|
-
plan: selectedPlan
|
|
8142
|
-
});
|
|
8143
|
-
}
|
|
8182
|
+
notify.dismiss(NOTIFICATION_ID);
|
|
8183
|
+
switchView("_plan-select-entitlements");
|
|
8184
|
+
}
|
|
8185
|
+
}, "Subscribe"), "now to get full page access.")), {
|
|
8186
|
+
className: "pelcro-notification-entitlement",
|
|
8187
|
+
position: "bottom-right",
|
|
8188
|
+
duration: Infinity,
|
|
8189
|
+
id: NOTIFICATION_ID
|
|
8190
|
+
});
|
|
8191
|
+
}
|
|
8192
|
+
}
|
|
8144
8193
|
|
|
8145
|
-
|
|
8146
|
-
switchView("_plan-select-entitlements");
|
|
8147
|
-
}
|
|
8148
|
-
}, "Subscribe"), "now to get full page access.")), {
|
|
8149
|
-
className: "pelcro-notification-entitlement",
|
|
8150
|
-
position: "bottom-right",
|
|
8151
|
-
duration: Infinity,
|
|
8152
|
-
id: NOTIFICATION_ID
|
|
8153
|
-
});
|
|
8154
|
-
}
|
|
8155
|
-
});
|
|
8156
|
-
});
|
|
8194
|
+
return true;
|
|
8157
8195
|
};
|
|
8158
|
-
/**
|
|
8159
|
-
*
|
|
8160
|
-
*/
|
|
8161
8196
|
|
|
8162
8197
|
function allElemsHaveSameEntitlements(elems) {
|
|
8163
8198
|
const entitlements = getEntitlementsFromElem(elems[0]);
|
|
@@ -8167,10 +8202,6 @@ function allElemsHaveSameEntitlements(elems) {
|
|
|
8167
8202
|
return entitlements.every(ent => elemEntitlements.includes(ent));
|
|
8168
8203
|
});
|
|
8169
8204
|
}
|
|
8170
|
-
/**
|
|
8171
|
-
*
|
|
8172
|
-
*/
|
|
8173
|
-
|
|
8174
8205
|
|
|
8175
8206
|
function disableKeyboardInteractions(elem) {
|
|
8176
8207
|
elem.addEventListener("keydown", event => {
|
|
@@ -8183,10 +8214,6 @@ function disableKeyboardInteractions(elem) {
|
|
|
8183
8214
|
}
|
|
8184
8215
|
}, true);
|
|
8185
8216
|
}
|
|
8186
|
-
/**
|
|
8187
|
-
*
|
|
8188
|
-
*/
|
|
8189
|
-
|
|
8190
8217
|
|
|
8191
8218
|
function unblurElemWhenUserSubscribes(elem, entitlements) {
|
|
8192
8219
|
document.addEventListener("PelcroSubscriptionCreate", event => {
|
|
@@ -8194,11 +8221,11 @@ function unblurElemWhenUserSubscribes(elem, entitlements) {
|
|
|
8194
8221
|
isGift
|
|
8195
8222
|
} = usePelcro.getStore();
|
|
8196
8223
|
if (isGift) return;
|
|
8197
|
-
const latestSub = event.detail.data.subscriptions[
|
|
8224
|
+
const latestSub = event.detail.data.subscriptions[event.detail.data.subscriptions.length - 1];
|
|
8198
8225
|
const shouldUnblurContent = entitlements.some(ent => {
|
|
8199
|
-
var _latestSub$plan$entit, _latestSub$plan$entit2;
|
|
8226
|
+
var _latestSub$plan$entit, _latestSub$plan, _latestSub$plan$entit2;
|
|
8200
8227
|
|
|
8201
|
-
return (_latestSub$plan$entit = (_latestSub$plan
|
|
8228
|
+
return (_latestSub$plan$entit = latestSub === null || latestSub === void 0 ? void 0 : (_latestSub$plan = latestSub.plan) === null || _latestSub$plan === void 0 ? void 0 : (_latestSub$plan$entit2 = _latestSub$plan.entitlements) === null || _latestSub$plan$entit2 === void 0 ? void 0 : _latestSub$plan$entit2.includes(ent)) !== null && _latestSub$plan$entit !== void 0 ? _latestSub$plan$entit : false;
|
|
8202
8229
|
});
|
|
8203
8230
|
|
|
8204
8231
|
if (shouldUnblurContent) {
|
|
@@ -8206,10 +8233,6 @@ function unblurElemWhenUserSubscribes(elem, entitlements) {
|
|
|
8206
8233
|
}
|
|
8207
8234
|
});
|
|
8208
8235
|
}
|
|
8209
|
-
/**
|
|
8210
|
-
*
|
|
8211
|
-
*/
|
|
8212
|
-
|
|
8213
8236
|
|
|
8214
8237
|
function shouldBlurContent(entitlements) {
|
|
8215
8238
|
return entitlements.every(entitlement => !window.Pelcro.user.isEntitledTo(entitlement));
|
|
@@ -8256,7 +8279,9 @@ const initPaywalls = () => {
|
|
|
8256
8279
|
const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
|
|
8257
8280
|
|
|
8258
8281
|
if (((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.settings) === "subscription") {
|
|
8259
|
-
//
|
|
8282
|
+
// blur entitlements based content
|
|
8283
|
+
const didBlurContent = init(); // Skip paywall if article is not restricted
|
|
8284
|
+
|
|
8260
8285
|
if (isValidViewFromURL(viewFromURL) || !paywallMethods.isArticleRestricted()) {
|
|
8261
8286
|
return;
|
|
8262
8287
|
}
|
|
@@ -8266,9 +8291,14 @@ const initPaywalls = () => {
|
|
|
8266
8291
|
} = usePelcro.getStore();
|
|
8267
8292
|
|
|
8268
8293
|
if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayMeterPaywall()) {
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8294
|
+
/*
|
|
8295
|
+
showing both the meter and the entitlements notification doesn't make sense from
|
|
8296
|
+
a product prespective + they would take half the screen on mobile devies, so we're
|
|
8297
|
+
not showing the meter, and only showing the entitlements notification.
|
|
8298
|
+
*/
|
|
8299
|
+
if (!didBlurContent) {
|
|
8300
|
+
switchView("meter");
|
|
8301
|
+
}
|
|
8272
8302
|
} else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayNewsletterPaywall()) {
|
|
8273
8303
|
switchView("newsletter");
|
|
8274
8304
|
} else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayPaywall()) {
|
|
@@ -8872,6 +8902,7 @@ const GET_STATES_SUCCESS = "GET_STATES_SUCCESS";
|
|
|
8872
8902
|
const GET_STATES_FETCH = "GET_STATES_FETCH";
|
|
8873
8903
|
const HANDLE_SUBMIT = "HANDLE_SUBMIT";
|
|
8874
8904
|
const SET_UPDATED_PRICE = "SET_UPDATED_PRICE";
|
|
8905
|
+
const SET_TAX_AMOUNT = "SET_TAX_AMOUNT";
|
|
8875
8906
|
const SET_CAN_MAKE_PAYMENT = "SET_CAN_MAKE_PAYMENT";
|
|
8876
8907
|
const SET_PAYMENT_REQUEST = "SET_PAYMENT_REQUEST";
|
|
8877
8908
|
const INIT_CONTAINER = "INIT_CONTAINER";
|
|
@@ -8900,6 +8931,9 @@ const SET_IMAGE_SRC = "SET_IMAGE_SRC";
|
|
|
8900
8931
|
const PASSWORD_CHANGE_SUCCESS = "PASSWORD_CHANGE_SUCCESS";
|
|
8901
8932
|
const SELECT_PAYMENT_METHOD = "SELECT_PAYMENT_METHOD";
|
|
8902
8933
|
const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
|
|
8934
|
+
const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
|
|
8935
|
+
const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
|
|
8936
|
+
const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
|
|
8903
8937
|
|
|
8904
8938
|
/**
|
|
8905
8939
|
* Extracts error message from the response error object
|
|
@@ -8961,7 +8995,7 @@ const debounce = (func, waitTime) => {
|
|
|
8961
8995
|
};
|
|
8962
8996
|
};
|
|
8963
8997
|
|
|
8964
|
-
const initialState$
|
|
8998
|
+
const initialState$f = {
|
|
8965
8999
|
email: "",
|
|
8966
9000
|
password: "",
|
|
8967
9001
|
emailError: null,
|
|
@@ -8972,10 +9006,10 @@ const initialState$e = {
|
|
|
8972
9006
|
content: ""
|
|
8973
9007
|
}
|
|
8974
9008
|
};
|
|
8975
|
-
const store$
|
|
9009
|
+
const store$f = /*#__PURE__*/React.createContext(initialState$f);
|
|
8976
9010
|
const {
|
|
8977
|
-
Provider: Provider$
|
|
8978
|
-
} = store$
|
|
9011
|
+
Provider: Provider$f
|
|
9012
|
+
} = store$f;
|
|
8979
9013
|
|
|
8980
9014
|
const LoginContainer = ({
|
|
8981
9015
|
style,
|
|
@@ -9082,7 +9116,7 @@ const LoginContainer = ({
|
|
|
9082
9116
|
});
|
|
9083
9117
|
|
|
9084
9118
|
case RESET_LOGIN_FORM:
|
|
9085
|
-
return initialState$
|
|
9119
|
+
return initialState$f;
|
|
9086
9120
|
|
|
9087
9121
|
case DISABLE_LOGIN_BUTTON:
|
|
9088
9122
|
return lib_7({ ...state,
|
|
@@ -9100,12 +9134,12 @@ const LoginContainer = ({
|
|
|
9100
9134
|
default:
|
|
9101
9135
|
return state;
|
|
9102
9136
|
}
|
|
9103
|
-
}, initialState$
|
|
9137
|
+
}, initialState$f);
|
|
9104
9138
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9105
9139
|
style: { ...style
|
|
9106
9140
|
},
|
|
9107
9141
|
className: `pelcro-container pelcro-login-container ${className}`
|
|
9108
|
-
}, /*#__PURE__*/React__default['default'].createElement(Provider$
|
|
9142
|
+
}, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
|
|
9109
9143
|
value: {
|
|
9110
9144
|
state,
|
|
9111
9145
|
dispatch
|
|
@@ -9113,12 +9147,12 @@ const LoginContainer = ({
|
|
|
9113
9147
|
}, children.length ? children.map((child, i) => {
|
|
9114
9148
|
if (child) {
|
|
9115
9149
|
return /*#__PURE__*/React__default['default'].cloneElement(child, {
|
|
9116
|
-
store: store$
|
|
9150
|
+
store: store$f,
|
|
9117
9151
|
key: i
|
|
9118
9152
|
});
|
|
9119
9153
|
}
|
|
9120
9154
|
}) : /*#__PURE__*/React__default['default'].cloneElement(children, {
|
|
9121
|
-
store: store$
|
|
9155
|
+
store: store$f
|
|
9122
9156
|
})));
|
|
9123
9157
|
};
|
|
9124
9158
|
|
|
@@ -9363,7 +9397,7 @@ const LoginButton = ({
|
|
|
9363
9397
|
buttonDisabled
|
|
9364
9398
|
},
|
|
9365
9399
|
dispatch
|
|
9366
|
-
} = React.useContext(store$
|
|
9400
|
+
} = React.useContext(store$f);
|
|
9367
9401
|
const {
|
|
9368
9402
|
t
|
|
9369
9403
|
} = useTranslation("login");
|
|
@@ -9384,23 +9418,23 @@ const LoginButton = ({
|
|
|
9384
9418
|
};
|
|
9385
9419
|
|
|
9386
9420
|
const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
|
|
9387
|
-
store: store$
|
|
9421
|
+
store: store$f
|
|
9388
9422
|
}, props));
|
|
9389
9423
|
|
|
9390
9424
|
const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
|
|
9391
|
-
store: store$
|
|
9425
|
+
store: store$f
|
|
9392
9426
|
}, props));
|
|
9393
9427
|
|
|
9394
|
-
var _path$
|
|
9428
|
+
var _path$m;
|
|
9395
9429
|
|
|
9396
|
-
function _extends$
|
|
9430
|
+
function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
|
|
9397
9431
|
|
|
9398
9432
|
function SvgCheck(props) {
|
|
9399
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
9433
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
|
|
9400
9434
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9401
9435
|
fill: "currentColor",
|
|
9402
9436
|
viewBox: "0 0 20 20"
|
|
9403
|
-
}, props), _path$
|
|
9437
|
+
}, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
|
|
9404
9438
|
fillRule: "evenodd",
|
|
9405
9439
|
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
9406
9440
|
clipRule: "evenodd"
|
|
@@ -9465,7 +9499,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
|
|
|
9465
9499
|
var FacebookLogin = unwrapExports(facebookLoginRenderProps);
|
|
9466
9500
|
facebookLoginRenderProps.FacebookLogin;
|
|
9467
9501
|
|
|
9468
|
-
const initialState$
|
|
9502
|
+
const initialState$e = {
|
|
9469
9503
|
email: "",
|
|
9470
9504
|
password: "",
|
|
9471
9505
|
emailError: null,
|
|
@@ -9482,10 +9516,10 @@ const initialState$d = {
|
|
|
9482
9516
|
content: ""
|
|
9483
9517
|
}
|
|
9484
9518
|
};
|
|
9485
|
-
const store$
|
|
9519
|
+
const store$e = /*#__PURE__*/React.createContext(initialState$e);
|
|
9486
9520
|
const {
|
|
9487
|
-
Provider: Provider$
|
|
9488
|
-
} = store$
|
|
9521
|
+
Provider: Provider$e
|
|
9522
|
+
} = store$e;
|
|
9489
9523
|
|
|
9490
9524
|
const RegisterContainer = ({
|
|
9491
9525
|
style,
|
|
@@ -9650,7 +9684,7 @@ const RegisterContainer = ({
|
|
|
9650
9684
|
});
|
|
9651
9685
|
|
|
9652
9686
|
case RESET_LOGIN_FORM:
|
|
9653
|
-
return initialState$
|
|
9687
|
+
return initialState$e;
|
|
9654
9688
|
|
|
9655
9689
|
case DISABLE_REGISTRATION_BUTTON:
|
|
9656
9690
|
return lib_7({ ...state,
|
|
@@ -9668,12 +9702,12 @@ const RegisterContainer = ({
|
|
|
9668
9702
|
default:
|
|
9669
9703
|
return state;
|
|
9670
9704
|
}
|
|
9671
|
-
}, initialState$
|
|
9705
|
+
}, initialState$e);
|
|
9672
9706
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9673
9707
|
style: { ...style
|
|
9674
9708
|
},
|
|
9675
9709
|
className: `pelcro-container pelcro-register-container ${className}`
|
|
9676
|
-
}, /*#__PURE__*/React__default['default'].createElement(Provider$
|
|
9710
|
+
}, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
|
|
9677
9711
|
value: {
|
|
9678
9712
|
state,
|
|
9679
9713
|
dispatch
|
|
@@ -9681,24 +9715,24 @@ const RegisterContainer = ({
|
|
|
9681
9715
|
}, children.length ? children.map((child, i) => {
|
|
9682
9716
|
if (child) {
|
|
9683
9717
|
return /*#__PURE__*/React__default['default'].cloneElement(child, {
|
|
9684
|
-
store: store$
|
|
9718
|
+
store: store$e,
|
|
9685
9719
|
key: i
|
|
9686
9720
|
});
|
|
9687
9721
|
}
|
|
9688
9722
|
}) : /*#__PURE__*/React__default['default'].cloneElement(children, {
|
|
9689
|
-
store: store$
|
|
9723
|
+
store: store$e
|
|
9690
9724
|
})));
|
|
9691
9725
|
};
|
|
9692
9726
|
|
|
9693
|
-
var _path$
|
|
9727
|
+
var _path$l;
|
|
9694
9728
|
|
|
9695
|
-
function _extends$
|
|
9729
|
+
function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
|
|
9696
9730
|
|
|
9697
9731
|
function SvgFacebookLogo(props) {
|
|
9698
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
9732
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
|
|
9699
9733
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9700
9734
|
viewBox: "88.428 12.828 107.543 207.085"
|
|
9701
|
-
}, props), _path$
|
|
9735
|
+
}, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
|
|
9702
9736
|
d: "M158.232 219.912v-94.461h31.707l4.747-36.813h-36.454V65.134c0-10.658 2.96-17.922 18.245-17.922l19.494-.009V14.278c-3.373-.447-14.944-1.449-28.406-1.449-28.106 0-47.348 17.155-47.348 48.661v27.149H88.428v36.813h31.788v94.461l38.016-.001z",
|
|
9703
9737
|
fill: "#3c5a9a"
|
|
9704
9738
|
})));
|
|
@@ -9715,10 +9749,10 @@ const FacebookLoginButton = ({
|
|
|
9715
9749
|
const facebookLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id;
|
|
9716
9750
|
const {
|
|
9717
9751
|
dispatch: loginDispatch
|
|
9718
|
-
} = React.useContext(store$
|
|
9752
|
+
} = React.useContext(store$f);
|
|
9719
9753
|
const {
|
|
9720
9754
|
dispatch: registerDispatch
|
|
9721
|
-
} = React.useContext(store$
|
|
9755
|
+
} = React.useContext(store$e);
|
|
9722
9756
|
|
|
9723
9757
|
const onSuccess = facebookUser => {
|
|
9724
9758
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
@@ -9771,15 +9805,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
|
|
|
9771
9805
|
unwrapExports(googleLogin);
|
|
9772
9806
|
var googleLogin_1 = googleLogin.GoogleLogin;
|
|
9773
9807
|
|
|
9774
|
-
var _path$
|
|
9808
|
+
var _path$k, _path2$2, _path3$1, _path4;
|
|
9775
9809
|
|
|
9776
|
-
function _extends$
|
|
9810
|
+
function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
|
|
9777
9811
|
|
|
9778
9812
|
function SvgGoogleLogo(props) {
|
|
9779
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
9813
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
|
|
9780
9814
|
viewBox: "0 0 24 24",
|
|
9781
9815
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9782
|
-
}, props), _path$
|
|
9816
|
+
}, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
|
|
9783
9817
|
fill: "#4285F4",
|
|
9784
9818
|
d: "M23.745 12.27c0-.79-.07-1.54-.19-2.27h-11.3v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"
|
|
9785
9819
|
})), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
@@ -9805,10 +9839,10 @@ const GoogleLoginButton = ({
|
|
|
9805
9839
|
const googleLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.google_app_id;
|
|
9806
9840
|
const {
|
|
9807
9841
|
dispatch: loginDispatch
|
|
9808
|
-
} = React.useContext(store$
|
|
9842
|
+
} = React.useContext(store$f);
|
|
9809
9843
|
const {
|
|
9810
9844
|
dispatch: registerDispatch
|
|
9811
|
-
} = React.useContext(store$
|
|
9845
|
+
} = React.useContext(store$e);
|
|
9812
9846
|
|
|
9813
9847
|
const onSuccess = response => {
|
|
9814
9848
|
var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
|
|
@@ -9913,15 +9947,15 @@ function LoginView(props) {
|
|
|
9913
9947
|
}, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null))))));
|
|
9914
9948
|
}
|
|
9915
9949
|
|
|
9916
|
-
var _path$
|
|
9950
|
+
var _path$j, _path2$1, _path3;
|
|
9917
9951
|
|
|
9918
|
-
function _extends$
|
|
9952
|
+
function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
|
|
9919
9953
|
|
|
9920
9954
|
function SvgPelcroAuthorship(props) {
|
|
9921
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
9955
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
|
|
9922
9956
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9923
9957
|
viewBox: "0 -80.652 497.072 179.991"
|
|
9924
|
-
}, props), _path$
|
|
9958
|
+
}, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
|
|
9925
9959
|
fill: "none",
|
|
9926
9960
|
stroke: "#4a4a4a",
|
|
9927
9961
|
d: "M487.89 42.299c0 13.158-10.671 23.829-23.829 23.829H37.074c-13.162 0-23.832-10.671-23.832-23.829v-63.552c0-13.158 10.67-23.831 23.832-23.831H464.06c13.158 0 23.829 10.672 23.829 23.831l.001 63.552z"
|
|
@@ -10068,11 +10102,11 @@ function LoginModal({
|
|
|
10068
10102
|
LoginModal.viewId = "login";
|
|
10069
10103
|
|
|
10070
10104
|
const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
|
|
10071
|
-
store: store$
|
|
10105
|
+
store: store$e
|
|
10072
10106
|
}, props));
|
|
10073
10107
|
|
|
10074
10108
|
const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
|
|
10075
|
-
store: store$
|
|
10109
|
+
store: store$e
|
|
10076
10110
|
}, props));
|
|
10077
10111
|
|
|
10078
10112
|
const RegisterButton = ({
|
|
@@ -10089,7 +10123,7 @@ const RegisterButton = ({
|
|
|
10089
10123
|
buttonDisabled
|
|
10090
10124
|
},
|
|
10091
10125
|
dispatch
|
|
10092
|
-
} = React.useContext(store$
|
|
10126
|
+
} = React.useContext(store$e);
|
|
10093
10127
|
const {
|
|
10094
10128
|
t
|
|
10095
10129
|
} = useTranslation("register");
|
|
@@ -10224,7 +10258,7 @@ function FirstName({
|
|
|
10224
10258
|
}
|
|
10225
10259
|
|
|
10226
10260
|
const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
|
|
10227
|
-
store: store$
|
|
10261
|
+
store: store$e
|
|
10228
10262
|
}, props));
|
|
10229
10263
|
|
|
10230
10264
|
function LastName({
|
|
@@ -10255,7 +10289,7 @@ function LastName({
|
|
|
10255
10289
|
}
|
|
10256
10290
|
|
|
10257
10291
|
const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
|
|
10258
|
-
store: store$
|
|
10292
|
+
store: store$e
|
|
10259
10293
|
}, props));
|
|
10260
10294
|
|
|
10261
10295
|
/**
|
|
@@ -10359,7 +10393,7 @@ function TextInput({
|
|
|
10359
10393
|
|
|
10360
10394
|
const RegisterTextInput = props => {
|
|
10361
10395
|
return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
|
|
10362
|
-
store: store$
|
|
10396
|
+
store: store$e
|
|
10363
10397
|
}));
|
|
10364
10398
|
};
|
|
10365
10399
|
|
|
@@ -12324,13 +12358,14 @@ class PaypalGateWay {
|
|
|
12324
12358
|
* @property {unknown} canMakePayment
|
|
12325
12359
|
* @property {unknown} paymentRequest
|
|
12326
12360
|
* @property {number} updatedPrice
|
|
12361
|
+
* @property {number} taxAmount
|
|
12327
12362
|
* @property {object} currentPlan
|
|
12328
12363
|
* @property {object} alert
|
|
12329
12364
|
*/
|
|
12330
12365
|
|
|
12331
12366
|
/** @type {PaymentStateType} */
|
|
12332
12367
|
|
|
12333
|
-
const initialState$
|
|
12368
|
+
const initialState$d = {
|
|
12334
12369
|
disableSubmit: false,
|
|
12335
12370
|
isLoading: false,
|
|
12336
12371
|
disableCouponButton: false,
|
|
@@ -12342,16 +12377,17 @@ const initialState$c = {
|
|
|
12342
12377
|
canMakePayment: false,
|
|
12343
12378
|
paymentRequest: null,
|
|
12344
12379
|
updatedPrice: null,
|
|
12380
|
+
taxAmount: null,
|
|
12345
12381
|
currentPlan: null,
|
|
12346
12382
|
alert: {
|
|
12347
12383
|
type: "error",
|
|
12348
12384
|
content: ""
|
|
12349
12385
|
}
|
|
12350
12386
|
};
|
|
12351
|
-
const store$
|
|
12387
|
+
const store$d = /*#__PURE__*/React.createContext(initialState$d);
|
|
12352
12388
|
const {
|
|
12353
|
-
Provider: Provider$
|
|
12354
|
-
} = store$
|
|
12389
|
+
Provider: Provider$d
|
|
12390
|
+
} = store$d;
|
|
12355
12391
|
|
|
12356
12392
|
const PaymentMethodContainerWithoutStripe = ({
|
|
12357
12393
|
style,
|
|
@@ -12392,6 +12428,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12392
12428
|
dispatch({
|
|
12393
12429
|
type: INIT_CONTAINER
|
|
12394
12430
|
});
|
|
12431
|
+
updateTotalAmountWithTax();
|
|
12395
12432
|
}, []);
|
|
12396
12433
|
|
|
12397
12434
|
const initPaymentRequest = (state, dispatch) => {
|
|
@@ -12458,6 +12495,45 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12458
12495
|
console.log("Google Pay/Apple pay isn't available in this country");
|
|
12459
12496
|
}
|
|
12460
12497
|
};
|
|
12498
|
+
/**
|
|
12499
|
+
* Updates the total amount after adding taxes only if site taxes are enabled
|
|
12500
|
+
*/
|
|
12501
|
+
|
|
12502
|
+
|
|
12503
|
+
const updateTotalAmountWithTax = () => {
|
|
12504
|
+
var _window$Pelcro$site$r;
|
|
12505
|
+
|
|
12506
|
+
const taxesEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.taxes_enabled;
|
|
12507
|
+
|
|
12508
|
+
if (taxesEnabled && type === "createPayment") {
|
|
12509
|
+
dispatch({
|
|
12510
|
+
type: DISABLE_SUBMIT,
|
|
12511
|
+
payload: true
|
|
12512
|
+
});
|
|
12513
|
+
resolveTaxCalculation().then(res => {
|
|
12514
|
+
if (res) {
|
|
12515
|
+
dispatch({
|
|
12516
|
+
type: SET_TAX_AMOUNT,
|
|
12517
|
+
payload: res.taxAmount
|
|
12518
|
+
});
|
|
12519
|
+
dispatch({
|
|
12520
|
+
type: SET_UPDATED_PRICE,
|
|
12521
|
+
payload: res.totalAmountWithTax
|
|
12522
|
+
});
|
|
12523
|
+
dispatch({
|
|
12524
|
+
type: UPDATE_PAYMENT_REQUEST
|
|
12525
|
+
});
|
|
12526
|
+
}
|
|
12527
|
+
}).catch(error => {
|
|
12528
|
+
handlePaymentError(error);
|
|
12529
|
+
}).finally(() => {
|
|
12530
|
+
dispatch({
|
|
12531
|
+
type: DISABLE_SUBMIT,
|
|
12532
|
+
payload: false
|
|
12533
|
+
});
|
|
12534
|
+
});
|
|
12535
|
+
}
|
|
12536
|
+
};
|
|
12461
12537
|
|
|
12462
12538
|
const onApplyCouponCode = (state, dispatch) => {
|
|
12463
12539
|
const {
|
|
@@ -12484,6 +12560,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12484
12560
|
});
|
|
12485
12561
|
}
|
|
12486
12562
|
|
|
12563
|
+
dispatch({
|
|
12564
|
+
type: SET_COUPON_ERROR,
|
|
12565
|
+
payload: ""
|
|
12566
|
+
});
|
|
12487
12567
|
dispatch({
|
|
12488
12568
|
type: SHOW_ALERT,
|
|
12489
12569
|
payload: {
|
|
@@ -12499,6 +12579,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12499
12579
|
type: SET_PERCENT_OFF,
|
|
12500
12580
|
payload: `${(_res$data$coupon = res.data.coupon) === null || _res$data$coupon === void 0 ? void 0 : _res$data$coupon.percent_off}%`
|
|
12501
12581
|
});
|
|
12582
|
+
dispatch({
|
|
12583
|
+
type: SET_TAX_AMOUNT,
|
|
12584
|
+
payload: res.data.taxes
|
|
12585
|
+
});
|
|
12502
12586
|
dispatch({
|
|
12503
12587
|
type: SET_UPDATED_PRICE,
|
|
12504
12588
|
payload: res.data.total
|
|
@@ -12508,6 +12592,29 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12508
12592
|
});
|
|
12509
12593
|
};
|
|
12510
12594
|
|
|
12595
|
+
if ((couponCode === null || couponCode === void 0 ? void 0 : couponCode.trim()) === "") {
|
|
12596
|
+
dispatch({
|
|
12597
|
+
type: SET_COUPON,
|
|
12598
|
+
payload: null
|
|
12599
|
+
});
|
|
12600
|
+
dispatch({
|
|
12601
|
+
type: SET_PERCENT_OFF,
|
|
12602
|
+
payload: ""
|
|
12603
|
+
});
|
|
12604
|
+
dispatch({
|
|
12605
|
+
type: SET_UPDATED_PRICE,
|
|
12606
|
+
payload: null
|
|
12607
|
+
});
|
|
12608
|
+
dispatch({
|
|
12609
|
+
type: SET_TAX_AMOUNT,
|
|
12610
|
+
payload: null
|
|
12611
|
+
});
|
|
12612
|
+
dispatch({
|
|
12613
|
+
type: UPDATE_PAYMENT_REQUEST
|
|
12614
|
+
});
|
|
12615
|
+
updateTotalAmountWithTax();
|
|
12616
|
+
}
|
|
12617
|
+
|
|
12511
12618
|
if (couponCode !== null && couponCode !== void 0 && couponCode.trim()) {
|
|
12512
12619
|
dispatch({
|
|
12513
12620
|
type: DISABLE_COUPON_BUTTON,
|
|
@@ -12894,16 +13001,20 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12894
13001
|
const totalAmount = (_ref = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
|
|
12895
13002
|
|
|
12896
13003
|
if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
|
|
12897
|
-
return resolveTaxCalculation().then(
|
|
12898
|
-
|
|
12899
|
-
error
|
|
12900
|
-
}) => {
|
|
12901
|
-
if (error) {
|
|
12902
|
-
return handlePaymentError(error);
|
|
12903
|
-
}
|
|
13004
|
+
return resolveTaxCalculation().then(res => {
|
|
13005
|
+
var _res$totalAmountWithT;
|
|
12904
13006
|
|
|
12905
|
-
|
|
12906
|
-
|
|
13007
|
+
return generate3DSecureSource(source, (_res$totalAmountWithT = res === null || res === void 0 ? void 0 : res.totalAmountWithTax) !== null && _res$totalAmountWithT !== void 0 ? _res$totalAmountWithT : totalAmount).then(({
|
|
13008
|
+
source,
|
|
13009
|
+
error
|
|
13010
|
+
}) => {
|
|
13011
|
+
if (error) {
|
|
13012
|
+
return handlePaymentError(error);
|
|
13013
|
+
}
|
|
13014
|
+
|
|
13015
|
+
toggleAuthenticationPendingView(true, source);
|
|
13016
|
+
});
|
|
13017
|
+
});
|
|
12907
13018
|
}
|
|
12908
13019
|
|
|
12909
13020
|
return handlePayment(source);
|
|
@@ -12912,15 +13023,15 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12912
13023
|
});
|
|
12913
13024
|
};
|
|
12914
13025
|
/**
|
|
12915
|
-
* Resolves with the total
|
|
13026
|
+
* Resolves with the total & tax amount incase taxes enabled by site
|
|
12916
13027
|
* @return {Promise}
|
|
12917
13028
|
*/
|
|
12918
13029
|
|
|
12919
13030
|
|
|
12920
13031
|
const resolveTaxCalculation = () => {
|
|
12921
|
-
var _window$Pelcro$site$
|
|
13032
|
+
var _window$Pelcro$site$r2;
|
|
12922
13033
|
|
|
12923
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
13034
|
+
const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
|
|
12924
13035
|
return new Promise((resolve, reject) => {
|
|
12925
13036
|
// resolve early if taxes isn't enabled
|
|
12926
13037
|
if (!taxesEnabled) {
|
|
@@ -12933,14 +13044,18 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12933
13044
|
coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
|
|
12934
13045
|
address_id: selectedAddressId
|
|
12935
13046
|
}, (error, res) => {
|
|
12936
|
-
var _res$data;
|
|
13047
|
+
var _res$data, _res$data2;
|
|
12937
13048
|
|
|
12938
13049
|
if (error) {
|
|
12939
13050
|
return reject(error);
|
|
12940
13051
|
}
|
|
12941
13052
|
|
|
12942
|
-
const
|
|
12943
|
-
|
|
13053
|
+
const taxAmount = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.taxes;
|
|
13054
|
+
const totalAmountWithTax = (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.total;
|
|
13055
|
+
resolve({
|
|
13056
|
+
totalAmountWithTax,
|
|
13057
|
+
taxAmount
|
|
13058
|
+
});
|
|
12944
13059
|
});
|
|
12945
13060
|
});
|
|
12946
13061
|
};
|
|
@@ -12995,13 +13110,13 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12995
13110
|
const handlePaymentError = error => {
|
|
12996
13111
|
if (error.type === "validation_error" && // Subscription creation & renewal
|
|
12997
13112
|
type === "createPayment") {
|
|
12998
|
-
var _state$
|
|
13113
|
+
var _state$couponObject;
|
|
12999
13114
|
|
|
13000
13115
|
const {
|
|
13001
13116
|
updatedPrice
|
|
13002
13117
|
} = state; // When price is 0, we allow submitting without card info
|
|
13003
13118
|
|
|
13004
|
-
if (updatedPrice === 0 && ((_state$
|
|
13119
|
+
if (updatedPrice === 0 && ((_state$couponObject = state.couponObject) === null || _state$couponObject === void 0 ? void 0 : _state$couponObject.duration) === "forever") {
|
|
13005
13120
|
return subscribe({}, state, dispatch);
|
|
13006
13121
|
}
|
|
13007
13122
|
}
|
|
@@ -13129,6 +13244,11 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13129
13244
|
updatedPrice: action.payload
|
|
13130
13245
|
});
|
|
13131
13246
|
|
|
13247
|
+
case SET_TAX_AMOUNT:
|
|
13248
|
+
return lib_7({ ...state,
|
|
13249
|
+
taxAmount: action.payload
|
|
13250
|
+
});
|
|
13251
|
+
|
|
13132
13252
|
case SET_CAN_MAKE_PAYMENT:
|
|
13133
13253
|
return lib_7({ ...state,
|
|
13134
13254
|
canMakePayment: action.payload
|
|
@@ -13146,7 +13266,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13146
13266
|
|
|
13147
13267
|
case SET_COUPON:
|
|
13148
13268
|
return lib_7({ ...state,
|
|
13149
|
-
|
|
13269
|
+
couponObject: action.payload
|
|
13150
13270
|
});
|
|
13151
13271
|
|
|
13152
13272
|
case SET_COUPON_ERROR:
|
|
@@ -13172,21 +13292,21 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13172
13292
|
default:
|
|
13173
13293
|
return state;
|
|
13174
13294
|
}
|
|
13175
|
-
}, initialState$
|
|
13295
|
+
}, initialState$d);
|
|
13176
13296
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13177
13297
|
style: { ...style
|
|
13178
13298
|
},
|
|
13179
13299
|
className: `pelcro-container pelcro-payment-container ${className}`
|
|
13180
|
-
}, /*#__PURE__*/React__default['default'].createElement(Provider$
|
|
13300
|
+
}, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
|
|
13181
13301
|
value: {
|
|
13182
13302
|
state,
|
|
13183
13303
|
dispatch
|
|
13184
13304
|
}
|
|
13185
13305
|
}, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
|
|
13186
|
-
store: store$
|
|
13306
|
+
store: store$d,
|
|
13187
13307
|
key: i
|
|
13188
13308
|
})) : /*#__PURE__*/React__default['default'].cloneElement(children, {
|
|
13189
|
-
store: store$
|
|
13309
|
+
store: store$d
|
|
13190
13310
|
})));
|
|
13191
13311
|
};
|
|
13192
13312
|
|
|
@@ -13199,7 +13319,7 @@ const PaymentMethodContainer = props => {
|
|
|
13199
13319
|
stripeAccount: window.Pelcro.site.read().account_id,
|
|
13200
13320
|
locale: getCanonicalLocaleFormat(window.Pelcro.site.read().default_locale)
|
|
13201
13321
|
}, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
|
|
13202
|
-
store: store$
|
|
13322
|
+
store: store$d
|
|
13203
13323
|
}, props))));
|
|
13204
13324
|
}
|
|
13205
13325
|
|
|
@@ -13252,7 +13372,7 @@ const PelcroPaymentRequestButton = props => {
|
|
|
13252
13372
|
currentPlan,
|
|
13253
13373
|
updatedPrice
|
|
13254
13374
|
}
|
|
13255
|
-
} = React.useContext(store$
|
|
13375
|
+
} = React.useContext(store$d);
|
|
13256
13376
|
|
|
13257
13377
|
const updatePaymentRequest = () => {
|
|
13258
13378
|
// Make sure payment request is up to date, eg. user added a coupon code.
|
|
@@ -13305,9 +13425,10 @@ const DiscountedPrice = props => {
|
|
|
13305
13425
|
const {
|
|
13306
13426
|
state: {
|
|
13307
13427
|
updatedPrice,
|
|
13428
|
+
taxAmount,
|
|
13308
13429
|
percentOff
|
|
13309
13430
|
}
|
|
13310
|
-
} = React.useContext(store$
|
|
13431
|
+
} = React.useContext(store$d);
|
|
13311
13432
|
const {
|
|
13312
13433
|
default_locale
|
|
13313
13434
|
} = Pelcro.site.read();
|
|
@@ -13317,12 +13438,15 @@ const DiscountedPrice = props => {
|
|
|
13317
13438
|
} = usePelcro();
|
|
13318
13439
|
const ecommOrderCurrency = (_order$currency = order === null || order === void 0 ? void 0 : order.currency) !== null && _order$currency !== void 0 ? _order$currency : order === null || order === void 0 ? void 0 : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
|
|
13319
13440
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
13320
|
-
const
|
|
13441
|
+
const discountedPriceWithoutTax = updatedPrice - taxAmount;
|
|
13442
|
+
const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
|
|
13321
13443
|
|
|
13322
13444
|
if (percentOff) {
|
|
13323
13445
|
return /*#__PURE__*/React__default['default'].createElement("div", Object.assign({
|
|
13324
|
-
className: "plc-
|
|
13325
|
-
}, props), "(-", percentOff, ") ",
|
|
13446
|
+
className: "plc-flex plc-justify-center plc-mt-2 pelcro-discount"
|
|
13447
|
+
}, props), "(-", percentOff, ")", " ", /*#__PURE__*/React__default['default'].createElement("span", {
|
|
13448
|
+
className: "plc-font-bold pelcro-discounted-price"
|
|
13449
|
+
}, priceFormatted));
|
|
13326
13450
|
}
|
|
13327
13451
|
|
|
13328
13452
|
return "";
|
|
@@ -13347,7 +13471,7 @@ const SubmitPaymentMethod = ({
|
|
|
13347
13471
|
isLoading,
|
|
13348
13472
|
updatedPrice
|
|
13349
13473
|
}
|
|
13350
|
-
} = React.useContext(store$
|
|
13474
|
+
} = React.useContext(store$d);
|
|
13351
13475
|
const {
|
|
13352
13476
|
default_locale
|
|
13353
13477
|
} = Pelcro.site.read();
|
|
@@ -13371,17 +13495,17 @@ const SubmitPaymentMethod = ({
|
|
|
13371
13495
|
}, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
|
|
13372
13496
|
};
|
|
13373
13497
|
|
|
13374
|
-
var _path$
|
|
13498
|
+
var _path$i;
|
|
13375
13499
|
|
|
13376
|
-
function _extends$
|
|
13500
|
+
function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
|
|
13377
13501
|
|
|
13378
13502
|
function SvgArrowLeft(props) {
|
|
13379
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
13503
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
|
|
13380
13504
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13381
13505
|
fill: "none",
|
|
13382
13506
|
viewBox: "0 0 24 24",
|
|
13383
13507
|
stroke: "currentColor"
|
|
13384
|
-
}, props), _path$
|
|
13508
|
+
}, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
|
|
13385
13509
|
strokeLinecap: "round",
|
|
13386
13510
|
strokeLinejoin: "round",
|
|
13387
13511
|
strokeWidth: 2,
|
|
@@ -13400,7 +13524,7 @@ const ApplyCouponButton = ({
|
|
|
13400
13524
|
disableCouponButton
|
|
13401
13525
|
},
|
|
13402
13526
|
dispatch
|
|
13403
|
-
} = React.useContext(store$
|
|
13527
|
+
} = React.useContext(store$d);
|
|
13404
13528
|
const {
|
|
13405
13529
|
t
|
|
13406
13530
|
} = useTranslation("checkoutForm");
|
|
@@ -13434,7 +13558,7 @@ const CouponCodeField = props => {
|
|
|
13434
13558
|
couponCode,
|
|
13435
13559
|
couponError
|
|
13436
13560
|
}
|
|
13437
|
-
} = React.useContext(store$
|
|
13561
|
+
} = React.useContext(store$d);
|
|
13438
13562
|
|
|
13439
13563
|
const onCouponCodeChange = e => {
|
|
13440
13564
|
dispatch({
|
|
@@ -13452,6 +13576,7 @@ const CouponCodeField = props => {
|
|
|
13452
13576
|
|
|
13453
13577
|
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
13454
13578
|
className: "plc-h-12",
|
|
13579
|
+
wrapperClassName: "plc-mb-1",
|
|
13455
13580
|
errorClassName: "plc-h-12 sm:plc-h-8",
|
|
13456
13581
|
error: couponError,
|
|
13457
13582
|
"aria-label": t("labels.code"),
|
|
@@ -13462,17 +13587,17 @@ const CouponCodeField = props => {
|
|
|
13462
13587
|
}, props));
|
|
13463
13588
|
};
|
|
13464
13589
|
|
|
13465
|
-
var _path$
|
|
13590
|
+
var _path$h;
|
|
13466
13591
|
|
|
13467
|
-
function _extends$
|
|
13592
|
+
function _extends$j() { _extends$j = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
|
|
13468
13593
|
|
|
13469
13594
|
function SvgTicket(props) {
|
|
13470
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
13595
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
|
|
13471
13596
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13472
13597
|
fill: "none",
|
|
13473
13598
|
viewBox: "0 0 24 24",
|
|
13474
13599
|
stroke: "currentColor"
|
|
13475
|
-
}, props), _path$
|
|
13600
|
+
}, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
|
|
13476
13601
|
strokeLinecap: "round",
|
|
13477
13602
|
strokeLinejoin: "round",
|
|
13478
13603
|
strokeWidth: 2,
|
|
@@ -13489,7 +13614,7 @@ const CouponCode = ({
|
|
|
13489
13614
|
state: {
|
|
13490
13615
|
enableCouponField
|
|
13491
13616
|
}
|
|
13492
|
-
} = React.useContext(store$
|
|
13617
|
+
} = React.useContext(store$d);
|
|
13493
13618
|
const {
|
|
13494
13619
|
t
|
|
13495
13620
|
} = useTranslation("checkoutForm");
|
|
@@ -13503,16 +13628,16 @@ const CouponCode = ({
|
|
|
13503
13628
|
};
|
|
13504
13629
|
|
|
13505
13630
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13506
|
-
className: "plc-
|
|
13631
|
+
className: "plc-mt-4"
|
|
13507
13632
|
}, /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
13508
|
-
className: "plc-text-base plc-text-gray-500",
|
|
13633
|
+
className: "plc-mb-2 plc-text-base plc-text-gray-500",
|
|
13509
13634
|
variant: "ghost",
|
|
13510
13635
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgTicket, {
|
|
13511
13636
|
className: "plc-w-5 plc-h-5 plc-mr-2"
|
|
13512
13637
|
}),
|
|
13513
13638
|
onClick: showCouponField
|
|
13514
13639
|
}, otherProps), !enableCouponField ? t("labels.addCode") : t("labels.hideCode")), enableCouponField && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13515
|
-
className: "plc-flex plc-w-full plc-
|
|
13640
|
+
className: "plc-flex plc-w-full plc-mt-2 pelcro-apply-coupon-wrapper"
|
|
13516
13641
|
}, /*#__PURE__*/React__default['default'].createElement(CouponCodeField, null), /*#__PURE__*/React__default['default'].createElement(ApplyCouponButton, null)));
|
|
13517
13642
|
};
|
|
13518
13643
|
|
|
@@ -13746,7 +13871,7 @@ const PaypalSubscribeButton = props => {
|
|
|
13746
13871
|
const {
|
|
13747
13872
|
dispatch,
|
|
13748
13873
|
state
|
|
13749
|
-
} = React.useContext(store$
|
|
13874
|
+
} = React.useContext(store$d);
|
|
13750
13875
|
const {
|
|
13751
13876
|
product,
|
|
13752
13877
|
plan,
|
|
@@ -13831,16 +13956,16 @@ const BankRedirection = () => {
|
|
|
13831
13956
|
}));
|
|
13832
13957
|
};
|
|
13833
13958
|
|
|
13834
|
-
var _path$
|
|
13959
|
+
var _path$g;
|
|
13835
13960
|
|
|
13836
|
-
function _extends$
|
|
13961
|
+
function _extends$i() { _extends$i = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
|
|
13837
13962
|
|
|
13838
13963
|
function SvgLock(props) {
|
|
13839
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
13964
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
|
|
13840
13965
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13841
13966
|
viewBox: "0 0 20 20",
|
|
13842
13967
|
fill: "currentColor"
|
|
13843
|
-
}, props), _path$
|
|
13968
|
+
}, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
|
|
13844
13969
|
fillRule: "evenodd",
|
|
13845
13970
|
d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",
|
|
13846
13971
|
clipRule: "evenodd"
|
|
@@ -13857,7 +13982,7 @@ const SelectedPaymentMethod = () => {
|
|
|
13857
13982
|
state: {
|
|
13858
13983
|
isLoading
|
|
13859
13984
|
}
|
|
13860
|
-
} = React.useContext(store$
|
|
13985
|
+
} = React.useContext(store$d);
|
|
13861
13986
|
const {
|
|
13862
13987
|
switchView,
|
|
13863
13988
|
selectedPaymentMethodId
|
|
@@ -13889,6 +14014,37 @@ const SelectedPaymentMethod = () => {
|
|
|
13889
14014
|
}, t("select.buttons.changePaymentMethod")))));
|
|
13890
14015
|
};
|
|
13891
14016
|
|
|
14017
|
+
const TaxAmount = () => {
|
|
14018
|
+
var _plan$quantity;
|
|
14019
|
+
|
|
14020
|
+
const {
|
|
14021
|
+
t
|
|
14022
|
+
} = useTranslation("checkoutForm");
|
|
14023
|
+
const {
|
|
14024
|
+
state: {
|
|
14025
|
+
taxAmount
|
|
14026
|
+
}
|
|
14027
|
+
} = React.useContext(store$d);
|
|
14028
|
+
const {
|
|
14029
|
+
default_locale
|
|
14030
|
+
} = Pelcro.site.read();
|
|
14031
|
+
const {
|
|
14032
|
+
plan
|
|
14033
|
+
} = usePelcro();
|
|
14034
|
+
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
14035
|
+
const priceFormatted = getFormattedPriceByLocal(taxAmount * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
|
|
14036
|
+
|
|
14037
|
+
if (taxAmount) {
|
|
14038
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14039
|
+
className: "plc-text-center pelcro-tax-amount"
|
|
14040
|
+
}, t("labels.tax"), " ", /*#__PURE__*/React__default['default'].createElement("span", {
|
|
14041
|
+
className: "plc-font-bold"
|
|
14042
|
+
}, priceFormatted));
|
|
14043
|
+
}
|
|
14044
|
+
|
|
14045
|
+
return null;
|
|
14046
|
+
};
|
|
14047
|
+
|
|
13892
14048
|
/**
|
|
13893
14049
|
*
|
|
13894
14050
|
*/
|
|
@@ -13925,7 +14081,9 @@ function PaymentMethodView({
|
|
|
13925
14081
|
onFailure: onFailure
|
|
13926
14082
|
}, /*#__PURE__*/React__default['default'].createElement(BankRedirection, null), /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
13927
14083
|
className: "plc-mb-2"
|
|
13928
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default['default'].createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default['default'].createElement(
|
|
14084
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default['default'].createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14085
|
+
className: "plc-mb-2"
|
|
14086
|
+
}, /*#__PURE__*/React__default['default'].createElement(CouponCode, null), /*#__PURE__*/React__default['default'].createElement(DiscountedPrice, null)), /*#__PURE__*/React__default['default'].createElement(TaxAmount, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13929
14087
|
className: "plc-grid plc-mt-4 plc-gap-y-2"
|
|
13930
14088
|
}, /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, null), showExternalPaymentMethods && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PelcroPaymentRequestButton, null), /*#__PURE__*/React__default['default'].createElement(PaypalSubscribeButton, null)))))));
|
|
13931
14089
|
}
|
|
@@ -14032,22 +14190,22 @@ function SubscriptionRenewModal({
|
|
|
14032
14190
|
}
|
|
14033
14191
|
SubscriptionRenewModal.viewId = "subscription-renew";
|
|
14034
14192
|
|
|
14035
|
-
var _path$
|
|
14193
|
+
var _path$f;
|
|
14036
14194
|
|
|
14037
|
-
function _extends$
|
|
14195
|
+
function _extends$h() { _extends$h = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
|
|
14038
14196
|
|
|
14039
14197
|
function SvgGift(props) {
|
|
14040
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
14198
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
|
|
14041
14199
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
14042
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14043
14200
|
fill: "none",
|
|
14044
|
-
|
|
14045
|
-
stroke: "currentColor"
|
|
14046
|
-
}, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
|
|
14201
|
+
stroke: "currentColor",
|
|
14047
14202
|
strokeLinecap: "round",
|
|
14048
14203
|
strokeLinejoin: "round",
|
|
14049
14204
|
strokeWidth: 2,
|
|
14050
|
-
|
|
14205
|
+
viewBox: "0 0 24 24",
|
|
14206
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
14207
|
+
}, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
|
|
14208
|
+
d: "M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z"
|
|
14051
14209
|
})));
|
|
14052
14210
|
}
|
|
14053
14211
|
|
|
@@ -14101,8 +14259,7 @@ const getSuccessContent = i18n => {
|
|
|
14101
14259
|
|
|
14102
14260
|
const flow = getCurrentFlow();
|
|
14103
14261
|
const {
|
|
14104
|
-
product
|
|
14105
|
-
giftRecipient
|
|
14262
|
+
product
|
|
14106
14263
|
} = usePelcro.getStore();
|
|
14107
14264
|
const wordingDictionary = {
|
|
14108
14265
|
subscriptionSuccess: {
|
|
@@ -14114,12 +14271,10 @@ const getSuccessContent = i18n => {
|
|
|
14114
14271
|
},
|
|
14115
14272
|
giftCreate: {
|
|
14116
14273
|
successIcon: /*#__PURE__*/React__default['default'].createElement(SvgGift, {
|
|
14117
|
-
className: "plc-w-32 plc-my-4 plc-text-gray-
|
|
14274
|
+
className: "plc-w-32 plc-my-4 plc-text-gray-500"
|
|
14118
14275
|
}),
|
|
14119
14276
|
successTitle: i18n("messages.giftCreate.title"),
|
|
14120
|
-
successContent: i18n("messages.giftCreate.content"
|
|
14121
|
-
email: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.email
|
|
14122
|
-
})
|
|
14277
|
+
successContent: i18n("messages.giftCreate.content")
|
|
14123
14278
|
},
|
|
14124
14279
|
giftRedeem: {
|
|
14125
14280
|
successIcon: /*#__PURE__*/React__default['default'].createElement(SvgCheckSolid, {
|
|
@@ -14380,6 +14535,292 @@ class DefaultNewsLetter extends React.Component {
|
|
|
14380
14535
|
|
|
14381
14536
|
const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
|
|
14382
14537
|
|
|
14538
|
+
const initialState$c = {
|
|
14539
|
+
didSubToNewslettersBefore: false,
|
|
14540
|
+
newsletters: [],
|
|
14541
|
+
isListLoading: true,
|
|
14542
|
+
isSubmitting: false,
|
|
14543
|
+
alert: {
|
|
14544
|
+
type: "error",
|
|
14545
|
+
content: ""
|
|
14546
|
+
}
|
|
14547
|
+
};
|
|
14548
|
+
const store$c = /*#__PURE__*/React.createContext(initialState$c);
|
|
14549
|
+
const {
|
|
14550
|
+
Provider: Provider$c
|
|
14551
|
+
} = store$c;
|
|
14552
|
+
|
|
14553
|
+
const NewsletterUpdateContainer = ({
|
|
14554
|
+
style,
|
|
14555
|
+
className = "",
|
|
14556
|
+
onSuccess = () => {},
|
|
14557
|
+
onFailure = () => {},
|
|
14558
|
+
children
|
|
14559
|
+
}) => {
|
|
14560
|
+
const [t] = useTranslation("newsletter");
|
|
14561
|
+
|
|
14562
|
+
const handleSubmit = ({
|
|
14563
|
+
newsletters,
|
|
14564
|
+
didSubToNewslettersBefore
|
|
14565
|
+
}, dispatch) => {
|
|
14566
|
+
var _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
14567
|
+
|
|
14568
|
+
const callback = (err, res) => {
|
|
14569
|
+
dispatch({
|
|
14570
|
+
type: LOADING,
|
|
14571
|
+
payload: false
|
|
14572
|
+
});
|
|
14573
|
+
|
|
14574
|
+
if (err) {
|
|
14575
|
+
dispatch({
|
|
14576
|
+
type: SHOW_ALERT,
|
|
14577
|
+
payload: {
|
|
14578
|
+
type: "error",
|
|
14579
|
+
content: getErrorMessages(err)
|
|
14580
|
+
}
|
|
14581
|
+
});
|
|
14582
|
+
onFailure(err);
|
|
14583
|
+
} else {
|
|
14584
|
+
if (!didSubToNewslettersBefore) {
|
|
14585
|
+
dispatch({
|
|
14586
|
+
type: SWITCH_TO_UPDATE
|
|
14587
|
+
});
|
|
14588
|
+
}
|
|
14589
|
+
|
|
14590
|
+
dispatch({
|
|
14591
|
+
type: SHOW_ALERT,
|
|
14592
|
+
payload: {
|
|
14593
|
+
type: "success",
|
|
14594
|
+
content: t("messages.success")
|
|
14595
|
+
}
|
|
14596
|
+
});
|
|
14597
|
+
onSuccess(res);
|
|
14598
|
+
}
|
|
14599
|
+
};
|
|
14600
|
+
|
|
14601
|
+
const requestData = {
|
|
14602
|
+
email: (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.email) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : window.Pelcro.helpers.getURLParameter("email"),
|
|
14603
|
+
source: "web",
|
|
14604
|
+
lists: newsletters.filter(newsletter => newsletter.selected).map(newsletter => newsletter.id).join(",")
|
|
14605
|
+
};
|
|
14606
|
+
|
|
14607
|
+
if (didSubToNewslettersBefore) {
|
|
14608
|
+
window.Pelcro.newsletter.update(requestData, callback);
|
|
14609
|
+
} else {
|
|
14610
|
+
window.Pelcro.newsletter.create(requestData, callback);
|
|
14611
|
+
}
|
|
14612
|
+
};
|
|
14613
|
+
|
|
14614
|
+
const [state, dispatch] = useReducerWithSideEffects((state, action) => {
|
|
14615
|
+
switch (action.type) {
|
|
14616
|
+
case GET_NEWSLETTERS_FETCH:
|
|
14617
|
+
return lib_7({ ...state,
|
|
14618
|
+
isListLoading: true
|
|
14619
|
+
});
|
|
14620
|
+
|
|
14621
|
+
case GET_NEWSLETTERS_SUCCESS:
|
|
14622
|
+
return lib_7({ ...state,
|
|
14623
|
+
newsletters: action.payload.newsletters,
|
|
14624
|
+
didSubToNewslettersBefore: action.payload.didSubToNewslettersBefore,
|
|
14625
|
+
isListLoading: false
|
|
14626
|
+
});
|
|
14627
|
+
|
|
14628
|
+
case SET_SELECT:
|
|
14629
|
+
return lib_7({ ...state,
|
|
14630
|
+
newsletters: state.newsletters.map(newsletter => {
|
|
14631
|
+
if (newsletter.id === action.payload) {
|
|
14632
|
+
return { ...newsletter,
|
|
14633
|
+
selected: !newsletter.selected
|
|
14634
|
+
};
|
|
14635
|
+
}
|
|
14636
|
+
|
|
14637
|
+
return newsletter;
|
|
14638
|
+
})
|
|
14639
|
+
});
|
|
14640
|
+
|
|
14641
|
+
case SWITCH_TO_UPDATE:
|
|
14642
|
+
return lib_7({ ...state,
|
|
14643
|
+
didSubToNewslettersBefore: true
|
|
14644
|
+
});
|
|
14645
|
+
|
|
14646
|
+
case SHOW_ALERT:
|
|
14647
|
+
return lib_7({ ...state,
|
|
14648
|
+
alert: action.payload
|
|
14649
|
+
});
|
|
14650
|
+
|
|
14651
|
+
case LOADING:
|
|
14652
|
+
return lib_7({ ...state,
|
|
14653
|
+
isSubmitting: action.payload
|
|
14654
|
+
});
|
|
14655
|
+
|
|
14656
|
+
case HANDLE_SUBMIT:
|
|
14657
|
+
return lib_5({ ...state,
|
|
14658
|
+
isSubmitting: true
|
|
14659
|
+
}, (state, dispatch) => handleSubmit(state, dispatch));
|
|
14660
|
+
|
|
14661
|
+
default:
|
|
14662
|
+
return state;
|
|
14663
|
+
}
|
|
14664
|
+
}, initialState$c);
|
|
14665
|
+
React.useEffect(() => {
|
|
14666
|
+
const getUserNewsletters = () => {
|
|
14667
|
+
var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
|
|
14668
|
+
|
|
14669
|
+
dispatch({
|
|
14670
|
+
type: GET_NEWSLETTERS_FETCH
|
|
14671
|
+
});
|
|
14672
|
+
const email = (_window$Pelcro$user$r3 = (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.email) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : window.Pelcro.helpers.getURLParameter("email");
|
|
14673
|
+
window.Pelcro.newsletter.getByEmail(email, (err, res) => {
|
|
14674
|
+
var _window$Pelcro$uiSett, _window$Pelcro, _window$Pelcro$uiSett2, _res$data$lists$split, _res$data$lists;
|
|
14675
|
+
|
|
14676
|
+
if (err) {
|
|
14677
|
+
return dispatch({
|
|
14678
|
+
type: SHOW_ALERT,
|
|
14679
|
+
payload: {
|
|
14680
|
+
type: "error",
|
|
14681
|
+
content: getErrorMessages(err)
|
|
14682
|
+
}
|
|
14683
|
+
});
|
|
14684
|
+
}
|
|
14685
|
+
|
|
14686
|
+
const newsletters = (_window$Pelcro$uiSett = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett2 = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett2 === void 0 ? void 0 : _window$Pelcro$uiSett2.newsletters) !== null && _window$Pelcro$uiSett !== void 0 ? _window$Pelcro$uiSett : [];
|
|
14687
|
+
const selectedNewsletters = (_res$data$lists$split = (_res$data$lists = res.data.lists) === null || _res$data$lists === void 0 ? void 0 : _res$data$lists.split(",")) !== null && _res$data$lists$split !== void 0 ? _res$data$lists$split : [];
|
|
14688
|
+
const allNewslettersWithSelectedField = newsletters.map(newsletter => ({ ...newsletter,
|
|
14689
|
+
id: String(newsletter.id),
|
|
14690
|
+
selected: selectedNewsletters.includes(String(newsletter.id))
|
|
14691
|
+
}));
|
|
14692
|
+
dispatch({
|
|
14693
|
+
type: GET_NEWSLETTERS_SUCCESS,
|
|
14694
|
+
payload: {
|
|
14695
|
+
newsletters: allNewslettersWithSelectedField,
|
|
14696
|
+
didSubToNewslettersBefore: Boolean(res.data.email)
|
|
14697
|
+
}
|
|
14698
|
+
});
|
|
14699
|
+
});
|
|
14700
|
+
};
|
|
14701
|
+
|
|
14702
|
+
getUserNewsletters();
|
|
14703
|
+
}, []);
|
|
14704
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14705
|
+
style: { ...style
|
|
14706
|
+
},
|
|
14707
|
+
className: `pelcro-container pelcro-newsletter-update-container ${className}`
|
|
14708
|
+
}, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
|
|
14709
|
+
value: {
|
|
14710
|
+
state,
|
|
14711
|
+
dispatch
|
|
14712
|
+
}
|
|
14713
|
+
}, children.length ? children.map((child, i) => {
|
|
14714
|
+
if (child) {
|
|
14715
|
+
return /*#__PURE__*/React__default['default'].cloneElement(child, {
|
|
14716
|
+
store: store$c,
|
|
14717
|
+
key: i
|
|
14718
|
+
});
|
|
14719
|
+
}
|
|
14720
|
+
}) : /*#__PURE__*/React__default['default'].cloneElement(children, {
|
|
14721
|
+
store: store$c
|
|
14722
|
+
})));
|
|
14723
|
+
};
|
|
14724
|
+
|
|
14725
|
+
const NewsletterUpdateButton = ({
|
|
14726
|
+
name,
|
|
14727
|
+
onClick,
|
|
14728
|
+
...otherProps
|
|
14729
|
+
}) => {
|
|
14730
|
+
const {
|
|
14731
|
+
dispatch,
|
|
14732
|
+
state: {
|
|
14733
|
+
isSubmitting,
|
|
14734
|
+
isListLoading
|
|
14735
|
+
}
|
|
14736
|
+
} = React.useContext(store$c);
|
|
14737
|
+
const {
|
|
14738
|
+
t
|
|
14739
|
+
} = useTranslation("newsletter");
|
|
14740
|
+
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
14741
|
+
onClick: () => {
|
|
14742
|
+
dispatch({
|
|
14743
|
+
type: HANDLE_SUBMIT
|
|
14744
|
+
});
|
|
14745
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
14746
|
+
},
|
|
14747
|
+
disabled: isListLoading,
|
|
14748
|
+
isLoading: isSubmitting
|
|
14749
|
+
}, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
|
|
14750
|
+
};
|
|
14751
|
+
|
|
14752
|
+
const NewsletterUpdateList = () => {
|
|
14753
|
+
const handleSelectNewsletter = event => {
|
|
14754
|
+
dispatch({
|
|
14755
|
+
type: SET_SELECT,
|
|
14756
|
+
payload: event.target.value
|
|
14757
|
+
});
|
|
14758
|
+
};
|
|
14759
|
+
|
|
14760
|
+
const {
|
|
14761
|
+
dispatch,
|
|
14762
|
+
state: {
|
|
14763
|
+
newsletters,
|
|
14764
|
+
isListLoading
|
|
14765
|
+
}
|
|
14766
|
+
} = React.useContext(store$c);
|
|
14767
|
+
|
|
14768
|
+
if (isListLoading) {
|
|
14769
|
+
return /*#__PURE__*/React__default['default'].createElement(Loader, {
|
|
14770
|
+
width: 60,
|
|
14771
|
+
height: 100
|
|
14772
|
+
});
|
|
14773
|
+
}
|
|
14774
|
+
|
|
14775
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14776
|
+
className: "plc-max-h-80 plc-overflow-y-auto pelcro-newsletters-wrapper"
|
|
14777
|
+
}, newsletters.map(newsletter => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14778
|
+
key: newsletter.id,
|
|
14779
|
+
className: "plc-p-2 plc-mx-3 plc-mt-2 plc-border plc-border-gray-400 plc-border-solid plc-rounded plc-text-gray-900 pelcro-newsletter-wrapper"
|
|
14780
|
+
}, /*#__PURE__*/React__default['default'].createElement(Checkbox, {
|
|
14781
|
+
className: "pelcro-select-newsletter-checkbox",
|
|
14782
|
+
labelClassName: "plc-cursor-pointer plc-w-full",
|
|
14783
|
+
id: `pelcro-newsletter-update-${newsletter.id}`,
|
|
14784
|
+
checked: newsletter.selected,
|
|
14785
|
+
value: newsletter.id,
|
|
14786
|
+
onChange: handleSelectNewsletter
|
|
14787
|
+
}, newsletter.label))));
|
|
14788
|
+
};
|
|
14789
|
+
|
|
14790
|
+
const NewsletterUpdateView = props => {
|
|
14791
|
+
const {
|
|
14792
|
+
t
|
|
14793
|
+
} = useTranslation("newsletter");
|
|
14794
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14795
|
+
id: "pelcro-newsletter-update-view"
|
|
14796
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14797
|
+
className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
|
|
14798
|
+
}, /*#__PURE__*/React__default['default'].createElement("h4", {
|
|
14799
|
+
className: "plc-text-2xl plc-font-semibold"
|
|
14800
|
+
}, t("updateTitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
|
|
14801
|
+
action: "javascript:void(0);",
|
|
14802
|
+
className: "plc-mt-2 pelcro-form"
|
|
14803
|
+
}, /*#__PURE__*/React__default['default'].createElement(NewsletterUpdateContainer, props, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, null), /*#__PURE__*/React__default['default'].createElement(NewsletterUpdateList, null), /*#__PURE__*/React__default['default'].createElement(NewsletterUpdateButton, {
|
|
14804
|
+
role: "submit",
|
|
14805
|
+
className: "plc-mt-4 plc-w-full",
|
|
14806
|
+
name: t("labels.submit"),
|
|
14807
|
+
id: "pelcro-submit"
|
|
14808
|
+
}))));
|
|
14809
|
+
};
|
|
14810
|
+
|
|
14811
|
+
const NewsletterUpdateModal = ({
|
|
14812
|
+
onDisplay,
|
|
14813
|
+
onClose,
|
|
14814
|
+
...otherProps
|
|
14815
|
+
}) => {
|
|
14816
|
+
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
14817
|
+
id: "pelcro-newsletter-update-modal",
|
|
14818
|
+
onDisplay: onDisplay,
|
|
14819
|
+
onClose: onClose
|
|
14820
|
+
}, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(NewsletterUpdateView, otherProps)), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
|
|
14821
|
+
};
|
|
14822
|
+
NewsletterUpdateModal.viewId = "newsletter-update";
|
|
14823
|
+
|
|
14383
14824
|
const MeterView = () => {
|
|
14384
14825
|
var _paywallProduct$paywa, _paywallProduct$paywa2;
|
|
14385
14826
|
|
|
@@ -14431,7 +14872,7 @@ const MeterModal = props => {
|
|
|
14431
14872
|
className: "plc-fixed plc-bottom-0 plc-right-0 plc-w-full plc-p-4 plc-bg-white plc-border-t-4 plc-rounded plc-shadow-md motion-safe:plc-animate-slideInBottom sm:plc-m-4 sm:plc-max-w-md plc-z-max plc-border-primary-500"
|
|
14432
14873
|
}, /*#__PURE__*/React__default['default'].createElement("button", {
|
|
14433
14874
|
type: "button",
|
|
14434
|
-
className: "plc-absolute plc-top-0 plc-text-2xl plc-text-gray-500 plc-right-1 pelcro-close-btn",
|
|
14875
|
+
className: "plc-absolute plc-top-0 plc-text-2xl plc-text-gray-500 hover:plc-text-black focus:plc-text-black plc-right-1 plc-border-0 plc-bg-transparent hover:plc-bg-transparent focus:plc-bg-transparent pelcro-close-btn",
|
|
14435
14876
|
"aria-label": "Close",
|
|
14436
14877
|
onClick: onClose
|
|
14437
14878
|
}, /*#__PURE__*/React__default['default'].createElement("span", null, "\xD7")), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(MeterView, props)));
|
|
@@ -14767,17 +15208,17 @@ const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createEl
|
|
|
14767
15208
|
|
|
14768
15209
|
var userSolidIcon = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20class%3D%22plc-h-5%20plc-w-5%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22white%22%3E%20%20%3Cpath%20transform%3D%22translate%280%2C2%29%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%209a3%203%200%20100-6%203%203%200%20000%206zm-7%209a7%207%200%201114%200H3z%22%20clip-rule%3D%22evenodd%22%20%2F%3E%3C%2Fsvg%3E";
|
|
14769
15210
|
|
|
14770
|
-
var _path$
|
|
15211
|
+
var _path$e;
|
|
14771
15212
|
|
|
14772
|
-
function _extends$
|
|
15213
|
+
function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
|
|
14773
15214
|
|
|
14774
15215
|
function SvgEdit(props) {
|
|
14775
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
15216
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
|
|
14776
15217
|
className: "plc-w-6 plc-h-6",
|
|
14777
15218
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14778
15219
|
viewBox: "0 0 20 20",
|
|
14779
15220
|
fill: "currentColor"
|
|
14780
|
-
}, props), _path$
|
|
15221
|
+
}, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
|
|
14781
15222
|
d: "M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zm-2.207 2.207L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
|
|
14782
15223
|
})));
|
|
14783
15224
|
}
|
|
@@ -17888,18 +18329,18 @@ const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].creat
|
|
|
17888
18329
|
store: store$4
|
|
17889
18330
|
}, props));
|
|
17890
18331
|
|
|
17891
|
-
var _path$
|
|
18332
|
+
var _path$d;
|
|
17892
18333
|
|
|
17893
|
-
function _extends$
|
|
18334
|
+
function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
|
|
17894
18335
|
|
|
17895
18336
|
function SvgInfoCircle(props) {
|
|
17896
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
18337
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
|
|
17897
18338
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17898
18339
|
className: "plc-w-5 plc-h-5",
|
|
17899
18340
|
fill: "none",
|
|
17900
18341
|
viewBox: "0 0 24 24",
|
|
17901
18342
|
stroke: "currentColor"
|
|
17902
|
-
}, props), _path$
|
|
18343
|
+
}, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
|
|
17903
18344
|
strokeLinecap: "round",
|
|
17904
18345
|
strokeLinejoin: "round",
|
|
17905
18346
|
strokeWidth: 2,
|
|
@@ -18886,8 +19327,8 @@ const PaymentMethodSelectModal = ({
|
|
|
18886
19327
|
};
|
|
18887
19328
|
PaymentMethodSelectModal.viewId = "payment-method-select";
|
|
18888
19329
|
|
|
18889
|
-
function _extends$
|
|
18890
|
-
_extends$
|
|
19330
|
+
function _extends$e() {
|
|
19331
|
+
_extends$e = Object.assign || function (target) {
|
|
18891
19332
|
for (var i = 1; i < arguments.length; i++) {
|
|
18892
19333
|
var source = arguments[i];
|
|
18893
19334
|
|
|
@@ -18901,7 +19342,7 @@ function _extends$d() {
|
|
|
18901
19342
|
return target;
|
|
18902
19343
|
};
|
|
18903
19344
|
|
|
18904
|
-
return _extends$
|
|
19345
|
+
return _extends$e.apply(this, arguments);
|
|
18905
19346
|
}
|
|
18906
19347
|
|
|
18907
19348
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -19085,7 +19526,7 @@ function render(props, propsBag, defaultTag, features, visible) {
|
|
|
19085
19526
|
return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
|
|
19086
19527
|
return null;
|
|
19087
19528
|
}, _match[RenderStrategy.Hidden] = function () {
|
|
19088
|
-
return _render(_extends$
|
|
19529
|
+
return _render(_extends$e({}, _rest, {
|
|
19089
19530
|
hidden: true,
|
|
19090
19531
|
style: {
|
|
19091
19532
|
display: 'none'
|
|
@@ -19613,7 +20054,7 @@ function TransitionChild(props) {
|
|
|
19613
20054
|
var passthroughProps = rest;
|
|
19614
20055
|
return React__default['default'].createElement(NestingContext.Provider, {
|
|
19615
20056
|
value: nesting
|
|
19616
|
-
}, render(_extends$
|
|
20057
|
+
}, render(_extends$e({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
|
|
19617
20058
|
}
|
|
19618
20059
|
|
|
19619
20060
|
function Transition(props) {
|
|
@@ -19657,7 +20098,7 @@ function Transition(props) {
|
|
|
19657
20098
|
value: nestingBag
|
|
19658
20099
|
}, React__default['default'].createElement(TransitionContext.Provider, {
|
|
19659
20100
|
value: transitionBag
|
|
19660
|
-
}, render(_extends$
|
|
20101
|
+
}, render(_extends$e({}, sharedProps, {
|
|
19661
20102
|
as: React.Fragment,
|
|
19662
20103
|
children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
|
|
19663
20104
|
}), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
|
|
@@ -19784,12 +20225,12 @@ var ActionTypes;
|
|
|
19784
20225
|
})(ActionTypes || (ActionTypes = {}));
|
|
19785
20226
|
|
|
19786
20227
|
(_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
|
|
19787
|
-
return _extends$
|
|
20228
|
+
return _extends$e({}, state, {
|
|
19788
20229
|
activeItemIndex: null,
|
|
19789
20230
|
menuState: MenuStates.Closed
|
|
19790
20231
|
});
|
|
19791
20232
|
}, _reducers[ActionTypes.OpenMenu] = function (state) {
|
|
19792
|
-
return _extends$
|
|
20233
|
+
return _extends$e({}, state, {
|
|
19793
20234
|
menuState: MenuStates.Open
|
|
19794
20235
|
});
|
|
19795
20236
|
}, _reducers[ActionTypes.GoToItem] = function (state, action) {
|
|
@@ -19808,7 +20249,7 @@ var ActionTypes;
|
|
|
19808
20249
|
}
|
|
19809
20250
|
});
|
|
19810
20251
|
if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
|
|
19811
|
-
return _extends$
|
|
20252
|
+
return _extends$e({}, state, {
|
|
19812
20253
|
searchQuery: '',
|
|
19813
20254
|
activeItemIndex: activeItemIndex
|
|
19814
20255
|
});
|
|
@@ -19819,19 +20260,19 @@ var ActionTypes;
|
|
|
19819
20260
|
|
|
19820
20261
|
return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
|
|
19821
20262
|
});
|
|
19822
|
-
if (match === -1 || match === state.activeItemIndex) return _extends$
|
|
20263
|
+
if (match === -1 || match === state.activeItemIndex) return _extends$e({}, state, {
|
|
19823
20264
|
searchQuery: searchQuery
|
|
19824
20265
|
});
|
|
19825
|
-
return _extends$
|
|
20266
|
+
return _extends$e({}, state, {
|
|
19826
20267
|
searchQuery: searchQuery,
|
|
19827
20268
|
activeItemIndex: match
|
|
19828
20269
|
});
|
|
19829
20270
|
}, _reducers[ActionTypes.ClearSearch] = function (state) {
|
|
19830
|
-
return _extends$
|
|
20271
|
+
return _extends$e({}, state, {
|
|
19831
20272
|
searchQuery: ''
|
|
19832
20273
|
});
|
|
19833
20274
|
}, _reducers[ActionTypes.RegisterItem] = function (state, action) {
|
|
19834
|
-
return _extends$
|
|
20275
|
+
return _extends$e({}, state, {
|
|
19835
20276
|
items: [].concat(state.items, [{
|
|
19836
20277
|
id: action.id,
|
|
19837
20278
|
dataRef: action.dataRef
|
|
@@ -19844,7 +20285,7 @@ var ActionTypes;
|
|
|
19844
20285
|
return a.id === action.id;
|
|
19845
20286
|
});
|
|
19846
20287
|
if (idx !== -1) nextItems.splice(idx, 1);
|
|
19847
|
-
return _extends$
|
|
20288
|
+
return _extends$e({}, state, {
|
|
19848
20289
|
items: nextItems,
|
|
19849
20290
|
activeItemIndex: function () {
|
|
19850
20291
|
if (idx === state.activeItemIndex) return null;
|
|
@@ -19883,19 +20324,19 @@ var ActionTypes$1;
|
|
|
19883
20324
|
(_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
|
|
19884
20325
|
if (state.disabled) return state;
|
|
19885
20326
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
19886
|
-
return _extends$
|
|
20327
|
+
return _extends$e({}, state, {
|
|
19887
20328
|
activeOptionIndex: null,
|
|
19888
20329
|
listboxState: ListboxStates.Closed
|
|
19889
20330
|
});
|
|
19890
20331
|
}, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
|
|
19891
20332
|
if (state.disabled) return state;
|
|
19892
20333
|
if (state.listboxState === ListboxStates.Open) return state;
|
|
19893
|
-
return _extends$
|
|
20334
|
+
return _extends$e({}, state, {
|
|
19894
20335
|
listboxState: ListboxStates.Open
|
|
19895
20336
|
});
|
|
19896
20337
|
}, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
|
|
19897
20338
|
if (state.disabled === action.disabled) return state;
|
|
19898
|
-
return _extends$
|
|
20339
|
+
return _extends$e({}, state, {
|
|
19899
20340
|
disabled: action.disabled
|
|
19900
20341
|
});
|
|
19901
20342
|
}, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
|
|
@@ -19916,7 +20357,7 @@ var ActionTypes$1;
|
|
|
19916
20357
|
}
|
|
19917
20358
|
});
|
|
19918
20359
|
if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
|
|
19919
|
-
return _extends$
|
|
20360
|
+
return _extends$e({}, state, {
|
|
19920
20361
|
searchQuery: '',
|
|
19921
20362
|
activeOptionIndex: activeOptionIndex
|
|
19922
20363
|
});
|
|
@@ -19929,10 +20370,10 @@ var ActionTypes$1;
|
|
|
19929
20370
|
|
|
19930
20371
|
return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
|
|
19931
20372
|
});
|
|
19932
|
-
if (match === -1 || match === state.activeOptionIndex) return _extends$
|
|
20373
|
+
if (match === -1 || match === state.activeOptionIndex) return _extends$e({}, state, {
|
|
19933
20374
|
searchQuery: searchQuery
|
|
19934
20375
|
});
|
|
19935
|
-
return _extends$
|
|
20376
|
+
return _extends$e({}, state, {
|
|
19936
20377
|
searchQuery: searchQuery,
|
|
19937
20378
|
activeOptionIndex: match
|
|
19938
20379
|
});
|
|
@@ -19940,11 +20381,11 @@ var ActionTypes$1;
|
|
|
19940
20381
|
if (state.disabled) return state;
|
|
19941
20382
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
19942
20383
|
if (state.searchQuery === '') return state;
|
|
19943
|
-
return _extends$
|
|
20384
|
+
return _extends$e({}, state, {
|
|
19944
20385
|
searchQuery: ''
|
|
19945
20386
|
});
|
|
19946
20387
|
}, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
|
|
19947
|
-
return _extends$
|
|
20388
|
+
return _extends$e({}, state, {
|
|
19948
20389
|
options: [].concat(state.options, [{
|
|
19949
20390
|
id: action.id,
|
|
19950
20391
|
dataRef: action.dataRef
|
|
@@ -19957,7 +20398,7 @@ var ActionTypes$1;
|
|
|
19957
20398
|
return a.id === action.id;
|
|
19958
20399
|
});
|
|
19959
20400
|
if (idx !== -1) nextOptions.splice(idx, 1);
|
|
19960
|
-
return _extends$
|
|
20401
|
+
return _extends$e({}, state, {
|
|
19961
20402
|
options: nextOptions,
|
|
19962
20403
|
activeOptionIndex: function () {
|
|
19963
20404
|
if (idx === state.activeOptionIndex) return null;
|
|
@@ -20018,18 +20459,18 @@ const getPaymentCardIcon = name => {
|
|
|
20018
20459
|
}));
|
|
20019
20460
|
};
|
|
20020
20461
|
|
|
20021
|
-
var _path$
|
|
20462
|
+
var _path$c;
|
|
20022
20463
|
|
|
20023
|
-
function _extends$
|
|
20464
|
+
function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
|
|
20024
20465
|
|
|
20025
20466
|
function SvgChevronRight(props) {
|
|
20026
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20467
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
|
|
20027
20468
|
className: "plc-w-6 plc-h-6",
|
|
20028
20469
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20029
20470
|
fill: "none",
|
|
20030
20471
|
viewBox: "0 0 24 24",
|
|
20031
20472
|
stroke: "currentColor"
|
|
20032
|
-
}, props), _path$
|
|
20473
|
+
}, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
|
|
20033
20474
|
strokeLinecap: "round",
|
|
20034
20475
|
strokeLinejoin: "round",
|
|
20035
20476
|
strokeWidth: 2,
|
|
@@ -20328,18 +20769,18 @@ Accordion.item = function AccordionItem({
|
|
|
20328
20769
|
}, content)) : null;
|
|
20329
20770
|
};
|
|
20330
20771
|
|
|
20331
|
-
var _path$
|
|
20772
|
+
var _path$b;
|
|
20332
20773
|
|
|
20333
|
-
function _extends$
|
|
20774
|
+
function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
|
|
20334
20775
|
|
|
20335
20776
|
function SvgExit(props) {
|
|
20336
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20777
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
|
|
20337
20778
|
className: "plc-w-6 plc-h-6",
|
|
20338
20779
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20339
20780
|
fill: "none",
|
|
20340
20781
|
viewBox: "0 0 24 24",
|
|
20341
20782
|
stroke: "currentColor"
|
|
20342
|
-
}, props), _path$
|
|
20783
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
|
|
20343
20784
|
strokeLinecap: "round",
|
|
20344
20785
|
strokeLinejoin: "round",
|
|
20345
20786
|
strokeWidth: 2,
|
|
@@ -20347,30 +20788,49 @@ function SvgExit(props) {
|
|
|
20347
20788
|
})));
|
|
20348
20789
|
}
|
|
20349
20790
|
|
|
20350
|
-
var _path$
|
|
20791
|
+
var _path$a;
|
|
20351
20792
|
|
|
20352
|
-
function _extends$
|
|
20793
|
+
function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
|
|
20353
20794
|
|
|
20354
20795
|
function SvgCheckMark(props) {
|
|
20355
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
20796
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
20356
20797
|
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
20357
20798
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20358
20799
|
viewBox: "0 0 20 20",
|
|
20359
20800
|
fill: "currentColor"
|
|
20360
|
-
}, props), _path$
|
|
20801
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
|
|
20361
20802
|
fillRule: "evenodd",
|
|
20362
20803
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
20363
20804
|
clipRule: "evenodd"
|
|
20364
20805
|
})));
|
|
20365
20806
|
}
|
|
20366
20807
|
|
|
20808
|
+
var _path$9;
|
|
20809
|
+
|
|
20810
|
+
function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
|
|
20811
|
+
|
|
20812
|
+
function SvgUser(props) {
|
|
20813
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
|
|
20814
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20815
|
+
fill: "none",
|
|
20816
|
+
viewBox: "0 0 24 24",
|
|
20817
|
+
stroke: "currentColor"
|
|
20818
|
+
}, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
20819
|
+
strokeLinecap: "round",
|
|
20820
|
+
strokeLinejoin: "round",
|
|
20821
|
+
strokeWidth: 2,
|
|
20822
|
+
d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
|
|
20823
|
+
})));
|
|
20824
|
+
}
|
|
20825
|
+
|
|
20367
20826
|
var _path$8;
|
|
20368
20827
|
|
|
20369
20828
|
function _extends$9() { _extends$9 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
|
|
20370
20829
|
|
|
20371
|
-
function
|
|
20830
|
+
function SvgNewsletter(props) {
|
|
20372
20831
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
20373
20832
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20833
|
+
className: "plc-h-5 plc-w-5",
|
|
20374
20834
|
fill: "none",
|
|
20375
20835
|
viewBox: "0 0 24 24",
|
|
20376
20836
|
stroke: "currentColor"
|
|
@@ -20378,7 +20838,7 @@ function SvgUser(props) {
|
|
|
20378
20838
|
strokeLinecap: "round",
|
|
20379
20839
|
strokeLinejoin: "round",
|
|
20380
20840
|
strokeWidth: 2,
|
|
20381
|
-
d: "
|
|
20841
|
+
d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
|
|
20382
20842
|
})));
|
|
20383
20843
|
}
|
|
20384
20844
|
|
|
@@ -20617,6 +21077,24 @@ class Dashboard extends React.Component {
|
|
|
20617
21077
|
});
|
|
20618
21078
|
});
|
|
20619
21079
|
|
|
21080
|
+
_defineProperty$3(this, "componentWillUnmount", () => {
|
|
21081
|
+
document.removeEventListener("click", this.hideMenuIfClickedOutside);
|
|
21082
|
+
});
|
|
21083
|
+
|
|
21084
|
+
_defineProperty$3(this, "initializeHideMenuHandler", () => {
|
|
21085
|
+
document.addEventListener("click", this.hideMenuIfClickedOutside);
|
|
21086
|
+
});
|
|
21087
|
+
|
|
21088
|
+
_defineProperty$3(this, "hideMenuIfClickedOutside", event => {
|
|
21089
|
+
const didClickOutsideMenu = this.state.isOpen && this.menuRef.current && !this.menuRef.current.contains(event.target);
|
|
21090
|
+
|
|
21091
|
+
if (didClickOutsideMenu) {
|
|
21092
|
+
this.setState({
|
|
21093
|
+
isOpen: false
|
|
21094
|
+
});
|
|
21095
|
+
}
|
|
21096
|
+
});
|
|
21097
|
+
|
|
20620
21098
|
_defineProperty$3(this, "cancelSubscription", (subscription_id, onSuccess, onFailure) => {
|
|
20621
21099
|
// disable the Login button to prevent repeated clicks
|
|
20622
21100
|
window.Pelcro.subscription.cancel({
|
|
@@ -20654,6 +21132,10 @@ class Dashboard extends React.Component {
|
|
|
20654
21132
|
return this.props.setView("password-change");
|
|
20655
21133
|
});
|
|
20656
21134
|
|
|
21135
|
+
_defineProperty$3(this, "displayNewsletterUpdate", () => {
|
|
21136
|
+
return this.props.setView("newsletter-update");
|
|
21137
|
+
});
|
|
21138
|
+
|
|
20657
21139
|
_defineProperty$3(this, "displayProductSelect", ({
|
|
20658
21140
|
isGift
|
|
20659
21141
|
}) => {
|
|
@@ -20773,6 +21255,8 @@ class Dashboard extends React.Component {
|
|
|
20773
21255
|
loadingMessage: this.locale("messages.subCancellation.loading"),
|
|
20774
21256
|
successMessage: this.locale("messages.subCancellation.success"),
|
|
20775
21257
|
errorMessage: this.locale("messages.subCancellation.error")
|
|
21258
|
+
}, {
|
|
21259
|
+
closeButtonLabel: this.locale("labels.subCancellation.goBack")
|
|
20776
21260
|
});
|
|
20777
21261
|
}; // Reactivate button click handlers
|
|
20778
21262
|
|
|
@@ -20811,21 +21295,21 @@ class Dashboard extends React.Component {
|
|
|
20811
21295
|
className: "plc-inline-block plc-mt-1"
|
|
20812
21296
|
}, sub.shipments_remaining, " ", this.locale("labels.shipments")) : null)), /*#__PURE__*/React__default['default'].createElement("td", null, sub.cancel_at_period_end === 0 && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
20813
21297
|
variant: "ghost",
|
|
20814
|
-
className: "plc-text-red-500 focus:plc-ring-red-500",
|
|
21298
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashoard-sub-cancel-button",
|
|
20815
21299
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
|
|
20816
21300
|
onClick: onCancelClick,
|
|
20817
21301
|
disabled: this.state.disableSubmit,
|
|
20818
21302
|
"data-key": sub.id
|
|
20819
21303
|
}, this.locale("labels.unsubscribe")), sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
20820
21304
|
variant: "ghost",
|
|
20821
|
-
className: "plc-text-green-400 focus:plc-ring-green-300",
|
|
21305
|
+
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashoard-sub-reactivate-button",
|
|
20822
21306
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgRefresh, null),
|
|
20823
21307
|
onClick: onReactivateClick,
|
|
20824
21308
|
disabled: this.state.disableSubmit,
|
|
20825
21309
|
"data-key": sub.id
|
|
20826
21310
|
}, this.locale("labels.reactivate")), sub.cancel_at_period_end === 1 && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
20827
21311
|
variant: "ghost",
|
|
20828
|
-
className: "plc-text-blue-400",
|
|
21312
|
+
className: "plc-text-blue-400 pelcro-dashoard-sub-renew-button",
|
|
20829
21313
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgRefresh, null),
|
|
20830
21314
|
onClick: onRenewClick,
|
|
20831
21315
|
disabled: this.state.disableSubmit,
|
|
@@ -21006,28 +21490,33 @@ class Dashboard extends React.Component {
|
|
|
21006
21490
|
this.site = window.Pelcro.site.read();
|
|
21007
21491
|
this.locale = this.props.t;
|
|
21008
21492
|
this.user = window.Pelcro.user.read();
|
|
21493
|
+
this.menuRef = /*#__PURE__*/React__default['default'].createRef();
|
|
21009
21494
|
}
|
|
21010
21495
|
|
|
21011
21496
|
render() {
|
|
21012
|
-
var _window$Pelcro$user$r3, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
21497
|
+
var _window$Pelcro$user$r3, _window$Pelcro, _window$Pelcro$uiSett, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
21013
21498
|
|
|
21014
21499
|
const {
|
|
21015
21500
|
isOpen
|
|
21016
21501
|
} = this.state;
|
|
21017
21502
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
21018
21503
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
21504
|
+
const newsletters = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.newsletters;
|
|
21505
|
+
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
21019
21506
|
return /*#__PURE__*/React__default['default'].createElement(Transition, {
|
|
21020
21507
|
className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full plc-max-w-xl plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
|
|
21021
21508
|
show: isOpen,
|
|
21022
21509
|
enter: "plc-transform plc-transition plc-duration-500",
|
|
21023
21510
|
enterFrom: "plc-translate-x-full",
|
|
21024
21511
|
enterTo: "plc-translate-x-0",
|
|
21512
|
+
afterEnter: this.initializeHideMenuHandler,
|
|
21025
21513
|
leave: "plc-transform plc-transition plc-duration-500",
|
|
21026
21514
|
leaveFrom: "plc-translate-x-0",
|
|
21027
21515
|
leaveTo: "plc-translate-x-full",
|
|
21028
21516
|
afterLeave: this.props.onClose
|
|
21029
21517
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
21030
|
-
id: "pelcro-view-dashboard"
|
|
21518
|
+
id: "pelcro-view-dashboard",
|
|
21519
|
+
ref: this.menuRef
|
|
21031
21520
|
}, /*#__PURE__*/React__default['default'].createElement("header", {
|
|
21032
21521
|
className: "plc-flex plc-flex-col plc-p-4 plc-pl-2 plc-min-h-40 sm:plc-pr-8 plc-bg-primary-500"
|
|
21033
21522
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -21090,7 +21579,14 @@ class Dashboard extends React.Component {
|
|
|
21090
21579
|
}),
|
|
21091
21580
|
className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
|
|
21092
21581
|
onClick: this.displayChangePassword
|
|
21093
|
-
}, this.locale("labels.changePassword"))
|
|
21582
|
+
}, this.locale("labels.changePassword")), siteHasNewslettersDefined && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
21583
|
+
variant: "ghost",
|
|
21584
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgNewsletter, {
|
|
21585
|
+
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
21586
|
+
}),
|
|
21587
|
+
className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
|
|
21588
|
+
onClick: this.displayNewsletterUpdate
|
|
21589
|
+
}, this.locale("labels.editNewsletters")))
|
|
21094
21590
|
}), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
|
|
21095
21591
|
name: SUB_MENUS.PAYMENT_CARDS,
|
|
21096
21592
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgPaymentCard, null),
|
|
@@ -21166,7 +21662,7 @@ const DashboardOpenButton = () => {
|
|
|
21166
21662
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
21167
21663
|
className: "plc-fixed plc-right-4 plc-bottom-4 pelcro-open-dashboard-btn"
|
|
21168
21664
|
}, /*#__PURE__*/React__default['default'].createElement("button", {
|
|
21169
|
-
className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300",
|
|
21665
|
+
className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300 hover:plc-bg-white",
|
|
21170
21666
|
name: "menu",
|
|
21171
21667
|
id: "pelcro-view-menu",
|
|
21172
21668
|
onClick: () => switchView("dashboard")
|
|
@@ -23031,6 +23527,7 @@ exports.AddressUpdateSubmit = AddressUpdateSubmit;
|
|
|
23031
23527
|
exports.AddressUpdateTextInput = AddressUpdateTextInput;
|
|
23032
23528
|
exports.AddressUpdateView = AddressUpdateView;
|
|
23033
23529
|
exports.Alert = AlertWithContext;
|
|
23530
|
+
exports.AlertElement = Alert;
|
|
23034
23531
|
exports.ApplyCouponButton = ApplyCouponButton;
|
|
23035
23532
|
exports.Badge = Badge;
|
|
23036
23533
|
exports.BankRedirection = BankRedirection;
|
|
@@ -23082,6 +23579,11 @@ exports.Modal = Modal;
|
|
|
23082
23579
|
exports.ModalBody = ModalBody;
|
|
23083
23580
|
exports.ModalFooter = ModalFooter;
|
|
23084
23581
|
exports.NewsLetter = NewsletterWithHook;
|
|
23582
|
+
exports.NewsletterUpdateButton = NewsletterUpdateButton;
|
|
23583
|
+
exports.NewsletterUpdateContainer = NewsletterUpdateContainer;
|
|
23584
|
+
exports.NewsletterUpdateList = NewsletterUpdateList;
|
|
23585
|
+
exports.NewsletterUpdateModal = NewsletterUpdateModal;
|
|
23586
|
+
exports.NewsletterUpdateView = NewsletterUpdateView;
|
|
23085
23587
|
exports.Notification = Notification;
|
|
23086
23588
|
exports.OrderConfirmModal = OrderConfirmModal;
|
|
23087
23589
|
exports.OrderCreateContainer = OrderCreateContainer;
|
|
@@ -23160,6 +23662,7 @@ exports.SubscriptionCreateView = SubscriptionCreateView;
|
|
|
23160
23662
|
exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
|
|
23161
23663
|
exports.SubscriptionRenewModal = SubscriptionRenewModal;
|
|
23162
23664
|
exports.SubscriptionRenewView = SubscriptionRenewView;
|
|
23665
|
+
exports.TaxAmount = TaxAmount;
|
|
23163
23666
|
exports.TextArea = TextArea;
|
|
23164
23667
|
exports.Tooltip = Tooltip;
|
|
23165
23668
|
exports.UserUpdateButton = UserUpdateButton;
|