@pelcro/react-pelcro-js 3.2.0-beta.2 → 3.2.0-beta.5

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,12 +4679,12 @@ 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 = "Invoice details";
4688
4688
  var labels = {
4689
4689
  summary: "Summary",
4690
4690
  total: "Total",
@@ -4697,11 +4697,37 @@ var buttons = {
4697
4697
  pay: "Pay now"
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 = "Renewal options";
4719
+ var subtitle = "Select one of the options below to continue";
4720
+ var next = "Next";
4721
+ var addNew = "Add Another Subscription";
4722
+ var renew = "Renew Existing Subscription";
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$z() {
7098
- _extends$z = 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$z() {
7109
7193
  return target;
7110
7194
  };
7111
7195
 
7112
- return _extends$z.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$z({}, 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$z({}, state, {
7296
+ return _extends$A({}, state, {
7213
7297
  toasts: state.toasts.map(function (t) {
7214
- return t.id === action.toast.id ? _extends$z({}, 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$z({}, state, {
7325
+ return _extends$A({}, state, {
7242
7326
  toasts: state.toasts.map(function (t) {
7243
- return t.id === toastId || toastId === undefined ? _extends$z({}, 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$z({}, state, {
7335
+ return _extends$A({}, state, {
7252
7336
  toasts: []
7253
7337
  });
7254
7338
  }
7255
7339
 
7256
- return _extends$z({}, 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$z({}, 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$z({}, state, {
7353
+ return _extends$A({}, state, {
7270
7354
  pausedAt: undefined,
7271
7355
  toasts: state.toasts.map(function (t) {
7272
- return _extends$z({}, 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$z({}, 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$z({}, 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$z({}, 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$z({
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$z({}, 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$z({
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$z({
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$z({}, 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$z({
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$z({
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$w;
7906
+ var _path$x;
7823
7907
 
7824
- 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); }
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$y({
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$w || (_path$w = /*#__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$v;
7923
+ var _path$w;
7840
7924
 
7841
- 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); }
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$x({
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$v || (_path$v = /*#__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$u;
7939
+ var _path$v;
7856
7940
 
7857
- 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); }
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$w({
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$u || (_path$u = /*#__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$t;
7954
+ var _path$u;
7871
7955
 
7872
- 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); }
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$v({
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$t || (_path$t = /*#__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$s, _path2$4;
7971
+ var _path$t, _path2$4;
7888
7972
 
7889
- 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); }
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$u({
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$s || (_path$s = /*#__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",
@@ -9225,7 +9313,7 @@ const PelcroModalController = ({
9225
9313
  type
9226
9314
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default['default'].Children.map(children, child => child).find(({
9227
9315
  type
9228
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default['default'].Children.map(children, child => child).find(({
9316
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default['default'].Children.map(children, child => child).find(({
9229
9317
  type
9230
9318
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default['default'].Children.map(children, child => child).find(({
9231
9319
  type
@@ -9506,8 +9594,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9506
9594
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9507
9595
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9508
9596
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9597
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9598
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9509
9599
 
9510
- const initialState$h = {
9600
+ const initialState$i = {
9511
9601
  email: "",
9512
9602
  password: "",
9513
9603
  emailError: null,
@@ -9518,10 +9608,10 @@ const initialState$h = {
9518
9608
  content: ""
9519
9609
  }
9520
9610
  };
9521
- const store$h = /*#__PURE__*/React.createContext(initialState$h);
9611
+ const store$i = /*#__PURE__*/React.createContext(initialState$i);
9522
9612
  const {
9523
- Provider: Provider$h
9524
- } = store$h;
9613
+ Provider: Provider$i
9614
+ } = store$i;
9525
9615
 
9526
9616
  const LoginContainer = ({
9527
9617
  style,
@@ -9628,7 +9718,7 @@ const LoginContainer = ({
9628
9718
  });
9629
9719
 
9630
9720
  case RESET_LOGIN_FORM:
9631
- return initialState$h;
9721
+ return initialState$i;
9632
9722
 
9633
9723
  case DISABLE_LOGIN_BUTTON:
9634
9724
  return lib_7({ ...state,
@@ -9646,12 +9736,12 @@ const LoginContainer = ({
9646
9736
  default:
9647
9737
  return state;
9648
9738
  }
9649
- }, initialState$h);
9739
+ }, initialState$i);
9650
9740
  return /*#__PURE__*/React__default['default'].createElement("div", {
9651
9741
  style: { ...style
9652
9742
  },
9653
9743
  className: `pelcro-container pelcro-login-container ${className}`
9654
- }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9744
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$i, {
9655
9745
  value: {
9656
9746
  state,
9657
9747
  dispatch
@@ -9659,12 +9749,12 @@ const LoginContainer = ({
9659
9749
  }, children.length ? children.map((child, i) => {
9660
9750
  if (child) {
9661
9751
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9662
- store: store$h,
9752
+ store: store$i,
9663
9753
  key: i
9664
9754
  });
9665
9755
  }
9666
9756
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9667
- store: store$h
9757
+ store: store$i
9668
9758
  })));
9669
9759
  };
9670
9760
 
@@ -9909,7 +9999,7 @@ const LoginButton = ({
9909
9999
  buttonDisabled
9910
10000
  },
9911
10001
  dispatch
9912
- } = React.useContext(store$h);
10002
+ } = React.useContext(store$i);
9913
10003
  const {
9914
10004
  t
9915
10005
  } = useTranslation("login");
@@ -9930,23 +10020,23 @@ const LoginButton = ({
9930
10020
  };
9931
10021
 
9932
10022
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9933
- store: store$h
10023
+ store: store$i
9934
10024
  }, props));
9935
10025
 
9936
10026
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9937
- store: store$h
10027
+ store: store$i
9938
10028
  }, props));
9939
10029
 
9940
- var _path$r;
10030
+ var _path$s;
9941
10031
 
9942
- 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); }
10032
+ 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); }
9943
10033
 
9944
10034
  function SvgCheck(props) {
9945
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10035
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
9946
10036
  xmlns: "http://www.w3.org/2000/svg",
9947
10037
  fill: "currentColor",
9948
10038
  viewBox: "0 0 20 20"
9949
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10039
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
9950
10040
  fillRule: "evenodd",
9951
10041
  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",
9952
10042
  clipRule: "evenodd"
@@ -10011,7 +10101,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
10011
10101
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
10012
10102
  facebookLoginRenderProps.FacebookLogin;
10013
10103
 
10014
- const initialState$g = {
10104
+ const initialState$h = {
10015
10105
  email: "",
10016
10106
  password: "",
10017
10107
  emailError: null,
@@ -10028,10 +10118,10 @@ const initialState$g = {
10028
10118
  content: ""
10029
10119
  }
10030
10120
  };
10031
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
10121
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
10032
10122
  const {
10033
- Provider: Provider$g
10034
- } = store$g;
10123
+ Provider: Provider$h
10124
+ } = store$h;
10035
10125
 
10036
10126
  const RegisterContainer = ({
10037
10127
  style,
@@ -10214,7 +10304,7 @@ const RegisterContainer = ({
10214
10304
  });
10215
10305
 
10216
10306
  case RESET_LOGIN_FORM:
10217
- return initialState$g;
10307
+ return initialState$h;
10218
10308
 
10219
10309
  case DISABLE_REGISTRATION_BUTTON:
10220
10310
  return lib_7({ ...state,
@@ -10232,12 +10322,12 @@ const RegisterContainer = ({
10232
10322
  default:
10233
10323
  return state;
10234
10324
  }
10235
- }, initialState$g);
10325
+ }, initialState$h);
10236
10326
  return /*#__PURE__*/React__default['default'].createElement("div", {
10237
10327
  style: { ...style
10238
10328
  },
10239
10329
  className: `pelcro-container pelcro-register-container ${className}`
10240
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10330
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
10241
10331
  value: {
10242
10332
  state,
10243
10333
  dispatch
@@ -10245,12 +10335,12 @@ const RegisterContainer = ({
10245
10335
  }, children.length ? children.map((child, i) => {
10246
10336
  if (child) {
10247
10337
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10248
- store: store$g,
10338
+ store: store$h,
10249
10339
  key: i
10250
10340
  });
10251
10341
  }
10252
10342
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10253
- store: store$g
10343
+ store: store$h
10254
10344
  })));
10255
10345
  };
10256
10346
  /**
@@ -10265,15 +10355,15 @@ function hasSecurityTokenEnabled$1() {
10265
10355
  return hasSecuritySdkLoaded;
10266
10356
  }
10267
10357
 
10268
- var _path$q;
10358
+ var _path$r;
10269
10359
 
10270
- 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); }
10360
+ 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); }
10271
10361
 
10272
10362
  function SvgFacebookLogo(props) {
10273
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10363
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10274
10364
  xmlns: "http://www.w3.org/2000/svg",
10275
10365
  viewBox: "88.428 12.828 107.543 207.085"
10276
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10366
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10277
10367
  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",
10278
10368
  fill: "#3c5a9a"
10279
10369
  })));
@@ -10290,10 +10380,10 @@ const FacebookLoginButton = ({
10290
10380
  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;
10291
10381
  const {
10292
10382
  dispatch: loginDispatch
10293
- } = React.useContext(store$h);
10383
+ } = React.useContext(store$i);
10294
10384
  const {
10295
10385
  dispatch: registerDispatch
10296
- } = React.useContext(store$g);
10386
+ } = React.useContext(store$h);
10297
10387
 
10298
10388
  const onSuccess = facebookUser => {
10299
10389
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10346,15 +10436,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10346
10436
  unwrapExports(googleLogin);
10347
10437
  var googleLogin_1 = googleLogin.GoogleLogin;
10348
10438
 
10349
- var _path$p, _path2$3, _path3$1, _path4;
10439
+ var _path$q, _path2$3, _path3$1, _path4;
10350
10440
 
10351
- 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); }
10441
+ 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); }
10352
10442
 
10353
10443
  function SvgGoogleLogo(props) {
10354
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10444
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10355
10445
  viewBox: "0 0 24 24",
10356
10446
  xmlns: "http://www.w3.org/2000/svg"
10357
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10447
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10358
10448
  fill: "#4285F4",
10359
10449
  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"
10360
10450
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10380,10 +10470,10 @@ const GoogleLoginButton = ({
10380
10470
  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;
10381
10471
  const {
10382
10472
  dispatch: loginDispatch
10383
- } = React.useContext(store$h);
10473
+ } = React.useContext(store$i);
10384
10474
  const {
10385
10475
  dispatch: registerDispatch
10386
- } = React.useContext(store$g);
10476
+ } = React.useContext(store$h);
10387
10477
 
10388
10478
  const onSuccess = response => {
10389
10479
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10431,15 +10521,15 @@ const GoogleLoginButton = ({
10431
10521
  }) : null;
10432
10522
  };
10433
10523
 
10434
- var _path$o;
10524
+ var _path$p;
10435
10525
 
10436
- 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); }
10526
+ 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); }
10437
10527
 
10438
10528
  function SvgAuth0Logo(props) {
10439
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10529
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10440
10530
  viewBox: "0 0 256 285",
10441
10531
  xmlns: "http://www.w3.org/2000/svg"
10442
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10532
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10443
10533
  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"
10444
10534
  })));
10445
10535
  }
@@ -10479,10 +10569,10 @@ const Auth0LoginButton = ({
10479
10569
  }, [auth0Enabled, auth0Loaded]);
10480
10570
  const {
10481
10571
  dispatch: loginDispatch
10482
- } = React.useContext(store$h);
10572
+ } = React.useContext(store$i);
10483
10573
  const {
10484
10574
  dispatch: registerDispatch
10485
- } = React.useContext(store$g);
10575
+ } = React.useContext(store$h);
10486
10576
 
10487
10577
  function handleClick() {
10488
10578
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10615,15 +10705,15 @@ function LoginView(props) {
10615
10705
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10616
10706
  }
10617
10707
 
10618
- var _path$n, _path2$2, _path3;
10708
+ var _path$o, _path2$2, _path3;
10619
10709
 
10620
- 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); }
10710
+ 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); }
10621
10711
 
10622
10712
  function SvgPelcroAuthorship(props) {
10623
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10713
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10624
10714
  xmlns: "http://www.w3.org/2000/svg",
10625
10715
  viewBox: "0 -80.652 497.072 179.991"
10626
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10716
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10627
10717
  fill: "none",
10628
10718
  stroke: "#4a4a4a",
10629
10719
  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"
@@ -10770,11 +10860,11 @@ function LoginModal({
10770
10860
  LoginModal.viewId = "login";
10771
10861
 
10772
10862
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10773
- store: store$g
10863
+ store: store$h
10774
10864
  }, props));
10775
10865
 
10776
10866
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10777
- store: store$g
10867
+ store: store$h
10778
10868
  }, props));
10779
10869
 
10780
10870
  const RegisterButton = ({
@@ -10794,7 +10884,7 @@ const RegisterButton = ({
10794
10884
  buttonDisabled
10795
10885
  },
10796
10886
  dispatch
10797
- } = React.useContext(store$g);
10887
+ } = React.useContext(store$h);
10798
10888
  const {
10799
10889
  t
10800
10890
  } = useTranslation("register");
@@ -10932,7 +11022,7 @@ function FirstName({
10932
11022
  }
10933
11023
 
10934
11024
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10935
- store: store$g
11025
+ store: store$h
10936
11026
  }, props));
10937
11027
 
10938
11028
  function LastName({
@@ -10963,7 +11053,7 @@ function LastName({
10963
11053
  }
10964
11054
 
10965
11055
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10966
- store: store$g
11056
+ store: store$h
10967
11057
  }, props));
10968
11058
 
10969
11059
  /**
@@ -11087,7 +11177,7 @@ function TextInput({
11087
11177
 
11088
11178
  const RegisterTextInput = props => {
11089
11179
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
11090
- store: store$g
11180
+ store: store$h
11091
11181
  }));
11092
11182
  };
11093
11183
 
@@ -11234,6 +11324,7 @@ function SelectModalWithHook(props) {
11234
11324
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11235
11325
  }, []);
11236
11326
  const {
11327
+ productsList,
11237
11328
  isGift,
11238
11329
  plan,
11239
11330
  product,
@@ -11243,11 +11334,12 @@ function SelectModalWithHook(props) {
11243
11334
  view,
11244
11335
  set
11245
11336
  } = usePelcro();
11246
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11247
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11337
+ const isRenewingSub = view === "_plan-select-renew";
11248
11338
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
11339
+ productsList: productsList,
11249
11340
  isGift: isGift,
11250
- disableGifting: isRenewingGift,
11341
+ disableGifting: isRenewingGift || isRenewingSub,
11342
+ isRenewingSub: isRenewingSub,
11251
11343
  plan: plan,
11252
11344
  product: product,
11253
11345
  onClose: () => {
@@ -11261,8 +11353,10 @@ function SelectModalWithHook(props) {
11261
11353
  plan,
11262
11354
  isGift
11263
11355
  }),
11264
- setView: switchView,
11265
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11356
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11357
+ subscriptionIdToRenew
11358
+ }),
11359
+ setView: switchView
11266
11360
  });
11267
11361
  }
11268
11362
  SelectModalWithHook.viewId = "plan-select";
@@ -11294,10 +11388,10 @@ class SelectModal extends React.Component {
11294
11388
  });
11295
11389
  }
11296
11390
 
11297
- if (this.state.productList.length === 1) {
11391
+ if (this.props.productsList.length === 1) {
11298
11392
  this.setState({
11299
- product: this.state.productList[0],
11300
- planList: this.state.productList[0].plans,
11393
+ product: this.props.productsList[0],
11394
+ planList: this.props.productsList[0].plans,
11301
11395
  mode: "plan"
11302
11396
  });
11303
11397
  }
@@ -11314,7 +11408,7 @@ class SelectModal extends React.Component {
11314
11408
  });
11315
11409
 
11316
11410
  _defineProperty$3(this, "onProductChange", e => {
11317
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11411
+ const product = productsList[e.target.selectedIndex];
11318
11412
  this.setState({
11319
11413
  product: product,
11320
11414
  plan: product.plans[0]
@@ -11380,7 +11474,7 @@ class SelectModal extends React.Component {
11380
11474
 
11381
11475
  _defineProperty$3(this, "renderProducts", () => {
11382
11476
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11383
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11477
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11384
11478
  return productsToShow.map((product, index) => {
11385
11479
  return this.renderOneProduct(product, index);
11386
11480
  });
@@ -11393,7 +11487,7 @@ class SelectModal extends React.Component {
11393
11487
  return this.renderOneProduct(this.state.product);
11394
11488
  }
11395
11489
 
11396
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11490
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11397
11491
 
11398
11492
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11399
11493
  return this.renderProducts();
@@ -11409,10 +11503,7 @@ class SelectModal extends React.Component {
11409
11503
  className: "plc-text-sm plc-font-semibold"
11410
11504
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11411
11505
 
11412
- function productsWithMatchedTaggedFirst() {
11413
- var _window$Pelcro$produc;
11414
-
11415
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11506
+ function productsWithMatchedTaggedFirst(allProducts) {
11416
11507
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11417
11508
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11418
11509
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11446,7 +11537,7 @@ class SelectModal extends React.Component {
11446
11537
  _defineProperty$3(this, "selectProduct", e => {
11447
11538
  const id = e.target.dataset.key;
11448
11539
 
11449
- for (const product of this.state.productList) {
11540
+ for (const product of this.props.productsList) {
11450
11541
  if (+product.id === +id) {
11451
11542
  var _this$state$plan;
11452
11543
 
@@ -11499,6 +11590,14 @@ class SelectModal extends React.Component {
11499
11590
 
11500
11591
  _defineProperty$3(this, "submitOption", () => {
11501
11592
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11593
+
11594
+ if (this.props.isRenewingSub) {
11595
+ var _matchingSub$id;
11596
+
11597
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11598
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11599
+ }
11600
+
11502
11601
  const {
11503
11602
  product,
11504
11603
  isGift
@@ -11536,8 +11635,7 @@ class SelectModal extends React.Component {
11536
11635
  plan: {},
11537
11636
  isGift: props.isGift,
11538
11637
  disabled: true,
11539
- mode: "product",
11540
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11638
+ mode: "product"
11541
11639
  };
11542
11640
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11543
11641
  this.locale = this.props.t;
@@ -11545,7 +11643,7 @@ class SelectModal extends React.Component {
11545
11643
  }
11546
11644
 
11547
11645
  render() {
11548
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11646
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11549
11647
 
11550
11648
  const {
11551
11649
  disableGifting
@@ -11579,7 +11677,7 @@ class SelectModal extends React.Component {
11579
11677
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11580
11678
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
11581
11679
  className: "plc-text-2xl plc-font-semibold"
11582
- }, 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", {
11680
+ }, 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", {
11583
11681
  className: "pelcro-select-products-wrapper"
11584
11682
  }, (_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", {
11585
11683
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -12743,20 +12841,21 @@ var es_12 = es.injectStripe;
12743
12841
  var es_13 = es.StripeProvider;
12744
12842
 
12745
12843
  /**
12746
- * @TODO: All subscription related business logic should end up moving
12844
+ * @TODO: All payment related business logic should end up moving
12747
12845
  * to this service, and out of react components.
12748
12846
  */
12749
12847
 
12750
12848
  /**
12751
- * Enum for subscription types
12849
+ * Enum for payment types
12752
12850
  * @readonly
12753
12851
  * @enum {string}
12754
12852
  */
12755
- const SUBSCRIPTION_TYPES = {
12853
+ const PAYMENT_TYPES = {
12756
12854
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12757
12855
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12758
12856
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12759
12857
  RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12858
+ PURCHASE_ECOMMERCE_ORDER: "PURCHASE_ECOMMERCE_ORDER",
12760
12859
  PAY_INVOICE: "PAY_INVOICE"
12761
12860
  };
12762
12861
 
@@ -12764,9 +12863,8 @@ var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
12764
12863
 
12765
12864
  var _generateUserError = /*#__PURE__*/new WeakMap();
12766
12865
 
12767
- class Subscription {
12866
+ class Payment {
12768
12867
  /**
12769
- * Subscription service constructor
12770
12868
  * @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
12771
12869
  */
12772
12870
  constructor(paymentGateway) {
@@ -12778,7 +12876,7 @@ class Subscription {
12778
12876
 
12779
12877
  if (!options.type) {
12780
12878
  callback(_classPrivateFieldGet(this, _generateUserError).call(this), null);
12781
- return console.error("No subscription type provided");
12879
+ return console.error("No payment type provided");
12782
12880
  } // delegate execution to paymentgateway
12783
12881
 
12784
12882
 
@@ -12796,21 +12894,21 @@ class Subscription {
12796
12894
  writable: true,
12797
12895
  value: () => {
12798
12896
  return {
12799
- error: new Error("An error has occured in the subscription service, please try again later")
12897
+ error: new Error("An error has occured in the payment service, please try again later")
12800
12898
  };
12801
12899
  }
12802
12900
  });
12803
12901
 
12804
12902
  if (_classPrivateFieldGet(this, _isPaymentGatewayInvalid).call(this, paymentGateway)) {
12805
12903
  this.paymentGateway = null;
12806
- console.error("Incompatible subscription gateway");
12904
+ console.error("Incompatible payment gateway");
12807
12905
  } else {
12808
12906
  this.paymentGateway = paymentGateway;
12809
12907
  }
12810
12908
  }
12811
12909
  /**
12812
- * @typedef subscriptionOptions
12813
- * @property {SUBSCRIPTION_TYPES} type
12910
+ * @typedef paymentOptions
12911
+ * @property {PAYMENT_TYPES} type
12814
12912
  * @property {string} token
12815
12913
  * @property {object} plan
12816
12914
  * @property {object} [product]
@@ -12821,6 +12919,7 @@ class Subscription {
12821
12919
  * @property {string} addressId
12822
12920
  * @property {number} invoiceId
12823
12921
  * @property {boolean} isExistingSource
12922
+ * @property {Array} items
12824
12923
  */
12825
12924
 
12826
12925
  /**
@@ -12831,8 +12930,8 @@ class Subscription {
12831
12930
  */
12832
12931
 
12833
12932
  /**
12834
- * Subscription execution method
12835
- * @param {subscriptionOptions} options subscription options
12933
+ * Payment execution method
12934
+ * @param {paymentOptions} options payment options
12836
12935
  * @param {executeCallback} callback
12837
12936
  * @return {void}
12838
12937
  */
@@ -12845,7 +12944,7 @@ const PAYMENT_GATEWAYS_ENUM = {
12845
12944
  vantiv: "vantiv"
12846
12945
  };
12847
12946
  /**
12848
- * Subscription Strategies
12947
+ * Payment Strategies
12849
12948
  */
12850
12949
 
12851
12950
  /**
@@ -12862,6 +12961,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12862
12961
 
12863
12962
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12864
12963
 
12964
+ var _purchaseEcommerceOrder = /*#__PURE__*/new WeakMap();
12965
+
12865
12966
  var _payInvoice = /*#__PURE__*/new WeakMap();
12866
12967
 
12867
12968
  class StripeGateway {
@@ -12872,7 +12973,7 @@ class StripeGateway {
12872
12973
  });
12873
12974
 
12874
12975
  _defineProperty$3(this, "execute", (options, callback) => {
12875
- const types = SUBSCRIPTION_TYPES;
12976
+ const types = PAYMENT_TYPES;
12876
12977
 
12877
12978
  switch (options.type) {
12878
12979
  case types.CREATE_SUBSCRIPTION:
@@ -12887,11 +12988,14 @@ class StripeGateway {
12887
12988
  case types.RENEW_GIFTED_SUBSCRIPTION:
12888
12989
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12889
12990
 
12991
+ case types.PURCHASE_ECOMMERCE_ORDER:
12992
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder).call(this, options, callback);
12993
+
12890
12994
  case types.PAY_INVOICE:
12891
12995
  return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12892
12996
 
12893
12997
  default:
12894
- console.error("Unsupported subscriptiion method: Stripe Gateway");
12998
+ console.error("Unsupported payment method: Stripe Gateway");
12895
12999
  }
12896
13000
  });
12897
13001
 
@@ -12999,6 +13103,35 @@ class StripeGateway {
12999
13103
  }
13000
13104
  });
13001
13105
 
13106
+ _purchaseEcommerceOrder.set(this, {
13107
+ writable: true,
13108
+ value: (options, callback) => {
13109
+ const {
13110
+ token,
13111
+ items,
13112
+ couponCode,
13113
+ addressId,
13114
+ isExistingSource
13115
+ } = options;
13116
+ const params = isExistingSource ? {
13117
+ source_id: token
13118
+ } : {
13119
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
13120
+ gateway_token: token
13121
+ };
13122
+ window.Pelcro.ecommerce.order.create({
13123
+ items,
13124
+ coupon_code: couponCode,
13125
+ ...params,
13126
+ ...(addressId && {
13127
+ address_id: addressId
13128
+ })
13129
+ }, (err, res) => {
13130
+ callback(err, res);
13131
+ });
13132
+ }
13133
+ });
13134
+
13002
13135
  _payInvoice.set(this, {
13003
13136
  writable: true,
13004
13137
  value: (options, callback) => {
@@ -13042,7 +13175,7 @@ class PaypalGateway {
13042
13175
  });
13043
13176
 
13044
13177
  _defineProperty$3(this, "execute", (options, callback) => {
13045
- const types = SUBSCRIPTION_TYPES;
13178
+ const types = PAYMENT_TYPES;
13046
13179
 
13047
13180
  switch (options.type) {
13048
13181
  case types.CREATE_SUBSCRIPTION:
@@ -13139,6 +13272,16 @@ var _paymentGateway3 = /*#__PURE__*/new WeakMap();
13139
13272
 
13140
13273
  var _createSubscription3 = /*#__PURE__*/new WeakMap();
13141
13274
 
13275
+ var _renewSubscription2 = /*#__PURE__*/new WeakMap();
13276
+
13277
+ var _createGiftedSubscription3 = /*#__PURE__*/new WeakMap();
13278
+
13279
+ var _renewGiftedSubscription2 = /*#__PURE__*/new WeakMap();
13280
+
13281
+ var _purchaseEcommerceOrder2 = /*#__PURE__*/new WeakMap();
13282
+
13283
+ var _payInvoice3 = /*#__PURE__*/new WeakMap();
13284
+
13142
13285
  class VantivGateway {
13143
13286
  constructor() {
13144
13287
  _paymentGateway3.set(this, {
@@ -13147,14 +13290,29 @@ class VantivGateway {
13147
13290
  });
13148
13291
 
13149
13292
  _defineProperty$3(this, "execute", (options, callback) => {
13150
- const types = SUBSCRIPTION_TYPES;
13293
+ const types = PAYMENT_TYPES;
13151
13294
 
13152
13295
  switch (options.type) {
13153
13296
  case types.CREATE_SUBSCRIPTION:
13154
13297
  return _classPrivateFieldGet(this, _createSubscription3).call(this, options, callback);
13155
13298
 
13299
+ case types.RENEW_SUBSCRIPTION:
13300
+ return _classPrivateFieldGet(this, _renewSubscription2).call(this, options, callback);
13301
+
13302
+ case types.CREATE_GIFTED_SUBSCRIPTION:
13303
+ return _classPrivateFieldGet(this, _createGiftedSubscription3).call(this, options, callback);
13304
+
13305
+ case types.RENEW_GIFTED_SUBSCRIPTION:
13306
+ return _classPrivateFieldGet(this, _renewGiftedSubscription2).call(this, options, callback);
13307
+
13308
+ case types.PURCHASE_ECOMMERCE_ORDER:
13309
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder2).call(this, options, callback);
13310
+
13311
+ case types.PAY_INVOICE:
13312
+ return _classPrivateFieldGet(this, _payInvoice3).call(this, options, callback);
13313
+
13156
13314
  default:
13157
- console.error("Unsupported subscriptiion method: vantiv Gateway");
13315
+ console.error("Unsupported payment method: vantiv Gateway");
13158
13316
  }
13159
13317
  });
13160
13318
 
@@ -13167,37 +13325,192 @@ class VantivGateway {
13167
13325
  couponCode,
13168
13326
  product,
13169
13327
  quantity = 1,
13170
- addressId
13328
+ addressId,
13329
+ isExistingSource
13171
13330
  } = options;
13331
+ const params = isExistingSource ? {
13332
+ source_id: token
13333
+ } : {
13334
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13335
+ gateway_token: token
13336
+ };
13172
13337
  window.Pelcro.subscription.create({
13173
13338
  quantity,
13174
- gateway_token: token,
13175
- payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13176
13339
  auth_token: window.Pelcro.user.read().auth_token,
13177
13340
  plan_id: plan.id,
13178
13341
  coupon_code: couponCode,
13179
- address_id: product.address_required ? addressId : null
13342
+ address_id: product.address_required ? addressId : null,
13343
+ ...params
13180
13344
  }, (err, res) => {
13181
13345
  callback(err, res);
13182
13346
  });
13183
13347
  }
13184
13348
  });
13185
- }
13186
-
13187
- }
13188
13349
 
13189
- /**
13190
- * @typedef {Object} PaymentStateType
13191
- * @property {boolean} disableSubmit
13192
- * @property {boolean} isLoading
13193
- * @property {boolean} disableCouponButton
13194
- * @property {object} couponObject
13195
- * @property {string} couponCode
13196
- * @property {string} couponError
13197
- * @property {boolean} enableCouponField
13198
- * @property {string} percentOff
13199
- * @property {unknown} canMakePayment
13200
- * @property {unknown} paymentRequest
13350
+ _renewSubscription2.set(this, {
13351
+ writable: true,
13352
+ value: (options, callback) => {
13353
+ const {
13354
+ subscriptionIdToRenew,
13355
+ token,
13356
+ plan,
13357
+ couponCode,
13358
+ product,
13359
+ addressId,
13360
+ isExistingSource
13361
+ } = options;
13362
+ const params = isExistingSource ? {
13363
+ source_id: token
13364
+ } : {
13365
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13366
+ gateway_token: token
13367
+ };
13368
+ window.Pelcro.subscription.renew({
13369
+ auth_token: window.Pelcro.user.read().auth_token,
13370
+ plan_id: plan.id,
13371
+ coupon_code: couponCode,
13372
+ subscription_id: subscriptionIdToRenew,
13373
+ address_id: product.address_required ? addressId : null,
13374
+ ...params
13375
+ }, (err, res) => {
13376
+ callback(err, res);
13377
+ });
13378
+ }
13379
+ });
13380
+
13381
+ _createGiftedSubscription3.set(this, {
13382
+ writable: true,
13383
+ value: (options, callback) => {
13384
+ const {
13385
+ token,
13386
+ plan,
13387
+ couponCode,
13388
+ product,
13389
+ giftRecipient,
13390
+ quantity = 1,
13391
+ addressId,
13392
+ isExistingSource
13393
+ } = options;
13394
+ const params = isExistingSource ? {
13395
+ source_id: token
13396
+ } : {
13397
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13398
+ gateway_token: token
13399
+ };
13400
+ window.Pelcro.subscription.create({
13401
+ quantity,
13402
+ auth_token: window.Pelcro.user.read().auth_token,
13403
+ plan_id: plan.id,
13404
+ coupon_code: couponCode,
13405
+ gift_recipient_email: giftRecipient.email,
13406
+ gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13407
+ gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
13408
+ gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
13409
+ gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
13410
+ address_id: product.address_required ? addressId : null,
13411
+ ...params
13412
+ }, (err, res) => {
13413
+ callback(err, res);
13414
+ });
13415
+ }
13416
+ });
13417
+
13418
+ _renewGiftedSubscription2.set(this, {
13419
+ writable: true,
13420
+ value: (options, callback) => {
13421
+ const {
13422
+ subscriptionIdToRenew,
13423
+ token,
13424
+ product,
13425
+ plan,
13426
+ couponCode,
13427
+ addressId,
13428
+ isExistingSource
13429
+ } = options;
13430
+ const params = isExistingSource ? {
13431
+ source_id: token
13432
+ } : {
13433
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13434
+ gateway_token: token
13435
+ };
13436
+ window.Pelcro.subscription.renewGift({
13437
+ auth_token: window.Pelcro.user.read().auth_token,
13438
+ plan_id: plan.id,
13439
+ coupon_code: couponCode,
13440
+ subscription_id: subscriptionIdToRenew,
13441
+ address_id: product.address_required ? addressId : null,
13442
+ ...params
13443
+ }, (err, res) => {
13444
+ callback(err, res);
13445
+ });
13446
+ }
13447
+ });
13448
+
13449
+ _purchaseEcommerceOrder2.set(this, {
13450
+ writable: true,
13451
+ value: (options, callback) => {
13452
+ const {
13453
+ token,
13454
+ items,
13455
+ couponCode,
13456
+ addressId,
13457
+ isExistingSource
13458
+ } = options;
13459
+ const params = isExistingSource ? {
13460
+ source_id: token
13461
+ } : {
13462
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13463
+ gateway_token: token
13464
+ };
13465
+ window.Pelcro.ecommerce.order.create({
13466
+ items,
13467
+ coupon_code: couponCode,
13468
+ ...params,
13469
+ ...(addressId && {
13470
+ address_id: addressId
13471
+ })
13472
+ }, (err, res) => {
13473
+ callback(err, res);
13474
+ });
13475
+ }
13476
+ });
13477
+
13478
+ _payInvoice3.set(this, {
13479
+ writable: true,
13480
+ value: (options, callback) => {
13481
+ const {
13482
+ token,
13483
+ invoiceId
13484
+ } = options;
13485
+ const params = options.isExistingSource ? {
13486
+ source_id: token,
13487
+ invoice_id: invoiceId
13488
+ } : {
13489
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13490
+ gateway_token: token,
13491
+ invoice_id: invoiceId
13492
+ };
13493
+ window.Pelcro.invoice.pay(params, (err, res) => {
13494
+ callback(err, res);
13495
+ });
13496
+ }
13497
+ });
13498
+ }
13499
+
13500
+ }
13501
+
13502
+ /**
13503
+ * @typedef {Object} PaymentStateType
13504
+ * @property {boolean} disableSubmit
13505
+ * @property {boolean} isLoading
13506
+ * @property {boolean} disableCouponButton
13507
+ * @property {object} couponObject
13508
+ * @property {string} couponCode
13509
+ * @property {string} couponError
13510
+ * @property {boolean} enableCouponField
13511
+ * @property {string} percentOff
13512
+ * @property {unknown} canMakePayment
13513
+ * @property {unknown} paymentRequest
13201
13514
  * @property {number} updatedPrice
13202
13515
  * @property {number} taxAmount
13203
13516
  * @property {object} currentPlan
@@ -13206,7 +13519,7 @@ class VantivGateway {
13206
13519
 
13207
13520
  /** @type {PaymentStateType} */
13208
13521
 
13209
- const initialState$f = {
13522
+ const initialState$g = {
13210
13523
  disableSubmit: false,
13211
13524
  isLoading: false,
13212
13525
  disableCouponButton: false,
@@ -13225,10 +13538,10 @@ const initialState$f = {
13225
13538
  content: ""
13226
13539
  }
13227
13540
  };
13228
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
13541
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
13229
13542
  const {
13230
- Provider: Provider$f
13231
- } = store$f;
13543
+ Provider: Provider$g
13544
+ } = store$g;
13232
13545
 
13233
13546
  const PaymentMethodContainerWithoutStripe = ({
13234
13547
  style,
@@ -13241,7 +13554,7 @@ const PaymentMethodContainerWithoutStripe = ({
13241
13554
  onFailure = () => {},
13242
13555
  ...props
13243
13556
  }) => {
13244
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
13557
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isGift, _props$isRenewingGift, _props$invoice;
13245
13558
 
13246
13559
  const {
13247
13560
  t
@@ -13257,6 +13570,7 @@ const PaymentMethodContainerWithoutStripe = ({
13257
13570
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
13258
13571
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
13259
13572
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
13573
+ const isGift = (_props$isGift = props.isGift) !== null && _props$isGift !== void 0 ? _props$isGift : pelcroStore.isGift;
13260
13574
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13261
13575
  const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
13262
13576
  React.useEffect(() => {
@@ -13273,7 +13587,11 @@ const PaymentMethodContainerWithoutStripe = ({
13273
13587
  updateTotalAmountWithTax();
13274
13588
  }, []);
13275
13589
 
13276
- function submitVantivPayment() {
13590
+ const submitVantivPayment = () => {
13591
+ if (selectedPaymentMethodId) {
13592
+ return handleVantivPayment(null);
13593
+ }
13594
+
13277
13595
  if (!vantivInstanceRef.current) {
13278
13596
  return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13279
13597
  }
@@ -13284,43 +13602,118 @@ const PaymentMethodContainerWithoutStripe = ({
13284
13602
  id: orderId,
13285
13603
  orderId: orderId
13286
13604
  });
13287
- }
13605
+ };
13288
13606
 
13289
13607
  function handleVantivPayment(paymentRequest) {
13290
- const SUCCESS_STATUS = "870";
13608
+ if (paymentRequest) {
13609
+ const SUCCESS_STATUS = "870";
13291
13610
 
13292
- if (paymentRequest.response !== SUCCESS_STATUS) {
13293
- return handlePaymentError({
13294
- error: new Error(paymentRequest.message)
13295
- });
13611
+ if (paymentRequest.response !== SUCCESS_STATUS) {
13612
+ return handlePaymentError({
13613
+ error: new Error(paymentRequest.message)
13614
+ });
13615
+ }
13296
13616
  }
13297
13617
 
13298
- const subscription = new Subscription(new VantivGateway());
13299
- const {
13300
- couponCode
13301
- } = state;
13302
- return subscription.execute({
13303
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
13304
- token: paymentRequest,
13305
- quantity: plan.quantity,
13306
- plan,
13307
- couponCode,
13308
- product,
13309
- addressId: selectedAddressId
13310
- }, (err, res) => {
13311
- if (err) {
13312
- return handlePaymentError(err);
13313
- }
13618
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13314
13619
 
13315
- onSuccess(res);
13316
- });
13620
+ if (type === "createPayment") {
13621
+ handleVantivSubscription();
13622
+ } else if (type === "orderCreate") {
13623
+ purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
13624
+ } else if (type === "invoicePayment") {
13625
+ payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
13626
+ }
13627
+
13628
+ function handleVantivSubscription() {
13629
+ const payment = new Payment(new VantivGateway());
13630
+ const createSubscription = !isGift && !subscriptionIdToRenew;
13631
+ const renewSubscription = !isGift && subscriptionIdToRenew;
13632
+ const giftSubscriprition = isGift && !subscriptionIdToRenew;
13633
+ const renewGift = isRenewingGift;
13634
+ const {
13635
+ couponCode
13636
+ } = state;
13637
+
13638
+ if (renewGift) {
13639
+ return payment.execute({
13640
+ type: PAYMENT_TYPES.RENEW_GIFTED_SUBSCRIPTION,
13641
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13642
+ plan,
13643
+ couponCode,
13644
+ product,
13645
+ isExistingSource: isUsingExistingPaymentMethod,
13646
+ subscriptionIdToRenew,
13647
+ addressId: selectedAddressId
13648
+ }, (err, res) => {
13649
+ if (err) {
13650
+ return handlePaymentError(err);
13651
+ }
13652
+
13653
+ onSuccess(res);
13654
+ });
13655
+ } else if (giftSubscriprition) {
13656
+ return payment.execute({
13657
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13658
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13659
+ quantity: plan.quantity,
13660
+ plan,
13661
+ couponCode,
13662
+ product,
13663
+ isExistingSource: isUsingExistingPaymentMethod,
13664
+ giftRecipient,
13665
+ addressId: selectedAddressId
13666
+ }, (err, res) => {
13667
+ if (err) {
13668
+ return handlePaymentError(err);
13669
+ }
13670
+
13671
+ onSuccess(res);
13672
+ });
13673
+ } else if (renewSubscription) {
13674
+ return payment.execute({
13675
+ type: PAYMENT_TYPES.RENEW_SUBSCRIPTION,
13676
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13677
+ quantity: plan.quantity,
13678
+ plan,
13679
+ couponCode,
13680
+ product,
13681
+ isExistingSource: isUsingExistingPaymentMethod,
13682
+ subscriptionIdToRenew,
13683
+ addressId: selectedAddressId
13684
+ }, (err, res) => {
13685
+ if (err) {
13686
+ return handlePaymentError(err);
13687
+ }
13688
+
13689
+ onSuccess(res);
13690
+ });
13691
+ } else if (createSubscription) {
13692
+ return payment.execute({
13693
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13694
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13695
+ quantity: plan.quantity,
13696
+ plan,
13697
+ couponCode,
13698
+ product,
13699
+ isExistingSource: isUsingExistingPaymentMethod,
13700
+ addressId: selectedAddressId
13701
+ }, (err, res) => {
13702
+ if (err) {
13703
+ return handlePaymentError(err);
13704
+ }
13705
+
13706
+ onSuccess(res);
13707
+ });
13708
+ }
13709
+ }
13317
13710
  }
13318
13711
 
13319
13712
  const vantivInstanceRef = React__default['default'].useRef(null);
13320
13713
  React.useEffect(() => {
13321
13714
  const cardProcessor = getSiteCardProcessor();
13322
13715
 
13323
- if (cardProcessor === "vantiv") {
13716
+ if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13324
13717
  var _window$Pelcro$site$r;
13325
13718
 
13326
13719
  const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_pay_page_id;
@@ -13343,7 +13736,7 @@ const PaymentMethodContainerWithoutStripe = ({
13343
13736
  }
13344
13737
  });
13345
13738
  }
13346
- }, []);
13739
+ }, [selectedPaymentMethodId]);
13347
13740
 
13348
13741
  const initPaymentRequest = (state, dispatch) => {
13349
13742
  try {
@@ -13767,7 +14160,7 @@ const PaymentMethodContainerWithoutStripe = ({
13767
14160
 
13768
14161
 
13769
14162
  const handlePaypalSubscription = (state, paypalNonce) => {
13770
- const subscription = new Subscription(new PaypalGateway());
14163
+ const payment = new Payment(new PaypalGateway());
13771
14164
  const {
13772
14165
  couponCode
13773
14166
  } = state;
@@ -13776,8 +14169,8 @@ const PaymentMethodContainerWithoutStripe = ({
13776
14169
  */
13777
14170
 
13778
14171
  if (giftRecipient) {
13779
- return subscription.execute({
13780
- type: SUBSCRIPTION_TYPES.CREATE_GIFTED_SUBSCRIPTION,
14172
+ return payment.execute({
14173
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13781
14174
  token: paypalNonce,
13782
14175
  quantity: plan.quantity,
13783
14176
  plan,
@@ -13810,8 +14203,8 @@ const PaymentMethodContainerWithoutStripe = ({
13810
14203
  });
13811
14204
  }
13812
14205
 
13813
- return subscription.execute({
13814
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
14206
+ return payment.execute({
14207
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13815
14208
  token: paypalNonce,
13816
14209
  quantity: plan.quantity,
13817
14210
  plan,
@@ -13843,7 +14236,7 @@ const PaymentMethodContainerWithoutStripe = ({
13843
14236
  });
13844
14237
  };
13845
14238
 
13846
- const purchase = (stripeSource, state, dispatch) => {
14239
+ const purchase = (gatewayService, gatewayToken, state, dispatch) => {
13847
14240
  const isQuickPurchase = !Array.isArray(order);
13848
14241
  const mappedOrderItems = isQuickPurchase ? [{
13849
14242
  sku_id: order.id,
@@ -13855,14 +14248,14 @@ const PaymentMethodContainerWithoutStripe = ({
13855
14248
  const {
13856
14249
  couponCode
13857
14250
  } = state;
13858
- window.Pelcro.ecommerce.order.create({
13859
- source_id: stripeSource.isExistingSource ? stripeSource.id : undefined,
13860
- stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
14251
+ const payment = new Payment(gatewayService);
14252
+ payment.execute({
14253
+ type: PAYMENT_TYPES.PURCHASE_ECOMMERCE_ORDER,
14254
+ token: gatewayToken,
14255
+ isExistingSource: Boolean(selectedPaymentMethodId),
13861
14256
  items: mappedOrderItems,
13862
- coupon_code: couponCode,
13863
- ...(selectedAddressId && {
13864
- address_id: selectedAddressId
13865
- })
14257
+ addressId: selectedAddressId,
14258
+ couponCode
13866
14259
  }, (err, res) => {
13867
14260
  dispatch({
13868
14261
  type: DISABLE_SUBMIT,
@@ -13900,9 +14293,9 @@ const PaymentMethodContainerWithoutStripe = ({
13900
14293
  };
13901
14294
 
13902
14295
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13903
- const subscription = new Subscription(gatewayService);
13904
- return subscription.execute({
13905
- type: SUBSCRIPTION_TYPES.PAY_INVOICE,
14296
+ const payment = new Payment(gatewayService);
14297
+ return payment.execute({
14298
+ type: PAYMENT_TYPES.PAY_INVOICE,
13906
14299
  token: gatewayToken,
13907
14300
  isExistingSource: Boolean(selectedPaymentMethodId),
13908
14301
  invoiceId: invoice.id
@@ -14140,7 +14533,7 @@ const PaymentMethodContainerWithoutStripe = ({
14140
14533
  if (stripeSource && type === "createPayment") {
14141
14534
  subscribe(stripeSource, state, dispatch);
14142
14535
  } else if (stripeSource && type === "orderCreate") {
14143
- purchase(stripeSource, state, dispatch);
14536
+ purchase(new StripeGateway(), stripeSource.id, state, dispatch);
14144
14537
  } else if (stripeSource && type === "invoicePayment") {
14145
14538
  payInvoice(new StripeGateway(), stripeSource.id, dispatch);
14146
14539
  }
@@ -14262,6 +14655,10 @@ const PaymentMethodContainerWithoutStripe = ({
14262
14655
  disableSubmit: true,
14263
14656
  isLoading: true
14264
14657
  }, (state, dispatch) => {
14658
+ if (getSiteCardProcessor() === "vantiv") {
14659
+ return submitVantivPayment();
14660
+ }
14661
+
14265
14662
  if (selectedPaymentMethodId) {
14266
14663
  // pay with selected method (source) if exists already
14267
14664
  return handlePayment({
@@ -14274,10 +14671,6 @@ const PaymentMethodContainerWithoutStripe = ({
14274
14671
  return updatePaymentSource(state, dispatch);
14275
14672
  }
14276
14673
 
14277
- if (getSiteCardProcessor() === "vantiv") {
14278
- return submitVantivPayment();
14279
- }
14280
-
14281
14674
  submitPayment(state);
14282
14675
  });
14283
14676
 
@@ -14346,21 +14739,21 @@ const PaymentMethodContainerWithoutStripe = ({
14346
14739
  default:
14347
14740
  return state;
14348
14741
  }
14349
- }, initialState$f);
14742
+ }, initialState$g);
14350
14743
  return /*#__PURE__*/React__default['default'].createElement("div", {
14351
14744
  style: { ...style
14352
14745
  },
14353
14746
  className: `pelcro-container pelcro-payment-container ${className}`
14354
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
14747
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
14355
14748
  value: {
14356
14749
  state,
14357
14750
  dispatch
14358
14751
  }
14359
14752
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
14360
- store: store$f,
14753
+ store: store$g,
14361
14754
  key: i
14362
14755
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
14363
- store: store$f
14756
+ store: store$g
14364
14757
  })));
14365
14758
  };
14366
14759
 
@@ -14382,7 +14775,7 @@ const PaymentMethodContainer = props => {
14382
14775
  stripeAccount: window.Pelcro.site.read().account_id,
14383
14776
  locale: getPageOrDefaultLanguage()
14384
14777
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
14385
- store: store$f
14778
+ store: store$g
14386
14779
  }, props))));
14387
14780
  }
14388
14781
 
@@ -14435,7 +14828,7 @@ const PelcroPaymentRequestButton = props => {
14435
14828
  currentPlan,
14436
14829
  updatedPrice
14437
14830
  }
14438
- } = React.useContext(store$f);
14831
+ } = React.useContext(store$g);
14439
14832
 
14440
14833
  const updatePaymentRequest = () => {
14441
14834
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14511,7 +14904,7 @@ const DiscountedPrice = props => {
14511
14904
  taxAmount,
14512
14905
  percentOff
14513
14906
  }
14514
- } = React.useContext(store$f);
14907
+ } = React.useContext(store$g);
14515
14908
  const {
14516
14909
  order,
14517
14910
  plan
@@ -14561,7 +14954,7 @@ const SubmitPaymentMethod = ({
14561
14954
  isLoading,
14562
14955
  updatedPrice
14563
14956
  }
14564
- } = React.useContext(store$f);
14957
+ } = React.useContext(store$g);
14565
14958
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14566
14959
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14567
14960
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14582,17 +14975,17 @@ const SubmitPaymentMethod = ({
14582
14975
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14583
14976
  };
14584
14977
 
14585
- var _path$m;
14978
+ var _path$n;
14586
14979
 
14587
- 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); }
14980
+ 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); }
14588
14981
 
14589
14982
  function SvgArrowLeft(props) {
14590
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14983
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
14591
14984
  xmlns: "http://www.w3.org/2000/svg",
14592
14985
  fill: "none",
14593
14986
  viewBox: "0 0 24 24",
14594
14987
  stroke: "currentColor"
14595
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14988
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
14596
14989
  strokeLinecap: "round",
14597
14990
  strokeLinejoin: "round",
14598
14991
  strokeWidth: 2,
@@ -14611,7 +15004,7 @@ const ApplyCouponButton = ({
14611
15004
  disableCouponButton
14612
15005
  },
14613
15006
  dispatch
14614
- } = React.useContext(store$f);
15007
+ } = React.useContext(store$g);
14615
15008
  const {
14616
15009
  t
14617
15010
  } = useTranslation("checkoutForm");
@@ -14645,7 +15038,7 @@ const CouponCodeField = props => {
14645
15038
  couponCode,
14646
15039
  couponError
14647
15040
  }
14648
- } = React.useContext(store$f);
15041
+ } = React.useContext(store$g);
14649
15042
 
14650
15043
  const onCouponCodeChange = e => {
14651
15044
  dispatch({
@@ -14674,17 +15067,17 @@ const CouponCodeField = props => {
14674
15067
  }, props));
14675
15068
  };
14676
15069
 
14677
- var _path$l;
15070
+ var _path$m;
14678
15071
 
14679
- 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); }
15072
+ 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); }
14680
15073
 
14681
15074
  function SvgTicket(props) {
14682
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15075
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14683
15076
  xmlns: "http://www.w3.org/2000/svg",
14684
15077
  fill: "none",
14685
15078
  viewBox: "0 0 24 24",
14686
15079
  stroke: "currentColor"
14687
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15080
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14688
15081
  strokeLinecap: "round",
14689
15082
  strokeLinejoin: "round",
14690
15083
  strokeWidth: 2,
@@ -14701,7 +15094,7 @@ const CouponCode = ({
14701
15094
  state: {
14702
15095
  enableCouponField
14703
15096
  }
14704
- } = React.useContext(store$f);
15097
+ } = React.useContext(store$g);
14705
15098
  const {
14706
15099
  t
14707
15100
  } = useTranslation("checkoutForm");
@@ -14958,7 +15351,7 @@ const PaypalSubscribeButton = props => {
14958
15351
  const {
14959
15352
  dispatch,
14960
15353
  state
14961
- } = React.useContext(store$f);
15354
+ } = React.useContext(store$g);
14962
15355
  const {
14963
15356
  product,
14964
15357
  plan,
@@ -15044,16 +15437,16 @@ const BankRedirection = () => {
15044
15437
  }));
15045
15438
  };
15046
15439
 
15047
- var _path$k;
15440
+ var _path$l;
15048
15441
 
15049
- 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); }
15442
+ 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); }
15050
15443
 
15051
15444
  function SvgLock(props) {
15052
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15445
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15053
15446
  xmlns: "http://www.w3.org/2000/svg",
15054
15447
  viewBox: "0 0 20 20",
15055
15448
  fill: "currentColor"
15056
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15449
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15057
15450
  fillRule: "evenodd",
15058
15451
  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",
15059
15452
  clipRule: "evenodd"
@@ -15070,7 +15463,7 @@ const SelectedPaymentMethod = () => {
15070
15463
  state: {
15071
15464
  isLoading
15072
15465
  }
15073
- } = React.useContext(store$f);
15466
+ } = React.useContext(store$g);
15074
15467
  const {
15075
15468
  switchView,
15076
15469
  selectedPaymentMethodId
@@ -15112,7 +15505,7 @@ const TaxAmount = () => {
15112
15505
  state: {
15113
15506
  taxAmount
15114
15507
  }
15115
- } = React.useContext(store$f);
15508
+ } = React.useContext(store$g);
15116
15509
  const {
15117
15510
  plan
15118
15511
  } = usePelcro();
@@ -15276,12 +15669,12 @@ function SubscriptionRenewModal({
15276
15669
  }
15277
15670
  SubscriptionRenewModal.viewId = "subscription-renew";
15278
15671
 
15279
- var _path$j;
15672
+ var _path$k;
15280
15673
 
15281
- 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); }
15674
+ 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); }
15282
15675
 
15283
15676
  function SvgGift(props) {
15284
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
15677
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15285
15678
  className: "plc-w-6 plc-h-6 plc-mr-2",
15286
15679
  fill: "none",
15287
15680
  stroke: "currentColor",
@@ -15290,7 +15683,7 @@ function SvgGift(props) {
15290
15683
  strokeWidth: 2,
15291
15684
  viewBox: "0 0 24 24",
15292
15685
  xmlns: "http://www.w3.org/2000/svg"
15293
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
15686
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15294
15687
  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"
15295
15688
  })));
15296
15689
  }
@@ -15631,7 +16024,7 @@ class DefaultNewsLetter extends React.Component {
15631
16024
 
15632
16025
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15633
16026
 
15634
- const initialState$e = {
16027
+ const initialState$f = {
15635
16028
  didSubToNewslettersBefore: false,
15636
16029
  newsletters: [],
15637
16030
  isListLoading: true,
@@ -15641,10 +16034,10 @@ const initialState$e = {
15641
16034
  content: ""
15642
16035
  }
15643
16036
  };
15644
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
16037
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
15645
16038
  const {
15646
- Provider: Provider$e
15647
- } = store$e;
16039
+ Provider: Provider$f
16040
+ } = store$f;
15648
16041
 
15649
16042
  const NewsletterUpdateContainer = ({
15650
16043
  style,
@@ -15757,7 +16150,7 @@ const NewsletterUpdateContainer = ({
15757
16150
  default:
15758
16151
  return state;
15759
16152
  }
15760
- }, initialState$e);
16153
+ }, initialState$f);
15761
16154
  React.useEffect(() => {
15762
16155
  const getUserNewsletters = () => {
15763
16156
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15801,7 +16194,7 @@ const NewsletterUpdateContainer = ({
15801
16194
  style: { ...style
15802
16195
  },
15803
16196
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15804
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16197
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
15805
16198
  value: {
15806
16199
  state,
15807
16200
  dispatch
@@ -15809,12 +16202,12 @@ const NewsletterUpdateContainer = ({
15809
16202
  }, children.length ? children.map((child, i) => {
15810
16203
  if (child) {
15811
16204
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
15812
- store: store$e,
16205
+ store: store$f,
15813
16206
  key: i
15814
16207
  });
15815
16208
  }
15816
16209
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15817
- store: store$e
16210
+ store: store$f
15818
16211
  })));
15819
16212
  };
15820
16213
 
@@ -15829,7 +16222,7 @@ const NewsletterUpdateButton = ({
15829
16222
  isSubmitting,
15830
16223
  isListLoading
15831
16224
  }
15832
- } = React.useContext(store$e);
16225
+ } = React.useContext(store$f);
15833
16226
  const {
15834
16227
  t
15835
16228
  } = useTranslation("newsletter");
@@ -15859,7 +16252,7 @@ const NewsletterUpdateList = () => {
15859
16252
  newsletters,
15860
16253
  isListLoading
15861
16254
  }
15862
- } = React.useContext(store$e);
16255
+ } = React.useContext(store$f);
15863
16256
 
15864
16257
  if (isListLoading) {
15865
16258
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -16063,7 +16456,7 @@ function SubscriptionCreateModal({
16063
16456
  SubscriptionCreateModal.viewId = "subscription-create";
16064
16457
 
16065
16458
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
16066
- const initialState$d = {
16459
+ const initialState$e = {
16067
16460
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
16068
16461
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
16069
16462
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -16076,10 +16469,10 @@ const initialState$d = {
16076
16469
  content: ""
16077
16470
  }
16078
16471
  };
16079
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
16472
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
16080
16473
  const {
16081
- Provider: Provider$d
16082
- } = store$d;
16474
+ Provider: Provider$e
16475
+ } = store$e;
16083
16476
 
16084
16477
  const UserUpdateContainer = ({
16085
16478
  style,
@@ -16211,27 +16604,27 @@ const UserUpdateContainer = ({
16211
16604
  default:
16212
16605
  return state;
16213
16606
  }
16214
- }, initialState$d);
16607
+ }, initialState$e);
16215
16608
  return /*#__PURE__*/React__default['default'].createElement("div", {
16216
16609
  style: { ...style
16217
16610
  },
16218
16611
  className: `pelcro-container pelcro-user-update-container ${className}`
16219
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16612
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16220
16613
  value: {
16221
16614
  state,
16222
16615
  dispatch
16223
16616
  }
16224
16617
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16225
- store: store$d,
16618
+ store: store$e,
16226
16619
  key: i
16227
16620
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16228
- store: store$d
16621
+ store: store$e
16229
16622
  })));
16230
16623
  };
16231
16624
 
16232
16625
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
16233
16626
  disabled: true,
16234
- store: store$d
16627
+ store: store$e
16235
16628
  }, props));
16236
16629
 
16237
16630
  const UserUpdateButton = ({
@@ -16244,7 +16637,7 @@ const UserUpdateButton = ({
16244
16637
  buttonDisabled
16245
16638
  },
16246
16639
  dispatch
16247
- } = React.useContext(store$d);
16640
+ } = React.useContext(store$e);
16248
16641
  const {
16249
16642
  t
16250
16643
  } = useTranslation("userEdit");
@@ -16261,11 +16654,11 @@ const UserUpdateButton = ({
16261
16654
  };
16262
16655
 
16263
16656
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
16264
- store: store$d
16657
+ store: store$e
16265
16658
  }, props));
16266
16659
 
16267
16660
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
16268
- store: store$d
16661
+ store: store$e
16269
16662
  }, props));
16270
16663
 
16271
16664
  function Phone({
@@ -16294,22 +16687,22 @@ function Phone({
16294
16687
  }
16295
16688
 
16296
16689
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
16297
- store: store$d
16690
+ store: store$e
16298
16691
  }, props));
16299
16692
 
16300
16693
  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";
16301
16694
 
16302
- var _path$i;
16695
+ var _path$j;
16303
16696
 
16304
- 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); }
16697
+ 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); }
16305
16698
 
16306
16699
  function SvgEdit(props) {
16307
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
16700
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
16308
16701
  className: "plc-w-6 plc-h-6",
16309
16702
  xmlns: "http://www.w3.org/2000/svg",
16310
16703
  viewBox: "0 0 20 20",
16311
16704
  fill: "currentColor"
16312
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
16705
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
16313
16706
  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"
16314
16707
  })));
16315
16708
  }
@@ -16441,16 +16834,16 @@ function DisplayName({
16441
16834
  }
16442
16835
 
16443
16836
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16444
- store: store$d
16837
+ store: store$e
16445
16838
  }, props));
16446
16839
 
16447
16840
  const UserUpdateTextInput = props => {
16448
16841
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16449
- store: store$d
16842
+ store: store$e
16450
16843
  }));
16451
16844
  };
16452
16845
 
16453
- const initialState$c = {
16846
+ const initialState$d = {
16454
16847
  isSubmitting: false,
16455
16848
  firstName: "",
16456
16849
  firstNameError: "",
@@ -16475,10 +16868,10 @@ const initialState$c = {
16475
16868
  content: ""
16476
16869
  }
16477
16870
  };
16478
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
16871
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
16479
16872
  const {
16480
- Provider: Provider$c
16481
- } = store$c;
16873
+ Provider: Provider$d
16874
+ } = store$d;
16482
16875
 
16483
16876
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16484
16877
 
@@ -16685,7 +17078,7 @@ const AddressCreateContainer = ({
16685
17078
  default:
16686
17079
  return state;
16687
17080
  }
16688
- }, initialState$c);
17081
+ }, initialState$d);
16689
17082
  React.useEffect(() => {
16690
17083
  const getStates = () => {
16691
17084
  dispatch({
@@ -16717,16 +17110,16 @@ const AddressCreateContainer = ({
16717
17110
  style: { ...style
16718
17111
  },
16719
17112
  className: `pelcro-container pelcro-address-create-container ${className}`
16720
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17113
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16721
17114
  value: {
16722
17115
  state,
16723
17116
  dispatch
16724
17117
  }
16725
17118
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16726
- store: store$c,
17119
+ store: store$d,
16727
17120
  key: i
16728
17121
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16729
- store: store$c
17122
+ store: store$d
16730
17123
  })));
16731
17124
  };
16732
17125
 
@@ -16737,7 +17130,7 @@ function AddressCreateFirstName(props) {
16737
17130
  firstName,
16738
17131
  firstNameError
16739
17132
  }
16740
- } = React.useContext(store$c);
17133
+ } = React.useContext(store$d);
16741
17134
 
16742
17135
  const handleBlur = () => {
16743
17136
  return dispatch({
@@ -16780,7 +17173,7 @@ function AddressCreateLastName(props) {
16780
17173
  lastName,
16781
17174
  lastNameError
16782
17175
  }
16783
- } = React.useContext(store$c);
17176
+ } = React.useContext(store$d);
16784
17177
 
16785
17178
  const handleBlur = () => {
16786
17179
  return dispatch({
@@ -16823,7 +17216,7 @@ function AddressCreateLine1(props) {
16823
17216
  line1,
16824
17217
  line1Error
16825
17218
  }
16826
- } = React.useContext(store$c);
17219
+ } = React.useContext(store$d);
16827
17220
 
16828
17221
  const handleBlur = () => {
16829
17222
  return dispatch({
@@ -16866,7 +17259,7 @@ function AddressCreateCity(props) {
16866
17259
  city,
16867
17260
  cityError
16868
17261
  }
16869
- } = React.useContext(store$c);
17262
+ } = React.useContext(store$d);
16870
17263
 
16871
17264
  const handleBlur = () => {
16872
17265
  return dispatch({
@@ -16909,7 +17302,7 @@ function AddressCreatePostalCode(props) {
16909
17302
  postalCode,
16910
17303
  postalCodeError
16911
17304
  }
16912
- } = React.useContext(store$c);
17305
+ } = React.useContext(store$d);
16913
17306
 
16914
17307
  const handleBlur = () => {
16915
17308
  return dispatch({
@@ -16955,7 +17348,7 @@ const AddressCreateSubmit = ({
16955
17348
  state: {
16956
17349
  isSubmitting
16957
17350
  }
16958
- } = React.useContext(store$c);
17351
+ } = React.useContext(store$d);
16959
17352
  const {
16960
17353
  t
16961
17354
  } = useTranslation("address");
@@ -17066,7 +17459,7 @@ function CountrySelect({
17066
17459
  }
17067
17460
 
17068
17461
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17069
- store: store$c
17462
+ store: store$d
17070
17463
  }, props));
17071
17464
 
17072
17465
  function StateSelect({
@@ -17154,7 +17547,7 @@ function StateSelect({
17154
17547
  }
17155
17548
 
17156
17549
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17157
- store: store$c
17550
+ store: store$d
17158
17551
  }, props));
17159
17552
 
17160
17553
  const AddressCreateView = props => {
@@ -17259,18 +17652,18 @@ AddressCreateModal.viewId = "address-create";
17259
17652
 
17260
17653
  const AddressCreateTextInput = props => {
17261
17654
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17262
- store: store$c
17655
+ store: store$d
17263
17656
  }));
17264
17657
  };
17265
17658
 
17266
17659
  const AddressCreateLine2 = props => {
17267
17660
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17268
17661
  fieldName: "line2",
17269
- store: store$c
17662
+ store: store$d
17270
17663
  }, props));
17271
17664
  };
17272
17665
 
17273
- const initialState$b = {
17666
+ const initialState$c = {
17274
17667
  isSubmitting: false,
17275
17668
  firstName: "",
17276
17669
  firstNameError: "",
@@ -17295,10 +17688,10 @@ const initialState$b = {
17295
17688
  content: ""
17296
17689
  }
17297
17690
  };
17298
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
17691
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
17299
17692
  const {
17300
- Provider: Provider$b
17301
- } = store$b;
17693
+ Provider: Provider$c
17694
+ } = store$c;
17302
17695
 
17303
17696
  const AddressUpdateContainer = ({
17304
17697
  style,
@@ -17350,7 +17743,7 @@ const AddressUpdateContainer = ({
17350
17743
  const thisAddress = addresses[address];
17351
17744
 
17352
17745
  if (+thisAddress.id === +addressId) {
17353
- const newState = { ...initialState$b,
17746
+ const newState = { ...initialState$c,
17354
17747
  firstName: thisAddress.first_name,
17355
17748
  lastName: thisAddress.last_name,
17356
17749
  line1: thisAddress.line1,
@@ -17483,7 +17876,7 @@ const AddressUpdateContainer = ({
17483
17876
  default:
17484
17877
  return state;
17485
17878
  }
17486
- }, initialState$b);
17879
+ }, initialState$c);
17487
17880
  React.useEffect(() => {
17488
17881
  const getStates = () => {
17489
17882
  dispatch({
@@ -17515,21 +17908,21 @@ const AddressUpdateContainer = ({
17515
17908
  style: { ...style
17516
17909
  },
17517
17910
  className: `pelcro-container pelcro-address-update-container ${className}`
17518
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17911
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17519
17912
  value: {
17520
17913
  state,
17521
17914
  dispatch
17522
17915
  }
17523
17916
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17524
- store: store$b,
17917
+ store: store$c,
17525
17918
  key: i
17526
17919
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17527
- store: store$b
17920
+ store: store$c
17528
17921
  })));
17529
17922
  };
17530
17923
 
17531
17924
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17532
- store: store$b
17925
+ store: store$c
17533
17926
  }, props));
17534
17927
 
17535
17928
  function AddressUpdateFirstName(props) {
@@ -17539,7 +17932,7 @@ function AddressUpdateFirstName(props) {
17539
17932
  firstName,
17540
17933
  firstNameError
17541
17934
  }
17542
- } = React.useContext(store$b);
17935
+ } = React.useContext(store$c);
17543
17936
 
17544
17937
  const handleBlur = () => {
17545
17938
  return dispatch({
@@ -17582,7 +17975,7 @@ function AddressUpdateLastName(props) {
17582
17975
  lastName,
17583
17976
  lastNameError
17584
17977
  }
17585
- } = React.useContext(store$b);
17978
+ } = React.useContext(store$c);
17586
17979
 
17587
17980
  const handleBlur = () => {
17588
17981
  return dispatch({
@@ -17625,7 +18018,7 @@ function AddressUpdateLine1(props) {
17625
18018
  line1,
17626
18019
  line1Error
17627
18020
  }
17628
- } = React.useContext(store$b);
18021
+ } = React.useContext(store$c);
17629
18022
 
17630
18023
  const handleBlur = () => {
17631
18024
  return dispatch({
@@ -17665,7 +18058,7 @@ const AddressUpdateLine2 = props => {
17665
18058
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17666
18059
  fieldName: "line2"
17667
18060
  }, props, {
17668
- store: store$b
18061
+ store: store$c
17669
18062
  }));
17670
18063
  };
17671
18064
 
@@ -17676,7 +18069,7 @@ function AddressUpdateCity(props) {
17676
18069
  city,
17677
18070
  cityError
17678
18071
  }
17679
- } = React.useContext(store$b);
18072
+ } = React.useContext(store$c);
17680
18073
 
17681
18074
  const handleBlur = () => {
17682
18075
  return dispatch({
@@ -17719,7 +18112,7 @@ function AddressUpdatePostalCode(props) {
17719
18112
  postalCode,
17720
18113
  postalCodeError
17721
18114
  }
17722
- } = React.useContext(store$b);
18115
+ } = React.useContext(store$c);
17723
18116
 
17724
18117
  const handleBlur = () => {
17725
18118
  return dispatch({
@@ -17765,7 +18158,7 @@ const AddressUpdateSubmit = ({
17765
18158
  state: {
17766
18159
  isSubmitting
17767
18160
  }
17768
- } = React.useContext(store$b);
18161
+ } = React.useContext(store$c);
17769
18162
  const {
17770
18163
  t
17771
18164
  } = useTranslation("address");
@@ -17781,7 +18174,7 @@ const AddressUpdateSubmit = ({
17781
18174
  };
17782
18175
 
17783
18176
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17784
- store: store$b
18177
+ store: store$c
17785
18178
  }, props));
17786
18179
 
17787
18180
  const AddressUpdateView = props => {
@@ -17864,7 +18257,7 @@ AddressUpdateModal.viewId = "address-edit";
17864
18257
 
17865
18258
  const AddressUpdateTextInput = props => {
17866
18259
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17867
- store: store$b
18260
+ store: store$c
17868
18261
  }));
17869
18262
  };
17870
18263
 
@@ -17947,7 +18340,7 @@ const PaymentMethodUpdateModal = props => {
17947
18340
  };
17948
18341
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17949
18342
 
17950
- const initialState$a = {
18343
+ const initialState$b = {
17951
18344
  email: "",
17952
18345
  password: "",
17953
18346
  passwordError: null,
@@ -17960,10 +18353,10 @@ const initialState$a = {
17960
18353
  content: ""
17961
18354
  }
17962
18355
  };
17963
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
18356
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
17964
18357
  const {
17965
- Provider: Provider$a
17966
- } = store$a;
18358
+ Provider: Provider$b
18359
+ } = store$b;
17967
18360
 
17968
18361
  const PasswordResetContainer = ({
17969
18362
  style,
@@ -18020,7 +18413,7 @@ const PasswordResetContainer = ({
18020
18413
  type: SET_EMAIL,
18021
18414
  payload: window.Pelcro.helpers.getURLParameter("email")
18022
18415
  });
18023
- initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18416
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
18024
18417
  dispatch({
18025
18418
  type: SET_TOKEN,
18026
18419
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -18080,26 +18473,26 @@ const PasswordResetContainer = ({
18080
18473
  default:
18081
18474
  return state;
18082
18475
  }
18083
- }, initialState$a);
18476
+ }, initialState$b);
18084
18477
  return /*#__PURE__*/React__default['default'].createElement("div", {
18085
18478
  style: { ...style
18086
18479
  },
18087
18480
  className: `pelcro-container pelcro-password-reset-container ${className}`
18088
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18481
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
18089
18482
  value: {
18090
18483
  state,
18091
18484
  dispatch
18092
18485
  }
18093
18486
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18094
- store: store$a,
18487
+ store: store$b,
18095
18488
  key: i
18096
18489
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18097
- store: store$a
18490
+ store: store$b
18098
18491
  })));
18099
18492
  };
18100
18493
 
18101
18494
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
18102
- store: store$a
18495
+ store: store$b
18103
18496
  }, props));
18104
18497
 
18105
18498
  const PasswordResetButton = ({
@@ -18112,7 +18505,7 @@ const PasswordResetButton = ({
18112
18505
  buttonDisabled
18113
18506
  },
18114
18507
  dispatch
18115
- } = React.useContext(store$a);
18508
+ } = React.useContext(store$b);
18116
18509
  const {
18117
18510
  t
18118
18511
  } = useTranslation("passwordReset");
@@ -18129,14 +18522,14 @@ const PasswordResetButton = ({
18129
18522
  };
18130
18523
 
18131
18524
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18132
- store: store$a
18525
+ store: store$b
18133
18526
  }, props, {
18134
18527
  value: window.Pelcro.helpers.getURLParameter("email"),
18135
18528
  disabled: true
18136
18529
  }));
18137
18530
 
18138
18531
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
18139
- store: store$a
18532
+ store: store$b
18140
18533
  }, props));
18141
18534
 
18142
18535
  const PasswordResetView = props => {
@@ -18188,7 +18581,7 @@ const PasswordResetModal = ({
18188
18581
  };
18189
18582
  PasswordResetModal.viewId = "password-reset";
18190
18583
 
18191
- const initialState$9 = {
18584
+ const initialState$a = {
18192
18585
  email: "",
18193
18586
  emailError: null,
18194
18587
  buttonDisabled: false,
@@ -18197,10 +18590,10 @@ const initialState$9 = {
18197
18590
  content: ""
18198
18591
  }
18199
18592
  };
18200
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18593
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
18201
18594
  const {
18202
- Provider: Provider$9
18203
- } = store$9;
18595
+ Provider: Provider$a
18596
+ } = store$a;
18204
18597
 
18205
18598
  const PasswordForgotContainer = ({
18206
18599
  style,
@@ -18278,21 +18671,21 @@ const PasswordForgotContainer = ({
18278
18671
  default:
18279
18672
  return state;
18280
18673
  }
18281
- }, initialState$9);
18674
+ }, initialState$a);
18282
18675
  return /*#__PURE__*/React__default['default'].createElement("div", {
18283
18676
  style: { ...style
18284
18677
  },
18285
18678
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18286
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18679
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18287
18680
  value: {
18288
18681
  state,
18289
18682
  dispatch
18290
18683
  }
18291
18684
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18292
- store: store$9,
18685
+ store: store$a,
18293
18686
  key: i
18294
18687
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18295
- store: store$9
18688
+ store: store$a
18296
18689
  })));
18297
18690
  };
18298
18691
 
@@ -18308,7 +18701,7 @@ const PasswordForgotButton = ({
18308
18701
  emailError
18309
18702
  },
18310
18703
  dispatch
18311
- } = React.useContext(store$9);
18704
+ } = React.useContext(store$a);
18312
18705
  const {
18313
18706
  t
18314
18707
  } = useTranslation("passwordForgot");
@@ -18329,7 +18722,7 @@ const PasswordForgotButton = ({
18329
18722
  };
18330
18723
 
18331
18724
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18332
- store: store$9
18725
+ store: store$a
18333
18726
  }, props));
18334
18727
 
18335
18728
  const PasswordForgotView = props => {
@@ -18379,7 +18772,7 @@ const PasswordForgotModal = ({
18379
18772
  };
18380
18773
  PasswordForgotModal.viewId = "password-forgot";
18381
18774
 
18382
- const initialState$8 = {
18775
+ const initialState$9 = {
18383
18776
  currentPassword: "",
18384
18777
  newPassword: "",
18385
18778
  confirmNewPassword: "",
@@ -18393,10 +18786,10 @@ const initialState$8 = {
18393
18786
  content: ""
18394
18787
  }
18395
18788
  };
18396
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18789
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18397
18790
  const {
18398
- Provider: Provider$8
18399
- } = store$8;
18791
+ Provider: Provider$9
18792
+ } = store$9;
18400
18793
  const PasswordChangeContainer = ({
18401
18794
  style,
18402
18795
  className = "",
@@ -18548,21 +18941,21 @@ const PasswordChangeContainer = ({
18548
18941
  default:
18549
18942
  return state;
18550
18943
  }
18551
- }, initialState$8);
18944
+ }, initialState$9);
18552
18945
  return /*#__PURE__*/React__default['default'].createElement("div", {
18553
18946
  style: { ...style
18554
18947
  },
18555
18948
  className: `pelcro-container pelcro-password-change-container ${className}`
18556
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18949
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18557
18950
  value: {
18558
18951
  state,
18559
18952
  dispatch
18560
18953
  }
18561
18954
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18562
- store: store$8,
18955
+ store: store$9,
18563
18956
  key: i
18564
18957
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18565
- store: store$8
18958
+ store: store$9
18566
18959
  })));
18567
18960
  };
18568
18961
 
@@ -18573,7 +18966,7 @@ function PasswordChangeCurrentPassword(props) {
18573
18966
  currentPassword,
18574
18967
  currentPasswordError
18575
18968
  }
18576
- } = React.useContext(store$8);
18969
+ } = React.useContext(store$9);
18577
18970
  const handleBlur = React.useCallback(() => {
18578
18971
  return dispatch({
18579
18972
  type: VALIDATE_PASSWORD
@@ -18607,7 +19000,7 @@ function PasswordChangeNewPassword(props) {
18607
19000
  newPassword,
18608
19001
  newPasswordError
18609
19002
  }
18610
- } = React.useContext(store$8);
19003
+ } = React.useContext(store$9);
18611
19004
  const handleBlur = React.useCallback(() => {
18612
19005
  return dispatch({
18613
19006
  type: VALIDATE_NEW_PASSWORD
@@ -18641,7 +19034,7 @@ function PasswordChangeConfirmNewPassword(props) {
18641
19034
  confirmNewPassword,
18642
19035
  confirmNewPasswordError
18643
19036
  }
18644
- } = React.useContext(store$8);
19037
+ } = React.useContext(store$9);
18645
19038
  const handleBlur = React.useCallback(() => {
18646
19039
  return dispatch({
18647
19040
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18682,7 +19075,7 @@ const PasswordChangeButton = ({
18682
19075
  confirmNewPasswordError
18683
19076
  },
18684
19077
  dispatch
18685
- } = React.useContext(store$8);
19078
+ } = React.useContext(store$9);
18686
19079
  const {
18687
19080
  t
18688
19081
  } = useTranslation("passwordChange");
@@ -18748,17 +19141,17 @@ const PasswordChangeModal = ({
18748
19141
  };
18749
19142
  PasswordChangeModal.viewId = "password-change";
18750
19143
 
18751
- const initialState$7 = {
19144
+ const initialState$8 = {
18752
19145
  buttonDisabled: false,
18753
19146
  alert: {
18754
19147
  type: "error",
18755
19148
  content: ""
18756
19149
  }
18757
19150
  };
18758
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19151
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18759
19152
  const {
18760
- Provider: Provider$7
18761
- } = store$7;
19153
+ Provider: Provider$8
19154
+ } = store$8;
18762
19155
 
18763
19156
  const CartContainer = ({
18764
19157
  style,
@@ -18849,21 +19242,21 @@ const CartContainer = ({
18849
19242
  default:
18850
19243
  return state;
18851
19244
  }
18852
- }, initialState$7);
19245
+ }, initialState$8);
18853
19246
  return /*#__PURE__*/React__default['default'].createElement("div", {
18854
19247
  style: { ...style
18855
19248
  },
18856
19249
  className: `pelcro-container pelcro-cart-container ${className}`
18857
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19250
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18858
19251
  value: {
18859
19252
  state,
18860
19253
  dispatch
18861
19254
  }
18862
19255
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18863
- store: store$7,
19256
+ store: store$8,
18864
19257
  key: i
18865
19258
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18866
- store: store$7
19259
+ store: store$8
18867
19260
  })));
18868
19261
  };
18869
19262
 
@@ -18900,7 +19293,7 @@ const CartSubmit = ({
18900
19293
  buttonDisabled
18901
19294
  },
18902
19295
  dispatch
18903
- } = React.useContext(store$7);
19296
+ } = React.useContext(store$8);
18904
19297
  const {
18905
19298
  t
18906
19299
  } = useTranslation("cart");
@@ -18931,7 +19324,7 @@ const CartTotalPrice = () => {
18931
19324
  state: {
18932
19325
  alert
18933
19326
  }
18934
- } = React.useContext(store$7);
19327
+ } = React.useContext(store$8);
18935
19328
  const {
18936
19329
  cartItems
18937
19330
  } = usePelcro();
@@ -19244,7 +19637,7 @@ const OrderConfirmModal = props => {
19244
19637
  };
19245
19638
  OrderConfirmModal.viewId = "order-confirm";
19246
19639
 
19247
- const initialState$6 = {
19640
+ const initialState$7 = {
19248
19641
  email: "",
19249
19642
  firstName: "",
19250
19643
  lastName: "",
@@ -19256,10 +19649,10 @@ const initialState$6 = {
19256
19649
  content: ""
19257
19650
  }
19258
19651
  };
19259
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19652
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19260
19653
  const {
19261
- Provider: Provider$6
19262
- } = store$6;
19654
+ Provider: Provider$7
19655
+ } = store$7;
19263
19656
 
19264
19657
  const GiftCreateContainer = ({
19265
19658
  style,
@@ -19363,21 +19756,21 @@ const GiftCreateContainer = ({
19363
19756
  default:
19364
19757
  return state;
19365
19758
  }
19366
- }, initialState$6);
19759
+ }, initialState$7);
19367
19760
  return /*#__PURE__*/React__default['default'].createElement("div", {
19368
19761
  style: { ...style
19369
19762
  },
19370
19763
  className: `pelcro-container pelcro-gift-create-container ${className}`
19371
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19764
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19372
19765
  value: {
19373
19766
  state,
19374
19767
  dispatch
19375
19768
  }
19376
19769
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19377
- store: store$6,
19770
+ store: store$7,
19378
19771
  key: i
19379
19772
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19380
- store: store$6
19773
+ store: store$7
19381
19774
  })));
19382
19775
  };
19383
19776
 
@@ -19391,7 +19784,7 @@ const GiftCreateSubmitButton = ({
19391
19784
  state: {
19392
19785
  disableSubmit
19393
19786
  }
19394
- } = React.useContext(store$6);
19787
+ } = React.useContext(store$7);
19395
19788
  const {
19396
19789
  t
19397
19790
  } = useTranslation("register");
@@ -19408,29 +19801,29 @@ const GiftCreateSubmitButton = ({
19408
19801
 
19409
19802
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
19410
19803
  initWithUserEmail: false,
19411
- store: store$6
19804
+ store: store$7
19412
19805
  }, props));
19413
19806
 
19414
19807
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
19415
- store: store$6
19808
+ store: store$7
19416
19809
  }, props));
