@pelcro/react-pelcro-js 3.13.0-beta.14 → 3.13.0-beta.16

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.esm.js CHANGED
@@ -8283,7 +8283,7 @@ class PelcroActions {
8283
8283
  return console.error("invalid subscription id");
8284
8284
  }
8285
8285
 
8286
- if ((subscriptionToManageMembers === null || subscriptionToManageMembers === void 0 ? void 0 : (_subscriptionToManage = subscriptionToManageMembers.plan) === null || _subscriptionToManage === void 0 ? void 0 : _subscriptionToManage.type) !== 'membership') {
8286
+ if ((subscriptionToManageMembers === null || subscriptionToManageMembers === void 0 ? void 0 : (_subscriptionToManage = subscriptionToManageMembers.plan) === null || _subscriptionToManage === void 0 ? void 0 : _subscriptionToManage.type) !== "membership") {
8287
8287
  return console.error("subscription is not from type membership");
8288
8288
  }
8289
8289
 
@@ -8583,7 +8583,7 @@ const createPelcroHook = store => {
8583
8583
 
8584
8584
  pelcroHook.override = fn => {
8585
8585
  const partialState = fn(store.setState, store.getState);
8586
- usePelcro.setState(partialState);
8586
+ usePelcro$1.setState(partialState);
8587
8587
  };
8588
8588
 
8589
8589
  pelcroHook.getStore = pelcroHook.getState;
@@ -8591,11 +8591,11 @@ const createPelcroHook = store => {
8591
8591
  };
8592
8592
 
8593
8593
  const pelcroStore = createPelcroStore();
8594
- const usePelcro = createPelcroHook(pelcroStore);
8594
+ const usePelcro$1 = createPelcroHook(pelcroStore);
8595
8595
  /* istanbul ignore next */
8596
8596
 
8597
8597
  if (process.env.NODE_ENV === "development") {
8598
- c$1("Pelcro Store", usePelcro);
8598
+ c$1("Pelcro Store", usePelcro$1);
8599
8599
  }
8600
8600
 
8601
8601
  /**
@@ -8800,7 +8800,7 @@ const trackSubscriptionOnGA = () => {
8800
8800
  product,
8801
8801
  plan,
8802
8802
  couponCode
8803
- } = usePelcro.getStore();
8803
+ } = usePelcro$1.getStore();
8804
8804
  /*
8805
8805
  getting the latest subscription id from invoices instead of subscriptions
8806
8806
  to handle gifted subs which are not added to subs list
@@ -9120,7 +9120,7 @@ class SaveToMetadataButtonClass {
9120
9120
  _defineProperty$3(this, "unauthenticated", () => {
9121
9121
  const {
9122
9122
  switchView
9123
- } = usePelcro.getStore();
9123
+ } = usePelcro$1.getStore();
9124
9124
 
9125
9125
  _classPrivateFieldGet(this, _onClick).call(this, () => switchView("login"));
9126
9126
 
@@ -9203,7 +9203,7 @@ class SaveToMetadataButtonClass {
9203
9203
  const user = window.Pelcro.user.read();
9204
9204
  const {
9205
9205
  switchView
9206
- } = usePelcro.getStore();
9206
+ } = usePelcro$1.getStore();
9207
9207
  const {
9208
9208
  key,
9209
9209
  ...buttonMetadata
@@ -10339,7 +10339,7 @@ const init$1 = () => {
10339
10339
  addToCart,
10340
10340
  purchaseItem,
10341
10341
  setSubscriptionToManageMembers
10342
- } = usePelcro.getStore();
10342
+ } = usePelcro$1.getStore();
10343
10343
  const pelcroDashboardButtonsByClass = document.getElementsByClassName("pelcro-dashboard-button");
10344
10344
 
10345
10345
  if (pelcroDashboardButtonsByClass.length !== 0) {
@@ -10642,7 +10642,7 @@ const init = () => {
10642
10642
  const {
10643
10643
  switchView,
10644
10644
  set
10645
- } = usePelcro.getStore();
10645
+ } = usePelcro$1.getStore();
10646
10646
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
10647
10647
 
10648
10648
  if (entitlementsProtectedElements.length === 0) {
@@ -10731,7 +10731,7 @@ function unblurElemWhenUserSubscribes(elem, entitlements) {
10731
10731
  document.addEventListener("PelcroSubscriptionCreate", event => {
10732
10732
  const {
10733
10733
  isGift
10734
- } = usePelcro.getStore();
10734
+ } = usePelcro$1.getStore();
10735
10735
  if (isGift) return;
10736
10736
  const latestSub = event.detail.data.subscriptions[event.detail.data.subscriptions.length - 1];
10737
10737
  const shouldUnblurContent = entitlements.some(ent => {
@@ -11053,7 +11053,7 @@ const initPaywalls = () => {
11053
11053
 
11054
11054
  const {
11055
11055
  switchView
11056
- } = usePelcro.getStore();
11056
+ } = usePelcro$1.getStore();
11057
11057
 
11058
11058
  if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayMeterPaywall()) {
11059
11059
  /*
@@ -11075,7 +11075,7 @@ const loadPaymentSDKs = () => {
11075
11075
  // Lazy load stripe's SDK
11076
11076
  const {
11077
11077
  whenUserReady
11078
- } = usePelcro.getStore();
11078
+ } = usePelcro$1.getStore();
11079
11079
  whenUserReady(() => {
11080
11080
  if (!window.Stripe) {
11081
11081
  pure_1(window.Pelcro.environment.stripe);
@@ -11123,7 +11123,7 @@ const loadAuth0SDK = () => {
11123
11123
  const initSecuritySdk = () => {
11124
11124
  const {
11125
11125
  whenSiteReady
11126
- } = usePelcro.getStore();
11126
+ } = usePelcro$1.getStore();
11127
11127
  whenSiteReady(() => {
11128
11128
  var _window$Pelcro$site$r2;
11129
11129
 
@@ -11159,7 +11159,7 @@ const dispatchModalDisplayEvents = modalName => {
11159
11159
  const {
11160
11160
  whenSiteReady,
11161
11161
  whenEcommerceLoaded
11162
- } = usePelcro.getStore();
11162
+ } = usePelcro$1.getStore();
11163
11163
  const renderShopView = shopComponent => {
11164
11164
  whenEcommerceLoaded(() => {
11165
11165
  const shopElement = document.getElementById("pelcro-shop");
@@ -11241,7 +11241,7 @@ const initViewFromURL = () => {
11241
11241
  const {
11242
11242
  switchView,
11243
11243
  whenSiteReady
11244
- } = usePelcro.getStore();
11244
+ } = usePelcro$1.getStore();
11245
11245
 
11246
11246
  if (isValidViewFromURL(view)) {
11247
11247
  whenSiteReady(() => {
@@ -11299,7 +11299,7 @@ const initSubscriptionFromURL = () => {
11299
11299
  switchView,
11300
11300
  whenSiteReady,
11301
11301
  set
11302
- } = usePelcro.getStore();
11302
+ } = usePelcro$1.getStore();
11303
11303
  whenSiteReady(() => {
11304
11304
  var _selectedProduct$plan;
11305
11305
 
@@ -11323,7 +11323,7 @@ const initSubscriptionFromURL = () => {
11323
11323
  isAuthenticated,
11324
11324
  switchToAddressView,
11325
11325
  switchToPaymentView
11326
- } = usePelcro.getStore();
11326
+ } = usePelcro$1.getStore();
11327
11327
 
11328
11328
  if (!isAuthenticated()) {
11329
11329
  return switchView("register");
@@ -11355,7 +11355,7 @@ const initOfflineSubscriptionFromURL = offlinePlanId => {
11355
11355
  switchToPaymentView,
11356
11356
  switchToAddressView,
11357
11357
  set
11358
- } = usePelcro.getStore();
11358
+ } = usePelcro$1.getStore();
11359
11359
  whenSiteReady(() => {
11360
11360
  window.Pelcro.plan.getPlan({
11361
11361
  plan_id: offlinePlanId
@@ -11402,7 +11402,7 @@ const initPurchaseFromUrl = () => {
11402
11402
  const {
11403
11403
  whenEcommerceLoaded,
11404
11404
  purchaseItem
11405
- } = usePelcro.getStore();
11405
+ } = usePelcro$1.getStore();
11406
11406
  whenEcommerceLoaded(() => {
11407
11407
  const skuId = window.Pelcro.helpers.getURLParameter("sku_id");
11408
11408
  purchaseItem(skuId);
@@ -11418,7 +11418,7 @@ const initCartFromUrl = () => {
11418
11418
  whenEcommerceLoaded,
11419
11419
  addToCart,
11420
11420
  switchView
11421
- } = usePelcro.getStore();
11421
+ } = usePelcro$1.getStore();
11422
11422
  whenEcommerceLoaded(() => {
11423
11423
  const skusIdsParam = window.Pelcro.helpers.getURLParameter("sku_id");
11424
11424
  const skusIds = skusIdsParam === null || skusIdsParam === void 0 ? void 0 : skusIdsParam.split(",");
@@ -11439,7 +11439,7 @@ const verifyEmailTokenFromUrl = () => {
11439
11439
 
11440
11440
  const {
11441
11441
  whenSiteReady
11442
- } = usePelcro.getStore();
11442
+ } = usePelcro$1.getStore();
11443
11443
  const translations = i18next.t("verifyEmail:messages", {
11444
11444
  returnObjects: true
11445
11445
  });
@@ -11468,7 +11468,7 @@ const verifyLinkTokenFromUrl = () => {
11468
11468
  whenSiteReady,
11469
11469
  resetView,
11470
11470
  isAuthenticated
11471
- } = usePelcro.getStore();
11471
+ } = usePelcro$1.getStore();
11472
11472
  const translations = i18next.t("verifyLinkToken:messages", {
11473
11473
  returnObjects: true
11474
11474
  });
@@ -11507,12 +11507,12 @@ const showPasswordlessRequestFromUrl = () => {
11507
11507
 
11508
11508
  const {
11509
11509
  isAuthenticated
11510
- } = usePelcro.getStore();
11510
+ } = usePelcro$1.getStore();
11511
11511
  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;
11512
11512
  if (!passwordlessEnabled || isAuthenticated()) return;
11513
11513
  const {
11514
11514
  switchView
11515
- } = usePelcro.getStore();
11515
+ } = usePelcro$1.getStore();
11516
11516
  return switchView("passwordless-request");
11517
11517
  };
11518
11518
 
@@ -11523,7 +11523,7 @@ const showInvoiceDetailsFromUrl = () => {
11523
11523
  whenUserReady,
11524
11524
  whenSiteReady,
11525
11525
  switchView
11526
- } = usePelcro.getStore();
11526
+ } = usePelcro$1.getStore();
11527
11527
  whenSiteReady(() => {
11528
11528
  if (!isAuthenticated()) {
11529
11529
  return switchView("login");
@@ -11542,7 +11542,7 @@ const showInvoiceDetailsFromUrl = () => {
11542
11542
 
11543
11543
  const {
11544
11544
  invoice
11545
- } = usePelcro.getStore();
11545
+ } = usePelcro$1.getStore();
11546
11546
 
11547
11547
  if (invoice.total === 0) {
11548
11548
  const errorMessage = i18next.t("messages:zeroTotalInvoice", {
@@ -11563,7 +11563,7 @@ const showSubscriptionManageMembersFromUrl = () => {
11563
11563
  whenUserReady,
11564
11564
  whenSiteReady,
11565
11565
  switchView
11566
- } = usePelcro.getStore();
11566
+ } = usePelcro$1.getStore();
11567
11567
  whenSiteReady(() => {
11568
11568
  if (!isAuthenticated()) {
11569
11569
  return switchView("login");
@@ -11603,7 +11603,7 @@ const PelcroModalController = ({
11603
11603
  view,
11604
11604
  isAuthenticated,
11605
11605
  whenSiteReady
11606
- } = usePelcro();
11606
+ } = usePelcro$1();
11607
11607
  React__default.useEffect(() => {
11608
11608
  init$1();
11609
11609
  renderShopView(React__default.Children.map(children, child => child).find(({
@@ -13364,7 +13364,7 @@ function Modal({
13364
13364
  }) {
13365
13365
  var _window$Pelcro, _window$Pelcro$site$r;
13366
13366
 
13367
- const resetView = usePelcro(state => state.resetView);
13367
+ const resetView = usePelcro$1(state => state.resetView);
13368
13368
  useEffect(() => {
13369
13369
  onDisplay === null || onDisplay === void 0 ? void 0 : onDisplay();
13370
13370
  dispatchModalDisplayEvents(id);
@@ -13437,8 +13437,11 @@ function LoginModal({
13437
13437
  const {
13438
13438
  switchView,
13439
13439
  resetView,
13440
- invoice
13441
- } = usePelcro();
13440
+ product,
13441
+ plan,
13442
+ switchToAddressView,
13443
+ switchToPaymentView
13444
+ } = usePelcro$1();
13442
13445
 
13443
13446
  const onSuccess = res => {
13444
13447
  var _props$onSuccess;
@@ -13449,10 +13452,18 @@ function LoginModal({
13449
13452
  initPaywalls();
13450
13453
  }
13451
13454
 
13455
+ if (product && plan) {
13456
+ if (product.address_required) {
13457
+ return switchToAddressView();
13458
+ } else {
13459
+ return switchToPaymentView();
13460
+ }
13461
+ }
13462
+
13452
13463
  resetView();
13453
13464
  const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
13454
13465
 
13455
- if (viewFromURL === "invoice-details") {
13466
+ if (viewFromURL === "invoice-details" || viewFromURL === "gift-redeem") {
13456
13467
  initViewFromURL();
13457
13468
  }
13458
13469
  };
@@ -13775,7 +13786,7 @@ function RegisterView(props) {
13775
13786
  } = useTranslation("register");
13776
13787
  const {
13777
13788
  product
13778
- } = usePelcro();
13789
+ } = usePelcro$1();
13779
13790
  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");
13780
13791
  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");
13781
13792
  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);
@@ -14006,7 +14017,7 @@ function RegisterModal(props) {
14006
14017
  order,
14007
14018
  giftCode,
14008
14019
  isGift
14009
- } = usePelcro();
14020
+ } = usePelcro$1();
14010
14021
 
14011
14022
  const onSuccess = res => {
14012
14023
  var _props$onSuccess;
@@ -14036,7 +14047,7 @@ function RegisterModal(props) {
14036
14047
 
14037
14048
 
14038
14049
  if (giftCode) {
14039
- return switchToAddressView();
14050
+ return switchView("gift-redeem"); // return switchToAddressView();
14040
14051
  } // Check if the subscription is meant as a gift (if so, gather recipients info)
14041
14052
 
14042
14053
 
@@ -14128,7 +14139,7 @@ function SelectModalWithHook(props) {
14128
14139
  resetView,
14129
14140
  view,
14130
14141
  set
14131
- } = usePelcro();
14142
+ } = usePelcro$1();
14132
14143
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
14133
14144
  const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
14134
14145
  return /*#__PURE__*/React__default.createElement(SelectModalWithTrans, {
@@ -14400,7 +14411,7 @@ class SelectModal extends Component {
14400
14411
  const {
14401
14412
  switchToAddressView,
14402
14413
  switchToPaymentView
14403
- } = usePelcro.getStore();
14414
+ } = usePelcro$1.getStore();
14404
14415
 
14405
14416
  if (!isAuthenticated) {
14406
14417
  return setView("register");
@@ -16603,16 +16614,16 @@ const PaymentMethodContainerWithoutStripe = ({
16603
16614
  const {
16604
16615
  t
16605
16616
  } = useTranslation("payment");
16606
- const pelcroStore = usePelcro();
16617
+ const pelcroStore = usePelcro$1();
16607
16618
  const {
16608
16619
  set,
16609
16620
  order,
16610
16621
  selectedPaymentMethodId,
16611
16622
  couponCode
16612
- } = usePelcro();
16623
+ } = usePelcro$1();
16613
16624
  const {
16614
16625
  whenUserReady
16615
- } = usePelcro.getStore();
16626
+ } = usePelcro$1.getStore();
16616
16627
  const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
16617
16628
  const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
16618
16629
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
@@ -18292,7 +18303,7 @@ const PaymentMethodContainer = props => {
18292
18303
  const [isStripeLoaded, setIsStripeLoaded] = useState(Boolean(window.Stripe));
18293
18304
  const {
18294
18305
  whenUserReady
18295
- } = usePelcro.getStore();
18306
+ } = usePelcro$1.getStore();
18296
18307
  useEffect(() => {
18297
18308
  whenUserReady(() => {
18298
18309
  if (!window.Stripe) {
@@ -18393,7 +18404,7 @@ const PelcroPaymentRequestButton = props => {
18393
18404
  const CheckoutForm = () => {
18394
18405
  const {
18395
18406
  selectedPaymentMethodId
18396
- } = usePelcro();
18407
+ } = usePelcro$1();
18397
18408
  const cardProcessor = getSiteCardProcessor();
18398
18409
 
18399
18410
  if (selectedPaymentMethodId) {
@@ -18448,7 +18459,7 @@ const DiscountedPrice = props => {
18448
18459
  const {
18449
18460
  order,
18450
18461
  plan
18451
- } = usePelcro();
18462
+ } = usePelcro$1();
18452
18463
  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;
18453
18464
  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;
18454
18465
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
@@ -18484,7 +18495,7 @@ const SubmitPaymentMethod = ({
18484
18495
 
18485
18496
  const {
18486
18497
  plan
18487
- } = usePelcro();
18498
+ } = usePelcro$1();
18488
18499
  const {
18489
18500
  t
18490
18501
  } = useTranslation("checkoutForm");
@@ -18916,7 +18927,7 @@ const PaypalSubscribeButton = props => {
18916
18927
  plan,
18917
18928
  invoice,
18918
18929
  selectedAddressId
18919
- } = usePelcro();
18930
+ } = usePelcro$1();
18920
18931
  useEffect(() => {
18921
18932
  var _ref, _ref2, _state$updatedPrice, _props$plan, _props$selectedAddres;
18922
18933
 
@@ -19058,7 +19069,7 @@ const SelectedPaymentMethod = () => {
19058
19069
  const {
19059
19070
  switchView,
19060
19071
  selectedPaymentMethodId
19061
- } = usePelcro();
19072
+ } = usePelcro$1();
19062
19073
  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 => {
19063
19074
  return source.id == selectedPaymentMethodId;
19064
19075
  });
@@ -19099,7 +19110,7 @@ const TaxAmount = () => {
19099
19110
  } = useContext(store$k);
19100
19111
  const {
19101
19112
  plan
19102
- } = usePelcro();
19113
+ } = usePelcro$1();
19103
19114
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
19104
19115
  const priceFormatted = getFormattedPriceByLocal(taxAmount * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
19105
19116
  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;
@@ -19245,7 +19256,7 @@ const SubscriptionRenewView = ({
19245
19256
  const {
19246
19257
  product,
19247
19258
  plan
19248
- } = usePelcro();
19259
+ } = usePelcro$1();
19249
19260
  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;
19250
19261
  const showSubscriptionButton = skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0;
19251
19262
 
@@ -19300,7 +19311,7 @@ function SubscriptionRenewModal({
19300
19311
  }) {
19301
19312
  const {
19302
19313
  switchView
19303
- } = usePelcro();
19314
+ } = usePelcro$1();
19304
19315
 
19305
19316
  const onSuccess = res => {
19306
19317
  var _otherProps$onSuccess, _ReactGA$event;
@@ -19505,7 +19516,7 @@ const SubscriptionCancelNowButton = ({
19505
19516
  }) => {
19506
19517
  const {
19507
19518
  switchView
19508
- } = usePelcro();
19519
+ } = usePelcro$1();
19509
19520
  const {
19510
19521
  state: {
19511
19522
  cancelationReason
@@ -19577,7 +19588,7 @@ const SubscriptionCancelLaterButton = ({
19577
19588
  }) => {
19578
19589
  const {
19579
19590
  switchView
19580
- } = usePelcro();
19591
+ } = usePelcro$1();
19581
19592
  const {
19582
19593
  state: {
19583
19594
  cancelationReason
@@ -19645,7 +19656,7 @@ const SubscriptionCancelLaterButton = ({
19645
19656
  const SubscriptionCancelView = props => {
19646
19657
  const {
19647
19658
  subscriptionToCancel
19648
- } = usePelcro();
19659
+ } = usePelcro$1();
19649
19660
  const {
19650
19661
  t
19651
19662
  } = useTranslation("subscriptionCancel");
@@ -19819,7 +19830,7 @@ const SubscriptionSuspendButton = ({
19819
19830
  }) => {
19820
19831
  const {
19821
19832
  switchView
19822
- } = usePelcro();
19833
+ } = usePelcro$1();
19823
19834
  const {
19824
19835
  state: {
19825
19836
  suspendDate,
@@ -19883,7 +19894,7 @@ const SubscriptionSuspendButton = ({
19883
19894
  const SubscriptionSuspendView = props => {
19884
19895
  const {
19885
19896
  subscriptionToSuspend
19886
- } = usePelcro();
19897
+ } = usePelcro$1();
19887
19898
  const {
19888
19899
  t
19889
19900
  } = useTranslation("subscriptionSuspend");
@@ -19976,7 +19987,7 @@ const getCurrentFlow = () => {
19976
19987
  giftRecipient,
19977
19988
  giftCode,
19978
19989
  invoice
19979
- } = usePelcro.getStore();
19990
+ } = usePelcro$1.getStore();
19980
19991
 
19981
19992
  if (invoice) {
19982
19993
  return "invoicePayment";
@@ -19995,7 +20006,7 @@ const getSuccessContent = i18n => {
19995
20006
  const flow = getCurrentFlow();
19996
20007
  const {
19997
20008
  product
19998
- } = usePelcro.getStore();
20009
+ } = usePelcro$1.getStore();
19999
20010
  const wordingDictionary = {
20000
20011
  subscriptionSuccess: {
20001
20012
  successIcon: /*#__PURE__*/React__default.createElement(SvgCheckSolid, {
@@ -20039,7 +20050,7 @@ function PaymentSuccessModal({
20039
20050
  }) {
20040
20051
  const {
20041
20052
  resetView
20042
- } = usePelcro();
20053
+ } = usePelcro$1();
20043
20054
 
20044
20055
  const onClose = () => {
20045
20056
  var _props$onClose;
@@ -20072,7 +20083,7 @@ function NewsletterWithHook(props) {
20072
20083
  switchView,
20073
20084
  resetView,
20074
20085
  product
20075
- } = usePelcro();
20086
+ } = usePelcro$1();
20076
20087
  return /*#__PURE__*/React__default.createElement(NewsLetter, {
20077
20088
  onClose: () => {
20078
20089
  var _props$onClose;
@@ -20571,7 +20582,7 @@ const MeterView = () => {
20571
20582
  switchView,
20572
20583
  product,
20573
20584
  isAuthenticated
20574
- } = usePelcro();
20585
+ } = usePelcro$1();
20575
20586
  const paywallProduct = product !== null && product !== void 0 ? product : window.Pelcro.paywall.getProduct();
20576
20587
  const visitsLeft = window.Pelcro.paywall.freeVisitsLeft();
20577
20588
  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}`;
@@ -20593,7 +20604,7 @@ const MeterView = () => {
20593
20604
  const MeterModal = props => {
20594
20605
  const {
20595
20606
  resetView
20596
- } = usePelcro();
20607
+ } = usePelcro$1();
20597
20608
  useEffect(() => {
20598
20609
  var _props$onDisplay;
20599
20610
 
@@ -20631,7 +20642,7 @@ const SubscriptionCreateView = ({
20631
20642
  const {
20632
20643
  product,
20633
20644
  plan
20634
- } = usePelcro();
20645
+ } = usePelcro$1();
20635
20646
  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;
20636
20647
  const showSubscriptionButton = skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0;
20637
20648
 
@@ -20689,7 +20700,7 @@ function SubscriptionCreateModal({
20689
20700
  useTranslation("common");
20690
20701
  const {
20691
20702
  switchView
20692
- } = usePelcro();
20703
+ } = usePelcro$1();
20693
20704
 
20694
20705
  const onSuccess = res => {
20695
20706
  var _otherProps$onSuccess;
@@ -20735,7 +20746,7 @@ const SubscriptionManageMembersContainer = ({
20735
20746
  }) => {
20736
20747
  const {
20737
20748
  subscriptionToManageMembers
20738
- } = usePelcro();
20749
+ } = usePelcro$1();
20739
20750
  const subscription_id = subscriptionToManageMembers === null || subscriptionToManageMembers === void 0 ? void 0 : subscriptionToManageMembers.id;
20740
20751
 
20741
20752
  const handleListMembers = ({}, dispatch) => {
@@ -21779,7 +21790,7 @@ function UserUpdateModal({
21779
21790
  }) {
21780
21791
  const {
21781
21792
  switchView
21782
- } = usePelcro();
21793
+ } = usePelcro$1();
21783
21794
 
21784
21795
  const onPictureClick = () => {
21785
21796
  switchView("profile-picture");
@@ -21888,7 +21899,7 @@ const AddressCreateContainer = ({
21888
21899
  order,
21889
21900
  set,
21890
21901
  selectedMembership
21891
- } = usePelcro();
21902
+ } = usePelcro$1();
21892
21903
  const giftCode = (_props$giftCode = props.giftCode) !== null && _props$giftCode !== void 0 ? _props$giftCode : giftCodeFromStore;
21893
21904
  const subscriptionIdToRenew = (_ref = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : subscriptionIdToRenewFromStore) !== null && _ref !== void 0 ? _ref : undefined;
21894
21905
  useEffect(() => {
@@ -22645,7 +22656,7 @@ const AddressCreateModal = ({
22645
22656
  switchView,
22646
22657
  switchToPaymentView,
22647
22658
  resetView
22648
- } = usePelcro();
22659
+ } = usePelcro$1();
22649
22660
 
22650
22661
  const onSuccess = newAddressId => {
22651
22662
  var _otherProps$onSuccess;
@@ -22738,7 +22749,7 @@ const AddressUpdateContainer = ({
22738
22749
 
22739
22750
  const {
22740
22751
  addressIdToEdit
22741
- } = usePelcro();
22752
+ } = usePelcro$1();
22742
22753
  const addressId = (_props$addressId = props === null || props === void 0 ? void 0 : props.addressId) !== null && _props$addressId !== void 0 ? _props$addressId : addressIdToEdit;
22743
22754
  const [t] = useTranslation("address");
22744
22755
  useEffect(() => {
@@ -23829,7 +23840,7 @@ const PasswordForgotModal = ({
23829
23840
  } = useTranslation("passwordForgot");
23830
23841
  const {
23831
23842
  switchView
23832
- } = usePelcro();
23843
+ } = usePelcro$1();
23833
23844
  return /*#__PURE__*/React__default.createElement(Modal, {
23834
23845
  id: "pelcro-password-forgot-modal",
23835
23846
  onDisplay: onDisplay,
@@ -24414,7 +24425,7 @@ const CartContainer = ({
24414
24425
  const {
24415
24426
  cartItems,
24416
24427
  set
24417
- } = usePelcro();
24428
+ } = usePelcro$1();
24418
24429
  const {
24419
24430
  t
24420
24431
  } = useTranslation("shop");
@@ -24519,7 +24530,7 @@ const CartRemoveItemButton = ({
24519
24530
  }) => {
24520
24531
  const {
24521
24532
  removeFromCart
24522
- } = usePelcro();
24533
+ } = usePelcro$1();
24523
24534
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
24524
24535
  variant: "icon",
24525
24536
  "data-key": itemId,
@@ -24582,7 +24593,7 @@ const CartTotalPrice = () => {
24582
24593
  } = useContext(store$8);
24583
24594
  const {
24584
24595
  cartItems
24585
- } = usePelcro();
24596
+ } = usePelcro$1();
24586
24597
  const totalPriceCurrency = cartItems[0].currency;
24587
24598
  const {
24588
24599
  t
@@ -24602,7 +24613,7 @@ const CartTotalPrice = () => {
24602
24613
  const CartView = props => {
24603
24614
  const {
24604
24615
  cartItems
24605
- } = usePelcro();
24616
+ } = usePelcro$1();
24606
24617
  const {
24607
24618
  t
24608
24619
  } = useTranslation("cart");
@@ -24663,7 +24674,7 @@ const CartModal = ({
24663
24674
  switchView,
24664
24675
  switchToAddressView,
24665
24676
  isAuthenticated
24666
- } = usePelcro();
24677
+ } = usePelcro$1();
24667
24678
 
24668
24679
  const onSuccess = items => {
24669
24680
  var _otherProps$onSuccess;
@@ -24695,7 +24706,7 @@ const ShopSelectProductButton = ({
24695
24706
  }) => {
24696
24707
  const {
24697
24708
  addToCart
24698
- } = usePelcro();
24709
+ } = usePelcro$1();
24699
24710
  const {
24700
24711
  t
24701
24712
  } = useTranslation("shop");
@@ -24727,7 +24738,7 @@ const ShopPurchaseButton = ({
24727
24738
  }) => {
24728
24739
  const {
24729
24740
  purchaseItem
24730
- } = usePelcro();
24741
+ } = usePelcro$1();
24731
24742
  const {
24732
24743
  t
24733
24744
  } = useTranslation("shop");
@@ -24803,7 +24814,7 @@ const OrderCreateModal = ({
24803
24814
  }) => {
24804
24815
  const {
24805
24816
  switchView
24806
- } = usePelcro();
24817
+ } = usePelcro$1();
24807
24818
 
24808
24819
  const onSuccess = () => {
24809
24820
  var _otherProps$onSuccess;
@@ -24833,7 +24844,7 @@ const OrderConfirmModal = props => {
24833
24844
  } = useTranslation("shop");
24834
24845
  const {
24835
24846
  resetView
24836
- } = usePelcro();
24847
+ } = usePelcro$1();
24837
24848
 
24838
24849
  const onClose = () => {
24839
24850
  var _props$onClose;
@@ -24925,7 +24936,7 @@ const GiftCreateContainer = ({
24925
24936
  } = useTranslation("register");
24926
24937
  const {
24927
24938
  set
24928
- } = usePelcro();
24939
+ } = usePelcro$1();
24929
24940
 
24930
24941
  const handleSubmit = (state, dispatch) => {
24931
24942
  const giftRecipient = {
@@ -25217,7 +25228,7 @@ const GiftCreateModal = ({
25217
25228
  switchToAddressView,
25218
25229
  switchToPaymentView,
25219
25230
  product
25220
- } = usePelcro();
25231
+ } = usePelcro$1();
25221
25232
 
25222
25233
  const onSuccess = giftRecipient => {
25223
25234
  var _otherProps$onSuccess;
@@ -25245,6 +25256,7 @@ const GiftCreateModal = ({
25245
25256
  GiftCreateModal.viewId = "gift-create";
25246
25257
 
25247
25258
  const initialState$6 = {
25259
+ isSubmitting: false,
25248
25260
  giftCode: "",
25249
25261
  buttonDisabled: true,
25250
25262
  alert: {
@@ -25263,14 +25275,24 @@ const GiftRedeemContainer = ({
25263
25275
  onSuccess = () => {},
25264
25276
  onFailure = () => {},
25265
25277
  onDisplay = () => {},
25266
- children
25278
+ children,
25279
+ ...props
25267
25280
  }) => {
25281
+ var _ref, _props$subscriptionId;
25282
+
25268
25283
  const {
25269
25284
  t
25270
25285
  } = useTranslation("register");
25271
25286
  const {
25272
25287
  set
25273
- } = usePelcro();
25288
+ } = usePelcro$1();
25289
+ const {
25290
+ switchView,
25291
+ switchToAddressView,
25292
+ isAuthenticated,
25293
+ subscriptionIdToRenew: subscriptionIdToRenewFromStore
25294
+ } = usePelcro$1();
25295
+ const subscriptionIdToRenew = (_ref = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : subscriptionIdToRenewFromStore) !== null && _ref !== void 0 ? _ref : undefined;
25274
25296
  useEffect(() => {
25275
25297
  onDisplay();
25276
25298
  }, []);
@@ -25291,7 +25313,41 @@ const GiftRedeemContainer = ({
25291
25313
  set({
25292
25314
  giftCode
25293
25315
  });
25294
- onSuccess(giftCode);
25316
+
25317
+ if (!isAuthenticated()) {
25318
+ switchView("register");
25319
+ } else {
25320
+ console.log("Shaker");
25321
+ window.Pelcro.subscription.redeemGift({
25322
+ auth_token: window.Pelcro.user.read().auth_token,
25323
+ gift_code: giftCode,
25324
+ // redeem gift as a future phase of an existing subscription
25325
+ subscription_id: subscriptionIdToRenew
25326
+ }, (err, res) => {
25327
+ dispatch({
25328
+ type: LOADING,
25329
+ payload: false
25330
+ });
25331
+
25332
+ if (err) {
25333
+ dispatch({
25334
+ type: SHOW_ALERT,
25335
+ payload: {
25336
+ type: "error",
25337
+ content: getErrorMessages(err)
25338
+ }
25339
+ });
25340
+
25341
+ if (getErrorMessages(err) === "Address ID is required") {
25342
+ switchToAddressView();
25343
+ } else {
25344
+ return onFailure(err);
25345
+ }
25346
+ } else {
25347
+ return onSuccess(giftCode);
25348
+ }
25349
+ });
25350
+ }
25295
25351
  }
25296
25352
  };
25297
25353
 
@@ -25312,8 +25368,14 @@ const GiftRedeemContainer = ({
25312
25368
  buttonDisabled: action.payload
25313
25369
  });
25314
25370
 
25371
+ case LOADING:
25372
+ return lib_7({ ...state,
25373
+ isSubmitting: action.payload
25374
+ });
25375
+
25315
25376
  case HANDLE_SUBMIT:
25316
25377
  return lib_5({ ...state,
25378
+ isSubmitting: true,
25317
25379
  buttonDisabled: true
25318
25380
  }, (state, dispatch) => handleRedeem(state, dispatch));
25319
25381
 
@@ -25382,7 +25444,8 @@ const GiftRedeemSubmitButton = ({
25382
25444
  const {
25383
25445
  dispatch,
25384
25446
  state: {
25385
- disableSubmit
25447
+ disableSubmit,
25448
+ isSubmitting
25386
25449
  }
25387
25450
  } = useContext(store$6);
25388
25451
  const {
@@ -25395,7 +25458,8 @@ const GiftRedeemSubmitButton = ({
25395
25458
  });
25396
25459
  onClick === null || onClick === void 0 ? void 0 : onClick();
25397
25460
  },
25398
- disabled: disableSubmit
25461
+ disabled: disableSubmit,
25462
+ isLoading: isSubmitting
25399
25463
  }, otherProps), name !== null && name !== void 0 ? name : t("redeem.buttons.redeem"));
25400
25464
  };
25401
25465
 
@@ -25440,18 +25504,13 @@ const GiftRedeemModal = ({
25440
25504
  switchView,
25441
25505
  switchToAddressView,
25442
25506
  isAuthenticated
25443
- } = usePelcro();
25507
+ } = usePelcro$1();
25444
25508
 
25445
25509
  const onSuccess = giftCode => {
25446
25510
  var _otherProps$onSuccess;
25447
25511
 
25448
25512
  (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, giftCode);
25449
-
25450
- if (isAuthenticated()) {
25451
- switchToAddressView();
25452
- } else {
25453
- switchView("register");
25454
- }
25513
+ switchView("subscription-success");
25455
25514
  };
25456
25515
 
25457
25516
  return /*#__PURE__*/React__default.createElement(Modal, {
@@ -25512,7 +25571,7 @@ const AddressSelectContainer = ({
25512
25571
  subscriptionIdToRenew: subscriptionIdToRenewFromStore,
25513
25572
  set,
25514
25573
  selectedMembership
25515
- } = usePelcro();
25574
+ } = usePelcro$1();
25516
25575
  const giftCode = (_props$giftCode = props.giftCode) !== null && _props$giftCode !== void 0 ? _props$giftCode : giftCodeFromStore;
25517
25576
  const subscriptionIdToRenew = (_ref = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : subscriptionIdToRenewFromStore) !== null && _ref !== void 0 ? _ref : undefined;
25518
25577
 
@@ -25754,7 +25813,7 @@ const AddressSelectModal = ({
25754
25813
  switchView,
25755
25814
  switchToPaymentView,
25756
25815
  resetView
25757
- } = usePelcro();
25816
+ } = usePelcro$1();
25758
25817
 
25759
25818
  const onSuccess = selectedAddressId => {
25760
25819
  var _otherProps$onSuccess;
@@ -25832,7 +25891,7 @@ const PaymentMethodSelectContainer = ({
25832
25891
  const {
25833
25892
  set,
25834
25893
  selectedPaymentMethodId: selectedPaymentMethodIdFromStore
25835
- } = usePelcro();
25894
+ } = usePelcro$1();
25836
25895
 
25837
25896
  const submitPaymentMethod = ({
25838
25897
  selectedPaymentMethodId
@@ -26015,7 +26074,7 @@ const PaymentMethodSelectModal = ({
26015
26074
  switchToCheckoutForm,
26016
26075
  set,
26017
26076
  plan
26018
- } = usePelcro();
26077
+ } = usePelcro$1();
26019
26078
  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;
26020
26079
  useEffect(() => {
26021
26080
  if (skipPayment && (plan === null || plan === void 0 ? void 0 : plan.amount) === 0) {
@@ -27323,7 +27382,7 @@ const SavedItems = ({
27323
27382
  const [isLoading, setLoading] = useState(false);
27324
27383
  const {
27325
27384
  isAuthenticated
27326
- } = usePelcro();
27385
+ } = usePelcro$1();
27327
27386
 
27328
27387
  const removeItemFromMetadata = (category, title) => {
27329
27388
  const user = window.Pelcro.user.read();
@@ -27522,7 +27581,7 @@ const SubscriptionsItems = ({
27522
27581
  setSubscriptionToCancel,
27523
27582
  setSubscriptionToSuspend,
27524
27583
  set
27525
- } = usePelcro();
27584
+ } = usePelcro$1();
27526
27585
  const subs = getNonDonationSubs();
27527
27586
  if (subs.length === 0) return null;
27528
27587
  return subs.sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
@@ -28119,7 +28178,7 @@ const InvoicesItems = () => {
28119
28178
  const {
28120
28179
  setInvoice,
28121
28180
  switchView
28122
- } = usePelcro();
28181
+ } = usePelcro$1();
28123
28182
  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 : [];
28124
28183
 
28125
28184
  const showInvoiceDetails = event => {
@@ -28250,7 +28309,7 @@ const MembershipsItems = () => {
28250
28309
  switchView,
28251
28310
  setSelectedMembership,
28252
28311
  switchToAddressView
28253
- } = usePelcro();
28312
+ } = usePelcro$1();
28254
28313
  const memberships = getActiveMemberships();
28255
28314
 
28256
28315
  const onChangeAddressClick = membershipId => {
@@ -28330,7 +28389,7 @@ function DashboardWithHook(props) {
28330
28389
  resetView,
28331
28390
  logout,
28332
28391
  set
28333
- } = usePelcro();
28392
+ } = usePelcro$1();
28334
28393
  return /*#__PURE__*/React__default.createElement(DashboardWithTrans, {
28335
28394
  setAddress: addressIdToEdit => set({
28336
28395
  addressIdToEdit
@@ -28966,7 +29025,7 @@ const DashboardWithTrans = withTranslation("dashboard")(Dashboard);
28966
29025
  const DashboardOpenButton = () => {
28967
29026
  const {
28968
29027
  switchView
28969
- } = usePelcro();
29028
+ } = usePelcro$1();
28970
29029
  return /*#__PURE__*/React__default.createElement("div", {
28971
29030
  className: "plc-fixed plc-right-4 plc-bottom-4 pelcro-open-dashboard-btn"
28972
29031
  }, /*#__PURE__*/React__default.createElement("button", {
@@ -30955,11 +31014,34 @@ const EmailVerifyModal = ({
30955
31014
  onClose,
30956
31015
  ...otherProps
30957
31016
  }) => {
31017
+ const {
31018
+ product,
31019
+ plan,
31020
+ switchToAddressView,
31021
+ switchToPaymentView
31022
+ } = usePelcro();
31023
+
31024
+ const onSuccess = res => {
31025
+ var _props$onSuccess, _props;
31026
+
31027
+ (_props$onSuccess = (_props = props).onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(_props, res);
31028
+
31029
+ if (product && plan) {
31030
+ if (product.address_required) {
31031
+ return switchToAddressView();
31032
+ } else {
31033
+ return switchToPaymentView();
31034
+ }
31035
+ }
31036
+ };
31037
+
30958
31038
  return /*#__PURE__*/React__default.createElement(Modal, {
30959
31039
  onDisplay: onDisplay,
30960
31040
  onClose: onClose,
30961
31041
  id: "pelcro-email-verify-modal"
30962
- }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(EmailVerifyView, otherProps)), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
31042
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(EmailVerifyView, Object.assign({
31043
+ onSuccess: onSuccess
31044
+ }, otherProps))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
30963
31045
  };
30964
31046
  EmailVerifyModal.viewId = "email-verify";
30965
31047
 
@@ -31107,7 +31189,7 @@ function VerifyLinkTokenModal({
31107
31189
  } = useTranslation("verifyLinkToken");
31108
31190
  const {
31109
31191
  resetView
31110
- } = usePelcro();
31192
+ } = usePelcro$1();
31111
31193
 
31112
31194
  const onSuccess = res => {
31113
31195
  var _props$onSuccess;
@@ -31157,7 +31239,7 @@ const InvoicePaymentModal = ({
31157
31239
  }) => {
31158
31240
  const {
31159
31241
  switchView
31160
- } = usePelcro();
31242
+ } = usePelcro$1();
31161
31243
 
31162
31244
  const onSuccess = () => {
31163
31245
  var _otherProps$onSuccess;
@@ -31234,7 +31316,7 @@ const InvoiceDetailsDownloadButton = ({
31234
31316
  } = useTranslation("invoiceDetails");
31235
31317
  const {
31236
31318
  invoice
31237
- } = usePelcro();
31319
+ } = usePelcro$1();
31238
31320
  return /*#__PURE__*/React__default.createElement(Link, Object.assign({
31239
31321
  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}`,
31240
31322
  id: "pelcro-download-invoice-link",
@@ -31271,7 +31353,7 @@ const InvoiceDetailsView = props => {
31271
31353
  } = useTranslation("invoiceDetails");
31272
31354
  const {
31273
31355
  invoice
31274
- } = usePelcro();
31356
+ } = usePelcro$1();
31275
31357
  const showPayButton = canPayInvoice(invoice);
31276
31358
  const showDownloadButton = Boolean(invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf);
31277
31359
  const hasPlanDetails = Boolean(invoice.plan);
@@ -31339,7 +31421,7 @@ const InvoiceDetailsModal = ({
31339
31421
  }) => {
31340
31422
  const {
31341
31423
  switchToPaymentView
31342
- } = usePelcro();
31424
+ } = usePelcro$1();
31343
31425
 
31344
31426
  const onSuccess = () => {
31345
31427
  var _otherProps$onSuccess;
@@ -32776,4 +32858,4 @@ const QrCodeModal = ({
32776
32858
  };
32777
32859
  QrCodeModal.viewId = "qrcode";
32778
32860
 
32779
- 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, unauthenticatedButtons, usePelcro };
32861
+ 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, unauthenticatedButtons, usePelcro$1 as usePelcro };