@pelcro/react-pelcro-js 4.0.0-alpha.27 → 4.0.0-alpha.28

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
@@ -3464,7 +3464,7 @@ var youAreSafe$3 = "You're safe - PCI compliant 128 SSL by";
3464
3464
  var cancel$3 = "Cancel your subscription online at anytime.";
3465
3465
  var giftSent$3 = "Subscription gift has been sent to";
3466
3466
  var successfully$3 = "successfully";
3467
- var entitlement$3 = "Some of the content on this page is available with one or more of our plans. <1>Subscribe</1> now to get full page access.";
3467
+ var entitlement$3 = "Some of the content on this page is available with one or more of our plans. <1> Subscribe </1> now to get full page access.";
3468
3468
  var recaptcha$3 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
3469
3469
  var invalidInvoice$3 = "Invalid invoice ID, please contact support";
3470
3470
  var invalidSubscription$2 = "Invalid subscription ID, please contact support";
@@ -3915,6 +3915,7 @@ var labels$U = {
3915
3915
  addCard: "Add Card",
3916
3916
  actions: "Actions",
3917
3917
  expiresOn: "Ends",
3918
+ until: "Until",
3918
3919
  startsOn: "Starts",
3919
3920
  startDate: "Start date",
3920
3921
  renewsOn: "Renews",
@@ -4405,7 +4406,7 @@ var youAreSafe$2 = "Vous êtes en sécurité - PCI conforme 128 SSL par";
4405
4406
  var cancel$2 = "Annuler votre abonnement en ligne à tout moment.";
4406
4407
  var giftSent$2 = "Le cadeau d’abonnement a été envoyé à";
4407
4408
  var successfully$2 = "avec succès.";
4408
- var entitlement$2 = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1>Abonnez-vous</1> à l'un de nos plans disponibles pour accéder à plus de contenu";
4409
+ var entitlement$2 = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1> Abonnez-vous </1> à l'un de nos plans disponibles pour accéder à plus de contenu";
4409
4410
  var recaptcha$2 = "Ce site est protégé par reCAPTCHA - les <1>règles de confidentialité</1> Google ainsi que les <3>conditions d'utilisation</3> s'appliquent.";
4410
4411
  var invalidInvoice$2 = "Identifiant de facture non valide, veuillez contacter l'assistance";
4411
4412
  var invalidSubscription$1 = "ID d'abonnement invalide, veuillez contacter l'assistance";
@@ -4857,6 +4858,7 @@ var labels$z = {
4857
4858
  addCard: "Ajouter une carte",
4858
4859
  actions: "Actes",
4859
4860
  expiresOn: "Expire le",
4861
+ until: "Jusqu'à ce que",
4860
4862
  startsOn: "Débute le",
4861
4863
  startDate: "Date de début",
4862
4864
  renewsOn: "Renouvelle le",
@@ -5293,7 +5295,7 @@ var youAreSafe$1 = "PCI 준수 128비트 SSL 인증서로 보호됩니다. 제
5293
5295
  var cancel$1 = "유료 멤버십은 언제든 온라인으로 취소가 가능합니다.";
5294
5296
  var giftSent$1 = "유료 멤버십 선물이 ";
5295
5297
  var successfully$1 = "님께 성공적으로 전송되었습니다.";
5296
- var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1>멤버십에 가입</1>하세요.";
5298
+ var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1> 멤버십에 가입 </1>하세요.";
5297
5299
  var recaptcha$1 = "이 사이트는 reCAPTCHA로 보호되며, Google <1>개인정보 보호정책</1> 및 <3>서비스 약관</3>이 적용됩니다.";
5298
5300
  var invalidInvoice$1 = "유효하지 않은 인보이스 ID입니다. 지원팀에 문의하십시오.";
5299
5301
  var invalidSubscription = "잘못된 구독 ID입니다. 지원팀에 문의하세요.";
@@ -5744,6 +5746,7 @@ var labels$k = {
5744
5746
  addCard: "카드 추가",
5745
5747
  actions: "조치",
5746
5748
  expiresOn: "종료",
5749
+ until: "까지",
5747
5750
  startsOn: "시작",
5748
5751
  startDate: "시작일",
5749
5752
  renewsOn: "갱신",
@@ -6230,7 +6233,7 @@ var youAreSafe = "Estás seguro - PCI compliance 128 SSL por";
6230
6233
  var cancel = "Cancela tu suscripción en línea en cualquier momento.";
6231
6234
  var giftSent = "La suscripción de regalo se ha enviado a";
6232
6235
  var successfully = "exitosamente";
6233
- var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1>Suscríbete</1> ahora para obtener acceso completo.";
6236
+ var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1> Suscríbete </1> ahora para obtener acceso completo.";
6234
6237
  var recaptcha = "Este sitio está protegido por reCAPTCHA, aplica la <1>Política de Privacidad</1> y los <3>Términos de Servicio</3> de Google.";
6235
6238
  var invalidInvoice = "Número de comprobante de pago inválido, por favor contacta a soporte.";
6236
6239
  var zeroTotalInvoice = "No puedes ver un comprobante de pago de $0";
@@ -6672,6 +6675,7 @@ var labels$5 = {
6672
6675
  paymentSource: "Datos de pago",
6673
6676
  actions: "Acciones",
6674
6677
  expiresOn: "Finaliza",
6678
+ until: "Hasta que",
6675
6679
  startsOn: "Inicia",
6676
6680
  startDate: "Fecha de inicio",
6677
6681
  renewsOn: "Renovación",
@@ -9070,6 +9074,27 @@ function userMustVerifyEmail() {
9070
9074
  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;
9071
9075
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
9072
9076
  }
9077
+ function notifyBugsnag(callback, startOptions) {
9078
+ if (!window.Bugsnag && !document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]')) {
9079
+ //load bugsnag CDN
9080
+ window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
9081
+ document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
9082
+ var _window$Pelcro$enviro, _window$Pelcro3, _window$Pelcro3$envir, _window$Pelcro4, _window$Pelcro4$envir;
9083
+
9084
+ Bugsnag.start({
9085
+ apiKey: (_window$Pelcro$enviro = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$envir = _window$Pelcro3.environment) === null || _window$Pelcro3$envir === void 0 ? void 0 : _window$Pelcro3$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
9086
+ autoDetectErrors: false,
9087
+ releaseStage: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$envir = _window$Pelcro4.environment) === null || _window$Pelcro4$envir === void 0 ? void 0 : _window$Pelcro4$envir.bugsnagReleaseStage,
9088
+ redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
9089
+ ...startOptions
9090
+ });
9091
+ callback();
9092
+ });
9093
+ return;
9094
+ }
9095
+
9096
+ callback();
9097
+ }
9073
9098
 
