@senitix/ui 0.4.1 → 0.4.3

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 (393) hide show
  1. package/dist/accordion-BcwB0wwz.cjs +2 -0
  2. package/dist/accordion-BcwB0wwz.cjs.map +1 -0
  3. package/dist/accordion-BwnJKrKm.js +360 -0
  4. package/dist/accordion-BwnJKrKm.js.map +1 -0
  5. package/dist/appointment-scheduler-BoQQO51F.cjs +2 -0
  6. package/dist/appointment-scheduler-BoQQO51F.cjs.map +1 -0
  7. package/dist/appointment-scheduler-DHAs-mF_.js +192 -0
  8. package/dist/appointment-scheduler-DHAs-mF_.js.map +1 -0
  9. package/dist/arrow-right-CM3nmiZe.js +15 -0
  10. package/dist/arrow-right-CM3nmiZe.js.map +1 -0
  11. package/dist/arrow-right-vDxRZOfm.cjs +7 -0
  12. package/dist/arrow-right-vDxRZOfm.cjs.map +1 -0
  13. package/dist/avatar-BlEcWE7T.js +191 -0
  14. package/dist/avatar-BlEcWE7T.js.map +1 -0
  15. package/dist/avatar-Cl38Ye4J.cjs +2 -0
  16. package/dist/avatar-Cl38Ye4J.cjs.map +1 -0
  17. package/dist/badge-BZcdBG5J.cjs +23 -0
  18. package/dist/badge-BZcdBG5J.cjs.map +1 -0
  19. package/dist/badge-D0C_rP2l.js +157 -0
  20. package/dist/badge-D0C_rP2l.js.map +1 -0
  21. package/dist/button-BP_ug5gP.js +126 -0
  22. package/dist/button-BP_ug5gP.js.map +1 -0
  23. package/dist/button-CPuCii0R.cjs +2 -0
  24. package/dist/button-CPuCii0R.cjs.map +1 -0
  25. package/dist/{calendar-DgnhzEfp.js → calendar-86qoSnO7.js} +368 -433
  26. package/dist/calendar-86qoSnO7.js.map +1 -0
  27. package/dist/{calendar-D3RWU0_G.cjs → calendar-BH-AuyiB.cjs} +2 -2
  28. package/dist/{calendar-D3RWU0_G.cjs.map → calendar-BH-AuyiB.cjs.map} +1 -1
  29. package/dist/calendar-CSJ060ym.cjs +2 -0
  30. package/dist/calendar-CSJ060ym.cjs.map +1 -0
  31. package/dist/{calendar-CUxm1K7J.js → calendar-JUSWONQ0.js} +2 -2
  32. package/dist/{calendar-CUxm1K7J.js.map → calendar-JUSWONQ0.js.map} +1 -1
  33. package/dist/{card-DISL3sPJ.cjs → card-CToWUN1K.cjs} +2 -2
  34. package/dist/{card-DISL3sPJ.cjs.map → card-CToWUN1K.cjs.map} +1 -1
  35. package/dist/{card-fId5vof_.js → card-yxbWFvZ1.js} +2 -2
  36. package/dist/{card-fId5vof_.js.map → card-yxbWFvZ1.js.map} +1 -1
  37. package/dist/checkbox-BmugT50K.cjs +2 -0
  38. package/dist/checkbox-BmugT50K.cjs.map +1 -0
  39. package/dist/{checkbox-BY2zxQVv.js → checkbox-CTa9e4SG.js} +95 -97
  40. package/dist/checkbox-CTa9e4SG.js.map +1 -0
  41. package/dist/chevron-left-5h87iFo_.cjs +7 -0
  42. package/dist/chevron-left-5h87iFo_.cjs.map +1 -0
  43. package/dist/chevron-left-DD5mQuvf.js +14 -0
  44. package/dist/chevron-left-DD5mQuvf.js.map +1 -0
  45. package/dist/{chevron-right-Bxf8i4gi.cjs → chevron-right-D-TdAZ7l.cjs} +2 -2
  46. package/dist/{chevron-right-Bxf8i4gi.cjs.map → chevron-right-D-TdAZ7l.cjs.map} +1 -1
  47. package/dist/{chevron-right-BLyGmyaF.js → chevron-right-Di90aqSn.js} +2 -2
  48. package/dist/{chevron-right-BLyGmyaF.js.map → chevron-right-Di90aqSn.js.map} +1 -1
  49. package/dist/chevron-up-Bq55Db6X.cjs +7 -0
  50. package/dist/{chevron-up-C3RClqXD.cjs.map → chevron-up-Bq55Db6X.cjs.map} +1 -1
  51. package/dist/{chevron-up-BmYZUtrk.js → chevron-up-Dr7EIn9V.js} +2 -2
  52. package/dist/{chevron-up-BmYZUtrk.js.map → chevron-up-Dr7EIn9V.js.map} +1 -1
  53. package/dist/clock-BjJE8PGr.js +15 -0
  54. package/dist/clock-BjJE8PGr.js.map +1 -0
  55. package/dist/clock-CnxBAA_O.cjs +7 -0
  56. package/dist/clock-CnxBAA_O.cjs.map +1 -0
  57. package/dist/command-BEpaOk-5.cjs +2 -0
  58. package/dist/command-BEpaOk-5.cjs.map +1 -0
  59. package/dist/command-CYhMM7gX.js +404 -0
  60. package/dist/command-CYhMM7gX.js.map +1 -0
  61. package/dist/components/builders/index.cjs.js +2 -0
  62. package/dist/components/builders/index.cjs.js.map +1 -0
  63. package/dist/components/builders/index.es.js +42 -0
  64. package/dist/components/builders/index.es.js.map +1 -0
  65. package/dist/components/charts/index.cjs.js +1 -1
  66. package/dist/components/charts/index.es.js +7 -6
  67. package/dist/components/charts/index.es.js.map +1 -1
  68. package/dist/components/data-display/index.cjs.js +1 -1
  69. package/dist/components/data-display/index.es.js +43 -20
  70. package/dist/components/dnd/index.cjs.js +1 -1
  71. package/dist/components/dnd/index.es.js +1 -1
  72. package/dist/components/feedback/index.cjs.js +1 -1
  73. package/dist/components/feedback/index.es.js +1 -1
  74. package/dist/components/forms/index.cjs.js +1 -1
  75. package/dist/components/forms/index.es.js +24 -23
  76. package/dist/components/forms/index.es.js.map +1 -1
  77. package/dist/components/layouts/index.cjs.js +1 -1
  78. package/dist/components/layouts/index.es.js +45 -21
  79. package/dist/components/messaging/index.cjs.js +2 -0
  80. package/dist/components/messaging/index.cjs.js.map +1 -0
  81. package/dist/components/messaging/index.es.js +15 -0
  82. package/dist/components/messaging/index.es.js.map +1 -0
  83. package/dist/components/navigation/index.cjs.js +1 -1
  84. package/dist/components/navigation/index.es.js +1 -1
  85. package/dist/components/scheduling/index.cjs.js +2 -0
  86. package/dist/components/scheduling/index.cjs.js.map +1 -0
  87. package/dist/components/scheduling/index.es.js +6 -0
  88. package/dist/components/scheduling/index.es.js.map +1 -0
  89. package/dist/components/ui/index.cjs.js +1 -1
  90. package/dist/components/ui/index.es.js +168 -158
  91. package/dist/components/ui/index.es.js.map +1 -1
  92. package/dist/dialog-Cr9SYCaD.cjs +6 -0
  93. package/dist/dialog-Cr9SYCaD.cjs.map +1 -0
  94. package/dist/dialog-MYAx3Qrc.js +387 -0
  95. package/dist/dialog-MYAx3Qrc.js.map +1 -0
  96. package/dist/dropdown-menu-CkCCV_tw.js +969 -0
  97. package/dist/dropdown-menu-CkCCV_tw.js.map +1 -0
  98. package/dist/dropdown-menu-ejikFvg2.cjs +7 -0
  99. package/dist/dropdown-menu-ejikFvg2.cjs.map +1 -0
  100. package/dist/{ellipsis-6eUne95u.js → ellipsis-CKhpjj5H.js} +2 -2
  101. package/dist/{ellipsis-6eUne95u.js.map → ellipsis-CKhpjj5H.js.map} +1 -1
  102. package/dist/{ellipsis-DkM3GBF5.cjs → ellipsis-Dk7Wfc4i.cjs} +3 -3
  103. package/dist/{ellipsis-DkM3GBF5.cjs.map → ellipsis-Dk7Wfc4i.cjs.map} +1 -1
  104. package/dist/external-link-CGBqsrbm.cjs +7 -0
  105. package/dist/external-link-CGBqsrbm.cjs.map +1 -0
  106. package/dist/external-link-UeWW0ty3.js +16 -0
  107. package/dist/external-link-UeWW0ty3.js.map +1 -0
  108. package/dist/eye-Cved4eAo.cjs +7 -0
  109. package/dist/eye-Cved4eAo.cjs.map +1 -0
  110. package/dist/eye-KdCUpmO8.js +21 -0
  111. package/dist/eye-KdCUpmO8.js.map +1 -0
  112. package/dist/{file-Cw_u_aJB.js → file-CHbdXCWO.js} +2 -2
  113. package/dist/{file-Cw_u_aJB.js.map → file-CHbdXCWO.js.map} +1 -1
  114. package/dist/{file-Cp5UoYUZ.cjs → file-CqYRamm8.cjs} +3 -3
  115. package/dist/{file-Cp5UoYUZ.cjs.map → file-CqYRamm8.cjs.map} +1 -1
  116. package/dist/file-spreadsheet-CpySxI0-.cjs +7 -0
  117. package/dist/file-spreadsheet-CpySxI0-.cjs.map +1 -0
  118. package/dist/file-spreadsheet-EqZMR-mM.js +19 -0
  119. package/dist/file-spreadsheet-EqZMR-mM.js.map +1 -0
  120. package/dist/form-preview-Bm5xHtkw.js +12075 -0
  121. package/dist/form-preview-Bm5xHtkw.js.map +1 -0
  122. package/dist/form-preview-IPEZdspX.cjs +111 -0
  123. package/dist/form-preview-IPEZdspX.cjs.map +1 -0
  124. package/dist/full-calendar-4Ut52QNO.cjs +18 -0
  125. package/dist/full-calendar-4Ut52QNO.cjs.map +1 -0
  126. package/dist/full-calendar-DD_tBy69.js +2631 -0
  127. package/dist/full-calendar-DD_tBy69.js.map +1 -0
  128. package/dist/funnel-chart-Dfj1pOyV.cjs +6 -0
  129. package/dist/funnel-chart-Dfj1pOyV.cjs.map +1 -0
  130. package/dist/funnel-chart-o9qcEMgg.js +2952 -0
  131. package/dist/funnel-chart-o9qcEMgg.js.map +1 -0
  132. package/dist/global-search-DcBKVaM4.cjs +22 -0
  133. package/dist/global-search-DcBKVaM4.cjs.map +1 -0
  134. package/dist/global-search-Dul9CD6-.js +1331 -0
  135. package/dist/global-search-Dul9CD6-.js.map +1 -0
  136. package/dist/hooks/index.cjs.js +1 -1
  137. package/dist/hooks/index.es.js +9 -7
  138. package/dist/hooks/index.es.js.map +1 -1
  139. package/dist/{index-DtaLkIY8.js → index-BGUveO6l.js} +84 -79
  140. package/dist/{index-DtaLkIY8.js.map → index-BGUveO6l.js.map} +1 -1
  141. package/dist/{index-gVbM3K4f.cjs → index-Bhee6XHk.cjs} +2 -2
  142. package/dist/{index-gVbM3K4f.cjs.map → index-Bhee6XHk.cjs.map} +1 -1
  143. package/dist/index-CrSlyWAA.js +1090 -0
  144. package/dist/index-CrSlyWAA.js.map +1 -0
  145. package/dist/{index-Dk_Et2WJ.js → index-D8-pHJim.js} +2 -2
  146. package/dist/{index-Dk_Et2WJ.js.map → index-D8-pHJim.js.map} +1 -1
  147. package/dist/index-Dy_9oyP3.cjs +2 -0
  148. package/dist/{index-D2U2F80P.cjs.map → index-Dy_9oyP3.cjs.map} +1 -1
  149. package/dist/index-hnbbvGmb.cjs +21 -0
  150. package/dist/index-hnbbvGmb.cjs.map +1 -0
  151. package/dist/index.cjs.js +1 -1
  152. package/dist/index.es.js +434 -319
  153. package/dist/index.es.js.map +1 -1
  154. package/dist/input-Pfq8fkiV.js +2718 -0
  155. package/dist/input-Pfq8fkiV.js.map +1 -0
  156. package/dist/input-UBp7V7li.cjs +52 -0
  157. package/dist/input-UBp7V7li.cjs.map +1 -0
  158. package/dist/label-CExiitfO.js +50 -0
  159. package/dist/label-CExiitfO.js.map +1 -0
  160. package/dist/label-F0zGAiI2.cjs +2 -0
  161. package/dist/label-F0zGAiI2.cjs.map +1 -0
  162. package/dist/loader-circle-CBVYGIRp.js +14 -0
  163. package/dist/loader-circle-CBVYGIRp.js.map +1 -0
  164. package/dist/loader-circle-IaJKvYsP.cjs +7 -0
  165. package/dist/loader-circle-IaJKvYsP.cjs.map +1 -0
  166. package/dist/locale-provider-BHGNO4j7.js +1786 -0
  167. package/dist/locale-provider-BHGNO4j7.js.map +1 -0
  168. package/dist/locale-provider-BScpm-eC.cjs +2 -0
  169. package/dist/locale-provider-BScpm-eC.cjs.map +1 -0
  170. package/dist/locale-selector-CRC0VBKl.cjs +12 -0
  171. package/dist/locale-selector-CRC0VBKl.cjs.map +1 -0
  172. package/dist/locale-selector-HuzfE0zZ.js +1740 -0
  173. package/dist/locale-selector-HuzfE0zZ.js.map +1 -0
  174. package/dist/map-pin-CHh0xl6i.js +46 -0
  175. package/dist/map-pin-CHh0xl6i.js.map +1 -0
  176. package/dist/map-pin-DGObSZ40.cjs +17 -0
  177. package/dist/map-pin-DGObSZ40.cjs.map +1 -0
  178. package/dist/message-square-B_xLey5D.js +14 -0
  179. package/dist/message-square-B_xLey5D.js.map +1 -0
  180. package/dist/message-square-_69ua8rH.cjs +7 -0
  181. package/dist/message-square-_69ua8rH.cjs.map +1 -0
  182. package/dist/minus-BUFkTM0k.cjs +7 -0
  183. package/dist/{minus-C0uyaz70.cjs.map → minus-BUFkTM0k.cjs.map} +1 -1
  184. package/dist/{minus-CiwV65ZG.js → minus-DJ0tmymW.js} +2 -2
  185. package/dist/{minus-CiwV65ZG.js.map → minus-DJ0tmymW.js.map} +1 -1
  186. package/dist/multi-container-CytCGxsc.cjs +7 -0
  187. package/dist/multi-container-CytCGxsc.cjs.map +1 -0
  188. package/dist/multi-container-DmkgnCJN.js +799 -0
  189. package/dist/multi-container-DmkgnCJN.js.map +1 -0
  190. package/dist/multi-select-Bj_kIDHE.cjs +7 -0
  191. package/dist/multi-select-Bj_kIDHE.cjs.map +1 -0
  192. package/dist/multi-select-CPF7w871.js +224 -0
  193. package/dist/multi-select-CPF7w871.js.map +1 -0
  194. package/dist/pencil-BJULwaDl.cjs +12 -0
  195. package/dist/pencil-BJULwaDl.cjs.map +1 -0
  196. package/dist/pencil-HL0trGIs.js +31 -0
  197. package/dist/pencil-HL0trGIs.js.map +1 -0
  198. package/dist/permission-matrix-BRqw2RPb.js +6128 -0
  199. package/dist/permission-matrix-BRqw2RPb.js.map +1 -0
  200. package/dist/permission-matrix-CqE8q8Hi.cjs +93 -0
  201. package/dist/permission-matrix-CqE8q8Hi.cjs.map +1 -0
  202. package/dist/phone-B0J1dGIE.js +31 -0
  203. package/dist/phone-B0J1dGIE.js.map +1 -0
  204. package/dist/phone-DPA6vucM.cjs +12 -0
  205. package/dist/phone-DPA6vucM.cjs.map +1 -0
  206. package/dist/plus-Bcuujcqd.cjs +7 -0
  207. package/dist/{plus-BsV82JJ5.cjs.map → plus-Bcuujcqd.cjs.map} +1 -1
  208. package/dist/{plus-DxD6rofl.js → plus-D7DMDKb8.js} +2 -2
  209. package/dist/{plus-DxD6rofl.js.map → plus-D7DMDKb8.js.map} +1 -1
  210. package/dist/popover-Bba1ELMX.cjs +2 -0
  211. package/dist/popover-Bba1ELMX.cjs.map +1 -0
  212. package/dist/popover-CZWAuYUL.js +281 -0
  213. package/dist/popover-CZWAuYUL.js.map +1 -0
  214. package/dist/progress-BPpsmZ48.js +218 -0
  215. package/dist/progress-BPpsmZ48.js.map +1 -0
  216. package/dist/progress-BrzjVhWG.cjs +22 -0
  217. package/dist/progress-BrzjVhWG.cjs.map +1 -0
  218. package/dist/providers/index.cjs.js +1 -1
  219. package/dist/providers/index.es.js +1 -1
  220. package/dist/radio-group-B9RM_c7e.js +244 -0
  221. package/dist/radio-group-B9RM_c7e.js.map +1 -0
  222. package/dist/radio-group-_n8TTqNQ.cjs +2 -0
  223. package/dist/radio-group-_n8TTqNQ.cjs.map +1 -0
  224. package/dist/record-dialog-footer-DbH9A6eA.js +2577 -0
  225. package/dist/record-dialog-footer-DbH9A6eA.js.map +1 -0
  226. package/dist/record-dialog-footer-DpDxH5wX.cjs +37 -0
  227. package/dist/record-dialog-footer-DpDxH5wX.cjs.map +1 -0
  228. package/dist/scroll-area-CGNbDUBQ.js +889 -0
  229. package/dist/scroll-area-CGNbDUBQ.js.map +1 -0
  230. package/dist/scroll-area-HsTSI_58.cjs +22 -0
  231. package/dist/scroll-area-HsTSI_58.cjs.map +1 -0
  232. package/dist/select-CEsYpjPi.cjs +2 -0
  233. package/dist/select-CEsYpjPi.cjs.map +1 -0
  234. package/dist/{select-BJpZrtep.js → select-Ce2C2acZ.js} +184 -179
  235. package/dist/select-Ce2C2acZ.js.map +1 -0
  236. package/dist/send-DIkOd-pu.js +21 -0
  237. package/dist/send-DIkOd-pu.js.map +1 -0
  238. package/dist/send-H6HC-rS8.cjs +7 -0
  239. package/dist/send-H6HC-rS8.cjs.map +1 -0
  240. package/dist/shared-inbox-Bv0AgLew.js +702 -0
  241. package/dist/shared-inbox-Bv0AgLew.js.map +1 -0
  242. package/dist/shared-inbox-DWEKfDX3.cjs +22 -0
  243. package/dist/shared-inbox-DWEKfDX3.cjs.map +1 -0
  244. package/dist/sheet-DTimb4SJ.cjs +2 -0
  245. package/dist/sheet-DTimb4SJ.cjs.map +1 -0
  246. package/dist/sheet-DgpAPCAp.js +147 -0
  247. package/dist/sheet-DgpAPCAp.js.map +1 -0
  248. package/dist/{skeleton-Bl6FAxHT.js → skeleton-C_dwS3_6.js} +2 -2
  249. package/dist/{skeleton-Bl6FAxHT.js.map → skeleton-C_dwS3_6.js.map} +1 -1
  250. package/dist/{skeleton-Cb6MWerF.cjs → skeleton-D3YsjVWD.cjs} +2 -2
  251. package/dist/{skeleton-Cb6MWerF.cjs.map → skeleton-D3YsjVWD.cjs.map} +1 -1
  252. package/dist/sparkline-chart-BP4bk24J.js +15881 -0
  253. package/dist/sparkline-chart-BP4bk24J.js.map +1 -0
  254. package/dist/sparkline-chart-D6SLZVjp.cjs +79 -0
  255. package/dist/sparkline-chart-D6SLZVjp.cjs.map +1 -0
  256. package/dist/styles.css +1 -1
  257. package/dist/switch-AEZvZSRV.cjs +2 -0
  258. package/dist/switch-AEZvZSRV.cjs.map +1 -0
  259. package/dist/switch-BF4LLvaU.js +147 -0
  260. package/dist/switch-BF4LLvaU.js.map +1 -0
  261. package/dist/table-2-Bn-YjZ9s.cjs +17 -0
  262. package/dist/table-2-Bn-YjZ9s.cjs.map +1 -0
  263. package/dist/table-2-C7E_N72K.js +52 -0
  264. package/dist/table-2-C7E_N72K.js.map +1 -0
  265. package/dist/textarea-4qZDuQ-C.js +206 -0
  266. package/dist/textarea-4qZDuQ-C.js.map +1 -0
  267. package/dist/textarea-Bq_zyt0L.cjs +2 -0
  268. package/dist/textarea-Bq_zyt0L.cjs.map +1 -0
  269. package/dist/tooltip-Dd7le9EO.cjs +2 -0
  270. package/dist/tooltip-Dd7le9EO.cjs.map +1 -0
  271. package/dist/tooltip-Dee-pNPI.js +338 -0
  272. package/dist/tooltip-Dee-pNPI.js.map +1 -0
  273. package/dist/trash-2-B3EP3JfM.js +18 -0
  274. package/dist/trash-2-B3EP3JfM.js.map +1 -0
  275. package/dist/trash-2-DWEeKlWT.cjs +7 -0
  276. package/dist/trash-2-DWEeKlWT.cjs.map +1 -0
  277. package/dist/{trending-up-BHFXgLWy.js → trending-up-ljWtN4pj.js} +2 -2
  278. package/dist/{trending-up-BHFXgLWy.js.map → trending-up-ljWtN4pj.js.map} +1 -1
  279. package/dist/{trending-up-BBjz_E69.cjs → trending-up-mLgmkp--.cjs} +2 -2
  280. package/dist/{trending-up-BBjz_E69.cjs.map → trending-up-mLgmkp--.cjs.map} +1 -1
  281. package/dist/upload-2tm-XihE.cjs +7 -0
  282. package/dist/upload-2tm-XihE.cjs.map +1 -0
  283. package/dist/upload-C_JDP8O0.js +16 -0
  284. package/dist/upload-C_JDP8O0.js.map +1 -0
  285. package/dist/use-controllable-state-3ATd6Fqd.cjs +2 -0
  286. package/dist/use-controllable-state-3ATd6Fqd.cjs.map +1 -0
  287. package/dist/use-controllable-state-CEa-Zlq6.js +23 -0
  288. package/dist/use-controllable-state-CEa-Zlq6.js.map +1 -0
  289. package/dist/use-formatters-Bb0fX1lW.cjs +2 -0
  290. package/dist/{use-formatters-CObUgipW.cjs.map → use-formatters-Bb0fX1lW.cjs.map} +1 -1
  291. package/dist/{use-formatters-Bgj3JA4i.js → use-formatters-xeMS4gdV.js} +1160 -1165
  292. package/dist/{use-formatters-Bgj3JA4i.js.map → use-formatters-xeMS4gdV.js.map} +1 -1
  293. package/dist/utils/index.cjs.js +1 -1
  294. package/dist/utils/index.es.js +1 -1
  295. package/dist/welcome-card-Ccbl_miQ.js +1007 -0
  296. package/dist/welcome-card-Ccbl_miQ.js.map +1 -0
  297. package/dist/welcome-card-D-ShMkaS.cjs +37 -0
  298. package/dist/welcome-card-D-ShMkaS.cjs.map +1 -0
  299. package/dist/x-BBkgEhUv.js +15 -0
  300. package/dist/x-BBkgEhUv.js.map +1 -0
  301. package/dist/x-D-El5XAY.cjs +7 -0
  302. package/dist/x-D-El5XAY.cjs.map +1 -0
  303. package/package.json +20 -2
  304. package/dist/avatar-BT_SPwFW.cjs +0 -18
  305. package/dist/avatar-BT_SPwFW.cjs.map +0 -1
  306. package/dist/avatar-C5-ZWIqT.js +0 -305
  307. package/dist/avatar-C5-ZWIqT.js.map +0 -1
  308. package/dist/calendar-BF5drX5u.cjs +0 -12
  309. package/dist/calendar-BF5drX5u.cjs.map +0 -1
  310. package/dist/calendar-DgnhzEfp.js.map +0 -1
  311. package/dist/checkbox-BY2zxQVv.js.map +0 -1
  312. package/dist/checkbox-CL6u7vL6.cjs +0 -2
  313. package/dist/checkbox-CL6u7vL6.cjs.map +0 -1
  314. package/dist/chevron-down-BiUlxZA-.js +0 -14
  315. package/dist/chevron-down-BiUlxZA-.js.map +0 -1
  316. package/dist/chevron-down-Ce0kqXiD.cjs +0 -7
  317. package/dist/chevron-down-Ce0kqXiD.cjs.map +0 -1
  318. package/dist/chevron-up-C3RClqXD.cjs +0 -7
  319. package/dist/createLucideIcon-BC8wu-bu.js +0 -80
  320. package/dist/createLucideIcon-BC8wu-bu.js.map +0 -1
  321. package/dist/createLucideIcon-Cv8nC2E9.cjs +0 -22
  322. package/dist/createLucideIcon-Cv8nC2E9.cjs.map +0 -1
  323. package/dist/filter-tags-DoRzXjuY.cjs +0 -48
  324. package/dist/filter-tags-DoRzXjuY.cjs.map +0 -1
  325. package/dist/filter-tags-zEQmRhEU.js +0 -2712
  326. package/dist/filter-tags-zEQmRhEU.js.map +0 -1
  327. package/dist/full-calendar-5Z4JSj8g.js +0 -3551
  328. package/dist/full-calendar-5Z4JSj8g.js.map +0 -1
  329. package/dist/full-calendar-DjAvCfuE.cjs +0 -23
  330. package/dist/full-calendar-DjAvCfuE.cjs.map +0 -1
  331. package/dist/global-search-BbZfc-VL.js +0 -1216
  332. package/dist/global-search-BbZfc-VL.js.map +0 -1
  333. package/dist/global-search-Bd74_wPV.cjs +0 -22
  334. package/dist/global-search-Bd74_wPV.cjs.map +0 -1
  335. package/dist/index-D2U2F80P.cjs +0 -2
  336. package/dist/index-DG0KV-sw.cjs +0 -11
  337. package/dist/index-DG0KV-sw.cjs.map +0 -1
  338. package/dist/index-XnFSmCuh.js +0 -299
  339. package/dist/index-XnFSmCuh.js.map +0 -1
  340. package/dist/input-BgPy-4Qu.js +0 -3658
  341. package/dist/input-BgPy-4Qu.js.map +0 -1
  342. package/dist/input-Cfr2WB-P.cjs +0 -47
  343. package/dist/input-Cfr2WB-P.cjs.map +0 -1
  344. package/dist/locale-provider-BojNdf1Y.cjs +0 -2
  345. package/dist/locale-provider-BojNdf1Y.cjs.map +0 -1
  346. package/dist/locale-provider-DzBeb-X3.js +0 -1013
  347. package/dist/locale-provider-DzBeb-X3.js.map +0 -1
  348. package/dist/locale-selector-BD1IWk6X.cjs +0 -22
  349. package/dist/locale-selector-BD1IWk6X.cjs.map +0 -1
  350. package/dist/locale-selector-DLRSyVye.js +0 -1772
  351. package/dist/locale-selector-DLRSyVye.js.map +0 -1
  352. package/dist/minus-C0uyaz70.cjs +0 -7
  353. package/dist/multi-container-BZia7HCU.js +0 -748
  354. package/dist/multi-container-BZia7HCU.js.map +0 -1
  355. package/dist/multi-container-BdNbgtPZ.cjs +0 -7
  356. package/dist/multi-container-BdNbgtPZ.cjs.map +0 -1
  357. package/dist/pipeline-Dh052Dvj.cjs +0 -27
  358. package/dist/pipeline-Dh052Dvj.cjs.map +0 -1
  359. package/dist/pipeline-DqWvleNy.js +0 -1076
  360. package/dist/pipeline-DqWvleNy.js.map +0 -1
  361. package/dist/plus-BsV82JJ5.cjs +0 -7
  362. package/dist/popover-BgLxmm1z.cjs +0 -7
  363. package/dist/popover-BgLxmm1z.cjs.map +0 -1
  364. package/dist/popover-PI9jbhnS.js +0 -775
  365. package/dist/popover-PI9jbhnS.js.map +0 -1
  366. package/dist/progress-CTTt_CP3.js +0 -260
  367. package/dist/progress-CTTt_CP3.js.map +0 -1
  368. package/dist/progress-CTWb7X1Q.cjs +0 -37
  369. package/dist/progress-CTWb7X1Q.cjs.map +0 -1
  370. package/dist/scroll-area-A3jGu-Ta.js +0 -974
  371. package/dist/scroll-area-A3jGu-Ta.js.map +0 -1
  372. package/dist/scroll-area-DzDnWIYJ.cjs +0 -12
  373. package/dist/scroll-area-DzDnWIYJ.cjs.map +0 -1
  374. package/dist/select-BJpZrtep.js.map +0 -1
  375. package/dist/select-Ii8HRuXa.cjs +0 -2
  376. package/dist/select-Ii8HRuXa.cjs.map +0 -1
  377. package/dist/separator-BzcDE0Ei.cjs +0 -2
  378. package/dist/separator-BzcDE0Ei.cjs.map +0 -1
  379. package/dist/separator-DyarVo1-.js +0 -396
  380. package/dist/separator-DyarVo1-.js.map +0 -1
  381. package/dist/sheet-DPSdOoE6.js +0 -84
  382. package/dist/sheet-DPSdOoE6.js.map +0 -1
  383. package/dist/sheet-XtjvbEMq.cjs +0 -2
  384. package/dist/sheet-XtjvbEMq.cjs.map +0 -1
  385. package/dist/sparkline-chart-CeCDeMNk.cjs +0 -102
  386. package/dist/sparkline-chart-CeCDeMNk.cjs.map +0 -1
  387. package/dist/sparkline-chart-DUS4CoW_.js +0 -19787
  388. package/dist/sparkline-chart-DUS4CoW_.js.map +0 -1
  389. package/dist/use-formatters-CObUgipW.cjs +0 -2
  390. package/dist/welcome-card-CNuEa6Ck.cjs +0 -67
  391. package/dist/welcome-card-CNuEa6Ck.cjs.map +0 -1
  392. package/dist/welcome-card-Cp6t6G3j.js +0 -1041
  393. package/dist/welcome-card-Cp6t6G3j.js.map +0 -1
