@pelcro/react-pelcro-js 2.4.0 → 2.6.0-beta.3
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 +915 -224
- package/dist/index.esm.js +909 -225
- package/dist/pelcro.css +119 -0
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -3432,6 +3432,7 @@ var paymentMethod_fr = {
|
|
|
3432
3432
|
};
|
|
3433
3433
|
|
|
3434
3434
|
var title$d = "Enter your email to subscribe to our newsletter";
|
|
3435
|
+
var updateTitle$1 = "Update newsletter selections";
|
|
3435
3436
|
var subtitle$7 = "We may use your email for other marketing communication";
|
|
3436
3437
|
var labels$l = {
|
|
3437
3438
|
submit: "Submit",
|
|
@@ -3443,22 +3444,21 @@ var labels$l = {
|
|
|
3443
3444
|
};
|
|
3444
3445
|
var messages$p = {
|
|
3445
3446
|
alreadyHaveAccount: "Already have an account?",
|
|
3447
|
+
success: "Newsletters were successfully updated",
|
|
3446
3448
|
loginHere: "Login here.",
|
|
3447
3449
|
createAnAccount: " Create an account by clicking ",
|
|
3448
3450
|
here: "here"
|
|
3449
3451
|
};
|
|
3450
|
-
var errors$b = {
|
|
3451
|
-
"": ""
|
|
3452
|
-
};
|
|
3453
3452
|
var newsletter_en = {
|
|
3454
3453
|
title: title$d,
|
|
3454
|
+
updateTitle: updateTitle$1,
|
|
3455
3455
|
subtitle: subtitle$7,
|
|
3456
3456
|
labels: labels$l,
|
|
3457
|
-
messages: messages$p
|
|
3458
|
-
errors: errors$b
|
|
3457
|
+
messages: messages$p
|
|
3459
3458
|
};
|
|
3460
3459
|
|
|
3461
3460
|
var title$c = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
|
|
3461
|
+
var updateTitle = "Mettre à jour son choix d'infolettres";
|
|
3462
3462
|
var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
|
|
3463
3463
|
var labels$k = {
|
|
3464
3464
|
submit: "Lire l’article !",
|
|
@@ -3470,19 +3470,17 @@ var labels$k = {
|
|
|
3470
3470
|
};
|
|
3471
3471
|
var messages$o = {
|
|
3472
3472
|
alreadyHaveAccount: "Vous avez déjà un compte ?",
|
|
3473
|
+
success: "Votre choix d'infolettres à été mis à jour",
|
|
3473
3474
|
loginHere: "Connectez-vous ici",
|
|
3474
3475
|
createAnAccount: " Créez un compte en cliquant ",
|
|
3475
3476
|
here: "ici"
|
|
3476
3477
|
};
|
|
3477
|
-
var errors$a = {
|
|
3478
|
-
"": ""
|
|
3479
|
-
};
|
|
3480
3478
|
var newsletter_fr = {
|
|
3481
3479
|
title: title$c,
|
|
3480
|
+
updateTitle: updateTitle,
|
|
3482
3481
|
subtitle: subtitle$6,
|
|
3483
3482
|
labels: labels$k,
|
|
3484
|
-
messages: messages$o
|
|
3485
|
-
errors: errors$a
|
|
3483
|
+
messages: messages$o
|
|
3486
3484
|
};
|
|
3487
3485
|
|
|
3488
3486
|
var labels$j = {
|
|
@@ -3591,7 +3589,8 @@ var labels$h = {
|
|
|
3591
3589
|
code: "Coupon code",
|
|
3592
3590
|
"for": "for",
|
|
3593
3591
|
interval: "{{count}} {{interval}}",
|
|
3594
|
-
interval_plural: "{{count}} {{interval}}s"
|
|
3592
|
+
interval_plural: "{{count}} {{interval}}s",
|
|
3593
|
+
tax: "+ Tax"
|
|
3595
3594
|
};
|
|
3596
3595
|
var checkoutForm_en = {
|
|
3597
3596
|
messages: messages$j,
|
|
@@ -3616,7 +3615,8 @@ var labels$g = {
|
|
|
3616
3615
|
code: "Code promo",
|
|
3617
3616
|
"for": "pour",
|
|
3618
3617
|
interval: "{{count}} {{interval}}",
|
|
3619
|
-
interval_plural: "{{count}} {{interval}}s"
|
|
3618
|
+
interval_plural: "{{count}} {{interval}}s",
|
|
3619
|
+
tax: "+ Taxe"
|
|
3620
3620
|
};
|
|
3621
3621
|
var checkoutForm_fr = {
|
|
3622
3622
|
messages: messages$i,
|
|
@@ -4345,6 +4345,7 @@ var labels$3 = {
|
|
|
4345
4345
|
profile: "Profile",
|
|
4346
4346
|
updateProfile: "Edit profile",
|
|
4347
4347
|
changePassword: "Change password",
|
|
4348
|
+
editNewsletters: "Edit newsletters",
|
|
4348
4349
|
edit: "Edit",
|
|
4349
4350
|
gifts: "Gifts",
|
|
4350
4351
|
redeemGift: "Redeem gift",
|
|
@@ -4421,6 +4422,7 @@ var labels$2 = {
|
|
|
4421
4422
|
profile: "Profil",
|
|
4422
4423
|
updateProfile: "Mettre à jour le profil",
|
|
4423
4424
|
changePassword: "Changer le mot de passe",
|
|
4425
|
+
editNewsletters: "Modifier les newsletters",
|
|
4424
4426
|
edit: "Modifier",
|
|
4425
4427
|
gifts: "Cadeaux",
|
|
4426
4428
|
redeemGift: "Échanger un cadeau",
|
|
@@ -5897,7 +5899,7 @@ class PelcroActions {
|
|
|
5897
5899
|
view,
|
|
5898
5900
|
cartItems,
|
|
5899
5901
|
...otherStateFields
|
|
5900
|
-
} = initialState$
|
|
5902
|
+
} = initialState$g;
|
|
5901
5903
|
this.set(otherStateFields);
|
|
5902
5904
|
});
|
|
5903
5905
|
|
|
@@ -6187,7 +6189,7 @@ class PelcroCallbacks {
|
|
|
6187
6189
|
|
|
6188
6190
|
}
|
|
6189
6191
|
|
|
6190
|
-
const initialState$
|
|
6192
|
+
const initialState$g = {
|
|
6191
6193
|
// View
|
|
6192
6194
|
view: null,
|
|
6193
6195
|
// Plans
|
|
@@ -6215,7 +6217,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
|
|
|
6215
6217
|
return {
|
|
6216
6218
|
// Store setter
|
|
6217
6219
|
set,
|
|
6218
|
-
...initialState$
|
|
6220
|
+
...initialState$g,
|
|
6219
6221
|
// State actions
|
|
6220
6222
|
...actions,
|
|
6221
6223
|
// Callbacks
|
|
@@ -6346,11 +6348,40 @@ const calcAndFormatItemsTotal = (items, currency) => {
|
|
|
6346
6348
|
*/
|
|
6347
6349
|
|
|
6348
6350
|
const isValidViewFromURL = viewID => {
|
|
6349
|
-
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)) {
|
|
6351
|
+
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()) {
|
|
6350
6352
|
return true;
|
|
6351
6353
|
}
|
|
6352
6354
|
|
|
6353
6355
|
return false;
|
|
6356
|
+
|
|
6357
|
+
function hasValidNewsletterUpdateUrl() {
|
|
6358
|
+
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
6359
|
+
|
|
6360
|
+
if (viewID !== "newsletter-update") return false;
|
|
6361
|
+
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;
|
|
6362
|
+
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
6363
|
+
|
|
6364
|
+
if (!siteHasNewslettersDefined) {
|
|
6365
|
+
return false;
|
|
6366
|
+
}
|
|
6367
|
+
|
|
6368
|
+
const queryParamEmail = window.Pelcro.helpers.getURLParameter("email");
|
|
6369
|
+
|
|
6370
|
+
if (queryParamEmail && window.Pelcro.user.isAuthenticated()) {
|
|
6371
|
+
var _window$Pelcro$user$r4;
|
|
6372
|
+
|
|
6373
|
+
if (queryParamEmail !== ((_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.email)) {
|
|
6374
|
+
console.error("email query parameter and user account email are different, url email query parameter must match user email if user is logged in");
|
|
6375
|
+
return false;
|
|
6376
|
+
}
|
|
6377
|
+
}
|
|
6378
|
+
|
|
6379
|
+
if (!queryParamEmail && !window.Pelcro.user.isAuthenticated()) {
|
|
6380
|
+
return false;
|
|
6381
|
+
}
|
|
6382
|
+
|
|
6383
|
+
return true;
|
|
6384
|
+
}
|
|
6354
6385
|
};
|
|
6355
6386
|
/**
|
|
6356
6387
|
* Returns the current stable viewID from all old variations
|
|
@@ -6382,7 +6413,7 @@ const disableScroll = () => {
|
|
|
6382
6413
|
}
|
|
6383
6414
|
};
|
|
6384
6415
|
const trackSubscriptionOnGA = () => {
|
|
6385
|
-
var _ReactGA$set, _window$Pelcro$user$
|
|
6416
|
+
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;
|
|
6386
6417
|
|
|
6387
6418
|
const {
|
|
6388
6419
|
product,
|
|
@@ -6404,7 +6435,7 @@ const trackSubscriptionOnGA = () => {
|
|
|
6404
6435
|
}
|
|
6405
6436
|
|
|
6406
6437
|
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$set = ReactGA.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA, {
|
|
6407
|
-
currencyCode: (_window$Pelcro$user$
|
|
6438
|
+
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
|
|
6408
6439
|
});
|
|
6409
6440
|
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", {
|
|
6410
6441
|
id: lastSubscriptionId,
|
|
@@ -6432,9 +6463,9 @@ const trackSubscriptionOnGA = () => {
|
|
|
6432
6463
|
*/
|
|
6433
6464
|
|
|
6434
6465
|
const userHasPaymentMethod = () => {
|
|
6435
|
-
var _window$Pelcro$user$
|
|
6466
|
+
var _window$Pelcro$user$r7, _window$Pelcro$user$r8;
|
|
6436
6467
|
|
|
6437
|
-
const sources = (_window$Pelcro$user$
|
|
6468
|
+
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 : [];
|
|
6438
6469
|
return sources.length > 0;
|
|
6439
6470
|
};
|
|
6440
6471
|
/**
|
|
@@ -6816,8 +6847,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
|
|
|
6816
6847
|
|
|
6817
6848
|
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}}
|
|
6818
6849
|
|
|
6819
|
-
function _extends$
|
|
6820
|
-
_extends$
|
|
6850
|
+
function _extends$u() {
|
|
6851
|
+
_extends$u = Object.assign || function (target) {
|
|
6821
6852
|
for (var i = 1; i < arguments.length; i++) {
|
|
6822
6853
|
var source = arguments[i];
|
|
6823
6854
|
|
|
@@ -6831,7 +6862,7 @@ function _extends$t() {
|
|
|
6831
6862
|
return target;
|
|
6832
6863
|
};
|
|
6833
6864
|
|
|
6834
|
-
return _extends$
|
|
6865
|
+
return _extends$u.apply(this, arguments);
|
|
6835
6866
|
}
|
|
6836
6867
|
|
|
6837
6868
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
@@ -6921,7 +6952,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
|
|
|
6921
6952
|
var reducer = function reducer(state, action) {
|
|
6922
6953
|
switch (action.type) {
|
|
6923
6954
|
case ActionType.ADD_TOAST:
|
|
6924
|
-
return _extends$
|
|
6955
|
+
return _extends$u({}, state, {
|
|
6925
6956
|
toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
|
|
6926
6957
|
});
|
|
6927
6958
|
|
|
@@ -6931,9 +6962,9 @@ var reducer = function reducer(state, action) {
|
|
|
6931
6962
|
clearFromRemoveQueue(action.toast.id);
|
|
6932
6963
|
}
|
|
6933
6964
|
|
|
6934
|
-
return _extends$
|
|
6965
|
+
return _extends$u({}, state, {
|
|
6935
6966
|
toasts: state.toasts.map(function (t) {
|
|
6936
|
-
return t.id === action.toast.id ? _extends$
|
|
6967
|
+
return t.id === action.toast.id ? _extends$u({}, t, action.toast) : t;
|
|
6937
6968
|
})
|
|
6938
6969
|
});
|
|
6939
6970
|
|
|
@@ -6960,9 +6991,9 @@ var reducer = function reducer(state, action) {
|
|
|
6960
6991
|
});
|
|
6961
6992
|
}
|
|
6962
6993
|
|
|
6963
|
-
return _extends$
|
|
6994
|
+
return _extends$u({}, state, {
|
|
6964
6995
|
toasts: state.toasts.map(function (t) {
|
|
6965
|
-
return t.id === toastId || toastId === undefined ? _extends$
|
|
6996
|
+
return t.id === toastId || toastId === undefined ? _extends$u({}, t, {
|
|
6966
6997
|
visible: false
|
|
6967
6998
|
}) : t;
|
|
6968
6999
|
})
|
|
@@ -6970,28 +7001,28 @@ var reducer = function reducer(state, action) {
|
|
|
6970
7001
|
|
|
6971
7002
|
case ActionType.REMOVE_TOAST:
|
|
6972
7003
|
if (action.toastId === undefined) {
|
|
6973
|
-
return _extends$
|
|
7004
|
+
return _extends$u({}, state, {
|
|
6974
7005
|
toasts: []
|
|
6975
7006
|
});
|
|
6976
7007
|
}
|
|
6977
7008
|
|
|
6978
|
-
return _extends$
|
|
7009
|
+
return _extends$u({}, state, {
|
|
6979
7010
|
toasts: state.toasts.filter(function (t) {
|
|
6980
7011
|
return t.id !== action.toastId;
|
|
6981
7012
|
})
|
|
6982
7013
|
});
|
|
6983
7014
|
|
|
6984
7015
|
case ActionType.START_PAUSE:
|
|
6985
|
-
return _extends$
|
|
7016
|
+
return _extends$u({}, state, {
|
|
6986
7017
|
pausedAt: action.time
|
|
6987
7018
|
});
|
|
6988
7019
|
|
|
6989
7020
|
case ActionType.END_PAUSE:
|
|
6990
7021
|
var diff = action.time - (state.pausedAt || 0);
|
|
6991
|
-
return _extends$
|
|
7022
|
+
return _extends$u({}, state, {
|
|
6992
7023
|
pausedAt: undefined,
|
|
6993
7024
|
toasts: state.toasts.map(function (t) {
|
|
6994
|
-
return _extends$
|
|
7025
|
+
return _extends$u({}, t, {
|
|
6995
7026
|
pauseDuration: t.pauseDuration + diff
|
|
6996
7027
|
});
|
|
6997
7028
|
})
|
|
@@ -7038,12 +7069,12 @@ var useStore = function useStore(toastOptions) {
|
|
|
7038
7069
|
var mergedToasts = state.toasts.map(function (t) {
|
|
7039
7070
|
var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
|
|
7040
7071
|
|
|
7041
|
-
return _extends$
|
|
7072
|
+
return _extends$u({}, toastOptions, toastOptions[t.type], t, {
|
|
7042
7073
|
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],
|
|
7043
|
-
style: _extends$
|
|
7074
|
+
style: _extends$u({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
|
|
7044
7075
|
});
|
|
7045
7076
|
});
|
|
7046
|
-
return _extends$
|
|
7077
|
+
return _extends$u({}, state, {
|
|
7047
7078
|
toasts: mergedToasts
|
|
7048
7079
|
});
|
|
7049
7080
|
};
|
|
@@ -7053,7 +7084,7 @@ var createToast = function createToast(message, type, opts) {
|
|
|
7053
7084
|
type = 'blank';
|
|
7054
7085
|
}
|
|
7055
7086
|
|
|
7056
|
-
return _extends$
|
|
7087
|
+
return _extends$u({
|
|
7057
7088
|
createdAt: Date.now(),
|
|
7058
7089
|
visible: true,
|
|
7059
7090
|
type: type,
|
|
@@ -7103,14 +7134,14 @@ toast.remove = function (toastId) {
|
|
|
7103
7134
|
};
|
|
7104
7135
|
|
|
7105
7136
|
toast.promise = function (promise, msgs, opts) {
|
|
7106
|
-
var id = toast.loading(msgs.loading, _extends$
|
|
7137
|
+
var id = toast.loading(msgs.loading, _extends$u({}, opts, opts == null ? void 0 : opts.loading));
|
|
7107
7138
|
promise.then(function (p) {
|
|
7108
|
-
toast.success(resolveValue(msgs.success, p), _extends$
|
|
7139
|
+
toast.success(resolveValue(msgs.success, p), _extends$u({
|
|
7109
7140
|
id: id
|
|
7110
7141
|
}, opts, opts == null ? void 0 : opts.success));
|
|
7111
7142
|
return p;
|
|
7112
7143
|
})["catch"](function (e) {
|
|
7113
|
-
toast.error(resolveValue(msgs.error, e), _extends$
|
|
7144
|
+
toast.error(resolveValue(msgs.error, e), _extends$u({
|
|
7114
7145
|
id: id
|
|
7115
7146
|
}, opts, opts == null ? void 0 : opts.error));
|
|
7116
7147
|
});
|
|
@@ -7449,7 +7480,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
|
|
|
7449
7480
|
var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
|
|
7450
7481
|
return createElement(ToastBarBase, {
|
|
7451
7482
|
className: toast.className,
|
|
7452
|
-
style: _extends$
|
|
7483
|
+
style: _extends$u({}, animationStyle, style, toast.style)
|
|
7453
7484
|
}, typeof children === 'function' ? children({
|
|
7454
7485
|
icon: icon,
|
|
7455
7486
|
message: message
|
|
@@ -7479,7 +7510,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
|
|
|
7479
7510
|
} : position.includes('right') ? {
|
|
7480
7511
|
justifyContent: 'flex-end'
|
|
7481
7512
|
} : {};
|
|
7482
|
-
return _extends$
|
|
7513
|
+
return _extends$u({
|
|
7483
7514
|
left: 0,
|
|
7484
7515
|
right: 0,
|
|
7485
7516
|
display: 'flex',
|
|
@@ -7506,7 +7537,7 @@ var Toaster = function Toaster(_ref) {
|
|
|
7506
7537
|
handlers = _useToaster.handlers;
|
|
7507
7538
|
|
|
7508
7539
|
return createElement("div", {
|
|
7509
|
-
style: _extends$
|
|
7540
|
+
style: _extends$u({
|
|
7510
7541
|
position: 'fixed',
|
|
7511
7542
|
zIndex: 9999,
|
|
7512
7543
|
top: DEFAULT_OFFSET,
|
|
@@ -7541,82 +7572,82 @@ var Toaster = function Toaster(_ref) {
|
|
|
7541
7572
|
}));
|
|
7542
7573
|
};
|
|
7543
7574
|
|
|
7544
|
-
var _path$
|
|
7575
|
+
var _path$r;
|
|
7545
7576
|
|
|
7546
|
-
function _extends$
|
|
7577
|
+
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); }
|
|
7547
7578
|
|
|
7548
7579
|
function SvgCheckSolid(props) {
|
|
7549
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7580
|
+
return /*#__PURE__*/React.createElement("svg", _extends$t({
|
|
7550
7581
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7551
7582
|
className: "h-5 w-5",
|
|
7552
7583
|
viewBox: "0 0 20 20",
|
|
7553
7584
|
fill: "currentColor"
|
|
7554
|
-
}, props), _path$
|
|
7585
|
+
}, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
|
|
7555
7586
|
fillRule: "evenodd",
|
|
7556
7587
|
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",
|
|
7557
7588
|
clipRule: "evenodd"
|
|
7558
7589
|
})));
|
|
7559
7590
|
}
|
|
7560
7591
|
|
|
7561
|
-
var _path$
|
|
7592
|
+
var _path$q;
|
|
7562
7593
|
|
|
7563
|
-
function _extends$
|
|
7594
|
+
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); }
|
|
7564
7595
|
|
|
7565
7596
|
function SvgXIcon(props) {
|
|
7566
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7597
|
+
return /*#__PURE__*/React.createElement("svg", _extends$s({
|
|
7567
7598
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7568
7599
|
viewBox: "0 0 20 20",
|
|
7569
7600
|
fill: "currentColor"
|
|
7570
|
-
}, props), _path$
|
|
7601
|
+
}, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
|
|
7571
7602
|
fill: "evenodd",
|
|
7572
7603
|
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",
|
|
7573
7604
|
clipRule: "evenodd"
|
|
7574
7605
|
})));
|
|
7575
7606
|
}
|
|
7576
7607
|
|
|
7577
|
-
var _path$
|
|
7608
|
+
var _path$p;
|
|
7578
7609
|
|
|
7579
|
-
function _extends$
|
|
7610
|
+
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); }
|
|
7580
7611
|
|
|
7581
7612
|
function SvgXIconSolid(props) {
|
|
7582
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7613
|
+
return /*#__PURE__*/React.createElement("svg", _extends$r({
|
|
7583
7614
|
className: "plc-w-4 plc-h-4",
|
|
7584
7615
|
fill: "currentColor",
|
|
7585
7616
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7586
7617
|
viewBox: "0 0 100 100"
|
|
7587
|
-
}, props), _path$
|
|
7618
|
+
}, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
|
|
7588
7619
|
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"
|
|
7589
7620
|
})));
|
|
7590
7621
|
}
|
|
7591
7622
|
|
|
7592
|
-
var _path$
|
|
7623
|
+
var _path$o;
|
|
7593
7624
|
|
|
7594
|
-
function _extends$
|
|
7625
|
+
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); }
|
|
7595
7626
|
|
|
7596
7627
|
function SvgExclamation(props) {
|
|
7597
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7628
|
+
return /*#__PURE__*/React.createElement("svg", _extends$q({
|
|
7598
7629
|
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
7599
7630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7600
7631
|
viewBox: "0 0 20 20",
|
|
7601
7632
|
fill: "currentColor"
|
|
7602
|
-
}, props), _path$
|
|
7633
|
+
}, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
|
|
7603
7634
|
fillRule: "evenodd",
|
|
7604
7635
|
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",
|
|
7605
7636
|
clipRule: "evenodd"
|
|
7606
7637
|
})));
|
|
7607
7638
|
}
|
|
7608
7639
|
|
|
7609
|
-
var _path$
|
|
7640
|
+
var _path$n, _path2$3;
|
|
7610
7641
|
|
|
7611
|
-
function _extends$
|
|
7642
|
+
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); }
|
|
7612
7643
|
|
|
7613
7644
|
function SvgSpinner(props) {
|
|
7614
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7645
|
+
return /*#__PURE__*/React.createElement("svg", _extends$p({
|
|
7615
7646
|
className: "plc-animate-spin",
|
|
7616
7647
|
viewBox: "0 0 24 24",
|
|
7617
7648
|
fill: "currentColor",
|
|
7618
7649
|
xmlns: "http://www.w3.org/2000/svg"
|
|
7619
|
-
}, props), _path$
|
|
7650
|
+
}, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
|
|
7620
7651
|
opacity: 0.2,
|
|
7621
7652
|
fill: "evenodd",
|
|
7622
7653
|
clipRule: "evenodd",
|
|
@@ -7842,6 +7873,16 @@ const init$1 = () => {
|
|
|
7842
7873
|
}
|
|
7843
7874
|
}
|
|
7844
7875
|
|
|
7876
|
+
const pelcroUpdateNewslettersButtons = document.getElementsByClassName("pelcro-update-newsletters-button");
|
|
7877
|
+
|
|
7878
|
+
if (pelcroUpdateNewslettersButtons.length !== 0) {
|
|
7879
|
+
for (let i = 0; i < pelcroUpdateNewslettersButtons.length; i++) {
|
|
7880
|
+
pelcroUpdateNewslettersButtons[i].addEventListener("click", () => {
|
|
7881
|
+
switchView("newsletter-update");
|
|
7882
|
+
});
|
|
7883
|
+
}
|
|
7884
|
+
}
|
|
7885
|
+
|
|
7845
7886
|
const pelcroCartButtonsByClass = document.getElementsByClassName("pelcro-cart-button");
|
|
7846
7887
|
|
|
7847
7888
|
if (pelcroCartButtonsByClass.length !== 0) {
|
|
@@ -8167,6 +8208,175 @@ function shouldBlurContent(entitlements) {
|
|
|
8167
8208
|
return entitlements.every(entitlement => !window.Pelcro.user.isEntitledTo(entitlement));
|
|
8168
8209
|
}
|
|
8169
8210
|
|
|
8211
|
+
var pure$1 = createCommonjsModule(function (module, exports) {
|
|
8212
|
+
|
|
8213
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8214
|
+
|
|
8215
|
+
function _typeof(obj) {
|
|
8216
|
+
"@babel/helpers - typeof";
|
|
8217
|
+
|
|
8218
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
8219
|
+
_typeof = function (obj) {
|
|
8220
|
+
return typeof obj;
|
|
8221
|
+
};
|
|
8222
|
+
} else {
|
|
8223
|
+
_typeof = function (obj) {
|
|
8224
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
8225
|
+
};
|
|
8226
|
+
}
|
|
8227
|
+
|
|
8228
|
+
return _typeof(obj);
|
|
8229
|
+
}
|
|
8230
|
+
|
|
8231
|
+
var V3_URL = 'https://js.stripe.com/v3';
|
|
8232
|
+
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
8233
|
+
var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
|
|
8234
|
+
var findScript = function findScript() {
|
|
8235
|
+
var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
|
|
8236
|
+
|
|
8237
|
+
for (var i = 0; i < scripts.length; i++) {
|
|
8238
|
+
var script = scripts[i];
|
|
8239
|
+
|
|
8240
|
+
if (!V3_URL_REGEX.test(script.src)) {
|
|
8241
|
+
continue;
|
|
8242
|
+
}
|
|
8243
|
+
|
|
8244
|
+
return script;
|
|
8245
|
+
}
|
|
8246
|
+
|
|
8247
|
+
return null;
|
|
8248
|
+
};
|
|
8249
|
+
|
|
8250
|
+
var injectScript = function injectScript(params) {
|
|
8251
|
+
var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
|
|
8252
|
+
var script = document.createElement('script');
|
|
8253
|
+
script.src = "".concat(V3_URL).concat(queryString);
|
|
8254
|
+
var headOrBody = document.head || document.body;
|
|
8255
|
+
|
|
8256
|
+
if (!headOrBody) {
|
|
8257
|
+
throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
|
|
8258
|
+
}
|
|
8259
|
+
|
|
8260
|
+
headOrBody.appendChild(script);
|
|
8261
|
+
return script;
|
|
8262
|
+
};
|
|
8263
|
+
|
|
8264
|
+
var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
8265
|
+
if (!stripe || !stripe._registerWrapper) {
|
|
8266
|
+
return;
|
|
8267
|
+
}
|
|
8268
|
+
|
|
8269
|
+
stripe._registerWrapper({
|
|
8270
|
+
name: 'stripe-js',
|
|
8271
|
+
version: "1.21.1",
|
|
8272
|
+
startTime: startTime
|
|
8273
|
+
});
|
|
8274
|
+
};
|
|
8275
|
+
|
|
8276
|
+
var stripePromise = null;
|
|
8277
|
+
var loadScript = function loadScript(params) {
|
|
8278
|
+
// Ensure that we only attempt to load Stripe.js at most once
|
|
8279
|
+
if (stripePromise !== null) {
|
|
8280
|
+
return stripePromise;
|
|
8281
|
+
}
|
|
8282
|
+
|
|
8283
|
+
stripePromise = new Promise(function (resolve, reject) {
|
|
8284
|
+
if (typeof window === 'undefined') {
|
|
8285
|
+
// Resolve to null when imported server side. This makes the module
|
|
8286
|
+
// safe to import in an isomorphic code base.
|
|
8287
|
+
resolve(null);
|
|
8288
|
+
return;
|
|
8289
|
+
}
|
|
8290
|
+
|
|
8291
|
+
if (window.Stripe && params) {
|
|
8292
|
+
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
8293
|
+
}
|
|
8294
|
+
|
|
8295
|
+
if (window.Stripe) {
|
|
8296
|
+
resolve(window.Stripe);
|
|
8297
|
+
return;
|
|
8298
|
+
}
|
|
8299
|
+
|
|
8300
|
+
try {
|
|
8301
|
+
var script = findScript();
|
|
8302
|
+
|
|
8303
|
+
if (script && params) {
|
|
8304
|
+
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
8305
|
+
} else if (!script) {
|
|
8306
|
+
script = injectScript(params);
|
|
8307
|
+
}
|
|
8308
|
+
|
|
8309
|
+
script.addEventListener('load', function () {
|
|
8310
|
+
if (window.Stripe) {
|
|
8311
|
+
resolve(window.Stripe);
|
|
8312
|
+
} else {
|
|
8313
|
+
reject(new Error('Stripe.js not available'));
|
|
8314
|
+
}
|
|
8315
|
+
});
|
|
8316
|
+
script.addEventListener('error', function () {
|
|
8317
|
+
reject(new Error('Failed to load Stripe.js'));
|
|
8318
|
+
});
|
|
8319
|
+
} catch (error) {
|
|
8320
|
+
reject(error);
|
|
8321
|
+
return;
|
|
8322
|
+
}
|
|
8323
|
+
});
|
|
8324
|
+
return stripePromise;
|
|
8325
|
+
};
|
|
8326
|
+
var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
8327
|
+
if (maybeStripe === null) {
|
|
8328
|
+
return null;
|
|
8329
|
+
}
|
|
8330
|
+
|
|
8331
|
+
var stripe = maybeStripe.apply(undefined, args);
|
|
8332
|
+
registerWrapper(stripe, startTime);
|
|
8333
|
+
return stripe;
|
|
8334
|
+
};
|
|
8335
|
+
var validateLoadParams = function validateLoadParams(params) {
|
|
8336
|
+
var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
|
|
8337
|
+
|
|
8338
|
+
if (params === null || _typeof(params) !== 'object') {
|
|
8339
|
+
throw new Error(errorMessage);
|
|
8340
|
+
}
|
|
8341
|
+
|
|
8342
|
+
if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') {
|
|
8343
|
+
return params;
|
|
8344
|
+
}
|
|
8345
|
+
|
|
8346
|
+
throw new Error(errorMessage);
|
|
8347
|
+
};
|
|
8348
|
+
|
|
8349
|
+
var loadParams;
|
|
8350
|
+
var loadStripeCalled = false;
|
|
8351
|
+
var loadStripe = function loadStripe() {
|
|
8352
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8353
|
+
args[_key] = arguments[_key];
|
|
8354
|
+
}
|
|
8355
|
+
|
|
8356
|
+
loadStripeCalled = true;
|
|
8357
|
+
var startTime = Date.now();
|
|
8358
|
+
return loadScript(loadParams).then(function (maybeStripe) {
|
|
8359
|
+
return initStripe(maybeStripe, args, startTime);
|
|
8360
|
+
});
|
|
8361
|
+
};
|
|
8362
|
+
|
|
8363
|
+
loadStripe.setLoadParameters = function (params) {
|
|
8364
|
+
if (loadStripeCalled) {
|
|
8365
|
+
throw new Error('You cannot change load parameters after calling loadStripe');
|
|
8366
|
+
}
|
|
8367
|
+
|
|
8368
|
+
loadParams = validateLoadParams(params);
|
|
8369
|
+
};
|
|
8370
|
+
|
|
8371
|
+
exports.loadStripe = loadStripe;
|
|
8372
|
+
});
|
|
8373
|
+
|
|
8374
|
+
unwrapExports(pure$1);
|
|
8375
|
+
pure$1.loadStripe;
|
|
8376
|
+
|
|
8377
|
+
var pure = pure$1;
|
|
8378
|
+
var pure_1 = pure.loadStripe;
|
|
8379
|
+
|
|
8170
8380
|
/**
|
|
8171
8381
|
* @typedef {Object} OptionsType
|
|
8172
8382
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -8236,8 +8446,15 @@ const initPaywalls = () => {
|
|
|
8236
8446
|
}
|
|
8237
8447
|
};
|
|
8238
8448
|
const loadPaymentSDKs = () => {
|
|
8239
|
-
//
|
|
8240
|
-
|
|
8449
|
+
// Lazy load stripe's SDK
|
|
8450
|
+
const {
|
|
8451
|
+
whenUserReady
|
|
8452
|
+
} = usePelcro.getStore();
|
|
8453
|
+
whenUserReady(() => {
|
|
8454
|
+
if (!window.Stripe) {
|
|
8455
|
+
pure_1(window.Pelcro.environment.stripe);
|
|
8456
|
+
}
|
|
8457
|
+
}); // Load PayPal SDK's
|
|
8241
8458
|
|
|
8242
8459
|
const supportsPaypal = Boolean(window.Pelcro.site.read().braintree_tokenization);
|
|
8243
8460
|
|
|
@@ -8831,6 +9048,7 @@ const GET_STATES_SUCCESS = "GET_STATES_SUCCESS";
|
|
|
8831
9048
|
const GET_STATES_FETCH = "GET_STATES_FETCH";
|
|
8832
9049
|
const HANDLE_SUBMIT = "HANDLE_SUBMIT";
|
|
8833
9050
|
const SET_UPDATED_PRICE = "SET_UPDATED_PRICE";
|
|
9051
|
+
const SET_TAX_AMOUNT = "SET_TAX_AMOUNT";
|
|
8834
9052
|
const SET_CAN_MAKE_PAYMENT = "SET_CAN_MAKE_PAYMENT";
|
|
8835
9053
|
const SET_PAYMENT_REQUEST = "SET_PAYMENT_REQUEST";
|
|
8836
9054
|
const INIT_CONTAINER = "INIT_CONTAINER";
|
|
@@ -8859,6 +9077,9 @@ const SET_IMAGE_SRC = "SET_IMAGE_SRC";
|
|
|
8859
9077
|
const PASSWORD_CHANGE_SUCCESS = "PASSWORD_CHANGE_SUCCESS";
|
|
8860
9078
|
const SELECT_PAYMENT_METHOD = "SELECT_PAYMENT_METHOD";
|
|
8861
9079
|
const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
|
|
9080
|
+
const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
|
|
9081
|
+
const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
|
|
9082
|
+
const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
|
|
8862
9083
|
|
|
8863
9084
|
/**
|
|
8864
9085
|
* Extracts error message from the response error object
|
|
@@ -8920,7 +9141,7 @@ const debounce = (func, waitTime) => {
|
|
|
8920
9141
|
};
|
|
8921
9142
|
};
|
|
8922
9143
|
|
|
8923
|
-
const initialState$
|
|
9144
|
+
const initialState$f = {
|
|
8924
9145
|
email: "",
|
|
8925
9146
|
password: "",
|
|
8926
9147
|
emailError: null,
|
|
@@ -8931,10 +9152,10 @@ const initialState$e = {
|
|
|
8931
9152
|
content: ""
|
|
8932
9153
|
}
|
|
8933
9154
|
};
|
|
8934
|
-
const store$
|
|
9155
|
+
const store$f = /*#__PURE__*/createContext(initialState$f);
|
|
8935
9156
|
const {
|
|
8936
|
-
Provider: Provider$
|
|
8937
|
-
} = store$
|
|
9157
|
+
Provider: Provider$f
|
|
9158
|
+
} = store$f;
|
|
8938
9159
|
|
|
8939
9160
|
const LoginContainer = ({
|
|
8940
9161
|
style,
|
|
@@ -9041,7 +9262,7 @@ const LoginContainer = ({
|
|
|
9041
9262
|
});
|
|
9042
9263
|
|
|
9043
9264
|
case RESET_LOGIN_FORM:
|
|
9044
|
-
return initialState$
|
|
9265
|
+
return initialState$f;
|
|
9045
9266
|
|
|
9046
9267
|
case DISABLE_LOGIN_BUTTON:
|
|
9047
9268
|
return lib_7({ ...state,
|
|
@@ -9059,12 +9280,12 @@ const LoginContainer = ({
|
|
|
9059
9280
|
default:
|
|
9060
9281
|
return state;
|
|
9061
9282
|
}
|
|
9062
|
-
}, initialState$
|
|
9283
|
+
}, initialState$f);
|
|
9063
9284
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9064
9285
|
style: { ...style
|
|
9065
9286
|
},
|
|
9066
9287
|
className: `pelcro-container pelcro-login-container ${className}`
|
|
9067
|
-
}, /*#__PURE__*/React__default.createElement(Provider$
|
|
9288
|
+
}, /*#__PURE__*/React__default.createElement(Provider$f, {
|
|
9068
9289
|
value: {
|
|
9069
9290
|
state,
|
|
9070
9291
|
dispatch
|
|
@@ -9072,12 +9293,12 @@ const LoginContainer = ({
|
|
|
9072
9293
|
}, children.length ? children.map((child, i) => {
|
|
9073
9294
|
if (child) {
|
|
9074
9295
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
9075
|
-
store: store$
|
|
9296
|
+
store: store$f,
|
|
9076
9297
|
key: i
|
|
9077
9298
|
});
|
|
9078
9299
|
}
|
|
9079
9300
|
}) : /*#__PURE__*/React__default.cloneElement(children, {
|
|
9080
|
-
store: store$
|
|
9301
|
+
store: store$f
|
|
9081
9302
|
})));
|
|
9082
9303
|
};
|
|
9083
9304
|
|
|
@@ -9322,7 +9543,7 @@ const LoginButton = ({
|
|
|
9322
9543
|
buttonDisabled
|
|
9323
9544
|
},
|
|
9324
9545
|
dispatch
|
|
9325
|
-
} = useContext(store$
|
|
9546
|
+
} = useContext(store$f);
|
|
9326
9547
|
const {
|
|
9327
9548
|
t
|
|
9328
9549
|
} = useTranslation("login");
|
|
@@ -9343,23 +9564,23 @@ const LoginButton = ({
|
|
|
9343
9564
|
};
|
|
9344
9565
|
|
|
9345
9566
|
const LoginEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
|
|
9346
|
-
store: store$
|
|
9567
|
+
store: store$f
|
|
9347
9568
|
}, props));
|
|
9348
9569
|
|
|
9349
9570
|
const LoginPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
|
|
9350
|
-
store: store$
|
|
9571
|
+
store: store$f
|
|
9351
9572
|
}, props));
|
|
9352
9573
|
|
|
9353
|
-
var _path$
|
|
9574
|
+
var _path$m;
|
|
9354
9575
|
|
|
9355
|
-
function _extends$
|
|
9576
|
+
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); }
|
|
9356
9577
|
|
|
9357
9578
|
function SvgCheck(props) {
|
|
9358
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
9579
|
+
return /*#__PURE__*/React.createElement("svg", _extends$o({
|
|
9359
9580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9360
9581
|
fill: "currentColor",
|
|
9361
9582
|
viewBox: "0 0 20 20"
|
|
9362
|
-
}, props), _path$
|
|
9583
|
+
}, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
|
|
9363
9584
|
fillRule: "evenodd",
|
|
9364
9585
|
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",
|
|
9365
9586
|
clipRule: "evenodd"
|
|
@@ -9424,7 +9645,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
|
|
|
9424
9645
|
var FacebookLogin = unwrapExports(facebookLoginRenderProps);
|
|
9425
9646
|
facebookLoginRenderProps.FacebookLogin;
|
|
9426
9647
|
|
|
9427
|
-
const initialState$
|
|
9648
|
+
const initialState$e = {
|
|
9428
9649
|
email: "",
|
|
9429
9650
|
password: "",
|
|
9430
9651
|
emailError: null,
|
|
@@ -9441,10 +9662,10 @@ const initialState$d = {
|
|
|
9441
9662
|
content: ""
|
|
9442
9663
|
}
|
|
9443
9664
|
};
|
|
9444
|
-
const store$
|
|
9665
|
+
const store$e = /*#__PURE__*/createContext(initialState$e);
|
|
9445
9666
|
const {
|
|
9446
|
-
Provider: Provider$
|
|
9447
|
-
} = store$
|
|
9667
|
+
Provider: Provider$e
|
|
9668
|
+
} = store$e;
|
|
9448
9669
|
|
|
9449
9670
|
const RegisterContainer = ({
|
|
9450
9671
|
style,
|
|
@@ -9609,7 +9830,7 @@ const RegisterContainer = ({
|
|
|
9609
9830
|
});
|
|
9610
9831
|
|
|
9611
9832
|
case RESET_LOGIN_FORM:
|
|
9612
|
-
return initialState$
|
|
9833
|
+
return initialState$e;
|
|
9613
9834
|
|
|
9614
9835
|
case DISABLE_REGISTRATION_BUTTON:
|
|
9615
9836
|
return lib_7({ ...state,
|
|
@@ -9627,12 +9848,12 @@ const RegisterContainer = ({
|
|
|
9627
9848
|
default:
|
|
9628
9849
|
return state;
|
|
9629
9850
|
}
|
|
9630
|
-
}, initialState$
|
|
9851
|
+
}, initialState$e);
|
|
9631
9852
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9632
9853
|
style: { ...style
|
|
9633
9854
|
},
|
|
9634
9855
|
className: `pelcro-container pelcro-register-container ${className}`
|
|
9635
|
-
}, /*#__PURE__*/React__default.createElement(Provider$
|
|
9856
|
+
}, /*#__PURE__*/React__default.createElement(Provider$e, {
|
|
9636
9857
|
value: {
|
|
9637
9858
|
state,
|
|
9638
9859
|
dispatch
|
|
@@ -9640,24 +9861,24 @@ const RegisterContainer = ({
|
|
|
9640
9861
|
}, children.length ? children.map((child, i) => {
|
|
9641
9862
|
if (child) {
|
|
9642
9863
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
9643
|
-
store: store$
|
|
9864
|
+
store: store$e,
|
|
9644
9865
|
key: i
|
|
9645
9866
|
});
|
|
9646
9867
|
}
|
|
9647
9868
|
}) : /*#__PURE__*/React__default.cloneElement(children, {
|
|
9648
|
-
store: store$
|
|
9869
|
+
store: store$e
|
|
9649
9870
|
})));
|
|
9650
9871
|
};
|
|
9651
9872
|
|
|
9652
|
-
var _path$
|
|
9873
|
+
var _path$l;
|
|
9653
9874
|
|
|
9654
|
-
function _extends$
|
|
9875
|
+
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); }
|
|
9655
9876
|
|
|
9656
9877
|
function SvgFacebookLogo(props) {
|
|
9657
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
9878
|
+
return /*#__PURE__*/React.createElement("svg", _extends$n({
|
|
9658
9879
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9659
9880
|
viewBox: "88.428 12.828 107.543 207.085"
|
|
9660
|
-
}, props), _path$
|
|
9881
|
+
}, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
|
|
9661
9882
|
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",
|
|
9662
9883
|
fill: "#3c5a9a"
|
|
9663
9884
|
})));
|
|
@@ -9674,10 +9895,10 @@ const FacebookLoginButton = ({
|
|
|
9674
9895
|
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;
|
|
9675
9896
|
const {
|
|
9676
9897
|
dispatch: loginDispatch
|
|
9677
|
-
} = useContext(store$
|
|
9898
|
+
} = useContext(store$f);
|
|
9678
9899
|
const {
|
|
9679
9900
|
dispatch: registerDispatch
|
|
9680
|
-
} = useContext(store$
|
|
9901
|
+
} = useContext(store$e);
|
|
9681
9902
|
|
|
9682
9903
|
const onSuccess = facebookUser => {
|
|
9683
9904
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
@@ -9730,15 +9951,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
|
|
|
9730
9951
|
unwrapExports(googleLogin);
|
|
9731
9952
|
var googleLogin_1 = googleLogin.GoogleLogin;
|
|
9732
9953
|
|
|
9733
|
-
var _path$
|
|
9954
|
+
var _path$k, _path2$2, _path3$1, _path4;
|
|
9734
9955
|
|
|
9735
|
-
function _extends$
|
|
9956
|
+
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); }
|
|
9736
9957
|
|
|
9737
9958
|
function SvgGoogleLogo(props) {
|
|
9738
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
9959
|
+
return /*#__PURE__*/React.createElement("svg", _extends$m({
|
|
9739
9960
|
viewBox: "0 0 24 24",
|
|
9740
9961
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9741
|
-
}, props), _path$
|
|
9962
|
+
}, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
|
|
9742
9963
|
fill: "#4285F4",
|
|
9743
9964
|
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"
|
|
9744
9965
|
})), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
|
|
@@ -9764,10 +9985,10 @@ const GoogleLoginButton = ({
|
|
|
9764
9985
|
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;
|
|
9765
9986
|
const {
|
|
9766
9987
|
dispatch: loginDispatch
|
|
9767
|
-
} = useContext(store$
|
|
9988
|
+
} = useContext(store$f);
|
|
9768
9989
|
const {
|
|
9769
9990
|
dispatch: registerDispatch
|
|
9770
|
-
} = useContext(store$
|
|
9991
|
+
} = useContext(store$e);
|
|
9771
9992
|
|
|
9772
9993
|
const onSuccess = response => {
|
|
9773
9994
|
var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
|
|
@@ -9872,15 +10093,15 @@ function LoginView(props) {
|
|
|
9872
10093
|
}, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
|
|
9873
10094
|
}
|
|
9874
10095
|
|
|
9875
|
-
var _path$
|
|
10096
|
+
var _path$j, _path2$1, _path3;
|
|
9876
10097
|
|
|
9877
|
-
function _extends$
|
|
10098
|
+
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); }
|
|
9878
10099
|
|
|
9879
10100
|
function SvgPelcroAuthorship(props) {
|
|
9880
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
10101
|
+
return /*#__PURE__*/React.createElement("svg", _extends$l({
|
|
9881
10102
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9882
10103
|
viewBox: "0 -80.652 497.072 179.991"
|
|
9883
|
-
}, props), _path$
|
|
10104
|
+
}, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
|
|
9884
10105
|
fill: "none",
|
|
9885
10106
|
stroke: "#4a4a4a",
|
|
9886
10107
|
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"
|
|
@@ -10027,11 +10248,11 @@ function LoginModal({
|
|
|
10027
10248
|
LoginModal.viewId = "login";
|
|
10028
10249
|
|
|
10029
10250
|
const RegisterEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
|
|
10030
|
-
store: store$
|
|
10251
|
+
store: store$e
|
|
10031
10252
|
}, props));
|
|
10032
10253
|
|
|
10033
10254
|
const RegisterPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
|
|
10034
|
-
store: store$
|
|
10255
|
+
store: store$e
|
|
10035
10256
|
}, props));
|
|
10036
10257
|
|
|
10037
10258
|
const RegisterButton = ({
|
|
@@ -10048,7 +10269,7 @@ const RegisterButton = ({
|
|
|
10048
10269
|
buttonDisabled
|
|
10049
10270
|
},
|
|
10050
10271
|
dispatch
|
|
10051
|
-
} = useContext(store$
|
|
10272
|
+
} = useContext(store$e);
|
|
10052
10273
|
const {
|
|
10053
10274
|
t
|
|
10054
10275
|
} = useTranslation("register");
|
|
@@ -10183,7 +10404,7 @@ function FirstName({
|
|
|
10183
10404
|
}
|
|
10184
10405
|
|
|
10185
10406
|
const RegisterFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
|
|
10186
|
-
store: store$
|
|
10407
|
+
store: store$e
|
|
10187
10408
|
}, props));
|
|
10188
10409
|
|
|
10189
10410
|
function LastName({
|
|
@@ -10214,7 +10435,7 @@ function LastName({
|
|
|
10214
10435
|
}
|
|
10215
10436
|
|
|
10216
10437
|
const RegisterLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
|
|
10217
|
-
store: store$
|
|
10438
|
+
store: store$e
|
|
10218
10439
|
}, props));
|
|
10219
10440
|
|
|
10220
10441
|
/**
|
|
@@ -10318,7 +10539,7 @@ function TextInput({
|
|
|
10318
10539
|
|
|
10319
10540
|
const RegisterTextInput = props => {
|
|
10320
10541
|
return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
|
|
10321
|
-
store: store$
|
|
10542
|
+
store: store$e
|
|
10322
10543
|
}));
|
|
10323
10544
|
};
|
|
10324
10545
|
|
|
@@ -12283,13 +12504,14 @@ class PaypalGateWay {
|
|
|
12283
12504
|
* @property {unknown} canMakePayment
|
|
12284
12505
|
* @property {unknown} paymentRequest
|
|
12285
12506
|
* @property {number} updatedPrice
|
|
12507
|
+
* @property {number} taxAmount
|
|
12286
12508
|
* @property {object} currentPlan
|
|
12287
12509
|
* @property {object} alert
|
|
12288
12510
|
*/
|
|
12289
12511
|
|
|
12290
12512
|
/** @type {PaymentStateType} */
|
|
12291
12513
|
|
|
12292
|
-
const initialState$
|
|
12514
|
+
const initialState$d = {
|
|
12293
12515
|
disableSubmit: false,
|
|
12294
12516
|
isLoading: false,
|
|
12295
12517
|
disableCouponButton: false,
|
|
@@ -12301,16 +12523,17 @@ const initialState$c = {
|
|
|
12301
12523
|
canMakePayment: false,
|
|
12302
12524
|
paymentRequest: null,
|
|
12303
12525
|
updatedPrice: null,
|
|
12526
|
+
taxAmount: null,
|
|
12304
12527
|
currentPlan: null,
|
|
12305
12528
|
alert: {
|
|
12306
12529
|
type: "error",
|
|
12307
12530
|
content: ""
|
|
12308
12531
|
}
|
|
12309
12532
|
};
|
|
12310
|
-
const store$
|
|
12533
|
+
const store$d = /*#__PURE__*/createContext(initialState$d);
|
|
12311
12534
|
const {
|
|
12312
|
-
Provider: Provider$
|
|
12313
|
-
} = store$
|
|
12535
|
+
Provider: Provider$d
|
|
12536
|
+
} = store$d;
|
|
12314
12537
|
|
|
12315
12538
|
const PaymentMethodContainerWithoutStripe = ({
|
|
12316
12539
|
style,
|
|
@@ -12351,6 +12574,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12351
12574
|
dispatch({
|
|
12352
12575
|
type: INIT_CONTAINER
|
|
12353
12576
|
});
|
|
12577
|
+
updateTotalAmountWithTax();
|
|
12354
12578
|
}, []);
|
|
12355
12579
|
|
|
12356
12580
|
const initPaymentRequest = (state, dispatch) => {
|
|
@@ -12417,6 +12641,45 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12417
12641
|
console.log("Google Pay/Apple pay isn't available in this country");
|
|
12418
12642
|
}
|
|
12419
12643
|
};
|
|
12644
|
+
/**
|
|
12645
|
+
* Updates the total amount after adding taxes only if site taxes are enabled
|
|
12646
|
+
*/
|
|
12647
|
+
|
|
12648
|
+
|
|
12649
|
+
const updateTotalAmountWithTax = () => {
|
|
12650
|
+
var _window$Pelcro$site$r;
|
|
12651
|
+
|
|
12652
|
+
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;
|
|
12653
|
+
|
|
12654
|
+
if (taxesEnabled && type === "createPayment") {
|
|
12655
|
+
dispatch({
|
|
12656
|
+
type: DISABLE_SUBMIT,
|
|
12657
|
+
payload: true
|
|
12658
|
+
});
|
|
12659
|
+
resolveTaxCalculation().then(res => {
|
|
12660
|
+
if (res) {
|
|
12661
|
+
dispatch({
|
|
12662
|
+
type: SET_TAX_AMOUNT,
|
|
12663
|
+
payload: res.taxAmount
|
|
12664
|
+
});
|
|
12665
|
+
dispatch({
|
|
12666
|
+
type: SET_UPDATED_PRICE,
|
|
12667
|
+
payload: res.totalAmountWithTax
|
|
12668
|
+
});
|
|
12669
|
+
dispatch({
|
|
12670
|
+
type: UPDATE_PAYMENT_REQUEST
|
|
12671
|
+
});
|
|
12672
|
+
}
|
|
12673
|
+
}).catch(error => {
|
|
12674
|
+
handlePaymentError(error);
|
|
12675
|
+
}).finally(() => {
|
|
12676
|
+
dispatch({
|
|
12677
|
+
type: DISABLE_SUBMIT,
|
|
12678
|
+
payload: false
|
|
12679
|
+
});
|
|
12680
|
+
});
|
|
12681
|
+
}
|
|
12682
|
+
};
|
|
12420
12683
|
|
|
12421
12684
|
const onApplyCouponCode = (state, dispatch) => {
|
|
12422
12685
|
const {
|
|
@@ -12443,6 +12706,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12443
12706
|
});
|
|
12444
12707
|
}
|
|
12445
12708
|
|
|
12709
|
+
dispatch({
|
|
12710
|
+
type: SET_COUPON_ERROR,
|
|
12711
|
+
payload: ""
|
|
12712
|
+
});
|
|
12446
12713
|
dispatch({
|
|
12447
12714
|
type: SHOW_ALERT,
|
|
12448
12715
|
payload: {
|
|
@@ -12459,7 +12726,11 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12459
12726
|
payload: `${(_res$data$coupon = res.data.coupon) === null || _res$data$coupon === void 0 ? void 0 : _res$data$coupon.percent_off}%`
|
|
12460
12727
|
});
|
|
12461
12728
|
dispatch({
|
|
12462
|
-
type:
|
|
12729
|
+
type: SET_TAX_AMOUNT,
|
|
12730
|
+
payload: res.data.taxes
|
|
12731
|
+
});
|
|
12732
|
+
dispatch({
|
|
12733
|
+
type: SET_UPDATED_PRICE,
|
|
12463
12734
|
payload: res.data.total
|
|
12464
12735
|
});
|
|
12465
12736
|
dispatch({
|
|
@@ -12467,6 +12738,29 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12467
12738
|
});
|
|
12468
12739
|
};
|
|
12469
12740
|
|
|
12741
|
+
if ((couponCode === null || couponCode === void 0 ? void 0 : couponCode.trim()) === "") {
|
|
12742
|
+
dispatch({
|
|
12743
|
+
type: SET_COUPON,
|
|
12744
|
+
payload: null
|
|
12745
|
+
});
|
|
12746
|
+
dispatch({
|
|
12747
|
+
type: SET_PERCENT_OFF,
|
|
12748
|
+
payload: ""
|
|
12749
|
+
});
|
|
12750
|
+
dispatch({
|
|
12751
|
+
type: SET_UPDATED_PRICE,
|
|
12752
|
+
payload: null
|
|
12753
|
+
});
|
|
12754
|
+
dispatch({
|
|
12755
|
+
type: SET_TAX_AMOUNT,
|
|
12756
|
+
payload: null
|
|
12757
|
+
});
|
|
12758
|
+
dispatch({
|
|
12759
|
+
type: UPDATE_PAYMENT_REQUEST
|
|
12760
|
+
});
|
|
12761
|
+
updateTotalAmountWithTax();
|
|
12762
|
+
}
|
|
12763
|
+
|
|
12470
12764
|
if (couponCode !== null && couponCode !== void 0 && couponCode.trim()) {
|
|
12471
12765
|
dispatch({
|
|
12472
12766
|
type: DISABLE_COUPON_BUTTON,
|
|
@@ -12853,16 +13147,20 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12853
13147
|
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();
|
|
12854
13148
|
|
|
12855
13149
|
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) {
|
|
12856
|
-
return resolveTaxCalculation().then(
|
|
12857
|
-
|
|
12858
|
-
error
|
|
12859
|
-
}) => {
|
|
12860
|
-
if (error) {
|
|
12861
|
-
return handlePaymentError(error);
|
|
12862
|
-
}
|
|
13150
|
+
return resolveTaxCalculation().then(res => {
|
|
13151
|
+
var _res$totalAmountWithT;
|
|
12863
13152
|
|
|
12864
|
-
|
|
12865
|
-
|
|
13153
|
+
return generate3DSecureSource(source, (_res$totalAmountWithT = res === null || res === void 0 ? void 0 : res.totalAmountWithTax) !== null && _res$totalAmountWithT !== void 0 ? _res$totalAmountWithT : totalAmount).then(({
|
|
13154
|
+
source,
|
|
13155
|
+
error
|
|
13156
|
+
}) => {
|
|
13157
|
+
if (error) {
|
|
13158
|
+
return handlePaymentError(error);
|
|
13159
|
+
}
|
|
13160
|
+
|
|
13161
|
+
toggleAuthenticationPendingView(true, source);
|
|
13162
|
+
});
|
|
13163
|
+
});
|
|
12866
13164
|
}
|
|
12867
13165
|
|
|
12868
13166
|
return handlePayment(source);
|
|
@@ -12871,15 +13169,15 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12871
13169
|
});
|
|
12872
13170
|
};
|
|
12873
13171
|
/**
|
|
12874
|
-
* Resolves with the total
|
|
13172
|
+
* Resolves with the total & tax amount incase taxes enabled by site
|
|
12875
13173
|
* @return {Promise}
|
|
12876
13174
|
*/
|
|
12877
13175
|
|
|
12878
13176
|
|
|
12879
13177
|
const resolveTaxCalculation = () => {
|
|
12880
|
-
var _window$Pelcro$site$
|
|
13178
|
+
var _window$Pelcro$site$r2;
|
|
12881
13179
|
|
|
12882
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
13180
|
+
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;
|
|
12883
13181
|
return new Promise((resolve, reject) => {
|
|
12884
13182
|
// resolve early if taxes isn't enabled
|
|
12885
13183
|
if (!taxesEnabled) {
|
|
@@ -12892,14 +13190,18 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12892
13190
|
coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
|
|
12893
13191
|
address_id: selectedAddressId
|
|
12894
13192
|
}, (error, res) => {
|
|
12895
|
-
var _res$data;
|
|
13193
|
+
var _res$data, _res$data2;
|
|
12896
13194
|
|
|
12897
13195
|
if (error) {
|
|
12898
13196
|
return reject(error);
|
|
12899
13197
|
}
|
|
12900
13198
|
|
|
12901
|
-
const
|
|
12902
|
-
|
|
13199
|
+
const taxAmount = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.taxes;
|
|
13200
|
+
const totalAmountWithTax = (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.total;
|
|
13201
|
+
resolve({
|
|
13202
|
+
totalAmountWithTax,
|
|
13203
|
+
taxAmount
|
|
13204
|
+
});
|
|
12903
13205
|
});
|
|
12904
13206
|
});
|
|
12905
13207
|
};
|
|
@@ -12954,13 +13256,13 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
12954
13256
|
const handlePaymentError = error => {
|
|
12955
13257
|
if (error.type === "validation_error" && // Subscription creation & renewal
|
|
12956
13258
|
type === "createPayment") {
|
|
12957
|
-
var _state$
|
|
13259
|
+
var _state$couponObject;
|
|
12958
13260
|
|
|
12959
13261
|
const {
|
|
12960
13262
|
updatedPrice
|
|
12961
13263
|
} = state; // When price is 0, we allow submitting without card info
|
|
12962
13264
|
|
|
12963
|
-
if (updatedPrice === 0 && ((_state$
|
|
13265
|
+
if (updatedPrice === 0 && ((_state$couponObject = state.couponObject) === null || _state$couponObject === void 0 ? void 0 : _state$couponObject.duration) === "forever") {
|
|
12964
13266
|
return subscribe({}, state, dispatch);
|
|
12965
13267
|
}
|
|
12966
13268
|
}
|
|
@@ -13088,6 +13390,11 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13088
13390
|
updatedPrice: action.payload
|
|
13089
13391
|
});
|
|
13090
13392
|
|
|
13393
|
+
case SET_TAX_AMOUNT:
|
|
13394
|
+
return lib_7({ ...state,
|
|
13395
|
+
taxAmount: action.payload
|
|
13396
|
+
});
|
|
13397
|
+
|
|
13091
13398
|
case SET_CAN_MAKE_PAYMENT:
|
|
13092
13399
|
return lib_7({ ...state,
|
|
13093
13400
|
canMakePayment: action.payload
|
|
@@ -13105,7 +13412,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13105
13412
|
|
|
13106
13413
|
case SET_COUPON:
|
|
13107
13414
|
return lib_7({ ...state,
|
|
13108
|
-
|
|
13415
|
+
couponObject: action.payload
|
|
13109
13416
|
});
|
|
13110
13417
|
|
|
13111
13418
|
case SET_COUPON_ERROR:
|
|
@@ -13131,21 +13438,21 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13131
13438
|
default:
|
|
13132
13439
|
return state;
|
|
13133
13440
|
}
|
|
13134
|
-
}, initialState$
|
|
13441
|
+
}, initialState$d);
|
|
13135
13442
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13136
13443
|
style: { ...style
|
|
13137
13444
|
},
|
|
13138
13445
|
className: `pelcro-container pelcro-payment-container ${className}`
|
|
13139
|
-
}, /*#__PURE__*/React__default.createElement(Provider$
|
|
13446
|
+
}, /*#__PURE__*/React__default.createElement(Provider$d, {
|
|
13140
13447
|
value: {
|
|
13141
13448
|
state,
|
|
13142
13449
|
dispatch
|
|
13143
13450
|
}
|
|
13144
13451
|
}, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
|
|
13145
|
-
store: store$
|
|
13452
|
+
store: store$d,
|
|
13146
13453
|
key: i
|
|
13147
13454
|
})) : /*#__PURE__*/React__default.cloneElement(children, {
|
|
13148
|
-
store: store$
|
|
13455
|
+
store: store$d
|
|
13149
13456
|
})));
|
|
13150
13457
|
};
|
|
13151
13458
|
|
|
@@ -13158,7 +13465,7 @@ const PaymentMethodContainer = props => {
|
|
|
13158
13465
|
stripeAccount: window.Pelcro.site.read().account_id,
|
|
13159
13466
|
locale: getCanonicalLocaleFormat(window.Pelcro.site.read().default_locale)
|
|
13160
13467
|
}, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
|
|
13161
|
-
store: store$
|
|
13468
|
+
store: store$d
|
|
13162
13469
|
}, props))));
|
|
13163
13470
|
}
|
|
13164
13471
|
|
|
@@ -13211,7 +13518,7 @@ const PelcroPaymentRequestButton = props => {
|
|
|
13211
13518
|
currentPlan,
|
|
13212
13519
|
updatedPrice
|
|
13213
13520
|
}
|
|
13214
|
-
} = useContext(store$
|
|
13521
|
+
} = useContext(store$d);
|
|
13215
13522
|
|
|
13216
13523
|
const updatePaymentRequest = () => {
|
|
13217
13524
|
// Make sure payment request is up to date, eg. user added a coupon code.
|
|
@@ -13264,9 +13571,10 @@ const DiscountedPrice = props => {
|
|
|
13264
13571
|
const {
|
|
13265
13572
|
state: {
|
|
13266
13573
|
updatedPrice,
|
|
13574
|
+
taxAmount,
|
|
13267
13575
|
percentOff
|
|
13268
13576
|
}
|
|
13269
|
-
} = useContext(store$
|
|
13577
|
+
} = useContext(store$d);
|
|
13270
13578
|
const {
|
|
13271
13579
|
default_locale
|
|
13272
13580
|
} = Pelcro.site.read();
|
|
@@ -13276,12 +13584,15 @@ const DiscountedPrice = props => {
|
|
|
13276
13584
|
} = usePelcro();
|
|
13277
13585
|
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;
|
|
13278
13586
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
13279
|
-
const
|
|
13587
|
+
const discountedPriceWithoutTax = updatedPrice - taxAmount;
|
|
13588
|
+
const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
|
|
13280
13589
|
|
|
13281
13590
|
if (percentOff) {
|
|
13282
13591
|
return /*#__PURE__*/React__default.createElement("div", Object.assign({
|
|
13283
|
-
className: "plc-
|
|
13284
|
-
}, props), "(-", percentOff, ") ",
|
|
13592
|
+
className: "plc-flex plc-justify-center plc-mt-2 pelcro-discount"
|
|
13593
|
+
}, props), "(-", percentOff, ")", " ", /*#__PURE__*/React__default.createElement("span", {
|
|
13594
|
+
className: "plc-font-bold pelcro-discounted-price"
|
|
13595
|
+
}, priceFormatted));
|
|
13285
13596
|
}
|
|
13286
13597
|
|
|
13287
13598
|
return "";
|
|
@@ -13306,7 +13617,7 @@ const SubmitPaymentMethod = ({
|
|
|
13306
13617
|
isLoading,
|
|
13307
13618
|
updatedPrice
|
|
13308
13619
|
}
|
|
13309
|
-
} = useContext(store$
|
|
13620
|
+
} = useContext(store$d);
|
|
13310
13621
|
const {
|
|
13311
13622
|
default_locale
|
|
13312
13623
|
} = Pelcro.site.read();
|
|
@@ -13330,17 +13641,17 @@ const SubmitPaymentMethod = ({
|
|
|
13330
13641
|
}, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
|
|
13331
13642
|
};
|
|
13332
13643
|
|
|
13333
|
-
var _path$
|
|
13644
|
+
var _path$i;
|
|
13334
13645
|
|
|
13335
|
-
function _extends$
|
|
13646
|
+
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); }
|
|
13336
13647
|
|
|
13337
13648
|
function SvgArrowLeft(props) {
|
|
13338
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
13649
|
+
return /*#__PURE__*/React.createElement("svg", _extends$k({
|
|
13339
13650
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13340
13651
|
fill: "none",
|
|
13341
13652
|
viewBox: "0 0 24 24",
|
|
13342
13653
|
stroke: "currentColor"
|
|
13343
|
-
}, props), _path$
|
|
13654
|
+
}, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
|
|
13344
13655
|
strokeLinecap: "round",
|
|
13345
13656
|
strokeLinejoin: "round",
|
|
13346
13657
|
strokeWidth: 2,
|
|
@@ -13359,7 +13670,7 @@ const ApplyCouponButton = ({
|
|
|
13359
13670
|
disableCouponButton
|
|
13360
13671
|
},
|
|
13361
13672
|
dispatch
|
|
13362
|
-
} = useContext(store$
|
|
13673
|
+
} = useContext(store$d);
|
|
13363
13674
|
const {
|
|
13364
13675
|
t
|
|
13365
13676
|
} = useTranslation("checkoutForm");
|
|
@@ -13393,7 +13704,7 @@ const CouponCodeField = props => {
|
|
|
13393
13704
|
couponCode,
|
|
13394
13705
|
couponError
|
|
13395
13706
|
}
|
|
13396
|
-
} = useContext(store$
|
|
13707
|
+
} = useContext(store$d);
|
|
13397
13708
|
|
|
13398
13709
|
const onCouponCodeChange = e => {
|
|
13399
13710
|
dispatch({
|
|
@@ -13411,6 +13722,7 @@ const CouponCodeField = props => {
|
|
|
13411
13722
|
|
|
13412
13723
|
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
13413
13724
|
className: "plc-h-12",
|
|
13725
|
+
wrapperClassName: "plc-mb-1",
|
|
13414
13726
|
errorClassName: "plc-h-12 sm:plc-h-8",
|
|
13415
13727
|
error: couponError,
|
|
13416
13728
|
"aria-label": t("labels.code"),
|
|
@@ -13421,17 +13733,17 @@ const CouponCodeField = props => {
|
|
|
13421
13733
|
}, props));
|
|
13422
13734
|
};
|
|
13423
13735
|
|
|
13424
|
-
var _path$
|
|
13736
|
+
var _path$h;
|
|
13425
13737
|
|
|
13426
|
-
function _extends$
|
|
13738
|
+
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); }
|
|
13427
13739
|
|
|
13428
13740
|
function SvgTicket(props) {
|
|
13429
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
13741
|
+
return /*#__PURE__*/React.createElement("svg", _extends$j({
|
|
13430
13742
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13431
13743
|
fill: "none",
|
|
13432
13744
|
viewBox: "0 0 24 24",
|
|
13433
13745
|
stroke: "currentColor"
|
|
13434
|
-
}, props), _path$
|
|
13746
|
+
}, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
|
|
13435
13747
|
strokeLinecap: "round",
|
|
13436
13748
|
strokeLinejoin: "round",
|
|
13437
13749
|
strokeWidth: 2,
|
|
@@ -13448,7 +13760,7 @@ const CouponCode = ({
|
|
|
13448
13760
|
state: {
|
|
13449
13761
|
enableCouponField
|
|
13450
13762
|
}
|
|
13451
|
-
} = useContext(store$
|
|
13763
|
+
} = useContext(store$d);
|
|
13452
13764
|
const {
|
|
13453
13765
|
t
|
|
13454
13766
|
} = useTranslation("checkoutForm");
|
|
@@ -13462,16 +13774,16 @@ const CouponCode = ({
|
|
|
13462
13774
|
};
|
|
13463
13775
|
|
|
13464
13776
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13465
|
-
className: "plc-
|
|
13777
|
+
className: "plc-mt-4"
|
|
13466
13778
|
}, /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
13467
|
-
className: "plc-text-base plc-text-gray-500",
|
|
13779
|
+
className: "plc-mb-2 plc-text-base plc-text-gray-500",
|
|
13468
13780
|
variant: "ghost",
|
|
13469
13781
|
icon: /*#__PURE__*/React__default.createElement(SvgTicket, {
|
|
13470
13782
|
className: "plc-w-5 plc-h-5 plc-mr-2"
|
|
13471
13783
|
}),
|
|
13472
13784
|
onClick: showCouponField
|
|
13473
13785
|
}, otherProps), !enableCouponField ? t("labels.addCode") : t("labels.hideCode")), enableCouponField && /*#__PURE__*/React__default.createElement("div", {
|
|
13474
|
-
className: "plc-flex plc-w-full plc-
|
|
13786
|
+
className: "plc-flex plc-w-full plc-mt-2 pelcro-apply-coupon-wrapper"
|
|
13475
13787
|
}, /*#__PURE__*/React__default.createElement(CouponCodeField, null), /*#__PURE__*/React__default.createElement(ApplyCouponButton, null)));
|
|
13476
13788
|
};
|
|
13477
13789
|
|
|
@@ -13705,7 +14017,7 @@ const PaypalSubscribeButton = props => {
|
|
|
13705
14017
|
const {
|
|
13706
14018
|
dispatch,
|
|
13707
14019
|
state
|
|
13708
|
-
} = useContext(store$
|
|
14020
|
+
} = useContext(store$d);
|
|
13709
14021
|
const {
|
|
13710
14022
|
product,
|
|
13711
14023
|
plan,
|
|
@@ -13790,16 +14102,16 @@ const BankRedirection = () => {
|
|
|
13790
14102
|
}));
|
|
13791
14103
|
};
|
|
13792
14104
|
|
|
13793
|
-
var _path$
|
|
14105
|
+
var _path$g;
|
|
13794
14106
|
|
|
13795
|
-
function _extends$
|
|
14107
|
+
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); }
|
|
13796
14108
|
|
|
13797
14109
|
function SvgLock(props) {
|
|
13798
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
14110
|
+
return /*#__PURE__*/React.createElement("svg", _extends$i({
|
|
13799
14111
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13800
14112
|
viewBox: "0 0 20 20",
|
|
13801
14113
|
fill: "currentColor"
|
|
13802
|
-
}, props), _path$
|
|
14114
|
+
}, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
|
|
13803
14115
|
fillRule: "evenodd",
|
|
13804
14116
|
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",
|
|
13805
14117
|
clipRule: "evenodd"
|
|
@@ -13816,7 +14128,7 @@ const SelectedPaymentMethod = () => {
|
|
|
13816
14128
|
state: {
|
|
13817
14129
|
isLoading
|
|
13818
14130
|
}
|
|
13819
|
-
} = useContext(store$
|
|
14131
|
+
} = useContext(store$d);
|
|
13820
14132
|
const {
|
|
13821
14133
|
switchView,
|
|
13822
14134
|
selectedPaymentMethodId
|
|
@@ -13848,6 +14160,37 @@ const SelectedPaymentMethod = () => {
|
|
|
13848
14160
|
}, t("select.buttons.changePaymentMethod")))));
|
|
13849
14161
|
};
|
|
13850
14162
|
|
|
14163
|
+
const TaxAmount = () => {
|
|
14164
|
+
var _plan$quantity;
|
|
14165
|
+
|
|
14166
|
+
const {
|
|
14167
|
+
t
|
|
14168
|
+
} = useTranslation("checkoutForm");
|
|
14169
|
+
const {
|
|
14170
|
+
state: {
|
|
14171
|
+
taxAmount
|
|
14172
|
+
}
|
|
14173
|
+
} = useContext(store$d);
|
|
14174
|
+
const {
|
|
14175
|
+
default_locale
|
|
14176
|
+
} = Pelcro.site.read();
|
|
14177
|
+
const {
|
|
14178
|
+
plan
|
|
14179
|
+
} = usePelcro();
|
|
14180
|
+
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
14181
|
+
const priceFormatted = getFormattedPriceByLocal(taxAmount * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
|
|
14182
|
+
|
|
14183
|
+
if (taxAmount) {
|
|
14184
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
14185
|
+
className: "plc-text-center pelcro-tax-amount"
|
|
14186
|
+
}, t("labels.tax"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
14187
|
+
className: "plc-font-bold"
|
|
14188
|
+
}, priceFormatted));
|
|
14189
|
+
}
|
|
14190
|
+
|
|
14191
|
+
return null;
|
|
14192
|
+
};
|
|
14193
|
+
|
|
13851
14194
|
/**
|
|
13852
14195
|
*
|
|
13853
14196
|
*/
|
|
@@ -13884,7 +14227,9 @@ function PaymentMethodView({
|
|
|
13884
14227
|
onFailure: onFailure
|
|
13885
14228
|
}, /*#__PURE__*/React__default.createElement(BankRedirection, null), /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
13886
14229
|
className: "plc-mb-2"
|
|
13887
|
-
}), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement(
|
|
14230
|
+
}), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement("div", {
|
|
14231
|
+
className: "plc-mb-2"
|
|
14232
|
+
}, /*#__PURE__*/React__default.createElement(CouponCode, null), /*#__PURE__*/React__default.createElement(DiscountedPrice, null)), /*#__PURE__*/React__default.createElement(TaxAmount, null), /*#__PURE__*/React__default.createElement("div", {
|
|
13888
14233
|
className: "plc-grid plc-mt-4 plc-gap-y-2"
|
|
13889
14234
|
}, /*#__PURE__*/React__default.createElement(SubmitPaymentMethod, null), showExternalPaymentMethods && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(PelcroPaymentRequestButton, null), /*#__PURE__*/React__default.createElement(PaypalSubscribeButton, null)))))));
|
|
13890
14235
|
}
|
|
@@ -13991,12 +14336,12 @@ function SubscriptionRenewModal({
|
|
|
13991
14336
|
}
|
|
13992
14337
|
SubscriptionRenewModal.viewId = "subscription-renew";
|
|
13993
14338
|
|
|
13994
|
-
var _path$
|
|
14339
|
+
var _path$f;
|
|
13995
14340
|
|
|
13996
|
-
function _extends$
|
|
14341
|
+
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); }
|
|
13997
14342
|
|
|
13998
14343
|
function SvgGift(props) {
|
|
13999
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
14344
|
+
return /*#__PURE__*/React.createElement("svg", _extends$h({
|
|
14000
14345
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
14001
14346
|
fill: "none",
|
|
14002
14347
|
stroke: "currentColor",
|
|
@@ -14005,7 +14350,7 @@ function SvgGift(props) {
|
|
|
14005
14350
|
strokeWidth: 2,
|
|
14006
14351
|
viewBox: "0 0 24 24",
|
|
14007
14352
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14008
|
-
}, props), _path$
|
|
14353
|
+
}, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
|
|
14009
14354
|
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"
|
|
14010
14355
|
})));
|
|
14011
14356
|
}
|
|
@@ -14336,6 +14681,292 @@ class DefaultNewsLetter extends Component {
|
|
|
14336
14681
|
|
|
14337
14682
|
const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
|
|
14338
14683
|
|
|
14684
|
+
const initialState$c = {
|
|
14685
|
+
didSubToNewslettersBefore: false,
|
|
14686
|
+
newsletters: [],
|
|
14687
|
+
isListLoading: true,
|
|
14688
|
+
isSubmitting: false,
|
|
14689
|
+
alert: {
|
|
14690
|
+
type: "error",
|
|
14691
|
+
content: ""
|
|
14692
|
+
}
|
|
14693
|
+
};
|
|
14694
|
+
const store$c = /*#__PURE__*/createContext(initialState$c);
|
|
14695
|
+
const {
|
|
14696
|
+
Provider: Provider$c
|
|
14697
|
+
} = store$c;
|
|
14698
|
+
|
|
14699
|
+
const NewsletterUpdateContainer = ({
|
|
14700
|
+
style,
|
|
14701
|
+
className = "",
|
|
14702
|
+
onSuccess = () => {},
|
|
14703
|
+
onFailure = () => {},
|
|
14704
|
+
children
|
|
14705
|
+
}) => {
|
|
14706
|
+
const [t] = useTranslation("newsletter");
|
|
14707
|
+
|
|
14708
|
+
const handleSubmit = ({
|
|
14709
|
+
newsletters,
|
|
14710
|
+
didSubToNewslettersBefore
|
|
14711
|
+
}, dispatch) => {
|
|
14712
|
+
var _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
14713
|
+
|
|
14714
|
+
const callback = (err, res) => {
|
|
14715
|
+
dispatch({
|
|
14716
|
+
type: LOADING,
|
|
14717
|
+
payload: false
|
|
14718
|
+
});
|
|
14719
|
+
|
|
14720
|
+
if (err) {
|
|
14721
|
+
dispatch({
|
|
14722
|
+
type: SHOW_ALERT,
|
|
14723
|
+
payload: {
|
|
14724
|
+
type: "error",
|
|
14725
|
+
content: getErrorMessages(err)
|
|
14726
|
+
}
|
|
14727
|
+
});
|
|
14728
|
+
onFailure(err);
|
|
14729
|
+
} else {
|
|
14730
|
+
if (!didSubToNewslettersBefore) {
|
|
14731
|
+
dispatch({
|
|
14732
|
+
type: SWITCH_TO_UPDATE
|
|
14733
|
+
});
|
|
14734
|
+
}
|
|
14735
|
+
|
|
14736
|
+
dispatch({
|
|
14737
|
+
type: SHOW_ALERT,
|
|
14738
|
+
payload: {
|
|
14739
|
+
type: "success",
|
|
14740
|
+
content: t("messages.success")
|
|
14741
|
+
}
|
|
14742
|
+
});
|
|
14743
|
+
onSuccess(res);
|
|
14744
|
+
}
|
|
14745
|
+
};
|
|
14746
|
+
|
|
14747
|
+
const requestData = {
|
|
14748
|
+
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"),
|
|
14749
|
+
source: "web",
|
|
14750
|
+
lists: newsletters.filter(newsletter => newsletter.selected).map(newsletter => newsletter.id).join(",")
|
|
14751
|
+
};
|
|
14752
|
+
|
|
14753
|
+
if (didSubToNewslettersBefore) {
|
|
14754
|
+
window.Pelcro.newsletter.update(requestData, callback);
|
|
14755
|
+
} else {
|
|
14756
|
+
window.Pelcro.newsletter.create(requestData, callback);
|
|
14757
|
+
}
|
|
14758
|
+
};
|
|
14759
|
+
|
|
14760
|
+
const [state, dispatch] = useReducerWithSideEffects((state, action) => {
|
|
14761
|
+
switch (action.type) {
|
|
14762
|
+
case GET_NEWSLETTERS_FETCH:
|
|
14763
|
+
return lib_7({ ...state,
|
|
14764
|
+
isListLoading: true
|
|
14765
|
+
});
|
|
14766
|
+
|
|
14767
|
+
case GET_NEWSLETTERS_SUCCESS:
|
|
14768
|
+
return lib_7({ ...state,
|
|
14769
|
+
newsletters: action.payload.newsletters,
|
|
14770
|
+
didSubToNewslettersBefore: action.payload.didSubToNewslettersBefore,
|
|
14771
|
+
isListLoading: false
|
|
14772
|
+
});
|
|
14773
|
+
|
|
14774
|
+
case SET_SELECT:
|
|
14775
|
+
return lib_7({ ...state,
|
|
14776
|
+
newsletters: state.newsletters.map(newsletter => {
|
|
14777
|
+
if (newsletter.id === action.payload) {
|
|
14778
|
+
return { ...newsletter,
|
|
14779
|
+
selected: !newsletter.selected
|
|
14780
|
+
};
|
|
14781
|
+
}
|
|
14782
|
+
|
|
14783
|
+
return newsletter;
|
|
14784
|
+
})
|
|
14785
|
+
});
|
|
14786
|
+
|
|
14787
|
+
case SWITCH_TO_UPDATE:
|
|
14788
|
+
return lib_7({ ...state,
|
|
14789
|
+
didSubToNewslettersBefore: true
|
|
14790
|
+
});
|
|
14791
|
+
|
|
14792
|
+
case SHOW_ALERT:
|
|
14793
|
+
return lib_7({ ...state,
|
|
14794
|
+
alert: action.payload
|
|
14795
|
+
});
|
|
14796
|
+
|
|
14797
|
+
case LOADING:
|
|
14798
|
+
return lib_7({ ...state,
|
|
14799
|
+
isSubmitting: action.payload
|
|
14800
|
+
});
|
|
14801
|
+
|
|
14802
|
+
case HANDLE_SUBMIT:
|
|
14803
|
+
return lib_5({ ...state,
|
|
14804
|
+
isSubmitting: true
|
|
14805
|
+
}, (state, dispatch) => handleSubmit(state, dispatch));
|
|
14806
|
+
|
|
14807
|
+
default:
|
|
14808
|
+
return state;
|
|
14809
|
+
}
|
|
14810
|
+
}, initialState$c);
|
|
14811
|
+
useEffect(() => {
|
|
14812
|
+
const getUserNewsletters = () => {
|
|
14813
|
+
var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
|
|
14814
|
+
|
|
14815
|
+
dispatch({
|
|
14816
|
+
type: GET_NEWSLETTERS_FETCH
|
|
14817
|
+
});
|
|
14818
|
+
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");
|
|
14819
|
+
window.Pelcro.newsletter.getByEmail(email, (err, res) => {
|
|
14820
|
+
var _window$Pelcro$uiSett, _window$Pelcro, _window$Pelcro$uiSett2, _res$data$lists$split, _res$data$lists;
|
|
14821
|
+
|
|
14822
|
+
if (err) {
|
|
14823
|
+
return dispatch({
|
|
14824
|
+
type: SHOW_ALERT,
|
|
14825
|
+
payload: {
|
|
14826
|
+
type: "error",
|
|
14827
|
+
content: getErrorMessages(err)
|
|
14828
|
+
}
|
|
14829
|
+
});
|
|
14830
|
+
}
|
|
14831
|
+
|
|
14832
|
+
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 : [];
|
|
14833
|
+
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 : [];
|
|
14834
|
+
const allNewslettersWithSelectedField = newsletters.map(newsletter => ({ ...newsletter,
|
|
14835
|
+
id: String(newsletter.id),
|
|
14836
|
+
selected: selectedNewsletters.includes(String(newsletter.id))
|
|
14837
|
+
}));
|
|
14838
|
+
dispatch({
|
|
14839
|
+
type: GET_NEWSLETTERS_SUCCESS,
|
|
14840
|
+
payload: {
|
|
14841
|
+
newsletters: allNewslettersWithSelectedField,
|
|
14842
|
+
didSubToNewslettersBefore: Boolean(res.data.email)
|
|
14843
|
+
}
|
|
14844
|
+
});
|
|
14845
|
+
});
|
|
14846
|
+
};
|
|
14847
|
+
|
|
14848
|
+
getUserNewsletters();
|
|
14849
|
+
}, []);
|
|
14850
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
14851
|
+
style: { ...style
|
|
14852
|
+
},
|
|
14853
|
+
className: `pelcro-container pelcro-newsletter-update-container ${className}`
|
|
14854
|
+
}, /*#__PURE__*/React__default.createElement(Provider$c, {
|
|
14855
|
+
value: {
|
|
14856
|
+
state,
|
|
14857
|
+
dispatch
|
|
14858
|
+
}
|
|
14859
|
+
}, children.length ? children.map((child, i) => {
|
|
14860
|
+
if (child) {
|
|
14861
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
14862
|
+
store: store$c,
|
|
14863
|
+
key: i
|
|
14864
|
+
});
|
|
14865
|
+
}
|
|
14866
|
+
}) : /*#__PURE__*/React__default.cloneElement(children, {
|
|
14867
|
+
store: store$c
|
|
14868
|
+
})));
|
|
14869
|
+
};
|
|
14870
|
+
|
|
14871
|
+
const NewsletterUpdateButton = ({
|
|
14872
|
+
name,
|
|
14873
|
+
onClick,
|
|
14874
|
+
...otherProps
|
|
14875
|
+
}) => {
|
|
14876
|
+
const {
|
|
14877
|
+
dispatch,
|
|
14878
|
+
state: {
|
|
14879
|
+
isSubmitting,
|
|
14880
|
+
isListLoading
|
|
14881
|
+
}
|
|
14882
|
+
} = useContext(store$c);
|
|
14883
|
+
const {
|
|
14884
|
+
t
|
|
14885
|
+
} = useTranslation("newsletter");
|
|
14886
|
+
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
14887
|
+
onClick: () => {
|
|
14888
|
+
dispatch({
|
|
14889
|
+
type: HANDLE_SUBMIT
|
|
14890
|
+
});
|
|
14891
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
14892
|
+
},
|
|
14893
|
+
disabled: isListLoading,
|
|
14894
|
+
isLoading: isSubmitting
|
|
14895
|
+
}, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
|
|
14896
|
+
};
|
|
14897
|
+
|
|
14898
|
+
const NewsletterUpdateList = () => {
|
|
14899
|
+
const handleSelectNewsletter = event => {
|
|
14900
|
+
dispatch({
|
|
14901
|
+
type: SET_SELECT,
|
|
14902
|
+
payload: event.target.value
|
|
14903
|
+
});
|
|
14904
|
+
};
|
|
14905
|
+
|
|
14906
|
+
const {
|
|
14907
|
+
dispatch,
|
|
14908
|
+
state: {
|
|
14909
|
+
newsletters,
|
|
14910
|
+
isListLoading
|
|
14911
|
+
}
|
|
14912
|
+
} = useContext(store$c);
|
|
14913
|
+
|
|
14914
|
+
if (isListLoading) {
|
|
14915
|
+
return /*#__PURE__*/React__default.createElement(Loader, {
|
|
14916
|
+
width: 60,
|
|
14917
|
+
height: 100
|
|
14918
|
+
});
|
|
14919
|
+
}
|
|
14920
|
+
|
|
14921
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
14922
|
+
className: "plc-max-h-80 plc-overflow-y-auto pelcro-newsletters-wrapper"
|
|
14923
|
+
}, newsletters.map(newsletter => /*#__PURE__*/React__default.createElement("div", {
|
|
14924
|
+
key: newsletter.id,
|
|
14925
|
+
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"
|
|
14926
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
14927
|
+
className: "pelcro-select-newsletter-checkbox",
|
|
14928
|
+
labelClassName: "plc-cursor-pointer plc-w-full",
|
|
14929
|
+
id: `pelcro-newsletter-update-${newsletter.id}`,
|
|
14930
|
+
checked: newsletter.selected,
|
|
14931
|
+
value: newsletter.id,
|
|
14932
|
+
onChange: handleSelectNewsletter
|
|
14933
|
+
}, newsletter.label))));
|
|
14934
|
+
};
|
|
14935
|
+
|
|
14936
|
+
const NewsletterUpdateView = props => {
|
|
14937
|
+
const {
|
|
14938
|
+
t
|
|
14939
|
+
} = useTranslation("newsletter");
|
|
14940
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
14941
|
+
id: "pelcro-newsletter-update-view"
|
|
14942
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14943
|
+
className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
|
|
14944
|
+
}, /*#__PURE__*/React__default.createElement("h4", {
|
|
14945
|
+
className: "plc-text-2xl plc-font-semibold"
|
|
14946
|
+
}, t("updateTitle"))), /*#__PURE__*/React__default.createElement("form", {
|
|
14947
|
+
action: "javascript:void(0);",
|
|
14948
|
+
className: "plc-mt-2 pelcro-form"
|
|
14949
|
+
}, /*#__PURE__*/React__default.createElement(NewsletterUpdateContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, null), /*#__PURE__*/React__default.createElement(NewsletterUpdateList, null), /*#__PURE__*/React__default.createElement(NewsletterUpdateButton, {
|
|
14950
|
+
role: "submit",
|
|
14951
|
+
className: "plc-mt-4 plc-w-full",
|
|
14952
|
+
name: t("labels.submit"),
|
|
14953
|
+
id: "pelcro-submit"
|
|
14954
|
+
}))));
|
|
14955
|
+
};
|
|
14956
|
+
|
|
14957
|
+
const NewsletterUpdateModal = ({
|
|
14958
|
+
onDisplay,
|
|
14959
|
+
onClose,
|
|
14960
|
+
...otherProps
|
|
14961
|
+
}) => {
|
|
14962
|
+
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
14963
|
+
id: "pelcro-newsletter-update-modal",
|
|
14964
|
+
onDisplay: onDisplay,
|
|
14965
|
+
onClose: onClose
|
|
14966
|
+
}, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(NewsletterUpdateView, otherProps)), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
|
|
14967
|
+
};
|
|
14968
|
+
NewsletterUpdateModal.viewId = "newsletter-update";
|
|
14969
|
+
|
|
14339
14970
|
const MeterView = () => {
|
|
14340
14971
|
var _paywallProduct$paywa, _paywallProduct$paywa2;
|
|
14341
14972
|
|
|
@@ -14387,7 +15018,7 @@ const MeterModal = props => {
|
|
|
14387
15018
|
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"
|
|
14388
15019
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
14389
15020
|
type: "button",
|
|
14390
|
-
className: "plc-absolute plc-top-0 plc-text-2xl plc-text-gray-500 plc-right-1 pelcro-close-btn",
|
|
15021
|
+
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",
|
|
14391
15022
|
"aria-label": "Close",
|
|
14392
15023
|
onClick: onClose
|
|
14393
15024
|
}, /*#__PURE__*/React__default.createElement("span", null, "\xD7")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(MeterView, props)));
|
|
@@ -14723,17 +15354,17 @@ const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone
|
|
|
14723
15354
|
|
|
14724
15355
|
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";
|
|
14725
15356
|
|
|
14726
|
-
var _path$
|
|
15357
|
+
var _path$e;
|
|
14727
15358
|
|
|
14728
|
-
function _extends$
|
|
15359
|
+
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); }
|
|
14729
15360
|
|
|
14730
15361
|
function SvgEdit(props) {
|
|
14731
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
15362
|
+
return /*#__PURE__*/React.createElement("svg", _extends$g({
|
|
14732
15363
|
className: "plc-w-6 plc-h-6",
|
|
14733
15364
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14734
15365
|
viewBox: "0 0 20 20",
|
|
14735
15366
|
fill: "currentColor"
|
|
14736
|
-
}, props), _path$
|
|
15367
|
+
}, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
|
|
14737
15368
|
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"
|
|
14738
15369
|
})));
|
|
14739
15370
|
}
|
|
@@ -17844,18 +18475,18 @@ const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(La
|
|
|
17844
18475
|
store: store$4
|
|
17845
18476
|
}, props));
|
|
17846
18477
|
|
|
17847
|
-
var _path$
|
|
18478
|
+
var _path$d;
|
|
17848
18479
|
|
|
17849
|
-
function _extends$
|
|
18480
|
+
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); }
|
|
17850
18481
|
|
|
17851
18482
|
function SvgInfoCircle(props) {
|
|
17852
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
18483
|
+
return /*#__PURE__*/React.createElement("svg", _extends$f({
|
|
17853
18484
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17854
18485
|
className: "plc-w-5 plc-h-5",
|
|
17855
18486
|
fill: "none",
|
|
17856
18487
|
viewBox: "0 0 24 24",
|
|
17857
18488
|
stroke: "currentColor"
|
|
17858
|
-
}, props), _path$
|
|
18489
|
+
}, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
|
|
17859
18490
|
strokeLinecap: "round",
|
|
17860
18491
|
strokeLinejoin: "round",
|
|
17861
18492
|
strokeWidth: 2,
|
|
@@ -18842,8 +19473,8 @@ const PaymentMethodSelectModal = ({
|
|
|
18842
19473
|
};
|
|
18843
19474
|
PaymentMethodSelectModal.viewId = "payment-method-select";
|
|
18844
19475
|
|
|
18845
|
-
function _extends$
|
|
18846
|
-
_extends$
|
|
19476
|
+
function _extends$e() {
|
|
19477
|
+
_extends$e = Object.assign || function (target) {
|
|
18847
19478
|
for (var i = 1; i < arguments.length; i++) {
|
|
18848
19479
|
var source = arguments[i];
|
|
18849
19480
|
|
|
@@ -18857,7 +19488,7 @@ function _extends$d() {
|
|
|
18857
19488
|
return target;
|
|
18858
19489
|
};
|
|
18859
19490
|
|
|
18860
|
-
return _extends$
|
|
19491
|
+
return _extends$e.apply(this, arguments);
|
|
18861
19492
|
}
|
|
18862
19493
|
|
|
18863
19494
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -19041,7 +19672,7 @@ function render(props, propsBag, defaultTag, features, visible) {
|
|
|
19041
19672
|
return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
|
|
19042
19673
|
return null;
|
|
19043
19674
|
}, _match[RenderStrategy.Hidden] = function () {
|
|
19044
|
-
return _render(_extends$
|
|
19675
|
+
return _render(_extends$e({}, _rest, {
|
|
19045
19676
|
hidden: true,
|
|
19046
19677
|
style: {
|
|
19047
19678
|
display: 'none'
|
|
@@ -19569,7 +20200,7 @@ function TransitionChild(props) {
|
|
|
19569
20200
|
var passthroughProps = rest;
|
|
19570
20201
|
return React__default.createElement(NestingContext.Provider, {
|
|
19571
20202
|
value: nesting
|
|
19572
|
-
}, render(_extends$
|
|
20203
|
+
}, render(_extends$e({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
|
|
19573
20204
|
}
|
|
19574
20205
|
|
|
19575
20206
|
function Transition(props) {
|
|
@@ -19613,7 +20244,7 @@ function Transition(props) {
|
|
|
19613
20244
|
value: nestingBag
|
|
19614
20245
|
}, React__default.createElement(TransitionContext.Provider, {
|
|
19615
20246
|
value: transitionBag
|
|
19616
|
-
}, render(_extends$
|
|
20247
|
+
}, render(_extends$e({}, sharedProps, {
|
|
19617
20248
|
as: Fragment,
|
|
19618
20249
|
children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
|
|
19619
20250
|
}), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
|
|
@@ -19740,12 +20371,12 @@ var ActionTypes;
|
|
|
19740
20371
|
})(ActionTypes || (ActionTypes = {}));
|
|
19741
20372
|
|
|
19742
20373
|
(_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
|
|
19743
|
-
return _extends$
|
|
20374
|
+
return _extends$e({}, state, {
|
|
19744
20375
|
activeItemIndex: null,
|
|
19745
20376
|
menuState: MenuStates.Closed
|
|
19746
20377
|
});
|
|
19747
20378
|
}, _reducers[ActionTypes.OpenMenu] = function (state) {
|
|
19748
|
-
return _extends$
|
|
20379
|
+
return _extends$e({}, state, {
|
|
19749
20380
|
menuState: MenuStates.Open
|
|
19750
20381
|
});
|
|
19751
20382
|
}, _reducers[ActionTypes.GoToItem] = function (state, action) {
|
|
@@ -19764,7 +20395,7 @@ var ActionTypes;
|
|
|
19764
20395
|
}
|
|
19765
20396
|
});
|
|
19766
20397
|
if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
|
|
19767
|
-
return _extends$
|
|
20398
|
+
return _extends$e({}, state, {
|
|
19768
20399
|
searchQuery: '',
|
|
19769
20400
|
activeItemIndex: activeItemIndex
|
|
19770
20401
|
});
|
|
@@ -19775,19 +20406,19 @@ var ActionTypes;
|
|
|
19775
20406
|
|
|
19776
20407
|
return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
|
|
19777
20408
|
});
|
|
19778
|
-
if (match === -1 || match === state.activeItemIndex) return _extends$
|
|
20409
|
+
if (match === -1 || match === state.activeItemIndex) return _extends$e({}, state, {
|
|
19779
20410
|
searchQuery: searchQuery
|
|
19780
20411
|
});
|
|
19781
|
-
return _extends$
|
|
20412
|
+
return _extends$e({}, state, {
|
|
19782
20413
|
searchQuery: searchQuery,
|
|
19783
20414
|
activeItemIndex: match
|
|
19784
20415
|
});
|
|
19785
20416
|
}, _reducers[ActionTypes.ClearSearch] = function (state) {
|
|
19786
|
-
return _extends$
|
|
20417
|
+
return _extends$e({}, state, {
|
|
19787
20418
|
searchQuery: ''
|
|
19788
20419
|
});
|
|
19789
20420
|
}, _reducers[ActionTypes.RegisterItem] = function (state, action) {
|
|
19790
|
-
return _extends$
|
|
20421
|
+
return _extends$e({}, state, {
|
|
19791
20422
|
items: [].concat(state.items, [{
|
|
19792
20423
|
id: action.id,
|
|
19793
20424
|
dataRef: action.dataRef
|
|
@@ -19800,7 +20431,7 @@ var ActionTypes;
|
|
|
19800
20431
|
return a.id === action.id;
|
|
19801
20432
|
});
|
|
19802
20433
|
if (idx !== -1) nextItems.splice(idx, 1);
|
|
19803
|
-
return _extends$
|
|
20434
|
+
return _extends$e({}, state, {
|
|
19804
20435
|
items: nextItems,
|
|
19805
20436
|
activeItemIndex: function () {
|
|
19806
20437
|
if (idx === state.activeItemIndex) return null;
|
|
@@ -19839,19 +20470,19 @@ var ActionTypes$1;
|
|
|
19839
20470
|
(_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
|
|
19840
20471
|
if (state.disabled) return state;
|
|
19841
20472
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
19842
|
-
return _extends$
|
|
20473
|
+
return _extends$e({}, state, {
|
|
19843
20474
|
activeOptionIndex: null,
|
|
19844
20475
|
listboxState: ListboxStates.Closed
|
|
19845
20476
|
});
|
|
19846
20477
|
}, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
|
|
19847
20478
|
if (state.disabled) return state;
|
|
19848
20479
|
if (state.listboxState === ListboxStates.Open) return state;
|
|
19849
|
-
return _extends$
|
|
20480
|
+
return _extends$e({}, state, {
|
|
19850
20481
|
listboxState: ListboxStates.Open
|
|
19851
20482
|
});
|
|
19852
20483
|
}, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
|
|
19853
20484
|
if (state.disabled === action.disabled) return state;
|
|
19854
|
-
return _extends$
|
|
20485
|
+
return _extends$e({}, state, {
|
|
19855
20486
|
disabled: action.disabled
|
|
19856
20487
|
});
|
|
19857
20488
|
}, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
|
|
@@ -19872,7 +20503,7 @@ var ActionTypes$1;
|
|
|
19872
20503
|
}
|
|
19873
20504
|
});
|
|
19874
20505
|
if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
|
|
19875
|
-
return _extends$
|
|
20506
|
+
return _extends$e({}, state, {
|
|
19876
20507
|
searchQuery: '',
|
|
19877
20508
|
activeOptionIndex: activeOptionIndex
|
|
19878
20509
|
});
|
|
@@ -19885,10 +20516,10 @@ var ActionTypes$1;
|
|
|
19885
20516
|
|
|
19886
20517
|
return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
|
|
19887
20518
|
});
|
|
19888
|
-
if (match === -1 || match === state.activeOptionIndex) return _extends$
|
|
20519
|
+
if (match === -1 || match === state.activeOptionIndex) return _extends$e({}, state, {
|
|
19889
20520
|
searchQuery: searchQuery
|
|
19890
20521
|
});
|
|
19891
|
-
return _extends$
|
|
20522
|
+
return _extends$e({}, state, {
|
|
19892
20523
|
searchQuery: searchQuery,
|
|
19893
20524
|
activeOptionIndex: match
|
|
19894
20525
|
});
|
|
@@ -19896,11 +20527,11 @@ var ActionTypes$1;
|
|
|
19896
20527
|
if (state.disabled) return state;
|
|
19897
20528
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
19898
20529
|
if (state.searchQuery === '') return state;
|
|
19899
|
-
return _extends$
|
|
20530
|
+
return _extends$e({}, state, {
|
|
19900
20531
|
searchQuery: ''
|
|
19901
20532
|
});
|
|
19902
20533
|
}, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
|
|
19903
|
-
return _extends$
|
|
20534
|
+
return _extends$e({}, state, {
|
|
19904
20535
|
options: [].concat(state.options, [{
|
|
19905
20536
|
id: action.id,
|
|
19906
20537
|
dataRef: action.dataRef
|
|
@@ -19913,7 +20544,7 @@ var ActionTypes$1;
|
|
|
19913
20544
|
return a.id === action.id;
|
|
19914
20545
|
});
|
|
19915
20546
|
if (idx !== -1) nextOptions.splice(idx, 1);
|
|
19916
|
-
return _extends$
|
|
20547
|
+
return _extends$e({}, state, {
|
|
19917
20548
|
options: nextOptions,
|
|
19918
20549
|
activeOptionIndex: function () {
|
|
19919
20550
|
if (idx === state.activeOptionIndex) return null;
|
|
@@ -19974,18 +20605,18 @@ const getPaymentCardIcon = name => {
|
|
|
19974
20605
|
}));
|
|
19975
20606
|
};
|
|
19976
20607
|
|
|
19977
|
-
var _path$
|
|
20608
|
+
var _path$c;
|
|
19978
20609
|
|
|
19979
|
-
function _extends$
|
|
20610
|
+
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); }
|
|
19980
20611
|
|
|
19981
20612
|
function SvgChevronRight(props) {
|
|
19982
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
20613
|
+
return /*#__PURE__*/React.createElement("svg", _extends$d({
|
|
19983
20614
|
className: "plc-w-6 plc-h-6",
|
|
19984
20615
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19985
20616
|
fill: "none",
|
|
19986
20617
|
viewBox: "0 0 24 24",
|
|
19987
20618
|
stroke: "currentColor"
|
|
19988
|
-
}, props), _path$
|
|
20619
|
+
}, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
|
|
19989
20620
|
strokeLinecap: "round",
|
|
19990
20621
|
strokeLinejoin: "round",
|
|
19991
20622
|
strokeWidth: 2,
|
|
@@ -20284,18 +20915,18 @@ Accordion.item = function AccordionItem({
|
|
|
20284
20915
|
}, content)) : null;
|
|
20285
20916
|
};
|
|
20286
20917
|
|
|
20287
|
-
var _path$
|
|
20918
|
+
var _path$b;
|
|
20288
20919
|
|
|
20289
|
-
function _extends$
|
|
20920
|
+
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); }
|
|
20290
20921
|
|
|
20291
20922
|
function SvgExit(props) {
|
|
20292
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
20923
|
+
return /*#__PURE__*/React.createElement("svg", _extends$c({
|
|
20293
20924
|
className: "plc-w-6 plc-h-6",
|
|
20294
20925
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20295
20926
|
fill: "none",
|
|
20296
20927
|
viewBox: "0 0 24 24",
|
|
20297
20928
|
stroke: "currentColor"
|
|
20298
|
-
}, props), _path$
|
|
20929
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
|
|
20299
20930
|
strokeLinecap: "round",
|
|
20300
20931
|
strokeLinejoin: "round",
|
|
20301
20932
|
strokeWidth: 2,
|
|
@@ -20303,30 +20934,49 @@ function SvgExit(props) {
|
|
|
20303
20934
|
})));
|
|
20304
20935
|
}
|
|
20305
20936
|
|
|
20306
|
-
var _path$
|
|
20937
|
+
var _path$a;
|
|
20307
20938
|
|
|
20308
|
-
function _extends$
|
|
20939
|
+
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); }
|
|
20309
20940
|
|
|
20310
20941
|
function SvgCheckMark(props) {
|
|
20311
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
20942
|
+
return /*#__PURE__*/React.createElement("svg", _extends$b({
|
|
20312
20943
|
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
20313
20944
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20314
20945
|
viewBox: "0 0 20 20",
|
|
20315
20946
|
fill: "currentColor"
|
|
20316
|
-
}, props), _path$
|
|
20947
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
|
|
20317
20948
|
fillRule: "evenodd",
|
|
20318
20949
|
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",
|
|
20319
20950
|
clipRule: "evenodd"
|
|
20320
20951
|
})));
|
|
20321
20952
|
}
|
|
20322
20953
|
|
|
20954
|
+
var _path$9;
|
|
20955
|
+
|
|
20956
|
+
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); }
|
|
20957
|
+
|
|
20958
|
+
function SvgUser(props) {
|
|
20959
|
+
return /*#__PURE__*/React.createElement("svg", _extends$a({
|
|
20960
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20961
|
+
fill: "none",
|
|
20962
|
+
viewBox: "0 0 24 24",
|
|
20963
|
+
stroke: "currentColor"
|
|
20964
|
+
}, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
|
|
20965
|
+
strokeLinecap: "round",
|
|
20966
|
+
strokeLinejoin: "round",
|
|
20967
|
+
strokeWidth: 2,
|
|
20968
|
+
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"
|
|
20969
|
+
})));
|
|
20970
|
+
}
|
|
20971
|
+
|
|
20323
20972
|
var _path$8;
|
|
20324
20973
|
|
|
20325
20974
|
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); }
|
|
20326
20975
|
|
|
20327
|
-
function
|
|
20976
|
+
function SvgNewsletter(props) {
|
|
20328
20977
|
return /*#__PURE__*/React.createElement("svg", _extends$9({
|
|
20329
20978
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20979
|
+
className: "plc-h-5 plc-w-5",
|
|
20330
20980
|
fill: "none",
|
|
20331
20981
|
viewBox: "0 0 24 24",
|
|
20332
20982
|
stroke: "currentColor"
|
|
@@ -20334,7 +20984,7 @@ function SvgUser(props) {
|
|
|
20334
20984
|
strokeLinecap: "round",
|
|
20335
20985
|
strokeLinejoin: "round",
|
|
20336
20986
|
strokeWidth: 2,
|
|
20337
|
-
d: "
|
|
20987
|
+
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"
|
|
20338
20988
|
})));
|
|
20339
20989
|
}
|
|
20340
20990
|
|
|
@@ -20573,6 +21223,24 @@ class Dashboard extends Component {
|
|
|
20573
21223
|
});
|
|
20574
21224
|
});
|
|
20575
21225
|
|
|
21226
|
+
_defineProperty$3(this, "componentWillUnmount", () => {
|
|
21227
|
+
document.removeEventListener("click", this.hideMenuIfClickedOutside);
|
|
21228
|
+
});
|
|
21229
|
+
|
|
21230
|
+
_defineProperty$3(this, "initializeHideMenuHandler", () => {
|
|
21231
|
+
document.addEventListener("click", this.hideMenuIfClickedOutside);
|
|
21232
|
+
});
|
|
21233
|
+
|
|
21234
|
+
_defineProperty$3(this, "hideMenuIfClickedOutside", event => {
|
|
21235
|
+
const didClickOutsideMenu = this.state.isOpen && this.menuRef.current && !this.menuRef.current.contains(event.target);
|
|
21236
|
+
|
|
21237
|
+
if (didClickOutsideMenu) {
|
|
21238
|
+
this.setState({
|
|
21239
|
+
isOpen: false
|
|
21240
|
+
});
|
|
21241
|
+
}
|
|
21242
|
+
});
|
|
21243
|
+
|
|
20576
21244
|
_defineProperty$3(this, "cancelSubscription", (subscription_id, onSuccess, onFailure) => {
|
|
20577
21245
|
// disable the Login button to prevent repeated clicks
|
|
20578
21246
|
window.Pelcro.subscription.cancel({
|
|
@@ -20610,6 +21278,10 @@ class Dashboard extends Component {
|
|
|
20610
21278
|
return this.props.setView("password-change");
|
|
20611
21279
|
});
|
|
20612
21280
|
|
|
21281
|
+
_defineProperty$3(this, "displayNewsletterUpdate", () => {
|
|
21282
|
+
return this.props.setView("newsletter-update");
|
|
21283
|
+
});
|
|
21284
|
+
|
|
20613
21285
|
_defineProperty$3(this, "displayProductSelect", ({
|
|
20614
21286
|
isGift
|
|
20615
21287
|
}) => {
|
|
@@ -20769,21 +21441,21 @@ class Dashboard extends Component {
|
|
|
20769
21441
|
className: "plc-inline-block plc-mt-1"
|
|
20770
21442
|
}, sub.shipments_remaining, " ", this.locale("labels.shipments")) : null)), /*#__PURE__*/React__default.createElement("td", null, sub.cancel_at_period_end === 0 && /*#__PURE__*/React__default.createElement(Button, {
|
|
20771
21443
|
variant: "ghost",
|
|
20772
|
-
className: "plc-text-red-500 focus:plc-ring-red-500",
|
|
21444
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
20773
21445
|
icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
|
|
20774
21446
|
onClick: onCancelClick,
|
|
20775
21447
|
disabled: this.state.disableSubmit,
|
|
20776
21448
|
"data-key": sub.id
|
|
20777
21449
|
}, this.locale("labels.unsubscribe")), sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
|
|
20778
21450
|
variant: "ghost",
|
|
20779
|
-
className: "plc-text-green-400 focus:plc-ring-green-300",
|
|
21451
|
+
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
|
|
20780
21452
|
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
20781
21453
|
onClick: onReactivateClick,
|
|
20782
21454
|
disabled: this.state.disableSubmit,
|
|
20783
21455
|
"data-key": sub.id
|
|
20784
21456
|
}, this.locale("labels.reactivate")), sub.cancel_at_period_end === 1 && /*#__PURE__*/React__default.createElement(Button, {
|
|
20785
21457
|
variant: "ghost",
|
|
20786
|
-
className: "plc-text-blue-400",
|
|
21458
|
+
className: "plc-text-blue-400 pelcro-dashboard-sub-renew-button",
|
|
20787
21459
|
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
20788
21460
|
onClick: onRenewClick,
|
|
20789
21461
|
disabled: this.state.disableSubmit,
|
|
@@ -20964,28 +21636,33 @@ class Dashboard extends Component {
|
|
|
20964
21636
|
this.site = window.Pelcro.site.read();
|
|
20965
21637
|
this.locale = this.props.t;
|
|
20966
21638
|
this.user = window.Pelcro.user.read();
|
|
21639
|
+
this.menuRef = /*#__PURE__*/React__default.createRef();
|
|
20967
21640
|
}
|
|
20968
21641
|
|
|
20969
21642
|
render() {
|
|
20970
|
-
var _window$Pelcro$user$r3, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
21643
|
+
var _window$Pelcro$user$r3, _window$Pelcro, _window$Pelcro$uiSett, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
20971
21644
|
|
|
20972
21645
|
const {
|
|
20973
21646
|
isOpen
|
|
20974
21647
|
} = this.state;
|
|
20975
21648
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
20976
21649
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
21650
|
+
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;
|
|
21651
|
+
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
20977
21652
|
return /*#__PURE__*/React__default.createElement(Transition, {
|
|
20978
21653
|
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",
|
|
20979
21654
|
show: isOpen,
|
|
20980
21655
|
enter: "plc-transform plc-transition plc-duration-500",
|
|
20981
21656
|
enterFrom: "plc-translate-x-full",
|
|
20982
21657
|
enterTo: "plc-translate-x-0",
|
|
21658
|
+
afterEnter: this.initializeHideMenuHandler,
|
|
20983
21659
|
leave: "plc-transform plc-transition plc-duration-500",
|
|
20984
21660
|
leaveFrom: "plc-translate-x-0",
|
|
20985
21661
|
leaveTo: "plc-translate-x-full",
|
|
20986
21662
|
afterLeave: this.props.onClose
|
|
20987
21663
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
20988
|
-
id: "pelcro-view-dashboard"
|
|
21664
|
+
id: "pelcro-view-dashboard",
|
|
21665
|
+
ref: this.menuRef
|
|
20989
21666
|
}, /*#__PURE__*/React__default.createElement("header", {
|
|
20990
21667
|
className: "plc-flex plc-flex-col plc-p-4 plc-pl-2 plc-min-h-40 sm:plc-pr-8 plc-bg-primary-500"
|
|
20991
21668
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -21048,7 +21725,14 @@ class Dashboard extends Component {
|
|
|
21048
21725
|
}),
|
|
21049
21726
|
className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
|
|
21050
21727
|
onClick: this.displayChangePassword
|
|
21051
|
-
}, this.locale("labels.changePassword"))
|
|
21728
|
+
}, this.locale("labels.changePassword")), siteHasNewslettersDefined && /*#__PURE__*/React__default.createElement(Button, {
|
|
21729
|
+
variant: "ghost",
|
|
21730
|
+
icon: /*#__PURE__*/React__default.createElement(SvgNewsletter, {
|
|
21731
|
+
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
21732
|
+
}),
|
|
21733
|
+
className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
|
|
21734
|
+
onClick: this.displayNewsletterUpdate
|
|
21735
|
+
}, this.locale("labels.editNewsletters")))
|
|
21052
21736
|
}), /*#__PURE__*/React__default.createElement(Accordion.item, {
|
|
21053
21737
|
name: SUB_MENUS.PAYMENT_CARDS,
|
|
21054
21738
|
icon: /*#__PURE__*/React__default.createElement(SvgPaymentCard, null),
|
|
@@ -21124,7 +21808,7 @@ const DashboardOpenButton = () => {
|
|
|
21124
21808
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
21125
21809
|
className: "plc-fixed plc-right-4 plc-bottom-4 pelcro-open-dashboard-btn"
|
|
21126
21810
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
21127
|
-
className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300",
|
|
21811
|
+
className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300 hover:plc-bg-white",
|
|
21128
21812
|
name: "menu",
|
|
21129
21813
|
id: "pelcro-view-menu",
|
|
21130
21814
|
onClick: () => switchView("dashboard")
|
|
@@ -22957,4 +23641,4 @@ function ProfilePicChangeModal({
|
|
|
22957
23641
|
}
|
|
22958
23642
|
ProfilePicChangeModal.viewId = "profile-picture";
|
|
22959
23643
|
|
|
22960
|
-
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, ApplyCouponButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };
|
|
23644
|
+
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };
|