9074
9099
  const resources = {
9075
9100
  en: {
@@ -11238,8 +11263,10 @@ const loadPaymentSDKs = () => {
11238
11263
  const {
11239
11264
  whenUserReady
11240
11265
  } = usePelcro.getStore();
11266
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
11267
+ const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
11241
11268
  whenUserReady(() => {
11242
- if (!window.Stripe) {
11269
+ if (!window.Stripe && !supportsVantiv && !supportsTap) {
11243
11270
  pure_1(window.Pelcro.environment.stripe);
11244
11271
  }
11245
11272
  }); // Load PayPal SDKs
@@ -11252,8 +11279,6 @@ const loadPaymentSDKs = () => {
11252
11279
  } // Load Vantiv SDKs
11253
11280
 
11254
11281
 
11255
- const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
11256
-
11257
11282
  if (supportsVantiv) {
11258
11283
  if (!window.jQuery) {
11259
11284
  window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
@@ -11261,15 +11286,13 @@ const loadPaymentSDKs = () => {
11261
11286
 
11262
11287
  if (!window.EprotectIframeClient) {
11263
11288
  const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
11264
- const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
11289
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client3.min.js";
11265
11290
  const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
11266
11291
  window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
11267
11292
  }
11268
11293
  } // Load Tap SDKs
11269
11294
 
11270
11295
 
11271
- const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
11272
-
11273
11296
  if (supportsTap) {
11274
11297
  window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
11275
11298
  window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
@@ -11466,7 +11489,11 @@ const initSubscriptionFromURL = () => {
11466
11489
  var _selectedProduct$plan;
11467
11490
 
11468
11491
  const productsList = window.Pelcro.product.list();
11469
- if (!(productsList !== null && productsList !== void 0 && productsList.length)) return;
11492
+
11493
+ if (!(productsList !== null && productsList !== void 0 && productsList.length)) {
11494
+ return;
11495
+ }
11496
+
11470
11497
  const [productId, planId, isGiftParam] = [window.Pelcro.helpers.getURLParameter("product_id"), window.Pelcro.helpers.getURLParameter("plan_id"), window.Pelcro.helpers.getURLParameter("is_gift")];
11471
11498
  const isGift = (isGiftParam === null || isGiftParam === void 0 ? void 0 : isGiftParam.toLowerCase()) === "true";
11472
11499
  const selectedProduct = productsList.find(product => product.id === Number(productId));
@@ -12393,7 +12420,7 @@ function Email({
12393
12420
  }, []);
12394
12421
 
12395
12422
  const isEmailValid = email => {
12396
- const re = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;
12423
+ const re = /[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;
12397
12424
  return re.test(email);
12398
12425
  };
12399
12426
 
@@ -19000,6 +19027,22 @@ class SelectModal extends React.Component {
19000
19027
  }
19001
19028
 
19002
19029
  document.addEventListener("keydown", this.handleSubmit);
19030
+
19031
+ if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
19032
+ notifyBugsnag(() => {
19033
+ Bugsnag.notify("SelectModal - No data viewed", event => {
19034
+ var _window$Pelcro, _window$Pelcro$site, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$uiSet, _window$Pelcro4;
19035
+
19036
+ event.addMetadata("MetaData", {
19037
+ site: (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$site = _window$Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : _window$Pelcro$site.read(),
19038
+ user: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read(),
19039
+ uiVersion: (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.uiVersion,
19040
+ environment: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : _window$Pelcro4.environment
19041
+ });
19042
+ });
19043
+ });
19044
+ console.log("bugsnag Triggered");
19045
+ }
19003
19046
  });
19004
19047
 
19005
19048
  _defineProperty$3(this, "componentWillUnmount", () => {
@@ -22024,7 +22067,7 @@ const PaymentMethodContainerWithoutStripe = ({
22024
22067
  vantivInstanceRef.current = new window.EprotectIframeClient({
22025
22068
  paypageId: payPageId,
22026
22069
  reportGroup: reportGroup,
22027
- style: "enhancedStyle3",
22070
+ style: "enhancedStyle5",
22028
22071
  height: "245",
22029
22072
  timeout: 50000,
22030
22073
  div: "eProtectiframe",
@@ -23185,9 +23228,10 @@ const PaymentMethodContainer = props => {
23185
23228
  const {
23186
23229
  whenUserReady
23187
23230
  } = usePelcro.getStore();
23231
+ const cardProcessor = getSiteCardProcessor();
23188
23232
  React.useEffect(() => {
23189
23233
  whenUserReady(() => {
23190
- if (!window.Stripe) {
23234
+ if (!window.Stripe && cardProcessor === "stripe") {
23191
23235
  document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
23192
23236
  setIsStripeLoaded(true);
23193
23237
  });
@@ -23203,9 +23247,11 @@ const PaymentMethodContainer = props => {
23203
23247
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
23204
23248
  store: store$k
23205
23249
  }, props))));
23250
+ } else {
23251
+ return /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainerWithoutStripe, Object.assign({
23252
+ store: store$k
23253
+ }, props));
23206
23254
  }
23207
-
23208
- return null;
23209
23255
  };
23210
23256
 
23211
23257
  const StripeInputStyle = {
@@ -33025,13 +33071,52 @@ const OrderItems = ({
33025
33071
  const DonationsMenu = ({
33026
33072
  reactivateSubscription,
33027
33073
  disableSubmit,
33028
- cancelSubscription
33074
+ cancelSubscription,
33075
+ onClose
33029
33076
  }) => {
33030
33077
  const {
33031
33078
  t
33032
33079
  } = useTranslation("dashboard");
33033
- usePelcro();
33080
+ const {
33081
+ switchView,
33082
+ setSubscriptionToCancel
33083
+ } = usePelcro();
33034
33084
  const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
33085
+ // Cancel button click handlers
33086
+ const onCancelClick = () => {
33087
+ const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
33088
+
33089
+ if (isImmediateCancelationEnabled) {
33090
+ setSubscriptionToCancel(sub.id);
33091
+ return switchView("subscription-cancel");
33092
+ }
33093
+
33094
+ if (userMustVerifyEmail()) {
33095
+ return switchView("email-verify");
33096
+ }
33097
+
33098
+ switchView(null);
33099
+ onClose === null || onClose === void 0 ? void 0 : onClose();
33100
+ notify.confirm((onSuccess, onFailure) => {
33101
+ cancelSubscription(sub.id, onSuccess, onFailure);
33102
+ }, {
33103
+ confirmMessage: t("messages.subCancellation.isSureToCancel"),
33104
+ loadingMessage: t("messages.subCancellation.loading"),
33105
+ successMessage: t("messages.subCancellation.success"),
33106
+ errorMessage: t("messages.subCancellation.error")
33107
+ }, {
33108
+ closeButtonLabel: t("labels.subCancellation.goBack")
33109
+ });
33110
+ }; // Reactivate button click handlers
33111
+
33112
+
33113
+ const onReactivateClick = () => {
33114
+ if (userMustVerifyEmail()) {
33115
+ return switchView("email-verify");
33116
+ }
33117
+
33118
+ reactivateSubscription(sub.id);
33119
+ };
33035
33120
 
33036
33121
  return /*#__PURE__*/React__default['default'].createElement("tr", {
33037
33122
  key: sub.id,
@@ -33044,7 +33129,21 @@ const DonationsMenu = ({
33044
33129
  className: "plc-text-xs plc-text-gray-400 pelcro-donation-price"
33045
33130
  }, getFormattedPriceByLocal(sub.plan.amount * sub.quantity, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("div", {
33046
33131
  className: "plc-mb-4 plc-text-gray-500 pelcro-donation-date"
33047
- }, sub.status && /*#__PURE__*/React__default['default'].createElement("span", null, formatStartDate(sub.start)))));
33132
+ }, sub.status && /*#__PURE__*/React__default['default'].createElement("span", null, formatStartDate(sub.start)))), /*#__PURE__*/React__default['default'].createElement("td", null, sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default['default'].createElement(Button, {
33133
+ variant: "ghost",
33134
+ className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
33135
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgRefresh, null),
33136
+ onClick: onReactivateClick,
33137
+ disabled: disableSubmit,
33138
+ "data-key": sub.id
33139
+ }, t("labels.reactivate")), !sub.plan.auto_renew || sub.plan.auto_renew && sub.cancel_at_period_end === 0 ? /*#__PURE__*/React__default['default'].createElement(Button, {
33140
+ variant: "ghost",
33141
+ className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
33142
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
33143
+ onClick: onCancelClick,
33144
+ disabled: disableSubmit,
33145
+ "data-key": sub.id
33146
+ }, t("labels.unsubscribe")) : ""));
33048
33147
  });
33049
33148
  return /*#__PURE__*/React__default['default'].createElement(Card, {
33050
33149
  id: "pelcro-dashboard-donation-menu",
@@ -33055,10 +33154,12 @@ const DonationsMenu = ({
33055
33154
  }, /*#__PURE__*/React__default['default'].createElement("thead", {
33056
33155
  className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
33057
33156
  }, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", {
33058
- className: "plc-w-1/4"
33157
+ className: "plc-w-4/12"
33059
33158
  }, t("labels.plan")), /*#__PURE__*/React__default['default'].createElement("th", {
33060
- className: "plc-w-1/4"
33061
- }, t("labels.startDate")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, subscriptions)));
33159
+ className: "plc-w-5/12"
33160
+ }, t("labels.startDate")), /*#__PURE__*/React__default['default'].createElement("th", {
33161
+ className: "plc-w-3/12"
33162
+ }, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, subscriptions)));
33062
33163
  };
33063
33164
 
33064
33165
  function getDonationSubs() {
@@ -35425,6 +35526,13 @@ class Dashboard extends React.Component {
35425
35526
  return `${this.locale("labels.status.incomplete")}`;
35426
35527
  }
35427
35528
 
35529
+ if (subscription.status === "extended") {
35530
+ // DateTime from BE is missing 3 zeros so we add them before instancing a date
35531
+ const expiryDate = new Date(Number(`${subscription.end_date}000`));
35532
+ const formattedExpiryDate = new Intl.DateTimeFormat("en-CA").format(expiryDate);
35533
+ return `${this.locale("labels.until")} ${formattedExpiryDate}`;
35534
+ }
35535
+
35428
35536
  if (subscription.cancel_at_period_end) {
35429
35537
  // DateTime from BE is missing 3 zeros so we add them before instancing a date
35430
35538
  const expiryDate = new Date(Number(`${subscription.expires_at}000`));
@@ -37822,7 +37930,6 @@ const EmailVerifyModal = ({
37822
37930
  switchToAddressView,
37823
37931
  switchToPaymentView
37824
37932
  } = usePelcro();
37825
- console.log("verify email");
37826
37933
 
37827
37934
  const onSuccess = res => {
37828
37935
  var _otherProps$onSuccess;
package/dist/index.esm.js CHANGED
@@ -3434,7 +3434,7 @@ var youAreSafe$3 = "You're safe - PCI compliant 128 SSL by";
3434
3434
  var cancel$3 = "Cancel your subscription online at anytime.";
3435
3435
  var giftSent$3 = "Subscription gift has been sent to";
3436
3436
  var successfully$3 = "successfully";
3437
- var entitlement$3 = "Some of the content on this page is available with one or more of our plans. <1>Subscribe</1> now to get full page access.";
3437
+ var entitlement$3 = "Some of the content on this page is available with one or more of our plans. <1> Subscribe </1> now to get full page access.";
3438
3438
  var recaptcha$3 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
3439
3439
  var invalidInvoice$3 = "Invalid invoice ID, please contact support";
3440
3440
  var invalidSubscription$2 = "Invalid subscription ID, please contact support";
@@ -3885,6 +3885,7 @@ var labels$U = {
3885
3885
  addCard: "Add Card",
3886
3886
  actions: "Actions",
3887
3887
  expiresOn: "Ends",
3888
+ until: "Until",
3888
3889
  startsOn: "Starts",
3889
3890
  startDate: "Start date",
3890
3891
  renewsOn: "Renews",
@@ -4375,7 +4376,7 @@ var youAreSafe$2 = "Vous êtes en sécurité - PCI conforme 128 SSL par";
4375
4376
  var cancel$2 = "Annuler votre abonnement en ligne à tout moment.";
4376
4377
  var giftSent$2 = "Le cadeau d’abonnement a été envoyé à";
4377
4378
  var successfully$2 = "avec succès.";
4378
- var entitlement$2 = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1>Abonnez-vous</1> à l'un de nos plans disponibles pour accéder à plus de contenu";
4379
+ var entitlement$2 = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1> Abonnez-vous </1> à l'un de nos plans disponibles pour accéder à plus de contenu";
4379
4380
  var recaptcha$2 = "Ce site est protégé par reCAPTCHA - les <1>règles de confidentialité</1> Google ainsi que les <3>conditions d'utilisation</3> s'appliquent.";
4380
4381
  var invalidInvoice$2 = "Identifiant de facture non valide, veuillez contacter l'assistance";
4381
4382
  var invalidSubscription$1 = "ID d'abonnement invalide, veuillez contacter l'assistance";
@@ -4827,6 +4828,7 @@ var labels$z = {
4827
4828
  addCard: "Ajouter une carte",
4828
4829
  actions: "Actes",
4829
4830
  expiresOn: "Expire le",
4831
+ until: "Jusqu'à ce que",
4830
4832
  startsOn: "Débute le",
4831
4833
  startDate: "Date de début",
4832
4834
  renewsOn: "Renouvelle le",
@@ -5263,7 +5265,7 @@ var youAreSafe$1 = "PCI 준수 128비트 SSL 인증서로 보호됩니다. 제
5263
5265
  var cancel$1 = "유료 멤버십은 언제든 온라인으로 취소가 가능합니다.";
5264
5266
  var giftSent$1 = "유료 멤버십 선물이 ";
5265
5267
  var successfully$1 = "님께 성공적으로 전송되었습니다.";
5266
- var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1>멤버십에 가입</1>하세요.";
5268
+ var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1> 멤버십에 가입 </1>하세요.";
5267
5269
  var recaptcha$1 = "이 사이트는 reCAPTCHA로 보호되며, Google <1>개인정보 보호정책</1> 및 <3>서비스 약관</3>이 적용됩니다.";
5268
5270
  var invalidInvoice$1 = "유효하지 않은 인보이스 ID입니다. 지원팀에 문의하십시오.";
5269
5271
  var invalidSubscription = "잘못된 구독 ID입니다. 지원팀에 문의하세요.";
@@ -5714,6 +5716,7 @@ var labels$k = {
5714
5716
  addCard: "카드 추가",
5715
5717
  actions: "조치",
5716
5718
  expiresOn: "종료",
5719
+ until: "까지",
5717
5720
  startsOn: "시작",
5718
5721
  startDate: "시작일",
5719
5722
  renewsOn: "갱신",
@@ -6200,7 +6203,7 @@ var youAreSafe = "Estás seguro - PCI compliance 128 SSL por";
6200
6203
  var cancel = "Cancela tu suscripción en línea en cualquier momento.";
6201
6204
  var giftSent = "La suscripción de regalo se ha enviado a";
6202
6205
  var successfully = "exitosamente";
6203
- var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1>Suscríbete</1> ahora para obtener acceso completo.";
6206
+ var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1> Suscríbete </1> ahora para obtener acceso completo.";
6204
6207
  var recaptcha = "Este sitio está protegido por reCAPTCHA, aplica la <1>Política de Privacidad</1> y los <3>Términos de Servicio</3> de Google.";
6205
6208
  var invalidInvoice = "Número de comprobante de pago inválido, por favor contacta a soporte.";
6206
6209
  var zeroTotalInvoice = "No puedes ver un comprobante de pago de $0";
@@ -6642,6 +6645,7 @@ var labels$5 = {
6642
6645
  paymentSource: "Datos de pago",
6643
6646
  actions: "Acciones",
6644
6647
  expiresOn: "Finaliza",
6648
+ until: "Hasta que",
6645
6649
  startsOn: "Inicia",
6646
6650
  startDate: "Fecha de inicio",
6647
6651
  renewsOn: "Renovación",
@@ -9040,6 +9044,27 @@ function userMustVerifyEmail() {
9040
9044
  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;
9041
9045
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
9042
9046
  }
9047
+ function notifyBugsnag(callback, startOptions) {
9048
+ if (!window.Bugsnag && !document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]')) {
9049
+ //load bugsnag CDN
9050
+ window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
9051
+ document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
9052
+ var _window$Pelcro$enviro, _window$Pelcro3, _window$Pelcro3$envir, _window$Pelcro4, _window$Pelcro4$envir;
9053
+
9054
+ Bugsnag.start({
9055
+ apiKey: (_window$Pelcro$enviro = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$envir = _window$Pelcro3.environment) === null || _window$Pelcro3$envir === void 0 ? void 0 : _window$Pelcro3$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
9056
+ autoDetectErrors: false,
9057
+ releaseStage: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$envir = _window$Pelcro4.environment) === null || _window$Pelcro4$envir === void 0 ? void 0 : _window$Pelcro4$envir.bugsnagReleaseStage,
9058
+ redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
9059
+ ...startOptions
9060
+ });
9061
+ callback();
9062
+ });
9063
+ return;
9064
+ }
9065
+
9066
+ callback();
9067
+ }
9043
9068
 
9044
9069
  const resources = {
9045
9070
  en: {
@@ -11208,8 +11233,10 @@ const loadPaymentSDKs = () => {
11208
11233
  const {
11209
11234
  whenUserReady
11210
11235
  } = usePelcro.getStore();
11236
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
11237
+ const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
11211
11238
  whenUserReady(() => {
11212
- if (!window.Stripe) {
11239
+ if (!window.Stripe && !supportsVantiv && !supportsTap) {
11213
11240
  pure_1(window.Pelcro.environment.stripe);
11214
11241
  }
11215
11242
  }); // Load PayPal SDKs
@@ -11222,8 +11249,6 @@ const loadPaymentSDKs = () => {
11222
11249
  } // Load Vantiv SDKs
11223
11250
 
11224
11251
 
11225
- const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
11226
-
11227
11252
  if (supportsVantiv) {
11228
11253
  if (!window.jQuery) {
11229
11254
  window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
@@ -11231,15 +11256,13 @@ const loadPaymentSDKs = () => {
11231
11256
 
11232
11257
  if (!window.EprotectIframeClient) {
11233
11258
  const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
11234
- const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
11259
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client3.min.js";
11235
11260
  const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
11236
11261
  window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
11237
11262
  }
11238
11263
  } // Load Tap SDKs
11239
11264
 
11240
11265
 
11241
- const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
11242
-
11243
11266
  if (supportsTap) {
11244
11267
  window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
11245
11268
  window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
@@ -11436,7 +11459,11 @@ const initSubscriptionFromURL = () => {
11436
11459
  var _selectedProduct$plan;
11437
11460
 
11438
11461
  const productsList = window.Pelcro.product.list();
11439
- if (!(productsList !== null && productsList !== void 0 && productsList.length)) return;
11462
+
11463
+ if (!(productsList !== null && productsList !== void 0 && productsList.length)) {
11464
+ return;
11465
+ }
11466
+
11440
11467
  const [productId, planId, isGiftParam] = [window.Pelcro.helpers.getURLParameter("product_id"), window.Pelcro.helpers.getURLParameter("plan_id"), window.Pelcro.helpers.getURLParameter("is_gift")];
11441
11468
  const isGift = (isGiftParam === null || isGiftParam === void 0 ? void 0 : isGiftParam.toLowerCase()) === "true";
11442
11469
  const selectedProduct = productsList.find(product => product.id === Number(productId));
@@ -12363,7 +12390,7 @@ function Email({
12363
12390
  }, []);
12364
12391
 
12365
12392
  const isEmailValid = email => {
12366
- const re = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;
12393
+ const re = /[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;
12367
12394
  return re.test(email);
12368
12395
  };
12369
12396
 
@@ -18970,6 +18997,22 @@ class SelectModal extends Component {
18970
18997
  }
18971
18998
 
18972
18999
  document.addEventListener("keydown", this.handleSubmit);
19000
+
19001
+ if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
19002
+ notifyBugsnag(() => {
19003
+ Bugsnag.notify("SelectModal - No data viewed", event => {
19004
+ var _window$Pelcro, _window$Pelcro$site, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$uiSet, _window$Pelcro4;
19005
+
19006
+ event.addMetadata("MetaData", {
19007
+ site: (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$site = _window$Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : _window$Pelcro$site.read(),
19008
+ user: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read(),
19009
+ uiVersion: (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.uiVersion,
19010
+ environment: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : _window$Pelcro4.environment
19011
+ });
19012
+ });
19013
+ });
19014
+ console.log("bugsnag Triggered");
19015
+ }
18973
19016
  });
18974
19017
 
18975
19018
  _defineProperty$3(this, "componentWillUnmount", () => {
@@ -21994,7 +22037,7 @@ const PaymentMethodContainerWithoutStripe = ({
21994
22037
  vantivInstanceRef.current = new window.EprotectIframeClient({
21995
22038
  paypageId: payPageId,
21996
22039
  reportGroup: reportGroup,
21997
- style: "enhancedStyle3",
22040
+ style: "enhancedStyle5",
21998
22041
  height: "245",
21999
22042
  timeout: 50000,
22000
22043
  div: "eProtectiframe",
@@ -23155,9 +23198,10 @@ const PaymentMethodContainer = props => {
23155
23198
  const {
23156
23199
  whenUserReady
23157
23200
  } = usePelcro.getStore();
23201
+ const cardProcessor = getSiteCardProcessor();
23158
23202
  useEffect(() => {
23159
23203
  whenUserReady(() => {
23160
- if (!window.Stripe) {
23204
+ if (!window.Stripe && cardProcessor === "stripe") {
23161
23205
  document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
23162
23206
  setIsStripeLoaded(true);
23163
23207
  });
@@ -23173,9 +23217,11 @@ const PaymentMethodContainer = props => {
23173
23217
  }, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
23174
23218
  store: store$k
23175
23219
  }, props))));
23220
+ } else {
23221
+ return /*#__PURE__*/React__default.createElement(PaymentMethodContainerWithoutStripe, Object.assign({
23222
+ store: store$k
23223
+ }, props));
23176
23224
  }
23177
-
23178
- return null;
23179
23225
  };
23180
23226
 
23181
23227
  const StripeInputStyle = {
@@ -32995,13 +33041,52 @@ const OrderItems = ({
32995
33041
  const DonationsMenu = ({
32996
33042
  reactivateSubscription,
32997
33043
  disableSubmit,
32998
- cancelSubscription
33044
+ cancelSubscription,
33045
+ onClose
32999
33046
  }) => {
33000
33047
  const {
33001
33048
  t
33002
33049
  } = useTranslation("dashboard");
33003
- usePelcro();
33050
+ const {
33051
+ switchView,
33052
+ setSubscriptionToCancel
33053
+ } = usePelcro();
33004
33054
  const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
33055
+ // Cancel button click handlers
33056
+ const onCancelClick = () => {
33057
+ const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
33058
+
33059
+ if (isImmediateCancelationEnabled) {
33060
+ setSubscriptionToCancel(sub.id);
33061
+ return switchView("subscription-cancel");
33062
+ }
33063
+
33064
+ if (userMustVerifyEmail()) {
33065
+ return switchView("email-verify");
33066
+ }
33067
+
33068
+ switchView(null);
33069
+ onClose === null || onClose === void 0 ? void 0 : onClose();
33070
+ notify.confirm((onSuccess, onFailure) => {
33071
+ cancelSubscription(sub.id, onSuccess, onFailure);
33072
+ }, {
33073
+ confirmMessage: t("messages.subCancellation.isSureToCancel"),
33074
+ loadingMessage: t("messages.subCancellation.loading"),
33075
+ successMessage: t("messages.subCancellation.success"),
33076
+ errorMessage: t("messages.subCancellation.error")
33077
+ }, {
33078
+ closeButtonLabel: t("labels.subCancellation.goBack")
33079
+ });
33080
+ }; // Reactivate button click handlers
33081
+
33082
+
33083
+ const onReactivateClick = () => {
33084
+ if (userMustVerifyEmail()) {
33085
+ return switchView("email-verify");
33086
+ }
33087
+
33088
+ reactivateSubscription(sub.id);
33089
+ };
33005
33090
 
33006
33091
  return /*#__PURE__*/React__default.createElement("tr", {
33007
33092
  key: sub.id,
@@ -33014,7 +33099,21 @@ const DonationsMenu = ({
33014
33099
  className: "plc-text-xs plc-text-gray-400 pelcro-donation-price"
33015
33100
  }, getFormattedPriceByLocal(sub.plan.amount * sub.quantity, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("div", {
33016
33101
  className: "plc-mb-4 plc-text-gray-500 pelcro-donation-date"
33017
- }, sub.status && /*#__PURE__*/React__default.createElement("span", null, formatStartDate(sub.start)))));
33102
+ }, sub.status && /*#__PURE__*/React__default.createElement("span", null, formatStartDate(sub.start)))), /*#__PURE__*/React__default.createElement("td", null, sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
33103
+ variant: "ghost",
33104
+ className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
33105
+ icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
33106
+ onClick: onReactivateClick,
33107
+ disabled: disableSubmit,
33108
+ "data-key": sub.id
33109
+ }, t("labels.reactivate")), !sub.plan.auto_renew || sub.plan.auto_renew && sub.cancel_at_period_end === 0 ? /*#__PURE__*/React__default.createElement(Button, {
33110
+ variant: "ghost",
33111
+ className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
33112
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
33113
+ onClick: onCancelClick,
33114
+ disabled: disableSubmit,
33115
+ "data-key": sub.id
33116
+ }, t("labels.unsubscribe")) : ""));
33018
33117
  });
33019
33118
  return /*#__PURE__*/React__default.createElement(Card, {
33020
33119
  id: "pelcro-dashboard-donation-menu",
@@ -33025,10 +33124,12 @@ const DonationsMenu = ({
33025
33124
  }, /*#__PURE__*/React__default.createElement("thead", {
33026
33125
  className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
33027
33126
  }, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
33028
- className: "plc-w-1/4"
33127
+ className: "plc-w-4/12"
33029
33128
  }, t("labels.plan")), /*#__PURE__*/React__default.createElement("th", {
33030
- className: "plc-w-1/4"
33031
- }, t("labels.startDate")))), /*#__PURE__*/React__default.createElement("tbody", null, subscriptions)));
33129
+ className: "plc-w-5/12"
33130
+ }, t("labels.startDate")), /*#__PURE__*/React__default.createElement("th", {
33131
+ className: "plc-w-3/12"
33132
+ }, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, subscriptions)));
33032
33133
  };
33033
33134
 
33034
33135
  function getDonationSubs() {
@@ -35395,6 +35496,13 @@ class Dashboard extends Component {
35395
35496
  return `${this.locale("labels.status.incomplete")}`;
35396
35497
  }
35397
35498
 
35499
+ if (subscription.status === "extended") {
35500
+ // DateTime from BE is missing 3 zeros so we add them before instancing a date
35501
+ const expiryDate = new Date(Number(`${subscription.end_date}000`));
35502
+ const formattedExpiryDate = new Intl.DateTimeFormat("en-CA").format(expiryDate);
35503
+ return `${this.locale("labels.until")} ${formattedExpiryDate}`;
35504
+ }
35505
+
35398
35506
  if (subscription.cancel_at_period_end) {
35399
35507
  // DateTime from BE is missing 3 zeros so we add them before instancing a date
35400
35508
  const expiryDate = new Date(Number(`${subscription.expires_at}000`));
@@ -37792,7 +37900,6 @@ const EmailVerifyModal = ({
37792
37900
  switchToAddressView,
37793
37901
  switchToPaymentView
37794
37902
  } = usePelcro();
37795
- console.log("verify email");
37796
37903
 
37797
37904
  const onSuccess = res => {
37798
37905
  var _otherProps$onSuccess;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "4.0.0-alpha.27",
4
+ "version": "4.0.0-alpha.28",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",