@@ -0,0 +1,2577 @@
1
+ import { jsx as e, jsxs as a, Fragment as _ } from "react/jsx-runtime";
2
+ import * as g from "react";
3
+ import { useState as ue } from "react";
4
+ import { c as b } from "./index-BGUveO6l.js";
5
+ import { u as Ze } from "./use-mobile-C-LMK4T8.js";
6
+ import { u as K } from "./use-controllable-state-CEa-Zlq6.js";
7
+ import { a as he, f as pe, S as me } from "./sheet-DgpAPCAp.js";
8
+ import { c as H, S as L, a as et } from "./scroll-area-CGNbDUBQ.js";
9
+ import { a as tt, b as Me, D as at, j as rt, e as st, s as nt, K as lt, P as ct, S as it, v as ot, u as dt, C as mt } from "./sortable.esm-Cb8oRBzU.js";
10
+ import { B as S } from "./button-BP_ug5gP.js";
11
+ import { I as $ } from "./input-Pfq8fkiV.js";
12
+ import { B as F, C as Ie } from "./badge-D0C_rP2l.js";
13
+ import { S as ut, D as Z, a as ee, b as te, c as O, g as fe } from "./dropdown-menu-CkCCV_tw.js";
14
+ import { C as Ae, e as Ee } from "./card-yxbWFvZ1.js";
15
+ import { C as W } from "./checkbox-CTa9e4SG.js";
16
+ import { u as Q } from "./use-formatters-xeMS4gdV.js";
17
+ import { T as ht, G as pt, P as Le } from "./table-2-C7E_N72K.js";
18
+ import { C as G } from "./calendar-JUSWONQ0.js";
19
+ import { F as ft, P as je } from "./pencil-HL0trGIs.js";
20
+ import { P as J } from "./plus-D7DMDKb8.js";
21
+ import { E as ae } from "./ellipsis-CKhpjj5H.js";
22
+ import { u as T } from "./locale-provider-BHGNO4j7.js";
23
+ import { d as re, T as ge, a as xe, b as X, c as Fe } from "./textarea-4qZDuQ-C.js";
24
+ import { A as Ne, a as ve, b as be } from "./avatar-BlEcWE7T.js";
25
+ import { P as se, M as ne } from "./phone-B0J1dGIE.js";
26
+ import { M as le } from "./message-square-B_xLey5D.js";
27
+ import { C as ze } from "./chevron-right-Di90aqSn.js";
28
+ import { S as Ve } from "./send-DIkOd-pu.js";
29
+ import { X as ye } from "./x-BBkgEhUv.js";
30
+ import { P as gt, a as xt, b as Nt } from "./popover-CZWAuYUL.js";
31
+ import { E as vt } from "./external-link-UeWW0ty3.js";
32
+ import { D as Oe, e as He, f as bt, h as Be, i as yt, g as wt, c as kt } from "./dialog-MYAx3Qrc.js";
33
+ import { L as Dt } from "./label-CExiitfO.js";
34
+ import { S as we, c as ke, b as De, d as Ce, f as Se } from "./select-Ce2C2acZ.js";
35
+ import { M as Ct } from "./minus-DJ0tmymW.js";
36
+ import { A as St, a as Rt, b as Tt, c as Mt } from "./accordion-BwnJKrKm.js";
37
+ import { L as Pt } from "./loader-circle-CBVYGIRp.js";
38
+ /**
39
+ * @license lucide-react v0.441.0 - ISC
40
+ *
41
+ * This source code is licensed under the ISC license.
42
+ * See the LICENSE file in the root directory of this source tree.
43
+ */
44
+ const Ke = H("Activity", [
45
+ [
46
+ "path",
47
+ {
48
+ d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
49
+ key: "169zse"
50
+ }
51
+ ]
52
+ ]);
53
+ /**
54
+ * @license lucide-react v0.441.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */
59
+ const It = H("ArrowDown", [
60
+ ["path", { d: "M12 5v14", key: "s699le" }],
61
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
62
+ ]);
63
+ /**
64
+ * @license lucide-react v0.441.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */
69
+ const At = H("ArrowUp", [
70
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
71
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
72
+ ]);
73
+ /**
74
+ * @license lucide-react v0.441.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */
79
+ const ce = H("CircleCheck", [
80
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
81
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
82
+ ]);
83
+ /**
84
+ * @license lucide-react v0.441.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */
89
+ const Et = H("LayoutGrid", [
90
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
91
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
92
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
93
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
94
+ ]);
95
+ /**
96
+ * @license lucide-react v0.441.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */
101
+ const _e = H("Link2", [
102
+ ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
103
+ ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
104
+ ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
105
+ ]);
106
+ /**
107
+ * @license lucide-react v0.441.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */
112
+ const Lt = H("List", [
113
+ ["line", { x1: "8", x2: "21", y1: "6", y2: "6", key: "7ey8pc" }],
114
+ ["line", { x1: "8", x2: "21", y1: "12", y2: "12", key: "rjfblc" }],
115
+ ["line", { x1: "8", x2: "21", y1: "18", y2: "18", key: "c3b1m8" }],
116
+ ["line", { x1: "3", x2: "3.01", y1: "6", y2: "6", key: "1g7gq3" }],
117
+ ["line", { x1: "3", x2: "3.01", y1: "12", y2: "12", key: "1pjlvk" }],
118
+ ["line", { x1: "3", x2: "3.01", y1: "18", y2: "18", key: "28t2mc" }]
119
+ ]), jt = g.forwardRef(
120
+ ({ className: t, children: s, ...n }, o) => /* @__PURE__ */ e(
121
+ "div",
122
+ {
123
+ ref: o,
124
+ className: b("flex min-h-screen w-full flex-col bg-background", t),
125
+ ...n,
126
+ children: s
127
+ }
128
+ )
129
+ );
130
+ jt.displayName = "AppShell";
131
+ const Ft = g.forwardRef(
132
+ ({ className: t, ...s }, n) => /* @__PURE__ */ e(
133
+ "header",
134
+ {
135
+ ref: n,
136
+ className: b(
137
+ "sticky top-0 z-50 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6",
138
+ t
139
+ ),
140
+ ...s
141
+ }
142
+ )
143
+ );
144
+ Ft.displayName = "AppShellHeader";
145
+ const zt = g.forwardRef(
146
+ ({ className: t, ...s }, n) => /* @__PURE__ */ e(
147
+ "main",
148
+ {
149
+ ref: n,
150
+ className: b("flex flex-1 flex-col gap-4 p-4 md:gap-8 md:p-6", t),
151
+ ...s
152
+ }
153
+ )
154
+ );
155
+ zt.displayName = "AppShellMain";
156
+ const Vt = g.forwardRef(
157
+ ({ className: t, ...s }, n) => /* @__PURE__ */ e(
158
+ "footer",
159
+ {
160
+ ref: n,
161
+ className: b("border-t bg-background px-4 py-6 md:px-6", t),
162
+ ...s
163
+ }
164
+ )
165
+ );
166
+ Vt.displayName = "AppShellFooter";
167
+ const Ot = g.forwardRef(
168
+ ({ className: t, heading: s, description: n, actions: o, children: r, ...l }, c) => /* @__PURE__ */ a(
169
+ "div",
170
+ {
171
+ ref: c,
172
+ className: b("flex flex-col gap-4 md:flex-row md:items-center md:justify-between", t),
173
+ ...l,
174
+ children: [
175
+ /* @__PURE__ */ a("div", { className: "space-y-1", children: [
176
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight md:text-3xl", children: s }),
177
+ n && /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: n })
178
+ ] }),
179
+ o && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: o }),
180
+ r
181
+ ]
182
+ }
183
+ )
184
+ );
185
+ Ot.displayName = "PageHeader";
186
+ const $e = g.createContext(null);
187
+ function Qe() {
188
+ const t = g.useContext($e);
189
+ if (!t)
190
+ throw new Error("useDashboardLayout must be used within a DashboardLayout.");
191
+ return t;
192
+ }
193
+ const Ht = g.forwardRef(
194
+ ({
195
+ className: t,
196
+ children: s,
197
+ sidebarOpen: n,
198
+ onSidebarOpenChange: o,
199
+ sidebarCollapsed: r,
200
+ onSidebarCollapsedChange: l,
201
+ defaultSidebarOpen: c = !0,
202
+ defaultSidebarCollapsed: d = !1,
203
+ sidebarWidth: u = "16rem",
204
+ sidebarCollapsedWidth: f = "4rem",
205
+ ...v
206
+ }, h) => {
207
+ const m = Ze(), [x, N] = K({
208
+ value: n,
209
+ defaultValue: c,
210
+ onChange: o
211
+ }), [y, w] = K({
212
+ value: r,
213
+ defaultValue: d,
214
+ onChange: l
215
+ }), i = g.useCallback(() => {
216
+ m ? N((k) => !k) : w((k) => !k);
217
+ }, [m, w, N]);
218
+ g.useEffect(() => {
219
+ const k = (C) => {
220
+ C.key === "b" && (C.metaKey || C.ctrlKey) && (C.preventDefault(), i());
221
+ };
222
+ return window.addEventListener("keydown", k), () => window.removeEventListener("keydown", k);
223
+ }, [i]);
224
+ const p = g.useMemo(
225
+ () => ({
226
+ sidebarOpen: x,
227
+ setSidebarOpen: N,
228
+ sidebarCollapsed: y,
229
+ setSidebarCollapsed: w,
230
+ isMobile: m,
231
+ toggleSidebar: i
232
+ }),
233
+ [x, N, y, w, m, i]
234
+ );
235
+ return /* @__PURE__ */ e($e.Provider, { value: p, children: /* @__PURE__ */ e(
236
+ "div",
237
+ {
238
+ ref: h,
239
+ style: {
240
+ "--sidebar-width": u,
241
+ "--sidebar-collapsed-width": f
242
+ },
243
+ className: b("flex min-h-screen w-full bg-background", t),
244
+ ...v,
245
+ children: s
246
+ }
247
+ ) });
248
+ }
249
+ );
250
+ Ht.displayName = "DashboardLayout";
251
+ const Bt = g.forwardRef(
252
+ ({ className: t, children: s, ...n }, o) => {
253
+ const { sidebarOpen: r, setSidebarOpen: l, sidebarCollapsed: c, isMobile: d } = Qe();
254
+ return d ? /* @__PURE__ */ e(he, { open: r, onOpenChange: l, children: /* @__PURE__ */ e(
255
+ pe,
256
+ {
257
+ side: "left",
258
+ className: "w-[var(--sidebar-width)] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
259
+ children: /* @__PURE__ */ e("aside", { className: "flex h-full w-full flex-col", children: s })
260
+ }
261
+ ) }) : /* @__PURE__ */ e(
262
+ "aside",
263
+ {
264
+ ref: o,
265
+ "data-collapsed": c,
266
+ className: b(
267
+ "fixed inset-y-0 left-0 z-30 flex h-screen flex-col border-r bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-in-out",
268
+ c ? "w-[var(--sidebar-collapsed-width)]" : "w-[var(--sidebar-width)]",
269
+ t
270
+ ),
271
+ ...n,
272
+ children: s
273
+ }
274
+ );
275
+ }
276
+ );
277
+ Bt.displayName = "DashboardSidebar";
278
+ const Kt = g.forwardRef(
279
+ ({ className: t, children: s, ...n }, o) => {
280
+ const { sidebarCollapsed: r, isMobile: l } = Qe();
281
+ return /* @__PURE__ */ e(
282
+ "div",
283
+ {
284
+ ref: o,
285
+ className: b(
286
+ "flex flex-1 flex-col transition-[margin-left] duration-200 ease-in-out",
287
+ !l && (r ? "ml-[var(--sidebar-collapsed-width)]" : "ml-[var(--sidebar-width)]"),
288
+ t
289
+ ),
290
+ ...n,
291
+ children: s
292
+ }
293
+ );
294
+ }
295
+ );
296
+ Kt.displayName = "DashboardContent";
297
+ const _t = g.forwardRef(
298
+ ({ className: t, children: s, ...n }, o) => /* @__PURE__ */ e(
299
+ "header",
300
+ {
301
+ ref: o,
302
+ className: b(
303
+ "sticky top-0 z-20 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6",
304
+ t
305
+ ),
306
+ ...n,
307
+ children: s
308
+ }
309
+ )
310
+ );
311
+ _t.displayName = "DashboardHeader";
312
+ const $t = g.forwardRef(
313
+ ({ className: t, children: s, ...n }, o) => /* @__PURE__ */ e(
314
+ "main",
315
+ {
316
+ ref: o,
317
+ className: b("flex-1 overflow-auto p-4 md:p-6", t),
318
+ ...n,
319
+ children: s
320
+ }
321
+ )
322
+ );
323
+ $t.displayName = "DashboardMain";
324
+ const Qt = g.forwardRef(
325
+ ({ className: t, children: s, ...n }, o) => /* @__PURE__ */ e(
326
+ "footer",
327
+ {
328
+ ref: o,
329
+ className: b("border-t bg-background px-4 py-4 md:px-6", t),
330
+ ...n,
331
+ children: s
332
+ }
333
+ )
334
+ );
335
+ Qt.displayName = "DashboardFooter";
336
+ const qt = {
337
+ sm: "sm:max-w-[360px]",
338
+ md: "sm:max-w-[460px]",
339
+ lg: "sm:max-w-[620px]"
340
+ }, Yt = g.forwardRef(({ open: t, onOpenChange: s, size: n = "md", children: o, className: r }, l) => /* @__PURE__ */ e(he, { open: t, onOpenChange: s, children: /* @__PURE__ */ e(
341
+ pe,
342
+ {
343
+ ref: l,
344
+ side: "right",
345
+ className: b(
346
+ "flex w-full flex-col gap-0 p-0",
347
+ qt[n],
348
+ r
349
+ ),
350
+ children: /* @__PURE__ */ e(L, { className: "flex-1", children: /* @__PURE__ */ e("div", { className: "flex flex-col", children: o }) })
351
+ }
352
+ ) }));
353
+ Yt.displayName = "DashboardRightPanel";
354
+ const Ut = {
355
+ low: "bg-muted text-muted-foreground",
356
+ medium: "bg-warning/15 text-warning",
357
+ high: "bg-destructive/15 text-destructive"
358
+ }, qe = g.createContext(null);
359
+ function B() {
360
+ const t = g.useContext(qe);
361
+ if (!t)
362
+ throw new Error("usePipeline must be used within a Pipeline component");
363
+ return t;
364
+ }
365
+ const Gt = g.forwardRef(
366
+ ({
367
+ className: t,
368
+ stages: s,
369
+ items: n,
370
+ defaultView: o = "kanban",
371
+ view: r,
372
+ onViewChange: l,
373
+ selectedItems: c,
374
+ defaultSelectedItems: d = [],
375
+ onSelectedItemsChange: u,
376
+ searchQuery: f,
377
+ defaultSearchQuery: v = "",
378
+ onSearchQueryChange: h,
379
+ groupBy: m,
380
+ defaultGroupBy: x = "",
381
+ onGroupByChange: N,
382
+ onItemMove: y,
383
+ onItemClick: w,
384
+ onItemAdd: i,
385
+ onItemEdit: p,
386
+ onItemDelete: k,
387
+ children: C,
388
+ ...z
389
+ }, I) => {
390
+ const [V, D] = K({
391
+ value: r,
392
+ defaultValue: o,
393
+ onChange: l
394
+ }), [M, R] = K({
395
+ value: c,
396
+ defaultValue: d,
397
+ onChange: u
398
+ }), [A, E] = K({
399
+ value: f,
400
+ defaultValue: v,
401
+ onChange: h
402
+ }), [ie, Y] = K({
403
+ value: m,
404
+ defaultValue: x,
405
+ onChange: (P) => N == null ? void 0 : N(P || void 0)
406
+ }), j = ie || void 0, U = g.useMemo(() => {
407
+ if (!A) return n;
408
+ const P = A.toLowerCase();
409
+ return n.filter(
410
+ (de) => {
411
+ var Re, Te;
412
+ return de.title.toLowerCase().includes(P) || ((Re = de.company) == null ? void 0 : Re.toLowerCase().includes(P)) || ((Te = de.owner) == null ? void 0 : Te.name.toLowerCase().includes(P));
413
+ }
414
+ );
415
+ }, [n, A]), oe = g.useMemo(
416
+ () => ({
417
+ view: V,
418
+ setView: (P) => D(P),
419
+ stages: s,
420
+ items: U,
421
+ selectedItems: M,
422
+ setSelectedItems: (P) => R(P),
423
+ onItemMove: y,
424
+ onItemClick: w,
425
+ onItemAdd: i,
426
+ onItemEdit: p,
427
+ onItemDelete: k,
428
+ searchQuery: A,
429
+ setSearchQuery: (P) => E(P),
430
+ groupBy: j,
431
+ setGroupBy: (P) => Y(P ?? "")
432
+ }),
433
+ [
434
+ V,
435
+ s,
436
+ U,
437
+ M,
438
+ A,
439
+ j,
440
+ y,
441
+ w,
442
+ i,
443
+ p,
444
+ k,
445
+ D,
446
+ R,
447
+ E,
448
+ Y
449
+ ]
450
+ );
451
+ return /* @__PURE__ */ e(qe.Provider, { value: oe, children: /* @__PURE__ */ e(
452
+ "div",
453
+ {
454
+ ref: I,
455
+ className: b("flex h-full flex-col", t),
456
+ ...z,
457
+ children: C
458
+ }
459
+ ) });
460
+ }
461
+ );
462
+ Gt.displayName = "Pipeline";
463
+ const Wt = g.forwardRef(
464
+ ({
465
+ className: t,
466
+ showViewSelector: s = !0,
467
+ showSearch: n = !0,
468
+ showAddButton: o = !0,
469
+ addButtonLabel: r,
470
+ onAdd: l,
471
+ title: c,
472
+ actions: d,
473
+ ...u
474
+ }, f) => {
475
+ const { view: v, setView: h, searchQuery: m, setSearchQuery: x, selectedItems: N } = B(), { t: y } = Q(), w = [
476
+ { value: "kanban", icon: /* @__PURE__ */ e(Et, { className: "h-4 w-4" }), label: y("pipeline.kanban") },
477
+ { value: "list", icon: /* @__PURE__ */ e(Lt, { className: "h-4 w-4" }), label: y("calendar.agenda") },
478
+ { value: "table", icon: /* @__PURE__ */ e(ht, { className: "h-4 w-4" }), label: y("pipeline.table") },
479
+ { value: "timeline", icon: /* @__PURE__ */ e(G, { className: "h-4 w-4" }), label: y("pipeline.timeline") }
480
+ ];
481
+ return /* @__PURE__ */ a(
482
+ "div",
483
+ {
484
+ ref: f,
485
+ className: b(
486
+ "flex flex-wrap items-center justify-between gap-4 border-b bg-background p-4",
487
+ t
488
+ ),
489
+ ...u,
490
+ children: [
491
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-4", children: [
492
+ c && /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: c }),
493
+ N.length > 0 && /* @__PURE__ */ e(F, { variant: "secondary", children: y("pipeline.selected", { count: N.length }) })
494
+ ] }),
495
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
496
+ n && /* @__PURE__ */ a("div", { className: "relative", children: [
497
+ /* @__PURE__ */ e(ut, { className: "absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
498
+ /* @__PURE__ */ e(
499
+ $,
500
+ {
501
+ placeholder: y("common.search"),
502
+ value: m,
503
+ onChange: (i) => x(i.target.value),
504
+ className: "h-9 w-[200px] pl-8"
505
+ }
506
+ )
507
+ ] }),
508
+ s && /* @__PURE__ */ e("div", { className: "flex items-center rounded-md border bg-muted/50 p-1", children: w.map((i) => /* @__PURE__ */ e(
509
+ S,
510
+ {
511
+ variant: v === i.value ? "secondary" : "ghost",
512
+ size: "sm",
513
+ className: "h-7 px-2",
514
+ onClick: () => h(i.value),
515
+ title: i.label,
516
+ children: i.icon
517
+ },
518
+ i.value
519
+ )) }),
520
+ /* @__PURE__ */ a(S, { variant: "outline", size: "sm", className: "h-9", children: [
521
+ /* @__PURE__ */ e(ft, { className: "mr-2 h-4 w-4" }),
522
+ y("common.filter")
523
+ ] }),
524
+ d,
525
+ o && /* @__PURE__ */ a(S, { size: "sm", className: "h-9", onClick: l, children: [
526
+ /* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
527
+ r || y("common.create")
528
+ ] })
529
+ ] })
530
+ ]
531
+ }
532
+ );
533
+ }
534
+ );
535
+ Wt.displayName = "PipelineHeader";
536
+ const Jt = g.forwardRef(
537
+ ({ className: t, children: s, ...n }, o) => {
538
+ const { view: r } = B();
539
+ return /* @__PURE__ */ e("div", { ref: o, className: b("flex-1 overflow-hidden", t), ...n, children: s || /* @__PURE__ */ a(_, { children: [
540
+ r === "kanban" && /* @__PURE__ */ e(Ye, {}),
541
+ r === "list" && /* @__PURE__ */ e(Ue, {}),
542
+ r === "table" && /* @__PURE__ */ e(Ge, {}),
543
+ r === "timeline" && /* @__PURE__ */ e(We, {})
544
+ ] }) });
545
+ }
546
+ );
547
+ Jt.displayName = "PipelineContent";
548
+ const Xt = g.memo(function({
549
+ item: s,
550
+ stageId: n,
551
+ renderItem: o,
552
+ defaultRenderItem: r,
553
+ onItemClick: l
554
+ }) {
555
+ const {
556
+ attributes: c,
557
+ listeners: d,
558
+ setNodeRef: u,
559
+ transform: f,
560
+ transition: v,
561
+ isDragging: h
562
+ } = dt({
563
+ id: s.id,
564
+ data: {
565
+ type: "item",
566
+ item: s,
567
+ stageId: n
568
+ }
569
+ }), m = {
570
+ transform: mt.Transform.toString(f),
571
+ transition: v,
572
+ opacity: h ? 0.5 : 1,
573
+ cursor: "grab"
574
+ };
575
+ return /* @__PURE__ */ e(
576
+ "div",
577
+ {
578
+ ref: u,
579
+ style: m,
580
+ ...c,
581
+ ...d,
582
+ onClick: (x) => {
583
+ x.stopPropagation(), l == null || l(s);
584
+ },
585
+ children: o ? o(s, n) : r(s)
586
+ }
587
+ );
588
+ }), Zt = g.memo(function({
589
+ stage: s,
590
+ items: n,
591
+ columnWidth: o,
592
+ showAddButton: r,
593
+ onItemAdd: l,
594
+ onItemClick: c,
595
+ renderItem: d,
596
+ defaultRenderItem: u,
597
+ getStageTotal: f,
598
+ formatCurrency: v,
599
+ t: h
600
+ }) {
601
+ const m = g.useMemo(() => n.map((N) => N.id), [n]), x = s.maxItems !== void 0 && n.length > s.maxItems;
602
+ return /* @__PURE__ */ a(
603
+ "div",
604
+ {
605
+ className: "flex shrink-0 flex-col rounded-lg bg-muted/30",
606
+ style: { width: o },
607
+ children: [
608
+ s.color && /* @__PURE__ */ e(
609
+ "div",
610
+ {
611
+ className: "h-[3px] rounded-t-lg",
612
+ style: { backgroundColor: s.color }
613
+ }
614
+ ),
615
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between p-3 border-b", children: [
616
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
617
+ s.color && /* @__PURE__ */ e(
618
+ "div",
619
+ {
620
+ className: "h-3 w-3 rounded-full",
621
+ style: { backgroundColor: s.color }
622
+ }
623
+ ),
624
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: s.name }),
625
+ /* @__PURE__ */ a(F, { variant: x ? "destructive" : "secondary", className: "text-xs", children: [
626
+ n.length,
627
+ s.maxItems !== void 0 ? `/${s.maxItems}` : ""
628
+ ] })
629
+ ] }),
630
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
631
+ r && l && /* @__PURE__ */ e(
632
+ S,
633
+ {
634
+ variant: "ghost",
635
+ size: "icon",
636
+ className: "h-6 w-6",
637
+ onClick: () => l(s.id),
638
+ children: /* @__PURE__ */ e(J, { className: "h-4 w-4" })
639
+ }
640
+ ),
641
+ /* @__PURE__ */ a(Z, { children: [
642
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ e(S, { variant: "ghost", size: "icon", className: "h-6 w-6", children: /* @__PURE__ */ e(ae, { className: "h-4 w-4" }) }) }),
643
+ /* @__PURE__ */ a(te, { align: "end", children: [
644
+ /* @__PURE__ */ e(O, { children: h("common.edit") }),
645
+ /* @__PURE__ */ e(fe, {}),
646
+ /* @__PURE__ */ e(O, { className: "text-destructive", children: h("common.delete") })
647
+ ] })
648
+ ] })
649
+ ] })
650
+ ] }),
651
+ /* @__PURE__ */ a("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: [
652
+ h("deal.value"),
653
+ ":",
654
+ " ",
655
+ /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: v(f(s.id), {
656
+ minimumFractionDigits: 0,
657
+ maximumFractionDigits: 0
658
+ }) })
659
+ ] }),
660
+ /* @__PURE__ */ e(L, { className: "flex-1", children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 p-2 min-h-[100px]", children: [
661
+ /* @__PURE__ */ e(it, { items: m, strategy: ot, children: n.map((N) => /* @__PURE__ */ e(
662
+ Xt,
663
+ {
664
+ item: N,
665
+ stageId: s.id,
666
+ renderItem: d,
667
+ defaultRenderItem: u,
668
+ onItemClick: c
669
+ },
670
+ N.id
671
+ )) }),
672
+ n.length === 0 && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/20 py-8 text-center transition-colors", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: h("common.noData") }) })
673
+ ] }) })
674
+ ]
675
+ }
676
+ );
677
+ }), Ye = g.forwardRef(
678
+ ({ className: t, columnWidth: s = 320, showAddButton: n = !0, renderItem: o, ...r }, l) => {
679
+ const { stages: c, items: d, onItemMove: u, onItemClick: f, onItemAdd: v } = B(), { formatCurrency: h, formatDate: m, t: x } = Q(), [N, y] = g.useState(null), w = tt(
680
+ Me(ct, {
681
+ activationConstraint: {
682
+ delay: 150,
683
+ tolerance: 5
684
+ }
685
+ }),
686
+ Me(lt, {
687
+ coordinateGetter: nt
688
+ })
689
+ ), i = g.useMemo(() => {
690
+ const D = {};
691
+ return c.forEach((M) => {
692
+ D[M.id] = d.filter((R) => R.stageId === M.id);
693
+ }), D;
694
+ }, [c, d]), p = g.useCallback(
695
+ (D) => {
696
+ var M;
697
+ return ((M = i[D]) == null ? void 0 : M.reduce((R, A) => R + (A.value || 0), 0)) || 0;
698
+ },
699
+ [i]
700
+ ), k = g.useCallback(
701
+ (D) => /* @__PURE__ */ e(Ae, { className: "cursor-pointer transition-all hover:shadow-md", children: /* @__PURE__ */ a(Ee, { className: "p-3 space-y-2", children: [
702
+ /* @__PURE__ */ a("div", { className: "flex items-start justify-between", children: [
703
+ /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
704
+ /* @__PURE__ */ e("h4", { className: "font-medium text-sm truncate", children: D.title }),
705
+ D.company && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: D.company })
706
+ ] }),
707
+ D.priority && /* @__PURE__ */ e(F, { className: b("text-[10px] ml-2", Ut[D.priority]), children: D.priority })
708
+ ] }),
709
+ D.value !== void 0 && /* @__PURE__ */ e("div", { className: "text-sm font-semibold", children: h(D.value, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) }),
710
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
711
+ D.dueDate && /* @__PURE__ */ e("span", { children: m(D.dueDate) }),
712
+ D.owner && /* @__PURE__ */ e("span", { className: "truncate max-w-[100px]", children: D.owner.name })
713
+ ] }),
714
+ D.probability !== void 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
715
+ /* @__PURE__ */ e("div", { className: "flex-1 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ e(
716
+ "div",
717
+ {
718
+ className: "h-full bg-primary rounded-full",
719
+ style: { width: `${D.probability}%` }
720
+ }
721
+ ) }),
722
+ /* @__PURE__ */ a("span", { className: "text-[10px] text-muted-foreground", children: [
723
+ D.probability,
724
+ "%"
725
+ ] })
726
+ ] })
727
+ ] }) }),
728
+ [h, m]
729
+ ), C = g.useCallback(
730
+ (D) => {
731
+ const { active: M } = D, R = M.data.current;
732
+ R != null && R.item && y(R.item);
733
+ },
734
+ []
735
+ ), z = g.useCallback((D) => {
736
+ }, []), I = g.useCallback(
737
+ (D) => {
738
+ const { active: M, over: R } = D;
739
+ if (y(null), !R) return;
740
+ const A = M.data.current, E = R.data.current;
741
+ if (!A) return;
742
+ const ie = A.item, Y = A.stageId;
743
+ let j = null;
744
+ if ((E == null ? void 0 : E.type) === "item")
745
+ j = E.stageId;
746
+ else if ((E == null ? void 0 : E.type) === "column")
747
+ j = E.stageId;
748
+ else {
749
+ const U = d.find((oe) => oe.id === R.id);
750
+ U && (j = U.stageId);
751
+ }
752
+ j && Y !== j && (u == null || u(ie.id, Y, j));
753
+ },
754
+ [d, u]
755
+ ), V = g.useMemo(
756
+ () => [...c].sort((D, M) => D.order - M.order),
757
+ [c]
758
+ );
759
+ return /* @__PURE__ */ e("div", { ref: l, className: b("h-full", t), ...r, children: /* @__PURE__ */ a(
760
+ at,
761
+ {
762
+ sensors: w,
763
+ collisionDetection: rt,
764
+ onDragStart: C,
765
+ onDragOver: z,
766
+ onDragEnd: I,
767
+ children: [
768
+ /* @__PURE__ */ a(L, { className: "h-full", children: [
769
+ /* @__PURE__ */ e("div", { className: "flex gap-4 p-4 h-full", children: V.map((D) => /* @__PURE__ */ e(
770
+ Zt,
771
+ {
772
+ stage: D,
773
+ items: i[D.id] || [],
774
+ columnWidth: s,
775
+ showAddButton: n,
776
+ onItemAdd: v,
777
+ onItemClick: f,
778
+ renderItem: o,
779
+ defaultRenderItem: k,
780
+ getStageTotal: p,
781
+ formatCurrency: h,
782
+ t: x
783
+ },
784
+ D.id
785
+ )) }),
786
+ /* @__PURE__ */ e(et, { orientation: "horizontal" })
787
+ ] }),
788
+ /* @__PURE__ */ e(st, { dropAnimation: {
789
+ duration: 200,
790
+ easing: "cubic-bezier(0.18, 0.67, 0.6, 1.22)"
791
+ }, children: N ? /* @__PURE__ */ e("div", { className: "opacity-90 shadow-xl rotate-1 scale-[1.02]", children: o ? o(N, N.stageId) : k(N) }) : null })
792
+ ]
793
+ }
794
+ ) });
795
+ }
796
+ );
797
+ Ye.displayName = "PipelineKanban";
798
+ const Ue = g.forwardRef(
799
+ ({ className: t, renderItem: s, ...n }, o) => {
800
+ const { stages: r, items: l, selectedItems: c, setSelectedItems: d, onItemClick: u, onItemEdit: f, onItemDelete: v } = B(), { formatCurrency: h, formatDate: m, t: x } = Q(), N = g.useMemo(() => {
801
+ const p = {};
802
+ return r.forEach((k) => {
803
+ p[k.id] = l.filter((C) => C.stageId === k.id);
804
+ }), p;
805
+ }, [r, l]), y = (p) => {
806
+ c.includes(p) ? d(c.filter((k) => k !== p)) : d([...c, p]);
807
+ }, w = {
808
+ low: "bg-muted text-muted-foreground",
809
+ medium: "bg-warning/15 text-warning",
810
+ high: "bg-destructive/15 text-destructive"
811
+ }, i = (p, k) => /* @__PURE__ */ a(
812
+ "div",
813
+ {
814
+ className: b(
815
+ "flex items-center gap-4 rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50",
816
+ c.includes(p.id) && "bg-muted/50 border-primary"
817
+ ),
818
+ children: [
819
+ /* @__PURE__ */ e(
820
+ W,
821
+ {
822
+ checked: c.includes(p.id),
823
+ onCheckedChange: () => y(p.id)
824
+ }
825
+ ),
826
+ /* @__PURE__ */ e(pt, { className: "h-4 w-4 text-muted-foreground cursor-grab" }),
827
+ /* @__PURE__ */ a("div", { className: "flex-1 min-w-0 cursor-pointer", onClick: () => u == null ? void 0 : u(p), children: [
828
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2 mb-1", children: [
829
+ /* @__PURE__ */ e("h4", { className: "font-medium truncate", children: p.title }),
830
+ p.priority && /* @__PURE__ */ e(F, { className: b("text-xs", w[p.priority]), children: p.priority })
831
+ ] }),
832
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", children: [
833
+ p.company && /* @__PURE__ */ e("span", { children: p.company }),
834
+ p.owner && /* @__PURE__ */ e("span", { children: p.owner.name })
835
+ ] })
836
+ ] }),
837
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-4", children: [
838
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
839
+ k.color && /* @__PURE__ */ e(
840
+ "div",
841
+ {
842
+ className: "h-2 w-2 rounded-full",
843
+ style: { backgroundColor: k.color }
844
+ }
845
+ ),
846
+ /* @__PURE__ */ e("span", { className: "text-sm", children: k.name })
847
+ ] }),
848
+ p.value !== void 0 && /* @__PURE__ */ e("div", { className: "font-semibold min-w-[100px] text-right", children: h(p.value, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) }),
849
+ p.dueDate && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground min-w-[100px]", children: m(p.dueDate) }),
850
+ /* @__PURE__ */ a(Z, { children: [
851
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ e(S, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ e(ae, { className: "h-4 w-4" }) }) }),
852
+ /* @__PURE__ */ a(te, { align: "end", children: [
853
+ /* @__PURE__ */ e(O, { onClick: () => f == null ? void 0 : f(p), children: x("common.edit") }),
854
+ /* @__PURE__ */ e(fe, {}),
855
+ /* @__PURE__ */ e(
856
+ O,
857
+ {
858
+ className: "text-destructive",
859
+ onClick: () => v == null ? void 0 : v(p.id),
860
+ children: x("common.delete")
861
+ }
862
+ )
863
+ ] })
864
+ ] })
865
+ ] })
866
+ ]
867
+ }
868
+ );
869
+ return /* @__PURE__ */ e("div", { ref: o, className: b("h-full", t), ...n, children: /* @__PURE__ */ e(L, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "p-4 space-y-6", children: r.sort((p, k) => p.order - k.order).map((p) => {
870
+ var k, C, z;
871
+ return /* @__PURE__ */ a("div", { children: [
872
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2 mb-3", children: [
873
+ p.color && /* @__PURE__ */ e(
874
+ "div",
875
+ {
876
+ className: "h-3 w-3 rounded-full",
877
+ style: { backgroundColor: p.color }
878
+ }
879
+ ),
880
+ /* @__PURE__ */ e("h3", { className: "font-semibold", children: p.name }),
881
+ /* @__PURE__ */ e(F, { variant: "secondary", children: ((k = N[p.id]) == null ? void 0 : k.length) || 0 })
882
+ ] }),
883
+ /* @__PURE__ */ a("div", { className: "space-y-2", children: [
884
+ (C = N[p.id]) == null ? void 0 : C.map(
885
+ (I) => s ? /* @__PURE__ */ e("div", { children: s(I) }, I.id) : /* @__PURE__ */ e("div", { children: i(I, p) }, I.id)
886
+ ),
887
+ ((z = N[p.id]) == null ? void 0 : z.length) === 0 && /* @__PURE__ */ e("div", { className: "py-4 text-center text-sm text-muted-foreground border rounded-lg", children: x("common.noData") })
888
+ ] })
889
+ ] }, p.id);
890
+ }) }) }) });
891
+ }
892
+ );
893
+ Ue.displayName = "PipelineList";
894
+ const Ge = g.forwardRef(
895
+ ({ className: t, ...s }, n) => {
896
+ const {
897
+ stages: o,
898
+ items: r,
899
+ selectedItems: l,
900
+ setSelectedItems: c,
901
+ onItemClick: d,
902
+ onItemEdit: u,
903
+ onItemDelete: f
904
+ } = B(), { formatCurrency: v, formatDate: h, t: m } = Q(), x = g.useMemo(() => {
905
+ const i = {};
906
+ return o.forEach((p) => {
907
+ i[p.id] = p;
908
+ }), i;
909
+ }, [o]), N = () => {
910
+ l.length === r.length ? c([]) : c(r.map((i) => i.id));
911
+ }, y = (i) => {
912
+ l.includes(i) ? c(l.filter((p) => p !== i)) : c([...l, i]);
913
+ }, w = {
914
+ low: "bg-muted text-muted-foreground",
915
+ medium: "bg-warning/15 text-warning",
916
+ high: "bg-destructive/15 text-destructive"
917
+ };
918
+ return /* @__PURE__ */ e("div", { ref: n, className: b("h-full", t), ...s, children: /* @__PURE__ */ e(L, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e("div", { className: "rounded-lg border", children: /* @__PURE__ */ a("table", { className: "w-full", children: [
919
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { className: "border-b bg-muted/50", children: [
920
+ /* @__PURE__ */ e("th", { className: "w-[40px] p-3", children: /* @__PURE__ */ e(
921
+ W,
922
+ {
923
+ checked: l.length === r.length && r.length > 0,
924
+ onCheckedChange: N
925
+ }
926
+ ) }),
927
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: m("pipeline.title") }),
928
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: m("pipeline.company") }),
929
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: m("deal.stage") }),
930
+ /* @__PURE__ */ e("th", { className: "text-right p-3 font-medium text-sm", children: m("deal.value") }),
931
+ /* @__PURE__ */ e("th", { className: "text-center p-3 font-medium text-sm", children: m("deal.probability") }),
932
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: m("pipeline.owner") }),
933
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: m("deal.closeDate") }),
934
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: m("pipeline.priority") }),
935
+ /* @__PURE__ */ e("th", { className: "w-[60px] p-3" })
936
+ ] }) }),
937
+ /* @__PURE__ */ a("tbody", { children: [
938
+ r.map((i) => {
939
+ var k;
940
+ const p = x[i.stageId];
941
+ return /* @__PURE__ */ a(
942
+ "tr",
943
+ {
944
+ className: b(
945
+ "border-b transition-colors hover:bg-muted/50",
946
+ l.includes(i.id) && "bg-muted/50"
947
+ ),
948
+ children: [
949
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(
950
+ W,
951
+ {
952
+ checked: l.includes(i.id),
953
+ onCheckedChange: () => y(i.id)
954
+ }
955
+ ) }),
956
+ /* @__PURE__ */ e(
957
+ "td",
958
+ {
959
+ className: "p-3 font-medium cursor-pointer",
960
+ onClick: () => d == null ? void 0 : d(i),
961
+ children: i.title
962
+ }
963
+ ),
964
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: i.company }),
965
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
966
+ (p == null ? void 0 : p.color) && /* @__PURE__ */ e(
967
+ "div",
968
+ {
969
+ className: "h-2 w-2 rounded-full",
970
+ style: { backgroundColor: p.color }
971
+ }
972
+ ),
973
+ /* @__PURE__ */ e("span", { children: p == null ? void 0 : p.name })
974
+ ] }) }),
975
+ /* @__PURE__ */ e("td", { className: "p-3 text-right font-medium", children: i.value !== void 0 ? v(i.value, {
976
+ minimumFractionDigits: 0,
977
+ maximumFractionDigits: 0
978
+ }) : "-" }),
979
+ /* @__PURE__ */ e("td", { className: "p-3 text-center", children: i.probability !== void 0 ? `${i.probability}%` : "-" }),
980
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: ((k = i.owner) == null ? void 0 : k.name) || "-" }),
981
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: i.dueDate ? h(i.dueDate) : "-" }),
982
+ /* @__PURE__ */ e("td", { className: "p-3", children: i.priority && /* @__PURE__ */ e(F, { className: b("text-xs", w[i.priority]), children: i.priority }) }),
983
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ a(Z, { children: [
984
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ e(S, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ e(ae, { className: "h-4 w-4" }) }) }),
985
+ /* @__PURE__ */ a(te, { align: "end", children: [
986
+ /* @__PURE__ */ e(O, { onClick: () => u == null ? void 0 : u(i), children: m("common.edit") }),
987
+ /* @__PURE__ */ e(fe, {}),
988
+ /* @__PURE__ */ e(
989
+ O,
990
+ {
991
+ className: "text-destructive",
992
+ onClick: () => f == null ? void 0 : f(i.id),
993
+ children: m("common.delete")
994
+ }
995
+ )
996
+ ] })
997
+ ] }) })
998
+ ]
999
+ },
1000
+ i.id
1001
+ );
1002
+ }),
1003
+ r.length === 0 && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 10, className: "p-8 text-center text-muted-foreground", children: m("common.noData") }) })
1004
+ ] })
1005
+ ] }) }) }) }) });
1006
+ }
1007
+ );
1008
+ Ge.displayName = "PipelineTable";
1009
+ const We = g.forwardRef(
1010
+ ({ className: t, ...s }, n) => {
1011
+ const { stages: o, items: r, onItemClick: l } = B(), { formatCurrency: c, formatDate: d, t: u } = Q(), f = g.useMemo(() => {
1012
+ const y = {};
1013
+ return (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), r.filter((i) => i.dueDate).sort((i, p) => {
1014
+ const k = new Date(i.dueDate), C = new Date(p.dueDate);
1015
+ return k.getTime() - C.getTime();
1016
+ }).forEach((i) => {
1017
+ const k = new Date(i.dueDate).toISOString().split("T")[0];
1018
+ y[k] || (y[k] = []), y[k].push(i);
1019
+ }), y;
1020
+ }, [r]), v = g.useMemo(() => {
1021
+ const y = {};
1022
+ return o.forEach((w) => {
1023
+ y[w.id] = w;
1024
+ }), y;
1025
+ }, [o]), h = Object.keys(f).sort(), m = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], x = (y) => {
1026
+ const w = new Date(y), i = /* @__PURE__ */ new Date();
1027
+ i.setHours(0, 0, 0, 0);
1028
+ const p = Math.ceil((w.getTime() - i.getTime()) / (1e3 * 60 * 60 * 24));
1029
+ return p === 0 ? u("date.today") : p === 1 ? u("date.tomorrow") : p === -1 ? u("date.yesterday") : d(w, "EEEE, MMMM d");
1030
+ }, N = (y) => y < m;
1031
+ return /* @__PURE__ */ e("div", { ref: n, className: b("h-full", t), ...s, children: /* @__PURE__ */ e(L, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "p-4", children: h.length === 0 ? /* @__PURE__ */ e("div", { className: "py-12 text-center text-muted-foreground", children: u("common.noData") }) : /* @__PURE__ */ e("div", { className: "relative space-y-8 before:absolute before:inset-0 before:ml-5 before:h-full before:w-0.5 before:-translate-x-px before:bg-border md:before:mx-auto md:before:translate-x-0", children: h.map((y) => /* @__PURE__ */ a("div", { className: "relative flex items-start gap-6 md:gap-12", children: [
1032
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-10 h-10 rounded-full bg-background border-2 border-muted shrink-0 md:order-1 md:mx-auto", children: /* @__PURE__ */ e(
1033
+ "div",
1034
+ {
1035
+ className: b(
1036
+ "w-3 h-3 rounded-full",
1037
+ N(y) ? "bg-destructive" : "bg-primary"
1038
+ )
1039
+ }
1040
+ ) }),
1041
+ /* @__PURE__ */ a("div", { className: "hidden md:block md:w-1/2 md:text-right md:pr-8", children: [
1042
+ /* @__PURE__ */ e(
1043
+ "span",
1044
+ {
1045
+ className: b(
1046
+ "font-semibold",
1047
+ N(y) && "text-destructive"
1048
+ ),
1049
+ children: x(y)
1050
+ }
1051
+ ),
1052
+ /* @__PURE__ */ e("span", { className: "block text-sm text-muted-foreground", children: u("pipeline.items", { count: f[y].length }) })
1053
+ ] }),
1054
+ /* @__PURE__ */ a("div", { className: "flex-1 md:w-1/2 md:pl-8", children: [
1055
+ /* @__PURE__ */ e("div", { className: "md:hidden mb-2", children: /* @__PURE__ */ e(
1056
+ "span",
1057
+ {
1058
+ className: b(
1059
+ "font-semibold",
1060
+ N(y) && "text-destructive"
1061
+ ),
1062
+ children: x(y)
1063
+ }
1064
+ ) }),
1065
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: f[y].map((w) => {
1066
+ const i = v[w.stageId];
1067
+ return /* @__PURE__ */ e(
1068
+ Ae,
1069
+ {
1070
+ className: "cursor-pointer hover:shadow-md transition-shadow",
1071
+ onClick: () => l == null ? void 0 : l(w),
1072
+ children: /* @__PURE__ */ a(Ee, { className: "p-4", children: [
1073
+ /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-4", children: [
1074
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1075
+ /* @__PURE__ */ e("h4", { className: "font-medium truncate", children: w.title }),
1076
+ w.company && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: w.company })
1077
+ ] }),
1078
+ w.value !== void 0 && /* @__PURE__ */ e("div", { className: "font-semibold", children: c(w.value, {
1079
+ minimumFractionDigits: 0,
1080
+ maximumFractionDigits: 0
1081
+ }) })
1082
+ ] }),
1083
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3 mt-3 text-sm", children: [
1084
+ i && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
1085
+ i.color && /* @__PURE__ */ e(
1086
+ "div",
1087
+ {
1088
+ className: "h-2 w-2 rounded-full",
1089
+ style: { backgroundColor: i.color }
1090
+ }
1091
+ ),
1092
+ /* @__PURE__ */ e("span", { children: i.name })
1093
+ ] }),
1094
+ w.owner && /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: w.owner.name })
1095
+ ] })
1096
+ ] })
1097
+ },
1098
+ w.id
1099
+ );
1100
+ }) })
1101
+ ] })
1102
+ ] }, y)) }) }) }) });
1103
+ }
1104
+ );
1105
+ We.displayName = "PipelineTimeline";
1106
+ const ea = g.forwardRef(
1107
+ ({ className: t, ...s }, n) => {
1108
+ const { stages: o, items: r } = B(), { formatCurrency: l, t: c } = Q(), d = r.reduce((v, h) => v + (h.value || 0), 0), u = r.length, f = g.useMemo(() => o.map((v) => {
1109
+ const h = r.filter((x) => x.stageId === v.id), m = h.reduce((x, N) => x + (N.value || 0), 0);
1110
+ return {
1111
+ ...v,
1112
+ count: h.length,
1113
+ value: m
1114
+ };
1115
+ }), [o, r]);
1116
+ return /* @__PURE__ */ e(
1117
+ "div",
1118
+ {
1119
+ ref: n,
1120
+ className: b("border-t bg-muted/30 px-4 py-3", t),
1121
+ ...s,
1122
+ children: /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
1123
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-6", children: [
1124
+ /* @__PURE__ */ a("div", { children: [
1125
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: c("common.total") }),
1126
+ /* @__PURE__ */ e("div", { className: "font-semibold", children: l(d, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) })
1127
+ ] }),
1128
+ /* @__PURE__ */ a("div", { children: [
1129
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: c("common.items") }),
1130
+ /* @__PURE__ */ e("div", { className: "font-semibold", children: u })
1131
+ ] })
1132
+ ] }),
1133
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-4", children: f.map((v) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm", children: [
1134
+ v.color && /* @__PURE__ */ e(
1135
+ "div",
1136
+ {
1137
+ className: "h-2 w-2 rounded-full",
1138
+ style: { backgroundColor: v.color }
1139
+ }
1140
+ ),
1141
+ /* @__PURE__ */ a("span", { className: "text-muted-foreground", children: [
1142
+ v.name,
1143
+ ":"
1144
+ ] }),
1145
+ /* @__PURE__ */ e("span", { className: "font-medium", children: v.count })
1146
+ ] }, v.id)) })
1147
+ ] })
1148
+ }
1149
+ );
1150
+ }
1151
+ );
1152
+ ea.displayName = "PipelineSummary";
1153
+ function ta({
1154
+ title: t,
1155
+ subtitle: s,
1156
+ avatar: n,
1157
+ status: o,
1158
+ actions: r,
1159
+ fields: l,
1160
+ className: c
1161
+ }) {
1162
+ return /* @__PURE__ */ a("div", { className: b("border-b bg-background", c), children: [
1163
+ /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-4 px-6 pt-5 pb-3", children: [
1164
+ /* @__PURE__ */ a("div", { className: "flex items-start gap-3 min-w-0", children: [
1165
+ n && /* @__PURE__ */ e("div", { className: "shrink-0", children: n }),
1166
+ /* @__PURE__ */ a("div", { className: "min-w-0", children: [
1167
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1168
+ /* @__PURE__ */ e("h1", { className: "truncate text-lg font-semibold", children: t }),
1169
+ o
1170
+ ] }),
1171
+ s && /* @__PURE__ */ e("p", { className: "truncate text-sm text-muted-foreground", children: s })
1172
+ ] })
1173
+ ] }),
1174
+ r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-2", children: r })
1175
+ ] }),
1176
+ l && l.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-x-6 gap-y-1.5 border-t px-6 py-2.5", children: l.map((d) => /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 text-sm", children: [
1177
+ /* @__PURE__ */ a("span", { className: "text-muted-foreground", children: [
1178
+ d.label,
1179
+ ":"
1180
+ ] }),
1181
+ /* @__PURE__ */ e("span", { className: "font-medium", children: d.value })
1182
+ ] }, d.id)) })
1183
+ ] });
1184
+ }
1185
+ const aa = {
1186
+ note: /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }),
1187
+ email: /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5" }),
1188
+ call: /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5" }),
1189
+ meeting: /* @__PURE__ */ e(G, { className: "h-3.5 w-3.5" }),
1190
+ task: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
1191
+ update: /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" }),
1192
+ custom: /* @__PURE__ */ e(Ke, { className: "h-3.5 w-3.5" })
1193
+ }, ra = {
1194
+ note: "bg-blue-100 text-blue-600",
1195
+ email: "bg-purple-100 text-purple-600",
1196
+ call: "bg-green-100 text-green-600",
1197
+ meeting: "bg-amber-100 text-amber-600",
1198
+ task: "bg-emerald-100 text-emerald-600",
1199
+ update: "bg-muted text-muted-foreground",
1200
+ custom: "bg-muted text-muted-foreground"
1201
+ };
1202
+ function sa(t) {
1203
+ return t.split(" ").map((s) => s[0]).join("").toUpperCase().slice(0, 2);
1204
+ }
1205
+ function na(t) {
1206
+ const s = /* @__PURE__ */ new Map();
1207
+ for (const n of t) {
1208
+ const r = (n.timestamp instanceof Date ? n.timestamp : new Date(n.timestamp)).toLocaleDateString(), l = s.get(r) ?? [];
1209
+ l.push(n), s.set(r, l);
1210
+ }
1211
+ return Array.from(s.entries()).map(([n, o]) => ({ date: n, items: o }));
1212
+ }
1213
+ function la({ activities: t, className: s }) {
1214
+ const { t: n } = T(), o = (l) => {
1215
+ const c = l instanceof Date ? l : new Date(l), u = (/* @__PURE__ */ new Date()).getTime() - c.getTime(), f = Math.floor(u / 6e4);
1216
+ if (f < 1) return n("record.justNow");
1217
+ if (f < 60) return n("record.minutesAgo", { count: f });
1218
+ const v = Math.floor(f / 60);
1219
+ if (v < 24) return n("record.hoursAgo", { count: v });
1220
+ const h = Math.floor(v / 24);
1221
+ return h < 7 ? n("record.daysAgo", { count: h }) : c.toLocaleDateString();
1222
+ }, r = na(
1223
+ [...t].sort((l, c) => {
1224
+ const d = l.timestamp instanceof Date ? l.timestamp : new Date(l.timestamp);
1225
+ return (c.timestamp instanceof Date ? c.timestamp : new Date(c.timestamp)).getTime() - d.getTime();
1226
+ })
1227
+ );
1228
+ return t.length === 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-8 text-sm text-muted-foreground", children: n("record.noActivity") }) : /* @__PURE__ */ e(L, { className: b("flex-1", s), children: /* @__PURE__ */ e("div", { className: "space-y-6 p-4", children: r.map((l) => /* @__PURE__ */ a("div", { children: [
1229
+ /* @__PURE__ */ e("p", { className: "mb-3 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: l.date }),
1230
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: l.items.map((c) => /* @__PURE__ */ a("div", { className: "flex gap-3", children: [
1231
+ /* @__PURE__ */ e("div", { className: b("flex h-7 w-7 shrink-0 items-center justify-center rounded-full", ra[c.type]), children: c.icon ?? aa[c.type] }),
1232
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1233
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1234
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: c.title }),
1235
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: o(c.timestamp) })
1236
+ ] }),
1237
+ c.description && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-muted-foreground line-clamp-2", children: c.description }),
1238
+ c.user && /* @__PURE__ */ a("div", { className: "mt-1 flex items-center gap-1.5", children: [
1239
+ /* @__PURE__ */ a(Ne, { className: "h-4 w-4", children: [
1240
+ /* @__PURE__ */ e(ve, { src: c.user.avatar, alt: c.user.name }),
1241
+ /* @__PURE__ */ e(be, { className: "text-[7px]", children: sa(c.user.name) })
1242
+ ] }),
1243
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: c.user.name })
1244
+ ] })
1245
+ ] })
1246
+ ] }, c.id)) })
1247
+ ] }, l.date)) }) });
1248
+ }
1249
+ function ca({ entities: t, className: s }) {
1250
+ const { t: n } = T();
1251
+ if (t.length === 0)
1252
+ return /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-6 text-sm text-muted-foreground", children: n("record.noRelated") });
1253
+ const o = /* @__PURE__ */ new Map();
1254
+ for (const r of t) {
1255
+ const l = o.get(r.type) ?? [];
1256
+ l.push(r), o.set(r.type, l);
1257
+ }
1258
+ return /* @__PURE__ */ e(L, { className: b("flex-1", s), children: /* @__PURE__ */ e("div", { className: "space-y-4 p-4", children: Array.from(o.entries()).map(([r, l]) => /* @__PURE__ */ a("div", { children: [
1259
+ /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-1.5", children: [
1260
+ /* @__PURE__ */ e(_e, { className: "h-3 w-3 text-muted-foreground" }),
1261
+ /* @__PURE__ */ a("p", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: [
1262
+ r,
1263
+ " (",
1264
+ l.length,
1265
+ ")"
1266
+ ] })
1267
+ ] }),
1268
+ /* @__PURE__ */ e("div", { className: "space-y-1", children: l.map((c) => /* @__PURE__ */ a(
1269
+ "button",
1270
+ {
1271
+ type: "button",
1272
+ onClick: c.onClick,
1273
+ className: b(
1274
+ "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted",
1275
+ c.onClick && "cursor-pointer",
1276
+ !c.onClick && "cursor-default"
1277
+ ),
1278
+ children: [
1279
+ c.icon && /* @__PURE__ */ e("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded bg-muted text-muted-foreground", children: c.icon }),
1280
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1281
+ /* @__PURE__ */ e("p", { className: "truncate text-sm font-medium", children: c.label }),
1282
+ c.subtitle && /* @__PURE__ */ e("p", { className: "truncate text-[10px] text-muted-foreground", children: c.subtitle })
1283
+ ] }),
1284
+ c.onClick && /* @__PURE__ */ e(ze, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground/50" })
1285
+ ]
1286
+ },
1287
+ c.id
1288
+ )) })
1289
+ ] }, r)) }) });
1290
+ }
1291
+ const ia = [
1292
+ { type: "note", label: "Note", icon: /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) },
1293
+ { type: "email", label: "Email", icon: /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5" }) },
1294
+ { type: "call", label: "Call", icon: /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5" }) },
1295
+ { type: "meeting", label: "Meeting", icon: /* @__PURE__ */ e(G, { className: "h-3.5 w-3.5" }) },
1296
+ { type: "task", label: "Task", icon: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }) }
1297
+ ];
1298
+ function oa({ onSubmit: t, className: s }) {
1299
+ const [n, o] = ue("note"), [r, l] = ue(""), { t: c } = T(), d = {
1300
+ note: c("activity.note"),
1301
+ email: c("activity.email"),
1302
+ call: c("activity.call"),
1303
+ meeting: c("activity.meeting"),
1304
+ task: c("activity.task")
1305
+ }, u = () => {
1306
+ r.trim() && (t == null || t(n, r.trim()), l(""));
1307
+ };
1308
+ return /* @__PURE__ */ a("div", { className: b("border-t bg-background", s), children: [
1309
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1 border-b px-3 py-1.5", children: ia.map((f) => /* @__PURE__ */ a(
1310
+ "button",
1311
+ {
1312
+ type: "button",
1313
+ onClick: () => o(f.type),
1314
+ className: b(
1315
+ "flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors",
1316
+ n === f.type ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:bg-muted hover:text-foreground"
1317
+ ),
1318
+ children: [
1319
+ f.icon,
1320
+ d[f.type] ?? f.label
1321
+ ]
1322
+ },
1323
+ f.type
1324
+ )) }),
1325
+ /* @__PURE__ */ a("div", { className: "flex items-end gap-2 px-3 py-2.5", children: [
1326
+ /* @__PURE__ */ e(
1327
+ re,
1328
+ {
1329
+ value: r,
1330
+ onChange: (f) => l(f.target.value),
1331
+ placeholder: c("activity.addPlaceholder", { type: d[n] ?? n }),
1332
+ rows: 2,
1333
+ className: "min-h-[60px] resize-none text-sm",
1334
+ onKeyDown: (f) => {
1335
+ f.key === "Enter" && !f.shiftKey && (f.preventDefault(), u());
1336
+ }
1337
+ }
1338
+ ),
1339
+ /* @__PURE__ */ e(
1340
+ S,
1341
+ {
1342
+ size: "sm",
1343
+ onClick: u,
1344
+ disabled: !r.trim(),
1345
+ className: "shrink-0",
1346
+ children: /* @__PURE__ */ e(Ve, { className: "h-3.5 w-3.5" })
1347
+ }
1348
+ )
1349
+ ] })
1350
+ ] });
1351
+ }
1352
+ function da({
1353
+ title: t,
1354
+ subtitle: s,
1355
+ avatar: n,
1356
+ status: o,
1357
+ actions: r,
1358
+ fields: l,
1359
+ activities: c = [],
1360
+ relatedEntities: d = [],
1361
+ tabs: u = [],
1362
+ defaultTab: f,
1363
+ activeTab: v,
1364
+ onTabChange: h,
1365
+ onActivityCreate: m,
1366
+ showComposer: x = !0,
1367
+ sidebarContent: N,
1368
+ className: y
1369
+ }) {
1370
+ var I, V;
1371
+ const { t: w } = T(), [i, p] = ue(f ?? ((I = u[0]) == null ? void 0 : I.id) ?? ""), k = v ?? i, C = (D) => {
1372
+ v || p(D), h == null || h(D);
1373
+ }, z = (V = u.find((D) => D.id === k)) == null ? void 0 : V.content;
1374
+ return /* @__PURE__ */ a("div", { className: b("flex h-full flex-col bg-background", y), children: [
1375
+ /* @__PURE__ */ e(
1376
+ ta,
1377
+ {
1378
+ title: t,
1379
+ subtitle: s,
1380
+ avatar: n,
1381
+ status: o,
1382
+ actions: r,
1383
+ fields: l
1384
+ }
1385
+ ),
1386
+ /* @__PURE__ */ a("div", { className: "flex flex-1 overflow-hidden", children: [
1387
+ /* @__PURE__ */ a("div", { className: "flex flex-1 flex-col border-r", children: [
1388
+ u.length > 0 && /* @__PURE__ */ e(ge, { value: k, onValueChange: C, children: /* @__PURE__ */ a(xe, { className: "w-full justify-start rounded-none border-b bg-transparent px-4 py-0 h-auto", children: [
1389
+ /* @__PURE__ */ e(
1390
+ X,
1391
+ {
1392
+ value: "__timeline__",
1393
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:shadow-none text-xs py-2",
1394
+ children: w("record.timeline")
1395
+ }
1396
+ ),
1397
+ u.map((D) => /* @__PURE__ */ a(
1398
+ X,
1399
+ {
1400
+ value: D.id,
1401
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:shadow-none text-xs py-2 gap-1.5",
1402
+ children: [
1403
+ D.icon,
1404
+ D.label,
1405
+ D.badge != null && /* @__PURE__ */ e(F, { variant: "secondary", className: "ml-1 h-4 min-w-[16px] px-1 text-[9px]", children: D.badge })
1406
+ ]
1407
+ },
1408
+ D.id
1409
+ ))
1410
+ ] }) }),
1411
+ /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-hidden", children: k === "__timeline__" || u.length === 0 ? /* @__PURE__ */ e(la, { activities: c }) : /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: z }) }),
1412
+ x && m && /* @__PURE__ */ e(oa, { onSubmit: m })
1413
+ ] }),
1414
+ /* @__PURE__ */ a("div", { className: "flex w-[280px] shrink-0 flex-col lg:w-[320px]", children: [
1415
+ d.length > 0 && /* @__PURE__ */ e(ca, { entities: d }),
1416
+ N && /* @__PURE__ */ e("div", { className: "border-t p-4", children: N })
1417
+ ] })
1418
+ ] })
1419
+ ] });
1420
+ }
1421
+ da.displayName = "RecordShell";
1422
+ const ma = {
1423
+ sm: "sm:max-w-[400px]",
1424
+ md: "sm:max-w-[560px]",
1425
+ lg: "sm:max-w-[720px]",
1426
+ xl: "sm:max-w-[900px]"
1427
+ }, ua = g.forwardRef(({ open: t, onOpenChange: s, size: n = "md", children: o, className: r }, l) => /* @__PURE__ */ e(he, { open: t, onOpenChange: s, children: /* @__PURE__ */ e(
1428
+ pe,
1429
+ {
1430
+ ref: l,
1431
+ side: "right",
1432
+ className: b(
1433
+ "flex w-full flex-col gap-0 p-0",
1434
+ ma[n],
1435
+ r
1436
+ ),
1437
+ children: /* @__PURE__ */ e(L, { className: "flex-1", children: /* @__PURE__ */ e("div", { className: "flex flex-col", children: o }) })
1438
+ }
1439
+ ) }));
1440
+ ua.displayName = "RecordPanel";
1441
+ const ha = g.forwardRef(
1442
+ ({ title: t, subtitle: s, avatar: n, status: o, actions: r, className: l }, c) => /* @__PURE__ */ a(
1443
+ "div",
1444
+ {
1445
+ ref: c,
1446
+ className: b("flex items-start justify-between gap-4 border-b px-6 pb-4 pt-6", l),
1447
+ children: [
1448
+ /* @__PURE__ */ a("div", { className: "flex items-start gap-3 min-w-0", children: [
1449
+ n && /* @__PURE__ */ e("div", { className: "shrink-0", children: n }),
1450
+ /* @__PURE__ */ a("div", { className: "min-w-0", children: [
1451
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1452
+ /* @__PURE__ */ e("h2", { className: "truncate text-lg font-semibold leading-tight", children: t }),
1453
+ o
1454
+ ] }),
1455
+ s && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-sm text-muted-foreground", children: s })
1456
+ ] })
1457
+ ] }),
1458
+ r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1.5", children: r.map((d) => /* @__PURE__ */ a(
1459
+ S,
1460
+ {
1461
+ variant: d.variant ?? "outline",
1462
+ size: "sm",
1463
+ onClick: d.onClick,
1464
+ children: [
1465
+ d.icon && /* @__PURE__ */ e("span", { className: "mr-1.5 inline-flex", children: d.icon }),
1466
+ d.label
1467
+ ]
1468
+ },
1469
+ d.id
1470
+ )) })
1471
+ ]
1472
+ }
1473
+ )
1474
+ );
1475
+ ha.displayName = "RecordPanelHeader";
1476
+ function pa({ field: t }) {
1477
+ const { t: s } = T(), [n, o] = g.useState(!1), [r, l] = g.useState(String(t.value ?? "")), c = g.useRef(null);
1478
+ g.useEffect(() => {
1479
+ var h, m;
1480
+ n && ((h = c.current) == null || h.focus(), (m = c.current) == null || m.select());
1481
+ }, [n]);
1482
+ const d = () => {
1483
+ var h;
1484
+ o(!1), r !== String(t.value ?? "") && ((h = t.onEdit) == null || h.call(t, t.type === "number" ? Number(r) : r));
1485
+ }, u = () => {
1486
+ o(!1), l(String(t.value ?? ""));
1487
+ }, f = (h) => {
1488
+ h.key === "Enter" ? (h.preventDefault(), d()) : h.key === "Escape" && (h.preventDefault(), u());
1489
+ }, v = (h) => h.preventDefault();
1490
+ return n ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
1491
+ /* @__PURE__ */ e(
1492
+ $,
1493
+ {
1494
+ ref: c,
1495
+ type: t.type === "number" ? "number" : t.type === "date" ? "date" : "text",
1496
+ value: r,
1497
+ onChange: (h) => l(h.target.value),
1498
+ onBlur: d,
1499
+ onKeyDown: f,
1500
+ className: "h-7 text-sm"
1501
+ }
1502
+ ),
1503
+ /* @__PURE__ */ e(
1504
+ "button",
1505
+ {
1506
+ onMouseDown: v,
1507
+ onClick: d,
1508
+ className: "flex h-6 w-6 shrink-0 items-center justify-center rounded text-primary hover:text-primary/80 hover:bg-muted transition-colors",
1509
+ "aria-label": s("editable.save"),
1510
+ children: /* @__PURE__ */ e(Ie, { className: "h-3.5 w-3.5" })
1511
+ }
1512
+ ),
1513
+ /* @__PURE__ */ e(
1514
+ "button",
1515
+ {
1516
+ onMouseDown: v,
1517
+ onClick: u,
1518
+ className: "flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
1519
+ "aria-label": s("editable.cancel"),
1520
+ children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
1521
+ }
1522
+ )
1523
+ ] }) : /* @__PURE__ */ a(
1524
+ "div",
1525
+ {
1526
+ className: "group/field flex min-h-[28px] cursor-default items-center gap-1.5",
1527
+ role: t.editable ? "button" : void 0,
1528
+ tabIndex: t.editable ? 0 : void 0,
1529
+ onClick: () => t.editable && o(!0),
1530
+ onKeyDown: (h) => {
1531
+ t.editable && (h.key === "Enter" || h.key === " ") && (h.preventDefault(), o(!0));
1532
+ },
1533
+ children: [
1534
+ /* @__PURE__ */ e("span", { className: "text-sm", children: t.value ?? /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: s("editable.emptyValue") }) }),
1535
+ t.editable && /* @__PURE__ */ e(je, { className: "h-3 w-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/field:opacity-100" })
1536
+ ]
1537
+ }
1538
+ );
1539
+ }
1540
+ const fa = g.forwardRef(
1541
+ ({ fields: t, className: s }, n) => /* @__PURE__ */ e("div", { ref: n, className: b("border-b px-6 py-4", s), children: /* @__PURE__ */ e("div", { className: "grid grid-cols-[minmax(100px,auto)_1fr] gap-x-4 gap-y-2", children: t.map((o) => /* @__PURE__ */ a(g.Fragment, { children: [
1542
+ /* @__PURE__ */ e("span", { className: "flex items-center text-sm text-muted-foreground", children: o.label }),
1543
+ /* @__PURE__ */ e(pa, { field: o })
1544
+ ] }, o.id)) }) })
1545
+ );
1546
+ fa.displayName = "RecordPanelFields";
1547
+ const ga = g.forwardRef(
1548
+ ({ tabs: t, defaultTab: s, activeTab: n, onTabChange: o, className: r }, l) => {
1549
+ var d;
1550
+ const c = s ?? ((d = t[0]) == null ? void 0 : d.id);
1551
+ return /* @__PURE__ */ e("div", { ref: l, className: b("flex flex-col", r), children: /* @__PURE__ */ a(
1552
+ ge,
1553
+ {
1554
+ value: n,
1555
+ defaultValue: n ? void 0 : c,
1556
+ onValueChange: o,
1557
+ children: [
1558
+ /* @__PURE__ */ e(xe, { className: "w-full justify-start rounded-none border-b bg-transparent px-6 py-0 h-auto", children: t.map((u) => /* @__PURE__ */ a(
1559
+ X,
1560
+ {
1561
+ value: u.id,
1562
+ className: "rounded-none border-b-2 border-transparent px-3 py-2.5 text-sm data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none gap-1.5",
1563
+ children: [
1564
+ u.icon && /* @__PURE__ */ e("span", { className: "inline-flex", children: u.icon }),
1565
+ u.label,
1566
+ u.badge != null && /* @__PURE__ */ e(F, { variant: "secondary", className: "ml-1 h-4 min-w-[16px] px-1 text-[10px]", children: u.badge })
1567
+ ]
1568
+ },
1569
+ u.id
1570
+ )) }),
1571
+ t.map((u) => /* @__PURE__ */ e(Fe, { value: u.id, className: "mt-0 px-6 py-4", children: u.content }, u.id))
1572
+ ]
1573
+ }
1574
+ ) });
1575
+ }
1576
+ );
1577
+ ga.displayName = "RecordPanelTabs";
1578
+ function xa(t) {
1579
+ return t.split(" ").map((s) => s[0]).join("").toUpperCase().slice(0, 2);
1580
+ }
1581
+ const Na = g.forwardRef(
1582
+ ({ activities: t, maxItems: s = 5, onViewAll: n, className: o }, r) => {
1583
+ const l = t.slice(0, s), c = t.length > s, { t: d } = T(), u = (f) => {
1584
+ const v = typeof f == "string" ? new Date(f) : f, m = (/* @__PURE__ */ new Date()).getTime() - v.getTime(), x = Math.floor(m / 6e4), N = Math.floor(x / 60), y = Math.floor(N / 24);
1585
+ return x < 1 ? d("record.justNow") : x < 60 ? d("record.minutesAgo", { count: x }) : N < 24 ? d("record.hoursAgo", { count: N }) : y < 7 ? d("record.daysAgo", { count: y }) : v.toLocaleDateString(void 0, { month: "short", day: "numeric" });
1586
+ };
1587
+ return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: b("px-6 py-4", o), children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: d("record.noActivity") }) }) : /* @__PURE__ */ a("div", { ref: r, className: b("px-6 py-4", o), children: [
1588
+ /* @__PURE__ */ e("h3", { className: "mb-3 text-sm font-medium", children: d("record.recentActivity") }),
1589
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: l.map((f) => /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
1590
+ f.user ? /* @__PURE__ */ a(Ne, { className: "h-7 w-7 shrink-0", children: [
1591
+ f.user.avatar && /* @__PURE__ */ e(ve, { src: f.user.avatar, alt: f.user.name }),
1592
+ /* @__PURE__ */ e(be, { className: "text-[10px]", children: xa(f.user.name) })
1593
+ ] }) : /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ e("div", { className: "h-2 w-2 rounded-full bg-muted-foreground/50" }) }),
1594
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1595
+ /* @__PURE__ */ a("div", { className: "flex items-baseline justify-between gap-2", children: [
1596
+ /* @__PURE__ */ e("p", { className: "truncate text-sm font-medium", children: f.title }),
1597
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-muted-foreground", children: u(f.timestamp) })
1598
+ ] }),
1599
+ f.description && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: f.description })
1600
+ ] })
1601
+ ] }, f.id)) }),
1602
+ c && n && /* @__PURE__ */ e(
1603
+ S,
1604
+ {
1605
+ variant: "link",
1606
+ size: "sm",
1607
+ className: "mt-2 h-auto p-0 text-xs",
1608
+ onClick: n,
1609
+ children: d("record.viewAll", { count: t.length })
1610
+ }
1611
+ )
1612
+ ] });
1613
+ }
1614
+ );
1615
+ Na.displayName = "RecordPanelActivity";
1616
+ const va = g.forwardRef(
1617
+ ({
1618
+ trigger: t,
1619
+ fields: s,
1620
+ title: n,
1621
+ subtitle: o,
1622
+ avatar: r,
1623
+ actions: l,
1624
+ onOpenFull: c,
1625
+ mode: d = "hover",
1626
+ className: u
1627
+ }, f) => {
1628
+ const [v, h] = g.useState(!1), m = g.useRef(), x = d === "hover", { t: N } = T(), y = () => {
1629
+ m.current && (clearTimeout(m.current), m.current = void 0);
1630
+ }, w = () => {
1631
+ y(), m.current = setTimeout(() => h(!1), 200);
1632
+ };
1633
+ g.useEffect(() => () => y(), []);
1634
+ const i = x ? {
1635
+ onMouseEnter: () => {
1636
+ y(), h(!0);
1637
+ },
1638
+ onMouseLeave: w
1639
+ } : {}, p = x ? {
1640
+ onMouseEnter: y,
1641
+ onMouseLeave: w
1642
+ } : {}, k = /* @__PURE__ */ a(
1643
+ "div",
1644
+ {
1645
+ ref: f,
1646
+ className: b("flex flex-col", u),
1647
+ ...p,
1648
+ children: [
1649
+ /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
1650
+ r && /* @__PURE__ */ e("div", { className: "shrink-0", children: r }),
1651
+ /* @__PURE__ */ a("div", { className: "min-w-0", children: [
1652
+ /* @__PURE__ */ e("p", { className: "truncate text-sm font-semibold", children: n }),
1653
+ o && /* @__PURE__ */ e("p", { className: "truncate text-xs text-muted-foreground", children: o })
1654
+ ] })
1655
+ ] }),
1656
+ s.length > 0 && /* @__PURE__ */ a(_, { children: [
1657
+ /* @__PURE__ */ e(me, { className: "my-3" }),
1658
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5", children: s.map((C) => /* @__PURE__ */ a(g.Fragment, { children: [
1659
+ /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: C.label }),
1660
+ /* @__PURE__ */ e("span", { className: "truncate text-xs", children: C.value ?? N("editable.emptyValue") })
1661
+ ] }, C.id)) })
1662
+ ] }),
1663
+ l && l.length > 0 && /* @__PURE__ */ a(_, { children: [
1664
+ /* @__PURE__ */ e(me, { className: "my-3" }),
1665
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: l.map((C) => /* @__PURE__ */ a(
1666
+ S,
1667
+ {
1668
+ variant: C.variant ?? "outline",
1669
+ size: "sm",
1670
+ className: "h-7 text-xs",
1671
+ onClick: C.onClick,
1672
+ children: [
1673
+ C.icon && /* @__PURE__ */ e("span", { className: "mr-1 inline-flex", children: C.icon }),
1674
+ C.label
1675
+ ]
1676
+ },
1677
+ C.id
1678
+ )) })
1679
+ ] }),
1680
+ c && /* @__PURE__ */ a(_, { children: [
1681
+ /* @__PURE__ */ e(me, { className: "my-3" }),
1682
+ /* @__PURE__ */ a(
1683
+ S,
1684
+ {
1685
+ variant: "link",
1686
+ size: "sm",
1687
+ className: "h-auto justify-start p-0 text-xs",
1688
+ onClick: c,
1689
+ children: [
1690
+ /* @__PURE__ */ e(vt, { className: "mr-1 h-3 w-3" }),
1691
+ N("record.openFullRecord")
1692
+ ]
1693
+ }
1694
+ )
1695
+ ] })
1696
+ ]
1697
+ }
1698
+ );
1699
+ return /* @__PURE__ */ a(gt, { open: v, onOpenChange: x ? void 0 : h, children: [
1700
+ /* @__PURE__ */ e(xt, { asChild: !0, children: /* @__PURE__ */ e("span", { ...i, children: t }) }),
1701
+ /* @__PURE__ */ e(
1702
+ Nt,
1703
+ {
1704
+ align: "start",
1705
+ sideOffset: 8,
1706
+ className: "w-80",
1707
+ onOpenAutoFocus: (C) => {
1708
+ x && C.preventDefault();
1709
+ },
1710
+ children: k
1711
+ }
1712
+ )
1713
+ ] });
1714
+ }
1715
+ );
1716
+ va.displayName = "QuickView";
1717
+ function ba(t) {
1718
+ switch (t) {
1719
+ case "number":
1720
+ return "number";
1721
+ case "date":
1722
+ return "date";
1723
+ case "email":
1724
+ return "email";
1725
+ case "phone":
1726
+ return "tel";
1727
+ case "url":
1728
+ return "url";
1729
+ default:
1730
+ return "text";
1731
+ }
1732
+ }
1733
+ const ya = g.forwardRef(
1734
+ ({
1735
+ open: t,
1736
+ onOpenChange: s,
1737
+ mode: n,
1738
+ title: o,
1739
+ fields: r,
1740
+ defaultValues: l,
1741
+ onSubmit: c,
1742
+ className: d
1743
+ }, u) => {
1744
+ const [f, v] = g.useState({}), [h, m] = g.useState(!1), { t: x } = T();
1745
+ g.useEffect(() => {
1746
+ if (t) {
1747
+ const i = {};
1748
+ for (const p of r)
1749
+ i[p.id] = (l == null ? void 0 : l[p.id]) ?? (typeof p.value == "string" ? p.value : "");
1750
+ v(i);
1751
+ }
1752
+ }, [t, r, l]);
1753
+ const N = (i, p) => {
1754
+ v((k) => ({ ...k, [i]: p }));
1755
+ }, y = async (i) => {
1756
+ i.preventDefault(), m(!0);
1757
+ try {
1758
+ await c(f), s(!1);
1759
+ } finally {
1760
+ m(!1);
1761
+ }
1762
+ }, w = o ?? x(n === "create" ? "record.createRecord" : "record.editRecord");
1763
+ return /* @__PURE__ */ e(Oe, { open: t, onOpenChange: s, children: /* @__PURE__ */ e(He, { ref: u, size: "md", className: b("sm:max-w-lg", d), children: /* @__PURE__ */ a("form", { onSubmit: y, children: [
1764
+ /* @__PURE__ */ a(bt, { children: [
1765
+ /* @__PURE__ */ e(Be, { children: w }),
1766
+ /* @__PURE__ */ e(yt, { children: x(n === "create" ? "record.createDescription" : "record.editDescription") })
1767
+ ] }),
1768
+ /* @__PURE__ */ e("div", { className: "mt-4 grid gap-4", children: r.map((i) => /* @__PURE__ */ a("div", { className: "grid gap-2", children: [
1769
+ /* @__PURE__ */ e(Dt, { htmlFor: `record-form-${i.id}`, children: i.label }),
1770
+ i.type === "select" && i.options ? /* @__PURE__ */ a(
1771
+ we,
1772
+ {
1773
+ value: String(f[i.id] ?? ""),
1774
+ onValueChange: (p) => N(i.id, p),
1775
+ children: [
1776
+ /* @__PURE__ */ e(ke, { id: `record-form-${i.id}`, size: "sm", children: /* @__PURE__ */ e(De, { placeholder: `Select ${i.label.toLowerCase()}` }) }),
1777
+ /* @__PURE__ */ e(Ce, { children: i.options.map((p) => /* @__PURE__ */ e(Se, { value: p.value, children: p.label }, p.value)) })
1778
+ ]
1779
+ }
1780
+ ) : /* @__PURE__ */ e(
1781
+ $,
1782
+ {
1783
+ id: `record-form-${i.id}`,
1784
+ type: ba(i.type),
1785
+ value: String(f[i.id] ?? ""),
1786
+ onChange: (p) => N(
1787
+ i.id,
1788
+ i.type === "number" ? Number(p.target.value) : p.target.value
1789
+ ),
1790
+ placeholder: i.label
1791
+ }
1792
+ )
1793
+ ] }, i.id)) }),
1794
+ /* @__PURE__ */ a(wt, { className: "mt-6", children: [
1795
+ /* @__PURE__ */ e(
1796
+ S,
1797
+ {
1798
+ type: "button",
1799
+ variant: "outline",
1800
+ onClick: () => s(!1),
1801
+ disabled: h,
1802
+ children: x("common.cancel")
1803
+ }
1804
+ ),
1805
+ /* @__PURE__ */ e(S, { type: "submit", disabled: h, children: x(h ? n === "create" ? "record.creating" : "record.saving" : n === "create" ? "record.create" : "record.saveChanges") })
1806
+ ] })
1807
+ ] }) }) });
1808
+ }
1809
+ );
1810
+ ya.displayName = "RecordFormDialog";
1811
+ const Je = g.createContext(null);
1812
+ function q() {
1813
+ const t = g.useContext(Je);
1814
+ if (!t)
1815
+ throw new Error("useRecordDialog must be used within a RecordDialog component");
1816
+ return t;
1817
+ }
1818
+ function wa({
1819
+ mode: t,
1820
+ onModeChange: s,
1821
+ children: n
1822
+ }) {
1823
+ const [o, r] = g.useState(!1), [l, c] = g.useState(!1), d = g.useCallback(
1824
+ (f) => {
1825
+ s == null || s(f);
1826
+ },
1827
+ [s]
1828
+ ), u = g.useMemo(
1829
+ () => ({
1830
+ mode: t,
1831
+ setMode: d,
1832
+ isDirty: o,
1833
+ setIsDirty: r,
1834
+ isSubmitting: l,
1835
+ setIsSubmitting: c
1836
+ }),
1837
+ [t, d, o, l]
1838
+ );
1839
+ return /* @__PURE__ */ e(Je.Provider, { value: u, children: n });
1840
+ }
1841
+ const ka = g.forwardRef(
1842
+ ({ open: t, onOpenChange: s, mode: n, onModeChange: o, ariaTitle: r, children: l, className: c }, d) => /* @__PURE__ */ e(Oe, { open: t, onOpenChange: s, children: /* @__PURE__ */ a(
1843
+ He,
1844
+ {
1845
+ ref: d,
1846
+ size: "4xl",
1847
+ className: b(
1848
+ "flex flex-col gap-0 overflow-hidden p-0",
1849
+ "max-w-[98vw] sm:max-w-[92vw] lg:max-w-[90vw] 2xl:max-w-[1600px]",
1850
+ "h-[95vh] sm:h-[88vh] lg:h-[85vh]",
1851
+ "[&>button.absolute]:hidden",
1852
+ c
1853
+ ),
1854
+ children: [
1855
+ /* @__PURE__ */ e(Be, { className: "sr-only", children: r ?? "Record" }),
1856
+ /* @__PURE__ */ e(wa, { mode: n, onModeChange: o, children: l })
1857
+ ]
1858
+ }
1859
+ ) })
1860
+ );
1861
+ ka.displayName = "RecordDialog";
1862
+ const Da = g.forwardRef(
1863
+ ({ title: t, subtitle: s, avatar: n, status: o, actions: r = [], className: l }, c) => {
1864
+ const { mode: d } = q(), { t: u } = T(), f = r.filter(
1865
+ (m) => !m.showInModes || m.showInModes.includes(d)
1866
+ ), v = f.slice(0, 2), h = f.slice(2);
1867
+ return /* @__PURE__ */ a(
1868
+ "div",
1869
+ {
1870
+ ref: c,
1871
+ className: b(
1872
+ "sticky top-0 z-10 flex items-start gap-4 border-b bg-background px-6 py-4 sm:px-8",
1873
+ l
1874
+ ),
1875
+ children: [
1876
+ n && /* @__PURE__ */ e("div", { className: "shrink-0", children: n }),
1877
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1878
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
1879
+ /* @__PURE__ */ e("h2", { className: "truncate text-lg font-semibold", children: t }),
1880
+ o && /* @__PURE__ */ e("div", { className: "shrink-0", children: o })
1881
+ ] }),
1882
+ s && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-sm text-muted-foreground", children: s })
1883
+ ] }),
1884
+ /* @__PURE__ */ a("div", { className: "flex shrink-0 items-center gap-2", children: [
1885
+ v.map((m) => /* @__PURE__ */ a(
1886
+ S,
1887
+ {
1888
+ variant: m.variant ?? "outline",
1889
+ size: "sm",
1890
+ onClick: m.onClick,
1891
+ disabled: m.disabled || m.loading,
1892
+ children: [
1893
+ m.icon && /* @__PURE__ */ e("span", { className: "mr-1.5", children: m.icon }),
1894
+ m.label
1895
+ ]
1896
+ },
1897
+ m.id
1898
+ )),
1899
+ h.length > 0 && /* @__PURE__ */ a(Z, { children: [
1900
+ /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ e(S, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ e(ae, { className: "h-4 w-4" }) }) }),
1901
+ /* @__PURE__ */ e(te, { align: "end", children: h.map((m) => /* @__PURE__ */ a(
1902
+ O,
1903
+ {
1904
+ onClick: m.onClick,
1905
+ disabled: m.disabled,
1906
+ className: m.variant === "destructive" ? "text-destructive" : void 0,
1907
+ children: [
1908
+ m.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: m.icon }),
1909
+ m.label
1910
+ ]
1911
+ },
1912
+ m.id
1913
+ )) })
1914
+ ] }),
1915
+ /* @__PURE__ */ e(kt, { asChild: !0, children: /* @__PURE__ */ a(S, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
1916
+ /* @__PURE__ */ e(ye, { className: "h-4 w-4" }),
1917
+ /* @__PURE__ */ e("span", { className: "sr-only", children: u("recordDialog.close") })
1918
+ ] }) })
1919
+ ] })
1920
+ ]
1921
+ }
1922
+ );
1923
+ }
1924
+ );
1925
+ Da.displayName = "RecordDialogHeader";
1926
+ const Ca = {
1927
+ up: "text-emerald-600",
1928
+ down: "text-destructive",
1929
+ neutral: "text-muted-foreground"
1930
+ }, Sa = {
1931
+ up: /* @__PURE__ */ e(At, { className: "h-3 w-3" }),
1932
+ down: /* @__PURE__ */ e(It, { className: "h-3 w-3" }),
1933
+ neutral: /* @__PURE__ */ e(Ct, { className: "h-3 w-3" })
1934
+ }, Ra = g.forwardRef(
1935
+ ({ fields: t, className: s }, n) => {
1936
+ const { mode: o } = q();
1937
+ return o === "create" || t.length === 0 ? null : /* @__PURE__ */ e(
1938
+ "div",
1939
+ {
1940
+ ref: n,
1941
+ className: b("border-b bg-muted/30 px-6 py-4 sm:px-8", s),
1942
+ children: /* @__PURE__ */ e(
1943
+ "div",
1944
+ {
1945
+ className: b(
1946
+ "grid gap-4 divide-x",
1947
+ t.length === 1 && "grid-cols-1",
1948
+ t.length === 2 && "grid-cols-2",
1949
+ t.length === 3 && "grid-cols-2 sm:grid-cols-3",
1950
+ t.length >= 4 && "grid-cols-2 sm:grid-cols-4"
1951
+ ),
1952
+ children: t.map((r, l) => /* @__PURE__ */ a(
1953
+ "div",
1954
+ {
1955
+ className: b("flex flex-col gap-1", l > 0 && "pl-4"),
1956
+ children: [
1957
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 text-xs font-medium text-muted-foreground", children: [
1958
+ r.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: r.icon }),
1959
+ r.label
1960
+ ] }),
1961
+ /* @__PURE__ */ e("div", { className: "text-sm font-semibold", children: r.value }),
1962
+ r.change && /* @__PURE__ */ a(
1963
+ "div",
1964
+ {
1965
+ className: b(
1966
+ "flex items-center gap-0.5 text-xs font-medium",
1967
+ Ca[r.change.direction]
1968
+ ),
1969
+ children: [
1970
+ Sa[r.change.direction],
1971
+ r.change.value
1972
+ ]
1973
+ }
1974
+ )
1975
+ ]
1976
+ },
1977
+ r.id
1978
+ ))
1979
+ }
1980
+ )
1981
+ }
1982
+ );
1983
+ }
1984
+ );
1985
+ Ra.displayName = "RecordDialogHighlight";
1986
+ const Ta = g.forwardRef(
1987
+ ({ tabs: t = [], defaultTab: s, activeTab: n, onTabChange: o, children: r, className: l }, c) => {
1988
+ var v;
1989
+ const { mode: d } = q(), u = t.filter(
1990
+ (h) => !h.hideInModes || !h.hideInModes.includes(d)
1991
+ );
1992
+ if (u.length === 0)
1993
+ return /* @__PURE__ */ e("div", { ref: c, className: b("flex-1 overflow-hidden", l), children: /* @__PURE__ */ e(L, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "px-6 py-6 sm:px-8", children: r }) }) });
1994
+ const f = s ?? ((v = u[0]) == null ? void 0 : v.id);
1995
+ return /* @__PURE__ */ e("div", { ref: c, className: b("flex flex-1 flex-col overflow-hidden", l), children: /* @__PURE__ */ a(
1996
+ ge,
1997
+ {
1998
+ value: n,
1999
+ defaultValue: f,
2000
+ onValueChange: o,
2001
+ className: "flex flex-1 flex-col overflow-hidden",
2002
+ children: [
2003
+ /* @__PURE__ */ e(xe, { className: "h-auto w-full justify-start gap-0 rounded-none border-b bg-transparent p-0 px-6 sm:px-8", children: u.map((h) => /* @__PURE__ */ e(
2004
+ X,
2005
+ {
2006
+ value: h.id,
2007
+ className: b(
2008
+ "relative rounded-none border-b-2 border-transparent bg-transparent px-4 py-2.5 text-sm font-medium text-muted-foreground shadow-none transition-none",
2009
+ "data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none"
2010
+ ),
2011
+ children: /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
2012
+ h.icon,
2013
+ h.label,
2014
+ h.badge != null && /* @__PURE__ */ e(F, { variant: "secondary", className: "h-5 min-w-[20px] px-1.5 text-[10px]", children: h.badge })
2015
+ ] })
2016
+ },
2017
+ h.id
2018
+ )) }),
2019
+ u.map((h) => /* @__PURE__ */ e(
2020
+ Fe,
2021
+ {
2022
+ value: h.id,
2023
+ className: "mt-0 flex-1 overflow-hidden data-[state=inactive]:hidden",
2024
+ children: /* @__PURE__ */ e(L, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "px-6 py-6 sm:px-8", children: h.content }) })
2025
+ },
2026
+ h.id
2027
+ ))
2028
+ ]
2029
+ }
2030
+ ) });
2031
+ }
2032
+ );
2033
+ Ta.displayName = "RecordDialogBody";
2034
+ const Ma = g.forwardRef(
2035
+ ({ id: t, title: s, icon: n, defaultCollapsed: o = !1, children: r, className: l }, c) => /* @__PURE__ */ e("div", { ref: c, className: l, children: /* @__PURE__ */ e(
2036
+ St,
2037
+ {
2038
+ type: "multiple",
2039
+ defaultValue: o ? [] : [t],
2040
+ children: /* @__PURE__ */ a(Rt, { value: t, className: "border-b-0", children: [
2041
+ /* @__PURE__ */ e(Tt, { className: "text-base font-semibold py-4 hover:no-underline", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2042
+ n && /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: n }),
2043
+ s
2044
+ ] }) }),
2045
+ /* @__PURE__ */ e(Mt, { children: r })
2046
+ ] })
2047
+ }
2048
+ ) })
2049
+ );
2050
+ Ma.displayName = "RecordDialogSection";
2051
+ function Pa({ field: t }) {
2052
+ var h;
2053
+ const { t: s } = T(), [n, o] = g.useState(!1), [r, l] = g.useState(String(t.value ?? "")), c = g.useRef(null);
2054
+ g.useEffect(() => {
2055
+ var m;
2056
+ n && ((m = c.current) == null || m.focus(), c.current instanceof HTMLInputElement && c.current.select());
2057
+ }, [n]);
2058
+ const d = () => {
2059
+ var m;
2060
+ o(!1), r !== String(t.value ?? "") && ((m = t.onEdit) == null || m.call(t, t.type === "number" ? Number(r) : r));
2061
+ }, u = () => {
2062
+ o(!1), l(String(t.value ?? ""));
2063
+ }, f = (m) => {
2064
+ m.key === "Enter" && t.type !== "textarea" ? (m.preventDefault(), d()) : m.key === "Escape" && (m.preventDefault(), u());
2065
+ }, v = (m) => m.preventDefault();
2066
+ return n ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
2067
+ t.type === "textarea" ? /* @__PURE__ */ e(
2068
+ re,
2069
+ {
2070
+ ref: c,
2071
+ value: r,
2072
+ onChange: (m) => l(m.target.value),
2073
+ onBlur: d,
2074
+ onKeyDown: (m) => {
2075
+ m.key === "Escape" && (m.preventDefault(), u());
2076
+ },
2077
+ rows: 3,
2078
+ className: "text-sm"
2079
+ }
2080
+ ) : t.type === "select" ? /* @__PURE__ */ a(
2081
+ we,
2082
+ {
2083
+ value: r,
2084
+ onValueChange: (m) => {
2085
+ var x;
2086
+ (x = t.onEdit) == null || x.call(t, m), o(!1);
2087
+ },
2088
+ children: [
2089
+ /* @__PURE__ */ e(ke, { className: "h-8 text-sm", children: /* @__PURE__ */ e(De, {}) }),
2090
+ /* @__PURE__ */ e(Ce, { children: (h = t.options) == null ? void 0 : h.map((m) => /* @__PURE__ */ e(Se, { value: m.value, children: m.label }, m.value)) })
2091
+ ]
2092
+ }
2093
+ ) : /* @__PURE__ */ e(
2094
+ $,
2095
+ {
2096
+ ref: c,
2097
+ type: Xe(t.type),
2098
+ value: r,
2099
+ onChange: (m) => l(m.target.value),
2100
+ onBlur: d,
2101
+ onKeyDown: f,
2102
+ className: "h-8 text-sm"
2103
+ }
2104
+ ),
2105
+ t.type !== "select" && /* @__PURE__ */ a(_, { children: [
2106
+ /* @__PURE__ */ e(
2107
+ "button",
2108
+ {
2109
+ onMouseDown: v,
2110
+ onClick: d,
2111
+ className: "flex h-6 w-6 shrink-0 items-center justify-center rounded text-primary hover:text-primary/80 hover:bg-muted transition-colors",
2112
+ "aria-label": s("editable.save"),
2113
+ children: /* @__PURE__ */ e(Ie, { className: "h-3.5 w-3.5" })
2114
+ }
2115
+ ),
2116
+ /* @__PURE__ */ e(
2117
+ "button",
2118
+ {
2119
+ onMouseDown: v,
2120
+ onClick: u,
2121
+ className: "flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
2122
+ "aria-label": s("editable.cancel"),
2123
+ children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
2124
+ }
2125
+ )
2126
+ ] })
2127
+ ] }) : /* @__PURE__ */ a(
2128
+ "div",
2129
+ {
2130
+ className: "group/field flex min-h-[28px] cursor-default items-center gap-1.5",
2131
+ role: t.editable ? "button" : void 0,
2132
+ tabIndex: t.editable ? 0 : void 0,
2133
+ onClick: () => t.editable && o(!0),
2134
+ onKeyDown: (m) => {
2135
+ t.editable && (m.key === "Enter" || m.key === " ") && (m.preventDefault(), o(!0));
2136
+ },
2137
+ children: [
2138
+ t.renderView ? t.renderView(t.value) : /* @__PURE__ */ e("span", { className: "text-sm", children: t.value ?? /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: s("editable.emptyValue") }) }),
2139
+ t.editable && /* @__PURE__ */ e(je, { className: "h-3 w-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/field:opacity-100" })
2140
+ ]
2141
+ }
2142
+ );
2143
+ }
2144
+ function Pe({ field: t }) {
2145
+ var o;
2146
+ const { t: s } = T(), { mode: n } = q();
2147
+ return t.type === "custom" && t.renderEdit ? /* @__PURE__ */ e(_, { children: t.renderEdit(t.value, (r) => {
2148
+ var l;
2149
+ return (l = t.onEdit) == null ? void 0 : l.call(t, r);
2150
+ }) }) : t.type === "checkbox" ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2 pt-1", children: [
2151
+ /* @__PURE__ */ e(
2152
+ W,
2153
+ {
2154
+ id: `field-${t.id}`,
2155
+ checked: !!t.value,
2156
+ onCheckedChange: (r) => {
2157
+ var l;
2158
+ return (l = t.onEdit) == null ? void 0 : l.call(t, r);
2159
+ },
2160
+ disabled: !t.editable && n !== "create"
2161
+ }
2162
+ ),
2163
+ /* @__PURE__ */ e("label", { htmlFor: `field-${t.id}`, className: "text-sm", children: t.label })
2164
+ ] }) : t.type === "select" ? /* @__PURE__ */ a(
2165
+ we,
2166
+ {
2167
+ value: String(t.value ?? ""),
2168
+ onValueChange: (r) => {
2169
+ var l;
2170
+ return (l = t.onEdit) == null ? void 0 : l.call(t, r);
2171
+ },
2172
+ disabled: !t.editable && n !== "create",
2173
+ children: [
2174
+ /* @__PURE__ */ e(ke, { className: "h-9 text-sm", children: /* @__PURE__ */ e(De, { placeholder: t.placeholder || s("common.select") }) }),
2175
+ /* @__PURE__ */ e(Ce, { children: (o = t.options) == null ? void 0 : o.map((r) => /* @__PURE__ */ e(Se, { value: r.value, children: r.label }, r.value)) })
2176
+ ]
2177
+ }
2178
+ ) : t.type === "textarea" ? /* @__PURE__ */ e(
2179
+ re,
2180
+ {
2181
+ value: String(t.value ?? ""),
2182
+ onChange: (r) => {
2183
+ var l;
2184
+ return (l = t.onEdit) == null ? void 0 : l.call(t, r.target.value);
2185
+ },
2186
+ placeholder: t.placeholder,
2187
+ rows: 3,
2188
+ className: "text-sm",
2189
+ disabled: !t.editable && n !== "create"
2190
+ }
2191
+ ) : t.type === "currency" ? /* @__PURE__ */ a("div", { className: "relative", children: [
2192
+ /* @__PURE__ */ e("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground", children: "$" }),
2193
+ /* @__PURE__ */ e(
2194
+ $,
2195
+ {
2196
+ type: "number",
2197
+ value: String(t.value ?? ""),
2198
+ onChange: (r) => {
2199
+ var l;
2200
+ return (l = t.onEdit) == null ? void 0 : l.call(t, r.target.value ? Number(r.target.value) : "");
2201
+ },
2202
+ placeholder: t.placeholder,
2203
+ className: "h-9 pl-7 text-sm",
2204
+ disabled: !t.editable && n !== "create"
2205
+ }
2206
+ )
2207
+ ] }) : /* @__PURE__ */ e(
2208
+ $,
2209
+ {
2210
+ type: Xe(t.type),
2211
+ value: String(t.value ?? ""),
2212
+ onChange: (r) => {
2213
+ var l;
2214
+ return (l = t.onEdit) == null ? void 0 : l.call(t, t.type === "number" ? Number(r.target.value) : r.target.value);
2215
+ },
2216
+ placeholder: t.placeholder,
2217
+ className: "h-9 text-sm",
2218
+ disabled: !t.editable && n !== "create"
2219
+ }
2220
+ );
2221
+ }
2222
+ const Ia = g.forwardRef(
2223
+ ({ fields: t, columns: s = 2, className: n }, o) => {
2224
+ const { mode: r } = q(), { t: l } = T();
2225
+ if (t.length === 0)
2226
+ return /* @__PURE__ */ e("div", { className: "py-6 text-center text-sm text-muted-foreground", children: l("recordDialog.noFields") });
2227
+ const c = b(
2228
+ "grid gap-x-8 gap-y-5",
2229
+ s === 1 && "grid-cols-1",
2230
+ s === 2 && "grid-cols-1 sm:grid-cols-2",
2231
+ s === 3 && "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
2232
+ );
2233
+ return /* @__PURE__ */ e("div", { ref: o, className: b(c, n), children: t.map((d) => {
2234
+ const f = (r === "edit" || r === "create") && (d.editable || r === "create") && d.type !== "checkbox";
2235
+ return /* @__PURE__ */ a(
2236
+ "div",
2237
+ {
2238
+ className: b(d.fullWidth && "col-span-full"),
2239
+ children: [
2240
+ d.type !== "checkbox" && /* @__PURE__ */ a("label", { className: "mb-1 block text-sm font-medium text-muted-foreground", children: [
2241
+ d.label,
2242
+ d.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-destructive", children: "*" })
2243
+ ] }),
2244
+ f ? /* @__PURE__ */ e(Pe, { field: d }) : d.type === "checkbox" ? /* @__PURE__ */ e(Pe, { field: d }) : /* @__PURE__ */ e(Pa, { field: d }),
2245
+ d.helpText && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-muted-foreground", children: d.helpText })
2246
+ ]
2247
+ },
2248
+ d.id
2249
+ );
2250
+ }) });
2251
+ }
2252
+ );
2253
+ Ia.displayName = "RecordDialogFields";
2254
+ function Xe(t) {
2255
+ switch (t) {
2256
+ case "number":
2257
+ case "currency":
2258
+ return "number";
2259
+ case "date":
2260
+ return "date";
2261
+ case "email":
2262
+ return "email";
2263
+ case "phone":
2264
+ return "tel";
2265
+ case "url":
2266
+ return "url";
2267
+ default:
2268
+ return "text";
2269
+ }
2270
+ }
2271
+ const Aa = {
2272
+ note: /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }),
2273
+ email: /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5" }),
2274
+ call: /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5" }),
2275
+ meeting: /* @__PURE__ */ e(G, { className: "h-3.5 w-3.5" }),
2276
+ task: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }),
2277
+ update: /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" }),
2278
+ custom: /* @__PURE__ */ e(Ke, { className: "h-3.5 w-3.5" })
2279
+ }, Ea = {
2280
+ note: "bg-blue-100 text-blue-600",
2281
+ email: "bg-purple-100 text-purple-600",
2282
+ call: "bg-green-100 text-green-600",
2283
+ meeting: "bg-amber-100 text-amber-600",
2284
+ task: "bg-emerald-100 text-emerald-600",
2285
+ update: "bg-muted text-muted-foreground",
2286
+ custom: "bg-muted text-muted-foreground"
2287
+ }, La = [
2288
+ { type: "note", labelKey: "activity.note", icon: /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) },
2289
+ { type: "email", labelKey: "activity.email", icon: /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5" }) },
2290
+ { type: "call", labelKey: "activity.call", icon: /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5" }) },
2291
+ { type: "meeting", labelKey: "activity.meeting", icon: /* @__PURE__ */ e(G, { className: "h-3.5 w-3.5" }) },
2292
+ { type: "task", labelKey: "activity.task", icon: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }) }
2293
+ ];
2294
+ function ja(t) {
2295
+ return t.split(" ").map((s) => s[0]).join("").toUpperCase().slice(0, 2);
2296
+ }
2297
+ function Fa(t) {
2298
+ const s = /* @__PURE__ */ new Map();
2299
+ for (const n of t) {
2300
+ const r = (n.timestamp instanceof Date ? n.timestamp : new Date(n.timestamp)).toLocaleDateString(), l = s.get(r) ?? [];
2301
+ l.push(n), s.set(r, l);
2302
+ }
2303
+ return Array.from(s.entries()).map(([n, o]) => ({ date: n, items: o }));
2304
+ }
2305
+ const za = g.forwardRef(
2306
+ ({ activities: t, showComposer: s, onActivityCreate: n, className: o }, r) => {
2307
+ const { t: l } = T(), [c, d] = g.useState("note"), [u, f] = g.useState(""), v = (x) => {
2308
+ const N = x instanceof Date ? x : new Date(x), w = (/* @__PURE__ */ new Date()).getTime() - N.getTime(), i = Math.floor(w / 6e4);
2309
+ if (i < 1) return l("record.justNow");
2310
+ if (i < 60) return l("record.minutesAgo", { count: i });
2311
+ const p = Math.floor(i / 60);
2312
+ if (p < 24) return l("record.hoursAgo", { count: p });
2313
+ const k = Math.floor(p / 24);
2314
+ return k < 7 ? l("record.daysAgo", { count: k }) : N.toLocaleDateString();
2315
+ }, h = Fa(
2316
+ [...t].sort((x, N) => {
2317
+ const y = x.timestamp instanceof Date ? x.timestamp : new Date(x.timestamp);
2318
+ return (N.timestamp instanceof Date ? N.timestamp : new Date(N.timestamp)).getTime() - y.getTime();
2319
+ })
2320
+ ), m = () => {
2321
+ u.trim() && (n == null || n(c, u.trim()), f(""));
2322
+ };
2323
+ return /* @__PURE__ */ a("div", { ref: r, className: b("flex flex-col", o), children: [
2324
+ s && n && /* @__PURE__ */ a("div", { className: "mb-6 rounded-lg border bg-muted/30", children: [
2325
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1 border-b px-3 py-1.5", children: La.map((x) => /* @__PURE__ */ a(
2326
+ "button",
2327
+ {
2328
+ type: "button",
2329
+ onClick: () => d(x.type),
2330
+ className: b(
2331
+ "flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors",
2332
+ c === x.type ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:bg-muted hover:text-foreground"
2333
+ ),
2334
+ children: [
2335
+ x.icon,
2336
+ l(x.labelKey)
2337
+ ]
2338
+ },
2339
+ x.type
2340
+ )) }),
2341
+ /* @__PURE__ */ a("div", { className: "flex items-end gap-2 px-3 py-2.5", children: [
2342
+ /* @__PURE__ */ e(
2343
+ re,
2344
+ {
2345
+ value: u,
2346
+ onChange: (x) => f(x.target.value),
2347
+ placeholder: l("activity.addPlaceholder", { type: l(`activity.${c}`) }),
2348
+ rows: 2,
2349
+ className: "min-h-[60px] resize-none text-sm",
2350
+ onKeyDown: (x) => {
2351
+ x.key === "Enter" && !x.shiftKey && (x.preventDefault(), m());
2352
+ }
2353
+ }
2354
+ ),
2355
+ /* @__PURE__ */ e(
2356
+ S,
2357
+ {
2358
+ size: "sm",
2359
+ onClick: m,
2360
+ disabled: !u.trim(),
2361
+ className: "shrink-0",
2362
+ children: /* @__PURE__ */ e(Ve, { className: "h-3.5 w-3.5" })
2363
+ }
2364
+ )
2365
+ ] })
2366
+ ] }),
2367
+ t.length === 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-8 text-sm text-muted-foreground", children: l("record.noActivity") }) : /* @__PURE__ */ e("div", { className: "space-y-6", children: h.map((x) => /* @__PURE__ */ a("div", { children: [
2368
+ /* @__PURE__ */ e("p", { className: "mb-3 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: x.date }),
2369
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: x.items.map((N) => /* @__PURE__ */ a("div", { className: "flex gap-3", children: [
2370
+ /* @__PURE__ */ e(
2371
+ "div",
2372
+ {
2373
+ className: b(
2374
+ "flex h-8 w-8 shrink-0 items-center justify-center rounded-full",
2375
+ Ea[N.type]
2376
+ ),
2377
+ children: N.icon ?? Aa[N.type]
2378
+ }
2379
+ ),
2380
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
2381
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2382
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: N.title }),
2383
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: v(N.timestamp) })
2384
+ ] }),
2385
+ N.description && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-muted-foreground line-clamp-2", children: N.description }),
2386
+ N.user && /* @__PURE__ */ a("div", { className: "mt-1 flex items-center gap-1.5", children: [
2387
+ /* @__PURE__ */ a(Ne, { className: "h-4 w-4", children: [
2388
+ /* @__PURE__ */ e(ve, { src: N.user.avatar, alt: N.user.name }),
2389
+ /* @__PURE__ */ e(be, { className: "text-[7px]", children: ja(N.user.name) })
2390
+ ] }),
2391
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: N.user.name })
2392
+ ] })
2393
+ ] })
2394
+ ] }, N.id)) })
2395
+ ] }, x.date)) })
2396
+ ] });
2397
+ }
2398
+ );
2399
+ za.displayName = "RecordDialogActivity";
2400
+ const Va = g.forwardRef(
2401
+ ({ entities: t, onAdd: s, className: n }, o) => {
2402
+ const { t: r } = T();
2403
+ if (t.length === 0)
2404
+ return /* @__PURE__ */ a("div", { ref: o, className: b("flex flex-col items-center justify-center py-8", n), children: [
2405
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: r("record.noRelated") }),
2406
+ s && /* @__PURE__ */ a(S, { variant: "outline", size: "sm", onClick: s, className: "mt-3", children: [
2407
+ /* @__PURE__ */ e(J, { className: "mr-1.5 h-3.5 w-3.5" }),
2408
+ r("recordDialog.addRelated")
2409
+ ] })
2410
+ ] });
2411
+ const l = /* @__PURE__ */ new Map();
2412
+ for (const c of t) {
2413
+ const d = l.get(c.type) ?? [];
2414
+ d.push(c), l.set(c.type, d);
2415
+ }
2416
+ return /* @__PURE__ */ a("div", { ref: o, className: b("space-y-6", n), children: [
2417
+ s && /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ a(S, { variant: "outline", size: "sm", onClick: s, children: [
2418
+ /* @__PURE__ */ e(J, { className: "mr-1.5 h-3.5 w-3.5" }),
2419
+ r("recordDialog.addRelated")
2420
+ ] }) }),
2421
+ Array.from(l.entries()).map(([c, d]) => /* @__PURE__ */ a("div", { children: [
2422
+ /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-1.5", children: [
2423
+ /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2424
+ /* @__PURE__ */ a("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: [
2425
+ c,
2426
+ " (",
2427
+ d.length,
2428
+ ")"
2429
+ ] })
2430
+ ] }),
2431
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: d.map((u) => /* @__PURE__ */ a(
2432
+ "button",
2433
+ {
2434
+ type: "button",
2435
+ onClick: u.onClick,
2436
+ className: b(
2437
+ "flex w-full items-center gap-3 rounded-lg border bg-card p-3 text-left transition-colors hover:bg-muted/50",
2438
+ u.onClick && "cursor-pointer",
2439
+ !u.onClick && "cursor-default"
2440
+ ),
2441
+ children: [
2442
+ u.icon && /* @__PURE__ */ e("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground", children: u.icon }),
2443
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
2444
+ /* @__PURE__ */ e("p", { className: "truncate text-sm font-medium", children: u.label }),
2445
+ u.subtitle && /* @__PURE__ */ e("p", { className: "truncate text-xs text-muted-foreground", children: u.subtitle })
2446
+ ] }),
2447
+ u.onClick && /* @__PURE__ */ e(ze, { className: "h-4 w-4 shrink-0 text-muted-foreground/50" })
2448
+ ]
2449
+ },
2450
+ u.id
2451
+ )) })
2452
+ ] }, c))
2453
+ ] });
2454
+ }
2455
+ );
2456
+ Va.displayName = "RecordDialogRelated";
2457
+ const Oa = g.forwardRef(
2458
+ ({ actions: t = [], onSubmit: s, onCancel: n, submitLabel: o, cancelLabel: r, className: l }, c) => {
2459
+ const { mode: d, isSubmitting: u, setIsSubmitting: f } = q(), { t: v } = T(), h = t.filter(
2460
+ (i) => !i.showInModes || i.showInModes.includes(d)
2461
+ ), m = h.filter((i) => i.variant === "destructive"), x = h.filter((i) => i.variant !== "destructive"), N = async () => {
2462
+ if (s) {
2463
+ f(!0);
2464
+ try {
2465
+ await s();
2466
+ } finally {
2467
+ f(!1);
2468
+ }
2469
+ }
2470
+ }, y = () => u ? v(d === "create" ? "record.creating" : "record.saving") : o ?? v(d === "create" ? "record.create" : "record.saveChanges"), w = d === "edit" || d === "create";
2471
+ return /* @__PURE__ */ a(
2472
+ "div",
2473
+ {
2474
+ ref: c,
2475
+ className: b(
2476
+ "sticky bottom-0 z-10 flex items-center justify-between border-t bg-background px-6 py-3 sm:px-8",
2477
+ l
2478
+ ),
2479
+ children: [
2480
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: m.map((i) => /* @__PURE__ */ a(
2481
+ S,
2482
+ {
2483
+ variant: i.variant,
2484
+ size: "sm",
2485
+ onClick: i.onClick,
2486
+ disabled: i.disabled || i.loading || u,
2487
+ children: [
2488
+ i.icon && /* @__PURE__ */ e("span", { className: "mr-1.5", children: i.icon }),
2489
+ i.label
2490
+ ]
2491
+ },
2492
+ i.id
2493
+ )) }),
2494
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2495
+ x.map((i) => /* @__PURE__ */ a(
2496
+ S,
2497
+ {
2498
+ variant: i.variant ?? "outline",
2499
+ size: "sm",
2500
+ onClick: i.onClick,
2501
+ disabled: i.disabled || i.loading || u,
2502
+ children: [
2503
+ i.icon && /* @__PURE__ */ e("span", { className: "mr-1.5", children: i.icon }),
2504
+ i.label
2505
+ ]
2506
+ },
2507
+ i.id
2508
+ )),
2509
+ w && n && /* @__PURE__ */ e(
2510
+ S,
2511
+ {
2512
+ variant: "outline",
2513
+ size: "sm",
2514
+ onClick: n,
2515
+ disabled: u,
2516
+ children: r ?? v("common.cancel")
2517
+ }
2518
+ ),
2519
+ w && s && /* @__PURE__ */ a(S, { size: "sm", onClick: N, disabled: u, children: [
2520
+ u && /* @__PURE__ */ e(Pt, { className: "mr-1.5 h-4 w-4 animate-spin" }),
2521
+ y()
2522
+ ] })
2523
+ ] })
2524
+ ]
2525
+ }
2526
+ );
2527
+ }
2528
+ );
2529
+ Oa.displayName = "RecordDialogFooter";
2530
+ export {
2531
+ jt as A,
2532
+ ga as B,
2533
+ Na as C,
2534
+ Ht as D,
2535
+ ya as E,
2536
+ q as F,
2537
+ wa as G,
2538
+ ka as H,
2539
+ Da as I,
2540
+ Ra as J,
2541
+ Ta as K,
2542
+ Ma as L,
2543
+ Ia as M,
2544
+ za as N,
2545
+ Va as O,
2546
+ Ot as P,
2547
+ va as Q,
2548
+ da as R,
2549
+ Oa as S,
2550
+ Ft as a,
2551
+ zt as b,
2552
+ Vt as c,
2553
+ Bt as d,
2554
+ Kt as e,
2555
+ _t as f,
2556
+ $t as g,
2557
+ Qt as h,
2558
+ Yt as i,
2559
+ B as j,
2560
+ Gt as k,
2561
+ Wt as l,
2562
+ Jt as m,
2563
+ Ye as n,
2564
+ Ue as o,
2565
+ Ge as p,
2566
+ We as q,
2567
+ ea as r,
2568
+ ta as s,
2569
+ la as t,
2570
+ Qe as u,
2571
+ ca as v,
2572
+ oa as w,
2573
+ ua as x,
2574
+ ha as y,
2575
+ fa as z
2576
+ };
2577
+ //# sourceMappingURL=record-dialog-footer-DbH9A6eA.js.map