19417
19810
 
19418
19811
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
19419
- store: store$6
19812
+ store: store$7
19420
19813
  }, props));
19421
19814
 
19422
- var _path$h;
19815
+ var _path$i;
19423
19816
 
19424
- 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); }
19817
+ 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); }
19425
19818
 
19426
19819
  function SvgInfoCircle(props) {
19427
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
19820
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
19428
19821
  xmlns: "http://www.w3.org/2000/svg",
19429
19822
  className: "plc-w-5 plc-h-5",
19430
19823
  fill: "none",
19431
19824
  viewBox: "0 0 24 24",
19432
19825
  stroke: "currentColor"
19433
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
19826
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
19434
19827
  strokeLinecap: "round",
19435
19828
  strokeLinejoin: "round",
19436
19829
  strokeWidth: 2,
@@ -19501,7 +19894,7 @@ const GiftCreateStartDate = props => {
19501
19894
  const {
19502
19895
  dispatch,
19503
19896
  state
19504
- } = React.useContext(store$6);
19897
+ } = React.useContext(store$7);
19505
19898
 
19506
19899
  const handleInputChange = value => {
19507
19900
  dispatch({
@@ -19574,7 +19967,7 @@ function GiftCreateMessage(props) {
19574
19967
  const {
19575
19968
  dispatch,
19576
19969
  state
19577
- } = React.useContext(store$6);
19970
+ } = React.useContext(store$7);
19578
19971
  const MAX_CHARS_COUNT = 200;
19579
19972
  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;
19580
19973
 
@@ -19698,7 +20091,7 @@ const GiftCreateModal = ({
19698
20091
  };
19699
20092
  GiftCreateModal.viewId = "gift-create";
19700
20093
 
19701
- const initialState$5 = {
20094
+ const initialState$6 = {
19702
20095
  giftCode: "",
19703
20096
  buttonDisabled: true,
19704
20097
  alert: {
@@ -19706,10 +20099,10 @@ const initialState$5 = {
19706
20099
  content: ""
19707
20100
  }
19708
20101
  };
19709
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20102
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19710
20103
  const {
19711
- Provider: Provider$5
19712
- } = store$5;
20104
+ Provider: Provider$6
20105
+ } = store$6;
19713
20106
 
19714
20107
  const GiftRedeemContainer = ({
19715
20108
  style,
@@ -19774,21 +20167,21 @@ const GiftRedeemContainer = ({
19774
20167
  default:
19775
20168
  return state;
19776
20169
  }
19777
- }, initialState$5);
20170
+ }, initialState$6);
19778
20171
  return /*#__PURE__*/React__default['default'].createElement("div", {
19779
20172
  style: { ...style
19780
20173
  },
19781
20174
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19782
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20175
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19783
20176
  value: {
19784
20177
  state,
19785
20178
  dispatch
19786
20179
  }
19787
20180
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19788
- store: store$5,
20181
+ store: store$6,
19789
20182
  key: i
19790
20183
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19791
- store: store$5
20184
+ store: store$6
19792
20185
  })));
19793
20186
  };
19794
20187
 
@@ -19825,7 +20218,7 @@ function GiftCode({
19825
20218
  }
19826
20219
 
19827
20220
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
19828
- store: store$5
20221
+ store: store$6
19829
20222
  }, props));
