@carlonicora/nextjs-jsonapi 1.0.4 → 1.0.6

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 (283) hide show
  1. package/LICENSE +675 -0
  2. package/dist/{AbstractService-BKlpJA61.d.mts → AbstractService-B2n_JdiC.d.mts} +1 -1
  3. package/dist/{AbstractService-D9eSVKNa.d.ts → AbstractService-DtQTYovo.d.ts} +1 -1
  4. package/dist/{content.interface-Dg2lt_An.d.mts → AuthComponent-CPLvEerw.d.mts} +11 -15
  5. package/dist/{content.interface-BhyAiOFq.d.ts → AuthComponent-m6Qp4Hz6.d.ts} +11 -15
  6. package/dist/{BlockNoteEditor-UVO3VZZE.mjs → BlockNoteEditor-BLVXQPXV.mjs} +14 -18
  7. package/dist/{BlockNoteEditor-UVO3VZZE.mjs.map → BlockNoteEditor-BLVXQPXV.mjs.map} +1 -1
  8. package/dist/{BlockNoteEditor-VFWG6LXI.js → BlockNoteEditor-ZTDHULFT.js} +15 -19
  9. package/dist/BlockNoteEditor-ZTDHULFT.js.map +1 -0
  10. package/dist/JsonApiRequest-O7BGUMFO.mjs +23 -0
  11. package/dist/JsonApiRequest-VARLNKAF.js +23 -0
  12. package/dist/JsonApiRequest-VARLNKAF.js.map +1 -0
  13. package/dist/chunk-2LM6LCJW.mjs +1 -0
  14. package/dist/chunk-3APORDYP.mjs +7783 -0
  15. package/dist/chunk-3APORDYP.mjs.map +1 -0
  16. package/dist/{chunk-TMVHSY3Y.js → chunk-5ZEADNNP.js} +36 -17
  17. package/dist/chunk-5ZEADNNP.js.map +1 -0
  18. package/dist/{chunk-ECDTZBYO.mjs → chunk-74F6BBHH.mjs} +21 -2
  19. package/dist/chunk-74F6BBHH.mjs.map +1 -0
  20. package/dist/{chunk-GYWPEPOH.mjs → chunk-7C5RAEBO.mjs} +72 -68
  21. package/dist/chunk-7C5RAEBO.mjs.map +1 -0
  22. package/dist/chunk-A5DDIABK.js +1 -0
  23. package/dist/{chunk-TEGF6ZWG.js → chunk-AGAJMJ4T.js} +47 -9
  24. package/dist/chunk-AGAJMJ4T.js.map +1 -0
  25. package/dist/{chunk-CXQOWQSY.js → chunk-AYHKQWHH.js} +15 -2
  26. package/dist/chunk-AYHKQWHH.js.map +1 -0
  27. package/dist/{chunk-I2REI7OA.js → chunk-HMHGLXWC.js} +33 -15
  28. package/dist/chunk-HMHGLXWC.js.map +1 -0
  29. package/dist/chunk-IWFGEPAA.mjs +1 -0
  30. package/dist/chunk-JC3WJK65.js +1 -0
  31. package/dist/{chunk-L6EQEAXU.mjs → chunk-PYF2U6WG.mjs} +25 -7
  32. package/dist/chunk-PYF2U6WG.mjs.map +1 -0
  33. package/dist/{chunk-YDVTFM7X.mjs → chunk-RBIVEH2K.mjs} +42 -4
  34. package/dist/chunk-RBIVEH2K.mjs.map +1 -0
  35. package/dist/{chunk-V2JJPI7N.js → chunk-RZO2LOW4.js} +237 -233
  36. package/dist/chunk-RZO2LOW4.js.map +1 -0
  37. package/dist/{chunk-X4BIHJ2B.mjs → chunk-SM63SZCP.mjs} +15 -2
  38. package/dist/chunk-SM63SZCP.mjs.map +1 -0
  39. package/dist/chunk-WEC4YMOS.js +7783 -0
  40. package/dist/chunk-WEC4YMOS.js.map +1 -0
  41. package/dist/client/index.d.mts +21 -2
  42. package/dist/client/index.d.ts +21 -2
  43. package/dist/client/index.js +18 -245
  44. package/dist/client/index.js.map +1 -1
  45. package/dist/client/index.mjs +28 -255
  46. package/dist/client/index.mjs.map +1 -1
  47. package/dist/components/index.d.mts +293 -8
  48. package/dist/components/index.d.ts +293 -8
  49. package/dist/components/index.js +78 -2323
  50. package/dist/components/index.js.map +1 -1
  51. package/dist/components/index.mjs +172 -2417
  52. package/dist/components/index.mjs.map +1 -1
  53. package/dist/{config-hXufftVS.d.ts → config-BmnK65TD.d.mts} +1 -0
  54. package/dist/{config-hXufftVS.d.mts → config-BmnK65TD.d.ts} +1 -0
  55. package/dist/config-DQeAo9Kf.d.mts +49 -0
  56. package/dist/config-DQeAo9Kf.d.ts +49 -0
  57. package/dist/contexts/index.d.mts +109 -21
  58. package/dist/contexts/index.d.ts +109 -21
  59. package/dist/contexts/index.js +39 -7
  60. package/dist/contexts/index.js.map +1 -1
  61. package/dist/contexts/index.mjs +40 -8
  62. package/dist/core/index.d.mts +3 -4
  63. package/dist/core/index.d.ts +3 -4
  64. package/dist/core/index.js +3 -7
  65. package/dist/core/index.js.map +1 -1
  66. package/dist/core/index.mjs +4 -8
  67. package/dist/{d3.link.interface-QMdB22bC.d.mts → d3.link.interface-ClC4Irqp.d.mts} +2 -1
  68. package/dist/{d3.link.interface-QMdB22bC.d.ts → d3.link.interface-ClC4Irqp.d.ts} +2 -1
  69. package/dist/features/index.d.mts +17 -86
  70. package/dist/features/index.d.ts +17 -86
  71. package/dist/features/index.js +7 -16
  72. package/dist/features/index.js.map +1 -1
  73. package/dist/features/index.mjs +10 -19
  74. package/dist/hooks/index.d.mts +18 -43
  75. package/dist/hooks/index.d.ts +18 -43
  76. package/dist/hooks/index.js +20 -7
  77. package/dist/hooks/index.js.map +1 -1
  78. package/dist/hooks/index.mjs +19 -6
  79. package/dist/index.d.mts +10 -6
  80. package/dist/index.d.ts +10 -6
  81. package/dist/index.js +13 -10
  82. package/dist/index.js.map +1 -1
  83. package/dist/index.mjs +22 -19
  84. package/dist/interfaces/index.d.mts +2 -1
  85. package/dist/interfaces/index.d.ts +2 -1
  86. package/dist/notification.interface-BBgMUdLR.d.mts +14 -0
  87. package/dist/notification.interface-gyvT-Z2F.d.ts +14 -0
  88. package/dist/permissions/index.d.mts +2 -3
  89. package/dist/permissions/index.d.ts +2 -3
  90. package/dist/server/index.d.mts +38 -18
  91. package/dist/server/index.d.ts +38 -18
  92. package/dist/server/index.js +70 -2
  93. package/dist/server/index.js.map +1 -1
  94. package/dist/server/index.mjs +68 -0
  95. package/dist/server/index.mjs.map +1 -1
  96. package/dist/types-BUAlgqqh.d.ts +39 -0
  97. package/dist/{types-DluCaP1I.d.ts → types-Bl61ob-7.d.mts} +19 -2
  98. package/dist/{types-lQVA8d_P.d.mts → types-Bl61ob-7.d.ts} +19 -2
  99. package/dist/types-iVdVY7ba.d.mts +39 -0
  100. package/dist/useSocket-Cn7fB_B1.d.mts +25 -0
  101. package/dist/useSocket-DzMKRKCA.d.ts +25 -0
  102. package/dist/user.fields-CbdObSmS.d.mts +18 -0
  103. package/dist/user.fields-CbdObSmS.d.ts +18 -0
  104. package/dist/utils/index.d.mts +1 -2
  105. package/dist/utils/index.d.ts +1 -2
  106. package/package.json +5 -3
  107. package/src/client/index.ts +13 -0
  108. package/src/components/forms/index.ts +1 -0
  109. package/src/components/index.ts +5 -0
  110. package/src/components/tables/ContentListTable.tsx +1 -0
  111. package/src/contexts/CommonContext.tsx +52 -0
  112. package/src/contexts/SharedContext.tsx +2 -0
  113. package/src/contexts/SocketContext.tsx +65 -0
  114. package/src/contexts/index.ts +6 -1
  115. package/src/features/auth/components/containers/AuthContainer.tsx +32 -0
  116. package/src/features/auth/components/containers/index.ts +1 -0
  117. package/src/features/auth/components/details/LandingComponent.tsx +39 -0
  118. package/src/features/auth/components/details/index.ts +1 -0
  119. package/src/features/auth/components/forms/AcceptInvitation.tsx +136 -0
  120. package/src/features/auth/components/forms/ActivateAccount.tsx +75 -0
  121. package/src/features/auth/components/forms/Cookies.tsx +32 -0
  122. package/src/features/auth/components/forms/ForgotPassword.tsx +108 -0
  123. package/src/features/auth/components/forms/Login.tsx +118 -0
  124. package/src/features/auth/components/forms/Logout.tsx +19 -0
  125. package/src/features/auth/components/forms/RefreshUser.tsx +39 -0
  126. package/src/features/auth/components/forms/Register.tsx +150 -0
  127. package/src/features/auth/components/forms/ResetPassword.tsx +126 -0
  128. package/src/features/auth/components/forms/index.ts +9 -0
  129. package/src/features/auth/components/index.ts +3 -0
  130. package/src/features/auth/contexts/AuthContext.tsx +77 -0
  131. package/src/features/auth/contexts/index.ts +1 -0
  132. package/src/features/auth/enums/AuthComponent.ts +9 -0
  133. package/src/features/auth/enums/index.ts +1 -0
  134. package/src/features/auth/index.ts +2 -1
  135. package/src/features/auth/utils/AuthCookies.ts +134 -0
  136. package/src/features/auth/utils/index.ts +1 -0
  137. package/src/features/company/components/containers/AdminCompanyContainer.tsx +26 -0
  138. package/src/features/company/components/containers/CompanyContainer.tsx +17 -0
  139. package/src/features/company/components/containers/index.ts +2 -0
  140. package/src/features/company/components/details/CompanyDetails.tsx +26 -0
  141. package/src/features/company/components/details/index.ts +1 -0
  142. package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +151 -0
  143. package/src/features/company/components/forms/CompanyConfigurationSecurityForm.tsx +97 -0
  144. package/src/features/company/components/forms/CompanyDeleter.tsx +121 -0
  145. package/src/features/company/components/forms/CompanyEditor.tsx +245 -0
  146. package/src/features/company/components/forms/CompanyLicense.tsx +213 -0
  147. package/src/features/company/components/forms/index.ts +5 -0
  148. package/src/features/company/components/index.ts +4 -0
  149. package/src/features/company/components/lists/CompaniesList.tsx +31 -0
  150. package/src/features/company/components/lists/index.ts +1 -0
  151. package/src/features/company/contexts/CompanyContext.tsx +99 -0
  152. package/src/features/company/contexts/index.ts +0 -0
  153. package/src/features/company/hooks/index.ts +1 -0
  154. package/src/features/company/hooks/useCompanyTableStructure.tsx +82 -0
  155. package/src/features/feature/components/forms/FormFeatures.tsx +141 -140
  156. package/src/features/feature/components/forms/index.ts +1 -0
  157. package/src/features/feature/components/index.ts +1 -1
  158. package/src/features/feature/index.ts +1 -2
  159. package/src/features/module/index.ts +1 -1
  160. package/src/features/notification/components/common/NotificationErrorBoundary.tsx +51 -0
  161. package/src/features/notification/components/common/index.ts +1 -0
  162. package/src/features/notification/components/containers/NotificationsListContainer.tsx +44 -0
  163. package/src/features/notification/components/containers/index.ts +1 -0
  164. package/src/features/notification/components/index.ts +5 -0
  165. package/src/features/notification/components/lists/NotificationsList.tsx +129 -0
  166. package/src/features/notification/components/lists/index.ts +1 -0
  167. package/src/features/notification/components/modals/NotificationModal.tsx +220 -0
  168. package/src/features/notification/components/modals/index.ts +1 -0
  169. package/src/features/notification/components/notifications/Notification.tsx +120 -0
  170. package/src/features/notification/components/notifications/PushNotificationProvider.tsx +9 -0
  171. package/src/features/notification/components/notifications/index.ts +2 -0
  172. package/src/features/notification/contexts/NotificationContext.tsx +187 -0
  173. package/src/features/notification/contexts/index.ts +1 -0
  174. package/src/features/notification/index.ts +1 -1
  175. package/src/features/push/index.ts +1 -1
  176. package/src/features/role/components/containers/RoleContainer.tsx +18 -0
  177. package/src/features/role/components/containers/index.ts +1 -0
  178. package/src/features/role/components/details/RoleDetails.tsx +21 -0
  179. package/src/features/role/components/details/index.ts +1 -0
  180. package/src/features/role/components/forms/FormRoles.tsx +82 -0
  181. package/src/features/role/components/forms/RemoveUserFromRole.tsx +108 -0
  182. package/src/features/role/components/forms/UserRoleAdd.tsx +128 -0
  183. package/src/features/role/components/forms/index.ts +3 -0
  184. package/src/features/role/components/index.ts +4 -0
  185. package/src/features/role/components/lists/RolesList.tsx +27 -0
  186. package/src/features/role/components/lists/UserRolesList.tsx +31 -0
  187. package/src/features/role/components/lists/index.ts +2 -0
  188. package/src/features/role/contexts/RoleContext.tsx +84 -0
  189. package/src/features/role/contexts/index.ts +1 -0
  190. package/src/features/role/hooks/index.ts +1 -0
  191. package/src/features/role/hooks/useRoleTableStructure.tsx +72 -0
  192. package/src/features/s3/index.ts +1 -1
  193. package/src/features/user/components/containers/UserContainer.tsx +23 -0
  194. package/src/features/user/components/containers/UserIndexContainer.tsx +12 -0
  195. package/src/features/user/components/containers/UsersListContainer.tsx +36 -0
  196. package/src/features/user/components/containers/index.ts +3 -0
  197. package/src/features/user/components/details/UserDetails.tsx +74 -0
  198. package/src/features/user/components/details/UserIndexDetails.tsx +28 -0
  199. package/src/features/user/components/details/index.ts +2 -0
  200. package/src/features/user/components/forms/RoleUserAdd.tsx +93 -0
  201. package/src/features/user/components/forms/UserAvatarEditor.tsx +78 -0
  202. package/src/features/user/components/forms/UserDeleter.tsx +49 -0
  203. package/src/features/user/components/forms/UserEditor.tsx +319 -0
  204. package/src/features/user/components/forms/UserMultiSelect.tsx +218 -0
  205. package/src/features/user/components/forms/UserReactivator.tsx +79 -0
  206. package/src/features/user/components/forms/UserResentInvitationEmail.tsx +88 -0
  207. package/src/features/user/components/forms/UserSelector.tsx +185 -0
  208. package/src/features/user/components/forms/index.ts +8 -0
  209. package/src/features/user/components/index.ts +3 -0
  210. package/src/features/user/components/lists/AdminUsersList.tsx +41 -0
  211. package/src/features/user/components/lists/CompanyUsersList.tsx +44 -0
  212. package/src/features/user/components/lists/RelevantUsersList.tsx +30 -0
  213. package/src/features/user/components/lists/RoleUsersList.tsx +31 -0
  214. package/src/features/user/components/lists/UserListInAdd.tsx +53 -0
  215. package/src/features/user/components/lists/UsersList.tsx +30 -0
  216. package/src/features/user/components/lists/UsersListByContentIds.tsx +30 -0
  217. package/src/features/user/components/lists/index.ts +7 -0
  218. package/src/features/user/components/widgets/UserAvatarList.tsx +31 -0
  219. package/src/features/user/components/widgets/UserSearchPopover.tsx +89 -0
  220. package/src/features/user/contexts/UserContext.tsx +106 -0
  221. package/src/features/user/contexts/index.ts +1 -0
  222. package/src/features/user/hooks/index.ts +2 -0
  223. package/src/features/user/hooks/useUserSearch.ts +53 -0
  224. package/src/features/user/hooks/useUserTableStructure.tsx +115 -0
  225. package/src/features/user/index.ts +0 -1
  226. package/src/hooks/index.ts +4 -0
  227. package/src/hooks/useCustomD3Graph.tsx +2 -0
  228. package/src/hooks/useNotificationSync.ts +20 -0
  229. package/src/hooks/usePageTracker.ts +69 -0
  230. package/src/hooks/usePushNotifications.ts +82 -0
  231. package/src/hooks/useSocket.ts +201 -0
  232. package/src/hooks/useTableGenerator.ts +6 -2
  233. package/src/i18n/config.ts +1 -0
  234. package/src/index.ts +4 -0
  235. package/src/interfaces/d3.link.interface.ts +2 -1
  236. package/src/server/ServerSession.ts +103 -0
  237. package/src/server/index.ts +2 -1
  238. package/src/unified/JsonApiRequest.ts +23 -0
  239. package/dist/ApiRequestDataTypeInterface-CUKFDBx2.d.mts +0 -20
  240. package/dist/ApiRequestDataTypeInterface-CUKFDBx2.d.ts +0 -20
  241. package/dist/BlockNoteEditor-VFWG6LXI.js.map +0 -1
  242. package/dist/JsonApiRequest-S3ICLM7B.mjs +0 -20
  243. package/dist/JsonApiRequest-ZZLSP26T.js +0 -20
  244. package/dist/JsonApiRequest-ZZLSP26T.js.map +0 -1
  245. package/dist/chunk-366S2JCC.mjs +0 -31
  246. package/dist/chunk-366S2JCC.mjs.map +0 -1
  247. package/dist/chunk-5W6AKZE6.mjs +0 -131
  248. package/dist/chunk-5W6AKZE6.mjs.map +0 -1
  249. package/dist/chunk-A3J3AAYM.mjs +0 -97
  250. package/dist/chunk-A3J3AAYM.mjs.map +0 -1
  251. package/dist/chunk-AWONBQQP.js +0 -97
  252. package/dist/chunk-AWONBQQP.js.map +0 -1
  253. package/dist/chunk-CXQOWQSY.js.map +0 -1
  254. package/dist/chunk-DKKMWBP4.mjs +0 -1
  255. package/dist/chunk-DKKMWBP4.mjs.map +0 -1
  256. package/dist/chunk-DO2HLAZO.js +0 -48
  257. package/dist/chunk-DO2HLAZO.js.map +0 -1
  258. package/dist/chunk-DZXDB3K2.mjs +0 -17
  259. package/dist/chunk-DZXDB3K2.mjs.map +0 -1
  260. package/dist/chunk-ECDTZBYO.mjs.map +0 -1
  261. package/dist/chunk-FY4SXJGU.js +0 -806
  262. package/dist/chunk-FY4SXJGU.js.map +0 -1
  263. package/dist/chunk-GYWPEPOH.mjs.map +0 -1
  264. package/dist/chunk-H6FMOA6B.js +0 -1
  265. package/dist/chunk-H6FMOA6B.js.map +0 -1
  266. package/dist/chunk-I2REI7OA.js.map +0 -1
  267. package/dist/chunk-J4Q36PMP.js +0 -31
  268. package/dist/chunk-J4Q36PMP.js.map +0 -1
  269. package/dist/chunk-L6EQEAXU.mjs.map +0 -1
  270. package/dist/chunk-MFO27OHB.mjs +0 -48
  271. package/dist/chunk-MFO27OHB.mjs.map +0 -1
  272. package/dist/chunk-RAF7PNLG.js +0 -131
  273. package/dist/chunk-RAF7PNLG.js.map +0 -1
  274. package/dist/chunk-RUR22SVM.js +0 -17
  275. package/dist/chunk-RUR22SVM.js.map +0 -1
  276. package/dist/chunk-TEGF6ZWG.js.map +0 -1
  277. package/dist/chunk-TMVHSY3Y.js.map +0 -1
  278. package/dist/chunk-V2JJPI7N.js.map +0 -1
  279. package/dist/chunk-WWWMJZEF.mjs +0 -806
  280. package/dist/chunk-WWWMJZEF.mjs.map +0 -1
  281. package/dist/chunk-X4BIHJ2B.mjs.map +0 -1
  282. package/dist/chunk-YDVTFM7X.mjs.map +0 -1
  283. /package/dist/{JsonApiRequest-S3ICLM7B.mjs.map → JsonApiRequest-O7BGUMFO.mjs.map} +0 -0
