@tesouro/embedded-components-react 0.5.18 → 0.5.20

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.
Files changed (146) hide show
  1. package/README.md +22 -21
  2. package/dist/index.css +18 -0
  3. package/dist/index.d.ts +29 -6
  4. package/dist/index.js +1 -1
  5. package/dist/lib/BillPayWidget.js +1 -1
  6. package/dist/lib/CardDetailsWidget.d.ts +20 -2
  7. package/dist/lib/CreditCardsWidget.d.ts +29 -6
  8. package/dist/lib/DebitCardsWidget.d.ts +29 -6
  9. package/dist/lib/WidgetSuite.d.ts +29 -6
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +2 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -9
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +4 -91
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +78 -83
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +98 -3
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -49
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +47 -136
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +136 -33
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +33 -187
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +188 -75
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -232
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +223 -210
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +202 -108
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +126 -13
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -47
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +47 -53
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +49 -202
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +202 -31
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +32 -234
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -19
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +19 -434
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +436 -4
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -38
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +35 -231
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +235 -3
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -10
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +10 -110
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +112 -3
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -46
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +43 -18
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -104
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +110 -206
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +213 -3
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -8
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +6 -113
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +115 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -24
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
  60. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +152 -149
  61. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +8 -11
  62. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +1 -1
  63. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +2 -0
  64. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +4 -4
  65. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +81 -79
  66. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +39 -38
  67. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +23 -0
  68. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +142 -118
  69. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +24 -14
  70. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +4 -1
  71. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -0
  72. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/PerTransactionMaximumControl.js +17 -16
  73. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +25 -24
  74. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/limitDecimalPlaces.js +7 -0
  75. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/SetupView.js +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +2 -2
  77. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index.js +1 -1
  78. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index10.js +6 -6
  79. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index11.js +3 -0
  80. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index12.js +7 -7
  81. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +24 -0
  82. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index14.js +7 -7
  83. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index15.js +7 -7
  84. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index16.js +1 -1
  85. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index17.js +7 -7
  86. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index18.js +6 -6
  87. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index19.js +7 -7
  88. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index2.js +10 -0
  89. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index20.js +1 -1
  90. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index21.js +7 -7
  91. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index22.js +6 -6
  92. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index23.js +7 -7
  93. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index3.js +4 -4
  94. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index4.js +29 -0
  95. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index5.js +10 -0
  96. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index6.js +10 -0
  97. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index7.js +7 -7
  98. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index8.js +6 -6
  99. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index9.js +6 -6
  100. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index10.js +1 -1
  101. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index11.js +4 -4
  102. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index12.js +9 -9
  103. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index13.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index14.js +6 -6
  105. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index15.js +8 -8
  106. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index16.js +5 -5
  107. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index17.js +11 -11
  108. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index2.js +10 -0
  109. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index3.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index4.js +2 -2
  111. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index5.js +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index6.js +1 -1
  113. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index7.js +3 -3
  114. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index8.js +1 -1
  115. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index9.js +1 -1
  116. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index10.js +5 -5
  117. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index11.js +1 -1
  118. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index12.js +4 -4
  119. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index13.js +1 -1
  120. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index14.js +2 -2
  121. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index15.js +4 -4
  122. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index16.js +5 -5
  123. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index17.js +4 -4
  124. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index18.js +2 -2
  125. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index2.js +1 -1
  126. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index3.js +2 -2
  127. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index4.js +2 -2
  128. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index5.js +3 -3
  129. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index6.js +1 -1
  130. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index7.js +2 -2
  131. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index8.js +4 -4
  132. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index9.js +1 -1
  133. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +12 -1
  134. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  135. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/card/cardPresentation.js +1 -1
  136. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  137. package/package.json +1 -1
  138. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index11.js +0 -3
  139. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index13.js +0 -24
  140. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index2.js +0 -10
  141. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index4.js +0 -29
  142. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index5.js +0 -10
  143. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index6.js +0 -10
  144. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index2.js +0 -9
  145. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index.js +0 -0
  146. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index.js +0 -0
