@pelcro/react-pelcro-js 3.1.0-beta.9 → 3.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -7064,8 +7064,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7064
7064
 
7065
7065
  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}}
7066
7066
 
7067
- function _extends$y() {
7068
- _extends$y = Object.assign || function (target) {
7067
+ function _extends$z() {
7068
+ _extends$z = Object.assign || function (target) {
7069
7069
  for (var i = 1; i < arguments.length; i++) {
7070
7070
  var source = arguments[i];
7071
7071
 
@@ -7079,7 +7079,7 @@ function _extends$y() {
7079
7079
  return target;
7080
7080
  };
7081
7081
 
7082
- return _extends$y.apply(this, arguments);
7082
+ return _extends$z.apply(this, arguments);
7083
7083
  }
7084
7084
 
7085
7085
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7169,7 +7169,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7169
7169
  var reducer = function reducer(state, action) {
7170
7170
  switch (action.type) {
7171
7171
  case ActionType.ADD_TOAST:
7172
- return _extends$y({}, state, {
7172
+ return _extends$z({}, state, {
7173
7173
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7174
7174
  });
7175
7175
 
@@ -7179,9 +7179,9 @@ var reducer = function reducer(state, action) {
7179
7179
  clearFromRemoveQueue(action.toast.id);
7180
7180
  }
7181
7181
 
7182
- return _extends$y({}, state, {
7182
+ return _extends$z({}, state, {
7183
7183
  toasts: state.toasts.map(function (t) {
7184
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7184
+ return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7185
7185
  })
7186
7186
  });
7187
7187
 
@@ -7208,9 +7208,9 @@ var reducer = function reducer(state, action) {
7208
7208
  });
7209
7209
  }
7210
7210
 
7211
- return _extends$y({}, state, {
7211
+ return _extends$z({}, state, {
7212
7212
  toasts: state.toasts.map(function (t) {
7213
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7213
+ return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7214
7214
  visible: false
7215
7215
  }) : t;
7216
7216
  })
@@ -7218,28 +7218,28 @@ var reducer = function reducer(state, action) {
7218
7218
 
7219
7219
  case ActionType.REMOVE_TOAST:
7220
7220
  if (action.toastId === undefined) {
7221
- return _extends$y({}, state, {
7221
+ return _extends$z({}, state, {
7222
7222
  toasts: []
7223
7223
  });
7224
7224
  }
7225
7225
 
7226
- return _extends$y({}, state, {
7226
+ return _extends$z({}, state, {
7227
7227
  toasts: state.toasts.filter(function (t) {
7228
7228
  return t.id !== action.toastId;
7229
7229
  })
7230
7230
  });
7231
7231
 
7232
7232
  case ActionType.START_PAUSE:
7233
- return _extends$y({}, state, {
7233
+ return _extends$z({}, state, {
7234
7234
  pausedAt: action.time
7235
7235
  });
7236
7236
 
7237
7237
  case ActionType.END_PAUSE:
7238
7238
  var diff = action.time - (state.pausedAt || 0);
7239
- return _extends$y({}, state, {
7239
+ return _extends$z({}, state, {
7240
7240
  pausedAt: undefined,
7241
7241
  toasts: state.toasts.map(function (t) {
7242
- return _extends$y({}, t, {
7242
+ return _extends$z({}, t, {
7243
7243
  pauseDuration: t.pauseDuration + diff
7244
7244
  });
7245
7245
  })
@@ -7286,12 +7286,12 @@ var useStore = function useStore(toastOptions) {
7286
7286
  var mergedToasts = state.toasts.map(function (t) {
7287
7287
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7288
7288
 
7289
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7289
+ return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7290
7290
  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],
7291
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7291
+ style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7292
7292
  });
7293
7293
  });
7294
- return _extends$y({}, state, {
7294
+ return _extends$z({}, state, {
7295
7295
  toasts: mergedToasts
7296
7296
  });
7297
7297
  };
@@ -7301,7 +7301,7 @@ var createToast = function createToast(message, type, opts) {
7301
7301
  type = 'blank';
7302
7302
  }
7303
7303
 
7304
- return _extends$y({
7304
+ return _extends$z({
7305
7305
  createdAt: Date.now(),
7306
7306
  visible: true,
7307
7307
  type: type,
@@ -7351,14 +7351,14 @@ toast.remove = function (toastId) {
7351
7351
  };
7352
7352
 
7353
7353
  toast.promise = function (promise, msgs, opts) {
7354
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7354
+ var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7355
7355
  promise.then(function (p) {
7356
- toast.success(resolveValue(msgs.success, p), _extends$y({
7356
+ toast.success(resolveValue(msgs.success, p), _extends$z({
7357
7357
  id: id
7358
7358
  }, opts, opts == null ? void 0 : opts.success));
7359
7359
  return p;
7360
7360
  })["catch"](function (e) {
7361
- toast.error(resolveValue(msgs.error, e), _extends$y({
7361
+ toast.error(resolveValue(msgs.error, e), _extends$z({
7362
7362
  id: id
7363
7363
  }, opts, opts == null ? void 0 : opts.error));
7364
7364
  });
@@ -7697,7 +7697,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7697
7697
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7698
7698
  return createElement(ToastBarBase, {
7699
7699
  className: toast.className,
7700
- style: _extends$y({}, animationStyle, style, toast.style)
7700
+ style: _extends$z({}, animationStyle, style, toast.style)
7701
7701
  }, typeof children === 'function' ? children({
7702
7702
  icon: icon,
7703
7703
  message: message
@@ -7727,7 +7727,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7727
7727
  } : position.includes('right') ? {
7728
7728
  justifyContent: 'flex-end'
7729
7729
  } : {};
7730
- return _extends$y({
7730
+ return _extends$z({
7731
7731
  left: 0,
7732
7732
  right: 0,
7733
7733
  display: 'flex',
@@ -7754,7 +7754,7 @@ var Toaster = function Toaster(_ref) {
7754
7754
  handlers = _useToaster.handlers;
7755
7755
 
7756
7756
  return createElement("div", {
7757
- style: _extends$y({
7757
+ style: _extends$z({
7758
7758
  position: 'fixed',
7759
7759
  zIndex: 9999,
7760
7760
  top: DEFAULT_OFFSET,
@@ -7789,82 +7789,82 @@ var Toaster = function Toaster(_ref) {
7789
7789
  }));
7790
7790
  };
7791
7791
 
7792
- var _path$v;
7792
+ var _path$w;
7793
7793
 
7794
- 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); }
7794
+ 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); }
7795
7795
 
7796
7796
  function SvgCheckSolid(props) {
7797
- return /*#__PURE__*/React.createElement("svg", _extends$x({
7797
+ return /*#__PURE__*/React.createElement("svg", _extends$y({
7798
7798
  xmlns: "http://www.w3.org/2000/svg",
7799
7799
  className: "h-5 w-5",
7800
7800
  viewBox: "0 0 20 20",
7801
7801
  fill: "currentColor"
7802
- }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7802
+ }, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
7803
7803
  fillRule: "evenodd",
7804
7804
  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",
7805
7805
  clipRule: "evenodd"
7806
7806
  })));
7807
7807
  }
7808
7808
 
7809
- var _path$u;
7809
+ var _path$v;
7810
7810
 
7811
- 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); }
7811
+ 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); }
7812
7812
 
7813
7813
  function SvgXIcon(props) {
7814
- return /*#__PURE__*/React.createElement("svg", _extends$w({
7814
+ return /*#__PURE__*/React.createElement("svg", _extends$x({
7815
7815
  xmlns: "http://www.w3.org/2000/svg",
7816
7816
  viewBox: "0 0 20 20",
7817
7817
  fill: "currentColor"
7818
- }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7818
+ }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7819
7819
  fill: "evenodd",
7820
7820
  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",
7821
7821
  clipRule: "evenodd"
7822
7822
  })));
7823
7823
  }
7824
7824
 
7825
- var _path$t;
7825
+ var _path$u;
7826
7826
 
7827
- 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); }
7827
+ 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); }
7828
7828
 
7829
7829
  function SvgXIconSolid(props) {
7830
- return /*#__PURE__*/React.createElement("svg", _extends$v({
7830
+ return /*#__PURE__*/React.createElement("svg", _extends$w({
7831
7831
  className: "plc-w-4 plc-h-4",
7832
7832
  fill: "currentColor",
7833
7833
  xmlns: "http://www.w3.org/2000/svg",
7834
7834
  viewBox: "0 0 100 100"
7835
- }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7835
+ }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7836
7836
  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"
7837
7837
  })));
7838
7838
  }
7839
7839
 
7840
- var _path$s;
7840
+ var _path$t;
7841
7841
 
7842
- 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); }
7842
+ 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); }
7843
7843
 
7844
7844
  function SvgExclamation(props) {
7845
- return /*#__PURE__*/React.createElement("svg", _extends$u({
7845
+ return /*#__PURE__*/React.createElement("svg", _extends$v({
7846
7846
  className: "plc-w-4 plc-h-4 plc-mr-1",
7847
7847
  xmlns: "http://www.w3.org/2000/svg",
7848
7848
  viewBox: "0 0 20 20",
7849
7849
  fill: "currentColor"
7850
- }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7850
+ }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7851
7851
  fillRule: "evenodd",
7852
7852
  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",
7853
7853
  clipRule: "evenodd"
7854
7854
  })));
7855
7855
  }
7856
7856
 
7857
- var _path$r, _path2$4;
7857
+ var _path$s, _path2$4;
7858
7858
 
7859
- 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); }
7859
+ 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); }
7860
7860
 
7861
7861
  function SvgSpinner(props) {
7862
- return /*#__PURE__*/React.createElement("svg", _extends$t({
7862
+ return /*#__PURE__*/React.createElement("svg", _extends$u({
7863
7863
  className: "plc-animate-spin",
7864
7864
  viewBox: "0 0 24 24",
7865
7865
  fill: "currentColor",
7866
7866
  xmlns: "http://www.w3.org/2000/svg"
7867
- }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7867
+ }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7868
7868
  opacity: 0.2,
7869
7869
  fill: "evenodd",
7870
7870
  clipRule: "evenodd",
@@ -8599,6 +8599,7 @@ var pure_1 = pure.loadStripe;
8599
8599
  * @param {Object} error Error object
8600
8600
  * @return {string}
8601
8601
  */
8602
+
8602
8603
  const getErrorMessages = error => {
8603
8604
  var _error$error, _error$response, _error$response$data, _error$response3, _error$response3$data, _error$response3$data2, _error$response5, _error$response5$data;
8604
8605
 
@@ -8653,6 +8654,15 @@ const debounce = (func, waitTime) => {
8653
8654
  timeout = setTimeout(later, waitTime);
8654
8655
  };
8655
8656
  };
8657
+ function getSiteCardProcessor() {
8658
+ var _window$Pelcro$site$r;
8659
+
8660
+ if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_pay_page_id) {
8661
+ return "vantiv";
8662
+ }
8663
+
8664
+ return "stripe";
8665
+ }
8656
8666
 
8657
8667
  /**
8658
8668
  * @typedef {Object} OptionsType
@@ -8733,13 +8743,26 @@ const loadPaymentSDKs = () => {
8733
8743
  if (!window.Stripe) {
8734
8744
  pure_1(window.Pelcro.environment.stripe);
8735
8745
  }
8736
- }); // Load PayPal SDK's
8746
+ }); // Load PayPal SDKs
8737
8747
 
8738
8748
  const supportsPaypal = Boolean(window.Pelcro.site.read().braintree_tokenization);
8739
8749
 
8740
8750
  if (supportsPaypal) {
8741
8751
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/client.min.js", "braintree-sdk");
8742
8752
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/paypal-checkout.min.js", "braintree-paypal-sdk");
8753
+ } // Load Vantiv SDKs
8754
+
8755
+
8756
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_pay_page_id);
8757
+
8758
+ if (supportsVantiv) {
8759
+ if (!window.jQuery) {
8760
+ window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
8761
+ }
8762
+
8763
+ if (!window.EprotectIframeClient) {
8764
+ window.Pelcro.helpers.loadSDK("https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js", "vantiv-eprotect-sdk");
8765
+ }
8743
8766
  }
8744
8767
  };
8745
8768
  const loadAuth0SDK = () => {
@@ -8899,8 +8922,7 @@ const initViewFromURL = () => {
8899
8922
  }
8900
8923
 
8901
8924
  if (view === "invoice-details") {
8902
- // FIXME: commented out to remove from the release
8903
- return false; // return showInvoiceDetailsFromUrl();
8925
+ return showInvoiceDetailsFromUrl();
8904
8926
  }
8905
8927
 
8906
8928
  switchView(view);
@@ -9079,6 +9101,43 @@ const verifyEmailTokenFromUrl = () => {
9079
9101
  });
9080
9102
  };
9081
9103
 
9104
+ const showInvoiceDetailsFromUrl = () => {
9105
+ const {
9106
+ isAuthenticated,
9107
+ setInvoice,
9108
+ whenSiteReady,
9109
+ switchView
9110
+ } = usePelcro.getStore();
9111
+ whenSiteReady(() => {
9112
+ if (!isAuthenticated()) {
9113
+ return switchView("login");
9114
+ }
9115
+
9116
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9117
+ const wasSetSuccessfully = setInvoice(invoiceId);
9118
+
9119
+ if (!wasSetSuccessfully) {
9120
+ const errorMessage = i18next.t("messages:invalidInvoice", {
9121
+ returnObjects: true
9122
+ });
9123
+ return notify.error(errorMessage);
9124
+ }
9125
+
9126
+ const {
9127
+ invoice
9128
+ } = usePelcro.getStore();
9129
+
9130
+ if (invoice.total === 0) {
9131
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9132
+ returnObjects: true
9133
+ });
9134
+ return notify.error(errorMessage);
9135
+ }
9136
+
9137
+ return switchView("invoice-details");
9138
+ });
9139
+ };
9140
+
9082
9141
  const defaultOptions = {
9083
9142
  loadPaymentSDKs: true,
9084
9143
  loadAuth0SDK: true,
@@ -9848,16 +9907,16 @@ const LoginPassword = props => /*#__PURE__*/React__default.createElement(Passwor
9848
9907
  store: store$h
9849
9908
  }, props));
9850
9909
 
9851
- var _path$q;
9910
+ var _path$r;
9852
9911
 
9853
- 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); }
9912
+ 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); }
9854
9913
 
9855
9914
  function SvgCheck(props) {
9856
- return /*#__PURE__*/React.createElement("svg", _extends$s({
9915
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
9857
9916
  xmlns: "http://www.w3.org/2000/svg",
9858
9917
  fill: "currentColor",
9859
9918
  viewBox: "0 0 20 20"
9860
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
9919
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
9861
9920
  fillRule: "evenodd",
9862
9921
  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",
9863
9922
  clipRule: "evenodd"
@@ -10176,15 +10235,15 @@ function hasSecurityTokenEnabled$1() {
10176
10235
  return hasSecuritySdkLoaded;
10177
10236
  }
10178
10237
 
10179
- var _path$p;
10238
+ var _path$q;
10180
10239
 
10181
- 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); }
10240
+ 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); }
10182
10241
 
10183
10242
  function SvgFacebookLogo(props) {
10184
- return /*#__PURE__*/React.createElement("svg", _extends$r({
10243
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
10185
10244
  xmlns: "http://www.w3.org/2000/svg",
10186
10245
  viewBox: "88.428 12.828 107.543 207.085"
10187
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10246
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10188
10247
  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",
10189
10248
  fill: "#3c5a9a"
10190
10249
  })));
@@ -10257,15 +10316,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10257
10316
  unwrapExports(googleLogin);
10258
10317
  var googleLogin_1 = googleLogin.GoogleLogin;
10259
10318
 
10260
- var _path$o, _path2$3, _path3$1, _path4;
10319
+ var _path$p, _path2$3, _path3$1, _path4;
10261
10320
 
10262
- 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); }
10321
+ 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); }
10263
10322
 
10264
10323
  function SvgGoogleLogo(props) {
10265
- return /*#__PURE__*/React.createElement("svg", _extends$q({
10324
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
10266
10325
  viewBox: "0 0 24 24",
10267
10326
  xmlns: "http://www.w3.org/2000/svg"
10268
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10327
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10269
10328
  fill: "#4285F4",
10270
10329
  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"
10271
10330
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
@@ -10342,15 +10401,15 @@ const GoogleLoginButton = ({
10342
10401
  }) : null;
10343
10402
  };
10344
10403
 
10345
- var _path$n;
10404
+ var _path$o;
10346
10405
 
10347
- 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); }
10406
+ 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); }
10348
10407
 
10349
10408
  function SvgAuth0Logo(props) {
10350
- return /*#__PURE__*/React.createElement("svg", _extends$p({
10409
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
10351
10410
  viewBox: "0 0 256 285",
10352
10411
  xmlns: "http://www.w3.org/2000/svg"
10353
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10412
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10354
10413
  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"
10355
10414
  })));
10356
10415
  }
@@ -10526,15 +10585,15 @@ function LoginView(props) {
10526
10585
  }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10527
10586
  }
10528
10587
 
10529
- var _path$m, _path2$2, _path3;
10588
+ var _path$n, _path2$2, _path3;
10530
10589
 
10531
- 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); }
10590
+ 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); }
10532
10591
 
10533
10592
  function SvgPelcroAuthorship(props) {
10534
- return /*#__PURE__*/React.createElement("svg", _extends$o({
10593
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
10535
10594
  xmlns: "http://www.w3.org/2000/svg",
10536
10595
  viewBox: "0 -80.652 497.072 179.991"
10537
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
10596
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10538
10597
  fill: "none",
10539
10598
  stroke: "#4a4a4a",
10540
10599
  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"
@@ -12678,7 +12737,7 @@ var _generateUserError = /*#__PURE__*/new WeakMap();
12678
12737
  class Subscription {
12679
12738
  /**
12680
12739
  * Subscription service constructor
12681
- * @param {(StripeGateway|PaypalGateWay)} paymentGateway
12740
+ * @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
12682
12741
  */
12683
12742
  constructor(paymentGateway) {
12684
12743
  _defineProperty$3(this, "execute", (options, callback) => {
@@ -12699,7 +12758,7 @@ class Subscription {
12699
12758
  _isPaymentGatewayInvalid.set(this, {
12700
12759
  writable: true,
12701
12760
  value: gateway => {
12702
- return gateway && !(gateway instanceof StripeGateway) && gateway && !(gateway instanceof PaypalGateWay);
12761
+ return gateway && !(gateway instanceof StripeGateway || gateway instanceof PaypalGateway || gateway instanceof VantivGateway);
12703
12762
  }
12704
12763
  });
12705
12764
 
@@ -12752,7 +12811,8 @@ class Subscription {
12752
12811
  }
12753
12812
  const PAYMENT_GATEWAYS_ENUM = {
12754
12813
  stripe: "stripe",
12755
- paypal: "braintree"
12814
+ paypal: "braintree",
12815
+ vantiv: "vantiv"
12756
12816
  };
12757
12817
  /**
12758
12818
  * Subscription Strategies
@@ -12944,7 +13004,7 @@ var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12944
13004
 
12945
13005
  var _payInvoice2 = /*#__PURE__*/new WeakMap();
12946
13006
 
12947
- class PaypalGateWay {
13007
+ class PaypalGateway {
12948
13008
  constructor() {
12949
13009
  _paymentGateway2.set(this, {
12950
13010
  writable: true,
@@ -13045,6 +13105,57 @@ class PaypalGateWay {
13045
13105
 
13046
13106
  }
13047
13107
 
13108
+ var _paymentGateway3 = /*#__PURE__*/new WeakMap();
13109
+
13110
+ var _createSubscription3 = /*#__PURE__*/new WeakMap();
13111
+
13112
+ class VantivGateway {
13113
+ constructor() {
13114
+ _paymentGateway3.set(this, {
13115
+ writable: true,
13116
+ value: PAYMENT_GATEWAYS_ENUM["vantiv"]
13117
+ });
13118
+
13119
+ _defineProperty$3(this, "execute", (options, callback) => {
13120
+ const types = SUBSCRIPTION_TYPES;
13121
+
13122
+ switch (options.type) {
13123
+ case types.CREATE_SUBSCRIPTION:
13124
+ return _classPrivateFieldGet(this, _createSubscription3).call(this, options, callback);
13125
+
13126
+ default:
13127
+ console.error("Unsupported subscriptiion method: vantiv Gateway");
13128
+ }
13129
+ });
13130
+
13131
+ _createSubscription3.set(this, {
13132
+ writable: true,
13133
+ value: (options, callback) => {
13134
+ const {
13135
+ token,
13136
+ plan,
13137
+ couponCode,
13138
+ product,
13139
+ quantity = 1,
13140
+ addressId
13141
+ } = options;
13142
+ window.Pelcro.subscription.create({
13143
+ quantity,
13144
+ gateway_token: token,
13145
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13146
+ auth_token: window.Pelcro.user.read().auth_token,
13147
+ plan_id: plan.id,
13148
+ coupon_code: couponCode,
13149
+ address_id: product.address_required ? addressId : null
13150
+ }, (err, res) => {
13151
+ callback(err, res);
13152
+ });
13153
+ }
13154
+ });
13155
+ }
13156
+
13157
+ }
13158
+
13048
13159
  /**
13049
13160
  * @typedef {Object} PaymentStateType
13050
13161
  * @property {boolean} disableSubmit
@@ -13132,6 +13243,78 @@ const PaymentMethodContainerWithoutStripe = ({
13132
13243
  updateTotalAmountWithTax();
13133
13244
  }, []);
13134
13245
 
13246
+ function submitVantivPayment() {
13247
+ if (!vantivInstanceRef.current) {
13248
+ return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13249
+ }
13250
+
13251
+ const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13252
+
13253
+ vantivInstanceRef.current.getPaypageRegistrationId({
13254
+ id: orderId,
13255
+ orderId: orderId
13256
+ });
13257
+ }
13258
+
13259
+ function handleVantivPayment(paymentRequest) {
13260
+ const SUCCESS_STATUS = "870";
13261
+
13262
+ if (paymentRequest.response !== SUCCESS_STATUS) {
13263
+ return handlePaymentError({
13264
+ error: new Error(paymentRequest.message)
13265
+ });
13266
+ }
13267
+
13268
+ const subscription = new Subscription(new VantivGateway());
13269
+ const {
13270
+ couponCode
13271
+ } = state;
13272
+ return subscription.execute({
13273
+ type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
13274
+ token: paymentRequest,
13275
+ quantity: plan.quantity,
13276
+ plan,
13277
+ couponCode,
13278
+ product,
13279
+ addressId: selectedAddressId
13280
+ }, (err, res) => {
13281
+ if (err) {
13282
+ return handlePaymentError(err);
13283
+ }
13284
+
13285
+ onSuccess(res);
13286
+ });
13287
+ }
13288
+
13289
+ const vantivInstanceRef = React__default.useRef(null);
13290
+ useEffect(() => {
13291
+ const cardProcessor = getSiteCardProcessor();
13292
+
13293
+ if (cardProcessor === "vantiv") {
13294
+ var _window$Pelcro$site$r;
13295
+
13296
+ 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;
13297
+ vantivInstanceRef.current = new window.EprotectIframeClient({
13298
+ paypageId: payPageId,
13299
+ reportGroup: payPageId,
13300
+ style: "pelcro",
13301
+ height: "245",
13302
+ timeout: 50000,
13303
+ div: "eProtectiframe",
13304
+ callback: handleVantivPayment,
13305
+ showCvv: true,
13306
+ numYears: 8,
13307
+ placeholderText: {
13308
+ cvv: "CVV",
13309
+ accountNumber: "1234 1234 1234 1234"
13310
+ },
13311
+ enhancedUxFeatures: {
13312
+ inlineFieldValidations: true
13313
+ }
13314
+ });
13315
+ }
13316
+ }, []);
13317
+
13135
13318
  const initPaymentRequest = (state, dispatch) => {
13136
13319
  try {
13137
13320
  const paymentRequest = stripe.paymentRequest({
@@ -13202,9 +13385,9 @@ const PaymentMethodContainerWithoutStripe = ({
13202
13385
 
13203
13386
 
13204
13387
  const updateTotalAmountWithTax = () => {
13205
- var _window$Pelcro$site$r;
13388
+ var _window$Pelcro$site$r2;
13206
13389
 
13207
- const taxesEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.taxes_enabled;
13390
+ const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
13208
13391
 
13209
13392
  if (taxesEnabled && type === "createPayment") {
13210
13393
  dispatch({
@@ -13554,7 +13737,7 @@ const PaymentMethodContainerWithoutStripe = ({
13554
13737
 
13555
13738
 
13556
13739
  const handlePaypalSubscription = (state, paypalNonce) => {
13557
- const subscription = new Subscription(new PaypalGateWay());
13740
+ const subscription = new Subscription(new PaypalGateway());
13558
13741
  const {
13559
13742
  couponCode
13560
13743
  } = state;
@@ -13849,13 +14032,13 @@ const PaymentMethodContainerWithoutStripe = ({
13849
14032
 
13850
14033
 
13851
14034
  const resolveTaxCalculation = () => {
13852
- var _window$Pelcro$site$r2;
14035
+ var _window$Pelcro$site$r3;
13853
14036
 
13854
14037
  if (type === "invoicePayment") {
13855
14038
  return new Promise(resolve => resolve());
13856
14039
  }
13857
14040
 
13858
- const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
14041
+ const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
13859
14042
  return new Promise((resolve, reject) => {
13860
14043
  // resolve early if taxes isn't enabled
13861
14044
  if (!taxesEnabled) {
@@ -13934,6 +14117,8 @@ const PaymentMethodContainerWithoutStripe = ({
13934
14117
  };
13935
14118
 
13936
14119
  const handlePaymentError = error => {
14120
+ var _getErrorMessages;
14121
+
13937
14122
  if (error.type === "validation_error" && // Subscription creation & renewal
13938
14123
  type === "createPayment") {
13939
14124
  var _state$couponObject;
@@ -13952,7 +14137,7 @@ const PaymentMethodContainerWithoutStripe = ({
13952
14137
  type: SHOW_ALERT,
13953
14138
  payload: {
13954
14139
  type: "error",
13955
- content: error === null || error === void 0 ? void 0 : error.message
14140
+ content: (_getErrorMessages = getErrorMessages(error)) !== null && _getErrorMessages !== void 0 ? _getErrorMessages : error === null || error === void 0 ? void 0 : error.message
13956
14141
  }
13957
14142
  });
13958
14143
  dispatch({
@@ -14056,16 +14241,20 @@ const PaymentMethodContainerWithoutStripe = ({
14056
14241
  }
14057
14242
 
14058
14243
  if (type === "updatePaymentSource") {
14059
- updatePaymentSource(state, dispatch);
14060
- } else {
14061
- submitPayment(state);
14244
+ return updatePaymentSource(state, dispatch);
14062
14245
  }
14246
+
14247
+ if (getSiteCardProcessor() === "vantiv") {
14248
+ return submitVantivPayment();
14249
+ }
14250
+
14251
+ submitPayment(state);
14063
14252
  });
14064
14253
 
14065
14254
  case HANDLE_PAYPAL_SUBSCRIPTION:
14066
14255
  return lib_5(state, (state, dispatch) => {
14067
14256
  if (type === "invoicePayment") {
14068
- payInvoice(new PaypalGateWay(), action.payload, dispatch);
14257
+ payInvoice(new PaypalGateway(), action.payload, dispatch);
14069
14258
  } else {
14070
14259
  handlePaypalSubscription(state, action.payload);
14071
14260
  }
@@ -14248,19 +14437,35 @@ const CheckoutForm = () => {
14248
14437
  const {
14249
14438
  selectedPaymentMethodId
14250
14439
  } = usePelcro();
14251
- return !selectedPaymentMethodId && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(PelcroCardNumber, {
14252
- autoFocus: true
14253
- }), /*#__PURE__*/React__default.createElement("img", {
14254
- alt: "credit_cards",
14255
- className: "plc-h-4 plc-w-auto plc-mt-2",
14256
- src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14257
- }), /*#__PURE__*/React__default.createElement("div", {
14258
- className: "plc-flex plc-justify-between plc-my-2 plc-items-end"
14259
- }, /*#__PURE__*/React__default.createElement("div", {
14260
- className: "plc-w-6/12 plc-pr-4"
14261
- }, /*#__PURE__*/React__default.createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default.createElement("div", {
14262
- className: "plc-w-6/12 plc-pl-4"
14263
- }, /*#__PURE__*/React__default.createElement(PelcroCardCVC, null))));
14440
+ const cardProcessor = getSiteCardProcessor();
14441
+
14442
+ if (selectedPaymentMethodId) {
14443
+ return null;
14444
+ }
14445
+
14446
+ if (cardProcessor === "vantiv") {
14447
+ return /*#__PURE__*/React__default.createElement("div", {
14448
+ id: "eProtectiframe"
14449
+ });
14450
+ }
14451
+
14452
+ if (cardProcessor === "stripe") {
14453
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(PelcroCardNumber, {
14454
+ autoFocus: true
14455
+ }), /*#__PURE__*/React__default.createElement("img", {
14456
+ alt: "credit_cards",
14457
+ className: "plc-w-auto plc-h-4 plc-mt-2",
14458
+ src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14459
+ }), /*#__PURE__*/React__default.createElement("div", {
14460
+ className: "plc-flex plc-items-end plc-justify-between plc-my-2"
14461
+ }, /*#__PURE__*/React__default.createElement("div", {
14462
+ className: "plc-w-6/12 plc-pr-4"
14463
+ }, /*#__PURE__*/React__default.createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default.createElement("div", {
14464
+ className: "plc-w-6/12 plc-pl-4"
14465
+ }, /*#__PURE__*/React__default.createElement(PelcroCardCVC, null))));
14466
+ }
14467
+
14468
+ return null;
14264
14469
  };
14265
14470
 
14266
14471
  const DiscountedPrice = props => {
@@ -14347,17 +14552,17 @@ const SubmitPaymentMethod = ({
14347
14552
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14348
14553
  };
14349
14554
 
14350
- var _path$l;
14555
+ var _path$m;
14351
14556
 
14352
- 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); }
14557
+ 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); }
14353
14558
 
14354
14559
  function SvgArrowLeft(props) {
14355
- return /*#__PURE__*/React.createElement("svg", _extends$n({
14560
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
14356
14561
  xmlns: "http://www.w3.org/2000/svg",
14357
14562
  fill: "none",
14358
14563
  viewBox: "0 0 24 24",
14359
14564
  stroke: "currentColor"
14360
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14565
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
14361
14566
  strokeLinecap: "round",
14362
14567
  strokeLinejoin: "round",
14363
14568
  strokeWidth: 2,
@@ -14439,17 +14644,17 @@ const CouponCodeField = props => {
14439
14644
  }, props));
14440
14645
  };
14441
14646
 
14442
- var _path$k;
14647
+ var _path$l;
14443
14648
 
14444
- 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); }
14649
+ 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); }
14445
14650
 
14446
14651
  function SvgTicket(props) {
14447
- return /*#__PURE__*/React.createElement("svg", _extends$m({
14652
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
14448
14653
  xmlns: "http://www.w3.org/2000/svg",
14449
14654
  fill: "none",
14450
14655
  viewBox: "0 0 24 24",
14451
14656
  stroke: "currentColor"
14452
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14657
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14453
14658
  strokeLinecap: "round",
14454
14659
  strokeLinejoin: "round",
14455
14660
  strokeWidth: 2,
@@ -14809,16 +15014,16 @@ const BankRedirection = () => {
14809
15014
  }));
14810
15015
  };
14811
15016
 
14812
- var _path$j;
15017
+ var _path$k;
14813
15018
 
14814
- 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); }
15019
+ 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); }
14815
15020
 
14816
15021
  function SvgLock(props) {
14817
- return /*#__PURE__*/React.createElement("svg", _extends$l({
15022
+ return /*#__PURE__*/React.createElement("svg", _extends$m({
14818
15023
  xmlns: "http://www.w3.org/2000/svg",
14819
15024
  viewBox: "0 0 20 20",
14820
15025
  fill: "currentColor"
14821
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
15026
+ }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14822
15027
  fillRule: "evenodd",
14823
15028
  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",
14824
15029
  clipRule: "evenodd"
@@ -14910,9 +15115,10 @@ function PaymentMethodView({
14910
15115
  const {
14911
15116
  t
14912
15117
  } = useTranslation("checkoutForm");
15118
+ const cardProcessor = getSiteCardProcessor();
14913
15119
  return /*#__PURE__*/React__default.createElement("div", {
14914
15120
  className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
14915
- }, /*#__PURE__*/React__default.createElement("div", {
15121
+ }, cardProcessor === "stripe" && /*#__PURE__*/React__default.createElement("div", {
14916
15122
  className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
14917
15123
  }, /*#__PURE__*/React__default.createElement(SvgLock, {
14918
15124
  className: "plc-w-5 plc-h-5 plc-mr-1"
@@ -15040,12 +15246,12 @@ function SubscriptionRenewModal({
15040
15246
  }
15041
15247
  SubscriptionRenewModal.viewId = "subscription-renew";
15042
15248
 
15043
- var _path$i;
15249
+ var _path$j;
15044
15250
 
15045
- 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); }
15251
+ 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); }
15046
15252
 
15047
15253
  function SvgGift(props) {
15048
- return /*#__PURE__*/React.createElement("svg", _extends$k({
15254
+ return /*#__PURE__*/React.createElement("svg", _extends$l({
15049
15255
  className: "plc-w-6 plc-h-6 plc-mr-2",
15050
15256
  fill: "none",
15051
15257
  stroke: "currentColor",
@@ -15054,7 +15260,7 @@ function SvgGift(props) {
15054
15260
  strokeWidth: 2,
15055
15261
  viewBox: "0 0 24 24",
15056
15262
  xmlns: "http://www.w3.org/2000/svg"
15057
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
15263
+ }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
15058
15264
  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"
15059
15265
  })));
15060
15266
  }
@@ -16063,17 +16269,17 @@ const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone
16063
16269
 
16064
16270
  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";
16065
16271
 
16066
- var _path$h;
16272
+ var _path$i;
16067
16273
 
16068
- 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); }
16274
+ 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); }
16069
16275
 
16070
16276
  function SvgEdit(props) {
16071
- return /*#__PURE__*/React.createElement("svg", _extends$j({
16277
+ return /*#__PURE__*/React.createElement("svg", _extends$k({
16072
16278
  className: "plc-w-6 plc-h-6",
16073
16279
  xmlns: "http://www.w3.org/2000/svg",
16074
16280
  viewBox: "0 0 20 20",
16075
16281
  fill: "currentColor"
16076
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
16282
+ }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
16077
16283
  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"
16078
16284
  })));
16079
16285
  }
@@ -19183,18 +19389,18 @@ const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(La
19183
19389
  store: store$6
19184
19390
  }, props));
19185
19391
 
19186
- var _path$g;
19392
+ var _path$h;
19187
19393
 
19188
- 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); }
19394
+ 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); }
19189
19395
 
19190
19396
  function SvgInfoCircle(props) {
19191
- return /*#__PURE__*/React.createElement("svg", _extends$i({
19397
+ return /*#__PURE__*/React.createElement("svg", _extends$j({
19192
19398
  xmlns: "http://www.w3.org/2000/svg",
19193
19399
  className: "plc-w-5 plc-h-5",
19194
19400
  fill: "none",
19195
19401
  viewBox: "0 0 24 24",
19196
19402
  stroke: "currentColor"
19197
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
19403
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
19198
19404
  strokeLinecap: "round",
19199
19405
  strokeLinejoin: "round",
19200
19406
  strokeWidth: 2,
@@ -20206,8 +20412,8 @@ const PaymentMethodSelectModal = ({
20206
20412
  };
20207
20413
  PaymentMethodSelectModal.viewId = "payment-method-select";
20208
20414
 
20209
- function _extends$h() {
20210
- _extends$h = Object.assign || function (target) {
20415
+ function _extends$i() {
20416
+ _extends$i = Object.assign || function (target) {
20211
20417
  for (var i = 1; i < arguments.length; i++) {
20212
20418
  var source = arguments[i];
20213
20419
 
@@ -20221,7 +20427,7 @@ function _extends$h() {
20221
20427
  return target;
20222
20428
  };
20223
20429
 
20224
- return _extends$h.apply(this, arguments);
20430
+ return _extends$i.apply(this, arguments);
20225
20431
  }
20226
20432
 
20227
20433
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20405,7 +20611,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20405
20611
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20406
20612
  return null;
20407
20613
  }, _match[RenderStrategy.Hidden] = function () {
20408
- return _render(_extends$h({}, _rest, {
20614
+ return _render(_extends$i({}, _rest, {
20409
20615
  hidden: true,
20410
20616
  style: {
20411
20617
  display: 'none'
@@ -20933,7 +21139,7 @@ function TransitionChild(props) {
20933
21139
  var passthroughProps = rest;
20934
21140
  return React__default.createElement(NestingContext.Provider, {
20935
21141
  value: nesting
20936
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21142
+ }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20937
21143
  }
20938
21144
 
20939
21145
  function Transition(props) {
@@ -20977,7 +21183,7 @@ function Transition(props) {
20977
21183
  value: nestingBag
20978
21184
  }, React__default.createElement(TransitionContext.Provider, {
20979
21185
  value: transitionBag
20980
- }, render(_extends$h({}, sharedProps, {
21186
+ }, render(_extends$i({}, sharedProps, {
20981
21187
  as: Fragment,
20982
21188
  children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
20983
21189
  }), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21104,12 +21310,12 @@ var ActionTypes;
21104
21310
  })(ActionTypes || (ActionTypes = {}));
21105
21311
 
21106
21312
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21107
- return _extends$h({}, state, {
21313
+ return _extends$i({}, state, {
21108
21314
  activeItemIndex: null,
21109
21315
  menuState: MenuStates.Closed
21110
21316
  });
21111
21317
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21112
- return _extends$h({}, state, {
21318
+ return _extends$i({}, state, {
21113
21319
  menuState: MenuStates.Open
21114
21320
  });
21115
21321
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21128,7 +21334,7 @@ var ActionTypes;
21128
21334
  }
21129
21335
  });
21130
21336
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21131
- return _extends$h({}, state, {
21337
+ return _extends$i({}, state, {
21132
21338
  searchQuery: '',
21133
21339
  activeItemIndex: activeItemIndex
21134
21340
  });
@@ -21139,19 +21345,19 @@ var ActionTypes;
21139
21345
 
21140
21346
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21141
21347
  });
21142
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21348
+ if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
21143
21349
  searchQuery: searchQuery
21144
21350
  });
21145
- return _extends$h({}, state, {
21351
+ return _extends$i({}, state, {
21146
21352
  searchQuery: searchQuery,
21147
21353
  activeItemIndex: match
21148
21354
  });
21149
21355
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21150
- return _extends$h({}, state, {
21356
+ return _extends$i({}, state, {
21151
21357
  searchQuery: ''
21152
21358
  });
21153
21359
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21154
- return _extends$h({}, state, {
21360
+ return _extends$i({}, state, {
21155
21361
  items: [].concat(state.items, [{
21156
21362
  id: action.id,
21157
21363
  dataRef: action.dataRef
@@ -21164,7 +21370,7 @@ var ActionTypes;
21164
21370
  return a.id === action.id;
21165
21371
  });
21166
21372
  if (idx !== -1) nextItems.splice(idx, 1);
21167
- return _extends$h({}, state, {
21373
+ return _extends$i({}, state, {
21168
21374
  items: nextItems,
21169
21375
  activeItemIndex: function () {
21170
21376
  if (idx === state.activeItemIndex) return null;
@@ -21203,19 +21409,19 @@ var ActionTypes$1;
21203
21409
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21204
21410
  if (state.disabled) return state;
21205
21411
  if (state.listboxState === ListboxStates.Closed) return state;
21206
- return _extends$h({}, state, {
21412
+ return _extends$i({}, state, {
21207
21413
  activeOptionIndex: null,
21208
21414
  listboxState: ListboxStates.Closed
21209
21415
  });
21210
21416
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21211
21417
  if (state.disabled) return state;
21212
21418
  if (state.listboxState === ListboxStates.Open) return state;
21213
- return _extends$h({}, state, {
21419
+ return _extends$i({}, state, {
21214
21420
  listboxState: ListboxStates.Open
21215
21421
  });
21216
21422
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21217
21423
  if (state.disabled === action.disabled) return state;
21218
- return _extends$h({}, state, {
21424
+ return _extends$i({}, state, {
21219
21425
  disabled: action.disabled
21220
21426
  });
21221
21427
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21236,7 +21442,7 @@ var ActionTypes$1;
21236
21442
  }
21237
21443
  });
21238
21444
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21239
- return _extends$h({}, state, {
21445
+ return _extends$i({}, state, {
21240
21446
  searchQuery: '',
21241
21447
  activeOptionIndex: activeOptionIndex
21242
21448
  });
@@ -21249,10 +21455,10 @@ var ActionTypes$1;
21249
21455
 
21250
21456
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21251
21457
  });
21252
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21458
+ if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21253
21459
  searchQuery: searchQuery
21254
21460
  });
21255
- return _extends$h({}, state, {
21461
+ return _extends$i({}, state, {
21256
21462
  searchQuery: searchQuery,
21257
21463
  activeOptionIndex: match
21258
21464
  });
@@ -21260,11 +21466,11 @@ var ActionTypes$1;
21260
21466
  if (state.disabled) return state;
21261
21467
  if (state.listboxState === ListboxStates.Closed) return state;
21262
21468
  if (state.searchQuery === '') return state;
21263
- return _extends$h({}, state, {
21469
+ return _extends$i({}, state, {
21264
21470
  searchQuery: ''
21265
21471
  });
21266
21472
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21267
- return _extends$h({}, state, {
21473
+ return _extends$i({}, state, {
21268
21474
  options: [].concat(state.options, [{
21269
21475
  id: action.id,
21270
21476
  dataRef: action.dataRef
@@ -21277,7 +21483,7 @@ var ActionTypes$1;
21277
21483
  return a.id === action.id;
21278
21484
  });
21279
21485
  if (idx !== -1) nextOptions.splice(idx, 1);
21280
- return _extends$h({}, state, {
21486
+ return _extends$i({}, state, {
21281
21487
  options: nextOptions,
21282
21488
  activeOptionIndex: function () {
21283
21489
  if (idx === state.activeOptionIndex) return null;
@@ -21338,18 +21544,18 @@ const getPaymentCardIcon = name => {
21338
21544
  }));
21339
21545
  };
21340
21546
 
21341
- var _path$f;
21547
+ var _path$g;
21342
21548
 
21343
- 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); }
21549
+ 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); }
21344
21550
 
21345
21551
  function SvgChevronRight(props) {
21346
- return /*#__PURE__*/React.createElement("svg", _extends$g({
21552
+ return /*#__PURE__*/React.createElement("svg", _extends$h({
21347
21553
  className: "plc-w-6 plc-h-6",
21348
21554
  xmlns: "http://www.w3.org/2000/svg",
21349
21555
  fill: "none",
21350
21556
  viewBox: "0 0 24 24",
21351
21557
  stroke: "currentColor"
21352
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21558
+ }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
21353
21559
  strokeLinecap: "round",
21354
21560
  strokeLinejoin: "round",
21355
21561
  strokeWidth: 2,
@@ -21565,18 +21771,18 @@ const SavedItems = ({
21565
21771
  });
21566
21772
  };
21567
21773
 
21568
- var _path$e;
21774
+ var _path$f;
21569
21775
 
21570
- 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); }
21776
+ 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); }
21571
21777
 
21572
21778
  function SvgRefresh(props) {
21573
- return /*#__PURE__*/React.createElement("svg", _extends$f({
21779
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
21574
21780
  className: "plc-w-4 plc-h-4 plc-mr-1",
21575
21781
  xmlns: "http://www.w3.org/2000/svg",
21576
21782
  fill: "none",
21577
21783
  viewBox: "0 0 24 24",
21578
21784
  stroke: "currentColor"
21579
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21785
+ }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21580
21786
  strokeLinecap: "round",
21581
21787
  strokeLinejoin: "round",
21582
21788
  strokeWidth: 2,
@@ -21584,35 +21790,35 @@ function SvgRefresh(props) {
21584
21790
  })));
21585
21791
  }
21586
21792
 
21587
- var _path$d;
21793
+ var _path$e;
21588
21794
 
21589
- 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); }
21795
+ 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); }
21590
21796
 
21591
21797
  function SvgCalendar(props) {
21592
- return /*#__PURE__*/React.createElement("svg", _extends$e({
21798
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
21593
21799
  xmlns: "http://www.w3.org/2000/svg",
21594
21800
  className: "plc-h-4 plc-w-4 plc-mr-1",
21595
21801
  viewBox: "0 0 20 20",
21596
21802
  fill: "currentColor"
21597
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21803
+ }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21598
21804
  fillRule: "evenodd",
21599
21805
  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",
21600
21806
  clipRule: "evenodd"
21601
21807
  })));
21602
21808
  }
21603
21809
 
21604
- var _path$c;
21810
+ var _path$d;
21605
21811
 
21606
- 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); }
21812
+ 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); }
21607
21813
 
21608
21814
  function SvgPlus(props) {
21609
- return /*#__PURE__*/React.createElement("svg", _extends$d({
21815
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
21610
21816
  className: "plc-w-5 plc-h-5",
21611
21817
  xmlns: "http://www.w3.org/2000/svg",
21612
21818
  fill: "none",
21613
21819
  viewBox: "0 0 24 24",
21614
21820
  stroke: "currentColor"
21615
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21821
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21616
21822
  strokeLinecap: "round",
21617
21823
  strokeLinejoin: "round",
21618
21824
  strokeWidth: 2,
@@ -21620,17 +21826,17 @@ function SvgPlus(props) {
21620
21826
  })));
21621
21827
  }
21622
21828
 
21623
- var _path$b;
21829
+ var _path$c;
21624
21830
 
21625
- 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); }
21831
+ 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); }
21626
21832
 
21627
21833
  function SvgCheckMark(props) {
21628
- return /*#__PURE__*/React.createElement("svg", _extends$c({
21834
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
21629
21835
  className: "plc-w-4 plc-h-4 plc-mr-1",
21630
21836
  xmlns: "http://www.w3.org/2000/svg",
21631
21837
  viewBox: "0 0 20 20",
21632
21838
  fill: "currentColor"
21633
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21839
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21634
21840
  fillRule: "evenodd",
21635
21841
  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",
21636
21842
  clipRule: "evenodd"
@@ -21925,13 +22131,31 @@ Accordion.item = function AccordionItem({
21925
22131
  }, content)) : null;
21926
22132
  };
21927
22133
 
22134
+ var _path$b;
22135
+
22136
+ 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); }
22137
+
22138
+ function SvgExit(props) {
22139
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
22140
+ className: "plc-w-6 plc-h-6",
22141
+ xmlns: "http://www.w3.org/2000/svg",
22142
+ fill: "none",
22143
+ viewBox: "0 0 24 24",
22144
+ stroke: "currentColor"
22145
+ }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
22146
+ strokeLinecap: "round",
22147
+ strokeLinejoin: "round",
22148
+ strokeWidth: 2,
22149
+ d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
22150
+ })));
22151
+ }
22152
+
21928
22153
  var _path$a;
21929
22154
 
21930
22155
  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); }
21931
22156
 
21932
- function SvgExit(props) {
22157
+ function SvgUser(props) {
21933
22158
  return /*#__PURE__*/React.createElement("svg", _extends$b({
21934
- className: "plc-w-6 plc-h-6",
21935
22159
  xmlns: "http://www.w3.org/2000/svg",
21936
22160
  fill: "none",
21937
22161
  viewBox: "0 0 24 24",
@@ -21940,7 +22164,7 @@ function SvgExit(props) {
21940
22164
  strokeLinecap: "round",
21941
22165
  strokeLinejoin: "round",
21942
22166
  strokeWidth: 2,
21943
- d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
22167
+ d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
21944
22168
  })));
21945
22169
  }
21946
22170
 
@@ -21948,9 +22172,10 @@ var _path$9;
21948
22172
 
21949
22173
  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); }
21950
22174
 
21951
- function SvgUser(props) {
22175
+ function SvgNewsletter(props) {
21952
22176
  return /*#__PURE__*/React.createElement("svg", _extends$a({
21953
22177
  xmlns: "http://www.w3.org/2000/svg",
22178
+ className: "plc-h-5 plc-w-5",
21954
22179
  fill: "none",
21955
22180
  viewBox: "0 0 24 24",
21956
22181
  stroke: "currentColor"
@@ -21958,7 +22183,7 @@ function SvgUser(props) {
21958
22183
  strokeLinecap: "round",
21959
22184
  strokeLinejoin: "round",
21960
22185
  strokeWidth: 2,
21961
- d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
22186
+ d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
21962
22187
  })));
21963
22188
  }
21964
22189
 
@@ -21966,10 +22191,10 @@ var _path$8;
21966
22191
 
21967
22192
  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); }
21968
22193
 
21969
- function SvgNewsletter(props) {
22194
+ function SvgDocument(props) {
21970
22195
  return /*#__PURE__*/React.createElement("svg", _extends$9({
21971
22196
  xmlns: "http://www.w3.org/2000/svg",
21972
- className: "plc-h-5 plc-w-5",
22197
+ className: "plc-h-6 plc-w-6 plc-mr-2",
21973
22198
  fill: "none",
21974
22199
  viewBox: "0 0 24 24",
21975
22200
  stroke: "currentColor"
@@ -21977,7 +22202,7 @@ function SvgNewsletter(props) {
21977
22202
  strokeLinecap: "round",
21978
22203
  strokeLinejoin: "round",
21979
22204
  strokeWidth: 2,
21980
- d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
22205
+ d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
21981
22206
  })));
21982
22207
  }
21983
22208
 
@@ -22157,6 +22382,138 @@ function formatStartDate(date) {
22157
22382
  return new Intl.DateTimeFormat("en-CA").format(startDate);
22158
22383
  }
22159
22384
 
22385
+ const InvoicesMenu = props => {
22386
+ const {
22387
+ t
22388
+ } = useTranslation("dashboard");
22389
+ return /*#__PURE__*/React__default.createElement("table", {
22390
+ className: "plc-w-full plc-table-fixed"
22391
+ }, /*#__PURE__*/React__default.createElement("thead", {
22392
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22393
+ }, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
22394
+ className: "plc-w-4/12 "
22395
+ }, t("labels.details")), /*#__PURE__*/React__default.createElement("th", {
22396
+ className: "plc-w-4/12 "
22397
+ }, t("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
22398
+ className: "plc-w-3/12 "
22399
+ }, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
22400
+ className: "plc-h-4"
22401
+ }), /*#__PURE__*/React__default.createElement(InvoicesItems, props)));
22402
+ };
22403
+
22404
+ const InvoicesItems = () => {
22405
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22406
+
22407
+ const {
22408
+ t
22409
+ } = useTranslation("dashboard");
22410
+ const {
22411
+ setInvoice,
22412
+ switchView
22413
+ } = usePelcro();
22414
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22415
+
22416
+ const showInvoiceDetails = event => {
22417
+ if (setInvoice(event.target.dataset.id)) {
22418
+ switchView("invoice-details");
22419
+ }
22420
+ };
22421
+
22422
+ if (invoices.length === 0) return null;
22423
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22424
+ const invoiceStatus = getInvoiceStatus(invoice);
22425
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22426
+ return /*#__PURE__*/React__default.createElement("tr", {
22427
+ key: invoice.id,
22428
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22429
+ }, /*#__PURE__*/React__default.createElement("td", {
22430
+ className: "plc-truncate"
22431
+ }, /*#__PURE__*/React__default.createElement("span", {
22432
+ className: "plc-font-semibold plc-text-gray-500"
22433
+ }, `#${invoice.id}`), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22434
+ className: "plc-text-sm plc-text-gray-500"
22435
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22436
+ className: "plc-text-sm plc-text-gray-500"
22437
+ }, formattedCreationDate)), /*#__PURE__*/React__default.createElement("td", {
22438
+ className: "plc-py-2"
22439
+ }, /*#__PURE__*/React__default.createElement("span", {
22440
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22441
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
22442
+ variant: "ghost",
22443
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22444
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, {
22445
+ className: "plc-w-4 plc-h-4"
22446
+ }),
22447
+ onClick: showInvoiceDetails,
22448
+ "data-id": invoice.id
22449
+ }, t("labels.view"))));
22450
+ });
22451
+ };
22452
+
22453
+ function getInvoiceStatus(invoice) {
22454
+ const translations = i18next.t("dashboard:labels", {
22455
+ returnObjects: true
22456
+ });
22457
+
22458
+ switch (invoice.status) {
22459
+ case "paid":
22460
+ return {
22461
+ textColor: "plc-text-green-700",
22462
+ bgColor: "plc-bg-green-100",
22463
+ icon: /*#__PURE__*/React__default.createElement(SvgCheckMark, null),
22464
+ title: translations.paid
22465
+ };
22466
+
22467
+ case "past_due":
22468
+ return {
22469
+ textColor: "plc-text-orange-700",
22470
+ bgColor: "plc-bg-orange-100",
22471
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22472
+ title: translations.pastDue
22473
+ };
22474
+
22475
+ case "open":
22476
+ return {
22477
+ textColor: "plc-text-yellow-700",
22478
+ bgColor: "plc-bg-yellow-100",
22479
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22480
+ title: translations.open
22481
+ };
22482
+
22483
+ case "draft":
22484
+ return {
22485
+ textColor: "plc-text-blue-700",
22486
+ bgColor: "plc-bg-blue-100",
22487
+ icon: /*#__PURE__*/React__default.createElement(SvgEdit, null),
22488
+ title: translations.draft
22489
+ };
22490
+
22491
+ case "scheduled":
22492
+ return {
22493
+ textColor: "plc-text-blue-700",
22494
+ bgColor: "plc-bg-blue-100",
22495
+ icon: /*#__PURE__*/React__default.createElement(SvgCalendar, null),
22496
+ title: translations.scheduled
22497
+ };
22498
+
22499
+ case "uncollectible":
22500
+ return {
22501
+ textColor: "plc-text-red-700",
22502
+ bgColor: "plc-bg-red-100",
22503
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22504
+ title: translations.uncollectible
22505
+ };
22506
+
22507
+ case "void":
22508
+ return {
22509
+ textColor: "plc-text-gray-700",
22510
+ bgColor: "plc-bg-gray-100",
22511
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22512
+ title: translations.void
22513
+ };
22514
+ }
22515
+ }
22516
+
22160
22517
  const SUB_MENUS = {
22161
22518
  PROFILE: "profile",
22162
22519
  SUBSCRIPTIONS: "subscriptions",
@@ -22710,6 +23067,12 @@ class Dashboard extends Component {
22710
23067
  icon: /*#__PURE__*/React__default.createElement(SvgShopping, null),
22711
23068
  title: this.locale("labels.orders.label"),
22712
23069
  content: /*#__PURE__*/React__default.createElement(OrdersMenu, null)
23070
+ }), /*#__PURE__*/React__default.createElement(Accordion.item, {
23071
+ show: hasInvoices(),
23072
+ name: SUB_MENUS.INVOICES,
23073
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, null),
23074
+ title: this.locale("labels.invoices"),
23075
+ content: /*#__PURE__*/React__default.createElement(InvoicesMenu, null)
22713
23076
  }), /*#__PURE__*/React__default.createElement(Accordion.item, {
22714
23077
  name: SUB_MENUS.SAVED_ITEMS,
22715
23078
  icon: /*#__PURE__*/React__default.createElement(SvgBookmark, null),
@@ -22725,6 +23088,13 @@ class Dashboard extends Component {
22725
23088
 
22726
23089
  }
22727
23090
 
23091
+ function hasInvoices() {
23092
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
23093
+
23094
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
23095
+ return invoices.length > 0;
23096
+ }
23097
+
22728
23098
  function hasDonationSubs() {
22729
23099
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22730
23100