@pelcro/react-pelcro-js 3.21.0-beta.6 → 3.21.1
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 +60 -170
- package/dist/index.esm.js +61 -170
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -11141,9 +11141,6 @@ const initViewFromURL = () => {
|
|
|
11141
11141
|
if (view === "manage-members") {
|
|
11142
11142
|
return showSubscriptionManageMembersFromUrl();
|
|
11143
11143
|
}
|
|
11144
|
-
if (view === "payment-method-update") {
|
|
11145
|
-
return showPaymentMethodUpdateFromUrl();
|
|
11146
|
-
}
|
|
11147
11144
|
switchView(view);
|
|
11148
11145
|
});
|
|
11149
11146
|
}
|
|
@@ -11352,43 +11349,6 @@ const showPasswordlessRequestFromUrl = () => {
|
|
|
11352
11349
|
} = usePelcro.getStore();
|
|
11353
11350
|
return switchView("passwordless-request");
|
|
11354
11351
|
};
|
|
11355
|
-
const showPaymentMethodUpdateFromUrl = () => {
|
|
11356
|
-
const {
|
|
11357
|
-
isAuthenticated,
|
|
11358
|
-
whenSiteReady,
|
|
11359
|
-
whenUserReady,
|
|
11360
|
-
switchView
|
|
11361
|
-
} = usePelcro.getStore();
|
|
11362
|
-
whenSiteReady(() => {
|
|
11363
|
-
if (!isAuthenticated()) {
|
|
11364
|
-
return switchView("login");
|
|
11365
|
-
}
|
|
11366
|
-
whenUserReady(() => {
|
|
11367
|
-
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
11368
|
-
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
11369
|
-
if (!window.Stripe && !supportsVantiv && !supportsTap) {
|
|
11370
|
-
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
11371
|
-
return switchView("payment-method-update");
|
|
11372
|
-
});
|
|
11373
|
-
return;
|
|
11374
|
-
}
|
|
11375
|
-
|
|
11376
|
-
//vantiv
|
|
11377
|
-
if (supportsVantiv) {
|
|
11378
|
-
document.querySelector("#vantiv-eprotect-sdk").addEventListener("load", () => {
|
|
11379
|
-
return switchView("payment-method-update");
|
|
11380
|
-
});
|
|
11381
|
-
return;
|
|
11382
|
-
}
|
|
11383
|
-
|
|
11384
|
-
//Tap
|
|
11385
|
-
if (supportsTap && document.querySelector("#tap-sdk")) {
|
|
11386
|
-
return switchView("payment-method-update");
|
|
11387
|
-
}
|
|
11388
|
-
return switchView("payment-method-update");
|
|
11389
|
-
});
|
|
11390
|
-
});
|
|
11391
|
-
};
|
|
11392
11352
|
const showInvoiceDetailsFromUrl = () => {
|
|
11393
11353
|
const {
|
|
11394
11354
|
isAuthenticated,
|
|
@@ -13301,7 +13261,7 @@ function LoginModal(_ref) {
|
|
|
13301
13261
|
}
|
|
13302
13262
|
resetView();
|
|
13303
13263
|
const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
|
|
13304
|
-
const viewsURLs = ["invoice-details", "gift-redeem", "plan-select"
|
|
13264
|
+
const viewsURLs = ["invoice-details", "gift-redeem", "plan-select"];
|
|
13305
13265
|
if (viewsURLs.includes(viewFromURL)) {
|
|
13306
13266
|
initViewFromURL();
|
|
13307
13267
|
}
|
|
@@ -13991,6 +13951,16 @@ function productsWithMatchedTaggedFirst() {
|
|
|
13991
13951
|
const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
|
|
13992
13952
|
return [productsThatMatchArticleTag, allProductsMinusMatched];
|
|
13993
13953
|
}
|
|
13954
|
+
function productMatchPageLanguage(product) {
|
|
13955
|
+
if (!product) {
|
|
13956
|
+
return false;
|
|
13957
|
+
}
|
|
13958
|
+
if (product.language === null) {
|
|
13959
|
+
return true;
|
|
13960
|
+
}
|
|
13961
|
+
const siteLanguage = window.Pelcro.helpers.getHtmlLanguageAttribute();
|
|
13962
|
+
return product.language === siteLanguage;
|
|
13963
|
+
}
|
|
13994
13964
|
SelectModalWithHook.viewId = "plan-select";
|
|
13995
13965
|
class SelectModal extends React.Component {
|
|
13996
13966
|
constructor(props) {
|
|
@@ -14027,27 +13997,28 @@ class SelectModal extends React.Component {
|
|
|
14027
13997
|
this.props.setView("register");
|
|
14028
13998
|
}
|
|
14029
13999
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14030
|
-
{
|
|
14000
|
+
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14031
14001
|
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$site;
|
|
14032
14002
|
const userCurrency = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read().currency;
|
|
14033
14003
|
const userCountry = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.location.countryCode;
|
|
14034
14004
|
const userLanguage = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$user = _window$Pelcro3.user) === null || _window$Pelcro3$user === void 0 ? void 0 : _window$Pelcro3$user.read().language;
|
|
14035
|
-
const
|
|
14036
|
-
const filteredPlans = product.plans.filter(plan => plan.
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14005
|
+
const productsMatchingUserCurrency = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$site = _window$Pelcro4.site) === null || _window$Pelcro4$site === void 0 ? void 0 : _window$Pelcro4$site.read().products.map(product => {
|
|
14006
|
+
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14007
|
+
return {
|
|
14008
|
+
...product,
|
|
14009
|
+
plans: filteredPlans
|
|
14010
|
+
};
|
|
14040
14011
|
});
|
|
14041
|
-
const
|
|
14012
|
+
const productsMatchingUserCountry = productsMatchingUserCurrency.filter(product => {
|
|
14042
14013
|
const filteredPlans = product.plans.filter(plan => {
|
|
14043
14014
|
var _plan$countries;
|
|
14044
|
-
return (_plan$countries = plan.countries) === null || _plan$countries === void 0 ? void 0 : _plan$countries.includes(userCountry);
|
|
14015
|
+
return plan.countries && ((_plan$countries = plan.countries) === null || _plan$countries === void 0 ? void 0 : _plan$countries.includes(userCountry)) || !plan.countries || !plan.countries.length;
|
|
14045
14016
|
});
|
|
14046
14017
|
if (filteredPlans.length) return filteredPlans;
|
|
14047
|
-
})
|
|
14018
|
+
});
|
|
14048
14019
|
notifyBugsnag(() => {
|
|
14049
14020
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14050
|
-
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _this$props, _window$Pelcro9, _window$Pelcro9$helpe
|
|
14021
|
+
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _this$props, _window$Pelcro9, _window$Pelcro9$helpe;
|
|
14051
14022
|
event.addMetadata("MetaData", {
|
|
14052
14023
|
site: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read(),
|
|
14053
14024
|
user: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : _window$Pelcro6$user.read(),
|
|
@@ -14064,12 +14035,9 @@ class SelectModal extends React.Component {
|
|
|
14064
14035
|
userCountry: userCountry,
|
|
14065
14036
|
userLanguage: userLanguage,
|
|
14066
14037
|
siteLanguage: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : (_window$Pelcro9$helpe = _window$Pelcro9.helpers) === null || _window$Pelcro9$helpe === void 0 ? void 0 : _window$Pelcro9$helpe.getHtmlLanguageAttribute(),
|
|
14067
|
-
currency_mismatch:
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
}).length) === 0,
|
|
14071
|
-
country_restrictions: currencyMismatch,
|
|
14072
|
-
language_mismatch: ((_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : (_window$Pelcro11$site = _window$Pelcro11.site) === null || _window$Pelcro11$site === void 0 ? void 0 : _window$Pelcro11$site.read().products.filter(product => product.language === userLanguage).length) === 0
|
|
14038
|
+
currency_mismatch: productsMatchingUserCurrency.length === 0,
|
|
14039
|
+
country_restrictions: productsMatchingUserCountry.length === 0,
|
|
14040
|
+
language_mismatch: productsMatchingUserCountry.filter(product => product.plans.length).filter(productMatchPageLanguage).length === 0
|
|
14073
14041
|
});
|
|
14074
14042
|
});
|
|
14075
14043
|
});
|
|
@@ -16835,7 +16803,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16835
16803
|
const tapInstanceRef = React__default['default'].useRef(null);
|
|
16836
16804
|
const tapInstanceCard = React__default['default'].useRef(null);
|
|
16837
16805
|
React.useEffect(() => {
|
|
16838
|
-
if (skipPayment && (
|
|
16806
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16839
16807
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
16840
16808
|
var _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
16841
16809
|
const payPageId = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.pay_page_id;
|
|
@@ -16864,7 +16832,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16864
16832
|
}, [selectedPaymentMethodId]);
|
|
16865
16833
|
React.useEffect(() => {
|
|
16866
16834
|
whenUserReady(() => {
|
|
16867
|
-
if (skipPayment && (
|
|
16835
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16868
16836
|
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
16869
16837
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
16870
16838
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -16878,7 +16846,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16878
16846
|
});
|
|
16879
16847
|
}, [selectedPaymentMethodId]);
|
|
16880
16848
|
const initPaymentRequest = (state, dispatch) => {
|
|
16881
|
-
if (skipPayment && (
|
|
16849
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16882
16850
|
try {
|
|
16883
16851
|
const paymentRequest = stripe.paymentRequest({
|
|
16884
16852
|
country: window.Pelcro.user.location.countryCode || "US",
|
|
@@ -16947,7 +16915,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16947
16915
|
*/
|
|
16948
16916
|
const updateTotalAmountWithTax = () => {
|
|
16949
16917
|
var _window$Pelcro$site$r4;
|
|
16950
|
-
if (skipPayment && (
|
|
16918
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16951
16919
|
const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
|
|
16952
16920
|
if (taxesEnabled && type === "createPayment") {
|
|
16953
16921
|
dispatch({
|
|
@@ -17542,29 +17510,6 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17542
17510
|
});
|
|
17543
17511
|
};
|
|
17544
17512
|
const submitPayment = (state, dispatch) => {
|
|
17545
|
-
if (skipPayment && (order === null || order === void 0 ? void 0 : order.price) === 0) {
|
|
17546
|
-
const isQuickPurchase = !Array.isArray(order);
|
|
17547
|
-
const mappedOrderItems = isQuickPurchase ? [{
|
|
17548
|
-
sku_id: order.id,
|
|
17549
|
-
quantity: order.quantity
|
|
17550
|
-
}] : order.map(item => ({
|
|
17551
|
-
sku_id: item.id,
|
|
17552
|
-
quantity: item.quantity
|
|
17553
|
-
}));
|
|
17554
|
-
window.Pelcro.ecommerce.order.create({
|
|
17555
|
-
items: mappedOrderItems,
|
|
17556
|
-
campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
|
|
17557
|
-
...(selectedAddressId && {
|
|
17558
|
-
address_id: selectedAddressId
|
|
17559
|
-
})
|
|
17560
|
-
}, (err, res) => {
|
|
17561
|
-
if (err) {
|
|
17562
|
-
return handlePaymentError(err);
|
|
17563
|
-
}
|
|
17564
|
-
return onSuccess(res);
|
|
17565
|
-
});
|
|
17566
|
-
return;
|
|
17567
|
-
}
|
|
17568
17513
|
stripe.createSource({
|
|
17569
17514
|
type: "card"
|
|
17570
17515
|
}).then(_ref8 => {
|
|
@@ -17926,14 +17871,10 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17926
17871
|
state,
|
|
17927
17872
|
dispatch
|
|
17928
17873
|
}
|
|
17929
|
-
}, children.length ? children.map((child, i) => {
|
|
17930
|
-
|
|
17931
|
-
|
|
17932
|
-
|
|
17933
|
-
key: i
|
|
17934
|
-
});
|
|
17935
|
-
}
|
|
17936
|
-
}) : /*#__PURE__*/React__default['default'].cloneElement(children, {
|
|
17874
|
+
}, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
|
|
17875
|
+
store: store$k,
|
|
17876
|
+
key: i
|
|
17877
|
+
})) : /*#__PURE__*/React__default['default'].cloneElement(children, {
|
|
17937
17878
|
store: store$k
|
|
17938
17879
|
})));
|
|
17939
17880
|
};
|
|
@@ -18755,42 +18696,6 @@ const SubscriptionCreateFreePlanButton = _ref => {
|
|
|
18755
18696
|
}, otherProps), t("buttons.subscribe"));
|
|
18756
18697
|
};
|
|
18757
18698
|
|
|
18758
|
-
const OrderCreateFreeButton = _ref => {
|
|
18759
|
-
let {
|
|
18760
|
-
name,
|
|
18761
|
-
onClick,
|
|
18762
|
-
...otherProps
|
|
18763
|
-
} = _ref;
|
|
18764
|
-
const {
|
|
18765
|
-
state: {
|
|
18766
|
-
disableSubmit
|
|
18767
|
-
},
|
|
18768
|
-
dispatch
|
|
18769
|
-
} = React.useContext(store$k);
|
|
18770
|
-
const {
|
|
18771
|
-
t
|
|
18772
|
-
} = useTranslation("checkoutForm");
|
|
18773
|
-
const [isDisabled, setDisabled] = React.useState(true);
|
|
18774
|
-
React.useEffect(() => {
|
|
18775
|
-
setDisabled(disableSubmit);
|
|
18776
|
-
}, [disableSubmit]);
|
|
18777
|
-
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
18778
|
-
className: "plc-w-full",
|
|
18779
|
-
onClick: () => {
|
|
18780
|
-
dispatch({
|
|
18781
|
-
type: DISABLE_SUBMIT,
|
|
18782
|
-
payload: true
|
|
18783
|
-
});
|
|
18784
|
-
dispatch({
|
|
18785
|
-
type: SUBMIT_PAYMENT
|
|
18786
|
-
});
|
|
18787
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
18788
|
-
},
|
|
18789
|
-
disabled: isDisabled,
|
|
18790
|
-
isLoading: disableSubmit
|
|
18791
|
-
}, otherProps), t("labels.submit"));
|
|
18792
|
-
};
|
|
18793
|
-
|
|
18794
18699
|
/**
|
|
18795
18700
|
*
|
|
18796
18701
|
*/
|
|
@@ -18803,8 +18708,7 @@ function PaymentMethodView(_ref) {
|
|
|
18803
18708
|
type,
|
|
18804
18709
|
showCoupon,
|
|
18805
18710
|
showExternalPaymentMethods,
|
|
18806
|
-
showSubscriptionButton
|
|
18807
|
-
showOrderButton
|
|
18711
|
+
showSubscriptionButton
|
|
18808
18712
|
} = _ref;
|
|
18809
18713
|
const {
|
|
18810
18714
|
t
|
|
@@ -18817,7 +18721,7 @@ function PaymentMethodView(_ref) {
|
|
|
18817
18721
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
18818
18722
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
18819
18723
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
|
|
18820
|
-
}, cardProcessor === "stripe" && !showSubscriptionButton &&
|
|
18724
|
+
}, cardProcessor === "stripe" && !showSubscriptionButton && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
18821
18725
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
|
|
18822
18726
|
}, /*#__PURE__*/React__default['default'].createElement(SvgLock, {
|
|
18823
18727
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -18836,7 +18740,7 @@ function PaymentMethodView(_ref) {
|
|
|
18836
18740
|
onFailure: onFailure
|
|
18837
18741
|
}, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
18838
18742
|
className: "plc-mb-2"
|
|
18839
|
-
}), showSubscriptionButton
|
|
18743
|
+
}), showSubscriptionButton ? /*#__PURE__*/React__default['default'].createElement(SubscriptionCreateFreePlanButton, null) : /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(BankRedirection, null), /*#__PURE__*/React__default['default'].createElement(BankAuthenticationSuccess, null), /*#__PURE__*/React__default['default'].createElement(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
18840
18744
|
className: "plc-flex plc-items-start"
|
|
18841
18745
|
}, /*#__PURE__*/React__default['default'].createElement(IncludeFirstName, {
|
|
18842
18746
|
id: "pelcro-input-first-name",
|
|
@@ -20627,32 +20531,27 @@ function SubscriptionManageMembersList(props) {
|
|
|
20627
20531
|
type: HANDLE_REMOVE_MEMBER
|
|
20628
20532
|
});
|
|
20629
20533
|
};
|
|
20630
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, members === null || members === void 0 ? void 0 : members.map(member => {
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20634
|
-
|
|
20635
|
-
|
|
20636
|
-
|
|
20637
|
-
|
|
20638
|
-
|
|
20639
|
-
|
|
20640
|
-
|
|
20641
|
-
|
|
20642
|
-
|
|
20643
|
-
|
|
20644
|
-
|
|
20645
|
-
|
|
20646
|
-
|
|
20647
|
-
|
|
20648
|
-
|
|
20649
|
-
|
|
20650
|
-
|
|
20651
|
-
disabled: member.id === removeMemberId,
|
|
20652
|
-
isLoading: member.id === removeMemberId,
|
|
20653
|
-
"data-key": member.id
|
|
20654
|
-
}, t("labels.remove"))));
|
|
20655
|
-
}));
|
|
20534
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, members === null || members === void 0 ? void 0 : members.map(member => /*#__PURE__*/React__default['default'].createElement("tr", {
|
|
20535
|
+
key: member.id,
|
|
20536
|
+
className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50 plc-text-center`
|
|
20537
|
+
}, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
20538
|
+
className: "plc-truncate plc-text-left",
|
|
20539
|
+
title: member === null || member === void 0 ? void 0 : member.invitation_email
|
|
20540
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20541
|
+
className: "plc-font-semibold plc-text-gray-500"
|
|
20542
|
+
}, member === null || member === void 0 ? void 0 : member.invitation_email)), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
20543
|
+
className: "plc-py-2"
|
|
20544
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20545
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getMemberStatus(member).bgColor} plc-uppercase ${getMemberStatus(member).textColor} plc-rounded-lg`
|
|
20546
|
+
}, getMemberStatus(member).icon, getMemberStatus(member).title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
20547
|
+
variant: "ghost",
|
|
20548
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
20549
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
|
|
20550
|
+
onClick: () => onRemoveClick(member.id),
|
|
20551
|
+
disabled: member.id === removeMemberId,
|
|
20552
|
+
isLoading: member.id === removeMemberId,
|
|
20553
|
+
"data-key": member.id
|
|
20554
|
+
}, t("labels.remove"))))));
|
|
20656
20555
|
}
|
|
20657
20556
|
|
|
20658
20557
|
/**
|
|
@@ -24246,15 +24145,9 @@ const OrderCreateContainer = props => /*#__PURE__*/React__default['default'].cre
|
|
|
24246
24145
|
}, props));
|
|
24247
24146
|
|
|
24248
24147
|
const OrderCreateView = props => {
|
|
24249
|
-
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
24250
24148
|
const {
|
|
24251
24149
|
t
|
|
24252
24150
|
} = useTranslation("payment");
|
|
24253
|
-
const {
|
|
24254
|
-
order
|
|
24255
|
-
} = usePelcro();
|
|
24256
|
-
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;
|
|
24257
|
-
const showOrderButton = skipPayment && (order === null || order === void 0 ? void 0 : order.price) === 0;
|
|
24258
24151
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24259
24152
|
id: "pelcro-order-create-view"
|
|
24260
24153
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -24265,8 +24158,7 @@ const OrderCreateView = props => {
|
|
|
24265
24158
|
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
|
|
24266
24159
|
type: "orderCreate",
|
|
24267
24160
|
showCoupon: true,
|
|
24268
|
-
showExternalPaymentMethods: false
|
|
24269
|
-
showOrderButton: showOrderButton
|
|
24161
|
+
showExternalPaymentMethods: false
|
|
24270
24162
|
}, props))));
|
|
24271
24163
|
};
|
|
24272
24164
|
|
|
@@ -25474,12 +25366,11 @@ const PaymentMethodSelectModal = _ref => {
|
|
|
25474
25366
|
const {
|
|
25475
25367
|
switchToCheckoutForm,
|
|
25476
25368
|
set,
|
|
25477
|
-
plan
|
|
25478
|
-
order
|
|
25369
|
+
plan
|
|
25479
25370
|
} = usePelcro();
|
|
25480
25371
|
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;
|
|
25481
25372
|
React.useEffect(() => {
|
|
25482
|
-
if (skipPayment && (
|
|
25373
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) {
|
|
25483
25374
|
switchToCheckoutForm();
|
|
25484
25375
|
}
|
|
25485
25376
|
}, []);
|
|
@@ -32297,7 +32188,6 @@ exports.NewsletterUpdateView = NewsletterUpdateView;
|
|
|
32297
32188
|
exports.Notification = Notification;
|
|
32298
32189
|
exports.OrderConfirmModal = OrderConfirmModal;
|
|
32299
32190
|
exports.OrderCreateContainer = OrderCreateContainer;
|
|
32300
|
-
exports.OrderCreateFreeButton = OrderCreateFreeButton;
|
|
32301
32191
|
exports.OrderCreateModal = OrderCreateModal;
|
|
32302
32192
|
exports.OrderCreateSubmitButton = OrderCreateSubmitButton;
|
|
32303
32193
|
exports.OrderCreateView = OrderCreateView;
|
package/dist/index.esm.js
CHANGED
|
@@ -11111,9 +11111,6 @@ const initViewFromURL = () => {
|
|
|
11111
11111
|
if (view === "manage-members") {
|
|
11112
11112
|
return showSubscriptionManageMembersFromUrl();
|
|
11113
11113
|
}
|
|
11114
|
-
if (view === "payment-method-update") {
|
|
11115
|
-
return showPaymentMethodUpdateFromUrl();
|
|
11116
|
-
}
|
|
11117
11114
|
switchView(view);
|
|
11118
11115
|
});
|
|
11119
11116
|
}
|
|
@@ -11322,43 +11319,6 @@ const showPasswordlessRequestFromUrl = () => {
|
|
|
11322
11319
|
} = usePelcro.getStore();
|
|
11323
11320
|
return switchView("passwordless-request");
|
|
11324
11321
|
};
|
|
11325
|
-
const showPaymentMethodUpdateFromUrl = () => {
|
|
11326
|
-
const {
|
|
11327
|
-
isAuthenticated,
|
|
11328
|
-
whenSiteReady,
|
|
11329
|
-
whenUserReady,
|
|
11330
|
-
switchView
|
|
11331
|
-
} = usePelcro.getStore();
|
|
11332
|
-
whenSiteReady(() => {
|
|
11333
|
-
if (!isAuthenticated()) {
|
|
11334
|
-
return switchView("login");
|
|
11335
|
-
}
|
|
11336
|
-
whenUserReady(() => {
|
|
11337
|
-
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
11338
|
-
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
11339
|
-
if (!window.Stripe && !supportsVantiv && !supportsTap) {
|
|
11340
|
-
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
11341
|
-
return switchView("payment-method-update");
|
|
11342
|
-
});
|
|
11343
|
-
return;
|
|
11344
|
-
}
|
|
11345
|
-
|
|
11346
|
-
//vantiv
|
|
11347
|
-
if (supportsVantiv) {
|
|
11348
|
-
document.querySelector("#vantiv-eprotect-sdk").addEventListener("load", () => {
|
|
11349
|
-
return switchView("payment-method-update");
|
|
11350
|
-
});
|
|
11351
|
-
return;
|
|
11352
|
-
}
|
|
11353
|
-
|
|
11354
|
-
//Tap
|
|
11355
|
-
if (supportsTap && document.querySelector("#tap-sdk")) {
|
|
11356
|
-
return switchView("payment-method-update");
|
|
11357
|
-
}
|
|
11358
|
-
return switchView("payment-method-update");
|
|
11359
|
-
});
|
|
11360
|
-
});
|
|
11361
|
-
};
|
|
11362
11322
|
const showInvoiceDetailsFromUrl = () => {
|
|
11363
11323
|
const {
|
|
11364
11324
|
isAuthenticated,
|
|
@@ -13271,7 +13231,7 @@ function LoginModal(_ref) {
|
|
|
13271
13231
|
}
|
|
13272
13232
|
resetView();
|
|
13273
13233
|
const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
|
|
13274
|
-
const viewsURLs = ["invoice-details", "gift-redeem", "plan-select"
|
|
13234
|
+
const viewsURLs = ["invoice-details", "gift-redeem", "plan-select"];
|
|
13275
13235
|
if (viewsURLs.includes(viewFromURL)) {
|
|
13276
13236
|
initViewFromURL();
|
|
13277
13237
|
}
|
|
@@ -13961,6 +13921,16 @@ function productsWithMatchedTaggedFirst() {
|
|
|
13961
13921
|
const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
|
|
13962
13922
|
return [productsThatMatchArticleTag, allProductsMinusMatched];
|
|
13963
13923
|
}
|
|
13924
|
+
function productMatchPageLanguage(product) {
|
|
13925
|
+
if (!product) {
|
|
13926
|
+
return false;
|
|
13927
|
+
}
|
|
13928
|
+
if (product.language === null) {
|
|
13929
|
+
return true;
|
|
13930
|
+
}
|
|
13931
|
+
const siteLanguage = window.Pelcro.helpers.getHtmlLanguageAttribute();
|
|
13932
|
+
return product.language === siteLanguage;
|
|
13933
|
+
}
|
|
13964
13934
|
SelectModalWithHook.viewId = "plan-select";
|
|
13965
13935
|
class SelectModal extends Component {
|
|
13966
13936
|
constructor(props) {
|
|
@@ -13997,27 +13967,28 @@ class SelectModal extends Component {
|
|
|
13997
13967
|
this.props.setView("register");
|
|
13998
13968
|
}
|
|
13999
13969
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14000
|
-
{
|
|
13970
|
+
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14001
13971
|
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$site;
|
|
14002
13972
|
const userCurrency = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read().currency;
|
|
14003
13973
|
const userCountry = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.location.countryCode;
|
|
14004
13974
|
const userLanguage = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$user = _window$Pelcro3.user) === null || _window$Pelcro3$user === void 0 ? void 0 : _window$Pelcro3$user.read().language;
|
|
14005
|
-
const
|
|
14006
|
-
const filteredPlans = product.plans.filter(plan => plan.
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
13975
|
+
const productsMatchingUserCurrency = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$site = _window$Pelcro4.site) === null || _window$Pelcro4$site === void 0 ? void 0 : _window$Pelcro4$site.read().products.map(product => {
|
|
13976
|
+
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
13977
|
+
return {
|
|
13978
|
+
...product,
|
|
13979
|
+
plans: filteredPlans
|
|
13980
|
+
};
|
|
14010
13981
|
});
|
|
14011
|
-
const
|
|
13982
|
+
const productsMatchingUserCountry = productsMatchingUserCurrency.filter(product => {
|
|
14012
13983
|
const filteredPlans = product.plans.filter(plan => {
|
|
14013
13984
|
var _plan$countries;
|
|
14014
|
-
return (_plan$countries = plan.countries) === null || _plan$countries === void 0 ? void 0 : _plan$countries.includes(userCountry);
|
|
13985
|
+
return plan.countries && ((_plan$countries = plan.countries) === null || _plan$countries === void 0 ? void 0 : _plan$countries.includes(userCountry)) || !plan.countries || !plan.countries.length;
|
|
14015
13986
|
});
|
|
14016
13987
|
if (filteredPlans.length) return filteredPlans;
|
|
14017
|
-
})
|
|
13988
|
+
});
|
|
14018
13989
|
notifyBugsnag(() => {
|
|
14019
13990
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14020
|
-
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _this$props, _window$Pelcro9, _window$Pelcro9$helpe
|
|
13991
|
+
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _this$props, _window$Pelcro9, _window$Pelcro9$helpe;
|
|
14021
13992
|
event.addMetadata("MetaData", {
|
|
14022
13993
|
site: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read(),
|
|
14023
13994
|
user: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : _window$Pelcro6$user.read(),
|
|
@@ -14034,12 +14005,9 @@ class SelectModal extends Component {
|
|
|
14034
14005
|
userCountry: userCountry,
|
|
14035
14006
|
userLanguage: userLanguage,
|
|
14036
14007
|
siteLanguage: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : (_window$Pelcro9$helpe = _window$Pelcro9.helpers) === null || _window$Pelcro9$helpe === void 0 ? void 0 : _window$Pelcro9$helpe.getHtmlLanguageAttribute(),
|
|
14037
|
-
currency_mismatch:
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
}).length) === 0,
|
|
14041
|
-
country_restrictions: currencyMismatch,
|
|
14042
|
-
language_mismatch: ((_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : (_window$Pelcro11$site = _window$Pelcro11.site) === null || _window$Pelcro11$site === void 0 ? void 0 : _window$Pelcro11$site.read().products.filter(product => product.language === userLanguage).length) === 0
|
|
14008
|
+
currency_mismatch: productsMatchingUserCurrency.length === 0,
|
|
14009
|
+
country_restrictions: productsMatchingUserCountry.length === 0,
|
|
14010
|
+
language_mismatch: productsMatchingUserCountry.filter(product => product.plans.length).filter(productMatchPageLanguage).length === 0
|
|
14043
14011
|
});
|
|
14044
14012
|
});
|
|
14045
14013
|
});
|
|
@@ -16805,7 +16773,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16805
16773
|
const tapInstanceRef = React__default.useRef(null);
|
|
16806
16774
|
const tapInstanceCard = React__default.useRef(null);
|
|
16807
16775
|
useEffect(() => {
|
|
16808
|
-
if (skipPayment && (
|
|
16776
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16809
16777
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
16810
16778
|
var _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
16811
16779
|
const payPageId = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.pay_page_id;
|
|
@@ -16834,7 +16802,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16834
16802
|
}, [selectedPaymentMethodId]);
|
|
16835
16803
|
useEffect(() => {
|
|
16836
16804
|
whenUserReady(() => {
|
|
16837
|
-
if (skipPayment && (
|
|
16805
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16838
16806
|
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
16839
16807
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
16840
16808
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -16848,7 +16816,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16848
16816
|
});
|
|
16849
16817
|
}, [selectedPaymentMethodId]);
|
|
16850
16818
|
const initPaymentRequest = (state, dispatch) => {
|
|
16851
|
-
if (skipPayment && (
|
|
16819
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16852
16820
|
try {
|
|
16853
16821
|
const paymentRequest = stripe.paymentRequest({
|
|
16854
16822
|
country: window.Pelcro.user.location.countryCode || "US",
|
|
@@ -16917,7 +16885,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16917
16885
|
*/
|
|
16918
16886
|
const updateTotalAmountWithTax = () => {
|
|
16919
16887
|
var _window$Pelcro$site$r4;
|
|
16920
|
-
if (skipPayment && (
|
|
16888
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) return;
|
|
16921
16889
|
const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
|
|
16922
16890
|
if (taxesEnabled && type === "createPayment") {
|
|
16923
16891
|
dispatch({
|
|
@@ -17512,29 +17480,6 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17512
17480
|
});
|
|
17513
17481
|
};
|
|
17514
17482
|
const submitPayment = (state, dispatch) => {
|
|
17515
|
-
if (skipPayment && (order === null || order === void 0 ? void 0 : order.price) === 0) {
|
|
17516
|
-
const isQuickPurchase = !Array.isArray(order);
|
|
17517
|
-
const mappedOrderItems = isQuickPurchase ? [{
|
|
17518
|
-
sku_id: order.id,
|
|
17519
|
-
quantity: order.quantity
|
|
17520
|
-
}] : order.map(item => ({
|
|
17521
|
-
sku_id: item.id,
|
|
17522
|
-
quantity: item.quantity
|
|
17523
|
-
}));
|
|
17524
|
-
window.Pelcro.ecommerce.order.create({
|
|
17525
|
-
items: mappedOrderItems,
|
|
17526
|
-
campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
|
|
17527
|
-
...(selectedAddressId && {
|
|
17528
|
-
address_id: selectedAddressId
|
|
17529
|
-
})
|
|
17530
|
-
}, (err, res) => {
|
|
17531
|
-
if (err) {
|
|
17532
|
-
return handlePaymentError(err);
|
|
17533
|
-
}
|
|
17534
|
-
return onSuccess(res);
|
|
17535
|
-
});
|
|
17536
|
-
return;
|
|
17537
|
-
}
|
|
17538
17483
|
stripe.createSource({
|
|
17539
17484
|
type: "card"
|
|
17540
17485
|
}).then(_ref8 => {
|
|
@@ -17896,14 +17841,10 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17896
17841
|
state,
|
|
17897
17842
|
dispatch
|
|
17898
17843
|
}
|
|
17899
|
-
}, children.length ? children.map((child, i) => {
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
|
|
17903
|
-
key: i
|
|
17904
|
-
});
|
|
17905
|
-
}
|
|
17906
|
-
}) : /*#__PURE__*/React__default.cloneElement(children, {
|
|
17844
|
+
}, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
|
|
17845
|
+
store: store$k,
|
|
17846
|
+
key: i
|
|
17847
|
+
})) : /*#__PURE__*/React__default.cloneElement(children, {
|
|
17907
17848
|
store: store$k
|
|
17908
17849
|
})));
|
|
17909
17850
|
};
|
|
@@ -18725,42 +18666,6 @@ const SubscriptionCreateFreePlanButton = _ref => {
|
|
|
18725
18666
|
}, otherProps), t("buttons.subscribe"));
|
|
18726
18667
|
};
|
|
18727
18668
|
|
|
18728
|
-
const OrderCreateFreeButton = _ref => {
|
|
18729
|
-
let {
|
|
18730
|
-
name,
|
|
18731
|
-
onClick,
|
|
18732
|
-
...otherProps
|
|
18733
|
-
} = _ref;
|
|
18734
|
-
const {
|
|
18735
|
-
state: {
|
|
18736
|
-
disableSubmit
|
|
18737
|
-
},
|
|
18738
|
-
dispatch
|
|
18739
|
-
} = useContext(store$k);
|
|
18740
|
-
const {
|
|
18741
|
-
t
|
|
18742
|
-
} = useTranslation("checkoutForm");
|
|
18743
|
-
const [isDisabled, setDisabled] = useState(true);
|
|
18744
|
-
useEffect(() => {
|
|
18745
|
-
setDisabled(disableSubmit);
|
|
18746
|
-
}, [disableSubmit]);
|
|
18747
|
-
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
18748
|
-
className: "plc-w-full",
|
|
18749
|
-
onClick: () => {
|
|
18750
|
-
dispatch({
|
|
18751
|
-
type: DISABLE_SUBMIT,
|
|
18752
|
-
payload: true
|
|
18753
|
-
});
|
|
18754
|
-
dispatch({
|
|
18755
|
-
type: SUBMIT_PAYMENT
|
|
18756
|
-
});
|
|
18757
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
18758
|
-
},
|
|
18759
|
-
disabled: isDisabled,
|
|
18760
|
-
isLoading: disableSubmit
|
|
18761
|
-
}, otherProps), t("labels.submit"));
|
|
18762
|
-
};
|
|
18763
|
-
|
|
18764
18669
|
/**
|
|
18765
18670
|
*
|
|
18766
18671
|
*/
|
|
@@ -18773,8 +18678,7 @@ function PaymentMethodView(_ref) {
|
|
|
18773
18678
|
type,
|
|
18774
18679
|
showCoupon,
|
|
18775
18680
|
showExternalPaymentMethods,
|
|
18776
|
-
showSubscriptionButton
|
|
18777
|
-
showOrderButton
|
|
18681
|
+
showSubscriptionButton
|
|
18778
18682
|
} = _ref;
|
|
18779
18683
|
const {
|
|
18780
18684
|
t
|
|
@@ -18787,7 +18691,7 @@ function PaymentMethodView(_ref) {
|
|
|
18787
18691
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
18788
18692
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
18789
18693
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
|
|
18790
|
-
}, cardProcessor === "stripe" && !showSubscriptionButton &&
|
|
18694
|
+
}, cardProcessor === "stripe" && !showSubscriptionButton && /*#__PURE__*/React__default.createElement("div", {
|
|
18791
18695
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
|
|
18792
18696
|
}, /*#__PURE__*/React__default.createElement(SvgLock, {
|
|
18793
18697
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -18806,7 +18710,7 @@ function PaymentMethodView(_ref) {
|
|
|
18806
18710
|
onFailure: onFailure
|
|
18807
18711
|
}, /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
18808
18712
|
className: "plc-mb-2"
|
|
18809
|
-
}), showSubscriptionButton
|
|
18713
|
+
}), showSubscriptionButton ? /*#__PURE__*/React__default.createElement(SubscriptionCreateFreePlanButton, null) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(BankRedirection, null), /*#__PURE__*/React__default.createElement(BankAuthenticationSuccess, null), /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
18810
18714
|
className: "plc-flex plc-items-start"
|
|
18811
18715
|
}, /*#__PURE__*/React__default.createElement(IncludeFirstName, {
|
|
18812
18716
|
id: "pelcro-input-first-name",
|
|
@@ -20597,32 +20501,27 @@ function SubscriptionManageMembersList(props) {
|
|
|
20597
20501
|
type: HANDLE_REMOVE_MEMBER
|
|
20598
20502
|
});
|
|
20599
20503
|
};
|
|
20600
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, members === null || members === void 0 ? void 0 : members.map(member => {
|
|
20601
|
-
|
|
20602
|
-
|
|
20603
|
-
|
|
20604
|
-
|
|
20605
|
-
|
|
20606
|
-
|
|
20607
|
-
|
|
20608
|
-
|
|
20609
|
-
|
|
20610
|
-
|
|
20611
|
-
|
|
20612
|
-
|
|
20613
|
-
|
|
20614
|
-
|
|
20615
|
-
|
|
20616
|
-
|
|
20617
|
-
|
|
20618
|
-
|
|
20619
|
-
|
|
20620
|
-
|
|
20621
|
-
disabled: member.id === removeMemberId,
|
|
20622
|
-
isLoading: member.id === removeMemberId,
|
|
20623
|
-
"data-key": member.id
|
|
20624
|
-
}, t("labels.remove"))));
|
|
20625
|
-
}));
|
|
20504
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, members === null || members === void 0 ? void 0 : members.map(member => /*#__PURE__*/React__default.createElement("tr", {
|
|
20505
|
+
key: member.id,
|
|
20506
|
+
className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50 plc-text-center`
|
|
20507
|
+
}, /*#__PURE__*/React__default.createElement("td", {
|
|
20508
|
+
className: "plc-truncate plc-text-left",
|
|
20509
|
+
title: member === null || member === void 0 ? void 0 : member.invitation_email
|
|
20510
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
20511
|
+
className: "plc-font-semibold plc-text-gray-500"
|
|
20512
|
+
}, member === null || member === void 0 ? void 0 : member.invitation_email)), /*#__PURE__*/React__default.createElement("td", {
|
|
20513
|
+
className: "plc-py-2"
|
|
20514
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
20515
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getMemberStatus(member).bgColor} plc-uppercase ${getMemberStatus(member).textColor} plc-rounded-lg`
|
|
20516
|
+
}, getMemberStatus(member).icon, getMemberStatus(member).title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
|
|
20517
|
+
variant: "ghost",
|
|
20518
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
20519
|
+
icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
|
|
20520
|
+
onClick: () => onRemoveClick(member.id),
|
|
20521
|
+
disabled: member.id === removeMemberId,
|
|
20522
|
+
isLoading: member.id === removeMemberId,
|
|
20523
|
+
"data-key": member.id
|
|
20524
|
+
}, t("labels.remove"))))));
|
|
20626
20525
|
}
|
|
20627
20526
|
|
|
20628
20527
|
/**
|
|
@@ -24216,15 +24115,9 @@ const OrderCreateContainer = props => /*#__PURE__*/React__default.createElement(
|
|
|
24216
24115
|
}, props));
|
|
24217
24116
|
|
|
24218
24117
|
const OrderCreateView = props => {
|
|
24219
|
-
var _window$Pelcro, _window$Pelcro$uiSett;
|
|
24220
24118
|
const {
|
|
24221
24119
|
t
|
|
24222
24120
|
} = useTranslation("payment");
|
|
24223
|
-
const {
|
|
24224
|
-
order
|
|
24225
|
-
} = usePelcro();
|
|
24226
|
-
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;
|
|
24227
|
-
const showOrderButton = skipPayment && (order === null || order === void 0 ? void 0 : order.price) === 0;
|
|
24228
24121
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
24229
24122
|
id: "pelcro-order-create-view"
|
|
24230
24123
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -24235,8 +24128,7 @@ const OrderCreateView = props => {
|
|
|
24235
24128
|
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
|
|
24236
24129
|
type: "orderCreate",
|
|
24237
24130
|
showCoupon: true,
|
|
24238
|
-
showExternalPaymentMethods: false
|
|
24239
|
-
showOrderButton: showOrderButton
|
|
24131
|
+
showExternalPaymentMethods: false
|
|
24240
24132
|
}, props))));
|
|
24241
24133
|
};
|
|
24242
24134
|
|
|
@@ -25444,12 +25336,11 @@ const PaymentMethodSelectModal = _ref => {
|
|
|
25444
25336
|
const {
|
|
25445
25337
|
switchToCheckoutForm,
|
|
25446
25338
|
set,
|
|
25447
|
-
plan
|
|
25448
|
-
order
|
|
25339
|
+
plan
|
|
25449
25340
|
} = usePelcro();
|
|
25450
25341
|
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;
|
|
25451
25342
|
useEffect(() => {
|
|
25452
|
-
if (skipPayment && (
|
|
25343
|
+
if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) {
|
|
25453
25344
|
switchToCheckoutForm();
|
|
25454
25345
|
}
|
|
25455
25346
|
}, []);
|
|
@@ -32154,4 +32045,4 @@ const QrCodeModal = _ref => {
|
|
|
32154
32045
|
};
|
|
32155
32046
|
QrCodeModal.viewId = "qrcode";
|
|
32156
32047
|
|
|
32157
|
-
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, BankAuthenticationSuccess, 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, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer,
|
|
32048
|
+
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, BankAuthenticationSuccess, 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, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, 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, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify$1 as notify, unauthenticatedButtons, usePelcro };
|