@tesouro/embedded-components-react 0.3.19 → 0.3.22

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 (210) hide show
  1. package/dist/index.css +9 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/lib/monite-sdk.js +18 -18
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +4 -4
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +14 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +4 -1
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +28 -97
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +81 -176
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +50 -4
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +250 -5
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +106 -107
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +209 -1
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +3 -24
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +114 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +1 -0
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +25 -0
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +21 -17
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +2 -0
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +36 -11
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +10 -283
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +199 -8
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +3 -8
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +14 -91
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +314 -0
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -2
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +4 -14
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +85 -105
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +2 -7
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +16 -28
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +113 -2
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +2 -7
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +5 -32
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +30 -2
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +2 -12
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +5 -104
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +34 -2
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +2 -18
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +9 -7
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +81 -145
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +15 -11
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +8 -87
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +170 -2
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -0
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +14 -0
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +89 -0
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -0
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +1 -1
  57. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +19 -19
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index422.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +16 -20
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index480.js +13 -12
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index481.js +19 -97
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index482.js +98 -42
  63. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index483.js +43 -27
  64. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index484.js +30 -1
  65. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index485.js +1 -17
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index486.js +11 -10
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index487.js +14 -4
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index488.js +4 -13
  69. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index489.js +7 -7
  70. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index490.js +18 -9
  71. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index491.js +8 -105
  72. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index492.js +102 -35
  73. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index493.js +36 -45
  74. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index494.js +44 -71
  75. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +72 -100
  76. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index496.js +99 -43
  77. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index497.js +35 -178
  78. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index498.js +171 -125
  79. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index499.js +134 -123
  80. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index500.js +125 -73
  81. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index501.js +63 -232
  82. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index502.js +248 -8
  83. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +8 -6
  84. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index504.js +5 -456
  85. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index505.js +455 -21
  86. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +17 -12
  87. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +13 -49
  88. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index508.js +51 -43
  89. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +46 -14
  90. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index510.js +13 -41
  91. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index511.js +39 -144
  92. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index512.js +143 -112
  93. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index513.js +114 -39
  94. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index514.js +33 -25
  95. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index515.js +32 -19
  96. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index516.js +3 -3
  97. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index517.js +19 -21
  98. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index518.js +20 -72
  99. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index519.js +73 -17
  100. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index520.js +18 -172
  101. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index521.js +149 -116
  102. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index522.js +136 -30
  103. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +31 -115
  104. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index524.js +116 -19
  105. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index525.js +10 -36
  106. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index526.js +46 -14
  107. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index527.js +13 -23
  108. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index528.js +21 -25
  109. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index529.js +26 -36
  110. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index530.js +36 -77
  111. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index531.js +77 -50
  112. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index532.js +50 -33
  113. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index533.js +34 -89
  114. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index534.js +86 -48
  115. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index535.js +54 -1
  116. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index536.js +1 -40
  117. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index537.js +40 -1
  118. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index538.js +0 -135
  119. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index539.js +129 -102
  120. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index540.js +105 -50
  121. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index541.js +48 -779
  122. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index542.js +780 -87
  123. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index543.js +84 -97
  124. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index544.js +105 -6
  125. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index545.js +6 -27
  126. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index546.js +23 -11
  127. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +13 -2
  128. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index548.js +2 -25
  129. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index549.js +25 -14
  130. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index550.js +14 -171
  131. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index551.js +163 -200
  132. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +204 -78
  133. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +82 -17
  134. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +17 -158
  135. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +146 -85
  136. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +95 -42
  137. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +46 -4
  138. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +4 -16
  139. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +13 -24
  140. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +27 -1
  141. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +0 -186
  142. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +186 -0
  143. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +0 -42
  144. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +41 -3
  145. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +5 -24
  146. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +20 -73
  147. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +74 -16
  148. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +16 -19
  149. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +19 -5
  150. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +4 -8
  151. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +10 -11
  152. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +11 -131
  153. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +129 -4
  154. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +4 -4
  155. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +8 -5
  156. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +4 -221
  157. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +219 -11
  158. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +12 -34
  159. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +32 -181
  160. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +168 -189
  161. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +192 -88
  162. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +97 -61
  163. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +63 -54
  164. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +46 -83
  165. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +91 -40
  166. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +39 -75
  167. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +63 -71
  168. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +85 -12
  169. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +12 -24
  170. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +25 -16
  171. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +14 -2
  172. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +4 -23
  173. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +23 -0
  174. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +1 -24
  175. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +24 -4
  176. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +4 -13
  177. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +9 -13
  178. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +13 -4
  179. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +4 -8
  180. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +8 -4
  181. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +8 -6
  182. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index602.js +6 -22
  183. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index603.js +17 -68
  184. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index604.js +66 -113
  185. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index605.js +104 -64
  186. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index606.js +72 -138
  187. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index607.js +144 -28
  188. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index608.js +28 -16
  189. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js +14 -87
  190. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js +91 -3
  191. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js +3 -26
  192. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js +22 -67
  193. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js +71 -1
  194. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js +0 -65
  195. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +66 -29
  196. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +30 -2
  197. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js +2 -34
  198. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +33 -15
  199. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index619.js +14 -29
  200. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index620.js +29 -26
  201. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index621.js +30 -2
  202. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index622.js +2 -97
  203. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index623.js +97 -0
  204. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +1 -1
  205. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  206. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
  207. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  208. package/dist/packages/shared-ui-shadcn/dist/index.js +16 -11
  209. package/package.json +1 -1
  210. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +0 -2