19830
20223
 
19831
20224
  const GiftRedeemSubmitButton = ({
@@ -19838,7 +20231,7 @@ const GiftRedeemSubmitButton = ({
19838
20231
  state: {
19839
20232
  disableSubmit
19840
20233
  }
19841
- } = React.useContext(store$5);
20234
+ } = React.useContext(store$6);
19842
20235
  const {
19843
20236
  t
19844
20237
  } = useTranslation("register");
@@ -19931,7 +20324,7 @@ const moveDefaultAddressToStart = addresses => {
19931
20324
  return [defaultAddress, ...addressesWithoutDefault];
19932
20325
  };
19933
20326
 
19934
- const initialState$4 = {
20327
+ const initialState$5 = {
19935
20328
  addresses: [],
19936
20329
  selectedAddressId: null,
19937
20330
  isSubmitting: false,
@@ -19940,10 +20333,10 @@ const initialState$4 = {
19940
20333
  content: ""
19941
20334
  }
19942
20335
  };
19943
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20336
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19944
20337
  const {
19945
- Provider: Provider$4
19946
- } = store$4;
20338
+ Provider: Provider$5
20339
+ } = store$5;
19947
20340
 
19948
20341
  const AddressSelectContainer = ({
19949
20342
  style,
@@ -20038,7 +20431,7 @@ const AddressSelectContainer = ({
20038
20431
  default:
20039
20432
  return state;
20040
20433
  }
20041
- }, initialState$4);
20434
+ }, initialState$5);
20042
20435
  React.useEffect(() => {
20043
20436
  var _window$Pelcro$user$r;
20044
20437
 
@@ -20051,16 +20444,16 @@ const AddressSelectContainer = ({
20051
20444
  style: { ...style
20052
20445
  },
20053
20446
  className: `pelcro-container pelcro-address-select-container ${className}`
20054
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20447
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20055
20448
  value: {
20056
20449
  state,
20057
20450
  dispatch
20058
20451
  }
20059
20452
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20060
- store: store$4,
20453
+ store: store$5,
20061
20454
  key: i
20062
20455
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20063
- store: store$4
20456
+ store: store$5
20064
20457
  })));
20065
20458
  };
