@mxenabled/connect-widget 2.18.1 → 2.19.0

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.es.js CHANGED
@@ -5269,39 +5269,23 @@ function baseFindIndex$2(array, predicate, fromIndex, fromRight) {
5269
5269
  }
5270
5270
  var _baseFindIndex = baseFindIndex$2;
5271
5271
 
5272
- var _trimmedEndIndex;
5273
- var hasRequired_trimmedEndIndex;
5274
-
5275
- function require_trimmedEndIndex () {
5276
- if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
5277
- hasRequired_trimmedEndIndex = 1;
5278
- var reWhitespace = /\s/;
5279
- function trimmedEndIndex(string) {
5280
- var index = string.length;
5281
- while (index-- && reWhitespace.test(string.charAt(index))) {
5282
- }
5283
- return index;
5284
- }
5285
- _trimmedEndIndex = trimmedEndIndex;
5286
- return _trimmedEndIndex;
5272
+ var reWhitespace = /\s/;
5273
+ function trimmedEndIndex$1(string) {
5274
+ var index = string.length;
5275
+ while (index-- && reWhitespace.test(string.charAt(index))) {
5276
+ }
5277
+ return index;
5287
5278
  }
5279
+ var _trimmedEndIndex = trimmedEndIndex$1;
5288
5280
 
5289
- var _baseTrim;
5290
- var hasRequired_baseTrim;
5291
-
5292
- function require_baseTrim () {
5293
- if (hasRequired_baseTrim) return _baseTrim;
5294
- hasRequired_baseTrim = 1;
5295
- var trimmedEndIndex = require_trimmedEndIndex();
5296
- var reTrimStart = /^\s+/;
5297
- function baseTrim(string) {
5298
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5299
- }
5300
- _baseTrim = baseTrim;
5301
- return _baseTrim;
5281
+ var trimmedEndIndex = _trimmedEndIndex;
5282
+ var reTrimStart = /^\s+/;
5283
+ function baseTrim$1(string) {
5284
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5302
5285
  }
5286
+ var _baseTrim = baseTrim$1;
5303
5287
 
5304
- var baseTrim = require_baseTrim(), isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5288
+ var baseTrim = _baseTrim, isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5305
5289
  var NAN = 0 / 0;
5306
5290
  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
5307
5291
  var reIsBinary = /^0b[01]+$/i;
@@ -5420,7 +5404,8 @@ const ActionTypes$2 = {
5420
5404
  MFA_CONNECT_SUBMIT_SUCCESS: "connect/mfa_connect_submit_success",
5421
5405
  LOGIN_ERROR_START_OVER: "connect/login_error_start_over",
5422
5406
  CONNECT_GO_BACK: "connect/go_back",
5423
- REJECT_ADDITIONAL_PRODUCT: "connect/reject_additional_product"
5407
+ REJECT_ADDITIONAL_PRODUCT: "connect/reject_additional_product",
5408
+ DEMO_CONNECT_GUARD_RETURN_TO_SEARCH: "connect/demo_connect_guard_return_to_search"
5424
5409
  };
5425
5410
  const loadConnect$1 = (config = {}) => ({ type: ActionTypes$2.LOAD_CONNECT, payload: config });
5426
5411
  const loadConnectSuccess$1 = (dependencies = {}) => ({
@@ -5541,6 +5526,7 @@ const STEPS = {
5541
5526
  CONNECTING: "connecting",
5542
5527
  CONSENT: "consent",
5543
5528
  DELETE_MEMBER_SUCCESS: "deleteMemberSuccess",
5529
+ DEMO_CONNECT_GUARD: "demoConnectGuard",
5544
5530
  DISCLOSURE: "disclosure",
5545
5531
  ENTER_CREDENTIALS: "enterCreds",
5546
5532
  INSTITUTION_STATUS_DETAILS: "institutionStatusDetails",
@@ -8783,7 +8769,7 @@ var hasRequiredTrim;
8783
8769
  function requireTrim () {
8784
8770
  if (hasRequiredTrim) return trim_1;
8785
8771
  hasRequiredTrim = 1;
8786
- var baseToString = _baseToString, baseTrim = require_baseTrim(), castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8772
+ var baseToString = _baseToString, baseTrim = _baseTrim, castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8787
8773
  function trim(string, chars, guard) {
8788
8774
  string = toString(string);
8789
8775
  if (string && (guard || chars === void 0)) {
@@ -8801,6 +8787,9 @@ function requireTrim () {
8801
8787
 
8802
8788
  var convert = convert_1, func = convert("trimChars", requireTrim());
8803
8789
  func.placeholder = requirePlaceholder();
8790
+ var trimChars = func;
8791
+
8792
+ const trimChars$1 = /*@__PURE__*/getDefaultExportFromCjs(trimChars);
8804
8793
 
8805
8794
  /*! gettext.js - Guillaume Potier - MIT Licensed */
8806
8795
  var i18n$1 = function(options) {
@@ -8982,10 +8971,17 @@ const getLocale = i18n.getLocale.bind(i18n);
8982
8971
  const setLocale = i18n.setLocale.bind(i18n);
8983
8972
  const loadJSON = i18n.loadJSON.bind(i18n);
8984
8973
  i18n.setMessages.bind(i18n);
8985
- ({
8974
+ const r$2 = /(\*[^*]*\*)/;
8975
+ const B$2 = ({ boldTag = "strong", children, ...rest }) => {
8976
+ const ret = children.split(r$2);
8977
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: ret.length === 0 ? children : ret.map(
8978
+ (x) => x[0] === "*" ? React__default.createElement(boldTag, { key: x, ...rest }, trimChars$1("*", x)) : x
8979
+ ) });
8980
+ };
8981
+ B$2.propTypes = {
8986
8982
  boldTag: PropTypes$1.oneOfType([PropTypes$1.node, PropTypes$1.func, PropTypes$1.string]),
8987
8983
  children: PropTypes$1.string.isRequired
8988
- });
8984
+ };
8989
8985
 
8990
8986
  const JOB_TYPES = {
8991
8987
  AGGREGATION: 0,
@@ -9716,6 +9712,8 @@ const selectInstitutionSuccess = (state, action) => {
9716
9712
  const canOfferAggregation = action.payload.additionalProductOption === COMBO_JOB_DATA_TYPES.TRANSACTIONS;
9717
9713
  if (action.payload.institution && (institutionIsBlockedForCostReasons(action.payload.institution) || action.payload.institutionStatus === InstitutionStatus.UNAVAILABLE)) {
9718
9714
  nextStep = STEPS.INSTITUTION_STATUS_DETAILS;
9715
+ } else if (action.payload.user?.is_demo && !action.payload.institution?.is_demo) {
9716
+ nextStep = STEPS.DEMO_CONNECT_GUARD;
9719
9717
  } else if (canOfferVerification || canOfferAggregation) {
9720
9718
  nextStep = STEPS.ADDITIONAL_PRODUCT;
9721
9719
  } else if (action.payload.consentIsEnabled) {
@@ -10032,6 +10030,7 @@ const connect = createReducer(defaultState$1, {
10032
10030
  [ActionTypes$2.ADD_MANUAL_ACCOUNT_SUCCESS]: addManualAccount,
10033
10031
  [ActionTypes$2.LOGIN_ERROR_START_OVER]: loginErrorStartOver,
10034
10032
  [ActionTypes$2.CONNECT_GO_BACK]: connectGoBack,
10033
+ [ActionTypes$2.DEMO_CONNECT_GUARD_RETURN_TO_SEARCH]: goBackSearchOrVerify,
10035
10034
  // Addtional product offer / step up reducers
10036
10035
  // These are here to manage changing the location/step of the widget
10037
10036
  [ActionTypes$2.REJECT_ADDITIONAL_PRODUCT]: continueAfterAdditionalProduct,
@@ -33092,7 +33091,7 @@ process.env.NODE_ENV !== "production" ? MenuList$1.propTypes = {
33092
33091
  function getStyleValue$1(value) {
33093
33092
  return parseInt(value, 10) || 0;
33094
33093
  }
33095
- const styles$6 = {
33094
+ const styles$7 = {
33096
33095
  shadow: {
33097
33096
  // Visibility needed to hide the extra text area on iPads
33098
33097
  visibility: "hidden",
@@ -33252,7 +33251,7 @@ const TextareaAutosize$1 = /* @__PURE__ */ React$1.forwardRef(function TextareaA
33252
33251
  ref: hiddenTextareaRef,
33253
33252
  tabIndex: -1,
33254
33253
  style: {
33255
- ...styles$6.shadow,
33254
+ ...styles$7.shadow,
33256
33255
  ...style,
33257
33256
  paddingTop: 0,
33258
33257
  paddingBottom: 0
@@ -36385,7 +36384,7 @@ function getTransitionProps$1(props, options) {
36385
36384
  function getScale$1(value) {
36386
36385
  return `scale(${value}, ${value ** 2})`;
36387
36386
  }
36388
- const styles$5 = {
36387
+ const styles$6 = {
36389
36388
  entering: {
36390
36389
  opacity: 1,
36391
36390
  transform: getScale$1(1)
@@ -36529,7 +36528,7 @@ const Grow$1 = /* @__PURE__ */ React$1.forwardRef(function Grow2(props, ref) {
36529
36528
  opacity: 0,
36530
36529
  transform: getScale$1(0.75),
36531
36530
  visibility: state === "exited" && !inProp ? "hidden" : void 0,
36532
- ...styles$5[state],
36531
+ ...styles$6[state],
36533
36532
  ...style,
36534
36533
  ...children.props.style
36535
36534
  },
@@ -37133,7 +37132,7 @@ if (process.env.NODE_ENV !== "production") {
37133
37132
  Portal$1["propTypes"] = exactProp$1(Portal$1.propTypes);
37134
37133
  }
37135
37134
 
37136
- const styles$4 = {
37135
+ const styles$5 = {
37137
37136
  entering: {
37138
37137
  opacity: 1
37139
37138
  },
@@ -37236,7 +37235,7 @@ const Fade$1 = /* @__PURE__ */ React$1.forwardRef(function Fade2(props, ref) {
37236
37235
  style: {
37237
37236
  opacity: 0,
37238
37237
  visibility: state === "exited" && !inProp ? "hidden" : void 0,
37239
- ...styles$4[state],
37238
+ ...styles$5[state],
37240
37239
  ...style,
37241
37240
  ...children.props.style
37242
37241
  },
@@ -46447,7 +46446,7 @@ if (process.env.NODE_ENV !== "production") {
46447
46446
  }
46448
46447
 
46449
46448
  const _excluded$q = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
46450
- const styles$3 = {
46449
+ const styles$4 = {
46451
46450
  entering: {
46452
46451
  opacity: 1
46453
46452
  },
@@ -46546,7 +46545,7 @@ const Fade = /* @__PURE__ */ React$1.forwardRef(function Fade2(props, ref) {
46546
46545
  style: _extends$1({
46547
46546
  opacity: 0,
46548
46547
  visibility: state === "exited" && !inProp ? "hidden" : void 0
46549
- }, styles$3[state], style, children.props.style),
46548
+ }, styles$4[state], style, children.props.style),
46550
46549
  ref: handleRef
46551
46550
  }, childProps));
46552
46551
  }
@@ -47455,7 +47454,7 @@ const _excluded$m = ["onChange", "maxRows", "minRows", "style", "value"];
47455
47454
  function getStyleValue(value) {
47456
47455
  return parseInt(value, 10) || 0;
47457
47456
  }
47458
- const styles$2 = {
47457
+ const styles$3 = {
47459
47458
  shadow: {
47460
47459
  // Visibility needed to hide the extra text area on iPads
47461
47460
  visibility: "hidden",
@@ -47612,7 +47611,7 @@ const TextareaAutosize = /* @__PURE__ */ React$1.forwardRef(function TextareaAut
47612
47611
  readOnly: true,
47613
47612
  ref: hiddenTextareaRef,
47614
47613
  tabIndex: -1,
47615
- style: _extends$1({}, styles$2.shadow, style, {
47614
+ style: _extends$1({}, styles$3.shadow, style, {
47616
47615
  paddingTop: 0,
47617
47616
  paddingBottom: 0
47618
47617
  })
@@ -50722,7 +50721,7 @@ const _excluded$a = ["addEndListener", "appear", "children", "easing", "in", "on
50722
50721
  function getScale(value) {
50723
50722
  return `scale(${value}, ${value ** 2})`;
50724
50723
  }
50725
- const styles$1 = {
50724
+ const styles$2 = {
50726
50725
  entering: {
50727
50726
  opacity: 1,
50728
50727
  transform: getScale(1)
@@ -50862,7 +50861,7 @@ const Grow = /* @__PURE__ */ React$1.forwardRef(function Grow2(props, ref) {
50862
50861
  opacity: 0,
50863
50862
  transform: getScale(0.75),
50864
50863
  visibility: state === "exited" && !inProp ? "hidden" : void 0
50865
- }, styles$1[state], style, children.props.style),
50864
+ }, styles$2[state], style, children.props.style),
50866
50865
  ref: handleRef
50867
50866
  }, childProps));
50868
50867
  }
@@ -69554,6 +69553,7 @@ const useSelectInstitution = () => {
69554
69553
  const dispatch = useDispatch();
69555
69554
  const consentIsEnabled = useSelector((state) => isConsentEnabled(state));
69556
69555
  const connectConfig = useSelector(selectConnectConfig);
69556
+ const user = useSelector((state) => state.profiles.user);
69557
69557
  const handleSelectInstitution = useCallback(
69558
69558
  (institution2) => {
69559
69559
  setInstitution(institution2);
@@ -69575,7 +69575,8 @@ const useSelectInstitution = () => {
69575
69575
  },
69576
69576
  institutionStatus,
69577
69577
  consentIsEnabled: consentIsEnabled || false,
69578
- additionalProductOption: connectConfig?.additional_product_option || null
69578
+ additionalProductOption: connectConfig?.additional_product_option || null,
69579
+ user
69579
69580
  }
69580
69581
  });
69581
69582
  }),
@@ -72609,9 +72610,9 @@ const focusElement = (element) => {
72609
72610
  }
72610
72611
  };
72611
72612
 
72612
- const container = "_container_1pcxm_1";
72613
- const styles = {
72614
- container: container
72613
+ const container$1 = "_container_1pcxm_1";
72614
+ const styles$1 = {
72615
+ container: container$1
72615
72616
  };
72616
72617
 
72617
72618
  const initialState$1 = {
@@ -72849,7 +72850,7 @@ const Search$2 = React__default.forwardRef((_, navigationRef) => {
72849
72850
  }
72850
72851
  );
72851
72852
  }
72852
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.container, children: [
72853
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.container, children: [
72853
72854
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: inlineStyles.searchBar, children: [
72854
72855
  /* @__PURE__ */ jsxRuntimeExports.jsx(
72855
72856
  L,
@@ -84471,6 +84472,58 @@ const Actions = {
84471
84472
  HANDLE_SUCCESS: "manualAccount/handleSuccess"
84472
84473
  };
84473
84474
 
84475
+ const container = "_container_hgokd_1";
84476
+ const logoContainer = "_logoContainer_hgokd_10";
84477
+ const icon = "_icon_hgokd_15";
84478
+ const title = "_title_hgokd_25";
84479
+ const body = "_body_hgokd_34";
84480
+ const styles = {
84481
+ container: container,
84482
+ logoContainer: logoContainer,
84483
+ icon: icon,
84484
+ title: title,
84485
+ body: body
84486
+ };
84487
+
84488
+ const DemoConnectGuard = () => {
84489
+ const institution = useSelector(getSelectedInstitution);
84490
+ const initialConfig = useSelector(selectInitialConfig);
84491
+ const dispatch = useDispatch();
84492
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.container, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(SlideDown, { children: [
84493
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.logoContainer, children: [
84494
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
84495
+ Y0,
84496
+ {
84497
+ alt: __("Logo for %1", institution.name),
84498
+ "aria-hidden": true,
84499
+ institutionGuid: institution.guid,
84500
+ logoUrl: institution.logo_url,
84501
+ size: 64
84502
+ }
84503
+ ),
84504
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.icon, children: /* @__PURE__ */ jsxRuntimeExports.jsx(x, { color: "error", fill: true, name: "error", size: 32 }) })
84505
+ ] }),
84506
+ /* @__PURE__ */ jsxRuntimeExports.jsx(U0, { className: styles.title, truncate: false, children: __("Demo mode active") }),
84507
+ /* @__PURE__ */ jsxRuntimeExports.jsx(W0, { className: styles.body, truncate: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(B$2, { children: __(
84508
+ "Live institutions are not available in the demo environment. Please select *MX Bank* to test the connection process."
84509
+ ) }) }),
84510
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
84511
+ Button$2,
84512
+ {
84513
+ fullWidth: true,
84514
+ onClick: () => {
84515
+ dispatch({
84516
+ type: ActionTypes$2.DEMO_CONNECT_GUARD_RETURN_TO_SEARCH,
84517
+ payload: initialConfig
84518
+ });
84519
+ },
84520
+ variant: "contained",
84521
+ children: __("Return to institution selection")
84522
+ }
84523
+ )
84524
+ ] }) });
84525
+ };
84526
+
84474
84527
  const ADDITIONAL_PRODUCT_OPTIONS = [
84475
84528
  COMBO_JOB_DATA_TYPES.TRANSACTIONS,
84476
84529
  COMBO_JOB_DATA_TYPES.ACCOUNT_NUMBER
@@ -85005,6 +85058,8 @@ const RenderConnectStep = (props) => {
85005
85058
  if (!ADDITIONAL_PRODUCT_OPTIONS.includes(connectConfig?.additional_product_option))
85006
85059
  throw new Error("invalid product offer");
85007
85060
  connectStepView = /* @__PURE__ */ jsxRuntimeExports.jsx(AdditionalProductStep, { ref: props.navigationRef });
85061
+ } else if (step === STEPS.DEMO_CONNECT_GUARD) {
85062
+ connectStepView = /* @__PURE__ */ jsxRuntimeExports.jsx(DemoConnectGuard, {});
85008
85063
  } else if (step === STEPS.ADD_MANUAL_ACCOUNT) {
85009
85064
  connectStepView = /* @__PURE__ */ jsxRuntimeExports.jsx(
85010
85065
  ManualAccountConnect,
@@ -88196,6 +88251,8 @@ const frCa = {
88196
88251
  "Profile information": "Informations de profil",
88197
88252
  "Account numbers": "Numéros de compte",
88198
88253
  "To complete your connection, please %1share%2 the following after signing in:": "Pour finaliser votre connexion, veuillez %1partager%2 les informations suivantes après vous être connecté :",
88254
+ "Demo mode active": "Mode démo actif",
88255
+ "Live institutions are not available in the demo environment. Please select *MX Bank* to test the connection process.": "Les établissements réels ne sont pas disponibles dans l'environnement de démonstration. Veuillez sélectionner *MX Bank* pour tester la procédure de connexion.",
88199
88256
  "connect/disclosure/policy/text\u0004By clicking Continue, you agree to the ": "En cliquant sur Continuer, vous acceptez la ",
88200
88257
  "connect/disclosure/policy/link\u0004MX Privacy Policy.": "Politique de confidentialité de MX.",
88201
88258
  "connect/disclosure/policy/link\u0004MX Privacy Policy": "Politique de confidentialité de MX.",
@@ -88709,6 +88766,8 @@ const es = {
88709
88766
  "Profile information": "Información del perfil",
88710
88767
  "Account numbers": "Números de cuenta",
88711
88768
  "To complete your connection, please %1share%2 the following after signing in:": "Para completar su conexión, por favor, %1comparta%2 lo siguiente después de iniciar sesión:",
88769
+ "Demo mode active": "Modo de demostración activo",
88770
+ "Live institutions are not available in the demo environment. Please select *MX Bank* to test the connection process.": "Las instituciones en vivo no están disponibles en el entorno de demostración. Seleccione *MX Bank* para probar el proceso de conexión.",
88712
88771
  "connect/disclosure/button\u0004Continue": "Continuar",
88713
88772
  "connect/disclosure/policy/text\u0004By clicking Continue, you agree to the ": "Al hacer clic en Continuar, tu aceptas la ",
88714
88773
  "connect/disclosure/policy/link\u0004MX Privacy Policy.": "Política de privacidad de Money Experience.",