@tesouro/embedded-components-react 0.2.257 → 0.2.260

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.
@@ -33,7 +33,7 @@ function f({ label: e, value: t, isCopied: n, copyAriaLabel: r, onCopy: a, trail
33
33
  })]
34
34
  });
35
35
  }
36
- function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wireAccountNumberLabel: g, bankNameLabel: _, bankAddressLabel: v, domesticWireIntroLabel: y, domesticWireNoteLabel: b, thingsToKnowBodyLabel: x, supportTeamHref: S, isAccountNumberVisible: C, isAccountNumberCopied: w, isRoutingNumberCopied: T, isDomesticWireExpanded: E, onDomesticWireExpandedChange: D, onToggleAccountNumberVisibility: O, onCopyAccountNumber: k, onCopyRoutingNumber: A, onCopyWireAccountNumber: j, onCopyWireRoutingNumber: M, onCopyBankName: N, onCopyBankAddress: P }) {
36
+ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, accountNumberTestId: g, wireAccountNumberLabel: _, bankNameLabel: v, bankAddressLabel: y, domesticWireIntroLabel: b, domesticWireNoteLabel: x, thingsToKnowBodyLabel: S, supportTeamHref: C, isAccountNumberVisible: w, isAccountNumberCopied: T, isRoutingNumberCopied: E, isDomesticWireExpanded: D, onDomesticWireExpandedChange: O, onToggleAccountNumberVisibility: k, onCopyAccountNumber: A, onCopyRoutingNumber: j, onCopyWireAccountNumber: M, onCopyWireRoutingNumber: N, onCopyBankName: P, onCopyBankAddress: F }) {
37
37
  return /* @__PURE__ */ s("div", {
38
38
  className: "ttw:space-y-6",
39
39
  children: [/* @__PURE__ */ s("section", {
@@ -49,9 +49,9 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
49
49
  children: [/* @__PURE__ */ o(f, {
50
50
  label: p.routingNumberLabel,
51
51
  value: m,
52
- isCopied: T,
52
+ isCopied: E,
53
53
  copyAriaLabel: p.copyLabel,
54
- onCopy: A
54
+ onCopy: j
55
55
  }), /* @__PURE__ */ s("div", {
56
56
  className: "ttw:space-y-1",
57
57
  children: [/* @__PURE__ */ o("p", {
@@ -61,6 +61,7 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
61
61
  className: "ttw:flex ttw:items-center ttw:gap-2",
62
62
  children: [
63
63
  /* @__PURE__ */ o("span", {
64
+ "data-testid": g,
64
65
  className: "ttw:font-medium ttw:tracking-widest",
65
66
  children: h
66
67
  }),
@@ -70,8 +71,8 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
70
71
  size: "icon",
71
72
  className: "ttw:size-7 ttw:text-primary",
72
73
  "aria-label": p.toggleAccountNumberVisibility,
73
- onClick: O,
74
- children: o(C ? d : u, { className: "ttw:size-4" })
74
+ onClick: k,
75
+ children: o(w ? d : u, { className: "ttw:size-4" })
75
76
  }),
76
77
  /* @__PURE__ */ o(i, {
77
78
  type: "button",
@@ -79,8 +80,8 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
79
80
  size: "icon",
80
81
  className: "ttw:size-7 ttw:text-primary",
81
82
  "aria-label": p.copyLabel,
82
- onClick: k,
83
- children: o(w ? c : l, { className: "ttw:size-4" })
83
+ onClick: A,
84
+ children: o(T ? c : l, { className: "ttw:size-4" })
84
85
  })
85
86
  ]
86
87
  })]
@@ -95,8 +96,8 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
95
96
  }), /* @__PURE__ */ o(e, {
96
97
  type: "single",
97
98
  collapsible: !0,
98
- value: E ? "domestic-wire" : "",
99
- onValueChange: (e) => D(e === "domestic-wire"),
99
+ value: D ? "domestic-wire" : "",
100
+ onValueChange: (e) => O(e === "domestic-wire"),
100
101
  className: "ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border",
101
102
  children: /* @__PURE__ */ s(n, {
102
103
  value: "domestic-wire",
@@ -110,11 +111,11 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
110
111
  children: [
111
112
  /* @__PURE__ */ o("p", {
112
113
  className: "ttw:text-sm ttw:text-foreground",
113
- children: y
114
+ children: b
114
115
  }),
115
116
  /* @__PURE__ */ o("p", {
116
117
  className: "ttw:text-sm ttw:text-foreground",
117
- children: b
118
+ children: x
118
119
  }),
119
120
  /* @__PURE__ */ s("div", {
120
121
  className: "ttw:space-y-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-4",
@@ -125,27 +126,27 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
125
126
  }),
126
127
  /* @__PURE__ */ o(f, {
127
128
  label: p.accountNumberLabel,
128
- value: g,
129
+ value: _,
129
130
  copyAriaLabel: p.copyLabel,
130
- onCopy: j
131
+ onCopy: M
131
132
  }),
132
133
  /* @__PURE__ */ o(f, {
133
134
  label: p.routingNumberLabel,
134
135
  value: m,
135
136
  copyAriaLabel: p.copyLabel,
136
- onCopy: M
137
+ onCopy: N
137
138
  }),
138
139
  /* @__PURE__ */ o(f, {
139
140
  label: p.bankNameLabel,
140
- value: _,
141
+ value: v,
141
142
  copyAriaLabel: p.copyLabel,
142
- onCopy: N
143
+ onCopy: P
143
144
  }),
144
- v ? /* @__PURE__ */ o(f, {
145
+ y ? /* @__PURE__ */ o(f, {
145
146
  label: p.bankAddressLabel,
146
- value: v,
147
+ value: y,
147
148
  copyAriaLabel: p.copyLabel,
148
- onCopy: P
149
+ onCopy: F
149
150
  }) : null
150
151
  ]
151
152
  }),
@@ -157,10 +158,10 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
157
158
  children: p.thingsToKnowHeading
158
159
  }),
159
160
  " ",
160
- x
161
+ S
161
162
  ]
162
163
  }),
163
- S ? /* @__PURE__ */ s("p", {
164
+ C ? /* @__PURE__ */ s("p", {
164
165
  className: "ttw:text-sm ttw:text-foreground",
165
166
  children: [
166
167
  p.supportQuestionsPrefix,
@@ -170,7 +171,7 @@ function p({ labels: p, routingNumberLabel: m, accountNumberDisplayLabel: h, wir
170
171
  asChild: !0,
171
172
  className: "ttw:h-auto ttw:p-0 ttw:text-sm ttw:font-normal",
172
173
  children: /* @__PURE__ */ o("a", {
173
- href: S,
174
+ href: C,
174
175
  target: "_blank",
175
176
  rel: "noopener noreferrer",
176
177
  children: p.supportTeamLink
@@ -6,38 +6,38 @@ import { Button as e, Skeleton as t, Tabs as n, TabsContent as r, TabsList as i,
6
6
  import { InlineErrorAlert as d } from "../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
7
7
  import "../../../../shared/ui/dist/index.js";
8
8
  import { DEFAULT_LABELS as f } from "./index7.js";
9
- import { AccountDetailsPanel as p } from "./index2.js";
10
- import { AccountActionsMenu as ee, EditAccountDialog as te } from "./index3.js";
11
- import { ExportTransactionsDialog as ne } from "./index4.js";
12
- import { StatementsPanel as re } from "./index5.js";
13
- import { TransactionsTable as ie } from "./index6.js";
14
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
15
- import { ChevronLeftIcon as _, HelpCircleIcon as v } from "lucide-react";
9
+ import { AccountDetailsPanel as ee } from "./index2.js";
10
+ import { AccountActionsMenu as te, EditAccountDialog as ne } from "./index3.js";
11
+ import { ExportTransactionsDialog as re } from "./index4.js";
12
+ import { StatementsPanel as ie } from "./index5.js";
13
+ import { TransactionsTable as ae } from "./index6.js";
14
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
15
+ import { ChevronLeftIcon as g, HelpCircleIcon as _ } from "lucide-react";
16
16
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index8.js
17
- function y({ labels: y, title: b, bankDisplayName: x, bankLogoSrc: S, bankLogoAlt: C, balanceLabel: w, isBankingTaglineVisible: T, activeTab: E, transactionRows: D, showExport: O, isExportOpen: k, exportStartDate: A, exportEndDate: j, isExportDownloading: M, isExportDownloadDisabled: N, disabledExportStartDates: P, disabledExportEndDates: F, accountNumberLabel: I, maskedAccountNumberLabel: L, routingNumberLabel: R, bankAddressLabel: z, wireAccountNumberLabel: B, domesticWireIntroLabel: V, domesticWireNoteLabel: ae, thingsToKnowBodyLabel: H, supportTeamHref: U, isAccountNumberVisible: W, isAccountNumberCopied: G, isRoutingNumberCopied: K, isDomesticWireExpanded: q, isLoading: J, isError: Y, isEditOpen: oe, isEditDisabled: se, isEditError: ce, isSubmitting: le, editForm: ue, canEdit: de, onBack: fe, onTabChange: pe, onToggleAccountNumberVisibility: me, onCopyAccountNumber: X, onCopyRoutingNumber: Z, onCopyBankName: he, onCopyBankAddress: ge, onDomesticWireExpandedChange: _e, onEditOpenChange: ve, onEditFormChange: ye, onEditSubmit: be, onEditNicknameClick: xe, onExportOpenChange: Q, onExportStartDateChange: Se, onExportEndDateChange: Ce, onExportDownload: we }) {
17
+ function v({ labels: v, title: y, bankDisplayName: b, bankLogoSrc: x, bankLogoAlt: S, balanceLabel: C, balanceTestId: w, isBankingTaglineVisible: T, activeTab: E, transactionRows: D, showExport: O, isExportOpen: k, exportStartDate: A, exportEndDate: j, isExportDownloading: M, isExportDownloadDisabled: N, disabledExportStartDates: P, disabledExportEndDates: F, accountNumberLabel: I, maskedAccountNumberLabel: L, accountNumberTestId: R, routingNumberLabel: z, bankAddressLabel: B, wireAccountNumberLabel: oe, domesticWireIntroLabel: V, domesticWireNoteLabel: H, thingsToKnowBodyLabel: U, supportTeamHref: W, isAccountNumberVisible: G, isAccountNumberCopied: K, isRoutingNumberCopied: q, isDomesticWireExpanded: se, isLoading: J, isError: Y, isEditOpen: ce, isEditDisabled: le, isEditError: ue, isSubmitting: de, editForm: fe, canEdit: pe, onBack: me, onTabChange: he, onToggleAccountNumberVisibility: ge, onCopyAccountNumber: X, onCopyRoutingNumber: Z, onCopyBankName: _e, onCopyBankAddress: ve, onDomesticWireExpandedChange: ye, onEditOpenChange: be, onEditFormChange: xe, onEditSubmit: Se, onEditNicknameClick: Ce, onExportOpenChange: Q, onExportStartDateChange: we, onExportEndDateChange: Te, onExportDownload: Ee }) {
18
18
  let $ = {
19
19
  ...f,
20
- ...y
21
- }, Te = /* @__PURE__ */ g(e, {
20
+ ...v
21
+ }, De = /* @__PURE__ */ h(e, {
22
22
  type: "button",
23
23
  variant: "ghost",
24
24
  className: "ttw:h-auto ttw:justify-start ttw:gap-1 ttw:px-0 ttw:py-1 ttw:has-[>svg]:px-0 ttw:text-sm ttw:font-medium ttw:leading-5 ttw:text-primary ttw:hover:bg-transparent",
25
- onClick: fe,
26
- children: [/* @__PURE__ */ h(_, { className: "ttw:size-4" }), $.backToAccounts]
25
+ onClick: me,
26
+ children: [/* @__PURE__ */ m(g, { className: "ttw:size-4" }), $.backToAccounts]
27
27
  });
28
- return /* @__PURE__ */ g("section", {
28
+ return /* @__PURE__ */ h("section", {
29
29
  className: "ttw:w-full ttw:space-y-4",
30
30
  children: [
31
- !J && !Y ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(te, {
31
+ !J && !Y ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(ne, {
32
32
  labels: $,
33
- open: oe,
34
- form: ue,
35
- isSubmitting: le,
36
- isError: ce,
37
- onOpenChange: ve,
38
- onFormChange: ye,
39
- onSubmit: be
40
- }), /* @__PURE__ */ h(ne, {
33
+ open: ce,
34
+ form: fe,
35
+ isSubmitting: de,
36
+ isError: ue,
37
+ onOpenChange: be,
38
+ onFormChange: xe,
39
+ onSubmit: Se
40
+ }), /* @__PURE__ */ m(re, {
41
41
  labels: $,
42
42
  open: k,
43
43
  startDate: A,
@@ -47,123 +47,125 @@ function y({ labels: y, title: b, bankDisplayName: x, bankLogoSrc: S, bankLogoAl
47
47
  disabledStartDates: P,
48
48
  disabledEndDates: F,
49
49
  onOpenChange: Q,
50
- onStartDateChange: Se,
51
- onEndDateChange: Ce,
52
- onDownload: we
50
+ onStartDateChange: we,
51
+ onEndDateChange: Te,
52
+ onDownload: Ee
53
53
  })] }) : null,
54
- /* @__PURE__ */ g("div", {
54
+ /* @__PURE__ */ h("div", {
55
55
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
56
- children: [Te, !J && !Y ? /* @__PURE__ */ h(ee, {
56
+ children: [De, !J && !Y ? /* @__PURE__ */ m(te, {
57
57
  labels: $,
58
- canEdit: de,
59
- onEditNickname: xe
58
+ canEdit: pe,
59
+ onEditNickname: Ce
60
60
  }) : null]
61
61
  }),
62
- J ? /* @__PURE__ */ g("div", {
62
+ J ? /* @__PURE__ */ h("div", {
63
63
  className: "ttw:space-y-4",
64
64
  "aria-label": $.loadingLabel,
65
- children: [/* @__PURE__ */ h(t, { className: "ttw:h-10 ttw:w-64" }), /* @__PURE__ */ h(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
66
- }) : Y ? /* @__PURE__ */ h(d, { children: $.errorTitle }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
65
+ children: [/* @__PURE__ */ m(t, { className: "ttw:h-10 ttw:w-64" }), /* @__PURE__ */ m(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
66
+ }) : Y ? /* @__PURE__ */ m(d, { children: $.errorTitle }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
67
67
  className: "ttw:space-y-4",
68
- children: [/* @__PURE__ */ g("div", {
68
+ children: [/* @__PURE__ */ h("div", {
69
69
  className: "ttw:space-y-0.5",
70
- children: [/* @__PURE__ */ h(u, {
70
+ children: [/* @__PURE__ */ m(u, {
71
71
  variant: "h2",
72
72
  component: "h1",
73
73
  className: "ttw:leading-9 ttw:tracking-[-0.75px]",
74
- children: b
75
- }), T && x ? /* @__PURE__ */ g("div", {
74
+ children: y
75
+ }), T && b ? /* @__PURE__ */ h("div", {
76
76
  className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-1",
77
- children: [/* @__PURE__ */ h(u, {
77
+ children: [/* @__PURE__ */ m(u, {
78
78
  component: "span",
79
79
  variant: "body2",
80
80
  color: "muted",
81
81
  className: "ttw:text-sm ttw:font-normal ttw:leading-5",
82
82
  children: $.bankingTaglinePrefix
83
- }), S ? /* @__PURE__ */ h("img", {
84
- src: S,
85
- alt: C ?? x,
83
+ }), x ? /* @__PURE__ */ m("img", {
84
+ src: x,
85
+ alt: S ?? b,
86
86
  className: "ttw:block ttw:h-auto ttw:max-w-[120px]"
87
- }) : /* @__PURE__ */ h(u, {
87
+ }) : /* @__PURE__ */ m(u, {
88
88
  component: "span",
89
89
  variant: "body2",
90
90
  color: "muted",
91
91
  className: "ttw:text-sm ttw:font-normal ttw:leading-5",
92
- children: x
92
+ children: b
93
93
  })]
94
94
  }) : null]
95
- }), /* @__PURE__ */ g("div", {
95
+ }), /* @__PURE__ */ h("div", {
96
96
  className: "ttw:space-y-1.5",
97
- children: [/* @__PURE__ */ g("div", {
97
+ children: [/* @__PURE__ */ h("div", {
98
98
  className: "ttw:flex ttw:items-center ttw:gap-1 ttw:text-sm ttw:text-muted-foreground",
99
- children: [/* @__PURE__ */ h("span", { children: $.availableBalanceLabel }), /* @__PURE__ */ h(c, { children: /* @__PURE__ */ g(o, { children: [/* @__PURE__ */ h(l, {
99
+ children: [/* @__PURE__ */ m("span", { children: $.availableBalanceLabel }), /* @__PURE__ */ m(c, { children: /* @__PURE__ */ h(o, { children: [/* @__PURE__ */ m(l, {
100
100
  type: "button",
101
101
  className: "ttw:inline-flex ttw:cursor-help",
102
102
  "aria-label": $.availableBalanceTooltip,
103
- children: /* @__PURE__ */ h(v, { className: "ttw:size-4" })
104
- }), /* @__PURE__ */ h(s, { children: $.availableBalanceTooltip })] }) })]
105
- }), /* @__PURE__ */ h("p", {
103
+ children: /* @__PURE__ */ m(_, { className: "ttw:size-4" })
104
+ }), /* @__PURE__ */ m(s, { children: $.availableBalanceTooltip })] }) })]
105
+ }), /* @__PURE__ */ m("p", {
106
+ "data-testid": w,
106
107
  className: "ttw:text-4xl ttw:font-bold ttw:text-primary",
107
- children: w
108
+ children: C
108
109
  })]
109
110
  })]
110
- }), /* @__PURE__ */ g(n, {
111
+ }), /* @__PURE__ */ h(n, {
111
112
  value: E,
112
- onValueChange: (e) => pe(e),
113
+ onValueChange: (e) => he(e),
113
114
  className: "ttw:gap-4",
114
115
  children: [
115
- /* @__PURE__ */ g(i, { children: [
116
- /* @__PURE__ */ h(a, {
116
+ /* @__PURE__ */ h(i, { children: [
117
+ /* @__PURE__ */ m(a, {
117
118
  value: "transactions",
118
119
  children: $.transactionsTab
119
120
  }),
120
- /* @__PURE__ */ h(a, {
121
+ /* @__PURE__ */ m(a, {
121
122
  value: "statements",
122
123
  children: $.statementsTab
123
124
  }),
124
- /* @__PURE__ */ h(a, {
125
+ /* @__PURE__ */ m(a, {
125
126
  value: "details",
126
127
  children: $.detailsTab
127
128
  })
128
129
  ] }),
129
- /* @__PURE__ */ h(r, {
130
+ /* @__PURE__ */ m(r, {
130
131
  value: "transactions",
131
- children: /* @__PURE__ */ h(ie, {
132
+ children: /* @__PURE__ */ m(ae, {
132
133
  labels: $,
133
134
  rows: D,
134
135
  showExport: O,
135
136
  onExportClick: () => Q(!0)
136
137
  })
137
138
  }),
138
- /* @__PURE__ */ h(r, {
139
+ /* @__PURE__ */ m(r, {
139
140
  value: "statements",
140
- children: /* @__PURE__ */ h(re, { labels: $ })
141
+ children: /* @__PURE__ */ m(ie, { labels: $ })
141
142
  }),
142
- /* @__PURE__ */ h(r, {
143
+ /* @__PURE__ */ m(r, {
143
144
  value: "details",
144
- children: /* @__PURE__ */ h(p, {
145
+ children: /* @__PURE__ */ m(ee, {
145
146
  labels: $,
146
- routingNumberLabel: R,
147
- accountNumberDisplayLabel: W ? I : L,
148
- wireAccountNumberLabel: B,
149
- bankNameLabel: x,
150
- bankAddressLabel: z,
147
+ routingNumberLabel: z,
148
+ accountNumberDisplayLabel: G ? I : L,
149
+ accountNumberTestId: R,
150
+ wireAccountNumberLabel: oe,
151
+ bankNameLabel: b,
152
+ bankAddressLabel: B,
151
153
  domesticWireIntroLabel: V,
152
- domesticWireNoteLabel: ae,
153
- thingsToKnowBodyLabel: H,
154
- supportTeamHref: U,
155
- isAccountNumberVisible: W,
156
- isAccountNumberCopied: G,
157
- isRoutingNumberCopied: K,
158
- isDomesticWireExpanded: q,
159
- onDomesticWireExpandedChange: _e,
160
- onToggleAccountNumberVisibility: me,
154
+ domesticWireNoteLabel: H,
155
+ thingsToKnowBodyLabel: U,
156
+ supportTeamHref: W,
157
+ isAccountNumberVisible: G,
158
+ isAccountNumberCopied: K,
159
+ isRoutingNumberCopied: q,
160
+ isDomesticWireExpanded: se,
161
+ onDomesticWireExpandedChange: ye,
162
+ onToggleAccountNumberVisibility: ge,
161
163
  onCopyAccountNumber: X,
162
164
  onCopyRoutingNumber: Z,
163
165
  onCopyWireAccountNumber: X,
164
166
  onCopyWireRoutingNumber: Z,
165
- onCopyBankName: he,
166
- onCopyBankAddress: ge
167
+ onCopyBankName: _e,
168
+ onCopyBankAddress: ve
167
169
  })
168
170
  })
169
171
  ]
@@ -172,4 +174,4 @@ function y({ labels: y, title: b, bankDisplayName: x, bankLogoSrc: S, bankLogoAl
172
174
  });
173
175
  }
174
176
  //#endregion
175
- export { y as AccountDetailsWidgetUi };
177
+ export { v as AccountDetailsWidgetUi };
@@ -15,15 +15,20 @@ var r = {
15
15
  activate: [t.DebitCardActivateOrg],
16
16
  create: [t.DebitCardIssueOrg]
17
17
  }
18
- }, i = [t.BankAccountReadOrg];
19
- function a({ cardProgram: t, scopes: a }) {
20
- let o = new Set(a ?? []), s = r[t];
18
+ }, i = [t.BankAccountReadOrg], a = {
19
+ users: [t.UserReadOrg],
20
+ roles: [t.RoleReadOrg],
21
+ funding: i
22
+ };
23
+ function o({ cardProgram: t, scopes: o }) {
24
+ let s = new Set(o ?? []), c = r[t];
21
25
  return {
22
- canRead: e(o, s.read),
23
- canActivate: e(o, s.activate),
24
- canCreate: e(o, s.create),
25
- canReadFundingAccounts: t === n.Debit && e(o, i)
26
+ canRead: e(s, c.read),
27
+ canActivate: e(s, c.activate),
28
+ canCreate: e(s, c.create),
29
+ canReadFundingAccounts: t === n.Debit && e(s, i),
30
+ canComposeDebitCreate: t === n.Debit && e(s, a.users) && e(s, a.roles) && e(s, a.funding)
26
31
  };
27
32
  }
28
33
  //#endregion
29
- export { a as getCardsPermissions };
34
+ export { o as getCardsPermissions };
@@ -34,18 +34,18 @@ function l(e) {
34
34
  pageSize: t
35
35
  };
36
36
  }
37
- function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationChange: f, featureLabels: p, selectedCardId: ve, defaultSelectedCardId: ye, onSelectedCardIdChange: be, onCreateCard: m, onActivateCard: h }) {
37
+ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationChange: f, featureLabels: p, selectedCardId: ve, defaultSelectedCardId: ye, onSelectedCardIdChange: be, onCreateCard: m, onActivateCard: h, cardArtSrc: xe }) {
38
38
  let g = a(() => re(p), [p]), _ = t();
39
39
  i(() => {
40
40
  _(ae.Mounted);
41
41
  }, [_]);
42
- let { organizationId: v, widgetToken: xe, initResponse: y } = ee(), b = y?.userId ?? void 0, Se = ne(), x = !!te(), S = !!(v && xe), C = a(() => ie({
42
+ let { organizationId: v, widgetToken: Se, initResponse: y } = ee(), b = y?.userId ?? void 0, Ce = ne(), x = !!te(), S = !!(v && Se), C = a(() => ie({
43
43
  cardProgram: s,
44
44
  scopes: y?.scopes
45
- }), [s, y?.scopes]), w = S && C.canRead && !!y, Ce = a(() => l(u), [u?.pageSize, u?.paginationToken]), T = a(() => l(d), [d?.pageSize, d?.paginationToken]), [E, we] = o(b);
46
- b !== void 0 && b !== E && we(b);
47
- let [D, Te] = o(v);
48
- v !== void 0 && v !== D && Te(v);
45
+ }), [s, y?.scopes]), w = S && C.canRead && !!y, we = a(() => l(u), [u?.pageSize, u?.paginationToken]), T = a(() => l(d), [d?.pageSize, d?.paginationToken]), [E, Te] = o(b);
46
+ b !== void 0 && b !== E && Te(b);
47
+ let [D, Ee] = o(v);
48
+ v !== void 0 && v !== D && Ee(v);
49
49
  let O = [
50
50
  [
51
51
  s,
@@ -58,7 +58,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
58
58
  resetKey: O,
59
59
  paginationToken: T.paginationToken,
60
60
  pageSize: T.pageSize
61
- })), [Ee, De] = o(!1), [Oe, M] = he({
61
+ })), [De, Oe] = o(!1), [ke, M] = he({
62
62
  prop: ve,
63
63
  defaultProp: ye ?? null,
64
64
  onChange: be,
@@ -67,7 +67,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
67
67
  cardProgram: s,
68
68
  organizationId: D,
69
69
  userId: E
70
- }), ke = N.current.cardProgram !== s || c(N.current.organizationId, D) || c(N.current.userId, E);
70
+ }), Ae = N.current.cardProgram !== s || c(N.current.organizationId, D) || c(N.current.userId, E);
71
71
  i(() => {
72
72
  let e = N.current;
73
73
  N.current = {
@@ -83,7 +83,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
83
83
  ]);
84
84
  let P = r((e) => {
85
85
  M(e);
86
- }, [M]), F = Ee && !!b, Ae = A.resetKey === O;
86
+ }, [M]), F = De && !!b, je = A.resetKey === O;
87
87
  i(() => {
88
88
  k || j((e) => e.resetKey === O ? e : {
89
89
  resetKey: O,
@@ -96,9 +96,9 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
96
96
  k,
97
97
  O
98
98
  ]);
99
- let I = k ? Ce : Ae ? A : T, je = I.paginationToken, L = I.pageSize, R = {
99
+ let I = k ? we : je ? A : T, Me = I.paginationToken, L = I.pageSize, R = {
100
100
  limit: L,
101
- paginationToken: je,
101
+ paginationToken: Me,
102
102
  userId: F ? b : void 0
103
103
  }, z = fe({
104
104
  ...R,
@@ -115,12 +115,12 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
115
115
  U.data?.data,
116
116
  g.untitledFundingAccount,
117
117
  C.canReadFundingAccounts
118
- ]), G = H && U.isError, Me = H && !G && (U.isLoading || U.isFetchingNextPage || !!U.hasNextPage), K = a(() => w ? s === n.Credit ? ue(z.data?.data ?? []) : de(B.data?.data ?? []) : [], [
118
+ ]), G = H && U.isError, Ne = H && !G && (U.isLoading || U.isFetchingNextPage || !!U.hasNextPage), K = a(() => w ? s === n.Credit ? ue(z.data?.data ?? []) : de(B.data?.data ?? []) : [], [
119
119
  w,
120
120
  s,
121
121
  z.data?.data,
122
122
  B.data?.data
123
- ]), Ne = a(() => le(K, {
123
+ ]), Pe = a(() => le(K, {
124
124
  labels: g,
125
125
  fundingAccountNames: W,
126
126
  canActivate: C.canActivate,
@@ -133,7 +133,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
133
133
  g,
134
134
  h,
135
135
  C.canActivate
136
- ]), q = V.data?.nextPaginationToken ?? void 0, J = V.data?.prevPaginationToken ?? void 0, Pe = !!V.data, Y = w && (V.isError || G), X = r((e) => {
136
+ ]), q = V.data?.nextPaginationToken ?? void 0, J = V.data?.prevPaginationToken ?? void 0, Fe = !!V.data, Y = w && (V.isError || G), X = r((e) => {
137
137
  k || j({
138
138
  resetKey: O,
139
139
  paginationToken: e.paginationToken,
@@ -148,14 +148,14 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
148
148
  paginationToken: void 0,
149
149
  pageSize: L
150
150
  });
151
- }, [X, L]), Fe = r((e) => {
151
+ }, [X, L]), Ie = r((e) => {
152
152
  X({
153
153
  paginationToken: void 0,
154
154
  pageSize: e
155
155
  });
156
- }, [X]), Ie = r((e) => {
157
- De(e), Z();
158
- }, [Z]), Le = r(() => {
156
+ }, [X]), Le = r((e) => {
157
+ Oe(e), Z();
158
+ }, [Z]), Re = r(() => {
159
159
  X({
160
160
  paginationToken: J,
161
161
  pageSize: L
@@ -164,7 +164,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
164
164
  X,
165
165
  L,
166
166
  J
167
- ]), Re = r(() => {
167
+ ]), ze = r(() => {
168
168
  X({
169
169
  paginationToken: q,
170
170
  pageSize: L
@@ -173,7 +173,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
173
173
  X,
174
174
  q,
175
175
  L
176
- ]), Q = V.refetch, $ = U.refetch, ze = r(() => {
176
+ ]), Q = V.refetch, $ = U.refetch, Be = r(() => {
177
177
  Q(), H && $();
178
178
  }, [
179
179
  H,
@@ -181,26 +181,27 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
181
181
  $
182
182
  ]);
183
183
  return {
184
- rows: Ne,
185
- selectedCardId: ke ? null : Oe,
184
+ rows: Pe,
185
+ selectedCardId: Ae ? null : ke,
186
186
  onSelectCard: P,
187
+ canReadCards: C.canRead,
187
188
  columns: ce[s],
188
- isLoading: !x && (!S || Se && !y || w && (V.isLoading || Me)),
189
+ isLoading: !x && (!S || Ce && !y || w && (V.isLoading || Ne)),
189
190
  isError: x || Y,
190
191
  canToggleShowMyCards: C.canRead && !!b,
191
192
  isShowingMyCards: F,
192
- onShowMyCardsChange: Ie,
193
- canCreateCard: C.canCreate && !!m,
193
+ onShowMyCardsChange: Le,
194
+ canCreateCard: C.canCreate && (!!m || !!xe && C.canComposeDebitCreate),
194
195
  onCreateCardClick: m,
195
- onRetry: ze,
196
- isPaginationVisible: w && Pe && !Y,
196
+ onRetry: Be,
197
+ isPaginationVisible: w && Fe && !Y,
197
198
  pageSize: L,
198
199
  pageSizeOptions: ge,
199
200
  isPreviousPageDisabled: !J,
200
201
  isNextPageDisabled: !q,
201
- onPageSizeChange: Fe,
202
- onPreviousPageClick: Le,
203
- onNextPageClick: Re
202
+ onPageSizeChange: Ie,
203
+ onPreviousPageClick: Re,
204
+ onNextPageClick: ze
204
205
  };
205
206
  }
206
207
  //#endregion