20066
20459
 
@@ -20071,7 +20464,7 @@ const AddressSelectList = () => {
20071
20464
  addresses,
20072
20465
  selectedAddressId
20073
20466
  }
20074
- } = React.useContext(store$4);
20467
+ } = React.useContext(store$5);
20075
20468
 
20076
20469
  const handleAddressSelect = event => {
20077
20470
  dispatch({
@@ -20115,7 +20508,7 @@ const AddressSelectSubmit = ({
20115
20508
  selectedAddressId,
20116
20509
  isSubmitting
20117
20510
  }
20118
- } = React.useContext(store$4);
20511
+ } = React.useContext(store$5);
20119
20512
  const {
20120
20513
  t
20121
20514
  } = useTranslation("address");
@@ -20211,7 +20604,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20211
20604
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20212
20605
  };
20213
20606
 
20214
- const initialState$3 = {
20607
+ const initialState$4 = {
20215
20608
  paymentMethods: [],
20216
20609
  selectedPaymentMethodId: null,
20217
20610
  isSubmitting: false,
@@ -20220,10 +20613,10 @@ const initialState$3 = {
20220
20613
  content: ""
20221
20614
  }
20222
20615
  };
20223
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
20616
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20224
20617
  const {
20225
- Provider: Provider$3
20226
- } = store$3;
20618
+ Provider: Provider$4
20619
+ } = store$4;
20227
20620
 
20228
20621
  const PaymentMethodSelectContainer = ({
20229
20622
  style,
@@ -20282,7 +20675,7 @@ const PaymentMethodSelectContainer = ({
20282
20675
  default:
20283
20676
  return state;
20284
20677
  }
20285
- }, initialState$3);
20678
+ }, initialState$4);
20286
20679
  React.useEffect(() => {
20287
20680
  var _window$Pelcro$user$r3;
20288
20681
 
@@ -20295,16 +20688,16 @@ const PaymentMethodSelectContainer = ({
20295
20688
  style: { ...style
20296
20689
  },
20297
20690
  className: `pelcro-container pelcro-payment-select-container ${className}`
20298
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
20691
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20299
20692
  value: {
20300
20693
  state,
20301
20694
  dispatch
20302
20695
  }
20303
20696
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20304
- store: store$3,
20697
+ store: store$4,
20305
20698
  key: i
20306
20699
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20307
- store: store$3
20700
+ store: store$4
20308
20701
  })));
