@mxenabled/connect-widget 2.15.4 → 2.15.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -5099,39 +5099,23 @@ function baseFindIndex$2(array, predicate, fromIndex, fromRight) {
5099
5099
  }
5100
5100
  var _baseFindIndex = baseFindIndex$2;
5101
5101
 
5102
- var _trimmedEndIndex;
5103
- var hasRequired_trimmedEndIndex;
5104
-
5105
- function require_trimmedEndIndex () {
5106
- if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
5107
- hasRequired_trimmedEndIndex = 1;
5108
- var reWhitespace = /\s/;
5109
- function trimmedEndIndex(string) {
5110
- var index = string.length;
5111
- while (index-- && reWhitespace.test(string.charAt(index))) {
5112
- }
5113
- return index;
5114
- }
5115
- _trimmedEndIndex = trimmedEndIndex;
5116
- return _trimmedEndIndex;
5102
+ var reWhitespace = /\s/;
5103
+ function trimmedEndIndex$1(string) {
5104
+ var index = string.length;
5105
+ while (index-- && reWhitespace.test(string.charAt(index))) {
5106
+ }
5107
+ return index;
5117
5108
  }
5109
+ var _trimmedEndIndex = trimmedEndIndex$1;
5118
5110
 
5119
- var _baseTrim;
5120
- var hasRequired_baseTrim;
5121
-
5122
- function require_baseTrim () {
5123
- if (hasRequired_baseTrim) return _baseTrim;
5124
- hasRequired_baseTrim = 1;
5125
- var trimmedEndIndex = require_trimmedEndIndex();
5126
- var reTrimStart = /^\s+/;
5127
- function baseTrim(string) {
5128
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5129
- }
5130
- _baseTrim = baseTrim;
5131
- return _baseTrim;
5111
+ var trimmedEndIndex = _trimmedEndIndex;
5112
+ var reTrimStart = /^\s+/;
5113
+ function baseTrim$1(string) {
5114
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5132
5115
  }
5116
+ var _baseTrim = baseTrim$1;
5133
5117
 
5134
- var baseTrim = require_baseTrim(), isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5118
+ var baseTrim = _baseTrim, isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5135
5119
  var NAN = 0 / 0;
5136
5120
  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
5137
5121
  var reIsBinary = /^0b[01]+$/i;
@@ -8613,7 +8597,7 @@ var hasRequiredTrim;
8613
8597
  function requireTrim () {
8614
8598
  if (hasRequiredTrim) return trim_1;
8615
8599
  hasRequiredTrim = 1;
8616
- var baseToString = _baseToString, baseTrim = require_baseTrim(), castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8600
+ var baseToString = _baseToString, baseTrim = _baseTrim, castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8617
8601
  function trim(string, chars, guard) {
8618
8602
  string = toString(string);
8619
8603
  if (string && (guard || chars === void 0)) {
@@ -9367,6 +9351,7 @@ const loadConnectSuccess = (state, action) => {
9367
9351
  microdeposit,
9368
9352
  config = {},
9369
9353
  institution = {},
9354
+ experimentalFeatures = {},
9370
9355
  widgetProfile
9371
9356
  } = action.payload;
9372
9357
  return {
@@ -9376,7 +9361,15 @@ const loadConnectSuccess = (state, action) => {
9376
9361
  isComponentLoading: false,
9377
9362
  location: pushLocation(
9378
9363
  state.location,
9379
- getStartingStep(members, member, microdeposit, config, institution, widgetProfile)
9364
+ getStartingStep(
9365
+ members,
9366
+ member,
9367
+ microdeposit,
9368
+ config,
9369
+ institution,
9370
+ widgetProfile,
9371
+ experimentalFeatures
9372
+ )
9380
9373
  ),
9381
9374
  selectedInstitution: institution,
9382
9375
  updateCredentials: member?.connection_status === ReadableStatuses$1.DENIED || state.updateCredentials,
@@ -9728,13 +9721,17 @@ const upsertMember = (state, action) => {
9728
9721
  }
9729
9722
  return [...state.members, loadedMember];
9730
9723
  };
9731
- function getStartingStep(members, member, microdeposit, config, institution, widgetProfile) {
9724
+ function getStartingStep(members, member, microdeposit, config, institution, widgetProfile, experimentalFeatures = {}) {
9725
+ const unavailableInstitutions = experimentalFeatures?.unavailableInstitutions || [];
9726
+ const institutionIsAvailable = institution && unavailableInstitutions.find(
9727
+ (ins) => ins.guid === institution?.guid || ins.name === institution?.name
9728
+ ) === void 0;
9732
9729
  const shouldStepToMFA = member && config.update_credentials && member.connection_status === ReadableStatuses$1.CHALLENGED;
9733
9730
  const shouldUpdateCredentials = member && (config.update_credentials || member.connection_status === ReadableStatuses$1.DENIED);
9734
9731
  const shouldStepToMicrodeposits = config.current_microdeposit_guid && config.mode === VERIFY_MODE && microdeposit.status !== MicrodepositsStatuses.PREINITIATED;
9735
- const shouldLoadWithInstitution = institution && (config.current_institution_guid || config.current_institution_code);
9732
+ const shouldLoadWithInstitution = institution && (config.current_institution_guid || config.current_institution_code) && institutionIsAvailable;
9736
9733
  const shouldStepToConnecting = member?.connection_status === ReadableStatuses$1.REJECTED || member?.connection_status === ReadableStatuses$1.EXPIRED;
9737
- const shouldStepToInstitutionStatusDetails = institution && institutionIsBlockedForCostReasons(institution) || member && memberIsBlockedForCostReasons(member);
9734
+ const shouldStepToInstitutionStatusDetails = institution && institutionIsBlockedForCostReasons(institution) || member && memberIsBlockedForCostReasons(member) || !institutionIsAvailable;
9738
9735
  if (shouldStepToInstitutionStatusDetails) {
9739
9736
  return STEPS.INSTITUTION_STATUS_DETAILS;
9740
9737
  } else if (shouldStepToMFA)
@@ -87531,6 +87528,7 @@ const getErrorResource = (err) => {
87531
87528
  const useLoadConnect = () => {
87532
87529
  const { api } = useApi();
87533
87530
  const profiles = useSelector((state) => state.profiles);
87531
+ const experimentalFeatures = useSelector(getExperimentalFeatures);
87534
87532
  const clientLocale = useMemo(() => {
87535
87533
  return document.querySelector("html")?.getAttribute("lang") || "en";
87536
87534
  }, [document.querySelector("html")?.getAttribute("lang")]);
@@ -87557,6 +87555,7 @@ const useLoadConnect = () => {
87557
87555
  return from(api.loadMembers(clientLocale)).pipe(
87558
87556
  map(
87559
87557
  (members = []) => loadConnectSuccess$1({
87558
+ experimentalFeatures,
87560
87559
  members,
87561
87560
  widgetProfile: profiles.widgetProfile,
87562
87561
  ...dependencies