@tesouro/embedded-components-react 0.5.186 → 0.5.187

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.
@@ -42,7 +42,7 @@ var Le = [
42
42
  5,
43
43
  10,
44
44
  25
45
- ], Re = 10, ze = [t.UserReadOrg], p = [t.UserWriteOrg, t.UserWriteAll], Be = [t.UserWriteAll], Ve = [t.UserWriteOrg], He = [t.UserWriteOrg], Ue = [t.RoleReadOrg], We = [t.UserWriteOrg], Ge = [t.BankAccountReadOrg], Ke = [t.ExternalBankAccountReadOrg], qe = [t.BankAccountWriteOrg];
45
+ ], Re = 10, ze = [t.UserReadOrg], p = [t.UserWriteOrg, t.UserWriteAll], Be = [t.UserWriteAll], Ve = [t.UserWriteOrg], He = [t.UserWriteOrg], Ue = [t.RoleReadOrg], We = [t.UserWriteOrg], Ge = [t.BankAccountReadOrg], Ke = [t.ExternalBankAccountReadOrg], qe = [t.BankAccountWriteOrg], Je = [t.DebitCardReadOrg], Ye = [t.DebitCardIssueOrg];
46
46
  function m({ labels: r, featureLabels: i, acceptInviteRedirectUri: m }) {
47
47
  let h = c(() => ({
48
48
  ...ae,
@@ -51,15 +51,15 @@ function m({ labels: r, featureLabels: i, acceptInviteRedirectUri: m }) {
51
51
  s(() => {
52
52
  g(oe.Mounted);
53
53
  }, [g]);
54
- let { organizationId: _, widgetToken: Je, initResponse: v } = ne(), y = v?.userId ?? void 0, Ye = ie(), Xe = !!re(), b = !!(_ && Je), x = c(() => e(v?.scopes, ze), [v?.scopes]), S = b && x && !!v, C = v?.scopes, w = e(C, Ue), Ze = e(C, We), Qe = b && e(C, p) && w && Ze, $e = b && x && e(C, p), et = b && e(C, Be), tt = b && e(C, Ve), nt = b && w && Ze, rt = b && e(C, He), it = b && x && e(C, [t.UserWriteOrg]), T = b && e(C, Ge), E = b && e(C, Ke), D = b && e(C, qe) && T && E, [O, at] = l("members"), k = le({
55
- canRead: x && O === "departments",
56
- canWrite: it,
54
+ let { organizationId: _, widgetToken: Xe, initResponse: v } = ne(), y = v?.userId ?? void 0, Ze = ie(), Qe = !!re(), b = !!(_ && Xe), x = c(() => e(v?.scopes, ze), [v?.scopes]), S = b && x && !!v, C = v?.scopes, w = e(C, Ue), $e = e(C, We), et = b && e(C, p) && w && $e, T = b && x && e(C, p), tt = b && e(C, Be), nt = b && e(C, Ve), rt = b && w && $e, it = b && e(C, He), at = b && x && e(C, [t.UserWriteOrg]), E = b && e(C, Ge), D = b && e(C, Ke), O = b && e(C, qe) && E && D, ot = b && e(C, Je) && e(C, Ye), [k, st] = l("members"), A = le({
55
+ canRead: x && k === "departments",
56
+ canWrite: at,
57
57
  featureLabels: h
58
- }), A = ye({
59
- canRead: x && O === "locations",
60
- canWrite: it,
58
+ }), j = ye({
59
+ canRead: x && k === "locations",
60
+ canWrite: at,
61
61
  featureLabels: h
62
- }), ot = [
62
+ }), ct = [
63
63
  {
64
64
  id: "members",
65
65
  label: h.teamMembersTab
@@ -72,282 +72,284 @@ function m({ labels: r, featureLabels: i, acceptInviteRedirectUri: m }) {
72
72
  id: "locations",
73
73
  label: h.locationsTab
74
74
  }
75
- ], [st, j] = l(), [M, ct] = l(Re), [lt, N] = l(0), [P, F] = l(), I = (Qe || nt) && w, ut = S && w && (!!P || !I), [dt, ft] = l(), L = se({
76
- Limit: M,
75
+ ], [lt, M] = l(), [N, ut] = l(Re), [dt, P] = l(0), [F, I] = l(), L = (et || rt) && w, ft = S && w && (!!F || !L), [pt, mt] = l(), R = se({
76
+ Limit: N,
77
77
  Status: "ALL",
78
- PaginationToken: st,
78
+ PaginationToken: lt,
79
79
  enabled: S
80
- }), pt = v?.organizationTypes ?? [], R = c(() => ({
80
+ }), ht = v?.organizationTypes ?? [], z = c(() => ({
81
81
  organizationId: _ ?? "",
82
- organizationTypes: pt
83
- }), [_, pt]), z = ee({ enabled: ut }), mt = c(() => me(z.data?.data ?? [], R), [z.data?.data, R]), B = S ? L.data?.data ?? [] : [], V = a({ enabled: I }), H = c(() => fe(V.data?.data ?? [], R), [V.data, R]), ht = c(() => {
84
- let e = I ? V.data?.data ?? [] : z.data?.data ?? [];
85
- return he(e, R);
82
+ organizationTypes: ht
83
+ }), [_, ht]), B = ee({ enabled: ft }), gt = c(() => me(B.data?.data ?? [], z), [B.data?.data, z]), V = S ? R.data?.data ?? [] : [], H = a({ enabled: L }), U = c(() => fe(H.data?.data ?? [], z), [H.data, z]), _t = c(() => {
84
+ let e = L ? H.data?.data ?? [] : B.data?.data ?? [];
85
+ return he(e, z);
86
86
  }, [
87
- I,
88
- V.data,
89
- z.data,
90
- R
91
- ]), gt = mt.length > 0 && !z.isResolving && !z.isError, _t = c(() => me(V.data?.data ?? [], R), [V.data, R]), U = gt ? mt : _t, vt = _e(B, h, F, U, _), yt = !!V.data, bt = H.length > 0, xt = Qe && yt && bt, St = nt && yt && bt, W = ve({
92
- canInvite: xt,
87
+ L,
88
+ H.data,
89
+ B.data,
90
+ z
91
+ ]), vt = gt.length > 0 && !B.isResolving && !B.isError, yt = c(() => me(H.data?.data ?? [], z), [H.data, z]), W = vt ? gt : yt, bt = _e(V, h, I, W, _), xt = !!H.data, St = U.length > 0, Ct = et && xt && St, wt = rt && xt && St, G = ve({
92
+ canInvite: Ct,
93
93
  canReadDirectory: x,
94
- canManageAccountAccess: D,
95
- canReadInternalAccounts: T,
96
- canReadExternalAccounts: E,
97
- roles: H,
98
- roleCatalog: U,
94
+ canManageAccountAccess: O,
95
+ canReadInternalAccounts: E,
96
+ canReadExternalAccounts: D,
97
+ canGrantDebitCardAccess: ot,
98
+ roles: U,
99
+ roleCatalog: W,
99
100
  organizationId: _,
100
101
  featureLabels: h,
101
102
  acceptInviteRedirectUri: m
102
- }), G = Ce({
103
- canEditAnyProfile: et,
104
- canEditOrgProfile: tt,
103
+ }), K = Ce({
104
+ canEditAnyProfile: tt,
105
+ canEditOrgProfile: nt,
105
106
  organizationId: _,
106
107
  currentUserId: y,
107
- canEditRole: St,
108
+ canEditRole: wt,
108
109
  canReadDirectory: x,
109
- canManageAccountAccess: D,
110
- canReadInternalAccounts: T,
111
- canReadExternalAccounts: E,
112
- members: B,
113
- roles: H,
114
- allRoles: ht,
115
- roleCatalog: U,
110
+ canManageAccountAccess: O,
111
+ canReadInternalAccounts: E,
112
+ canReadExternalAccounts: D,
113
+ members: V,
114
+ roles: U,
115
+ allRoles: _t,
116
+ roleCatalog: W,
116
117
  featureLabels: h
117
- }), K = we({
118
- canDeactivate: rt,
119
- canResendInvite: $e,
120
- members: B,
118
+ }), q = we({
119
+ canDeactivate: it,
120
+ canResendInvite: T,
121
+ members: V,
121
122
  featureLabels: h,
122
123
  acceptInviteRedirectUri: m
123
- }), Ct = L.data?.nextPaginationToken, wt = L.data?.prevPaginationToken, q = P ? B.find((e) => e.id === P) : void 0, J = ce({ enabled: !!q && x }), Tt = J.data?.data ?? B, Y = q ? de(Tt, q.reportingManagerUserId) : void 0, Et = c(() => q && J.isComplete ? pe(J.data?.data ?? [], q.id, h, U, _) : [], [
124
- q,
125
- J.isComplete,
126
- J.data?.data,
124
+ }), Tt = R.data?.nextPaginationToken, Et = R.data?.prevPaginationToken, J = F ? V.find((e) => e.id === F) : void 0, Y = ce({ enabled: !!J && x }), Dt = Y.data?.data ?? V, X = J ? de(Dt, J.reportingManagerUserId) : void 0, Ot = c(() => J && Y.isComplete ? pe(Y.data?.data ?? [], J.id, h, W, _) : [], [
125
+ J,
126
+ Y.isComplete,
127
+ Y.data?.data,
127
128
  h,
128
- U,
129
+ W,
129
130
  _
130
- ]), Dt = !!L.data, Ot = Dt && !!P && !q;
131
+ ]), kt = !!R.data, At = kt && !!F && !J;
131
132
  s(() => {
132
- Ot && F(void 0);
133
- }, [Ot]);
134
- let kt = L.isError;
133
+ At && I(void 0);
134
+ }, [At]);
135
+ let jt = R.isError;
135
136
  s(() => {
136
- kt && (j(void 0), N(0));
137
- }, [kt]);
138
- let X = vt.length, At = X === 0 ? 0 : lt * M + 1, jt = lt * M + X, Mt = `${h.viewingRangeLabel} ${At}-${jt}`, Z = ue(q), Nt = !!(q && xe({
139
- member: q,
137
+ jt && (M(void 0), P(0));
138
+ }, [jt]);
139
+ let Mt = bt.length, Nt = Mt === 0 ? 0 : dt * N + 1, Pt = dt * N + Mt, Ft = `${h.viewingRangeLabel} ${Nt}-${Pt}`, Z = ue(J), It = !!(J && xe({
140
+ member: J,
140
141
  organizationId: _,
141
- canEditAnyProfile: et,
142
- canEditOrgProfile: tt,
142
+ canEditAnyProfile: tt,
143
+ canEditOrgProfile: nt,
143
144
  currentUserId: y
144
- })), Pt = !!(q && Se({
145
- member: q,
145
+ })), Lt = !!(J && Se({
146
+ member: J,
146
147
  organizationId: _,
147
- canEditRole: St,
148
+ canEditRole: wt,
148
149
  currentUserId: y
149
- })), Ft = D && !!q && q?.id !== y, It = Nt || Pt || Ft, Q = be({
150
- selectedMember: q && Z ? q : void 0,
151
- canReadInternalAccounts: T,
152
- canReadExternalAccounts: E,
150
+ })), Rt = O && !!J && J?.id !== y, zt = It || Lt || Rt, Q = be({
151
+ selectedMember: J && Z ? J : void 0,
152
+ canReadInternalAccounts: E,
153
+ canReadExternalAccounts: D,
153
154
  featureLabels: h,
154
- allRoles: ht
155
- }), $ = c(() => q ? ge(q, h, U, _) : void 0, [
156
- q,
155
+ allRoles: _t
156
+ }), $ = c(() => J ? ge(J, h, W, _) : void 0, [
157
+ J,
157
158
  h,
158
- U,
159
+ W,
159
160
  _
160
161
  ]);
161
162
  return /* @__PURE__ */ f(u, { children: [
162
163
  /* @__PURE__ */ d(n, {}),
163
- G.isEditOpen ? /* @__PURE__ */ d(Ee, {
164
- open: G.isEditOpen,
165
- memberName: G.editMemberName,
166
- memberEmail: G.editMemberEmail,
164
+ K.isEditOpen ? /* @__PURE__ */ d(Ee, {
165
+ open: K.isEditOpen,
166
+ memberName: K.editMemberName,
167
+ memberEmail: K.editMemberEmail,
167
168
  memberInitials: $?.initials,
168
- avatarSeed: q?.email,
169
+ avatarSeed: J?.email,
169
170
  roleBadgeLabel: $?.roleCardTitle,
170
171
  statusLabel: $?.statusLabel,
171
172
  statusTone: $?.statusTone,
172
173
  lastSignInLabel: $?.lastSignInLabel,
173
- form: G.editForm,
174
+ form: K.editForm,
175
+ roleOptions: K.roleOptions,
176
+ departmentOptions: K.departmentOptions,
177
+ locationOptions: K.locationOptions,
178
+ reportingManagerOptions: K.reportingManagerOptions,
179
+ departmentsLoading: K.departmentsLoading,
180
+ locationsLoading: K.locationsLoading,
181
+ reportingManagersLoading: K.reportingManagersLoading,
182
+ departmentsError: K.departmentsError,
183
+ locationsError: K.locationsError,
184
+ reportingManagersError: K.reportingManagersError,
185
+ errors: K.editErrors,
186
+ submitErrorMessage: K.editErrorMessage,
187
+ isSubmitting: K.isSavingEdit,
188
+ isNameDisabled: K.isEditNameDisabled,
189
+ isRoleDisabled: K.isEditRoleDisabled,
190
+ isGroupDisabled: K.isEditGroupDisabled,
191
+ isReportingManagerDisabled: K.isEditReportingManagerDisabled,
192
+ isSaveDisabled: K.isEditSaveDisabled,
193
+ accountAccessMode: K.accountAccessMode,
194
+ accountAccessRows: K.accountAccessRows,
195
+ onAccountAccessToggle: K.onAccountAccessToggle,
196
+ isAccountAccessLoading: K.isAccountAccessLoading,
197
+ accountAccessErrorMessage: K.accountAccessErrorMessage,
198
+ onOpenChange: K.onEditOpenChange,
199
+ onFormChange: K.onEditFormChange,
200
+ onSubmit: K.onEditSubmit,
201
+ labels: r
202
+ }) : J ? /* @__PURE__ */ d(Ae, {
203
+ ...ge(J, h, W, _),
204
+ avatarSeed: J.email,
205
+ reportingManagerName: X?.name,
206
+ reportingManagerInitials: X?.initials,
207
+ reportingManagerSeed: X?.email,
208
+ directReports: Ot,
209
+ accountAccessLabel: Q.detailAccountAccessLabel,
210
+ accountAccessRows: Q.detailAccounts,
211
+ isAccountAccessLoading: Q.detailAccountsLoading,
212
+ isRoleLoading: w && B.isResolving,
213
+ onBackClick: () => {
214
+ mt(F), I(void 0);
215
+ },
216
+ onEditClick: zt && Z ? () => K.openMemberEdit(J.id) : void 0,
217
+ onResendClick: T && (J.status ?? "").trim().toUpperCase() === "INVITED" ? () => q.openResendConfirmation(J.id) : void 0,
218
+ onDeactivateClick: it && Z ? () => q.openDeactivateConfirmation(J.id) : void 0,
219
+ labels: r
220
+ }) : G.isInviteOpen ? /* @__PURE__ */ d(Te, {
221
+ form: G.inviteForm,
174
222
  roleOptions: G.roleOptions,
175
223
  departmentOptions: G.departmentOptions,
176
224
  locationOptions: G.locationOptions,
177
225
  reportingManagerOptions: G.reportingManagerOptions,
226
+ accountAccessOptions: G.accountAccessOptions,
178
227
  departmentsLoading: G.departmentsLoading,
179
228
  locationsLoading: G.locationsLoading,
180
229
  reportingManagersLoading: G.reportingManagersLoading,
181
230
  departmentsError: G.departmentsError,
182
231
  locationsError: G.locationsError,
183
232
  reportingManagersError: G.reportingManagersError,
184
- errors: G.editErrors,
185
- submitErrorMessage: G.editErrorMessage,
186
- isSubmitting: G.isSavingEdit,
187
- isNameDisabled: G.isEditNameDisabled,
188
- isRoleDisabled: G.isEditRoleDisabled,
189
- isGroupDisabled: G.isEditGroupDisabled,
190
- isReportingManagerDisabled: G.isEditReportingManagerDisabled,
191
- isSaveDisabled: G.isEditSaveDisabled,
233
+ accountAccessLoading: G.accountAccessLoading,
234
+ accountAccessError: G.accountAccessError,
192
235
  accountAccessMode: G.accountAccessMode,
193
- accountAccessRows: G.accountAccessRows,
194
- onAccountAccessToggle: G.onAccountAccessToggle,
195
- isAccountAccessLoading: G.isAccountAccessLoading,
196
- accountAccessErrorMessage: G.accountAccessErrorMessage,
197
- onOpenChange: G.onEditOpenChange,
198
- onFormChange: G.onEditFormChange,
199
- onSubmit: G.onEditSubmit,
200
- labels: r
201
- }) : q ? /* @__PURE__ */ d(Ae, {
202
- ...ge(q, h, U, _),
203
- avatarSeed: q.email,
204
- reportingManagerName: Y?.name,
205
- reportingManagerInitials: Y?.initials,
206
- reportingManagerSeed: Y?.email,
207
- directReports: Et,
208
- accountAccessLabel: Q.detailAccountAccessLabel,
209
- accountAccessRows: Q.detailAccounts,
210
- isAccountAccessLoading: Q.detailAccountsLoading,
211
- isRoleLoading: w && z.isResolving,
212
- onBackClick: () => {
213
- ft(P), F(void 0);
214
- },
215
- onEditClick: It && Z ? () => G.openMemberEdit(q.id) : void 0,
216
- onResendClick: $e && (q.status ?? "").trim().toUpperCase() === "INVITED" ? () => K.openResendConfirmation(q.id) : void 0,
217
- onDeactivateClick: rt && Z ? () => K.openDeactivateConfirmation(q.id) : void 0,
218
- labels: r
219
- }) : W.isInviteOpen ? /* @__PURE__ */ d(Te, {
220
- form: W.inviteForm,
221
- roleOptions: W.roleOptions,
222
- departmentOptions: W.departmentOptions,
223
- locationOptions: W.locationOptions,
224
- reportingManagerOptions: W.reportingManagerOptions,
225
- accountAccessOptions: W.accountAccessOptions,
226
- departmentsLoading: W.departmentsLoading,
227
- locationsLoading: W.locationsLoading,
228
- reportingManagersLoading: W.reportingManagersLoading,
229
- departmentsError: W.departmentsError,
230
- locationsError: W.locationsError,
231
- reportingManagersError: W.reportingManagersError,
232
- accountAccessLoading: W.accountAccessLoading,
233
- accountAccessError: W.accountAccessError,
234
- accountAccessMode: W.accountAccessMode,
235
- errors: W.inviteErrors,
236
- submitErrorMessage: W.inviteErrorMessage,
237
- isSubmitting: W.isInviting,
238
- onFormChange: W.onInviteFormChange,
239
- onBackClick: W.closeInviteForm,
240
- onCancel: W.closeInviteForm,
241
- onSubmit: W.onInviteSubmit,
236
+ errors: G.inviteErrors,
237
+ submitErrorMessage: G.inviteErrorMessage,
238
+ isSubmitting: G.isInviting,
239
+ isSubmitBlocked: G.isInviteSubmitBlocked,
240
+ onFormChange: G.onInviteFormChange,
241
+ onBackClick: G.closeInviteForm,
242
+ onCancel: G.closeInviteForm,
243
+ onSubmit: G.onInviteSubmit,
242
244
  labels: r
243
245
  }) : /* @__PURE__ */ d("div", {
244
246
  className: "ttw:space-y-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
245
247
  children: /* @__PURE__ */ d(je, {
246
- tabs: ot,
247
- activeTabId: O,
248
- onTabChange: at,
249
- children: O === "departments" ? /* @__PURE__ */ f(u, { children: [
248
+ tabs: ct,
249
+ activeTabId: k,
250
+ onTabChange: st,
251
+ children: k === "departments" ? /* @__PURE__ */ f(u, { children: [
250
252
  /* @__PURE__ */ d(Oe, {
251
253
  icon: /* @__PURE__ */ d(Ne, { className: "ttw:size-4" }),
252
- ...k.panel
254
+ ...A.panel
253
255
  }),
254
- /* @__PURE__ */ d(De, { ...k.drawer }),
256
+ /* @__PURE__ */ d(De, { ...A.drawer }),
255
257
  /* @__PURE__ */ d(o, {
256
- open: k.deleteDialog.open,
258
+ open: A.deleteDialog.open,
257
259
  icon: /* @__PURE__ */ d(Ie, {
258
260
  "aria-hidden": !0,
259
261
  className: "ttw:size-6"
260
262
  }),
261
263
  title: h.departmentDeleteDialogTitle,
262
264
  description: h.departmentDeleteDialogDescription,
263
- subjectName: k.deleteDialog.subjectName,
265
+ subjectName: A.deleteDialog.subjectName,
264
266
  confirmButtonLabel: h.departmentDeleteConfirmButton,
265
- errorMessage: k.deleteDialog.errorMessage,
266
- isConfirming: k.deleteDialog.isConfirming,
267
- onOpenChange: k.deleteDialog.onOpenChange,
268
- onConfirm: k.deleteDialog.onConfirm,
267
+ errorMessage: A.deleteDialog.errorMessage,
268
+ isConfirming: A.deleteDialog.isConfirming,
269
+ onOpenChange: A.deleteDialog.onOpenChange,
270
+ onConfirm: A.deleteDialog.onConfirm,
269
271
  labels: r
270
272
  })
271
- ] }) : O === "locations" ? /* @__PURE__ */ f(u, { children: [
273
+ ] }) : k === "locations" ? /* @__PURE__ */ f(u, { children: [
272
274
  /* @__PURE__ */ d(Oe, {
273
275
  icon: /* @__PURE__ */ d(Fe, { className: "ttw:size-4" }),
274
- ...A.panel
276
+ ...j.panel
275
277
  }),
276
- /* @__PURE__ */ d(De, { ...A.drawer }),
278
+ /* @__PURE__ */ d(De, { ...j.drawer }),
277
279
  /* @__PURE__ */ d(o, {
278
- open: A.deleteDialog.open,
280
+ open: j.deleteDialog.open,
279
281
  icon: /* @__PURE__ */ d(Ie, {
280
282
  "aria-hidden": !0,
281
283
  className: "ttw:size-6"
282
284
  }),
283
285
  title: h.locationDeleteDialogTitle,
284
286
  description: h.locationDeleteDialogDescription,
285
- subjectName: A.deleteDialog.subjectName,
287
+ subjectName: j.deleteDialog.subjectName,
286
288
  confirmButtonLabel: h.locationDeleteConfirmButton,
287
- errorMessage: A.deleteDialog.errorMessage,
288
- isConfirming: A.deleteDialog.isConfirming,
289
- onOpenChange: A.deleteDialog.onOpenChange,
290
- onConfirm: A.deleteDialog.onConfirm,
289
+ errorMessage: j.deleteDialog.errorMessage,
290
+ isConfirming: j.deleteDialog.isConfirming,
291
+ onOpenChange: j.deleteDialog.onOpenChange,
292
+ onConfirm: j.deleteDialog.onConfirm,
291
293
  labels: r
292
294
  })
293
295
  ] }) : /* @__PURE__ */ d(ke, {
294
- rows: vt,
295
- isLoading: !Xe && (!b || Ye && !v || S && L.isLoading),
296
- isError: Xe || S && L.isError,
297
- showPagination: S && Dt && !L.isError,
298
- isPreviousPageDisabled: !wt,
299
- isNextPageDisabled: !Ct,
300
- pageSize: M,
296
+ rows: bt,
297
+ isLoading: !Qe && (!b || Ze && !v || S && R.isLoading),
298
+ isError: Qe || S && R.isError,
299
+ showPagination: S && kt && !R.isError,
300
+ isPreviousPageDisabled: !Et,
301
+ isNextPageDisabled: !Tt,
302
+ pageSize: N,
301
303
  pageSizeOptions: Le,
302
- rangeLabel: Mt,
304
+ rangeLabel: Ft,
303
305
  onPageSizeChange: (e) => {
304
- ct(e), j(void 0), N(0);
306
+ ut(e), M(void 0), P(0);
305
307
  },
306
- autoFocusRowKey: dt,
308
+ autoFocusRowKey: pt,
307
309
  onPreviousPageClick: () => {
308
- j(wt ?? void 0), N((e) => Math.max(0, e - 1));
310
+ M(Et ?? void 0), P((e) => Math.max(0, e - 1));
309
311
  },
310
312
  onNextPageClick: () => {
311
- j(Ct ?? void 0), N((e) => e + 1);
313
+ M(Tt ?? void 0), P((e) => e + 1);
312
314
  },
313
- onInviteClick: xt ? W.openInviteForm : void 0,
315
+ onInviteClick: Ct ? G.openInviteForm : void 0,
314
316
  labels: r
315
317
  })
316
318
  })
317
319
  }),
318
320
  /* @__PURE__ */ d(o, {
319
- open: K.isDeactivateOpen,
321
+ open: q.isDeactivateOpen,
320
322
  icon: /* @__PURE__ */ d(Me, {
321
323
  "aria-hidden": !0,
322
324
  className: "ttw:size-6"
323
325
  }),
324
326
  title: h.deactivateDialogTitle,
325
327
  description: h.deactivateDialogDescription,
326
- subjectName: K.deactivateMemberName,
327
- subjectDetail: K.deactivateMemberEmail,
328
+ subjectName: q.deactivateMemberName,
329
+ subjectDetail: q.deactivateMemberEmail,
328
330
  confirmButtonLabel: h.deactivateConfirmButton,
329
- errorMessage: K.deactivateErrorMessage,
330
- isConfirming: K.isDeactivating,
331
- onOpenChange: K.onDeactivateOpenChange,
332
- onConfirm: K.onDeactivateConfirm,
331
+ errorMessage: q.deactivateErrorMessage,
332
+ isConfirming: q.isDeactivating,
333
+ onOpenChange: q.onDeactivateOpenChange,
334
+ onConfirm: q.onDeactivateConfirm,
333
335
  labels: r
334
336
  }),
335
337
  /* @__PURE__ */ d(o, {
336
- open: K.isResendOpen,
338
+ open: q.isResendOpen,
337
339
  icon: /* @__PURE__ */ d(Pe, {
338
340
  "aria-hidden": !0,
339
341
  className: "ttw:size-6"
340
342
  }),
341
343
  title: h.resendDialogTitle,
342
344
  description: h.resendDialogDescription,
343
- subjectName: K.resendMemberName,
344
- subjectDetail: K.resendMemberEmail,
345
+ subjectName: q.resendMemberName,
346
+ subjectDetail: q.resendMemberEmail,
345
347
  confirmButtonLabel: h.resendConfirmButton,
346
348
  confirmVariant: "default",
347
- errorMessage: K.resendErrorMessage,
348
- isConfirming: K.isResending,
349
- onOpenChange: K.onResendOpenChange,
350
- onConfirm: K.onResendConfirm,
349
+ errorMessage: q.resendErrorMessage,
350
+ isConfirming: q.isResending,
351
+ onOpenChange: q.onResendOpenChange,
352
+ onConfirm: q.onResendConfirm,
351
353
  labels: r
352
354
  })
353
355
  ] });
@@ -10,6 +10,7 @@ var e = {
10
10
  emailInvalidError: "Enter a valid email address.",
11
11
  roleRequiredError: "Choose a role for the member.",
12
12
  inviteSuccessToast: "Invite sent.",
13
+ inviteCardAccessWarningToast: "Invite sent, but the member could not be granted access to every card.",
13
14
  resendSuccessToast: "Invite resent.",
14
15
  inviteFailedError: "Something went wrong while sending the invite. Please try again.",
15
16
  editFailedError: "Something went wrong while saving the changes. Please try again.",
@@ -18,6 +19,7 @@ var e = {
18
19
  loadAccessFailedError: "We couldn’t load this member’s account access. Please try again.",
19
20
  roleNeedsAccountAccessError: "Assigning the Admin or Employee role changes account access, which requires the account-access permission. Ask an admin with that permission to make this change.",
20
21
  rolePermissionsUnavailableError: "We couldn’t check this role’s account-access permissions. Please try again.",
22
+ debitCardsUnavailableError: "We couldn’t load this company’s cards to grant this role access to them. Please try again.",
21
23
  accountAccessAll: "All accounts",
22
24
  accountAccessNone: "This member doesn’t have access to any account.",
23
25
  accountAccessCountSingular: "account",
@@ -5,25 +5,29 @@ var t = e.BankAccountWriteOrg, n = [e.BankAccountReadOrg, e.ExternalBankAccountR
5
5
  function r(e) {
6
6
  return !!e?.has(t);
7
7
  }
8
- function i(e) {
8
+ var i = e.DebitCardIssueOrg;
9
+ function a(e) {
10
+ return !!e?.has(i);
11
+ }
12
+ function o(e) {
9
13
  return e ? !n.some((t) => e.has(t)) : !1;
10
14
  }
11
- function a(e, t) {
15
+ function s(e, t) {
12
16
  return e && !t;
13
17
  }
14
- function o(e) {
18
+ function c(e) {
15
19
  return `••••${(e ?? "").trim().slice(-4)}`;
16
20
  }
17
- function s(e, t) {
21
+ function l(e, t) {
18
22
  return e?.trim() || t;
19
23
  }
20
- function c(e, t, n) {
24
+ function u(e, t, n) {
21
25
  let r = [], i = /* @__PURE__ */ new Map();
22
26
  for (let t of e) {
23
- let e = o(t.accountNumber);
27
+ let e = c(t.accountNumber);
24
28
  r.push({
25
29
  value: t.id,
26
- name: s(t.nickname, e),
30
+ name: l(t.nickname, e),
27
31
  typeLabel: n.checking,
28
32
  maskedNumber: e,
29
33
  source: "internal"
@@ -33,10 +37,10 @@ function c(e, t, n) {
33
37
  });
34
38
  }
35
39
  for (let e of t) {
36
- let t = o(e.accountNumber);
40
+ let t = c(e.accountNumber);
37
41
  r.push({
38
42
  value: e.id,
39
- name: s(e.nickname, t),
43
+ name: l(e.nickname, t),
40
44
  typeLabel: e.type === "SAVINGS" ? n.savings : n.checking,
41
45
  maskedNumber: t,
42
46
  source: "external"
@@ -51,11 +55,11 @@ function c(e, t, n) {
51
55
  allAccountIds: r.map((e) => e.value)
52
56
  };
53
57
  }
54
- function l(e, t) {
58
+ function d(e, t) {
55
59
  return e.map((e) => t.get(e)).filter((e) => !!e);
56
60
  }
57
- function u({ isAdmin: e, accessibleCount: t, totalCount: n, labels: r }) {
61
+ function f({ isAdmin: e, accessibleCount: t, totalCount: n, labels: r }) {
58
62
  return e ? r.accountAccessAll : t <= 0 ? r.accountAccessNone : `${t} ${t === 1 ? r.accountAccessCountSingular : r.accountAccessCountPlural}${n > 0 ? ` ${r.accountAccessOf} ${n}` : ""}`;
59
63
  }
60
64
  //#endregion
61
- export { t as ACCOUNT_ACCESS_ADMIN_PERMISSION_KEY, n as ACCOUNT_ACCESS_VISIBILITY_PERMISSION_KEYS, u as formatAccountAccessLabel, a as isAccountsSectionVisibleForRole, r as isAdminPermissionSet, i as isEmployeePermissionSet, o as maskAccountNumber, l as toAccountAccessInputs, c as toAccountAccessOptions };
65
+ export { t as ACCOUNT_ACCESS_ADMIN_PERMISSION_KEY, n as ACCOUNT_ACCESS_VISIBILITY_PERMISSION_KEYS, i as DEBIT_CARD_ADMIN_PERMISSION_KEY, f as formatAccountAccessLabel, s as isAccountsSectionVisibleForRole, r as isAdminPermissionSet, a as isDebitCardAdminPermissionSet, o as isEmployeePermissionSet, c as maskAccountNumber, d as toAccountAccessInputs, u as toAccountAccessOptions };