20309
20702
  };
20310
20703
 
@@ -20318,7 +20711,7 @@ const PaymentMethodSelectList = () => {
20318
20711
  paymentMethods,
20319
20712
  selectedPaymentMethodId
20320
20713
  }
20321
- } = React.useContext(store$3);
20714
+ } = React.useContext(store$4);
20322
20715
 
20323
20716
  const handlePaymentMethodSelect = event => {
20324
20717
  dispatch({
@@ -20368,7 +20761,7 @@ const PaymentMethodSelectSubmit = ({
20368
20761
  selectedPaymentMethodId,
20369
20762
  isSubmitting
20370
20763
  }
20371
- } = React.useContext(store$3);
20764
+ } = React.useContext(store$4);
20372
20765
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20373
20766
  onClick: () => {
20374
20767
  dispatch({
@@ -20442,8 +20835,8 @@ const PaymentMethodSelectModal = ({
20442
20835
  };
20443
20836
  PaymentMethodSelectModal.viewId = "payment-method-select";
20444
20837
 
20445
- function _extends$i() {
20446
- _extends$i = Object.assign || function (target) {
20838
+ function _extends$j() {
20839
+ _extends$j = Object.assign || function (target) {
20447
20840
  for (var i = 1; i < arguments.length; i++) {
20448
20841
  var source = arguments[i];
20449
20842
 
@@ -20457,7 +20850,7 @@ function _extends$i() {
20457
20850
  return target;
20458
20851
  };
20459
20852
 
20460
- return _extends$i.apply(this, arguments);
20853
+ return _extends$j.apply(this, arguments);
20461
20854
  }
20462
20855
 
20463
20856
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20641,7 +21034,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20641
21034
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20642
21035
  return null;
20643
21036
  }, _match[RenderStrategy.Hidden] = function () {
20644
- return _render(_extends$i({}, _rest, {
21037
+ return _render(_extends$j({}, _rest, {
20645
21038
  hidden: true,
20646
21039
  style: {
20647
21040
  display: 'none'
@@ -21169,7 +21562,7 @@ function TransitionChild(props) {
21169
21562
  var passthroughProps = rest;
21170
21563
  return React__default['default'].createElement(NestingContext.Provider, {
21171
21564
  value: nesting
21172
- }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21565
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21173
21566
  }
21174
21567
 
21175
21568
  function Transition(props) {
@@ -21213,7 +21606,7 @@ function Transition(props) {
21213
21606
  value: nestingBag
21214
21607
  }, React__default['default'].createElement(TransitionContext.Provider, {
21215
21608
  value: transitionBag
21216
- }, render(_extends$i({}, sharedProps, {
21609
+ }, render(_extends$j({}, sharedProps, {
21217
21610
  as: React.Fragment,
21218
21611
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21219
21612
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21340,12 +21733,12 @@ var ActionTypes;
21340
21733
  })(ActionTypes || (ActionTypes = {}));
21341
21734
 
21342
21735
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21343
- return _extends$i({}, state, {
21736
+ return _extends$j({}, state, {
21344
21737
  activeItemIndex: null,
21345
21738
  menuState: MenuStates.Closed
21346
21739
  });
21347
21740
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21348
- return _extends$i({}, state, {
21741
+ return _extends$j({}, state, {
21349
21742
  menuState: MenuStates.Open
21350
21743
  });
21351
21744
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21364,7 +21757,7 @@ var ActionTypes;
21364
21757
  }
21365
21758
  });
21366
21759
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21367
- return _extends$i({}, state, {
21760
+ return _extends$j({}, state, {
21368
21761
  searchQuery: '',
21369
21762
  activeItemIndex: activeItemIndex
21370
21763
  });
@@ -21375,19 +21768,19 @@ var ActionTypes;
21375
21768
 
21376
21769
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21377
21770
  });
21378
- if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
21771
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21379
21772
  searchQuery: searchQuery
21380
21773
  });
21381
- return _extends$i({}, state, {
21774
+ return _extends$j({}, state, {
21382
21775
  searchQuery: searchQuery,
21383
21776
  activeItemIndex: match
21384
21777
  });
21385
21778
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21386
- return _extends$i({}, state, {
21779
+ return _extends$j({}, state, {
21387
21780
  searchQuery: ''
21388
21781
  });
21389
21782
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21390
- return _extends$i({}, state, {
21783
+ return _extends$j({}, state, {
21391
21784
  items: [].concat(state.items, [{
21392
21785
  id: action.id,
21393
21786
  dataRef: action.dataRef
@@ -21400,7 +21793,7 @@ var ActionTypes;
21400
21793
  return a.id === action.id;
21401
21794
  });
21402
21795
  if (idx !== -1) nextItems.splice(idx, 1);
21403
- return _extends$i({}, state, {
21796
+ return _extends$j({}, state, {
21404
21797
  items: nextItems,
21405
21798
  activeItemIndex: function () {
21406
21799
  if (idx === state.activeItemIndex) return null;
@@ -21439,19 +21832,19 @@ var ActionTypes$1;
21439
21832
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21440
21833
  if (state.disabled) return state;
21441
21834
  if (state.listboxState === ListboxStates.Closed) return state;
21442
- return _extends$i({}, state, {
21835
+ return _extends$j({}, state, {
21443
21836
  activeOptionIndex: null,
21444
21837
  listboxState: ListboxStates.Closed
21445
21838
  });
21446
21839
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21447
21840
  if (state.disabled) return state;
21448
21841
  if (state.listboxState === ListboxStates.Open) return state;
21449
- return _extends$i({}, state, {
21842
+ return _extends$j({}, state, {
21450
21843
  listboxState: ListboxStates.Open
21451
21844
  });
21452
21845
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21453
21846
  if (state.disabled === action.disabled) return state;
21454
- return _extends$i({}, state, {
21847
+ return _extends$j({}, state, {
21455
21848
  disabled: action.disabled
21456
21849
  });
21457
21850
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21472,7 +21865,7 @@ var ActionTypes$1;
21472
21865
  }
21473
21866
  });
21474
21867
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21475
- return _extends$i({}, state, {
21868
+ return _extends$j({}, state, {
21476
21869
  searchQuery: '',
21477
21870
  activeOptionIndex: activeOptionIndex
21478
21871
  });
@@ -21485,10 +21878,10 @@ var ActionTypes$1;
21485
21878
 
21486
21879
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21487
21880
  });
21488
- if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21881
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21489
21882
  searchQuery: searchQuery
21490
21883
  });
21491
- return _extends$i({}, state, {
21884
+ return _extends$j({}, state, {
21492
21885
  searchQuery: searchQuery,
21493
21886
  activeOptionIndex: match
21494
21887
  });
@@ -21496,11 +21889,11 @@ var ActionTypes$1;
21496
21889
  if (state.disabled) return state;
21497
21890
  if (state.listboxState === ListboxStates.Closed) return state;
21498
21891
  if (state.searchQuery === '') return state;
21499
- return _extends$i({}, state, {
21892
+ return _extends$j({}, state, {
21500
21893
  searchQuery: ''
21501
21894
  });
21502
21895
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21503
- return _extends$i({}, state, {
21896
+ return _extends$j({}, state, {
21504
21897
  options: [].concat(state.options, [{
21505
21898
  id: action.id,
21506
21899
  dataRef: action.dataRef
@@ -21513,7 +21906,7 @@ var ActionTypes$1;
21513
21906
  return a.id === action.id;
21514
21907
  });
21515
21908
  if (idx !== -1) nextOptions.splice(idx, 1);
21516
- return _extends$i({}, state, {
21909
+ return _extends$j({}, state, {
21517
21910
  options: nextOptions,
21518
21911
  activeOptionIndex: function () {
21519
21912
  if (idx === state.activeOptionIndex) return null;
@@ -21574,18 +21967,18 @@ const getPaymentCardIcon = name => {
21574
21967
  }));
21575
21968
  };
21576
21969
 
21577
- var _path$g;
21970
+ var _path$h;
21578
21971
 
21579
- 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); }
21972
+ 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); }
21580
21973
 
21581
21974
  function SvgChevronRight(props) {
21582
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21975
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
21583
21976
  className: "plc-w-6 plc-h-6",
21584
21977
  xmlns: "http://www.w3.org/2000/svg",
21585
21978
  fill: "none",
21586
21979
  viewBox: "0 0 24 24",
21587
21980
  stroke: "currentColor"
21588
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21981
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
21589
21982
  strokeLinecap: "round",
21590
21983
  strokeLinejoin: "round",
21591
21984
  strokeWidth: 2,
@@ -21801,18 +22194,18 @@ const SavedItems = ({
21801
22194
  });
21802
22195
  };
21803
22196
 
21804
- var _path$f;
22197
+ var _path$g;
21805
22198
 
21806
- 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); }
22199
+ 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); }
21807
22200
 
21808
22201
  function SvgRefresh(props) {
21809
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
22202
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21810
22203
  className: "plc-w-4 plc-h-4 plc-mr-1",
21811
22204
  xmlns: "http://www.w3.org/2000/svg",
21812
22205
  fill: "none",
21813
22206
  viewBox: "0 0 24 24",
21814
22207
  stroke: "currentColor"
21815
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
22208
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21816
22209
  strokeLinecap: "round",
21817
22210
  strokeLinejoin: "round",
21818
22211
  strokeWidth: 2,
@@ -21820,35 +22213,35 @@ function SvgRefresh(props) {
21820
22213
  })));
21821
22214
  }
21822
22215
 
21823
- var _path$e;
22216
+ var _path$f;
21824
22217
 
21825
- 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); }
22218
+ 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); }
21826
22219
 
21827
22220
  function SvgCalendar(props) {
21828
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22221
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21829
22222
  xmlns: "http://www.w3.org/2000/svg",
21830
22223
  className: "plc-h-4 plc-w-4 plc-mr-1",
21831
22224
  viewBox: "0 0 20 20",
21832
22225
  fill: "currentColor"
21833
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22226
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21834
22227
  fillRule: "evenodd",
21835
22228
  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",
21836
22229
  clipRule: "evenodd"
21837
22230
  })));
21838
22231
  }
21839
22232
 
21840
- var _path$d;
22233
+ var _path$e;
21841
22234
 
21842
- 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); }
22235
+ 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); }
21843
22236
 
21844
22237
  function SvgPlus(props) {
21845
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22238
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21846
22239
  className: "plc-w-5 plc-h-5",
21847
22240
  xmlns: "http://www.w3.org/2000/svg",
21848
22241
  fill: "none",
21849
22242
  viewBox: "0 0 24 24",
21850
22243
  stroke: "currentColor"
21851
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22244
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21852
22245
  strokeLinecap: "round",
21853
22246
  strokeLinejoin: "round",
21854
22247
  strokeWidth: 2,
@@ -21856,17 +22249,17 @@ function SvgPlus(props) {
21856
22249
  })));
21857
22250
  }
21858
22251
 
21859
- var _path$c;
22252
+ var _path$d;
21860
22253
 
21861
- 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); }
22254
+ 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); }
21862
22255
 
21863
22256
  function SvgCheckMark(props) {
21864
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22257
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21865
22258
  className: "plc-w-4 plc-h-4 plc-mr-1",
21866
22259
  xmlns: "http://www.w3.org/2000/svg",
21867
22260
  viewBox: "0 0 20 20",
21868
22261
  fill: "currentColor"
21869
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22262
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21870
22263
  fillRule: "evenodd",
21871
22264
  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",
21872
22265
  clipRule: "evenodd"
@@ -21930,7 +22323,8 @@ const SubscriptionsItems = ({
21930
22323
  } = useTranslation("dashboard");
21931
22324
  const {
21932
22325
  switchView,
21933
- isAuthenticated
22326
+ switchToAddressView,
22327
+ switchToPaymentView
21934
22328
  } = usePelcro();
21935
22329
  const subs = getNonDonationSubs();
21936
22330
  if (subs.length === 0) return null;
@@ -21972,7 +22366,12 @@ const SubscriptionsItems = ({
21972
22366
  const plan = window.Pelcro.plan.getById(plan_id);
21973
22367
  setProductAndPlan(product, plan);
21974
22368
  setSubscriptionIdToRenew(sub.id);
21975
- setView("plan-select");
22369
+
22370
+ if (product.address_required) {
22371
+ return switchToAddressView();
22372
+ }
22373
+
22374
+ return switchToPaymentView();
21976
22375
  };
21977
22376
 
21978
22377
  const getPhases = () => {
@@ -22161,18 +22560,18 @@ Accordion.item = function AccordionItem({
22161
22560
  }, content)) : null;
22162
22561
  };
22163
22562
 
22164
- var _path$b;
22563
+ var _path$c;
22165
22564
 
22166
- 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); }
22565
+ 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); }
22167
22566
 
22168
22567
  function SvgExit(props) {
22169
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22568
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22170
22569
  className: "plc-w-6 plc-h-6",
22171
22570
  xmlns: "http://www.w3.org/2000/svg",
22172
22571
  fill: "none",
22173
22572
  viewBox: "0 0 24 24",
22174
22573
  stroke: "currentColor"
22175
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22574
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22176
22575
  strokeLinecap: "round",
22177
22576
  strokeLinejoin: "round",
22178
22577
  strokeWidth: 2,
@@ -22180,17 +22579,17 @@ function SvgExit(props) {
22180
22579
  })));
22181
22580
  }
22182
22581
 
22183
- var _path$a;
22582
+ var _path$b;
22184
22583
 
22185
- 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); }
22584
+ 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); }
22186
22585
 
22187
22586
  function SvgUser(props) {
22188
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22587
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22189
22588
  xmlns: "http://www.w3.org/2000/svg",
22190
22589
  fill: "none",
22191
22590
  viewBox: "0 0 24 24",
22192
22591
  stroke: "currentColor"
22193
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22592
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22194
22593
  strokeLinecap: "round",
22195
22594
  strokeLinejoin: "round",
22196
22595
  strokeWidth: 2,
@@ -22198,18 +22597,18 @@ function SvgUser(props) {
22198
22597
  })));
22199
22598
  }
22200
22599
 
22201
- var _path$9;
22600
+ var _path$a;
22202
22601
 
22203
- 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); }
22602
+ 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); }
22204
22603
 
22205
22604
  function SvgNewsletter(props) {
22206
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22605
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22207
22606
  xmlns: "http://www.w3.org/2000/svg",
22208
22607
  className: "plc-h-5 plc-w-5",
22209
22608
  fill: "none",
22210
22609
  viewBox: "0 0 24 24",
22211
22610
  stroke: "currentColor"
22212
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22611
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22213
22612
  strokeLinecap: "round",
22214
22613
  strokeLinejoin: "round",
22215
22614
  strokeWidth: 2,
@@ -22217,18 +22616,18 @@ function SvgNewsletter(props) {
22217
22616
  })));