@@ -1,2438 +1,154 @@
1
1
  "use client";
2
2
  import {
3
- errorToast
4
- } from "../chunk-DZXDB3K2.mjs";
5
- import {
6
- ContributorsList,
7
- UserAvatar
8
- } from "../chunk-A3J3AAYM.mjs";
9
- import {
10
- AlertDialog,
11
- AlertDialogContent,
12
- AlertDialogDescription,
13
- AlertDialogHeader,
14
- AlertDialogTitle,
15
- AlertDialogTrigger,
3
+ AcceptInvitation,
4
+ ActivateAccount,
5
+ AddUserToRole,
6
+ AdminCompanyContainer,
7
+ AdminUsersList,
8
+ AllowedUsersDetails,
9
+ AttributeElement,
10
+ AuthContainer,
11
+ BlockNoteEditorContainer,
16
12
  Breadcrumb,
17
- BreadcrumbEllipsis,
18
- BreadcrumbItem,
19
- BreadcrumbList,
20
- BreadcrumbSeparator,
21
- Button,
22
- Calendar,
23
- Card,
24
- CardContent,
25
- CardDescription,
26
- CardHeader,
27
- CardTitle,
28
- Checkbox,
29
- Command,
30
- CommandDialog,
31
- CommandEmpty,
32
- CommandInput,
33
- CommandList,
34
- DialogDescription,
35
- DialogHeader,
36
- DialogTitle,
37
- DialogTrigger,
38
- DropdownMenu,
39
- DropdownMenuContent,
40
- DropdownMenuItem,
41
- DropdownMenuLabel,
42
- DropdownMenuSeparator,
43
- DropdownMenuTrigger,
44
- FormControl,
45
- FormField,
46
- FormItem,
47
- FormLabel,
48
- FormMessage,
49
- Input,
50
- Label,
51
- Link,
52
- Popover,
53
- PopoverContent,
54
- PopoverTrigger,
55
- ResizableHandle,
56
- ResizablePanel,
57
- ResizablePanelGroup,
58
- ScrollArea,
59
- Select,
60
- SelectContent,
61
- SelectItem,
62
- SelectTrigger,
63
- SelectValue,
64
- SidebarTrigger,
65
- Slider,
66
- Switch,
67
- Table,
68
- TableBody,
69
- TableCell,
70
- TableFooter,
71
- TableHead,
72
- TableHeader,
73
- TableRow,
74
- Tabs,
75
- TabsContent,
76
- TabsList,
77
- TabsTrigger,
78
- Textarea,
79
- Tooltip,
80
- TooltipContent,
81
- TooltipTrigger,
82
- buttonVariants,
83
- useSidebar
84
- } from "../chunk-IWFGEPAA.mjs";
85
- import {
86
- cn
87
- } from "../chunk-2LM6LCJW.mjs";
88
- import {
89
- useDebounce,
90
- usePageUrlGenerator,
91
- useTableGenerator,
92
- useUrlRewriter
93
- } from "../chunk-WWWMJZEF.mjs";
94
- import {
95
- useI18nDateFnsLocale,
96
- useI18nLocale,
97
- useI18nRouter,
98
- useI18nTranslations
99
- } from "../chunk-X4BIHJ2B.mjs";
100
- import {
101
- recentPagesAtom
102
- } from "../chunk-Q2N6SQYW.mjs";
103
- import {
104
- useCurrentUserContext,
105
- useSharedContext
106
- } from "../chunk-5W6AKZE6.mjs";
107
- import "../chunk-DD3KISNB.mjs";
13
+ CommonAssociationCommandDialog,
14
+ CommonAssociationTrigger,
15
+ CommonDeleter,
16
+ CommonEditorButtons,
17
+ CommonEditorHeader,
18
+ CommonEditorTrigger,
19
+ CompaniesList,
20
+ CompanyConfigurationEditor,
21
+ CompanyConfigurationSecurityForm,
22
+ CompanyContainer,
23
+ CompanyDeleter,
24
+ CompanyDetails,
25
+ CompanyEditor,
26
+ CompanyUsersList,
27
+ ContentListTable,
28
+ ContentTableSearch,
29
+ ContentTitle,
30
+ ContributorsList,
31
+ Cookies,
32
+ DatePickerPopover,
33
+ DateRangeSelector,
34
+ ErrorDetails,
35
+ FileInput,
36
+ FileUploader,
37
+ FileUploaderContent,
38
+ FileUploaderItem,
39
+ ForgotPassword,
40
+ FormCheckbox,
41
+ FormContainerGeneric,
42
+ FormDate,
43
+ FormDateTime,
44
+ FormFeatures,
45
+ FormInput,
46
+ FormPassword,
47
+ FormPlaceAutocomplete,
48
+ FormRoles,
49
+ FormSelect,
50
+ FormSlider,
51
+ FormSwitch,
52
+ FormTextarea,
53
+ Header,
54
+ LandingComponent,
55
+ Login,
56
+ Logout,
57
+ ModeToggleSwitch,
58
+ NotificationErrorBoundary,
59
+ NotificationMenuItem,
60
+ NotificationModal,
61
+ NotificationToast,
62
+ NotificationsList,
63
+ NotificationsListContainer,
64
+ PageContainer,
65
+ PageContainerContentDetails,
66
+ PageContentContainer,
67
+ PageSection,
68
+ PasswordInput,
69
+ PushNotificationProvider,
70
+ ReactMarkdownContainer,
71
+ RecentPagesNavigator,
72
+ RefreshUser,
73
+ RelevantUsersList,
74
+ RemoveUserFromRole,
75
+ ResetPassword,
76
+ RoleContainer,
77
+ RoleDetails,
78
+ RoleUsersList,
79
+ RolesList,
80
+ TabsContainer,
81
+ UserAvatar,
82
+ UserAvatarEditor,
83
+ UserContainer,
84
+ UserDeleter,
85
+ UserDetails,
86
+ UserEditor,
87
+ UserIndexContainer,
88
+ UserIndexDetails,
89
+ UserListInAdd,
90
+ UserMultiSelect,
91
+ UserReactivator,
92
+ UserResentInvitationEmail,
93
+ UserRoleAdd,
94
+ UserRolesList,
95
+ UserSelector,
96
+ UsersList,
97
+ UsersListByContentIds,
98
+ UsersListContainer,
99
+ cellComponent,
100
+ cellDate,
101
+ cellId,
102
+ cellLink,
103
+ cellUrl,
104
+ errorToast,
105
+ generateNotificationData,
106
+ triggerAssociationToast,
107
+ useFileUpload
108
+ } from "../chunk-3APORDYP.mjs";
109
+ import "../chunk-C7C7VY4F.mjs";
110
+ import "../chunk-IWFGEPAA.mjs";
111
+ import "../chunk-2LM6LCJW.mjs";
112
+ import "../chunk-7C5RAEBO.mjs";
113
+ import "../chunk-AUXK7QSA.mjs";
114
+ import "../chunk-SM63SZCP.mjs";
115
+ import "../chunk-74F6BBHH.mjs";
108
116
  import "../chunk-BLWVZK6J.mjs";
