@pelcro/react-pelcro-js 2.6.0-beta.1 → 2.6.0-beta.13
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 +781 -385
- package/dist/index.esm.js +781 -385
- package/dist/pelcro.css +14 -0
- package/package.json +2 -4
package/dist/index.esm.js
CHANGED
|
@@ -3628,12 +3628,14 @@ var cancel$1 = "Cancel your subscription online at anytime.";
|
|
|
3628
3628
|
var giftSent$1 = "Subscription gift has been sent to";
|
|
3629
3629
|
var successfully$1 = "successfully";
|
|
3630
3630
|
var entitlement$1 = "Some of the content on this page is available with one or more of our plans. <1>Subscribe</1> now to get full page access.";
|
|
3631
|
+
var recaptcha$1 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
|
|
3631
3632
|
var messages_en = {
|
|
3632
3633
|
youAreSafe: youAreSafe$1,
|
|
3633
3634
|
cancel: cancel$1,
|
|
3634
3635
|
giftSent: giftSent$1,
|
|
3635
3636
|
successfully: successfully$1,
|
|
3636
|
-
entitlement: entitlement$1
|
|
3637
|
+
entitlement: entitlement$1,
|
|
3638
|
+
recaptcha: recaptcha$1
|
|
3637
3639
|
};
|
|
3638
3640
|
|
|
3639
3641
|
var youAreSafe = "Vous êtes en sécurité - PCI conforme 128 SSL par";
|
|
@@ -3641,12 +3643,14 @@ var cancel = "Annuler votre abonnement en ligne à tout moment.";
|
|
|
3641
3643
|
var giftSent = "Le cadeau d’abonnement a été envoyé à";
|
|
3642
3644
|
var successfully = "avec succès.";
|
|
3643
3645
|
var entitlement = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1>Abonnez-vous</1> à l'un de nos plans disponibles pour accéder à plus de contenu";
|
|
3646
|
+
var recaptcha = "Ce site est protégé par reCAPTCHA - les <1>règles de confidentialité</1> Google ainsi que les <3>conditions d'utilisation</3> s'appliquent.";
|
|
3644
3647
|
var messages_fr = {
|
|
3645
3648
|
youAreSafe: youAreSafe,
|
|
3646
3649
|
cancel: cancel,
|
|
3647
3650
|
giftSent: giftSent,
|
|
3648
3651
|
successfully: successfully,
|
|
3649
|
-
entitlement: entitlement
|
|
3652
|
+
entitlement: entitlement,
|
|
3653
|
+
recaptcha: recaptcha
|
|
3650
3654
|
};
|
|
3651
3655
|
|
|
3652
3656
|
var labels$f = {
|
|
@@ -4329,7 +4333,8 @@ var labels$3 = {
|
|
|
4329
4333
|
title: "Status",
|
|
4330
4334
|
active: "Active",
|
|
4331
4335
|
inTrial: "In trial",
|
|
4332
|
-
endingSoon: "Ending soon"
|
|
4336
|
+
endingSoon: "Ending soon",
|
|
4337
|
+
scheduled: "Scheduled"
|
|
4333
4338
|
},
|
|
4334
4339
|
shipments: "Shipments remaining",
|
|
4335
4340
|
logout: "Logout",
|
|
@@ -4355,6 +4360,7 @@ var labels$3 = {
|
|
|
4355
4360
|
paymentSource: "Payment cards",
|
|
4356
4361
|
actions: "Actions",
|
|
4357
4362
|
expiresOn: "Ends",
|
|
4363
|
+
startsOn: "Starts",
|
|
4358
4364
|
renewsOn: "Renews",
|
|
4359
4365
|
canceledOn: "Canceled on",
|
|
4360
4366
|
recipient: "Recipient",
|
|
@@ -4406,7 +4412,8 @@ var labels$2 = {
|
|
|
4406
4412
|
title: "Statut",
|
|
4407
4413
|
active: "Active",
|
|
4408
4414
|
inTrial: "Dans l'essai",
|
|
4409
|
-
endingSoon: "Fin bientôt"
|
|
4415
|
+
endingSoon: "Fin bientôt",
|
|
4416
|
+
scheduled: "Programmé"
|
|
4410
4417
|
},
|
|
4411
4418
|
shipments: "Expéditions restantes",
|
|
4412
4419
|
logout: "Déconnexion",
|
|
@@ -4432,6 +4439,7 @@ var labels$2 = {
|
|
|
4432
4439
|
paymentSource: "Sources de paiement",
|
|
4433
4440
|
actions: "Actes",
|
|
4434
4441
|
expiresOn: "Expire le",
|
|
4442
|
+
startsOn: "Débute le",
|
|
4435
4443
|
renewsOn: "Renouvelle le",
|
|
4436
4444
|
canceledOn: "Annulé le",
|
|
4437
4445
|
recipient: "Destinataire",
|
|
@@ -4464,7 +4472,7 @@ var messages$2 = {
|
|
|
4464
4472
|
isSureToCancel: "Êtes-vous certain de vouloir annuler votre abonnement?",
|
|
4465
4473
|
loading: "Annulation de l'abonnement",
|
|
4466
4474
|
success: "L'abonnement a été annulé avec succès",
|
|
4467
|
-
error: "Une
|
|
4475
|
+
error: "Une erreur s'est produite lors de l'annulation de l'abonnement"
|
|
4468
4476
|
}
|
|
4469
4477
|
};
|
|
4470
4478
|
var dashboard_fr = {
|
|
@@ -6297,13 +6305,34 @@ const getAddressById = id => {
|
|
|
6297
6305
|
};
|
|
6298
6306
|
/**
|
|
6299
6307
|
* Transforms locale names stored in our backend like
|
|
6300
|
-
* "en_US" into the
|
|
6308
|
+
* "en_US" into the standard accepted in core i18n methods: "en-US"
|
|
6301
6309
|
* @param {string} localeName
|
|
6302
6310
|
* @return {string | undefined}
|
|
6303
6311
|
* @example getCanonicalLocaleFormat("en_US") => "en-US"
|
|
6304
6312
|
*/
|
|
6305
6313
|
|
|
6306
6314
|
const getCanonicalLocaleFormat = localeName => localeName === null || localeName === void 0 ? void 0 : localeName.replace("_", "-");
|
|
6315
|
+
/**
|
|
6316
|
+
* @param {string} localeName
|
|
6317
|
+
* @return {string | undefined}
|
|
6318
|
+
* @example getLanguageWithoutRegion("en-US") => "en"
|
|
6319
|
+
*/
|
|
6320
|
+
|
|
6321
|
+
const getLanguageWithoutRegion = localeName => {
|
|
6322
|
+
var _getCanonicalLocaleFo;
|
|
6323
|
+
|
|
6324
|
+
return (_getCanonicalLocaleFo = getCanonicalLocaleFormat(localeName)) === null || _getCanonicalLocaleFo === void 0 ? void 0 : _getCanonicalLocaleFo.split("-")[0];
|
|
6325
|
+
};
|
|
6326
|
+
/**
|
|
6327
|
+
* Gets the current page language or fallbacks to site default
|
|
6328
|
+
* @return {string | undefined}
|
|
6329
|
+
*/
|
|
6330
|
+
|
|
6331
|
+
const getPageOrDefaultLanguage = () => {
|
|
6332
|
+
var _window$Pelcro$helper, _window$Pelcro, _window$Pelcro$site, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
6333
|
+
|
|
6334
|
+
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$site = _window$Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read) === null || _window$Pelcro$site$r === void 0 ? void 0 : (_window$Pelcro$site$r2 = _window$Pelcro$site$r.call(_window$Pelcro$site)) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.default_locale);
|
|
6335
|
+
};
|
|
6307
6336
|
/**
|
|
6308
6337
|
* Returns a formatted price string depending on locale
|
|
6309
6338
|
* @param {number} amount
|
|
@@ -6313,7 +6342,7 @@ const getCanonicalLocaleFormat = localeName => localeName === null || localeName
|
|
|
6313
6342
|
* @example getFormattedPriceByLocal(10, 'USD', 'en-US') => "$10.00"
|
|
6314
6343
|
*/
|
|
6315
6344
|
|
|
6316
|
-
const getFormattedPriceByLocal = (amount, currency = "USD", locale = "en
|
|
6345
|
+
const getFormattedPriceByLocal = (amount, currency = "USD", locale = "en") => {
|
|
6317
6346
|
const formatter = new Intl.NumberFormat(getCanonicalLocaleFormat(locale), {
|
|
6318
6347
|
style: "currency",
|
|
6319
6348
|
currency
|
|
@@ -6338,8 +6367,7 @@ const calcAndFormatItemsTotal = (items, currency) => {
|
|
|
6338
6367
|
totalWithoutDividingBy100 += parseFloat(item.price ? (item.price * item.quantity).toFixed(2) : item.amount.toFixed(2));
|
|
6339
6368
|
}
|
|
6340
6369
|
|
|
6341
|
-
|
|
6342
|
-
return getFormattedPriceByLocal(totalWithoutDividingBy100, currency, locale);
|
|
6370
|
+
return getFormattedPriceByLocal(totalWithoutDividingBy100, currency, getPageOrDefaultLanguage());
|
|
6343
6371
|
};
|
|
6344
6372
|
/**
|
|
6345
6373
|
* returns true if the URL contains a supported view trigger URL
|
|
@@ -6353,12 +6381,15 @@ const isValidViewFromURL = viewID => {
|
|
|
6353
6381
|
}
|
|
6354
6382
|
|
|
6355
6383
|
return false;
|
|
6384
|
+
/**
|
|
6385
|
+
*
|
|
6386
|
+
*/
|
|
6356
6387
|
|
|
6357
6388
|
function hasValidNewsletterUpdateUrl() {
|
|
6358
|
-
var _window$
|
|
6389
|
+
var _window$Pelcro2, _window$Pelcro2$uiSet;
|
|
6359
6390
|
|
|
6360
6391
|
if (viewID !== "newsletter-update") return false;
|
|
6361
|
-
const newsletters = (_window$
|
|
6392
|
+
const newsletters = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.newsletters;
|
|
6362
6393
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
6363
6394
|
|
|
6364
6395
|
if (!siteHasNewslettersDefined) {
|
|
@@ -6531,10 +6562,20 @@ const getPaymentCardIcon$1 = name => {
|
|
|
6531
6562
|
d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"
|
|
6532
6563
|
}));
|
|
6533
6564
|
};
|
|
6565
|
+
/**
|
|
6566
|
+
* Gets the current date with time set to 0
|
|
6567
|
+
* @param {Date} dateObject
|
|
6568
|
+
* @return {Date}
|
|
6569
|
+
*/
|
|
6570
|
+
|
|
6571
|
+
function getDateWithoutTime(dateObject) {
|
|
6572
|
+
const date = new Date(dateObject.getTime());
|
|
6573
|
+
date.setHours(0, 0, 0, 0);
|
|
6574
|
+
return date;
|
|
6575
|
+
}
|
|
6534
6576
|
|
|
6535
|
-
var _window$Pelcro, _window$Pelcro$site, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
6536
6577
|
const resources = {
|
|
6537
|
-
|
|
6578
|
+
en: {
|
|
6538
6579
|
common: common_en,
|
|
6539
6580
|
paymentMethod: paymentMethod_en,
|
|
6540
6581
|
newsletter: newsletter_en,
|
|
@@ -6556,7 +6597,7 @@ const resources = {
|
|
|
6556
6597
|
select: select_en,
|
|
6557
6598
|
notification: notification_en
|
|
6558
6599
|
},
|
|
6559
|
-
|
|
6600
|
+
fr: {
|
|
6560
6601
|
common: common_fr,
|
|
6561
6602
|
paymentMethod: paymentMethod_fr,
|
|
6562
6603
|
newsletter: newsletter_fr,
|
|
@@ -6578,13 +6619,14 @@ const resources = {
|
|
|
6578
6619
|
select: select_fr,
|
|
6579
6620
|
notification: notification_fr
|
|
6580
6621
|
}
|
|
6581
|
-
};
|
|
6582
|
-
|
|
6583
|
-
|
|
6622
|
+
}; // set UI language to the page language or default to the language in site settings
|
|
6623
|
+
|
|
6624
|
+
const locale = getPageOrDefaultLanguage();
|
|
6584
6625
|
i18next.use(initReactI18next) // passes i18n down to react-i18next,
|
|
6585
6626
|
.init({
|
|
6586
6627
|
resources,
|
|
6587
|
-
lng:
|
|
6628
|
+
lng: locale,
|
|
6629
|
+
fallbackLng: "en",
|
|
6588
6630
|
// debug: true,
|
|
6589
6631
|
interpolation: {
|
|
6590
6632
|
escapeValue: false // react already safes from xss
|
|
@@ -6595,6 +6637,16 @@ i18next.use(initReactI18next) // passes i18n down to react-i18next,
|
|
|
6595
6637
|
|
|
6596
6638
|
}
|
|
6597
6639
|
});
|
|
6640
|
+
const pageLanguageObserver = new MutationObserver(mutationsList => {
|
|
6641
|
+
mutationsList.forEach(mutationRecord => {
|
|
6642
|
+
if (mutationRecord.attributeName === "lang") {
|
|
6643
|
+
i18next.changeLanguage(window.Pelcro.helpers.getHtmlLanguageAttribute());
|
|
6644
|
+
}
|
|
6645
|
+
});
|
|
6646
|
+
});
|
|
6647
|
+
pageLanguageObserver.observe(document.documentElement, {
|
|
6648
|
+
attributes: true
|
|
6649
|
+
});
|
|
6598
6650
|
|
|
6599
6651
|
function _classPrivateFieldGet(receiver, privateMap) {
|
|
6600
6652
|
var descriptor = privateMap.get(receiver);
|
|
@@ -6847,8 +6899,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
|
|
|
6847
6899
|
|
|
6848
6900
|
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}}
|
|
6849
6901
|
|
|
6850
|
-
function _extends$
|
|
6851
|
-
_extends$
|
|
6902
|
+
function _extends$v() {
|
|
6903
|
+
_extends$v = Object.assign || function (target) {
|
|
6852
6904
|
for (var i = 1; i < arguments.length; i++) {
|
|
6853
6905
|
var source = arguments[i];
|
|
6854
6906
|
|
|
@@ -6862,7 +6914,7 @@ function _extends$u() {
|
|
|
6862
6914
|
return target;
|
|
6863
6915
|
};
|
|
6864
6916
|
|
|
6865
|
-
return _extends$
|
|
6917
|
+
return _extends$v.apply(this, arguments);
|
|
6866
6918
|
}
|
|
6867
6919
|
|
|
6868
6920
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
@@ -6952,7 +7004,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
|
|
|
6952
7004
|
var reducer = function reducer(state, action) {
|
|
6953
7005
|
switch (action.type) {
|
|
6954
7006
|
case ActionType.ADD_TOAST:
|
|
6955
|
-
return _extends$
|
|
7007
|
+
return _extends$v({}, state, {
|
|
6956
7008
|
toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
|
|
6957
7009
|
});
|
|
6958
7010
|
|
|
@@ -6962,9 +7014,9 @@ var reducer = function reducer(state, action) {
|
|
|
6962
7014
|
clearFromRemoveQueue(action.toast.id);
|
|
6963
7015
|
}
|
|
6964
7016
|
|
|
6965
|
-
return _extends$
|
|
7017
|
+
return _extends$v({}, state, {
|
|
6966
7018
|
toasts: state.toasts.map(function (t) {
|
|
6967
|
-
return t.id === action.toast.id ? _extends$
|
|
7019
|
+
return t.id === action.toast.id ? _extends$v({}, t, action.toast) : t;
|
|
6968
7020
|
})
|
|
6969
7021
|
});
|
|
6970
7022
|
|
|
@@ -6991,9 +7043,9 @@ var reducer = function reducer(state, action) {
|
|
|
6991
7043
|
});
|
|
6992
7044
|
}
|
|
6993
7045
|
|
|
6994
|
-
return _extends$
|
|
7046
|
+
return _extends$v({}, state, {
|
|
6995
7047
|
toasts: state.toasts.map(function (t) {
|
|
6996
|
-
return t.id === toastId || toastId === undefined ? _extends$
|
|
7048
|
+
return t.id === toastId || toastId === undefined ? _extends$v({}, t, {
|
|
6997
7049
|
visible: false
|
|
6998
7050
|
}) : t;
|
|
6999
7051
|
})
|
|
@@ -7001,28 +7053,28 @@ var reducer = function reducer(state, action) {
|
|
|
7001
7053
|
|
|
7002
7054
|
case ActionType.REMOVE_TOAST:
|
|
7003
7055
|
if (action.toastId === undefined) {
|
|
7004
|
-
return _extends$
|
|
7056
|
+
return _extends$v({}, state, {
|
|
7005
7057
|
toasts: []
|
|
7006
7058
|
});
|
|
7007
7059
|
}
|
|
7008
7060
|
|
|
7009
|
-
return _extends$
|
|
7061
|
+
return _extends$v({}, state, {
|
|
7010
7062
|
toasts: state.toasts.filter(function (t) {
|
|
7011
7063
|
return t.id !== action.toastId;
|
|
7012
7064
|
})
|
|
7013
7065
|
});
|
|
7014
7066
|
|
|
7015
7067
|
case ActionType.START_PAUSE:
|
|
7016
|
-
return _extends$
|
|
7068
|
+
return _extends$v({}, state, {
|
|
7017
7069
|
pausedAt: action.time
|
|
7018
7070
|
});
|
|
7019
7071
|
|
|
7020
7072
|
case ActionType.END_PAUSE:
|
|
7021
7073
|
var diff = action.time - (state.pausedAt || 0);
|
|
7022
|
-
return _extends$
|
|
7074
|
+
return _extends$v({}, state, {
|
|
7023
7075
|
pausedAt: undefined,
|
|
7024
7076
|
toasts: state.toasts.map(function (t) {
|
|
7025
|
-
return _extends$
|
|
7077
|
+
return _extends$v({}, t, {
|
|
7026
7078
|
pauseDuration: t.pauseDuration + diff
|
|
7027
7079
|
});
|
|
7028
7080
|
})
|
|
@@ -7069,12 +7121,12 @@ var useStore = function useStore(toastOptions) {
|
|
|
7069
7121
|
var mergedToasts = state.toasts.map(function (t) {
|
|
7070
7122
|
var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
|
|
7071
7123
|
|
|
7072
|
-
return _extends$
|
|
7124
|
+
return _extends$v({}, toastOptions, toastOptions[t.type], t, {
|
|
7073
7125
|
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],
|
|
7074
|
-
style: _extends$
|
|
7126
|
+
style: _extends$v({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
|
|
7075
7127
|
});
|
|
7076
7128
|
});
|
|
7077
|
-
return _extends$
|
|
7129
|
+
return _extends$v({}, state, {
|
|
7078
7130
|
toasts: mergedToasts
|
|
7079
7131
|
});
|
|
7080
7132
|
};
|
|
@@ -7084,7 +7136,7 @@ var createToast = function createToast(message, type, opts) {
|
|
|
7084
7136
|
type = 'blank';
|
|
7085
7137
|
}
|
|
7086
7138
|
|
|
7087
|
-
return _extends$
|
|
7139
|
+
return _extends$v({
|
|
7088
7140
|
createdAt: Date.now(),
|
|
7089
7141
|
visible: true,
|
|
7090
7142
|
type: type,
|
|
@@ -7134,14 +7186,14 @@ toast.remove = function (toastId) {
|
|
|
7134
7186
|
};
|
|
7135
7187
|
|
|
7136
7188
|
toast.promise = function (promise, msgs, opts) {
|
|
7137
|
-
var id = toast.loading(msgs.loading, _extends$
|
|
7189
|
+
var id = toast.loading(msgs.loading, _extends$v({}, opts, opts == null ? void 0 : opts.loading));
|
|
7138
7190
|
promise.then(function (p) {
|
|
7139
|
-
toast.success(resolveValue(msgs.success, p), _extends$
|
|
7191
|
+
toast.success(resolveValue(msgs.success, p), _extends$v({
|
|
7140
7192
|
id: id
|
|
7141
7193
|
}, opts, opts == null ? void 0 : opts.success));
|
|
7142
7194
|
return p;
|
|
7143
7195
|
})["catch"](function (e) {
|
|
7144
|
-
toast.error(resolveValue(msgs.error, e), _extends$
|
|
7196
|
+
toast.error(resolveValue(msgs.error, e), _extends$v({
|
|
7145
7197
|
id: id
|
|
7146
7198
|
}, opts, opts == null ? void 0 : opts.error));
|
|
7147
7199
|
});
|
|
@@ -7480,7 +7532,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
|
|
|
7480
7532
|
var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
|
|
7481
7533
|
return createElement(ToastBarBase, {
|
|
7482
7534
|
className: toast.className,
|
|
7483
|
-
style: _extends$
|
|
7535
|
+
style: _extends$v({}, animationStyle, style, toast.style)
|
|
7484
7536
|
}, typeof children === 'function' ? children({
|
|
7485
7537
|
icon: icon,
|
|
7486
7538
|
message: message
|
|
@@ -7510,7 +7562,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
|
|
|
7510
7562
|
} : position.includes('right') ? {
|
|
7511
7563
|
justifyContent: 'flex-end'
|
|
7512
7564
|
} : {};
|
|
7513
|
-
return _extends$
|
|
7565
|
+
return _extends$v({
|
|
7514
7566
|
left: 0,
|
|
7515
7567
|
right: 0,
|
|
7516
7568
|
display: 'flex',
|
|
@@ -7537,7 +7589,7 @@ var Toaster = function Toaster(_ref) {
|
|
|
7537
7589
|
handlers = _useToaster.handlers;
|
|
7538
7590
|
|
|
7539
7591
|
return createElement("div", {
|
|
7540
|
-
style: _extends$
|
|
7592
|
+
style: _extends$v({
|
|
7541
7593
|
position: 'fixed',
|
|
7542
7594
|
zIndex: 9999,
|
|
7543
7595
|
top: DEFAULT_OFFSET,
|
|
@@ -7572,82 +7624,82 @@ var Toaster = function Toaster(_ref) {
|
|
|
7572
7624
|
}));
|
|
7573
7625
|
};
|
|
7574
7626
|
|
|
7575
|
-
var _path$
|
|
7627
|
+
var _path$s;
|
|
7576
7628
|
|
|
7577
|
-
function _extends$
|
|
7629
|
+
function _extends$u() { _extends$u = 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$u.apply(this, arguments); }
|
|
7578
7630
|
|
|
7579
7631
|
function SvgCheckSolid(props) {
|
|
7580
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7632
|
+
return /*#__PURE__*/React.createElement("svg", _extends$u({
|
|
7581
7633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7582
7634
|
className: "h-5 w-5",
|
|
7583
7635
|
viewBox: "0 0 20 20",
|
|
7584
7636
|
fill: "currentColor"
|
|
7585
|
-
}, props), _path$
|
|
7637
|
+
}, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
|
|
7586
7638
|
fillRule: "evenodd",
|
|
7587
7639
|
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",
|
|
7588
7640
|
clipRule: "evenodd"
|
|
7589
7641
|
})));
|
|
7590
7642
|
}
|
|
7591
7643
|
|
|
7592
|
-
var _path$
|
|
7644
|
+
var _path$r;
|
|
7593
7645
|
|
|
7594
|
-
function _extends$
|
|
7646
|
+
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); }
|
|
7595
7647
|
|
|
7596
7648
|
function SvgXIcon(props) {
|
|
7597
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7649
|
+
return /*#__PURE__*/React.createElement("svg", _extends$t({
|
|
7598
7650
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7599
7651
|
viewBox: "0 0 20 20",
|
|
7600
7652
|
fill: "currentColor"
|
|
7601
|
-
}, props), _path$
|
|
7653
|
+
}, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
|
|
7602
7654
|
fill: "evenodd",
|
|
7603
7655
|
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",
|
|
7604
7656
|
clipRule: "evenodd"
|
|
7605
7657
|
})));
|
|
7606
7658
|
}
|
|
7607
7659
|
|
|
7608
|
-
var _path$
|
|
7660
|
+
var _path$q;
|
|
7609
7661
|
|
|
7610
|
-
function _extends$
|
|
7662
|
+
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); }
|
|
7611
7663
|
|
|
7612
7664
|
function SvgXIconSolid(props) {
|
|
7613
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7665
|
+
return /*#__PURE__*/React.createElement("svg", _extends$s({
|
|
7614
7666
|
className: "plc-w-4 plc-h-4",
|
|
7615
7667
|
fill: "currentColor",
|
|
7616
7668
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7617
7669
|
viewBox: "0 0 100 100"
|
|
7618
|
-
}, props), _path$
|
|
7670
|
+
}, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
|
|
7619
7671
|
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"
|
|
7620
7672
|
})));
|
|
7621
7673
|
}
|
|
7622
7674
|
|
|
7623
|
-
var _path$
|
|
7675
|
+
var _path$p;
|
|
7624
7676
|
|
|
7625
|
-
function _extends$
|
|
7677
|
+
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); }
|
|
7626
7678
|
|
|
7627
7679
|
function SvgExclamation(props) {
|
|
7628
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7680
|
+
return /*#__PURE__*/React.createElement("svg", _extends$r({
|
|
7629
7681
|
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
7630
7682
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7631
7683
|
viewBox: "0 0 20 20",
|
|
7632
7684
|
fill: "currentColor"
|
|
7633
|
-
}, props), _path$
|
|
7685
|
+
}, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
|
|
7634
7686
|
fillRule: "evenodd",
|
|
7635
7687
|
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",
|
|
7636
7688
|
clipRule: "evenodd"
|
|
7637
7689
|
})));
|
|
7638
7690
|
}
|
|
7639
7691
|
|
|
7640
|
-
var _path$
|
|
7692
|
+
var _path$o, _path2$3;
|
|
7641
7693
|
|
|
7642
|
-
function _extends$
|
|
7694
|
+
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); }
|
|
7643
7695
|
|
|
7644
7696
|
function SvgSpinner(props) {
|
|
7645
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7697
|
+
return /*#__PURE__*/React.createElement("svg", _extends$q({
|
|
7646
7698
|
className: "plc-animate-spin",
|
|
7647
7699
|
viewBox: "0 0 24 24",
|
|
7648
7700
|
fill: "currentColor",
|
|
7649
7701
|
xmlns: "http://www.w3.org/2000/svg"
|
|
7650
|
-
}, props), _path$
|
|
7702
|
+
}, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
|
|
7651
7703
|
opacity: 0.2,
|
|
7652
7704
|
fill: "evenodd",
|
|
7653
7705
|
clipRule: "evenodd",
|
|
@@ -8208,6 +8260,175 @@ function shouldBlurContent(entitlements) {
|
|
|
8208
8260
|
return entitlements.every(entitlement => !window.Pelcro.user.isEntitledTo(entitlement));
|
|
8209
8261
|
}
|
|
8210
8262
|
|
|
8263
|
+
var pure$1 = createCommonjsModule(function (module, exports) {
|
|
8264
|
+
|
|
8265
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8266
|
+
|
|
8267
|
+
function _typeof(obj) {
|
|
8268
|
+
"@babel/helpers - typeof";
|
|
8269
|
+
|
|
8270
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
8271
|
+
_typeof = function (obj) {
|
|
8272
|
+
return typeof obj;
|
|
8273
|
+
};
|
|
8274
|
+
} else {
|
|
8275
|
+
_typeof = function (obj) {
|
|
8276
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
8277
|
+
};
|
|
8278
|
+
}
|
|
8279
|
+
|
|
8280
|
+
return _typeof(obj);
|
|
8281
|
+
}
|
|
8282
|
+
|
|
8283
|
+
var V3_URL = 'https://js.stripe.com/v3';
|
|
8284
|
+
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
8285
|
+
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';
|
|
8286
|
+
var findScript = function findScript() {
|
|
8287
|
+
var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
|
|
8288
|
+
|
|
8289
|
+
for (var i = 0; i < scripts.length; i++) {
|
|
8290
|
+
var script = scripts[i];
|
|
8291
|
+
|
|
8292
|
+
if (!V3_URL_REGEX.test(script.src)) {
|
|
8293
|
+
continue;
|
|
8294
|
+
}
|
|
8295
|
+
|
|
8296
|
+
return script;
|
|
8297
|
+
}
|
|
8298
|
+
|
|
8299
|
+
return null;
|
|
8300
|
+
};
|
|
8301
|
+
|
|
8302
|
+
var injectScript = function injectScript(params) {
|
|
8303
|
+
var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
|
|
8304
|
+
var script = document.createElement('script');
|
|
8305
|
+
script.src = "".concat(V3_URL).concat(queryString);
|
|
8306
|
+
var headOrBody = document.head || document.body;
|
|
8307
|
+
|
|
8308
|
+
if (!headOrBody) {
|
|
8309
|
+
throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
|
|
8310
|
+
}
|
|
8311
|
+
|
|
8312
|
+
headOrBody.appendChild(script);
|
|
8313
|
+
return script;
|
|
8314
|
+
};
|
|
8315
|
+
|
|
8316
|
+
var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
8317
|
+
if (!stripe || !stripe._registerWrapper) {
|
|
8318
|
+
return;
|
|
8319
|
+
}
|
|
8320
|
+
|
|
8321
|
+
stripe._registerWrapper({
|
|
8322
|
+
name: 'stripe-js',
|
|
8323
|
+
version: "1.21.1",
|
|
8324
|
+
startTime: startTime
|
|
8325
|
+
});
|
|
8326
|
+
};
|
|
8327
|
+
|
|
8328
|
+
var stripePromise = null;
|
|
8329
|
+
var loadScript = function loadScript(params) {
|
|
8330
|
+
// Ensure that we only attempt to load Stripe.js at most once
|
|
8331
|
+
if (stripePromise !== null) {
|
|
8332
|
+
return stripePromise;
|
|
8333
|
+
}
|
|
8334
|
+
|
|
8335
|
+
stripePromise = new Promise(function (resolve, reject) {
|
|
8336
|
+
if (typeof window === 'undefined') {
|
|
8337
|
+
// Resolve to null when imported server side. This makes the module
|
|
8338
|
+
// safe to import in an isomorphic code base.
|
|
8339
|
+
resolve(null);
|
|
8340
|
+
return;
|
|
8341
|
+
}
|
|
8342
|
+
|
|
8343
|
+
if (window.Stripe && params) {
|
|
8344
|
+
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
8345
|
+
}
|
|
8346
|
+
|
|
8347
|
+
if (window.Stripe) {
|
|
8348
|
+
resolve(window.Stripe);
|
|
8349
|
+
return;
|
|
8350
|
+
}
|
|
8351
|
+
|
|
8352
|
+
try {
|
|
8353
|
+
var script = findScript();
|
|
8354
|
+
|
|
8355
|
+
if (script && params) {
|
|
8356
|
+
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
8357
|
+
} else if (!script) {
|
|
8358
|
+
script = injectScript(params);
|
|
8359
|
+
}
|
|
8360
|
+
|
|
8361
|
+
script.addEventListener('load', function () {
|
|
8362
|
+
if (window.Stripe) {
|
|
8363
|
+
resolve(window.Stripe);
|
|
8364
|
+
} else {
|
|
8365
|
+
reject(new Error('Stripe.js not available'));
|
|
8366
|
+
}
|
|
8367
|
+
});
|
|
8368
|
+
script.addEventListener('error', function () {
|
|
8369
|
+
reject(new Error('Failed to load Stripe.js'));
|
|
8370
|
+
});
|
|
8371
|
+
} catch (error) {
|
|
8372
|
+
reject(error);
|
|
8373
|
+
return;
|
|
8374
|
+
}
|
|
8375
|
+
});
|
|
8376
|
+
return stripePromise;
|
|
8377
|
+
};
|
|
8378
|
+
var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
8379
|
+
if (maybeStripe === null) {
|
|
8380
|
+
return null;
|
|
8381
|
+
}
|
|
8382
|
+
|
|
8383
|
+
var stripe = maybeStripe.apply(undefined, args);
|
|
8384
|
+
registerWrapper(stripe, startTime);
|
|
8385
|
+
return stripe;
|
|
8386
|
+
};
|
|
8387
|
+
var validateLoadParams = function validateLoadParams(params) {
|
|
8388
|
+
var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
|
|
8389
|
+
|
|
8390
|
+
if (params === null || _typeof(params) !== 'object') {
|
|
8391
|
+
throw new Error(errorMessage);
|
|
8392
|
+
}
|
|
8393
|
+
|
|
8394
|
+
if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') {
|
|
8395
|
+
return params;
|
|
8396
|
+
}
|
|
8397
|
+
|
|
8398
|
+
throw new Error(errorMessage);
|
|
8399
|
+
};
|
|
8400
|
+
|
|
8401
|
+
var loadParams;
|
|
8402
|
+
var loadStripeCalled = false;
|
|
8403
|
+
var loadStripe = function loadStripe() {
|
|
8404
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8405
|
+
args[_key] = arguments[_key];
|
|
8406
|
+
}
|
|
8407
|
+
|
|
8408
|
+
loadStripeCalled = true;
|
|
8409
|
+
var startTime = Date.now();
|
|
8410
|
+
return loadScript(loadParams).then(function (maybeStripe) {
|
|
8411
|
+
return initStripe(maybeStripe, args, startTime);
|
|
8412
|
+
});
|
|
8413
|
+
};
|
|
8414
|
+
|
|
8415
|
+
loadStripe.setLoadParameters = function (params) {
|
|
8416
|
+
if (loadStripeCalled) {
|
|
8417
|
+
throw new Error('You cannot change load parameters after calling loadStripe');
|
|
8418
|
+
}
|
|
8419
|
+
|
|
8420
|
+
loadParams = validateLoadParams(params);
|
|
8421
|
+
};
|
|
8422
|
+
|
|
8423
|
+
exports.loadStripe = loadStripe;
|
|
8424
|
+
});
|
|
8425
|
+
|
|
8426
|
+
unwrapExports(pure$1);
|
|
8427
|
+
pure$1.loadStripe;
|
|
8428
|
+
|
|
8429
|
+
var pure = pure$1;
|
|
8430
|
+
var pure_1 = pure.loadStripe;
|
|
8431
|
+
|
|
8211
8432
|
/**
|
|
8212
8433
|
* @typedef {Object} OptionsType
|
|
8213
8434
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -8233,6 +8454,7 @@ const optionsController = options => {
|
|
|
8233
8454
|
enableURLTriggers: initViewFromURL,
|
|
8234
8455
|
enableTheme: applyPelcroTheme,
|
|
8235
8456
|
enablePaywalls: initPaywalls,
|
|
8457
|
+
loadSecuritySDK: initSecuritySdk,
|
|
8236
8458
|
enableGoogleAnalytics: initGATracking
|
|
8237
8459
|
}; // Only execute enabled options
|
|
8238
8460
|
|
|
@@ -8277,8 +8499,15 @@ const initPaywalls = () => {
|
|
|
8277
8499
|
}
|
|
8278
8500
|
};
|
|
8279
8501
|
const loadPaymentSDKs = () => {
|
|
8280
|
-
//
|
|
8281
|
-
|
|
8502
|
+
// Lazy load stripe's SDK
|
|
8503
|
+
const {
|
|
8504
|
+
whenUserReady
|
|
8505
|
+
} = usePelcro.getStore();
|
|
8506
|
+
whenUserReady(() => {
|
|
8507
|
+
if (!window.Stripe) {
|
|
8508
|
+
pure_1(window.Pelcro.environment.stripe);
|
|
8509
|
+
}
|
|
8510
|
+
}); // Load PayPal SDK's
|
|
8282
8511
|
|
|
8283
8512
|
const supportsPaypal = Boolean(window.Pelcro.site.read().braintree_tokenization);
|
|
8284
8513
|
|
|
@@ -8287,6 +8516,18 @@ const loadPaymentSDKs = () => {
|
|
|
8287
8516
|
window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/paypal-checkout.min.js", "braintree-paypal-sdk");
|
|
8288
8517
|
}
|
|
8289
8518
|
};
|
|
8519
|
+
const initSecuritySdk = () => {
|
|
8520
|
+
const {
|
|
8521
|
+
whenSiteReady
|
|
8522
|
+
} = usePelcro.getStore();
|
|
8523
|
+
whenSiteReady(() => {
|
|
8524
|
+
var _window$Pelcro$site$r2;
|
|
8525
|
+
|
|
8526
|
+
const securityKey = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.security_key;
|
|
8527
|
+
if (!securityKey) return;
|
|
8528
|
+
window.Pelcro.helpers.loadSDK(`https://www.google.com/recaptcha/enterprise.js?render=${securityKey}`, "pelcro-security-enteprise");
|
|
8529
|
+
});
|
|
8530
|
+
};
|
|
8290
8531
|
const initGATracking = () => {
|
|
8291
8532
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
8292
8533
|
|
|
@@ -8373,9 +8614,9 @@ const applyPelcroTheme = () => {
|
|
|
8373
8614
|
};
|
|
8374
8615
|
|
|
8375
8616
|
whenSiteReady(() => {
|
|
8376
|
-
var _window$Pelcro$site$
|
|
8617
|
+
var _window$Pelcro$site$r3, _window$Pelcro$site$r4;
|
|
8377
8618
|
|
|
8378
|
-
const primaryColorHex = (_window$Pelcro$site$
|
|
8619
|
+
const primaryColorHex = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site$r3.design_settings) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.primary_color;
|
|
8379
8620
|
|
|
8380
8621
|
if (!primaryColorHex) {
|
|
8381
8622
|
return;
|
|
@@ -8574,6 +8815,7 @@ const defaultOptions = {
|
|
|
8574
8815
|
enableURLTriggers: true,
|
|
8575
8816
|
enableTheme: true,
|
|
8576
8817
|
enablePaywalls: true,
|
|
8818
|
+
loadSecuritySDK: true,
|
|
8577
8819
|
enableGoogleAnalytics: false
|
|
8578
8820
|
};
|
|
8579
8821
|
const PelcroModalController = ({
|
|
@@ -9395,16 +9637,16 @@ const LoginPassword = props => /*#__PURE__*/React__default.createElement(Passwor
|
|
|
9395
9637
|
store: store$f
|
|
9396
9638
|
}, props));
|
|
9397
9639
|
|
|
9398
|
-
var _path$
|
|
9640
|
+
var _path$n;
|
|
9399
9641
|
|
|
9400
|
-
function _extends$
|
|
9642
|
+
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); }
|
|
9401
9643
|
|
|
9402
9644
|
function SvgCheck(props) {
|
|
9403
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
9645
|
+
return /*#__PURE__*/React.createElement("svg", _extends$p({
|
|
9404
9646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9405
9647
|
fill: "currentColor",
|
|
9406
9648
|
viewBox: "0 0 20 20"
|
|
9407
|
-
}, props), _path$
|
|
9649
|
+
}, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
|
|
9408
9650
|
fillRule: "evenodd",
|
|
9409
9651
|
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",
|
|
9410
9652
|
clipRule: "evenodd"
|
|
@@ -9514,35 +9756,53 @@ const RegisterContainer = ({
|
|
|
9514
9756
|
jobTitle,
|
|
9515
9757
|
selectFields
|
|
9516
9758
|
} = filteredData;
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
dispatch({
|
|
9529
|
-
type: DISABLE_REGISTRATION_BUTTON,
|
|
9530
|
-
payload: false
|
|
9759
|
+
|
|
9760
|
+
if (!hasSecurityTokenEnabled$1()) {
|
|
9761
|
+
sendRegisterRequest();
|
|
9762
|
+
return;
|
|
9763
|
+
}
|
|
9764
|
+
|
|
9765
|
+
window.grecaptcha.enterprise.ready(async () => {
|
|
9766
|
+
var _window$Pelcro$site$r;
|
|
9767
|
+
|
|
9768
|
+
const token = await window.grecaptcha.enterprise.execute((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.security_key, {
|
|
9769
|
+
action: "register"
|
|
9531
9770
|
});
|
|
9771
|
+
sendRegisterRequest(token);
|
|
9772
|
+
});
|
|
9532
9773
|
|
|
9533
|
-
|
|
9774
|
+
function sendRegisterRequest(securityToken) {
|
|
9775
|
+
window.Pelcro.user.register({
|
|
9776
|
+
email,
|
|
9777
|
+
password,
|
|
9778
|
+
first_name: firstName,
|
|
9779
|
+
last_name: lastName,
|
|
9780
|
+
security_token: securityToken,
|
|
9781
|
+
metadata: {
|
|
9782
|
+
organization,
|
|
9783
|
+
jobTitle,
|
|
9784
|
+
...selectFields
|
|
9785
|
+
}
|
|
9786
|
+
}, (err, res) => {
|
|
9534
9787
|
dispatch({
|
|
9535
|
-
type:
|
|
9536
|
-
payload:
|
|
9537
|
-
type: "error",
|
|
9538
|
-
content: getErrorMessages(err)
|
|
9539
|
-
}
|
|
9788
|
+
type: DISABLE_REGISTRATION_BUTTON,
|
|
9789
|
+
payload: false
|
|
9540
9790
|
});
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9791
|
+
|
|
9792
|
+
if (err) {
|
|
9793
|
+
dispatch({
|
|
9794
|
+
type: SHOW_ALERT,
|
|
9795
|
+
payload: {
|
|
9796
|
+
type: "error",
|
|
9797
|
+
content: getErrorMessages(err)
|
|
9798
|
+
}
|
|
9799
|
+
});
|
|
9800
|
+
onFailure(err);
|
|
9801
|
+
} else {
|
|
9802
|
+
onSuccess(res);
|
|
9803
|
+
}
|
|
9804
|
+
});
|
|
9805
|
+
}
|
|
9546
9806
|
};
|
|
9547
9807
|
|
|
9548
9808
|
const handleSocialLogin = ({
|
|
@@ -9693,16 +9953,25 @@ const RegisterContainer = ({
|
|
|
9693
9953
|
store: store$e
|
|
9694
9954
|
})));
|
|
9695
9955
|
};
|
|
9956
|
+
/**
|
|
9957
|
+
* Checks if the current site has security token enabled
|
|
9958
|
+
* @return {boolean}
|
|
9959
|
+
*/
|
|
9696
9960
|
|
|
9697
|
-
|
|
9961
|
+
function hasSecurityTokenEnabled$1() {
|
|
9962
|
+
const hasSecuritySdkLoaded = Boolean(window.grecaptcha);
|
|
9963
|
+
return hasSecuritySdkLoaded;
|
|
9964
|
+
}
|
|
9698
9965
|
|
|
9699
|
-
|
|
9966
|
+
var _path$m;
|
|
9967
|
+
|
|
9968
|
+
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); }
|
|
9700
9969
|
|
|
9701
9970
|
function SvgFacebookLogo(props) {
|
|
9702
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
9971
|
+
return /*#__PURE__*/React.createElement("svg", _extends$o({
|
|
9703
9972
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9704
9973
|
viewBox: "88.428 12.828 107.543 207.085"
|
|
9705
|
-
}, props), _path$
|
|
9974
|
+
}, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
|
|
9706
9975
|
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",
|
|
9707
9976
|
fill: "#3c5a9a"
|
|
9708
9977
|
})));
|
|
@@ -9714,7 +9983,7 @@ const FacebookLoginButton = ({
|
|
|
9714
9983
|
labelClassName = "",
|
|
9715
9984
|
iconClassName = ""
|
|
9716
9985
|
}) => {
|
|
9717
|
-
var _window$Pelcro$site$r
|
|
9986
|
+
var _window$Pelcro$site$r;
|
|
9718
9987
|
|
|
9719
9988
|
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;
|
|
9720
9989
|
const {
|
|
@@ -9753,7 +10022,7 @@ const FacebookLoginButton = ({
|
|
|
9753
10022
|
|
|
9754
10023
|
return facebookLoginEnabled ? /*#__PURE__*/React__default.createElement(FacebookLogin, {
|
|
9755
10024
|
appId: window.Pelcro.site.read().facebook_app_id,
|
|
9756
|
-
language: (
|
|
10025
|
+
language: getPageOrDefaultLanguage(),
|
|
9757
10026
|
fields: "first_name,last_name,email,picture",
|
|
9758
10027
|
callback: onSuccess,
|
|
9759
10028
|
onFailure: onFailure,
|
|
@@ -9775,15 +10044,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
|
|
|
9775
10044
|
unwrapExports(googleLogin);
|
|
9776
10045
|
var googleLogin_1 = googleLogin.GoogleLogin;
|
|
9777
10046
|
|
|
9778
|
-
var _path$
|
|
10047
|
+
var _path$l, _path2$2, _path3$1, _path4;
|
|
9779
10048
|
|
|
9780
|
-
function _extends$
|
|
10049
|
+
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); }
|
|
9781
10050
|
|
|
9782
10051
|
function SvgGoogleLogo(props) {
|
|
9783
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
10052
|
+
return /*#__PURE__*/React.createElement("svg", _extends$n({
|
|
9784
10053
|
viewBox: "0 0 24 24",
|
|
9785
10054
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9786
|
-
}, props), _path$
|
|
10055
|
+
}, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
|
|
9787
10056
|
fill: "#4285F4",
|
|
9788
10057
|
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"
|
|
9789
10058
|
})), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
|
|
@@ -9917,15 +10186,15 @@ function LoginView(props) {
|
|
|
9917
10186
|
}, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
|
|
9918
10187
|
}
|
|
9919
10188
|
|
|
9920
|
-
var _path$
|
|
10189
|
+
var _path$k, _path2$1, _path3;
|
|
9921
10190
|
|
|
9922
|
-
function _extends$
|
|
10191
|
+
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); }
|
|
9923
10192
|
|
|
9924
10193
|
function SvgPelcroAuthorship(props) {
|
|
9925
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
10194
|
+
return /*#__PURE__*/React.createElement("svg", _extends$m({
|
|
9926
10195
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9927
10196
|
viewBox: "0 -80.652 497.072 179.991"
|
|
9928
|
-
}, props), _path$
|
|
10197
|
+
}, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
|
|
9929
10198
|
fill: "none",
|
|
9930
10199
|
stroke: "#4a4a4a",
|
|
9931
10200
|
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"
|
|
@@ -10082,8 +10351,11 @@ const RegisterPassword = props => /*#__PURE__*/React__default.createElement(Pass
|
|
|
10082
10351
|
const RegisterButton = ({
|
|
10083
10352
|
name,
|
|
10084
10353
|
onClick,
|
|
10354
|
+
className,
|
|
10085
10355
|
...otherProps
|
|
10086
10356
|
}) => {
|
|
10357
|
+
var _window$Pelcro$site$r;
|
|
10358
|
+
|
|
10087
10359
|
const {
|
|
10088
10360
|
state: {
|
|
10089
10361
|
emailError,
|
|
@@ -10109,7 +10381,10 @@ const RegisterButton = ({
|
|
|
10109
10381
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
10110
10382
|
},
|
|
10111
10383
|
disabled: isDisabled,
|
|
10112
|
-
isLoading: buttonDisabled
|
|
10384
|
+
isLoading: buttonDisabled,
|
|
10385
|
+
className: `${className} g-recaptcha`,
|
|
10386
|
+
"data-action": "register",
|
|
10387
|
+
"data-sitekey": (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.security_key
|
|
10113
10388
|
}, otherProps), name !== null && name !== void 0 ? name : t("messages.createAccount"));
|
|
10114
10389
|
};
|
|
10115
10390
|
|
|
@@ -10313,7 +10588,17 @@ function RegisterView(props) {
|
|
|
10313
10588
|
className: "plc-w-full plc-mt-2",
|
|
10314
10589
|
id: "pelcro-submit",
|
|
10315
10590
|
name: t("messages.createAccount")
|
|
10316
|
-
}),
|
|
10591
|
+
}), hasSecurityTokenEnabled() && /*#__PURE__*/React__default.createElement("p", {
|
|
10592
|
+
className: "plc-text-sm plc-text-gray-500 plc-mt-1"
|
|
10593
|
+
}, /*#__PURE__*/React__default.createElement(Trans, {
|
|
10594
|
+
i18nKey: "messages:recaptcha"
|
|
10595
|
+
}, "This site is protected by reCAPTCHA and the Google", /*#__PURE__*/React__default.createElement(Link, {
|
|
10596
|
+
href: "https://policies.google.com/privacy",
|
|
10597
|
+
className: "plc-text-sm plc-text-gray-500"
|
|
10598
|
+
}, "Privacy Policy"), "and", /*#__PURE__*/React__default.createElement(Link, {
|
|
10599
|
+
href: "https://policies.google.com/terms",
|
|
10600
|
+
className: "plc-text-sm plc-text-gray-500"
|
|
10601
|
+
}, "Terms of Service"), "apply.")), socialLoginEnabled && /*#__PURE__*/React__default.createElement("div", {
|
|
10317
10602
|
className: "plc-mt-5"
|
|
10318
10603
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10319
10604
|
className: "plc-flex plc-items-center plc-justify-between "
|
|
@@ -10327,6 +10612,16 @@ function RegisterView(props) {
|
|
|
10327
10612
|
className: "plc-flex plc-justify-center plc-px-5 plc-mt-1 plc-space-x-3"
|
|
10328
10613
|
}, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
|
|
10329
10614
|
}
|
|
10615
|
+
/**
|
|
10616
|
+
* Checks if the current site has security token enabled
|
|
10617
|
+
* @return {boolean}
|
|
10618
|
+
*/
|
|
10619
|
+
|
|
10620
|
+
function hasSecurityTokenEnabled() {
|
|
10621
|
+
var _window$Pelcro$site, _window$Pelcro$site$r3;
|
|
10622
|
+
|
|
10623
|
+
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r3 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.security_key);
|
|
10624
|
+
}
|
|
10330
10625
|
|
|
10331
10626
|
function TextInput({
|
|
10332
10627
|
store,
|
|
@@ -13283,11 +13578,20 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13283
13578
|
const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
|
|
13284
13579
|
|
|
13285
13580
|
const PaymentMethodContainer = props => {
|
|
13286
|
-
|
|
13581
|
+
const [isStripeLoaded, setIsStripeLoaded] = useState(Boolean(window.Stripe));
|
|
13582
|
+
useEffect(() => {
|
|
13583
|
+
if (!window.Stripe) {
|
|
13584
|
+
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
13585
|
+
setIsStripeLoaded(true);
|
|
13586
|
+
});
|
|
13587
|
+
}
|
|
13588
|
+
}, []);
|
|
13589
|
+
|
|
13590
|
+
if (isStripeLoaded) {
|
|
13287
13591
|
return /*#__PURE__*/React__default.createElement(es_13, {
|
|
13288
13592
|
apiKey: window.Pelcro.environment.stripe,
|
|
13289
13593
|
stripeAccount: window.Pelcro.site.read().account_id,
|
|
13290
|
-
locale:
|
|
13594
|
+
locale: getPageOrDefaultLanguage()
|
|
13291
13595
|
}, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
|
|
13292
13596
|
store: store$d
|
|
13293
13597
|
}, props))));
|
|
@@ -13399,9 +13703,6 @@ const DiscountedPrice = props => {
|
|
|
13399
13703
|
percentOff
|
|
13400
13704
|
}
|
|
13401
13705
|
} = useContext(store$d);
|
|
13402
|
-
const {
|
|
13403
|
-
default_locale
|
|
13404
|
-
} = Pelcro.site.read();
|
|
13405
13706
|
const {
|
|
13406
13707
|
order,
|
|
13407
13708
|
plan
|
|
@@ -13409,7 +13710,7 @@ const DiscountedPrice = props => {
|
|
|
13409
13710
|
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;
|
|
13410
13711
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
13411
13712
|
const discountedPriceWithoutTax = updatedPrice - taxAmount;
|
|
13412
|
-
const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency,
|
|
13713
|
+
const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
13413
13714
|
|
|
13414
13715
|
if (percentOff) {
|
|
13415
13716
|
return /*#__PURE__*/React__default.createElement("div", Object.assign({
|
|
@@ -13442,12 +13743,9 @@ const SubmitPaymentMethod = ({
|
|
|
13442
13743
|
updatedPrice
|
|
13443
13744
|
}
|
|
13444
13745
|
} = useContext(store$d);
|
|
13445
|
-
const {
|
|
13446
|
-
default_locale
|
|
13447
|
-
} = Pelcro.site.read();
|
|
13448
13746
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
13449
13747
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
13450
|
-
const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency,
|
|
13748
|
+
const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
13451
13749
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
13452
13750
|
role: "submit",
|
|
13453
13751
|
className: "plc-w-full plc-py-3",
|
|
@@ -13465,17 +13763,17 @@ const SubmitPaymentMethod = ({
|
|
|
13465
13763
|
}, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
|
|
13466
13764
|
};
|
|
13467
13765
|
|
|
13468
|
-
var _path$
|
|
13766
|
+
var _path$j;
|
|
13469
13767
|
|
|
13470
|
-
function _extends$
|
|
13768
|
+
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); }
|
|
13471
13769
|
|
|
13472
13770
|
function SvgArrowLeft(props) {
|
|
13473
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
13771
|
+
return /*#__PURE__*/React.createElement("svg", _extends$l({
|
|
13474
13772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13475
13773
|
fill: "none",
|
|
13476
13774
|
viewBox: "0 0 24 24",
|
|
13477
13775
|
stroke: "currentColor"
|
|
13478
|
-
}, props), _path$
|
|
13776
|
+
}, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
|
|
13479
13777
|
strokeLinecap: "round",
|
|
13480
13778
|
strokeLinejoin: "round",
|
|
13481
13779
|
strokeWidth: 2,
|
|
@@ -13557,17 +13855,17 @@ const CouponCodeField = props => {
|
|
|
13557
13855
|
}, props));
|
|
13558
13856
|
};
|
|
13559
13857
|
|
|
13560
|
-
var _path$
|
|
13858
|
+
var _path$i;
|
|
13561
13859
|
|
|
13562
|
-
function _extends$
|
|
13860
|
+
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); }
|
|
13563
13861
|
|
|
13564
13862
|
function SvgTicket(props) {
|
|
13565
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
13863
|
+
return /*#__PURE__*/React.createElement("svg", _extends$k({
|
|
13566
13864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13567
13865
|
fill: "none",
|
|
13568
13866
|
viewBox: "0 0 24 24",
|
|
13569
13867
|
stroke: "currentColor"
|
|
13570
|
-
}, props), _path$
|
|
13868
|
+
}, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
|
|
13571
13869
|
strokeLinecap: "round",
|
|
13572
13870
|
strokeLinejoin: "round",
|
|
13573
13871
|
strokeWidth: 2,
|
|
@@ -13692,7 +13990,7 @@ class PaypalClient {
|
|
|
13692
13990
|
this.paypalButton = window.paypal.Buttons({
|
|
13693
13991
|
fundingSource: window.paypal.FUNDING.PAYPAL,
|
|
13694
13992
|
// button locale
|
|
13695
|
-
locale: (_this$config$locale = this.config.locale) !== null && _this$config$locale !== void 0 ? _this$config$locale :
|
|
13993
|
+
locale: (_this$config$locale = this.config.locale) !== null && _this$config$locale !== void 0 ? _this$config$locale : getPageOrDefaultLanguage(),
|
|
13696
13994
|
// button style
|
|
13697
13995
|
style: (_this$config$style = this.config.style) !== null && _this$config$style !== void 0 ? _this$config$style : defaultButtonStyle,
|
|
13698
13996
|
// create payment handler
|
|
@@ -13789,7 +14087,7 @@ class PaypalClient {
|
|
|
13789
14087
|
} : undefined,
|
|
13790
14088
|
shippingAddressEditable: this.config.shippingAddressEditable,
|
|
13791
14089
|
displayName: (_this$config$displayN = this.config.displayName) !== null && _this$config$displayN !== void 0 ? _this$config$displayN : this.siteInfo.name,
|
|
13792
|
-
locale: (_this$config$locale2 = this.config.locale) !== null && _this$config$locale2 !== void 0 ? _this$config$locale2 :
|
|
14090
|
+
locale: (_this$config$locale2 = this.config.locale) !== null && _this$config$locale2 !== void 0 ? _this$config$locale2 : getPageOrDefaultLanguage()
|
|
13793
14091
|
};
|
|
13794
14092
|
}
|
|
13795
14093
|
});
|
|
@@ -13798,7 +14096,7 @@ class PaypalClient {
|
|
|
13798
14096
|
writable: true,
|
|
13799
14097
|
value: () => {
|
|
13800
14098
|
const totalAmount = (this.product.quantity || 1) * this.amount;
|
|
13801
|
-
const priceFormatted = getFormattedPriceByLocal(totalAmount, this.product.currency,
|
|
14099
|
+
const priceFormatted = getFormattedPriceByLocal(totalAmount, this.product.currency, getPageOrDefaultLanguage());
|
|
13802
14100
|
const autoRenewed = this.product.auto_renew;
|
|
13803
14101
|
const {
|
|
13804
14102
|
interval,
|
|
@@ -13926,16 +14224,16 @@ const BankRedirection = () => {
|
|
|
13926
14224
|
}));
|
|
13927
14225
|
};
|
|
13928
14226
|
|
|
13929
|
-
var _path$
|
|
14227
|
+
var _path$h;
|
|
13930
14228
|
|
|
13931
|
-
function _extends$
|
|
14229
|
+
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); }
|
|
13932
14230
|
|
|
13933
14231
|
function SvgLock(props) {
|
|
13934
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
14232
|
+
return /*#__PURE__*/React.createElement("svg", _extends$j({
|
|
13935
14233
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13936
14234
|
viewBox: "0 0 20 20",
|
|
13937
14235
|
fill: "currentColor"
|
|
13938
|
-
}, props), _path$
|
|
14236
|
+
}, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
|
|
13939
14237
|
fillRule: "evenodd",
|
|
13940
14238
|
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",
|
|
13941
14239
|
clipRule: "evenodd"
|
|
@@ -13995,14 +14293,11 @@ const TaxAmount = () => {
|
|
|
13995
14293
|
taxAmount
|
|
13996
14294
|
}
|
|
13997
14295
|
} = useContext(store$d);
|
|
13998
|
-
const {
|
|
13999
|
-
default_locale
|
|
14000
|
-
} = Pelcro.site.read();
|
|
14001
14296
|
const {
|
|
14002
14297
|
plan
|
|
14003
14298
|
} = usePelcro();
|
|
14004
14299
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
14005
|
-
const priceFormatted = getFormattedPriceByLocal(taxAmount * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency,
|
|
14300
|
+
const priceFormatted = getFormattedPriceByLocal(taxAmount * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
14006
14301
|
|
|
14007
14302
|
if (taxAmount) {
|
|
14008
14303
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -14160,12 +14455,12 @@ function SubscriptionRenewModal({
|
|
|
14160
14455
|
}
|
|
14161
14456
|
SubscriptionRenewModal.viewId = "subscription-renew";
|
|
14162
14457
|
|
|
14163
|
-
var _path$
|
|
14458
|
+
var _path$g;
|
|
14164
14459
|
|
|
14165
|
-
function _extends$
|
|
14460
|
+
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); }
|
|
14166
14461
|
|
|
14167
14462
|
function SvgGift(props) {
|
|
14168
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
14463
|
+
return /*#__PURE__*/React.createElement("svg", _extends$i({
|
|
14169
14464
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
14170
14465
|
fill: "none",
|
|
14171
14466
|
stroke: "currentColor",
|
|
@@ -14174,7 +14469,7 @@ function SvgGift(props) {
|
|
|
14174
14469
|
strokeWidth: 2,
|
|
14175
14470
|
viewBox: "0 0 24 24",
|
|
14176
14471
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14177
|
-
}, props), _path$
|
|
14472
|
+
}, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
|
|
14178
14473
|
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"
|
|
14179
14474
|
})));
|
|
14180
14475
|
}
|
|
@@ -14875,10 +15170,7 @@ const SubscriptionCreateView = ({
|
|
|
14875
15170
|
interval,
|
|
14876
15171
|
count: interval_count
|
|
14877
15172
|
});
|
|
14878
|
-
const
|
|
14879
|
-
default_locale
|
|
14880
|
-
} = Pelcro.site.read();
|
|
14881
|
-
const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
|
|
15173
|
+
const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
14882
15174
|
return /*#__PURE__*/React__default.createElement("p", {
|
|
14883
15175
|
className: "plc-text-gray-600"
|
|
14884
15176
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
@@ -15178,17 +15470,17 @@ const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone
|
|
|
15178
15470
|
|
|
15179
15471
|
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";
|
|
15180
15472
|
|
|
15181
|
-
var _path$
|
|
15473
|
+
var _path$f;
|
|
15182
15474
|
|
|
15183
|
-
function _extends$
|
|
15475
|
+
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); }
|
|
15184
15476
|
|
|
15185
15477
|
function SvgEdit(props) {
|
|
15186
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
15478
|
+
return /*#__PURE__*/React.createElement("svg", _extends$h({
|
|
15187
15479
|
className: "plc-w-6 plc-h-6",
|
|
15188
15480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15189
15481
|
viewBox: "0 0 20 20",
|
|
15190
15482
|
fill: "currentColor"
|
|
15191
|
-
}, props), _path$
|
|
15483
|
+
}, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
|
|
15192
15484
|
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"
|
|
15193
15485
|
})));
|
|
15194
15486
|
}
|
|
@@ -18055,7 +18347,6 @@ const OrderConfirmModal = props => {
|
|
|
18055
18347
|
const userOrders = window.Pelcro.user.read().orders;
|
|
18056
18348
|
const latestOrder = userOrders === null || userOrders === void 0 ? void 0 : userOrders[userOrders.length - 1];
|
|
18057
18349
|
const latestOrderDiscount = latestOrder === null || latestOrder === void 0 ? void 0 : (_latestOrder$coupon = latestOrder.coupon) === null || _latestOrder$coupon === void 0 ? void 0 : _latestOrder$coupon.percent_off;
|
|
18058
|
-
const locale = window.Pelcro.site.read().default_locale;
|
|
18059
18350
|
const {
|
|
18060
18351
|
t
|
|
18061
18352
|
} = useTranslation("shop");
|
|
@@ -18114,7 +18405,7 @@ const OrderConfirmModal = props => {
|
|
|
18114
18405
|
className: "plc-mr-1 pelcro-summary-total-text"
|
|
18115
18406
|
}, t("labels.total")), /*#__PURE__*/React__default.createElement("p", {
|
|
18116
18407
|
className: "pelcro-summary-total"
|
|
18117
|
-
}, latestOrderDiscount && `(-${latestOrderDiscount}%) `, getFormattedPriceByLocal(latestOrder === null || latestOrder === void 0 ? void 0 : latestOrder.amount, latestOrder === null || latestOrder === void 0 ? void 0 : latestOrder.currency,
|
|
18408
|
+
}, latestOrderDiscount && `(-${latestOrderDiscount}%) `, getFormattedPriceByLocal(latestOrder === null || latestOrder === void 0 ? void 0 : latestOrder.amount, latestOrder === null || latestOrder === void 0 ? void 0 : latestOrder.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default.createElement("div", {
|
|
18118
18409
|
className: "plc-flex plc-justify-center plc-mt-6"
|
|
18119
18410
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
18120
18411
|
id: "pelcro-submit",
|
|
@@ -18176,9 +18467,9 @@ const GiftCreateContainer = ({
|
|
|
18176
18467
|
}
|
|
18177
18468
|
|
|
18178
18469
|
if (giftRecipient.startDate) {
|
|
18179
|
-
const nowDate = new Date();
|
|
18180
|
-
const yearFromNowDate = new Date(new Date().setFullYear(nowDate.getFullYear() + 1));
|
|
18181
|
-
const submittedDate = new Date(giftRecipient.startDate);
|
|
18470
|
+
const nowDate = getDateWithoutTime(new Date());
|
|
18471
|
+
const yearFromNowDate = getDateWithoutTime(new Date(new Date().setFullYear(nowDate.getFullYear() + 1)));
|
|
18472
|
+
const submittedDate = getDateWithoutTime(new Date(giftRecipient.startDate));
|
|
18182
18473
|
|
|
18183
18474
|
if (submittedDate < nowDate || submittedDate > yearFromNowDate) {
|
|
18184
18475
|
dispatch({
|
|
@@ -18299,18 +18590,18 @@ const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(La
|
|
|
18299
18590
|
store: store$4
|
|
18300
18591
|
}, props));
|
|
18301
18592
|
|
|
18302
|
-
var _path$
|
|
18593
|
+
var _path$e;
|
|
18303
18594
|
|
|
18304
|
-
function _extends$
|
|
18595
|
+
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); }
|
|
18305
18596
|
|
|
18306
18597
|
function SvgInfoCircle(props) {
|
|
18307
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
18598
|
+
return /*#__PURE__*/React.createElement("svg", _extends$g({
|
|
18308
18599
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18309
18600
|
className: "plc-w-5 plc-h-5",
|
|
18310
18601
|
fill: "none",
|
|
18311
18602
|
viewBox: "0 0 24 24",
|
|
18312
18603
|
stroke: "currentColor"
|
|
18313
|
-
}, props), _path$
|
|
18604
|
+
}, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
|
|
18314
18605
|
strokeLinecap: "round",
|
|
18315
18606
|
strokeLinejoin: "round",
|
|
18316
18607
|
strokeWidth: 2,
|
|
@@ -19297,8 +19588,8 @@ const PaymentMethodSelectModal = ({
|
|
|
19297
19588
|
};
|
|
19298
19589
|
PaymentMethodSelectModal.viewId = "payment-method-select";
|
|
19299
19590
|
|
|
19300
|
-
function _extends$
|
|
19301
|
-
_extends$
|
|
19591
|
+
function _extends$f() {
|
|
19592
|
+
_extends$f = Object.assign || function (target) {
|
|
19302
19593
|
for (var i = 1; i < arguments.length; i++) {
|
|
19303
19594
|
var source = arguments[i];
|
|
19304
19595
|
|
|
@@ -19312,7 +19603,7 @@ function _extends$e() {
|
|
|
19312
19603
|
return target;
|
|
19313
19604
|
};
|
|
19314
19605
|
|
|
19315
|
-
return _extends$
|
|
19606
|
+
return _extends$f.apply(this, arguments);
|
|
19316
19607
|
}
|
|
19317
19608
|
|
|
19318
19609
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -19496,7 +19787,7 @@ function render(props, propsBag, defaultTag, features, visible) {
|
|
|
19496
19787
|
return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
|
|
19497
19788
|
return null;
|
|
19498
19789
|
}, _match[RenderStrategy.Hidden] = function () {
|
|
19499
|
-
return _render(_extends$
|
|
19790
|
+
return _render(_extends$f({}, _rest, {
|
|
19500
19791
|
hidden: true,
|
|
19501
19792
|
style: {
|
|
19502
19793
|
display: 'none'
|
|
@@ -20024,7 +20315,7 @@ function TransitionChild(props) {
|
|
|
20024
20315
|
var passthroughProps = rest;
|
|
20025
20316
|
return React__default.createElement(NestingContext.Provider, {
|
|
20026
20317
|
value: nesting
|
|
20027
|
-
}, render(_extends$
|
|
20318
|
+
}, render(_extends$f({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
|
|
20028
20319
|
}
|
|
20029
20320
|
|
|
20030
20321
|
function Transition(props) {
|
|
@@ -20068,7 +20359,7 @@ function Transition(props) {
|
|
|
20068
20359
|
value: nestingBag
|
|
20069
20360
|
}, React__default.createElement(TransitionContext.Provider, {
|
|
20070
20361
|
value: transitionBag
|
|
20071
|
-
}, render(_extends$
|
|
20362
|
+
}, render(_extends$f({}, sharedProps, {
|
|
20072
20363
|
as: Fragment,
|
|
20073
20364
|
children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
|
|
20074
20365
|
}), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
|
|
@@ -20195,12 +20486,12 @@ var ActionTypes;
|
|
|
20195
20486
|
})(ActionTypes || (ActionTypes = {}));
|
|
20196
20487
|
|
|
20197
20488
|
(_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
|
|
20198
|
-
return _extends$
|
|
20489
|
+
return _extends$f({}, state, {
|
|
20199
20490
|
activeItemIndex: null,
|
|
20200
20491
|
menuState: MenuStates.Closed
|
|
20201
20492
|
});
|
|
20202
20493
|
}, _reducers[ActionTypes.OpenMenu] = function (state) {
|
|
20203
|
-
return _extends$
|
|
20494
|
+
return _extends$f({}, state, {
|
|
20204
20495
|
menuState: MenuStates.Open
|
|
20205
20496
|
});
|
|
20206
20497
|
}, _reducers[ActionTypes.GoToItem] = function (state, action) {
|
|
@@ -20219,7 +20510,7 @@ var ActionTypes;
|
|
|
20219
20510
|
}
|
|
20220
20511
|
});
|
|
20221
20512
|
if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
|
|
20222
|
-
return _extends$
|
|
20513
|
+
return _extends$f({}, state, {
|
|
20223
20514
|
searchQuery: '',
|
|
20224
20515
|
activeItemIndex: activeItemIndex
|
|
20225
20516
|
});
|
|
@@ -20230,19 +20521,19 @@ var ActionTypes;
|
|
|
20230
20521
|
|
|
20231
20522
|
return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
|
|
20232
20523
|
});
|
|
20233
|
-
if (match === -1 || match === state.activeItemIndex) return _extends$
|
|
20524
|
+
if (match === -1 || match === state.activeItemIndex) return _extends$f({}, state, {
|
|
20234
20525
|
searchQuery: searchQuery
|
|
20235
20526
|
});
|
|
20236
|
-
return _extends$
|
|
20527
|
+
return _extends$f({}, state, {
|
|
20237
20528
|
searchQuery: searchQuery,
|
|
20238
20529
|
activeItemIndex: match
|
|
20239
20530
|
});
|
|
20240
20531
|
}, _reducers[ActionTypes.ClearSearch] = function (state) {
|
|
20241
|
-
return _extends$
|
|
20532
|
+
return _extends$f({}, state, {
|
|
20242
20533
|
searchQuery: ''
|
|
20243
20534
|
});
|
|
20244
20535
|
}, _reducers[ActionTypes.RegisterItem] = function (state, action) {
|
|
20245
|
-
return _extends$
|
|
20536
|
+
return _extends$f({}, state, {
|
|
20246
20537
|
items: [].concat(state.items, [{
|
|
20247
20538
|
id: action.id,
|
|
20248
20539
|
dataRef: action.dataRef
|
|
@@ -20255,7 +20546,7 @@ var ActionTypes;
|
|
|
20255
20546
|
return a.id === action.id;
|
|
20256
20547
|
});
|
|
20257
20548
|
if (idx !== -1) nextItems.splice(idx, 1);
|
|
20258
|
-
return _extends$
|
|
20549
|
+
return _extends$f({}, state, {
|
|
20259
20550
|
items: nextItems,
|
|
20260
20551
|
activeItemIndex: function () {
|
|
20261
20552
|
if (idx === state.activeItemIndex) return null;
|
|
@@ -20294,19 +20585,19 @@ var ActionTypes$1;
|
|
|
20294
20585
|
(_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
|
|
20295
20586
|
if (state.disabled) return state;
|
|
20296
20587
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
20297
|
-
return _extends$
|
|
20588
|
+
return _extends$f({}, state, {
|
|
20298
20589
|
activeOptionIndex: null,
|
|
20299
20590
|
listboxState: ListboxStates.Closed
|
|
20300
20591
|
});
|
|
20301
20592
|
}, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
|
|
20302
20593
|
if (state.disabled) return state;
|
|
20303
20594
|
if (state.listboxState === ListboxStates.Open) return state;
|
|
20304
|
-
return _extends$
|
|
20595
|
+
return _extends$f({}, state, {
|
|
20305
20596
|
listboxState: ListboxStates.Open
|
|
20306
20597
|
});
|
|
20307
20598
|
}, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
|
|
20308
20599
|
if (state.disabled === action.disabled) return state;
|
|
20309
|
-
return _extends$
|
|
20600
|
+
return _extends$f({}, state, {
|
|
20310
20601
|
disabled: action.disabled
|
|
20311
20602
|
});
|
|
20312
20603
|
}, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
|
|
@@ -20327,7 +20618,7 @@ var ActionTypes$1;
|
|
|
20327
20618
|
}
|
|
20328
20619
|
});
|
|
20329
20620
|
if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
|
|
20330
|
-
return _extends$
|
|
20621
|
+
return _extends$f({}, state, {
|
|
20331
20622
|
searchQuery: '',
|
|
20332
20623
|
activeOptionIndex: activeOptionIndex
|
|
20333
20624
|
});
|
|
@@ -20340,10 +20631,10 @@ var ActionTypes$1;
|
|
|
20340
20631
|
|
|
20341
20632
|
return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
|
|
20342
20633
|
});
|
|
20343
|
-
if (match === -1 || match === state.activeOptionIndex) return _extends$
|
|
20634
|
+
if (match === -1 || match === state.activeOptionIndex) return _extends$f({}, state, {
|
|
20344
20635
|
searchQuery: searchQuery
|
|
20345
20636
|
});
|
|
20346
|
-
return _extends$
|
|
20637
|
+
return _extends$f({}, state, {
|
|
20347
20638
|
searchQuery: searchQuery,
|
|
20348
20639
|
activeOptionIndex: match
|
|
20349
20640
|
});
|
|
@@ -20351,11 +20642,11 @@ var ActionTypes$1;
|
|
|
20351
20642
|
if (state.disabled) return state;
|
|
20352
20643
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
20353
20644
|
if (state.searchQuery === '') return state;
|
|
20354
|
-
return _extends$
|
|
20645
|
+
return _extends$f({}, state, {
|
|
20355
20646
|
searchQuery: ''
|
|
20356
20647
|
});
|
|
20357
20648
|
}, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
|
|
20358
|
-
return _extends$
|
|
20649
|
+
return _extends$f({}, state, {
|
|
20359
20650
|
options: [].concat(state.options, [{
|
|
20360
20651
|
id: action.id,
|
|
20361
20652
|
dataRef: action.dataRef
|
|
@@ -20368,7 +20659,7 @@ var ActionTypes$1;
|
|
|
20368
20659
|
return a.id === action.id;
|
|
20369
20660
|
});
|
|
20370
20661
|
if (idx !== -1) nextOptions.splice(idx, 1);
|
|
20371
|
-
return _extends$
|
|
20662
|
+
return _extends$f({}, state, {
|
|
20372
20663
|
options: nextOptions,
|
|
20373
20664
|
activeOptionIndex: function () {
|
|
20374
20665
|
if (idx === state.activeOptionIndex) return null;
|
|
@@ -20429,18 +20720,18 @@ const getPaymentCardIcon = name => {
|
|
|
20429
20720
|
}));
|
|
20430
20721
|
};
|
|
20431
20722
|
|
|
20432
|
-
var _path$
|
|
20723
|
+
var _path$d;
|
|
20433
20724
|
|
|
20434
|
-
function _extends$
|
|
20725
|
+
function _extends$e() { _extends$e = 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$e.apply(this, arguments); }
|
|
20435
20726
|
|
|
20436
20727
|
function SvgChevronRight(props) {
|
|
20437
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
20728
|
+
return /*#__PURE__*/React.createElement("svg", _extends$e({
|
|
20438
20729
|
className: "plc-w-6 plc-h-6",
|
|
20439
20730
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20440
20731
|
fill: "none",
|
|
20441
20732
|
viewBox: "0 0 24 24",
|
|
20442
20733
|
stroke: "currentColor"
|
|
20443
|
-
}, props), _path$
|
|
20734
|
+
}, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
|
|
20444
20735
|
strokeLinecap: "round",
|
|
20445
20736
|
strokeLinejoin: "round",
|
|
20446
20737
|
strokeWidth: 2,
|
|
@@ -20483,7 +20774,6 @@ const OrderItems = ({
|
|
|
20483
20774
|
const {
|
|
20484
20775
|
t
|
|
20485
20776
|
} = useTranslation("dashboard");
|
|
20486
|
-
const site = window.Pelcro.site.read();
|
|
20487
20777
|
return !(orders !== null && orders !== void 0 && orders.length) ? /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
20488
20778
|
colSpan: "3",
|
|
20489
20779
|
className: "plc-text-center plc-text-gray-500"
|
|
@@ -20499,7 +20789,7 @@ const OrderItems = ({
|
|
|
20499
20789
|
className: "plc-py-4 plc-pl-2"
|
|
20500
20790
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
20501
20791
|
className: "plc-text-xl plc-font-semibold "
|
|
20502
|
-
}, getFormattedPriceByLocal(order.amount, order.currency,
|
|
20792
|
+
}, getFormattedPriceByLocal(order.amount, order.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
20503
20793
|
className: "plc-text-xs plc-text-gray-400 plc-uppercase"
|
|
20504
20794
|
}, t("labels.orders.itemsAmount", {
|
|
20505
20795
|
count: getItemsAmount(order.id)
|
|
@@ -20528,7 +20818,7 @@ const OrderItems = ({
|
|
|
20528
20818
|
className: ""
|
|
20529
20819
|
}, item.product_sku_name))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span", {
|
|
20530
20820
|
className: "plc-font-semibold"
|
|
20531
|
-
}, getFormattedPriceByLocal(item.amount, order.currency,
|
|
20821
|
+
}, getFormattedPriceByLocal(item.amount, order.currency, getPageOrDefaultLanguage()))));
|
|
20532
20822
|
}), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
20533
20823
|
colSpan: "3"
|
|
20534
20824
|
}, /*#__PURE__*/React__default.createElement("hr", {
|
|
@@ -20657,6 +20947,266 @@ const SavedItems = ({
|
|
|
20657
20947
|
});
|
|
20658
20948
|
};
|
|
20659
20949
|
|
|
20950
|
+
var _path$c;
|
|
20951
|
+
|
|
20952
|
+
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); }
|
|
20953
|
+
|
|
20954
|
+
function SvgRefresh(props) {
|
|
20955
|
+
return /*#__PURE__*/React.createElement("svg", _extends$d({
|
|
20956
|
+
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
20957
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20958
|
+
fill: "none",
|
|
20959
|
+
viewBox: "0 0 24 24",
|
|
20960
|
+
stroke: "currentColor"
|
|
20961
|
+
}, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
|
|
20962
|
+
strokeLinecap: "round",
|
|
20963
|
+
strokeLinejoin: "round",
|
|
20964
|
+
strokeWidth: 2,
|
|
20965
|
+
d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
|
|
20966
|
+
})));
|
|
20967
|
+
}
|
|
20968
|
+
|
|
20969
|
+
var _path$b;
|
|
20970
|
+
|
|
20971
|
+
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); }
|
|
20972
|
+
|
|
20973
|
+
function SvgCalendar(props) {
|
|
20974
|
+
return /*#__PURE__*/React.createElement("svg", _extends$c({
|
|
20975
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20976
|
+
className: "plc-h-4 plc-w-4 plc-mr-1",
|
|
20977
|
+
viewBox: "0 0 20 20",
|
|
20978
|
+
fill: "currentColor"
|
|
20979
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
|
|
20980
|
+
fillRule: "evenodd",
|
|
20981
|
+
d: "M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",
|
|
20982
|
+
clipRule: "evenodd"
|
|
20983
|
+
})));
|
|
20984
|
+
}
|
|
20985
|
+
|
|
20986
|
+
var _path$a;
|
|
20987
|
+
|
|
20988
|
+
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); }
|
|
20989
|
+
|
|
20990
|
+
function SvgPlus(props) {
|
|
20991
|
+
return /*#__PURE__*/React.createElement("svg", _extends$b({
|
|
20992
|
+
className: "plc-w-5 plc-h-5",
|
|
20993
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20994
|
+
fill: "none",
|
|
20995
|
+
viewBox: "0 0 24 24",
|
|
20996
|
+
stroke: "currentColor"
|
|
20997
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
|
|
20998
|
+
strokeLinecap: "round",
|
|
20999
|
+
strokeLinejoin: "round",
|
|
21000
|
+
strokeWidth: 2,
|
|
21001
|
+
d: "M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
21002
|
+
})));
|
|
21003
|
+
}
|
|
21004
|
+
|
|
21005
|
+
var _path$9;
|
|
21006
|
+
|
|
21007
|
+
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); }
|
|
21008
|
+
|
|
21009
|
+
function SvgCheckMark(props) {
|
|
21010
|
+
return /*#__PURE__*/React.createElement("svg", _extends$a({
|
|
21011
|
+
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
21012
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21013
|
+
viewBox: "0 0 20 20",
|
|
21014
|
+
fill: "currentColor"
|
|
21015
|
+
}, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
|
|
21016
|
+
fillRule: "evenodd",
|
|
21017
|
+
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",
|
|
21018
|
+
clipRule: "evenodd"
|
|
21019
|
+
})));
|
|
21020
|
+
}
|
|
21021
|
+
|
|
21022
|
+
const SubscriptionsMenu = props => {
|
|
21023
|
+
const {
|
|
21024
|
+
t
|
|
21025
|
+
} = useTranslation("dashboard");
|
|
21026
|
+
return /*#__PURE__*/React__default.createElement("table", {
|
|
21027
|
+
className: "plc-w-full plc-table-fixed"
|
|
21028
|
+
}, /*#__PURE__*/React__default.createElement("thead", {
|
|
21029
|
+
className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
|
|
21030
|
+
}, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
|
|
21031
|
+
className: "plc-w-3/12 "
|
|
21032
|
+
}, t("labels.plan")), /*#__PURE__*/React__default.createElement("th", {
|
|
21033
|
+
className: "plc-w-4/12 "
|
|
21034
|
+
}, t("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
|
|
21035
|
+
className: "plc-w-3/12 "
|
|
21036
|
+
}, t("labels.actions")), /*#__PURE__*/React__default.createElement("th", {
|
|
21037
|
+
className: "plc-w-2/12 "
|
|
21038
|
+
}))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
|
|
21039
|
+
className: "plc-h-4"
|
|
21040
|
+
})), /*#__PURE__*/React__default.createElement(Accordion, null, /*#__PURE__*/React__default.createElement(SubscriptionsItems, props)), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
21041
|
+
colSpan: "4",
|
|
21042
|
+
className: "plc-p-1"
|
|
21043
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
21044
|
+
variant: "ghost",
|
|
21045
|
+
icon: /*#__PURE__*/React__default.createElement(SvgPlus, {
|
|
21046
|
+
className: "plc-w-4 plc-h-4 plc-mr-1"
|
|
21047
|
+
}),
|
|
21048
|
+
className: "plc-w-full plc-h-8 plc-font-semibold plc-tracking-wider plc-text-gray-900 plc-uppercase plc-rounded-none hover:plc-bg-gray-100",
|
|
21049
|
+
onClick: props.displayProductSelect
|
|
21050
|
+
}, t("labels.addSubscription")))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
21051
|
+
colSpan: "4",
|
|
21052
|
+
className: "plc-p-1"
|
|
21053
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
21054
|
+
variant: "ghost",
|
|
21055
|
+
icon: /*#__PURE__*/React__default.createElement(SvgGift, {
|
|
21056
|
+
className: "plc-w-4 plc-h-4 plc-mr-1"
|
|
21057
|
+
}),
|
|
21058
|
+
className: "plc-w-full plc-h-8 plc-font-semibold plc-tracking-wider plc-text-gray-900 plc-uppercase plc-rounded-none hover:plc-bg-gray-100",
|
|
21059
|
+
onClick: props.displayRedeem
|
|
21060
|
+
}, t("labels.redeemGift"))))));
|
|
21061
|
+
};
|
|
21062
|
+
const SubscriptionsItems = ({
|
|
21063
|
+
onClose,
|
|
21064
|
+
cancelSubscription,
|
|
21065
|
+
reactivateSubscription,
|
|
21066
|
+
setProductAndPlan,
|
|
21067
|
+
setSubscriptionIdToRenew,
|
|
21068
|
+
setView,
|
|
21069
|
+
getSubscriptionStatus,
|
|
21070
|
+
disableSubmit,
|
|
21071
|
+
activeMenu,
|
|
21072
|
+
toggleActiveMenu
|
|
21073
|
+
}) => {
|
|
21074
|
+
const {
|
|
21075
|
+
t
|
|
21076
|
+
} = useTranslation("dashboard");
|
|
21077
|
+
const subs = window.Pelcro.subscription.list();
|
|
21078
|
+
if (!subs || subs.length === 0) return null;
|
|
21079
|
+
return window.Pelcro.subscription.list().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
|
|
21080
|
+
const isActive = activeMenu === sub.id; // Cancel button click handlers
|
|
21081
|
+
|
|
21082
|
+
const onCancelClick = () => {
|
|
21083
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
21084
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
21085
|
+
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
21086
|
+
}, {
|
|
21087
|
+
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
21088
|
+
loadingMessage: t("messages.subCancellation.loading"),
|
|
21089
|
+
successMessage: t("messages.subCancellation.success"),
|
|
21090
|
+
errorMessage: t("messages.subCancellation.error")
|
|
21091
|
+
}, {
|
|
21092
|
+
closeButtonLabel: t("labels.subCancellation.goBack")
|
|
21093
|
+
});
|
|
21094
|
+
}; // Reactivate button click handlers
|
|
21095
|
+
|
|
21096
|
+
|
|
21097
|
+
const onReactivateClick = () => {
|
|
21098
|
+
reactivateSubscription(sub.id);
|
|
21099
|
+
}; // Renew click
|
|
21100
|
+
|
|
21101
|
+
|
|
21102
|
+
const onRenewClick = () => {
|
|
21103
|
+
const product_id = sub.plan.product.id;
|
|
21104
|
+
const plan_id = sub.plan.id;
|
|
21105
|
+
const product = window.Pelcro.product.getById(product_id);
|
|
21106
|
+
const plan = window.Pelcro.plan.getById(plan_id);
|
|
21107
|
+
setProductAndPlan(product, plan);
|
|
21108
|
+
setSubscriptionIdToRenew(sub.id);
|
|
21109
|
+
setView("plan-select");
|
|
21110
|
+
};
|
|
21111
|
+
|
|
21112
|
+
const getPhases = () => {
|
|
21113
|
+
if (!sub.schedule) return [];
|
|
21114
|
+
const currentPhaseStartDate = sub.schedule.current_phase.start_date;
|
|
21115
|
+
const currentPhase = sub.schedule.phases.find(phase => {
|
|
21116
|
+
return phase.start_date === currentPhaseStartDate;
|
|
21117
|
+
});
|
|
21118
|
+
const futurePhases = sub.schedule.phases.filter(phase => {
|
|
21119
|
+
return phase.start_date > currentPhaseStartDate;
|
|
21120
|
+
});
|
|
21121
|
+
return [currentPhase, ...futurePhases];
|
|
21122
|
+
};
|
|
21123
|
+
|
|
21124
|
+
const hasPhases = getPhases().length > 0;
|
|
21125
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
21126
|
+
key: sub.id
|
|
21127
|
+
}, /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
|
|
21128
|
+
onClick: () => {
|
|
21129
|
+
if (hasPhases) toggleActiveMenu(sub.id);
|
|
21130
|
+
},
|
|
21131
|
+
key: sub.id,
|
|
21132
|
+
className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header ${isActive ? "plc-bg-gray-100" : "hover:plc-bg-gray-50"}`
|
|
21133
|
+
}, /*#__PURE__*/React__default.createElement("td", {
|
|
21134
|
+
className: "plc-truncate"
|
|
21135
|
+
}, sub.plan.nickname && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
21136
|
+
className: "plc-font-semibold plc-text-gray-500"
|
|
21137
|
+
}, sub.plan.nickname), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
21138
|
+
className: "plc-text-xs plc-text-gray-400"
|
|
21139
|
+
}, getFormattedPriceByLocal(sub.plan.amount, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default.createElement("td", {
|
|
21140
|
+
className: "plc-py-2"
|
|
21141
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21142
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getSubscriptionStatus(sub).bgColor} plc-uppercase ${getSubscriptionStatus(sub).textColor} plc-rounded-lg`
|
|
21143
|
+
}, getSubscriptionStatus(sub).icon, getSubscriptionStatus(sub).title), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
21144
|
+
className: "plc-text-xs plc-text-gray-500"
|
|
21145
|
+
}, sub.status && /*#__PURE__*/React__default.createElement("span", {
|
|
21146
|
+
className: "plc-inline-block plc-mt-1 plc-underline"
|
|
21147
|
+
}, getSubscriptionStatus(sub).content), /*#__PURE__*/React__default.createElement("br", null), sub.shipments_remaining ? /*#__PURE__*/React__default.createElement("span", {
|
|
21148
|
+
className: "plc-inline-block plc-mt-1"
|
|
21149
|
+
}, sub.shipments_remaining, " ", t("labels.shipments")) : null)), /*#__PURE__*/React__default.createElement("td", null, sub.cancel_at_period_end === 0 && /*#__PURE__*/React__default.createElement(Button, {
|
|
21150
|
+
variant: "ghost",
|
|
21151
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
21152
|
+
icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
|
|
21153
|
+
onClick: onCancelClick,
|
|
21154
|
+
disabled: disableSubmit,
|
|
21155
|
+
"data-key": sub.id
|
|
21156
|
+
}, t("labels.unsubscribe")), sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
|
|
21157
|
+
variant: "ghost",
|
|
21158
|
+
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
|
|
21159
|
+
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
21160
|
+
onClick: onReactivateClick,
|
|
21161
|
+
disabled: disableSubmit,
|
|
21162
|
+
"data-key": sub.id
|
|
21163
|
+
}, t("labels.reactivate")), sub.cancel_at_period_end === 1 && /*#__PURE__*/React__default.createElement(Button, {
|
|
21164
|
+
variant: "ghost",
|
|
21165
|
+
className: "plc-text-blue-400 pelcro-dashboard-sub-renew-button",
|
|
21166
|
+
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
21167
|
+
onClick: onRenewClick,
|
|
21168
|
+
disabled: disableSubmit,
|
|
21169
|
+
"data-key": sub.id
|
|
21170
|
+
}, t("labels.renew"))), /*#__PURE__*/React__default.createElement("td", null, hasPhases && /*#__PURE__*/React__default.createElement("div", {
|
|
21171
|
+
className: `plc-flex plc-items-center plc-justify-center plc-transition-transform plc-ease-out plc-transform plc-rounded-full plc-w-7 plc-h-7 ${isActive ? "plc-flex plc-place-items-center plc-w-7 plc-h-7 plc-p-1 plc-bg-primary-400 plc-rounded-full" : "accordion-chevron"}`
|
|
21172
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21173
|
+
className: `plc-transition plc-ease-out ${isActive && "plc-text-white plc-transform plc-rotate-90"}`
|
|
21174
|
+
}, /*#__PURE__*/React__default.createElement(SvgChevronRight, null)))))), /*#__PURE__*/React__default.createElement("tbody", null, isActive && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, getPhases().map((phase, i) => {
|
|
21175
|
+
var _phase$plans;
|
|
21176
|
+
|
|
21177
|
+
const plan = (_phase$plans = phase.plans) === null || _phase$plans === void 0 ? void 0 : _phase$plans[0].plan;
|
|
21178
|
+
const isCurrentPhase = i === 0;
|
|
21179
|
+
const startDate = new Date(Number(`${phase.start_date}000`));
|
|
21180
|
+
const endDate = new Date(Number(`${phase.end_date}000`));
|
|
21181
|
+
const formattedStartDate = new Intl.DateTimeFormat("en-CA").format(startDate);
|
|
21182
|
+
const formattedEndDate = new Intl.DateTimeFormat("en-CA").format(endDate);
|
|
21183
|
+
const startDateString = `${t("labels.startsOn")} ${formattedStartDate}`;
|
|
21184
|
+
const endDateString = `${t("labels.expiresOn")} ${formattedEndDate}`;
|
|
21185
|
+
return /*#__PURE__*/React__default.createElement("tr", {
|
|
21186
|
+
key: `${phase.start_date}-${phase.end_date}`,
|
|
21187
|
+
className: "pelcro-sub-phase-row plc-w-full plc-align-middle"
|
|
21188
|
+
}, /*#__PURE__*/React__default.createElement("td", {
|
|
21189
|
+
className: "plc-truncate"
|
|
21190
|
+
}, plan.nickname && /*#__PURE__*/React__default.createElement("span", {
|
|
21191
|
+
className: "plc-font-semibold plc-text-gray-500"
|
|
21192
|
+
}, plan.nickname)), /*#__PURE__*/React__default.createElement("td", {
|
|
21193
|
+
className: "plc-py-2"
|
|
21194
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21195
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold plc-uppercase plc-rounded-lg ${isCurrentPhase ? "plc-text-green-700 plc-bg-green-100" : "plc-text-blue-700 plc-bg-blue-100"}
|
|
21196
|
+
`
|
|
21197
|
+
}, isCurrentPhase ? /*#__PURE__*/React__default.createElement(SvgCheckMark, null) : /*#__PURE__*/React__default.createElement(SvgCalendar, null), isCurrentPhase ? t("labels.status.active") : t("labels.status.scheduled")), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
21198
|
+
className: "plc-text-xs plc-text-gray-500"
|
|
21199
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21200
|
+
className: "plc-inline-block plc-mt-1 plc-underline"
|
|
21201
|
+
}, isCurrentPhase ? endDateString : startDateString))));
|
|
21202
|
+
}), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
21203
|
+
colSpan: "4"
|
|
21204
|
+
}, /*#__PURE__*/React__default.createElement("hr", {
|
|
21205
|
+
className: "plc-mt-4"
|
|
21206
|
+
}))))));
|
|
21207
|
+
});
|
|
21208
|
+
};
|
|
21209
|
+
|
|
20660
21210
|
/**
|
|
20661
21211
|
* @typedef {Object} AccordionPropsType
|
|
20662
21212
|
* @property {string} initialActiveMenu the initial active menu
|
|
@@ -20683,7 +21233,7 @@ const Accordion = ({
|
|
|
20683
21233
|
};
|
|
20684
21234
|
|
|
20685
21235
|
return React__default.Children.map(children, (child, i) => {
|
|
20686
|
-
if (child.type === Accordion.item || child.type === OrderItems || child.type === SavedItems) {
|
|
21236
|
+
if (child.type === Accordion.item || child.type === OrderItems || child.type === SavedItems || child.type === SubscriptionsItems) {
|
|
20687
21237
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
20688
21238
|
activeMenu,
|
|
20689
21239
|
toggleActiveMenu,
|
|
@@ -20739,18 +21289,18 @@ Accordion.item = function AccordionItem({
|
|
|
20739
21289
|
}, content)) : null;
|
|
20740
21290
|
};
|
|
20741
21291
|
|
|
20742
|
-
var _path$
|
|
21292
|
+
var _path$8;
|
|
20743
21293
|
|
|
20744
|
-
function _extends$
|
|
21294
|
+
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); }
|
|
20745
21295
|
|
|
20746
21296
|
function SvgExit(props) {
|
|
20747
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21297
|
+
return /*#__PURE__*/React.createElement("svg", _extends$9({
|
|
20748
21298
|
className: "plc-w-6 plc-h-6",
|
|
20749
21299
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20750
21300
|
fill: "none",
|
|
20751
21301
|
viewBox: "0 0 24 24",
|
|
20752
21302
|
stroke: "currentColor"
|
|
20753
|
-
}, props), _path$
|
|
21303
|
+
}, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
|
|
20754
21304
|
strokeLinecap: "round",
|
|
20755
21305
|
strokeLinejoin: "round",
|
|
20756
21306
|
strokeWidth: 2,
|
|
@@ -20758,34 +21308,17 @@ function SvgExit(props) {
|
|
|
20758
21308
|
})));
|
|
20759
21309
|
}
|
|
20760
21310
|
|
|
20761
|
-
var _path$
|
|
20762
|
-
|
|
20763
|
-
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); }
|
|
20764
|
-
|
|
20765
|
-
function SvgCheckMark(props) {
|
|
20766
|
-
return /*#__PURE__*/React.createElement("svg", _extends$b({
|
|
20767
|
-
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
20768
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20769
|
-
viewBox: "0 0 20 20",
|
|
20770
|
-
fill: "currentColor"
|
|
20771
|
-
}, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
|
|
20772
|
-
fillRule: "evenodd",
|
|
20773
|
-
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",
|
|
20774
|
-
clipRule: "evenodd"
|
|
20775
|
-
})));
|
|
20776
|
-
}
|
|
20777
|
-
|
|
20778
|
-
var _path$9;
|
|
21311
|
+
var _path$7;
|
|
20779
21312
|
|
|
20780
|
-
function _extends$
|
|
21313
|
+
function _extends$8() { _extends$8 = 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$8.apply(this, arguments); }
|
|
20781
21314
|
|
|
20782
21315
|
function SvgUser(props) {
|
|
20783
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21316
|
+
return /*#__PURE__*/React.createElement("svg", _extends$8({
|
|
20784
21317
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20785
21318
|
fill: "none",
|
|
20786
21319
|
viewBox: "0 0 24 24",
|
|
20787
21320
|
stroke: "currentColor"
|
|
20788
|
-
}, props), _path$
|
|
21321
|
+
}, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
|
|
20789
21322
|
strokeLinecap: "round",
|
|
20790
21323
|
strokeLinejoin: "round",
|
|
20791
21324
|
strokeWidth: 2,
|
|
@@ -20793,18 +21326,18 @@ function SvgUser(props) {
|
|
|
20793
21326
|
})));
|
|
20794
21327
|
}
|
|
20795
21328
|
|
|
20796
|
-
var _path$
|
|
21329
|
+
var _path$6;
|
|
20797
21330
|
|
|
20798
|
-
function _extends$
|
|
21331
|
+
function _extends$7() { _extends$7 = 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$7.apply(this, arguments); }
|
|
20799
21332
|
|
|
20800
21333
|
function SvgNewsletter(props) {
|
|
20801
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21334
|
+
return /*#__PURE__*/React.createElement("svg", _extends$7({
|
|
20802
21335
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20803
21336
|
className: "plc-h-5 plc-w-5",
|
|
20804
21337
|
fill: "none",
|
|
20805
21338
|
viewBox: "0 0 24 24",
|
|
20806
21339
|
stroke: "currentColor"
|
|
20807
|
-
}, props), _path$
|
|
21340
|
+
}, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
|
|
20808
21341
|
strokeLinecap: "round",
|
|
20809
21342
|
strokeLinejoin: "round",
|
|
20810
21343
|
strokeWidth: 2,
|
|
@@ -20812,37 +21345,18 @@ function SvgNewsletter(props) {
|
|
|
20812
21345
|
})));
|
|
20813
21346
|
}
|
|
20814
21347
|
|
|
20815
|
-
var _path$
|
|
20816
|
-
|
|
20817
|
-
function _extends$8() { _extends$8 = 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$8.apply(this, arguments); }
|
|
20818
|
-
|
|
20819
|
-
function SvgRefresh(props) {
|
|
20820
|
-
return /*#__PURE__*/React.createElement("svg", _extends$8({
|
|
20821
|
-
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
20822
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20823
|
-
fill: "none",
|
|
20824
|
-
viewBox: "0 0 24 24",
|
|
20825
|
-
stroke: "currentColor"
|
|
20826
|
-
}, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
|
|
20827
|
-
strokeLinecap: "round",
|
|
20828
|
-
strokeLinejoin: "round",
|
|
20829
|
-
strokeWidth: 2,
|
|
20830
|
-
d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
|
|
20831
|
-
})));
|
|
20832
|
-
}
|
|
20833
|
-
|
|
20834
|
-
var _path$6;
|
|
21348
|
+
var _path$5;
|
|
20835
21349
|
|
|
20836
|
-
function _extends$
|
|
21350
|
+
function _extends$6() { _extends$6 = 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$6.apply(this, arguments); }
|
|
20837
21351
|
|
|
20838
21352
|
function SvgPaymentCard(props) {
|
|
20839
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21353
|
+
return /*#__PURE__*/React.createElement("svg", _extends$6({
|
|
20840
21354
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
20841
21355
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20842
21356
|
fill: "none",
|
|
20843
21357
|
viewBox: "0 0 24 24",
|
|
20844
21358
|
stroke: "currentColor"
|
|
20845
|
-
}, props), _path$
|
|
21359
|
+
}, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
|
|
20846
21360
|
strokeLinecap: "round",
|
|
20847
21361
|
strokeLinejoin: "round",
|
|
20848
21362
|
strokeWidth: 2,
|
|
@@ -20850,18 +21364,18 @@ function SvgPaymentCard(props) {
|
|
|
20850
21364
|
})));
|
|
20851
21365
|
}
|
|
20852
21366
|
|
|
20853
|
-
var _path$
|
|
21367
|
+
var _path$4, _path2;
|
|
20854
21368
|
|
|
20855
|
-
function _extends$
|
|
21369
|
+
function _extends$5() { _extends$5 = 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$5.apply(this, arguments); }
|
|
20856
21370
|
|
|
20857
21371
|
function SvgLocationPin(props) {
|
|
20858
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21372
|
+
return /*#__PURE__*/React.createElement("svg", _extends$5({
|
|
20859
21373
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
20860
21374
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20861
21375
|
fill: "none",
|
|
20862
21376
|
viewBox: "0 0 24 24",
|
|
20863
21377
|
stroke: "currentColor"
|
|
20864
|
-
}, props), _path$
|
|
21378
|
+
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
20865
21379
|
strokeLinecap: "round",
|
|
20866
21380
|
strokeLinejoin: "round",
|
|
20867
21381
|
strokeWidth: 2,
|
|
@@ -20876,10 +21390,10 @@ function SvgLocationPin(props) {
|
|
|
20876
21390
|
|
|
20877
21391
|
var _switch;
|
|
20878
21392
|
|
|
20879
|
-
function _extends$
|
|
21393
|
+
function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
|
|
20880
21394
|
|
|
20881
21395
|
function SvgSubscription(props) {
|
|
20882
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21396
|
+
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
20883
21397
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20884
21398
|
viewBox: "0 0 100 125",
|
|
20885
21399
|
fill: "currentColor"
|
|
@@ -20894,30 +21408,11 @@ function SvgSubscription(props) {
|
|
|
20894
21408
|
}))))));
|
|
20895
21409
|
}
|
|
20896
21410
|
|
|
20897
|
-
var _path$4;
|
|
20898
|
-
|
|
20899
|
-
function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
|
|
20900
|
-
|
|
20901
|
-
function SvgShopping(props) {
|
|
20902
|
-
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
20903
|
-
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
20904
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20905
|
-
fill: "none",
|
|
20906
|
-
viewBox: "0 0 24 24",
|
|
20907
|
-
stroke: "currentColor"
|
|
20908
|
-
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
20909
|
-
strokeLinecap: "round",
|
|
20910
|
-
strokeLinejoin: "round",
|
|
20911
|
-
strokeWidth: 2,
|
|
20912
|
-
d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"
|
|
20913
|
-
})));
|
|
20914
|
-
}
|
|
20915
|
-
|
|
20916
21411
|
var _path$3;
|
|
20917
21412
|
|
|
20918
21413
|
function _extends$3() { _extends$3 = 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$3.apply(this, arguments); }
|
|
20919
21414
|
|
|
20920
|
-
function
|
|
21415
|
+
function SvgShopping(props) {
|
|
20921
21416
|
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
20922
21417
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
20923
21418
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -20928,7 +21423,7 @@ function SvgBookmark(props) {
|
|
|
20928
21423
|
strokeLinecap: "round",
|
|
20929
21424
|
strokeLinejoin: "round",
|
|
20930
21425
|
strokeWidth: 2,
|
|
20931
|
-
d: "
|
|
21426
|
+
d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"
|
|
20932
21427
|
})));
|
|
20933
21428
|
}
|
|
20934
21429
|
|
|
@@ -20936,9 +21431,9 @@ var _path$2;
|
|
|
20936
21431
|
|
|
20937
21432
|
function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
|
|
20938
21433
|
|
|
20939
|
-
function
|
|
21434
|
+
function SvgBookmark(props) {
|
|
20940
21435
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
20941
|
-
className: "plc-w-
|
|
21436
|
+
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
20942
21437
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20943
21438
|
fill: "none",
|
|
20944
21439
|
viewBox: "0 0 24 24",
|
|
@@ -20947,7 +21442,7 @@ function SvgPlus(props) {
|
|
|
20947
21442
|
strokeLinecap: "round",
|
|
20948
21443
|
strokeLinejoin: "round",
|
|
20949
21444
|
strokeWidth: 2,
|
|
20950
|
-
d: "
|
|
21445
|
+
d: "M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"
|
|
20951
21446
|
})));
|
|
20952
21447
|
}
|
|
20953
21448
|
|
|
@@ -21211,116 +21706,6 @@ class Dashboard extends Component {
|
|
|
21211
21706
|
};
|
|
21212
21707
|
});
|
|
21213
21708
|
|
|
21214
|
-
_defineProperty$3(this, "renderSubscriptions", () => {
|
|
21215
|
-
var _this$state$subscript;
|
|
21216
|
-
|
|
21217
|
-
const subscriptions = (_this$state$subscript = this.state.subscriptions) === null || _this$state$subscript === void 0 ? void 0 : _this$state$subscript.sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
|
|
21218
|
-
// Cancel button click handlers
|
|
21219
|
-
const onCancelClick = () => {
|
|
21220
|
-
this.props.onClose();
|
|
21221
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
21222
|
-
this.cancelSubscription(sub.id, onSuccess, onFailure);
|
|
21223
|
-
}, {
|
|
21224
|
-
confirmMessage: this.locale("messages.subCancellation.isSureToCancel"),
|
|
21225
|
-
loadingMessage: this.locale("messages.subCancellation.loading"),
|
|
21226
|
-
successMessage: this.locale("messages.subCancellation.success"),
|
|
21227
|
-
errorMessage: this.locale("messages.subCancellation.error")
|
|
21228
|
-
}, {
|
|
21229
|
-
closeButtonLabel: this.locale("labels.subCancellation.goBack")
|
|
21230
|
-
});
|
|
21231
|
-
}; // Reactivate button click handlers
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
const onReactivateClick = () => {
|
|
21235
|
-
this.reactivateSubscription(sub.id);
|
|
21236
|
-
}; // Renew click
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
const onRenewClick = () => {
|
|
21240
|
-
const product_id = sub.plan.product.id;
|
|
21241
|
-
const plan_id = sub.plan.id;
|
|
21242
|
-
const product = window.Pelcro.product.getById(product_id);
|
|
21243
|
-
const plan = window.Pelcro.plan.getById(plan_id);
|
|
21244
|
-
this.props.setProductAndPlan(product, plan);
|
|
21245
|
-
this.props.setSubscriptionIdToRenew(sub.id);
|
|
21246
|
-
this.props.setView("plan-select");
|
|
21247
|
-
};
|
|
21248
|
-
|
|
21249
|
-
return /*#__PURE__*/React__default.createElement("tr", {
|
|
21250
|
-
key: "dashboard-subscription-" + sub.id,
|
|
21251
|
-
className: "plc-w-full plc-align-top"
|
|
21252
|
-
}, /*#__PURE__*/React__default.createElement("td", {
|
|
21253
|
-
className: "plc-truncate"
|
|
21254
|
-
}, sub.plan.nickname && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
21255
|
-
className: "plc-font-semibold plc-text-gray-500"
|
|
21256
|
-
}, sub.plan.nickname), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
21257
|
-
className: "plc-text-xs plc-text-gray-400"
|
|
21258
|
-
}, getFormattedPriceByLocal(sub.plan.amount, sub.plan.currency, this.site.default_locale)))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span", {
|
|
21259
|
-
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${this.getSubscriptionStatus(sub).bgColor} plc-uppercase ${this.getSubscriptionStatus(sub).textColor} plc-rounded-lg`
|
|
21260
|
-
}, this.getSubscriptionStatus(sub).icon, this.getSubscriptionStatus(sub).title), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
21261
|
-
className: "plc-mb-4 plc-text-xs plc-text-gray-500"
|
|
21262
|
-
}, sub.status && /*#__PURE__*/React__default.createElement("span", {
|
|
21263
|
-
className: "plc-inline-block plc-mt-1 plc-underline"
|
|
21264
|
-
}, this.getSubscriptionStatus(sub).content), /*#__PURE__*/React__default.createElement("br", null), sub.shipments_remaining ? /*#__PURE__*/React__default.createElement("span", {
|
|
21265
|
-
className: "plc-inline-block plc-mt-1"
|
|
21266
|
-
}, 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, {
|
|
21267
|
-
variant: "ghost",
|
|
21268
|
-
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashoard-sub-cancel-button",
|
|
21269
|
-
icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
|
|
21270
|
-
onClick: onCancelClick,
|
|
21271
|
-
disabled: this.state.disableSubmit,
|
|
21272
|
-
"data-key": sub.id
|
|
21273
|
-
}, this.locale("labels.unsubscribe")), sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
|
|
21274
|
-
variant: "ghost",
|
|
21275
|
-
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashoard-sub-reactivate-button",
|
|
21276
|
-
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
21277
|
-
onClick: onReactivateClick,
|
|
21278
|
-
disabled: this.state.disableSubmit,
|
|
21279
|
-
"data-key": sub.id
|
|
21280
|
-
}, this.locale("labels.reactivate")), sub.cancel_at_period_end === 1 && /*#__PURE__*/React__default.createElement(Button, {
|
|
21281
|
-
variant: "ghost",
|
|
21282
|
-
className: "plc-text-blue-400 pelcro-dashoard-sub-renew-button",
|
|
21283
|
-
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
21284
|
-
onClick: onRenewClick,
|
|
21285
|
-
disabled: this.state.disableSubmit,
|
|
21286
|
-
"data-key": sub.id
|
|
21287
|
-
}, this.locale("labels.renew"))));
|
|
21288
|
-
});
|
|
21289
|
-
return /*#__PURE__*/React__default.createElement("table", {
|
|
21290
|
-
className: "plc-w-full plc-table-fixed"
|
|
21291
|
-
}, /*#__PURE__*/React__default.createElement("thead", {
|
|
21292
|
-
className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
|
|
21293
|
-
}, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
|
|
21294
|
-
className: "plc-w-5/12 "
|
|
21295
|
-
}, this.locale("labels.plan")), /*#__PURE__*/React__default.createElement("th", {
|
|
21296
|
-
className: "plc-w-4/12 "
|
|
21297
|
-
}, this.locale("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
|
|
21298
|
-
className: "plc-w-3/12 "
|
|
21299
|
-
}, this.locale("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
|
|
21300
|
-
className: "plc-h-4"
|
|
21301
|
-
}), subscriptions, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
21302
|
-
colSpan: "4",
|
|
21303
|
-
className: "plc-p-1"
|
|
21304
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
21305
|
-
variant: "ghost",
|
|
21306
|
-
icon: /*#__PURE__*/React__default.createElement(SvgPlus, {
|
|
21307
|
-
className: "plc-w-4 plc-h-4 plc-mr-1"
|
|
21308
|
-
}),
|
|
21309
|
-
className: "plc-w-full plc-h-8 plc-font-semibold plc-tracking-wider plc-text-gray-900 plc-uppercase plc-rounded-none hover:plc-bg-gray-100",
|
|
21310
|
-
onClick: this.displayProductSelect
|
|
21311
|
-
}, this.locale("labels.addSubscription")))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
21312
|
-
colSpan: "4",
|
|
21313
|
-
className: "plc-p-1"
|
|
21314
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
21315
|
-
variant: "ghost",
|
|
21316
|
-
icon: /*#__PURE__*/React__default.createElement(SvgGift, {
|
|
21317
|
-
className: "plc-w-4 plc-h-4 plc-mr-1"
|
|
21318
|
-
}),
|
|
21319
|
-
className: "plc-w-full plc-h-8 plc-font-semibold plc-tracking-wider plc-text-gray-900 plc-uppercase plc-rounded-none hover:plc-bg-gray-100",
|
|
21320
|
-
onClick: this.displayRedeem
|
|
21321
|
-
}, this.locale("labels.redeemGift"))))));
|
|
21322
|
-
});
|
|
21323
|
-
|
|
21324
21709
|
_defineProperty$3(this, "renderGiftRecipients", () => {
|
|
21325
21710
|
var _giftRecipients$sort, _giftRecipients$sort$;
|
|
21326
21711
|
|
|
@@ -21358,7 +21743,7 @@ class Dashboard extends Component {
|
|
|
21358
21743
|
className: "plc-font-semibold plc-text-gray-500"
|
|
21359
21744
|
}, recipient.plan.nickname), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
21360
21745
|
className: "plc-text-xs plc-text-gray-400"
|
|
21361
|
-
}, getFormattedPriceByLocal(recipient.plan.amount, recipient.plan.currency,
|
|
21746
|
+
}, getFormattedPriceByLocal(recipient.plan.amount, recipient.plan.currency, getPageOrDefaultLanguage())))), recipient.status && /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span", {
|
|
21362
21747
|
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${this.getSubscriptionStatus(recipient).bgColor} plc-uppercase ${this.getSubscriptionStatus(recipient).textColor} plc-rounded-lg`
|
|
21363
21748
|
}, this.getSubscriptionStatus(recipient).icon, this.getSubscriptionStatus(recipient).title), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
21364
21749
|
className: "plc-mb-4 plc-text-xs plc-text-gray-500"
|
|
@@ -21595,7 +21980,18 @@ class Dashboard extends Component {
|
|
|
21595
21980
|
className: "plc-w-10 plc-h-10 plc-pt-2 plc-pr-1 plc--ml-2"
|
|
21596
21981
|
}),
|
|
21597
21982
|
title: this.locale("labels.subscriptions"),
|
|
21598
|
-
content:
|
|
21983
|
+
content: /*#__PURE__*/React__default.createElement(SubscriptionsMenu, {
|
|
21984
|
+
onClose: this.props.onClose,
|
|
21985
|
+
cancelSubscription: this.cancelSubscription,
|
|
21986
|
+
reactivateSubscription: this.reactivateSubscription,
|
|
21987
|
+
setProductAndPlan: this.props.setProductAndPlan,
|
|
21988
|
+
setSubscriptionIdToRenew: this.props.setSubscriptionIdToRenew,
|
|
21989
|
+
setView: this.props.setView,
|
|
21990
|
+
getSubscriptionStatus: this.getSubscriptionStatus,
|
|
21991
|
+
disableSubmit: this.state.disableSubmit,
|
|
21992
|
+
displayProductSelect: this.displayProductSelect,
|
|
21993
|
+
displayRedeem: this.displayRedeem
|
|
21994
|
+
})
|
|
21599
21995
|
}), /*#__PURE__*/React__default.createElement(Accordion.item, {
|
|
21600
21996
|
name: SUB_MENUS.GIFTS,
|
|
21601
21997
|
icon: /*#__PURE__*/React__default.createElement(SvgGift, null),
|