@mx-cartographer/experiences 6.11.1-alpha.mega2 → 6.11.1-alpha.mega4

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
@@ -12763,30 +12763,36 @@ const Gm = (e, n) => {
12763
12763
  addRetirementGoalAccount: a,
12764
12764
  newRetirementGoalAccounts: o,
12765
12765
  retirementGoalAccounts: r,
12766
- setAlert: s,
12767
- setNewRetirementGoalAccounts: c
12768
- } = ot(), [d, u] = h.useState(!1), _ = !e.guid, g = i.filter(
12769
- (f) => _ ? o.find((E) => E.account_guid === f.guid) : r.find((E) => E.account_guid === f.guid)
12770
- ), m = i.filter(
12771
- (f) => !r.find((E) => E.account_guid === f.guid)
12772
- ), C = async (f) => {
12773
- const E = f.map((b) => ({
12774
- account_guid: b.guid,
12766
+ selectedGoal: s,
12767
+ setAlert: c,
12768
+ setNewRetirementGoalAccounts: d,
12769
+ setSelectedGoal: u
12770
+ } = ot(), [_, g] = h.useState(!1), m = !e.guid, C = i.filter(
12771
+ (b) => m ? o.find((S) => S.account_guid === b.guid) : r.find((S) => S.account_guid === b.guid)
12772
+ ), f = i.filter(
12773
+ (b) => !r.find((S) => S.account_guid === b.guid)
12774
+ ), E = async (b) => {
12775
+ console.log(JSON.parse(JSON.stringify(b)));
12776
+ const S = b.map((A) => ({
12777
+ account_guid: A.guid,
12775
12778
  retirement_goal_guid: e.guid
12776
12779
  }));
12777
- if (_)
12778
- c(E);
12780
+ if (m)
12781
+ d(S);
12779
12782
  else
12780
- for (const b of E)
12781
- await a(b), s(n.alert_account_added);
12782
- u(!1);
12783
+ for (const A of S)
12784
+ await a(A), c(n.alert_account_added);
12785
+ u({
12786
+ ...s,
12787
+ current_amount: b.reduce((A, v) => A + (v.balance || 0), 0)
12788
+ }), g(!1);
12783
12789
  };
12784
12790
  return /* @__PURE__ */ l(y, { children: [
12785
- g.map((f) => /* @__PURE__ */ l(y, { children: [
12786
- /* @__PURE__ */ t(_c, { account: f }),
12791
+ C.map((b) => /* @__PURE__ */ l(y, { children: [
12792
+ /* @__PURE__ */ t(_c, { account: b }),
12787
12793
  /* @__PURE__ */ t(P, {})
12788
- ] }, f.guid)),
12789
- /* @__PURE__ */ t(Y, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ l(ue, { onClick: () => u(!0), children: [
12794
+ ] }, b.guid)),
12795
+ /* @__PURE__ */ t(Y, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ l(ue, { onClick: () => g(!0), children: [
12790
12796
  /* @__PURE__ */ t(se, { children: /* @__PURE__ */ l(y, { alignItems: "center", color: "action.active", direction: "row", gap: 8, children: [
12791
12797
  /* @__PURE__ */ t(as, { filled: !0 }),
12792
12798
  n.details_add_account
@@ -12796,10 +12802,10 @@ const Gm = (e, n) => {
12796
12802
  /* @__PURE__ */ t(
12797
12803
  dc,
12798
12804
  {
12799
- accounts: m,
12800
- isOpen: d,
12801
- onClose: () => u(!1),
12802
- onSave: C,
12805
+ accounts: f,
12806
+ isOpen: _,
12807
+ onClose: () => g(!1),
12808
+ onSave: E,
12803
12809
  title: n.add_select_accounts
12804
12810
  }
12805
12811
  )