@@ -1,141 +1,174 @@
1
1
  import { useMoniteContext as e } from "./index47.js";
2
- import { useCurrencies as t } from "./index63.js";
3
- import { Button as n } from "./index56.js";
4
- import "./index217.js";
5
- import { DialogFooter as r, DialogHeader as i, DialogTitle as a } from "./index58.js";
6
- import { Typography as o } from "./index62.js";
7
- import { Separator as s } from "./index64.js";
8
- import { Checkbox as c } from "./index103.js";
9
- import { useGetMeasureUnits as l } from "./index458.js";
10
- import { useMemo as u, useState as d } from "react";
11
- import { Check as f } from "lucide-react";
12
- import { Fragment as p, jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
13
- import { toast as g } from "react-hot-toast";
14
- import { useLingui as _ } from "@lingui/react";
2
+ import { useCounterpartById as t } from "./index48.js";
3
+ import { getCounterpartEmail as n, getCounterpartName as r } from "./index53.js";
4
+ import { Button as i } from "./index56.js";
5
+ import { Input as a } from "./index89.js";
6
+ import { Textarea as o } from "./index106.js";
7
+ import { useGetReceivableById as s } from "./index141.js";
8
+ import "./index142.js";
9
+ import { DialogDescription as c, DialogFooter as l, DialogHeader as u, DialogTitle as d } from "./index58.js";
10
+ import { Typography as f } from "./index62.js";
11
+ import { formatFileSize as p } from "./index193.js";
12
+ import { useEffect as m, useMemo as h, useState as g } from "react";
13
+ import { Check as _, Send as v } from "lucide-react";
14
+ import { Fragment as y, jsx as b, jsxs as x } from "@emotion/react/jsx-runtime";
15
+ import { toast as S } from "react-hot-toast";
16
+ import { useLingui as C } from "@lingui/react";
15
17
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index521.js
16
- var v = ({ inlineLineItems: v, title: y, onClose: b }) => {
17
- let { i18n: x } = _(), { api: S, queryClient: C } = e(), { formatCurrencyToDisplay: w } = t(), { data: T } = l(), { mutateAsync: E } = S.finops.postProducts.useMutation(), D = u(() => v.map((e, t) => ({
18
- key: e.id ?? String(t),
19
- lineItem: e
20
- })), [v]), [O, k] = d(() => new Set(D.map((e) => e.key))), [A, j] = d(!1), M = D.length > 0 && O.size === D.length, N = O.size > 0, P = () => k(new Set(D.map((e) => e.key))), F = () => k(/* @__PURE__ */ new Set()), I = (e) => k((t) => {
21
- let n = new Set(t);
22
- return n.has(e) ? n.delete(e) : n.add(e), n;
23
- }), L = (e) => {
24
- let t = w(e.product.price.value, e.product.price.currency) ?? "", n = e.product.measure_unit_id ? T?.data?.find((t) => t.id === e.product.measure_unit_id)?.name : void 0;
25
- return n ? `${t} ${n}` : t;
26
- };
27
- return /* @__PURE__ */ h(p, { children: [
28
- /* @__PURE__ */ m(i, {
18
+ var w = ({ receivableId: w, counterpartId: T, onSkip: E, onSent: D, isEditFlow: O = !1 }) => {
19
+ let { i18n: k } = C(), { api: A, queryClient: j, entityId: M } = e(), { data: N } = s(w, !!w), { data: P } = t(T), { data: F } = A.finops.getEntitiesIdPaymentMethods.useQuery({ path: { entity_id: M } }), { mutateAsync: I } = A.finops.postReceivablesIdSend.useMutation(), { mutateAsync: L } = A.finops.postPaymentLinks.useMutation({}), R = r(P), z = n(P), B = N, V = B?.document_id, H = B?.attachments ?? [], U = h(() => R ? V ? k._("Invoice #{documentId} for {name}", {
20
+ documentId: V,
21
+ name: R
22
+ }) : k._("Invoice for {name}", { name: R }) : "", [
23
+ V,
24
+ R,
25
+ k
26
+ ]), [W, G] = g(""), [K, q] = g(!1), [J, Y] = g(""), [X, Z] = g(!1);
27
+ return m(() => {
28
+ !K && U && G(U);
29
+ }, [U, K]), /* @__PURE__ */ x(y, { children: [
30
+ /* @__PURE__ */ b(u, {
29
31
  className: "ttw:border-b ttw:border-border ttw:p-6",
30
- children: /* @__PURE__ */ h(a, {
31
- className: "ttw:flex ttw:flex-row ttw:items-center ttw:gap-4",
32
- children: [/* @__PURE__ */ m("span", {
33
- className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-emerald-200 ttw:bg-emerald-50",
34
- children: /* @__PURE__ */ m(f, { className: "ttw:size-6 ttw:text-green-700" })
35
- }), y]
32
+ children: /* @__PURE__ */ x("div", {
33
+ className: "ttw:flex ttw:items-center ttw:gap-4",
34
+ children: [/* @__PURE__ */ b("span", {
35
+ className: "ttw:flex ttw:size-10 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-emerald-200 ttw:bg-emerald-50",
36
+ children: b(O ? v : _, { className: "ttw:size-6 ttw:text-green-700" })
37
+ }), /* @__PURE__ */ x("div", {
38
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
39
+ children: [/* @__PURE__ */ b(d, { children: O ? k._("Send a copy to {name}?", { name: R }) : k._("Invoice issued. Send a copy to {name}?", { name: R }) }), /* @__PURE__ */ b(c, {
40
+ className: "ttw:text-xs",
41
+ children: k._("The customer will be emailed a copy of the invoice with payment instructions.")
42
+ })]
43
+ })]
36
44
  })
37
45
  }),
38
- /* @__PURE__ */ h("div", {
39
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:p-6",
40
- children: [/* @__PURE__ */ h("div", {
41
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-1.5",
42
- children: [/* @__PURE__ */ h("div", {
43
- className: "ttw:flex ttw:flex-col ttw:gap-1",
44
- children: [/* @__PURE__ */ m(o, {
45
- variant: "h4",
46
- children: x._("Do you want to also save these items?")
47
- }), /* @__PURE__ */ m(o, {
48
- variant: "caption",
46
+ /* @__PURE__ */ x("div", {
47
+ className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:p-6",
48
+ children: [
49
+ /* @__PURE__ */ x("div", {
50
+ className: "ttw:flex ttw:items-center ttw:gap-4",
51
+ children: [/* @__PURE__ */ b(f, {
52
+ variant: "body2",
49
53
  color: "muted",
50
- children: x._("Saved items can be quickly added to future invoices.")
54
+ className: "ttw:w-16 ttw:shrink-0",
55
+ children: k._("To")
56
+ }), /* @__PURE__ */ x(f, {
57
+ variant: "body2",
58
+ children: [R, z ? ` <${z}>` : ""]
51
59
  })]
52
- }), /* @__PURE__ */ m(n, {
53
- type: "button",
54
- variant: "ghost",
55
- className: "ttw:text-primary ttw:hover:text-primary",
56
- disabled: A,
57
- onClick: N ? F : P,
58
- children: N ? x._("Deselect all") : x._("Select all")
59
- })]
60
- }), /* @__PURE__ */ h("ul", {
61
- className: "ttw:flex ttw:flex-col ttw:gap-3",
62
- children: [
63
- /* @__PURE__ */ h("li", {
64
- className: "ttw:flex ttw:items-center ttw:gap-2",
65
- children: [/* @__PURE__ */ m(c, {
66
- checked: M,
67
- onCheckedChange: (e) => e ? P() : F(),
68
- disabled: A || D.length === 0,
69
- "aria-label": x._("Products and services")
70
- }), /* @__PURE__ */ m(o, {
60
+ }),
61
+ /* @__PURE__ */ x("div", {
62
+ className: "ttw:flex ttw:items-center ttw:gap-4",
63
+ children: [/* @__PURE__ */ b(f, {
64
+ variant: "body2",
65
+ color: "muted",
66
+ className: "ttw:w-16 ttw:shrink-0",
67
+ children: k._("Subject")
68
+ }), /* @__PURE__ */ b(a, {
69
+ className: "ttw:flex-1",
70
+ value: W,
71
+ onChange: (e) => {
72
+ G(e.target.value), q(!0);
73
+ },
74
+ disabled: X
75
+ })]
76
+ }),
77
+ /* @__PURE__ */ x("div", {
78
+ className: "ttw:flex ttw:items-start ttw:gap-4",
79
+ children: [/* @__PURE__ */ b(f, {
80
+ variant: "body2",
81
+ color: "muted",
82
+ className: "ttw:w-16 ttw:shrink-0 ttw:pt-2",
83
+ children: k._("Message")
84
+ }), /* @__PURE__ */ b(o, {
85
+ className: "ttw:flex-1",
86
+ value: J,
87
+ onChange: (e) => Y(e.target.value),
88
+ placeholder: k._("e.g., Thank you for your business"),
89
+ disabled: X
90
+ })]
91
+ }),
92
+ H.length > 0 && /* @__PURE__ */ x("div", {
93
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pl-20",
94
+ children: [/* @__PURE__ */ x("div", {
95
+ className: "ttw:flex ttw:flex-col",
96
+ children: [/* @__PURE__ */ b(f, {
71
97
  variant: "body2",
72
- className: "ttw:font-semibold",
73
- children: x._("Products and services")
98
+ color: "muted",
99
+ children: k._("Attachments")
100
+ }), /* @__PURE__ */ b(f, {
101
+ variant: "caption",
102
+ color: "muted",
103
+ children: k._("To change what files are attached to the email, you will need to update the invoice.")
74
104
  })]
75
- }),
76
- /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(s, {}) }),
77
- D.map(({ key: e, lineItem: t }) => /* @__PURE__ */ h("li", {
78
- className: "ttw:flex ttw:items-start ttw:gap-2",
79
- children: [/* @__PURE__ */ m(c, {
80
- checked: O.has(e),
81
- onCheckedChange: () => I(e),
82
- disabled: A,
83
- "aria-label": t.product.name
84
- }), /* @__PURE__ */ h("div", {
85
- className: "ttw:flex ttw:flex-col ttw:gap-1",
86
- children: [/* @__PURE__ */ m(o, {
87
- variant: "caption",
88
- children: t.product.name
89
- }), /* @__PURE__ */ m(o, {
90
- variant: "caption",
91
- color: "muted",
92
- children: L(t)
93
- })]
94
- })]
95
- }, e))
96
- ]
97
- })]
105
+ }), /* @__PURE__ */ b("ul", {
106
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
107
+ children: H.map((e) => /* @__PURE__ */ x("li", {
108
+ className: "ttw:rounded-lg ttw:bg-muted ttw:px-2 ttw:py-1 ttw:text-sm ttw:font-medium",
109
+ children: [
110
+ e.name,
111
+ " ",
112
+ /* @__PURE__ */ x("span", {
113
+ className: "ttw:text-muted-foreground",
114
+ children: [
115
+ "(",
116
+ p(e.size),
117
+ ")"
118
+ ]
119
+ })
120
+ ]
121
+ }, e.id))
122
+ })]
123
+ })
124
+ ]
98
125
  }),
99
- /* @__PURE__ */ h(r, {
126
+ /* @__PURE__ */ x(l, {
100
127
  className: "ttw:flex ttw:flex-row ttw:gap-4 ttw:border-t ttw:border-border ttw:p-6",
101
- children: [/* @__PURE__ */ m(n, {
128
+ children: [/* @__PURE__ */ b(i, {
102
129
  type: "button",
103
130
  variant: "outline",
104
131
  className: "ttw:flex-1 ttw:border-border",
105
- disabled: A,
106
- onClick: b,
107
- children: x._("Skip")
108
- }), /* @__PURE__ */ m(n, {
132
+ disabled: X,
133
+ onClick: E,
134
+ children: O ? k._("Cancel") : k._("Skip")
135
+ }), /* @__PURE__ */ b(i, {
109
136
  type: "button",
110
137
  variant: "default",
111
138
  className: "ttw:flex-1",
112
- disabled: !N || A,
139
+ disabled: X || !W.trim() || !J.trim(),
113
140
  onClick: async () => {
114
- let e = D.filter((e) => O.has(e.key));
115
- if (e.length) {
116
- j(!0);
117
- try {
118
- await Promise.all(e.map(({ lineItem: e }) => E({ body: {
119
- name: e.product.name,
120
- type: "product",
121
- price: {
122
- value: e.product.price.value,
123
- currency: e.product.price?.currency ?? "USD"
124
- },
125
- ...e.product.measure_unit_id ? { measure_unit_id: e.product.measure_unit_id } : {},
126
- ...e.product.description ? { description: e.product.description } : {}
127
- } }))), await S.finops.getProducts.invalidateQueries(C), g.success(x._("Products and services saved.")), b();
128
- } catch {
129
- g.error(x._("Failed to save products and services."));
130
- } finally {
131
- j(!1);
132
- }
141
+ Z(!0);
142
+ try {
143
+ let e = F ? F.data.filter(({ status: e, direction: t }) => e === "active" && t === "receive") : [];
144
+ e.length === 0 ? S.error(k._("You haven't onboarded for any payment method. Invoice is sent without a payment link.")) : await L({
145
+ recipient: {
146
+ id: M,
147
+ type: "entity"
148
+ },
149
+ payment_methods: e.map((e) => e.type),
150
+ object: {
151
+ id: w,
152
+ type: "receivable"
153
+ }
154
+ }), await I({
155
+ path: { receivable_id: w },
156
+ body: {
157
+ subject_text: W,
158
+ body_text: J,
159
+ recipients: z ? { to: [z] } : void 0
160
+ }
161
+ }), await Promise.all([A.finops.getReceivables.invalidateQueries(j), A.finops.getReceivablesId.invalidateQueries({ parameters: { path: { receivable_id: w } } }, j)]), S.success(k._("Invoice sent successfully")), D();
162
+ } catch {
163
+ S.error(k._("Failed to send invoice."));
164
+ } finally {
165
+ Z(!1);
133
166
  }
134
167
  },
135
- children: x._("Save selected items")
168
+ children: k._("Send invoice")
136
169
  })]
137
170
  })
138
171
  ] });
139
172
  };
140
173
  //#endregion
141
- export { v as ActionsModalProductsStep };
174
+ export { w as ActionsModalIssueStep };
@@ -1,35 +1,141 @@
1
- import { Dialog as e, DialogContent as t } from "./index58.js";
2
- import { ActionsModalIssueStep as n } from "./index520.js";
3
- import { ActionsModalProductsStep as r } from "./index521.js";
4
- import { useState as i } from "react";
5
- import { jsx as a } from "@emotion/react/jsx-runtime";
6
- import { useLingui as o } from "@lingui/react";
1
+ import { useMoniteContext as e } from "./index47.js";
2
+ import { useCurrencies as t } from "./index63.js";
3
+ import { Button as n } from "./index56.js";
4
+ import "./index217.js";
5
+ import { DialogFooter as r, DialogHeader as i, DialogTitle as a } from "./index58.js";
6
+ import { Typography as o } from "./index62.js";
7
+ import { Separator as s } from "./index64.js";
8
+ import { Checkbox as c } from "./index103.js";
9
+ import { useGetMeasureUnits as l } from "./index458.js";
10
+ import { useMemo as u, useState as d } from "react";
11
+ import { Check as f } from "lucide-react";
12
+ import { Fragment as p, jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
13
+ import { toast as g } from "react-hot-toast";
14
+ import { useLingui as _ } from "@lingui/react";
7
15
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index522.js
8
- var s = ({ open: s, onClose: c, action: l, inlineLineItems: u, issue: d, isEditFlow: f = !1 }) => {
9
- let { i18n: p } = o(), [m, h] = i(d ? "issue" : "products"), [g, _] = i(null), v = (e) => {
10
- _(e), u.length > 0 ? h("products") : c();
11
- }, y = g === "sent" ? p._("Invoice sent") : g === "issued" || l === "issue" ? p._("Invoice issued") : l === "recurrence" ? p._("Recurring billing activated") : l === "update" ? p._("Invoice updated") : p._("Draft saved");
12
- return /* @__PURE__ */ a(e, {
13
- open: s,
14
- onOpenChange: (e) => {
15
- e || (m === "issue" ? v("issued") : c());
16
- },
17
- children: /* @__PURE__ */ a(t, {
18
- showCloseButton: !1,
19
- className: "ttw:gap-0 ttw:p-0 ttw:max-w-178 ttw:sm:max-w-178",
20
- children: m === "issue" && d ? /* @__PURE__ */ a(n, {
21
- receivableId: d.receivableId,
22
- counterpartId: d.counterpartId,
23
- isEditFlow: f,
24
- onSkip: () => v("issued"),
25
- onSent: () => v("sent")
26
- }) : /* @__PURE__ */ a(r, {
27
- inlineLineItems: u,
28
- title: y,
29
- onClose: c
16
+ var v = ({ inlineLineItems: v, title: y, onClose: b }) => {
17
+ let { i18n: x } = _(), { api: S, queryClient: C } = e(), { formatCurrencyToDisplay: w } = t(), { data: T } = l(), { mutateAsync: E } = S.finops.postProducts.useMutation(), D = u(() => v.map((e, t) => ({
18
+ key: e.id ?? String(t),
19
+ lineItem: e
20
+ })), [v]), [O, k] = d(() => new Set(D.map((e) => e.key))), [A, j] = d(!1), M = D.length > 0 && O.size === D.length, N = O.size > 0, P = () => k(new Set(D.map((e) => e.key))), F = () => k(/* @__PURE__ */ new Set()), I = (e) => k((t) => {
21
+ let n = new Set(t);
22
+ return n.has(e) ? n.delete(e) : n.add(e), n;
23
+ }), L = (e) => {
24
+ let t = w(e.product.price.value, e.product.price.currency) ?? "", n = e.product.measure_unit_id ? T?.data?.find((t) => t.id === e.product.measure_unit_id)?.name : void 0;
25
+ return n ? `${t} ${n}` : t;
26
+ };
27
+ return /* @__PURE__ */ h(p, { children: [
28
+ /* @__PURE__ */ m(i, {
29
+ className: "ttw:border-b ttw:border-border ttw:p-6",
30
+ children: /* @__PURE__ */ h(a, {
31
+ className: "ttw:flex ttw:flex-row ttw:items-center ttw:gap-4",
32
+ children: [/* @__PURE__ */ m("span", {
33
+ className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-emerald-200 ttw:bg-emerald-50",
34
+ children: /* @__PURE__ */ m(f, { className: "ttw:size-6 ttw:text-green-700" })
35
+ }), y]
30
36
  })
37
+ }),
38
+ /* @__PURE__ */ h("div", {
39
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:p-6",
40
+ children: [/* @__PURE__ */ h("div", {
41
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-1.5",
42
+ children: [/* @__PURE__ */ h("div", {
43
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
44
+ children: [/* @__PURE__ */ m(o, {
45
+ variant: "h4",
46
+ children: x._("Do you want to also save these items?")
47
+ }), /* @__PURE__ */ m(o, {
48
+ variant: "caption",
49
+ color: "muted",
50
+ children: x._("Saved items can be quickly added to future invoices.")
51
+ })]
52
+ }), /* @__PURE__ */ m(n, {
53
+ type: "button",
54
+ variant: "ghost",
55
+ className: "ttw:text-primary ttw:hover:text-primary",
56
+ disabled: A,
57
+ onClick: N ? F : P,
58
+ children: N ? x._("Deselect all") : x._("Select all")
59
+ })]
60
+ }), /* @__PURE__ */ h("ul", {
61
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
62
+ children: [
63
+ /* @__PURE__ */ h("li", {
64
+ className: "ttw:flex ttw:items-center ttw:gap-2",
65
+ children: [/* @__PURE__ */ m(c, {
66
+ checked: M,
67
+ onCheckedChange: (e) => e ? P() : F(),
68
+ disabled: A || D.length === 0,
69
+ "aria-label": x._("Products and services")
70
+ }), /* @__PURE__ */ m(o, {
71
+ variant: "body2",
72
+ className: "ttw:font-semibold",
73
+ children: x._("Products and services")
74
+ })]
75
+ }),
76
+ /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(s, {}) }),
77
+ D.map(({ key: e, lineItem: t }) => /* @__PURE__ */ h("li", {
78
+ className: "ttw:flex ttw:items-start ttw:gap-2",
79
+ children: [/* @__PURE__ */ m(c, {
80
+ checked: O.has(e),
81
+ onCheckedChange: () => I(e),
82
+ disabled: A,
83
+ "aria-label": t.product.name
84
+ }), /* @__PURE__ */ h("div", {
85
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
86
+ children: [/* @__PURE__ */ m(o, {
87
+ variant: "caption",
88
+ children: t.product.name
89
+ }), /* @__PURE__ */ m(o, {
90
+ variant: "caption",
91
+ color: "muted",
92
+ children: L(t)
93
+ })]
94
+ })]
95
+ }, e))
96
+ ]
97
+ })]
98
+ }),
99
+ /* @__PURE__ */ h(r, {
100
+ className: "ttw:flex ttw:flex-row ttw:gap-4 ttw:border-t ttw:border-border ttw:p-6",
101
+ children: [/* @__PURE__ */ m(n, {
102
+ type: "button",
103
+ variant: "outline",
104
+ className: "ttw:flex-1 ttw:border-border",
105
+ disabled: A,
106
+ onClick: b,
107
+ children: x._("Skip")
108
+ }), /* @__PURE__ */ m(n, {
109
+ type: "button",
110
+ variant: "default",
111
+ className: "ttw:flex-1",
112
+ disabled: !N || A,
113
+ onClick: async () => {
114
+ let e = D.filter((e) => O.has(e.key));
115
+ if (e.length) {
116
+ j(!0);
117
+ try {
118
+ await Promise.all(e.map(({ lineItem: e }) => E({ body: {
119
+ name: e.product.name,
120
+ type: "product",
121
+ price: {
122
+ value: e.product.price.value,
123
+ currency: e.product.price?.currency ?? "USD"
124
+ },
125
+ ...e.product.measure_unit_id ? { measure_unit_id: e.product.measure_unit_id } : {},
126
+ ...e.product.description ? { description: e.product.description } : {}
127
+ } }))), await S.finops.getProducts.invalidateQueries(C), g.success(x._("Products and services saved.")), b();
128
+ } catch {
129
+ g.error(x._("Failed to save products and services."));
130
+ } finally {
131
+ j(!1);
132
+ }
133
+ }
134
+ },
135
+ children: x._("Save selected items")
136
+ })]
31
137
  })
32
- });
138
+ ] });
33
139
  };
34
140
  //#endregion
35
- export { s as ActionsModal };
141
+ export { v as ActionsModalProductsStep };
@@ -1,119 +1,35 @@
1
- import { Scope as e } from "../../shared/data-access/dist/lib/scopes.js";
2
- import "../../shared/data-access/dist/index.js";
3
- import { useMoniteContext as t } from "./index47.js";
4
- import { Button as n } from "./index56.js";
5
- import { getDraftInvoiceValidationSchema as r, getInvoiceValidationSchema as i } from "./index98.js";
6
- import { useUserPermissions as a } from "./index116.js";
7
- import { useMeasureUnitsMapping as o } from "./index165.js";
8
- import { useGetRecurrenceById as s } from "./index168.js";
9
- import { willRecurrenceIssue as c } from "./index190.js";
10
- import { buildEditInvoiceFormValues as l } from "./index197.js";
11
- import "./index202.js";
12
- import { LoadingPage as u } from "./index260.js";
13
- import "./index261.js";
14
- import { useGetMeasureUnits as d } from "./index458.js";
15
- import { useReceivableSubmit as f } from "./index459.js";
16
- import { ReceivableFormLayout as p } from "./index511.js";
17
- import { useCallback as m, useEffect as h, useMemo as g, useRef as _ } from "react";
18
- import { Fragment as v, jsx as y, jsxs as b } from "@emotion/react/jsx-runtime";
19
- import { useLingui as x } from "@lingui/react";
20
- import { useForm as S } from "react-hook-form";
21
- import { zodResolver as C } from "@hookform/resolvers/zod";
1
+ import { Dialog as e, DialogContent as t } from "./index58.js";
2
+ import { ActionsModalIssueStep as n } from "./index521.js";
3
+ import { ActionsModalProductsStep as r } from "./index522.js";
4
+ import { useState as i } from "react";
5
+ import { jsx as a } from "@emotion/react/jsx-runtime";
6
+ import { useLingui as o } from "@lingui/react";
22
7
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js
23
- var w = (e) => {
24
- let { data: t, isLoading: n } = s(e.invoice.recurrence_id);
25
- return e.invoice.recurrence_id && n ? /* @__PURE__ */ y(u, {}) : /* @__PURE__ */ y(T, {
26
- ...e,
27
- recurrence: t
28
- });
29
- }, T = ({ invoice: s, onCancel: u, onUpdated: w, isOpen: T, recurrence: E, issueIntent: D, embeddedBankName: O }) => {
30
- let { i18n: k } = x(), { componentSettings: A } = t(), j = a().has(e.CounterpartWriteOrg), M = !!A?.receivables?.enableEntityBankAccount, N = _("draft"), { data: P } = d(), F = s.currency, I = g(() => l(s, E), [s, E]), L = g(() => E?.iterations?.filter((e) => e.issued_invoice_id).length ?? 0, [E?.iterations]), R = g(() => C(r(k, j, L)), [
31
- k,
32
- j,
33
- L
34
- ]), z = g(() => C(i(k, M, j, L)), [
35
- k,
36
- M,
37
- j,
38
- L
39
- ]), B = m((e, t, n) => (N.current === "issue" || c(e) && L === 0 ? z : R)(e, t, n), [
40
- z,
41
- R,
42
- L
43
- ]), V = S({
44
- mode: "onBlur",
45
- resolver: B,
46
- defaultValues: I
47
- }), { getValues: H, reset: U } = V;
48
- o(P, H, U);
49
- let W = !!E?.iterations?.some((e) => e.issued_invoice_id), G = f({
50
- mode: "edit",
51
- methods: V,
52
- currency: F,
53
- invoice: s,
54
- submitModeRef: N,
55
- existingRecurrence: E ? {
56
- id: E.id,
57
- scheduleLocked: W
58
- } : void 0,
59
- hasStartedRecurrence: L > 0,
60
- onComplete: (e) => w(e.receivable, {
61
- inlineLineItems: e.inlineLineItems,
62
- activatedRecurrence: e.mode === "recurrence",
63
- issued: e.mode === "issue",
64
- counterpartId: e.counterpartId,
65
- hasCustomerEmail: e.hasCustomerEmail
66
- }),
67
- onClose: u
68
- });
69
- return h(() => {
70
- D && G.highlightForIssue();
71
- }, []), /* @__PURE__ */ y(p, {
72
- open: T,
73
- onRequestClose: G.requestClose,
74
- methods: V,
75
- title: k._("Edit invoice"),
76
- currency: F,
77
- embeddedBankName: O,
78
- showPurchaseOrder: !1,
79
- lockRecurrenceSchedule: W,
80
- formName: G.formName,
81
- onSubmit: G.onSubmit,
82
- formScrollRef: G.formScrollRef,
83
- registerLineItemCleanupFn: G.registerLineItemCleanupFn,
84
- onAttachmentsUploadingChange: G.onAttachmentsUploadingChange,
85
- disabled: G.isLoading,
86
- closeDisabled: G.isSaving,
87
- discardModal: G.discardModal,
88
- footer: /* @__PURE__ */ b(v, { children: [
89
- /* @__PURE__ */ y(n, {
90
- variant: "outline",
91
- className: "ttw:border-border",
92
- onClick: G.requestClose,
93
- disabled: G.isSaving || G.attachmentsUploading,
94
- children: k._("Cancel")
95
- }),
96
- !G.isRecurrenceEnabled && /* @__PURE__ */ y(n, {
97
- variant: "secondary",
98
- type: "submit",
99
- form: G.formName,
100
- disabled: G.isLoading || G.attachmentsUploading,
101
- onClick: () => {
102
- G.submitModeRef.current = "draft";
103
- },
104
- children: k._("Update draft")
105
- }),
106
- /* @__PURE__ */ y(n, {
107
- type: "submit",
108
- form: G.formName,
109
- disabled: G.isLoading || G.attachmentsUploading || G.isIssuePreflightLoading || !G.isRecurrenceEnabled && G.isCustomerEmailLoading,
110
- onClick: () => {
111
- G.submitModeRef.current = G.isRecurrenceEnabled ? "draft" : "issue";
112
- },
113
- children: G.isRecurrenceEnabled ? E ? k._("Update recurring billing schedule") : k._("Activate recurring billing schedule") : k._("Issue invoice")
114
- }, "next")
115
- ] })
8
+ var s = ({ open: s, onClose: c, action: l, inlineLineItems: u, issue: d, isEditFlow: f = !1 }) => {
9
+ let { i18n: p } = o(), [m, h] = i(d ? "issue" : "products"), [g, _] = i(null), v = (e) => {
10
+ _(e), u.length > 0 ? h("products") : c();
11
+ }, y = g === "sent" ? p._("Invoice sent") : g === "issued" || l === "issue" ? p._("Invoice issued") : l === "recurrence" ? p._("Recurring billing activated") : l === "update" ? p._("Invoice updated") : p._("Draft saved");
12
+ return /* @__PURE__ */ a(e, {
13
+ open: s,
14
+ onOpenChange: (e) => {
15
+ e || (m === "issue" ? v("issued") : c());
16
+ },
17
+ children: /* @__PURE__ */ a(t, {
18
+ showCloseButton: !1,
19
+ className: "ttw:gap-0 ttw:p-0 ttw:max-w-178 ttw:sm:max-w-178",
20
+ children: m === "issue" && d ? /* @__PURE__ */ a(n, {
21
+ receivableId: d.receivableId,
22
+ counterpartId: d.counterpartId,
23
+ isEditFlow: f,
24
+ onSkip: () => v("issued"),
25
+ onSent: () => v("sent")
26
+ }) : /* @__PURE__ */ a(r, {
27
+ inlineLineItems: u,
28
+ title: y,
29
+ onClose: c
30
+ })
31
+ })
116
32
  });
117
33
  };
118
34
  //#endregion
119
- export { w as EditInvoiceDetails };
35
+ export { s as ActionsModal };