22218
22617
  }
22219
22618
 
22220
- var _path$8;
22619
+ var _path$9;
22221
22620
 
22222
- 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); }
22621
+ 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); }
22223
22622
 
22224
22623
  function SvgDocument(props) {
22225
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22624
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22226
22625
  xmlns: "http://www.w3.org/2000/svg",
22227
22626
  className: "plc-h-6 plc-w-6 plc-mr-2",
22228
22627
  fill: "none",
22229
22628
  viewBox: "0 0 24 24",
22230
22629
  stroke: "currentColor"
22231
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22630
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22232
22631
  strokeLinecap: "round",
22233
22632
  strokeLinejoin: "round",
22234
22633
  strokeWidth: 2,
@@ -22236,18 +22635,18 @@ function SvgDocument(props) {
22236
22635
  })));
22237
22636
  }
22238
22637
 
22239
- var _path$7;
22638
+ var _path$8;
22240
22639
 
22241
- 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); }
22640
+ 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); }
22242
22641
 
22243
22642
  function SvgPaymentCard(props) {
22244
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22643
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22245
22644
  className: "plc-w-6 plc-h-6 plc-mr-2",
22246
22645
  xmlns: "http://www.w3.org/2000/svg",
22247
22646
  fill: "none",
22248
22647
  viewBox: "0 0 24 24",
22249
22648
  stroke: "currentColor"
22250
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22649
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22251
22650
  strokeLinecap: "round",
22252
22651
  strokeLinejoin: "round",
22253
22652
  strokeWidth: 2,
@@ -22255,18 +22654,18 @@ function SvgPaymentCard(props) {
22255
22654
  })));
