@pelcro/react-pelcro-js 3.5.0-beta.2 → 3.5.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +39 -30
- package/dist/index.esm.js +39 -30
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -9231,7 +9231,7 @@ toast.confirm = (onConfirm, {
|
|
|
9231
9231
|
};
|
|
9232
9232
|
};
|
|
9233
9233
|
|
|
9234
|
-
const notify
|
|
9234
|
+
const notify = toast;
|
|
9235
9235
|
|
|
9236
9236
|
const translations = i18next.t("common:buttons", {
|
|
9237
9237
|
returnObjects: true
|
|
@@ -9441,7 +9441,7 @@ const init$1 = () => {
|
|
|
9441
9441
|
const errorMsg = i18next.t("shop:messages.currencyMismatch", {
|
|
9442
9442
|
currency: userCurrency
|
|
9443
9443
|
});
|
|
9444
|
-
notify
|
|
9444
|
+
notify.error(errorMsg);
|
|
9445
9445
|
}
|
|
9446
9446
|
});
|
|
9447
9447
|
}
|
|
@@ -9535,7 +9535,7 @@ const init = () => {
|
|
|
9535
9535
|
elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
|
|
9536
9536
|
unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
|
|
9537
9537
|
const NOTIFICATION_ID = "entitlement";
|
|
9538
|
-
notify
|
|
9538
|
+
notify( /*#__PURE__*/React__default['default'].createElement("p", null, /*#__PURE__*/React__default['default'].createElement(Trans, {
|
|
9539
9539
|
i18nKey: "messages:entitlement"
|
|
9540
9540
|
}, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default['default'].createElement(Link, {
|
|
9541
9541
|
onClick: () => {
|
|
@@ -9552,7 +9552,7 @@ const init = () => {
|
|
|
9552
9552
|
});
|
|
9553
9553
|
}
|
|
9554
9554
|
|
|
9555
|
-
notify
|
|
9555
|
+
notify.dismiss(NOTIFICATION_ID);
|
|
9556
9556
|
switchView("_plan-select-entitlements");
|
|
9557
9557
|
}
|
|
9558
9558
|
}, "Subscribe"), "now to get full page access.")), {
|
|
@@ -10296,10 +10296,10 @@ const verifyEmailTokenFromUrl = () => {
|
|
|
10296
10296
|
token: emailToken
|
|
10297
10297
|
}, (err, res) => {
|
|
10298
10298
|
if (err) {
|
|
10299
|
-
return notify
|
|
10299
|
+
return notify.error(getErrorMessages(err));
|
|
10300
10300
|
}
|
|
10301
10301
|
|
|
10302
|
-
return notify
|
|
10302
|
+
return notify.success(translations.success);
|
|
10303
10303
|
});
|
|
10304
10304
|
}, {
|
|
10305
10305
|
once: true
|
|
@@ -10325,7 +10325,7 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10325
10325
|
token: loginToken
|
|
10326
10326
|
}, (err, res) => {
|
|
10327
10327
|
if (err) {
|
|
10328
|
-
return notify
|
|
10328
|
+
return notify.error(getErrorMessages(err));
|
|
10329
10329
|
}
|
|
10330
10330
|
|
|
10331
10331
|
const {
|
|
@@ -10335,11 +10335,11 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10335
10335
|
auth_token
|
|
10336
10336
|
}, (err, res) => {
|
|
10337
10337
|
if (err) {
|
|
10338
|
-
return notify
|
|
10338
|
+
return notify.error(getErrorMessages(err));
|
|
10339
10339
|
}
|
|
10340
10340
|
|
|
10341
10341
|
resetView();
|
|
10342
|
-
return notify
|
|
10342
|
+
return notify.success(translations.success);
|
|
10343
10343
|
});
|
|
10344
10344
|
});
|
|
10345
10345
|
}, {
|
|
@@ -10380,7 +10380,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10380
10380
|
const errorMessage = i18next.t("messages:invalidInvoice", {
|
|
10381
10381
|
returnObjects: true
|
|
10382
10382
|
});
|
|
10383
|
-
return notify
|
|
10383
|
+
return notify.error(errorMessage);
|
|
10384
10384
|
}
|
|
10385
10385
|
|
|
10386
10386
|
const {
|
|
@@ -10391,7 +10391,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10391
10391
|
const errorMessage = i18next.t("messages:zeroTotalInvoice", {
|
|
10392
10392
|
returnObjects: true
|
|
10393
10393
|
});
|
|
10394
|
-
return notify
|
|
10394
|
+
return notify.error(errorMessage);
|
|
10395
10395
|
}
|
|
10396
10396
|
|
|
10397
10397
|
return switchView("invoice-details");
|
|
@@ -14796,19 +14796,11 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
14796
14796
|
type: UPDATE_COUPON_CODE,
|
|
14797
14797
|
payload: window.Pelcro.coupon.getFromUrl()
|
|
14798
14798
|
});
|
|
14799
|
-
dispatch({
|
|
14800
|
-
type: SHOW_COUPON_FIELD,
|
|
14801
|
-
payload: true
|
|
14802
|
-
});
|
|
14803
14799
|
} else if (couponCode) {
|
|
14804
14800
|
dispatch({
|
|
14805
14801
|
type: UPDATE_COUPON_CODE,
|
|
14806
14802
|
payload: couponCode
|
|
14807
14803
|
});
|
|
14808
|
-
dispatch({
|
|
14809
|
-
type: SHOW_COUPON_FIELD,
|
|
14810
|
-
payload: true
|
|
14811
|
-
});
|
|
14812
14804
|
}
|
|
14813
14805
|
|
|
14814
14806
|
dispatch({
|
|
@@ -17189,7 +17181,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
17189
17181
|
|
|
17190
17182
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17191
17183
|
|
|
17192
|
-
notify
|
|
17184
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17193
17185
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17194
17186
|
}, {
|
|
17195
17187
|
confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
|
|
@@ -17261,7 +17253,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
17261
17253
|
|
|
17262
17254
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17263
17255
|
|
|
17264
|
-
notify
|
|
17256
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17265
17257
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17266
17258
|
}, {
|
|
17267
17259
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -19401,7 +19393,8 @@ const AddressCreateModal = ({
|
|
|
19401
19393
|
}) => {
|
|
19402
19394
|
const {
|
|
19403
19395
|
switchView,
|
|
19404
|
-
switchToPaymentView
|
|
19396
|
+
switchToPaymentView,
|
|
19397
|
+
resetView
|
|
19405
19398
|
} = usePelcro();
|
|
19406
19399
|
|
|
19407
19400
|
const onSuccess = newAddressId => {
|
|
@@ -19423,6 +19416,7 @@ const AddressCreateModal = ({
|
|
|
19423
19416
|
var _otherProps$onMembers;
|
|
19424
19417
|
|
|
19425
19418
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
19419
|
+
resetView();
|
|
19426
19420
|
};
|
|
19427
19421
|
|
|
19428
19422
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -22336,7 +22330,7 @@ const AddressSelectContainer = ({
|
|
|
22336
22330
|
return onFailure(err);
|
|
22337
22331
|
}
|
|
22338
22332
|
|
|
22339
|
-
notify
|
|
22333
|
+
notify.success(t("messages.addressUpdated"));
|
|
22340
22334
|
return onMembershipAdressUpdateSuccess(res);
|
|
22341
22335
|
});
|
|
22342
22336
|
}
|
|
@@ -22377,6 +22371,8 @@ const AddressSelectContainer = ({
|
|
|
22377
22371
|
};
|
|
22378
22372
|
|
|
22379
22373
|
const [state, dispatch] = useReducerWithSideEffects((state, action) => {
|
|
22374
|
+
var _selectedMembership$a;
|
|
22375
|
+
|
|
22380
22376
|
switch (action.type) {
|
|
22381
22377
|
case SELECT_ADDRESS:
|
|
22382
22378
|
return lib_7({ ...state,
|
|
@@ -22386,7 +22382,7 @@ const AddressSelectContainer = ({
|
|
|
22386
22382
|
case LOAD_ADDRESSES:
|
|
22387
22383
|
return lib_7({ ...state,
|
|
22388
22384
|
addresses: moveDefaultAddressToStart(action.payload),
|
|
22389
|
-
selectedAddressId: String(getDefaultAddress(action.payload).id)
|
|
22385
|
+
selectedAddressId: String((_selectedMembership$a = selectedMembership === null || selectedMembership === void 0 ? void 0 : selectedMembership.address_id) !== null && _selectedMembership$a !== void 0 ? _selectedMembership$a : getDefaultAddress(action.payload).id)
|
|
22390
22386
|
});
|
|
22391
22387
|
|
|
22392
22388
|
case SHOW_ALERT:
|
|
@@ -22533,7 +22529,8 @@ const AddressSelectModal = ({
|
|
|
22533
22529
|
}) => {
|
|
22534
22530
|
const {
|
|
22535
22531
|
switchView,
|
|
22536
|
-
switchToPaymentView
|
|
22532
|
+
switchToPaymentView,
|
|
22533
|
+
resetView
|
|
22537
22534
|
} = usePelcro();
|
|
22538
22535
|
|
|
22539
22536
|
const onSuccess = selectedAddressId => {
|
|
@@ -22559,6 +22556,7 @@ const AddressSelectModal = ({
|
|
|
22559
22556
|
var _otherProps$onMembers;
|
|
22560
22557
|
|
|
22561
22558
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
22559
|
+
resetView();
|
|
22562
22560
|
};
|
|
22563
22561
|
|
|
22564
22562
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -24328,7 +24326,7 @@ const SubscriptionsItems = ({
|
|
|
24328
24326
|
}
|
|
24329
24327
|
|
|
24330
24328
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
24331
|
-
notify
|
|
24329
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
24332
24330
|
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
24333
24331
|
}, {
|
|
24334
24332
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -24961,14 +24959,16 @@ const MembershipsItems = () => {
|
|
|
24961
24959
|
className: "plc-truncate"
|
|
24962
24960
|
}, membership.subscription.plan.nickname && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24963
24961
|
className: "plc-font-semibold plc-text-gray-500 pelcro-membership-plan"
|
|
24964
|
-
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("span",
|
|
24962
|
+
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24963
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getMemberShipStatus(membership.status).bgColor} plc-uppercase ${getMemberShipStatus(membership.status).textColor} plc-rounded-lg`
|
|
24964
|
+
}, getMemberShipStatus(membership.status).icon, getMemberShipStatus(membership.status).title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
24965
24965
|
variant: "ghost",
|
|
24966
24966
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, {
|
|
24967
24967
|
className: "plc-w-4 plc-h-4"
|
|
24968
24968
|
}),
|
|
24969
24969
|
className: "plc-text-blue-400 focus:plc-ring-blue-500 pelcro-dashboard-membership-address-button",
|
|
24970
24970
|
onClick: () => onChangeAddressClick(membership.id)
|
|
24971
|
-
}, t("labels.edit"))));
|
|
24971
|
+
}, `${t("labels.edit")} ${t("labels.address")}`)));
|
|
24972
24972
|
});
|
|
24973
24973
|
};
|
|
24974
24974
|
|
|
@@ -24978,6 +24978,15 @@ function getActiveMemberships() {
|
|
|
24978
24978
|
return (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().memberships) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(membership => membership.status === "active")) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
24979
24979
|
}
|
|
24980
24980
|
|
|
24981
|
+
function getMemberShipStatus(status) {
|
|
24982
|
+
return {
|
|
24983
|
+
title: status,
|
|
24984
|
+
textColor: "plc-text-green-700",
|
|
24985
|
+
bgColor: "plc-bg-green-100",
|
|
24986
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgCheckMark, null)
|
|
24987
|
+
};
|
|
24988
|
+
}
|
|
24989
|
+
|
|
24981
24990
|
const SUB_MENUS = {
|
|
24982
24991
|
PROFILE: "profile",
|
|
24983
24992
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -27742,7 +27751,7 @@ function VerifyLinkTokenModal({
|
|
|
27742
27751
|
|
|
27743
27752
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
27744
27753
|
resetView();
|
|
27745
|
-
notify
|
|
27754
|
+
notify.success(t("messages.success"));
|
|
27746
27755
|
};
|
|
27747
27756
|
|
|
27748
27757
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -28198,6 +28207,6 @@ exports.i18n = i18next;
|
|
|
28198
28207
|
exports.initButtons = init$1;
|
|
28199
28208
|
exports.initContentEntitlement = init;
|
|
28200
28209
|
exports.invoicePaymentSubmitButton = invoicePaymentSubmitButton;
|
|
28201
|
-
exports.notify = notify
|
|
28210
|
+
exports.notify = notify;
|
|
28202
28211
|
exports.unauthenticatedButtons = unauthenticatedButtons;
|
|
28203
28212
|
exports.usePelcro = usePelcro;
|
package/dist/index.esm.js
CHANGED
|
@@ -9201,7 +9201,7 @@ toast.confirm = (onConfirm, {
|
|
|
9201
9201
|
};
|
|
9202
9202
|
};
|
|
9203
9203
|
|
|
9204
|
-
const notify
|
|
9204
|
+
const notify = toast;
|
|
9205
9205
|
|
|
9206
9206
|
const translations = i18next.t("common:buttons", {
|
|
9207
9207
|
returnObjects: true
|
|
@@ -9411,7 +9411,7 @@ const init$1 = () => {
|
|
|
9411
9411
|
const errorMsg = i18next.t("shop:messages.currencyMismatch", {
|
|
9412
9412
|
currency: userCurrency
|
|
9413
9413
|
});
|
|
9414
|
-
notify
|
|
9414
|
+
notify.error(errorMsg);
|
|
9415
9415
|
}
|
|
9416
9416
|
});
|
|
9417
9417
|
}
|
|
@@ -9505,7 +9505,7 @@ const init = () => {
|
|
|
9505
9505
|
elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
|
|
9506
9506
|
unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
|
|
9507
9507
|
const NOTIFICATION_ID = "entitlement";
|
|
9508
|
-
notify
|
|
9508
|
+
notify( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
|
|
9509
9509
|
i18nKey: "messages:entitlement"
|
|
9510
9510
|
}, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default.createElement(Link, {
|
|
9511
9511
|
onClick: () => {
|
|
@@ -9522,7 +9522,7 @@ const init = () => {
|
|
|
9522
9522
|
});
|
|
9523
9523
|
}
|
|
9524
9524
|
|
|
9525
|
-
notify
|
|
9525
|
+
notify.dismiss(NOTIFICATION_ID);
|
|
9526
9526
|
switchView("_plan-select-entitlements");
|
|
9527
9527
|
}
|
|
9528
9528
|
}, "Subscribe"), "now to get full page access.")), {
|
|
@@ -10266,10 +10266,10 @@ const verifyEmailTokenFromUrl = () => {
|
|
|
10266
10266
|
token: emailToken
|
|
10267
10267
|
}, (err, res) => {
|
|
10268
10268
|
if (err) {
|
|
10269
|
-
return notify
|
|
10269
|
+
return notify.error(getErrorMessages(err));
|
|
10270
10270
|
}
|
|
10271
10271
|
|
|
10272
|
-
return notify
|
|
10272
|
+
return notify.success(translations.success);
|
|
10273
10273
|
});
|
|
10274
10274
|
}, {
|
|
10275
10275
|
once: true
|
|
@@ -10295,7 +10295,7 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10295
10295
|
token: loginToken
|
|
10296
10296
|
}, (err, res) => {
|
|
10297
10297
|
if (err) {
|
|
10298
|
-
return notify
|
|
10298
|
+
return notify.error(getErrorMessages(err));
|
|
10299
10299
|
}
|
|
10300
10300
|
|
|
10301
10301
|
const {
|
|
@@ -10305,11 +10305,11 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10305
10305
|
auth_token
|
|
10306
10306
|
}, (err, res) => {
|
|
10307
10307
|
if (err) {
|
|
10308
|
-
return notify
|
|
10308
|
+
return notify.error(getErrorMessages(err));
|
|
10309
10309
|
}
|
|
10310
10310
|
|
|
10311
10311
|
resetView();
|
|
10312
|
-
return notify
|
|
10312
|
+
return notify.success(translations.success);
|
|
10313
10313
|
});
|
|
10314
10314
|
});
|
|
10315
10315
|
}, {
|
|
@@ -10350,7 +10350,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10350
10350
|
const errorMessage = i18next.t("messages:invalidInvoice", {
|
|
10351
10351
|
returnObjects: true
|
|
10352
10352
|
});
|
|
10353
|
-
return notify
|
|
10353
|
+
return notify.error(errorMessage);
|
|
10354
10354
|
}
|
|
10355
10355
|
|
|
10356
10356
|
const {
|
|
@@ -10361,7 +10361,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10361
10361
|
const errorMessage = i18next.t("messages:zeroTotalInvoice", {
|
|
10362
10362
|
returnObjects: true
|
|
10363
10363
|
});
|
|
10364
|
-
return notify
|
|
10364
|
+
return notify.error(errorMessage);
|
|
10365
10365
|
}
|
|
10366
10366
|
|
|
10367
10367
|
return switchView("invoice-details");
|
|
@@ -14766,19 +14766,11 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
14766
14766
|
type: UPDATE_COUPON_CODE,
|
|
14767
14767
|
payload: window.Pelcro.coupon.getFromUrl()
|
|
14768
14768
|
});
|
|
14769
|
-
dispatch({
|
|
14770
|
-
type: SHOW_COUPON_FIELD,
|
|
14771
|
-
payload: true
|
|
14772
|
-
});
|
|
14773
14769
|
} else if (couponCode) {
|
|
14774
14770
|
dispatch({
|
|
14775
14771
|
type: UPDATE_COUPON_CODE,
|
|
14776
14772
|
payload: couponCode
|
|
14777
14773
|
});
|
|
14778
|
-
dispatch({
|
|
14779
|
-
type: SHOW_COUPON_FIELD,
|
|
14780
|
-
payload: true
|
|
14781
|
-
});
|
|
14782
14774
|
}
|
|
14783
14775
|
|
|
14784
14776
|
dispatch({
|
|
@@ -17159,7 +17151,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
17159
17151
|
|
|
17160
17152
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17161
17153
|
|
|
17162
|
-
notify
|
|
17154
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17163
17155
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17164
17156
|
}, {
|
|
17165
17157
|
confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
|
|
@@ -17231,7 +17223,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
17231
17223
|
|
|
17232
17224
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17233
17225
|
|
|
17234
|
-
notify
|
|
17226
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17235
17227
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17236
17228
|
}, {
|
|
17237
17229
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -19371,7 +19363,8 @@ const AddressCreateModal = ({
|
|
|
19371
19363
|
}) => {
|
|
19372
19364
|
const {
|
|
19373
19365
|
switchView,
|
|
19374
|
-
switchToPaymentView
|
|
19366
|
+
switchToPaymentView,
|
|
19367
|
+
resetView
|
|
19375
19368
|
} = usePelcro();
|
|
19376
19369
|
|
|
19377
19370
|
const onSuccess = newAddressId => {
|
|
@@ -19393,6 +19386,7 @@ const AddressCreateModal = ({
|
|
|
19393
19386
|
var _otherProps$onMembers;
|
|
19394
19387
|
|
|
19395
19388
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
19389
|
+
resetView();
|
|
19396
19390
|
};
|
|
19397
19391
|
|
|
19398
19392
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -22306,7 +22300,7 @@ const AddressSelectContainer = ({
|
|
|
22306
22300
|
return onFailure(err);
|
|
22307
22301
|
}
|
|
22308
22302
|
|
|
22309
|
-
notify
|
|
22303
|
+
notify.success(t("messages.addressUpdated"));
|
|
22310
22304
|
return onMembershipAdressUpdateSuccess(res);
|
|
22311
22305
|
});
|
|
22312
22306
|
}
|
|
@@ -22347,6 +22341,8 @@ const AddressSelectContainer = ({
|
|
|
22347
22341
|
};
|
|
22348
22342
|
|
|
22349
22343
|
const [state, dispatch] = useReducerWithSideEffects((state, action) => {
|
|
22344
|
+
var _selectedMembership$a;
|
|
22345
|
+
|
|
22350
22346
|
switch (action.type) {
|
|
22351
22347
|
case SELECT_ADDRESS:
|
|
22352
22348
|
return lib_7({ ...state,
|
|
@@ -22356,7 +22352,7 @@ const AddressSelectContainer = ({
|
|
|
22356
22352
|
case LOAD_ADDRESSES:
|
|
22357
22353
|
return lib_7({ ...state,
|
|
22358
22354
|
addresses: moveDefaultAddressToStart(action.payload),
|
|
22359
|
-
selectedAddressId: String(getDefaultAddress(action.payload).id)
|
|
22355
|
+
selectedAddressId: String((_selectedMembership$a = selectedMembership === null || selectedMembership === void 0 ? void 0 : selectedMembership.address_id) !== null && _selectedMembership$a !== void 0 ? _selectedMembership$a : getDefaultAddress(action.payload).id)
|
|
22360
22356
|
});
|
|
22361
22357
|
|
|
22362
22358
|
case SHOW_ALERT:
|
|
@@ -22503,7 +22499,8 @@ const AddressSelectModal = ({
|
|
|
22503
22499
|
}) => {
|
|
22504
22500
|
const {
|
|
22505
22501
|
switchView,
|
|
22506
|
-
switchToPaymentView
|
|
22502
|
+
switchToPaymentView,
|
|
22503
|
+
resetView
|
|
22507
22504
|
} = usePelcro();
|
|
22508
22505
|
|
|
22509
22506
|
const onSuccess = selectedAddressId => {
|
|
@@ -22529,6 +22526,7 @@ const AddressSelectModal = ({
|
|
|
22529
22526
|
var _otherProps$onMembers;
|
|
22530
22527
|
|
|
22531
22528
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
22529
|
+
resetView();
|
|
22532
22530
|
};
|
|
22533
22531
|
|
|
22534
22532
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -24298,7 +24296,7 @@ const SubscriptionsItems = ({
|
|
|
24298
24296
|
}
|
|
24299
24297
|
|
|
24300
24298
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
24301
|
-
notify
|
|
24299
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
24302
24300
|
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
24303
24301
|
}, {
|
|
24304
24302
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -24931,14 +24929,16 @@ const MembershipsItems = () => {
|
|
|
24931
24929
|
className: "plc-truncate"
|
|
24932
24930
|
}, membership.subscription.plan.nickname && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
24933
24931
|
className: "plc-font-semibold plc-text-gray-500 pelcro-membership-plan"
|
|
24934
|
-
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span",
|
|
24932
|
+
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span", {
|
|
24933
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getMemberShipStatus(membership.status).bgColor} plc-uppercase ${getMemberShipStatus(membership.status).textColor} plc-rounded-lg`
|
|
24934
|
+
}, getMemberShipStatus(membership.status).icon, getMemberShipStatus(membership.status).title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
|
|
24935
24935
|
variant: "ghost",
|
|
24936
24936
|
icon: /*#__PURE__*/React__default.createElement(SvgEdit, {
|
|
24937
24937
|
className: "plc-w-4 plc-h-4"
|
|
24938
24938
|
}),
|
|
24939
24939
|
className: "plc-text-blue-400 focus:plc-ring-blue-500 pelcro-dashboard-membership-address-button",
|
|
24940
24940
|
onClick: () => onChangeAddressClick(membership.id)
|
|
24941
|
-
}, t("labels.edit"))));
|
|
24941
|
+
}, `${t("labels.edit")} ${t("labels.address")}`)));
|
|
24942
24942
|
});
|
|
24943
24943
|
};
|
|
24944
24944
|
|
|
@@ -24948,6 +24948,15 @@ function getActiveMemberships() {
|
|
|
24948
24948
|
return (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().memberships) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(membership => membership.status === "active")) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
24949
24949
|
}
|
|
24950
24950
|
|
|
24951
|
+
function getMemberShipStatus(status) {
|
|
24952
|
+
return {
|
|
24953
|
+
title: status,
|
|
24954
|
+
textColor: "plc-text-green-700",
|
|
24955
|
+
bgColor: "plc-bg-green-100",
|
|
24956
|
+
icon: /*#__PURE__*/React__default.createElement(SvgCheckMark, null)
|
|
24957
|
+
};
|
|
24958
|
+
}
|
|
24959
|
+
|
|
24951
24960
|
const SUB_MENUS = {
|
|
24952
24961
|
PROFILE: "profile",
|
|
24953
24962
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -27712,7 +27721,7 @@ function VerifyLinkTokenModal({
|
|
|
27712
27721
|
|
|
27713
27722
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
27714
27723
|
resetView();
|
|
27715
|
-
notify
|
|
27724
|
+
notify.success(t("messages.success"));
|
|
27716
27725
|
};
|
|
27717
27726
|
|
|
27718
27727
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -27956,4 +27965,4 @@ const InvoiceDetailsModal = ({
|
|
|
27956
27965
|
};
|
|
27957
27966
|
InvoiceDetailsModal.viewId = "invoice-details";
|
|
27958
27967
|
|
|
27959
|
-
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify
|
|
27968
|
+
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };
|