@mxenabled/connect-widget 0.9.2 → 0.9.3

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
@@ -45396,15 +45396,30 @@ const getMemberByGuid = (members, guid) => {
45396
45396
  if (guid === "") return {};
45397
45397
  return _find(members, { guid }) || {};
45398
45398
  };
45399
+ const getConnectSlice = createSelector(
45400
+ (state) => state,
45401
+ (state) => state.connect
45402
+ );
45403
+ const getMembersRaw = createSelector(getConnectSlice, (slice) => slice.members);
45399
45404
  const getCurrentMember = createSelector(
45400
- (state) => state.connect.members,
45405
+ getMembersRaw,
45401
45406
  (state) => state.connect.currentMemberGuid,
45402
45407
  getMemberByGuid
45403
45408
  );
45404
45409
  const getMembers = createSelector(
45405
- (state) => state.connect.members,
45410
+ getMembersRaw,
45406
45411
  (members) => members?.filter((member) => !(member.connection_status === ReadableStatuses$1.PENDING)) ?? []
45407
45412
  );
45413
+ const getSelectedInstitution = createSelector(
45414
+ getConnectSlice,
45415
+ (slice) => slice.selectedInstitution
45416
+ );
45417
+ const getSelectedInstitutionUcpInstitutionId = createSelector(
45418
+ getSelectedInstitution,
45419
+ (selectedInstitution) => {
45420
+ return selectedInstitution?.ucpInstitutionId;
45421
+ }
45422
+ );
45408
45423
 
45409
45424
  const Lock = createSvgIcon$2(({ color }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
45410
45425
  "path",
@@ -65685,7 +65700,7 @@ const DisclosureInterstitial = React__default.forwardRef((props, interstitialNav
65685
65700
  const tokens = useTokens();
65686
65701
  const styles = getStyles$F(tokens);
65687
65702
  const getNextDelay = getDelay();
65688
- const institution = useSelector((state) => state.connect.selectedInstitution);
65703
+ const institution = useSelector(getSelectedInstitution);
65689
65704
  const appName = useSelector((state) => state.profiles.client.oauth_app_name || null);
65690
65705
  const [currentView, setCurrentView] = useState(VIEWS$1.INTERSTITIAL_DISCLOSURE);
65691
65706
  useImperativeHandle(interstitialNavRef, () => {
@@ -66085,7 +66100,7 @@ const OAuthError = React__default.forwardRef((props, navigationRef) => {
66085
66100
  const { currentMember, onRetry, onReturnToSearch } = props;
66086
66101
  const postMessageFunctions = useContext(PostMessageContext);
66087
66102
  const errorReason = useSelector((state) => state.connect.oauthErrorReason);
66088
- const selectedInstitution = useSelector((state) => state.connect.selectedInstitution);
66103
+ const selectedInstitution = useSelector(getSelectedInstitution);
66089
66104
  const tokens = useTokens();
66090
66105
  const styles = getStyles$E(tokens);
66091
66106
  const getNextDelay = getDelay();
@@ -66329,7 +66344,7 @@ const Credentials = React__default.forwardRef(
66329
66344
  const { handleBlur, handleFocus, handleSpaceValidation, PasswordShowButton, validations } = usePasswordInputValidation();
66330
66345
  const connectConfig = useSelector(selectConnectConfig);
66331
66346
  useSelector((state) => state.browser.size) === "small";
66332
- const institution = useSelector((state) => state.connect.selectedInstitution);
66347
+ const institution = useSelector(getSelectedInstitution);
66333
66348
  const showExternalLinkPopup = useSelector(
66334
66349
  (state) => state.profiles.clientProfile.show_external_link_popup
66335
66350
  );
@@ -66776,7 +66791,7 @@ Credentials.displayName = "Credentials";
66776
66791
 
66777
66792
  const UpdateMemberForm = (props) => {
66778
66793
  useAnalyticsPath(...PageviewInfo.CONNECT_UPDATE_CREDENTIALS);
66779
- const institution = useSelector((state2) => state2.connect.selectedInstitution);
66794
+ const institution = useSelector(getSelectedInstitution);
66780
66795
  const currentMember = useSelector(getCurrentMember);
66781
66796
  const config = useSelector(selectConfig);
66782
66797
  const isHuman = useSelector((state2) => state2.app.humanEvent);
@@ -66854,7 +66869,7 @@ UpdateMemberForm.propTypes = {
66854
66869
  };
66855
66870
 
66856
66871
  const CreateMemberForm = (props) => {
66857
- const institution = useSelector((state2) => state2.connect.selectedInstitution);
66872
+ const institution = useSelector(getSelectedInstitution);
66858
66873
  useAnalyticsPath(...PageviewInfo.CONNECT_CREATE_CREDENTIALS, {
66859
66874
  institution_guid: institution.guid,
66860
66875
  institution_name: institution.name
@@ -67312,6 +67327,7 @@ const Connecting = (props) => {
67312
67327
  const styles = getStyles$B(tokens);
67313
67328
  const getNextDelay = getDelay();
67314
67329
  const dispatch = useDispatch();
67330
+ const ucpInstitutionId = useSelector(getSelectedInstitutionUcpInstitutionId);
67315
67331
  const analyticFunctions = useContext(AnalyticContext);
67316
67332
  const postMessageFunctions = useContext(PostMessageContext);
67317
67333
  const connectingRef = useRef(null);
@@ -67344,6 +67360,9 @@ const Connecting = (props) => {
67344
67360
  if (currentMember.aggregator) {
67345
67361
  event.aggregator = currentMember.aggregator;
67346
67362
  }
67363
+ if (ucpInstitutionId) {
67364
+ event.ucpInstitutionId = ucpInstitutionId;
67365
+ }
67347
67366
  postMessageFunctions.onPostMessage(POST_MESSAGES.MEMBER_CONNECTED, event);
67348
67367
  analyticFunctions.onAnalyticEvent(`connect_${POST_MESSAGES.MEMBER_CONNECTED}`, {
67349
67368
  type: connectConfig.is_mobile_webview ? "url" : "message"
@@ -67812,7 +67831,7 @@ const NoEligibleAccounts = () => {
67812
67831
  const postMessageFunctions = useContext(PostMessageContext);
67813
67832
  const dispatch = useDispatch();
67814
67833
  const currentMember = useSelector(getCurrentMember);
67815
- const selectedInstitution = useSelector((state) => state.connect.selectedInstitution);
67834
+ const selectedInstitution = useSelector(getSelectedInstitution);
67816
67835
  const postHogEventMetadata = {
67817
67836
  authentication_method: currentMember.is_oauth ? AuthenticationMethods.OAUTH : AuthenticationMethods.NON_OAUTH,
67818
67837
  institution_guid: selectedInstitution.guid,
@@ -72449,7 +72468,7 @@ const RenderConnectStep = (props) => {
72449
72468
  );
72450
72469
  const connectedMembers = useSelector(getMembers);
72451
72470
  const currentMember = useSelector(getCurrentMember);
72452
- const selectedInstitution = useSelector((state) => state.connect.selectedInstitution);
72471
+ const selectedInstitution = useSelector(getSelectedInstitution);
72453
72472
  const updateCredentials = useSelector((state) => state.connect.updateCredentials);
72454
72473
  const verifyMemberError = useSelector((state) => state.connect.error);
72455
72474
  const { handleSelectInstitution } = useSelectInstitution();