22256
22655
  }
22257
22656
 
22258
- var _path$6, _path2$1;
22657
+ var _path$7, _path2$1;
22259
22658
 
22260
- 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); }
22659
+ 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); }
22261
22660
 
22262
22661
  function SvgLocationPin(props) {
22263
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22662
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22264
22663
  className: "plc-w-6 plc-h-6 plc-mr-2",
22265
22664
  xmlns: "http://www.w3.org/2000/svg",
22266
22665
  fill: "none",
22267
22666
  viewBox: "0 0 24 24",
22268
22667
  stroke: "currentColor"
22269
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22668
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22270
22669
  strokeLinecap: "round",
22271
22670
  strokeLinejoin: "round",
22272
22671
  strokeWidth: 2,
@@ -22281,10 +22680,10 @@ function SvgLocationPin(props) {
22281
22680
 
22282
22681
  var _switch;
22283
22682
 
22284
- 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); }
22683
+ 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); }
22285
22684
 
22286
22685
  function SvgSubscription(props) {
22287
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22686
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22288
22687
  xmlns: "http://www.w3.org/2000/svg",
22289
22688
  viewBox: "0 0 100 125",
22290
22689
  fill: "currentColor"
@@ -22299,18 +22698,18 @@ function SvgSubscription(props) {
22299
22698
  }))))));
22300
22699
  }
22301
22700
 
22302
- var _path$5;
22701
+ var _path$6;
22303
22702
 
22304
- 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); }
22703
+ 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); }
22305
22704
 
22306
22705
  function SvgShopping(props) {
22307
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22706
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22308
22707
  className: "plc-w-6 plc-h-6 plc-mr-2",
22309
22708
  xmlns: "http://www.w3.org/2000/svg",
22310
22709
  fill: "none",
22311
22710
  viewBox: "0 0 24 24",
22312
22711
  stroke: "currentColor"
22313
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22712
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22314
22713
  strokeLinecap: "round",
22315
22714
  strokeLinejoin: "round",
22316
22715
  strokeWidth: 2,
@@ -22318,18 +22717,18 @@ function SvgShopping(props) {
22318
22717
  })));
22319
22718
  }
22320
22719
 
22321
- var _path$4;
22720
+ var _path$5;
22322
22721
 
22323
- 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); }
22722
+ 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); }
22324
22723
 
22325
22724
  function SvgBookmark(props) {
22326
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22725
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22327
22726
  className: "plc-w-6 plc-h-6 plc-mr-2",
22328
22727
  xmlns: "http://www.w3.org/2000/svg",
22329
22728
  fill: "none",
22330
22729
  viewBox: "0 0 24 24",
22331
22730
  stroke: "currentColor"
22332
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22731
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22333
22732
  strokeLinecap: "round",
22334
22733
  strokeLinejoin: "round",
22335
22734
  strokeWidth: 2,
@@ -22337,33 +22736,33 @@ function SvgBookmark(props) {
22337
22736
  })));
22338
22737
  }
22339
22738
 
22340
- var _path$3;
22739
+ var _path$4;
22341
22740
 
22342
- 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); }
22741
+ 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); }
22343
22742
 
22344
22743
  function SvgKey(props) {
22345
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22744
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22346
22745
  xmlns: "http://www.w3.org/2000/svg",
22347
22746
  viewBox: "0 0 20 20",
22348
22747
  fill: "currentColor"
22349
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22748
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22350
22749
  fillRule: "evenodd",
22351
22750
  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",
22352
22751
  clipRule: "evenodd"
22353
22752
  })));
22354
22753
  }
22355
22754
 
22356
- var _path$2;
22755
+ var _path$3;
22357
22756
 
22358
- 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); }
22757
+ 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); }
22359
22758
 
22360
22759
  function SvgDonate(props) {
22361
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
22760
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22362
22761
  width: 24,
22363
22762
  height: 24,
22364
22763
  fill: "currentColor",
22365
22764
  xmlns: "http://www.w3.org/2000/svg"
22366
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
22765
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22367
22766
  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"
22368
22767
  })));
22369
22768
  }
@@ -22690,9 +23089,10 @@ class Dashboard extends React.Component {
22690
23089
  }) => {
22691
23090
  if (isGift) {
22692
23091
  this.props.setProductAndPlan(null, null, true);
23092
+ return this.props.setView("plan-select");
22693
23093
  }
22694
23094
 
22695
- return this.props.setView("plan-select");
23095
+ return this.props.setView("subscription-options");
22696
23096
  });
22697
23097
 
22698
23098
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -23160,7 +23560,7 @@ const DashboardOpenButton = () => {
23160
23560
  };
23161
23561
  DashboardOpenButton.viewId = "dashboard-open";
23162
23562
 
23163
- const initialState$2 = {
23563
+ const initialState$3 = {
23164
23564
  imageSrc: null,
23165
23565
  crop: {
23166
23566
  x: 0,
@@ -23174,10 +23574,10 @@ const initialState$2 = {
23174
23574
  content: ""
23175
23575
  }
23176
23576
  };
23177
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
23577
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
23178
23578
  const {
23179
- Provider: Provider$2
23180
- } = store$2;
23579
+ Provider: Provider$3
23580
+ } = store$3;
23181
23581
 
23182
23582
  const ProfilePicChangeContainer = ({
23183
23583
  style,
@@ -23311,21 +23711,21 @@ const ProfilePicChangeContainer = ({
23311
23711
  default:
23312
23712
  return state;
23313
23713
  }
23314
- }, initialState$2);
23714
+ }, initialState$3);
23315
23715
  return /*#__PURE__*/React__default['default'].createElement("div", {
23316
23716
  style: { ...style
23317
23717
  },
23318
23718
  className: `pelcro-container pelcro-profile-picture-container ${className}`
23319
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
23719
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
23320
23720
  value: {
23321
23721
  state,
23322
23722
  dispatch
23323
23723
  }
23324
23724
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
23325
- store: store$2,
23725
+ store: store$3,
23326
23726
  key: i
23327
23727
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
23328
- store: store$2
23728
+ store: store$3
23329
23729
  })));
