@pelcro/react-pelcro-js 2.6.0-beta.6 → 2.6.0
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 +456 -313
- package/dist/index.esm.js +456 -313
- package/dist/pelcro.css +14 -0
- package/package.json +1 -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 = {
|
|
@@ -6891,8 +6899,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
|
|
|
6891
6899
|
|
|
6892
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}}
|
|
6893
6901
|
|
|
6894
|
-
function _extends$
|
|
6895
|
-
_extends$
|
|
6902
|
+
function _extends$v() {
|
|
6903
|
+
_extends$v = Object.assign || function (target) {
|
|
6896
6904
|
for (var i = 1; i < arguments.length; i++) {
|
|
6897
6905
|
var source = arguments[i];
|
|
6898
6906
|
|
|
@@ -6906,7 +6914,7 @@ function _extends$u() {
|
|
|
6906
6914
|
return target;
|
|
6907
6915
|
};
|
|
6908
6916
|
|
|
6909
|
-
return _extends$
|
|
6917
|
+
return _extends$v.apply(this, arguments);
|
|
6910
6918
|
}
|
|
6911
6919
|
|
|
6912
6920
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
@@ -6996,7 +7004,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
|
|
|
6996
7004
|
var reducer = function reducer(state, action) {
|
|
6997
7005
|
switch (action.type) {
|
|
6998
7006
|
case ActionType.ADD_TOAST:
|
|
6999
|
-
return _extends$
|
|
7007
|
+
return _extends$v({}, state, {
|
|
7000
7008
|
toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
|
|
7001
7009
|
});
|
|
7002
7010
|
|
|
@@ -7006,9 +7014,9 @@ var reducer = function reducer(state, action) {
|
|
|
7006
7014
|
clearFromRemoveQueue(action.toast.id);
|
|
7007
7015
|
}
|
|
7008
7016
|
|
|
7009
|
-
return _extends$
|
|
7017
|
+
return _extends$v({}, state, {
|
|
7010
7018
|
toasts: state.toasts.map(function (t) {
|
|
7011
|
-
return t.id === action.toast.id ? _extends$
|
|
7019
|
+
return t.id === action.toast.id ? _extends$v({}, t, action.toast) : t;
|
|
7012
7020
|
})
|
|
7013
7021
|
});
|
|
7014
7022
|
|
|
@@ -7035,9 +7043,9 @@ var reducer = function reducer(state, action) {
|
|
|
7035
7043
|
});
|
|
7036
7044
|
}
|
|
7037
7045
|
|
|
7038
|
-
return _extends$
|
|
7046
|
+
return _extends$v({}, state, {
|
|
7039
7047
|
toasts: state.toasts.map(function (t) {
|
|
7040
|
-
return t.id === toastId || toastId === undefined ? _extends$
|
|
7048
|
+
return t.id === toastId || toastId === undefined ? _extends$v({}, t, {
|
|
7041
7049
|
visible: false
|
|
7042
7050
|
}) : t;
|
|
7043
7051
|
})
|
|
@@ -7045,28 +7053,28 @@ var reducer = function reducer(state, action) {
|
|
|
7045
7053
|
|
|
7046
7054
|
case ActionType.REMOVE_TOAST:
|
|
7047
7055
|
if (action.toastId === undefined) {
|
|
7048
|
-
return _extends$
|
|
7056
|
+
return _extends$v({}, state, {
|
|
7049
7057
|
toasts: []
|
|
7050
7058
|
});
|
|
7051
7059
|
}
|
|
7052
7060
|
|
|
7053
|
-
return _extends$
|
|
7061
|
+
return _extends$v({}, state, {
|
|
7054
7062
|
toasts: state.toasts.filter(function (t) {
|
|
7055
7063
|
return t.id !== action.toastId;
|
|
7056
7064
|
})
|
|
7057
7065
|
});
|
|
7058
7066
|
|
|
7059
7067
|
case ActionType.START_PAUSE:
|
|
7060
|
-
return _extends$
|
|
7068
|
+
return _extends$v({}, state, {
|
|
7061
7069
|
pausedAt: action.time
|
|
7062
7070
|
});
|
|
7063
7071
|
|
|
7064
7072
|
case ActionType.END_PAUSE:
|
|
7065
7073
|
var diff = action.time - (state.pausedAt || 0);
|
|
7066
|
-
return _extends$
|
|
7074
|
+
return _extends$v({}, state, {
|
|
7067
7075
|
pausedAt: undefined,
|
|
7068
7076
|
toasts: state.toasts.map(function (t) {
|
|
7069
|
-
return _extends$
|
|
7077
|
+
return _extends$v({}, t, {
|
|
7070
7078
|
pauseDuration: t.pauseDuration + diff
|
|
7071
7079
|
});
|
|
7072
7080
|
})
|
|
@@ -7113,12 +7121,12 @@ var useStore = function useStore(toastOptions) {
|
|
|
7113
7121
|
var mergedToasts = state.toasts.map(function (t) {
|
|
7114
7122
|
var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
|
|
7115
7123
|
|
|
7116
|
-
return _extends$
|
|
7124
|
+
return _extends$v({}, toastOptions, toastOptions[t.type], t, {
|
|
7117
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],
|
|
7118
|
-
style: _extends$
|
|
7126
|
+
style: _extends$v({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
|
|
7119
7127
|
});
|
|
7120
7128
|
});
|
|
7121
|
-
return _extends$
|
|
7129
|
+
return _extends$v({}, state, {
|
|
7122
7130
|
toasts: mergedToasts
|
|
7123
7131
|
});
|
|
7124
7132
|
};
|
|
@@ -7128,7 +7136,7 @@ var createToast = function createToast(message, type, opts) {
|
|
|
7128
7136
|
type = 'blank';
|
|
7129
7137
|
}
|
|
7130
7138
|
|
|
7131
|
-
return _extends$
|
|
7139
|
+
return _extends$v({
|
|
7132
7140
|
createdAt: Date.now(),
|
|
7133
7141
|
visible: true,
|
|
7134
7142
|
type: type,
|
|
@@ -7178,14 +7186,14 @@ toast.remove = function (toastId) {
|
|
|
7178
7186
|
};
|
|
7179
7187
|
|
|
7180
7188
|
toast.promise = function (promise, msgs, opts) {
|
|
7181
|
-
var id = toast.loading(msgs.loading, _extends$
|
|
7189
|
+
var id = toast.loading(msgs.loading, _extends$v({}, opts, opts == null ? void 0 : opts.loading));
|
|
7182
7190
|
promise.then(function (p) {
|
|
7183
|
-
toast.success(resolveValue(msgs.success, p), _extends$
|
|
7191
|
+
toast.success(resolveValue(msgs.success, p), _extends$v({
|
|
7184
7192
|
id: id
|
|
7185
7193
|
}, opts, opts == null ? void 0 : opts.success));
|
|
7186
7194
|
return p;
|
|
7187
7195
|
})["catch"](function (e) {
|
|
7188
|
-
toast.error(resolveValue(msgs.error, e), _extends$
|
|
7196
|
+
toast.error(resolveValue(msgs.error, e), _extends$v({
|
|
7189
7197
|
id: id
|
|
7190
7198
|
}, opts, opts == null ? void 0 : opts.error));
|
|
7191
7199
|
});
|
|
@@ -7524,7 +7532,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
|
|
|
7524
7532
|
var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
|
|
7525
7533
|
return createElement(ToastBarBase, {
|
|
7526
7534
|
className: toast.className,
|
|
7527
|
-
style: _extends$
|
|
7535
|
+
style: _extends$v({}, animationStyle, style, toast.style)
|
|
7528
7536
|
}, typeof children === 'function' ? children({
|
|
7529
7537
|
icon: icon,
|
|
7530
7538
|
message: message
|
|
@@ -7554,7 +7562,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
|
|
|
7554
7562
|
} : position.includes('right') ? {
|
|
7555
7563
|
justifyContent: 'flex-end'
|
|
7556
7564
|
} : {};
|
|
7557
|
-
return _extends$
|
|
7565
|
+
return _extends$v({
|
|
7558
7566
|
left: 0,
|
|
7559
7567
|
right: 0,
|
|
7560
7568
|
display: 'flex',
|
|
@@ -7581,7 +7589,7 @@ var Toaster = function Toaster(_ref) {
|
|
|
7581
7589
|
handlers = _useToaster.handlers;
|
|
7582
7590
|
|
|
7583
7591
|
return createElement("div", {
|
|
7584
|
-
style: _extends$
|
|
7592
|
+
style: _extends$v({
|
|
7585
7593
|
position: 'fixed',
|
|
7586
7594
|
zIndex: 9999,
|
|
7587
7595
|
top: DEFAULT_OFFSET,
|
|
@@ -7616,82 +7624,82 @@ var Toaster = function Toaster(_ref) {
|
|
|
7616
7624
|
}));
|
|
7617
7625
|
};
|
|
7618
7626
|
|
|
7619
|
-
var _path$
|
|
7627
|
+
var _path$s;
|
|
7620
7628
|
|
|
7621
|
-
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); }
|
|
7622
7630
|
|
|
7623
7631
|
function SvgCheckSolid(props) {
|
|
7624
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7632
|
+
return /*#__PURE__*/React.createElement("svg", _extends$u({
|
|
7625
7633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7626
7634
|
className: "h-5 w-5",
|
|
7627
7635
|
viewBox: "0 0 20 20",
|
|
7628
7636
|
fill: "currentColor"
|
|
7629
|
-
}, props), _path$
|
|
7637
|
+
}, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
|
|
7630
7638
|
fillRule: "evenodd",
|
|
7631
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",
|
|
7632
7640
|
clipRule: "evenodd"
|
|
7633
7641
|
})));
|
|
7634
7642
|
}
|
|
7635
7643
|
|
|
7636
|
-
var _path$
|
|
7644
|
+
var _path$r;
|
|
7637
7645
|
|
|
7638
|
-
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); }
|
|
7639
7647
|
|
|
7640
7648
|
function SvgXIcon(props) {
|
|
7641
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7649
|
+
return /*#__PURE__*/React.createElement("svg", _extends$t({
|
|
7642
7650
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7643
7651
|
viewBox: "0 0 20 20",
|
|
7644
7652
|
fill: "currentColor"
|
|
7645
|
-
}, props), _path$
|
|
7653
|
+
}, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
|
|
7646
7654
|
fill: "evenodd",
|
|
7647
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",
|
|
7648
7656
|
clipRule: "evenodd"
|
|
7649
7657
|
})));
|
|
7650
7658
|
}
|
|
7651
7659
|
|
|
7652
|
-
var _path$
|
|
7660
|
+
var _path$q;
|
|
7653
7661
|
|
|
7654
|
-
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); }
|
|
7655
7663
|
|
|
7656
7664
|
function SvgXIconSolid(props) {
|
|
7657
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7665
|
+
return /*#__PURE__*/React.createElement("svg", _extends$s({
|
|
7658
7666
|
className: "plc-w-4 plc-h-4",
|
|
7659
7667
|
fill: "currentColor",
|
|
7660
7668
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7661
7669
|
viewBox: "0 0 100 100"
|
|
7662
|
-
}, props), _path$
|
|
7670
|
+
}, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
|
|
7663
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"
|
|
7664
7672
|
})));
|
|
7665
7673
|
}
|
|
7666
7674
|
|
|
7667
|
-
var _path$
|
|
7675
|
+
var _path$p;
|
|
7668
7676
|
|
|
7669
|
-
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); }
|
|
7670
7678
|
|
|
7671
7679
|
function SvgExclamation(props) {
|
|
7672
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7680
|
+
return /*#__PURE__*/React.createElement("svg", _extends$r({
|
|
7673
7681
|
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
7674
7682
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7675
7683
|
viewBox: "0 0 20 20",
|
|
7676
7684
|
fill: "currentColor"
|
|
7677
|
-
}, props), _path$
|
|
7685
|
+
}, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
|
|
7678
7686
|
fillRule: "evenodd",
|
|
7679
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",
|
|
7680
7688
|
clipRule: "evenodd"
|
|
7681
7689
|
})));
|
|
7682
7690
|
}
|
|
7683
7691
|
|
|
7684
|
-
var _path$
|
|
7692
|
+
var _path$o, _path2$3;
|
|
7685
7693
|
|
|
7686
|
-
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); }
|
|
7687
7695
|
|
|
7688
7696
|
function SvgSpinner(props) {
|
|
7689
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
7697
|
+
return /*#__PURE__*/React.createElement("svg", _extends$q({
|
|
7690
7698
|
className: "plc-animate-spin",
|
|
7691
7699
|
viewBox: "0 0 24 24",
|
|
7692
7700
|
fill: "currentColor",
|
|
7693
7701
|
xmlns: "http://www.w3.org/2000/svg"
|
|
7694
|
-
}, props), _path$
|
|
7702
|
+
}, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
|
|
7695
7703
|
opacity: 0.2,
|
|
7696
7704
|
fill: "evenodd",
|
|
7697
7705
|
clipRule: "evenodd",
|
|
@@ -9629,16 +9637,16 @@ const LoginPassword = props => /*#__PURE__*/React__default.createElement(Passwor
|
|
|
9629
9637
|
store: store$f
|
|
9630
9638
|
}, props));
|
|
9631
9639
|
|
|
9632
|
-
var _path$
|
|
9640
|
+
var _path$n;
|
|
9633
9641
|
|
|
9634
|
-
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); }
|
|
9635
9643
|
|
|
9636
9644
|
function SvgCheck(props) {
|
|
9637
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
9645
|
+
return /*#__PURE__*/React.createElement("svg", _extends$p({
|
|
9638
9646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9639
9647
|
fill: "currentColor",
|
|
9640
9648
|
viewBox: "0 0 20 20"
|
|
9641
|
-
}, props), _path$
|
|
9649
|
+
}, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
|
|
9642
9650
|
fillRule: "evenodd",
|
|
9643
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",
|
|
9644
9652
|
clipRule: "evenodd"
|
|
@@ -9749,7 +9757,7 @@ const RegisterContainer = ({
|
|
|
9749
9757
|
selectFields
|
|
9750
9758
|
} = filteredData;
|
|
9751
9759
|
|
|
9752
|
-
if (!hasSecurityTokenEnabled()) {
|
|
9760
|
+
if (!hasSecurityTokenEnabled$1()) {
|
|
9753
9761
|
sendRegisterRequest();
|
|
9754
9762
|
return;
|
|
9755
9763
|
}
|
|
@@ -9950,20 +9958,20 @@ const RegisterContainer = ({
|
|
|
9950
9958
|
* @return {boolean}
|
|
9951
9959
|
*/
|
|
9952
9960
|
|
|
9953
|
-
function hasSecurityTokenEnabled() {
|
|
9961
|
+
function hasSecurityTokenEnabled$1() {
|
|
9954
9962
|
const hasSecuritySdkLoaded = Boolean(window.grecaptcha);
|
|
9955
9963
|
return hasSecuritySdkLoaded;
|
|
9956
9964
|
}
|
|
9957
9965
|
|
|
9958
|
-
var _path$
|
|
9966
|
+
var _path$m;
|
|
9959
9967
|
|
|
9960
|
-
function _extends$
|
|
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); }
|
|
9961
9969
|
|
|
9962
9970
|
function SvgFacebookLogo(props) {
|
|
9963
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
9971
|
+
return /*#__PURE__*/React.createElement("svg", _extends$o({
|
|
9964
9972
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9965
9973
|
viewBox: "88.428 12.828 107.543 207.085"
|
|
9966
|
-
}, props), _path$
|
|
9974
|
+
}, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
|
|
9967
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",
|
|
9968
9976
|
fill: "#3c5a9a"
|
|
9969
9977
|
})));
|
|
@@ -10036,15 +10044,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
|
|
|
10036
10044
|
unwrapExports(googleLogin);
|
|
10037
10045
|
var googleLogin_1 = googleLogin.GoogleLogin;
|
|
10038
10046
|
|
|
10039
|
-
var _path$
|
|
10047
|
+
var _path$l, _path2$2, _path3$1, _path4;
|
|
10040
10048
|
|
|
10041
|
-
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); }
|
|
10042
10050
|
|
|
10043
10051
|
function SvgGoogleLogo(props) {
|
|
10044
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
10052
|
+
return /*#__PURE__*/React.createElement("svg", _extends$n({
|
|
10045
10053
|
viewBox: "0 0 24 24",
|
|
10046
10054
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10047
|
-
}, props), _path$
|
|
10055
|
+
}, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
|
|
10048
10056
|
fill: "#4285F4",
|
|
10049
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"
|
|
10050
10058
|
})), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
|
|
@@ -10178,15 +10186,15 @@ function LoginView(props) {
|
|
|
10178
10186
|
}, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
|
|
10179
10187
|
}
|
|
10180
10188
|
|
|
10181
|
-
var _path$
|
|
10189
|
+
var _path$k, _path2$1, _path3;
|
|
10182
10190
|
|
|
10183
|
-
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); }
|
|
10184
10192
|
|
|
10185
10193
|
function SvgPelcroAuthorship(props) {
|
|
10186
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
10194
|
+
return /*#__PURE__*/React.createElement("svg", _extends$m({
|
|
10187
10195
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10188
10196
|
viewBox: "0 -80.652 497.072 179.991"
|
|
10189
|
-
}, props), _path$
|
|
10197
|
+
}, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
|
|
10190
10198
|
fill: "none",
|
|
10191
10199
|
stroke: "#4a4a4a",
|
|
10192
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"
|
|
@@ -10580,7 +10588,17 @@ function RegisterView(props) {
|
|
|
10580
10588
|
className: "plc-w-full plc-mt-2",
|
|
10581
10589
|
id: "pelcro-submit",
|
|
10582
10590
|
name: t("messages.createAccount")
|
|
10583
|
-
}),
|
|
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", {
|
|
10584
10602
|
className: "plc-mt-5"
|
|
10585
10603
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10586
10604
|
className: "plc-flex plc-items-center plc-justify-between "
|
|
@@ -10594,6 +10612,16 @@ function RegisterView(props) {
|
|
|
10594
10612
|
className: "plc-flex plc-justify-center plc-px-5 plc-mt-1 plc-space-x-3"
|
|
10595
10613
|
}, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
|
|
10596
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
|
+
}
|
|
10597
10625
|
|
|
10598
10626
|
function TextInput({
|
|
10599
10627
|
store,
|
|
@@ -13550,7 +13578,16 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
13550
13578
|
const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
|
|
13551
13579
|
|
|
13552
13580
|
const PaymentMethodContainer = props => {
|
|
13553
|
-
|
|
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) {
|
|
13554
13591
|
return /*#__PURE__*/React__default.createElement(es_13, {
|
|
13555
13592
|
apiKey: window.Pelcro.environment.stripe,
|
|
13556
13593
|
stripeAccount: window.Pelcro.site.read().account_id,
|
|
@@ -13726,17 +13763,17 @@ const SubmitPaymentMethod = ({
|
|
|
13726
13763
|
}, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
|
|
13727
13764
|
};
|
|
13728
13765
|
|
|
13729
|
-
var _path$
|
|
13766
|
+
var _path$j;
|
|
13730
13767
|
|
|
13731
|
-
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); }
|
|
13732
13769
|
|
|
13733
13770
|
function SvgArrowLeft(props) {
|
|
13734
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
13771
|
+
return /*#__PURE__*/React.createElement("svg", _extends$l({
|
|
13735
13772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13736
13773
|
fill: "none",
|
|
13737
13774
|
viewBox: "0 0 24 24",
|
|
13738
13775
|
stroke: "currentColor"
|
|
13739
|
-
}, props), _path$
|
|
13776
|
+
}, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
|
|
13740
13777
|
strokeLinecap: "round",
|
|
13741
13778
|
strokeLinejoin: "round",
|
|
13742
13779
|
strokeWidth: 2,
|
|
@@ -13818,17 +13855,17 @@ const CouponCodeField = props => {
|
|
|
13818
13855
|
}, props));
|
|
13819
13856
|
};
|
|
13820
13857
|
|
|
13821
|
-
var _path$
|
|
13858
|
+
var _path$i;
|
|
13822
13859
|
|
|
13823
|
-
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); }
|
|
13824
13861
|
|
|
13825
13862
|
function SvgTicket(props) {
|
|
13826
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
13863
|
+
return /*#__PURE__*/React.createElement("svg", _extends$k({
|
|
13827
13864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13828
13865
|
fill: "none",
|
|
13829
13866
|
viewBox: "0 0 24 24",
|
|
13830
13867
|
stroke: "currentColor"
|
|
13831
|
-
}, props), _path$
|
|
13868
|
+
}, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
|
|
13832
13869
|
strokeLinecap: "round",
|
|
13833
13870
|
strokeLinejoin: "round",
|
|
13834
13871
|
strokeWidth: 2,
|
|
@@ -14187,16 +14224,16 @@ const BankRedirection = () => {
|
|
|
14187
14224
|
}));
|
|
14188
14225
|
};
|
|
14189
14226
|
|
|
14190
|
-
var _path$
|
|
14227
|
+
var _path$h;
|
|
14191
14228
|
|
|
14192
|
-
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); }
|
|
14193
14230
|
|
|
14194
14231
|
function SvgLock(props) {
|
|
14195
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
14232
|
+
return /*#__PURE__*/React.createElement("svg", _extends$j({
|
|
14196
14233
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14197
14234
|
viewBox: "0 0 20 20",
|
|
14198
14235
|
fill: "currentColor"
|
|
14199
|
-
}, props), _path$
|
|
14236
|
+
}, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
|
|
14200
14237
|
fillRule: "evenodd",
|
|
14201
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",
|
|
14202
14239
|
clipRule: "evenodd"
|
|
@@ -14418,12 +14455,12 @@ function SubscriptionRenewModal({
|
|
|
14418
14455
|
}
|
|
14419
14456
|
SubscriptionRenewModal.viewId = "subscription-renew";
|
|
14420
14457
|
|
|
14421
|
-
var _path$
|
|
14458
|
+
var _path$g;
|
|
14422
14459
|
|
|
14423
|
-
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); }
|
|
14424
14461
|
|
|
14425
14462
|
function SvgGift(props) {
|
|
14426
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
14463
|
+
return /*#__PURE__*/React.createElement("svg", _extends$i({
|
|
14427
14464
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
14428
14465
|
fill: "none",
|
|
14429
14466
|
stroke: "currentColor",
|
|
@@ -14432,7 +14469,7 @@ function SvgGift(props) {
|
|
|
14432
14469
|
strokeWidth: 2,
|
|
14433
14470
|
viewBox: "0 0 24 24",
|
|
14434
14471
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14435
|
-
}, props), _path$
|
|
14472
|
+
}, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
|
|
14436
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"
|
|
14437
14474
|
})));
|
|
14438
14475
|
}
|
|
@@ -15433,17 +15470,17 @@ const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone
|
|
|
15433
15470
|
|
|
15434
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";
|
|
15435
15472
|
|
|
15436
|
-
var _path$
|
|
15473
|
+
var _path$f;
|
|
15437
15474
|
|
|
15438
|
-
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); }
|
|
15439
15476
|
|
|
15440
15477
|
function SvgEdit(props) {
|
|
15441
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
15478
|
+
return /*#__PURE__*/React.createElement("svg", _extends$h({
|
|
15442
15479
|
className: "plc-w-6 plc-h-6",
|
|
15443
15480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15444
15481
|
viewBox: "0 0 20 20",
|
|
15445
15482
|
fill: "currentColor"
|
|
15446
|
-
}, props), _path$
|
|
15483
|
+
}, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
|
|
15447
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"
|
|
15448
15485
|
})));
|
|
15449
15486
|
}
|
|
@@ -18553,18 +18590,18 @@ const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(La
|
|
|
18553
18590
|
store: store$4
|
|
18554
18591
|
}, props));
|
|
18555
18592
|
|
|
18556
|
-
var _path$
|
|
18593
|
+
var _path$e;
|
|
18557
18594
|
|
|
18558
|
-
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); }
|
|
18559
18596
|
|
|
18560
18597
|
function SvgInfoCircle(props) {
|
|
18561
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
18598
|
+
return /*#__PURE__*/React.createElement("svg", _extends$g({
|
|
18562
18599
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18563
18600
|
className: "plc-w-5 plc-h-5",
|
|
18564
18601
|
fill: "none",
|
|
18565
18602
|
viewBox: "0 0 24 24",
|
|
18566
18603
|
stroke: "currentColor"
|
|
18567
|
-
}, props), _path$
|
|
18604
|
+
}, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
|
|
18568
18605
|
strokeLinecap: "round",
|
|
18569
18606
|
strokeLinejoin: "round",
|
|
18570
18607
|
strokeWidth: 2,
|
|
@@ -19551,8 +19588,8 @@ const PaymentMethodSelectModal = ({
|
|
|
19551
19588
|
};
|
|
19552
19589
|
PaymentMethodSelectModal.viewId = "payment-method-select";
|
|
19553
19590
|
|
|
19554
|
-
function _extends$
|
|
19555
|
-
_extends$
|
|
19591
|
+
function _extends$f() {
|
|
19592
|
+
_extends$f = Object.assign || function (target) {
|
|
19556
19593
|
for (var i = 1; i < arguments.length; i++) {
|
|
19557
19594
|
var source = arguments[i];
|
|
19558
19595
|
|
|
@@ -19566,7 +19603,7 @@ function _extends$e() {
|
|
|
19566
19603
|
return target;
|
|
19567
19604
|
};
|
|
19568
19605
|
|
|
19569
|
-
return _extends$
|
|
19606
|
+
return _extends$f.apply(this, arguments);
|
|
19570
19607
|
}
|
|
19571
19608
|
|
|
19572
19609
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -19750,7 +19787,7 @@ function render(props, propsBag, defaultTag, features, visible) {
|
|
|
19750
19787
|
return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
|
|
19751
19788
|
return null;
|
|
19752
19789
|
}, _match[RenderStrategy.Hidden] = function () {
|
|
19753
|
-
return _render(_extends$
|
|
19790
|
+
return _render(_extends$f({}, _rest, {
|
|
19754
19791
|
hidden: true,
|
|
19755
19792
|
style: {
|
|
19756
19793
|
display: 'none'
|
|
@@ -20278,7 +20315,7 @@ function TransitionChild(props) {
|
|
|
20278
20315
|
var passthroughProps = rest;
|
|
20279
20316
|
return React__default.createElement(NestingContext.Provider, {
|
|
20280
20317
|
value: nesting
|
|
20281
|
-
}, render(_extends$
|
|
20318
|
+
}, render(_extends$f({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
|
|
20282
20319
|
}
|
|
20283
20320
|
|
|
20284
20321
|
function Transition(props) {
|
|
@@ -20322,7 +20359,7 @@ function Transition(props) {
|
|
|
20322
20359
|
value: nestingBag
|
|
20323
20360
|
}, React__default.createElement(TransitionContext.Provider, {
|
|
20324
20361
|
value: transitionBag
|
|
20325
|
-
}, render(_extends$
|
|
20362
|
+
}, render(_extends$f({}, sharedProps, {
|
|
20326
20363
|
as: Fragment,
|
|
20327
20364
|
children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
|
|
20328
20365
|
}), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
|
|
@@ -20449,12 +20486,12 @@ var ActionTypes;
|
|
|
20449
20486
|
})(ActionTypes || (ActionTypes = {}));
|
|
20450
20487
|
|
|
20451
20488
|
(_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
|
|
20452
|
-
return _extends$
|
|
20489
|
+
return _extends$f({}, state, {
|
|
20453
20490
|
activeItemIndex: null,
|
|
20454
20491
|
menuState: MenuStates.Closed
|
|
20455
20492
|
});
|
|
20456
20493
|
}, _reducers[ActionTypes.OpenMenu] = function (state) {
|
|
20457
|
-
return _extends$
|
|
20494
|
+
return _extends$f({}, state, {
|
|
20458
20495
|
menuState: MenuStates.Open
|
|
20459
20496
|
});
|
|
20460
20497
|
}, _reducers[ActionTypes.GoToItem] = function (state, action) {
|
|
@@ -20473,7 +20510,7 @@ var ActionTypes;
|
|
|
20473
20510
|
}
|
|
20474
20511
|
});
|
|
20475
20512
|
if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
|
|
20476
|
-
return _extends$
|
|
20513
|
+
return _extends$f({}, state, {
|
|
20477
20514
|
searchQuery: '',
|
|
20478
20515
|
activeItemIndex: activeItemIndex
|
|
20479
20516
|
});
|
|
@@ -20484,19 +20521,19 @@ var ActionTypes;
|
|
|
20484
20521
|
|
|
20485
20522
|
return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
|
|
20486
20523
|
});
|
|
20487
|
-
if (match === -1 || match === state.activeItemIndex) return _extends$
|
|
20524
|
+
if (match === -1 || match === state.activeItemIndex) return _extends$f({}, state, {
|
|
20488
20525
|
searchQuery: searchQuery
|
|
20489
20526
|
});
|
|
20490
|
-
return _extends$
|
|
20527
|
+
return _extends$f({}, state, {
|
|
20491
20528
|
searchQuery: searchQuery,
|
|
20492
20529
|
activeItemIndex: match
|
|
20493
20530
|
});
|
|
20494
20531
|
}, _reducers[ActionTypes.ClearSearch] = function (state) {
|
|
20495
|
-
return _extends$
|
|
20532
|
+
return _extends$f({}, state, {
|
|
20496
20533
|
searchQuery: ''
|
|
20497
20534
|
});
|
|
20498
20535
|
}, _reducers[ActionTypes.RegisterItem] = function (state, action) {
|
|
20499
|
-
return _extends$
|
|
20536
|
+
return _extends$f({}, state, {
|
|
20500
20537
|
items: [].concat(state.items, [{
|
|
20501
20538
|
id: action.id,
|
|
20502
20539
|
dataRef: action.dataRef
|
|
@@ -20509,7 +20546,7 @@ var ActionTypes;
|
|
|
20509
20546
|
return a.id === action.id;
|
|
20510
20547
|
});
|
|
20511
20548
|
if (idx !== -1) nextItems.splice(idx, 1);
|
|
20512
|
-
return _extends$
|
|
20549
|
+
return _extends$f({}, state, {
|
|
20513
20550
|
items: nextItems,
|
|
20514
20551
|
activeItemIndex: function () {
|
|
20515
20552
|
if (idx === state.activeItemIndex) return null;
|
|
@@ -20548,19 +20585,19 @@ var ActionTypes$1;
|
|
|
20548
20585
|
(_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
|
|
20549
20586
|
if (state.disabled) return state;
|
|
20550
20587
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
20551
|
-
return _extends$
|
|
20588
|
+
return _extends$f({}, state, {
|
|
20552
20589
|
activeOptionIndex: null,
|
|
20553
20590
|
listboxState: ListboxStates.Closed
|
|
20554
20591
|
});
|
|
20555
20592
|
}, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
|
|
20556
20593
|
if (state.disabled) return state;
|
|
20557
20594
|
if (state.listboxState === ListboxStates.Open) return state;
|
|
20558
|
-
return _extends$
|
|
20595
|
+
return _extends$f({}, state, {
|
|
20559
20596
|
listboxState: ListboxStates.Open
|
|
20560
20597
|
});
|
|
20561
20598
|
}, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
|
|
20562
20599
|
if (state.disabled === action.disabled) return state;
|
|
20563
|
-
return _extends$
|
|
20600
|
+
return _extends$f({}, state, {
|
|
20564
20601
|
disabled: action.disabled
|
|
20565
20602
|
});
|
|
20566
20603
|
}, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
|
|
@@ -20581,7 +20618,7 @@ var ActionTypes$1;
|
|
|
20581
20618
|
}
|
|
20582
20619
|
});
|
|
20583
20620
|
if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
|
|
20584
|
-
return _extends$
|
|
20621
|
+
return _extends$f({}, state, {
|
|
20585
20622
|
searchQuery: '',
|
|
20586
20623
|
activeOptionIndex: activeOptionIndex
|
|
20587
20624
|
});
|
|
@@ -20594,10 +20631,10 @@ var ActionTypes$1;
|
|
|
20594
20631
|
|
|
20595
20632
|
return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
|
|
20596
20633
|
});
|
|
20597
|
-
if (match === -1 || match === state.activeOptionIndex) return _extends$
|
|
20634
|
+
if (match === -1 || match === state.activeOptionIndex) return _extends$f({}, state, {
|
|
20598
20635
|
searchQuery: searchQuery
|
|
20599
20636
|
});
|
|
20600
|
-
return _extends$
|
|
20637
|
+
return _extends$f({}, state, {
|
|
20601
20638
|
searchQuery: searchQuery,
|
|
20602
20639
|
activeOptionIndex: match
|
|
20603
20640
|
});
|
|
@@ -20605,11 +20642,11 @@ var ActionTypes$1;
|
|
|
20605
20642
|
if (state.disabled) return state;
|
|
20606
20643
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
20607
20644
|
if (state.searchQuery === '') return state;
|
|
20608
|
-
return _extends$
|
|
20645
|
+
return _extends$f({}, state, {
|
|
20609
20646
|
searchQuery: ''
|
|
20610
20647
|
});
|
|
20611
20648
|
}, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
|
|
20612
|
-
return _extends$
|
|
20649
|
+
return _extends$f({}, state, {
|
|
20613
20650
|
options: [].concat(state.options, [{
|
|
20614
20651
|
id: action.id,
|
|
20615
20652
|
dataRef: action.dataRef
|
|
@@ -20622,7 +20659,7 @@ var ActionTypes$1;
|
|
|
20622
20659
|
return a.id === action.id;
|
|
20623
20660
|
});
|
|
20624
20661
|
if (idx !== -1) nextOptions.splice(idx, 1);
|
|
20625
|
-
return _extends$
|
|
20662
|
+
return _extends$f({}, state, {
|
|
20626
20663
|
options: nextOptions,
|
|
20627
20664
|
activeOptionIndex: function () {
|
|
20628
20665
|
if (idx === state.activeOptionIndex) return null;
|
|
@@ -20683,18 +20720,18 @@ const getPaymentCardIcon = name => {
|
|
|
20683
20720
|
}));
|
|
20684
20721
|
};
|
|
20685
20722
|
|
|
20686
|
-
var _path$
|
|
20723
|
+
var _path$d;
|
|
20687
20724
|
|
|
20688
|
-
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); }
|
|
20689
20726
|
|
|
20690
20727
|
function SvgChevronRight(props) {
|
|
20691
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
20728
|
+
return /*#__PURE__*/React.createElement("svg", _extends$e({
|
|
20692
20729
|
className: "plc-w-6 plc-h-6",
|
|
20693
20730
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20694
20731
|
fill: "none",
|
|
20695
20732
|
viewBox: "0 0 24 24",
|
|
20696
20733
|
stroke: "currentColor"
|
|
20697
|
-
}, props), _path$
|
|
20734
|
+
}, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
|
|
20698
20735
|
strokeLinecap: "round",
|
|
20699
20736
|
strokeLinejoin: "round",
|
|
20700
20737
|
strokeWidth: 2,
|
|
@@ -20910,6 +20947,266 @@ const SavedItems = ({
|
|
|
20910
20947
|
});
|
|
20911
20948
|
};
|
|
20912
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
|
+
|
|
20913
21210
|
/**
|
|
20914
21211
|
* @typedef {Object} AccordionPropsType
|
|
20915
21212
|
* @property {string} initialActiveMenu the initial active menu
|
|
@@ -20936,7 +21233,7 @@ const Accordion = ({
|
|
|
20936
21233
|
};
|
|
20937
21234
|
|
|
20938
21235
|
return React__default.Children.map(children, (child, i) => {
|
|
20939
|
-
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) {
|
|
20940
21237
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
20941
21238
|
activeMenu,
|
|
20942
21239
|
toggleActiveMenu,
|
|
@@ -20992,18 +21289,18 @@ Accordion.item = function AccordionItem({
|
|
|
20992
21289
|
}, content)) : null;
|
|
20993
21290
|
};
|
|
20994
21291
|
|
|
20995
|
-
var _path$
|
|
21292
|
+
var _path$8;
|
|
20996
21293
|
|
|
20997
|
-
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); }
|
|
20998
21295
|
|
|
20999
21296
|
function SvgExit(props) {
|
|
21000
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21297
|
+
return /*#__PURE__*/React.createElement("svg", _extends$9({
|
|
21001
21298
|
className: "plc-w-6 plc-h-6",
|
|
21002
21299
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21003
21300
|
fill: "none",
|
|
21004
21301
|
viewBox: "0 0 24 24",
|
|
21005
21302
|
stroke: "currentColor"
|
|
21006
|
-
}, props), _path$
|
|
21303
|
+
}, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
|
|
21007
21304
|
strokeLinecap: "round",
|
|
21008
21305
|
strokeLinejoin: "round",
|
|
21009
21306
|
strokeWidth: 2,
|
|
@@ -21011,34 +21308,17 @@ function SvgExit(props) {
|
|
|
21011
21308
|
})));
|
|
21012
21309
|
}
|
|
21013
21310
|
|
|
21014
|
-
var _path$
|
|
21015
|
-
|
|
21016
|
-
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); }
|
|
21017
|
-
|
|
21018
|
-
function SvgCheckMark(props) {
|
|
21019
|
-
return /*#__PURE__*/React.createElement("svg", _extends$b({
|
|
21020
|
-
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
21021
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21022
|
-
viewBox: "0 0 20 20",
|
|
21023
|
-
fill: "currentColor"
|
|
21024
|
-
}, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
|
|
21025
|
-
fillRule: "evenodd",
|
|
21026
|
-
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",
|
|
21027
|
-
clipRule: "evenodd"
|
|
21028
|
-
})));
|
|
21029
|
-
}
|
|
21030
|
-
|
|
21031
|
-
var _path$9;
|
|
21311
|
+
var _path$7;
|
|
21032
21312
|
|
|
21033
|
-
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); }
|
|
21034
21314
|
|
|
21035
21315
|
function SvgUser(props) {
|
|
21036
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21316
|
+
return /*#__PURE__*/React.createElement("svg", _extends$8({
|
|
21037
21317
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21038
21318
|
fill: "none",
|
|
21039
21319
|
viewBox: "0 0 24 24",
|
|
21040
21320
|
stroke: "currentColor"
|
|
21041
|
-
}, props), _path$
|
|
21321
|
+
}, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
|
|
21042
21322
|
strokeLinecap: "round",
|
|
21043
21323
|
strokeLinejoin: "round",
|
|
21044
21324
|
strokeWidth: 2,
|
|
@@ -21046,18 +21326,18 @@ function SvgUser(props) {
|
|
|
21046
21326
|
})));
|
|
21047
21327
|
}
|
|
21048
21328
|
|
|
21049
|
-
var _path$
|
|
21329
|
+
var _path$6;
|
|
21050
21330
|
|
|
21051
|
-
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); }
|
|
21052
21332
|
|
|
21053
21333
|
function SvgNewsletter(props) {
|
|
21054
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21334
|
+
return /*#__PURE__*/React.createElement("svg", _extends$7({
|
|
21055
21335
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21056
21336
|
className: "plc-h-5 plc-w-5",
|
|
21057
21337
|
fill: "none",
|
|
21058
21338
|
viewBox: "0 0 24 24",
|
|
21059
21339
|
stroke: "currentColor"
|
|
21060
|
-
}, props), _path$
|
|
21340
|
+
}, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
|
|
21061
21341
|
strokeLinecap: "round",
|
|
21062
21342
|
strokeLinejoin: "round",
|
|
21063
21343
|
strokeWidth: 2,
|
|
@@ -21065,37 +21345,18 @@ function SvgNewsletter(props) {
|
|
|
21065
21345
|
})));
|
|
21066
21346
|
}
|
|
21067
21347
|
|
|
21068
|
-
var _path$
|
|
21348
|
+
var _path$5;
|
|
21069
21349
|
|
|
21070
|
-
function _extends$
|
|
21071
|
-
|
|
21072
|
-
function SvgRefresh(props) {
|
|
21073
|
-
return /*#__PURE__*/React.createElement("svg", _extends$8({
|
|
21074
|
-
className: "plc-w-4 plc-h-4 plc-mr-1",
|
|
21075
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21076
|
-
fill: "none",
|
|
21077
|
-
viewBox: "0 0 24 24",
|
|
21078
|
-
stroke: "currentColor"
|
|
21079
|
-
}, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
|
|
21080
|
-
strokeLinecap: "round",
|
|
21081
|
-
strokeLinejoin: "round",
|
|
21082
|
-
strokeWidth: 2,
|
|
21083
|
-
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"
|
|
21084
|
-
})));
|
|
21085
|
-
}
|
|
21086
|
-
|
|
21087
|
-
var _path$6;
|
|
21088
|
-
|
|
21089
|
-
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); }
|
|
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); }
|
|
21090
21351
|
|
|
21091
21352
|
function SvgPaymentCard(props) {
|
|
21092
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21353
|
+
return /*#__PURE__*/React.createElement("svg", _extends$6({
|
|
21093
21354
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
21094
21355
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21095
21356
|
fill: "none",
|
|
21096
21357
|
viewBox: "0 0 24 24",
|
|
21097
21358
|
stroke: "currentColor"
|
|
21098
|
-
}, props), _path$
|
|
21359
|
+
}, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
|
|
21099
21360
|
strokeLinecap: "round",
|
|
21100
21361
|
strokeLinejoin: "round",
|
|
21101
21362
|
strokeWidth: 2,
|
|
@@ -21103,18 +21364,18 @@ function SvgPaymentCard(props) {
|
|
|
21103
21364
|
})));
|
|
21104
21365
|
}
|
|
21105
21366
|
|
|
21106
|
-
var _path$
|
|
21367
|
+
var _path$4, _path2;
|
|
21107
21368
|
|
|
21108
|
-
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); }
|
|
21109
21370
|
|
|
21110
21371
|
function SvgLocationPin(props) {
|
|
21111
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21372
|
+
return /*#__PURE__*/React.createElement("svg", _extends$5({
|
|
21112
21373
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
21113
21374
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21114
21375
|
fill: "none",
|
|
21115
21376
|
viewBox: "0 0 24 24",
|
|
21116
21377
|
stroke: "currentColor"
|
|
21117
|
-
}, props), _path$
|
|
21378
|
+
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
21118
21379
|
strokeLinecap: "round",
|
|
21119
21380
|
strokeLinejoin: "round",
|
|
21120
21381
|
strokeWidth: 2,
|
|
@@ -21129,10 +21390,10 @@ function SvgLocationPin(props) {
|
|
|
21129
21390
|
|
|
21130
21391
|
var _switch;
|
|
21131
21392
|
|
|
21132
|
-
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); }
|
|
21133
21394
|
|
|
21134
21395
|
function SvgSubscription(props) {
|
|
21135
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
21396
|
+
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
21136
21397
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21137
21398
|
viewBox: "0 0 100 125",
|
|
21138
21399
|
fill: "currentColor"
|
|
@@ -21147,30 +21408,11 @@ function SvgSubscription(props) {
|
|
|
21147
21408
|
}))))));
|
|
21148
21409
|
}
|
|
21149
21410
|
|
|
21150
|
-
var _path$4;
|
|
21151
|
-
|
|
21152
|
-
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); }
|
|
21153
|
-
|
|
21154
|
-
function SvgShopping(props) {
|
|
21155
|
-
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
21156
|
-
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
21157
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21158
|
-
fill: "none",
|
|
21159
|
-
viewBox: "0 0 24 24",
|
|
21160
|
-
stroke: "currentColor"
|
|
21161
|
-
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
21162
|
-
strokeLinecap: "round",
|
|
21163
|
-
strokeLinejoin: "round",
|
|
21164
|
-
strokeWidth: 2,
|
|
21165
|
-
d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"
|
|
21166
|
-
})));
|
|
21167
|
-
}
|
|
21168
|
-
|
|
21169
21411
|
var _path$3;
|
|
21170
21412
|
|
|
21171
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); }
|
|
21172
21414
|
|
|
21173
|
-
function
|
|
21415
|
+
function SvgShopping(props) {
|
|
21174
21416
|
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
21175
21417
|
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
21176
21418
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -21181,7 +21423,7 @@ function SvgBookmark(props) {
|
|
|
21181
21423
|
strokeLinecap: "round",
|
|
21182
21424
|
strokeLinejoin: "round",
|
|
21183
21425
|
strokeWidth: 2,
|
|
21184
|
-
d: "
|
|
21426
|
+
d: "M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"
|
|
21185
21427
|
})));
|
|
21186
21428
|
}
|
|
21187
21429
|
|
|
@@ -21189,9 +21431,9 @@ var _path$2;
|
|
|
21189
21431
|
|
|
21190
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); }
|
|
21191
21433
|
|
|
21192
|
-
function
|
|
21434
|
+
function SvgBookmark(props) {
|
|
21193
21435
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
21194
|
-
className: "plc-w-
|
|
21436
|
+
className: "plc-w-6 plc-h-6 plc-mr-2",
|
|
21195
21437
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21196
21438
|
fill: "none",
|
|
21197
21439
|
viewBox: "0 0 24 24",
|
|
@@ -21200,7 +21442,7 @@ function SvgPlus(props) {
|
|
|
21200
21442
|
strokeLinecap: "round",
|
|
21201
21443
|
strokeLinejoin: "round",
|
|
21202
21444
|
strokeWidth: 2,
|
|
21203
|
-
d: "
|
|
21445
|
+
d: "M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"
|
|
21204
21446
|
})));
|
|
21205
21447
|
}
|
|
21206
21448
|
|
|
@@ -21464,116 +21706,6 @@ class Dashboard extends Component {
|
|
|
21464
21706
|
};
|
|
21465
21707
|
});
|
|
21466
21708
|
|
|
21467
|
-
_defineProperty$3(this, "renderSubscriptions", () => {
|
|
21468
|
-
var _this$state$subscript;
|
|
21469
|
-
|
|
21470
|
-
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 => {
|
|
21471
|
-
// Cancel button click handlers
|
|
21472
|
-
const onCancelClick = () => {
|
|
21473
|
-
this.props.onClose();
|
|
21474
|
-
notify.confirm((onSuccess, onFailure) => {
|
|
21475
|
-
this.cancelSubscription(sub.id, onSuccess, onFailure);
|
|
21476
|
-
}, {
|
|
21477
|
-
confirmMessage: this.locale("messages.subCancellation.isSureToCancel"),
|
|
21478
|
-
loadingMessage: this.locale("messages.subCancellation.loading"),
|
|
21479
|
-
successMessage: this.locale("messages.subCancellation.success"),
|
|
21480
|
-
errorMessage: this.locale("messages.subCancellation.error")
|
|
21481
|
-
}, {
|
|
21482
|
-
closeButtonLabel: this.locale("labels.subCancellation.goBack")
|
|
21483
|
-
});
|
|
21484
|
-
}; // Reactivate button click handlers
|
|
21485
|
-
|
|
21486
|
-
|
|
21487
|
-
const onReactivateClick = () => {
|
|
21488
|
-
this.reactivateSubscription(sub.id);
|
|
21489
|
-
}; // Renew click
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
const onRenewClick = () => {
|
|
21493
|
-
const product_id = sub.plan.product.id;
|
|
21494
|
-
const plan_id = sub.plan.id;
|
|
21495
|
-
const product = window.Pelcro.product.getById(product_id);
|
|
21496
|
-
const plan = window.Pelcro.plan.getById(plan_id);
|
|
21497
|
-
this.props.setProductAndPlan(product, plan);
|
|
21498
|
-
this.props.setSubscriptionIdToRenew(sub.id);
|
|
21499
|
-
this.props.setView("plan-select");
|
|
21500
|
-
};
|
|
21501
|
-
|
|
21502
|
-
return /*#__PURE__*/React__default.createElement("tr", {
|
|
21503
|
-
key: "dashboard-subscription-" + sub.id,
|
|
21504
|
-
className: "plc-w-full plc-align-top"
|
|
21505
|
-
}, /*#__PURE__*/React__default.createElement("td", {
|
|
21506
|
-
className: "plc-truncate"
|
|
21507
|
-
}, sub.plan.nickname && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
21508
|
-
className: "plc-font-semibold plc-text-gray-500"
|
|
21509
|
-
}, sub.plan.nickname), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
21510
|
-
className: "plc-text-xs plc-text-gray-400"
|
|
21511
|
-
}, getFormattedPriceByLocal(sub.plan.amount, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span", {
|
|
21512
|
-
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`
|
|
21513
|
-
}, this.getSubscriptionStatus(sub).icon, this.getSubscriptionStatus(sub).title), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
21514
|
-
className: "plc-mb-4 plc-text-xs plc-text-gray-500"
|
|
21515
|
-
}, sub.status && /*#__PURE__*/React__default.createElement("span", {
|
|
21516
|
-
className: "plc-inline-block plc-mt-1 plc-underline"
|
|
21517
|
-
}, this.getSubscriptionStatus(sub).content), /*#__PURE__*/React__default.createElement("br", null), sub.shipments_remaining ? /*#__PURE__*/React__default.createElement("span", {
|
|
21518
|
-
className: "plc-inline-block plc-mt-1"
|
|
21519
|
-
}, 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, {
|
|
21520
|
-
variant: "ghost",
|
|
21521
|
-
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
21522
|
-
icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
|
|
21523
|
-
onClick: onCancelClick,
|
|
21524
|
-
disabled: this.state.disableSubmit,
|
|
21525
|
-
"data-key": sub.id
|
|
21526
|
-
}, this.locale("labels.unsubscribe")), sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
|
|
21527
|
-
variant: "ghost",
|
|
21528
|
-
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
|
|
21529
|
-
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
21530
|
-
onClick: onReactivateClick,
|
|
21531
|
-
disabled: this.state.disableSubmit,
|
|
21532
|
-
"data-key": sub.id
|
|
21533
|
-
}, this.locale("labels.reactivate")), sub.cancel_at_period_end === 1 && /*#__PURE__*/React__default.createElement(Button, {
|
|
21534
|
-
variant: "ghost",
|
|
21535
|
-
className: "plc-text-blue-400 pelcro-dashboard-sub-renew-button",
|
|
21536
|
-
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
21537
|
-
onClick: onRenewClick,
|
|
21538
|
-
disabled: this.state.disableSubmit,
|
|
21539
|
-
"data-key": sub.id
|
|
21540
|
-
}, this.locale("labels.renew"))));
|
|
21541
|
-
});
|
|
21542
|
-
return /*#__PURE__*/React__default.createElement("table", {
|
|
21543
|
-
className: "plc-w-full plc-table-fixed"
|
|
21544
|
-
}, /*#__PURE__*/React__default.createElement("thead", {
|
|
21545
|
-
className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
|
|
21546
|
-
}, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
|
|
21547
|
-
className: "plc-w-5/12 "
|
|
21548
|
-
}, this.locale("labels.plan")), /*#__PURE__*/React__default.createElement("th", {
|
|
21549
|
-
className: "plc-w-4/12 "
|
|
21550
|
-
}, this.locale("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
|
|
21551
|
-
className: "plc-w-3/12 "
|
|
21552
|
-
}, this.locale("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
|
|
21553
|
-
className: "plc-h-4"
|
|
21554
|
-
}), subscriptions, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
21555
|
-
colSpan: "4",
|
|
21556
|
-
className: "plc-p-1"
|
|
21557
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
21558
|
-
variant: "ghost",
|
|
21559
|
-
icon: /*#__PURE__*/React__default.createElement(SvgPlus, {
|
|
21560
|
-
className: "plc-w-4 plc-h-4 plc-mr-1"
|
|
21561
|
-
}),
|
|
21562
|
-
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",
|
|
21563
|
-
onClick: this.displayProductSelect
|
|
21564
|
-
}, this.locale("labels.addSubscription")))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
21565
|
-
colSpan: "4",
|
|
21566
|
-
className: "plc-p-1"
|
|
21567
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
21568
|
-
variant: "ghost",
|
|
21569
|
-
icon: /*#__PURE__*/React__default.createElement(SvgGift, {
|
|
21570
|
-
className: "plc-w-4 plc-h-4 plc-mr-1"
|
|
21571
|
-
}),
|
|
21572
|
-
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",
|
|
21573
|
-
onClick: this.displayRedeem
|
|
21574
|
-
}, this.locale("labels.redeemGift"))))));
|
|
21575
|
-
});
|
|
21576
|
-
|
|
21577
21709
|
_defineProperty$3(this, "renderGiftRecipients", () => {
|
|
21578
21710
|
var _giftRecipients$sort, _giftRecipients$sort$;
|
|
21579
21711
|
|
|
@@ -21848,7 +21980,18 @@ class Dashboard extends Component {
|
|
|
21848
21980
|
className: "plc-w-10 plc-h-10 plc-pt-2 plc-pr-1 plc--ml-2"
|
|
21849
21981
|
}),
|
|
21850
21982
|
title: this.locale("labels.subscriptions"),
|
|
21851
|
-
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
|
+
})
|
|
21852
21995
|
}), /*#__PURE__*/React__default.createElement(Accordion.item, {
|
|
21853
21996
|
name: SUB_MENUS.GIFTS,
|
|
21854
21997
|
icon: /*#__PURE__*/React__default.createElement(SvgGift, null),
|