@pelcro/react-pelcro-js 3.1.0 → 3.2.0-beta.11

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 CHANGED
@@ -3461,9 +3461,9 @@ var paymentMethod_fr = {
3461
3461
  select: select
3462
3462
  };
3463
3463
 
3464
- var title$f = "Enter your email to subscribe to our newsletter";
3464
+ var title$h = "Enter your email to subscribe to our newsletter";
3465
3465
  var updateTitle$1 = "Update newsletter selections";
3466
- var subtitle$7 = "We may use your email for other marketing communication";
3466
+ var subtitle$9 = "We may use your email for other marketing communication";
3467
3467
  var labels$p = {
3468
3468
  submit: "Submit",
3469
3469
  firstName: "First name",
@@ -3480,16 +3480,16 @@ var messages$r = {
3480
3480
  here: "here"
3481
3481
  };
3482
3482
  var newsletter_en = {
3483
- title: title$f,
3483
+ title: title$h,
3484
3484
  updateTitle: updateTitle$1,
3485
- subtitle: subtitle$7,
3485
+ subtitle: subtitle$9,
3486
3486
  labels: labels$p,
3487
3487
  messages: messages$r
3488
3488
  };
3489
3489
 
3490
- var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3490
+ var title$g = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3491
3491
  var updateTitle = "Mettre à jour son choix d'infolettres";
3492
- var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3492
+ var subtitle$8 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3493
3493
  var labels$o = {
3494
3494
  submit: "Lire l’article !",
3495
3495
  firstName: "Prénom",
@@ -3506,9 +3506,9 @@ var messages$q = {
3506
3506
  here: "ici"
3507
3507
  };
3508
3508
  var newsletter_fr = {
3509
- title: title$e,
3509
+ title: title$g,
3510
3510
  updateTitle: updateTitle,
3511
- subtitle: subtitle$6,
3511
+ subtitle: subtitle$8,
3512
3512
  labels: labels$o,
3513
3513
  messages: messages$q
3514
3514
  };
@@ -3765,8 +3765,8 @@ var login_fr = {
3765
3765
  errors: errors$4
3766
3766
  };
3767
3767
 
3768
- var title$d = "Create an account";
3769
- var subtitle$5 = "Enter your email and password below";
3768
+ var title$f = "Create an account";
3769
+ var subtitle$7 = "Enter your email and password below";
3770
3770
  var labels$h = {
3771
3771
  signUpFacebook: "Sign up with Facebook",
3772
3772
  signUpGoogle: "Sign up with Google",
@@ -3851,8 +3851,8 @@ var redeem$1 = {
3851
3851
  }
3852
3852
  };
3853
3853
  var register_en = {
3854
- title: title$d,
3855
- subtitle: subtitle$5,
3854
+ title: title$f,
3855
+ subtitle: subtitle$7,
3856
3856
  labels: labels$h,
3857
3857
  messages: messages$h,
3858
3858
  errors: errors$3,
@@ -3860,8 +3860,8 @@ var register_en = {
3860
3860
  redeem: redeem$1
3861
3861
  };
3862
3862
 
3863
- var title$c = "Créer un compte";
3864
- var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3863
+ var title$e = "Créer un compte";
3864
+ var subtitle$6 = "Entrez votre courriel et votre mot de passe ci-dessous";
3865
3865
  var labels$g = {
3866
3866
  signUpFacebook: "Inscrivez-vous avec Facebook",
3867
3867
  signUpGoogle: "Inscrivez-vous avec Google",
@@ -3947,8 +3947,8 @@ var redeem = {
3947
3947
  }
3948
3948
  };
3949
3949
  var register_fr = {
3950
- title: title$c,
3951
- subtitle: subtitle$4,
3950
+ title: title$e,
3951
+ subtitle: subtitle$6,
3952
3952
  labels: labels$g,
3953
3953
  messages: messages$g,
3954
3954
  errors: errors$2,
@@ -4008,7 +4008,7 @@ var userEdit_fr = {
4008
4008
  messages: messages$e
4009
4009
  };
4010
4010
 
4011
- var title$b = "Enter your shipping address";
4011
+ var title$d = "Enter your shipping address";
4012
4012
  var selectAddressTitle$1 = "Please select an address";
4013
4013
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
4014
4014
  var labels$d = {
@@ -4031,7 +4031,7 @@ var messages$d = {
4031
4031
  subRedeemed: "Your subscription has been redeemed."
4032
4032
  };
4033
4033
  var address_en = {
4034
- title: title$b,
4034
+ title: title$d,
4035
4035
  selectAddressTitle: selectAddressTitle$1,
4036
4036
  selectAddressSubtitle: selectAddressSubtitle$1,
4037
4037
  labels: labels$d,
@@ -4039,7 +4039,7 @@ var address_en = {
4039
4039
  messages: messages$d
4040
4040
  };
4041
4041
 
4042
- var title$a = "Entrez votre adresse de livraison";
4042
+ var title$c = "Entrez votre adresse de livraison";
4043
4043
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4044
4044
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4045
4045
  var labels$c = {
@@ -4062,7 +4062,7 @@ var messages$c = {
4062
4062
  subRedeemed: "Votre abonnement a bien été activé."
4063
4063
  };
4064
4064
  var address_fr = {
4065
- title: title$a,
4065
+ title: title$c,
4066
4066
  selectAddressTitle: selectAddressTitle,
4067
4067
  selectAddressSubtitle: selectAddressSubtitle,
4068
4068
  labels: labels$c,
@@ -4070,8 +4070,8 @@ var address_fr = {
4070
4070
  messages: messages$c
4071
4071
  };
4072
4072
 
4073
- var title$9 = "Reset your password";
4074
- var subtitle$3 = "Enter a new password below";
4073
+ var title$b = "Reset your password";
4074
+ var subtitle$5 = "Enter a new password below";
4075
4075
  var email$3 = "Email";
4076
4076
  var password$3 = "Password";
4077
4077
  var confirmPassword$1 = "Confirm password";
@@ -4079,8 +4079,8 @@ var submit$5 = "Submit";
4079
4079
  var required$5 = "Required";
4080
4080
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4081
4081
  var passwordReset_en = {
4082
- title: title$9,
4083
- subtitle: subtitle$3,
4082
+ title: title$b,
4083
+ subtitle: subtitle$5,
4084
4084
  email: email$3,
4085
4085
  password: password$3,
4086
4086
  confirmPassword: confirmPassword$1,
@@ -4089,8 +4089,8 @@ var passwordReset_en = {
4089
4089
  passwordUpdated: passwordUpdated$1
4090
4090
  };
4091
4091
 
4092
- var title$8 = "Réinitialiser votre mot de passe";
4093
- var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4092
+ var title$a = "Réinitialiser votre mot de passe";
4093
+ var subtitle$4 = "Entrez un nouveau mot de passe ci-dessous";
4094
4094
  var email$2 = "Adresse courriel";
4095
4095
  var password$2 = "Mot de passe";
4096
4096
  var confirmPassword = "Confirmer le mot de passe";
@@ -4098,8 +4098,8 @@ var submit$4 = "Soumettre";
4098
4098
  var required$4 = "Champs obligatoires";
4099
4099
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4100
4100
  var passwordReset_fr = {
4101
- title: title$8,
4102
- subtitle: subtitle$2,
4101
+ title: title$a,
4102
+ subtitle: subtitle$4,
4103
4103
  email: email$2,
4104
4104
  password: password$2,
4105
4105
  confirmPassword: confirmPassword,
@@ -4108,7 +4108,7 @@ var passwordReset_fr = {
4108
4108
  passwordUpdated: passwordUpdated
4109
4109
  };
4110
4110
 
4111
- var title$7 = "Forgot your password?";
4111
+ var title$9 = "Forgot your password?";
4112
4112
  var email$1 = "Email";
4113
4113
  var password$1 = "Password";
4114
4114
  var submit$3 = "Submit";
@@ -4119,7 +4119,7 @@ var messages$b = {
4119
4119
  loginHere: "login here."
4120
4120
  };
4121
4121
  var passwordForgot_en = {
4122
- title: title$7,
4122
+ title: title$9,
4123
4123
  email: email$1,
4124
4124
  password: password$1,
4125
4125
  submit: submit$3,
@@ -4128,7 +4128,7 @@ var passwordForgot_en = {
4128
4128
  messages: messages$b
4129
4129
  };
4130
4130
 
4131
- var title$6 = "Mot de passe oublié ?";
4131
+ var title$8 = "Mot de passe oublié ?";
4132
4132
  var email = "Courriel";
4133
4133
  var password = "Mot de passe";
4134
4134
  var submit$2 = "Soumettre";
@@ -4139,7 +4139,7 @@ var messages$a = {
4139
4139
  loginHere: "Connectez-vous ici"
4140
4140
  };
4141
4141
  var passwordForgot_fr = {
4142
- title: title$6,
4142
+ title: title$8,
4143
4143
  email: email,
4144
4144
  password: password,
4145
4145
  submit: submit$2,
@@ -4148,7 +4148,7 @@ var passwordForgot_fr = {
4148
4148
  messages: messages$a
4149
4149
  };
4150
4150
 
4151
- var title$5 = "Change your password";
4151
+ var title$7 = "Change your password";
4152
4152
  var currentPassword$1 = "Current password";
4153
4153
  var newPassword$1 = "New password";
4154
4154
  var confirmNewPassword$1 = "Confirm new password";
@@ -4158,7 +4158,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4158
4158
  var passwordsNotMatching$1 = "Passwords don't match";
4159
4159
  var weakPassword$1 = "Your password must contain at least 6 characters";
4160
4160
  var passwordChange_en = {
4161
- title: title$5,
4161
+ title: title$7,
4162
4162
  currentPassword: currentPassword$1,
4163
4163
  newPassword: newPassword$1,
4164
4164
  confirmNewPassword: confirmNewPassword$1,
@@ -4169,7 +4169,7 @@ var passwordChange_en = {
4169
4169
  weakPassword: weakPassword$1
4170
4170
  };
4171
4171
 
4172
- var title$4 = "Changez votre mot de passe";
4172
+ var title$6 = "Changez votre mot de passe";
4173
4173
  var currentPassword = "Mot de passe actuel";
4174
4174
  var newPassword = "Nouveau mot de passe";
4175
4175
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4179,7 +4179,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4179
4179
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4180
4180
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4181
4181
  var passwordChange_fr = {
4182
- title: title$4,
4182
+ title: title$6,
4183
4183
  currentPassword: currentPassword,
4184
4184
  newPassword: newPassword,
4185
4185
  confirmNewPassword: confirmNewPassword,
@@ -4190,8 +4190,8 @@ var passwordChange_fr = {
4190
4190
  weakPassword: weakPassword
4191
4191
  };
4192
4192
 
4193
- var title$3 = "Votre panier";
4194
- var subtitle$1 = "Terminez votre achat ci-dessous";
4193
+ var title$5 = "Votre panier";
4194
+ var subtitle$3 = "Terminez votre achat ci-dessous";
4195
4195
  var name$1 = "Produit";
4196
4196
  var quantity$1 = "Quantité";
4197
4197
  var price$1 = "Prix";
@@ -4202,8 +4202,8 @@ var confirm$3 = "Passer à la caisse";
4202
4202
  var empty$1 = "Votre panier est vide.";
4203
4203
  var removeAll$1 = "Vider";
4204
4204
  var cart_fr = {
4205
- title: title$3,
4206
- subtitle: subtitle$1,
4205
+ title: title$5,
4206
+ subtitle: subtitle$3,
4207
4207
  name: name$1,
4208
4208
  quantity: quantity$1,
4209
4209
  price: price$1,
@@ -4215,8 +4215,8 @@ var cart_fr = {
4215
4215
  removeAll: removeAll$1
4216
4216
  };
4217
4217
 
4218
- var title$2 = "Your shopping cart";
4219
- var subtitle = "Comple your purchase below";
4218
+ var title$4 = "Your shopping cart";
4219
+ var subtitle$2 = "Comple your purchase below";
4220
4220
  var name = "Name";
4221
4221
  var quantity = "Quantity";
4222
4222
  var price = "Price";
@@ -4227,8 +4227,8 @@ var confirm$2 = "Checkout";
4227
4227
  var empty = "Your cart is empty.";
4228
4228
  var removeAll = "Remove all";
4229
4229
  var cart_en = {
4230
- title: title$2,
4231
- subtitle: subtitle,
4230
+ title: title$4,
4231
+ subtitle: subtitle$2,
4232
4232
  name: name,
4233
4233
  quantity: quantity,
4234
4234
  price: price,
@@ -4666,7 +4666,7 @@ var verifyEmail_fr = {
4666
4666
  messages: messages
4667
4667
  };
4668
4668
 
4669
- var title$1 = "Invoice details";
4669
+ var title$3 = "Invoice details";
4670
4670
  var labels$1 = {
4671
4671
  summary: "Summary",
4672
4672
  total: "Total",
@@ -4679,29 +4679,55 @@ var buttons$1 = {
4679
4679
  pay: "Pay now"
4680
4680
  };
4681
4681
  var invoiceDetails_en = {
4682
- title: title$1,
4682
+ title: title$3,
4683
4683
  labels: labels$1,
4684
4684
  buttons: buttons$1
4685
4685
  };
4686
4686
 
4687
- var title = "Invoice details";
4687
+ var title$2 = "Détails de la facture";
4688
4688
  var labels = {
4689
- summary: "Summary",
4689
+ summary: "Résumé",
4690
4690
  total: "Total",
4691
- amountPaid: "Amount paid",
4692
- amountDue: "Amount due",
4693
- creationDate: "Created on:"
4691
+ amountPaid: "Montant payé",
4692
+ amountDue: "Montant ",
4693
+ creationDate: "Créé le:"
4694
4694
  };
4695
4695
  var buttons = {
4696
- download: "Download",
4697
- pay: "Pay now"
4696
+ download: "Télécharger",
4697
+ pay: "Payer"
4698
4698
  };
4699
4699
  var invoiceDetails_fr = {
4700
- title: title,
4700
+ title: title$2,
4701
4701
  labels: labels,
4702
4702
  buttons: buttons
4703
4703
  };
4704
4704
 
4705
+ var title$1 = "Renewal options";
4706
+ var subtitle$1 = "Select one of the options below to continue";
4707
+ var next$1 = "Next";
4708
+ var addNew$1 = "Add Another Subscription";
4709
+ var renew$1 = "Renew Existing Subscription";
4710
+ var subscriptionOptions_en = {
4711
+ title: title$1,
4712
+ subtitle: subtitle$1,
4713
+ next: next$1,
4714
+ addNew: addNew$1,
4715
+ renew: renew$1
4716
+ };
4717
+
4718
+ var title = "Choix de renouvellement";
4719
+ var subtitle = "Veuillez choisir un des choix ci-dessous";
4720
+ var next = "Prochain";
4721
+ var addNew = "S'abonner à un autre forfait maintenant";
4722
+ var renew = "Renouveler l'abonnement actuel ";
4723
+ var subscriptionOptions_fr = {
4724
+ title: title,
4725
+ subtitle: subtitle,
4726
+ next: next,
4727
+ addNew: addNew,
4728
+ renew: renew
4729
+ };
4730
+
4705
4731
  function create$1(createState) {
4706
4732
  let state;
4707
4733
  const listeners = new Set();
@@ -6051,7 +6077,7 @@ class PelcroActions {
6051
6077
  view,
6052
6078
  cartItems,
6053
6079
  ...otherStateFields
6054
- } = initialState$i;
6080
+ } = initialState$j;
6055
6081
  this.set(otherStateFields);
6056
6082
  });
6057
6083
 
@@ -6075,6 +6101,16 @@ class PelcroActions {
6075
6101
  });
6076
6102
  }
6077
6103
 
6104
+ if (view === "subscription-options") {
6105
+ const noRenewableProducts = getRenewableProducts().length === 0;
6106
+
6107
+ if (noRenewableProducts) {
6108
+ return this.set({
6109
+ view: "plan-select"
6110
+ });
6111
+ }
6112
+ }
6113
+
6078
6114
  this.set({
6079
6115
  view
6080
6116
  });
@@ -6149,6 +6185,26 @@ class PelcroActions {
6149
6185
  }
6150
6186
  });
6151
6187
 
6188
+ _defineProperty$3(this, "setProductsList", products => {
6189
+ if (!Array.isArray(products)) {
6190
+ return console.error(`setProductsList expects an array of products as an argument, got an argument of type ${typeof products} instead`);
6191
+ }
6192
+
6193
+ const allowedProducts = window.Pelcro.product.list();
6194
+ const validProducts = products.filter(product => {
6195
+ const isValidProduct = allowedProducts.some(allowedProduct => allowedProduct.id === (product === null || product === void 0 ? void 0 : product.id) && allowedProduct.name === (product === null || product === void 0 ? void 0 : product.name));
6196
+
6197
+ if (!isValidProduct) {
6198
+ console.warn(`setProductsList expects an array of products that exist in the list of valid products (window.Pelcro.product.list()), but it recieved a product which doesn't exist in that list:`, product);
6199
+ }
6200
+
6201
+ return isValidProduct;
6202
+ });
6203
+ this.set({
6204
+ productsList: validProducts
6205
+ });
6206
+ });
6207
+
6152
6208
  _defineProperty$3(this, "setProduct", id => {
6153
6209
  const product = window.Pelcro.product.getById(id);
6154
6210
  if (!product) return console.error("invalid product id");
@@ -6370,10 +6426,12 @@ class PelcroCallbacks {
6370
6426
 
6371
6427
  }
6372
6428
 
6373
- const initialState$i = {
6429
+ var _window$Pelcro$produc, _window$Pelcro;
6430
+ const initialState$j = {
6374
6431
  // View
6375
6432
  view: null,
6376
6433
  // Plans
6434
+ productsList: (_window$Pelcro$produc = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : _window$Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [],
6377
6435
  product: null,
6378
6436
  plan: null,
6379
6437
  isGift: false,
@@ -6400,7 +6458,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6400
6458
  return {
6401
6459
  // Store setter
6402
6460
  set,
6403
- ...initialState$i,
6461
+ ...initialState$j,
6404
6462
  // State actions
6405
6463
  ...actions,
6406
6464
  // Callbacks
@@ -6755,6 +6813,30 @@ function userMustVerifyEmail() {
6755
6813
  const isUserEmailVerified = (_window$Pelcro$user$r9 = (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.email_confirm) !== null && _window$Pelcro$user$r9 !== void 0 ? _window$Pelcro$user$r9 : false;
6756
6814
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6757
6815
  }
6816
+ function getRenewableProducts() {
6817
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2;
6818
+
6819
+ const renewableSubs = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription.list()) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : _window$Pelcro$subscr2.filter(sub => sub.status === "active" && sub.cancel_at_period_end === 1)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
6820
+ const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6821
+ const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6822
+ const {
6823
+ productsList
6824
+ } = usePelcro.getStore();
6825
+ return productsList.map(product => {
6826
+ if (renewableProductsIds.includes(product.id)) {
6827
+ const renewablePlans = getRenewablePlansOnly(product);
6828
+ return { ...product,
6829
+ plans: renewablePlans
6830
+ };
6831
+ }
6832
+ }).filter(product => product);
6833
+
6834
+ function getRenewablePlansOnly(product) {
6835
+ var _product$plans$filter, _product$plans;
6836
+
6837
+ return (_product$plans$filter = product === null || product === void 0 ? void 0 : (_product$plans = product.plans) === null || _product$plans === void 0 ? void 0 : _product$plans.filter(plan => renewablePlansIds.includes(plan.id))) !== null && _product$plans$filter !== void 0 ? _product$plans$filter : [];
6838
+ }
6839
+ }
6758
6840
 
6759
6841
  const resources = {
6760
6842
  en: {
@@ -6779,7 +6861,8 @@ const resources = {
6779
6861
  dashboard: dashboard_en,
6780
6862
  select: select_en,
6781
6863
  notification: notification_en,
6782
- invoiceDetails: invoiceDetails_en
6864
+ invoiceDetails: invoiceDetails_en,
6865
+ subscriptionOptions: subscriptionOptions_en
6783
6866
  },
6784
6867
  fr: {
6785
6868
  common: common_fr,
@@ -6803,7 +6886,8 @@ const resources = {
6803
6886
  dashboard: dashboard_fr,
6804
6887
  select: select_fr,
6805
6888
  notification: notification_fr,
6806
- invoiceDetails: invoiceDetails_fr
6889
+ invoiceDetails: invoiceDetails_fr,
6890
+ subscriptionOptions: subscriptionOptions_fr
6807
6891
  }
6808
6892
  }; // set UI language to the page language or default to the language in site settings
6809
6893
 
@@ -7094,8 +7178,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7094
7178
 
7095
7179
  let e={data:""},t=t=>"undefined"!=typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,n=(e,t)=>{let r,l="",a="",o="";for(let c in e){let s=e[c];"object"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):c,a+="@"==c[0]?"f"==c[1]?n(s,c):c+"{"+n(s,"k"==c[1]?"":t)+"}":n(s,r)):"@"==c[0]&&"i"==c[1]?l=c+" "+s+";":(c=c.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=n.p?n.p(c,s):c+":"+s+";");}return o[0]?(r=t?t+"{"+o+"}":o,l+r+a):l+a},o={},c=e=>{let t="";for(let r in e)t+=r+("object"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p="object"==typeof e?c(e):e,u=o[p]||(o[p]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(p));if(!o[u]){let t="object"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,""));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{["@keyframes "+u]:t}:t,r?"":"."+u);}return ((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":n(e,""):e;}return e+l+(null==o?"":o)},"");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,f,d;p.bind({g:1});let b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,f=r,d=l;}function y(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=p.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=c.as||e;return d&&i[0]&&d(c),u(i,c)}return t?t(a):a}}
7096
7180
 
7097
- function _extends$y() {
7098
- _extends$y = Object.assign || function (target) {
7181
+ function _extends$A() {
7182
+ _extends$A = Object.assign || function (target) {
7099
7183
  for (var i = 1; i < arguments.length; i++) {
7100
7184
  var source = arguments[i];
7101
7185
 
@@ -7109,7 +7193,7 @@ function _extends$y() {
7109
7193
  return target;
7110
7194
  };
7111
7195
 
7112
- return _extends$y.apply(this, arguments);
7196
+ return _extends$A.apply(this, arguments);
7113
7197
  }
7114
7198
 
7115
7199
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7199,7 +7283,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7199
7283
  var reducer = function reducer(state, action) {
7200
7284
  switch (action.type) {
7201
7285
  case ActionType.ADD_TOAST:
7202
- return _extends$y({}, state, {
7286
+ return _extends$A({}, state, {
7203
7287
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7204
7288
  });
7205
7289
 
@@ -7209,9 +7293,9 @@ var reducer = function reducer(state, action) {
7209
7293
  clearFromRemoveQueue(action.toast.id);
7210
7294
  }
7211
7295
 
7212
- return _extends$y({}, state, {
7296
+ return _extends$A({}, state, {
7213
7297
  toasts: state.toasts.map(function (t) {
7214
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7298
+ return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7215
7299
  })
7216
7300
  });
7217
7301
 
@@ -7238,9 +7322,9 @@ var reducer = function reducer(state, action) {
7238
7322
  });
7239
7323
  }
7240
7324
 
7241
- return _extends$y({}, state, {
7325
+ return _extends$A({}, state, {
7242
7326
  toasts: state.toasts.map(function (t) {
7243
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7327
+ return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7244
7328
  visible: false
7245
7329
  }) : t;
7246
7330
  })
@@ -7248,28 +7332,28 @@ var reducer = function reducer(state, action) {
7248
7332
 
7249
7333
  case ActionType.REMOVE_TOAST:
7250
7334
  if (action.toastId === undefined) {
7251
- return _extends$y({}, state, {
7335
+ return _extends$A({}, state, {
7252
7336
  toasts: []
7253
7337
  });
7254
7338
  }
7255
7339
 
7256
- return _extends$y({}, state, {
7340
+ return _extends$A({}, state, {
7257
7341
  toasts: state.toasts.filter(function (t) {
7258
7342
  return t.id !== action.toastId;
7259
7343
  })
7260
7344
  });
7261
7345
 
7262
7346
  case ActionType.START_PAUSE:
7263
- return _extends$y({}, state, {
7347
+ return _extends$A({}, state, {
7264
7348
  pausedAt: action.time
7265
7349
  });
7266
7350
 
7267
7351
  case ActionType.END_PAUSE:
7268
7352
  var diff = action.time - (state.pausedAt || 0);
7269
- return _extends$y({}, state, {
7353
+ return _extends$A({}, state, {
7270
7354
  pausedAt: undefined,
7271
7355
  toasts: state.toasts.map(function (t) {
7272
- return _extends$y({}, t, {
7356
+ return _extends$A({}, t, {
7273
7357
  pauseDuration: t.pauseDuration + diff
7274
7358
  });
7275
7359
  })
@@ -7316,12 +7400,12 @@ var useStore = function useStore(toastOptions) {
7316
7400
  var mergedToasts = state.toasts.map(function (t) {
7317
7401
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7318
7402
 
7319
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7403
+ return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7320
7404
  duration: t.duration || ((_toastOptions$t$type = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type.duration) || ((_toastOptions = toastOptions) == null ? void 0 : _toastOptions.duration) || defaultTimeouts[t.type],
7321
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7405
+ style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7322
7406
  });
7323
7407
  });
7324
- return _extends$y({}, state, {
7408
+ return _extends$A({}, state, {
7325
7409
  toasts: mergedToasts
7326
7410
  });
7327
7411
  };
@@ -7331,7 +7415,7 @@ var createToast = function createToast(message, type, opts) {
7331
7415
  type = 'blank';
7332
7416
  }
7333
7417
 
7334
- return _extends$y({
7418
+ return _extends$A({
7335
7419
  createdAt: Date.now(),
7336
7420
  visible: true,
7337
7421
  type: type,
@@ -7381,14 +7465,14 @@ toast.remove = function (toastId) {
7381
7465
  };
7382
7466
 
7383
7467
  toast.promise = function (promise, msgs, opts) {
7384
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7468
+ var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7385
7469
  promise.then(function (p) {
7386
- toast.success(resolveValue(msgs.success, p), _extends$y({
7470
+ toast.success(resolveValue(msgs.success, p), _extends$A({
7387
7471
  id: id
7388
7472
  }, opts, opts == null ? void 0 : opts.success));
7389
7473
  return p;
7390
7474
  })["catch"](function (e) {
7391
- toast.error(resolveValue(msgs.error, e), _extends$y({
7475
+ toast.error(resolveValue(msgs.error, e), _extends$A({
7392
7476
  id: id
7393
7477
  }, opts, opts == null ? void 0 : opts.error));
7394
7478
  });
@@ -7727,7 +7811,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7727
7811
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7728
7812
  return React.createElement(ToastBarBase, {
7729
7813
  className: toast.className,
7730
- style: _extends$y({}, animationStyle, style, toast.style)
7814
+ style: _extends$A({}, animationStyle, style, toast.style)
7731
7815
  }, typeof children === 'function' ? children({
7732
7816
  icon: icon,
7733
7817
  message: message
@@ -7757,7 +7841,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7757
7841
  } : position.includes('right') ? {
7758
7842
  justifyContent: 'flex-end'
7759
7843
  } : {};
7760
- return _extends$y({
7844
+ return _extends$A({
7761
7845
  left: 0,
7762
7846
  right: 0,
7763
7847
  display: 'flex',
@@ -7784,7 +7868,7 @@ var Toaster = function Toaster(_ref) {
7784
7868
  handlers = _useToaster.handlers;
7785
7869
 
7786
7870
  return React.createElement("div", {
7787
- style: _extends$y({
7871
+ style: _extends$A({
7788
7872
  position: 'fixed',
7789
7873
  zIndex: 9999,
7790
7874
  top: DEFAULT_OFFSET,
@@ -7819,82 +7903,82 @@ var Toaster = function Toaster(_ref) {
7819
7903
  }));
7820
7904
  };
7821
7905
 
7822
- var _path$v;
7906
+ var _path$x;
7823
7907
 
7824
- function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7908
+ function _extends$z() { _extends$z = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
7825
7909
 
7826
7910
  function SvgCheckSolid(props) {
7827
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7911
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
7828
7912
  xmlns: "http://www.w3.org/2000/svg",
7829
7913
  className: "h-5 w-5",
7830
7914
  viewBox: "0 0 20 20",
7831
7915
  fill: "currentColor"
7832
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7916
+ }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
7833
7917
  fillRule: "evenodd",
7834
7918
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
7835
7919
  clipRule: "evenodd"
7836
7920
  })));
7837
7921
  }
7838
7922
 
7839
- var _path$u;
7923
+ var _path$w;
7840
7924
 
7841
- function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7925
+ function _extends$y() { _extends$y = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
7842
7926
 
7843
7927
  function SvgXIcon(props) {
7844
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7928
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7845
7929
  xmlns: "http://www.w3.org/2000/svg",
7846
7930
  viewBox: "0 0 20 20",
7847
7931
  fill: "currentColor"
7848
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7932
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7849
7933
  fill: "evenodd",
7850
7934
  d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
7851
7935
  clipRule: "evenodd"
7852
7936
  })));
7853
7937
  }
7854
7938
 
7855
- var _path$t;
7939
+ var _path$v;
7856
7940
 
7857
- function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7941
+ function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7858
7942
 
7859
7943
  function SvgXIconSolid(props) {
7860
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7944
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7861
7945
  className: "plc-w-4 plc-h-4",
7862
7946
  fill: "currentColor",
7863
7947
  xmlns: "http://www.w3.org/2000/svg",
7864
7948
  viewBox: "0 0 100 100"
7865
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7949
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7866
7950
  d: "M94.842 48.408c0 24.852-20.148 44.999-45.002 44.999-24.851 0-44.997-20.146-44.997-44.999 0-24.854 20.146-45 44.997-45 24.853 0 45.002 20.146 45.002 45zM71.073 64.841L54.73 48.497l16.344-16.344-4.979-4.979-16.343 16.345-16.343-16.344-4.799 4.799 16.344 16.344L28.61 64.661l4.979 4.978 16.344-16.344 16.343 16.344 4.797-4.798z"
7867
7951
  })));
7868
7952
  }
7869
7953
 
7870
- var _path$s;
7954
+ var _path$u;
7871
7955
 
7872
- function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
7956
+ function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7873
7957
 
7874
7958
  function SvgExclamation(props) {
7875
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7959
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7876
7960
  className: "plc-w-4 plc-h-4 plc-mr-1",
7877
7961
  xmlns: "http://www.w3.org/2000/svg",
7878
7962
  viewBox: "0 0 20 20",
7879
7963
  fill: "currentColor"
7880
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7964
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7881
7965
  fillRule: "evenodd",
7882
7966
  d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
7883
7967
  clipRule: "evenodd"
7884
7968
  })));
7885
7969
  }
7886
7970
 
7887
- var _path$r, _path2$4;
7971
+ var _path$t, _path2$4;
7888
7972
 
7889
- function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
7973
+ function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7890
7974
 
7891
7975
  function SvgSpinner(props) {
7892
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
7976
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7893
7977
  className: "plc-animate-spin",
7894
7978
  viewBox: "0 0 24 24",
7895
7979
  fill: "currentColor",
7896
7980
  xmlns: "http://www.w3.org/2000/svg"
7897
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
7981
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7898
7982
  opacity: 0.2,
7899
7983
  fill: "evenodd",
7900
7984
  clipRule: "evenodd",
@@ -8184,7 +8268,9 @@ const init$1 = () => {
8184
8268
  return switchToAddressView();
8185
8269
  });
8186
8270
  } else {
8187
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8271
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8272
+ return switchView("subscription-options");
8273
+ });
8188
8274
  }
8189
8275
  }
8190
8276
  }
@@ -8346,7 +8432,8 @@ function Link({
8346
8432
  const init = () => {
8347
8433
  const {
8348
8434
  switchView,
8349
- set
8435
+ set,
8436
+ setProductsList
8350
8437
  } = usePelcro.getStore();
8351
8438
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8352
8439
 
@@ -8397,7 +8484,8 @@ const init = () => {
8397
8484
  }
8398
8485
 
8399
8486
  notify.dismiss(NOTIFICATION_ID);
8400
- switchView("_plan-select-entitlements");
8487
+ setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8488
+ switchView("plan-select");
8401
8489
  }
8402
8490
  }, "Subscribe"), "now to get full page access.")), {
8403
8491
  className: "pelcro-notification-entitlement",
@@ -8629,6 +8717,7 @@ var pure_1 = pure.loadStripe;
8629
8717
  * @param {Object} error Error object
8630
8718
  * @return {string}
8631
8719
  */
8720
+
8632
8721
  const getErrorMessages = error => {
8633
8722
  var _error$error, _error$response, _error$response$data, _error$response3, _error$response3$data, _error$response3$data2, _error$response5, _error$response5$data;
8634
8723
 
@@ -8648,6 +8737,10 @@ const getErrorMessages = error => {
8648
8737
  return error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.error) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2.message;
8649
8738
  }
8650
8739
 
8740
+ if (error !== null && error !== void 0 && error.message) {
8741
+ return error.message;
8742
+ }
8743
+
8651
8744
  const errorMessages = []; // enumerable error (ex: validation errors)
8652
8745
 
8653
8746
  Object.values(error === null || error === void 0 ? void 0 : (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : (_error$response5$data = _error$response5.data) === null || _error$response5$data === void 0 ? void 0 : _error$response5$data.errors).forEach(([errorMessage]) => {
@@ -8683,6 +8776,15 @@ const debounce = (func, waitTime) => {
8683
8776
  timeout = setTimeout(later, waitTime);
8684
8777
  };
8685
8778
  };
8779
+ function getSiteCardProcessor() {
8780
+ var _window$Pelcro$site$r;
8781
+
8782
+ if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_gateway_settings) {
8783
+ return "vantiv";
8784
+ }
8785
+
8786
+ return "stripe";
8787
+ }
8686
8788
 
8687
8789
  /**
8688
8790
  * @typedef {Object} OptionsType
@@ -8763,13 +8865,29 @@ const loadPaymentSDKs = () => {
8763
8865
  if (!window.Stripe) {
8764
8866
  pure_1(window.Pelcro.environment.stripe);
8765
8867
  }
8766
- }); // Load PayPal SDK's
8868
+ }); // Load PayPal SDKs
8767
8869
 
8768
8870
  const supportsPaypal = Boolean(window.Pelcro.site.read().braintree_tokenization);
8769
8871
 
8770
8872
  if (supportsPaypal) {
8771
8873
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/client.min.js", "braintree-sdk");
8772
8874
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/paypal-checkout.min.js", "braintree-paypal-sdk");
8875
+ } // Load Vantiv SDKs
8876
+
8877
+
8878
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
8879
+
8880
+ if (supportsVantiv) {
8881
+ if (!window.jQuery) {
8882
+ window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
8883
+ }
8884
+
8885
+ if (!window.EprotectIframeClient) {
8886
+ const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
8887
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
8888
+ const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
8889
+ window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
8890
+ }
8773
8891
  }
8774
8892
  };
8775
8893
  const loadAuth0SDK = () => {
@@ -8929,8 +9047,7 @@ const initViewFromURL = () => {
8929
9047
  }
8930
9048
 
8931
9049
  if (view === "invoice-details") {
8932
- // FIXME: commented out to remove from the release
8933
- return false; // return showInvoiceDetailsFromUrl();
9050
+ return showInvoiceDetailsFromUrl();
8934
9051
  }
8935
9052
 
8936
9053
  switchView(view);
@@ -9109,6 +9226,43 @@ const verifyEmailTokenFromUrl = () => {
9109
9226
  });
9110
9227
  };
9111
9228
 
9229
+ const showInvoiceDetailsFromUrl = () => {
9230
+ const {
9231
+ isAuthenticated,
9232
+ setInvoice,
9233
+ whenSiteReady,
9234
+ switchView
9235
+ } = usePelcro.getStore();
9236
+ whenSiteReady(() => {
9237
+ if (!isAuthenticated()) {
9238
+ return switchView("login");
9239
+ }
9240
+
9241
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9242
+ const wasSetSuccessfully = setInvoice(invoiceId);
9243
+
9244
+ if (!wasSetSuccessfully) {
9245
+ const errorMessage = i18next.t("messages:invalidInvoice", {
9246
+ returnObjects: true
9247
+ });
9248
+ return notify.error(errorMessage);
9249
+ }
9250
+
9251
+ const {
9252
+ invoice
9253
+ } = usePelcro.getStore();
9254
+
9255
+ if (invoice.total === 0) {
9256
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9257
+ returnObjects: true
9258
+ });
9259
+ return notify.error(errorMessage);
9260
+ }
9261
+
9262
+ return switchView("invoice-details");
9263
+ });
9264
+ };
9265
+
9112
9266
  const defaultOptions = {
9113
9267
  loadPaymentSDKs: true,
9114
9268
  loadAuth0SDK: true,
@@ -9166,7 +9320,7 @@ const PelcroModalController = ({
9166
9320
  type
9167
9321
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default['default'].Children.map(children, child => child).find(({
9168
9322
  type
9169
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default['default'].Children.map(children, child => child).find(({
9323
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default['default'].Children.map(children, child => child).find(({
9170
9324
  type
9171
9325
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default['default'].Children.map(children, child => child).find(({
9172
9326
  type
@@ -9447,8 +9601,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9447
9601
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9448
9602
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9449
9603
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9604
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9605
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9450
9606
 
9451
- const initialState$h = {
9607
+ const initialState$i = {
9452
9608
  email: "",
9453
9609
  password: "",
9454
9610
  emailError: null,
@@ -9459,10 +9615,10 @@ const initialState$h = {
9459
9615
  content: ""
9460
9616
  }
9461
9617
  };
9462
- const store$h = /*#__PURE__*/React.createContext(initialState$h);
9618
+ const store$i = /*#__PURE__*/React.createContext(initialState$i);
9463
9619
  const {
9464
- Provider: Provider$h
9465
- } = store$h;
9620
+ Provider: Provider$i
9621
+ } = store$i;
9466
9622
 
9467
9623
  const LoginContainer = ({
9468
9624
  style,
@@ -9569,7 +9725,7 @@ const LoginContainer = ({
9569
9725
  });
9570
9726
 
9571
9727
  case RESET_LOGIN_FORM:
9572
- return initialState$h;
9728
+ return initialState$i;
9573
9729
 
9574
9730
  case DISABLE_LOGIN_BUTTON:
9575
9731
  return lib_7({ ...state,
@@ -9587,12 +9743,12 @@ const LoginContainer = ({
9587
9743
  default:
9588
9744
  return state;
9589
9745
  }
9590
- }, initialState$h);
9746
+ }, initialState$i);
9591
9747
  return /*#__PURE__*/React__default['default'].createElement("div", {
9592
9748
  style: { ...style
9593
9749
  },
9594
9750
  className: `pelcro-container pelcro-login-container ${className}`
9595
- }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9751
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$i, {
9596
9752
  value: {
9597
9753
  state,
9598
9754
  dispatch
@@ -9600,12 +9756,12 @@ const LoginContainer = ({
9600
9756
  }, children.length ? children.map((child, i) => {
9601
9757
  if (child) {
9602
9758
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9603
- store: store$h,
9759
+ store: store$i,
9604
9760
  key: i
9605
9761
  });
9606
9762
  }
9607
9763
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9608
- store: store$h
9764
+ store: store$i
9609
9765
  })));
9610
9766
  };
9611
9767
 
@@ -9850,7 +10006,7 @@ const LoginButton = ({
9850
10006
  buttonDisabled
9851
10007
  },
9852
10008
  dispatch
9853
- } = React.useContext(store$h);
10009
+ } = React.useContext(store$i);
9854
10010
  const {
9855
10011
  t
9856
10012
  } = useTranslation("login");
@@ -9871,23 +10027,23 @@ const LoginButton = ({
9871
10027
  };
9872
10028
 
9873
10029
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9874
- store: store$h
10030
+ store: store$i
9875
10031
  }, props));
9876
10032
 
9877
10033
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9878
- store: store$h
10034
+ store: store$i
9879
10035
  }, props));
9880
10036
 
9881
- var _path$q;
10037
+ var _path$s;
9882
10038
 
9883
- function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
10039
+ function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
9884
10040
 
9885
10041
  function SvgCheck(props) {
9886
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10042
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
9887
10043
  xmlns: "http://www.w3.org/2000/svg",
9888
10044
  fill: "currentColor",
9889
10045
  viewBox: "0 0 20 20"
9890
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10046
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
9891
10047
  fillRule: "evenodd",
9892
10048
  d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
9893
10049
  clipRule: "evenodd"
@@ -9952,7 +10108,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9952
10108
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9953
10109
  facebookLoginRenderProps.FacebookLogin;
9954
10110
 
9955
- const initialState$g = {
10111
+ const initialState$h = {
9956
10112
  email: "",
9957
10113
  password: "",
9958
10114
  emailError: null,
@@ -9969,10 +10125,10 @@ const initialState$g = {
9969
10125
  content: ""
9970
10126
  }
9971
10127
  };
9972
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
10128
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
9973
10129
  const {
9974
- Provider: Provider$g
9975
- } = store$g;
10130
+ Provider: Provider$h
10131
+ } = store$h;
9976
10132
 
9977
10133
  const RegisterContainer = ({
9978
10134
  style,
@@ -10155,7 +10311,7 @@ const RegisterContainer = ({
10155
10311
  });
10156
10312
 
10157
10313
  case RESET_LOGIN_FORM:
10158
- return initialState$g;
10314
+ return initialState$h;
10159
10315
 
10160
10316
  case DISABLE_REGISTRATION_BUTTON:
10161
10317
  return lib_7({ ...state,
@@ -10173,12 +10329,12 @@ const RegisterContainer = ({
10173
10329
  default:
10174
10330
  return state;
10175
10331
  }
10176
- }, initialState$g);
10332
+ }, initialState$h);
10177
10333
  return /*#__PURE__*/React__default['default'].createElement("div", {
10178
10334
  style: { ...style
10179
10335
  },
10180
10336
  className: `pelcro-container pelcro-register-container ${className}`
10181
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10337
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
10182
10338
  value: {
10183
10339
  state,
10184
10340
  dispatch
@@ -10186,12 +10342,12 @@ const RegisterContainer = ({
10186
10342
  }, children.length ? children.map((child, i) => {
10187
10343
  if (child) {
10188
10344
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10189
- store: store$g,
10345
+ store: store$h,
10190
10346
  key: i
10191
10347
  });
10192
10348
  }
10193
10349
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10194
- store: store$g
10350
+ store: store$h
10195
10351
  })));
10196
10352
  };
10197
10353
  /**
@@ -10206,15 +10362,15 @@ function hasSecurityTokenEnabled$1() {
10206
10362
  return hasSecuritySdkLoaded;
10207
10363
  }
10208
10364
 
10209
- var _path$p;
10365
+ var _path$r;
10210
10366
 
10211
- function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
10367
+ function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
10212
10368
 
10213
10369
  function SvgFacebookLogo(props) {
10214
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10370
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10215
10371
  xmlns: "http://www.w3.org/2000/svg",
10216
10372
  viewBox: "88.428 12.828 107.543 207.085"
10217
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10373
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10218
10374
  d: "M158.232 219.912v-94.461h31.707l4.747-36.813h-36.454V65.134c0-10.658 2.96-17.922 18.245-17.922l19.494-.009V14.278c-3.373-.447-14.944-1.449-28.406-1.449-28.106 0-47.348 17.155-47.348 48.661v27.149H88.428v36.813h31.788v94.461l38.016-.001z",
10219
10375
  fill: "#3c5a9a"
10220
10376
  })));
@@ -10231,10 +10387,10 @@ const FacebookLoginButton = ({
10231
10387
  const facebookLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id;
10232
10388
  const {
10233
10389
  dispatch: loginDispatch
10234
- } = React.useContext(store$h);
10390
+ } = React.useContext(store$i);
10235
10391
  const {
10236
10392
  dispatch: registerDispatch
10237
- } = React.useContext(store$g);
10393
+ } = React.useContext(store$h);
10238
10394
 
10239
10395
  const onSuccess = facebookUser => {
10240
10396
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10287,15 +10443,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10287
10443
  unwrapExports(googleLogin);
10288
10444
  var googleLogin_1 = googleLogin.GoogleLogin;
10289
10445
 
10290
- var _path$o, _path2$3, _path3$1, _path4;
10446
+ var _path$q, _path2$3, _path3$1, _path4;
10291
10447
 
10292
- function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
10448
+ function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
10293
10449
 
10294
10450
  function SvgGoogleLogo(props) {
10295
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10451
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10296
10452
  viewBox: "0 0 24 24",
10297
10453
  xmlns: "http://www.w3.org/2000/svg"
10298
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10454
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10299
10455
  fill: "#4285F4",
10300
10456
  d: "M23.745 12.27c0-.79-.07-1.54-.19-2.27h-11.3v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"
10301
10457
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10321,10 +10477,10 @@ const GoogleLoginButton = ({
10321
10477
  const googleLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.google_app_id;
10322
10478
  const {
10323
10479
  dispatch: loginDispatch
10324
- } = React.useContext(store$h);
10480
+ } = React.useContext(store$i);
10325
10481
  const {
10326
10482
  dispatch: registerDispatch
10327
- } = React.useContext(store$g);
10483
+ } = React.useContext(store$h);
10328
10484
 
10329
10485
  const onSuccess = response => {
10330
10486
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10372,15 +10528,15 @@ const GoogleLoginButton = ({
10372
10528
  }) : null;
10373
10529
  };
10374
10530
 
10375
- var _path$n;
10531
+ var _path$p;
10376
10532
 
10377
- function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
10533
+ function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
10378
10534
 
10379
10535
  function SvgAuth0Logo(props) {
10380
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10536
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10381
10537
  viewBox: "0 0 256 285",
10382
10538
  xmlns: "http://www.w3.org/2000/svg"
10383
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10539
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10384
10540
  d: "M220.412 0h-92.415l28.562 89.006h92.416l-74.77 53.077 28.57 89.511c48.128-35.06 63.854-88.12 46.208-142.588L220.413 0zM7.018 89.006h92.416L127.997 0H35.589L7.019 89.006c-17.655 54.468-1.92 107.529 46.207 142.588l28.563-89.51-74.77-53.078zm46.208 142.588l74.77 52.97 74.77-52.97-74.77-53.847-74.77 53.847z"
10385
10541
  })));
10386
10542
  }
@@ -10420,10 +10576,10 @@ const Auth0LoginButton = ({
10420
10576
  }, [auth0Enabled, auth0Loaded]);
10421
10577
  const {
10422
10578
  dispatch: loginDispatch
10423
- } = React.useContext(store$h);
10579
+ } = React.useContext(store$i);
10424
10580
  const {
10425
10581
  dispatch: registerDispatch
10426
- } = React.useContext(store$g);
10582
+ } = React.useContext(store$h);
10427
10583
 
10428
10584
  function handleClick() {
10429
10585
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10556,15 +10712,15 @@ function LoginView(props) {
10556
10712
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10557
10713
  }
10558
10714
 
10559
- var _path$m, _path2$2, _path3;
10715
+ var _path$o, _path2$2, _path3;
10560
10716
 
10561
- function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
10717
+ function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
10562
10718
 
10563
10719
  function SvgPelcroAuthorship(props) {
10564
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
10720
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10565
10721
  xmlns: "http://www.w3.org/2000/svg",
10566
10722
  viewBox: "0 -80.652 497.072 179.991"
10567
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
10723
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10568
10724
  fill: "none",
10569
10725
  stroke: "#4a4a4a",
10570
10726
  d: "M487.89 42.299c0 13.158-10.671 23.829-23.829 23.829H37.074c-13.162 0-23.832-10.671-23.832-23.829v-63.552c0-13.158 10.67-23.831 23.832-23.831H464.06c13.158 0 23.829 10.672 23.829 23.831l.001 63.552z"
@@ -10711,11 +10867,11 @@ function LoginModal({
10711
10867
  LoginModal.viewId = "login";
10712
10868
 
10713
10869
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10714
- store: store$g
10870
+ store: store$h
10715
10871
  }, props));
10716
10872
 
10717
10873
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10718
- store: store$g
10874
+ store: store$h
10719
10875
  }, props));
10720
10876
 
10721
10877
  const RegisterButton = ({
@@ -10735,7 +10891,7 @@ const RegisterButton = ({
10735
10891
  buttonDisabled
10736
10892
  },
10737
10893
  dispatch
10738
- } = React.useContext(store$g);
10894
+ } = React.useContext(store$h);
10739
10895
  const {
10740
10896
  t
10741
10897
  } = useTranslation("register");
@@ -10873,7 +11029,7 @@ function FirstName({
10873
11029
  }
10874
11030
 
10875
11031
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10876
- store: store$g
11032
+ store: store$h
10877
11033
  }, props));
10878
11034
 
10879
11035
  function LastName({
@@ -10904,7 +11060,7 @@ function LastName({
10904
11060
  }
10905
11061
 
10906
11062
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10907
- store: store$g
11063
+ store: store$h
10908
11064
  }, props));
10909
11065
 
10910
11066
  /**
@@ -11028,7 +11184,7 @@ function TextInput({
11028
11184
 
11029
11185
  const RegisterTextInput = props => {
11030
11186
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
11031
- store: store$g
11187
+ store: store$h
11032
11188
  }));
11033
11189
  };
11034
11190
 
@@ -11175,6 +11331,7 @@ function SelectModalWithHook(props) {
11175
11331
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11176
11332
  }, []);
11177
11333
  const {
11334
+ productsList,
11178
11335
  isGift,
11179
11336
  plan,
11180
11337
  product,
@@ -11184,11 +11341,12 @@ function SelectModalWithHook(props) {
11184
11341
  view,
11185
11342
  set
11186
11343
  } = usePelcro();
11187
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11188
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11344
+ const isRenewingSub = view === "_plan-select-renew";
11189
11345
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
11346
+ productsList: productsList,
11190
11347
  isGift: isGift,
11191
- disableGifting: isRenewingGift,
11348
+ disableGifting: isRenewingGift || isRenewingSub,
11349
+ isRenewingSub: isRenewingSub,
11192
11350
  plan: plan,
11193
11351
  product: product,
11194
11352
  onClose: () => {
@@ -11202,8 +11360,10 @@ function SelectModalWithHook(props) {
11202
11360
  plan,
11203
11361
  isGift
11204
11362
  }),
11205
- setView: switchView,
11206
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11363
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11364
+ subscriptionIdToRenew
11365
+ }),
11366
+ setView: switchView
11207
11367
  });
11208
11368
  }
11209
11369
  SelectModalWithHook.viewId = "plan-select";
@@ -11235,10 +11395,10 @@ class SelectModal extends React.Component {
11235
11395
  });
11236
11396
  }
11237
11397
 
11238
- if (this.state.productList.length === 1) {
11398
+ if (this.props.productsList.length === 1) {
11239
11399
  this.setState({
11240
- product: this.state.productList[0],
11241
- planList: this.state.productList[0].plans,
11400
+ product: this.props.productsList[0],
11401
+ planList: this.props.productsList[0].plans,
11242
11402
  mode: "plan"
11243
11403
  });
11244
11404
  }
@@ -11255,7 +11415,7 @@ class SelectModal extends React.Component {
11255
11415
  });
11256
11416
 
11257
11417
  _defineProperty$3(this, "onProductChange", e => {
11258
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11418
+ const product = productsList[e.target.selectedIndex];
11259
11419
  this.setState({
11260
11420
  product: product,
11261
11421
  plan: product.plans[0]
@@ -11321,7 +11481,7 @@ class SelectModal extends React.Component {
11321
11481
 
11322
11482
  _defineProperty$3(this, "renderProducts", () => {
11323
11483
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11324
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11484
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11325
11485
  return productsToShow.map((product, index) => {
11326
11486
  return this.renderOneProduct(product, index);
11327
11487
  });
@@ -11334,7 +11494,7 @@ class SelectModal extends React.Component {
11334
11494
  return this.renderOneProduct(this.state.product);
11335
11495
  }
11336
11496
 
11337
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11497
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11338
11498
 
11339
11499
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11340
11500
  return this.renderProducts();
@@ -11350,10 +11510,7 @@ class SelectModal extends React.Component {
11350
11510
  className: "plc-text-sm plc-font-semibold"
11351
11511
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11352
11512
 
11353
- function productsWithMatchedTaggedFirst() {
11354
- var _window$Pelcro$produc;
11355
-
11356
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11513
+ function productsWithMatchedTaggedFirst(allProducts) {
11357
11514
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11358
11515
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11359
11516
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11387,7 +11544,7 @@ class SelectModal extends React.Component {
11387
11544
  _defineProperty$3(this, "selectProduct", e => {
11388
11545
  const id = e.target.dataset.key;
11389
11546
 
11390
- for (const product of this.state.productList) {
11547
+ for (const product of this.props.productsList) {
11391
11548
  if (+product.id === +id) {
11392
11549
  var _this$state$plan;
11393
11550
 
@@ -11440,6 +11597,14 @@ class SelectModal extends React.Component {
11440
11597
 
11441
11598
  _defineProperty$3(this, "submitOption", () => {
11442
11599
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11600
+
11601
+ if (this.props.isRenewingSub) {
11602
+ var _matchingSub$id;
11603
+
11604
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11605
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11606
+ }
11607
+
11443
11608
  const {
11444
11609
  product,
11445
11610
  isGift
@@ -11477,8 +11642,7 @@ class SelectModal extends React.Component {
11477
11642
  plan: {},
11478
11643
  isGift: props.isGift,
11479
11644
  disabled: true,
11480
- mode: "product",
11481
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11645
+ mode: "product"
11482
11646
  };
11483
11647
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11484
11648
  this.locale = this.props.t;
@@ -11486,7 +11650,7 @@ class SelectModal extends React.Component {
11486
11650
  }
11487
11651
 
11488
11652
  render() {
11489
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11653
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11490
11654
 
11491
11655
  const {
11492
11656
  disableGifting
@@ -11520,7 +11684,7 @@ class SelectModal extends React.Component {
11520
11684
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11521
11685
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
11522
11686
  className: "plc-text-2xl plc-font-semibold"
11523
- }, this.product && this.product.paywall.select_title || ((_window$Pelcro$produc2 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc2 === void 0 ? void 0 : _window$Pelcro$produc2.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_window$Pelcro$produc3 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc3 === void 0 ? void 0 : _window$Pelcro$produc3.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11687
+ }, this.product && this.product.paywall.select_title || ((_this$props$productsL = this.props.productsList[0]) === null || _this$props$productsL === void 0 ? void 0 : _this$props$productsL.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_this$props$productsL2 = this.props.productsList[0]) === null || _this$props$productsL2 === void 0 ? void 0 : _this$props$productsL2.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11524
11688
  className: "pelcro-select-products-wrapper"
11525
11689
  }, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
11526
11690
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -12684,20 +12848,21 @@ var es_12 = es.injectStripe;
12684
12848
  var es_13 = es.StripeProvider;
12685
12849
 
12686
12850
  /**
12687
- * @TODO: All subscription related business logic should end up moving
12851
+ * @TODO: All payment related business logic should end up moving
12688
12852
  * to this service, and out of react components.
12689
12853
  */
12690
12854
 
12691
12855
  /**
12692
- * Enum for subscription types
12856
+ * Enum for payment types
12693
12857
  * @readonly
12694
12858
  * @enum {string}
12695
12859
  */
12696
- const SUBSCRIPTION_TYPES = {
12860
+ const PAYMENT_TYPES = {
12697
12861
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12698
12862
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12699
12863
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12700
12864
  RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12865
+ PURCHASE_ECOMMERCE_ORDER: "PURCHASE_ECOMMERCE_ORDER",
12701
12866
  PAY_INVOICE: "PAY_INVOICE"
12702
12867
  };
12703
12868
 
@@ -12705,10 +12870,9 @@ var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
12705
12870
 
12706
12871
  var _generateUserError = /*#__PURE__*/new WeakMap();
12707
12872
 
12708
- class Subscription {
12873
+ class Payment {
12709
12874
  /**
12710
- * Subscription service constructor
12711
- * @param {(StripeGateway|PaypalGateWay)} paymentGateway
12875
+ * @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
12712
12876
  */
12713
12877
  constructor(paymentGateway) {
12714
12878
  _defineProperty$3(this, "execute", (options, callback) => {
@@ -12719,7 +12883,7 @@ class Subscription {
12719
12883
 
12720
12884
  if (!options.type) {
12721
12885
  callback(_classPrivateFieldGet(this, _generateUserError).call(this), null);
12722
- return console.error("No subscription type provided");
12886
+ return console.error("No payment type provided");
12723
12887
  } // delegate execution to paymentgateway
12724
12888
 
12725
12889
 
@@ -12729,7 +12893,7 @@ class Subscription {
12729
12893
  _isPaymentGatewayInvalid.set(this, {
12730
12894
  writable: true,
12731
12895
  value: gateway => {
12732
- return gateway && !(gateway instanceof StripeGateway) && gateway && !(gateway instanceof PaypalGateWay);
12896
+ return gateway && !(gateway instanceof StripeGateway || gateway instanceof PaypalGateway || gateway instanceof VantivGateway);
12733
12897
  }
12734
12898
  });
12735
12899
 
@@ -12737,21 +12901,21 @@ class Subscription {
12737
12901
  writable: true,
12738
12902
  value: () => {
12739
12903
  return {
12740
- error: new Error("An error has occured in the subscription service, please try again later")
12904
+ error: new Error("An error has occured in the payment service, please try again later")
12741
12905
  };
12742
12906
  }
12743
12907
  });
12744
12908
 
12745
12909
  if (_classPrivateFieldGet(this, _isPaymentGatewayInvalid).call(this, paymentGateway)) {
12746
12910
  this.paymentGateway = null;
12747
- console.error("Incompatible subscription gateway");
12911
+ console.error("Incompatible payment gateway");
12748
12912
  } else {
12749
12913
  this.paymentGateway = paymentGateway;
12750
12914
  }
12751
12915
  }
12752
12916
  /**
12753
- * @typedef subscriptionOptions
12754
- * @property {SUBSCRIPTION_TYPES} type
12917
+ * @typedef paymentOptions
12918
+ * @property {PAYMENT_TYPES} type
12755
12919
  * @property {string} token
12756
12920
  * @property {object} plan
12757
12921
  * @property {object} [product]
@@ -12762,6 +12926,7 @@ class Subscription {
12762
12926
  * @property {string} addressId
12763
12927
  * @property {number} invoiceId
12764
12928
  * @property {boolean} isExistingSource
12929
+ * @property {Array} items
12765
12930
  */
12766
12931
 
12767
12932
  /**
@@ -12772,8 +12937,8 @@ class Subscription {
12772
12937
  */
12773
12938
 
12774
12939
  /**
12775
- * Subscription execution method
12776
- * @param {subscriptionOptions} options subscription options
12940
+ * Payment execution method
12941
+ * @param {paymentOptions} options payment options
12777
12942
  * @param {executeCallback} callback
12778
12943
  * @return {void}
12779
12944
  */
@@ -12782,10 +12947,11 @@ class Subscription {
12782
12947
  }
12783
12948
  const PAYMENT_GATEWAYS_ENUM = {
12784
12949
  stripe: "stripe",
12785
- paypal: "braintree"
12950
+ paypal: "braintree",
12951
+ vantiv: "vantiv"
12786
12952
  };
12787
12953
  /**
12788
- * Subscription Strategies
12954
+ * Payment Strategies
12789
12955
  */
12790
12956
 
12791
12957
  /**
@@ -12802,6 +12968,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12802
12968
 
12803
12969
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12804
12970
 
12971
+ var _purchaseEcommerceOrder = /*#__PURE__*/new WeakMap();
12972
+
12805
12973
  var _payInvoice = /*#__PURE__*/new WeakMap();
12806
12974
 
12807
12975
  class StripeGateway {
@@ -12812,7 +12980,7 @@ class StripeGateway {
12812
12980
  });
12813
12981
 
12814
12982
  _defineProperty$3(this, "execute", (options, callback) => {
12815
- const types = SUBSCRIPTION_TYPES;
12983
+ const types = PAYMENT_TYPES;
12816
12984
 
12817
12985
  switch (options.type) {
12818
12986
  case types.CREATE_SUBSCRIPTION:
@@ -12827,11 +12995,14 @@ class StripeGateway {
12827
12995
  case types.RENEW_GIFTED_SUBSCRIPTION:
12828
12996
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12829
12997
 
12998
+ case types.PURCHASE_ECOMMERCE_ORDER:
12999
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder).call(this, options, callback);
13000
+
12830
13001
  case types.PAY_INVOICE:
12831
13002
  return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12832
13003
 
12833
13004
  default:
12834
- console.error("Unsupported subscriptiion method: Stripe Gateway");
13005
+ console.error("Unsupported payment method: Stripe Gateway");
12835
13006
  }
12836
13007
  });
12837
13008
 
@@ -12853,6 +13024,7 @@ class StripeGateway {
12853
13024
  auth_token: window.Pelcro.user.read().auth_token,
12854
13025
  plan_id: plan.id,
12855
13026
  coupon_code: couponCode,
13027
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12856
13028
  address_id: product.address_required ? addressId : null
12857
13029
  }, (err, res) => {
12858
13030
  callback(err, res);
@@ -12879,6 +13051,7 @@ class StripeGateway {
12879
13051
  auth_token: window.Pelcro.user.read().auth_token,
12880
13052
  plan_id: plan.id,
12881
13053
  coupon_code: couponCode,
13054
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12882
13055
  gift_recipient_email: giftRecipient.email,
12883
13056
  gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
12884
13057
  gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
@@ -12906,6 +13079,7 @@ class StripeGateway {
12906
13079
  stripe_token: token,
12907
13080
  auth_token: window.Pelcro.user.read().auth_token,
12908
13081
  plan_id: plan.id,
13082
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12909
13083
  coupon_code: couponCode,
12910
13084
  subscription_id: subscriptionIdToRenew,
12911
13085
  address_id: product.address_required ? addressId : null
@@ -12939,27 +13113,57 @@ class StripeGateway {
12939
13113
  }
12940
13114
  });
12941
13115
 
12942
- _payInvoice.set(this, {
13116
+ _purchaseEcommerceOrder.set(this, {
12943
13117
  writable: true,
12944
13118
  value: (options, callback) => {
12945
13119
  const {
12946
13120
  token,
12947
- invoiceId
13121
+ items,
13122
+ couponCode,
13123
+ addressId,
13124
+ isExistingSource
12948
13125
  } = options;
12949
- const params = options.isExistingSource ? {
12950
- source_id: token,
12951
- invoice_id: invoiceId
13126
+ const params = isExistingSource ? {
13127
+ source_id: token
12952
13128
  } : {
12953
13129
  payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
12954
- gateway_token: token,
12955
- invoice_id: invoiceId
13130
+ gateway_token: token
12956
13131
  };
12957
- window.Pelcro.invoice.pay(params, (err, res) => {
13132
+ window.Pelcro.ecommerce.order.create({
13133
+ items,
13134
+ coupon_code: couponCode,
13135
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13136
+ ...params,
13137
+ ...(addressId && {
13138
+ address_id: addressId
13139
+ })
13140
+ }, (err, res) => {
12958
13141
  callback(err, res);
12959
13142
  });
12960
13143
  }
12961
13144
  });
12962
- }
13145
+
13146
+ _payInvoice.set(this, {
13147
+ writable: true,
13148
+ value: (options, callback) => {
13149
+ const {
13150
+ token,
13151
+ invoiceId
13152
+ } = options;
13153
+ const params = options.isExistingSource ? {
13154
+ source_id: token,
13155
+ invoice_id: invoiceId
13156
+ } : {
13157
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
13158
+ gateway_token: token,
13159
+ invoice_id: invoiceId
13160
+ };
13161
+ window.Pelcro.invoice.pay(params, (err, res) => {
13162
+ callback(err, res);
13163
+ });
13164
+ }
13165
+ });
13166
+ }
12963
13167
 
12964
13168
  }
12965
13169
  /**
@@ -12974,7 +13178,7 @@ var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12974
13178
 
12975
13179
  var _payInvoice2 = /*#__PURE__*/new WeakMap();
12976
13180
 
12977
- class PaypalGateWay {
13181
+ class PaypalGateway {
12978
13182
  constructor() {
12979
13183
  _paymentGateway2.set(this, {
12980
13184
  writable: true,
@@ -12982,7 +13186,7 @@ class PaypalGateWay {
12982
13186
  });
12983
13187
 
12984
13188
  _defineProperty$3(this, "execute", (options, callback) => {
12985
- const types = SUBSCRIPTION_TYPES;
13189
+ const types = PAYMENT_TYPES;
12986
13190
 
12987
13191
  switch (options.type) {
12988
13192
  case types.CREATE_SUBSCRIPTION:
@@ -13016,6 +13220,7 @@ class PaypalGateWay {
13016
13220
  payment_gateway: _classPrivateFieldGet(this, _paymentGateway2),
13017
13221
  auth_token: window.Pelcro.user.read().auth_token,
13018
13222
  plan_id: plan.id,
13223
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13019
13224
  coupon_code: couponCode,
13020
13225
  address_id: product.address_required ? addressId : null
13021
13226
  }, (err, res) => {
@@ -13043,6 +13248,7 @@ class PaypalGateWay {
13043
13248
  auth_token: window.Pelcro.user.read().auth_token,
13044
13249
  plan_id: plan.id,
13045
13250
  coupon_code: couponCode,
13251
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13046
13252
  gift_recipient_email: giftRecipient.email,
13047
13253
  gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13048
13254
  gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
@@ -13075,6 +13281,241 @@ class PaypalGateWay {
13075
13281
 
13076
13282
  }
13077
13283
 
13284
+ var _paymentGateway3 = /*#__PURE__*/new WeakMap();
13285
+
13286
+ var _createSubscription3 = /*#__PURE__*/new WeakMap();
13287
+
13288
+ var _renewSubscription2 = /*#__PURE__*/new WeakMap();
13289
+
13290
+ var _createGiftedSubscription3 = /*#__PURE__*/new WeakMap();
13291
+
13292
+ var _renewGiftedSubscription2 = /*#__PURE__*/new WeakMap();
13293
+
13294
+ var _purchaseEcommerceOrder2 = /*#__PURE__*/new WeakMap();
13295
+
13296
+ var _payInvoice3 = /*#__PURE__*/new WeakMap();
13297
+
13298
+ class VantivGateway {
13299
+ constructor() {
13300
+ _paymentGateway3.set(this, {
13301
+ writable: true,
13302
+ value: PAYMENT_GATEWAYS_ENUM["vantiv"]
13303
+ });
13304
+
13305
+ _defineProperty$3(this, "execute", (options, callback) => {
13306
+ const types = PAYMENT_TYPES;
13307
+
13308
+ switch (options.type) {
13309
+ case types.CREATE_SUBSCRIPTION:
13310
+ return _classPrivateFieldGet(this, _createSubscription3).call(this, options, callback);
13311
+
13312
+ case types.RENEW_SUBSCRIPTION:
13313
+ return _classPrivateFieldGet(this, _renewSubscription2).call(this, options, callback);
13314
+
13315
+ case types.CREATE_GIFTED_SUBSCRIPTION:
13316
+ return _classPrivateFieldGet(this, _createGiftedSubscription3).call(this, options, callback);
13317
+
13318
+ case types.RENEW_GIFTED_SUBSCRIPTION:
13319
+ return _classPrivateFieldGet(this, _renewGiftedSubscription2).call(this, options, callback);
13320
+
13321
+ case types.PURCHASE_ECOMMERCE_ORDER:
13322
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder2).call(this, options, callback);
13323
+
13324
+ case types.PAY_INVOICE:
13325
+ return _classPrivateFieldGet(this, _payInvoice3).call(this, options, callback);
13326
+
13327
+ default:
13328
+ console.error("Unsupported payment method: vantiv Gateway");
13329
+ }
13330
+ });
13331
+
13332
+ _createSubscription3.set(this, {
13333
+ writable: true,
13334
+ value: (options, callback) => {
13335
+ const {
13336
+ token,
13337
+ plan,
13338
+ couponCode,
13339
+ product,
13340
+ quantity = 1,
13341
+ addressId,
13342
+ isExistingSource
13343
+ } = options;
13344
+ const params = isExistingSource ? {
13345
+ source_id: token
13346
+ } : {
13347
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13348
+ gateway_token: token
13349
+ };
13350
+ window.Pelcro.subscription.create({
13351
+ quantity,
13352
+ auth_token: window.Pelcro.user.read().auth_token,
13353
+ plan_id: plan.id,
13354
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13355
+ coupon_code: couponCode,
13356
+ address_id: product.address_required ? addressId : null,
13357
+ ...params
13358
+ }, (err, res) => {
13359
+ callback(err, res);
13360
+ });
13361
+ }
13362
+ });
13363
+
13364
+ _renewSubscription2.set(this, {
13365
+ writable: true,
13366
+ value: (options, callback) => {
13367
+ const {
13368
+ subscriptionIdToRenew,
13369
+ token,
13370
+ plan,
13371
+ couponCode,
13372
+ product,
13373
+ addressId,
13374
+ isExistingSource
13375
+ } = options;
13376
+ const params = isExistingSource ? {
13377
+ source_id: token
13378
+ } : {
13379
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13380
+ gateway_token: token
13381
+ };
13382
+ window.Pelcro.subscription.renew({
13383
+ auth_token: window.Pelcro.user.read().auth_token,
13384
+ plan_id: plan.id,
13385
+ coupon_code: couponCode,
13386
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13387
+ subscription_id: subscriptionIdToRenew,
13388
+ address_id: product.address_required ? addressId : null,
13389
+ ...params
13390
+ }, (err, res) => {
13391
+ callback(err, res);
13392
+ });
13393
+ }
13394
+ });
13395
+
13396
+ _createGiftedSubscription3.set(this, {
13397
+ writable: true,
13398
+ value: (options, callback) => {
13399
+ const {
13400
+ token,
13401
+ plan,
13402
+ couponCode,
13403
+ product,
13404
+ giftRecipient,
13405
+ quantity = 1,
13406
+ addressId,
13407
+ isExistingSource
13408
+ } = options;
13409
+ const params = isExistingSource ? {
13410
+ source_id: token
13411
+ } : {
13412
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13413
+ gateway_token: token
13414
+ };
13415
+ window.Pelcro.subscription.create({
13416
+ quantity,
13417
+ auth_token: window.Pelcro.user.read().auth_token,
13418
+ plan_id: plan.id,
13419
+ coupon_code: couponCode,
13420
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13421
+ gift_recipient_email: giftRecipient.email,
13422
+ gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13423
+ gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
13424
+ gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
13425
+ gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
13426
+ address_id: product.address_required ? addressId : null,
13427
+ ...params
13428
+ }, (err, res) => {
13429
+ callback(err, res);
13430
+ });
13431
+ }
13432
+ });
13433
+
13434
+ _renewGiftedSubscription2.set(this, {
13435
+ writable: true,
13436
+ value: (options, callback) => {
13437
+ const {
13438
+ subscriptionIdToRenew,
13439
+ token,
13440
+ product,
13441
+ plan,
13442
+ couponCode,
13443
+ addressId,
13444
+ isExistingSource
13445
+ } = options;
13446
+ const params = isExistingSource ? {
13447
+ source_id: token
13448
+ } : {
13449
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13450
+ gateway_token: token
13451
+ };
13452
+ window.Pelcro.subscription.renewGift({
13453
+ auth_token: window.Pelcro.user.read().auth_token,
13454
+ plan_id: plan.id,
13455
+ coupon_code: couponCode,
13456
+ subscription_id: subscriptionIdToRenew,
13457
+ address_id: product.address_required ? addressId : null,
13458
+ ...params
13459
+ }, (err, res) => {
13460
+ callback(err, res);
13461
+ });
13462
+ }
13463
+ });
13464
+
13465
+ _purchaseEcommerceOrder2.set(this, {
13466
+ writable: true,
13467
+ value: (options, callback) => {
13468
+ const {
13469
+ token,
13470
+ items,
13471
+ couponCode,
13472
+ addressId,
13473
+ isExistingSource
13474
+ } = options;
13475
+ const params = isExistingSource ? {
13476
+ source_id: token
13477
+ } : {
13478
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13479
+ gateway_token: token
13480
+ };
13481
+ window.Pelcro.ecommerce.order.create({
13482
+ items,
13483
+ coupon_code: couponCode,
13484
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13485
+ ...params,
13486
+ ...(addressId && {
13487
+ address_id: addressId
13488
+ })
13489
+ }, (err, res) => {
13490
+ callback(err, res);
13491
+ });
13492
+ }
13493
+ });
13494
+
13495
+ _payInvoice3.set(this, {
13496
+ writable: true,
13497
+ value: (options, callback) => {
13498
+ const {
13499
+ token,
13500
+ invoiceId
13501
+ } = options;
13502
+ const params = options.isExistingSource ? {
13503
+ source_id: token,
13504
+ invoice_id: invoiceId
13505
+ } : {
13506
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13507
+ gateway_token: token,
13508
+ invoice_id: invoiceId
13509
+ };
13510
+ window.Pelcro.invoice.pay(params, (err, res) => {
13511
+ callback(err, res);
13512
+ });
13513
+ }
13514
+ });
13515
+ }
13516
+
13517
+ }
13518
+
13078
13519
  /**
13079
13520
  * @typedef {Object} PaymentStateType
13080
13521
  * @property {boolean} disableSubmit
@@ -13095,7 +13536,7 @@ class PaypalGateWay {
13095
13536
 
13096
13537
  /** @type {PaymentStateType} */
13097
13538
 
13098
- const initialState$f = {
13539
+ const initialState$g = {
13099
13540
  disableSubmit: false,
13100
13541
  isLoading: false,
13101
13542
  disableCouponButton: false,
@@ -13114,10 +13555,10 @@ const initialState$f = {
13114
13555
  content: ""
13115
13556
  }
13116
13557
  };
13117
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
13558
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
13118
13559
  const {
13119
- Provider: Provider$f
13120
- } = store$f;
13560
+ Provider: Provider$g
13561
+ } = store$g;
13121
13562
 
13122
13563
  const PaymentMethodContainerWithoutStripe = ({
13123
13564
  style,
@@ -13130,7 +13571,7 @@ const PaymentMethodContainerWithoutStripe = ({
13130
13571
  onFailure = () => {},
13131
13572
  ...props
13132
13573
  }) => {
13133
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
13574
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isGift, _props$isRenewingGift, _props$invoice;
13134
13575
 
13135
13576
  const {
13136
13577
  t
@@ -13146,6 +13587,7 @@ const PaymentMethodContainerWithoutStripe = ({
13146
13587
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
13147
13588
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
13148
13589
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
13590
+ const isGift = (_props$isGift = props.isGift) !== null && _props$isGift !== void 0 ? _props$isGift : pelcroStore.isGift;
13149
13591
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13150
13592
  const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
13151
13593
  React.useEffect(() => {
@@ -13162,6 +13604,203 @@ const PaymentMethodContainerWithoutStripe = ({
13162
13604
  updateTotalAmountWithTax();
13163
13605
  }, []);
13164
13606
 
13607
+ const submitUsingVantiv = () => {
13608
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13609
+
13610
+ if (isUsingExistingPaymentMethod) {
13611
+ // no need to create a new source using vantiv
13612
+ return handleVantivPayment(null);
13613
+ }
13614
+
13615
+ if (!vantivInstanceRef.current) {
13616
+ return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13617
+ }
13618
+
13619
+ const orderId = `pelcro-${new Date().getTime()}`;
13620
+ /*
13621
+ calls handleVantivPayment to either handle a payment or update a source by simply creating a new source
13622
+ */
13623
+
13624
+ vantivInstanceRef.current.getPaypageRegistrationId({
13625
+ id: orderId,
13626
+ orderId: orderId
13627
+ });
13628
+ };
13629
+
13630
+ function handleVantivPayment(paymentRequest) {
13631
+ if (paymentRequest) {
13632
+ const SUCCESS_STATUS = "870";
13633
+
13634
+ if (paymentRequest.response !== SUCCESS_STATUS) {
13635
+ return handlePaymentError({
13636
+ error: new Error(paymentRequest.message)
13637
+ });
13638
+ }
13639
+ }
13640
+
13641
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13642
+
13643
+ if (type === "createPayment") {
13644
+ handleVantivSubscription();
13645
+ } else if (type === "orderCreate") {
13646
+ purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
13647
+ } else if (type === "invoicePayment") {
13648
+ payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
13649
+ } else if (type === "updatePaymentSource") {
13650
+ createNewVantivCard();
13651
+ }
13652
+
13653
+ function createNewVantivCard() {
13654
+ window.Pelcro.source.create({
13655
+ auth_token: window.Pelcro.user.read().auth_token,
13656
+ token: paymentRequest,
13657
+ gateway: "vantiv"
13658
+ }, (err, res) => {
13659
+ dispatch({
13660
+ type: DISABLE_SUBMIT,
13661
+ payload: false
13662
+ });
13663
+ dispatch({
13664
+ type: LOADING,
13665
+ payload: false
13666
+ });
13667
+
13668
+ if (err) {
13669
+ onFailure(err);
13670
+ return dispatch({
13671
+ type: SHOW_ALERT,
13672
+ payload: {
13673
+ type: "error",
13674
+ content: getErrorMessages(err)
13675
+ }
13676
+ });
13677
+ }
13678
+
13679
+ dispatch({
13680
+ type: SHOW_ALERT,
13681
+ payload: {
13682
+ type: "success",
13683
+ content: t("messages.sourceUpdated")
13684
+ }
13685
+ });
13686
+ onSuccess(res);
13687
+ });
13688
+ }
13689
+
13690
+ function handleVantivSubscription() {
13691
+ const payment = new Payment(new VantivGateway());
13692
+ const createSubscription = !isGift && !subscriptionIdToRenew;
13693
+ const renewSubscription = !isGift && subscriptionIdToRenew;
13694
+ const giftSubscriprition = isGift && !subscriptionIdToRenew;
13695
+ const renewGift = isRenewingGift;
13696
+ const {
13697
+ couponCode
13698
+ } = state;
13699
+
13700
+ if (renewGift) {
13701
+ return payment.execute({
13702
+ type: PAYMENT_TYPES.RENEW_GIFTED_SUBSCRIPTION,
13703
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13704
+ plan,
13705
+ couponCode,
13706
+ product,
13707
+ isExistingSource: isUsingExistingPaymentMethod,
13708
+ subscriptionIdToRenew,
13709
+ addressId: selectedAddressId
13710
+ }, (err, res) => {
13711
+ if (err) {
13712
+ return handlePaymentError(err);
13713
+ }
13714
+
13715
+ onSuccess(res);
13716
+ });
13717
+ } else if (giftSubscriprition) {
13718
+ return payment.execute({
13719
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13720
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13721
+ quantity: plan.quantity,
13722
+ plan,
13723
+ couponCode,
13724
+ product,
13725
+ isExistingSource: isUsingExistingPaymentMethod,
13726
+ giftRecipient,
13727
+ addressId: selectedAddressId
13728
+ }, (err, res) => {
13729
+ if (err) {
13730
+ return handlePaymentError(err);
13731
+ }
13732
+
13733
+ onSuccess(res);
13734
+ });
13735
+ } else if (renewSubscription) {
13736
+ return payment.execute({
13737
+ type: PAYMENT_TYPES.RENEW_SUBSCRIPTION,
13738
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13739
+ quantity: plan.quantity,
13740
+ plan,
13741
+ couponCode,
13742
+ product,
13743
+ isExistingSource: isUsingExistingPaymentMethod,
13744
+ subscriptionIdToRenew,
13745
+ addressId: selectedAddressId
13746
+ }, (err, res) => {
13747
+ if (err) {
13748
+ return handlePaymentError(err);
13749
+ }
13750
+
13751
+ onSuccess(res);
13752
+ });
13753
+ } else if (createSubscription) {
13754
+ return payment.execute({
13755
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13756
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13757
+ quantity: plan.quantity,
13758
+ plan,
13759
+ couponCode,
13760
+ product,
13761
+ isExistingSource: isUsingExistingPaymentMethod,
13762
+ addressId: selectedAddressId
13763
+ }, (err, res) => {
13764
+ if (err) {
13765
+ return handlePaymentError(err);
13766
+ }
13767
+
13768
+ onSuccess(res);
13769
+ });
13770
+ }
13771
+ }
13772
+ }
13773
+
13774
+ const vantivInstanceRef = React__default['default'].useRef(null);
13775
+ React.useEffect(() => {
13776
+ const cardProcessor = getSiteCardProcessor();
13777
+
13778
+ if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13779
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2;
13780
+
13781
+ const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings.pay_page_id;
13782
+ const reportGroup = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.report_group;
13783
+ vantivInstanceRef.current = new window.EprotectIframeClient({
13784
+ paypageId: payPageId,
13785
+ reportGroup: reportGroup,
13786
+ style: "pelcro",
13787
+ height: "245",
13788
+ timeout: 50000,
13789
+ div: "eProtectiframe",
13790
+ callback: handleVantivPayment,
13791
+ showCvv: true,
13792
+ numYears: 8,
13793
+ placeholderText: {
13794
+ cvv: "CVV",
13795
+ accountNumber: "1234 1234 1234 1234"
13796
+ },
13797
+ enhancedUxFeatures: {
13798
+ inlineFieldValidations: true
13799
+ }
13800
+ });
13801
+ }
13802
+ }, [selectedPaymentMethodId]);
13803
+
13165
13804
  const initPaymentRequest = (state, dispatch) => {
13166
13805
  try {
13167
13806
  const paymentRequest = stripe.paymentRequest({
@@ -13232,9 +13871,9 @@ const PaymentMethodContainerWithoutStripe = ({
13232
13871
 
13233
13872
 
13234
13873
  const updateTotalAmountWithTax = () => {
13235
- var _window$Pelcro$site$r;
13874
+ var _window$Pelcro$site$r3;
13236
13875
 
13237
- const taxesEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.taxes_enabled;
13876
+ const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
13238
13877
 
13239
13878
  if (taxesEnabled && type === "createPayment") {
13240
13879
  dispatch({
@@ -13391,6 +14030,7 @@ const PaymentMethodContainerWithoutStripe = ({
13391
14030
  window.Pelcro.order.create({
13392
14031
  auth_token: window.Pelcro.user.read().auth_token,
13393
14032
  plan_id: plan.id,
14033
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13394
14034
  coupon_code: couponCode,
13395
14035
  address_id: selectedAddressId
13396
14036
  }, handleCouponResponse);
@@ -13472,6 +14112,7 @@ const PaymentMethodContainerWithoutStripe = ({
13472
14112
  stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
13473
14113
  auth_token: window.Pelcro.user.read().auth_token,
13474
14114
  plan_id: plan.id,
14115
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13475
14116
  quantity: plan.quantity,
13476
14117
  coupon_code: couponCode,
13477
14118
  gift_recipient_email: giftRecipient ? giftRecipient.email : null,
@@ -13543,6 +14184,7 @@ const PaymentMethodContainerWithoutStripe = ({
13543
14184
  stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
13544
14185
  auth_token: window.Pelcro.user.read().auth_token,
13545
14186
  plan_id: plan.id,
14187
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13546
14188
  coupon_code: couponCode,
13547
14189
  subscription_id: subscriptionIdToRenew,
13548
14190
  address_id: product.address_required ? selectedAddressId : null
@@ -13584,7 +14226,7 @@ const PaymentMethodContainerWithoutStripe = ({
13584
14226
 
13585
14227
 
13586
14228
  const handlePaypalSubscription = (state, paypalNonce) => {
13587
- const subscription = new Subscription(new PaypalGateWay());
14229
+ const payment = new Payment(new PaypalGateway());
13588
14230
  const {
13589
14231
  couponCode
13590
14232
  } = state;
@@ -13593,8 +14235,8 @@ const PaymentMethodContainerWithoutStripe = ({
13593
14235
  */
13594
14236
 
13595
14237
  if (giftRecipient) {
13596
- return subscription.execute({
13597
- type: SUBSCRIPTION_TYPES.CREATE_GIFTED_SUBSCRIPTION,
14238
+ return payment.execute({
14239
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13598
14240
  token: paypalNonce,
13599
14241
  quantity: plan.quantity,
13600
14242
  plan,
@@ -13627,8 +14269,8 @@ const PaymentMethodContainerWithoutStripe = ({
13627
14269
  });
13628
14270
  }
13629
14271
 
13630
- return subscription.execute({
13631
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
14272
+ return payment.execute({
14273
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13632
14274
  token: paypalNonce,
13633
14275
  quantity: plan.quantity,
13634
14276
  plan,
@@ -13660,7 +14302,7 @@ const PaymentMethodContainerWithoutStripe = ({
13660
14302
  });
13661
14303
  };
13662
14304
 
13663
- const purchase = (stripeSource, state, dispatch) => {
14305
+ const purchase = (gatewayService, gatewayToken, state, dispatch) => {
13664
14306
  const isQuickPurchase = !Array.isArray(order);
13665
14307
  const mappedOrderItems = isQuickPurchase ? [{
13666
14308
  sku_id: order.id,
@@ -13672,14 +14314,14 @@ const PaymentMethodContainerWithoutStripe = ({
13672
14314
  const {
13673
14315
  couponCode
13674
14316
  } = state;
13675
- window.Pelcro.ecommerce.order.create({
13676
- source_id: stripeSource.isExistingSource ? stripeSource.id : undefined,
13677
- stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
14317
+ const payment = new Payment(gatewayService);
14318
+ payment.execute({
14319
+ type: PAYMENT_TYPES.PURCHASE_ECOMMERCE_ORDER,
14320
+ token: gatewayToken,
14321
+ isExistingSource: Boolean(selectedPaymentMethodId),
13678
14322
  items: mappedOrderItems,
13679
- coupon_code: couponCode,
13680
- ...(selectedAddressId && {
13681
- address_id: selectedAddressId
13682
- })
14323
+ addressId: selectedAddressId,
14324
+ couponCode
13683
14325
  }, (err, res) => {
13684
14326
  dispatch({
13685
14327
  type: DISABLE_SUBMIT,
@@ -13717,9 +14359,9 @@ const PaymentMethodContainerWithoutStripe = ({
13717
14359
  };
13718
14360
 
13719
14361
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13720
- const subscription = new Subscription(gatewayService);
13721
- return subscription.execute({
13722
- type: SUBSCRIPTION_TYPES.PAY_INVOICE,
14362
+ const payment = new Payment(gatewayService);
14363
+ return payment.execute({
14364
+ type: PAYMENT_TYPES.PAY_INVOICE,
13723
14365
  token: gatewayToken,
13724
14366
  isExistingSource: Boolean(selectedPaymentMethodId),
13725
14367
  invoiceId: invoice.id
@@ -13764,7 +14406,9 @@ const PaymentMethodContainerWithoutStripe = ({
13764
14406
 
13765
14407
  if ((source === null || source === void 0 ? void 0 : (_source$card2 = source.card) === null || _source$card2 === void 0 ? void 0 : _source$card2.three_d_secure) === "required") {
13766
14408
  return handlePaymentError({
13767
- message: t("messages.cardAuthNotSupported")
14409
+ error: {
14410
+ message: t("messages.cardAuthNotSupported")
14411
+ }
13768
14412
  });
13769
14413
  }
13770
14414
 
@@ -13879,13 +14523,13 @@ const PaymentMethodContainerWithoutStripe = ({
13879
14523
 
13880
14524
 
13881
14525
  const resolveTaxCalculation = () => {
13882
- var _window$Pelcro$site$r2;
14526
+ var _window$Pelcro$site$r4;
13883
14527
 
13884
14528
  if (type === "invoicePayment") {
13885
14529
  return new Promise(resolve => resolve());
13886
14530
  }
13887
14531
 
13888
- const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
14532
+ 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;
13889
14533
  return new Promise((resolve, reject) => {
13890
14534
  // resolve early if taxes isn't enabled
13891
14535
  if (!taxesEnabled) {
@@ -13895,6 +14539,7 @@ const PaymentMethodContainerWithoutStripe = ({
13895
14539
  window.Pelcro.order.create({
13896
14540
  auth_token: window.Pelcro.user.read().auth_token,
13897
14541
  plan_id: plan.id,
14542
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13898
14543
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
13899
14544
  address_id: selectedAddressId
13900
14545
  }, (error, res) => {
@@ -13957,13 +14602,15 @@ const PaymentMethodContainerWithoutStripe = ({
13957
14602
  if (stripeSource && type === "createPayment") {
13958
14603
  subscribe(stripeSource, state, dispatch);
13959
14604
  } else if (stripeSource && type === "orderCreate") {
13960
- purchase(stripeSource, state, dispatch);
14605
+ purchase(new StripeGateway(), stripeSource.id, state, dispatch);
13961
14606
  } else if (stripeSource && type === "invoicePayment") {
13962
14607
  payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13963
14608
  }
13964
14609
  };
13965
14610
 
13966
14611
  const handlePaymentError = error => {
14612
+ var _getErrorMessages;
14613
+
13967
14614
  if (error.type === "validation_error" && // Subscription creation & renewal
13968
14615
  type === "createPayment") {
13969
14616
  var _state$couponObject;
@@ -13982,7 +14629,7 @@ const PaymentMethodContainerWithoutStripe = ({
13982
14629
  type: SHOW_ALERT,
13983
14630
  payload: {
13984
14631
  type: "error",
13985
- content: error === null || error === void 0 ? void 0 : error.message
14632
+ content: (_getErrorMessages = getErrorMessages(error)) !== null && _getErrorMessages !== void 0 ? _getErrorMessages : error === null || error === void 0 ? void 0 : error.message
13986
14633
  }
13987
14634
  });
13988
14635
  dispatch({
@@ -14006,7 +14653,9 @@ const PaymentMethodContainerWithoutStripe = ({
14006
14653
 
14007
14654
  if ((source === null || source === void 0 ? void 0 : source.status) === "failed") {
14008
14655
  return handlePaymentError({
14009
- message: t("messages.cardAuthFailed")
14656
+ error: {
14657
+ message: t("messages.cardAuthFailed")
14658
+ }
14010
14659
  });
14011
14660
  }
14012
14661
 
@@ -14077,6 +14726,10 @@ const PaymentMethodContainerWithoutStripe = ({
14077
14726
  disableSubmit: true,
14078
14727
  isLoading: true
14079
14728
  }, (state, dispatch) => {
14729
+ if (getSiteCardProcessor() === "vantiv") {
14730
+ return submitUsingVantiv();
14731
+ }
14732
+
14080
14733
  if (selectedPaymentMethodId) {
14081
14734
  // pay with selected method (source) if exists already
14082
14735
  return handlePayment({
@@ -14086,16 +14739,16 @@ const PaymentMethodContainerWithoutStripe = ({
14086
14739
  }
14087
14740
 
14088
14741
  if (type === "updatePaymentSource") {
14089
- updatePaymentSource(state, dispatch);
14090
- } else {
14091
- submitPayment(state);
14742
+ return updatePaymentSource(state, dispatch);
14092
14743
  }
14744
+
14745
+ submitPayment(state);
14093
14746
  });
14094
14747
 
14095
14748
  case HANDLE_PAYPAL_SUBSCRIPTION:
14096
14749
  return lib_5(state, (state, dispatch) => {
14097
14750
  if (type === "invoicePayment") {
14098
- payInvoice(new PaypalGateWay(), action.payload, dispatch);
14751
+ payInvoice(new PaypalGateway(), action.payload, dispatch);
14099
14752
  } else {
14100
14753
  handlePaypalSubscription(state, action.payload);
14101
14754
  }
@@ -14157,21 +14810,21 @@ const PaymentMethodContainerWithoutStripe = ({
14157
14810
  default:
14158
14811
  return state;
14159
14812
  }
14160
- }, initialState$f);
14813
+ }, initialState$g);
14161
14814
  return /*#__PURE__*/React__default['default'].createElement("div", {
14162
14815
  style: { ...style
14163
14816
  },
14164
14817
  className: `pelcro-container pelcro-payment-container ${className}`
14165
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
14818
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
14166
14819
  value: {
14167
14820
  state,
14168
14821
  dispatch
14169
14822
  }
14170
14823
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
14171
- store: store$f,
14824
+ store: store$g,
14172
14825
  key: i
14173
14826
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
14174
- store: store$f
14827
+ store: store$g
14175
14828
  })));
14176
14829
  };
14177
14830
 
@@ -14193,7 +14846,7 @@ const PaymentMethodContainer = props => {
14193
14846
  stripeAccount: window.Pelcro.site.read().account_id,
14194
14847
  locale: getPageOrDefaultLanguage()
14195
14848
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
14196
- store: store$f
14849
+ store: store$g
14197
14850
  }, props))));
14198
14851
  }
14199
14852
 
@@ -14246,7 +14899,7 @@ const PelcroPaymentRequestButton = props => {
14246
14899
  currentPlan,
14247
14900
  updatedPrice
14248
14901
  }
14249
- } = React.useContext(store$f);
14902
+ } = React.useContext(store$g);
14250
14903
 
14251
14904
  const updatePaymentRequest = () => {
14252
14905
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14278,19 +14931,35 @@ const CheckoutForm = () => {
14278
14931
  const {
14279
14932
  selectedPaymentMethodId
14280
14933
  } = usePelcro();
14281
- return !selectedPaymentMethodId && /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(PelcroCardNumber, {
14282
- autoFocus: true
14283
- }), /*#__PURE__*/React__default['default'].createElement("img", {
14284
- alt: "credit_cards",
14285
- className: "plc-h-4 plc-w-auto plc-mt-2",
14286
- src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14287
- }), /*#__PURE__*/React__default['default'].createElement("div", {
14288
- className: "plc-flex plc-justify-between plc-my-2 plc-items-end"
14289
- }, /*#__PURE__*/React__default['default'].createElement("div", {
14290
- className: "plc-w-6/12 plc-pr-4"
14291
- }, /*#__PURE__*/React__default['default'].createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default['default'].createElement("div", {
14292
- className: "plc-w-6/12 plc-pl-4"
14293
- }, /*#__PURE__*/React__default['default'].createElement(PelcroCardCVC, null))));
14934
+ const cardProcessor = getSiteCardProcessor();
14935
+
14936
+ if (selectedPaymentMethodId) {
14937
+ return null;
14938
+ }
14939
+
14940
+ if (cardProcessor === "vantiv") {
14941
+ return /*#__PURE__*/React__default['default'].createElement("div", {
14942
+ id: "eProtectiframe"
14943
+ });
14944
+ }
14945
+
14946
+ if (cardProcessor === "stripe") {
14947
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(PelcroCardNumber, {
14948
+ autoFocus: true
14949
+ }), /*#__PURE__*/React__default['default'].createElement("img", {
14950
+ alt: "credit_cards",
14951
+ className: "plc-w-auto plc-h-4 plc-mt-2",
14952
+ src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14953
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
14954
+ className: "plc-flex plc-items-end plc-justify-between plc-my-2"
14955
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
14956
+ className: "plc-w-6/12 plc-pr-4"
14957
+ }, /*#__PURE__*/React__default['default'].createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default['default'].createElement("div", {
14958
+ className: "plc-w-6/12 plc-pl-4"
14959
+ }, /*#__PURE__*/React__default['default'].createElement(PelcroCardCVC, null))));
14960
+ }
14961
+
14962
+ return null;
14294
14963
  };
14295
14964
 
14296
14965
  const DiscountedPrice = props => {
@@ -14306,7 +14975,7 @@ const DiscountedPrice = props => {
14306
14975
  taxAmount,
14307
14976
  percentOff
14308
14977
  }
14309
- } = React.useContext(store$f);
14978
+ } = React.useContext(store$g);
14310
14979
  const {
14311
14980
  order,
14312
14981
  plan
@@ -14356,7 +15025,7 @@ const SubmitPaymentMethod = ({
14356
15025
  isLoading,
14357
15026
  updatedPrice
14358
15027
  }
14359
- } = React.useContext(store$f);
15028
+ } = React.useContext(store$g);
14360
15029
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14361
15030
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14362
15031
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14377,17 +15046,17 @@ const SubmitPaymentMethod = ({
14377
15046
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14378
15047
  };
14379
15048
 
14380
- var _path$l;
15049
+ var _path$n;
14381
15050
 
14382
- function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
15051
+ function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
14383
15052
 
14384
15053
  function SvgArrowLeft(props) {
14385
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15054
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
14386
15055
  xmlns: "http://www.w3.org/2000/svg",
14387
15056
  fill: "none",
14388
15057
  viewBox: "0 0 24 24",
14389
15058
  stroke: "currentColor"
14390
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15059
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
14391
15060
  strokeLinecap: "round",
14392
15061
  strokeLinejoin: "round",
14393
15062
  strokeWidth: 2,
@@ -14406,7 +15075,7 @@ const ApplyCouponButton = ({
14406
15075
  disableCouponButton
14407
15076
  },
14408
15077
  dispatch
14409
- } = React.useContext(store$f);
15078
+ } = React.useContext(store$g);
14410
15079
  const {
14411
15080
  t
14412
15081
  } = useTranslation("checkoutForm");
@@ -14440,7 +15109,7 @@ const CouponCodeField = props => {
14440
15109
  couponCode,
14441
15110
  couponError
14442
15111
  }
14443
- } = React.useContext(store$f);
15112
+ } = React.useContext(store$g);
14444
15113
 
14445
15114
  const onCouponCodeChange = e => {
14446
15115
  dispatch({
@@ -14469,17 +15138,17 @@ const CouponCodeField = props => {
14469
15138
  }, props));
14470
15139
  };
14471
15140
 
14472
- var _path$k;
15141
+ var _path$m;
14473
15142
 
14474
- function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
15143
+ function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
14475
15144
 
14476
15145
  function SvgTicket(props) {
14477
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15146
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14478
15147
  xmlns: "http://www.w3.org/2000/svg",
14479
15148
  fill: "none",
14480
15149
  viewBox: "0 0 24 24",
14481
15150
  stroke: "currentColor"
14482
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15151
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14483
15152
  strokeLinecap: "round",
14484
15153
  strokeLinejoin: "round",
14485
15154
  strokeWidth: 2,
@@ -14496,7 +15165,7 @@ const CouponCode = ({
14496
15165
  state: {
14497
15166
  enableCouponField
14498
15167
  }
14499
- } = React.useContext(store$f);
15168
+ } = React.useContext(store$g);
14500
15169
  const {
14501
15170
  t
14502
15171
  } = useTranslation("checkoutForm");
@@ -14753,7 +15422,7 @@ const PaypalSubscribeButton = props => {
14753
15422
  const {
14754
15423
  dispatch,
14755
15424
  state
14756
- } = React.useContext(store$f);
15425
+ } = React.useContext(store$g);
14757
15426
  const {
14758
15427
  product,
14759
15428
  plan,
@@ -14768,7 +15437,7 @@ const PaypalSubscribeButton = props => {
14768
15437
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
14769
15438
 
14770
15439
  const initializePaypal = async () => {
14771
- var _props$buttonElementI, _props$product$addres, _props$product, _props$plan2;
15440
+ var _props$buttonElementI, _props$product$addres, _props$product;
14772
15441
 
14773
15442
  const paypalCheckoutInstance = new PaypalClient({
14774
15443
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
@@ -14778,12 +15447,33 @@ const PaypalSubscribeButton = props => {
14778
15447
  displayName: props.merchantDisplayName,
14779
15448
  locale: props.locale,
14780
15449
  billingAgreementDescription: props.billingDescription
14781
- }); // Await building paypal instance
15450
+ });
15451
+
15452
+ const getProduct = () => {
15453
+ if (invoice) {
15454
+ invoice.plan = null;
15455
+
15456
+ if (invoice.plan) {
15457
+ return invoice.plan;
15458
+ } else {
15459
+ // standalone invoices dont have a plan
15460
+ return {
15461
+ currency: invoice.currency,
15462
+ nickname: `invoice #${invoice.id}`
15463
+ };
15464
+ }
15465
+ } else if (props.plan) {
15466
+ return props.plan;
15467
+ } else {
15468
+ return plan;
15469
+ }
15470
+ }; // Await building paypal instance
15471
+
14782
15472
 
14783
15473
  await paypalCheckoutInstance.build(); // Create paypal payment
14784
15474
 
14785
15475
  paypalCheckoutInstance.createPayment({
14786
- product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
15476
+ product: getProduct(),
14787
15477
  amount: updatedPrice,
14788
15478
  address: invoice ? null : selectedAddress,
14789
15479
  onButtonClick: () => {
@@ -14839,16 +15529,16 @@ const BankRedirection = () => {
14839
15529
  }));
14840
15530
  };
14841
15531
 
14842
- var _path$j;
15532
+ var _path$l;
14843
15533
 
14844
- function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
15534
+ function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
14845
15535
 
14846
15536
  function SvgLock(props) {
14847
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
15537
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14848
15538
  xmlns: "http://www.w3.org/2000/svg",
14849
15539
  viewBox: "0 0 20 20",
14850
15540
  fill: "currentColor"
14851
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
15541
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14852
15542
  fillRule: "evenodd",
14853
15543
  d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",
14854
15544
  clipRule: "evenodd"
@@ -14865,7 +15555,7 @@ const SelectedPaymentMethod = () => {
14865
15555
  state: {
14866
15556
  isLoading
14867
15557
  }
14868
- } = React.useContext(store$f);
15558
+ } = React.useContext(store$g);
14869
15559
  const {
14870
15560
  switchView,
14871
15561
  selectedPaymentMethodId
@@ -14907,7 +15597,7 @@ const TaxAmount = () => {
14907
15597
  state: {
14908
15598
  taxAmount
14909
15599
  }
14910
- } = React.useContext(store$f);
15600
+ } = React.useContext(store$g);
14911
15601
  const {
14912
15602
  plan
14913
15603
  } = usePelcro();
@@ -14940,9 +15630,10 @@ function PaymentMethodView({
14940
15630
  const {
14941
15631
  t
14942
15632
  } = useTranslation("checkoutForm");
15633
+ const cardProcessor = getSiteCardProcessor();
14943
15634
  return /*#__PURE__*/React__default['default'].createElement("div", {
14944
15635
  className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
14945
- }, /*#__PURE__*/React__default['default'].createElement("div", {
15636
+ }, cardProcessor === "stripe" && /*#__PURE__*/React__default['default'].createElement("div", {
14946
15637
  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"
14947
15638
  }, /*#__PURE__*/React__default['default'].createElement(SvgLock, {
14948
15639
  className: "plc-w-5 plc-h-5 plc-mr-1"
@@ -15070,12 +15761,12 @@ function SubscriptionRenewModal({
15070
15761
  }
15071
15762
  SubscriptionRenewModal.viewId = "subscription-renew";
15072
15763
 
15073
- var _path$i;
15764
+ var _path$k;
15074
15765
 
15075
- function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
15766
+ function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
15076
15767
 
15077
15768
  function SvgGift(props) {
15078
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
15769
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15079
15770
  className: "plc-w-6 plc-h-6 plc-mr-2",
15080
15771
  fill: "none",
15081
15772
  stroke: "currentColor",
@@ -15084,7 +15775,7 @@ function SvgGift(props) {
15084
15775
  strokeWidth: 2,
15085
15776
  viewBox: "0 0 24 24",
15086
15777
  xmlns: "http://www.w3.org/2000/svg"
15087
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
15778
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15088
15779
  d: "M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z"
15089
15780
  })));
15090
15781
  }
@@ -15425,7 +16116,7 @@ class DefaultNewsLetter extends React.Component {
15425
16116
 
15426
16117
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15427
16118
 
15428
- const initialState$e = {
16119
+ const initialState$f = {
15429
16120
  didSubToNewslettersBefore: false,
15430
16121
  newsletters: [],
15431
16122
  isListLoading: true,
@@ -15435,10 +16126,10 @@ const initialState$e = {
15435
16126
  content: ""
15436
16127
  }
15437
16128
  };
15438
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
16129
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
15439
16130
  const {
15440
- Provider: Provider$e
15441
- } = store$e;
16131
+ Provider: Provider$f
16132
+ } = store$f;
15442
16133
 
15443
16134
  const NewsletterUpdateContainer = ({
15444
16135
  style,
@@ -15551,7 +16242,7 @@ const NewsletterUpdateContainer = ({
15551
16242
  default:
15552
16243
  return state;
15553
16244
  }
15554
- }, initialState$e);
16245
+ }, initialState$f);
15555
16246
  React.useEffect(() => {
15556
16247
  const getUserNewsletters = () => {
15557
16248
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15595,7 +16286,7 @@ const NewsletterUpdateContainer = ({
15595
16286
  style: { ...style
15596
16287
  },
15597
16288
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15598
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16289
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
15599
16290
  value: {
15600
16291
  state,
15601
16292
  dispatch
@@ -15603,12 +16294,12 @@ const NewsletterUpdateContainer = ({
15603
16294
  }, children.length ? children.map((child, i) => {
15604
16295
  if (child) {
15605
16296
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
15606
- store: store$e,
16297
+ store: store$f,
15607
16298
  key: i
15608
16299
  });
15609
16300
  }
15610
16301
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15611
- store: store$e
16302
+ store: store$f
15612
16303
  })));
15613
16304
  };
15614
16305
 
@@ -15623,7 +16314,7 @@ const NewsletterUpdateButton = ({
15623
16314
  isSubmitting,
15624
16315
  isListLoading
15625
16316
  }
15626
- } = React.useContext(store$e);
16317
+ } = React.useContext(store$f);
15627
16318
  const {
15628
16319
  t
15629
16320
  } = useTranslation("newsletter");
@@ -15653,7 +16344,7 @@ const NewsletterUpdateList = () => {
15653
16344
  newsletters,
15654
16345
  isListLoading
15655
16346
  }
15656
- } = React.useContext(store$e);
16347
+ } = React.useContext(store$f);
15657
16348
 
15658
16349
  if (isListLoading) {
15659
16350
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -15857,7 +16548,7 @@ function SubscriptionCreateModal({
15857
16548
  SubscriptionCreateModal.viewId = "subscription-create";
15858
16549
 
15859
16550
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
15860
- const initialState$d = {
16551
+ const initialState$e = {
15861
16552
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
15862
16553
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
15863
16554
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -15870,10 +16561,10 @@ const initialState$d = {
15870
16561
  content: ""
15871
16562
  }
15872
16563
  };
15873
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
16564
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
15874
16565
  const {
15875
- Provider: Provider$d
15876
- } = store$d;
16566
+ Provider: Provider$e
16567
+ } = store$e;
15877
16568
 
15878
16569
  const UserUpdateContainer = ({
15879
16570
  style,
@@ -16005,27 +16696,27 @@ const UserUpdateContainer = ({
16005
16696
  default:
16006
16697
  return state;
16007
16698
  }
16008
- }, initialState$d);
16699
+ }, initialState$e);
16009
16700
  return /*#__PURE__*/React__default['default'].createElement("div", {
16010
16701
  style: { ...style
16011
16702
  },
16012
16703
  className: `pelcro-container pelcro-user-update-container ${className}`
16013
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16704
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16014
16705
  value: {
16015
16706
  state,
16016
16707
  dispatch
16017
16708
  }
16018
16709
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16019
- store: store$d,
16710
+ store: store$e,
16020
16711
  key: i
16021
16712
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16022
- store: store$d
16713
+ store: store$e
16023
16714
  })));
16024
16715
  };
16025
16716
 
16026
16717
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
16027
16718
  disabled: true,
16028
- store: store$d
16719
+ store: store$e
16029
16720
  }, props));
16030
16721
 
16031
16722
  const UserUpdateButton = ({
@@ -16038,7 +16729,7 @@ const UserUpdateButton = ({
16038
16729
  buttonDisabled
16039
16730
  },
16040
16731
  dispatch
16041
- } = React.useContext(store$d);
16732
+ } = React.useContext(store$e);
16042
16733
  const {
16043
16734
  t
16044
16735
  } = useTranslation("userEdit");
@@ -16055,11 +16746,11 @@ const UserUpdateButton = ({
16055
16746
  };
16056
16747
 
16057
16748
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
16058
- store: store$d
16749
+ store: store$e
16059
16750
  }, props));
16060
16751
 
16061
16752
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
16062
- store: store$d
16753
+ store: store$e
16063
16754
  }, props));
16064
16755
 
16065
16756
  function Phone({
@@ -16088,22 +16779,22 @@ function Phone({
16088
16779
  }
16089
16780
 
16090
16781
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
16091
- store: store$d
16782
+ store: store$e
16092
16783
  }, props));
16093
16784
 
16094
16785
  var userSolidIcon = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20class%3D%22plc-h-5%20plc-w-5%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22white%22%3E%20%20%3Cpath%20transform%3D%22translate%280%2C2%29%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%209a3%203%200%20100-6%203%203%200%20000%206zm-7%209a7%207%200%201114%200H3z%22%20clip-rule%3D%22evenodd%22%20%2F%3E%3C%2Fsvg%3E";
16095
16786
 
16096
- var _path$h;
16787
+ var _path$j;
16097
16788
 
16098
- function _extends$j() { _extends$j = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
16789
+ function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
16099
16790
 
16100
16791
  function SvgEdit(props) {
16101
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
16792
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
16102
16793
  className: "plc-w-6 plc-h-6",
16103
16794
  xmlns: "http://www.w3.org/2000/svg",
16104
16795
  viewBox: "0 0 20 20",
16105
16796
  fill: "currentColor"
16106
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
16797
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
16107
16798
  d: "M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zm-2.207 2.207L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
16108
16799
  })));
16109
16800
  }
@@ -16235,16 +16926,16 @@ function DisplayName({
16235
16926
  }
16236
16927
 
16237
16928
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16238
- store: store$d
16929
+ store: store$e
16239
16930
  }, props));
16240
16931
 
16241
16932
  const UserUpdateTextInput = props => {
16242
16933
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16243
- store: store$d
16934
+ store: store$e
16244
16935
  }));
16245
16936
  };
16246
16937
 
16247
- const initialState$c = {
16938
+ const initialState$d = {
16248
16939
  isSubmitting: false,
16249
16940
  firstName: "",
16250
16941
  firstNameError: "",
@@ -16269,10 +16960,10 @@ const initialState$c = {
16269
16960
  content: ""
16270
16961
  }
16271
16962
  };
16272
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
16963
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
16273
16964
  const {
16274
- Provider: Provider$c
16275
- } = store$c;
16965
+ Provider: Provider$d
16966
+ } = store$d;
16276
16967
 
16277
16968
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16278
16969
 
@@ -16479,7 +17170,7 @@ const AddressCreateContainer = ({
16479
17170
  default:
16480
17171
  return state;
16481
17172
  }
16482
- }, initialState$c);
17173
+ }, initialState$d);
16483
17174
  React.useEffect(() => {
16484
17175
  const getStates = () => {
16485
17176
  dispatch({
@@ -16511,16 +17202,16 @@ const AddressCreateContainer = ({
16511
17202
  style: { ...style
16512
17203
  },
16513
17204
  className: `pelcro-container pelcro-address-create-container ${className}`
16514
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17205
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16515
17206
  value: {
16516
17207
  state,
16517
17208
  dispatch
16518
17209
  }
16519
17210
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16520
- store: store$c,
17211
+ store: store$d,
16521
17212
  key: i
16522
17213
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16523
- store: store$c
17214
+ store: store$d
16524
17215
  })));
16525
17216
  };
16526
17217
 
@@ -16531,7 +17222,7 @@ function AddressCreateFirstName(props) {
16531
17222
  firstName,
16532
17223
  firstNameError
16533
17224
  }
16534
- } = React.useContext(store$c);
17225
+ } = React.useContext(store$d);
16535
17226
 
16536
17227
  const handleBlur = () => {
16537
17228
  return dispatch({
@@ -16574,7 +17265,7 @@ function AddressCreateLastName(props) {
16574
17265
  lastName,
16575
17266
  lastNameError
16576
17267
  }
16577
- } = React.useContext(store$c);
17268
+ } = React.useContext(store$d);
16578
17269
 
16579
17270
  const handleBlur = () => {
16580
17271
  return dispatch({
@@ -16617,7 +17308,7 @@ function AddressCreateLine1(props) {
16617
17308
  line1,
16618
17309
  line1Error
16619
17310
  }
16620
- } = React.useContext(store$c);
17311
+ } = React.useContext(store$d);
16621
17312
 
16622
17313
  const handleBlur = () => {
16623
17314
  return dispatch({
@@ -16660,7 +17351,7 @@ function AddressCreateCity(props) {
16660
17351
  city,
16661
17352
  cityError
16662
17353
  }
16663
- } = React.useContext(store$c);
17354
+ } = React.useContext(store$d);
16664
17355
 
16665
17356
  const handleBlur = () => {
16666
17357
  return dispatch({
@@ -16703,7 +17394,7 @@ function AddressCreatePostalCode(props) {
16703
17394
  postalCode,
16704
17395
  postalCodeError
16705
17396
  }
16706
- } = React.useContext(store$c);
17397
+ } = React.useContext(store$d);
16707
17398
 
16708
17399
  const handleBlur = () => {
16709
17400
  return dispatch({
@@ -16749,7 +17440,7 @@ const AddressCreateSubmit = ({
16749
17440
  state: {
16750
17441
  isSubmitting
16751
17442
  }
16752
- } = React.useContext(store$c);
17443
+ } = React.useContext(store$d);
16753
17444
  const {
16754
17445
  t
16755
17446
  } = useTranslation("address");
@@ -16860,7 +17551,7 @@ function CountrySelect({
16860
17551
  }
16861
17552
 
16862
17553
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
16863
- store: store$c
17554
+ store: store$d
16864
17555
  }, props));
16865
17556
 
16866
17557
  function StateSelect({
@@ -16948,7 +17639,7 @@ function StateSelect({
16948
17639
  }
16949
17640
 
16950
17641
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
16951
- store: store$c
17642
+ store: store$d
16952
17643
  }, props));
16953
17644
 
16954
17645
  const AddressCreateView = props => {
@@ -17053,18 +17744,18 @@ AddressCreateModal.viewId = "address-create";
17053
17744
 
17054
17745
  const AddressCreateTextInput = props => {
17055
17746
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17056
- store: store$c
17747
+ store: store$d
17057
17748
  }));
17058
17749
  };
17059
17750
 
17060
17751
  const AddressCreateLine2 = props => {
17061
17752
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17062
17753
  fieldName: "line2",
17063
- store: store$c
17754
+ store: store$d
17064
17755
  }, props));
17065
17756
  };
17066
17757
 
17067
- const initialState$b = {
17758
+ const initialState$c = {
17068
17759
  isSubmitting: false,
17069
17760
  firstName: "",
17070
17761
  firstNameError: "",
@@ -17089,10 +17780,10 @@ const initialState$b = {
17089
17780
  content: ""
17090
17781
  }
17091
17782
  };
17092
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
17783
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
17093
17784
  const {
17094
- Provider: Provider$b
17095
- } = store$b;
17785
+ Provider: Provider$c
17786
+ } = store$c;
17096
17787
 
17097
17788
  const AddressUpdateContainer = ({
17098
17789
  style,
@@ -17144,7 +17835,7 @@ const AddressUpdateContainer = ({
17144
17835
  const thisAddress = addresses[address];
17145
17836
 
17146
17837
  if (+thisAddress.id === +addressId) {
17147
- const newState = { ...initialState$b,
17838
+ const newState = { ...initialState$c,
17148
17839
  firstName: thisAddress.first_name,
17149
17840
  lastName: thisAddress.last_name,
17150
17841
  line1: thisAddress.line1,
@@ -17277,7 +17968,7 @@ const AddressUpdateContainer = ({
17277
17968
  default:
17278
17969
  return state;
17279
17970
  }
17280
- }, initialState$b);
17971
+ }, initialState$c);
17281
17972
  React.useEffect(() => {
17282
17973
  const getStates = () => {
17283
17974
  dispatch({
@@ -17309,21 +18000,21 @@ const AddressUpdateContainer = ({
17309
18000
  style: { ...style
17310
18001
  },
17311
18002
  className: `pelcro-container pelcro-address-update-container ${className}`
17312
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
18003
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17313
18004
  value: {
17314
18005
  state,
17315
18006
  dispatch
17316
18007
  }
17317
18008
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17318
- store: store$b,
18009
+ store: store$c,
17319
18010
  key: i
17320
18011
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17321
- store: store$b
18012
+ store: store$c
17322
18013
  })));
17323
18014
  };
17324
18015
 
17325
18016
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17326
- store: store$b
18017
+ store: store$c
17327
18018
  }, props));
17328
18019
 
17329
18020
  function AddressUpdateFirstName(props) {
@@ -17333,7 +18024,7 @@ function AddressUpdateFirstName(props) {
17333
18024
  firstName,
17334
18025
  firstNameError
17335
18026
  }
17336
- } = React.useContext(store$b);
18027
+ } = React.useContext(store$c);
17337
18028
 
17338
18029
  const handleBlur = () => {
17339
18030
  return dispatch({
@@ -17376,7 +18067,7 @@ function AddressUpdateLastName(props) {
17376
18067
  lastName,
17377
18068
  lastNameError
17378
18069
  }
17379
- } = React.useContext(store$b);
18070
+ } = React.useContext(store$c);
17380
18071
 
17381
18072
  const handleBlur = () => {
17382
18073
  return dispatch({
@@ -17419,7 +18110,7 @@ function AddressUpdateLine1(props) {
17419
18110
  line1,
17420
18111
  line1Error
17421
18112
  }
17422
- } = React.useContext(store$b);
18113
+ } = React.useContext(store$c);
17423
18114
 
17424
18115
  const handleBlur = () => {
17425
18116
  return dispatch({
@@ -17459,7 +18150,7 @@ const AddressUpdateLine2 = props => {
17459
18150
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17460
18151
  fieldName: "line2"
17461
18152
  }, props, {
17462
- store: store$b
18153
+ store: store$c
17463
18154
  }));
17464
18155
  };
17465
18156
 
@@ -17470,7 +18161,7 @@ function AddressUpdateCity(props) {
17470
18161
  city,
17471
18162
  cityError
17472
18163
  }
17473
- } = React.useContext(store$b);
18164
+ } = React.useContext(store$c);
17474
18165
 
17475
18166
  const handleBlur = () => {
17476
18167
  return dispatch({
@@ -17513,7 +18204,7 @@ function AddressUpdatePostalCode(props) {
17513
18204
  postalCode,
17514
18205
  postalCodeError
17515
18206
  }
17516
- } = React.useContext(store$b);
18207
+ } = React.useContext(store$c);
17517
18208
 
17518
18209
  const handleBlur = () => {
17519
18210
  return dispatch({
@@ -17559,7 +18250,7 @@ const AddressUpdateSubmit = ({
17559
18250
  state: {
17560
18251
  isSubmitting
17561
18252
  }
17562
- } = React.useContext(store$b);
18253
+ } = React.useContext(store$c);
17563
18254
  const {
17564
18255
  t
17565
18256
  } = useTranslation("address");
@@ -17575,7 +18266,7 @@ const AddressUpdateSubmit = ({
17575
18266
  };
17576
18267
 
17577
18268
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17578
- store: store$b
18269
+ store: store$c
17579
18270
  }, props));
17580
18271
 
17581
18272
  const AddressUpdateView = props => {
@@ -17658,7 +18349,7 @@ AddressUpdateModal.viewId = "address-edit";
17658
18349
 
17659
18350
  const AddressUpdateTextInput = props => {
17660
18351
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17661
- store: store$b
18352
+ store: store$c
17662
18353
  }));
17663
18354
  };
17664
18355
 
@@ -17741,7 +18432,7 @@ const PaymentMethodUpdateModal = props => {
17741
18432
  };
17742
18433
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17743
18434
 
17744
- const initialState$a = {
18435
+ const initialState$b = {
17745
18436
  email: "",
17746
18437
  password: "",
17747
18438
  passwordError: null,
@@ -17754,10 +18445,10 @@ const initialState$a = {
17754
18445
  content: ""
17755
18446
  }
17756
18447
  };
17757
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
18448
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
17758
18449
  const {
17759
- Provider: Provider$a
17760
- } = store$a;
18450
+ Provider: Provider$b
18451
+ } = store$b;
17761
18452
 
17762
18453
  const PasswordResetContainer = ({
17763
18454
  style,
@@ -17814,7 +18505,7 @@ const PasswordResetContainer = ({
17814
18505
  type: SET_EMAIL,
17815
18506
  payload: window.Pelcro.helpers.getURLParameter("email")
17816
18507
  });
17817
- initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18508
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
17818
18509
  dispatch({
17819
18510
  type: SET_TOKEN,
17820
18511
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -17874,26 +18565,26 @@ const PasswordResetContainer = ({
17874
18565
  default:
17875
18566
  return state;
17876
18567
  }
17877
- }, initialState$a);
18568
+ }, initialState$b);
17878
18569
  return /*#__PURE__*/React__default['default'].createElement("div", {
17879
18570
  style: { ...style
17880
18571
  },
17881
18572
  className: `pelcro-container pelcro-password-reset-container ${className}`
17882
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18573
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17883
18574
  value: {
17884
18575
  state,
17885
18576
  dispatch
17886
18577
  }
17887
18578
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17888
- store: store$a,
18579
+ store: store$b,
17889
18580
  key: i
17890
18581
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17891
- store: store$a
18582
+ store: store$b
17892
18583
  })));
17893
18584
  };
17894
18585
 
17895
18586
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
17896
- store: store$a
18587
+ store: store$b
17897
18588
  }, props));
17898
18589
 
17899
18590
  const PasswordResetButton = ({
@@ -17906,7 +18597,7 @@ const PasswordResetButton = ({
17906
18597
  buttonDisabled
17907
18598
  },
17908
18599
  dispatch
17909
- } = React.useContext(store$a);
18600
+ } = React.useContext(store$b);
17910
18601
  const {
17911
18602
  t
17912
18603
  } = useTranslation("passwordReset");
@@ -17923,14 +18614,14 @@ const PasswordResetButton = ({
17923
18614
  };
17924
18615
 
17925
18616
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
17926
- store: store$a
18617
+ store: store$b
17927
18618
  }, props, {
17928
18619
  value: window.Pelcro.helpers.getURLParameter("email"),
17929
18620
  disabled: true
17930
18621
  }));
17931
18622
 
17932
18623
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
17933
- store: store$a
18624
+ store: store$b
17934
18625
  }, props));
17935
18626
 
17936
18627
  const PasswordResetView = props => {
@@ -17982,7 +18673,7 @@ const PasswordResetModal = ({
17982
18673
  };
17983
18674
  PasswordResetModal.viewId = "password-reset";
17984
18675
 
17985
- const initialState$9 = {
18676
+ const initialState$a = {
17986
18677
  email: "",
17987
18678
  emailError: null,
17988
18679
  buttonDisabled: false,
@@ -17991,10 +18682,10 @@ const initialState$9 = {
17991
18682
  content: ""
17992
18683
  }
17993
18684
  };
17994
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18685
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
17995
18686
  const {
17996
- Provider: Provider$9
17997
- } = store$9;
18687
+ Provider: Provider$a
18688
+ } = store$a;
17998
18689
 
17999
18690
  const PasswordForgotContainer = ({
18000
18691
  style,
@@ -18072,21 +18763,21 @@ const PasswordForgotContainer = ({
18072
18763
  default:
18073
18764
  return state;
18074
18765
  }
18075
- }, initialState$9);
18766
+ }, initialState$a);
18076
18767
  return /*#__PURE__*/React__default['default'].createElement("div", {
18077
18768
  style: { ...style
18078
18769
  },
18079
18770
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18080
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18771
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18081
18772
  value: {
18082
18773
  state,
18083
18774
  dispatch
18084
18775
  }
18085
18776
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18086
- store: store$9,
18777
+ store: store$a,
18087
18778
  key: i
18088
18779
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18089
- store: store$9
18780
+ store: store$a
18090
18781
  })));
18091
18782
  };
18092
18783
 
@@ -18102,7 +18793,7 @@ const PasswordForgotButton = ({
18102
18793
  emailError
18103
18794
  },
18104
18795
  dispatch
18105
- } = React.useContext(store$9);
18796
+ } = React.useContext(store$a);
18106
18797
  const {
18107
18798
  t
18108
18799
  } = useTranslation("passwordForgot");
@@ -18123,7 +18814,7 @@ const PasswordForgotButton = ({
18123
18814
  };
18124
18815
 
18125
18816
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18126
- store: store$9
18817
+ store: store$a
18127
18818
  }, props));
18128
18819
 
18129
18820
  const PasswordForgotView = props => {
@@ -18173,7 +18864,7 @@ const PasswordForgotModal = ({
18173
18864
  };
18174
18865
  PasswordForgotModal.viewId = "password-forgot";
18175
18866
 
18176
- const initialState$8 = {
18867
+ const initialState$9 = {
18177
18868
  currentPassword: "",
18178
18869
  newPassword: "",
18179
18870
  confirmNewPassword: "",
@@ -18187,10 +18878,10 @@ const initialState$8 = {
18187
18878
  content: ""
18188
18879
  }
18189
18880
  };
18190
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18881
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18191
18882
  const {
18192
- Provider: Provider$8
18193
- } = store$8;
18883
+ Provider: Provider$9
18884
+ } = store$9;
18194
18885
  const PasswordChangeContainer = ({
18195
18886
  style,
18196
18887
  className = "",
@@ -18342,21 +19033,21 @@ const PasswordChangeContainer = ({
18342
19033
  default:
18343
19034
  return state;
18344
19035
  }
18345
- }, initialState$8);
19036
+ }, initialState$9);
18346
19037
  return /*#__PURE__*/React__default['default'].createElement("div", {
18347
19038
  style: { ...style
18348
19039
  },
18349
19040
  className: `pelcro-container pelcro-password-change-container ${className}`
18350
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
19041
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18351
19042
  value: {
18352
19043
  state,
18353
19044
  dispatch
18354
19045
  }
18355
19046
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18356
- store: store$8,
19047
+ store: store$9,
18357
19048
  key: i
18358
19049
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18359
- store: store$8
19050
+ store: store$9
18360
19051
  })));
18361
19052
  };
18362
19053
 
@@ -18367,7 +19058,7 @@ function PasswordChangeCurrentPassword(props) {
18367
19058
  currentPassword,
18368
19059
  currentPasswordError
18369
19060
  }
18370
- } = React.useContext(store$8);
19061
+ } = React.useContext(store$9);
18371
19062
  const handleBlur = React.useCallback(() => {
18372
19063
  return dispatch({
18373
19064
  type: VALIDATE_PASSWORD
@@ -18401,7 +19092,7 @@ function PasswordChangeNewPassword(props) {
18401
19092
  newPassword,
18402
19093
  newPasswordError
18403
19094
  }
18404
- } = React.useContext(store$8);
19095
+ } = React.useContext(store$9);
18405
19096
  const handleBlur = React.useCallback(() => {
18406
19097
  return dispatch({
18407
19098
  type: VALIDATE_NEW_PASSWORD
@@ -18435,7 +19126,7 @@ function PasswordChangeConfirmNewPassword(props) {
18435
19126
  confirmNewPassword,
18436
19127
  confirmNewPasswordError
18437
19128
  }
18438
- } = React.useContext(store$8);
19129
+ } = React.useContext(store$9);
18439
19130
  const handleBlur = React.useCallback(() => {
18440
19131
  return dispatch({
18441
19132
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18476,7 +19167,7 @@ const PasswordChangeButton = ({
18476
19167
  confirmNewPasswordError
18477
19168
  },
18478
19169
  dispatch
18479
- } = React.useContext(store$8);
19170
+ } = React.useContext(store$9);
18480
19171
  const {
18481
19172
  t
18482
19173
  } = useTranslation("passwordChange");
@@ -18542,17 +19233,17 @@ const PasswordChangeModal = ({
18542
19233
  };
18543
19234
  PasswordChangeModal.viewId = "password-change";
18544
19235
 
18545
- const initialState$7 = {
19236
+ const initialState$8 = {
18546
19237
  buttonDisabled: false,
18547
19238
  alert: {
18548
19239
  type: "error",
18549
19240
  content: ""
18550
19241
  }
18551
19242
  };
18552
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19243
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18553
19244
  const {
18554
- Provider: Provider$7
18555
- } = store$7;
19245
+ Provider: Provider$8
19246
+ } = store$8;
18556
19247
 
18557
19248
  const CartContainer = ({
18558
19249
  style,
@@ -18643,21 +19334,21 @@ const CartContainer = ({
18643
19334
  default:
18644
19335
  return state;
18645
19336
  }
18646
- }, initialState$7);
19337
+ }, initialState$8);
18647
19338
  return /*#__PURE__*/React__default['default'].createElement("div", {
18648
19339
  style: { ...style
18649
19340
  },
18650
19341
  className: `pelcro-container pelcro-cart-container ${className}`
18651
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19342
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18652
19343
  value: {
18653
19344
  state,
18654
19345
  dispatch
18655
19346
  }
18656
19347
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18657
- store: store$7,
19348
+ store: store$8,
18658
19349
  key: i
18659
19350
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18660
- store: store$7
19351
+ store: store$8
18661
19352
  })));
18662
19353
  };
18663
19354
 
@@ -18694,7 +19385,7 @@ const CartSubmit = ({
18694
19385
  buttonDisabled
18695
19386
  },
18696
19387
  dispatch
18697
- } = React.useContext(store$7);
19388
+ } = React.useContext(store$8);
18698
19389
  const {
18699
19390
  t
18700
19391
  } = useTranslation("cart");
@@ -18725,7 +19416,7 @@ const CartTotalPrice = () => {
18725
19416
  state: {
18726
19417
  alert
18727
19418
  }
18728
- } = React.useContext(store$7);
19419
+ } = React.useContext(store$8);
18729
19420
  const {
18730
19421
  cartItems
18731
19422
  } = usePelcro();
@@ -19038,7 +19729,7 @@ const OrderConfirmModal = props => {
19038
19729
  };
19039
19730
  OrderConfirmModal.viewId = "order-confirm";
19040
19731
 
19041
- const initialState$6 = {
19732
+ const initialState$7 = {
19042
19733
  email: "",
19043
19734
  firstName: "",
19044
19735
  lastName: "",
@@ -19050,10 +19741,10 @@ const initialState$6 = {
19050
19741
  content: ""
19051
19742
  }
19052
19743
  };
19053
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19744
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19054
19745
  const {
19055
- Provider: Provider$6
19056
- } = store$6;
19746
+ Provider: Provider$7
19747
+ } = store$7;
19057
19748
 
19058
19749
  const GiftCreateContainer = ({
19059
19750
  style,
@@ -19157,21 +19848,21 @@ const GiftCreateContainer = ({
19157
19848
  default:
19158
19849
  return state;
19159
19850
  }
19160
- }, initialState$6);
19851
+ }, initialState$7);
19161
19852
  return /*#__PURE__*/React__default['default'].createElement("div", {
19162
19853
  style: { ...style
19163
19854
  },
19164
19855
  className: `pelcro-container pelcro-gift-create-container ${className}`
19165
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19856
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19166
19857
  value: {
19167
19858
  state,
19168
19859
  dispatch
19169
19860
  }
19170
19861
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19171
- store: store$6,
19862
+ store: store$7,
19172
19863
  key: i
19173
19864
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19174
- store: store$6
19865
+ store: store$7
19175
19866
  })));
19176
19867
  };
19177
19868
 
@@ -19185,7 +19876,7 @@ const GiftCreateSubmitButton = ({
19185
19876
  state: {
19186
19877
  disableSubmit
19187
19878
  }
19188
- } = React.useContext(store$6);
19879
+ } = React.useContext(store$7);
19189
19880
  const {
19190
19881
  t
19191
19882
  } = useTranslation("register");
@@ -19202,29 +19893,29 @@ const GiftCreateSubmitButton = ({
19202
19893
 
19203
19894
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
19204
19895
  initWithUserEmail: false,
19205
- store: store$6
19896
+ store: store$7
19206
19897
  }, props));
19207
19898
 
19208
19899
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
19209
- store: store$6
19900
+ store: store$7
19210
19901
  }, props));
19211
19902
 
19212
19903
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
19213
- store: store$6
19904
+ store: store$7
19214
19905
  }, props));
19215
19906
 
19216
- var _path$g;
19907
+ var _path$i;
19217
19908
 
19218
- function _extends$i() { _extends$i = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
19909
+ function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
19219
19910
 
19220
19911
  function SvgInfoCircle(props) {
19221
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
19912
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
19222
19913
  xmlns: "http://www.w3.org/2000/svg",
19223
19914
  className: "plc-w-5 plc-h-5",
19224
19915
  fill: "none",
19225
19916
  viewBox: "0 0 24 24",
19226
19917
  stroke: "currentColor"
19227
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
19918
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
19228
19919
  strokeLinecap: "round",
19229
19920
  strokeLinejoin: "round",
19230
19921
  strokeWidth: 2,
@@ -19295,7 +19986,7 @@ const GiftCreateStartDate = props => {
19295
19986
  const {
19296
19987
  dispatch,
19297
19988
  state
19298
- } = React.useContext(store$6);
19989
+ } = React.useContext(store$7);
19299
19990
 
19300
19991
  const handleInputChange = value => {
19301
19992
  dispatch({
@@ -19368,7 +20059,7 @@ function GiftCreateMessage(props) {
19368
20059
  const {
19369
20060
  dispatch,
19370
20061
  state
19371
- } = React.useContext(store$6);
20062
+ } = React.useContext(store$7);
19372
20063
  const MAX_CHARS_COUNT = 200;
19373
20064
  const remainingCharsCount = (_ref = MAX_CHARS_COUNT - ((_state$giftMessage = state.giftMessage) === null || _state$giftMessage === void 0 ? void 0 : _state$giftMessage.length)) !== null && _ref !== void 0 ? _ref : 0;
19374
20065
 
@@ -19492,7 +20183,7 @@ const GiftCreateModal = ({
19492
20183
  };
19493
20184
  GiftCreateModal.viewId = "gift-create";
19494
20185
 
19495
- const initialState$5 = {
20186
+ const initialState$6 = {
19496
20187
  giftCode: "",
19497
20188
  buttonDisabled: true,
19498
20189
  alert: {
@@ -19500,10 +20191,10 @@ const initialState$5 = {
19500
20191
  content: ""
19501
20192
  }
19502
20193
  };
19503
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20194
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19504
20195
  const {
19505
- Provider: Provider$5
19506
- } = store$5;
20196
+ Provider: Provider$6
20197
+ } = store$6;
19507
20198
 
19508
20199
  const GiftRedeemContainer = ({
19509
20200
  style,
@@ -19568,21 +20259,21 @@ const GiftRedeemContainer = ({
19568
20259
  default:
19569
20260
  return state;
19570
20261
  }
19571
- }, initialState$5);
20262
+ }, initialState$6);
19572
20263
  return /*#__PURE__*/React__default['default'].createElement("div", {
19573
20264
  style: { ...style
19574
20265
  },
19575
20266
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19576
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20267
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19577
20268
  value: {
19578
20269
  state,
19579
20270
  dispatch
19580
20271
  }
19581
20272
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19582
- store: store$5,
20273
+ store: store$6,
19583
20274
  key: i
19584
20275
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19585
- store: store$5
20276
+ store: store$6
19586
20277
  })));
19587
20278
  };
19588
20279
 
@@ -19619,7 +20310,7 @@ function GiftCode({
19619
20310
  }
19620
20311
 
19621
20312
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
19622
- store: store$5
20313
+ store: store$6
19623
20314
  }, props));
19624
20315
 
19625
20316
  const GiftRedeemSubmitButton = ({
@@ -19632,7 +20323,7 @@ const GiftRedeemSubmitButton = ({
19632
20323
  state: {
19633
20324
  disableSubmit
19634
20325
  }
19635
- } = React.useContext(store$5);
20326
+ } = React.useContext(store$6);
19636
20327
  const {
19637
20328
  t
19638
20329
  } = useTranslation("register");
@@ -19725,7 +20416,7 @@ const moveDefaultAddressToStart = addresses => {
19725
20416
  return [defaultAddress, ...addressesWithoutDefault];
19726
20417
  };
19727
20418
 
19728
- const initialState$4 = {
20419
+ const initialState$5 = {
19729
20420
  addresses: [],
19730
20421
  selectedAddressId: null,
19731
20422
  isSubmitting: false,
@@ -19734,10 +20425,10 @@ const initialState$4 = {
19734
20425
  content: ""
19735
20426
  }
19736
20427
  };
19737
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20428
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19738
20429
  const {
19739
- Provider: Provider$4
19740
- } = store$4;
20430
+ Provider: Provider$5
20431
+ } = store$5;
19741
20432
 
19742
20433
  const AddressSelectContainer = ({
19743
20434
  style,
@@ -19832,7 +20523,7 @@ const AddressSelectContainer = ({
19832
20523
  default:
19833
20524
  return state;
19834
20525
  }
19835
- }, initialState$4);
20526
+ }, initialState$5);
19836
20527
  React.useEffect(() => {
19837
20528
  var _window$Pelcro$user$r;
19838
20529
 
@@ -19845,16 +20536,16 @@ const AddressSelectContainer = ({
19845
20536
  style: { ...style
19846
20537
  },
19847
20538
  className: `pelcro-container pelcro-address-select-container ${className}`
19848
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20539
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
19849
20540
  value: {
19850
20541
  state,
19851
20542
  dispatch
19852
20543
  }
19853
20544
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19854
- store: store$4,
20545
+ store: store$5,
19855
20546
  key: i
19856
20547
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19857
- store: store$4
20548
+ store: store$5
19858
20549
  })));
19859
20550
  };
19860
20551
 
@@ -19865,7 +20556,7 @@ const AddressSelectList = () => {
19865
20556
  addresses,
19866
20557
  selectedAddressId
19867
20558
  }
19868
- } = React.useContext(store$4);
20559
+ } = React.useContext(store$5);
19869
20560
 
19870
20561
  const handleAddressSelect = event => {
19871
20562
  dispatch({
@@ -19909,7 +20600,7 @@ const AddressSelectSubmit = ({
19909
20600
  selectedAddressId,
19910
20601
  isSubmitting
19911
20602
  }
19912
- } = React.useContext(store$4);
20603
+ } = React.useContext(store$5);
19913
20604
  const {
19914
20605
  t
19915
20606
  } = useTranslation("address");
@@ -20005,7 +20696,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20005
20696
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20006
20697
  };
20007
20698
 
20008
- const initialState$3 = {
20699
+ const initialState$4 = {
20009
20700
  paymentMethods: [],
20010
20701
  selectedPaymentMethodId: null,
20011
20702
  isSubmitting: false,
@@ -20014,10 +20705,10 @@ const initialState$3 = {
20014
20705
  content: ""
20015
20706
  }
20016
20707
  };
20017
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
20708
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20018
20709
  const {
20019
- Provider: Provider$3
20020
- } = store$3;
20710
+ Provider: Provider$4
20711
+ } = store$4;
20021
20712
 
20022
20713
  const PaymentMethodSelectContainer = ({
20023
20714
  style,
@@ -20076,7 +20767,7 @@ const PaymentMethodSelectContainer = ({
20076
20767
  default:
20077
20768
  return state;
20078
20769
  }
20079
- }, initialState$3);
20770
+ }, initialState$4);
20080
20771
  React.useEffect(() => {
20081
20772
  var _window$Pelcro$user$r3;
20082
20773
 
@@ -20089,16 +20780,16 @@ const PaymentMethodSelectContainer = ({
20089
20780
  style: { ...style
20090
20781
  },
20091
20782
  className: `pelcro-container pelcro-payment-select-container ${className}`
20092
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
20783
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20093
20784
  value: {
20094
20785
  state,
20095
20786
  dispatch
20096
20787
  }
20097
20788
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20098
- store: store$3,
20789
+ store: store$4,
20099
20790
  key: i
20100
20791
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20101
- store: store$3
20792
+ store: store$4
20102
20793
  })));
20103
20794
  };
20104
20795
 
@@ -20112,7 +20803,7 @@ const PaymentMethodSelectList = () => {
20112
20803
  paymentMethods,
20113
20804
  selectedPaymentMethodId
20114
20805
  }
20115
- } = React.useContext(store$3);
20806
+ } = React.useContext(store$4);
20116
20807
 
20117
20808
  const handlePaymentMethodSelect = event => {
20118
20809
  dispatch({
@@ -20162,7 +20853,7 @@ const PaymentMethodSelectSubmit = ({
20162
20853
  selectedPaymentMethodId,
20163
20854
  isSubmitting
20164
20855
  }
20165
- } = React.useContext(store$3);
20856
+ } = React.useContext(store$4);
20166
20857
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20167
20858
  onClick: () => {
20168
20859
  dispatch({
@@ -20236,8 +20927,8 @@ const PaymentMethodSelectModal = ({
20236
20927
  };
20237
20928
  PaymentMethodSelectModal.viewId = "payment-method-select";
20238
20929
 
20239
- function _extends$h() {
20240
- _extends$h = Object.assign || function (target) {
20930
+ function _extends$j() {
20931
+ _extends$j = Object.assign || function (target) {
20241
20932
  for (var i = 1; i < arguments.length; i++) {
20242
20933
  var source = arguments[i];
20243
20934
 
@@ -20251,7 +20942,7 @@ function _extends$h() {
20251
20942
  return target;
20252
20943
  };
20253
20944
 
20254
- return _extends$h.apply(this, arguments);
20945
+ return _extends$j.apply(this, arguments);
20255
20946
  }
20256
20947
 
20257
20948
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20435,7 +21126,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20435
21126
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20436
21127
  return null;
20437
21128
  }, _match[RenderStrategy.Hidden] = function () {
20438
- return _render(_extends$h({}, _rest, {
21129
+ return _render(_extends$j({}, _rest, {
20439
21130
  hidden: true,
20440
21131
  style: {
20441
21132
  display: 'none'
@@ -20963,7 +21654,7 @@ function TransitionChild(props) {
20963
21654
  var passthroughProps = rest;
20964
21655
  return React__default['default'].createElement(NestingContext.Provider, {
20965
21656
  value: nesting
20966
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21657
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20967
21658
  }
20968
21659
 
20969
21660
  function Transition(props) {
@@ -21007,7 +21698,7 @@ function Transition(props) {
21007
21698
  value: nestingBag
21008
21699
  }, React__default['default'].createElement(TransitionContext.Provider, {
21009
21700
  value: transitionBag
21010
- }, render(_extends$h({}, sharedProps, {
21701
+ }, render(_extends$j({}, sharedProps, {
21011
21702
  as: React.Fragment,
21012
21703
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21013
21704
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21134,12 +21825,12 @@ var ActionTypes;
21134
21825
  })(ActionTypes || (ActionTypes = {}));
21135
21826
 
21136
21827
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21137
- return _extends$h({}, state, {
21828
+ return _extends$j({}, state, {
21138
21829
  activeItemIndex: null,
21139
21830
  menuState: MenuStates.Closed
21140
21831
  });
21141
21832
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21142
- return _extends$h({}, state, {
21833
+ return _extends$j({}, state, {
21143
21834
  menuState: MenuStates.Open
21144
21835
  });
21145
21836
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21158,7 +21849,7 @@ var ActionTypes;
21158
21849
  }
21159
21850
  });
21160
21851
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21161
- return _extends$h({}, state, {
21852
+ return _extends$j({}, state, {
21162
21853
  searchQuery: '',
21163
21854
  activeItemIndex: activeItemIndex
21164
21855
  });
@@ -21169,19 +21860,19 @@ var ActionTypes;
21169
21860
 
21170
21861
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21171
21862
  });
21172
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21863
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21173
21864
  searchQuery: searchQuery
21174
21865
  });
21175
- return _extends$h({}, state, {
21866
+ return _extends$j({}, state, {
21176
21867
  searchQuery: searchQuery,
21177
21868
  activeItemIndex: match
21178
21869
  });
21179
21870
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21180
- return _extends$h({}, state, {
21871
+ return _extends$j({}, state, {
21181
21872
  searchQuery: ''
21182
21873
  });
21183
21874
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21184
- return _extends$h({}, state, {
21875
+ return _extends$j({}, state, {
21185
21876
  items: [].concat(state.items, [{
21186
21877
  id: action.id,
21187
21878
  dataRef: action.dataRef
@@ -21194,7 +21885,7 @@ var ActionTypes;
21194
21885
  return a.id === action.id;
21195
21886
  });
21196
21887
  if (idx !== -1) nextItems.splice(idx, 1);
21197
- return _extends$h({}, state, {
21888
+ return _extends$j({}, state, {
21198
21889
  items: nextItems,
21199
21890
  activeItemIndex: function () {
21200
21891
  if (idx === state.activeItemIndex) return null;
@@ -21233,19 +21924,19 @@ var ActionTypes$1;
21233
21924
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21234
21925
  if (state.disabled) return state;
21235
21926
  if (state.listboxState === ListboxStates.Closed) return state;
21236
- return _extends$h({}, state, {
21927
+ return _extends$j({}, state, {
21237
21928
  activeOptionIndex: null,
21238
21929
  listboxState: ListboxStates.Closed
21239
21930
  });
21240
21931
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21241
21932
  if (state.disabled) return state;
21242
21933
  if (state.listboxState === ListboxStates.Open) return state;
21243
- return _extends$h({}, state, {
21934
+ return _extends$j({}, state, {
21244
21935
  listboxState: ListboxStates.Open
21245
21936
  });
21246
21937
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21247
21938
  if (state.disabled === action.disabled) return state;
21248
- return _extends$h({}, state, {
21939
+ return _extends$j({}, state, {
21249
21940
  disabled: action.disabled
21250
21941
  });
21251
21942
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21266,7 +21957,7 @@ var ActionTypes$1;
21266
21957
  }
21267
21958
  });
21268
21959
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21269
- return _extends$h({}, state, {
21960
+ return _extends$j({}, state, {
21270
21961
  searchQuery: '',
21271
21962
  activeOptionIndex: activeOptionIndex
21272
21963
  });
@@ -21279,10 +21970,10 @@ var ActionTypes$1;
21279
21970
 
21280
21971
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21281
21972
  });
21282
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21973
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21283
21974
  searchQuery: searchQuery
21284
21975
  });
21285
- return _extends$h({}, state, {
21976
+ return _extends$j({}, state, {
21286
21977
  searchQuery: searchQuery,
21287
21978
  activeOptionIndex: match
21288
21979
  });
@@ -21290,11 +21981,11 @@ var ActionTypes$1;
21290
21981
  if (state.disabled) return state;
21291
21982
  if (state.listboxState === ListboxStates.Closed) return state;
21292
21983
  if (state.searchQuery === '') return state;
21293
- return _extends$h({}, state, {
21984
+ return _extends$j({}, state, {
21294
21985
  searchQuery: ''
21295
21986
  });
21296
21987
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21297
- return _extends$h({}, state, {
21988
+ return _extends$j({}, state, {
21298
21989
  options: [].concat(state.options, [{
21299
21990
  id: action.id,
21300
21991
  dataRef: action.dataRef
@@ -21307,7 +21998,7 @@ var ActionTypes$1;
21307
21998
  return a.id === action.id;
21308
21999
  });
21309
22000
  if (idx !== -1) nextOptions.splice(idx, 1);
21310
- return _extends$h({}, state, {
22001
+ return _extends$j({}, state, {
21311
22002
  options: nextOptions,
21312
22003
  activeOptionIndex: function () {
21313
22004
  if (idx === state.activeOptionIndex) return null;
@@ -21368,18 +22059,18 @@ const getPaymentCardIcon = name => {
21368
22059
  }));
21369
22060
  };
21370
22061
 
21371
- var _path$f;
22062
+ var _path$h;
21372
22063
 
21373
- function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
22064
+ function _extends$i() { _extends$i = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
21374
22065
 
21375
22066
  function SvgChevronRight(props) {
21376
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
22067
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
21377
22068
  className: "plc-w-6 plc-h-6",
21378
22069
  xmlns: "http://www.w3.org/2000/svg",
21379
22070
  fill: "none",
21380
22071
  viewBox: "0 0 24 24",
21381
22072
  stroke: "currentColor"
21382
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
22073
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
21383
22074
  strokeLinecap: "round",
21384
22075
  strokeLinejoin: "round",
21385
22076
  strokeWidth: 2,
@@ -21595,18 +22286,18 @@ const SavedItems = ({
21595
22286
  });
21596
22287
  };
21597
22288
 
21598
- var _path$e;
22289
+ var _path$g;
21599
22290
 
21600
- function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
22291
+ function _extends$h() { _extends$h = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
21601
22292
 
21602
22293
  function SvgRefresh(props) {
21603
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22294
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21604
22295
  className: "plc-w-4 plc-h-4 plc-mr-1",
21605
22296
  xmlns: "http://www.w3.org/2000/svg",
21606
22297
  fill: "none",
21607
22298
  viewBox: "0 0 24 24",
21608
22299
  stroke: "currentColor"
21609
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22300
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21610
22301
  strokeLinecap: "round",
21611
22302
  strokeLinejoin: "round",
21612
22303
  strokeWidth: 2,
@@ -21614,35 +22305,35 @@ function SvgRefresh(props) {
21614
22305
  })));
21615
22306
  }
21616
22307
 
21617
- var _path$d;
22308
+ var _path$f;
21618
22309
 
21619
- function _extends$e() { _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
22310
+ function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
21620
22311
 
21621
22312
  function SvgCalendar(props) {
21622
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22313
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21623
22314
  xmlns: "http://www.w3.org/2000/svg",
21624
22315
  className: "plc-h-4 plc-w-4 plc-mr-1",
21625
22316
  viewBox: "0 0 20 20",
21626
22317
  fill: "currentColor"
21627
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22318
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21628
22319
  fillRule: "evenodd",
21629
22320
  d: "M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",
21630
22321
  clipRule: "evenodd"
21631
22322
  })));
21632
22323
  }
21633
22324
 
21634
- var _path$c;
22325
+ var _path$e;
21635
22326
 
21636
- function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
22327
+ function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
21637
22328
 
21638
22329
  function SvgPlus(props) {
21639
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22330
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21640
22331
  className: "plc-w-5 plc-h-5",
21641
22332
  xmlns: "http://www.w3.org/2000/svg",
21642
22333
  fill: "none",
21643
22334
  viewBox: "0 0 24 24",
21644
22335
  stroke: "currentColor"
21645
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22336
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21646
22337
  strokeLinecap: "round",
21647
22338
  strokeLinejoin: "round",
21648
22339
  strokeWidth: 2,
@@ -21650,17 +22341,17 @@ function SvgPlus(props) {
21650
22341
  })));
21651
22342
  }
21652
22343
 
21653
- var _path$b;
22344
+ var _path$d;
21654
22345
 
21655
- function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
22346
+ function _extends$e() { _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
21656
22347
 
21657
22348
  function SvgCheckMark(props) {
21658
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22349
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21659
22350
  className: "plc-w-4 plc-h-4 plc-mr-1",
21660
22351
  xmlns: "http://www.w3.org/2000/svg",
21661
22352
  viewBox: "0 0 20 20",
21662
22353
  fill: "currentColor"
21663
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22354
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21664
22355
  fillRule: "evenodd",
21665
22356
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
21666
22357
  clipRule: "evenodd"
@@ -21724,7 +22415,8 @@ const SubscriptionsItems = ({
21724
22415
  } = useTranslation("dashboard");
21725
22416
  const {
21726
22417
  switchView,
21727
- isAuthenticated
22418
+ switchToAddressView,
22419
+ switchToPaymentView
21728
22420
  } = usePelcro();
21729
22421
  const subs = getNonDonationSubs();
21730
22422
  if (subs.length === 0) return null;
@@ -21766,7 +22458,12 @@ const SubscriptionsItems = ({
21766
22458
  const plan = window.Pelcro.plan.getById(plan_id);
21767
22459
  setProductAndPlan(product, plan);
21768
22460
  setSubscriptionIdToRenew(sub.id);
21769
- setView("plan-select");
22461
+
22462
+ if (product.address_required) {
22463
+ return switchToAddressView();
22464
+ }
22465
+
22466
+ return switchToPaymentView();
21770
22467
  };
21771
22468
 
21772
22469
  const getPhases = () => {
@@ -21955,18 +22652,18 @@ Accordion.item = function AccordionItem({
21955
22652
  }, content)) : null;
21956
22653
  };
21957
22654
 
21958
- var _path$a;
22655
+ var _path$c;
21959
22656
 
21960
- function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
22657
+ function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
21961
22658
 
21962
22659
  function SvgExit(props) {
21963
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22660
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
21964
22661
  className: "plc-w-6 plc-h-6",
21965
22662
  xmlns: "http://www.w3.org/2000/svg",
21966
22663
  fill: "none",
21967
22664
  viewBox: "0 0 24 24",
21968
22665
  stroke: "currentColor"
21969
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22666
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
21970
22667
  strokeLinecap: "round",
21971
22668
  strokeLinejoin: "round",
21972
22669
  strokeWidth: 2,
@@ -21974,17 +22671,17 @@ function SvgExit(props) {
21974
22671
  })));
21975
22672
  }
21976
22673
 
21977
- var _path$9;
22674
+ var _path$b;
21978
22675
 
21979
- function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
22676
+ function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
21980
22677
 
21981
22678
  function SvgUser(props) {
21982
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22679
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
21983
22680
  xmlns: "http://www.w3.org/2000/svg",
21984
22681
  fill: "none",
21985
22682
  viewBox: "0 0 24 24",
21986
22683
  stroke: "currentColor"
21987
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22684
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
21988
22685
  strokeLinecap: "round",
21989
22686
  strokeLinejoin: "round",
21990
22687
  strokeWidth: 2,
@@ -21992,18 +22689,18 @@ function SvgUser(props) {
21992
22689
  })));
21993
22690
  }
21994
22691
 
21995
- var _path$8;
22692
+ var _path$a;
21996
22693
 
21997
- function _extends$9() { _extends$9 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
22694
+ function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
21998
22695
 
21999
22696
  function SvgNewsletter(props) {
22000
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22697
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22001
22698
  xmlns: "http://www.w3.org/2000/svg",
22002
22699
  className: "plc-h-5 plc-w-5",
22003
22700
  fill: "none",
22004
22701
  viewBox: "0 0 24 24",
22005
22702
  stroke: "currentColor"
22006
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22703
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22007
22704
  strokeLinecap: "round",
22008
22705
  strokeLinejoin: "round",
22009
22706
  strokeWidth: 2,
@@ -22011,18 +22708,37 @@ function SvgNewsletter(props) {
22011
22708
  })));
22012
22709
  }
22013
22710
 
22014
- var _path$7;
22711
+ var _path$9;
22712
+
22713
+ function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
22015
22714
 
22016
- function _extends$8() { _extends$8 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
22715
+ function SvgDocument(props) {
22716
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22717
+ xmlns: "http://www.w3.org/2000/svg",
22718
+ className: "plc-h-6 plc-w-6 plc-mr-2",
22719
+ fill: "none",
22720
+ viewBox: "0 0 24 24",
22721
+ stroke: "currentColor"
22722
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22723
+ strokeLinecap: "round",
22724
+ strokeLinejoin: "round",
22725
+ strokeWidth: 2,
22726
+ d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
22727
+ })));
22728
+ }
22729
+
22730
+ var _path$8;
22731
+
22732
+ function _extends$9() { _extends$9 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
22017
22733
 
22018
22734
  function SvgPaymentCard(props) {
22019
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22735
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22020
22736
  className: "plc-w-6 plc-h-6 plc-mr-2",
22021
22737
  xmlns: "http://www.w3.org/2000/svg",
22022
22738
  fill: "none",
22023
22739
  viewBox: "0 0 24 24",
22024
22740
  stroke: "currentColor"
22025
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22741
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22026
22742
  strokeLinecap: "round",
22027
22743
  strokeLinejoin: "round",
22028
22744
  strokeWidth: 2,
@@ -22030,18 +22746,18 @@ function SvgPaymentCard(props) {
22030
22746
  })));
22031
22747
  }
22032
22748
 
22033
- var _path$6, _path2$1;
22749
+ var _path$7, _path2$1;
22034
22750
 
22035
- function _extends$7() { _extends$7 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
22751
+ function _extends$8() { _extends$8 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
22036
22752
 
22037
22753
  function SvgLocationPin(props) {
22038
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22754
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22039
22755
  className: "plc-w-6 plc-h-6 plc-mr-2",
22040
22756
  xmlns: "http://www.w3.org/2000/svg",
22041
22757
  fill: "none",
22042
22758
  viewBox: "0 0 24 24",
22043
22759
  stroke: "currentColor"
22044
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22760
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22045
22761
  strokeLinecap: "round",
22046
22762
  strokeLinejoin: "round",
22047
22763
  strokeWidth: 2,
@@ -22056,10 +22772,10 @@ function SvgLocationPin(props) {
22056
22772
 
22057
22773
  var _switch;
22058
22774
 
22059
- function _extends$6() { _extends$6 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
22775
+ function _extends$7() { _extends$7 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
22060
22776
 
22061
22777
  function SvgSubscription(props) {
22062
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22778
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22063
22779
  xmlns: "http://www.w3.org/2000/svg",
22064
22780
  viewBox: "0 0 100 125",
22065
22781
  fill: "currentColor"
@@ -22074,18 +22790,18 @@ function SvgSubscription(props) {
22074
22790
  }))))));
22075
22791
  }
22076
22792
 
22077
- var _path$5;
22793
+ var _path$6;
22078
22794
 
22079
- function _extends$5() { _extends$5 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
22795
+ function _extends$6() { _extends$6 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
22080
22796
 
22081
22797
  function SvgShopping(props) {
22082
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22798
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22083
22799
  className: "plc-w-6 plc-h-6 plc-mr-2",
22084
22800
  xmlns: "http://www.w3.org/2000/svg",
22085
22801
  fill: "none",
22086
22802
  viewBox: "0 0 24 24",
22087
22803
  stroke: "currentColor"
22088
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22804
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22089
22805
  strokeLinecap: "round",
22090
22806
  strokeLinejoin: "round",
22091
22807
  strokeWidth: 2,
@@ -22093,18 +22809,18 @@ function SvgShopping(props) {
22093
22809
  })));
22094
22810
  }
22095
22811
 
22096
- var _path$4;
22812
+ var _path$5;
22097
22813
 
22098
- function _extends$4() { _extends$4 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
22814
+ function _extends$5() { _extends$5 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
22099
22815
 
22100
22816
  function SvgBookmark(props) {
22101
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22817
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22102
22818
  className: "plc-w-6 plc-h-6 plc-mr-2",
22103
22819
  xmlns: "http://www.w3.org/2000/svg",
22104
22820
  fill: "none",
22105
22821
  viewBox: "0 0 24 24",
22106
22822
  stroke: "currentColor"
22107
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22823
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22108
22824
  strokeLinecap: "round",
22109
22825
  strokeLinejoin: "round",
22110
22826
  strokeWidth: 2,
@@ -22112,33 +22828,33 @@ function SvgBookmark(props) {
22112
22828
  })));
22113
22829
  }
22114
22830
 
22115
- var _path$3;
22831
+ var _path$4;
22116
22832
 
22117
- function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
22833
+ function _extends$4() { _extends$4 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
22118
22834
 
22119
22835
  function SvgKey(props) {
22120
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22836
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22121
22837
  xmlns: "http://www.w3.org/2000/svg",
22122
22838
  viewBox: "0 0 20 20",
22123
22839
  fill: "currentColor"
22124
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22840
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22125
22841
  fillRule: "evenodd",
22126
22842
  d: "M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",
22127
22843
  clipRule: "evenodd"
22128
22844
  })));
22129
22845
  }
22130
22846
 
22131
- var _path$2;
22847
+ var _path$3;
22132
22848
 
22133
- function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
22849
+ function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
22134
22850
 
22135
22851
  function SvgDonate(props) {
22136
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
22852
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22137
22853
  width: 24,
22138
22854
  height: 24,
22139
22855
  fill: "currentColor",
22140
22856
  xmlns: "http://www.w3.org/2000/svg"
22141
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
22857
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22142
22858
  d: "M4 21h9.62a3.995 3.995 0 003.037-1.397l5.102-5.952a1 1 0 00-.442-1.6l-1.968-.656a3.043 3.043 0 00-2.823.503l-3.185 2.547-.617-1.235A3.98 3.98 0 009.146 11H4c-1.103 0-2 .897-2 2v6c0 1.103.897 2 2 2zm0-8h5.146c.763 0 1.448.423 1.789 1.105l.447.895H7v2h6.014a.996.996 0 00.442-.11l.003-.001.004-.002h.003l.002-.001h.004l.001-.001c.009.003.003-.001.003-.001.01 0 .002-.001.002-.001h.001l.002-.001.003-.001.002-.001.002-.001.003-.001.002-.001c.003 0 .001-.001.002-.001l.003-.002.002-.001.002-.001.003-.001.002-.001h.001l.002-.001h.001l.002-.001.002-.001c.009-.001.003-.001.003-.001l.002-.001a.915.915 0 00.11-.078l4.146-3.317c.262-.208.623-.273.94-.167l.557.186-4.133 4.823a2.029 2.029 0 01-1.52.688H4v-6zM16 2h-.017c-.163.002-1.006.039-1.983.705-.951-.648-1.774-.7-1.968-.704L12.002 2h-.004c-.801 0-1.555.313-2.119.878C9.313 3.445 9 4.198 9 5s.313 1.555.861 2.104l3.414 3.586a1.006 1.006 0 001.45-.001l3.396-3.568C18.688 6.555 19 5.802 19 5s-.313-1.555-.878-2.121A2.978 2.978 0 0016.002 2H16zm1 3c0 .267-.104.518-.311.725L14 8.55l-2.707-2.843C11.104 5.518 11 5.267 11 5s.104-.518.294-.708A.977.977 0 0111.979 4c.025.001.502.032 1.067.485.081.065.163.139.247.222l.707.707.707-.707c.084-.083.166-.157.247-.222.529-.425.976-.478 1.052-.484a.987.987 0 01.701.292c.189.189.293.44.293.707z"
22143
22859
  })));
22144
22860
  }
@@ -22174,17 +22890,149 @@ const DonationsMenu = () => {
22174
22890
  }), subscriptions));
22175
22891
  };
22176
22892
 
22177
- function getDonationSubs() {
22178
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22893
+ function getDonationSubs() {
22894
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22895
+
22896
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22897
+ const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
22898
+ return [...donations, ...canceledDonations];
22899
+ }
22900
+
22901
+ function formatStartDate(date) {
22902
+ const startDate = new Date(date);
22903
+ return new Intl.DateTimeFormat("en-CA").format(startDate);
22904
+ }
22905
+
22906
+ const InvoicesMenu = props => {
22907
+ const {
22908
+ t
22909
+ } = useTranslation("dashboard");
22910
+ return /*#__PURE__*/React__default['default'].createElement("table", {
22911
+ className: "plc-w-full plc-table-fixed"
22912
+ }, /*#__PURE__*/React__default['default'].createElement("thead", {
22913
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22914
+ }, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", {
22915
+ className: "plc-w-4/12 "
22916
+ }, t("labels.details")), /*#__PURE__*/React__default['default'].createElement("th", {
22917
+ className: "plc-w-4/12 "
22918
+ }, t("labels.status.title")), /*#__PURE__*/React__default['default'].createElement("th", {
22919
+ className: "plc-w-3/12 "
22920
+ }, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, /*#__PURE__*/React__default['default'].createElement("tr", {
22921
+ className: "plc-h-4"
22922
+ }), /*#__PURE__*/React__default['default'].createElement(InvoicesItems, props)));
22923
+ };
22924
+
22925
+ const InvoicesItems = () => {
22926
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22927
+
22928
+ const {
22929
+ t
22930
+ } = useTranslation("dashboard");
22931
+ const {
22932
+ setInvoice,
22933
+ switchView
22934
+ } = usePelcro();
22935
+ 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 : [];
22936
+
22937
+ const showInvoiceDetails = event => {
22938
+ if (setInvoice(event.target.dataset.id)) {
22939
+ switchView("invoice-details");
22940
+ }
22941
+ };
22942
+
22943
+ if (invoices.length === 0) return null;
22944
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22945
+ const invoiceStatus = getInvoiceStatus(invoice);
22946
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22947
+ return /*#__PURE__*/React__default['default'].createElement("tr", {
22948
+ key: invoice.id,
22949
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22950
+ }, /*#__PURE__*/React__default['default'].createElement("td", {
22951
+ className: "plc-truncate"
22952
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22953
+ className: "plc-font-semibold plc-text-gray-500"
22954
+ }, `#${invoice.id}`), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22955
+ className: "plc-text-sm plc-text-gray-500"
22956
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22957
+ className: "plc-text-sm plc-text-gray-500"
22958
+ }, formattedCreationDate)), /*#__PURE__*/React__default['default'].createElement("td", {
22959
+ className: "plc-py-2"
22960
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22961
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22962
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
22963
+ variant: "ghost",
22964
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22965
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, {
22966
+ className: "plc-w-4 plc-h-4"
22967
+ }),
22968
+ onClick: showInvoiceDetails,
22969
+ "data-id": invoice.id
22970
+ }, t("labels.view"))));
22971
+ });
22972
+ };
22973
+
22974
+ function getInvoiceStatus(invoice) {
22975
+ const translations = i18next.t("dashboard:labels", {
22976
+ returnObjects: true
22977
+ });
22978
+
22979
+ switch (invoice.status) {
22980
+ case "paid":
22981
+ return {
22982
+ textColor: "plc-text-green-700",
22983
+ bgColor: "plc-bg-green-100",
22984
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCheckMark, null),
22985
+ title: translations.paid
22986
+ };
22987
+
22988
+ case "past_due":
22989
+ return {
22990
+ textColor: "plc-text-orange-700",
22991
+ bgColor: "plc-bg-orange-100",
22992
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22993
+ title: translations.pastDue
22994
+ };
22179
22995
 
22180
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22181
- const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
22182
- return [...donations, ...canceledDonations];
22183
- }
22996
+ case "open":
22997
+ return {
22998
+ textColor: "plc-text-yellow-700",
22999
+ bgColor: "plc-bg-yellow-100",
23000
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
23001
+ title: translations.open
23002
+ };
22184
23003
 
22185
- function formatStartDate(date) {
22186
- const startDate = new Date(date);
22187
- return new Intl.DateTimeFormat("en-CA").format(startDate);
23004
+ case "draft":
23005
+ return {
23006
+ textColor: "plc-text-blue-700",
23007
+ bgColor: "plc-bg-blue-100",
23008
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, null),
23009
+ title: translations.draft
23010
+ };
23011
+
23012
+ case "scheduled":
23013
+ return {
23014
+ textColor: "plc-text-blue-700",
23015
+ bgColor: "plc-bg-blue-100",
23016
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCalendar, null),
23017
+ title: translations.scheduled
23018
+ };
23019
+
23020
+ case "uncollectible":
23021
+ return {
23022
+ textColor: "plc-text-red-700",
23023
+ bgColor: "plc-bg-red-100",
23024
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
23025
+ title: translations.uncollectible
23026
+ };
23027
+
23028
+ case "void":
23029
+ return {
23030
+ textColor: "plc-text-gray-700",
23031
+ bgColor: "plc-bg-gray-100",
23032
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
23033
+ title: translations.void
23034
+ };
23035
+ }
22188
23036
  }
22189
23037
 
22190
23038
  const SUB_MENUS = {
@@ -22333,9 +23181,10 @@ class Dashboard extends React.Component {
22333
23181
  }) => {
22334
23182
  if (isGift) {
22335
23183
  this.props.setProductAndPlan(null, null, true);
23184
+ return this.props.setView("plan-select");
22336
23185
  }
22337
23186
 
22338
- return this.props.setView("plan-select");
23187
+ return this.props.setView("subscription-options");
22339
23188
  });
22340
23189
 
22341
23190
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -22740,6 +23589,12 @@ class Dashboard extends React.Component {
22740
23589
  icon: /*#__PURE__*/React__default['default'].createElement(SvgShopping, null),
22741
23590
  title: this.locale("labels.orders.label"),
22742
23591
  content: /*#__PURE__*/React__default['default'].createElement(OrdersMenu, null)
23592
+ }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
23593
+ show: hasInvoices(),
23594
+ name: SUB_MENUS.INVOICES,
23595
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, null),
23596
+ title: this.locale("labels.invoices"),
23597
+ content: /*#__PURE__*/React__default['default'].createElement(InvoicesMenu, null)
22743
23598
  }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
22744
23599
  name: SUB_MENUS.SAVED_ITEMS,
22745
23600
  icon: /*#__PURE__*/React__default['default'].createElement(SvgBookmark, null),
@@ -22755,6 +23610,13 @@ class Dashboard extends React.Component {
22755
23610
 
22756
23611
  }
22757
23612
 
23613
+ function hasInvoices() {
23614
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
23615
+
23616
+ 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 : [];
23617
+ return invoices.length > 0;
23618
+ }
23619
+
22758
23620
  function hasDonationSubs() {
22759
23621
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22760
23622
 
@@ -22790,7 +23652,7 @@ const DashboardOpenButton = () => {
22790
23652
  };
22791
23653
  DashboardOpenButton.viewId = "dashboard-open";
22792
23654
 
22793
- const initialState$2 = {
23655
+ const initialState$3 = {
22794
23656
  imageSrc: null,
22795
23657
  crop: {
22796
23658
  x: 0,
@@ -22804,10 +23666,10 @@ const initialState$2 = {
22804
23666
  content: ""
22805
23667
  }
22806
23668
  };
22807
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
23669
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
22808
23670
  const {
22809
- Provider: Provider$2
22810
- } = store$2;
23671
+ Provider: Provider$3
23672
+ } = store$3;
22811
23673
 
22812
23674
  const ProfilePicChangeContainer = ({
22813
23675
  style,
@@ -22941,21 +23803,21 @@ const ProfilePicChangeContainer = ({
22941
23803
  default:
22942
23804
  return state;
22943
23805
  }
22944
- }, initialState$2);
23806
+ }, initialState$3);
22945
23807
  return /*#__PURE__*/React__default['default'].createElement("div", {
22946
23808
  style: { ...style
22947
23809
  },
22948
23810
  className: `pelcro-container pelcro-profile-picture-container ${className}`
22949
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
23811
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
22950
23812
  value: {
22951
23813
  state,
22952
23814
  dispatch
22953
23815
  }
22954
23816
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
22955
- store: store$2,
23817
+ store: store$3,
22956
23818
  key: i
22957
23819
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
22958
- store: store$2
23820
+ store: store$3
22959
23821
  })));
22960
23822
  };
22961
23823
  /**
@@ -23017,7 +23879,7 @@ const ProfilePicChangeButton = ({
23017
23879
  isSubmitting
23018
23880
  },
23019
23881
  dispatch
23020
- } = React.useContext(store$2);
23882
+ } = React.useContext(store$3);
23021
23883
  const {
23022
23884
  t
23023
23885
  } = useTranslation("userEdit");
@@ -24385,7 +25247,7 @@ const ProfilePicChangeCropper = ({
24385
25247
  zoom
24386
25248
  },
24387
25249
  dispatch
24388
- } = React.useContext(store$2);
25250
+ } = React.useContext(store$3);
24389
25251
  return /*#__PURE__*/React__default['default'].createElement("div", {
24390
25252
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24391
25253
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -24427,7 +25289,7 @@ const ProfilePicChangeZoom = ({
24427
25289
  zoom
24428
25290
  },
24429
25291
  dispatch
24430
- } = React.useContext(store$2);
25292
+ } = React.useContext(store$3);
24431
25293
  const {
24432
25294
  t
24433
25295
  } = useTranslation("userEdit");
@@ -24450,18 +25312,18 @@ const ProfilePicChangeZoom = ({
24450
25312
  }, otherProps)));
24451
25313
  };
24452
25314
 
24453
- var _path$1;
25315
+ var _path$2;
24454
25316
 
24455
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
25317
+ function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
24456
25318
 
24457
25319
  function SvgPhotograph(props) {
24458
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25320
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
24459
25321
  xmlns: "http://www.w3.org/2000/svg",
24460
25322
  className: "plc-h-6 plc-w-6",
24461
25323
  fill: "none",
24462
25324
  viewBox: "0 0 24 24",
24463
25325
  stroke: "currentColor"
24464
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25326
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
24465
25327
  strokeLinecap: "round",
24466
25328
  strokeLinejoin: "round",
24467
25329
  strokeWidth: 2,
@@ -24479,7 +25341,7 @@ const ProfilePicChangeSelectButton = ({
24479
25341
  state: {
24480
25342
  isSubmitting
24481
25343
  }
24482
- } = React.useContext(store$2);
25344
+ } = React.useContext(store$3);
24483
25345
  const {
24484
25346
  t
24485
25347
  } = useTranslation("userEdit");
@@ -24521,7 +25383,7 @@ const ProfilePicChangeRemoveButton = ({
24521
25383
  state: {
24522
25384
  isSubmitting
24523
25385
  }
24524
- } = React.useContext(store$2);
25386
+ } = React.useContext(store$3);
24525
25387
  const {
24526
25388
  t
24527
25389
  } = useTranslation("userEdit");
@@ -24544,7 +25406,7 @@ const ProfilePicChangeWrapper = () => {
24544
25406
  state: {
24545
25407
  imageSrc
24546
25408
  }
24547
- } = React.useContext(store$2);
25409
+ } = React.useContext(store$3);
24548
25410
  const {
24549
25411
  t
24550
25412
  } = useTranslation("userEdit");
@@ -24606,17 +25468,17 @@ function ProfilePicChangeModal({
24606
25468
  }
24607
25469
  ProfilePicChangeModal.viewId = "profile-picture";
24608
25470
 
24609
- const initialState$1 = {
25471
+ const initialState$2 = {
24610
25472
  isSubmitting: false,
24611
25473
  alert: {
24612
25474
  type: "error",
24613
25475
  content: ""
24614
25476
  }
24615
25477
  };
24616
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25478
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
24617
25479
  const {
24618
- Provider: Provider$1
24619
- } = store$1;
25480
+ Provider: Provider$2
25481
+ } = store$2;
24620
25482
 
24621
25483
  const EmailVerifyContainer = ({
24622
25484
  style,
@@ -24679,21 +25541,21 @@ const EmailVerifyContainer = ({
24679
25541
  default:
24680
25542
  return state;
24681
25543
  }
24682
- }, initialState$1);
25544
+ }, initialState$2);
24683
25545
  return /*#__PURE__*/React__default['default'].createElement("div", {
24684
25546
  style: { ...style
24685
25547
  },
24686
25548
  className: `pelcro-container pelcro-email-verify-container ${className}`
24687
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25549
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
24688
25550
  value: {
24689
25551
  state,
24690
25552
  dispatch
24691
25553
  }
24692
25554
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
24693
- store: store$1,
25555
+ store: store$2,
24694
25556
  key: i
24695
25557
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
24696
- store: store$1
25558
+ store: store$2
24697
25559
  })));
24698
25560
  };
24699
25561
 
@@ -24707,7 +25569,7 @@ const EmailVerifyResendButton = ({
24707
25569
  state: {
24708
25570
  isSubmitting
24709
25571
  }
24710
- } = React.useContext(store$1);
25572
+ } = React.useContext(store$2);
24711
25573
  const {
24712
25574
  t
24713
25575
  } = useTranslation("verifyEmail");
@@ -24722,16 +25584,16 @@ const EmailVerifyResendButton = ({
24722
25584
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
24723
25585
  };
24724
25586
 
24725
- var _path, _path2;
25587
+ var _path$1, _path2;
24726
25588
 
24727
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25589
+ function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
24728
25590
 
24729
25591
  function SvgEmailVerify(props) {
24730
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25592
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
24731
25593
  className: "plc-w-6 plc-h-6",
24732
25594
  viewBox: "0 0 700 700",
24733
25595
  xmlns: "http://www.w3.org/2000/svg"
24734
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25596
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
24735
25597
  d: "M583.01 231.93a15.008 15.008 0 00-.887-3.875c-.562-1.254-1.129-2.508-1.695-3.762a14.686 14.686 0 00-1.898-1.789c-.438-.437-.653-1.027-1.153-1.414l-56.266-44.164v-52.484a15.555 15.555 0 00-15.554-15.555H434.56l-74.945-58.895a15.547 15.547 0 00-19.227 0l-74.945 58.895h-70.996a15.555 15.555 0 00-15.555 15.555v52.484l-56.266 44.16c-.496.39-.715.996-1.152 1.43v.004a13.37 13.37 0 00-1.898 1.773c-.22.426-.414.86-.59 1.305a14.158 14.158 0 00-1.106 2.457 15.009 15.009 0 00-.886 3.875c0 .48-.329.918-.329 1.398l.004 264.45a15.555 15.555 0 0015.555 15.555h435.55a15.555 15.555 0 0015.555-15.555v-264.45c0-.48-.278-.918-.325-1.398zm-41.176.809l-20.723 14.809v-31.11zm-191.83-150.73l34.223 26.883h-68.445zm-140 57.992h280v124.45c.07 1.593.383 3.168.934 4.664l-140.93 100.66-140.46-100.33c.214-.77.37-1.555.464-2.348zm-31.109 107.55l-20.719-14.81 20.719-16.27zm-31.113 234.67V263.56l193.18 137.99a15.562 15.562 0 0018.078 0l193.18-137.99v218.66z"
24736
25598
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
24737
25599
  d: "M324.33 291.81a15.56 15.56 0 0020.582-.297l85.555-77.777a15.56 15.56 0 00-20.938-23.023l-75.398 68.539-44.023-37.723a15.54 15.54 0 00-11.46-4.106 15.553 15.553 0 00-8.758 27.718z"
@@ -24835,11 +25697,11 @@ const invoicePaymentSubmitButton = props => {
24835
25697
  return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
24836
25698
  };
24837
25699
 
24838
- const initialState = {};
24839
- const store = /*#__PURE__*/React.createContext(initialState);
25700
+ const initialState$1 = {};
25701
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
24840
25702
  const {
24841
- Provider
24842
- } = store;
25703
+ Provider: Provider$1
25704
+ } = store$1;
24843
25705
 
24844
25706
  const InvoiceDetailsContainer = ({
24845
25707
  style,
@@ -24860,21 +25722,21 @@ const InvoiceDetailsContainer = ({
24860
25722
  default:
24861
25723
  return state;
24862
25724
  }
24863
- }, initialState);
25725
+ }, initialState$1);
24864
25726
  return /*#__PURE__*/React__default['default'].createElement("div", {
24865
25727
  style: { ...style
24866
25728
  },
24867
25729
  className: `pelcro-container pelcro-invoice-details-container ${className}`
24868
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25730
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
24869
25731
  value: {
24870
25732
  state,
24871
25733
  dispatch
24872
25734
  }
24873
25735
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
24874
- store,
25736
+ store: store$1,
24875
25737
  key: i
24876
25738
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
24877
- store
25739
+ store: store$1
24878
25740
  })));
24879
25741
  };
24880
25742
 
@@ -24906,7 +25768,7 @@ const InvoiceDetailsPayButton = ({
24906
25768
  }) => {
24907
25769
  const {
24908
25770
  dispatch
24909
- } = React.useContext(store);
25771
+ } = React.useContext(store$1);
24910
25772
  const {
24911
25773
  t
24912
25774
  } = useTranslation("invoiceDetails");
@@ -24928,6 +25790,8 @@ const InvoiceDetailsView = props => {
24928
25790
  invoice
24929
25791
  } = usePelcro();
24930
25792
  const showPayButton = canPayInvoice(invoice);
25793
+ const showDownloadButton = Boolean(invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf);
25794
+ const hasPlanDetails = Boolean(invoice.plan);
24931
25795
  const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
24932
25796
  const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
24933
25797
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -24945,7 +25809,7 @@ const InvoiceDetailsView = props => {
24945
25809
  className: "plc-font-bold pelcro-invoice-summary-title"
24946
25810
  }, t("labels.summary")), invoice && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
24947
25811
  className: "plc-mr-2 pelcro-invoice-creation-date"
24948
- }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default['default'].createElement("div", {
25812
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), hasPlanDetails && /*#__PURE__*/React__default['default'].createElement("div", {
24949
25813
  className: "plc-flex plc-items-center plc-pt-2 plc-mt-2 plc-border-t plc-border-gray-400 plc-min-h-12 plc-justify-between pelcro-invoice-plan-wrapper"
24950
25814
  }, /*#__PURE__*/React__default['default'].createElement("div", {
24951
25815
  className: "plc-break-words pelcro-invoice-plan-name"
@@ -24971,7 +25835,7 @@ const InvoiceDetailsView = props => {
24971
25835
  className: "plc-font-semibold pelcro-invoice-total"
24972
25836
  }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default['default'].createElement("div", {
24973
25837
  className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
24974
- }, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
25838
+ }, showDownloadButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
24975
25839
  url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
24976
25840
  className: "plc-w-full plc-text-center"
24977
25841
  }), showPayButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsPayButton, {
@@ -25011,6 +25875,232 @@ const InvoiceDetailsModal = ({
25011
25875
  };
25012
25876
  InvoiceDetailsModal.viewId = "invoice-details";
25013
25877
 
25878
+ const initialState = {
25879
+ selectedOption: ""
25880
+ };
25881
+ const store = /*#__PURE__*/React.createContext(initialState);
25882
+ const {
25883
+ Provider
25884
+ } = store;
25885
+
25886
+ const SubscriptionOptionsContainer = ({
25887
+ style,
25888
+ className = "",
25889
+ onRenewSubSuccess = () => {},
25890
+ onNewSubSuccess = () => {},
25891
+ children,
25892
+ ...props
25893
+ }) => {
25894
+ const submit = ({
25895
+ selectedOption
25896
+ }, dispatch) => {
25897
+ if (selectedOption === "renew") return onRenewSubSuccess();
25898
+ if (selectedOption === "new") return onNewSubSuccess();
25899
+ };
25900
+
25901
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25902
+ switch (action.type) {
25903
+ case SWITCH_TO_NEW:
25904
+ return lib_7({ ...state,
25905
+ selectedOption: "new"
25906
+ });
25907
+
25908
+ case SWITCH_TO_RENEW:
25909
+ return lib_7({ ...state,
25910
+ selectedOption: "renew"
25911
+ });
25912
+
25913
+ case HANDLE_SUBMIT:
25914
+ return lib_4((state, dispatch) => submit(state));
25915
+
25916
+ default:
25917
+ return state;
25918
+ }
25919
+ }, initialState);
25920
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25921
+ style: { ...style
25922
+ },
25923
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25924
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25925
+ value: {
25926
+ state,
25927
+ dispatch
25928
+ }
25929
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25930
+ store,
25931
+ key: i
25932
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25933
+ store
25934
+ })));
25935
+ };
25936
+
25937
+ var _path;
25938
+
25939
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25940
+
25941
+ function SvgPlusCircle(props) {
25942
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25943
+ xmlns: "http://www.w3.org/2000/svg",
25944
+ className: "plc-h-6 plc-w-6",
25945
+ fill: "none",
25946
+ viewBox: "0 0 24 24",
25947
+ stroke: "currentColor",
25948
+ strokeWidth: 2
25949
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25950
+ strokeLinecap: "round",
25951
+ strokeLinejoin: "round",
25952
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25953
+ })));
25954
+ }
25955
+
25956
+ const SubscriptionOptionsNewButton = ({
25957
+ name,
25958
+ onClick,
25959
+ ...otherProps
25960
+ }) => {
25961
+ const {
25962
+ dispatch,
25963
+ state: {
25964
+ selectedOption
25965
+ }
25966
+ } = React.useContext(store);
25967
+ const {
25968
+ t
25969
+ } = useTranslation("subscriptionOptions");
25970
+ const isChecked = selectedOption === "new";
25971
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25972
+ className: "plc-hidden pelcro-new-sub-option",
25973
+ labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-new-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
25974
+ id: "pelcro-new-sub-option",
25975
+ name: "option",
25976
+ onChange: () => {
25977
+ dispatch({
25978
+ type: SWITCH_TO_NEW
25979
+ });
25980
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25981
+ },
25982
+ checked: isChecked
25983
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default['default'].createElement(SvgPlusCircle, {
25984
+ className: "plc-w-full plc-h-full plc-mr-0"
25985
+ }));
25986
+ };
25987
+
25988
+ const SubscriptionOptionsRenewButton = ({
25989
+ name,
25990
+ onClick,
25991
+ ...otherProps
25992
+ }) => {
25993
+ const {
25994
+ dispatch,
25995
+ state: {
25996
+ selectedOption
25997
+ }
25998
+ } = React.useContext(store);
25999
+ const {
26000
+ t
26001
+ } = useTranslation("subscriptionOptions");
26002
+ const isChecked = selectedOption === "renew";
26003
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
26004
+ className: "plc-hidden pelcro-renew-sub-option",
26005
+ labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-renew-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
26006
+ id: "pelcro-renew-sub-option",
26007
+ name: "option",
26008
+ onChange: () => {
26009
+ dispatch({
26010
+ type: SWITCH_TO_RENEW
26011
+ });
26012
+ onClick === null || onClick === void 0 ? void 0 : onClick();
26013
+ },
26014
+ checked: isChecked
26015
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default['default'].createElement(SvgRefresh, {
26016
+ className: "plc-w-full plc-h-full plc-mr-0"
26017
+ }));
26018
+ };
26019
+
26020
+ const SubscriptionOptionsSubmit = ({
26021
+ name,
26022
+ onClick,
26023
+ ...otherProps
26024
+ }) => {
26025
+ const {
26026
+ dispatch,
26027
+ state: {
26028
+ selectedOption
26029
+ }
26030
+ } = React.useContext(store);
26031
+ const {
26032
+ t
26033
+ } = useTranslation("subscriptionOptions");
26034
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
26035
+ onClick: () => {
26036
+ dispatch({
26037
+ type: HANDLE_SUBMIT
26038
+ });
26039
+ onClick === null || onClick === void 0 ? void 0 : onClick();
26040
+ },
26041
+ disabled: !selectedOption
26042
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
26043
+ };
26044
+
26045
+ const SubscriptionOptionsView = props => {
26046
+ const {
26047
+ t
26048
+ } = useTranslation("subscriptionOptions");
26049
+ return /*#__PURE__*/React__default['default'].createElement("div", {
26050
+ id: "pelcro-subscription-options-view"
26051
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
26052
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
26053
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
26054
+ className: "plc-text-2xl plc-font-semibold"
26055
+ }, t("title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
26056
+ action: "javascript:void(0);",
26057
+ className: "plc-mt-2 pelcro-form"
26058
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
26059
+ className: "plc-flex plc-justify-between plc-items-center"
26060
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsSubmit, {
26061
+ role: "submit",
26062
+ className: "plc-mt-4 plc-w-full",
26063
+ name: t("next"),
26064
+ id: "pelcro-submit"
26065
+ }))));
26066
+ };
26067
+
26068
+ const SubscriptionOptionsModal = ({
26069
+ onDisplay,
26070
+ onClose,
26071
+ ...otherProps
26072
+ }) => {
26073
+ const {
26074
+ switchView,
26075
+ setProductsList
26076
+ } = usePelcro();
26077
+
26078
+ const onRenewSubSuccess = () => {
26079
+ var _otherProps$onRenewSu;
26080
+
26081
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
26082
+ setProductsList(getRenewableProducts());
26083
+ switchView("_plan-select-renew");
26084
+ };
26085
+
26086
+ const onNewSubSuccess = () => {
26087
+ var _otherProps$onNewSubS;
26088
+
26089
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
26090
+ switchView("plan-select");
26091
+ };
26092
+
26093
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
26094
+ onDisplay: onDisplay,
26095
+ onClose: onClose,
26096
+ id: "pelcro-subscription-options-modal"
26097
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
26098
+ onNewSubSuccess: onNewSubSuccess,
26099
+ onRenewSubSuccess: onRenewSubSuccess
26100
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
26101
+ };
26102
+ SubscriptionOptionsModal.viewId = "subscription-options";
26103
+
25014
26104
  exports.AddressCreateCity = AddressCreateCity;
25015
26105
  exports.AddressCreateContainer = AddressCreateContainer;
25016
26106
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -25188,6 +26278,12 @@ exports.SubmitPaymentMethod = SubmitPaymentMethod;
25188
26278
  exports.SubscriptionCreateContainer = SubscriptionCreateContainer;
25189
26279
  exports.SubscriptionCreateModal = SubscriptionCreateModal;
25190
26280
  exports.SubscriptionCreateView = SubscriptionCreateView;
26281
+ exports.SubscriptionOptionsContainer = SubscriptionOptionsContainer;
26282
+ exports.SubscriptionOptionsModal = SubscriptionOptionsModal;
26283
+ exports.SubscriptionOptionsNewButton = SubscriptionOptionsNewButton;
26284
+ exports.SubscriptionOptionsRenewButton = SubscriptionOptionsRenewButton;
26285
+ exports.SubscriptionOptionsSubmit = SubscriptionOptionsSubmit;
26286
+ exports.SubscriptionOptionsView = SubscriptionOptionsView;
25191
26287
  exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
25192
26288
  exports.SubscriptionRenewModal = SubscriptionRenewModal;
25193
26289
  exports.SubscriptionRenewView = SubscriptionRenewView;