23330
23730
  };
23331
23731
  /**
@@ -23387,7 +23787,7 @@ const ProfilePicChangeButton = ({
23387
23787
  isSubmitting
23388
23788
  },
23389
23789
  dispatch
23390
- } = React.useContext(store$2);
23790
+ } = React.useContext(store$3);
23391
23791
  const {
23392
23792
  t
23393
23793
  } = useTranslation("userEdit");
@@ -24755,7 +25155,7 @@ const ProfilePicChangeCropper = ({
24755
25155
  zoom
24756
25156
  },
24757
25157
  dispatch
24758
- } = React.useContext(store$2);
25158
+ } = React.useContext(store$3);
24759
25159
  return /*#__PURE__*/React__default['default'].createElement("div", {
24760
25160
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24761
25161
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -24797,7 +25197,7 @@ const ProfilePicChangeZoom = ({
24797
25197
  zoom
24798
25198
  },
24799
25199
  dispatch
24800
- } = React.useContext(store$2);
25200
+ } = React.useContext(store$3);
24801
25201
  const {
24802
25202
  t
24803
25203
  } = useTranslation("userEdit");
@@ -24820,18 +25220,18 @@ const ProfilePicChangeZoom = ({
24820
25220
  }, otherProps)));
24821
25221
  };
24822
25222
 
24823
- var _path$1;
25223
+ var _path$2;
24824
25224
 
24825
- 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); }
25225
+ 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); }
24826
25226
 
24827
25227
  function SvgPhotograph(props) {
24828
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25228
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
24829
25229
  xmlns: "http://www.w3.org/2000/svg",
24830
25230
  className: "plc-h-6 plc-w-6",
24831
25231
  fill: "none",
24832
25232
  viewBox: "0 0 24 24",
24833
25233
  stroke: "currentColor"
24834
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25234
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
24835
25235
  strokeLinecap: "round",
24836
25236
  strokeLinejoin: "round",
24837
25237
  strokeWidth: 2,
@@ -24849,7 +25249,7 @@ const ProfilePicChangeSelectButton = ({
24849
25249
  state: {
24850
25250
  isSubmitting
24851
25251
  }
24852
- } = React.useContext(store$2);
25252
+ } = React.useContext(store$3);
24853
25253
  const {
24854
25254
  t
24855
25255
  } = useTranslation("userEdit");
@@ -24891,7 +25291,7 @@ const ProfilePicChangeRemoveButton = ({
24891
25291
  state: {
24892
25292
  isSubmitting
24893
25293
  }
24894
- } = React.useContext(store$2);
25294
+ } = React.useContext(store$3);
24895
25295
  const {
24896
25296
  t
24897
25297
  } = useTranslation("userEdit");
@@ -24914,7 +25314,7 @@ const ProfilePicChangeWrapper = () => {
24914
25314
  state: {
24915
25315
  imageSrc
24916
25316
  }
24917
- } = React.useContext(store$2);
25317
+ } = React.useContext(store$3);
24918
25318
  const {
24919
25319
  t
24920
25320
  } = useTranslation("userEdit");
@@ -24976,17 +25376,17 @@ function ProfilePicChangeModal({
24976
25376
  }
24977
25377
  ProfilePicChangeModal.viewId = "profile-picture";
24978
25378
 
24979
- const initialState$1 = {
25379
+ const initialState$2 = {
24980
25380
  isSubmitting: false,
24981
25381
  alert: {
24982
25382
  type: "error",
24983
25383
  content: ""
24984
25384
  }
24985
25385
  };
24986
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25386
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
24987
25387
  const {
24988
- Provider: Provider$1
24989
- } = store$1;
25388
+ Provider: Provider$2
25389
+ } = store$2;
24990
25390
 
24991
25391
  const EmailVerifyContainer = ({
24992
25392
  style,
@@ -25049,21 +25449,21 @@ const EmailVerifyContainer = ({
25049
25449
  default:
25050
25450
  return state;
25051
25451
  }
25052
- }, initialState$1);
25452
+ }, initialState$2);
25053
25453
  return /*#__PURE__*/React__default['default'].createElement("div", {
25054
25454
  style: { ...style
25055
25455
  },
25056
25456
  className: `pelcro-container pelcro-email-verify-container ${className}`
25057
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25457
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
25058
25458
  value: {
25059
25459
  state,
25060
25460
  dispatch
25061
25461
  }
25062
25462
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25063
- store: store$1,
25463
+ store: store$2,
25064
25464
  key: i
25065
25465
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25066
- store: store$1
25466
+ store: store$2
25067
25467
  })));
25068
25468
  };
25069
25469
 
@@ -25077,7 +25477,7 @@ const EmailVerifyResendButton = ({
25077
25477
  state: {
25078
25478
  isSubmitting
25079
25479
  }
25080
- } = React.useContext(store$1);
25480
+ } = React.useContext(store$2);
25081
25481
  const {
25082
25482
  t
25083
25483
  } = useTranslation("verifyEmail");
@@ -25092,16 +25492,16 @@ const EmailVerifyResendButton = ({
25092
25492
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
25093
25493
  };
25094
25494
 
25095
- var _path, _path2;
25495
+ var _path$1, _path2;
25096
25496
 
25097
- 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); }
25497
+ 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); }
25098
25498
 
25099
25499
  function SvgEmailVerify(props) {
25100
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25500
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25101
25501
  className: "plc-w-6 plc-h-6",
25102
25502
  viewBox: "0 0 700 700",
25103
25503
  xmlns: "http://www.w3.org/2000/svg"
25104
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25504
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25105
25505
  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"
25106
25506
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
25107
25507
  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"
@@ -25205,11 +25605,11 @@ const invoicePaymentSubmitButton = props => {
25205
25605
  return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
25206
25606
  };
25207
25607
 
25208
- const initialState = {};
25209
- const store = /*#__PURE__*/React.createContext(initialState);
25608
+ const initialState$1 = {};
25609
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25210
25610
  const {
25211
- Provider
25212
- } = store;
25611
+ Provider: Provider$1
25612
+ } = store$1;
25213
25613
 
25214
25614
  const InvoiceDetailsContainer = ({
25215
25615
  style,
@@ -25230,21 +25630,21 @@ const InvoiceDetailsContainer = ({
25230
25630
  default:
25231
25631
  return state;
25232
25632
  }
25233
- }, initialState);
25633
+ }, initialState$1);
25234
25634
  return /*#__PURE__*/React__default['default'].createElement("div", {
25235
25635
  style: { ...style
25236
25636
  },
25237
25637
  className: `pelcro-container pelcro-invoice-details-container ${className}`
25238
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25638
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25239
25639
  value: {
25240
25640
  state,
25241
25641
  dispatch
25242
25642
  }
25243
25643
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25244
- store,
25644
+ store: store$1,
25245
25645
  key: i
25246
25646
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25247
- store
25647
+ store: store$1
25248
25648
  })));
25249
25649
  };
25250
25650
 
@@ -25276,7 +25676,7 @@ const InvoiceDetailsPayButton = ({
25276
25676
  }) => {
25277
25677
  const {
25278
25678
  dispatch
25279
- } = React.useContext(store);
25679
+ } = React.useContext(store$1);
25280
25680
  const {
25281
25681
  t
25282
25682
  } = useTranslation("invoiceDetails");
@@ -25381,6 +25781,232 @@ const InvoiceDetailsModal = ({
25381
25781
  };
25382
25782
  InvoiceDetailsModal.viewId = "invoice-details";
25383
25783
 
25784
+ const initialState = {
25785
+ selectedOption: ""
25786
+ };
25787
+ const store = /*#__PURE__*/React.createContext(initialState);
25788
+ const {
25789
+ Provider
25790
+ } = store;
25791
+
25792
+ const SubscriptionOptionsContainer = ({
25793
+ style,
25794
+ className = "",
25795
+ onRenewSubSuccess = () => {},
25796
+ onNewSubSuccess = () => {},
25797
+ children,
25798
+ ...props
25799
+ }) => {
25800
+ const submit = ({
25801
+ selectedOption
25802
+ }, dispatch) => {
25803
+ if (selectedOption === "renew") return onRenewSubSuccess();
25804
+ if (selectedOption === "new") return onNewSubSuccess();
25805
+ };
25806
+
25807
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25808
+ switch (action.type) {
25809
+ case SWITCH_TO_NEW:
25810
+ return lib_7({ ...state,
25811
+ selectedOption: "new"
25812
+ });
25813
+
25814
+ case SWITCH_TO_RENEW:
25815
+ return lib_7({ ...state,
25816
+ selectedOption: "renew"
25817
+ });
25818
+
25819
+ case HANDLE_SUBMIT:
25820
+ return lib_4((state, dispatch) => submit(state));
25821
+
25822
+ default:
25823
+ return state;
25824
+ }
25825
+ }, initialState);
25826
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25827
+ style: { ...style
25828
+ },
25829
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25830
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25831
+ value: {
25832
+ state,
25833
+ dispatch
25834
+ }
25835
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25836
+ store,
25837
+ key: i
25838
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25839
+ store
25840
+ })));
25841
+ };
25842
+
25843
+ var _path;
25844
+
25845
+ 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); }
25846
+
25847
+ function SvgPlusCircle(props) {
25848
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25849
+ xmlns: "http://www.w3.org/2000/svg",
25850
+ className: "plc-h-6 plc-w-6",
25851
+ fill: "none",
25852
+ viewBox: "0 0 24 24",
25853
+ stroke: "currentColor",
25854
+ strokeWidth: 2
25855
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25856
+ strokeLinecap: "round",
25857
+ strokeLinejoin: "round",
25858
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25859
+ })));
25860
+ }
25861
+
25862
+ const SubscriptionOptionsNewButton = ({
25863
+ name,
25864
+ onClick,
25865
+ ...otherProps
25866
+ }) => {
25867
+ const {
25868
+ dispatch,
25869
+ state: {
25870
+ selectedOption
25871
+ }
25872
+ } = React.useContext(store);
25873
+ const {
25874
+ t
25875
+ } = useTranslation("subscriptionOptions");
25876
+ const isChecked = selectedOption === "new";
25877
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25878
+ className: "plc-hidden pelcro-new-sub-option",
25879
+ 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"}`,
25880
+ id: "pelcro-new-sub-option",
25881
+ name: "option",
25882
+ onChange: () => {
25883
+ dispatch({
25884
+ type: SWITCH_TO_NEW
25885
+ });
25886
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25887
+ },
25888
+ checked: isChecked
25889
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default['default'].createElement(SvgPlusCircle, {
25890
+ className: "plc-w-full plc-h-full plc-mr-0"
25891
+ }));
25892
+ };
25893
+
25894
+ const SubscriptionOptionsRenewButton = ({
25895
+ name,
25896
+ onClick,
25897
+ ...otherProps
25898
+ }) => {
25899
+ const {
25900
+ dispatch,
25901
+ state: {
25902
+ selectedOption
25903
+ }
25904
+ } = React.useContext(store);
25905
+ const {
25906
+ t
25907
+ } = useTranslation("subscriptionOptions");
25908
+ const isChecked = selectedOption === "renew";
25909
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25910
+ className: "plc-hidden pelcro-renew-sub-option",
25911
+ 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"}`,
25912
+ id: "pelcro-renew-sub-option",
25913
+ name: "option",
25914
+ onChange: () => {
25915
+ dispatch({
25916
+ type: SWITCH_TO_RENEW
25917
+ });
25918
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25919
+ },
25920
+ checked: isChecked
25921
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default['default'].createElement(SvgRefresh, {
25922
+ className: "plc-w-full plc-h-full plc-mr-0"
25923
+ }));
25924
+ };
25925
+
25926
+ const SubscriptionOptionsSubmit = ({
25927
+ name,
25928
+ onClick,
25929
+ ...otherProps
25930
+ }) => {
25931
+ const {
25932
+ dispatch,
25933
+ state: {
25934
+ selectedOption
25935
+ }
25936
+ } = React.useContext(store);
25937
+ const {
25938
+ t
25939
+ } = useTranslation("subscriptionOptions");
25940
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
25941
+ onClick: () => {
25942
+ dispatch({
25943
+ type: HANDLE_SUBMIT
25944
+ });
25945
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25946
+ },
25947
+ disabled: !selectedOption
25948
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
25949
+ };
25950
+
25951
+ const SubscriptionOptionsView = props => {
25952
+ const {
25953
+ t
25954
+ } = useTranslation("subscriptionOptions");
25955
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25956
+ id: "pelcro-subscription-options-view"
25957
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25958
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25959
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
25960
+ className: "plc-text-2xl plc-font-semibold"
25961
+ }, t("title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
25962
+ action: "javascript:void(0);",
25963
+ className: "plc-mt-2 pelcro-form"
25964
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
25965
+ className: "plc-flex plc-justify-between plc-items-center"
25966
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsSubmit, {
25967
+ role: "submit",
25968
+ className: "plc-mt-4 plc-w-full",
25969
+ name: t("next"),
25970
+ id: "pelcro-submit"
25971
+ }))));
25972
+ };
25973
+
25974
+ const SubscriptionOptionsModal = ({
25975
+ onDisplay,
25976
+ onClose,
25977
+ ...otherProps
25978
+ }) => {
25979
+ const {
25980
+ switchView,
25981
+ setProductsList
25982
+ } = usePelcro();
25983
+
25984
+ const onRenewSubSuccess = () => {
25985
+ var _otherProps$onRenewSu;
25986
+
25987
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
25988
+ setProductsList(getRenewableProducts());
25989
+ switchView("_plan-select-renew");
25990
+ };
25991
+
25992
+ const onNewSubSuccess = () => {
25993
+ var _otherProps$onNewSubS;
25994
+
25995
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
25996
+ switchView("plan-select");
25997
+ };
25998
+
25999
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
26000
+ onDisplay: onDisplay,
26001
+ onClose: onClose,
26002
+ id: "pelcro-subscription-options-modal"
26003
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
26004
+ onNewSubSuccess: onNewSubSuccess,
26005
+ onRenewSubSuccess: onRenewSubSuccess
26006
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
26007
+ };
26008
+ SubscriptionOptionsModal.viewId = "subscription-options";
26009
+
25384
26010
  exports.AddressCreateCity = AddressCreateCity;
25385
26011
  exports.AddressCreateContainer = AddressCreateContainer;
25386
26012
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -25558,6 +26184,12 @@ exports.SubmitPaymentMethod = SubmitPaymentMethod;
25558
26184
  exports.SubscriptionCreateContainer = SubscriptionCreateContainer;
25559
26185
  exports.SubscriptionCreateModal = SubscriptionCreateModal;
25560
26186
  exports.SubscriptionCreateView = SubscriptionCreateView;
26187
+ exports.SubscriptionOptionsContainer = SubscriptionOptionsContainer;
26188
+ exports.SubscriptionOptionsModal = SubscriptionOptionsModal;
26189
+ exports.SubscriptionOptionsNewButton = SubscriptionOptionsNewButton;
26190
+ exports.SubscriptionOptionsRenewButton = SubscriptionOptionsRenewButton;
26191
+ exports.SubscriptionOptionsSubmit = SubscriptionOptionsSubmit;
26192
+ exports.SubscriptionOptionsView = SubscriptionOptionsView;
25561
26193
  exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
25562
26194
  exports.SubscriptionRenewModal = SubscriptionRenewModal;
25563
26195
  exports.SubscriptionRenewView = SubscriptionRenewView;