@@ -3,114 +3,116 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { isApiConflictError as t } from "../../../shared/data-access/dist/lib/isApiConflictError.js";
7
- import { isApiUnprocessableError as n } from "../../../shared/data-access/dist/lib/isApiUnprocessableError.js";
6
+ import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { isApiConflictError as n } from "../../../shared/data-access/dist/lib/isApiConflictError.js";
8
+ import { isApiUnprocessableError as r } from "../../../shared/data-access/dist/lib/isApiUnprocessableError.js";
8
9
  import "../../../shared/data-access/dist/index.js";
9
10
  import "../../../shared/ui/dist/index.js";
10
- import { CardProgram as r } from "../../../shared/feature/dist/lib/card/cardProgram.js";
11
+ import { CardProgram as i } from "../../../shared/feature/dist/lib/card/cardProgram.js";
11
12
  import "../../../shared/feature/dist/index.js";
12
- import { canActivateCard as i, toCardFaceExpirationDate as a } from "./index7.js";
13
- import { useIdScopedRequest as o } from "./index8.js";
14
- import { useActivateCreditCardMutation as s, useActivateDebitCardMutation as c } from "../../data-access/dist/index4.js";
15
- import { useVerifyDebitCardMutation as l } from "../../data-access/dist/index11.js";
13
+ import { canActivateCard as a, toCardFaceExpirationDate as o } from "./index7.js";
14
+ import { useIdScopedRequest as s } from "./index8.js";
15
+ import { useActivateCreditCardMutation as c, useActivateDebitCardMutation as l } from "../../data-access/dist/index4.js";
16
+ import { useVerifyDebitCardMutation as u } from "../../data-access/dist/index11.js";
16
17
  import "../../data-access/dist/index.js";
17
- import { ActivateCardFormError as u, EMPTY_ACTIVATE_CARD_FORM_VALUES as d, validateActivateCardForm as f } from "../../ui/dist/lib/ActivateCardPanel/validation.js";
18
+ import { ActivateCardFormError as d, EMPTY_ACTIVATE_CARD_FORM_VALUES as f, validateActivateCardForm as p } from "../../ui/dist/lib/ActivateCardPanel/validation.js";
18
19
  import "../../ui/dist/index.js";