109
- import "../chunk-L6EQEAXU.mjs";
110
- import "../chunk-YDVTFM7X.mjs";
111
- import "../chunk-366S2JCC.mjs";
112
- import "../chunk-MFO27OHB.mjs";
113
- import {
114
- __name
115
- } from "../chunk-PAWJFY3S.mjs";
116
-
117
- // src/components/navigations/Breadcrumb.tsx
118
- import { useTranslations } from "next-intl";
119
- import { Fragment, useState } from "react";
120
- import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
121
- var ITEMS_TO_DISPLAY = 3;
122
- function Breadcrumb2({ items }) {
123
- const generateUrl = usePageUrlGenerator();
124
- const t = useTranslations();
125
- const [open, setOpen] = useState(false);
126
- return /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, { children: [
127
- /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(Link, { href: generateUrl({ page: `/` }), children: t(`generic.home`) }) }),
128
- items.length > 0 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
129
- items.length > ITEMS_TO_DISPLAY ? /* @__PURE__ */ jsxs(Fragment2, { children: [
130
- /* @__PURE__ */ jsx(BreadcrumbItem, { children: items[0].href ? /* @__PURE__ */ jsx(Link, { href: items[0].href, children: items[0].name }) : /* @__PURE__ */ jsx(Fragment2, { children: items[0].name }) }),
131
- /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
132
- /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { open, onOpenChange: setOpen, children: [
133
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { className: "flex items-center gap-1", "aria-label": "Toggle menu", children: /* @__PURE__ */ jsx(BreadcrumbEllipsis, { className: "h-4 w-4" }) }),
134
- /* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", children: items.slice(1, -ITEMS_TO_DISPLAY + 1).map((item, index) => /* @__PURE__ */ jsx(DropdownMenuItem, { children: /* @__PURE__ */ jsx(Link, { href: item.href ? item.href : "#", children: item.name }) }, index)) })
135
- ] }) }),
136
- /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
137
- items.slice(-ITEMS_TO_DISPLAY + 1).map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
138
- /* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx(Link, { href: item.href, children: item.name }) : /* @__PURE__ */ jsx(Fragment2, { children: item.name }) }),
139
- index < items.slice(-ITEMS_TO_DISPLAY + 1).length - 1 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})
140
- ] }, index))
141
- ] }) : /* @__PURE__ */ jsx(Fragment2, { children: items.map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
142
- /* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx(Link, { href: item.href, children: item.name }) : /* @__PURE__ */ jsx(Fragment2, { children: item.name }) }),
143
- index < items.length - 1 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})
144
- ] }, index)) })
145
- ] }) });
146
- }
147
- __name(Breadcrumb2, "Breadcrumb");
148
-
149
- // src/components/navigations/ContentTitle.tsx
150
- import { useEffect, useState as useState2 } from "react";
151
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
152
- function ContentTitle({ type, element, functions, className }) {
153
- const [clientFunctions, setClientFunctions] = useState2(null);
154
- const [isClient, setIsClient] = useState2(false);
155
- useEffect(() => {
156
- setIsClient(true);
157
- setClientFunctions(functions);
158
- }, [functions]);
159
- if (!element) return null;
160
- return /* @__PURE__ */ jsxs2("div", { className: cn(`mb-4 flex w-full flex-col`, className), children: [
161
- (type || isClient) && /* @__PURE__ */ jsxs2("div", { className: "flex flex-row items-center justify-between gap-x-4", children: [
162
- type && /* @__PURE__ */ jsx2("div", { className: `text-muted-foreground text-xl font-light`, children: type }),
163
- isClient && clientFunctions && /* @__PURE__ */ jsx2("div", { className: "flex flex-row items-center justify-start", children: clientFunctions })
164
- ] }),
165
- /* @__PURE__ */ jsx2("div", { className: `text-primary w-full text-3xl font-semibold`, children: element })
166
- ] });
167
- }
168
- __name(ContentTitle, "ContentTitle");
169
-
170
- // src/components/navigations/Header.tsx
171
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
172
- function Header({ children }) {
173
- const { breadcrumbs } = useSharedContext();
174
- return /* @__PURE__ */ jsx3("header", { className: `sticky top-0 z-10 flex h-12 flex-col items-center justify-start gap-x-4 border-b`, children: /* @__PURE__ */ jsxs3("div", { className: "bg-sidebar flex h-12 w-full flex-row items-center justify-between pl-2 pr-4", children: [
175
- /* @__PURE__ */ jsx3(SidebarTrigger, { "aria-label": "Toggle sidebar" }),
176
- /* @__PURE__ */ jsx3("div", { className: "flex w-full flex-row items-center justify-start", children: /* @__PURE__ */ jsx3(Breadcrumb2, { items: breadcrumbs }) }),
177
- /* @__PURE__ */ jsx3("div", { className: "flex w-64 flex-row items-center justify-end gap-x-4 whitespace-nowrap", children: children ? children : null })
178
- ] }) });
179
- }
180
- __name(Header, "Header");
181
-
182
- // src/components/navigations/ModeToggleSwitch.tsx
183
- import { MoonIcon, SunIcon } from "lucide-react";
184
- import { useTheme } from "next-themes";
185
- import { jsx as jsx4 } from "react/jsx-runtime";
186
- function ModeToggleSwitch() {
187
- const { theme, setTheme } = useTheme();
188
- const handleToggle = /* @__PURE__ */ __name(() => {
189
- setTheme(theme === "light" ? "dark" : "light");
190
- }, "handleToggle");
191
- return /* @__PURE__ */ jsx4("div", { className: "flex items-center", children: /* @__PURE__ */ jsx4(Switch, { checked: theme === "dark", onCheckedChange: handleToggle, className: "relative", children: theme === "dark" ? /* @__PURE__ */ jsx4(MoonIcon, { className: "text-primary-foreground h-4 w-4" }) : /* @__PURE__ */ jsx4(SunIcon, { className: "text-primary h-4 w-4" }) }) });
192
- }
193
- __name(ModeToggleSwitch, "ModeToggleSwitch");
194
-
195
- // src/components/navigations/PageSection.tsx
196
- import { ChevronDownIcon, ChevronRightIcon } from "lucide-react";
197
- import { useEffect as useEffect2, useState as useState3 } from "react";
198
- import { v4 } from "uuid";
199
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
200
- function PageSection({ children, title, options, open, small, onToggle }) {
201
- const [isOpen, setIsOpen] = useState3(open ?? true);
202
- const [shouldRender, setShouldRender] = useState3(open ?? true);
203
- useEffect2(() => {
204
- if (onToggle) {
205
- onToggle(isOpen);
206
- }
207
- }, [isOpen]);
208
- const toggleOpen = /* @__PURE__ */ __name(() => setIsOpen(!isOpen), "toggleOpen");
209
- useEffect2(() => {
210
- if (isOpen) {
211
- setShouldRender(true);
212
- } else {
213
- const timer = setTimeout(() => setShouldRender(false), 300);
214
- return () => clearTimeout(timer);
215
- }
216
- }, [isOpen]);
217
- return /* @__PURE__ */ jsxs4(
218
- "section",
219
- {
220
- id: title ? title.toLowerCase().replaceAll(" ", "") : v4(),
221
- className: `${isOpen ? "mb-4" : "my-0"} flex w-full scroll-mt-40 flex-col`,
222
- children: [
223
- title && /* @__PURE__ */ jsxs4(
224
- "div",
225
- {
226
- className: `${isOpen ? "mb-4" : "mb-0"} flex w-full justify-between border-b ${small ? `border-muted` : `border-primary`} pb-1`,
227
- children: [
228
- /* @__PURE__ */ jsxs4("div", { className: "flex w-full cursor-pointer items-center justify-start gap-x-2", onClick: toggleOpen, children: [
229
- isOpen ? /* @__PURE__ */ jsx5(ChevronDownIcon, { className: `text-primary h-4 w-4` }) : /* @__PURE__ */ jsx5(ChevronRightIcon, { className: "text-primary h-4 w-4" }),
230
- /* @__PURE__ */ jsx5("h2", { className: `flex w-full ${small === true ? `text-sm` : `text-lg`} text-primary font-semibold`, children: title })
231
- ] }),
232
- options && /* @__PURE__ */ jsx5("div", { className: "flex gap-2", children: options })
233
- ]
234
- }
235
- ),
236
- /* @__PURE__ */ jsx5("div", { className: `overflow-hidden transition-all duration-300 ${isOpen ? "" : "max-h-0"}`, children: shouldRender && children })
237
- ]
238
- }
239
- );
240
- }
241
- __name(PageSection, "PageSection");
242
-
243
- // src/components/navigations/RecentPagesNavigator.tsx
244
- import { useAtomValue } from "jotai";
245
- import { HistoryIcon } from "lucide-react";
246
- import { useTranslations as useTranslations2 } from "next-intl";
247
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
248
- function RecentPagesNavigator() {
249
- const recentPages = useAtomValue(recentPagesAtom);
250
- const t = useTranslations2();
251
- const { state } = useSidebar();
252
- if (recentPages.length === 0) {
253
- return null;
254
- }
255
- return /* @__PURE__ */ jsxs5(DropdownMenu, { children: [
256
- /* @__PURE__ */ jsx6(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx6("div", { className: "flex w-full cursor-pointer items-center gap-2", children: state === "collapsed" ? /* @__PURE__ */ jsx6(HistoryIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx6("span", { children: t(`generic.recent_pages`) }) }) }),
257
- /* @__PURE__ */ jsxs5(DropdownMenuContent, { align: "start", className: "w-96", children: [
258
- /* @__PURE__ */ jsx6(DropdownMenuLabel, { children: t(`generic.recent_pages`) }),
259
- /* @__PURE__ */ jsx6(DropdownMenuSeparator, {}),
260
- recentPages.map((page, index) => /* @__PURE__ */ jsx6(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx6(Link, { href: page.url, className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
261
- /* @__PURE__ */ jsx6("div", { className: "truncate text-sm", children: page.title }),
262
- /* @__PURE__ */ jsx6("div", { className: "text-muted-foreground text-xs font-normal", children: t(`types.${page.moduleType}`, { count: 1 }) })
263
- ] }) }) }, `${page.url}-${index}`))
264
- ] })
265
- ] });
266
- }
267
- __name(RecentPagesNavigator, "RecentPagesNavigator");
268
-
269
- // src/components/containers/PageContainer.tsx
270
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
271
- function PageContainer({ children, testId, className }) {
272
- return /* @__PURE__ */ jsxs6("div", { className: `flex h-full w-full flex-col`, "data-testid": testId, children: [
273
- /* @__PURE__ */ jsx7(Header, {}),
274
- /* @__PURE__ */ jsx7("main", { className: cn(`flex w-full flex-1 flex-col gap-y-4 pt-4 pl-4 pr-4`, className), children })
275
- ] });
276
- }
277
- __name(PageContainer, "PageContainer");
278
-
279
- // src/components/containers/ReactMarkdownContainer.tsx
280
- import { ChevronDown, ChevronUp } from "lucide-react";
281
- import { useTranslations as useTranslations3 } from "next-intl";
282
- import { useEffect as useEffect3, useRef, useState as useState4 } from "react";
283
- import ReactMarkdown from "react-markdown";
284
- import remarkGfm from "remark-gfm";
285
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
286
- function ReactMarkdownContainer({
287
- content,
288
- collapsible = false,
289
- initialLines = 4,
290
- size = "normal"
291
- }) {
292
- const t = useTranslations3("generic.buttons");
293
- const [isExpanded, setIsExpanded] = useState4(false);
294
- const [showExpandButton, setShowExpandButton] = useState4(false);
295
- const contentRef = useRef(null);
296
- useEffect3(() => {
297
- if (collapsible && contentRef.current && !isExpanded) {
298
- const isOverflowing = contentRef.current.scrollHeight > contentRef.current.clientHeight;
299
- setShowExpandButton(isOverflowing);
300
- }
301
- }, [collapsible, content, isExpanded]);
302
- const handleToggle = /* @__PURE__ */ __name(() => {
303
- setIsExpanded(!isExpanded);
304
- }, "handleToggle");
305
- const clampStyle = collapsible && !isExpanded ? {
306
- display: "-webkit-box",
307
- WebkitLineClamp: initialLines,
308
- WebkitBoxOrient: "vertical",
309
- overflow: "hidden"
310
- } : {};
311
- return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col", children: [
312
- /* @__PURE__ */ jsxs7("div", { className: "relative", children: [
313
- /* @__PURE__ */ jsx8("div", { ref: contentRef, style: clampStyle, className: "transition-all duration-300 ease-in-out", children: /* @__PURE__ */ jsx8(
314
- ReactMarkdown,
315
- {
316
- remarkPlugins: [remarkGfm],
317
- components: {
318
- p: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("p", { className: size === "small" ? "text-xs" : "", children }), "p"),
319
- li: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("li", { className: size === "small" ? "text-xs" : "", children }), "li"),
320
- table: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("table", { className: "w-full table-auto border-collapse border", children }), "table"),
321
- th: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("th", { className: `border px-4 py-2 text-left ${size === "small" ? "px-2 py-1 text-xs" : ""}`, children }), "th"),
322
- td: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("td", { className: `border px-4 py-2 ${size === "small" ? "px-2 py-1 text-xs" : ""}`, children }), "td"),
323
- tr: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("tr", { className: "even:bg-gray-50", children }), "tr"),
324
- ul: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("ul", { className: `list-disc ${size === "small" ? "pl-3" : "pl-4"}`, children }), "ul"),
325
- ol: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("ol", { className: `list-decimal ${size === "small" ? "pl-3" : "pl-4"}`, children }), "ol"),
326
- h1: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("h1", { className: size === "small" ? "my-1 mt-2 text-sm font-bold" : "my-2 mt-4 text-3xl font-medium", children }), "h1"),
327
- h2: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8(
328
- "h2",
329
- {
330
- className: size === "small" ? "my-1 mt-2 text-sm font-semibold" : "my-2 mt-4 text-2xl font-semibold",
331
- children
332
- }
333
- ), "h2"),
334
- h3: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("h3", { className: size === "small" ? "my-1 mt-2 text-sm font-medium" : "my-2 mt-4 text-xl font-semibold", children }), "h3"),
335
- h4: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx8("h4", { className: size === "small" ? "my-1 mt-2 text-sm font-medium" : "my-2 mt-4 text-lg font-semibold", children }), "h4")
336
- },
337
- children: content
338
- }
339
- ) }),
340
- collapsible && !isExpanded && showExpandButton && /* @__PURE__ */ jsx8("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 h-12 bg-gradient-to-t from-white to-transparent" })
341
- ] }),
342
- collapsible && showExpandButton && /* @__PURE__ */ jsx8("div", { className: "mt-2 flex justify-end", children: /* @__PURE__ */ jsxs7(
343
- "button",
344
- {
345
- onClick: handleToggle,
346
- className: "flex items-center gap-1 rounded-md px-3 py-1.5 text-sm text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900",
347
- "aria-label": isExpanded ? t("show_less") : t("show_more"),
348
- children: [
349
- /* @__PURE__ */ jsx8("span", { children: isExpanded ? t("show_less") : t("show_more") }),
350
- isExpanded ? /* @__PURE__ */ jsx8(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx8(ChevronDown, { className: "h-4 w-4" })
351
- ]
352
- }
353
- ) })
354
- ] });
355
- }
356
- __name(ReactMarkdownContainer, "ReactMarkdownContainer");
357
-
358
- // src/components/containers/TabsContainer.tsx
359
- import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
360
- function TabsContainer({
361
- tabs,
362
- defaultTab,
363
- tabsListClassName,
364
- tabsTriggerClassName,
365
- scrollAreaClassName,
366
- style,
367
- additionalComponent
368
- }) {
369
- const { hasPermissionToModules } = useCurrentUserContext();
370
- const validTabs = tabs.filter(
371
- (tab) => tab.modules && tab.action ? hasPermissionToModules({ modules: tab.modules, action: tab.action }) : true
372
- );
373
- if (validTabs.length === 0) return null;
374
- const defaultValue = defaultTab ?? tabs[0].label;
375
- if (validTabs.length === 1) {
376
- return validTabs[0].content;
377
- }
378
- return /* @__PURE__ */ jsxs8(Tabs, { defaultValue, className: "w-full", children: [
379
- /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between", children: [
380
- /* @__PURE__ */ jsx9(
381
- TabsList,
382
- {
383
- className: cn(
384
- `${style ? `my-4 flex w-full justify-start rounded-none border-b bg-transparent pb-0` : ``}`,
385
- tabsListClassName
386
- ),
387
- children: validTabs.map((tab) => /* @__PURE__ */ jsx9(
388
- TabsTrigger,
389
- {
390
- value: tab.label,
391
- className: cn(
392
- `${style ? `text-muted-foreground border-accent data-[state=active]:text-foreground hover:text-foreground cursor-pointer rounded-none bg-transparent pb-2 text-sm font-light hover:border-0 data-[state=active]:border-b data-[state=active]:font-medium data-[state=active]:shadow-none` : `text-primary text-xs`}`,
393
- tabsTriggerClassName
394
- ),
395
- children: tab.contentLabel ?? tab.label
396
- },
397
- tab.label
398
- ))
399
- }
400
- ),
401
- additionalComponent && additionalComponent
402
- ] }),
403
- scrollAreaClassName ? /* @__PURE__ */ jsx9(ScrollArea, { className: scrollAreaClassName, children: validTabs.map((tab) => /* @__PURE__ */ jsx9(TabsContent, { value: tab.label, children: tab.content }, tab.label)) }) : /* @__PURE__ */ jsx9(Fragment3, { children: validTabs.map((tab) => /* @__PURE__ */ jsx9(TabsContent, { value: tab.label, children: tab.content }, tab.label)) })
404
- ] });
405
- }
406
- __name(TabsContainer, "TabsContainer");
407
-
408
- // src/components/contents/AttributeElement.tsx
409
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
410
- function AttributeElement({ inline, title, value, className }) {
411
- return /* @__PURE__ */ jsxs9("div", { className: cn(`flex ${inline === true ? "flex-row" : "flex-col"} my-1 justify-start`, className), children: [
412
- title && /* @__PURE__ */ jsx10("div", { className: `${inline === true ? "min-w-48 pr-4" : "w-full"} text-sm font-semibold`, children: title }),
413
- value && /* @__PURE__ */ jsx10("div", { className: "flex w-full flex-col text-sm", children: value })
414
- ] });
415
- }
416
- __name(AttributeElement, "AttributeElement");
417
-
418
- // src/components/details/AllowedUsersDetails.tsx
419
- import { useTranslations as useTranslations4 } from "next-intl";
420
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
421
- function AllowedUsersDetails({ showTitle, content }) {
422
- const t = useTranslations4();
423
- return /* @__PURE__ */ jsxs10("div", { className: "mb-2 flex w-full flex-col gap-y-2", children: [
424
- showTitle && /* @__PURE__ */ jsx11("h3", { className: "text-xs font-semibold", children: t("generic.permissions") }),
425
- /* @__PURE__ */ jsx11("div", { className: "flex w-full items-center justify-start gap-x-4", children: /* @__PURE__ */ jsx11(ContributorsList, { content }) })
426
- ] });
427
- }
428
- __name(AllowedUsersDetails, "AllowedUsersDetails");
429
-
430
- // src/components/editors/BlockNoteEditorContainer.tsx
431
- import dynamic from "next/dynamic";
432
- import React from "react";
433
- import { jsx as jsx12 } from "react/jsx-runtime";
434
- var BlockNoteEditor = dynamic(() => import("../BlockNoteEditor-UVO3VZZE.mjs"), {
435
- ssr: false
436
- });
437
- var BlockNoteEditorContainer = React.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
438
- return /* @__PURE__ */ jsx12(BlockNoteEditor, { ...props });
439
- }, "EditorContainer"));
440
-
441
- // src/components/errors/ErrorDetails.tsx
442
- import Image from "next/image";
443
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
444
- function ErrorDetails({ title, message, code }) {
445
- if (code === 403)
446
- return /* @__PURE__ */ jsx13("div", { className: "w-xl max-w-xl", children: /* @__PURE__ */ jsxs11(Card, { className: "w-full", children: [
447
- /* @__PURE__ */ jsxs11(CardHeader, { children: [
448
- /* @__PURE__ */ jsxs11(CardTitle, { className: "text-foreground flex flex-col items-center gap-y-4 pb-10 text-4xl", children: [
449
- /* @__PURE__ */ jsx13(Image, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
450
- /* @__PURE__ */ jsx13("div", { children: "Unauthorised" })
451
- ] }),
452
- /* @__PURE__ */ jsx13(CardDescription, { className: "text-center text-lg", children: "We are sorry, but you are not allowed to access this content." })
453
- ] }),
454
- /* @__PURE__ */ jsx13(CardContent, {})
455
- ] }) });
456
- return /* @__PURE__ */ jsx13("div", { className: "w-xl max-w-xl", children: /* @__PURE__ */ jsxs11(Card, { className: "w-full", children: [
457
- /* @__PURE__ */ jsxs11(CardHeader, { children: [
458
- /* @__PURE__ */ jsxs11(CardTitle, { className: "text-foreground flex flex-col items-center gap-y-4 pb-10 text-center text-4xl", children: [
459
- /* @__PURE__ */ jsx13(Image, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
460
- /* @__PURE__ */ jsx13("div", { children: code }),
461
- /* @__PURE__ */ jsx13("div", { children: title })
462
- ] }),
463
- /* @__PURE__ */ jsx13(CardDescription, { className: "text-center text-lg", children: message })
464
- ] }),
465
- /* @__PURE__ */ jsx13(CardContent, {})
466
- ] }) });
467
- }
468
- __name(ErrorDetails, "ErrorDetails");
469
-
470
- // src/components/forms/CommonAssociationForm.tsx
471
- import { useTranslations as useTranslations5 } from "next-intl";
472
- import { useCallback, useEffect as useEffect4, useRef as useRef2, useState as useState5 } from "react";
473
- import { toast } from "sonner";
474
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
475
- function CommonAssociationTrigger({
476
- sourceType,
477
- destinationType,
478
- hasDestination,
479
- onTrigger
480
- }) {
481
- const t = useTranslations5();
482
- if (hasDestination)
483
- return /* @__PURE__ */ jsx14("div", { className: "hover:text-accent cursor-pointer", onClick: onTrigger, children: "Join" });
484
- return /* @__PURE__ */ jsx14(Button, { variant: `outline`, size: `sm`, onClick: onTrigger, children: t(`generic.association.label`, {
485
- source: sourceType,
486
- destination: destinationType
487
- }) });
488
- }
489
- __name(CommonAssociationTrigger, "CommonAssociationTrigger");
490
- function CommonAssociationCommandDialog({
491
- show,
492
- setShow,
493
- data,
494
- source,
495
- destination,
496
- destinationName,
497
- children
498
- }) {
499
- const t = useTranslations5();
500
- const searchTermRef = useRef2("");
501
- const [searchTerm, setSearchTerm] = useState5("");
502
- const refreshList = useCallback(
503
- async (searchedTerm) => {
504
- if (searchedTerm === searchTermRef.current) return;
505
- searchTermRef.current = searchedTerm;
506
- await data.search(searchedTerm);
507
- },
508
- [searchTerm, data]
509
- );
510
- const updateSearchTerm = useDebounce(refreshList, 500);
511
- useEffect4(() => {
512
- if (show) updateSearchTerm(searchTerm);
513
- }, [show, searchTerm]);
514
- return /* @__PURE__ */ jsxs12(CommandDialog, { open: show, onOpenChange: setShow, children: [
515
- /* @__PURE__ */ jsxs12(DialogHeader, { className: "flex flex-col items-start p-4 pb-0", children: [
516
- /* @__PURE__ */ jsx14(DialogTitle, { children: t(`generic.association.label`, {
517
- source,
518
- destination
519
- }) }),
520
- /* @__PURE__ */ jsx14(DialogDescription, { children: t(`generic.association.description`, {
521
- source,
522
- destination,
523
- destination_name: destinationName
524
- }) })
525
- ] }),
526
- /* @__PURE__ */ jsxs12(Command, { shouldFilter: false, className: "p-4", children: [
527
- /* @__PURE__ */ jsx14(
528
- CommandInput,
529
- {
530
- placeholder: t(`generic.search.placeholder`, { type: source }),
531
- value: searchTerm,
532
- onValueChange: setSearchTerm
533
- }
534
- ),
535
- /* @__PURE__ */ jsxs12(CommandList, { className: "mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-y-auto overflow-x-hidden", children: [
536
- /* @__PURE__ */ jsx14(CommandEmpty, { children: t(`generic.search.no_results`, { type: source }) }),
537
- children
538
- ] })
539
- ] })
540
- ] });
541
- }
542
- __name(CommonAssociationCommandDialog, "CommonAssociationCommandDialog");
543
- var triggerAssociationToast = /* @__PURE__ */ __name((params) => {
544
- if (params.level) {
545
- toast.message(
546
- params.t(`generic.association.label`, {
547
- source: params.source,
548
- destination: params.destination
549
- }),
550
- {
551
- description: params.t(`generic.association.success_level`, {
552
- source: params.source,
553
- destination: params.destination,
554
- source_name: params.source_name,
555
- destination_name: params.destination_name,
556
- level: params.level
557
- })
558
- }
559
- );
560
- } else {
561
- toast.message(
562
- params.t(`generic.association.label`, {
563
- source: params.source,
564
- destination: params.destination
565
- }),
566
- {
567
- description: params.t(`generic.association.success`, {
568
- source: params.source,
569
- destination: params.destination,
570
- source_name: params.source_name,
571
- destination_name: params.destination_name
572
- })
573
- }
574
- );
575
- }
576
- }, "triggerAssociationToast");
577
-
578
- // src/components/forms/CommonDeleter.tsx
579
- import { LoaderCircleIcon, Trash2Icon } from "lucide-react";
580
- import { useState as useState6 } from "react";
581
- import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
582
- function CommonDeleter({ deleteFunction, redirectTo, type, forceShow }) {
583
- const t = useI18nTranslations();
584
- const router = useI18nRouter();
585
- const [open, setOpen] = useState6(forceShow || false);
586
- const [isDeleting, setIsDeleting] = useState6(false);
587
- const handleDelete = /* @__PURE__ */ __name(async () => {
588
- setIsDeleting(true);
589
- try {
590
- await deleteFunction();
591
- setOpen(false);
592
- if (redirectTo) router.push(redirectTo);
593
- } catch (error) {
594
- errorToast({ title: t(`generic.errors.delete`), error });
595
- }
596
- setIsDeleting(false);
597
- }, "handleDelete");
598
- return /* @__PURE__ */ jsxs13(AlertDialog, { open, onOpenChange: setOpen, children: [
599
- forceShow ? null : /* @__PURE__ */ jsx15(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx15(Button, { size: "sm", variant: "ghost", className: "text-muted-foreground hover:text-destructive", children: /* @__PURE__ */ jsx15(Trash2Icon, {}) }) }),
600
- /* @__PURE__ */ jsxs13(AlertDialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
601
- /* @__PURE__ */ jsxs13(AlertDialogHeader, { children: [
602
- /* @__PURE__ */ jsx15(AlertDialogTitle, { children: t(`generic.delete.title`, { type: t(`types.${type}`, { count: 1 }) }) }),
603
- /* @__PURE__ */ jsx15(AlertDialogDescription, { children: t(`generic.delete.subtitle`, { type: t(`types.${type}`, { count: 1 }) }) })
604
- ] }),
605
- /* @__PURE__ */ jsx15("div", { className: "text-destructive p-4 text-sm", children: t(`generic.delete.description`, { type: t(`types.${type}`, { count: 1 }) }) }),
606
- /* @__PURE__ */ jsxs13("div", { className: "flex justify-end", children: [
607
- /* @__PURE__ */ jsx15(
608
- Button,
609
- {
610
- className: "mr-2",
611
- variant: "outline",
612
- type: `button`,
613
- onClick: () => setOpen(false),
614
- disabled: isDeleting,
615
- children: t(`generic.buttons.cancel`)
616
- }
617
- ),
618
- /* @__PURE__ */ jsx15(
619
- Button,
620
- {
621
- type: "submit",
622
- onClick: (e) => {
623
- e.preventDefault();
624
- handleDelete();
625
- },
626
- variant: "destructive",
627
- disabled: isDeleting,
628
- children: isDeleting ? /* @__PURE__ */ jsxs13(Fragment4, { children: [
629
- t(`generic.buttons.is_deleting`),
630
- /* @__PURE__ */ jsx15(LoaderCircleIcon, { className: "animate-spin-slow h-5 w-5" })
631
- ] }) : t(`generic.buttons.delete`)
632
- }
633
- )
634
- ] })
635
- ] })
636
- ] });
637
- }
638
- __name(CommonDeleter, "CommonDeleter");
639
-
640
- // src/components/forms/CommonEditorButtons.tsx
641
- import { useTranslations as useTranslations6 } from "next-intl";
642
- import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
643
- function CommonEditorButtons({ isEdit, form, disabled, setOpen }) {
644
- const t = useTranslations6();
645
- return /* @__PURE__ */ jsxs14("div", { className: "flex justify-end", children: [
646
- /* @__PURE__ */ jsx16(
647
- Button,
648
- {
649
- className: "mr-2",
650
- variant: "outline",
651
- type: `button`,
652
- onClick: () => setOpen(false),
653
- "data-testid": `modal-button-cancel`,
654
- children: t(`generic.buttons.cancel`)
655
- }
656
- ),
657
- /* @__PURE__ */ jsx16(Button, { type: "submit", disabled: form.formState.isSubmitting || disabled, "data-testid": `modal-button-create`, children: isEdit ? t(`generic.buttons.confirm_update`) : t(`generic.buttons.confirm_create`) })
658
- ] });
659
- }
660
- __name(CommonEditorButtons, "CommonEditorButtons");
661
-
662
- // src/components/forms/CommonEditorHeader.tsx
663
- import { useTranslations as useTranslations7 } from "next-intl";
664
- import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
665
- function CommonEditorHeader({ type, name }) {
666
- const t = useTranslations7();
667
- return /* @__PURE__ */ jsxs15(DialogHeader, { children: [
668
- /* @__PURE__ */ jsx17(DialogTitle, { children: name ? t(`generic.edit.update.title`, {
669
- type
670
- }) : t(`generic.edit.create.title`, { type }) }),
671
- /* @__PURE__ */ jsx17(DialogDescription, { children: name ? t(`generic.edit.update.description`, {
672
- type,
673
- name
674
- }) : t(`generic.edit.create.description`, {
675
- type
676
- }) })
677
- ] });
678
- }
679
- __name(CommonEditorHeader, "CommonEditorHeader");
680
-
681
- // src/components/forms/CommonEditorTrigger.tsx
682
- import { PencilIcon } from "lucide-react";
683
- import { useTranslations as useTranslations8 } from "next-intl";
684
- import { jsx as jsx18 } from "react/jsx-runtime";
685
- function CommonEditorTrigger({ isEdit, edit, create }) {
686
- const t = useTranslations8();
687
- return /* @__PURE__ */ jsx18(DialogTrigger, { asChild: true, children: isEdit ? /* @__PURE__ */ jsx18(Button, { size: "sm", variant: `ghost`, className: "text-muted-foreground", children: /* @__PURE__ */ jsx18(PencilIcon, {}) }) : /* @__PURE__ */ jsx18(Button, { size: "sm", variant: `outline`, children: create ? create : t(`generic.buttons.create`) }) });
688
- }
689
- __name(CommonEditorTrigger, "CommonEditorTrigger");
690
-
691
- // src/components/forms/DatePickerPopover.tsx
692
- import { isValid, parse } from "date-fns";
693
- import { Calendar as CalendarIcon, CircleXIcon } from "lucide-react";
694
- import { useMemo, useState as useState7 } from "react";
695
- import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
696
- var DatePickerPopover = /* @__PURE__ */ __name(({
697
- children,
698
- value,
699
- onSelect,
700
- minDate,
701
- align = "start",
702
- className
703
- }) => {
704
- const locale = useI18nLocale();
705
- const dateFnsLocale = useI18nDateFnsLocale();
706
- const [isOpen, setIsOpen] = useState7(false);
707
- const [displayMonth, setDisplayMonth] = useState7(() => value || /* @__PURE__ */ new Date());
708
- const dateFormatter = useMemo(
709
- () => new Intl.DateTimeFormat(locale, { day: "2-digit", month: "2-digit", year: "numeric" }),
710
- [locale]
711
- );
712
- const formatDate = /* @__PURE__ */ __name((date) => dateFormatter.format(date), "formatDate");
713
- const datePlaceholder = useMemo(() => {
714
- const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
715
- return parts.map((part) => {
716
- if (part.type === "day") return "dd";
717
- if (part.type === "month") return "mm";
718
- if (part.type === "year") return "yyyy";
719
- return part.value;
720
- }).join("");
721
- }, [dateFormatter]);
722
- const dateFormatPattern = useMemo(() => {
723
- const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
724
- return parts.map((part) => {
725
- if (part.type === "day") return "dd";
726
- if (part.type === "month") return "MM";
727
- if (part.type === "year") return "yyyy";
728
- return part.value;
729
- }).join("");
730
- }, [dateFormatter]);
731
- const [inputValue, setInputValue] = useState7(() => value ? formatDate(value) : "");
732
- const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
733
- const yearOptions = Array.from({ length: currentYear - 1900 + 11 }, (_, i) => 1900 + i);
734
- const monthNames = useMemo(() => {
735
- const formatter = new Intl.DateTimeFormat(locale, { month: "long" });
736
- return Array.from({ length: 12 }, (_, i) => {
737
- const monthName = formatter.format(new Date(2e3, i, 1));
738
- return monthName.charAt(0).toUpperCase() + monthName.slice(1);
739
- });
740
- }, [locale]);
741
- const handleInputChange = /* @__PURE__ */ __name((inputValue2) => {
742
- setInputValue(inputValue2);
743
- const parsedDate = parse(inputValue2, dateFormatPattern, /* @__PURE__ */ new Date());
744
- if (isValid(parsedDate)) {
745
- onSelect(parsedDate);
746
- setDisplayMonth(parsedDate);
747
- } else if (inputValue2 === "") {
748
- onSelect(void 0);
749
- }
750
- }, "handleInputChange");
751
- const handleCalendarSelect = /* @__PURE__ */ __name((selectedDate) => {
752
- onSelect(selectedDate);
753
- if (selectedDate) {
754
- setInputValue(formatDate(selectedDate));
755
- setDisplayMonth(selectedDate);
756
- } else {
757
- setInputValue("");
758
- }
759
- setIsOpen(false);
760
- }, "handleCalendarSelect");
761
- const handleClear = /* @__PURE__ */ __name((e) => {
762
- e.stopPropagation();
763
- onSelect(void 0);
764
- setInputValue("");
765
- }, "handleClear");
766
- return /* @__PURE__ */ jsxs16(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
767
- /* @__PURE__ */ jsx19(PopoverTrigger, { asChild: true, children }),
768
- /* @__PURE__ */ jsx19(PopoverContent, { className: cn("w-auto p-0", className), align, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxs16("div", { className: "p-3", children: [
769
- /* @__PURE__ */ jsxs16("div", { className: "relative mb-3", children: [
770
- /* @__PURE__ */ jsx19(
771
- Input,
772
- {
773
- value: inputValue,
774
- onChange: (e) => handleInputChange(e.target.value),
775
- placeholder: datePlaceholder,
776
- className: "pr-16",
777
- onClick: (e) => e.stopPropagation()
778
- }
779
- ),
780
- /* @__PURE__ */ jsxs16("div", { className: "absolute right-1 top-1/2 flex -translate-y-1/2 items-center space-x-1", children: [
781
- /* @__PURE__ */ jsx19(
782
- "button",
783
- {
784
- type: "button",
785
- className: "flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",
786
- onClick: (e) => e.stopPropagation(),
787
- children: /* @__PURE__ */ jsx19(CalendarIcon, { className: "h-4 w-4 opacity-50" })
788
- }
789
- ),
790
- value && /* @__PURE__ */ jsx19(
791
- "button",
792
- {
793
- type: "button",
794
- className: "flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",
795
- onClick: handleClear,
796
- children: /* @__PURE__ */ jsx19(CircleXIcon, { className: "h-4 w-4 opacity-50 hover:opacity-100" })
797
- }
798
- )
799
- ] })
800
- ] }),
801
- /* @__PURE__ */ jsxs16("div", { className: "mb-3 flex gap-2", children: [
802
- /* @__PURE__ */ jsxs16(
803
- Select,
804
- {
805
- value: displayMonth.getMonth().toString(),
806
- onValueChange: (value2) => {
807
- const newMonth = parseInt(value2);
808
- const newDate = new Date(displayMonth.getFullYear(), newMonth, 1);
809
- setDisplayMonth(newDate);
810
- },
811
- children: [
812
- /* @__PURE__ */ jsx19(SelectTrigger, { className: "w-[130px]", children: /* @__PURE__ */ jsx19(SelectValue, {}) }),
813
- /* @__PURE__ */ jsx19(SelectContent, { children: monthNames.map((month, index) => /* @__PURE__ */ jsx19(SelectItem, { value: index.toString(), children: month }, index)) })
814
- ]
815
- }
816
- ),
817
- /* @__PURE__ */ jsxs16(
818
- Select,
819
- {
820
- value: displayMonth.getFullYear().toString(),
821
- onValueChange: (value2) => {
822
- const newYear = parseInt(value2);
823
- const newDate = new Date(newYear, displayMonth.getMonth(), 1);
824
- setDisplayMonth(newDate);
825
- },
826
- children: [
827
- /* @__PURE__ */ jsx19(SelectTrigger, { className: "w-[80px]", children: /* @__PURE__ */ jsx19(SelectValue, {}) }),
828
- /* @__PURE__ */ jsx19(SelectContent, { children: yearOptions.reverse().map((year) => /* @__PURE__ */ jsx19(SelectItem, { value: year.toString(), children: year }, year)) })
829
- ]
830
- }
831
- )
832
- ] }),
833
- /* @__PURE__ */ jsx19(
834
- Calendar,
835
- {
836
- mode: "single",
837
- selected: value,
838
- onSelect: handleCalendarSelect,
839
- disabled: (date) => minDate && date < minDate ? true : false,
840
- locale: dateFnsLocale,
841
- weekStartsOn: 1,
842
- month: displayMonth,
843
- onMonthChange: setDisplayMonth
844
- }
845
- )
846
- ] }) })
847
- ] });
848
- }, "DatePickerPopover");
849
-
850
- // src/components/forms/DateRangeSelector.tsx
851
- import { format } from "date-fns";
852
- import { CalendarIcon as CalendarIcon2 } from "lucide-react";
853
- import { useEffect as useEffect5, useState as useState8 } from "react";
854
- import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
855
- function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth }) {
856
- const [date, setDate] = useState8(
857
- avoidSettingDates ? void 0 : {
858
- from: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1),
859
- to: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() + 1, 0)
860
- }
861
- );
862
- const [open, setOpen] = useState8(false);
863
- const [prevRange, setPrevRange] = useState8(date);
864
- useEffect5(() => {
865
- if (date?.from && date?.to && date.to > date.from && (prevRange?.from?.getTime() !== date.from.getTime() || prevRange?.to?.getTime() !== date.to.getTime())) {
866
- onDateChange(date);
867
- setPrevRange(date);
868
- setOpen(false);
869
- }
870
- }, [date, prevRange, onDateChange]);
871
- const handleSelect = /* @__PURE__ */ __name((range) => {
872
- if (!range) {
873
- setDate(void 0);
874
- return;
875
- }
876
- if (range.from && (!date?.from || range.from.getTime() !== date.from.getTime())) {
877
- setDate({ from: range.from, to: void 0 });
878
- } else {
879
- setDate(range);
880
- }
881
- }, "handleSelect");
882
- return /* @__PURE__ */ jsx20("div", { className: cn("grid gap-2"), children: /* @__PURE__ */ jsxs17(Popover, { open, onOpenChange: setOpen, children: [
883
- /* @__PURE__ */ jsx20(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs17(
884
- Button,
885
- {
886
- id: "date",
887
- variant: "outline",
888
- className: cn("w-[300px] justify-start text-left font-normal", !date && "text-muted-foreground"),
889
- children: [
890
- /* @__PURE__ */ jsx20(CalendarIcon2, {}),
891
- date?.from ? date.to ? /* @__PURE__ */ jsxs17(Fragment5, { children: [
892
- format(date.from, "LLL dd, y"),
893
- " - ",
894
- format(date.to, "LLL dd, y")
895
- ] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */ jsx20("span", { children: "Pick a date" })
896
- ]
897
- }
898
- ) }),
899
- /* @__PURE__ */ jsx20(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-2 p-2", children: [
900
- /* @__PURE__ */ jsx20(
901
- Calendar,
902
- {
903
- mode: "range",
904
- defaultMonth: date?.from ?? (showPreviousMonth ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() - 1, 1) : void 0),
905
- selected: date,
906
- onSelect: handleSelect,
907
- numberOfMonths: 2
908
- }
909
- ),
910
- /* @__PURE__ */ jsx20(
911
- Button,
912
- {
913
- variant: "secondary",
914
- type: "button",
915
- onClick: () => {
916
- setDate(void 0);
917
- setPrevRange(void 0);
918
- onDateChange(void 0);
919
- setOpen(false);
920
- },
921
- className: "cursor-pointer",
922
- disabled: !date,
923
- children: "Clear"
924
- }
925
- )
926
- ] }) })
927
- ] }) });
928
- }
929
- __name(DateRangeSelector, "DateRangeSelector");
930
-
931
- // src/components/forms/FileUploader.tsx
932
- import { Trash2 as RemoveIcon } from "lucide-react";
933
- import { useTranslations as useTranslations9 } from "next-intl";
934
- import {
935
- createContext,
936
- forwardRef,
937
- useCallback as useCallback2,
938
- useContext,
939
- useEffect as useEffect6,
940
- useRef as useRef3,
941
- useState as useState9
942
- } from "react";
943
- import { useDropzone } from "react-dropzone";
944
- import { toast as toast2 } from "sonner";
945
- import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
946
- var FileUploaderContext = createContext(null);
947
- var useFileUpload = /* @__PURE__ */ __name(() => {
948
- const context = useContext(FileUploaderContext);
949
- if (!context) {
950
- throw new Error("useFileUpload must be used within a FileUploaderProvider");
951
- }
952
- return context;
953
- }, "useFileUpload");
954
- var FileUploader = forwardRef(
955
- ({ className, dropzoneOptions, value, onValueChange, reSelect, orientation = "vertical", children, dir, ...props }, ref) => {
956
- const [isFileTooBig, setIsFileTooBig] = useState9(false);
957
- const [isLOF, setIsLOF] = useState9(false);
958
- const [activeIndex, setActiveIndex] = useState9(-1);
959
- const { maxFiles = 1, maxSize = 4 * 1024 * 1024, multiple = true } = dropzoneOptions;
960
- const t = useTranslations9();
961
- const reSelectAll = maxFiles === 1 ? true : reSelect;
962
- const direction = dir === "rtl" ? "rtl" : "ltr";
963
- const removeFileFromSet = useCallback2(
964
- (i) => {
965
- if (!value) return;
966
- const newFiles = value.filter((_, index) => index !== i);
967
- onValueChange(newFiles);
968
- },
969
- [value, onValueChange]
970
- );
971
- const handleKeyDown = useCallback2(
972
- (e) => {
973
- e.preventDefault();
974
- e.stopPropagation();
975
- if (!value) return;
976
- const moveNext = /* @__PURE__ */ __name(() => {
977
- const nextIndex = activeIndex + 1;
978
- setActiveIndex(nextIndex > value.length - 1 ? 0 : nextIndex);
979
- }, "moveNext");
980
- const movePrev = /* @__PURE__ */ __name(() => {
981
- const nextIndex = activeIndex - 1;
982
- setActiveIndex(nextIndex < 0 ? value.length - 1 : nextIndex);
983
- }, "movePrev");
984
- const prevKey = orientation === "horizontal" ? direction === "ltr" ? "ArrowLeft" : "ArrowRight" : "ArrowUp";
985
- const nextKey = orientation === "horizontal" ? direction === "ltr" ? "ArrowRight" : "ArrowLeft" : "ArrowDown";
986
- if (e.key === nextKey) {
987
- moveNext();
988
- } else if (e.key === prevKey) {
989
- movePrev();
990
- } else if (e.key === "Enter" || e.key === "Space") {
991
- if (activeIndex === -1) {
992
- dropzoneState.inputRef.current?.click();
993
- }
994
- } else if (e.key === "Delete" || e.key === "Backspace") {
995
- if (activeIndex !== -1) {
996
- removeFileFromSet(activeIndex);
997
- if (value.length - 1 === 0) {
998
- setActiveIndex(-1);
999
- return;
1000
- }
1001
- movePrev();
1002
- }
1003
- } else if (e.key === "Escape") {
1004
- setActiveIndex(-1);
1005
- }
1006
- },
1007
- [value, activeIndex, removeFileFromSet]
1008
- );
1009
- const onDrop = useCallback2(
1010
- (acceptedFiles, rejectedFiles) => {
1011
- const files = acceptedFiles;
1012
- if (!files) {
1013
- toast2.error(t("generic.errors.file"), {
1014
- description: t("generic.errors.file_large")
1015
- });
1016
- return;
1017
- }
1018
- const newValues = value ? [...value] : [];
1019
- if (reSelectAll) {
1020
- newValues.splice(0, newValues.length);
1021
- }
1022
- files.forEach((file) => {
1023
- if (newValues.length < maxFiles) {
1024
- newValues.push(file);
1025
- }
1026
- });
1027
- onValueChange(newValues);
1028
- if (rejectedFiles.length > 0) {
1029
- for (let i = 0; i < rejectedFiles.length; i++) {
1030
- if (rejectedFiles[i].errors[0]?.code === "file-too-large") {
1031
- toast2.error(t("generic.errors.file"), {
1032
- description: t(`generic.errors.file_max`, { size: maxSize / 1024 / 1024 })
1033
- });
1034
- break;
1035
- }
1036
- if (rejectedFiles[i].errors[0]?.message) {
1037
- toast2.error(t(`generic.errors.file`), {
1038
- description: rejectedFiles[i].errors[0].message
1039
- });
1040
- break;
1041
- }
1042
- }
1043
- }
1044
- },
1045
- [reSelectAll, value]
1046
- );
1047
- useEffect6(() => {
1048
- if (!value) return;
1049
- if (value.length === maxFiles) {
1050
- return;
1051
- }
1052
- setIsLOF(false);
1053
- }, [value, maxFiles]);
1054
- const opts = dropzoneOptions ? dropzoneOptions : { maxFiles, maxSize, multiple };
1055
- const dropzoneState = useDropzone({
1056
- ...opts,
1057
- onDrop,
1058
- onDropRejected: /* @__PURE__ */ __name(() => setIsFileTooBig(true), "onDropRejected"),
1059
- onDropAccepted: /* @__PURE__ */ __name(() => setIsFileTooBig(false), "onDropAccepted")
1060
- });
1061
- const { isDragActive } = dropzoneState;
1062
- return /* @__PURE__ */ jsx21(
1063
- FileUploaderContext.Provider,
1064
- {
1065
- value: {
1066
- dropzoneState,
1067
- isLOF,
1068
- isFileTooBig,
1069
- removeFileFromSet,
1070
- activeIndex,
1071
- setActiveIndex,
1072
- orientation,
1073
- direction
1074
- },
1075
- children: /* @__PURE__ */ jsx21(
1076
- "div",
1077
- {
1078
- ref,
1079
- tabIndex: 0,
1080
- onKeyDownCapture: handleKeyDown,
1081
- className: cn(
1082
- "grid w-full overflow-hidden focus:outline-none",
1083
- className,
1084
- // Original className from props
1085
- {
1086
- "gap-2": value && value.length > 0,
1087
- "bg-muted border-primary border-dashed": isDragActive
1088
- // Apply drag-active styles to the main FileUploader div
1089
- }
1090
- ),
1091
- dir,
1092
- ...props,
1093
- children
1094
- }
1095
- )
1096
- }
1097
- );
1098
- }
1099
- );
1100
- FileUploader.displayName = "FileUploader";
1101
- var FileUploaderContent = forwardRef(
1102
- ({ children, className, ...props }, ref) => {
1103
- const { orientation } = useFileUpload();
1104
- const containerRef = useRef3(null);
1105
- return /* @__PURE__ */ jsx21("div", { className: cn("w-full px-1"), ref: containerRef, "aria-description": "content file holder", children: /* @__PURE__ */ jsx21(
1106
- "div",
1107
- {
1108
- ...props,
1109
- ref,
1110
- className: cn(
1111
- "flex gap-1 rounded-xl",
1112
- orientation === "horizontal" ? "flex-raw flex-wrap" : "flex-col",
1113
- className
1114
- ),
1115
- children
1116
- }
1117
- ) });
1118
- }
1119
- );
1120
- FileUploaderContent.displayName = "FileUploaderContent";
1121
- var FileUploaderItem = forwardRef(
1122
- ({ className, index, children, ...props }, ref) => {
1123
- const { removeFileFromSet, activeIndex, direction } = useFileUpload();
1124
- const isSelected = index === activeIndex;
1125
- const t = useTranslations9();
1126
- return /* @__PURE__ */ jsxs18(
1127
- "div",
1128
- {
1129
- ref,
1130
- className: cn(
1131
- buttonVariants({ variant: "ghost" }),
1132
- "relative h-6 cursor-pointer justify-between p-1",
1133
- className,
1134
- isSelected ? "bg-muted" : ""
1135
- ),
1136
- ...props,
1137
- children: [
1138
- /* @__PURE__ */ jsx21("div", { className: "flex h-full w-full items-center gap-1.5 leading-none font-medium tracking-tight", children }),
1139
- /* @__PURE__ */ jsxs18(
1140
- "button",
1141
- {
1142
- type: "button",
1143
- className: cn("absolute", direction === "rtl" ? "top-1 left-1" : "top-1 right-1"),
1144
- onClick: () => removeFileFromSet(index),
1145
- children: [
1146
- /* @__PURE__ */ jsx21("span", { className: "sr-only", children: t(`generic.remove_item`, { index }) }),
1147
- /* @__PURE__ */ jsx21(RemoveIcon, { className: "hover:stroke-destructive h-4 w-4 duration-200 ease-in-out" })
1148
- ]
1149
- }
1150
- )
1151
- ]
1152
- }
1153
- );
1154
- }
1155
- );
1156
- FileUploaderItem.displayName = "FileUploaderItem";
1157
- var FileInput = forwardRef(
1158
- ({ className, children, ...props }, ref) => {
1159
- const { dropzoneState, isFileTooBig, isLOF } = useFileUpload();
1160
- const rootProps = isLOF ? {} : dropzoneState.getRootProps();
1161
- const { isDragActive: parentIsDragActive } = dropzoneState;
1162
- return /* @__PURE__ */ jsxs18(
1163
- "div",
1164
- {
1165
- ref,
1166
- ...props,
1167
- className: cn(`relative w-full ${isLOF ? "cursor-not-allowed opacity-50" : "cursor-pointer"}`, className),
1168
- children: [
1169
- /* @__PURE__ */ jsx21(
1170
- "div",
1171
- {
1172
- className: cn(
1173
- "w-full rounded-lg duration-300 ease-in-out",
1174
- // Simpler border logic: if parent is drag-active, it controls the border.
1175
- // Otherwise, FileInput can show its own accept/reject/default border.
1176
- {
1177
- "border-green-500": dropzoneState.isDragAccept && !parentIsDragActive,
1178
- "border-red-500": (dropzoneState.isDragReject || isFileTooBig) && !parentIsDragActive,
1179
- "border-gray-300": !dropzoneState.isDragAccept && !dropzoneState.isDragReject && !isFileTooBig && !parentIsDragActive
1180
- },
1181
- // className from props should be last to allow overrides if necessary
1182
- className
1183
- ),
1184
- ...rootProps,
1185
- children
1186
- }
1187
- ),
1188
- /* @__PURE__ */ jsx21(
1189
- Input,
1190
- {
1191
- ref: dropzoneState.inputRef,
1192
- disabled: isLOF,
1193
- ...dropzoneState.getInputProps(),
1194
- className: `${isLOF ? "cursor-not-allowed" : ""}`
1195
- }
1196
- )
1197
- ]
1198
- }
1199
- );
1200
- }
1201
- );
1202
- FileInput.displayName = "FileInput";
1203
-
1204
- // src/components/forms/FormCheckbox.tsx
1205
- import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
1206
- function FormCheckbox({ form, id, name, labelBefore, description, isRequired }) {
1207
- const simpleLabel = /* @__PURE__ */ __name(() => {
1208
- return /* @__PURE__ */ jsx22(FormLabel, { htmlFor: id, className: `font-normal ${labelBefore ? "" : "ml-3"}`, children: name });
1209
- }, "simpleLabel");
1210
- const label = /* @__PURE__ */ __name(() => {
1211
- if (description) return simpleLabel();
1212
- else
1213
- return /* @__PURE__ */ jsxs19(Tooltip, { children: [
1214
- /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: simpleLabel() }),
1215
- /* @__PURE__ */ jsx22(TooltipContent, { children: description })
1216
- ] });
1217
- }, "label");
1218
- return /* @__PURE__ */ jsx22("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx22(
1219
- FormField,
1220
- {
1221
- control: form.control,
1222
- name: id,
1223
- render: ({ field }) => /* @__PURE__ */ jsxs19(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
1224
- /* @__PURE__ */ jsx22(FormControl, { children: /* @__PURE__ */ jsxs19("div", { className: "flex gap-x-4", children: [
1225
- labelBefore && label(),
1226
- labelBefore && isRequired && /* @__PURE__ */ jsx22("span", { className: "text-destructive ml-2 font-semibold", children: "*" }),
1227
- /* @__PURE__ */ jsx22(Checkbox, { id, defaultChecked: field.value, onCheckedChange: field.onChange }),
1228
- !labelBefore && label(),
1229
- !labelBefore && isRequired && /* @__PURE__ */ jsx22("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
1230
- ] }) }),
1231
- /* @__PURE__ */ jsx22(FormMessage, {})
1232
- ] })
1233
- }
1234
- ) });
1235
- }
1236
- __name(FormCheckbox, "FormCheckbox");
1237
-
1238
- // src/components/forms/FormContainerGeneric.tsx
1239
- import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
1240
- function FormContainerGeneric({
1241
- form,
1242
- id,
1243
- name,
1244
- children,
1245
- isRequired = false
1246
- }) {
1247
- return /* @__PURE__ */ jsx23("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx23(
1248
- FormField,
1249
- {
1250
- control: form.control,
1251
- name: id,
1252
- render: ({ field }) => /* @__PURE__ */ jsxs20(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
1253
- name && /* @__PURE__ */ jsxs20(FormLabel, { className: "flex items-center", children: [
1254
- /* @__PURE__ */ jsx23("span", { children: name }),
1255
- isRequired && /* @__PURE__ */ jsx23("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
1256
- ] }),
1257
- /* @__PURE__ */ jsx23(FormControl, { children }),
1258
- /* @__PURE__ */ jsx23(FormMessage, {})
1259
- ] })
1260
- }
1261
- ) });
1262
- }
1263
- __name(FormContainerGeneric, "FormContainerGeneric");
1264
-
1265
- // src/components/forms/FormDate.tsx
1266
- import { isValid as isValid2, parse as parse2 } from "date-fns";
1267
- import { Calendar as CalendarIcon3, CircleXIcon as CircleXIcon2 } from "lucide-react";
1268
- import { useMemo as useMemo2, useState as useState10 } from "react";
1269
- import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
1270
- function FormDate({
1271
- form,
1272
- id,
1273
- name,
1274
- minDate,
1275
- onChange,
1276
- isRequired = false
1277
- }) {
1278
- const locale = useI18nLocale();
1279
- const dateFnsLocale = useI18nDateFnsLocale();
1280
- const [open, setOpen] = useState10(false);
1281
- const [displayMonth, setDisplayMonth] = useState10(() => {
1282
- const currentValue = form.getValues(id);
1283
- return currentValue || /* @__PURE__ */ new Date();
1284
- });
1285
- const dateFormatter = useMemo2(
1286
- () => new Intl.DateTimeFormat(locale, { day: "2-digit", month: "2-digit", year: "numeric" }),
1287
- [locale]
1288
- );
1289
- const formatDate = /* @__PURE__ */ __name((date) => dateFormatter.format(date), "formatDate");
1290
- const datePlaceholder = useMemo2(() => {
1291
- const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
1292
- return parts.map((part) => {
1293
- if (part.type === "day") return "dd";
1294
- if (part.type === "month") return "mm";
1295
- if (part.type === "year") return "yyyy";
1296
- return part.value;
1297
- }).join("");
1298
- }, [dateFormatter]);
1299
- const dateFormatPattern = useMemo2(() => {
1300
- const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
1301
- return parts.map((part) => {
1302
- if (part.type === "day") return "dd";
1303
- if (part.type === "month") return "MM";
1304
- if (part.type === "year") return "yyyy";
1305
- return part.value;
1306
- }).join("");
1307
- }, [dateFormatter]);
1308
- const [inputValue, setInputValue] = useState10(() => {
1309
- const currentValue = form.getValues(id);
1310
- return currentValue ? formatDate(currentValue) : "";
1311
- });
1312
- const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
1313
- const yearOptions = Array.from({ length: currentYear - 1900 + 1 }, (_, i) => 1900 + i);
1314
- const monthNames = useMemo2(() => {
1315
- const formatter = new Intl.DateTimeFormat(locale, { month: "long" });
1316
- return Array.from({ length: 12 }, (_, i) => {
1317
- const monthName = formatter.format(new Date(2e3, i, 1));
1318
- return monthName.charAt(0).toUpperCase() + monthName.slice(1);
1319
- });
1320
- }, [locale]);
1321
- const handleInputChange = /* @__PURE__ */ __name((value, field) => {
1322
- setInputValue(value);
1323
- const parsedDate = parse2(value, dateFormatPattern, /* @__PURE__ */ new Date());
1324
- if (isValid2(parsedDate)) {
1325
- field.onChange(parsedDate);
1326
- setDisplayMonth(parsedDate);
1327
- if (onChange) onChange(parsedDate);
1328
- } else if (value === "") {
1329
- field.onChange(void 0);
1330
- if (onChange) onChange(void 0);
1331
- }
1332
- }, "handleInputChange");
1333
- const handleCalendarSelect = /* @__PURE__ */ __name((selectedDate, field) => {
1334
- field.onChange(selectedDate);
1335
- if (selectedDate) {
1336
- setInputValue(formatDate(selectedDate));
1337
- setDisplayMonth(selectedDate);
1338
- } else {
1339
- setInputValue("");
1340
- }
1341
- if (onChange) onChange(selectedDate);
1342
- }, "handleCalendarSelect");
1343
- return /* @__PURE__ */ jsx24("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx24(
1344
- FormField,
1345
- {
1346
- control: form.control,
1347
- name: id,
1348
- render: ({ field }) => /* @__PURE__ */ jsxs21(FormItem, { className: `${name ? "mb-5" : "mb-1"} w-full`, children: [
1349
- name && /* @__PURE__ */ jsxs21(FormLabel, { className: "dlex items-center", children: [
1350
- name,
1351
- " ",
1352
- isRequired && /* @__PURE__ */ jsx24("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
1353
- ] }),
1354
- /* @__PURE__ */ jsx24(FormControl, { children: /* @__PURE__ */ jsx24("div", { className: "relative", children: /* @__PURE__ */ jsxs21(Popover, { open, onOpenChange: setOpen, modal: true, children: [
1355
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
1356
- /* @__PURE__ */ jsx24(
1357
- Input,
1358
- {
1359
- value: inputValue,
1360
- onChange: (e) => handleInputChange(e.target.value, field),
1361
- placeholder: datePlaceholder,
1362
- className: "pr-16"
1363
- }
1364
- ),
1365
- /* @__PURE__ */ jsxs21("div", { className: "absolute right-1 top-1/2 flex -translate-y-1/2 items-center space-x-1", children: [
1366
- /* @__PURE__ */ jsx24(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
1367
- "button",
1368
- {
1369
- type: "button",
1370
- className: "hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md",
1371
- children: /* @__PURE__ */ jsx24(CalendarIcon3, { className: "h-4 w-4 opacity-50" })
1372
- }
1373
- ) }),
1374
- field.value && /* @__PURE__ */ jsx24(
1375
- "button",
1376
- {
1377
- type: "button",
1378
- className: "hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md",
1379
- onClick: () => {
1380
- field.onChange(void 0);
1381
- setInputValue("");
1382
- if (onChange) onChange(void 0);
1383
- },
1384
- children: /* @__PURE__ */ jsx24(CircleXIcon2, { className: "h-4 w-4 opacity-50 hover:opacity-100" })
1385
- }
1386
- )
1387
- ] })
1388
- ] }),
1389
- /* @__PURE__ */ jsx24(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsxs21("div", { className: "p-3", children: [
1390
- /* @__PURE__ */ jsxs21("div", { className: "mb-3 flex gap-2", children: [
1391
- /* @__PURE__ */ jsxs21(
1392
- Select,
1393
- {
1394
- value: displayMonth.getMonth().toString(),
1395
- onValueChange: (value) => {
1396
- const newMonth = parseInt(value);
1397
- const newDate = new Date(displayMonth.getFullYear(), newMonth, 1);
1398
- setDisplayMonth(newDate);
1399
- },
1400
- children: [
1401
- /* @__PURE__ */ jsx24(SelectTrigger, { className: "w-[130px]", children: /* @__PURE__ */ jsx24(SelectValue, {}) }),
1402
- /* @__PURE__ */ jsx24(SelectContent, { children: monthNames.map((month, index) => /* @__PURE__ */ jsx24(SelectItem, { value: index.toString(), children: month }, index)) })
1403
- ]
1404
- }
1405
- ),
1406
- /* @__PURE__ */ jsxs21(
1407
- Select,
1408
- {
1409
- value: displayMonth.getFullYear().toString(),
1410
- onValueChange: (value) => {
1411
- const newYear = parseInt(value);
1412
- const newDate = new Date(newYear, displayMonth.getMonth(), 1);
1413
- setDisplayMonth(newDate);
1414
- },
1415
- children: [
1416
- /* @__PURE__ */ jsx24(SelectTrigger, { className: "w-[80px]", children: /* @__PURE__ */ jsx24(SelectValue, {}) }),
1417
- /* @__PURE__ */ jsx24(SelectContent, { children: yearOptions.reverse().map((year) => /* @__PURE__ */ jsx24(SelectItem, { value: year.toString(), children: year }, year)) })
1418
- ]
1419
- }
1420
- )
1421
- ] }),
1422
- /* @__PURE__ */ jsx24(
1423
- Calendar,
1424
- {
1425
- mode: "single",
1426
- selected: field.value,
1427
- onSelect: (e) => {
1428
- handleCalendarSelect(e, field);
1429
- setOpen(false);
1430
- },
1431
- disabled: (date) => minDate && date < minDate ? true : false,
1432
- locale: dateFnsLocale,
1433
- weekStartsOn: 1,
1434
- month: displayMonth,
1435
- onMonthChange: setDisplayMonth
1436
- }
1437
- )
1438
- ] }) })
1439
- ] }) }) }),
1440
- /* @__PURE__ */ jsx24(FormMessage, {})
1441
- ] })
1442
- }
1443
- ) });
1444
- }
1445
- __name(FormDate, "FormDate");
1446
-
1447
- // src/components/forms/FormDateTime.tsx
1448
- import { Calendar as CalendarIcon4, CircleXIcon as CircleXIcon3 } from "lucide-react";
1449
- import { useMemo as useMemo3, useState as useState11 } from "react";
1450
- import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
1451
- function FormDateTime({
1452
- form,
1453
- id,
1454
- name,
1455
- minDate,
1456
- onChange,
1457
- allowEmpty
1458
- }) {
1459
- const [open, setOpen] = useState11(false);
1460
- const t = useI18nTranslations();
1461
- const locale = useI18nLocale();
1462
- const dateFnsLocale = useI18nDateFnsLocale();
1463
- const dateTimeFormatter = useMemo3(
1464
- () => new Intl.DateTimeFormat(locale, {
1465
- year: "numeric",
1466
- month: "long",
1467
- day: "numeric",
1468
- hour: "2-digit",
1469
- minute: "2-digit"
1470
- }),
1471
- [locale]
1472
- );
1473
- const formatDateTime = /* @__PURE__ */ __name((date) => dateTimeFormatter.format(date), "formatDateTime");
1474
- const [selectedHours, setSelectedHours] = useState11((/* @__PURE__ */ new Date()).getHours());
1475
- const [selectedMinutes, setSelectedMinutes] = useState11(roundToNearestFiveMinutes((/* @__PURE__ */ new Date()).getMinutes()));
1476
- const hoursOptions = Array.from({ length: 24 }, (_, i) => {
1477
- const hour = i;
1478
- return {
1479
- value: hour,
1480
- label: hour.toString().padStart(2, "0")
1481
- };
1482
- });
1483
- const minutesOptions = Array.from({ length: 12 }, (_, i) => {
1484
- const minute = i * 5;
1485
- return {
1486
- value: minute,
1487
- label: minute.toString().padStart(2, "0")
1488
- };
1489
- });
1490
- function roundToNearestFiveMinutes(minutes) {
1491
- return Math.round(minutes / 5) * 5 % 60;
1492
- }
1493
- __name(roundToNearestFiveMinutes, "roundToNearestFiveMinutes");
1494
- const handleTimeChange = /* @__PURE__ */ __name((hours, minutes) => {
1495
- const currentDate = form.getValues(id);
1496
- if (currentDate) {
1497
- const updatedDate = new Date(currentDate);
1498
- updatedDate.setHours(hours);
1499
- updatedDate.setMinutes(minutes);
1500
- form.setValue(id, updatedDate);
1501
- if (onChange) onChange(updatedDate);
1502
- }
1503
- }, "handleTimeChange");
1504
- return /* @__PURE__ */ jsx25("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx25(
1505
- FormField,
1506
- {
1507
- control: form.control,
1508
- name: id,
1509
- render: ({ field }) => /* @__PURE__ */ jsxs22(FormItem, { className: `${name ? "mb-5" : "mb-1"} w-full`, children: [
1510
- name && /* @__PURE__ */ jsx25(FormLabel, { children: name }),
1511
- /* @__PURE__ */ jsx25(FormControl, { children: /* @__PURE__ */ jsx25("div", { className: "relative flex flex-row", children: /* @__PURE__ */ jsxs22(Popover, { open, onOpenChange: setOpen, modal: true, children: [
1512
- /* @__PURE__ */ jsxs22("div", { className: "flex w-full flex-row items-center justify-between", children: [
1513
- /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(FormControl, { children: /* @__PURE__ */ jsxs22(
1514
- Button,
1515
- {
1516
- variant: "outline",
1517
- className: cn("w-full pl-3 text-left font-normal", !field.value && "text-muted-foreground"),
1518
- children: [
1519
- field.value ? formatDateTime(field.value) : /* @__PURE__ */ jsx25("span", { children: t(`generic.pick_date_time`) }),
1520
- /* @__PURE__ */ jsx25(CalendarIcon4, { className: "ml-auto h-4 w-4 opacity-50" })
1521
- ]
1522
- }
1523
- ) }) }),
1524
- field.value && allowEmpty !== false && /* @__PURE__ */ jsx25(
1525
- CircleXIcon3,
1526
- {
1527
- className: "text-muted hover:text-destructive ml-2 h-6 w-6 cursor-pointer",
1528
- onClick: () => {
1529
- if (onChange) onChange(void 0);
1530
- form.setValue(id, "");
1531
- }
1532
- }
1533
- )
1534
- ] }),
1535
- /* @__PURE__ */ jsx25(PopoverContent, { className: "w-auto p-4", align: "start", children: /* @__PURE__ */ jsxs22("div", { className: "flex flex-col space-y-4", children: [
1536
- /* @__PURE__ */ jsx25(
1537
- Calendar,
1538
- {
1539
- mode: "single",
1540
- selected: field.value,
1541
- onSelect: (date) => {
1542
- if (date) {
1543
- const newDate = new Date(date);
1544
- if (field.value) {
1545
- const currentDate = new Date(field.value);
1546
- newDate.setHours(currentDate.getHours(), currentDate.getMinutes());
1547
- } else {
1548
- newDate.setHours(selectedHours, selectedMinutes);
1549
- }
1550
- form.setValue(id, newDate);
1551
- if (onChange) onChange(newDate);
1552
- setSelectedHours(newDate.getHours());
1553
- setSelectedMinutes(roundToNearestFiveMinutes(newDate.getMinutes()));
1554
- }
1555
- },
1556
- disabled: (date) => minDate && date < minDate ? true : false,
1557
- locale: dateFnsLocale
1558
- }
1559
- ),
1560
- /* @__PURE__ */ jsxs22("div", { className: "flex flex-row items-end justify-center space-x-4", children: [
1561
- /* @__PURE__ */ jsxs22("div", { className: "flex flex-col space-y-2", children: [
1562
- /* @__PURE__ */ jsx25(Label, { htmlFor: "hours-select", children: t(`generic.hours`) }),
1563
- /* @__PURE__ */ jsxs22(
1564
- Select,
1565
- {
1566
- value: String(field.value ? new Date(field.value).getHours() : selectedHours),
1567
- onValueChange: (value) => {
1568
- const hours = parseInt(value);
1569
- setSelectedHours(hours);
1570
- handleTimeChange(
1571
- hours,
1572
- field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
1573
- );
1574
- },
1575
- children: [
1576
- /* @__PURE__ */ jsx25(SelectTrigger, { id: "hours-select", className: "w-[70px]", children: /* @__PURE__ */ jsx25(SelectValue, { placeholder: "Hour" }) }),
1577
- /* @__PURE__ */ jsx25(SelectContent, { children: hoursOptions.map((option) => /* @__PURE__ */ jsx25(SelectItem, { value: String(option.value), children: option.label }, option.value)) })
1578
- ]
1579
- }
1580
- )
1581
- ] }),
1582
- /* @__PURE__ */ jsx25("div", { className: "mb-[9px] text-xl", children: ":" }),
1583
- /* @__PURE__ */ jsxs22("div", { className: "flex flex-col space-y-2", children: [
1584
- /* @__PURE__ */ jsx25(Label, { htmlFor: "minutes-select", children: t(`generic.minutes`) }),
1585
- /* @__PURE__ */ jsxs22(
1586
- Select,
1587
- {
1588
- value: String(
1589
- field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
1590
- ),
1591
- onValueChange: (value) => {
1592
- const minutes = parseInt(value);
1593
- setSelectedMinutes(minutes);
1594
- handleTimeChange(field.value ? new Date(field.value).getHours() : selectedHours, minutes);
1595
- },
1596
- children: [
1597
- /* @__PURE__ */ jsx25(SelectTrigger, { id: "minutes-select", className: "w-[70px]", children: /* @__PURE__ */ jsx25(SelectValue, { placeholder: "Min" }) }),
1598
- /* @__PURE__ */ jsx25(SelectContent, { children: minutesOptions.map((option) => /* @__PURE__ */ jsx25(SelectItem, { value: String(option.value), children: option.label }, option.value)) })
1599
- ]
1600
- }
1601
- )
1602
- ] })
1603
- ] }),
1604
- /* @__PURE__ */ jsx25(
1605
- Button,
1606
- {
1607
- className: "mt-2",
1608
- onClick: () => {
1609
- setOpen(false);
1610
- },
1611
- children: t(`generic.buttons.select_date`)
1612
- }
1613
- )
1614
- ] }) })
1615
- ] }) }) }),
1616
- /* @__PURE__ */ jsx25(FormMessage, {})
1617
- ] })
1618
- }
1619
- ) });
1620
- }
1621
- __name(FormDateTime, "FormDateTime");
1622
-
1623
- // src/components/forms/FormInput.tsx
1624
- import { useTranslations as useTranslations10 } from "next-intl";
1625
- import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
1626
- function FormInput({
1627
- form,
1628
- id,
1629
- name,
1630
- placeholder,
1631
- type,
1632
- onBlur,
1633
- disabled,
1634
- onKeyDown,
1635
- autoFocus,
1636
- onChange,
1637
- testId,
1638
- isRequired = false
1639
- }) {
1640
- const t = useTranslations10();
1641
- return /* @__PURE__ */ jsx26("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx26(
1642
- FormField,
1643
- {
1644
- control: form.control,
1645
- name: id,
1646
- render: ({ field }) => {
1647
- const handleBlur = /* @__PURE__ */ __name(async (e) => {
1648
- let value = e.target.value;
1649
- if (type === "link" && value) {
1650
- if (!/^https?:\/\//i.test(value)) {
1651
- value = "https://" + value;
1652
- field.onChange(value);
1653
- }
1654
- try {
1655
- new URL(value);
1656
- form.clearErrors(id);
1657
- } catch (error) {
1658
- form.setError(id, {
1659
- type: "validate",
1660
- message: t(`generic.errors.valid_url`)
1661
- });
1662
- }
1663
- }
1664
- if (onBlur) await onBlur();
1665
- field.onBlur();
1666
- }, "handleBlur");
1667
- return /* @__PURE__ */ jsxs23(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
1668
- name && /* @__PURE__ */ jsxs23(FormLabel, { className: "flex items-center", children: [
1669
- name,
1670
- isRequired && /* @__PURE__ */ jsx26("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
1671
- ] }),
1672
- /* @__PURE__ */ jsx26(FormControl, { children: /* @__PURE__ */ jsxs23("div", { className: "relative", children: [
1673
- type === "currency" && /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground absolute top-0 left-0 pt-2 pl-3", children: "\u20AC" }),
1674
- /* @__PURE__ */ jsx26(
1675
- Input,
1676
- {
1677
- "data-testid": testId,
1678
- ...field,
1679
- autoFocus: autoFocus === true,
1680
- type: type === "number" || type === "currency" ? "number" : type === "password" ? "password" : "text",
1681
- className: `w-full ${type === "number" || type === "currency" ? "text-end" : ""}`,
1682
- disabled: disabled === true || form.formState.isSubmitting,
1683
- placeholder: placeholder || "",
1684
- onBlur: handleBlur,
1685
- onKeyDown,
1686
- onChange: (e) => {
1687
- if (type === "number" || type === "currency") {
1688
- const value = e.target.value.replace(/[^0-9]/g, "");
1689
- field.onChange(+value);
1690
- if (onChange) onChange(+value);
1691
- } else {
1692
- field.onChange(e.target.value);
1693
- if (onChange) onChange(e.target.value);
1694
- }
1695
- }
1696
- }
1697
- )
1698
- ] }) }),
1699
- /* @__PURE__ */ jsx26(FormMessage, { "data-testid": testId ? `${testId}-error` : void 0 })
1700
- ] });
1701
- }
1702
- }
1703
- ) });
1704
- }
1705
- __name(FormInput, "FormInput");
1706
-
1707
- // src/components/forms/PasswordInput.tsx
1708
- import * as React2 from "react";
1709
- import { EyeIcon, EyeOffIcon } from "lucide-react";
1710
- import { useTranslations as useTranslations11 } from "next-intl";
1711
- import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
1712
- var PasswordInput = React2.forwardRef(({ className, type, ...props }, ref) => {
1713
- const [showPassword, setShowPassword] = React2.useState(false);
1714
- const disabled = props.value === "" || props.value === void 0 || props.disabled;
1715
- const t = useTranslations11();
1716
- return /* @__PURE__ */ jsxs24("div", { className: "relative", children: [
1717
- /* @__PURE__ */ jsx27(Input, { type: showPassword ? "text" : "password", className: cn("", className), ref, ...props }),
1718
- /* @__PURE__ */ jsxs24(
1719
- Button,
1720
- {
1721
- type: "button",
1722
- variant: "ghost",
1723
- size: "sm",
1724
- className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
1725
- onClick: () => setShowPassword((prev) => !prev),
1726
- disabled,
1727
- children: [
1728
- showPassword && !disabled ? /* @__PURE__ */ jsx27(EyeIcon, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsx27(EyeOffIcon, { className: "h-4 w-4", "aria-hidden": "true" }),
1729
- /* @__PURE__ */ jsx27("span", { className: "sr-only", children: showPassword ? t(`generic.hide_password`) : t(`generic.show_password`) })
1730
- ]
1731
- }
1732
- ),
1733
- /* @__PURE__ */ jsx27("style", { children: `
1734
- .hide-password-toggle::-ms-reveal,
1735
- .hide-password-toggle::-ms-clear {
1736
- visibility: hidden;
1737
- pointer-events: none;
1738
- display: none;
1739
- }
1740
- ` })
1741
- ] });
1742
- });
1743
- PasswordInput.displayName = "PasswordInput";
1744
-
1745
- // src/components/forms/FormPassword.tsx
1746
- import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
1747
- function FormPassword({
1748
- form,
1749
- id,
1750
- name,
1751
- placeholder,
1752
- onBlur,
1753
- disabled,
1754
- testId,
1755
- isRequired
1756
- }) {
1757
- return /* @__PURE__ */ jsx28("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx28(
1758
- FormField,
1759
- {
1760
- control: form.control,
1761
- name: id,
1762
- render: ({ field }) => /* @__PURE__ */ jsxs25(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
1763
- name && /* @__PURE__ */ jsxs25(FormLabel, { children: [
1764
- name,
1765
- isRequired && /* @__PURE__ */ jsx28("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
1766
- ] }),
1767
- /* @__PURE__ */ jsx28(FormControl, { children: /* @__PURE__ */ jsx28(
1768
- PasswordInput,
1769
- {
1770
- ...field,
1771
- className: `w-full`,
1772
- disabled: disabled === true || form.formState.isSubmitting,
1773
- placeholder: placeholder ? placeholder : "",
1774
- onBlur,
1775
- "data-testid": testId
1776
- }
1777
- ) }),
1778
- /* @__PURE__ */ jsx28(FormMessage, { "data-testid": testId ? `${testId}-error` : void 0 })
1779
- ] })
1780
- }
1781
- ) });
1782
- }
1783
- __name(FormPassword, "FormPassword");
1784
-
1785
- // src/components/forms/FormPlaceAutocomplete.tsx
1786
- import { useEffect as useEffect7, useRef as useRef4, useState as useState13 } from "react";
1787
- import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
1788
- function FormPlaceAutocomplete({
1789
- form,
1790
- id,
1791
- name,
1792
- placeholder,
1793
- disabled,
1794
- testId,
1795
- isRequired = false,
1796
- onPlaceSelect,
1797
- className,
1798
- includeTypes
1799
- }) {
1800
- const [inputValue, setInputValue] = useState13("");
1801
- const [suggestions, setSuggestions] = useState13([]);
1802
- const [isLoading, setIsLoading] = useState13(false);
1803
- const [showSuggestions, setShowSuggestions] = useState13(false);
1804
- const [loadError, setLoadError] = useState13(false);
1805
- const [apiKey, setApiKey] = useState13(null);
1806
- const debounceRef = useRef4(null);
1807
- const containerRef = useRef4(null);
1808
- useEffect7(() => {
1809
- const key = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;
1810
- if (!key) {
1811
- console.error("Google Maps API key not found. Please set NEXT_PUBLIC_GOOGLE_MAPS_API_KEY environment variable.");
1812
- setLoadError(true);
1813
- return;
1814
- }
1815
- setApiKey(key);
1816
- }, []);
1817
- useEffect7(() => {
1818
- const formValue = form.getValues(id);
1819
- if (formValue !== inputValue) {
1820
- setInputValue(formValue || "");
1821
- }
1822
- }, [form.watch(id), id, inputValue]);
1823
- const fetchSuggestions = /* @__PURE__ */ __name(async (input) => {
1824
- if (!apiKey) return;
1825
- try {
1826
- setIsLoading(true);
1827
- const response = await fetch(`https://places.googleapis.com/v1/places:autocomplete`, {
1828
- method: "POST",
1829
- headers: {
1830
- "Content-Type": "application/json",
1831
- "X-Goog-Api-Key": apiKey
1832
- },
1833
- body: JSON.stringify({
1834
- input,
1835
- includedPrimaryTypes: includeTypes || ["street_address", "premise", "subpremise"],
1836
- languageCode: "en"
1837
- })
1838
- });
1839
- if (!response.ok) {
1840
- throw new Error(`Places API error: ${response.status}`);
1841
- }
1842
- const data = await response.json();
1843
- if (data.suggestions) {
1844
- const formattedSuggestions = data.suggestions.map((suggestion) => ({
1845
- place_id: suggestion.placePrediction?.placeId || "",
1846
- description: suggestion.placePrediction?.text?.text || "",
1847
- structured_formatting: {
1848
- main_text: suggestion.placePrediction?.structuredFormat?.mainText?.text || "",
1849
- secondary_text: suggestion.placePrediction?.structuredFormat?.secondaryText?.text || ""
1850
- }
1851
- }));
1852
- setSuggestions(formattedSuggestions);
1853
- setShowSuggestions(true);
1854
- } else {
1855
- setSuggestions([]);
1856
- }
1857
- } catch (error) {
1858
- console.error("Error fetching place suggestions:", error);
1859
- setSuggestions([]);
1860
- } finally {
1861
- setIsLoading(false);
1862
- }
1863
- }, "fetchSuggestions");
1864
- const handleInputChange = /* @__PURE__ */ __name((value) => {
1865
- setInputValue(value);
1866
- form.setValue(id, value);
1867
- if (debounceRef.current) {
1868
- clearTimeout(debounceRef.current);
1869
- }
1870
- if (value.length > 2 && apiKey) {
1871
- debounceRef.current = setTimeout(() => {
1872
- fetchSuggestions(value);
1873
- }, 300);
1874
- } else {
1875
- setSuggestions([]);
1876
- setShowSuggestions(false);
1877
- setIsLoading(false);
1878
- }
1879
- }, "handleInputChange");
1880
- const handleSuggestionSelect = /* @__PURE__ */ __name((suggestion) => {
1881
- setInputValue(suggestion.description);
1882
- form.setValue(id, suggestion.description);
1883
- setShowSuggestions(false);
1884
- setSuggestions([]);
1885
- if (onPlaceSelect) {
1886
- onPlaceSelect(suggestion);
1887
- }
1888
- }, "handleSuggestionSelect");
1889
- useEffect7(() => {
1890
- const handleClickOutside = /* @__PURE__ */ __name((event) => {
1891
- if (containerRef.current && !containerRef.current.contains(event.target)) {
1892
- setShowSuggestions(false);
1893
- }
1894
- }, "handleClickOutside");
1895
- document.addEventListener("mousedown", handleClickOutside);
1896
- return () => {
1897
- document.removeEventListener("mousedown", handleClickOutside);
1898
- };
1899
- }, []);
1900
- useEffect7(() => {
1901
- return () => {
1902
- if (debounceRef.current) {
1903
- clearTimeout(debounceRef.current);
1904
- }
1905
- };
1906
- }, []);
1907
- if (loadError) {
1908
- return /* @__PURE__ */ jsx29("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx29(
1909
- FormField,
1910
- {
1911
- control: form.control,
1912
- name: id,
1913
- render: ({ field }) => /* @__PURE__ */ jsxs26(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
1914
- name && /* @__PURE__ */ jsxs26(FormLabel, { className: "flex items-center", children: [
1915
- name,
1916
- isRequired && /* @__PURE__ */ jsx29("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
1917
- ] }),
1918
- /* @__PURE__ */ jsx29(FormControl, { children: /* @__PURE__ */ jsx29(
1919
- Input,
1920
- {
1921
- ...field,
1922
- placeholder,
1923
- disabled,
1924
- "data-testid": testId,
1925
- className: cn("w-full", className)
1926
- }
1927
- ) }),
1928
- /* @__PURE__ */ jsx29(FormMessage, {})
1929
- ] })
1930
- }
1931
- ) });
1932
- }
1933
- return /* @__PURE__ */ jsx29("div", { className: "flex w-full flex-col", ref: containerRef, children: /* @__PURE__ */ jsx29(
1934
- FormField,
1935
- {
1936
- control: form.control,
1937
- name: id,
1938
- render: ({ field }) => /* @__PURE__ */ jsxs26(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
1939
- name && /* @__PURE__ */ jsxs26(FormLabel, { className: "flex items-center", children: [
1940
- name,
1941
- isRequired && /* @__PURE__ */ jsx29("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
1942
- ] }),
1943
- /* @__PURE__ */ jsx29(FormControl, { children: /* @__PURE__ */ jsxs26("div", { className: "relative", children: [
1944
- /* @__PURE__ */ jsx29(
1945
- Input,
1946
- {
1947
- value: inputValue,
1948
- onChange: (e) => handleInputChange(e.target.value),
1949
- onBlur: field.onBlur,
1950
- onFocus: () => {
1951
- if (suggestions.length > 0) {
1952
- setShowSuggestions(true);
1953
- }
1954
- },
1955
- placeholder,
1956
- disabled: disabled || !apiKey,
1957
- "data-testid": testId,
1958
- className: cn("w-full", className)
1959
- }
1960
- ),
1961
- isLoading && /* @__PURE__ */ jsx29("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx29("div", { className: "border-primary h-4 w-4 animate-spin rounded-full border-2 border-t-transparent" }) }),
1962
- showSuggestions && suggestions.length > 0 && /* @__PURE__ */ jsx29("div", { className: "bg-background absolute left-0 right-0 top-full z-50 mt-1 max-h-60 overflow-auto rounded-md border shadow-lg", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs26(
1963
- "div",
1964
- {
1965
- className: "hover:bg-muted cursor-pointer px-3 py-2 text-sm",
1966
- onClick: () => handleSuggestionSelect(suggestion),
1967
- children: [
1968
- /* @__PURE__ */ jsx29("div", { className: "font-medium", children: suggestion.structured_formatting?.main_text }),
1969
- /* @__PURE__ */ jsx29("div", { className: "text-muted-foreground", children: suggestion.structured_formatting?.secondary_text })
1970
- ]
1971
- },
1972
- suggestion.place_id || index
1973
- )) })
1974
- ] }) }),
1975
- /* @__PURE__ */ jsx29(FormMessage, {})
1976
- ] })
1977
- }
1978
- ) });
1979
- }
1980
- __name(FormPlaceAutocomplete, "FormPlaceAutocomplete");
1981
-
1982
- // src/components/forms/FormSelect.tsx
1983
- import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
1984
- function FormSelect({
1985
- form,
1986
- id,
1987
- name,
1988
- placeholder,
1989
- disabled,
1990
- values,
1991
- onChange,
1992
- useRows,
1993
- testId
1994
- }) {
1995
- return /* @__PURE__ */ jsx30("div", { className: `flex w-full flex-col`, children: /* @__PURE__ */ jsx30(
1996
- FormField,
1997
- {
1998
- control: form.control,
1999
- name: id,
2000
- render: ({ field }) => /* @__PURE__ */ jsxs27(FormItem, { className: `flex w-full ${useRows ? `flex-row items-center justify-between gap-x-4` : `flex-col`}`, children: [
2001
- name && /* @__PURE__ */ jsx30(FormLabel, { className: `${useRows ? `min-w-28` : ``}`, children: name }),
2002
- /* @__PURE__ */ jsxs27(
2003
- Select,
2004
- {
2005
- onValueChange: (e) => {
2006
- field.onChange(e);
2007
- if (onChange) onChange(e);
2008
- },
2009
- defaultValue: field.value,
2010
- "data-testid": testId,
2011
- children: [
2012
- /* @__PURE__ */ jsx30(FormControl, { className: "w-full", children: /* @__PURE__ */ jsx30(SelectTrigger, { children: /* @__PURE__ */ jsx30(SelectValue, { placeholder }) }) }),
2013
- /* @__PURE__ */ jsx30(SelectContent, { children: values.map((type) => /* @__PURE__ */ jsx30(SelectItem, { value: type.id, children: type.text }, type.id)) })
2014
- ]
2015
- }
2016
- ),
2017
- /* @__PURE__ */ jsx30(FormMessage, {})
2018
- ] })
2019
- }
2020
- ) });
2021
- }
2022
- __name(FormSelect, "FormSelect");
2023
-
2024
- // src/components/forms/FormSlider.tsx
2025
- import { useWatch } from "react-hook-form";
2026
- import { jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
2027
- function FormSlider({
2028
- form,
2029
- id,
2030
- name,
2031
- disabled,
2032
- showPercentage
2033
- }) {
2034
- const value = useWatch({ control: form.control, name: id });
2035
- return /* @__PURE__ */ jsx31("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx31(
2036
- FormField,
2037
- {
2038
- control: form.control,
2039
- name: id,
2040
- render: ({ field }) => /* @__PURE__ */ jsxs28(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
2041
- name && /* @__PURE__ */ jsx31(FormLabel, { children: name }),
2042
- /* @__PURE__ */ jsx31(FormControl, { children: /* @__PURE__ */ jsxs28("div", { children: [
2043
- showPercentage && /* @__PURE__ */ jsx31("div", { className: "text-muted-foreground mb-2 flex w-full justify-center text-xs", children: `${value}%` }),
2044
- /* @__PURE__ */ jsx31(
2045
- Slider,
2046
- {
2047
- onValueChange: (value2) => form.setValue(id, value2[0]),
2048
- value: [value],
2049
- max: 100,
2050
- step: 5,
2051
- disabled: disabled === true || form.formState.isSubmitting
2052
- }
2053
- )
2054
- ] }) }),
2055
- /* @__PURE__ */ jsx31(FormMessage, {})
2056
- ] })
2057
- }
2058
- ) });
2059
- }
2060
- __name(FormSlider, "FormSlider");
2061
-
2062
- // src/components/forms/FormSwitch.tsx
2063
- import { jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
2064
- function FormSwitch({ form, id, name, disabled }) {
2065
- return /* @__PURE__ */ jsx32("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx32(
2066
- FormField,
2067
- {
2068
- control: form.control,
2069
- name: id,
2070
- render: ({ field }) => /* @__PURE__ */ jsxs29(FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
2071
- /* @__PURE__ */ jsx32(FormControl, { children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-row gap-x-4", children: [
2072
- /* @__PURE__ */ jsx32(Switch, { checked: field.value, onCheckedChange: field.onChange }),
2073
- name && /* @__PURE__ */ jsx32(FormLabel, { children: name })
2074
- ] }) }),
2075
- /* @__PURE__ */ jsx32(FormMessage, {})
2076
- ] })
2077
- }
2078
- ) });
2079
- }
2080
- __name(FormSwitch, "FormSwitch");
2081
-
2082
- // src/components/forms/FormTextarea.tsx
2083
- import { jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
2084
- function FormTextarea({
2085
- form,
2086
- id,
2087
- name,
2088
- className,
2089
- placeholder,
2090
- testId
2091
- }) {
2092
- return /* @__PURE__ */ jsx33("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx33(
2093
- FormField,
2094
- {
2095
- control: form.control,
2096
- name: id,
2097
- render: ({ field }) => /* @__PURE__ */ jsxs30(FormItem, { className: "mb-5", children: [
2098
- /* @__PURE__ */ jsx33(FormLabel, { children: name }),
2099
- /* @__PURE__ */ jsx33(FormControl, { children: /* @__PURE__ */ jsx33(
2100
- Textarea,
2101
- {
2102
- ...field,
2103
- className: cn("min-h-96 w-full", className),
2104
- disabled: form.formState.isSubmitting,
2105
- placeholder,
2106
- "data-testid": testId
2107
- }
2108
- ) }),
2109
- /* @__PURE__ */ jsx33(FormMessage, { "data-testid": testId ? `${testId}-error` : void 0 })
2110
- ] })
2111
- }
2112
- ) });
2113
- }
2114
- __name(FormTextarea, "FormTextarea");
2115
-
2116
- // src/components/pages/PageContainerContentDetails.tsx
2117
- import { useEffect as useEffect8, useRef as useRef5, useState as useState14 } from "react";
2118
- import { jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
2119
- function PageContainerContentDetails({ items, section, module, id }) {
2120
- const rewriteUrl = useUrlRewriter();
2121
- const [isScrolled, setIsScrolled] = useState14(false);
2122
- const sentinelRef = useRef5(null);
2123
- useEffect8(() => {
2124
- const sentinel = sentinelRef.current;
2125
- if (!sentinel) return;
2126
- const observer = new IntersectionObserver(
2127
- ([entry]) => {
2128
- setIsScrolled(!entry.isIntersecting);
2129
- },
2130
- {
2131
- threshold: 0,
2132
- rootMargin: "0px"
2133
- }
2134
- );
2135
- observer.observe(sentinel);
2136
- return () => {
2137
- observer.disconnect();
2138
- };
2139
- }, []);
2140
- return /* @__PURE__ */ jsxs31(
2141
- Tabs,
2142
- {
2143
- defaultValue: section || items[0].title,
2144
- onValueChange: (a) => rewriteUrl({ page: module, id, childPage: a }),
2145
- children: [
2146
- /* @__PURE__ */ jsx34("div", { ref: sentinelRef, className: "h-0" }),
2147
- /* @__PURE__ */ jsx34("div", { className: `bg-background sticky top-0 z-10 mb-2 pb-2 transition-shadow ${isScrolled ? "border-b" : ""}`, children: /* @__PURE__ */ jsx34(TabsList, { children: items.map((item) => /* @__PURE__ */ jsx34(TabsTrigger, { value: item.title, children: item.title }, item.title)) }) }),
2148
- /* @__PURE__ */ jsx34("div", { className: "pr-4", children: items.map((item) => /* @__PURE__ */ jsx34(TabsContent, { value: item.title, children: item.content }, item.title)) })
2149
- ]
2150
- }
2151
- );
2152
- }
2153
- __name(PageContainerContentDetails, "PageContainerContentDetails");
2154
-
2155
- // src/components/pages/PageContentContainer.tsx
2156
- import { jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
2157
- function PageContentContainer({ details, footer, content }) {
2158
- return /* @__PURE__ */ jsx35("div", { className: "flex h-[calc(100vh-(--spacing(16)))] w-full", children: /* @__PURE__ */ jsxs32(ResizablePanelGroup, { direction: "horizontal", className: "items-stretch", autoSaveId: "page-content-layout", children: [
2159
- /* @__PURE__ */ jsx35(ResizablePanel, { id: "left-panel", defaultSize: 32, minSize: 20, maxSize: 40, children: /* @__PURE__ */ jsxs32("div", { className: "@container flex h-full flex-col pr-4", children: [
2160
- /* @__PURE__ */ jsx35("div", { className: "flex-1 overflow-y-auto", children: details }),
2161
- footer && /* @__PURE__ */ jsx35("div", { className: "flex flex-col gap-y-2 pt-2 pb-2", children: footer })
2162
- ] }) }),
2163
- /* @__PURE__ */ jsx35(ResizableHandle, { withHandle: true }),
2164
- /* @__PURE__ */ jsx35(ResizablePanel, { id: "right-panel", className: "pl-4", children: /* @__PURE__ */ jsx35("div", { className: "h-full overflow-y-auto", children: content }) })
2165
- ] }) });
2166
- }
2167
- __name(PageContentContainer, "PageContentContainer");
2168
-
2169
- // src/components/tables/cells/cell.component.tsx
2170
- var cellComponent = /* @__PURE__ */ __name((params) => {
2171
- return {
2172
- id: params.name,
2173
- accessorKey: params.name,
2174
- header: params.title,
2175
- cell: /* @__PURE__ */ __name(({ row }) => params.component, "cell"),
2176
- enableSorting: false,
2177
- enableHiding: false
2178
- };
2179
- }, "cellComponent");
2180
-
2181
- // src/components/tables/cells/cell.date.tsx
2182
- import { jsx as jsx36 } from "react/jsx-runtime";
2183
- var cellDate = /* @__PURE__ */ __name((params) => {
2184
- return {
2185
- id: params.name,
2186
- accessorKey: params.name,
2187
- header: params.title,
2188
- cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx36("span", { className: "text-muted-foreground text-xs", children: row.getValue(params.name).toLocaleDateString("en", { dateStyle: "medium" }) }), "cell"),
2189
- enableSorting: false,
2190
- enableHiding: false
2191
- };
2192
- }, "cellDate");
2193
-
2194
- // src/components/tables/cells/cell.id.tsx
2195
- import { jsx as jsx37 } from "react/jsx-runtime";
2196
- var cellId = /* @__PURE__ */ __name((params) => {
2197
- return {
2198
- id: params.name,
2199
- accessorKey: params.name,
2200
- header: "",
2201
- cell: /* @__PURE__ */ __name(({ row }) => params.toggleId ? /* @__PURE__ */ jsx37(
2202
- Checkbox,
2203
- {
2204
- checked: params.checkedIds?.includes(row.getValue(params.name)) || false,
2205
- onCheckedChange: (value) => {
2206
- row.toggleSelected(!!value);
2207
- params.toggleId?.(row.getValue(params.name));
2208
- },
2209
- "aria-label": "Select row"
2210
- }
2211
- ) : null, "cell"),
2212
- enableSorting: false,
2213
- enableHiding: true
2214
- };
2215
- }, "cellId");
2216
-
2217
- // src/components/tables/cells/cell.link.tsx
2218
- import { jsx as jsx38 } from "react/jsx-runtime";
2219
- var cellLink = /* @__PURE__ */ __name((params) => {
2220
- return {
2221
- id: params.name,
2222
- accessorKey: params.name,
2223
- header: params.title,
2224
- cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx38(Link, { href: params.generateUrl(row.getValue(params.id)), children: row.getValue(params.name) }), "cell"),
2225
- enableSorting: false,
2226
- enableHiding: false
2227
- };
2228
- }, "cellLink");
2229
-
2230
- // src/components/tables/cells/cell.url.tsx
2231
- import { jsx as jsx39 } from "react/jsx-runtime";
2232
- var cellUrl = /* @__PURE__ */ __name((params) => {
2233
- return {
2234
- id: params.name,
2235
- accessorKey: params.name,
2236
- header: params.title,
2237
- cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx39(Link, { href: row.getValue(params.name), children: row.getValue(params.name) }), "cell"),
2238
- enableSorting: false,
2239
- enableHiding: false
2240
- };
2241
- }, "cellUrl");
2242
-
2243
- // src/components/tables/ContentListTable.tsx
2244
- import { flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
2245
- import { CaretLeftIcon, CaretRightIcon } from "@radix-ui/react-icons";
2246
- import { memo, useMemo as useMemo4 } from "react";
2247
-
2248
- // src/components/tables/ContentTableSearch.tsx
2249
- import { RefreshCw, Search, X } from "lucide-react";
2250
- import { useTranslations as useTranslations12 } from "next-intl";
2251
- import { useCallback as useCallback3, useEffect as useEffect9, useRef as useRef6, useState as useState15 } from "react";
2252
- import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
2253
- function ContentTableSearch({ data }) {
2254
- const t = useTranslations12();
2255
- const searchTermRef = useRef6("");
2256
- const inputRef = useRef6(null);
2257
- const [searchTerm, setSearchTerm] = useState15("");
2258
- const [isFocused, setIsFocused] = useState15(false);
2259
- const [isSearching, setIsSearching] = useState15(false);
2260
- const isExpanded = isFocused || searchTerm.length > 0;
2261
- const search = useCallback3(
2262
- async (searchedTerm) => {
2263
- try {
2264
- if (searchedTerm === searchTermRef.current) return;
2265
- searchTermRef.current = searchedTerm;
2266
- await data.search(searchedTerm);
2267
- } finally {
2268
- setIsSearching(false);
2269
- }
2270
- },
2271
- [searchTermRef, data]
2272
- );
2273
- const updateSearchTerm = useDebounce(search, 500);
2274
- useEffect9(() => {
2275
- setIsSearching(true);
2276
- updateSearchTerm(searchTerm);
2277
- }, [updateSearchTerm, searchTerm]);
2278
- const handleSearchIconClick = /* @__PURE__ */ __name(() => {
2279
- if (!isExpanded) {
2280
- setIsFocused(true);
2281
- setTimeout(() => inputRef.current?.focus(), 50);
2282
- }
2283
- }, "handleSearchIconClick");
2284
- const handleBlur = /* @__PURE__ */ __name(() => {
2285
- if (searchTerm.length === 0) {
2286
- setIsFocused(false);
2287
- }
2288
- }, "handleBlur");
2289
- const handleClear = /* @__PURE__ */ __name(() => {
2290
- setSearchTerm("");
2291
- search("");
2292
- setIsFocused(false);
2293
- }, "handleClear");
2294
- return /* @__PURE__ */ jsxs33(
2295
- "div",
2296
- {
2297
- className: `relative flex h-6 items-center text-xs font-normal transition-all duration-300 ease-in-out ${isExpanded ? "w-64" : "w-6"}`,
2298
- children: [
2299
- /* @__PURE__ */ jsx40(
2300
- Search,
2301
- {
2302
- className: `absolute top-1 left-1 h-4 w-4 transition-colors ${isExpanded ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground cursor-pointer"}`,
2303
- onClick: handleSearchIconClick
2304
- }
2305
- ),
2306
- isExpanded && /* @__PURE__ */ jsx40(
2307
- Input,
2308
- {
2309
- ref: inputRef,
2310
- onKeyDown: (e) => {
2311
- if (e.key === "Escape") {
2312
- handleClear();
2313
- }
2314
- },
2315
- onFocus: () => setIsFocused(true),
2316
- onBlur: handleBlur,
2317
- placeholder: t(`generic.search.placeholder_global`),
2318
- type: "text",
2319
- className: "border-border/50 focus-visible:border-border h-10 w-full pr-8 pl-8 text-xs shadow-none focus-visible:ring-0",
2320
- onChange: (e) => setSearchTerm(e.target.value),
2321
- value: searchTerm
2322
- }
2323
- ),
2324
- isExpanded && isSearching && /* @__PURE__ */ jsx40(RefreshCw, { className: "text-muted-foreground absolute top-1 right-1 h-4 w-4 animate-spin" }),
2325
- isExpanded && !isSearching && searchTermRef.current && /* @__PURE__ */ jsx40(
2326
- X,
2327
- {
2328
- className: "text-muted-foreground hover:text-foreground absolute top-1 right-1 h-4 w-4 cursor-pointer",
2329
- onClick: handleClear
2330
- }
2331
- )
2332
- ]
2333
- }
2334
- );
2335
- }
2336
- __name(ContentTableSearch, "ContentTableSearch");
2337
-
2338
- // src/components/tables/ContentListTable.tsx
2339
- import { Fragment as Fragment6, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
2340
- var EMPTY_ARRAY = [];
2341
- var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(props) {
2342
- const { data, fields, checkedIds, toggleId, allowSearch, filters } = props;
2343
- const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
2344
- data: data?.data ?? EMPTY_ARRAY,
2345
- fields,
2346
- checkedIds,
2347
- toggleId,
2348
- dataRetriever: data,
2349
- context: props.context
2350
- });
2351
- const columnVisibility = useMemo4(
2352
- () => fields.reduce(
2353
- (acc, columnId) => {
2354
- acc[columnId] = true;
2355
- return acc;
2356
- },
2357
- {}
2358
- ),
2359
- [fields]
2360
- );
2361
- const table = useReactTable({
2362
- data: tableData,
2363
- columns: tableColumns,
2364
- getCoreRowModel: getCoreRowModel(),
2365
- initialState: {
2366
- columnVisibility
2367
- }
2368
- });
2369
- const rowModel = tableData ? table.getRowModel() : null;
2370
- const showFooter = !!(props.functions || data.next || data.previous);
2371
- return /* @__PURE__ */ jsx41("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx41("div", { className: "overflow-hidden rounded-md border", children: /* @__PURE__ */ jsxs34(Table, { children: [
2372
- /* @__PURE__ */ jsxs34(TableHeader, { className: "bg-muted font-semibold", children: [
2373
- props.title && /* @__PURE__ */ jsx41(TableRow, { children: /* @__PURE__ */ jsx41(TableHead, { className: "bg-card text-primary p-4 text-left font-bold", colSpan: tableColumns.length, children: /* @__PURE__ */ jsxs34("div", { className: "flex w-full items-center justify-between gap-x-2", children: [
2374
- /* @__PURE__ */ jsx41("div", { className: "w-full", children: props.title }),
2375
- (props.functions || props.filters || allowSearch) && /* @__PURE__ */ jsxs34(Fragment6, { children: [
2376
- props.functions,
2377
- props.filters,
2378
- /* @__PURE__ */ jsx41(ContentTableSearch, { data })
2379
- ] })
2380
- ] }) }) }),
2381
- table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx41(TableRow, { children: headerGroup.headers.map((header) => {
2382
- return /* @__PURE__ */ jsx41(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
2383
- }) }, headerGroup.id))
2384
- ] }),
2385
- /* @__PURE__ */ jsx41(TableBody, { children: rowModel && rowModel.rows?.length ? rowModel.rows.map((row) => /* @__PURE__ */ jsx41(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx41(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx41(TableRow, { children: /* @__PURE__ */ jsx41(TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
2386
- showFooter && /* @__PURE__ */ jsx41(TableFooter, { children: /* @__PURE__ */ jsx41(TableRow, { children: /* @__PURE__ */ jsx41(TableCell, { colSpan: tableColumns.length, className: "bg-card py-4 text-right", children: /* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-end space-x-2", children: [
2387
- /* @__PURE__ */ jsx41(
2388
- Button,
2389
- {
2390
- variant: "outline",
2391
- size: "sm",
2392
- onClick: (e) => {
2393
- e.preventDefault();
2394
- data.previous?.(true);
2395
- },
2396
- disabled: !data.previous,
2397
- children: /* @__PURE__ */ jsx41(CaretLeftIcon, { className: "h-4 w-4" })
2398
- }
2399
- ),
2400
- data.pageInfo && /* @__PURE__ */ jsxs34("span", { className: "text-muted-foreground text-xs", children: [
2401
- data.pageInfo.startItem,
2402
- "-",
2403
- data.pageInfo.endItem
2404
- ] }),
2405
- /* @__PURE__ */ jsx41(
2406
- Button,
2407
- {
2408
- variant: "outline",
2409
- size: "sm",
2410
- onClick: (e) => {
2411
- e.preventDefault();
2412
- data.next?.(true);
2413
- },
2414
- disabled: !data.next,
2415
- children: /* @__PURE__ */ jsx41(CaretRightIcon, { className: "h-4 w-4" })
2416
- }
2417
- )
2418
- ] }) }) }) })
2419
- ] }) }) });
2420
- }, "ContentListTable"));
117
+ import "../chunk-Q2N6SQYW.mjs";
118
+ import "../chunk-PYF2U6WG.mjs";
119
+ import "../chunk-RBIVEH2K.mjs";
120
+ import "../chunk-DD3KISNB.mjs";
121
+ import "../chunk-PAWJFY3S.mjs";
2421
122
  export {
123
+ AcceptInvitation,
124
+ ActivateAccount,
125
+ AddUserToRole,
126
+ AdminCompanyContainer,
127
+ AdminUsersList,
2422
128
  AllowedUsersDetails,
2423
129
  AttributeElement,
130
+ AuthContainer,
2424
131
  BlockNoteEditorContainer,
2425
- Breadcrumb2 as Breadcrumb,
132
+ Breadcrumb,
2426
133
  CommonAssociationCommandDialog,
2427
134
  CommonAssociationTrigger,
2428
135
  CommonDeleter,
2429
136
  CommonEditorButtons,
2430
137
  CommonEditorHeader,
2431
138
  CommonEditorTrigger,
139
+ CompaniesList,
140
+ CompanyConfigurationEditor,
141
+ CompanyConfigurationSecurityForm,
142
+ CompanyContainer,
143
+ CompanyDeleter,
144
+ CompanyDetails,
145
+ CompanyEditor,
146
+ CompanyUsersList,
2432
147
  ContentListTable,
2433
148
  ContentTableSearch,
2434
149
  ContentTitle,
2435
150
  ContributorsList,
151
+ Cookies,
2436
152
  DatePickerPopover,
2437
153
  DateRangeSelector,
2438
154
  ErrorDetails,
@@ -2440,34 +156,73 @@ export {
2440
156
  FileUploader,
2441
157
  FileUploaderContent,
2442
158
  FileUploaderItem,
159
+ ForgotPassword,
2443
160
  FormCheckbox,
2444
161
  FormContainerGeneric,
2445
162
  FormDate,
2446
163
  FormDateTime,
164
+ FormFeatures,
2447
165
  FormInput,
2448
166
  FormPassword,
2449
167
  FormPlaceAutocomplete,
168
+ FormRoles,
2450
169
  FormSelect,
2451
170
  FormSlider,
2452
171
  FormSwitch,
2453
172
  FormTextarea,
2454
173
  Header,
174
+ LandingComponent,
175
+ Login,
176
+ Logout,
2455
177
  ModeToggleSwitch,
178
+ NotificationErrorBoundary,
179
+ NotificationMenuItem,
180
+ NotificationModal,
181
+ NotificationToast,
182
+ NotificationsList,
183
+ NotificationsListContainer,
2456
184
  PageContainer,
2457
185
  PageContainerContentDetails,
2458
186
  PageContentContainer,
2459
187
  PageSection,
2460
188
  PasswordInput,
189
+ PushNotificationProvider,
2461
190
  ReactMarkdownContainer,
2462
191
  RecentPagesNavigator,
192
+ RefreshUser,
193
+ RelevantUsersList,
194
+ RemoveUserFromRole,
195
+ ResetPassword,
196
+ RoleContainer,
197
+ RoleDetails,
198
+ RoleUsersList,
199
+ RolesList,
2463
200
  TabsContainer,
2464
201
  UserAvatar,
202
+ UserAvatarEditor,
203
+ UserContainer,
204
+ UserDeleter,
205
+ UserDetails,
206
+ UserEditor,
207
+ UserIndexContainer,
208
+ UserIndexDetails,
209
+ UserListInAdd,
210
+ UserMultiSelect,
211
+ UserReactivator,
212
+ UserResentInvitationEmail,
213
+ UserRoleAdd,
214
+ UserRolesList,
215
+ UserSelector,
216
+ UsersList,
217
+ UsersListByContentIds,
218
+ UsersListContainer,
2465
219
  cellComponent,
2466
220
  cellDate,
2467
221
  cellId,
2468
222
  cellLink,
2469
223
  cellUrl,
2470
224
  errorToast,
225
+ generateNotificationData,
2471
226
  triggerAssociationToast,
2472
227
  useFileUpload
2473
228
  };