@pelcro/react-pelcro-js 3.13.0-beta.15 → 3.13.0-beta.17
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 +132 -97
- package/dist/index.esm.js +132 -97
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8613,7 +8613,7 @@ const createPelcroHook = store => {
|
|
|
8613
8613
|
|
|
8614
8614
|
pelcroHook.override = fn => {
|
|
8615
8615
|
const partialState = fn(store.setState, store.getState);
|
|
8616
|
-
usePelcro.setState(partialState);
|
|
8616
|
+
usePelcro$1.setState(partialState);
|
|
8617
8617
|
};
|
|
8618
8618
|
|
|
8619
8619
|
pelcroHook.getStore = pelcroHook.getState;
|
|
@@ -8621,11 +8621,11 @@ const createPelcroHook = store => {
|
|
|
8621
8621
|
};
|
|
8622
8622
|
|
|
8623
8623
|
const pelcroStore = createPelcroStore();
|
|
8624
|
-
const usePelcro = createPelcroHook(pelcroStore);
|
|
8624
|
+
const usePelcro$1 = createPelcroHook(pelcroStore);
|
|
8625
8625
|
/* istanbul ignore next */
|
|
8626
8626
|
|
|
8627
8627
|
if (process.env.NODE_ENV === "development") {
|
|
8628
|
-
c$1("Pelcro Store", usePelcro);
|
|
8628
|
+
c$1("Pelcro Store", usePelcro$1);
|
|
8629
8629
|
}
|
|
8630
8630
|
|
|
8631
8631
|
/**
|
|
@@ -8830,7 +8830,7 @@ const trackSubscriptionOnGA = () => {
|
|
|
8830
8830
|
product,
|
|
8831
8831
|
plan,
|
|
8832
8832
|
couponCode
|
|
8833
|
-
} = usePelcro.getStore();
|
|
8833
|
+
} = usePelcro$1.getStore();
|
|
8834
8834
|
/*
|
|
8835
8835
|
getting the latest subscription id from invoices instead of subscriptions
|
|
8836
8836
|
to handle gifted subs which are not added to subs list
|
|
@@ -9150,7 +9150,7 @@ class SaveToMetadataButtonClass {
|
|
|
9150
9150
|
_defineProperty$3(this, "unauthenticated", () => {
|
|
9151
9151
|
const {
|
|
9152
9152
|
switchView
|
|
9153
|
-
} = usePelcro.getStore();
|
|
9153
|
+
} = usePelcro$1.getStore();
|
|
9154
9154
|
|
|
9155
9155
|
_classPrivateFieldGet(this, _onClick).call(this, () => switchView("login"));
|
|
9156
9156
|
|
|
@@ -9233,7 +9233,7 @@ class SaveToMetadataButtonClass {
|
|
|
9233
9233
|
const user = window.Pelcro.user.read();
|
|
9234
9234
|
const {
|
|
9235
9235
|
switchView
|
|
9236
|
-
} = usePelcro.getStore();
|
|
9236
|
+
} = usePelcro$1.getStore();
|
|
9237
9237
|
const {
|
|
9238
9238
|
key,
|
|
9239
9239
|
...buttonMetadata
|
|
@@ -10369,7 +10369,7 @@ const init$1 = () => {
|
|
|
10369
10369
|
addToCart,
|
|
10370
10370
|
purchaseItem,
|
|
10371
10371
|
setSubscriptionToManageMembers
|
|
10372
|
-
} = usePelcro.getStore();
|
|
10372
|
+
} = usePelcro$1.getStore();
|
|
10373
10373
|
const pelcroDashboardButtonsByClass = document.getElementsByClassName("pelcro-dashboard-button");
|
|
10374
10374
|
|
|
10375
10375
|
if (pelcroDashboardButtonsByClass.length !== 0) {
|
|
@@ -10672,7 +10672,7 @@ const init = () => {
|
|
|
10672
10672
|
const {
|
|
10673
10673
|
switchView,
|
|
10674
10674
|
set
|
|
10675
|
-
} = usePelcro.getStore();
|
|
10675
|
+
} = usePelcro$1.getStore();
|
|
10676
10676
|
const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
|
|
10677
10677
|
|
|
10678
10678
|
if (entitlementsProtectedElements.length === 0) {
|
|
@@ -10761,7 +10761,7 @@ function unblurElemWhenUserSubscribes(elem, entitlements) {
|
|
|
10761
10761
|
document.addEventListener("PelcroSubscriptionCreate", event => {
|
|
10762
10762
|
const {
|
|
10763
10763
|
isGift
|
|
10764
|
-
} = usePelcro.getStore();
|
|
10764
|
+
} = usePelcro$1.getStore();
|
|
10765
10765
|
if (isGift) return;
|
|
10766
10766
|
const latestSub = event.detail.data.subscriptions[event.detail.data.subscriptions.length - 1];
|
|
10767
10767
|
const shouldUnblurContent = entitlements.some(ent => {
|
|
@@ -11083,7 +11083,7 @@ const initPaywalls = () => {
|
|
|
11083
11083
|
|
|
11084
11084
|
const {
|
|
11085
11085
|
switchView
|
|
11086
|
-
} = usePelcro.getStore();
|
|
11086
|
+
} = usePelcro$1.getStore();
|
|
11087
11087
|
|
|
11088
11088
|
if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayMeterPaywall()) {
|
|
11089
11089
|
/*
|
|
@@ -11105,7 +11105,7 @@ const loadPaymentSDKs = () => {
|
|
|
11105
11105
|
// Lazy load stripe's SDK
|
|
11106
11106
|
const {
|
|
11107
11107
|
whenUserReady
|
|
11108
|
-
} = usePelcro.getStore();
|
|
11108
|
+
} = usePelcro$1.getStore();
|
|
11109
11109
|
whenUserReady(() => {
|
|
11110
11110
|
if (!window.Stripe) {
|
|
11111
11111
|
pure_1(window.Pelcro.environment.stripe);
|
|
@@ -11153,7 +11153,7 @@ const loadAuth0SDK = () => {
|
|
|
11153
11153
|
const initSecuritySdk = () => {
|
|
11154
11154
|
const {
|
|
11155
11155
|
whenSiteReady
|
|
11156
|
-
} = usePelcro.getStore();
|
|
11156
|
+
} = usePelcro$1.getStore();
|
|
11157
11157
|
whenSiteReady(() => {
|
|
11158
11158
|
var _window$Pelcro$site$r2;
|
|
11159
11159
|
|
|
@@ -11189,7 +11189,7 @@ const dispatchModalDisplayEvents = modalName => {
|
|
|
11189
11189
|
const {
|
|
11190
11190
|
whenSiteReady,
|
|
11191
11191
|
whenEcommerceLoaded
|
|
11192
|
-
} = usePelcro.getStore();
|
|
11192
|
+
} = usePelcro$1.getStore();
|
|
11193
11193
|
const renderShopView = shopComponent => {
|
|
11194
11194
|
whenEcommerceLoaded(() => {
|
|
11195
11195
|
const shopElement = document.getElementById("pelcro-shop");
|
|
@@ -11271,7 +11271,7 @@ const initViewFromURL = () => {
|
|
|
11271
11271
|
const {
|
|
11272
11272
|
switchView,
|
|
11273
11273
|
whenSiteReady
|
|
11274
|
-
} = usePelcro.getStore();
|
|
11274
|
+
} = usePelcro$1.getStore();
|
|
11275
11275
|
|
|
11276
11276
|
if (isValidViewFromURL(view)) {
|
|
11277
11277
|
whenSiteReady(() => {
|
|
@@ -11329,7 +11329,7 @@ const initSubscriptionFromURL = () => {
|
|
|
11329
11329
|
switchView,
|
|
11330
11330
|
whenSiteReady,
|
|
11331
11331
|
set
|
|
11332
|
-
} = usePelcro.getStore();
|
|
11332
|
+
} = usePelcro$1.getStore();
|
|
11333
11333
|
whenSiteReady(() => {
|
|
11334
11334
|
var _selectedProduct$plan;
|
|
11335
11335
|
|
|
@@ -11353,7 +11353,7 @@ const initSubscriptionFromURL = () => {
|
|
|
11353
11353
|
isAuthenticated,
|
|
11354
11354
|
switchToAddressView,
|
|
11355
11355
|
switchToPaymentView
|
|
11356
|
-
} = usePelcro.getStore();
|
|
11356
|
+
} = usePelcro$1.getStore();
|
|
11357
11357
|
|
|
11358
11358
|
if (!isAuthenticated()) {
|
|
11359
11359
|
return switchView("register");
|
|
@@ -11385,7 +11385,7 @@ const initOfflineSubscriptionFromURL = offlinePlanId => {
|
|
|
11385
11385
|
switchToPaymentView,
|
|
11386
11386
|
switchToAddressView,
|
|
11387
11387
|
set
|
|
11388
|
-
} = usePelcro.getStore();
|
|
11388
|
+
} = usePelcro$1.getStore();
|
|
11389
11389
|
whenSiteReady(() => {
|
|
11390
11390
|
window.Pelcro.plan.getPlan({
|
|
11391
11391
|
plan_id: offlinePlanId
|
|
@@ -11432,7 +11432,7 @@ const initPurchaseFromUrl = () => {
|
|
|
11432
11432
|
const {
|
|
11433
11433
|
whenEcommerceLoaded,
|
|
11434
11434
|
purchaseItem
|
|
11435
|
-
} = usePelcro.getStore();
|
|
11435
|
+
} = usePelcro$1.getStore();
|
|
11436
11436
|
whenEcommerceLoaded(() => {
|
|
11437
11437
|
const skuId = window.Pelcro.helpers.getURLParameter("sku_id");
|
|
11438
11438
|
purchaseItem(skuId);
|
|
@@ -11448,7 +11448,7 @@ const initCartFromUrl = () => {
|
|
|
11448
11448
|
whenEcommerceLoaded,
|
|
11449
11449
|
addToCart,
|
|
11450
11450
|
switchView
|
|
11451
|
-
} = usePelcro.getStore();
|
|
11451
|
+
} = usePelcro$1.getStore();
|
|
11452
11452
|
whenEcommerceLoaded(() => {
|
|
11453
11453
|
const skusIdsParam = window.Pelcro.helpers.getURLParameter("sku_id");
|
|
11454
11454
|
const skusIds = skusIdsParam === null || skusIdsParam === void 0 ? void 0 : skusIdsParam.split(",");
|
|
@@ -11469,7 +11469,7 @@ const verifyEmailTokenFromUrl = () => {
|
|
|
11469
11469
|
|
|
11470
11470
|
const {
|
|
11471
11471
|
whenSiteReady
|
|
11472
|
-
} = usePelcro.getStore();
|
|
11472
|
+
} = usePelcro$1.getStore();
|
|
11473
11473
|
const translations = i18next.t("verifyEmail:messages", {
|
|
11474
11474
|
returnObjects: true
|
|
11475
11475
|
});
|
|
@@ -11498,7 +11498,7 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
11498
11498
|
whenSiteReady,
|
|
11499
11499
|
resetView,
|
|
11500
11500
|
isAuthenticated
|
|
11501
|
-
} = usePelcro.getStore();
|
|
11501
|
+
} = usePelcro$1.getStore();
|
|
11502
11502
|
const translations = i18next.t("verifyLinkToken:messages", {
|
|
11503
11503
|
returnObjects: true
|
|
11504
11504
|
});
|
|
@@ -11537,12 +11537,12 @@ const showPasswordlessRequestFromUrl = () => {
|
|
|
11537
11537
|
|
|
11538
11538
|
const {
|
|
11539
11539
|
isAuthenticated
|
|
11540
|
-
} = usePelcro.getStore();
|
|
11540
|
+
} = usePelcro$1.getStore();
|
|
11541
11541
|
const passwordlessEnabled = (_window$Pelcro$site$r8 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r8 === void 0 ? void 0 : _window$Pelcro$site$r8.passwordless_enabled;
|
|
11542
11542
|
if (!passwordlessEnabled || isAuthenticated()) return;
|
|
11543
11543
|
const {
|
|
11544
11544
|
switchView
|
|
11545
|
-
} = usePelcro.getStore();
|
|
11545
|
+
} = usePelcro$1.getStore();
|
|
11546
11546
|
return switchView("passwordless-request");
|
|
11547
11547
|
};
|
|
11548
11548
|
|
|
@@ -11553,7 +11553,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
11553
11553
|
whenUserReady,
|
|
11554
11554
|
whenSiteReady,
|
|
11555
11555
|
switchView
|
|
11556
|
-
} = usePelcro.getStore();
|
|
11556
|
+
} = usePelcro$1.getStore();
|
|
11557
11557
|
whenSiteReady(() => {
|
|
11558
11558
|
if (!isAuthenticated()) {
|
|
11559
11559
|
return switchView("login");
|
|
@@ -11572,7 +11572,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
11572
11572
|
|
|
11573
11573
|
const {
|
|
11574
11574
|
invoice
|
|
11575
|
-
} = usePelcro.getStore();
|
|
11575
|
+
} = usePelcro$1.getStore();
|
|
11576
11576
|
|
|
11577
11577
|
if (invoice.total === 0) {
|
|
11578
11578
|
const errorMessage = i18next.t("messages:zeroTotalInvoice", {
|
|
@@ -11593,7 +11593,7 @@ const showSubscriptionManageMembersFromUrl = () => {
|
|
|
11593
11593
|
whenUserReady,
|
|
11594
11594
|
whenSiteReady,
|
|
11595
11595
|
switchView
|
|
11596
|
-
} = usePelcro.getStore();
|
|
11596
|
+
} = usePelcro$1.getStore();
|
|
11597
11597
|
whenSiteReady(() => {
|
|
11598
11598
|
if (!isAuthenticated()) {
|
|
11599
11599
|
return switchView("login");
|
|
@@ -11633,7 +11633,7 @@ const PelcroModalController = ({
|
|
|
11633
11633
|
view,
|
|
11634
11634
|
isAuthenticated,
|
|
11635
11635
|
whenSiteReady
|
|
11636
|
-
} = usePelcro();
|
|
11636
|
+
} = usePelcro$1();
|
|
11637
11637
|
React__default['default'].useEffect(() => {
|
|
11638
11638
|
init$1();
|
|
11639
11639
|
renderShopView(React__default['default'].Children.map(children, child => child).find(({
|
|
@@ -13394,7 +13394,7 @@ function Modal({
|
|
|
13394
13394
|
}) {
|
|
13395
13395
|
var _window$Pelcro, _window$Pelcro$site$r;
|
|
13396
13396
|
|
|
13397
|
-
const resetView = usePelcro(state => state.resetView);
|
|
13397
|
+
const resetView = usePelcro$1(state => state.resetView);
|
|
13398
13398
|
React.useEffect(() => {
|
|
13399
13399
|
onDisplay === null || onDisplay === void 0 ? void 0 : onDisplay();
|
|
13400
13400
|
dispatchModalDisplayEvents(id);
|
|
@@ -13467,8 +13467,11 @@ function LoginModal({
|
|
|
13467
13467
|
const {
|
|
13468
13468
|
switchView,
|
|
13469
13469
|
resetView,
|
|
13470
|
-
|
|
13471
|
-
|
|
13470
|
+
product,
|
|
13471
|
+
plan,
|
|
13472
|
+
switchToAddressView,
|
|
13473
|
+
switchToPaymentView
|
|
13474
|
+
} = usePelcro$1();
|
|
13472
13475
|
|
|
13473
13476
|
const onSuccess = res => {
|
|
13474
13477
|
var _props$onSuccess;
|
|
@@ -13479,10 +13482,19 @@ function LoginModal({
|
|
|
13479
13482
|
initPaywalls();
|
|
13480
13483
|
}
|
|
13481
13484
|
|
|
13485
|
+
if (product && plan) {
|
|
13486
|
+
if (product.address_required) {
|
|
13487
|
+
return switchToAddressView();
|
|
13488
|
+
} else {
|
|
13489
|
+
return switchToPaymentView();
|
|
13490
|
+
}
|
|
13491
|
+
}
|
|
13492
|
+
|
|
13482
13493
|
resetView();
|
|
13483
13494
|
const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
|
|
13495
|
+
const viewsURLs = ["invoice-details", "gift-redeem", "plan-select"];
|
|
13484
13496
|
|
|
13485
|
-
if (viewFromURL
|
|
13497
|
+
if (viewsURLs.includes(viewFromURL)) {
|
|
13486
13498
|
initViewFromURL();
|
|
13487
13499
|
}
|
|
13488
13500
|
};
|
|
@@ -13805,7 +13817,7 @@ function RegisterView(props) {
|
|
|
13805
13817
|
} = useTranslation("register");
|
|
13806
13818
|
const {
|
|
13807
13819
|
product
|
|
13808
|
-
} = usePelcro();
|
|
13820
|
+
} = usePelcro$1();
|
|
13809
13821
|
const title = (_product$paywall$regi = product === null || product === void 0 ? void 0 : (_product$paywall = product.paywall) === null || _product$paywall === void 0 ? void 0 : _product$paywall.register_title) !== null && _product$paywall$regi !== void 0 ? _product$paywall$regi : t("title");
|
|
13810
13822
|
const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
|
|
13811
13823
|
const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
|
|
@@ -14036,7 +14048,7 @@ function RegisterModal(props) {
|
|
|
14036
14048
|
order,
|
|
14037
14049
|
giftCode,
|
|
14038
14050
|
isGift
|
|
14039
|
-
} = usePelcro();
|
|
14051
|
+
} = usePelcro$1();
|
|
14040
14052
|
|
|
14041
14053
|
const onSuccess = res => {
|
|
14042
14054
|
var _props$onSuccess;
|
|
@@ -14158,7 +14170,7 @@ function SelectModalWithHook(props) {
|
|
|
14158
14170
|
resetView,
|
|
14159
14171
|
view,
|
|
14160
14172
|
set
|
|
14161
|
-
} = usePelcro();
|
|
14173
|
+
} = usePelcro$1();
|
|
14162
14174
|
const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
|
|
14163
14175
|
const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
|
|
14164
14176
|
return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
|
|
@@ -14430,7 +14442,7 @@ class SelectModal extends React.Component {
|
|
|
14430
14442
|
const {
|
|
14431
14443
|
switchToAddressView,
|
|
14432
14444
|
switchToPaymentView
|
|
14433
|
-
} = usePelcro.getStore();
|
|
14445
|
+
} = usePelcro$1.getStore();
|
|
14434
14446
|
|
|
14435
14447
|
if (!isAuthenticated) {
|
|
14436
14448
|
return setView("register");
|
|
@@ -16633,16 +16645,16 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16633
16645
|
const {
|
|
16634
16646
|
t
|
|
16635
16647
|
} = useTranslation("payment");
|
|
16636
|
-
const pelcroStore = usePelcro();
|
|
16648
|
+
const pelcroStore = usePelcro$1();
|
|
16637
16649
|
const {
|
|
16638
16650
|
set,
|
|
16639
16651
|
order,
|
|
16640
16652
|
selectedPaymentMethodId,
|
|
16641
16653
|
couponCode
|
|
16642
|
-
} = usePelcro();
|
|
16654
|
+
} = usePelcro$1();
|
|
16643
16655
|
const {
|
|
16644
16656
|
whenUserReady
|
|
16645
|
-
} = usePelcro.getStore();
|
|
16657
|
+
} = usePelcro$1.getStore();
|
|
16646
16658
|
const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
|
|
16647
16659
|
const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
|
|
16648
16660
|
const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
|
|
@@ -18322,7 +18334,7 @@ const PaymentMethodContainer = props => {
|
|
|
18322
18334
|
const [isStripeLoaded, setIsStripeLoaded] = React.useState(Boolean(window.Stripe));
|
|
18323
18335
|
const {
|
|
18324
18336
|
whenUserReady
|
|
18325
|
-
} = usePelcro.getStore();
|
|
18337
|
+
} = usePelcro$1.getStore();
|
|
18326
18338
|
React.useEffect(() => {
|
|
18327
18339
|
whenUserReady(() => {
|
|
18328
18340
|
if (!window.Stripe) {
|
|
@@ -18423,7 +18435,7 @@ const PelcroPaymentRequestButton = props => {
|
|
|
18423
18435
|
const CheckoutForm = () => {
|
|
18424
18436
|
const {
|
|
18425
18437
|
selectedPaymentMethodId
|
|
18426
|
-
} = usePelcro();
|
|
18438
|
+
} = usePelcro$1();
|
|
18427
18439
|
const cardProcessor = getSiteCardProcessor();
|
|
18428
18440
|
|
|
18429
18441
|
if (selectedPaymentMethodId) {
|
|
@@ -18478,7 +18490,7 @@ const DiscountedPrice = props => {
|
|
|
18478
18490
|
const {
|
|
18479
18491
|
order,
|
|
18480
18492
|
plan
|
|
18481
|
-
} = usePelcro();
|
|
18493
|
+
} = usePelcro$1();
|
|
18482
18494
|
const isTaxInclusive = (_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tax_inclusive;
|
|
18483
18495
|
const ecommOrderCurrency = (_order$currency = order === null || order === void 0 ? void 0 : order.currency) !== null && _order$currency !== void 0 ? _order$currency : order === null || order === void 0 ? void 0 : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
|
|
18484
18496
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
@@ -18514,7 +18526,7 @@ const SubmitPaymentMethod = ({
|
|
|
18514
18526
|
|
|
18515
18527
|
const {
|
|
18516
18528
|
plan
|
|
18517
|
-
} = usePelcro();
|
|
18529
|
+
} = usePelcro$1();
|
|
18518
18530
|
const {
|
|
18519
18531
|
t
|
|
18520
18532
|
} = useTranslation("checkoutForm");
|
|
@@ -18946,7 +18958,7 @@ const PaypalSubscribeButton = props => {
|
|
|
18946
18958
|
plan,
|
|
18947
18959
|
invoice,
|
|
18948
18960
|
selectedAddressId
|
|
18949
|
-
} = usePelcro();
|
|
18961
|
+
} = usePelcro$1();
|
|
18950
18962
|
React.useEffect(() => {
|
|
18951
18963
|
var _ref, _ref2, _state$updatedPrice, _props$plan, _props$selectedAddres;
|
|
18952
18964
|
|
|
@@ -19088,7 +19100,7 @@ const SelectedPaymentMethod = () => {
|
|
|
19088
19100
|
const {
|
|
19089
19101
|
switchView,
|
|
19090
19102
|
selectedPaymentMethodId
|
|
19091
|
-
} = usePelcro();
|
|
19103
|
+
} = usePelcro$1();
|
|
19092
19104
|
const paymentMethod = (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : (_window$Pelcro$user$r2 = _window$Pelcro$user$r.sources) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : (_window$Pelcro$user$r3 = _window$Pelcro$user$r2.find) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.call(_window$Pelcro$user$r2, source => {
|
|
19093
19105
|
return source.id == selectedPaymentMethodId;
|
|
19094
19106
|
});
|
|
@@ -19129,7 +19141,7 @@ const TaxAmount = () => {
|
|
|
19129
19141
|
} = React.useContext(store$k);
|
|
19130
19142
|
const {
|
|
19131
19143
|
plan
|
|
19132
|
-
} = usePelcro();
|
|
19144
|
+
} = usePelcro$1();
|
|
19133
19145
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
19134
19146
|
const priceFormatted = getFormattedPriceByLocal(taxAmount * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
19135
19147
|
const isTaxInclusive = (_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tax_inclusive;
|
|
@@ -19275,7 +19287,7 @@ const SubscriptionRenewView = ({
|
|
|
19275
19287
|
const {
|
|
19276
19288
|
product,
|
|
19277
19289
|
plan
|
|
19278
|
-
} = usePelcro();
|
|
19290
|
+
} = usePelcro$1();
|
|
19279
19291
|
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
19280
19292
|
const showSubscriptionButton = skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0;
|
|
19281
19293
|
|
|
@@ -19330,7 +19342,7 @@ function SubscriptionRenewModal({
|
|
|
19330
19342
|
}) {
|
|
19331
19343
|
const {
|
|
19332
19344
|
switchView
|
|
19333
|
-
} = usePelcro();
|
|
19345
|
+
} = usePelcro$1();
|
|
19334
19346
|
|
|
19335
19347
|
const onSuccess = res => {
|
|
19336
19348
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
@@ -19535,7 +19547,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
19535
19547
|
}) => {
|
|
19536
19548
|
const {
|
|
19537
19549
|
switchView
|
|
19538
|
-
} = usePelcro();
|
|
19550
|
+
} = usePelcro$1();
|
|
19539
19551
|
const {
|
|
19540
19552
|
state: {
|
|
19541
19553
|
cancelationReason
|
|
@@ -19607,7 +19619,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
19607
19619
|
}) => {
|
|
19608
19620
|
const {
|
|
19609
19621
|
switchView
|
|
19610
|
-
} = usePelcro();
|
|
19622
|
+
} = usePelcro$1();
|
|
19611
19623
|
const {
|
|
19612
19624
|
state: {
|
|
19613
19625
|
cancelationReason
|
|
@@ -19675,7 +19687,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
19675
19687
|
const SubscriptionCancelView = props => {
|
|
19676
19688
|
const {
|
|
19677
19689
|
subscriptionToCancel
|
|
19678
|
-
} = usePelcro();
|
|
19690
|
+
} = usePelcro$1();
|
|
19679
19691
|
const {
|
|
19680
19692
|
t
|
|
19681
19693
|
} = useTranslation("subscriptionCancel");
|
|
@@ -19849,7 +19861,7 @@ const SubscriptionSuspendButton = ({
|
|
|
19849
19861
|
}) => {
|
|
19850
19862
|
const {
|
|
19851
19863
|
switchView
|
|
19852
|
-
} = usePelcro();
|
|
19864
|
+
} = usePelcro$1();
|
|
19853
19865
|
const {
|
|
19854
19866
|
state: {
|
|
19855
19867
|
suspendDate,
|
|
@@ -19913,7 +19925,7 @@ const SubscriptionSuspendButton = ({
|
|
|
19913
19925
|
const SubscriptionSuspendView = props => {
|
|
19914
19926
|
const {
|
|
19915
19927
|
subscriptionToSuspend
|
|
19916
|
-
} = usePelcro();
|
|
19928
|
+
} = usePelcro$1();
|
|
19917
19929
|
const {
|
|
19918
19930
|
t
|
|
19919
19931
|
} = useTranslation("subscriptionSuspend");
|
|
@@ -20006,7 +20018,7 @@ const getCurrentFlow = () => {
|
|
|
20006
20018
|
giftRecipient,
|
|
20007
20019
|
giftCode,
|
|
20008
20020
|
invoice
|
|
20009
|
-
} = usePelcro.getStore();
|
|
20021
|
+
} = usePelcro$1.getStore();
|
|
20010
20022
|
|
|
20011
20023
|
if (invoice) {
|
|
20012
20024
|
return "invoicePayment";
|
|
@@ -20025,7 +20037,7 @@ const getSuccessContent = i18n => {
|
|
|
20025
20037
|
const flow = getCurrentFlow();
|
|
20026
20038
|
const {
|
|
20027
20039
|
product
|
|
20028
|
-
} = usePelcro.getStore();
|
|
20040
|
+
} = usePelcro$1.getStore();
|
|
20029
20041
|
const wordingDictionary = {
|
|
20030
20042
|
subscriptionSuccess: {
|
|
20031
20043
|
successIcon: /*#__PURE__*/React__default['default'].createElement(SvgCheckSolid, {
|
|
@@ -20069,7 +20081,7 @@ function PaymentSuccessModal({
|
|
|
20069
20081
|
}) {
|
|
20070
20082
|
const {
|
|
20071
20083
|
resetView
|
|
20072
|
-
} = usePelcro();
|
|
20084
|
+
} = usePelcro$1();
|
|
20073
20085
|
|
|
20074
20086
|
const onClose = () => {
|
|
20075
20087
|
var _props$onClose;
|
|
@@ -20102,7 +20114,7 @@ function NewsletterWithHook(props) {
|
|
|
20102
20114
|
switchView,
|
|
20103
20115
|
resetView,
|
|
20104
20116
|
product
|
|
20105
|
-
} = usePelcro();
|
|
20117
|
+
} = usePelcro$1();
|
|
20106
20118
|
return /*#__PURE__*/React__default['default'].createElement(NewsLetter, {
|
|
20107
20119
|
onClose: () => {
|
|
20108
20120
|
var _props$onClose;
|
|
@@ -20601,7 +20613,7 @@ const MeterView = () => {
|
|
|
20601
20613
|
switchView,
|
|
20602
20614
|
product,
|
|
20603
20615
|
isAuthenticated
|
|
20604
|
-
} = usePelcro();
|
|
20616
|
+
} = usePelcro$1();
|
|
20605
20617
|
const paywallProduct = product !== null && product !== void 0 ? product : window.Pelcro.paywall.getProduct();
|
|
20606
20618
|
const visitsLeft = window.Pelcro.paywall.freeVisitsLeft();
|
|
20607
20619
|
const title = `${paywallProduct === null || paywallProduct === void 0 ? void 0 : (_paywallProduct$paywa = paywallProduct.paywall) === null || _paywallProduct$paywa === void 0 ? void 0 : _paywallProduct$paywa.meter_title}: ${visitsLeft}`;
|
|
@@ -20623,7 +20635,7 @@ const MeterView = () => {
|
|
|
20623
20635
|
const MeterModal = props => {
|
|
20624
20636
|
const {
|
|
20625
20637
|
resetView
|
|
20626
|
-
} = usePelcro();
|
|
20638
|
+
} = usePelcro$1();
|
|
20627
20639
|
React.useEffect(() => {
|
|
20628
20640
|
var _props$onDisplay;
|
|
20629
20641
|
|
|
@@ -20661,7 +20673,7 @@ const SubscriptionCreateView = ({
|
|
|
20661
20673
|
const {
|
|
20662
20674
|
product,
|
|
20663
20675
|
plan
|
|
20664
|
-
} = usePelcro();
|
|
20676
|
+
} = usePelcro$1();
|
|
20665
20677
|
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
20666
20678
|
const showSubscriptionButton = skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0;
|
|
20667
20679
|
|
|
@@ -20719,7 +20731,7 @@ function SubscriptionCreateModal({
|
|
|
20719
20731
|
useTranslation("common");
|
|
20720
20732
|
const {
|
|
20721
20733
|
switchView
|
|
20722
|
-
} = usePelcro();
|
|
20734
|
+
} = usePelcro$1();
|
|
20723
20735
|
|
|
20724
20736
|
const onSuccess = res => {
|
|
20725
20737
|
var _otherProps$onSuccess;
|
|
@@ -20765,7 +20777,7 @@ const SubscriptionManageMembersContainer = ({
|
|
|
20765
20777
|
}) => {
|
|
20766
20778
|
const {
|
|
20767
20779
|
subscriptionToManageMembers
|
|
20768
|
-
} = usePelcro();
|
|
20780
|
+
} = usePelcro$1();
|
|
20769
20781
|
const subscription_id = subscriptionToManageMembers === null || subscriptionToManageMembers === void 0 ? void 0 : subscriptionToManageMembers.id;
|
|
20770
20782
|
|
|
20771
20783
|
const handleListMembers = ({}, dispatch) => {
|
|
@@ -21809,7 +21821,7 @@ function UserUpdateModal({
|
|
|
21809
21821
|
}) {
|
|
21810
21822
|
const {
|
|
21811
21823
|
switchView
|
|
21812
|
-
} = usePelcro();
|
|
21824
|
+
} = usePelcro$1();
|
|
21813
21825
|
|
|
21814
21826
|
const onPictureClick = () => {
|
|
21815
21827
|
switchView("profile-picture");
|
|
@@ -21918,7 +21930,7 @@ const AddressCreateContainer = ({
|
|
|
21918
21930
|
order,
|
|
21919
21931
|
set,
|
|
21920
21932
|
selectedMembership
|
|
21921
|
-
} = usePelcro();
|
|
21933
|
+
} = usePelcro$1();
|
|
21922
21934
|
const giftCode = (_props$giftCode = props.giftCode) !== null && _props$giftCode !== void 0 ? _props$giftCode : giftCodeFromStore;
|
|
21923
21935
|
const subscriptionIdToRenew = (_ref = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : subscriptionIdToRenewFromStore) !== null && _ref !== void 0 ? _ref : undefined;
|
|
21924
21936
|
React.useEffect(() => {
|
|
@@ -22675,7 +22687,7 @@ const AddressCreateModal = ({
|
|
|
22675
22687
|
switchView,
|
|
22676
22688
|
switchToPaymentView,
|
|
22677
22689
|
resetView
|
|
22678
|
-
} = usePelcro();
|
|
22690
|
+
} = usePelcro$1();
|
|
22679
22691
|
|
|
22680
22692
|
const onSuccess = newAddressId => {
|
|
22681
22693
|
var _otherProps$onSuccess;
|
|
@@ -22768,7 +22780,7 @@ const AddressUpdateContainer = ({
|
|
|
22768
22780
|
|
|
22769
22781
|
const {
|
|
22770
22782
|
addressIdToEdit
|
|
22771
|
-
} = usePelcro();
|
|
22783
|
+
} = usePelcro$1();
|
|
22772
22784
|
const addressId = (_props$addressId = props === null || props === void 0 ? void 0 : props.addressId) !== null && _props$addressId !== void 0 ? _props$addressId : addressIdToEdit;
|
|
22773
22785
|
const [t] = useTranslation("address");
|
|
22774
22786
|
React.useEffect(() => {
|
|
@@ -23859,7 +23871,7 @@ const PasswordForgotModal = ({
|
|
|
23859
23871
|
} = useTranslation("passwordForgot");
|
|
23860
23872
|
const {
|
|
23861
23873
|
switchView
|
|
23862
|
-
} = usePelcro();
|
|
23874
|
+
} = usePelcro$1();
|
|
23863
23875
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
23864
23876
|
id: "pelcro-password-forgot-modal",
|
|
23865
23877
|
onDisplay: onDisplay,
|
|
@@ -24444,7 +24456,7 @@ const CartContainer = ({
|
|
|
24444
24456
|
const {
|
|
24445
24457
|
cartItems,
|
|
24446
24458
|
set
|
|
24447
|
-
} = usePelcro();
|
|
24459
|
+
} = usePelcro$1();
|
|
24448
24460
|
const {
|
|
24449
24461
|
t
|
|
24450
24462
|
} = useTranslation("shop");
|
|
@@ -24549,7 +24561,7 @@ const CartRemoveItemButton = ({
|
|
|
24549
24561
|
}) => {
|
|
24550
24562
|
const {
|
|
24551
24563
|
removeFromCart
|
|
24552
|
-
} = usePelcro();
|
|
24564
|
+
} = usePelcro$1();
|
|
24553
24565
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
24554
24566
|
variant: "icon",
|
|
24555
24567
|
"data-key": itemId,
|
|
@@ -24612,7 +24624,7 @@ const CartTotalPrice = () => {
|
|
|
24612
24624
|
} = React.useContext(store$8);
|
|
24613
24625
|
const {
|
|
24614
24626
|
cartItems
|
|
24615
|
-
} = usePelcro();
|
|
24627
|
+
} = usePelcro$1();
|
|
24616
24628
|
const totalPriceCurrency = cartItems[0].currency;
|
|
24617
24629
|
const {
|
|
24618
24630
|
t
|
|
@@ -24632,7 +24644,7 @@ const CartTotalPrice = () => {
|
|
|
24632
24644
|
const CartView = props => {
|
|
24633
24645
|
const {
|
|
24634
24646
|
cartItems
|
|
24635
|
-
} = usePelcro();
|
|
24647
|
+
} = usePelcro$1();
|
|
24636
24648
|
const {
|
|
24637
24649
|
t
|
|
24638
24650
|
} = useTranslation("cart");
|
|
@@ -24693,7 +24705,7 @@ const CartModal = ({
|
|
|
24693
24705
|
switchView,
|
|
24694
24706
|
switchToAddressView,
|
|
24695
24707
|
isAuthenticated
|
|
24696
|
-
} = usePelcro();
|
|
24708
|
+
} = usePelcro$1();
|
|
24697
24709
|
|
|
24698
24710
|
const onSuccess = items => {
|
|
24699
24711
|
var _otherProps$onSuccess;
|
|
@@ -24725,7 +24737,7 @@ const ShopSelectProductButton = ({
|
|
|
24725
24737
|
}) => {
|
|
24726
24738
|
const {
|
|
24727
24739
|
addToCart
|
|
24728
|
-
} = usePelcro();
|
|
24740
|
+
} = usePelcro$1();
|
|
24729
24741
|
const {
|
|
24730
24742
|
t
|
|
24731
24743
|
} = useTranslation("shop");
|
|
@@ -24757,7 +24769,7 @@ const ShopPurchaseButton = ({
|
|
|
24757
24769
|
}) => {
|
|
24758
24770
|
const {
|
|
24759
24771
|
purchaseItem
|
|
24760
|
-
} = usePelcro();
|
|
24772
|
+
} = usePelcro$1();
|
|
24761
24773
|
const {
|
|
24762
24774
|
t
|
|
24763
24775
|
} = useTranslation("shop");
|
|
@@ -24833,7 +24845,7 @@ const OrderCreateModal = ({
|
|
|
24833
24845
|
}) => {
|
|
24834
24846
|
const {
|
|
24835
24847
|
switchView
|
|
24836
|
-
} = usePelcro();
|
|
24848
|
+
} = usePelcro$1();
|
|
24837
24849
|
|
|
24838
24850
|
const onSuccess = () => {
|
|
24839
24851
|
var _otherProps$onSuccess;
|
|
@@ -24863,7 +24875,7 @@ const OrderConfirmModal = props => {
|
|
|
24863
24875
|
} = useTranslation("shop");
|
|
24864
24876
|
const {
|
|
24865
24877
|
resetView
|
|
24866
|
-
} = usePelcro();
|
|
24878
|
+
} = usePelcro$1();
|
|
24867
24879
|
|
|
24868
24880
|
const onClose = () => {
|
|
24869
24881
|
var _props$onClose;
|
|
@@ -24955,7 +24967,7 @@ const GiftCreateContainer = ({
|
|
|
24955
24967
|
} = useTranslation("register");
|
|
24956
24968
|
const {
|
|
24957
24969
|
set
|
|
24958
|
-
} = usePelcro();
|
|
24970
|
+
} = usePelcro$1();
|
|
24959
24971
|
|
|
24960
24972
|
const handleSubmit = (state, dispatch) => {
|
|
24961
24973
|
const giftRecipient = {
|
|
@@ -25247,7 +25259,7 @@ const GiftCreateModal = ({
|
|
|
25247
25259
|
switchToAddressView,
|
|
25248
25260
|
switchToPaymentView,
|
|
25249
25261
|
product
|
|
25250
|
-
} = usePelcro();
|
|
25262
|
+
} = usePelcro$1();
|
|
25251
25263
|
|
|
25252
25264
|
const onSuccess = giftRecipient => {
|
|
25253
25265
|
var _otherProps$onSuccess;
|
|
@@ -25304,13 +25316,13 @@ const GiftRedeemContainer = ({
|
|
|
25304
25316
|
} = useTranslation("register");
|
|
25305
25317
|
const {
|
|
25306
25318
|
set
|
|
25307
|
-
} = usePelcro();
|
|
25319
|
+
} = usePelcro$1();
|
|
25308
25320
|
const {
|
|
25309
25321
|
switchView,
|
|
25310
25322
|
switchToAddressView,
|
|
25311
25323
|
isAuthenticated,
|
|
25312
25324
|
subscriptionIdToRenew: subscriptionIdToRenewFromStore
|
|
25313
|
-
} = usePelcro();
|
|
25325
|
+
} = usePelcro$1();
|
|
25314
25326
|
const subscriptionIdToRenew = (_ref = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : subscriptionIdToRenewFromStore) !== null && _ref !== void 0 ? _ref : undefined;
|
|
25315
25327
|
React.useEffect(() => {
|
|
25316
25328
|
onDisplay();
|
|
@@ -25523,7 +25535,7 @@ const GiftRedeemModal = ({
|
|
|
25523
25535
|
switchView,
|
|
25524
25536
|
switchToAddressView,
|
|
25525
25537
|
isAuthenticated
|
|
25526
|
-
} = usePelcro();
|
|
25538
|
+
} = usePelcro$1();
|
|
25527
25539
|
|
|
25528
25540
|
const onSuccess = giftCode => {
|
|
25529
25541
|
var _otherProps$onSuccess;
|
|
@@ -25590,7 +25602,7 @@ const AddressSelectContainer = ({
|
|
|
25590
25602
|
subscriptionIdToRenew: subscriptionIdToRenewFromStore,
|
|
25591
25603
|
set,
|
|
25592
25604
|
selectedMembership
|
|
25593
|
-
} = usePelcro();
|
|
25605
|
+
} = usePelcro$1();
|
|
25594
25606
|
const giftCode = (_props$giftCode = props.giftCode) !== null && _props$giftCode !== void 0 ? _props$giftCode : giftCodeFromStore;
|
|
25595
25607
|
const subscriptionIdToRenew = (_ref = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : subscriptionIdToRenewFromStore) !== null && _ref !== void 0 ? _ref : undefined;
|
|
25596
25608
|
|
|
@@ -25832,7 +25844,7 @@ const AddressSelectModal = ({
|
|
|
25832
25844
|
switchView,
|
|
25833
25845
|
switchToPaymentView,
|
|
25834
25846
|
resetView
|
|
25835
|
-
} = usePelcro();
|
|
25847
|
+
} = usePelcro$1();
|
|
25836
25848
|
|
|
25837
25849
|
const onSuccess = selectedAddressId => {
|
|
25838
25850
|
var _otherProps$onSuccess;
|
|
@@ -25910,7 +25922,7 @@ const PaymentMethodSelectContainer = ({
|
|
|
25910
25922
|
const {
|
|
25911
25923
|
set,
|
|
25912
25924
|
selectedPaymentMethodId: selectedPaymentMethodIdFromStore
|
|
25913
|
-
} = usePelcro();
|
|
25925
|
+
} = usePelcro$1();
|
|
25914
25926
|
|
|
25915
25927
|
const submitPaymentMethod = ({
|
|
25916
25928
|
selectedPaymentMethodId
|
|
@@ -26093,7 +26105,7 @@ const PaymentMethodSelectModal = ({
|
|
|
26093
26105
|
switchToCheckoutForm,
|
|
26094
26106
|
set,
|
|
26095
26107
|
plan
|
|
26096
|
-
} = usePelcro();
|
|
26108
|
+
} = usePelcro$1();
|
|
26097
26109
|
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
26098
26110
|
React.useEffect(() => {
|
|
26099
26111
|
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) {
|
|
@@ -27401,7 +27413,7 @@ const SavedItems = ({
|
|
|
27401
27413
|
const [isLoading, setLoading] = React.useState(false);
|
|
27402
27414
|
const {
|
|
27403
27415
|
isAuthenticated
|
|
27404
|
-
} = usePelcro();
|
|
27416
|
+
} = usePelcro$1();
|
|
27405
27417
|
|
|
27406
27418
|
const removeItemFromMetadata = (category, title) => {
|
|
27407
27419
|
const user = window.Pelcro.user.read();
|
|
@@ -27600,7 +27612,7 @@ const SubscriptionsItems = ({
|
|
|
27600
27612
|
setSubscriptionToCancel,
|
|
27601
27613
|
setSubscriptionToSuspend,
|
|
27602
27614
|
set
|
|
27603
|
-
} = usePelcro();
|
|
27615
|
+
} = usePelcro$1();
|
|
27604
27616
|
const subs = getNonDonationSubs();
|
|
27605
27617
|
if (subs.length === 0) return null;
|
|
27606
27618
|
return subs.sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
|
|
@@ -28197,7 +28209,7 @@ const InvoicesItems = () => {
|
|
|
28197
28209
|
const {
|
|
28198
28210
|
setInvoice,
|
|
28199
28211
|
switchView
|
|
28200
|
-
} = usePelcro();
|
|
28212
|
+
} = usePelcro$1();
|
|
28201
28213
|
const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
|
|
28202
28214
|
|
|
28203
28215
|
const showInvoiceDetails = event => {
|
|
@@ -28328,7 +28340,7 @@ const MembershipsItems = () => {
|
|
|
28328
28340
|
switchView,
|
|
28329
28341
|
setSelectedMembership,
|
|
28330
28342
|
switchToAddressView
|
|
28331
|
-
} = usePelcro();
|
|
28343
|
+
} = usePelcro$1();
|
|
28332
28344
|
const memberships = getActiveMemberships();
|
|
28333
28345
|
|
|
28334
28346
|
const onChangeAddressClick = membershipId => {
|
|
@@ -28408,7 +28420,7 @@ function DashboardWithHook(props) {
|
|
|
28408
28420
|
resetView,
|
|
28409
28421
|
logout,
|
|
28410
28422
|
set
|
|
28411
|
-
} = usePelcro();
|
|
28423
|
+
} = usePelcro$1();
|
|
28412
28424
|
return /*#__PURE__*/React__default['default'].createElement(DashboardWithTrans, {
|
|
28413
28425
|
setAddress: addressIdToEdit => set({
|
|
28414
28426
|
addressIdToEdit
|
|
@@ -29044,7 +29056,7 @@ const DashboardWithTrans = withTranslation("dashboard")(Dashboard);
|
|
|
29044
29056
|
const DashboardOpenButton = () => {
|
|
29045
29057
|
const {
|
|
29046
29058
|
switchView
|
|
29047
|
-
} = usePelcro();
|
|
29059
|
+
} = usePelcro$1();
|
|
29048
29060
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
29049
29061
|
className: "plc-fixed plc-right-4 plc-bottom-4 pelcro-open-dashboard-btn"
|
|
29050
29062
|
}, /*#__PURE__*/React__default['default'].createElement("button", {
|
|
@@ -31033,11 +31045,34 @@ const EmailVerifyModal = ({
|
|
|
31033
31045
|
onClose,
|
|
31034
31046
|
...otherProps
|
|
31035
31047
|
}) => {
|
|
31048
|
+
const {
|
|
31049
|
+
product,
|
|
31050
|
+
plan,
|
|
31051
|
+
switchToAddressView,
|
|
31052
|
+
switchToPaymentView
|
|
31053
|
+
} = usePelcro();
|
|
31054
|
+
|
|
31055
|
+
const onSuccess = res => {
|
|
31056
|
+
var _props$onSuccess, _props;
|
|
31057
|
+
|
|
31058
|
+
(_props$onSuccess = (_props = props).onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(_props, res);
|
|
31059
|
+
|
|
31060
|
+
if (product && plan) {
|
|
31061
|
+
if (product.address_required) {
|
|
31062
|
+
return switchToAddressView();
|
|
31063
|
+
} else {
|
|
31064
|
+
return switchToPaymentView();
|
|
31065
|
+
}
|
|
31066
|
+
}
|
|
31067
|
+
};
|
|
31068
|
+
|
|
31036
31069
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
31037
31070
|
onDisplay: onDisplay,
|
|
31038
31071
|
onClose: onClose,
|
|
31039
31072
|
id: "pelcro-email-verify-modal"
|
|
31040
|
-
}, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(EmailVerifyView,
|
|
31073
|
+
}, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(EmailVerifyView, Object.assign({
|
|
31074
|
+
onSuccess: onSuccess
|
|
31075
|
+
}, otherProps))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
|
|
31041
31076
|
};
|
|
31042
31077
|
EmailVerifyModal.viewId = "email-verify";
|
|
31043
31078
|
|
|
@@ -31185,7 +31220,7 @@ function VerifyLinkTokenModal({
|
|
|
31185
31220
|
} = useTranslation("verifyLinkToken");
|
|
31186
31221
|
const {
|
|
31187
31222
|
resetView
|
|
31188
|
-
} = usePelcro();
|
|
31223
|
+
} = usePelcro$1();
|
|
31189
31224
|
|
|
31190
31225
|
const onSuccess = res => {
|
|
31191
31226
|
var _props$onSuccess;
|
|
@@ -31235,7 +31270,7 @@ const InvoicePaymentModal = ({
|
|
|
31235
31270
|
}) => {
|
|
31236
31271
|
const {
|
|
31237
31272
|
switchView
|
|
31238
|
-
} = usePelcro();
|
|
31273
|
+
} = usePelcro$1();
|
|
31239
31274
|
|
|
31240
31275
|
const onSuccess = () => {
|
|
31241
31276
|
var _otherProps$onSuccess;
|
|
@@ -31312,7 +31347,7 @@ const InvoiceDetailsDownloadButton = ({
|
|
|
31312
31347
|
} = useTranslation("invoiceDetails");
|
|
31313
31348
|
const {
|
|
31314
31349
|
invoice
|
|
31315
|
-
} = usePelcro();
|
|
31350
|
+
} = usePelcro$1();
|
|
31316
31351
|
return /*#__PURE__*/React__default['default'].createElement(Link, Object.assign({
|
|
31317
31352
|
className: `plc-px-6 plc-py-2 plc-uppercase plc-bg-transparent plc-text-primary-500 plc-border plc-border-primary-500 plc-rounded focus:plc-outline-none focus:plc-ring-2 focus:plc-ring-primary-300 plc-tracking-wider hover:plc-bg-primary-600 focus:plc-bg-primary-600 hover:plc-text-white focus:plc-text-white hover:plc-shadow-none plc-no-underline ${className}`,
|
|
31318
31353
|
id: "pelcro-download-invoice-link",
|
|
@@ -31349,7 +31384,7 @@ const InvoiceDetailsView = props => {
|
|
|
31349
31384
|
} = useTranslation("invoiceDetails");
|
|
31350
31385
|
const {
|
|
31351
31386
|
invoice
|
|
31352
|
-
} = usePelcro();
|
|
31387
|
+
} = usePelcro$1();
|
|
31353
31388
|
const showPayButton = canPayInvoice(invoice);
|
|
31354
31389
|
const showDownloadButton = Boolean(invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf);
|
|
31355
31390
|
const hasPlanDetails = Boolean(invoice.plan);
|
|
@@ -31417,7 +31452,7 @@ const InvoiceDetailsModal = ({
|
|
|
31417
31452
|
}) => {
|
|
31418
31453
|
const {
|
|
31419
31454
|
switchToPaymentView
|
|
31420
|
-
} = usePelcro();
|
|
31455
|
+
} = usePelcro$1();
|
|
31421
31456
|
|
|
31422
31457
|
const onSuccess = () => {
|
|
31423
31458
|
var _otherProps$onSuccess;
|
|
@@ -33088,4 +33123,4 @@ exports.initContentEntitlement = init;
|
|
|
33088
33123
|
exports.invoicePaymentSubmitButton = invoicePaymentSubmitButton;
|
|
33089
33124
|
exports.notify = notify;
|
|
33090
33125
|
exports.unauthenticatedButtons = unauthenticatedButtons;
|
|
33091
|
-
exports.usePelcro = usePelcro;
|
|
33126
|
+
exports.usePelcro = usePelcro$1;
|