19
- import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
20
+ import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
20
21
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js
21
- function _({ cardId: _, cardProgram: v, card: y, scopes: b, conflictToast: x }) {
22
- let [S, C] = g(!1), [w, T] = g(d), [E, D] = g("idle"), [O, k] = g(!1), { claim: A, release: j, isStale: M } = o({
23
- id: _,
22
+ function v({ cardId: v, cardProgram: y, card: b, scopes: x, currentUserId: S, conflictToast: C }) {
23
+ let [w, T] = _(!1), [E, D] = _(f), [O, k] = _("idle"), [A, j] = _(!1), { authEpoch: M } = t(), { claim: N, release: P, isStale: F } = s({
24
+ id: `${v}:${M}`,
24
25
  reset: () => {
25
- C(!1), T(d), D("idle"), k(!1);
26
+ T(!1), D(f), k("idle"), j(!1);
26
27
  }
27
- }), { mutateAsync: N } = l(), { mutateAsync: P } = s(), { mutateAsync: F } = c(), I = i({
28
- card: y,
29
- cardProgram: v,
30
- scopes: b
31
- }), L = h(() => f(w), [w]), R = h(() => ({
32
- ...L.errors,
33
- ...O ? { form: u.VerificationRejected } : {}
34
- }), [O, L.errors]), z = p(() => {
35
- C(!0);
36
- }, []), B = p(() => {
37
- j(), T(d), k(!1);
38
- }, [j]), V = p(() => {
39
- C(!1), D("idle"), B();
40
- }, [B]), H = p((e) => {
41
- T((t) => ({
28
+ }), { mutateAsync: I } = u(), { mutateAsync: L } = c(), { mutateAsync: R } = l(), z = a({
29
+ card: b,
30
+ cardProgram: y,
31
+ scopes: x,
32
+ currentUserId: S
33
+ }), B = g(() => p(E), [E]), V = g(() => ({
34
+ ...B.errors,
35
+ ...A ? { form: d.VerificationRejected } : {}
36
+ }), [A, B.errors]), H = m(() => {
37
+ T(!0);
38
+ }, []), U = m(() => {
39
+ P(), D(f), j(!1);
40
+ }, [P]), W = m(() => {
41
+ T(!1), k("idle"), U();
42
+ }, [U]), G = m((e) => {
43
+ D((t) => ({
42
44
  ...t,
43
45
  ...e
44
46
  }));
45
47
  }, []);
46
- m(() => {
47
- !S || I || E !== "succeeded" && E !== "submitting" && (e.error(x), V());
48
+ h(() => {
49
+ !w || z || O !== "succeeded" && O !== "submitting" && (e.error(C), W());
48
50
  }, [
49
- I,
50
- V,
51
- x,
52
- S,
53
- E
51
+ z,
52
+ W,
53
+ C,
54
+ w,
55
+ O
54
56
  ]);
55
- let U = p(async () => {
56
- if (!I || !f(w).isValid) return;
57
- let i = v === r.Credit, o = v === r.Debit;
58
- if (!i && !o) return;
59
- D("submitting"), k(!1);
60
- let s = A();
57
+ let K = m(async () => {
58
+ if (!z || !p(E).isValid) return;
59
+ let t = y === i.Credit, a = y === i.Debit;
60
+ if (!t && !a) return;
61
+ k("submitting"), j(!1);
62
+ let s = N();
61
63
  try {
62
- if (o) {
63
- let e = a(w.expirationDate);
64
+ if (a) {
65
+ let e = o(E.expirationDate);
64
66
  if (!e) {
65
- D("errored");
67
+ k("errored");
66
68
  return;
67
69
  }
68
- await N({
69
- path: { id: _ },
70
+ await I({
71
+ path: { id: v },
70
72
  body: {
71
73
  expirationDate: e,
72
- cvv: w.securityCode
74
+ cvv: E.securityCode
73
75
  }
74
76
  });
75
77
  }
76
- if (M(s) || (i ? await P({ path: { id: _ } }) : await F({ path: { id: _ } }), M(s))) return;
77
- D("succeeded");
78
- } catch (r) {
79
- if (M(s)) return;
80
- if (t(r)) {
81
- e.error(x), V();
78
+ if (F(s) || (t ? await L({ path: { id: v } }) : await R({ path: { id: v } }), F(s))) return;
79
+ k("succeeded");
80
+ } catch (t) {
81
+ if (F(s)) return;
82
+ if (n(t)) {
83
+ e.error(C), W();
82
84
  return;
83
85
  }
84
- n(r) && k(!0), D("errored");
86
+ r(t) && j(!0), k("errored");
85
87
  }
86
88
  }, [
87
- P,
88
- F,
89
- I,
90
- _,
89
+ L,
90
+ R,
91
+ z,
91
92
  v,
92
- A,
93
- V,
94
- x,
95
- M,
96
- w,
97
- N
98
- ]), W = p(() => {
99
- U();
100
- }, [U]);
93
+ y,
94
+ N,
95
+ W,
96
+ C,
97
+ F,
98
+ E,
99
+ I
100
+ ]), q = m(() => {
101
+ K();
102
+ }, [K]);
101
103
  return {
102
- canActivate: I,
103
- isOpen: S,
104
- open: z,
105
- close: V,
106
- finish: B,
107
- values: w,
108
- errors: R,
109
- state: E,
110
- isSubmitDisabled: !I || !L.isValid || E === "submitting",
111
- onValuesChange: H,
112
- onSubmit: W
104
+ canActivate: z,
105
+ isOpen: w,
106
+ open: H,
107
+ close: W,
108
+ finish: U,
109
+ values: E,
110
+ errors: V,
111
+ state: O,
112
+ isSubmitDisabled: !z || !B.isValid || O === "submitting",
113
+ onValuesChange: G,
114
+ onSubmit: q
113
115
  };
114
116
  }
115
117
  //#endregion
116
- export { _ as useActivateCard };
118
+ export { v as useActivateCard };
@@ -23,69 +23,70 @@ function O(e, t) {
23
23
  default: return;
24
24
  }
25
25
  }
26
- function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, bankLogoSrc: I, bankLogoAlt: L, cardholderName: R, maskedCardNumber: z, programLabel: B, testIds: V, className: H }) {
27
- let U = x(() => f(p), [p]), W = b(), G = b(), K = b(), q = b(), J = m === "submitting", Y = O(j.expirationDate, U.validation), X = O(j.form, U.validation);
26
+ function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, cardArtSrc: I, bankLogoSrc: L, bankLogoAlt: R, cardholderName: z, maskedCardNumber: B, programLabel: V, testIds: H, className: U }) {
27
+ let W = x(() => f(p), [p]), G = b(), K = b(), q = b(), J = b(), Y = m === "submitting", X = O(j.expirationDate, W.validation), Z = O(j.form, W.validation);
28
28
  return /* @__PURE__ */ C("div", {
29
- "data-testid": V?.root,
30
- className: l("ttw:flex ttw:w-full ttw:flex-col", H),
29
+ "data-testid": H?.root,
30
+ className: l("ttw:flex ttw:w-full ttw:flex-col", U),
31
31
  children: [/* @__PURE__ */ C("div", {
32
32
  className: "ttw:flex ttw:items-start ttw:gap-1.5 ttw:px-4 ttw:pt-4 ttw:pb-3",
33
33
  children: [/* @__PURE__ */ S("h2", {
34
34
  className: "ttw:min-w-0 ttw:flex-1 ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
35
- children: U.header.title
35
+ children: W.header.title
36
36
  }), P ? /* @__PURE__ */ S(e, {
37
37
  type: "button",
38
38
  variant: "ghost",
39
39
  size: "icon",
40
40
  className: "ttw:size-8 ttw:shrink-0",
41
- "aria-label": U.header.closeAriaLabel,
41
+ "aria-label": W.header.closeAriaLabel,
42
42
  onClick: P,
43
43
  children: /* @__PURE__ */ S(E, { className: "ttw:size-4" })
44
44
  }) : null]
45
45
  }), m === "succeeded" ? /* @__PURE__ */ S(v, {
46
- labels: U.status,
46
+ labels: W.status,
47
47
  onDone: F,
48
- testIds: V?.successView
48
+ testIds: H?.successView
49
49
  }) : /* @__PURE__ */ C("form", {
50
50
  noValidate: !0,
51
51
  onSubmit: (e) => {
52
- e.preventDefault(), !(M || J) && N?.();
52
+ e.preventDefault(), !(M || Y) && N?.();
53
53
  },
54
54
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-4 ttw:pb-4",
55
55
  children: [
56
56
  /* @__PURE__ */ S("div", {
57
57
  className: "ttw:flex ttw:justify-center",
58
58
  children: /* @__PURE__ */ S(d, {
59
- bankLogoSrc: I,
60
- bankLogoAlt: L ?? U.cardFace.bankLogoAlt,
61
- cardholderName: R ?? "",
62
- maskedCardNumber: z ?? "",
63
- programLabel: B ?? "",
64
- testIds: V?.cardFace
59
+ cardArtSrc: I,
60
+ bankLogoSrc: L,
61
+ bankLogoAlt: R ?? W.cardFace.bankLogoAlt,
62
+ cardholderName: z ?? "",
63
+ maskedCardNumber: B ?? "",
64
+ programLabel: V ?? "",
65
+ testIds: H?.cardFace
65
66
  })
66
67
  }),
67
68
  /* @__PURE__ */ C("div", {
68
69
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
69
70
  children: [
70
71
  /* @__PURE__ */ S(n, {
71
- htmlFor: W,
72
+ htmlFor: G,
72
73
  className: "ttw:text-sm ttw:font-medium",
73
- children: U.fields.expirationDate
74
+ children: W.fields.expirationDate
74
75
  }),
75
76
  /* @__PURE__ */ S(t, {
76
- id: W,
77
+ id: G,
77
78
  value: k.expirationDate,
78
- placeholder: U.fields.expirationDatePlaceholder,
79
- disabled: J,
79
+ placeholder: W.fields.expirationDatePlaceholder,
80
+ disabled: Y,
80
81
  inputMode: "numeric",
81
82
  autoComplete: "off",
82
- "aria-invalid": Y ? !0 : void 0,
83
- "aria-describedby": Y ? G : void 0,
83
+ "aria-invalid": X ? !0 : void 0,
84
+ "aria-describedby": X ? K : void 0,
84
85
  onChange: (e) => A?.({ expirationDate: _(e.target.value) })
85
86
  }),
86
87
  /* @__PURE__ */ S(y, {
87
- id: G,
88
- message: Y
88
+ id: K,
89
+ message: X
89
90
  })
90
91
  ]
91
92
  }),
@@ -95,46 +96,46 @@ function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, err
95
96
  /* @__PURE__ */ C("div", {
96
97
  className: "ttw:flex ttw:items-center ttw:gap-1.5",
97
98
  children: [/* @__PURE__ */ S(n, {
98
- htmlFor: K,
99
+ htmlFor: q,
99
100
  className: "ttw:text-sm ttw:font-medium",
100
- children: U.fields.securityCode
101
+ children: W.fields.securityCode
101
102
  }), /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(c, {
102
103
  type: "button",
103
104
  className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
104
- "aria-label": U.fields.securityCodeInfoAriaLabel,
105
+ "aria-label": W.fields.securityCodeInfoAriaLabel,
105
106
  children: /* @__PURE__ */ S(T, { className: "ttw:size-4" })
106
107
  }), /* @__PURE__ */ S(o, {
107
108
  className: "ttw:max-w-xs",
108
- children: U.fields.securityCodeInfo
109
+ children: W.fields.securityCodeInfo
109
110
  })] }) })]
110
111
  }),
111
112
  /* @__PURE__ */ S(t, {
112
- id: K,
113
+ id: q,
113
114
  value: k.securityCode,
114
- placeholder: U.fields.securityCodePlaceholder,
115
- "aria-describedby": q,
116
- disabled: J,
115
+ placeholder: W.fields.securityCodePlaceholder,
116
+ "aria-describedby": J,
117
+ disabled: Y,
117
118
  inputMode: "numeric",
118
119
  autoComplete: "off",
119
120
  maxLength: 4,
120
121
  onChange: (e) => A?.({ securityCode: g(e.target.value, 4) })
121
122
  }),
122
123
  /* @__PURE__ */ S("span", {
123
- id: q,
124
+ id: J,
124
125
  className: "ttw:sr-only",
125
- children: U.fields.securityCodeInfo
126
+ children: W.fields.securityCodeInfo
126
127
  })
127
128
  ]
128
129
  }),
129
130
  /* @__PURE__ */ S(r, {}),
130
- m === "errored" || X ? /* @__PURE__ */ S(u, { children: X ?? U.status.errorDescription }) : null,
131
+ m === "errored" || Z ? /* @__PURE__ */ S(u, { children: Z ?? W.status.errorDescription }) : null,
131
132
  /* @__PURE__ */ C(e, {
132
133
  type: "submit",
133
134
  className: "ttw:w-full",
134
- disabled: M || J,
135
+ disabled: M || Y,
135
136
  children: [
136
- J ? /* @__PURE__ */ S(i, { "aria-label": U.status.submittingAriaLabel }) : null,
137
- U.status.submit,
137
+ Y ? /* @__PURE__ */ S(i, { "aria-label": W.status.submittingAriaLabel }) : null,
138
+ W.status.submit,
138
139
  /* @__PURE__ */ S(w, { className: "ttw:size-4" })
139
140
  ]
140
141
  })
@@ -0,0 +1,23 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { CopyIcon as n } from "lucide-react";
3
+ //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js
4
+ function r({ value: r, copyAriaLabel: i, onCopy: a }) {
5
+ return /* @__PURE__ */ t("div", {
6
+ className: "ttw:flex ttw:items-center ttw:gap-1",
7
+ children: [/* @__PURE__ */ e("span", {
8
+ className: "ttw:min-w-0 ttw:truncate ttw:text-sm ttw:text-foreground",
9
+ children: r
10
+ }), i && a ? /* @__PURE__ */ e("button", {
11
+ type: "button",
12
+ "aria-label": i,
13
+ onClick: a,
14
+ className: "ttw:inline-flex ttw:size-5 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded ttw:text-muted-foreground ttw:transition-colors ttw:hover:bg-accent ttw:hover:text-accent-foreground ttw:focus-visible:ring-2 ttw:focus-visible:ring-ring ttw:focus-visible:outline-none",
15
+ children: /* @__PURE__ */ e(n, {
16
+ className: "ttw:size-3",
17
+ "aria-hidden": "true"
18
+ })
19
+ }) : null]
20
+ });
21
+ }
22
+ //#endregion
23
+ export { r as AddressLine };