react-luminus-components 1.3.87 → 1.3.89

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 (384) hide show
  1. package/package.json +2 -1
  2. package/dist/.vite/manifest.json +0 -183
  3. package/dist/FullScreenContainer-Ce-nK_6a.js +0 -27
  4. package/dist/FullScreenContainer-ST-Zqpvr.cjs +0 -1
  5. package/dist/Loading-CiGaVvoO.js +0 -17
  6. package/dist/Loading-DiAp8L6X.cjs +0 -1
  7. package/dist/SimpleTooltip-Bi03GT58.js +0 -5
  8. package/dist/SimpleTooltip-CsQYpO-x.cjs +0 -1
  9. package/dist/components/BnfTableValueFormats/UserAvatarValueFormat/UserAvatarValueFormat.d.ts +0 -4
  10. package/dist/components/BnfTableValueFormats/index.d.ts +0 -1
  11. package/dist/components/Buttons/ContextButton/ContextButton.d.ts +0 -13
  12. package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +0 -11
  13. package/dist/components/Buttons/FileUploadButton/FileUploadButton.d.ts +0 -11
  14. package/dist/components/Buttons/FloatingSubmit/FloatingFormSubmit.d.ts +0 -9
  15. package/dist/components/Buttons/IconButton/IconButton.d.ts +0 -12
  16. package/dist/components/Buttons/PrimaryButton/PrimaryButton.d.ts +0 -13
  17. package/dist/components/Buttons/index.d.ts +0 -6
  18. package/dist/components/Documents/Documents.d.ts +0 -10
  19. package/dist/components/Documents/components/DocumentDirectory/DocumentDirectory.d.ts +0 -5
  20. package/dist/components/Documents/components/DocumentDirectory/components/DocumentDirectoryLabel/DocumentDirectoryLabel.d.ts +0 -7
  21. package/dist/components/Documents/components/DocumentDirectory/components/index.d.ts +0 -1
  22. package/dist/components/Documents/components/DocumentsActions/DocumentsActions.d.ts +0 -7
  23. package/dist/components/Documents/components/DocumentsActions/components/DocActionButton/DocActionButton.d.ts +0 -10
  24. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/DocumentsUpload.d.ts +0 -10
  25. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/UploadFilesModal/UploadFilesModal.d.ts +0 -7
  26. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/UploadFilesModal/hooks/useUploadFilesFormSchema.d.ts +0 -18
  27. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/index.d.ts +0 -1
  28. package/dist/components/Documents/components/DocumentsActions/components/index.d.ts +0 -2
  29. package/dist/components/Documents/components/DocumentsFilesTable/DocumentsFilesTable.d.ts +0 -6
  30. package/dist/components/Documents/components/DocumentsFilesTable/hooks/useDocumentsFilesColumns.d.ts +0 -11
  31. package/dist/components/Documents/components/DocumentsModals/DocumentsModals.d.ts +0 -2
  32. package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/CreateFolderModal.d.ts +0 -5
  33. package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/hooks/useDocCreateFolderForm.d.ts +0 -13
  34. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/EditFileModal.d.ts +0 -5
  35. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/EditFileModalInner.d.ts +0 -8
  36. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/hooks/useEditFileForm.d.ts +0 -18
  37. package/dist/components/Documents/components/DocumentsModals/components/index.d.ts +0 -2
  38. package/dist/components/Documents/components/DocumentsModals/types/DocumentsModalType.d.ts +0 -2
  39. package/dist/components/Documents/components/DocumentsRoot/DocumentsRoot.d.ts +0 -5
  40. package/dist/components/Documents/components/FileExtensionIcon/FileExtensionIcon.d.ts +0 -7
  41. package/dist/components/Documents/components/index.d.ts +0 -6
  42. package/dist/components/Documents/contexts/DocumentsContext.d.ts +0 -13
  43. package/dist/components/Documents/hooks/useDocContextApiActions.d.ts +0 -17
  44. package/dist/components/Documents/hooks/useDocumentsApiActions.d.ts +0 -7
  45. package/dist/components/Documents/hooks/useDocumentsDrag.d.ts +0 -19
  46. package/dist/components/Documents/hooks/useDocumentsReducer.d.ts +0 -91
  47. package/dist/components/Documents/index.d.ts +0 -2
  48. package/dist/components/Documents/types/ui/DocumentFile.d.ts +0 -6
  49. package/dist/components/Documents/types/ui/DocumentFolder.d.ts +0 -10
  50. package/dist/components/Documents/types/ui/DocumentState.d.ts +0 -2
  51. package/dist/components/Documents/types/ui/DocumentsActionsObj.d.ts +0 -14
  52. package/dist/components/Documents/types/ui/DocumentsFolderId.d.ts +0 -2
  53. package/dist/components/Documents/types/ui/FileDirType.d.ts +0 -2
  54. package/dist/components/Documents/utils/documentsConstants.d.ts +0 -1
  55. package/dist/components/Documents/utils/documentsDataUtils.d.ts +0 -12
  56. package/dist/components/Documents/utils/documentsTypeUtils.d.ts +0 -4
  57. package/dist/components/Documents/utils/documentsUtils.d.ts +0 -7
  58. package/dist/components/Dropdown/Dropdown.d.ts +0 -8
  59. package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +0 -7
  60. package/dist/components/Dropdown/comps/DropdownItem/DropdownItem.d.ts +0 -10
  61. package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +0 -11
  62. package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +0 -7
  63. package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +0 -11
  64. package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +0 -9
  65. package/dist/components/Dropdown/comps/index.d.ts +0 -6
  66. package/dist/components/Dropdown/index.d.ts +0 -2
  67. package/dist/components/Flexmonster/Flexmonster.d.ts +0 -15
  68. package/dist/components/Flexmonster/ReportPage.d.ts +0 -16
  69. package/dist/components/Flexmonster/components/ReportSharingModal/ReportSharingModal.d.ts +0 -12
  70. package/dist/components/Flexmonster/components/ReportSharingModal/hooks/useReportSharingApi.d.ts +0 -6
  71. package/dist/components/Flexmonster/components/index.d.ts +0 -1
  72. package/dist/components/Flexmonster/hooks/useReportMappings.d.ts +0 -4
  73. package/dist/components/Flexmonster/hooks/useReportVersionApi.d.ts +0 -10
  74. package/dist/components/Flexmonster/index.d.ts +0 -2
  75. package/dist/components/Flexmonster/types/api/ReportModel.d.ts +0 -7
  76. package/dist/components/Flexmonster/types/api/ReportRestrictItem.d.ts +0 -4
  77. package/dist/components/Flexmonster/types/api/ReportRestrictModel.d.ts +0 -6
  78. package/dist/components/Flexmonster/types/api/ReportVersionModel.d.ts +0 -15
  79. package/dist/components/Flexmonster/types/api/ReportVersionUserModel.d.ts +0 -7
  80. package/dist/components/Flexmonster/types/ui/ReportSettings.d.ts +0 -5
  81. package/dist/components/Flexmonster/utils/flexMonsterUtils.d.ts +0 -12
  82. package/dist/components/Form/CheckInput/CheckInput.d.ts +0 -4
  83. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +0 -4
  84. package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +0 -4
  85. package/dist/components/Form/NumericTextInput/NumericTextInput.d.ts +0 -4
  86. package/dist/components/Form/SelectInput/SelectInput.d.ts +0 -4
  87. package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +0 -4
  88. package/dist/components/Form/TextInput/TextInput.d.ts +0 -4
  89. package/dist/components/Form/index.d.ts +0 -7
  90. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +0 -4
  91. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +0 -4
  92. package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +0 -5
  93. package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +0 -4
  94. package/dist/components/HookForm/FloatingSubmit/HookFormFloatingSubmit.d.ts +0 -9
  95. package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +0 -4
  96. package/dist/components/HookForm/NumericTextInput/HookFormNumericTextInput.d.ts +0 -4
  97. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +0 -4
  98. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +0 -4
  99. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +0 -4
  100. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +0 -4
  101. package/dist/components/HookForm/index.d.ts +0 -11
  102. package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +0 -33
  103. package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +0 -9
  104. package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +0 -33
  105. package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +0 -33
  106. package/dist/components/InputContainers/index.d.ts +0 -4
  107. package/dist/components/Layout/MessageBoard/MessageBoard.d.ts +0 -15
  108. package/dist/components/Layout/MessageBoard/components/MessageList/MessageList.d.ts +0 -12
  109. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageFilters/MessageFilters.d.ts +0 -7
  110. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageItem/MessageItem.d.ts +0 -11
  111. package/dist/components/Layout/MessageBoard/components/MessageList/comps/index.d.ts +0 -2
  112. package/dist/components/Layout/MessageBoard/components/index.d.ts +0 -1
  113. package/dist/components/Layout/index.d.ts +0 -1
  114. package/dist/components/NewTabs/Tab/Tab.d.ts +0 -12
  115. package/dist/components/NewTabs/TabPanel/TabPanel.d.ts +0 -10
  116. package/dist/components/NewTabs/Tabs/Tabs.d.ts +0 -13
  117. package/dist/components/NewTabs/index.d.ts +0 -3
  118. package/dist/components/ResponsiveContextDropdown/ResponsiveContextDropdown.d.ts +0 -13
  119. package/dist/components/ResponsiveContextDropdown/components/ResponsiveContextDropdownItem/ResponsiveContextDropdownItem.d.ts +0 -22
  120. package/dist/components/ResponsiveContextDropdown/components/index.d.ts +0 -1
  121. package/dist/components/ResponsiveContextDropdown/index.d.ts +0 -2
  122. package/dist/components/ResponsiveContextDropdown/utils/responsiveContextDropdownUtils.d.ts +0 -5
  123. package/dist/components/Tabs/Tabs.d.ts +0 -9
  124. package/dist/components/Tabs/comps/Tab/Tab.d.ts +0 -7
  125. package/dist/components/Tabs/comps/index.d.ts +0 -1
  126. package/dist/components/Tabs/index.d.ts +0 -2
  127. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +0 -25
  128. package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +0 -9
  129. package/dist/components/Tooltip/index.d.ts +0 -2
  130. package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +0 -7
  131. package/dist/components/UserAvatar/index.d.ts +0 -1
  132. package/dist/components/common/Alert/Alert.d.ts +0 -8
  133. package/dist/components/common/AlertItem/AlertItem.d.ts +0 -8
  134. package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +0 -9
  135. package/dist/components/common/AppSearch/AppSearch.d.ts +0 -9
  136. package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +0 -12
  137. package/dist/components/common/AppSearch/comps/TypeSelector/TypeSelector.d.ts +0 -10
  138. package/dist/components/common/AppSearch/comps/index.d.ts +0 -2
  139. package/dist/components/common/AppSearch/hooks/useSearchItems.d.ts +0 -7
  140. package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +0 -7
  141. package/dist/components/common/Backdrop/Backdrop.d.ts +0 -6
  142. package/dist/components/common/Badge/Badge.d.ts +0 -9
  143. package/dist/components/common/Card/Card.d.ts +0 -28
  144. package/dist/components/common/Collapse/Collapse.d.ts +0 -19
  145. package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +0 -2
  146. package/dist/components/common/DisabledRowLabelLink/DisabledRowLabelLink.d.ts +0 -9
  147. package/dist/components/common/DynamicForm/DynamicForm.d.ts +0 -24
  148. package/dist/components/common/DynamicForm/comps/DynamicFormErrors/DynamicFormErrors.d.ts +0 -9
  149. package/dist/components/common/DynamicForm/comps/DynamicFormMasterPicker/DynamicFormMasterPicker.d.ts +0 -10
  150. package/dist/components/common/DynamicForm/comps/DynamicFormTable/DynamicFormTable.d.ts +0 -17
  151. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/DynamicFormCreateTableRow/DynamicFormCreateTableRow.d.ts +0 -9
  152. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/DynamicFormTableRow/DynamicFormTableRow.d.ts +0 -11
  153. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/comps/DynamicFormInput/DynamicFormInput.d.ts +0 -17
  154. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/comps/index.d.ts +0 -1
  155. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/index.d.ts +0 -2
  156. package/dist/components/common/DynamicForm/comps/index.d.ts +0 -3
  157. package/dist/components/common/DynamicForm/utils/itemTransformers.d.ts +0 -4
  158. package/dist/components/common/EmployeeSmallPhoto/EmployeeSmallPhoto.d.ts +0 -9
  159. package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +0 -10
  160. package/dist/components/common/FloatingActionContainer/FloatingActionContainer.d.ts +0 -6
  161. package/dist/components/common/FromToDatePicker/FromToDatePicker.d.ts +0 -11
  162. package/dist/components/common/FromToDatePicker/components/FromToDatePickerDropdownToggle/FromToDatePickerDropdownToggle.d.ts +0 -8
  163. package/dist/components/common/FromToDatePicker/components/index.d.ts +0 -1
  164. package/dist/components/common/FromToDatePicker/constants/TimeRanges.d.ts +0 -3
  165. package/dist/components/common/FromToDatePicker/hooks/useFromToDatePicker.d.ts +0 -10
  166. package/dist/components/common/FromToDatePicker/utils/utilsFromToDatePicker.d.ts +0 -11
  167. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +0 -10
  168. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +0 -9
  169. package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +0 -11
  170. package/dist/components/common/HomeDashboard/comps/index.d.ts +0 -1
  171. package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +0 -7
  172. package/dist/components/common/ImgApi/ImgApi.d.ts +0 -4
  173. package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +0 -9
  174. package/dist/components/common/ImgDirect/ImgDirect.d.ts +0 -4
  175. package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +0 -5
  176. package/dist/components/common/LanguageSwitch/LanguageSwitch.d.ts +0 -2
  177. package/dist/components/common/Loading/Loading.d.ts +0 -2
  178. package/dist/components/common/Loading/LoadingBlock.d.ts +0 -5
  179. package/dist/components/common/MonthPicker/MonthPicker.d.ts +0 -11
  180. package/dist/components/common/MonthPickerSearchParams/MonthPickerSearchParams.d.ts +0 -8
  181. package/dist/components/common/NumericFormat/NumericFormat.d.ts +0 -9
  182. package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +0 -14
  183. package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +0 -18
  184. package/dist/components/common/PieChart/PieChart.d.ts +0 -12
  185. package/dist/components/common/PromptDialog/PromptDialog.d.ts +0 -2
  186. package/dist/components/common/SearchBox/SearchBox.d.ts +0 -8
  187. package/dist/components/common/SettingsFormPicker/SettingsFormPicker.d.ts +0 -19
  188. package/dist/components/common/SimplePicker/SimplePicker.d.ts +0 -26
  189. package/dist/components/common/Timeline/Timeline.d.ts +0 -7
  190. package/dist/components/common/TypedFormGroup/TypedFormGroup.d.ts +0 -9
  191. package/dist/components/common/Typography/Typography.d.ts +0 -8
  192. package/dist/components/common/VersionInfo/VersionInfo.d.ts +0 -5
  193. package/dist/components/common/Widget/WidgetCard.d.ts +0 -9
  194. package/dist/components/common/Widget/WidgetWrapper.d.ts +0 -8
  195. package/dist/components/common/YearPicker/YearPicker.d.ts +0 -9
  196. package/dist/components/common/YearPickerSearchParams/YearPickerSearchParams.d.ts +0 -9
  197. package/dist/components/common/index.d.ts +0 -40
  198. package/dist/contexts/auth/AuthContext.d.ts +0 -9
  199. package/dist/contexts/auth/AuthProvider.d.ts +0 -16
  200. package/dist/contexts/confirm/ConfirmContext.d.ts +0 -8
  201. package/dist/contexts/confirm/ConfirmProvider.d.ts +0 -5
  202. package/dist/contexts/delegation/DelegationContext.d.ts +0 -24
  203. package/dist/contexts/delegation/DelegationProvider.d.ts +0 -6
  204. package/dist/contexts/index.d.ts +0 -12
  205. package/dist/contexts/loading/LoadingContext.d.ts +0 -7
  206. package/dist/contexts/loading/LoadingProvider.d.ts +0 -5
  207. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +0 -22
  208. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +0 -18
  209. package/dist/contexts/prompt/PromptContext.d.ts +0 -13
  210. package/dist/contexts/prompt/PromptProvider.d.ts +0 -7
  211. package/dist/contexts/user/UserContext.d.ts +0 -11
  212. package/dist/contexts/user/UserProvider.d.ts +0 -5
  213. package/dist/contexts.cjs.js +0 -1
  214. package/dist/contexts.d.ts +0 -1
  215. package/dist/contexts.es.js +0 -280
  216. package/dist/hooks/index.d.ts +0 -17
  217. package/dist/hooks/useAuth/hooks/useDevAuth.d.ts +0 -7
  218. package/dist/hooks/useAuth/hooks/useMsalAuth.d.ts +0 -8
  219. package/dist/hooks/useAuth/useAuth.d.ts +0 -8
  220. package/dist/hooks/useAxios/useAxios.d.ts +0 -12
  221. package/dist/hooks/useClickOutside/useClickOutside.d.ts +0 -4
  222. package/dist/hooks/useClipboard/useClipboard.d.ts +0 -4
  223. package/dist/hooks/useConfirm/useConfirm.d.ts +0 -8
  224. package/dist/hooks/useEmployeePhotoPath/useEmployeePhotoPath.d.ts +0 -5
  225. package/dist/hooks/useFormControlType/useFormControlType.d.ts +0 -2
  226. package/dist/hooks/useGetApiData/useGetApiData.d.ts +0 -9
  227. package/dist/hooks/useGetDataBound/useGetDataBound.d.ts +0 -4
  228. package/dist/hooks/useKeyPress/useKeyPress.d.ts +0 -2
  229. package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +0 -2
  230. package/dist/hooks/useNotifications/useNotifications.d.ts +0 -4
  231. package/dist/hooks/usePermissions/usePermissions.d.ts +0 -4
  232. package/dist/hooks/usePrompt/usePrompt.d.ts +0 -9
  233. package/dist/hooks/useSearchQuery/useSearchQuery.d.ts +0 -5
  234. package/dist/hooks/useSearchQueryState/useSearchQueryState.d.ts +0 -15
  235. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +0 -75
  236. package/dist/hooks.cjs.js +0 -1
  237. package/dist/hooks.d.ts +0 -1
  238. package/dist/hooks.es.js +0 -60
  239. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +0 -4
  240. package/dist/layout/MainContainer/MainContainer.d.ts +0 -4
  241. package/dist/layout/PageTitle/PageTitle.d.ts +0 -7
  242. package/dist/layout/SideContentBar/SideContentBar.d.ts +0 -8
  243. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +0 -11
  244. package/dist/layout/SideMenu/SideMenu.d.ts +0 -12
  245. package/dist/layout/TopBar/TopBar.d.ts +0 -8
  246. package/dist/layout/index.d.ts +0 -5
  247. package/dist/layout.cjs.js +0 -1
  248. package/dist/layout.d.ts +0 -1
  249. package/dist/layout.es.js +0 -124
  250. package/dist/main.cjs.js +0 -9
  251. package/dist/main.d.ts +0 -48
  252. package/dist/main.es.js +0 -3956
  253. package/dist/models/api/documents/DocType.d.ts +0 -6
  254. package/dist/models/api/documents/DocumentFileModel.d.ts +0 -18
  255. package/dist/models/api/documents/DocumentFolderModel.d.ts +0 -9
  256. package/dist/models/api/documents/DocumentListModel.d.ts +0 -8
  257. package/dist/models/api/documents/DocumentUploadModel.d.ts +0 -6
  258. package/dist/models/api/documents/DocumentsCreateFolderModel.d.ts +0 -8
  259. package/dist/models/index.d.ts +0 -83
  260. package/dist/models/luminus-context-types/CommonLuminusIcons.d.ts +0 -2
  261. package/dist/models/luminus-context-types/ILocalizationContext.d.ts +0 -8
  262. package/dist/models/prop-types/ContainerProps.d.ts +0 -11
  263. package/dist/models/prop-types/DashboardWidgetCommonProps.d.ts +0 -6
  264. package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +0 -8
  265. package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +0 -12
  266. package/dist/models/prop-types/FormInputProps/FormNumericStepperInputProps.d.ts +0 -9
  267. package/dist/models/prop-types/FormInputProps/FormNumericTextInputProps.d.ts +0 -8
  268. package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +0 -7
  269. package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +0 -8
  270. package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +0 -8
  271. package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +0 -8
  272. package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +0 -5
  273. package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +0 -5
  274. package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +0 -5
  275. package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +0 -8
  276. package/dist/models/prop-types/HookFormInputProps/HookFormInputProps.d.ts +0 -10
  277. package/dist/models/prop-types/HookFormInputProps/HookFormNumericStepperInputProps.d.ts +0 -5
  278. package/dist/models/prop-types/HookFormInputProps/HookFormNumericTextInputProps.d.ts +0 -5
  279. package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +0 -5
  280. package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +0 -5
  281. package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +0 -8
  282. package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +0 -5
  283. package/dist/models/prop-types/ImgProps.d.ts +0 -8
  284. package/dist/models/prop-types/InputContainerProps.d.ts +0 -25
  285. package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +0 -6
  286. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +0 -24
  287. package/dist/models/prop-types/InputProps/FileInputProps.d.ts +0 -7
  288. package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +0 -16
  289. package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +0 -14
  290. package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +0 -7
  291. package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +0 -10
  292. package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +0 -6
  293. package/dist/models/prop-types/InputProps/TextInputProps.d.ts +0 -10
  294. package/dist/models/texts/AppSearchTexts.d.ts +0 -5
  295. package/dist/models/texts/AxiosTexts.d.ts +0 -8
  296. package/dist/models/texts/ClipboardTexts.d.ts +0 -5
  297. package/dist/models/texts/ComponentsContextTexts.d.ts +0 -34
  298. package/dist/models/texts/ConfirmTexts.d.ts +0 -7
  299. package/dist/models/texts/CustomSelectTexts.d.ts +0 -5
  300. package/dist/models/texts/DateTexts.d.ts +0 -8
  301. package/dist/models/texts/DocumentsTexts.d.ts +0 -45
  302. package/dist/models/texts/DropdownPickerTexts.d.ts +0 -5
  303. package/dist/models/texts/DynamicFormsTexts.d.ts +0 -13
  304. package/dist/models/texts/ErrorBoundaryTexts.d.ts +0 -6
  305. package/dist/models/texts/FormSubmitTexts.d.ts +0 -4
  306. package/dist/models/texts/FormValidationTexts.d.ts +0 -7
  307. package/dist/models/texts/HomeDashboardTexts.d.ts +0 -6
  308. package/dist/models/texts/MessageBoardTexts.d.ts +0 -4
  309. package/dist/models/texts/ReportsTexts.d.ts +0 -30
  310. package/dist/models/texts/WidgetTexts.d.ts +0 -4
  311. package/dist/models/types/ApiErrorResult.d.ts +0 -9
  312. package/dist/models/types/BaseMessageBoardModel.d.ts +0 -8
  313. package/dist/models/types/DashboardConfig.d.ts +0 -6
  314. package/dist/models/types/DashboardWidget.d.ts +0 -10
  315. package/dist/models/types/DashboardWidgetConfig.d.ts +0 -5
  316. package/dist/models/types/DropdownPickerOption.d.ts +0 -8
  317. package/dist/models/types/EmployeeIndexModel.d.ts +0 -14
  318. package/dist/models/types/ErrorField.d.ts +0 -5
  319. package/dist/models/types/FormSelectOption.d.ts +0 -5
  320. package/dist/models/types/FromTo.d.ts +0 -5
  321. package/dist/models/types/HookFormInputProps.d.ts +0 -10
  322. package/dist/models/types/LoginState.d.ts +0 -7
  323. package/dist/models/types/MenuItemType.d.ts +0 -10
  324. package/dist/models/types/MenuItemTypeExtended.d.ts +0 -7
  325. package/dist/models/types/NameIdIntModel.d.ts +0 -5
  326. package/dist/models/types/NameIdIntOptionalModel.d.ts +0 -5
  327. package/dist/models/types/NameIdStringModel.d.ts +0 -5
  328. package/dist/models/types/NameIdStringOptionalModel.d.ts +0 -5
  329. package/dist/models/types/PhotoAction.d.ts +0 -8
  330. package/dist/models/types/PhotoLibraryItemModel.d.ts +0 -7
  331. package/dist/models/types/PromptOptions.d.ts +0 -7
  332. package/dist/models/types/SaveFileFromResponseOptions.d.ts +0 -6
  333. package/dist/models/types/SearchResultGroupKeyModel.d.ts +0 -6
  334. package/dist/models/types/SearchResultGroupModel.d.ts +0 -8
  335. package/dist/models/types/SearchResultModel.d.ts +0 -9
  336. package/dist/models/types/SearchType.d.ts +0 -6
  337. package/dist/models/types/TimelineStep.d.ts +0 -11
  338. package/dist/models/types/TimelineStepState.d.ts +0 -5
  339. package/dist/models/types/ToLiteral.d.ts +0 -5
  340. package/dist/models/types/UseGetApiDataOptions.d.ts +0 -11
  341. package/dist/models/types/UseGetDataBoundOptions.d.ts +0 -5
  342. package/dist/models/types/UserLoginState.d.ts +0 -8
  343. package/dist/models/types/UserModel.d.ts +0 -12
  344. package/dist/models/types/common/NullsOptional.d.ts +0 -12
  345. package/dist/models/types/common/RequireAtLeastOne.d.ts +0 -4
  346. package/dist/models/types/common/SharedProperties.d.ts +0 -33
  347. package/dist/models/types/dynamicForms/formPickerTypes/SettingsFormGroup.d.ts +0 -8
  348. package/dist/models/types/dynamicForms/formPickerTypes/SettingsFormItem.d.ts +0 -8
  349. package/dist/models/types/dynamicForms/index.d.ts +0 -8
  350. package/dist/models/types/dynamicForms/types/DynamicFormColumnDef.d.ts +0 -12
  351. package/dist/models/types/dynamicForms/types/DynamicFormColumnSchemaModel.d.ts +0 -13
  352. package/dist/models/types/dynamicForms/types/DynamicFormColumnValueSchemaModel.d.ts +0 -5
  353. package/dist/models/types/dynamicForms/types/DynamicFormFilters.d.ts +0 -4
  354. package/dist/models/types/dynamicForms/types/DynamicFormIndexModel.d.ts +0 -7
  355. package/dist/models/types/dynamicForms/types/DynamicFormSchemaModel.d.ts +0 -16
  356. package/dist/models/types/dynamicForms/types/DynamicFormValueTypes.d.ts +0 -12
  357. package/dist/nivo-pie.es-DcNHbK3t.js +0 -22244
  358. package/dist/nivo-pie.es-plr8yBAX.cjs +0 -279
  359. package/dist/searchUtils-CjdE19He.cjs +0 -1
  360. package/dist/searchUtils-TyScKjjN.js +0 -14
  361. package/dist/style.css +0 -1
  362. package/dist/useClipboard-9hyuQ25B.cjs +0 -1
  363. package/dist/useClipboard-BaVnqM5C.js +0 -70
  364. package/dist/useGetApiData-BgW3pCEg.js +0 -52
  365. package/dist/useGetApiData-D79g-CfI.cjs +0 -1
  366. package/dist/useLocalStorageState-BFc8Gc8H.cjs +0 -1
  367. package/dist/useLocalStorageState-Bt99kkCr.js +0 -17
  368. package/dist/usePermissions-B2wkyp2u.cjs +0 -1
  369. package/dist/usePermissions-Ds6FiFo2.js +0 -20
  370. package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +0 -5
  371. package/dist/utils/bnfValueFormat/bnfValueFormat.d.ts +0 -7
  372. package/dist/utils/color/colorUtils.d.ts +0 -2
  373. package/dist/utils/date/dateUtils.d.ts +0 -47
  374. package/dist/utils/file/fileUtils.d.ts +0 -9
  375. package/dist/utils/hookForm/hookFormUtils.d.ts +0 -4
  376. package/dist/utils/index.d.ts +0 -11
  377. package/dist/utils/number/numberUtils.d.ts +0 -1
  378. package/dist/utils/object/objectUtils.d.ts +0 -6
  379. package/dist/utils/search/searchUtils.d.ts +0 -5
  380. package/dist/utils/text/string.d.ts +0 -18
  381. package/dist/utils/text/textUtils.d.ts +0 -11
  382. package/dist/utils.cjs.js +0 -1
  383. package/dist/utils.d.ts +0 -1
  384. package/dist/utils.es.js +0 -83
package/dist/main.es.js DELETED
@@ -1,3956 +0,0 @@
1
- import { j as r, c as w, t as ve, a as pt, s as _n, g as Nn, m as ya, d as _t, b as ba, e as wa, f as Le, h as _a, i as Na, k as Ca, l as Sa, n as ka, o as Ia, p as Da, T as sr, q as or, r as Cn, E as $a, u as ir, v as an, w as lr, x as Fa, y as ue, z as $t, A as Oa, B as cr, C as Ft, D as Ea, F as Qt, G as dr, H as Ta, S as Zt, N as ur, I as sn, J as on, K as La, L as Ra, M as Aa, O as Ma, P as Va, Q as fr, R as Ba, U as Pa, V as Ha, W as Wa, X as za, Y as Ua, Z as Ga, _ as Ya, $ as Jt, a0 as Ka, a1 as Mt, a2 as Z, a3 as ge, a4 as Xt, a5 as qa, a6 as Qa, a7 as Za, a8 as mr, a9 as xt, aa as ne, ab as ln, ac as ye, ad as cn, ae as Je, af as Ja, ag as Oe, ah as hr, ai as gr, aj as pr, ak as Xe, al as Pe, am as Xa, an as es, ao as ts, ap as ns, aq as Ot, ar as et, as as Et, at as Tt, au as xr, av as Ve, aw as rs, ax as ot, ay as as, az as ss, aA as dn, aB as un, aC as vr, aD as Qe, aE as jr, aF as vt, aG as os, aH as yr, aI as is, aJ as br, aK as ls, aL as cs, aM as ds, aN as St, aO as wr, aP as us, aQ as fs, aR as ms, aS as hs, aT as gs, aU as Be, aV as ps, aW as xs, aX as Fe, aY as vs, aZ as js, a_ as Vt, a$ as Sn, b0 as ys } from "./nivo-pie.es-DcNHbK3t.js";
2
- import { b4 as Bd, b5 as Pd, b2 as Hd, b1 as Wd, b6 as zd, b7 as Ud, b3 as Gd } from "./nivo-pie.es-DcNHbK3t.js";
3
- import * as se from "react";
4
- import Ce, { useCallback as S, useMemo as te, useContext as Q, useRef as ee, useEffect as A, useState as E, useId as bs, useLayoutEffect as ws, Component as _s, isValidElement as Ns, Suspense as Cs, useReducer as Ss } from "react";
5
- import { c as Re, L as kn } from "./Loading-CiGaVvoO.js";
6
- import { InteractionType as ks } from "@azure/msal-browser";
7
- import { MsalAuthenticationTemplate as Is } from "@azure/msal-react";
8
- import { Link as Ze, useNavigate as Ds, useParams as $s, generatePath as kt, Navigate as wt } from "react-router-dom";
9
- import { useFormContext as He, Controller as fn } from "react-hook-form";
10
- import { Pivot as Fs } from "react-flexmonster";
11
- import { S as mn } from "./SimpleTooltip-Bi03GT58.js";
12
- import { u as Os, a as _r, b as Nr, c as Es, d as Ts, e as Ls } from "./useClipboard-BaVnqM5C.js";
13
- import It from "react-dom";
14
- import { l as ht, s as en } from "./searchUtils-TyScKjjN.js";
15
- import { u as Rs } from "./useGetApiData-BgW3pCEg.js";
16
- import { F as As } from "./FullScreenContainer-Ce-nK_6a.js";
17
- const Zc = ({ fileLoader: e, fileName: t, children: n }) => {
18
- const a = S(async () => {
19
- var c, l;
20
- const s = await e();
21
- if (!s)
22
- return;
23
- const o = window.URL.createObjectURL(new Blob([s])), i = document.createElement("a");
24
- i.href = o, i.setAttribute("download", t), (c = document.body) == null || c.appendChild(i), i.click(), (l = document.body) == null || l.removeChild(i);
25
- }, [e, t]);
26
- return /* @__PURE__ */ r.jsx("div", { role: "button", onClick: a, children: n });
27
- }, Ms = ({ className: e, ...t }) => /* @__PURE__ */ r.jsxs("div", { className: w("luminus-loading", Re.loading, Re.loadingBlock, Re.loadingBlock), ...t, children: [
28
- /* @__PURE__ */ r.jsx("div", { className: w("spinner-grow", Re.spinnerGrow, "text-primary"), role: "status" }),
29
- /* @__PURE__ */ r.jsx("div", { className: w("spinner-grow", Re.spinnerGrow, "text-primary", Re.second), role: "status" }),
30
- /* @__PURE__ */ r.jsx("div", { className: w("spinner-grow", Re.spinnerGrow, "text-primary", Re.third), role: "status" })
31
- ] });
32
- function Cr(e, t) {
33
- const n = ve(e);
34
- if (isNaN(t)) return pt(e, NaN);
35
- if (!t)
36
- return n;
37
- const a = n.getDate(), s = pt(e, n.getTime());
38
- s.setMonth(n.getMonth() + t + 1, 0);
39
- const o = s.getDate();
40
- return a >= o ? s : (n.setFullYear(
41
- s.getFullYear(),
42
- s.getMonth(),
43
- a
44
- ), n);
45
- }
46
- function Vs(e, t) {
47
- return Cr(e, t * 12);
48
- }
49
- function Bs(e, t) {
50
- const n = ve(e), a = ve(t), s = n.getTime() - a.getTime();
51
- return s < 0 ? -1 : s > 0 ? 1 : s;
52
- }
53
- function In(e, t) {
54
- const n = ve(e), a = ve(t), s = n.getFullYear() - a.getFullYear(), o = n.getMonth() - a.getMonth();
55
- return s * 12 + o;
56
- }
57
- function Dn(e) {
58
- const t = ve(e);
59
- return Math.trunc(t.getMonth() / 3) + 1;
60
- }
61
- function Bt(e, t) {
62
- const n = ve(e), a = ve(t), s = n.getFullYear() - a.getFullYear(), o = Dn(n) - Dn(a);
63
- return s * 4 + o;
64
- }
65
- function $n(e, t, n) {
66
- const a = _n(e, n), s = _n(t, n), o = +a - Nn(a), i = +s - Nn(s);
67
- return Math.round((o - i) / ya);
68
- }
69
- function Pt(e, t) {
70
- const n = ve(e), a = ve(t);
71
- return n.getFullYear() - a.getFullYear();
72
- }
73
- function Ps(e, t) {
74
- const n = ve(e), a = ve(t), s = Fn(n, a), o = Math.abs(_t(n, a));
75
- n.setDate(n.getDate() - s * o);
76
- const i = +(Fn(n, a) === -s), c = s * (o - i);
77
- return c === 0 ? 0 : c;
78
- }
79
- function Fn(e, t) {
80
- const n = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
81
- return n < 0 ? -1 : n > 0 ? 1 : n;
82
- }
83
- function hn(e) {
84
- return (t) => {
85
- const a = (e ? Math[e] : Math.trunc)(t);
86
- return a === 0 ? 0 : a;
87
- };
88
- }
89
- function gn(e, t) {
90
- return +ve(e) - +ve(t);
91
- }
92
- function On(e, t, n) {
93
- const a = gn(e, t) / ba;
94
- return hn(n == null ? void 0 : n.roundingMethod)(a);
95
- }
96
- function En(e, t, n) {
97
- const a = gn(e, t) / wa;
98
- return hn(n == null ? void 0 : n.roundingMethod)(a);
99
- }
100
- function Ht(e, t, n) {
101
- const a = gn(e, t) / 1e3;
102
- return hn(n == null ? void 0 : n.roundingMethod)(a);
103
- }
104
- function tn(e, t) {
105
- const n = ve(e);
106
- if (isNaN(n.getTime()))
107
- throw new RangeError("Invalid time value");
108
- const a = (t == null ? void 0 : t.format) ?? "extended", s = (t == null ? void 0 : t.representation) ?? "complete";
109
- let o = "", i = "";
110
- const c = a === "extended" ? "-" : "", l = a === "extended" ? ":" : "";
111
- if (s !== "time") {
112
- const u = Le(n.getDate(), 2), d = Le(n.getMonth() + 1, 2);
113
- o = `${Le(n.getFullYear(), 4)}${c}${d}${c}${u}`;
114
- }
115
- if (s !== "date") {
116
- const u = n.getTimezoneOffset();
117
- if (u !== 0) {
118
- const p = Math.abs(u), g = Le(Math.trunc(p / 60), 2), j = Le(p % 60, 2);
119
- i = `${u < 0 ? "+" : "-"}${g}:${j}`;
120
- } else
121
- i = "Z";
122
- const d = Le(n.getHours(), 2), m = Le(n.getMinutes(), 2), x = Le(n.getSeconds(), 2), v = o === "" ? "" : "T", h = [d, m, x].join(l);
123
- o = `${o}${v}${h}${i}`;
124
- }
125
- return o;
126
- }
127
- function Hs(e) {
128
- const t = ve(e), n = t.getFullYear(), a = t.getMonth(), s = pt(e, 0);
129
- return s.setFullYear(n, a + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
130
- }
131
- function Ws(e, t, n) {
132
- let a = 0, s;
133
- const o = ve(e), i = ve(t);
134
- if (n != null && n.unit)
135
- s = n == null ? void 0 : n.unit, s === "second" ? a = Ht(o, i) : s === "minute" ? a = En(o, i) : s === "hour" ? a = On(o, i) : s === "day" ? a = _t(o, i) : s === "week" ? a = $n(o, i) : s === "month" ? a = In(o, i) : s === "quarter" ? a = Bt(o, i) : s === "year" && (a = Pt(o, i));
136
- else {
137
- const l = Ht(o, i);
138
- Math.abs(l) < _a ? (a = Ht(o, i), s = "second") : Math.abs(l) < Na ? (a = En(o, i), s = "minute") : Math.abs(l) < Ca && Math.abs(_t(o, i)) < 1 ? (a = On(o, i), s = "hour") : Math.abs(l) < Sa && (a = _t(o, i)) && Math.abs(a) < 7 ? s = "day" : Math.abs(l) < ka ? (a = $n(o, i), s = "week") : Math.abs(l) < Ia ? (a = In(o, i), s = "month") : Math.abs(l) < Da && Bt(o, i) < 4 ? (a = Bt(o, i), s = "quarter") : (a = Pt(o, i), s = "year");
139
- }
140
- return new Intl.RelativeTimeFormat(n == null ? void 0 : n.locale, {
141
- localeMatcher: n == null ? void 0 : n.localeMatcher,
142
- numeric: (n == null ? void 0 : n.numeric) || "auto",
143
- style: n == null ? void 0 : n.style
144
- }).format(a, s);
145
- }
146
- function zs(e, t) {
147
- const n = ve(e), a = n.getFullYear(), s = n.getDate(), o = pt(e, 0);
148
- o.setFullYear(a, t, 15), o.setHours(0, 0, 0, 0);
149
- const i = Hs(o);
150
- return n.setMonth(t, Math.min(s, i)), n;
151
- }
152
- function Sr(e, t) {
153
- const n = ve(e);
154
- return isNaN(+n) ? pt(e, NaN) : (n.setFullYear(t), n);
155
- }
156
- function mt(...e) {
157
- return e.filter((t) => t != null).reduce((t, n) => {
158
- if (typeof n != "function")
159
- throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");
160
- return t === null ? n : function(...s) {
161
- t.apply(this, s), n.apply(this, s);
162
- };
163
- }, null);
164
- }
165
- const Us = {
166
- height: ["marginTop", "marginBottom"],
167
- width: ["marginLeft", "marginRight"]
168
- };
169
- function Gs(e, t) {
170
- const n = `offset${e[0].toUpperCase()}${e.slice(1)}`, a = t[n], s = Us[e];
171
- return a + // @ts-ignore
172
- parseInt(Cn(t, s[0]), 10) + // @ts-ignore
173
- parseInt(Cn(t, s[1]), 10);
174
- }
175
- const Ys = {
176
- [$a]: "collapse",
177
- [ir]: "collapsing",
178
- [an]: "collapsing",
179
- [lr]: "collapse show"
180
- }, kr = /* @__PURE__ */ Ce.forwardRef(({
181
- onEnter: e,
182
- onEntering: t,
183
- onEntered: n,
184
- onExit: a,
185
- onExiting: s,
186
- className: o,
187
- children: i,
188
- dimension: c = "height",
189
- in: l = !1,
190
- timeout: u = 300,
191
- mountOnEnter: d = !1,
192
- unmountOnExit: m = !1,
193
- appear: x = !1,
194
- getDimensionValue: v = Gs,
195
- ...h
196
- }, p) => {
197
- const g = typeof c == "function" ? c() : c, j = te(() => mt((k) => {
198
- k.style[g] = "0";
199
- }, e), [g, e]), y = te(() => mt((k) => {
200
- const I = `scroll${g[0].toUpperCase()}${g.slice(1)}`;
201
- k.style[g] = `${k[I]}px`;
202
- }, t), [g, t]), f = te(() => mt((k) => {
203
- k.style[g] = null;
204
- }, n), [g, n]), b = te(() => mt((k) => {
205
- k.style[g] = `${v(g, k)}px`, Fa(k);
206
- }, a), [a, v, g]), N = te(() => mt((k) => {
207
- k.style[g] = null;
208
- }, s), [g, s]);
209
- return /* @__PURE__ */ r.jsx(sr, {
210
- ref: p,
211
- addEndListener: or,
212
- ...h,
213
- "aria-expanded": h.role ? l : null,
214
- onEnter: j,
215
- onEntering: y,
216
- onEntered: f,
217
- onExit: b,
218
- onExiting: N,
219
- childRef: i.ref,
220
- in: l,
221
- timeout: u,
222
- mountOnEnter: d,
223
- unmountOnExit: m,
224
- appear: x,
225
- children: (k, I) => /* @__PURE__ */ Ce.cloneElement(i, {
226
- ...I,
227
- className: w(o, i.props.className, Ys[k], g === "width" && "collapse-horizontal")
228
- })
229
- });
230
- }), Ir = $t("h4");
231
- Ir.displayName = "DivStyledAsH4";
232
- const Dr = /* @__PURE__ */ se.forwardRef(({
233
- className: e,
234
- bsPrefix: t,
235
- as: n = Ir,
236
- ...a
237
- }, s) => (t = ue(t, "alert-heading"), /* @__PURE__ */ r.jsx(n, {
238
- ref: s,
239
- className: w(e, t),
240
- ...a
241
- })));
242
- Dr.displayName = "AlertHeading";
243
- const $r = /* @__PURE__ */ se.forwardRef(({
244
- className: e,
245
- bsPrefix: t,
246
- as: n = Oa,
247
- ...a
248
- }, s) => (t = ue(t, "alert-link"), /* @__PURE__ */ r.jsx(n, {
249
- ref: s,
250
- className: w(e, t),
251
- ...a
252
- })));
253
- $r.displayName = "AlertLink";
254
- const Fr = /* @__PURE__ */ se.forwardRef((e, t) => {
255
- const {
256
- bsPrefix: n,
257
- show: a = !0,
258
- closeLabel: s = "Close alert",
259
- closeVariant: o,
260
- className: i,
261
- children: c,
262
- variant: l = "primary",
263
- onClose: u,
264
- dismissible: d,
265
- transition: m = Qt,
266
- ...x
267
- } = cr(e, {
268
- show: "onClose"
269
- }), v = ue(n, "alert"), h = Ft((j) => {
270
- u && u(!1, j);
271
- }), p = m === !0 ? Qt : m, g = /* @__PURE__ */ r.jsxs("div", {
272
- role: "alert",
273
- ...p ? void 0 : x,
274
- ref: t,
275
- className: w(i, v, l && `${v}-${l}`, d && `${v}-dismissible`),
276
- children: [d && /* @__PURE__ */ r.jsx(Ea, {
277
- onClick: h,
278
- "aria-label": s,
279
- variant: o
280
- }), c]
281
- });
282
- return p ? /* @__PURE__ */ r.jsx(p, {
283
- unmountOnExit: !0,
284
- ...x,
285
- ref: void 0,
286
- in: a,
287
- children: g
288
- }) : a ? g : null;
289
- });
290
- Fr.displayName = "Alert";
291
- const Ks = Object.assign(Fr, {
292
- Link: $r,
293
- Heading: Dr
294
- }), pn = /* @__PURE__ */ se.forwardRef(({
295
- className: e,
296
- bsPrefix: t,
297
- as: n = "div",
298
- ...a
299
- }, s) => (t = ue(t, "card-body"), /* @__PURE__ */ r.jsx(n, {
300
- ref: s,
301
- className: w(e, t),
302
- ...a
303
- })));
304
- pn.displayName = "CardBody";
305
- const Or = /* @__PURE__ */ se.forwardRef(({
306
- className: e,
307
- bsPrefix: t,
308
- as: n = "div",
309
- ...a
310
- }, s) => (t = ue(t, "card-footer"), /* @__PURE__ */ r.jsx(n, {
311
- ref: s,
312
- className: w(e, t),
313
- ...a
314
- })));
315
- Or.displayName = "CardFooter";
316
- const Er = /* @__PURE__ */ se.createContext(null);
317
- Er.displayName = "CardHeaderContext";
318
- const Tr = /* @__PURE__ */ se.forwardRef(({
319
- bsPrefix: e,
320
- className: t,
321
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
322
- as: n = "div",
323
- ...a
324
- }, s) => {
325
- const o = ue(e, "card-header"), i = te(() => ({
326
- cardHeaderBsPrefix: o
327
- }), [o]);
328
- return /* @__PURE__ */ r.jsx(Er.Provider, {
329
- value: i,
330
- children: /* @__PURE__ */ r.jsx(n, {
331
- ref: s,
332
- ...a,
333
- className: w(t, o)
334
- })
335
- });
336
- });
337
- Tr.displayName = "CardHeader";
338
- const Lr = /* @__PURE__ */ se.forwardRef(
339
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
340
- ({
341
- bsPrefix: e,
342
- className: t,
343
- variant: n,
344
- as: a = "img",
345
- ...s
346
- }, o) => {
347
- const i = ue(e, "card-img");
348
- return /* @__PURE__ */ r.jsx(a, {
349
- ref: o,
350
- className: w(n ? `${i}-${n}` : i, t),
351
- ...s
352
- });
353
- }
354
- );
355
- Lr.displayName = "CardImg";
356
- const Rr = /* @__PURE__ */ se.forwardRef(({
357
- className: e,
358
- bsPrefix: t,
359
- as: n = "div",
360
- ...a
361
- }, s) => (t = ue(t, "card-img-overlay"), /* @__PURE__ */ r.jsx(n, {
362
- ref: s,
363
- className: w(e, t),
364
- ...a
365
- })));
366
- Rr.displayName = "CardImgOverlay";
367
- const Ar = /* @__PURE__ */ se.forwardRef(({
368
- className: e,
369
- bsPrefix: t,
370
- as: n = "a",
371
- ...a
372
- }, s) => (t = ue(t, "card-link"), /* @__PURE__ */ r.jsx(n, {
373
- ref: s,
374
- className: w(e, t),
375
- ...a
376
- })));
377
- Ar.displayName = "CardLink";
378
- const qs = $t("h6"), Mr = /* @__PURE__ */ se.forwardRef(({
379
- className: e,
380
- bsPrefix: t,
381
- as: n = qs,
382
- ...a
383
- }, s) => (t = ue(t, "card-subtitle"), /* @__PURE__ */ r.jsx(n, {
384
- ref: s,
385
- className: w(e, t),
386
- ...a
387
- })));
388
- Mr.displayName = "CardSubtitle";
389
- const Vr = /* @__PURE__ */ se.forwardRef(({
390
- className: e,
391
- bsPrefix: t,
392
- as: n = "p",
393
- ...a
394
- }, s) => (t = ue(t, "card-text"), /* @__PURE__ */ r.jsx(n, {
395
- ref: s,
396
- className: w(e, t),
397
- ...a
398
- })));
399
- Vr.displayName = "CardText";
400
- const Qs = $t("h5"), Br = /* @__PURE__ */ se.forwardRef(({
401
- className: e,
402
- bsPrefix: t,
403
- as: n = Qs,
404
- ...a
405
- }, s) => (t = ue(t, "card-title"), /* @__PURE__ */ r.jsx(n, {
406
- ref: s,
407
- className: w(e, t),
408
- ...a
409
- })));
410
- Br.displayName = "CardTitle";
411
- const Pr = /* @__PURE__ */ se.forwardRef(({
412
- bsPrefix: e,
413
- className: t,
414
- bg: n,
415
- text: a,
416
- border: s,
417
- body: o = !1,
418
- children: i,
419
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
420
- as: c = "div",
421
- ...l
422
- }, u) => {
423
- const d = ue(e, "card");
424
- return /* @__PURE__ */ r.jsx(c, {
425
- ref: u,
426
- ...l,
427
- className: w(t, d, n && `bg-${n}`, a && `text-${a}`, s && `border-${s}`),
428
- children: o ? /* @__PURE__ */ r.jsx(pn, {
429
- children: i
430
- }) : i
431
- });
432
- });
433
- Pr.displayName = "Card";
434
- const Tn = Object.assign(Pr, {
435
- Img: Lr,
436
- Title: Br,
437
- Subtitle: Mr,
438
- Body: pn,
439
- Link: Ar,
440
- Text: Vr,
441
- Header: Tr,
442
- Footer: Or,
443
- ImgOverlay: Rr
444
- }), Lt = /* @__PURE__ */ se.forwardRef(({
445
- className: e,
446
- bsPrefix: t,
447
- as: n = "span",
448
- ...a
449
- }, s) => (t = ue(t, "input-group-text"), /* @__PURE__ */ r.jsx(n, {
450
- ref: s,
451
- className: w(e, t),
452
- ...a
453
- })));
454
- Lt.displayName = "InputGroupText";
455
- const Zs = (e) => /* @__PURE__ */ r.jsx(Lt, {
456
- children: /* @__PURE__ */ r.jsx(dr, {
457
- type: "checkbox",
458
- ...e
459
- })
460
- }), Js = (e) => /* @__PURE__ */ r.jsx(Lt, {
461
- children: /* @__PURE__ */ r.jsx(dr, {
462
- type: "radio",
463
- ...e
464
- })
465
- }), Hr = /* @__PURE__ */ se.forwardRef(({
466
- bsPrefix: e,
467
- size: t,
468
- hasValidation: n,
469
- className: a,
470
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
471
- as: s = "div",
472
- ...o
473
- }, i) => {
474
- e = ue(e, "input-group");
475
- const c = te(() => ({}), []);
476
- return /* @__PURE__ */ r.jsx(Ta.Provider, {
477
- value: c,
478
- children: /* @__PURE__ */ r.jsx(s, {
479
- ref: i,
480
- ...o,
481
- className: w(a, e, t && `${e}-${t}`, n && "has-validation")
482
- })
483
- });
484
- });
485
- Hr.displayName = "InputGroup";
486
- const Nt = Object.assign(Hr, {
487
- Text: Lt,
488
- Radio: Js,
489
- Checkbox: Zs
490
- }), Wr = /* @__PURE__ */ se.createContext(null), Xs = ["as", "active", "eventKey"];
491
- function eo(e, t) {
492
- if (e == null) return {};
493
- var n = {};
494
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
495
- if (t.indexOf(a) >= 0) continue;
496
- n[a] = e[a];
497
- }
498
- return n;
499
- }
500
- function zr({
501
- key: e,
502
- onClick: t,
503
- active: n,
504
- id: a,
505
- role: s,
506
- disabled: o
507
- }) {
508
- const i = Q(Zt), c = Q(ur), l = Q(Wr);
509
- let u = n;
510
- const d = {
511
- role: s
512
- };
513
- if (c) {
514
- !s && c.role === "tablist" && (d.role = "tab");
515
- const m = c.getControllerId(e ?? null), x = c.getControlledId(e ?? null);
516
- d[sn("event-key")] = e, d.id = m || a, u = n == null && e != null ? c.activeKey === e : n, (u || !(l != null && l.unmountOnExit) && !(l != null && l.mountOnEnter)) && (d["aria-controls"] = x);
517
- }
518
- return d.role === "tab" && (d["aria-selected"] = u, u || (d.tabIndex = -1), o && (d.tabIndex = -1, d["aria-disabled"] = !0)), d.onClick = Ft((m) => {
519
- o || (t == null || t(m), e != null && i && !m.isPropagationStopped() && i(e, m));
520
- }), [d, {
521
- isActive: u
522
- }];
523
- }
524
- const Ur = /* @__PURE__ */ se.forwardRef((e, t) => {
525
- let {
526
- as: n = La,
527
- active: a,
528
- eventKey: s
529
- } = e, o = eo(e, Xs);
530
- const [i, c] = zr(Object.assign({
531
- key: on(s, o.href),
532
- active: a
533
- }, o));
534
- return i[sn("active")] = c.isActive, /* @__PURE__ */ r.jsx(n, Object.assign({}, o, i, {
535
- ref: t
536
- }));
537
- });
538
- Ur.displayName = "NavItem";
539
- const to = Ur, no = ["as", "onSelect", "activeKey", "role", "onKeyDown"];
540
- function ro(e, t) {
541
- if (e == null) return {};
542
- var n = {};
543
- for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
544
- if (t.indexOf(a) >= 0) continue;
545
- n[a] = e[a];
546
- }
547
- return n;
548
- }
549
- const Ln = () => {
550
- }, Rn = sn("event-key"), Gr = /* @__PURE__ */ se.forwardRef((e, t) => {
551
- let {
552
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
553
- as: n = "div",
554
- onSelect: a,
555
- activeKey: s,
556
- role: o,
557
- onKeyDown: i
558
- } = e, c = ro(e, no);
559
- const l = Ra(), u = ee(!1), d = Q(Zt), m = Q(Wr);
560
- let x, v;
561
- m && (o = o || "tablist", s = m.activeKey, x = m.getControlledId, v = m.getControllerId);
562
- const h = ee(null), p = (f) => {
563
- const b = h.current;
564
- if (!b) return null;
565
- const N = Va(b, `[${Rn}]:not([aria-disabled=true])`), k = b.querySelector("[aria-selected=true]");
566
- if (!k || k !== document.activeElement) return null;
567
- const I = N.indexOf(k);
568
- if (I === -1) return null;
569
- let F = I + f;
570
- return F >= N.length && (F = 0), F < 0 && (F = N.length - 1), N[F];
571
- }, g = (f, b) => {
572
- f != null && (a == null || a(f, b), d == null || d(f, b));
573
- }, j = (f) => {
574
- if (i == null || i(f), !m)
575
- return;
576
- let b;
577
- switch (f.key) {
578
- case "ArrowLeft":
579
- case "ArrowUp":
580
- b = p(-1);
581
- break;
582
- case "ArrowRight":
583
- case "ArrowDown":
584
- b = p(1);
585
- break;
586
- default:
587
- return;
588
- }
589
- b && (f.preventDefault(), g(b.dataset[Ma("EventKey")] || null, f), u.current = !0, l());
590
- };
591
- A(() => {
592
- if (h.current && u.current) {
593
- const f = h.current.querySelector(`[${Rn}][aria-selected=true]`);
594
- f == null || f.focus();
595
- }
596
- u.current = !1;
597
- });
598
- const y = Aa(t, h);
599
- return /* @__PURE__ */ r.jsx(Zt.Provider, {
600
- value: g,
601
- children: /* @__PURE__ */ r.jsx(ur.Provider, {
602
- value: {
603
- role: o,
604
- // used by NavLink to determine it's role
605
- activeKey: on(s),
606
- getControlledId: x || Ln,
607
- getControllerId: v || Ln
608
- },
609
- children: /* @__PURE__ */ r.jsx(n, Object.assign({}, c, {
610
- onKeyDown: j,
611
- ref: y,
612
- role: o
613
- }))
614
- })
615
- });
616
- });
617
- Gr.displayName = "Nav";
618
- const ao = Object.assign(Gr, {
619
- Item: to
620
- }), xn = /* @__PURE__ */ se.forwardRef(({
621
- bsPrefix: e,
622
- active: t,
623
- disabled: n,
624
- eventKey: a,
625
- className: s,
626
- variant: o,
627
- action: i,
628
- as: c,
629
- ...l
630
- }, u) => {
631
- e = ue(e, "list-group-item");
632
- const [d, m] = zr({
633
- key: on(a, l.href),
634
- active: t,
635
- ...l
636
- }), x = Ft((h) => {
637
- if (n) {
638
- h.preventDefault(), h.stopPropagation();
639
- return;
640
- }
641
- d.onClick(h);
642
- });
643
- n && l.tabIndex === void 0 && (l.tabIndex = -1, l["aria-disabled"] = !0);
644
- const v = c || (i ? l.href ? "a" : "button" : "div");
645
- return process.env.NODE_ENV !== "production" && fr(c || !(!i && l.href), "`action=false` and `href` should not be used together."), /* @__PURE__ */ r.jsx(v, {
646
- ref: u,
647
- ...l,
648
- ...d,
649
- onClick: x,
650
- className: w(s, e, m.isActive && "active", n && "disabled", o && `${e}-${o}`, i && `${e}-action`)
651
- });
652
- });
653
- xn.displayName = "ListGroupItem";
654
- const Yr = /* @__PURE__ */ se.forwardRef((e, t) => {
655
- const {
656
- className: n,
657
- bsPrefix: a,
658
- variant: s,
659
- horizontal: o,
660
- numbered: i,
661
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
662
- as: c = "div",
663
- ...l
664
- } = cr(e, {
665
- activeKey: "onSelect"
666
- }), u = ue(a, "list-group");
667
- let d;
668
- return o && (d = o === !0 ? "horizontal" : `horizontal-${o}`), process.env.NODE_ENV !== "production" && fr(!(o && s === "flush"), '`variant="flush"` and `horizontal` should not be used together.'), /* @__PURE__ */ r.jsx(ao, {
669
- ref: t,
670
- ...l,
671
- as: c,
672
- className: w(n, u, s && `${u}-${s}`, d && `${u}-${d}`, i && `${u}-numbered`)
673
- });
674
- });
675
- Yr.displayName = "ListGroup";
676
- const so = Object.assign(Yr, {
677
- Item: xn
678
- }), nn = /* @__PURE__ */ new WeakMap(), An = (e, t) => {
679
- if (!e || !t) return;
680
- const n = nn.get(t) || /* @__PURE__ */ new Map();
681
- nn.set(t, n);
682
- let a = n.get(e);
683
- return a || (a = t.matchMedia(e), a.refCount = 0, n.set(a.media, a)), a;
684
- };
685
- function oo(e, t = typeof window > "u" ? void 0 : window) {
686
- const n = An(e, t), [a, s] = E(() => n ? n.matches : !1);
687
- return Ba(() => {
688
- let o = An(e, t);
689
- if (!o)
690
- return s(!1);
691
- let i = nn.get(t);
692
- const c = () => {
693
- s(o.matches);
694
- };
695
- return o.refCount++, o.addListener(c), c(), () => {
696
- o.removeListener(c), o.refCount--, o.refCount <= 0 && (i == null || i.delete(o.media)), o = void 0;
697
- };
698
- }, [e]), a;
699
- }
700
- function io(e) {
701
- const t = Object.keys(e);
702
- function n(c, l) {
703
- return c === l ? l : c ? `${c} and ${l}` : l;
704
- }
705
- function a(c) {
706
- return t[Math.min(t.indexOf(c) + 1, t.length - 1)];
707
- }
708
- function s(c) {
709
- const l = a(c);
710
- let u = e[l];
711
- return typeof u == "number" ? u = `${u - 0.2}px` : u = `calc(${u} - 0.2px)`, `(max-width: ${u})`;
712
- }
713
- function o(c) {
714
- let l = e[c];
715
- return typeof l == "number" && (l = `${l}px`), `(min-width: ${l})`;
716
- }
717
- function i(c, l, u) {
718
- let d;
719
- typeof c == "object" ? (d = c, u = l, l = !0) : (l = l || !0, d = {
720
- [c]: l
721
- });
722
- let m = te(() => Object.entries(d).reduce((x, [v, h]) => ((h === "up" || h === !0) && (x = n(x, o(v))), (h === "down" || h === !0) && (x = n(x, s(v))), x), ""), [JSON.stringify(d)]);
723
- return oo(m, u);
724
- }
725
- return i;
726
- }
727
- const lo = io({
728
- xs: 0,
729
- sm: 576,
730
- md: 768,
731
- lg: 992,
732
- xl: 1200,
733
- xxl: 1400
734
- }), Kr = /* @__PURE__ */ se.forwardRef(({
735
- className: e,
736
- bsPrefix: t,
737
- as: n = "div",
738
- ...a
739
- }, s) => (t = ue(t, "offcanvas-body"), /* @__PURE__ */ r.jsx(n, {
740
- ref: s,
741
- className: w(e, t),
742
- ...a
743
- })));
744
- Kr.displayName = "OffcanvasBody";
745
- const co = {
746
- [an]: "show",
747
- [lr]: "show"
748
- }, qr = /* @__PURE__ */ se.forwardRef(({
749
- bsPrefix: e,
750
- className: t,
751
- children: n,
752
- in: a = !1,
753
- mountOnEnter: s = !1,
754
- unmountOnExit: o = !1,
755
- appear: i = !1,
756
- ...c
757
- }, l) => (e = ue(e, "offcanvas"), /* @__PURE__ */ r.jsx(sr, {
758
- ref: l,
759
- addEndListener: or,
760
- in: a,
761
- mountOnEnter: s,
762
- unmountOnExit: o,
763
- appear: i,
764
- ...c,
765
- childRef: n.ref,
766
- children: (u, d) => /* @__PURE__ */ se.cloneElement(n, {
767
- ...d,
768
- className: w(t, n.props.className, (u === an || u === ir) && `${e}-toggling`, co[u])
769
- })
770
- })));
771
- qr.displayName = "OffcanvasToggling";
772
- const Qr = /* @__PURE__ */ se.forwardRef(({
773
- bsPrefix: e,
774
- className: t,
775
- closeLabel: n = "Close",
776
- closeButton: a = !1,
777
- ...s
778
- }, o) => (e = ue(e, "offcanvas-header"), /* @__PURE__ */ r.jsx(Pa, {
779
- ref: o,
780
- ...s,
781
- className: w(t, e),
782
- closeLabel: n,
783
- closeButton: a
784
- })));
785
- Qr.displayName = "OffcanvasHeader";
786
- const uo = $t("h5"), Zr = /* @__PURE__ */ se.forwardRef(({
787
- className: e,
788
- bsPrefix: t,
789
- as: n = uo,
790
- ...a
791
- }, s) => (t = ue(t, "offcanvas-title"), /* @__PURE__ */ r.jsx(n, {
792
- ref: s,
793
- className: w(e, t),
794
- ...a
795
- })));
796
- Zr.displayName = "OffcanvasTitle";
797
- function fo(e) {
798
- return /* @__PURE__ */ r.jsx(qr, {
799
- ...e
800
- });
801
- }
802
- function mo(e) {
803
- return /* @__PURE__ */ r.jsx(Qt, {
804
- ...e
805
- });
806
- }
807
- const Jr = /* @__PURE__ */ se.forwardRef(({
808
- bsPrefix: e,
809
- className: t,
810
- children: n,
811
- "aria-labelledby": a,
812
- placement: s = "start",
813
- responsive: o,
814
- /* BaseModal props */
815
- show: i = !1,
816
- backdrop: c = !0,
817
- keyboard: l = !0,
818
- scroll: u = !1,
819
- onEscapeKeyDown: d,
820
- onShow: m,
821
- onHide: x,
822
- container: v,
823
- autoFocus: h = !0,
824
- enforceFocus: p = !0,
825
- restoreFocus: g = !0,
826
- restoreFocusOptions: j,
827
- onEntered: y,
828
- onExit: f,
829
- onExiting: b,
830
- onEnter: N,
831
- onEntering: k,
832
- onExited: I,
833
- backdropClassName: F,
834
- manager: C,
835
- renderStaticNode: R = !1,
836
- ...O
837
- }, _) => {
838
- const U = ee();
839
- e = ue(e, "offcanvas");
840
- const {
841
- onToggle: V
842
- } = Q(Ha) || {}, [X, L] = E(!1), D = lo(o || "xs", "up");
843
- A(() => {
844
- L(o ? i && !D : i);
845
- }, [i, o, D]);
846
- const P = Ft(() => {
847
- V == null || V(), x == null || x();
848
- }), H = te(() => ({
849
- onHide: P
850
- }), [P]);
851
- function J() {
852
- return C || (u ? (U.current || (U.current = new Ua({
853
- handleContainerOverflow: !1
854
- })), U.current) : Ga());
855
- }
856
- const $ = (z, ...me) => {
857
- z && (z.style.visibility = "visible"), N == null || N(z, ...me);
858
- }, Y = (z, ...me) => {
859
- z && (z.style.visibility = ""), I == null || I(...me);
860
- }, ie = S((z) => /* @__PURE__ */ r.jsx("div", {
861
- ...z,
862
- className: w(`${e}-backdrop`, F)
863
- }), [F, e]), M = (z) => /* @__PURE__ */ r.jsx("div", {
864
- ...z,
865
- ...O,
866
- className: w(t, o ? `${e}-${o}` : e, `${e}-${s}`),
867
- "aria-labelledby": a,
868
- children: n
869
- });
870
- return /* @__PURE__ */ r.jsxs(r.Fragment, {
871
- children: [!X && (o || R) && M({}), /* @__PURE__ */ r.jsx(Wa.Provider, {
872
- value: H,
873
- children: /* @__PURE__ */ r.jsx(za, {
874
- show: X,
875
- ref: _,
876
- backdrop: c,
877
- container: v,
878
- keyboard: l,
879
- autoFocus: h,
880
- enforceFocus: p && !u,
881
- restoreFocus: g,
882
- restoreFocusOptions: j,
883
- onEscapeKeyDown: d,
884
- onShow: m,
885
- onHide: P,
886
- onEnter: $,
887
- onEntering: k,
888
- onEntered: y,
889
- onExit: f,
890
- onExiting: b,
891
- onExited: Y,
892
- manager: J(),
893
- transition: fo,
894
- backdropTransition: mo,
895
- renderBackdrop: ie,
896
- renderDialog: M
897
- })
898
- })]
899
- });
900
- });
901
- Jr.displayName = "Offcanvas";
902
- const Mn = Object.assign(Jr, {
903
- Body: Kr,
904
- Header: Qr,
905
- Title: Zr
906
- });
907
- function Xr({
908
- animation: e,
909
- bg: t,
910
- bsPrefix: n,
911
- size: a,
912
- ...s
913
- }) {
914
- n = ue(n, "placeholder");
915
- const [{
916
- className: o,
917
- ...i
918
- }] = Ya(s);
919
- return {
920
- ...i,
921
- className: w(o, e ? `${n}-${e}` : n, a && `${n}-${a}`, t && `bg-${t}`)
922
- };
923
- }
924
- const ea = /* @__PURE__ */ se.forwardRef((e, t) => {
925
- const n = Xr(e);
926
- return /* @__PURE__ */ r.jsx(Jt, {
927
- ...n,
928
- ref: t,
929
- disabled: !0,
930
- tabIndex: -1
931
- });
932
- });
933
- ea.displayName = "PlaceholderButton";
934
- const ta = /* @__PURE__ */ se.forwardRef(({
935
- as: e = "span",
936
- ...t
937
- }, n) => {
938
- const a = Xr(t);
939
- return /* @__PURE__ */ r.jsx(e, {
940
- ...a,
941
- ref: n
942
- });
943
- });
944
- ta.displayName = "Placeholder";
945
- const Ae = Object.assign(ta, {
946
- Button: ea
947
- }), vn = /* @__PURE__ */ se.forwardRef(({
948
- bsPrefix: e,
949
- variant: t,
950
- animation: n = "border",
951
- size: a,
952
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
953
- as: s = "div",
954
- className: o,
955
- ...i
956
- }, c) => {
957
- e = ue(e, "spinner");
958
- const l = `${e}-${n}`;
959
- return /* @__PURE__ */ r.jsx(s, {
960
- ref: c,
961
- ...i,
962
- className: w(o, l, a && `${l}-${a}`, t && `text-${t}`)
963
- });
964
- });
965
- vn.displayName = "Spinner";
966
- const Jc = ({ heading: e, content: t, placement: n, children: a, trigger: s, popoverClassName: o, ...i }) => /* @__PURE__ */ r.jsx(Ka, { placement: n, overlay: /* @__PURE__ */ r.jsxs(Mt, { className: w("luminus-popover", o), onClick: (c) => c.stopPropagation(), children: [
967
- e && /* @__PURE__ */ r.jsx(Mt.Header, { children: typeof e == "string" ? /* @__PURE__ */ r.jsx(Z, { variant: "h6", className: "text-primary", children: e }) : e }),
968
- /* @__PURE__ */ r.jsx(Mt.Body, { children: t })
969
- ] }), trigger: s ?? "hover", rootClose: !0, show: i.controlled ? i.isOpen : void 0, onToggle: i.controlled ? (c) => i.setIsOpen(c) : void 0, children: a }), ho = ({ children: e, onStorno: t, noSpacer: n }) => {
970
- const { texts: { formSubmit: a } } = Q(ge);
971
- return /* @__PURE__ */ r.jsxs(tc, { noSpacer: n, children: [
972
- /* @__PURE__ */ r.jsxs(Xt, { as: "button", color: "primary", size: "lg", type: "submit", children: [
973
- /* @__PURE__ */ r.jsx(qa, {}),
974
- e
975
- ] }),
976
- t && /* @__PURE__ */ r.jsxs(Xt, { as: "button", color: "secondary", variant: "outlined", size: "lg", onClick: t, children: [
977
- /* @__PURE__ */ r.jsx(Qa, {}),
978
- a.storno
979
- ] })
980
- ] });
981
- }, na = ({ color: e = "primary", icon: t = /* @__PURE__ */ r.jsx(mr, { size: 12 }), inputId: n = "context-file-input", accept: a = "*", onUpload: s, className: o, children: i, multiple: c, ...l }) => {
982
- const u = (d) => {
983
- d.target.files && (s(d.target.files), d.target.value = "");
984
- };
985
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
986
- /* @__PURE__ */ r.jsxs("label", { htmlFor: n, className: w(`luminus-context-button btn text-${e} ${o ?? ""}`, Za.button), ...l, children: [
987
- t,
988
- i
989
- ] }),
990
- /* @__PURE__ */ r.jsx("input", { id: n, type: "file", accept: a, onChange: u, hidden: !0, multiple: c })
991
- ] });
992
- }, Xc = ({ onUpload: e, accept: t, children: n, className: a, size: s = "md" }) => {
993
- const o = S(async (c) => {
994
- if (c.target.files)
995
- try {
996
- await e(c.target.files);
997
- } finally {
998
- c.target.value = "";
999
- }
1000
- }, [e]), i = bs();
1001
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1002
- /* @__PURE__ */ r.jsx("label", { htmlFor: i, className: w("btn luminus-context-button text-primary", `btn-${s}`, a), children: n }),
1003
- /* @__PURE__ */ r.jsx("input", { id: i, type: "file", accept: t, onChange: o, hidden: !0 })
1004
- ] });
1005
- }, go = "_select_dlv1t_1", Wt = {
1006
- select: go
1007
- }, po = ({ month: e, onChangeMonth: t, locale: n, yearMin: a = 2e3, yearMax: s = 2050 }) => {
1008
- const o = S((l) => {
1009
- const u = Cr(e, l);
1010
- u.getFullYear() < a || u.getFullYear() > s || t(u);
1011
- }, [e, t, a, s]), i = te(() => {
1012
- const l = [];
1013
- for (let u = a; u <= s; u++)
1014
- l.push(u);
1015
- return l;
1016
- }, [a, s]), c = te(() => {
1017
- const d = [];
1018
- for (let m = 0; m <= 11; m++)
1019
- d.push({
1020
- id: m,
1021
- name: xt(new Date(2024, m, 1), "LLLL", { locale: n })
1022
- });
1023
- return d;
1024
- }, [n]);
1025
- return /* @__PURE__ */ r.jsxs("div", { className: "card d-flex flex-row align-items-center m-0 p-1 gap-2", children: [
1026
- /* @__PURE__ */ r.jsx(ne, { onClick: () => o(-1), disabled: e.getFullYear() < a || e.getFullYear() === a && e.getMonth() <= 0, children: /* @__PURE__ */ r.jsx(ln, {}) }),
1027
- /* @__PURE__ */ r.jsx(ye.Select, { value: e.getMonth(), onChange: (l) => {
1028
- var u;
1029
- return ((u = l.target) == null ? void 0 : u.value) && t(zs(e, Number(l.target.value)));
1030
- }, className: w(Wt.select, Wt.month), children: c.map((l) => /* @__PURE__ */ r.jsx("option", { value: l.id, children: l.name }, l.id)) }),
1031
- /* @__PURE__ */ r.jsx(ye.Select, { value: e.getFullYear(), onChange: (l) => {
1032
- var u;
1033
- return ((u = l.target) == null ? void 0 : u.value) && t(Sr(e, Number(l.target.value)));
1034
- }, className: w(Wt.select), children: i.map((l) => /* @__PURE__ */ r.jsx("option", { value: l, children: l }, l)) }),
1035
- /* @__PURE__ */ r.jsx(ne, { onClick: () => o(1), disabled: e.getFullYear() > s || e.getFullYear() === s && e.getMonth() >= 11, children: /* @__PURE__ */ r.jsx(cn, {}) })
1036
- ] });
1037
- }, xo = "_select_pywmr_1", vo = {
1038
- select: xo
1039
- }, jo = ({ year: e, onChangeYear: t, optionMin: n = 2e3, optionMax: a = 2050, className: s }) => {
1040
- const o = S((c) => {
1041
- const l = e.getFullYear() + c;
1042
- l < n || l > a || t(Vs(e, c));
1043
- }, [e, t, a, n]), i = te(() => {
1044
- const c = [];
1045
- for (let l = n; l <= a; l++)
1046
- c.push(l);
1047
- return c;
1048
- }, [n, a]);
1049
- return /* @__PURE__ */ r.jsxs("div", { className: w("card d-flex flex-row align-items-center m-0 p-1 gap-2", s ?? ""), children: [
1050
- /* @__PURE__ */ r.jsx(ne, { onClick: () => o(-1), disabled: e.getFullYear() <= n, children: /* @__PURE__ */ r.jsx(ln, {}) }),
1051
- /* @__PURE__ */ r.jsx(ye.Select, { value: e.getFullYear(), onChange: (c) => {
1052
- var l;
1053
- return ((l = c.target) == null ? void 0 : l.value) && t(Sr(e, Number(c.target.value)));
1054
- }, className: vo.select, children: i.map((c) => /* @__PURE__ */ r.jsx("option", { value: c, children: c }, c)) }),
1055
- /* @__PURE__ */ r.jsx(ne, { onClick: () => o(1), disabled: e.getFullYear() >= a, children: /* @__PURE__ */ r.jsx(cn, {}) })
1056
- ] });
1057
- }, yo = "_widget_etgh3_1", bo = {
1058
- widget: yo
1059
- }, ra = ({ currentSelection: e, selectedItemNavigateTo: t, children: n }) => {
1060
- if (!e || !e.id || !t)
1061
- return /* @__PURE__ */ r.jsx("div", { className: "luminus-input-container position-relative w-100", children: n });
1062
- const a = t(e);
1063
- return /* @__PURE__ */ r.jsx(Ze, { to: a, className: "luminus-input-container position-relative w-100 text-decoration-none", children: n });
1064
- }, aa = ({ InputContainer: e = Je, label: t, value: n, onChange: a, hidden: s, disabled: o, className: i, type: c, withoutLabel: l, indeterminate: u }) => {
1065
- const d = ee(null);
1066
- return A(() => {
1067
- d.current && (d.current.indeterminate = u ?? !1);
1068
- }, [d, u]), /* @__PURE__ */ r.jsx(e, { isForCheckInput: !0, hidden: s, label: t ?? "", withoutLabel: l, className: i, children: /* @__PURE__ */ r.jsx(ye.Check, { ref: d, id: `check-${t}`, type: c ?? "checkbox", label: t ?? "", checked: n, onChange: (m) => {
1069
- var x;
1070
- a && a(((x = m.target) == null ? void 0 : x.checked) ?? !1);
1071
- }, className: i ?? "", hidden: s ?? !1, disabled: o ?? !1 }) });
1072
- }, at = ({ InputContainer: e = Je, type: t, value: n, onChange: a, debounceMs: s, label: o, withoutLabel: i, placeholder: c, size: l, hidden: u, disabled: d, showClearIcon: m, clearValue: x, list: v, className: h, step: p, noSelectOnFocus: g }) => {
1073
- const j = t === "number", y = S(() => {
1074
- if (!a)
1075
- return;
1076
- const O = x ?? null;
1077
- a(j ? O ? Number(O) : null : (O == null ? void 0 : O.toString()) ?? "");
1078
- }, [x, j, a]), f = ee(null), [b, N] = E((n == null ? void 0 : n.toString()) ?? ""), k = S((O) => {
1079
- const _ = O;
1080
- a && (j && a(_ == null || _ === "" ? null : Number(_)), a(_ || null));
1081
- }, [j, a]), I = S((O) => {
1082
- var U;
1083
- const _ = (U = O.target) == null ? void 0 : U.value;
1084
- if (!s) {
1085
- k(_);
1086
- return;
1087
- }
1088
- N(_), f.current !== null && window.clearTimeout(f.current), f.current = window.setTimeout(() => {
1089
- k(_);
1090
- }, s);
1091
- }, [s, k]);
1092
- A(() => {
1093
- N(n === null ? "" : n.toString());
1094
- }, [n]);
1095
- const [F, C] = E(!1), R = Ja(t, n ? n.toString() ?? null : null, F);
1096
- return /* @__PURE__ */ r.jsxs(e, { withoutLabel: i, label: o ?? "", hidden: u, className: h, children: [
1097
- /* @__PURE__ */ r.jsx(ye.Control, { type: R, placeholder: c ?? o, size: l, value: s ? b : (n == null ? void 0 : n.toString()) ?? "", onChange: I, className: h ?? "", hidden: u, disabled: d ?? !1, list: v, onFocus: (O) => {
1098
- C(!0), !g && O.target.select();
1099
- }, onBlur: () => C(!1), step: p }),
1100
- m && n !== null && a && !d && /* @__PURE__ */ r.jsx("div", { className: `luminus-input-remove-icon ${t !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
1101
- ] });
1102
- }, Dt = ({
1103
- InputContainer: e = Je,
1104
- value: t,
1105
- options: n,
1106
- onChange: a,
1107
- label: s,
1108
- withoutLabel: o,
1109
- isNumber: i,
1110
- size: c,
1111
- hidden: l,
1112
- disabled: u,
1113
- showClearIcon: d,
1114
- clearValue: m,
1115
- noSortOptions: x,
1116
- className: v,
1117
- noEmptyOption: h
1118
- // it will still add the empty option if there is no value provided or value is empty string or null
1119
- }) => {
1120
- const p = S(() => {
1121
- if (!a)
1122
- return;
1123
- const g = m ?? null;
1124
- a(i ? g ? Number(g) : null : (g == null ? void 0 : g.toString()) ?? "");
1125
- }, [m, i, a]);
1126
- return /* @__PURE__ */ r.jsxs(e, { withoutLabel: o, label: s ?? "", hidden: l, className: v, children: [
1127
- /* @__PURE__ */ r.jsxs(ye.Select, { size: c, value: t ?? "", onChange: (g) => {
1128
- var y;
1129
- if (!a)
1130
- return;
1131
- const j = (y = g.target) == null ? void 0 : y.value;
1132
- i && a(j ? parseInt(j, 10) : null), a(j || null);
1133
- }, className: v ?? "", hidden: l, disabled: u ?? !1, children: [
1134
- !h && /* @__PURE__ */ r.jsx("option", { value: "" }),
1135
- n == null ? void 0 : n.sort((g, j) => x ? 0 : (g.name ?? "").localeCompare(j.name ?? "")).map((g) => /* @__PURE__ */ r.jsx("option", { value: g.id ?? "", children: g.name }, g.id))
1136
- ] }),
1137
- d && t && a && !u && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: p, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
1138
- ] });
1139
- }, ed = ({ InputContainer: e = Je, items: t, defaultSelection: n, selectedItemNavigateTo: a, onSearchQueryChange: s, texts: o, isLoading: i, isNumber: c, onSelect: l, label: u, withoutLabel: d, size: m, dropdownItemsNameWidth: x, additionalColumns: v, hidden: h, disabled: p, displayIdAsName: g, CustomOnChangeComponent: j, className: y }) => {
1140
- var _, U;
1141
- const [f, b] = E(n), [N, k] = E(!1);
1142
- A(() => {
1143
- b(n);
1144
- }, [n]);
1145
- const I = S((V) => {
1146
- b(V);
1147
- }, []), F = S((V) => {
1148
- k(!1), I(V);
1149
- }, [I]);
1150
- A(() => {
1151
- l && l(f);
1152
- }, [f, l]);
1153
- const C = ee(null), R = a !== void 0, O = R && f !== null;
1154
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(e, { withoutLabel: d, label: u ?? "", hidden: h, inputContainerClassName: w({ "luminus-dropdown-select-open": N }), className: y, children: [
1155
- /* @__PURE__ */ r.jsxs(ra, { currentSelection: f, selectedItemNavigateTo: a, children: [
1156
- g && (f == null ? void 0 : f.name) && /* @__PURE__ */ r.jsx(Z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: f.name }),
1157
- /* @__PURE__ */ r.jsxs(ye.Select, { ref: C, size: m, value: (f == null ? void 0 : f.id) ?? "", onChange: (V) => b({
1158
- id: c ? Number(V.target.value) ?? null : V.target.value,
1159
- name: ""
1160
- }), onMouseDown: (V) => {
1161
- V.currentTarget.focus(), V.preventDefault();
1162
- }, onClick: () => {
1163
- !R && !p && k(!0);
1164
- }, className: w("w-100", {
1165
- "luminus-dropdown-picker-disabled": p,
1166
- "luminus-dropdown-picker-link": O
1167
- }), hidden: h, children: [
1168
- /* @__PURE__ */ r.jsx("option", { value: "" }),
1169
- n && /* @__PURE__ */ r.jsx("option", { value: n.id ?? void 0, children: n.name && ((_ = n.name) == null ? void 0 : _.length) > 0 ? n.name : n.id }),
1170
- f && /* @__PURE__ */ r.jsx("option", { value: f.id ?? void 0, children: f.name && ((U = f.name) == null ? void 0 : U.length) > 0 ? f.name : f.id })
1171
- ] }),
1172
- j || !p && R ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
1173
- !j && !p && R && /* @__PURE__ */ r.jsx(ne, { size: "sm", color: "secondary", onClick: (V) => {
1174
- V.preventDefault(), V.stopPropagation(), k(!0);
1175
- }, children: /* @__PURE__ */ r.jsx(hr, {}) }),
1176
- j ?? null
1177
- ] }) : null
1178
- ] }),
1179
- C.current && /* @__PURE__ */ r.jsx(wn, { show: N, onCancel: () => k(!1), items: t, currentSelection: f, onSelectionChange: F, onSearchQueryChange: s, texts: o, itemsNameWidth: x, additionalColumns: v, isLoading: i, disabled: p, inputRef: C })
1180
- ] }) });
1181
- }, td = ({ InputContainer: e = Je, value: t, onChange: n, label: a, size: s, showClearIcon: o, clearValue: i, hidden: c, disabled: l, rows: u, withoutLabel: d, debounceMs: m, className: x }) => {
1182
- const v = S(() => {
1183
- if (!n)
1184
- return;
1185
- const f = i ?? null;
1186
- n((f == null ? void 0 : f.toString()) ?? "");
1187
- }, [i, n]), h = ee(null), [p, g] = E((t == null ? void 0 : t.toString()) ?? ""), j = S((f) => {
1188
- const b = f;
1189
- n && n(b || null);
1190
- }, [n]), y = S((f) => {
1191
- var N;
1192
- const b = (N = f.target) == null ? void 0 : N.value;
1193
- if (!m) {
1194
- j(b);
1195
- return;
1196
- }
1197
- g(b), h.current !== null && window.clearTimeout(h.current), h.current = window.setTimeout(() => {
1198
- j(b);
1199
- }, m);
1200
- }, [m, j]);
1201
- return A(() => {
1202
- g(t === null ? "" : t.toString());
1203
- }, [t]), /* @__PURE__ */ r.jsxs(e, { label: a ?? "", hidden: c, withoutLabel: d, className: x, isForTextAreaInput: !0, children: [
1204
- /* @__PURE__ */ r.jsx(ye.Control, { as: "textarea", size: s, value: m ? p : t ?? "", onChange: y, hidden: c, disabled: l, rows: u ?? 2, className: "w-100" }),
1205
- o && t && n && !l && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: v, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
1206
- ] });
1207
- }, nd = ({ InputContainer: e = Je, value: t, onChange: n, debounceMs: a, label: s, withoutLabel: o, placeholder: i, size: c, hidden: l, disabled: u, showClearIcon: d, clearValue: m, className: x, step: v, stepperStep: h = 1, min: p, max: g }) => {
1208
- const j = S(() => {
1209
- if (!n)
1210
- return;
1211
- const I = m ?? null;
1212
- n(I ? Number(I) : null);
1213
- }, [m, n]), y = ee(null), [f, b] = E((t == null ? void 0 : t.toString()) ?? ""), N = S((I) => {
1214
- const F = I;
1215
- n && n(F == null || F === "" ? null : ht(Number(F), p, g));
1216
- }, [g, p, n]), k = S((I) => {
1217
- var C;
1218
- const F = (C = I.target) == null ? void 0 : C.value;
1219
- if (!a) {
1220
- N(F);
1221
- return;
1222
- }
1223
- b(ht(Number(F), p, g).toString()), y.current !== null && window.clearTimeout(y.current), y.current = window.setTimeout(() => {
1224
- N(F);
1225
- }, a);
1226
- }, [a, N, g, p]);
1227
- return A(() => {
1228
- b(t === null ? "" : ht(t, p, g).toString());
1229
- }, [g, p, t]), /* @__PURE__ */ r.jsx(e, { withoutLabel: o, label: s ?? "", hidden: l, className: x, children: /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
1230
- /* @__PURE__ */ r.jsx(ye.Control, { type: "number", placeholder: i ?? s, size: c, value: a ? f : t ?? "", onChange: k, className: `luminus-numeric-stepper ${x ?? ""}`, hidden: l, disabled: u ?? !1, step: v }),
1231
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !u && /* @__PURE__ */ r.jsx(ne, { size: "sm", onClick: (I) => {
1232
- I.preventDefault(), I.stopPropagation(), N(((t ?? 0) - h).toString());
1233
- }, children: /* @__PURE__ */ r.jsx(gr, {}) }) }),
1234
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !u && /* @__PURE__ */ r.jsx(ne, { size: "sm", onClick: (I) => {
1235
- I.preventDefault(), I.stopPropagation(), N(((t ?? 0) + h).toString());
1236
- }, children: /* @__PURE__ */ r.jsx(pr, {}) }) }),
1237
- d && t && n && !u && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: j, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
1238
- ] }) });
1239
- };
1240
- function sa(e, t) {
1241
- var n = {};
1242
- for (var a in e)
1243
- Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
1244
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1245
- for (var s = 0, a = Object.getOwnPropertySymbols(e); s < a.length; s++)
1246
- t.indexOf(a[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[s]) && (n[a[s]] = e[a[s]]);
1247
- return n;
1248
- }
1249
- var jt;
1250
- (function(e) {
1251
- e.event = "event", e.props = "prop";
1252
- })(jt || (jt = {}));
1253
- function Me() {
1254
- }
1255
- function wo(e) {
1256
- var t, n = void 0;
1257
- return function() {
1258
- for (var a = [], s = arguments.length; s--; ) a[s] = arguments[s];
1259
- return t && a.length === t.length && a.every(function(o, i) {
1260
- return o === t[i];
1261
- }) || (t = a, n = e.apply(void 0, a)), n;
1262
- };
1263
- }
1264
- function yt(e) {
1265
- return !!(e || "").match(/\d/);
1266
- }
1267
- function st(e) {
1268
- return e == null;
1269
- }
1270
- function _o(e) {
1271
- return typeof e == "number" && isNaN(e);
1272
- }
1273
- function oa(e) {
1274
- return st(e) || _o(e) || typeof e == "number" && !isFinite(e);
1275
- }
1276
- function ia(e) {
1277
- return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
1278
- }
1279
- function No(e) {
1280
- switch (e) {
1281
- case "lakh":
1282
- return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
1283
- case "wan":
1284
- return /(\d)(?=(\d{4})+(?!\d))/g;
1285
- case "thousand":
1286
- default:
1287
- return /(\d)(?=(\d{3})+(?!\d))/g;
1288
- }
1289
- }
1290
- function Co(e, t, n) {
1291
- var a = No(n), s = e.search(/[1-9]/);
1292
- return s = s === -1 ? e.length : s, e.substring(0, s) + e.substring(s, e.length).replace(a, "$1" + t);
1293
- }
1294
- function So(e) {
1295
- var t = ee(e);
1296
- t.current = e;
1297
- var n = ee(function() {
1298
- for (var a = [], s = arguments.length; s--; ) a[s] = arguments[s];
1299
- return t.current.apply(t, a);
1300
- });
1301
- return n.current;
1302
- }
1303
- function jn(e, t) {
1304
- t === void 0 && (t = !0);
1305
- var n = e[0] === "-", a = n && t;
1306
- e = e.replace("-", "");
1307
- var s = e.split("."), o = s[0], i = s[1] || "";
1308
- return {
1309
- beforeDecimal: o,
1310
- afterDecimal: i,
1311
- hasNegation: n,
1312
- addNegation: a
1313
- };
1314
- }
1315
- function ko(e) {
1316
- if (!e)
1317
- return e;
1318
- var t = e[0] === "-";
1319
- t && (e = e.substring(1, e.length));
1320
- var n = e.split("."), a = n[0].replace(/^0+/, "") || "0", s = n[1] || "";
1321
- return (t ? "-" : "") + a + (s ? "." + s : "");
1322
- }
1323
- function la(e, t, n) {
1324
- for (var a = "", s = n ? "0" : "", o = 0; o <= t - 1; o++)
1325
- a += e[o] || s;
1326
- return a;
1327
- }
1328
- function Vn(e, t) {
1329
- return Array(t + 1).join(e);
1330
- }
1331
- function ca(e) {
1332
- var t = e + "", n = t[0] === "-" ? "-" : "";
1333
- n && (t = t.substring(1));
1334
- var a = t.split(/[eE]/g), s = a[0], o = a[1];
1335
- if (o = Number(o), !o)
1336
- return n + s;
1337
- s = s.replace(".", "");
1338
- var i = 1 + o, c = s.length;
1339
- return i < 0 ? s = "0." + Vn("0", Math.abs(i)) + s : i >= c ? s = s + Vn("0", i - c) : s = (s.substring(0, i) || "0") + "." + s.substring(i), n + s;
1340
- }
1341
- function Bn(e, t, n) {
1342
- if (["", "-"].indexOf(e) !== -1)
1343
- return e;
1344
- var a = (e.indexOf(".") !== -1 || n) && t, s = jn(e), o = s.beforeDecimal, i = s.afterDecimal, c = s.hasNegation, l = parseFloat("0." + (i || "0")), u = i.length <= t ? "0." + i : l.toFixed(t), d = u.split("."), m = o;
1345
- o && Number(d[0]) && (m = o.split("").reverse().reduce(function(p, g, j) {
1346
- return p.length > j ? (Number(p[0]) + Number(g)).toString() + p.substring(1, p.length) : g + p;
1347
- }, d[0]));
1348
- var x = la(d[1] || "", t, n), v = c ? "-" : "", h = a ? "." : "";
1349
- return "" + v + m + h + x;
1350
- }
1351
- function qe(e, t) {
1352
- if (e.value = e.value, e !== null) {
1353
- if (e.createTextRange) {
1354
- var n = e.createTextRange();
1355
- return n.move("character", t), n.select(), !0;
1356
- }
1357
- return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
1358
- }
1359
- }
1360
- var da = wo(function(e, t) {
1361
- for (var n = 0, a = 0, s = e.length, o = t.length; e[n] === t[n] && n < s; )
1362
- n++;
1363
- for (; e[s - 1 - a] === t[o - 1 - a] && o - a > n && s - a > n; )
1364
- a++;
1365
- return {
1366
- from: { start: n, end: s - a },
1367
- to: { start: n, end: o - a }
1368
- };
1369
- }), Io = function(e, t) {
1370
- var n = Math.min(e.selectionStart, t);
1371
- return {
1372
- from: { start: n, end: e.selectionEnd },
1373
- to: { start: n, end: t }
1374
- };
1375
- };
1376
- function Do(e, t, n) {
1377
- return Math.min(Math.max(e, t), n);
1378
- }
1379
- function zt(e) {
1380
- return Math.max(e.selectionStart, e.selectionEnd);
1381
- }
1382
- function $o() {
1383
- return typeof navigator < "u" && !(navigator.platform && /iPhone|iPod/.test(navigator.platform));
1384
- }
1385
- function Fo(e) {
1386
- return {
1387
- from: {
1388
- start: 0,
1389
- end: 0
1390
- },
1391
- to: {
1392
- start: 0,
1393
- end: e.length
1394
- },
1395
- lastValue: ""
1396
- };
1397
- }
1398
- function Oo(e) {
1399
- var t = e.currentValue, n = e.formattedValue, a = e.currentValueIndex, s = e.formattedValueIndex;
1400
- return t[a] === n[s];
1401
- }
1402
- function Eo(e, t, n, a, s, o, i) {
1403
- i === void 0 && (i = Oo);
1404
- var c = s.findIndex(function(b) {
1405
- return b;
1406
- }), l = e.slice(0, c);
1407
- !t && !n.startsWith(l) && (t = l, n = l + n, a = a + l.length);
1408
- for (var u = n.length, d = e.length, m = {}, x = new Array(u), v = 0; v < u; v++) {
1409
- x[v] = -1;
1410
- for (var h = 0, p = d; h < p; h++) {
1411
- var g = i({
1412
- currentValue: n,
1413
- lastValue: t,
1414
- formattedValue: e,
1415
- currentValueIndex: v,
1416
- formattedValueIndex: h
1417
- });
1418
- if (g && m[h] !== !0) {
1419
- x[v] = h, m[h] = !0;
1420
- break;
1421
- }
1422
- }
1423
- }
1424
- for (var j = a; j < u && (x[j] === -1 || !o(n[j])); )
1425
- j++;
1426
- var y = j === u || x[j] === -1 ? d : x[j];
1427
- for (j = a - 1; j > 0 && x[j] === -1; )
1428
- j--;
1429
- var f = j === -1 || x[j] === -1 ? 0 : x[j] + 1;
1430
- return f > y ? y : a - f < y - a ? f : y;
1431
- }
1432
- function Pn(e, t, n, a) {
1433
- var s = e.length;
1434
- if (t = Do(t, 0, s), a === "left") {
1435
- for (; t >= 0 && !n[t]; )
1436
- t--;
1437
- t === -1 && (t = n.indexOf(!0));
1438
- } else {
1439
- for (; t <= s && !n[t]; )
1440
- t++;
1441
- t > s && (t = n.lastIndexOf(!0));
1442
- }
1443
- return t === -1 && (t = s), t;
1444
- }
1445
- function To(e) {
1446
- for (var t = Array.from({ length: e.length + 1 }).map(function() {
1447
- return !0;
1448
- }), n = 0, a = t.length; n < a; n++)
1449
- t[n] = !!(yt(e[n]) || yt(e[n - 1]));
1450
- return t;
1451
- }
1452
- function ua(e, t, n, a, s, o) {
1453
- o === void 0 && (o = Me);
1454
- var i = So(function(h, p) {
1455
- var g, j;
1456
- return oa(h) ? (j = "", g = "") : typeof h == "number" || p ? (j = typeof h == "number" ? ca(h) : h, g = a(j)) : (j = s(h, void 0), g = a(j)), { formattedValue: g, numAsString: j };
1457
- }), c = E(function() {
1458
- return i(st(e) ? t : e, n);
1459
- }), l = c[0], u = c[1], d = function(h, p) {
1460
- h.formattedValue !== l.formattedValue && u({
1461
- formattedValue: h.formattedValue,
1462
- numAsString: h.value
1463
- }), o(h, p);
1464
- }, m = e, x = n;
1465
- st(e) && (m = l.numAsString, x = !0);
1466
- var v = i(m, x);
1467
- return te(function() {
1468
- u(v);
1469
- }, [v.formattedValue]), [l, d];
1470
- }
1471
- function Lo(e) {
1472
- return e.replace(/[^0-9]/g, "");
1473
- }
1474
- function Ro(e) {
1475
- return e;
1476
- }
1477
- function Ao(e) {
1478
- var t = e.type;
1479
- t === void 0 && (t = "text");
1480
- var n = e.displayType;
1481
- n === void 0 && (n = "input");
1482
- var a = e.customInput, s = e.renderText, o = e.getInputRef, i = e.format;
1483
- i === void 0 && (i = Ro);
1484
- var c = e.removeFormatting;
1485
- c === void 0 && (c = Lo);
1486
- var l = e.defaultValue, u = e.valueIsNumericString, d = e.onValueChange, m = e.isAllowed, x = e.onChange;
1487
- x === void 0 && (x = Me);
1488
- var v = e.onKeyDown;
1489
- v === void 0 && (v = Me);
1490
- var h = e.onMouseUp;
1491
- h === void 0 && (h = Me);
1492
- var p = e.onFocus;
1493
- p === void 0 && (p = Me);
1494
- var g = e.onBlur;
1495
- g === void 0 && (g = Me);
1496
- var j = e.value, y = e.getCaretBoundary;
1497
- y === void 0 && (y = To);
1498
- var f = e.isValidInputCharacter;
1499
- f === void 0 && (f = yt);
1500
- var b = e.isCharacterSame, N = sa(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), k = ua(j, l, !!u, i, c, d), I = k[0], F = I.formattedValue, C = I.numAsString, R = k[1], O = ee(), _ = ee({ formattedValue: F, numAsString: C }), U = function(T, B) {
1501
- _.current = { formattedValue: T.formattedValue, numAsString: T.value }, R(T, B);
1502
- }, V = E(!1), X = V[0], L = V[1], D = ee(null), P = ee({
1503
- setCaretTimeout: null,
1504
- focusTimeout: null
1505
- });
1506
- A(function() {
1507
- return L(!0), function() {
1508
- clearTimeout(P.current.setCaretTimeout), clearTimeout(P.current.focusTimeout);
1509
- };
1510
- }, []);
1511
- var H = i, J = function(T, B) {
1512
- var q = parseFloat(B);
1513
- return {
1514
- formattedValue: T,
1515
- value: B,
1516
- floatValue: isNaN(q) ? void 0 : q
1517
- };
1518
- }, $ = function(T, B, q) {
1519
- T.selectionStart === 0 && T.selectionEnd === T.value.length || (qe(T, B), P.current.setCaretTimeout = setTimeout(function() {
1520
- T.value === q && T.selectionStart !== B && qe(T, B);
1521
- }, 0));
1522
- }, Y = function(T, B, q) {
1523
- return Pn(T, B, y(T), q);
1524
- }, ie = function(T, B, q) {
1525
- var le = y(B), we = Eo(B, F, T, q, le, f, b);
1526
- return we = Pn(B, we, le), we;
1527
- }, M = function(T) {
1528
- var B = T.formattedValue;
1529
- B === void 0 && (B = "");
1530
- var q = T.input, le = T.source, we = T.event, ce = T.numAsString, ae;
1531
- if (q) {
1532
- var Se = T.inputValue || q.value, De = zt(q);
1533
- q.value = B, ae = ie(Se, B, De), ae !== void 0 && $(q, ae, B);
1534
- }
1535
- B !== F && U(J(B, ce), { event: we, source: le });
1536
- };
1537
- A(function() {
1538
- var T = _.current, B = T.formattedValue, q = T.numAsString;
1539
- (F !== B || C !== q) && U(J(F, C), {
1540
- event: void 0,
1541
- source: jt.props
1542
- });
1543
- }, [F, C]);
1544
- var z = D.current ? zt(D.current) : void 0, me = typeof window < "u" ? ws : A;
1545
- me(function() {
1546
- var T = D.current;
1547
- if (F !== _.current.formattedValue && T) {
1548
- var B = ie(_.current.formattedValue, F, z);
1549
- T.value = F, $(T, B, F);
1550
- }
1551
- }, [F]);
1552
- var G = function(T, B, q) {
1553
- var le = B.target, we = O.current ? Io(O.current, le.selectionEnd) : da(F, T), ce = Object.assign(Object.assign({}, we), { lastValue: F }), ae = c(T, ce), Se = H(ae);
1554
- if (ae = c(Se, void 0), m && !m(J(Se, ae))) {
1555
- var De = B.target, W = zt(De), re = ie(T, F, W);
1556
- return De.value = F, $(De, re, F), !1;
1557
- }
1558
- return M({
1559
- formattedValue: Se,
1560
- numAsString: ae,
1561
- inputValue: T,
1562
- event: B,
1563
- source: q,
1564
- input: B.target
1565
- }), !0;
1566
- }, pe = function(T, B) {
1567
- B === void 0 && (B = 0);
1568
- var q = T.selectionStart, le = T.selectionEnd;
1569
- O.current = { selectionStart: q, selectionEnd: le + B };
1570
- }, Ne = function(T) {
1571
- var B = T.target, q = B.value, le = G(q, T, jt.event);
1572
- le && x(T), O.current = void 0;
1573
- }, Ie = function(T) {
1574
- var B = T.target, q = T.key, le = B.selectionStart, we = B.selectionEnd, ce = B.value;
1575
- ce === void 0 && (ce = "");
1576
- var ae;
1577
- q === "ArrowLeft" || q === "Backspace" ? ae = Math.max(le - 1, 0) : q === "ArrowRight" ? ae = Math.min(le + 1, ce.length) : q === "Delete" && (ae = le);
1578
- var Se = 0;
1579
- q === "Delete" && le === we && (Se = 1);
1580
- var De = q === "ArrowLeft" || q === "ArrowRight";
1581
- if (ae === void 0 || le !== we && !De) {
1582
- v(T), pe(B, Se);
1583
- return;
1584
- }
1585
- var W = ae;
1586
- if (De) {
1587
- var re = q === "ArrowLeft" ? "left" : "right";
1588
- W = Y(ce, ae, re), W !== ae && T.preventDefault();
1589
- } else q === "Delete" && !f(ce[ae]) ? W = Y(ce, ae, "right") : q === "Backspace" && !f(ce[ae]) && (W = Y(ce, ae, "left"));
1590
- W !== ae && $(B, W, ce), v(T), pe(B, Se);
1591
- }, We = function(T) {
1592
- var B = T.target, q = function() {
1593
- var le = B.selectionStart, we = B.selectionEnd, ce = B.value;
1594
- if (ce === void 0 && (ce = ""), le === we) {
1595
- var ae = Y(ce, le);
1596
- ae !== le && $(B, ae, ce);
1597
- }
1598
- };
1599
- q(), requestAnimationFrame(function() {
1600
- q();
1601
- }), h(T), pe(B);
1602
- }, K = function(T) {
1603
- T.persist && T.persist();
1604
- var B = T.target, q = T.currentTarget;
1605
- D.current = B, P.current.focusTimeout = setTimeout(function() {
1606
- var le = B.selectionStart, we = B.selectionEnd, ce = B.value;
1607
- ce === void 0 && (ce = "");
1608
- var ae = Y(ce, le);
1609
- ae !== le && !(le === 0 && we === ce.length) && $(B, ae, ce), p(Object.assign(Object.assign({}, T), { currentTarget: q }));
1610
- }, 0);
1611
- }, fe = function(T) {
1612
- D.current = null, clearTimeout(P.current.focusTimeout), clearTimeout(P.current.setCaretTimeout), g(T);
1613
- }, _e = X && $o() ? "numeric" : void 0, ze = Object.assign({ inputMode: _e }, N, {
1614
- type: t,
1615
- value: F,
1616
- onChange: Ne,
1617
- onKeyDown: Ie,
1618
- onMouseUp: We,
1619
- onFocus: K,
1620
- onBlur: fe
1621
- });
1622
- if (n === "text")
1623
- return s ? Ce.createElement(Ce.Fragment, null, s(F, N) || null) : Ce.createElement("span", Object.assign({}, N, { ref: o }), F);
1624
- if (a) {
1625
- var tt = a;
1626
- return Ce.createElement(tt, Object.assign({}, ze, { ref: o }));
1627
- }
1628
- return Ce.createElement("input", Object.assign({}, ze, { ref: o }));
1629
- }
1630
- function Hn(e, t) {
1631
- var n = t.decimalScale, a = t.fixedDecimalScale, s = t.prefix;
1632
- s === void 0 && (s = "");
1633
- var o = t.suffix;
1634
- o === void 0 && (o = "");
1635
- var i = t.allowNegative, c = t.thousandsGroupStyle;
1636
- if (c === void 0 && (c = "thousand"), e === "" || e === "-")
1637
- return e;
1638
- var l = Rt(t), u = l.thousandSeparator, d = l.decimalSeparator, m = n !== 0 && e.indexOf(".") !== -1 || n && a, x = jn(e, i), v = x.beforeDecimal, h = x.afterDecimal, p = x.addNegation;
1639
- return n !== void 0 && (h = la(h, n, !!a)), u && (v = Co(v, u, c)), s && (v = s + v), o && (h = h + o), p && (v = "-" + v), e = v + (m && d || "") + h, e;
1640
- }
1641
- function Rt(e) {
1642
- var t = e.decimalSeparator;
1643
- t === void 0 && (t = ".");
1644
- var n = e.thousandSeparator, a = e.allowedDecimalSeparators;
1645
- return n === !0 && (n = ","), a || (a = [t, "."]), {
1646
- decimalSeparator: t,
1647
- thousandSeparator: n,
1648
- allowedDecimalSeparators: a
1649
- };
1650
- }
1651
- function Mo(e, t) {
1652
- e === void 0 && (e = "");
1653
- var n = new RegExp("(-)"), a = new RegExp("(-)(.)*(-)"), s = n.test(e), o = a.test(e);
1654
- return e = e.replace(/-/g, ""), s && !o && t && (e = "-" + e), e;
1655
- }
1656
- function Vo(e, t) {
1657
- return new RegExp("(^-)|[0-9]|" + ia(e), "g");
1658
- }
1659
- function Bo(e, t, n) {
1660
- return e === "" ? !0 : !(t != null && t.match(/\d/)) && !(n != null && n.match(/\d/)) && typeof e == "string" && !isNaN(Number(e));
1661
- }
1662
- function Po(e, t, n) {
1663
- var a;
1664
- t === void 0 && (t = Fo(e));
1665
- var s = n.allowNegative, o = n.prefix;
1666
- o === void 0 && (o = "");
1667
- var i = n.suffix;
1668
- i === void 0 && (i = "");
1669
- var c = n.decimalScale, l = t.from, u = t.to, d = u.start, m = u.end, x = Rt(n), v = x.allowedDecimalSeparators, h = x.decimalSeparator, p = e[m] === h;
1670
- if (yt(e) && (e === o || e === i) && t.lastValue === "")
1671
- return e;
1672
- if (m - d === 1 && v.indexOf(e[d]) !== -1) {
1673
- var g = c === 0 ? "" : h;
1674
- e = e.substring(0, d) + g + e.substring(d + 1, e.length);
1675
- }
1676
- var j = function(D, P, H) {
1677
- var J = !1, $ = !1;
1678
- o.startsWith("-") ? J = !1 : D.startsWith("--") ? (J = !1, $ = !0) : i.startsWith("-") && D.length === i.length ? J = !1 : D[0] === "-" && (J = !0);
1679
- var Y = J ? 1 : 0;
1680
- return $ && (Y = 2), Y && (D = D.substring(Y), P -= Y, H -= Y), { value: D, start: P, end: H, hasNegation: J };
1681
- }, y = j(e, d, m), f = y.hasNegation;
1682
- a = y, e = a.value, d = a.start, m = a.end;
1683
- var b = j(t.lastValue, l.start, l.end), N = b.start, k = b.end, I = b.value, F = e.substring(d, m);
1684
- e.length && I.length && (N > I.length - i.length || k < o.length) && !(F && i.startsWith(F)) && (e = I);
1685
- var C = 0;
1686
- e.startsWith(o) ? C += o.length : d < o.length && (C = d), e = e.substring(C), m -= C;
1687
- var R = e.length, O = e.length - i.length;
1688
- e.endsWith(i) ? R = O : (m > O || m > e.length - i.length) && (R = m), e = e.substring(0, R), e = Mo(f ? "-" + e : e, s), e = (e.match(Vo(h)) || []).join("");
1689
- var _ = e.indexOf(h);
1690
- e = e.replace(new RegExp(ia(h), "g"), function(D, P) {
1691
- return P === _ ? "." : "";
1692
- });
1693
- var U = jn(e, s), V = U.beforeDecimal, X = U.afterDecimal, L = U.addNegation;
1694
- return u.end - u.start < l.end - l.start && V === "" && p && !parseFloat(X) && (e = L ? "-" : ""), e;
1695
- }
1696
- function Ho(e, t) {
1697
- var n = t.prefix;
1698
- n === void 0 && (n = "");
1699
- var a = t.suffix;
1700
- a === void 0 && (a = "");
1701
- var s = Array.from({ length: e.length + 1 }).map(function() {
1702
- return !0;
1703
- }), o = e[0] === "-";
1704
- s.fill(!1, 0, n.length + (o ? 1 : 0));
1705
- var i = e.length;
1706
- return s.fill(!1, i - a.length + 1, i + 1), s;
1707
- }
1708
- function Wo(e) {
1709
- var t = Rt(e), n = t.thousandSeparator, a = t.decimalSeparator, s = e.prefix;
1710
- s === void 0 && (s = "");
1711
- var o = e.allowNegative;
1712
- if (o === void 0 && (o = !0), n === a)
1713
- throw new Error(`
1714
- Decimal separator can't be same as thousand separator.
1715
- thousandSeparator: ` + n + ` (thousandSeparator = {true} is same as thousandSeparator = ",")
1716
- decimalSeparator: ` + a + ` (default value for decimalSeparator is .)
1717
- `);
1718
- return s.startsWith("-") && o && (console.error(`
1719
- Prefix can't start with '-' when allowNegative is true.
1720
- prefix: ` + s + `
1721
- allowNegative: ` + o + `
1722
- `), o = !1), Object.assign(Object.assign({}, e), { allowNegative: o });
1723
- }
1724
- function zo(e) {
1725
- e = Wo(e), e.decimalSeparator, e.allowedDecimalSeparators, e.thousandsGroupStyle;
1726
- var t = e.suffix, n = e.allowNegative, a = e.allowLeadingZeros, s = e.onKeyDown;
1727
- s === void 0 && (s = Me);
1728
- var o = e.onBlur;
1729
- o === void 0 && (o = Me);
1730
- var i = e.thousandSeparator, c = e.decimalScale, l = e.fixedDecimalScale, u = e.prefix;
1731
- u === void 0 && (u = "");
1732
- var d = e.defaultValue, m = e.value, x = e.valueIsNumericString, v = e.onValueChange, h = sa(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), p = Rt(e), g = p.decimalSeparator, j = p.allowedDecimalSeparators, y = function(L) {
1733
- return Hn(L, e);
1734
- }, f = function(L, D) {
1735
- return Po(L, D, e);
1736
- }, b = st(m) ? d : m, N = x ?? Bo(b, u, t);
1737
- st(m) ? st(d) || (N = N || typeof d == "number") : N = N || typeof m == "number";
1738
- var k = function(L) {
1739
- return oa(L) ? L : (typeof L == "number" && (L = ca(L)), N && typeof c == "number" ? Bn(L, c, !!l) : L);
1740
- }, I = ua(k(m), k(d), !!N, y, f, v), F = I[0], C = F.numAsString, R = F.formattedValue, O = I[1], _ = function(L) {
1741
- var D = L.target, P = L.key, H = D.selectionStart, J = D.selectionEnd, $ = D.value;
1742
- if ($ === void 0 && ($ = ""), (P === "Backspace" || P === "Delete") && J < u.length) {
1743
- L.preventDefault();
1744
- return;
1745
- }
1746
- if (H !== J) {
1747
- s(L);
1748
- return;
1749
- }
1750
- P === "Backspace" && $[0] === "-" && H === u.length + 1 && n && qe(D, 1), c && l && (P === "Backspace" && $[H - 1] === g ? (qe(D, H - 1), L.preventDefault()) : P === "Delete" && $[H] === g && L.preventDefault()), j != null && j.includes(P) && $[H] === g && qe(D, H + 1);
1751
- var Y = i === !0 ? "," : i;
1752
- P === "Backspace" && $[H - 1] === Y && qe(D, H - 1), P === "Delete" && $[H] === Y && qe(D, H + 1), s(L);
1753
- }, U = function(L) {
1754
- var D = C;
1755
- if (D.match(/\d/g) || (D = ""), a || (D = ko(D)), l && c && (D = Bn(D, c, l)), D !== C) {
1756
- var P = Hn(D, e);
1757
- O({
1758
- formattedValue: P,
1759
- value: D,
1760
- floatValue: parseFloat(D)
1761
- }, {
1762
- event: L,
1763
- source: jt.event
1764
- });
1765
- }
1766
- o(L);
1767
- }, V = function(L) {
1768
- return L === g ? !0 : yt(L);
1769
- }, X = function(L) {
1770
- var D = L.currentValue, P = L.lastValue, H = L.formattedValue, J = L.currentValueIndex, $ = L.formattedValueIndex, Y = D[J], ie = H[$], M = da(P, D), z = M.to;
1771
- return J >= z.start && J < z.end && j && j.includes(Y) && ie === g ? !0 : Y === ie;
1772
- };
1773
- return Object.assign(Object.assign({}, h), {
1774
- value: R,
1775
- valueIsNumericString: !1,
1776
- isValidInputCharacter: V,
1777
- isCharacterSame: X,
1778
- onValueChange: O,
1779
- format: y,
1780
- removeFormatting: f,
1781
- getCaretBoundary: function(L) {
1782
- return Ho(L, e);
1783
- },
1784
- onKeyDown: _,
1785
- onBlur: U
1786
- });
1787
- }
1788
- function yn(e) {
1789
- var t = zo(e);
1790
- return Ce.createElement(Ao, Object.assign({}, t));
1791
- }
1792
- const rd = ({ InputContainer: e = Je, value: t, onChange: n, debounceMs: a, label: s, withoutLabel: o, placeholder: i, size: c, hidden: l, disabled: u, showClearIcon: d, clearValue: m, className: x, step: v, noSelectOnFocus: h, decimalScale: p, numberPrefix: g, numberSuffix: j, min: y, max: f }) => {
1793
- const b = S(() => {
1794
- if (!n)
1795
- return;
1796
- const R = m ?? null;
1797
- n(R ? Number(R) : null);
1798
- }, [m, n]), N = ee(null), [k, I] = E((t == null ? void 0 : t.toString()) ?? ""), F = S((R) => {
1799
- const O = R;
1800
- n && n(O == null || O === "" ? null : Number(O));
1801
- }, [n]), C = S((R) => {
1802
- var _, U;
1803
- let O = parseFloat(((U = (_ = R.target) == null ? void 0 : _.value) == null ? void 0 : U.replaceAll(" ", "")) ?? 0);
1804
- if (Number.isNaN(O) && (O = 0), !a) {
1805
- F(O.toString());
1806
- return;
1807
- }
1808
- I(O.toString()), N.current !== null && window.clearTimeout(N.current), N.current = window.setTimeout(() => {
1809
- F(O.toString());
1810
- }, a);
1811
- }, [a, F]);
1812
- return A(() => {
1813
- I(t === null ? "" : t.toString());
1814
- }, [f, y, t]), A(() => {
1815
- f !== void 0 && Number(k) > f && I(f.toString()), y !== void 0 && Number(k) < y && I(y.toString());
1816
- }, [k, f, y, I]), A(() => {
1817
- !n || t === null || (f !== void 0 && t > f && n(f), y !== void 0 && t < y && n(y));
1818
- }, [t, f, y, n]), /* @__PURE__ */ r.jsxs(e, { withoutLabel: o, label: s ?? "", hidden: l, className: x, children: [
1819
- /* @__PURE__ */ r.jsx(yn, { displayType: "input", thousandSeparator: " ", decimalScale: p, prefix: g, suffix: j, defaultValue: "", value: a ? k : (t == null ? void 0 : t.toString()) ?? "", placeholder: i ?? s, onFocus: (R) => {
1820
- !h && R.target.select();
1821
- }, onChange: C, hidden: l, disabled: u, className: w("form-control text-end w-100", {
1822
- [`form-control-${c}`]: c
1823
- }), step: v, min: y, max: f }),
1824
- d && t !== null && n && !u && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: b, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
1825
- ] });
1826
- }, ad = ({ InputContainer: e = Pe, formField: t, label: n, resetsFields: a, type: s, required: o, hidden: i, disabled: c, withoutLabel: l, className: u }) => {
1827
- const { register: d, formState: m, setValue: x } = He(), [v, h] = E(void 0), [p, g] = E(!1);
1828
- A(() => {
1829
- const y = t.split(".");
1830
- let f = m.errors;
1831
- y.forEach((b) => {
1832
- f !== void 0 && (f = f[b]);
1833
- }), h(f);
1834
- }, [m, t]), A(() => {
1835
- m.isSubmitted && g(!0);
1836
- }, [m]);
1837
- const j = v !== void 0;
1838
- return /* @__PURE__ */ r.jsxs(e, { isForCheckInput: !0, hidden: i, label: `${n}${o ? " *" : ""}`, isInvalid: j, withoutLabel: l, className: u, children: [
1839
- /* @__PURE__ */ r.jsx(ye.Check, { id: `check-${t}`, type: s ?? "checkbox", label: `${n}${o ? " *" : ""}`, ...d(t, {
1840
- onChange: () => {
1841
- a && a.forEach((y) => x(y, null, { shouldDirty: !0, shouldValidate: p }));
1842
- }
1843
- }), isInvalid: j, hidden: i, disabled: c, className: "w-100" }),
1844
- v && /* @__PURE__ */ r.jsx(Xe, { message: v.message })
1845
- ] });
1846
- }, sd = ({ InputContainer: e = Pe, label: t, formField: n, options: a, resetsFields: s, required: o, disabled: i, hidden: c, className: l }) => {
1847
- const { register: u, formState: d, setValue: m, watch: x } = He(), [v, h] = E(void 0), [p, g] = E(!1), j = te(() => a, [a]);
1848
- A(() => {
1849
- const f = n.split(".");
1850
- let b = d.errors;
1851
- f.forEach((N) => {
1852
- b !== void 0 && (b = b[N]);
1853
- }), h(b);
1854
- }, [d, n]), A(() => {
1855
- d.isSubmitted && g(!0);
1856
- }, [d]);
1857
- const y = v !== void 0;
1858
- return /* @__PURE__ */ r.jsxs(e, { isForRadioInput: !0, hidden: c, withoutLabel: !t, label: `${t}${o ? " *" : ""}`, isInvalid: y, className: l, children: [
1859
- j.map((f) => /* @__PURE__ */ r.jsx(ye.Check, { id: `radio-${f.id}`, label: f.name, type: "radio", value: f.id ?? "", checked: x(n) === f.id, ...u(n, {
1860
- onChange: () => {
1861
- s && s.forEach((b) => m(b, null, { shouldDirty: !0, shouldValidate: p }));
1862
- }
1863
- }), isInvalid: y, hidden: c, disabled: i, className: "w-100" }, f.id)),
1864
- v && /* @__PURE__ */ r.jsx(Xe, { message: v.message })
1865
- ] });
1866
- }, od = ({ InputContainer: e = Pe, formField: t, label: n, size: a, defaultSelection: s, resetsFields: o, isNumber: i, required: c, hidden: l, disabled: u, items: d, onSearchQueryChange: m, selectedItemNavigateTo: x, texts: v, dropdownItemsNameWidth: h, isLoading: p, withoutLabel: g, additionalColumns: j, CustomOnChangeComponent: y, displayIdAsName: f, onSelect: b, className: N }) => {
1867
- const { formState: k, setValue: I, watch: F, control: C } = He(), [R, O] = E(void 0), [_, U] = E(!1), [V, X] = E(!1), L = F(t) ?? null, D = L === (s == null ? void 0 : s.id) ? s == null ? void 0 : s.name : F(`${t}-DropdownName`), P = te(() => L == null ? null : { id: L ?? null, name: D ?? "" }, [L, D]), H = S(() => {
1868
- const G = t.split(".");
1869
- let pe = k.errors;
1870
- G.forEach((Ne) => {
1871
- pe !== void 0 && (pe = pe[Ne]);
1872
- }), O(pe);
1873
- }, [k, t]), J = S((G) => {
1874
- if ((G == null ? void 0 : G.id) === L)
1875
- return;
1876
- if (b && b(G), o && o.forEach((Ne) => I(Ne, null, { shouldDirty: !0, shouldValidate: V })), G === null) {
1877
- I(t, null, {
1878
- shouldDirty: !0,
1879
- shouldValidate: V
1880
- }), I(`${t}-DropdownName`, null);
1881
- return;
1882
- }
1883
- let pe = null;
1884
- i ? pe = (G == null ? void 0 : G.id) !== null && (G == null ? void 0 : G.id) !== "" ? parseInt(G.id.toString(), 10) : null : pe = G.id === null || G.id === void 0 || G.id === "" ? null : G.id, I(t, pe, {
1885
- shouldDirty: !0,
1886
- shouldValidate: V
1887
- }), I(`${t}-DropdownName`, G.name ?? "");
1888
- }, [I, t, V, i, o, L, b]), $ = S((G) => {
1889
- U(!1), J(G);
1890
- }, [J]), Y = S(() => {
1891
- U(!1);
1892
- }, []);
1893
- A(() => {
1894
- H();
1895
- }, [H]), A(() => {
1896
- k.isSubmitted && X(!0);
1897
- }, [k]);
1898
- const ie = ee(null), M = R !== void 0, z = x !== void 0, me = z && P !== null;
1899
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(e, { label: `${n}${c ? " *" : ""}`, hidden: l, withoutLabel: g, isInvalid: M, inputContainerClassName: w({ "luminus-dropdown-select-open": _ }), className: N, children: [
1900
- /* @__PURE__ */ r.jsxs(ra, { currentSelection: P, selectedItemNavigateTo: x, children: [
1901
- f && (P == null ? void 0 : P.name) && /* @__PURE__ */ r.jsx(Z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: P.name }),
1902
- /* @__PURE__ */ r.jsx(fn, { control: C, name: t, render: () => /* @__PURE__ */ r.jsx(ye.Select, { size: a, onMouseDown: (G) => {
1903
- G.currentTarget.focus(), G.preventDefault();
1904
- }, onClick: () => {
1905
- !z && !u && U(!0);
1906
- }, ref: ie, value: L ?? "", onChange: () => {
1907
- }, isInvalid: M, hidden: l, className: w("w-100", {
1908
- "luminus-dropdown-picker-disabled": u,
1909
- "luminus-dropdown-picker-link": me
1910
- }), children: /* @__PURE__ */ r.jsx("option", { value: L, children: f ? L : (D == null ? void 0 : D.length) > 0 ? D : L }) }) }),
1911
- y || !u && z ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
1912
- !y && !u && z && /* @__PURE__ */ r.jsx(ne, { size: "sm", color: "secondary", onClick: (G) => {
1913
- G.preventDefault(), G.stopPropagation(), U(!0);
1914
- }, children: /* @__PURE__ */ r.jsx(hr, {}) }),
1915
- y ?? null
1916
- ] }) : null
1917
- ] }),
1918
- R && /* @__PURE__ */ r.jsx(Xe, { message: R.message }),
1919
- ie.current && /* @__PURE__ */ r.jsx(wn, { show: _, onCancel: Y, items: d, currentSelection: P, onSelectionChange: $, onSearchQueryChange: m, texts: v, itemsNameWidth: h, additionalColumns: j, displayIdAsName: f, isLoading: p, disabled: u, inputRef: ie })
1920
- ] }) });
1921
- }, id = ({ InputContainer: e = Pe, label: t, formField: n, hidden: a, required: s, placeholder: o, disabled: i, showClearIcon: c, resetsFields: l, multiple: u, accept: d, withoutLabel: m, className: x }) => {
1922
- const { watch: v, setValue: h, register: p, formState: g } = He(), [j, y] = E(!1), [f, b] = E(void 0), N = S(() => {
1923
- h(n, "");
1924
- }, [h, n]), k = S(() => {
1925
- const F = n.split(".");
1926
- let C = g.errors;
1927
- F.forEach((R) => {
1928
- C !== void 0 && (C = C[R]);
1929
- }), b(C);
1930
- }, [g, n]);
1931
- A(k, [k]), A(() => {
1932
- g.isSubmitted && y(!0);
1933
- }, [g]);
1934
- const I = f !== void 0;
1935
- return /* @__PURE__ */ r.jsxs(e, { label: `${t}${s ? "*" : ""}`, hidden: a, withoutLabel: m, isInvalid: I, className: x, children: [
1936
- /* @__PURE__ */ r.jsx(Xa, { type: "file", multiple: u, accept: d.join(", "), placeholder: o ?? t, isInvalid: I, hidden: a, disabled: i, className: "w-100", ...p(n, {
1937
- onChange: () => {
1938
- l && l.forEach((F) => h(F, null, { shouldDirty: !0, shouldValidate: j }));
1939
- }
1940
- }) }),
1941
- c && v(n) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: N, children: /* @__PURE__ */ r.jsx(Oe, {}) }) }),
1942
- f && /* @__PURE__ */ r.jsx(Xe, { message: f.message })
1943
- ] });
1944
- }, ld = ({ children: e, onStorno: t, noSpacer: n }) => {
1945
- const { formState: a } = He(), [s, o] = E(!1);
1946
- return A(() => {
1947
- o(Object.keys(a.dirtyFields).length > 0);
1948
- }, [a]), s ? /* @__PURE__ */ r.jsx(ho, { onStorno: t, noSpacer: n, children: e }) : null;
1949
- }, cd = ({ InputContainer: e = Pe, options: t, formField: n, label: a, size: s, resetsFields: o, isNumber: i, required: c, hidden: l, disabled: u, withoutLabel: d, noSortOptions: m, suffixIdToName: x, className: v }) => {
1950
- const { texts: { customSelect: h } } = Q(ge), { formState: p, setValue: g, watch: j, control: y } = He(), [f, b] = E(void 0), [N, k] = E(!1), [I, F] = E(!1), [C, R] = E(""), O = j(n), _ = te(() => t.find(($) => $.id === O) ?? null, [t, O]), U = S(() => {
1951
- const $ = n.split(".");
1952
- let Y = p.errors;
1953
- $.forEach((ie) => {
1954
- Y !== void 0 && (Y = Y[ie]);
1955
- }), b(Y);
1956
- }, [p, n]), V = S(($) => {
1957
- if (($ == null ? void 0 : $.id) === O)
1958
- return;
1959
- if (o && o.forEach((ie) => g(ie, null, { shouldDirty: !0, shouldValidate: I })), $ === null) {
1960
- g(n, null, {
1961
- shouldDirty: !0,
1962
- shouldValidate: I
1963
- });
1964
- return;
1965
- }
1966
- let Y = null;
1967
- i ? Y = ($ == null ? void 0 : $.id) !== null && ($ == null ? void 0 : $.id) !== "" ? parseInt($.id.toString(), 10) : null : Y = $.id === null || $.id === void 0 || $.id === "" ? null : $.id, g(n, Y, {
1968
- shouldDirty: !0,
1969
- shouldValidate: I
1970
- });
1971
- }, [g, n, i, o, O, I]), X = S(($) => {
1972
- k(!1), V($);
1973
- }, [V]), L = S(($) => {
1974
- R($);
1975
- }, []);
1976
- A(() => {
1977
- U();
1978
- }, [U]), A(() => {
1979
- p.isSubmitted && F(!0);
1980
- }, [p]);
1981
- const D = S(($) => {
1982
- var Y;
1983
- return $ === null ? "" : !$.name || $.name.length === 0 ? ((Y = $.id) == null ? void 0 : Y.toString()) ?? "" : x ? `${$.name} (${$.id})` : $.name;
1984
- }, [x]), P = te(() => t.map(($) => ({
1985
- id: $.id,
1986
- name: D($)
1987
- })).filter(($) => en($.name, C)).sort(($, Y) => m ? 0 : ($.name ?? "").localeCompare(Y.name ?? "")), [t, m, C, D]), H = ee(null), J = f !== void 0;
1988
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(e, { label: `${a}${c ? " *" : ""}`, hidden: l, withoutLabel: d, isInvalid: J, inputContainerClassName: w({ "luminus-dropdown-select-open": N }), className: v, children: [
1989
- /* @__PURE__ */ r.jsx(fn, { control: y, name: n, render: () => /* @__PURE__ */ r.jsx(ye.Select, { size: s, onMouseDown: ($) => {
1990
- $.currentTarget.focus(), $.preventDefault();
1991
- }, onClick: () => {
1992
- k(!0);
1993
- }, ref: H, value: O ?? "", onChange: () => {
1994
- }, isInvalid: J, hidden: l, disabled: u, className: "w-100", children: /* @__PURE__ */ r.jsx("option", { value: (_ == null ? void 0 : _.id) ?? "", children: D(_) }) }) }),
1995
- f && /* @__PURE__ */ r.jsx(Xe, { message: f.message }),
1996
- H.current && /* @__PURE__ */ r.jsx(wn, { show: N, onCancel: () => k(!1), items: P, currentSelection: _ ?? null, onSelectionChange: X, onSearchQueryChange: L, texts: h, disabled: u, inputRef: H, autoHideSearch: !0, allItemsLength: t.length })
1997
- ] }) });
1998
- }, dd = ({ InputContainer: e = Pe, formField: t, label: n, placeholder: a, size: s, resetsFields: o, showClearIcon: i, clearValue: c, required: l, hidden: u, disabled: d, withoutLabel: m, step: x, stepperStep: v = 1, className: h, min: p, max: g }) => {
1999
- const { register: j, formState: y, setValue: f, watch: b } = He(), [N, k] = E(void 0), [I, F] = E(!1), C = S((V, X, L) => {
2000
- f(V, ht(X, p, g), L);
2001
- }, [g, p, f]), R = S(() => {
2002
- const V = c ?? null;
2003
- C(t, V !== null ? Number(V) : null, {
2004
- shouldDirty: !0,
2005
- shouldValidate: I
2006
- });
2007
- }, [c, C, t, I]), O = S(() => {
2008
- const V = t.split(".");
2009
- let X = y.errors;
2010
- V.forEach((L) => {
2011
- X !== void 0 && (X = X[L]);
2012
- }), k(X);
2013
- }, [y, t]);
2014
- A(() => {
2015
- O();
2016
- }, [O]), A(() => {
2017
- y.isSubmitted && F(!0);
2018
- }, [y]);
2019
- const _ = N !== void 0, U = b(t);
2020
- return /* @__PURE__ */ r.jsxs(e, { label: `${n}${l ? " *" : ""}`, hidden: u, withoutLabel: m, isInvalid: _, className: h, children: [
2021
- /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
2022
- /* @__PURE__ */ r.jsx(ye.Control, { type: "number", placeholder: a ?? n, size: s, ...j(t, {
2023
- setValueAs: (V) => V == null || V === "" ? null : ht(Number(V), p, g),
2024
- min: p,
2025
- max: g,
2026
- onChange: () => {
2027
- o && o.forEach((V) => f(V, null, { shouldDirty: !0, shouldValidate: I }));
2028
- }
2029
- }), isInvalid: _, hidden: u, disabled: d, className: "w-100 luminus-numeric-stepper", step: x, min: p, max: g }),
2030
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !d && /* @__PURE__ */ r.jsx(ne, { size: "sm", onClick: (V) => {
2031
- V.preventDefault(), V.stopPropagation(), C(t, ((U ? Number(U) : 0) - v).toString(), { shouldDirty: !0, shouldValidate: I });
2032
- }, children: /* @__PURE__ */ r.jsx(gr, {}) }) }),
2033
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !d && /* @__PURE__ */ r.jsx(ne, { size: "sm", onClick: (V) => {
2034
- V.preventDefault(), V.stopPropagation(), C(t, ((U ? Number(U) : 0) + v).toString(), { shouldDirty: !0, shouldValidate: I });
2035
- }, children: /* @__PURE__ */ r.jsx(pr, {}) }) })
2036
- ] }),
2037
- i && b(t) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: R, children: /* @__PURE__ */ r.jsx(Oe, {}) }) }),
2038
- N && /* @__PURE__ */ r.jsx(Xe, { message: N.message })
2039
- ] });
2040
- }, ud = ({ InputContainer: e = Pe, formField: t, label: n, placeholder: a, resetsFields: s, showClearIcon: o, clearValue: i, required: c, hidden: l, disabled: u, withoutLabel: d, step: m, size: x, CustomOnChangeComponent: v, noSelectOnFocus: h, className: p, decimalScale: g = 2, numberPrefix: j, numberSuffix: y, min: f, max: b }) => {
2041
- const { formState: N, setValue: k, watch: I, control: F } = He(), [C, R] = E(void 0), [O, _] = E(!1), U = S(() => {
2042
- const D = i ?? null;
2043
- k(t, D !== null ? Number(D) : null, {
2044
- shouldDirty: !0,
2045
- shouldValidate: O
2046
- });
2047
- }, [i, k, t, O]), V = S(() => {
2048
- const D = t.split(".");
2049
- let P = N.errors;
2050
- D.forEach((H) => {
2051
- P !== void 0 && (P = P[H]);
2052
- }), R(P);
2053
- }, [N, t]);
2054
- A(() => {
2055
- V();
2056
- }, [V]), A(() => {
2057
- N.isSubmitted && _(!0);
2058
- }, [N]);
2059
- const X = I(t);
2060
- A(() => {
2061
- b !== void 0 && X > b && k(t, b), f !== void 0 && X < f && k(t, f);
2062
- }, [t, X, b, f, k]);
2063
- const L = C !== void 0;
2064
- return /* @__PURE__ */ r.jsxs(e, { label: `${n}${c ? " *" : ""}`, hidden: l, withoutLabel: d, isInvalid: L, className: p, children: [
2065
- /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
2066
- /* @__PURE__ */ r.jsx(fn, { control: F, name: t, render: ({ field: { ref: D, onChange: P, name: H, value: J } }) => /* @__PURE__ */ r.jsx(yn, { displayType: "input", thousandSeparator: " ", decimalScale: g, prefix: j, suffix: y, defaultValue: "", name: H, value: J, placeholder: a ?? n, onFocus: ($) => {
2067
- !h && $.target.select();
2068
- }, onChange: ($) => {
2069
- var ie, M;
2070
- const Y = parseFloat(((M = (ie = $.target) == null ? void 0 : ie.value) == null ? void 0 : M.replaceAll(" ", "")) ?? 0);
2071
- s && s.forEach((z) => k(z, null, { shouldDirty: !0, shouldValidate: O })), P(Y == null || Number.isNaN(Y) ? null : Number(Y));
2072
- }, hidden: l, disabled: u, className: w("form-control text-end w-100", {
2073
- "is-invalid": L
2074
- }, {
2075
- [`form-control-${x}`]: x
2076
- }), step: m, getInputRef: D, min: f, max: b }) }),
2077
- v && /* @__PURE__ */ r.jsx("div", { className: "custom-picker-button", children: v })
2078
- ] }),
2079
- o && I(t) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(ne, { color: "secondary", size: "sm", onClick: U, children: /* @__PURE__ */ r.jsx(Oe, {}) }) }),
2080
- C && /* @__PURE__ */ r.jsx(Xe, { message: C.message })
2081
- ] });
2082
- }, fd = ({ color: e = "primary", icon: t = /* @__PURE__ */ r.jsx(mr, { size: 12 }), inputId: n = "context-file-input", accept: a = "*", onUpload: s, multiple: o, className: i, children: c, ...l }) => {
2083
- const u = (d) => {
2084
- d.target.files && (s(d.target.files), d.target.value = "");
2085
- };
2086
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2087
- /* @__PURE__ */ r.jsxs("label", { htmlFor: n, className: w(`btn luminus-dropdown-item text-nowrap rounded text-${e} ${i ?? ""}`, es.item), ...l, children: [
2088
- t,
2089
- c
2090
- ] }),
2091
- /* @__PURE__ */ r.jsx("input", { id: n, type: "file", accept: a, onChange: u, hidden: !0, multiple: o })
2092
- ] });
2093
- }, Uo = "_divider_1e6rk_1", Go = {
2094
- divider: Uo
2095
- }, md = ({ className: e }) => /* @__PURE__ */ r.jsx(ts.Divider, { className: w("luminus-dropdown-divider", e, Go.divider) }), bn = ["slice", "options", "formats", "conditions"], Wn = (e) => {
2096
- const t = e.current.flexmonster.getReport({ withDefaults: !0 });
2097
- if (typeof t == "string")
2098
- throw alert("report is string"), new Error("report is string");
2099
- const n = {};
2100
- return bn.forEach((a) => {
2101
- n[a] = t[a];
2102
- }), JSON.stringify(n);
2103
- }, Yo = (e) => {
2104
- if (e.settings) {
2105
- const t = JSON.parse(e.settings);
2106
- return bn.forEach((n) => {
2107
- t[n] === void 0 && (t[n] = null);
2108
- }), t;
2109
- }
2110
- return {};
2111
- }, Ko = (e) => {
2112
- const t = {};
2113
- return bn.forEach((n) => {
2114
- t[n] = (e == null ? void 0 : e[n]) ?? void 0;
2115
- }), t;
2116
- }, qo = ({ dataSource: e, settings: t, pivotRef: n, localization: a, licenseKey: s, enabled: o = !0 }) => {
2117
- const { texts: { reports: i } } = Q(ge), [c, l] = E(!1), u = ee(null), d = n ?? u, m = te(() => ({
2118
- localization: a
2119
- }), [a]), x = S((h) => {
2120
- delete h[0], delete h[1], delete h[2];
2121
- const p = [
2122
- {
2123
- id: "fm-tab-expand",
2124
- title: i.expandAll,
2125
- handler: d.current.flexmonster.expandAllData,
2126
- icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'
2127
- },
2128
- {
2129
- id: "fm-tab-collapse",
2130
- title: i.collapseAll,
2131
- handler: d.current.flexmonster.collapseAllData,
2132
- icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'
2133
- }
2134
- ];
2135
- return h.unshift({
2136
- id: "fm-tab-expand",
2137
- title: i.expand,
2138
- icon: '<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',
2139
- menu: p,
2140
- rightGroup: !0
2141
- }), h;
2142
- }, [d, i.collapseAll, i.expand, i.expandAll]), v = (h) => {
2143
- const p = h.getTabs();
2144
- h.getTabs = () => x(p);
2145
- };
2146
- return A(() => {
2147
- var h;
2148
- c && o && ((h = d.current) == null || h.flexmonster.updateData(e), console.log("Updating flexmonster dataSource to: ", e));
2149
- }, [e, o, c, d]), A(() => {
2150
- var h, p, g;
2151
- if (c && o) {
2152
- const { options: j, conditions: y, formats: f, slice: b, ...N } = (h = d.current) == null ? void 0 : h.flexmonster.getReport();
2153
- if (N === void 0 || typeof N == "string")
2154
- return;
2155
- const k = Ko(t);
2156
- k.options = {
2157
- ...t == null ? void 0 : t.options,
2158
- grid: { ...(p = t == null ? void 0 : t.options) == null ? void 0 : p.grid, autoSwitchToCompact: !1 }
2159
- };
2160
- const I = { ...N, ...k };
2161
- (g = d.current) == null || g.flexmonster.setReport(I), console.log("Refreshing flexmonster settings. New report: ", I);
2162
- }
2163
- }, [o, c, d, t]), /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx(
2164
- Fs,
2165
- {
2166
- ref: d,
2167
- global: m,
2168
- licenseKey: s,
2169
- toolbar: !0,
2170
- height: "100%",
2171
- beforetoolbarcreated: v,
2172
- ready: () => {
2173
- l(!0);
2174
- },
2175
- width: "100%"
2176
- }
2177
- ) });
2178
- }, Qo = (e, t, n, a) => {
2179
- const { texts: { reports: s } } = Q(ge), { prompt: o } = ns(), { confirm: i } = Ot(), c = et(), { user: l } = Q(Et), { startLoading: u, stopLoading: d } = Q(Tt), { addNotification: m } = xr(), x = S(async (j) => {
2180
- u("report-versionSavingAs");
2181
- try {
2182
- const y = await c.post("/reports/version", j);
2183
- m(s.saveSuccessful, "success"), await a(y.data);
2184
- } finally {
2185
- d("report-versionSavingAs");
2186
- }
2187
- }, [m, a, c, s.saveSuccessful, u, d]), v = S(async () => {
2188
- if (n === null) {
2189
- m("none open", "warning");
2190
- return;
2191
- }
2192
- if (!await i(s.confirmOverwriteSave))
2193
- return;
2194
- const y = Wn(t);
2195
- x({
2196
- reportSourceName: e,
2197
- reportVersionId: n,
2198
- settings: y
2199
- });
2200
- }, [
2201
- m,
2202
- i,
2203
- t,
2204
- e,
2205
- s.confirmOverwriteSave,
2206
- x,
2207
- n
2208
- ]), h = S(async () => {
2209
- const j = await o(s.enterName, { input: "input", required: !0 });
2210
- if (j === null)
2211
- return;
2212
- const y = Wn(t);
2213
- x({
2214
- reportSourceName: e,
2215
- name: j,
2216
- settings: y
2217
- });
2218
- }, [t, o, e, s.enterName, x]), p = S(async () => {
2219
- u("report-versionSavingAs");
2220
- try {
2221
- await c.post("/reports/version", {
2222
- reportVersionId: n ?? void 0,
2223
- reportSourceName: e,
2224
- isArchived: !0
2225
- }), m(s.deleteSuccessful, "success");
2226
- } finally {
2227
- d("report-versionSavingAs");
2228
- }
2229
- }, [
2230
- m,
2231
- c,
2232
- e,
2233
- s.deleteSuccessful,
2234
- n,
2235
- u,
2236
- d
2237
- ]), g = S(async () => {
2238
- u("report-versionSavingAs");
2239
- try {
2240
- await c.post("/reports/version-restrictions", {
2241
- reportVersionId: n ?? void 0,
2242
- userRestricts: [
2243
- {
2244
- employeeId: l.personalNumber,
2245
- addRights: !1
2246
- }
2247
- ]
2248
- }), m(s.detachSuccessful, "success");
2249
- } finally {
2250
- d("report-versionSavingAs");
2251
- }
2252
- }, [
2253
- m,
2254
- c,
2255
- s.detachSuccessful,
2256
- n,
2257
- u,
2258
- d,
2259
- l.personalNumber
2260
- ]);
2261
- return { saveAs: h, save: v, archive: p, detach: g };
2262
- }, Zo = (e) => {
2263
- const t = et(), { startLoading: n, stopLoading: a } = Q(Tt);
2264
- return { changeEmployeeRights: S(async (o, i) => {
2265
- let c = null;
2266
- n("reportSharing-addPerson");
2267
- try {
2268
- c = (await t.post("/reports/version-restrictions", {
2269
- reportVersionId: e,
2270
- userRestricts: [
2271
- {
2272
- employeeId: o,
2273
- addRights: i
2274
- }
2275
- ]
2276
- })).data;
2277
- } finally {
2278
- a("reportSharing-addPerson");
2279
- }
2280
- return c;
2281
- }, [t, e, n, a]) };
2282
- }, Jo = ({ isOpen: e, onHide: t, usersData: n, setUsersData: a, reportVersionId: s, EmployeePicker: o }) => {
2283
- const { ProjectIconComponent: i, texts: { reports: c } } = Q(ge), { confirm: l } = Ot(), [u, d] = E(null), { changeEmployeeRights: m } = Zo(s), x = S(async () => {
2284
- if (u === null)
2285
- return;
2286
- const h = await m(u, !0);
2287
- a(s, h);
2288
- }, [u, m, s, a]), v = S(async (h) => {
2289
- if (!await l(c.removeSharingWith(h)))
2290
- return;
2291
- const g = await m(h, !1);
2292
- a(s, g);
2293
- }, [m, l, s, c, a]);
2294
- return /* @__PURE__ */ r.jsxs(Ve, { show: e, onHide: t, children: [
2295
- /* @__PURE__ */ r.jsx(Ve.Header, { closeButton: !0, children: /* @__PURE__ */ r.jsx(Ve.Title, { children: c.reportSharing }) }),
2296
- /* @__PURE__ */ r.jsxs(Ve.Body, { children: [
2297
- /* @__PURE__ */ r.jsx(Z, { variant: "h6", children: c.sharedWith }),
2298
- /* @__PURE__ */ r.jsxs(so, { variant: "flush", children: [
2299
- n && n.length === 0 ? /* @__PURE__ */ r.jsx("div", { className: "px-2", children: c.noone.toLowerCase() }) : null,
2300
- n == null ? void 0 : n.map((h) => /* @__PURE__ */ r.jsxs(xn, { className: "d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1", children: [
2301
- h.lastName,
2302
- " ",
2303
- h.firstName,
2304
- " [",
2305
- h.id,
2306
- "]",
2307
- /* @__PURE__ */ r.jsx(ne, { color: "danger", onClick: () => v(h.id), children: /* @__PURE__ */ r.jsx(i, { icon: "delete" }) })
2308
- ] }, h.id))
2309
- ] }),
2310
- /* @__PURE__ */ r.jsx(Z, { variant: "h6", className: "mt-2 mb-2", children: c.addSharing }),
2311
- /* @__PURE__ */ r.jsxs("div", { className: "d-flex gap-2 align-items-center", children: [
2312
- /* @__PURE__ */ r.jsx("div", { className: "flex-grow-1", children: /* @__PURE__ */ r.jsx(o, { defaultSelection: null, label: c.shareWith, onSelect: (h) => {
2313
- d(h === null ? null : Number(h.id));
2314
- } }) }),
2315
- /* @__PURE__ */ r.jsx(Xt, { onClick: x, disabled: u === null, children: c.add })
2316
- ] })
2317
- ] })
2318
- ] });
2319
- }, Xo = (e, t) => {
2320
- const [n, a] = E(null);
2321
- return A(() => {
2322
- e.then(({ default: s }) => {
2323
- const o = t !== void 0 ? t(s) : s;
2324
- a(o);
2325
- });
2326
- }, [t, e]), { mappings: n };
2327
- }, hd = ({ reportType: e, title: t, data: n, filterElements: a, getReportRoute: s, localization: o, licenseKey: i, EmployeePicker: c, localizationJsonFile: l, localizationTransformer: u }) => {
2328
- const { texts: { reports: d } } = Q(ge), { confirm: m } = Ot(), x = Ds(), { id: v } = $s(), h = te(() => v === void 0 ? null : Number(v), [v]), p = S((M) => {
2329
- const z = M === null ? "" : M.toString();
2330
- x(kt(s(e), { id: z }), {
2331
- replace: !0
2332
- });
2333
- }, [s, x, e]), [g, j] = E(!1), y = ee(null), { user: f } = Q(Et), { data: b, reloadData: N, setData: k } = Rs(`/reports/${e}`), { mappings: I } = Xo(l, u), [F, C] = E({}), R = S((M) => {
2334
- if (b === null)
2335
- return;
2336
- const z = M.target.value, me = z === "" ? null : Number(z);
2337
- p(me);
2338
- }, [b, p]), O = S(async (M) => {
2339
- await N(), p(M);
2340
- }, [N, p]), _ = te(() => {
2341
- if (b === null)
2342
- return null;
2343
- const M = b.reportVersions.find((z) => z.reportVersionId === h);
2344
- return M === void 0 ? null : M;
2345
- }, [b, h]);
2346
- A(() => {
2347
- var z;
2348
- if (b === null)
2349
- return;
2350
- if (_ === null) {
2351
- C({});
2352
- return;
2353
- }
2354
- const M = Yo(_) ?? {};
2355
- C(M), (z = y.current) == null || z.flexmonster.refresh();
2356
- }, [b, _, h]);
2357
- const { save: U, saveAs: V, archive: X, detach: L } = Qo(e, y, h, O), D = te(() => ({
2358
- data: n ?? [],
2359
- mapping: I ?? void 0
2360
- }), [n, I]), P = S(async () => {
2361
- var z;
2362
- await m(d.confirmRevertChanges) && ((z = y.current) == null || z.flexmonster.setReport({ dataSource: D, ...F }));
2363
- }, [m, D, d.confirmRevertChanges, F]), H = te(() => (_ == null ? void 0 : _.ownerId) === f.personalNumber, [_ == null ? void 0 : _.ownerId, f.personalNumber]), J = te(() => {
2364
- var M;
2365
- return (M = _ == null ? void 0 : _.users) == null ? void 0 : M.some((z) => z.id === f.personalNumber && !z.isReportOwner);
2366
- }, [_ == null ? void 0 : _.users, f.personalNumber]), $ = S((M, z) => {
2367
- k((me) => {
2368
- const G = me == null ? void 0 : me.reportVersions.findIndex((Ie) => Ie.reportVersionId === M);
2369
- if (G === void 0 || me === null)
2370
- return me;
2371
- const pe = {
2372
- ...me.reportVersions[G],
2373
- users: z.filter((Ie) => Ie.isReportOwner === !1)
2374
- }, Ne = [...me.reportVersions];
2375
- return Ne[G] = pe, {
2376
- ...me,
2377
- reportVersions: Ne
2378
- };
2379
- });
2380
- }, [k]), Y = S(async () => {
2381
- await m(d.confirmDelete(_ == null ? void 0 : _.name)) && (await X(), p(null), await N());
2382
- }, [X, m, N, _ == null ? void 0 : _.name, d, p]), ie = S(async () => {
2383
- await m(d.confirmDetach(_ == null ? void 0 : _.name)) && (await L(), p(null), await N());
2384
- }, [m, L, N, _ == null ? void 0 : _.name, d, p]);
2385
- return A(() => {
2386
- var M;
2387
- h === null && p(((M = b == null ? void 0 : b.reportVersions.find((z) => z.isSystem === !0)) == null ? void 0 : M.reportVersionId) ?? null);
2388
- }, [b == null ? void 0 : b.reportVersions, h, p]), /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2389
- /* @__PURE__ */ r.jsx(As, { title: /* @__PURE__ */ r.jsxs("div", { className: "d-flex justify-content-start gap-3", children: [
2390
- /* @__PURE__ */ r.jsx(Z, { variant: "h3", children: t }),
2391
- a,
2392
- /* @__PURE__ */ r.jsxs("div", { className: "d-flex gap-1 align-items-center", children: [
2393
- /* @__PURE__ */ r.jsxs(rs, { size: "sm", value: h ?? void 0, onChange: R, children: [
2394
- /* @__PURE__ */ r.jsx("optgroup", { label: d.versionSelectSystem, children: b == null ? void 0 : b.reportVersions.filter((M) => M.isSystem === !0).map((M) => /* @__PURE__ */ r.jsx("option", { value: M.reportVersionId, children: M.name }, M.reportVersionId)) }),
2395
- /* @__PURE__ */ r.jsx("optgroup", { label: d.versionSelectYour, children: b == null ? void 0 : b.reportVersions.filter((M) => M.ownerId === f.personalNumber).map((M) => /* @__PURE__ */ r.jsx("option", { value: M.reportVersionId, children: M.name }, M.reportVersionId)) }),
2396
- /* @__PURE__ */ r.jsx("optgroup", { label: d.versionSelectSharedWithYou, children: b == null ? void 0 : b.reportVersions.filter((M) => M.isSystem === !1 && M.ownerId !== f.personalNumber).map((M) => /* @__PURE__ */ r.jsx("option", { value: M.reportVersionId, children: `${M.name} [${M.ownerId}]` }, M.reportVersionId)) })
2397
- ] }),
2398
- /* @__PURE__ */ r.jsx(ot, { icon: /* @__PURE__ */ r.jsx(as, {}), onClick: U, disabled: h === null || (_ == null ? void 0 : _.isSystem) || !H, children: d.save }),
2399
- /* @__PURE__ */ r.jsx(ot, { icon: /* @__PURE__ */ r.jsx(ss, {}), onClick: V, className: "flex-shrink-0", children: d.saveAs }),
2400
- /* @__PURE__ */ r.jsxs(dn, { toggle: /* @__PURE__ */ r.jsx(un, { as: vr }), children: [
2401
- /* @__PURE__ */ r.jsx(Qe, { onClick: P, children: d.revertChanges }),
2402
- /* @__PURE__ */ r.jsx(Qe, { onClick: () => j(!0), disabled: !H || (_ == null ? void 0 : _.isSystem), children: d.share }),
2403
- H && !(_ != null && _.isSystem) ? /* @__PURE__ */ r.jsx(Qe, { color: "danger", onClick: Y, children: d.delete }) : null,
2404
- J && !(_ != null && _.isSystem) ? /* @__PURE__ */ r.jsx(Qe, { color: "danger", onClick: ie, children: d.detach }) : null
2405
- ] })
2406
- ] })
2407
- ] }), children: /* @__PURE__ */ r.jsx("div", { className: w("h-100 w-100", D.data && D.data.length > 0 ? "" : "d-none"), children: /* @__PURE__ */ r.jsx(qo, { dataSource: D, settings: F, pivotRef: y, enabled: D.data && D.data.length > 0, localization: o, licenseKey: i }) }) }),
2408
- _ !== null ? /* @__PURE__ */ r.jsx(Jo, { isOpen: g, onHide: () => j(!1), usersData: _.users ?? null, setUsersData: $, reportVersionId: _ == null ? void 0 : _.reportVersionId, EmployeePicker: c }) : null
2409
- ] });
2410
- }, gd = ({ cell: { value: e } }) => /* @__PURE__ */ r.jsx(r.Fragment, { children: e ? /* @__PURE__ */ r.jsx(jr, { name: e, size: 21, fontSize: 12 }) : /* @__PURE__ */ r.jsx(r.Fragment, {}) }), ei = ({ knownTypes: e, typeFilters: t, onChangeTypeFilters: n }) => /* @__PURE__ */ r.jsx("div", { className: "mb-1 d-flex justify-content-center gap-2", children: e.map((a) => /* @__PURE__ */ r.jsx("div", { role: "button", style: {
2411
- height: "14px",
2412
- width: "14px",
2413
- borderRadius: "50%",
2414
- border: "2px solid transparent",
2415
- backgroundColor: "transparent"
2416
- }, className: w(`border-${a}`, t.includes(a) && `bg-${a}`), onClick: () => {
2417
- t.includes(a) ? n(t.filter((s) => s !== a)) : n([...t, a]);
2418
- } }, a)) }), ti = ({ linksTo: e, onClick: t, children: n }) => e ? /* @__PURE__ */ r.jsx(Ze, { to: e, className: "text-decoration-none", onClick: t, children: n }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: n }), ni = ({ message: e, onDeleteMessage: t, onClickMessage: n, getIcon: a, getLinksTo: s }) => {
2419
- const { ProjectIconComponent: o, localizationContext: i } = Q(ge), { dateFnsLocale: c } = Q(i), l = e.dateTime ? vt(e.dateTime) : null, u = l ? Ps(new Date(Date.now()), l) : 0;
2420
- return /* @__PURE__ */ r.jsxs("div", { children: [
2421
- l && /* @__PURE__ */ r.jsx("div", { className: "d-flex justify-content-end", children: /* @__PURE__ */ r.jsx(mn, { text: xt(l, "dd.MM.yyyy HH:mm"), placement: "left", children: /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(Z, { variant: "caption", children: u > 2 ? xt(l, "dd.MM.yyyy") : Ws(l, new Date(Date.now()), {
2422
- locale: c.code
2423
- }) }) }) }) }),
2424
- /* @__PURE__ */ r.jsx(ti, { linksTo: s(e) ?? void 0, onClick: n, children: /* @__PURE__ */ r.jsx(Jl, { level: e.type, noIcon: !0, children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start gap-2", children: [
2425
- a(e),
2426
- /* @__PURE__ */ r.jsxs("div", { className: "d-flex flex-column gap-1 w-100", children: [
2427
- /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start justify-content-between gap-3", children: [
2428
- /* @__PURE__ */ r.jsx(Z, { variant: "body2", className: "fw-bold", children: e.subject }),
2429
- /* @__PURE__ */ r.jsx(ne, { size: "sm", onClick: (d) => {
2430
- d.preventDefault(), d.stopPropagation(), t(e.id);
2431
- }, children: /* @__PURE__ */ r.jsx(o, { icon: "delete" }) })
2432
- ] }),
2433
- /* @__PURE__ */ r.jsx(Z, { variant: "body2", children: e.text })
2434
- ] })
2435
- ] }) }) })
2436
- ] });
2437
- }, zn = ["info", "warning", "danger"], Un = ({ messages: e, isLoading: t, onDeleteMessage: n, onClickMessage: a, getIcon: s, getLinksTo: o }) => {
2438
- const { texts: { messageBoard: i } } = Q(ge), [c, l] = E(zn), u = te(() => e.filter((d) => c.includes(d.type ?? "")), [c, e]);
2439
- return /* @__PURE__ */ r.jsxs("div", { className: "h-100 d-flex flex-column overflow-hidden", children: [
2440
- /* @__PURE__ */ r.jsx(ei, { knownTypes: zn, typeFilters: c, onChangeTypeFilters: (d) => l(d) }),
2441
- t && /* @__PURE__ */ r.jsxs("div", { className: "p-3 w-100", children: [
2442
- /* @__PURE__ */ r.jsx(Ae, { as: Tn.Title, animation: "glow", children: /* @__PURE__ */ r.jsx(Ae, { xs: 6 }) }),
2443
- /* @__PURE__ */ r.jsxs(Ae, { as: Tn.Text, animation: "glow", children: [
2444
- /* @__PURE__ */ r.jsx(Ae, { xs: 7 }),
2445
- " ",
2446
- /* @__PURE__ */ r.jsx(Ae, { xs: 4 }),
2447
- " ",
2448
- /* @__PURE__ */ r.jsx(Ae, { xs: 4 }),
2449
- " ",
2450
- /* @__PURE__ */ r.jsx(Ae, { xs: 6 }),
2451
- " ",
2452
- /* @__PURE__ */ r.jsx(Ae, { xs: 8 })
2453
- ] })
2454
- ] }),
2455
- !t && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2456
- e.length === 0 && /* @__PURE__ */ r.jsx(xa, { variant: "info", size: "sm", className: "mt-2", children: i.noMessages }),
2457
- /* @__PURE__ */ r.jsx("div", { className: "h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar", children: u.map((d) => /* @__PURE__ */ r.jsx(ni, { message: d, onDeleteMessage: n, onClickMessage: a, getIcon: s, getLinksTo: o }, d.id)) })
2458
- ] })
2459
- ] });
2460
- }, Ut = {
2461
- apiGet: "/messageBoard",
2462
- apiDelete: "/messageBoard/"
2463
- }, pd = ({ renderAsNotifPanel: e, notifIcon: t, apiUrls: { apiGet: n = Ut.apiGet, apiDelete: a = Ut.apiDelete } = Ut, getIcon: s, getLinksTo: o }) => {
2464
- const c = et(), [l, u] = E([]), [d, m] = E(!1), [x, v] = E(!1), [h, p] = E(!1), g = S(async () => {
2465
- v(!0), await c.get(n).then(({ data: N }) => {
2466
- u(N), m(!0), v(!1);
2467
- }).catch(() => {
2468
- u([]), v(!1);
2469
- });
2470
- }, [n, c]), j = S(async (N) => c.delete(`${a}${N}`).then(() => !0).catch(() => !1), [a, c]), y = S((N) => {
2471
- j(N).then((k) => {
2472
- k && u(l.filter((I) => I.id !== N));
2473
- });
2474
- }, [j, l]);
2475
- A(() => {
2476
- g();
2477
- const N = setInterval(() => g(), 60 * 1e3);
2478
- return () => {
2479
- clearInterval(N);
2480
- };
2481
- }, [g]);
2482
- const f = l.filter((N) => N.type === "danger").length, b = d ? !1 : x;
2483
- return e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2484
- /* @__PURE__ */ r.jsxs("div", { className: "position-relative", children: [
2485
- /* @__PURE__ */ r.jsx(ne, { size: "md", onClick: () => p(!h), children: t }),
2486
- f > 0 && /* @__PURE__ */ r.jsx("div", { className: "badge rounded-pill bg-danger p-1 px-2 text-white", style: { position: "absolute", top: "-6px", right: "-10px", fontSize: "10px" }, children: f })
2487
- ] }),
2488
- /* @__PURE__ */ r.jsx(Mn, { show: h, onHide: () => p(!1), placement: "end", children: /* @__PURE__ */ r.jsx(Mn.Body, { children: /* @__PURE__ */ r.jsx(Un, { messages: l, isLoading: b, onDeleteMessage: y, onClickMessage: () => p(!1), getIcon: s, getLinksTo: o }) }) })
2489
- ] }) : /* @__PURE__ */ r.jsx(Un, { messages: l, isLoading: b, onDeleteMessage: y, getIcon: s, getLinksTo: o });
2490
- }, ri = "_tab-panel_d8l8q_1", ai = "_full-height-no-overflow_d8l8q_5", si = "_disabled_d8l8q_12", Gt = {
2491
- "tab-panel": "_tab-panel_d8l8q_1",
2492
- tabPanel: ri,
2493
- "full-height-no-overflow": "_full-height-no-overflow_d8l8q_5",
2494
- fullHeightNoOverflow: ai,
2495
- disabled: si
2496
- }, xd = ({ eventKey: e, activeTab: t, fullHeightNoOverflow: n, disabled: a, className: s, children: o }) => e !== t ? null : /* @__PURE__ */ r.jsx("div", { className: w("luminus-tab-panel", Gt.tabPanel, { [Gt.fullHeightNoOverflow]: n }, { disabled: a }, { [Gt.disabled]: a }, s), children: o }), oi = "_join-line_1q9e8_1", ii = {
2497
- "join-line": "_join-line_1q9e8_1",
2498
- joinLine: oi
2499
- }, vd = ({ activeTab: e, onSelect: t, children: n, vertical: a, verticalStepper: s }) => /* @__PURE__ */ r.jsx("div", { className: w("luminus-tabs d-flex mb-2", { "gap-1": !s }, { "gap-0": s }, {
2500
- "flex-column": a || s
2501
- }), children: n.map((o, i) => {
2502
- const c = o.type, l = o.props;
2503
- if (!l)
2504
- return null;
2505
- const u = l.eventKey, d = l.children, m = l.className, x = l.onClick;
2506
- return /* @__PURE__ */ r.jsxs(Ce.Fragment, { children: [
2507
- /* @__PURE__ */ r.jsx(c, { ...l, className: w({ active: e === u }, m), onClick: () => {
2508
- t(u), x && x(u);
2509
- }, vertical: a || s, children: d }),
2510
- s && i < n.length - 1 && /* @__PURE__ */ r.jsx("div", { className: w("join-line", ii.joinLine) })
2511
- ] }, l.eventKey);
2512
- }) }), li = "_tab_1tbi7_1", ci = "_disabled_1tbi7_7", di = "_vertical_1tbi7_13", Yt = {
2513
- tab: li,
2514
- disabled: ci,
2515
- vertical: di
2516
- }, jd = ({ eventKey: e, className: t, onClick: n, disabled: a, vertical: s, children: o }) => /* @__PURE__ */ r.jsx("div", { role: "button", className: w("luminus-tab text-primary rounded", Yt.tab, t, {
2517
- disabled: a
2518
- }, { [Yt.disabled]: a }, { vertical: s }, { [Yt.vertical]: s }), onClick: () => n && !a && n(e), children: typeof o == "string" ? /* @__PURE__ */ r.jsx(Z, { variant: s ? "body" : "h6", className: s ? "" : "text-primary", children: o }) : o }), ui = ({ show: e, widgets: t, handleClose: n, onWidgetPicked: a, texts: s }) => /* @__PURE__ */ r.jsxs(Ve, { show: e, onHide: () => n(), children: [
2519
- /* @__PURE__ */ r.jsx(Ve.Header, { closeButton: !0, children: /* @__PURE__ */ r.jsx(Ve.Title, { children: s.pickWidgetToAdd }) }),
2520
- /* @__PURE__ */ r.jsx(Ve.Body, { children: /* @__PURE__ */ r.jsx("div", { className: "list-group", children: t.filter((o) => o.id >= 0).map((o) => /* @__PURE__ */ r.jsx("div", { role: "button", className: "list-group-item bg-white", onClick: () => a(o.id), children: /* @__PURE__ */ r.jsx(Z, { variant: "body", children: o.name }) })) }) })
2521
- ] }), Gn = ({ availableWidgets: e, onAdd: t, texts: n }) => {
2522
- const [a, s] = E(!1);
2523
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2524
- /* @__PURE__ */ r.jsx("div", { className: w("luminus-empty-widget", bo.widget), children: /* @__PURE__ */ r.jsx(ne, { onClick: () => s(!0), children: /* @__PURE__ */ r.jsx(os, {}) }) }),
2525
- /* @__PURE__ */ r.jsx(ui, { show: a, widgets: e, handleClose: () => s(!1), onWidgetPicked: (o) => {
2526
- s(!1), t(o);
2527
- }, texts: n })
2528
- ] });
2529
- }, fi = (e) => {
2530
- const [t, n] = E({ widgets: [] });
2531
- A(() => {
2532
- const s = localStorage.getItem("dashboardConfig");
2533
- s ? n(JSON.parse(s)) : e && n(e);
2534
- }, [e]);
2535
- const a = S((s) => {
2536
- n(s), localStorage.setItem("dashboardConfig", JSON.stringify(s));
2537
- }, []);
2538
- return { dashboardConfig: t, onChangeDashboardConfig: a };
2539
- }, mi = "_dashboard_16plm_1", hi = "_widgets-grid_16plm_1", gi = "_widget-wrapper_16plm_8", pi = "_full-width_16plm_13", xi = "_widget-edit_16plm_16", vi = "_remove-icon_16plm_19", ji = "_full-width-icon_16plm_26", yi = "_widget-edit-overlay_16plm_36", Ee = {
2540
- dashboard: mi,
2541
- "widgets-grid": "_widgets-grid_16plm_1",
2542
- widgetsGrid: hi,
2543
- "widget-wrapper": "_widget-wrapper_16plm_8",
2544
- widgetWrapper: gi,
2545
- "full-width": "_full-width_16plm_13",
2546
- fullWidth: pi,
2547
- "widget-edit": "_widget-edit_16plm_16",
2548
- widgetEdit: xi,
2549
- "remove-icon": "_remove-icon_16plm_19",
2550
- removeIcon: vi,
2551
- "full-width-icon": "_full-width-icon_16plm_26",
2552
- fullWidthIcon: ji,
2553
- "widget-edit-overlay": "_widget-edit-overlay_16plm_36",
2554
- widgetEditOverlay: yi
2555
- };
2556
- class bi extends _s {
2557
- constructor(t) {
2558
- super(t), this.state = { hasError: !1 }, this.reload = this.reload.bind(this);
2559
- }
2560
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2561
- static getDerivedStateFromError(t) {
2562
- return { hasError: !0 };
2563
- }
2564
- componentDidUpdate(t) {
2565
- this.state.hasError && t.keyForErrorState !== this.props.keyForErrorState && this.setState({ hasError: !1 });
2566
- }
2567
- componentDidCatch(t, n) {
2568
- console.error("Error:", t, n);
2569
- }
2570
- reload() {
2571
- this.setState({ hasError: !1 });
2572
- }
2573
- render() {
2574
- const { fallback: t, children: n, texts: a, reloadButtonDisplay: s = "append-after-child" } = this.props;
2575
- return this.state.hasError ? s === "inject-to-child" && Ns(t) ? Ce.cloneElement(t, {
2576
- ...t.props
2577
- }, /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
2578
- ...t.props.children,
2579
- /* @__PURE__ */ r.jsx(ot, { type: "button", onClick: this.reload, children: a.reloadButtonContent })
2580
- ] })) : /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
2581
- t,
2582
- s === "none" ? null : /* @__PURE__ */ r.jsx(ot, { type: "button", onClick: this.reload, children: a.reloadButtonContent })
2583
- ] }) : n;
2584
- }
2585
- }
2586
- const wi = (e) => (n) => {
2587
- const { texts: { errorBoundary: a } } = Q(ge);
2588
- return /* @__PURE__ */ r.jsx(e, { texts: a, ...n });
2589
- }, _i = wi(bi), Ni = "_widget-card_e9tsb_1", Ci = {
2590
- "widget-card": "_widget-card_e9tsb_1",
2591
- widgetCard: Ni
2592
- }, Yn = ({ children: e, title: t, headerContent: n }) => /* @__PURE__ */ r.jsx(wl, { className: w(Ci.widgetCard, "luminus-widget"), title: t, headerContent: n, contentClassName: "h-100 overflow-auto", children: e }), Si = ({ children: e, title: t }) => {
2593
- const { texts: { widget: n } } = Q(ge);
2594
- return /* @__PURE__ */ r.jsx(_i, { fallback: /* @__PURE__ */ r.jsx(Yn, { title: t, children: n.fallbackError }), reloadButtonDisplay: "inject-to-child", children: /* @__PURE__ */ r.jsx(Cs, { fallback: /* @__PURE__ */ r.jsx(Yn, { title: t, children: /* @__PURE__ */ r.jsx(Ms, {}) }), children: e }) });
2595
- }, yd = ({ availableWidgets: e, editMode: t, defaultDashboardConfig: n }) => {
2596
- var d;
2597
- const { texts: { homeDashboard: a } } = Q(ge), { dashboardConfig: s, onChangeDashboardConfig: o } = fi(n), i = S((m, x) => {
2598
- var v, h;
2599
- m === ((v = s.widgets) == null ? void 0 : v.length) ? o({
2600
- ...s,
2601
- widgets: [...s.widgets, { widgetId: x, fullWidth: !1 }]
2602
- }) : o({
2603
- ...s,
2604
- widgets: ((h = s.widgets) == null ? void 0 : h.map((p, g) => g === m ? { widgetId: x, fullWidth: !1 } : p)) ?? []
2605
- });
2606
- }, [s, o]), c = S((m) => {
2607
- var x, v;
2608
- ((x = s.widgets[m]) == null ? void 0 : x.widgetId) === -1 ? o({
2609
- ...s,
2610
- widgets: ((v = s.widgets) == null ? void 0 : v.filter((h, p) => p !== m)) ?? []
2611
- }) : i(m, -1);
2612
- }, [s, o, i]), l = S((m) => {
2613
- var x;
2614
- o({
2615
- ...s,
2616
- widgets: ((x = s.widgets) == null ? void 0 : x.map((v, h) => h === m ? { ...v, fullWidth: !v.fullWidth } : v)) ?? []
2617
- });
2618
- }, [s, o]), u = S((m, x, v) => m ? /* @__PURE__ */ r.jsxs("div", { className: w(Ee.widgetWrapper, {
2619
- [Ee.widgetEdit]: t && m.id !== -1
2620
- }, { [Ee.fullWidth]: v }), children: [
2621
- t && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2622
- /* @__PURE__ */ r.jsx(ne, { color: "danger", onClick: () => c(x), className: w(Ee.removeIcon), children: /* @__PURE__ */ r.jsx(yr, {}) }),
2623
- /* @__PURE__ */ r.jsx(ne, { color: v ? "danger" : "primary", onClick: () => l(x), className: w(Ee.fullWidthIcon), children: /* @__PURE__ */ r.jsx(is, {}) })
2624
- ] }),
2625
- m.id === -1 ? t && /* @__PURE__ */ r.jsx("div", { className: Ee.widgetWrapper, children: /* @__PURE__ */ r.jsx(Gn, { availableWidgets: e, onAdd: (h) => i(x, h), texts: a }) }) : /* @__PURE__ */ r.jsx(Si, { title: m.title, children: /* @__PURE__ */ r.jsx(m.WidgetElement, { title: m.title }) }),
2626
- m.id > -1 && t && /* @__PURE__ */ r.jsx("div", { className: Ee.widgetEditOverlay })
2627
- ] }, x) : /* @__PURE__ */ r.jsx(r.Fragment, {}), [
2628
- t,
2629
- i,
2630
- c,
2631
- l,
2632
- e,
2633
- a
2634
- ]);
2635
- return /* @__PURE__ */ r.jsx("div", { className: Ee.dashboard, children: /* @__PURE__ */ r.jsxs("div", { className: Ee.widgetsGrid, children: [
2636
- (d = s.widgets) == null ? void 0 : d.map((m, x) => u(e.find((v) => v.id === m.widgetId), x, m.fullWidth)),
2637
- t && /* @__PURE__ */ r.jsx(Gn, { availableWidgets: e, onAdd: (m) => {
2638
- var x;
2639
- return i((x = s.widgets) == null ? void 0 : x.length, m);
2640
- }, texts: a })
2641
- ] }) });
2642
- }, ki = "_badge_193ci_1", Ii = "_sm_193ci_6", Di = "_md_193ci_10", $i = "_lg_193ci_14", Fi = "_light_193ci_18", Kt = {
2643
- badge: ki,
2644
- sm: Ii,
2645
- md: Di,
2646
- lg: $i,
2647
- light: Fi
2648
- }, bd = ({ children: e, color: t = "primary", size: n = "md", rounded: a, className: s, ...o }) => /* @__PURE__ */ r.jsx("span", { className: w(`luminus-badge badge bg-${t} ${s ?? ""}`, { "rounded-pill": a }, { "text-dark": t === "light" }, { [Kt.light]: t === "light" }, Kt.badge, Kt[n]), ...o, children: e }), Oi = "_collapse-icon_1ahhn_1", Ei = "_collapsed_1ahhn_6", Kn = {
2649
- "collapse-icon": "_collapse-icon_1ahhn_1",
2650
- collapseIcon: Oi,
2651
- collapsed: Ei
2652
- }, Ti = ({ title: e, children: t, className: n, ...a }) => {
2653
- const s = a.controlled ? !1 : a.defaultOpen ?? !1, [o, i] = E(s), c = a.controlled ? a.isOpen : o;
2654
- return A(() => {
2655
- i(s);
2656
- }, [s]), /* @__PURE__ */ r.jsxs("div", { className: n ?? "", children: [
2657
- /* @__PURE__ */ r.jsxs("div", { role: "button", className: "d-flex align-items-center justify-content-between pb-3 pt-2", onClick: () => a.controlled ? a.onToggle(!a.isOpen) : i(!o), children: [
2658
- /* @__PURE__ */ r.jsx(Z, { variant: "h6", children: e }),
2659
- /* @__PURE__ */ r.jsx(br, { className: w(Kn.collapseIcon, {
2660
- [Kn.collapsed]: c
2661
- }) })
2662
- ] }),
2663
- /* @__PURE__ */ r.jsx(kr, { in: c, children: /* @__PURE__ */ r.jsx("div", { children: t }) }),
2664
- /* @__PURE__ */ r.jsx("hr", { className: `my-0 ${c ? "mt-3" : ""}` })
2665
- ] });
2666
- };
2667
- function Li(e, t, n) {
2668
- var a = this, s = ee(null), o = ee(0), i = ee(null), c = ee([]), l = ee(), u = ee(), d = ee(e), m = ee(!0);
2669
- d.current = e;
2670
- var x = typeof window < "u", v = !t && t !== 0 && x;
2671
- if (typeof e != "function") throw new TypeError("Expected a function");
2672
- t = +t || 0;
2673
- var h = !!(n = n || {}).leading, p = !("trailing" in n) || !!n.trailing, g = "maxWait" in n, j = "debounceOnServer" in n && !!n.debounceOnServer, y = g ? Math.max(+n.maxWait || 0, t) : null;
2674
- A(function() {
2675
- return m.current = !0, function() {
2676
- m.current = !1;
2677
- };
2678
- }, []);
2679
- var f = te(function() {
2680
- var b = function(R) {
2681
- var O = c.current, _ = l.current;
2682
- return c.current = l.current = null, o.current = R, u.current = d.current.apply(_, O);
2683
- }, N = function(R, O) {
2684
- v && cancelAnimationFrame(i.current), i.current = v ? requestAnimationFrame(R) : setTimeout(R, O);
2685
- }, k = function(R) {
2686
- if (!m.current) return !1;
2687
- var O = R - s.current;
2688
- return !s.current || O >= t || O < 0 || g && R - o.current >= y;
2689
- }, I = function(R) {
2690
- return i.current = null, p && c.current ? b(R) : (c.current = l.current = null, u.current);
2691
- }, F = function R() {
2692
- var O = Date.now();
2693
- if (k(O)) return I(O);
2694
- if (m.current) {
2695
- var _ = t - (O - s.current), U = g ? Math.min(_, y - (O - o.current)) : _;
2696
- N(R, U);
2697
- }
2698
- }, C = function() {
2699
- if (x || j) {
2700
- var R = Date.now(), O = k(R);
2701
- if (c.current = [].slice.call(arguments), l.current = a, s.current = R, O) {
2702
- if (!i.current && m.current) return o.current = s.current, N(F, t), h ? b(s.current) : u.current;
2703
- if (g) return N(F, t), b(s.current);
2704
- }
2705
- return i.current || N(F, t), u.current;
2706
- }
2707
- };
2708
- return C.cancel = function() {
2709
- i.current && (v ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), o.current = 0, c.current = s.current = l.current = i.current = null;
2710
- }, C.isPending = function() {
2711
- return !!i.current;
2712
- }, C.flush = function() {
2713
- return i.current ? I(Date.now()) : u.current;
2714
- }, C;
2715
- }, [h, g, t, y, p, v, x, j]);
2716
- return f;
2717
- }
2718
- function Ri(e, t) {
2719
- return e === t;
2720
- }
2721
- function Ai(e, t) {
2722
- return t;
2723
- }
2724
- function fa(e, t, n) {
2725
- var a = Ri, s = Ss(Ai, e), o = s[0], i = s[1], c = Li(S(function(u) {
2726
- return i(u);
2727
- }, [i]), t, n), l = ee(e);
2728
- return a(l.current, e) || (c(e), l.current = e), a(o, e) && c.cancel(), [o, c];
2729
- }
2730
- const Mi = "_wrapper_1kgb8_1", Vi = "_open_1kgb8_9", Bi = "_dropdown_1kgb8_13", Pi = "_search-input-container_1kgb8_19", Hi = "_search-input_1kgb8_19", Wi = "_loading-container_1kgb8_25", zi = "_items-container_1kgb8_32", Ui = "_header-row_1kgb8_38", Gi = "_item_1kgb8_32", Yi = "_name_1kgb8_57", Ki = "_column-item_1kgb8_62", qi = "_icon_1kgb8_66", Qi = "_action-buttons-container_1kgb8_74", Zi = "_reverse_1kgb8_82", Ji = "_action-button_1kgb8_74", be = {
2731
- wrapper: Mi,
2732
- open: Vi,
2733
- dropdown: Bi,
2734
- "search-input-container": "_search-input-container_1kgb8_19",
2735
- searchInputContainer: Pi,
2736
- "search-input": "_search-input_1kgb8_19",
2737
- searchInput: Hi,
2738
- "loading-container": "_loading-container_1kgb8_25",
2739
- loadingContainer: Wi,
2740
- "items-container": "_items-container_1kgb8_32",
2741
- itemsContainer: zi,
2742
- "header-row": "_header-row_1kgb8_38",
2743
- headerRow: Ui,
2744
- item: Gi,
2745
- name: Yi,
2746
- "column-item": "_column-item_1kgb8_62",
2747
- columnItem: Ki,
2748
- icon: qi,
2749
- "action-buttons-container": "_action-buttons-container_1kgb8_74",
2750
- actionButtonsContainer: Qi,
2751
- reverse: Zi,
2752
- "action-button": "_action-button_1kgb8_74",
2753
- actionButton: Ji
2754
- }, wn = ({ show: e, onCancel: t, items: n, currentSelection: a, onSelectionChange: s, onSearchQueryChange: o, texts: i, itemsNameWidth: c, additionalColumns: l, displayIdAsName: u = !1, autoHideSearch: d = !1, allItemsLength: m, disabled: x, isLoading: v = !1, inputRef: h }) => {
2755
- var We;
2756
- const p = ee(null), g = ee(null), j = ee(null), y = ee(null), f = ee(null), [b, N] = E(""), [k] = fa(b, 500), [, I] = E(!1), { copyToClipboard: F } = Os(), C = (We = h.current) == null ? void 0 : We.getBoundingClientRect(), R = (C == null ? void 0 : C.x) ?? 0, O = ((C == null ? void 0 : C.x) ?? 0) + ((C == null ? void 0 : C.width) ?? 0), _ = (C == null ? void 0 : C.y) ?? 0, U = ((C == null ? void 0 : C.y) ?? 0) + ((C == null ? void 0 : C.height) ?? 0), V = (C == null ? void 0 : C.width) ?? 0, X = (C == null ? void 0 : C.height) ?? 0, L = 5, D = te(() => R ? R > window.innerWidth / 2 : !1, [R]), P = te(() => _ ? _ > window.innerHeight / 2 : !1, [_]);
2757
- A(() => {
2758
- var K;
2759
- e && ((K = y.current) == null || K.focus());
2760
- }, [y, e]), A(() => {
2761
- e || N("");
2762
- }, [e]), A(() => {
2763
- o(k);
2764
- }, [k, o]);
2765
- const [H, J] = E(null);
2766
- A(() => {
2767
- e && n.length > 0 ? J(0) : J(null);
2768
- }, [n, e]);
2769
- const $ = te(() => H !== null ? n.at(H) ?? null : null, [H, n]), Y = S((K, fe) => {
2770
- var ze, tt;
2771
- const _e = document.getElementById(`item-${K}`);
2772
- if (_e) {
2773
- const T = _e.clientHeight ?? 0;
2774
- fe === "down" ? (ze = f.current) == null || ze.scrollBy({
2775
- left: 0,
2776
- top: T,
2777
- behavior: "smooth"
2778
- }) : (tt = f.current) == null || tt.scrollBy({
2779
- left: 0,
2780
- top: -T,
2781
- behavior: "smooth"
2782
- });
2783
- }
2784
- }, []), ie = S((K) => {
2785
- if (H === null || x)
2786
- return;
2787
- const fe = H + K;
2788
- fe < 0 || fe >= n.length || J((_e) => (_e !== null && Y(_e, K > 0 ? "down" : "up"), fe));
2789
- }, [H, n, x, Y]), M = S((K) => {
2790
- if (e)
2791
- switch (K.key) {
2792
- case "Escape":
2793
- K.stopPropagation(), K.preventDefault(), t();
2794
- break;
2795
- case "Enter":
2796
- K.stopPropagation(), K.preventDefault(), x || s($);
2797
- break;
2798
- case "ArrowUp":
2799
- K.stopPropagation(), K.preventDefault(), ie(-1);
2800
- break;
2801
- case "ArrowDown":
2802
- K.stopPropagation(), K.preventDefault(), ie(1);
2803
- break;
2804
- }
2805
- }, [t, e, ie, $, x, s]), z = S(() => {
2806
- I((K) => !K);
2807
- }, []);
2808
- A(() => (window.addEventListener("scroll", z), () => {
2809
- window.removeEventListener("scroll", z);
2810
- }), [z]), A(() => (window.addEventListener("resize", z), () => {
2811
- window.removeEventListener("resize", z);
2812
- }), [z]), _r(M), Nr([p, g, j], t);
2813
- const me = c ?? (l && l.length > 0 ? 250 : 0), G = (l == null ? void 0 : l.reduce((K, fe) => K + (fe.width ?? 100), 0)) ?? 0, pe = `calc(max(${V}px, ${me}px + ${G}px))`, Ne = te(() => (a && e && !x) ?? !1, [a, e, x]), Ie = te(() => (a && e) ?? !1, [a, e]);
2814
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2815
- /* @__PURE__ */ r.jsx(ga, { show: e, onClick: t }),
2816
- /* @__PURE__ */ r.jsxs("div", { className: w("luminus-dropdown-picker-actions", be.actionButtonsContainer, {
2817
- [be.reverse]: D
2818
- }), style: {
2819
- top: `calc(${_}px + ${X / 2}px - 12px)`,
2820
- left: D ? Ne && Ie ? `calc(${R}px - 24px - 8px - 24px - 4px)` : `calc(${R}px - 24px - 8px)` : `calc(${O}px + 8px)`
2821
- }, children: [
2822
- Ne && /* @__PURE__ */ r.jsx("button", { ref: g, type: "button", className: w("luminus-dropdown-picker-clear-button", be.actionButton), onClick: () => !x && s(null), children: /* @__PURE__ */ r.jsx(Z, { variant: "caption", className: "text-danger", children: /* @__PURE__ */ r.jsx(yr, { size: 16 }) }) }),
2823
- Ie && /* @__PURE__ */ r.jsx("button", { ref: j, type: "button", className: w("luminus-dropdown-picker-copy-button", be.actionButton), onClick: () => {
2824
- var K, fe;
2825
- F(u ? ((K = a == null ? void 0 : a.id) == null ? void 0 : K.toString()) ?? "" : ((fe = a == null ? void 0 : a.name) == null ? void 0 : fe.toString()) ?? ""), t();
2826
- }, children: /* @__PURE__ */ r.jsx(Z, { variant: "caption", className: "text-info", children: /* @__PURE__ */ r.jsx(ls, { size: 16 }) }) })
2827
- ] }),
2828
- /* @__PURE__ */ r.jsx("div", { className: w("luminus-dropdown-picker", be.wrapper, {
2829
- [be.open]: e
2830
- }), style: {
2831
- top: P ? `calc(${_}px - 50vh - 8px)` : `calc(${U}px + 8px)`,
2832
- left: D ? `calc(${O}px - ${pe})` : R,
2833
- right: D ? `${O}px` : `calc(${R}px + ${pe})`,
2834
- width: pe,
2835
- justifyContent: P ? "flex-end" : "flex-start"
2836
- }, children: /* @__PURE__ */ r.jsx("div", { ref: p, className: w("shadow rounded", be.dropdown), children: !x && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2837
- d && (m ?? n.length) <= L ? null : /* @__PURE__ */ r.jsx("div", { className: w("search-input-container border-bottom", be.searchInputContainer), children: /* @__PURE__ */ r.jsx(ye.Control, { ref: y, type: "search", size: "sm", className: be.searchInput, placeholder: i.searchPlaceholder, value: b, onChange: (K) => {
2838
- var fe;
2839
- return N(((fe = K.target) == null ? void 0 : fe.value) ?? "");
2840
- } }) }),
2841
- v ? /* @__PURE__ */ r.jsx("div", { className: be.loadingContainer, children: /* @__PURE__ */ r.jsx(vn, { animation: "border", variant: "primary" }) }) : n.length > 0 && /* @__PURE__ */ r.jsxs("div", { ref: f, className: w("items", be.itemsContainer), children: [
2842
- l && l.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: w("header-row border-bottom", be.headerRow), children: [
2843
- /* @__PURE__ */ r.jsx("div", { className: be.name }),
2844
- l == null ? void 0 : l.map((K) => /* @__PURE__ */ r.jsx("div", { className: be.columnItem, style: {
2845
- width: `${K.width ?? 100}px`,
2846
- minWidth: `${K.width ?? 100}px`,
2847
- maxWidth: `${K.width ?? 100}px`
2848
- }, children: /* @__PURE__ */ r.jsx(Z, { variant: "caption", children: K.name }) }, K.key))
2849
- ] }),
2850
- n == null ? void 0 : n.map((K, fe) => /* @__PURE__ */ r.jsxs("button", { id: `item-${fe}`, type: "button", className: w("item cursor-pointer", be.item, {
2851
- [be.focused]: H === fe
2852
- }, {
2853
- focused: H === fe
2854
- }), onClick: () => !x && s(K), onMouseEnter: () => J(fe), children: [
2855
- /* @__PURE__ */ r.jsx("div", { className: be.name, children: /* @__PURE__ */ r.jsx(Z, { variant: "body2", children: u ? K.id : K.name }) }),
2856
- l == null ? void 0 : l.map((_e) => /* @__PURE__ */ r.jsx("div", { className: be.columnItem, style: {
2857
- width: `${_e.width ?? 100}px`,
2858
- minWidth: `${_e.width ?? 100}px`,
2859
- maxWidth: `${_e.width ?? 100}px`
2860
- }, children: /* @__PURE__ */ r.jsx(Z, { variant: "caption", className: w("text-muted"), children: K.additionalColumns && K.additionalColumns[_e.key] }) }, _e.key))
2861
- ] }, K.id))
2862
- ] })
2863
- ] }) }) })
2864
- ] });
2865
- }, Xi = ({ searchTypes: e, selectedType: t, setSelectedType: n }) => /* @__PURE__ */ r.jsx(dn, { toggle: /* @__PURE__ */ r.jsx(un, { as: vr, icon: null, text: t == null ? void 0 : t.text }), children: e.map((a) => /* @__PURE__ */ r.jsx(Qe, { icon: null, onClick: () => n(a.key), children: a.text }, a.key)) }), el = "_dropdown_1ddrg_1", tl = "_open_1ddrg_12", nl = "_loading-container_1ddrg_15", rl = "_groups-container_1ddrg_22", al = "_group_1ddrg_22", sl = "_header_1ddrg_26", ol = "_item_1ddrg_33", Ue = {
2866
- dropdown: el,
2867
- open: tl,
2868
- "loading-container": "_loading-container_1ddrg_15",
2869
- loadingContainer: nl,
2870
- "groups-container": "_groups-container_1ddrg_22",
2871
- groupsContainer: rl,
2872
- group: al,
2873
- header: sl,
2874
- item: ol
2875
- }, il = ({ show: e, query: t, onCancel: n, groups: a, isLoading: s, searchTypes: o }) => {
2876
- const { texts: { appSearch: i } } = Q(ge), c = ee(null), l = S((u) => {
2877
- var m;
2878
- const d = (m = o.find((x) => x.key === u.type)) == null ? void 0 : m.toPath;
2879
- return d ? `${d}/${u.searchKey}` : "/not-found";
2880
- }, [o]);
2881
- return Nr([c], n), /* @__PURE__ */ r.jsx("div", { ref: c, className: w("luminus-app-search-dropdown shadow rounded", Ue.dropdown, {
2882
- [Ue.open]: e
2883
- }), children: s ? /* @__PURE__ */ r.jsx("div", { className: Ue.loadingContainer, children: /* @__PURE__ */ r.jsx(vn, { animation: "border", variant: "primary" }) }) : /* @__PURE__ */ r.jsx("div", { className: Ue.groupsContainer, children: a == null ? void 0 : a.map((u) => {
2884
- var d;
2885
- return /* @__PURE__ */ r.jsxs("div", { className: w(Ue.group), children: [
2886
- /* @__PURE__ */ r.jsxs(Ze, { to: `/search?query=${t}&type=${u.key.category}`, className: w("group-header", Ue.header), onClick: n, children: [
2887
- /* @__PURE__ */ r.jsx(Z, { variant: "body", className: "text-primary", children: u.key.categoryName }),
2888
- /* @__PURE__ */ r.jsxs(Z, { variant: "caption", children: [
2889
- u.items.length,
2890
- " ",
2891
- i.amountFrom,
2892
- " ",
2893
- u.key.totalCount
2894
- ] })
2895
- ] }),
2896
- (d = u.items) == null ? void 0 : d.map((m, x) => /* @__PURE__ */ r.jsxs(
2897
- Ze,
2898
- {
2899
- to: l(m),
2900
- className: w("search-item d-flex gap-3 align-items-center justify-content-between", Ue.item),
2901
- onClick: n,
2902
- children: [
2903
- /* @__PURE__ */ r.jsx(Z, { variant: "body2", className: "text-nowrap text-truncate", children: m.name }),
2904
- /* @__PURE__ */ r.jsx(Z, { variant: "caption", className: "text-primary", children: /* @__PURE__ */ r.jsx(cs, {}) })
2905
- ]
2906
- },
2907
- x
2908
- ))
2909
- ] }, u.key.category);
2910
- }) }) });
2911
- }, ll = "_input-group_1lkfy_1", cl = "_input-group-text_1lkfy_5", dl = "_left_1lkfy_9", ul = "_right_1lkfy_13", fl = "_input_1lkfy_1", ml = "_submit-button_1lkfy_20", Ge = {
2912
- "input-group": "_input-group_1lkfy_1",
2913
- inputGroup: ll,
2914
- "input-group-text": "_input-group-text_1lkfy_5",
2915
- inputGroupText: cl,
2916
- left: dl,
2917
- right: ul,
2918
- input: fl,
2919
- "submit-button": "_submit-button_1lkfy_20",
2920
- submitButton: ml
2921
- }, hl = (e, t) => {
2922
- const n = et(), [a, s] = E(!1), [o, i] = E([]), c = !e || !e.key, l = S(() => {
2923
- if (t.length < 3) {
2924
- i([]);
2925
- return;
2926
- }
2927
- s(!0), n.get(`/search/${t}?count=${c ? 5 : 20}${c ? "" : `&type=${e.key}`}`).then(({ data: u }) => {
2928
- i(u), s(!1);
2929
- }).catch(() => {
2930
- s(!1);
2931
- });
2932
- }, [e, t, n, c]);
2933
- return A(() => {
2934
- l();
2935
- }, [l]), { isLoading: a, searchItems: o };
2936
- }, wd = ({ searchTypes: e, navigateFunction: t, currentPath: n }) => {
2937
- var p;
2938
- const { texts: { appSearch: a } } = Q(ge), [s, o] = E(e.length > 0 ? ((p = e.at(0)) == null ? void 0 : p.key) ?? null : null), i = te(() => e.find((g) => g.key === s) ?? null, [e, s]), [c, l] = E(""), [u, d] = fa(c, 500), { isLoading: m, searchItems: x } = hl(i, u), [v, h] = E(!1);
2939
- return A(() => {
2940
- (x.length > 0 || m) && h(!0);
2941
- }, [x, m]), A(() => {
2942
- l("");
2943
- }, [n]), /* @__PURE__ */ r.jsx(ye, { onSubmit: (g) => {
2944
- g.preventDefault(), g.stopPropagation(), d.flush(), h(!1), c.length > 2 && t(`/search?query=${c}${i && i.key && `&type=${i == null ? void 0 : i.key}`}`);
2945
- }, children: /* @__PURE__ */ r.jsxs(Nt, { className: Ge.inputGroup, children: [
2946
- /* @__PURE__ */ r.jsx(Nt.Text, { className: w("p-1 rounded", Ge.inputGroupText, Ge.left), children: /* @__PURE__ */ r.jsx(Xi, { searchTypes: e, selectedType: i, setSelectedType: o }) }),
2947
- /* @__PURE__ */ r.jsx(ye.Control, { placeholder: a.searchPlaceholder, type: "text", size: "sm", className: w("luminus-app-search-input", Ge.input), value: c, onChange: (g) => {
2948
- var j;
2949
- return l(((j = g.target) == null ? void 0 : j.value) ?? "");
2950
- }, onFocus: () => x.length > 0 && h(!0) }),
2951
- /* @__PURE__ */ r.jsx(Nt.Text, { className: w("p-0 rounded", Ge.inputGroupText, Ge.right), children: /* @__PURE__ */ r.jsx("button", { type: "submit", className: w("text-primary", Ge.submitButton), children: /* @__PURE__ */ r.jsx(ds, {}) }) }),
2952
- /* @__PURE__ */ r.jsx(il, { query: u, searchTypes: e, show: v, onCancel: () => h(!1), groups: x, isLoading: m })
2953
- ] }) });
2954
- }, gl = "_card_19733_1", pl = "_header_19733_6", xl = "_header-content_19733_13", vl = "_title_19733_19", jl = "_collapse-icon_19733_22", yl = "_collapsed_19733_27", bl = "_content_19733_30", Ye = {
2955
- card: gl,
2956
- header: pl,
2957
- "header-content": "_header-content_19733_13",
2958
- headerContent: xl,
2959
- title: vl,
2960
- "collapse-icon": "_collapse-icon_19733_22",
2961
- collapseIcon: jl,
2962
- collapsed: yl,
2963
- content: bl
2964
- }, wl = ({ title: e, headerContent: t, children: n, className: a, headerClassName: s, contentClassName: o, dontRenderIfNoChildren: i, ...c }) => {
2965
- const l = c.collapsible ? c.controlled ? !1 : c.defaultOpen ?? !1 : !0, [u, d] = E(l), m = c.collapsible ? c.controlled ? c.isOpen : u : !0;
2966
- A(() => {
2967
- d(l);
2968
- }, [l]);
2969
- const x = te(() => !n || !n.toString() || n.toString().split(",").filter((v) => v && v !== "false").length === 0, [n]);
2970
- return i && x ? null : /* @__PURE__ */ r.jsxs("div", { className: w("luminus-card rounded shadow-sm", Ye.card, {
2971
- [a ?? ""]: a
2972
- }), children: [
2973
- /* @__PURE__ */ r.jsxs("div", { role: c.collapsible ? "button" : void 0, className: w("header", Ye.header, {
2974
- [s ?? ""]: s
2975
- }), onClick: () => {
2976
- c.collapsible && (c.controlled ? c.onToggle(!c.isOpen) : d(!u));
2977
- }, children: [
2978
- /* @__PURE__ */ r.jsxs("div", { className: w("header-content", Ye.headerContent), children: [
2979
- /* @__PURE__ */ r.jsx(Z, { variant: "h6", className: w("text-primary", Ye.title), children: e }),
2980
- t ?? null
2981
- ] }),
2982
- c.collapsible && /* @__PURE__ */ r.jsx(br, { className: w(Ye.collapseIcon, {
2983
- [Ye.collapsed]: m
2984
- }) })
2985
- ] }),
2986
- /* @__PURE__ */ r.jsx(kr, { in: m, children: /* @__PURE__ */ r.jsx("div", { className: w("card-content border-top border-primary", Ye.content, {
2987
- [o ?? ""]: o
2988
- }), children: n }) })
2989
- ] });
2990
- };
2991
- var _l = !!(typeof window < "u" && window.document && window.document.createElement), Nl = /* @__PURE__ */ function() {
2992
- function e(t, n) {
2993
- for (var a = 0; a < n.length; a++) {
2994
- var s = n[a];
2995
- s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
2996
- }
2997
- }
2998
- return function(t, n, a) {
2999
- return n && e(t.prototype, n), a && e(t, a), t;
3000
- };
3001
- }();
3002
- function Cl(e, t) {
3003
- if (!(e instanceof t))
3004
- throw new TypeError("Cannot call a class as a function");
3005
- }
3006
- function Sl(e, t) {
3007
- if (!e)
3008
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
3009
- return t && (typeof t == "object" || typeof t == "function") ? t : e;
3010
- }
3011
- function kl(e, t) {
3012
- if (typeof t != "function" && t !== null)
3013
- throw new TypeError("Super expression must either be null or a function, not " + typeof t);
3014
- e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
3015
- }
3016
- var ma = function(e) {
3017
- kl(t, e);
3018
- function t() {
3019
- return Cl(this, t), Sl(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments));
3020
- }
3021
- return Nl(t, [{
3022
- key: "componentWillUnmount",
3023
- value: function() {
3024
- this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null;
3025
- }
3026
- }, {
3027
- key: "render",
3028
- value: function() {
3029
- return _l ? (!this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode)), It.createPortal(this.props.children, this.props.node || this.defaultNode)) : null;
3030
- }
3031
- }]), t;
3032
- }(Ce.Component);
3033
- ma.propTypes = {
3034
- children: St.node.isRequired,
3035
- node: St.any
3036
- };
3037
- var Il = /* @__PURE__ */ function() {
3038
- function e(t, n) {
3039
- for (var a = 0; a < n.length; a++) {
3040
- var s = n[a];
3041
- s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
3042
- }
3043
- }
3044
- return function(t, n, a) {
3045
- return n && e(t.prototype, n), a && e(t, a), t;
3046
- };
3047
- }();
3048
- function Dl(e, t) {
3049
- if (!(e instanceof t))
3050
- throw new TypeError("Cannot call a class as a function");
3051
- }
3052
- function $l(e, t) {
3053
- if (!e)
3054
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
3055
- return t && (typeof t == "object" || typeof t == "function") ? t : e;
3056
- }
3057
- function Fl(e, t) {
3058
- if (typeof t != "function" && t !== null)
3059
- throw new TypeError("Super expression must either be null or a function, not " + typeof t);
3060
- e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
3061
- }
3062
- var ha = function(e) {
3063
- Fl(t, e);
3064
- function t() {
3065
- return Dl(this, t), $l(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments));
3066
- }
3067
- return Il(t, [{
3068
- key: "componentDidMount",
3069
- value: function() {
3070
- this.renderPortal();
3071
- }
3072
- }, {
3073
- key: "componentDidUpdate",
3074
- value: function(a) {
3075
- this.renderPortal();
3076
- }
3077
- }, {
3078
- key: "componentWillUnmount",
3079
- value: function() {
3080
- It.unmountComponentAtNode(this.defaultNode || this.props.node), this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null, this.portal = null;
3081
- }
3082
- }, {
3083
- key: "renderPortal",
3084
- value: function(a) {
3085
- !this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode));
3086
- var s = this.props.children;
3087
- typeof this.props.children.type == "function" && (s = Ce.cloneElement(this.props.children)), this.portal = It.unstable_renderSubtreeIntoContainer(this, s, this.props.node || this.defaultNode);
3088
- }
3089
- }, {
3090
- key: "render",
3091
- value: function() {
3092
- return null;
3093
- }
3094
- }]), t;
3095
- }(Ce.Component);
3096
- ha.propTypes = {
3097
- children: St.node.isRequired,
3098
- node: St.any
3099
- };
3100
- var rn = void 0;
3101
- It.createPortal ? rn = ma : rn = ha;
3102
- const Ol = "_lightbox_14acg_1", El = "_show_14acg_16", Tl = "_header_14acg_20", Ll = "_photo-actions_14acg_26", Rl = "_photo-container_14acg_31", Al = "_photo_14acg_26", Ml = "_nav-button_14acg_41", Vl = "_photos-preview_14acg_49", Bl = "_selected_14acg_62", Pl = "_default-indicator_14acg_66", ke = {
3103
- lightbox: Ol,
3104
- show: El,
3105
- header: Tl,
3106
- "photo-actions": "_photo-actions_14acg_26",
3107
- photoActions: Ll,
3108
- "photo-container": "_photo-container_14acg_31",
3109
- photoContainer: Rl,
3110
- photo: Al,
3111
- "nav-button": "_nav-button_14acg_41",
3112
- navButton: Ml,
3113
- "photos-preview": "_photos-preview_14acg_49",
3114
- photosPreview: Vl,
3115
- selected: Bl,
3116
- "default-indicator": "_default-indicator_14acg_66",
3117
- defaultIndicator: Pl
3118
- }, Hl = "_backdrop_3huvf_1", Wl = "_show_3huvf_11", qn = {
3119
- backdrop: Hl,
3120
- show: Wl
3121
- }, ga = ({ show: e, onClick: t }) => /* @__PURE__ */ r.jsx("div", { className: w("luminus-backdrop", qn.backdrop, {
3122
- [qn.show]: e
3123
- }), onClick: () => t && t() }), pa = ({ src: e, alt: t, baseUrl: n, customToken: a, placeholder: s, ...o }) => /* @__PURE__ */ r.jsx("img", { ...o, alt: t ?? "", src: e ?? s }), zl = ({ show: e, onClose: t, photos: n, defaultIndex: a, uploadPhotosText: s, noPhotosText: o, onUploadPhotos: i, photoActions: c, baseUrl: l, customToken: u, placeholder: d, ImgComponent: m = pa }) => {
3124
- const x = ee(null), [v, h] = E(a), p = n.at(v), g = v > 0, j = v < n.length - 1;
3125
- A(() => {
3126
- e && h(a);
3127
- }, [a, e]), A(() => {
3128
- v >= n.length && h(n.length - 1);
3129
- }, [n, v]);
3130
- const y = S((f) => {
3131
- switch (f.key) {
3132
- case "ArrowLeft":
3133
- f.stopPropagation(), g && h((b) => b - 1);
3134
- break;
3135
- case "ArrowRight":
3136
- f.stopPropagation(), j && h((b) => b + 1);
3137
- break;
3138
- case "Escape":
3139
- f.stopPropagation(), t();
3140
- break;
3141
- }
3142
- }, [j, g, t]);
3143
- return _r(y), /* @__PURE__ */ r.jsxs(rn, { children: [
3144
- /* @__PURE__ */ r.jsx(ga, { show: e, onClick: t }),
3145
- /* @__PURE__ */ r.jsxs("div", { ref: x, className: w("luminus-lightbox rounded shadow", ke.lightbox, {
3146
- [ke.show]: e
3147
- }), children: [
3148
- /* @__PURE__ */ r.jsxs("div", { className: ke.header, children: [
3149
- /* @__PURE__ */ r.jsxs("div", { className: w("rounded", ke.photoActions), children: [
3150
- i && /* @__PURE__ */ r.jsx(na, { accept: ".jpg,.jpeg,.png", onUpload: (f) => {
3151
- f.length > 0 && i(Array.from(f));
3152
- }, icon: /* @__PURE__ */ r.jsx(wr, { style: { fontSize: 18 } }), multiple: !0, className: "me-3", children: s ?? null }),
3153
- p && (c == null ? void 0 : c.map(({ label: f, onClick: b, ...N }, k) => /* @__PURE__ */ r.jsx(
3154
- ot,
3155
- {
3156
- onClick: () => b(p.id),
3157
- ...N,
3158
- children: f
3159
- },
3160
- `action-${k}`
3161
- )))
3162
- ] }),
3163
- /* @__PURE__ */ r.jsx("div", { role: "button", onClick: t, children: /* @__PURE__ */ r.jsx(Oe, { style: { fontSize: "32px" } }) })
3164
- ] }),
3165
- n.length === 0 && /* @__PURE__ */ r.jsx("div", { className: "w-100 h-100 d-flex align-items-center justify-content-center", children: /* @__PURE__ */ r.jsx(Z, { variant: "body", children: o ?? "No photos available" }) }),
3166
- p && /* @__PURE__ */ r.jsxs("div", { className: ke.photoContainer, children: [
3167
- /* @__PURE__ */ r.jsx("div", { role: g ? "button" : void 0, className: w("align-items-start", ke.navButton), onClick: () => g && h((f) => f - 1), children: g && /* @__PURE__ */ r.jsx(ln, { style: { fontSize: "40px" } }) }),
3168
- /* @__PURE__ */ r.jsx(m, { src: p.lgSrc, alt: p.alt, className: w("rounded", ke.photo), baseUrl: l, customToken: u, placeholder: d }),
3169
- /* @__PURE__ */ r.jsx("div", { role: j ? "button" : void 0, className: w("align-items-end", ke.navButton), onClick: () => j && h((f) => f + 1), children: j && /* @__PURE__ */ r.jsx(cn, { style: { fontSize: "40px" } }) })
3170
- ] }),
3171
- /* @__PURE__ */ r.jsx("div", { className: ke.photosPreview, children: n.map((f, b) => /* @__PURE__ */ r.jsxs("div", { role: "button", onClick: () => h(b), className: "position-relative", children: [
3172
- /* @__PURE__ */ r.jsx(m, { role: b !== v ? "button" : void 0, src: f.smSrc, alt: f.alt, className: w("rounded", ke.photo, {
3173
- [ke.selected]: b === v
3174
- }), baseUrl: l, customToken: u, placeholder: d }, f.id),
3175
- f.isDefault && /* @__PURE__ */ r.jsx("div", { className: w("text-primary", ke.defaultIndicator), children: /* @__PURE__ */ r.jsx(us, {}) })
3176
- ] })) })
3177
- ] })
3178
- ] });
3179
- }, Ul = ({ photos: e, onUploadPhotos: t, uploadPhotosText: n, photoActions: a, baseUrl: s, customToken: o, placeholder: i, ImgComponent: c = pa }) => {
3180
- const [l, u] = E(null), d = l !== null ? e[l] : null, [m, x] = E(!1);
3181
- return A(() => {
3182
- if (e.length === 0) {
3183
- u(null), x(!1);
3184
- return;
3185
- }
3186
- const v = e.findIndex((h) => h.isDefault);
3187
- u(v > -1 ? v : 0);
3188
- }, [e]), d ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3189
- /* @__PURE__ */ r.jsx(c, { role: "button", src: d.smSrc, alt: d.alt, className: "rounded w-100", onClick: () => x(!0), baseUrl: s, customToken: o, placeholder: i }),
3190
- /* @__PURE__ */ r.jsx(zl, { show: m, onClose: () => x(!1), photos: e, defaultIndex: l ?? 0, uploadPhotosText: n, onUploadPhotos: t, photoActions: a, baseUrl: s, customToken: o, placeholder: i, ImgComponent: c })
3191
- ] }) : t ? /* @__PURE__ */ r.jsx(na, { accept: ".jpg,.jpeg,.png", onUpload: (v) => {
3192
- v.length > 0 && t(Array.from(v));
3193
- }, icon: /* @__PURE__ */ r.jsx(wr, { style: { fontSize: 18 } }), multiple: !0, children: n ?? null }) : null;
3194
- }, _d = ({ children: e }) => {
3195
- var c, l, u;
3196
- const { useMsal: t, msalScopes: n } = Q(fs), { isAuthenticated: a } = ms(), { userLoginState: s } = Q(Et), o = s.state === hs.LOGGING_IN, i = s.user && ((c = s.user) == null ? void 0 : c.permissions) && ((u = (l = s.user) == null ? void 0 : l.permissions) == null ? void 0 : u.length) > 0;
3197
- return t ? /* @__PURE__ */ r.jsx(Is, { interactionType: ks.Redirect, authenticationRequest: { scopes: n }, children: o || !a() ? /* @__PURE__ */ r.jsx(kn, {}) : s.user ? i ? /* @__PURE__ */ r.jsx(r.Fragment, { children: e }) : /* @__PURE__ */ r.jsx(wt, { to: "/user-not-permitted", replace: !0 }) : /* @__PURE__ */ r.jsx(wt, { to: "/no-user-login", replace: !0 }) }) : o ? /* @__PURE__ */ r.jsx(kn, {}) : !a() || !s.user ? /* @__PURE__ */ r.jsx(wt, { to: "/login", replace: !0 }) : i ? e : /* @__PURE__ */ r.jsx(wt, { to: "/user-not-permitted", replace: !0 });
3198
- }, xa = (e) => {
3199
- const { variant: t, children: n, className: a, size: s = "md", typographyVariant: o = s === "sm" ? "body2" : "body", ...i } = { ...e };
3200
- return /* @__PURE__ */ r.jsx(Ks, { variant: t, className: `text-center ${s === "sm" ? "p-1" : s === "md" ? "p-3" : "p-4"} bg-${t} bg-opacity-10 border-none ${a ?? ""}`, ...i, children: /* @__PURE__ */ r.jsx(Z, { variant: o, children: n }) });
3201
- }, Gl = "_item_1lf6j_1", Yl = "_level-success_1lf6j_4", Kl = "_level-info_1lf6j_10", ql = "_level-warning_1lf6j_16", Ql = "_level-danger_1lf6j_22", Zl = "_type-icon_1lf6j_28", qt = {
3202
- item: Gl,
3203
- "level-success": "_level-success_1lf6j_4",
3204
- levelSuccess: Yl,
3205
- "level-info": "_level-info_1lf6j_10",
3206
- levelInfo: Kl,
3207
- "level-warning": "_level-warning_1lf6j_16",
3208
- levelWarning: ql,
3209
- "level-danger": "_level-danger_1lf6j_22",
3210
- levelDanger: Ql,
3211
- "type-icon": "_type-icon_1lf6j_28",
3212
- typeIcon: Zl
3213
- }, Jl = ({ level: e, children: t, customIcon: n, noIcon: a }) => {
3214
- const { ProjectIconComponent: s } = Q(ge), o = S(() => {
3215
- switch (e) {
3216
- case "info":
3217
- return /* @__PURE__ */ r.jsx(s, { icon: "info" });
3218
- case "warning":
3219
- return /* @__PURE__ */ r.jsx(s, { icon: "warning" });
3220
- case "danger":
3221
- return /* @__PURE__ */ r.jsx(s, { icon: "danger" });
3222
- default:
3223
- return /* @__PURE__ */ r.jsx(s, { icon: "check" });
3224
- }
3225
- }, [s, e]);
3226
- return /* @__PURE__ */ r.jsxs("div", { className: w("p-2 rounded d-flex gap-1 align-items-center justify-content-between", { "ps-1": !a }, qt.item, qt[`level-${e}`]), children: [
3227
- !a && /* @__PURE__ */ r.jsx("div", { className: w(qt.typeIcon), children: n ?? o() }),
3228
- /* @__PURE__ */ r.jsx(Z, { variant: "body2", className: "w-100", children: t })
3229
- ] });
3230
- }, Nd = ({ version: e }) => /* @__PURE__ */ r.jsx("div", { className: "rounded", style: {
3231
- position: "fixed",
3232
- right: "0px",
3233
- bottom: "0px",
3234
- zIndex: "10000",
3235
- backgroundColor: "rgba(255, 255, 255, 0.5)",
3236
- padding: "4px",
3237
- pointerEvents: "all"
3238
- }, children: /* @__PURE__ */ r.jsxs(Z, { variant: "caption", className: "w-100 text-end", children: [
3239
- "verze ",
3240
- e
3241
- ] }) }), Xl = "_submit-container_a9slg_1", ec = "_spacer_a9slg_14", Qn = {
3242
- "submit-container": "_submit-container_a9slg_1",
3243
- submitContainer: Xl,
3244
- spacer: ec
3245
- }, tc = ({ children: e, noSpacer: t = !1 }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3246
- !t && /* @__PURE__ */ r.jsx("div", { className: Qn.spacer }),
3247
- /* @__PURE__ */ r.jsx("div", { className: w("luminus-floating-action-container shadow", Qn.submitContainer), children: e })
3248
- ] }), nc = "_timeline_g1754_1", rc = "_step-container_g1754_1", ac = "_step-date_g1754_1", sc = "_step-content_g1754_4", oc = "_content-header_g1754_8", ic = "_content-text_g1754_11", lc = "_step-icon_g1754_14", Ke = {
3249
- timeline: nc,
3250
- "step-container": "_step-container_g1754_1",
3251
- stepContainer: rc,
3252
- "step-date": "_step-date_g1754_1",
3253
- stepDate: ac,
3254
- "step-content": "_step-content_g1754_4",
3255
- stepContent: sc,
3256
- "content-header": "_content-header_g1754_8",
3257
- contentHeader: oc,
3258
- "content-text": "_content-text_g1754_11",
3259
- contentText: ic,
3260
- "step-icon": "_step-icon_g1754_14",
3261
- stepIcon: lc
3262
- }, Cd = ({ steps: e }) => /* @__PURE__ */ r.jsx("div", { className: Ke.timeline, children: e.sort((t, n) => Bs(t.date ?? /* @__PURE__ */ new Date(), n.date ?? /* @__PURE__ */ new Date())).map((t, n) => /* @__PURE__ */ r.jsxs("div", { className: w("row g-0 gx-3", Ke.stepContainer), children: [
3263
- /* @__PURE__ */ r.jsx("div", { className: "col-3", children: t.date && /* @__PURE__ */ r.jsxs(Z, { variant: "caption", className: w("h-100 d-flex flex-column align-items-end justify-content-center gap-0", Ke.stepDate), children: [
3264
- /* @__PURE__ */ r.jsx("div", { children: xt(t.date, "dd.MM.yyyy") }),
3265
- /* @__PURE__ */ r.jsx("div", { children: xt(t.date, "HH:mm") })
3266
- ] }) }),
3267
- /* @__PURE__ */ r.jsx("div", { className: "col-9", children: /* @__PURE__ */ r.jsxs("div", { className: w("h-100 d-flex flex-column gap-1 border-start border-2 p-3", Ke.stepContent), children: [
3268
- /* @__PURE__ */ r.jsxs("div", { className: w("d-flex gap-2 align-items-center", Ke.contentHeader), children: [
3269
- t.person && /* @__PURE__ */ r.jsx(jr, { name: t.person.name ?? "", size: 22, fontSize: 12 }),
3270
- typeof t.title == "string" ? /* @__PURE__ */ r.jsx(Z, { variant: "body", className: "fw-bold", children: t.title }) : t.title
3271
- ] }),
3272
- t.text && /* @__PURE__ */ r.jsx(Z, { variant: "body2", className: Ke.contentText, children: t.text }),
3273
- /* @__PURE__ */ r.jsx("div", { className: w("text-primary", Ke.stepIcon), children: t.icon ?? /* @__PURE__ */ r.jsx(gs, {}) })
3274
- ] }) })
3275
- ] }, n)) }), cc = (e, t, n, a = !0) => {
3276
- const s = et({ silent: a, differentBaseUrl: t, customToken: n }), [o, i] = E(!1), [c, l] = E(null), u = S(async (d) => {
3277
- i(!0), l(null), s.get(e, {
3278
- signal: d,
3279
- responseType: "blob"
3280
- }).then((m) => {
3281
- i(!1), l(m.data);
3282
- }).catch(() => {
3283
- i(!1), l(null);
3284
- });
3285
- }, [s, e]);
3286
- return A(() => {
3287
- const d = new AbortController();
3288
- return u(d.signal), () => {
3289
- d.abort();
3290
- };
3291
- }, [u]), { data: c, setData: l, reloadData: u, isLoading: o };
3292
- }, Zn = ({ src: e, alt: t, baseUrl: n, customToken: a, placeholder: s, ...o }) => {
3293
- const { data: i } = cc(e, n, a), [c, l] = E(null);
3294
- return A(() => {
3295
- let u = null;
3296
- return i !== null ? (u = URL.createObjectURL(i), l(u)) : l(null), () => {
3297
- u !== null && URL.revokeObjectURL(u);
3298
- };
3299
- }, [i]), c === null && !s ? null : /* @__PURE__ */ r.jsx("img", { ...o, alt: t ?? "", src: c ?? s });
3300
- }, Jn = [
3301
- ["D", "day"],
3302
- // ['W', 'week'],
3303
- ["M", "month"],
3304
- ["Y", "year"],
3305
- ["C", "custom"]
3306
- ], dc = "_wrapper_qfqux_1", uc = "_lg_qfqux_7", fc = "_sm_qfqux_11", mc = "_md_qfqux_14", Xn = {
3307
- wrapper: dc,
3308
- lg: uc,
3309
- sm: fc,
3310
- md: mc
3311
- }, Ct = (e) => {
3312
- const t = new Date(e), n = Be(t.toISOString());
3313
- t.setMonth(t.getMonth() + 1), t.setDate(t.getDate() - 1);
3314
- const a = Be(t.toISOString());
3315
- return { from: n, to: a };
3316
- }, gt = (e) => {
3317
- const t = new Date(e), n = Be(t.toISOString());
3318
- t.setFullYear(t.getFullYear() + 1), t.setDate(t.getDate() - 1);
3319
- const a = Be(t.toISOString());
3320
- return { from: n, to: a };
3321
- }, hc = (e, t) => {
3322
- if (e === null || t === null)
3323
- return "C";
3324
- if (e === t)
3325
- return "D";
3326
- const n = new Date(e);
3327
- return Ct(n).to === t ? "M" : gt(n).to === t ? "Y" : (console.log(gt(n), t), "C");
3328
- }, gc = (e, t, n) => {
3329
- const a = S((i, c) => {
3330
- if (e === "C") {
3331
- n((l) => ({ ...l, [i]: c }));
3332
- return;
3333
- }
3334
- switch (i) {
3335
- case "from":
3336
- n((l) => {
3337
- if (c === null)
3338
- return l;
3339
- const u = new Date(c);
3340
- if (e === "D") {
3341
- const d = Be(u.toISOString());
3342
- return {
3343
- from: d,
3344
- to: d
3345
- };
3346
- }
3347
- return e === "M" ? Ct(u) : e === "Y" ? gt(u) : l;
3348
- });
3349
- break;
3350
- case "to":
3351
- t("C"), n((l) => ({ ...l, [i]: c }));
3352
- break;
3353
- }
3354
- }, [e, n, t]), s = S((i) => {
3355
- n((c) => {
3356
- if (c.from === null || c.to === null)
3357
- return c;
3358
- const l = new Date(c.from);
3359
- l.setHours(l.getHours() - l.getTimezoneOffset() / 60);
3360
- const u = new Date(c.to);
3361
- if (e === "D") {
3362
- l.setDate(l.getDate() + i);
3363
- const d = Be(l.toISOString());
3364
- return {
3365
- from: d,
3366
- to: d
3367
- };
3368
- }
3369
- return e === "M" ? (l.setMonth(l.getMonth() + i), Ct(l)) : e === "Y" ? (l.setFullYear(l.getFullYear() + i), gt(l)) : {
3370
- from: Be(l.toISOString()),
3371
- to: Be(u.toISOString())
3372
- };
3373
- });
3374
- }, [e, n]), o = S((i) => {
3375
- i === "D" ? n((c) => ({ from: c.from, to: c.from })) : i === "M" ? n((c) => {
3376
- if (c.from === null)
3377
- return c;
3378
- const l = ps(c.from);
3379
- return Ct(l);
3380
- }) : i === "Y" && n((c) => {
3381
- if (c.from === null)
3382
- return c;
3383
- const l = xs(new Date(c.from).getFullYear());
3384
- return gt(l);
3385
- }), t(i);
3386
- }, [n, t]);
3387
- return { setFromToProp: a, handleArrowClick: s, handleRangeChange: o };
3388
- }, Sd = ({ fromtoState: [e, t], className: n, size: a }) => {
3389
- const { texts: { date: s }, ProjectIconComponent: o } = Q(ge), [i, c] = E("C"), { handleArrowClick: l, handleRangeChange: u, setFromToProp: d } = gc(i, c, t), m = te(() => i === "C", [i]), x = ee(!0);
3390
- return A(() => {
3391
- if (x.current) {
3392
- const v = hc(e.from, e.to);
3393
- c(v), x.current = !1;
3394
- }
3395
- }, [e.from, e.to]), /* @__PURE__ */ r.jsxs("div", { className: w("d-inline-flex align-items-center gap-1", Xn.wrapper, Xn[a ?? "md"], n), children: [
3396
- /* @__PURE__ */ r.jsx(ne, { disabled: m, onClick: () => {
3397
- l(-1);
3398
- }, children: /* @__PURE__ */ r.jsx(o, { icon: "chevron-left" }) }),
3399
- /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center gap-1", children: [
3400
- /* @__PURE__ */ r.jsx(at, { type: "date", value: e.from, onChange: (v) => d("from", v === null ? null : v.toString()), InputContainer: Fe, size: a }),
3401
- /* @__PURE__ */ r.jsx(dn, { toggle: /* @__PURE__ */ r.jsx(un, { text: s[Jn.find((v) => v[0] === i)[1]].substring(0, 1), as: vs }), children: Jn.map((v) => /* @__PURE__ */ r.jsx(Qe, { disabled: v[0] === i, className: w(v[0] === i ? "text-black-50" : ""), onClick: () => u(v[0]), role: "button", children: s[v[1]] }, v[0])) }),
3402
- /* @__PURE__ */ r.jsx(at, { type: "date", value: e.to, onChange: (v) => d("to", v === null ? null : v.toString()), InputContainer: Fe, size: a })
3403
- ] }) }),
3404
- /* @__PURE__ */ r.jsx(ne, { disabled: m, onClick: () => {
3405
- l(1);
3406
- }, children: /* @__PURE__ */ r.jsx(o, { icon: "chevron-right" }) })
3407
- ] });
3408
- }, kd = ({ defaultMonth: e, searchKey: t = "monthFrom", yearMin: n, yearMax: a }) => {
3409
- const { localizationContext: s } = Q(ge), { dateFnsLocale: o } = Q(s), { searchParams: i, setSearch: c } = Es(), l = i.get(t), u = l ? vt(l) : e, d = S((m) => {
3410
- c(t, tn(m, { representation: "date" }));
3411
- }, [t, c]);
3412
- return /* @__PURE__ */ r.jsx(po, { month: u, onChangeMonth: d, locale: o, yearMin: n, yearMax: a });
3413
- }, Id = ({ defaultYear: e, searchKey: t = "yearFrom", optionMin: n, optionMax: a, className: s }) => {
3414
- const [o, i] = Ts(t, tn(e, { representation: "date" })), c = o ? vt(o) : e, l = S((u) => {
3415
- i(tn(u, { representation: "date" }));
3416
- }, [i]);
3417
- return /* @__PURE__ */ r.jsx(jo, { year: c, onChangeYear: l, optionMin: n, optionMax: a, className: s });
3418
- }, Dd = ({ data: e, showLegend: t = !1, legendPosition: n = "left", onClick: a }) => {
3419
- const { chartColorPalette: s } = Q(ge);
3420
- return /* @__PURE__ */ r.jsx(js, { data: e, margin: {
3421
- top: 50,
3422
- right: t && n === "right" ? 200 : 100,
3423
- bottom: 50,
3424
- left: t && n === "left" ? 200 : 100
3425
- }, innerRadius: 0.4, padAngle: 4, cornerRadius: 2, activeOuterRadiusOffset: 10, borderWidth: 2, borderColor: {
3426
- from: "color",
3427
- modifiers: [["darker", 0.5]]
3428
- }, colors: s, arcLinkLabelsSkipAngle: 10, arcLinkLabelsTextColor: { from: "color", modifiers: [["darker", 0.5]] }, arcLinkLabelsThickness: 2, arcLinkLabelsColor: { from: "color" }, enableArcLabels: !1, legends: t ? [
3429
- {
3430
- anchor: n,
3431
- direction: n === "left" || n === "right" ? "column" : "row",
3432
- justify: !1,
3433
- translateX: n === "left" ? -200 : n === "right" ? 200 : 0,
3434
- translateY: n === "top" ? -50 : n === "bottom" ? 50 : 0,
3435
- itemsSpacing: 4,
3436
- itemWidth: 120,
3437
- itemHeight: 18,
3438
- itemTextColor: "#1e2832",
3439
- itemDirection: "left-to-right",
3440
- itemOpacity: 1,
3441
- symbolSize: 18,
3442
- symbolShape: "circle",
3443
- padding: 10
3444
- }
3445
- ] : [], onClick: (o) => a && a(o.data) });
3446
- }, pc = ({ errors: e, schema: t }) => {
3447
- const n = (a) => {
3448
- var s, o;
3449
- return a.toLowerCase() === "others" ? "Obecné" : ((o = (s = t.columns) == null ? void 0 : s.find((i) => i.field === a)) == null ? void 0 : o.caption) ?? a;
3450
- };
3451
- return /* @__PURE__ */ r.jsx("div", { className: "alert alert-danger w-100 m-0 p-2", children: /* @__PURE__ */ r.jsx("table", { children: /* @__PURE__ */ r.jsx("tbody", { children: e.map((a) => /* @__PURE__ */ r.jsxs("tr", { children: [
3452
- /* @__PURE__ */ r.jsx("td", { className: "fw-bold pe-2", children: /* @__PURE__ */ r.jsxs(Z, { variant: "body", children: [
3453
- n(a.name),
3454
- ":"
3455
- ] }) }),
3456
- /* @__PURE__ */ r.jsx("td", { className: "", children: /* @__PURE__ */ r.jsx(Z, { variant: "body", children: a.errors }) })
3457
- ] }, a.name)) }) }) });
3458
- }, va = (e) => {
3459
- const t = {};
3460
- return Object.keys(e).forEach((n) => {
3461
- if (e[n].value === !0) {
3462
- t[n] = 1;
3463
- return;
3464
- }
3465
- if (e[n].value === !1) {
3466
- t[n] = 0;
3467
- return;
3468
- }
3469
- t[n] = e[n].value;
3470
- }), t;
3471
- }, er = (e, t) => {
3472
- const n = {};
3473
- return Object.keys(e).forEach((a) => {
3474
- var i;
3475
- const s = e[a], o = (i = t.columns) == null ? void 0 : i.find((c) => c.field === a);
3476
- if ((o == null ? void 0 : o.type) === "BIT" && (s === 1 || s === 0)) {
3477
- n[a] = { value: s === 1, defaultValue: s === 1 };
3478
- return;
3479
- }
3480
- n[a] = { value: s, defaultValue: s };
3481
- }), n;
3482
- }, xc = "_table_1klfy_1", vc = "_table-header_1klfy_10", jc = "_table-row_1klfy_10", yc = "_table-head_1klfy_10", bc = "_filters-row_1klfy_19", wc = "_table-body_1klfy_30", _c = "_table-cell_1klfy_30", Nc = "_action-column_1klfy_43", Cc = "_sticky-top_1klfy_47", Sc = "_sticky-first_1klfy_54", kc = "_sticky-last_1klfy_61", Ic = "_sticky-bottom_1klfy_68", de = {
3483
- table: xc,
3484
- "table-header": "_table-header_1klfy_10",
3485
- tableHeader: vc,
3486
- "table-row": "_table-row_1klfy_10",
3487
- tableRow: jc,
3488
- "table-head": "_table-head_1klfy_10",
3489
- tableHead: yc,
3490
- "filters-row": "_filters-row_1klfy_19",
3491
- filtersRow: bc,
3492
- "table-body": "_table-body_1klfy_30",
3493
- tableBody: wc,
3494
- "table-cell": "_table-cell_1klfy_30",
3495
- tableCell: _c,
3496
- "action-column": "_action-column_1klfy_43",
3497
- actionColumn: Nc,
3498
- "sticky-top": "_sticky-top_1klfy_47",
3499
- stickyTop: Cc,
3500
- "sticky-first": "_sticky-first_1klfy_54",
3501
- stickyFirst: Sc,
3502
- "sticky-last": "_sticky-last_1klfy_61",
3503
- stickyLast: kc,
3504
- "sticky-bottom": "_sticky-bottom_1klfy_68",
3505
- stickyBottom: Ic
3506
- }, Dc = "_input_13mhy_1", nt = {
3507
- input: Dc
3508
- }, ja = ({ type: e, value: t, field: n, isPrimary: a, isReadonly: s, primaryEditable: o = !1, valuesForSelect: i, onChangeHandler: c, hideClearIcon: l, clearValue: u }) => {
3509
- switch (e) {
3510
- case "NUM":
3511
- return i && i.length > 0 ? /* @__PURE__ */ r.jsx(Dt, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", value: (t == null ? void 0 : t.toString()) ?? "", onChange: (d) => c(n, d === null ? null : Number(d)), options: i, disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u }) : /* @__PURE__ */ r.jsx(at, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", type: "number", value: t === null ? null : Number(t), onChange: (d) => c(n, d === null ? null : Number(d)), disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u });
3512
- case "STR":
3513
- return i && i.length > 0 ? /* @__PURE__ */ r.jsx(Dt, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", value: (t == null ? void 0 : t.toString()) ?? "", onChange: (d) => c(n, (d == null ? void 0 : d.toString()) ?? null), options: i, disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u }) : /* @__PURE__ */ r.jsx(at, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", type: "text", value: (t == null ? void 0 : t.toString()) ?? "", onChange: (d) => c(n, (d == null ? void 0 : d.toString()) ?? null), disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u });
3514
- case "BIT":
3515
- return /* @__PURE__ */ r.jsx(aa, { InputContainer: Fe, className: nt.input, value: t === !0, onChange: (d) => c(n, d), disabled: s || o ? !1 : a });
3516
- case "DT":
3517
- return /* @__PURE__ */ r.jsx(at, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", type: "date", value: t ? t.toString().split("T")[0] ?? "" : "", onChange: (d) => c(n, (d == null ? void 0 : d.toString()) ?? null), disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u });
3518
- default:
3519
- return /* @__PURE__ */ r.jsx("div", { className: "alert alert-warning p-1 m-0", children: /* @__PURE__ */ r.jsxs(Z, { variant: "body", children: [
3520
- "Neznámý typ ",
3521
- e
3522
- ] }) });
3523
- }
3524
- }, $c = ({ schema: e, columns: t, initialItem: n, onEdit: a, onDelete: s }) => {
3525
- const { ProjectIconComponent: o } = Q(ge), [i, c] = E(n), l = S((m, x) => {
3526
- console.log("changeValue", m, x), c((v) => ({
3527
- ...v,
3528
- [m]: {
3529
- ...v[m],
3530
- value: x
3531
- }
3532
- }));
3533
- }, []), u = (m) => (m == null ? void 0 : m.value) !== (m == null ? void 0 : m.defaultValue), d = S(() => Object.keys(i).some((m) => u(i[m])), [i]);
3534
- return A(() => {
3535
- c(n);
3536
- }, [n]), /* @__PURE__ */ r.jsxs("tr", { className: w("table-row", de.tableRow), children: [
3537
- /* @__PURE__ */ r.jsx("td", { className: w("table-cell", de.tableCell, de.stickyFirst), children: d() && /* @__PURE__ */ r.jsx(ne, { color: "success", onClick: () => a(va(i)), children: /* @__PURE__ */ r.jsx(o, { icon: "check" }) }) }),
3538
- t.map((m) => {
3539
- var x, v;
3540
- return /* @__PURE__ */ r.jsx("td", { className: w("table-cell", de.tableCell), children: /* @__PURE__ */ r.jsx(ja, { type: m.type, value: (x = i[m.field ?? ""]) == null ? void 0 : x.value, field: m.field, isReadonly: m.readOnly, isPrimary: e.primaryKey === m.field, valuesForSelect: m.valuesForSelect, onChangeHandler: l, hideClearIcon: !u(i[m.field ?? ""]), clearValue: (v = i[m.field ?? ""].defaultValue) == null ? void 0 : v.toString() }) }, `${e.id}-${m.field}`);
3541
- }),
3542
- /* @__PURE__ */ r.jsx("td", { className: w("table-cell", de.tableCell, de.stickyLast), children: /* @__PURE__ */ r.jsx(ne, { color: "danger", onClick: () => s(i[e.primaryKey ?? ""].value), children: /* @__PURE__ */ r.jsx(o, { icon: "delete" }) }) })
3543
- ] });
3544
- }, Fc = ({ schema: e, columns: t, onCreate: n }) => {
3545
- const { ProjectIconComponent: a } = Q(ge), [s, o] = E(null), i = S(() => {
3546
- var u;
3547
- const l = {};
3548
- (u = e.columns) == null || u.forEach((d) => {
3549
- const m = d.type === "BIT" ? !1 : d.type === "NUM" ? 0 : d.type === "STR" ? "" : null;
3550
- l[d.field ?? ""] = {
3551
- value: m,
3552
- defaultValue: m
3553
- };
3554
- }), o(l);
3555
- }, [e]), c = S((l, u) => {
3556
- o((d) => d && {
3557
- ...d,
3558
- [l]: {
3559
- ...d[l],
3560
- value: u
3561
- }
3562
- });
3563
- }, []);
3564
- return s ? /* @__PURE__ */ r.jsxs("tr", { className: "sticky-bottom shadow", children: [
3565
- /* @__PURE__ */ r.jsx("td", { className: "sticky-first", children: /* @__PURE__ */ r.jsx(ne, { color: "success", onClick: async () => {
3566
- const l = va(s);
3567
- l && await n(l) && o(null);
3568
- }, children: /* @__PURE__ */ r.jsx(a, { icon: "check" }) }) }),
3569
- t.map((l) => /* @__PURE__ */ r.jsx("td", { children: /* @__PURE__ */ r.jsx(ja, { type: l.type, value: s[l.field ?? ""].value, field: l.field, isReadonly: l.readOnly, isPrimary: e.primaryKey === l.field, valuesForSelect: l.valuesForSelect, onChangeHandler: c, primaryEditable: !0 }) }, `${e.id}-${l.field}`)),
3570
- /* @__PURE__ */ r.jsx("td", { className: "sticky-last", children: /* @__PURE__ */ r.jsx(ne, { color: "danger", onClick: () => o(null), children: /* @__PURE__ */ r.jsx(a, { icon: "cancel" }) }) })
3571
- ] }) : /* @__PURE__ */ r.jsxs("tr", { className: "sticky-bottom shadow", children: [
3572
- /* @__PURE__ */ r.jsx("td", { className: "sticky-first", children: /* @__PURE__ */ r.jsx(ne, { onClick: i, children: /* @__PURE__ */ r.jsx(a, { icon: "add" }) }) }),
3573
- /* @__PURE__ */ r.jsx("td", { colSpan: t.length + 1 })
3574
- ] });
3575
- }, Oc = ({ column: e, children: t }) => e.description ? /* @__PURE__ */ r.jsx(mn, { placement: "bottom", text: e.description ?? "", children: /* @__PURE__ */ r.jsx("div", { children: t }) }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: t }), Ec = ({ schema: e, items: t, onEditItem: n, onDeleteItem: a, onCreateItem: s, filters: o, setFilter: i, sortByField: c, sortByType: l, setSortBy: u, selectedMaster: d }) => {
3576
- const { texts: { dynamicForms: m }, ProjectIconComponent: x } = Q(ge), [v, h] = E([]);
3577
- return A(() => {
3578
- var p, g, j;
3579
- h([
3580
- ...((j = (g = (p = e.columns) == null ? void 0 : p.filter((y) => !y.hidden)) == null ? void 0 : g.filter((y) => e.masterReference ? y.field !== e.masterReferenceColumn : !0)) == null ? void 0 : j.map((y) => {
3581
- var f;
3582
- return {
3583
- label: y.caption ?? "",
3584
- description: y.description ?? null,
3585
- field: y.field ?? "",
3586
- type: y.type,
3587
- readOnly: y.readOnly,
3588
- valuesForSelect: ((f = y.values) == null ? void 0 : f.filter((b) => y.valuesFilteredByMaster ? b.masterValue === d : !0).map((b) => ({ id: b.id ?? "", name: b.name }))) ?? void 0
3589
- };
3590
- })) ?? []
3591
- ]);
3592
- }, [e, d]), /* @__PURE__ */ r.jsxs("table", { id: `dynamic-table-${e.id}`, className: w("table table-borderless luminus-df-table", de.table), children: [
3593
- /* @__PURE__ */ r.jsxs("thead", { className: w("text-nowrap table-header", de.stickyTop, de.tableHeader), children: [
3594
- /* @__PURE__ */ r.jsxs("tr", { className: w("table-row", de.tableRow), children: [
3595
- /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyFirst) }),
3596
- v.map((p) => /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead), onClick: () => {
3597
- const g = c === p.field ? l : null;
3598
- if (g === "asc") {
3599
- u(p.field, "desc");
3600
- return;
3601
- }
3602
- if (g === "desc") {
3603
- u(p.field, null);
3604
- return;
3605
- }
3606
- u(p.field, "asc");
3607
- }, children: /* @__PURE__ */ r.jsx(Oc, { column: p, children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [
3608
- p.label,
3609
- c === p.field && /* @__PURE__ */ r.jsx(x, { icon: l === "asc" ? "chevron-up" : "chevron-down" })
3610
- ] }) }) }, `${e.id}-${p.field}`)),
3611
- /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyLast) })
3612
- ] }),
3613
- /* @__PURE__ */ r.jsxs("tr", { className: w("table-row filters-row", de.tableRow, de.filtersRow), children: [
3614
- /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyFirst) }),
3615
- v.map((p) => /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead), children: p.valuesForSelect && p.valuesForSelect.length > 0 || p.type === "BIT" ? /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx(Dt, { InputContainer: Fe, withoutLabel: !0, size: "sm", value: o[p.field] ?? "", onChange: (g) => i(p.field, (g == null ? void 0 : g.toString()) ?? null), options: p.type === "BIT" ? [
3616
- { id: 1, name: m.yes },
3617
- { id: 0, name: m.no }
3618
- ] : p.valuesForSelect ?? [], isNumber: p.type === "BIT", showClearIcon: !0 }) }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx(at, { InputContainer: Fe, withoutLabel: !0, size: "sm", type: p.type === "NUM" ? "number" : p.type === "DT" ? "date" : "text", value: o[p.field] ?? "", onChange: (g) => i(p.field, (g == null ? void 0 : g.toString()) ?? null) }) }) }, `${e.id}-${p.field}`)),
3619
- /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyLast) })
3620
- ] })
3621
- ] }),
3622
- /* @__PURE__ */ r.jsxs("tbody", { className: w("table-body", de.tableBody), children: [
3623
- t.filter((p) => p[e.primaryKey ?? ""]).map((p) => /* @__PURE__ */ r.jsx($c, { schema: e, columns: v, initialItem: p, onEdit: n, onDelete: a }, `${e.id}-${p[e.primaryKey ?? ""].value}`)),
3624
- /* @__PURE__ */ r.jsx(Fc, { schema: e, columns: v, onCreate: s })
3625
- ] })
3626
- ] });
3627
- }, Tc = ({ master: e, onChange: t, options: n, label: a }) => /* @__PURE__ */ r.jsx(Dt, { label: a, value: e, onChange: (s) => t(s ? s.toString() : null), options: n, size: "sm" }), Lc = "_pagination_gujwe_1", tr = {
3628
- pagination: Lc
3629
- }, nr = {
3630
- appDetail: "/settings/:id"
3631
- }, rt = {
3632
- apiSchemaGet: "/dynamicForms/schema",
3633
- apiDataGet: "/dynamicForms/data",
3634
- apiItemPost: "/dynamicForms/update",
3635
- apiItemDelete: "/dynamicForms/delete",
3636
- apiItemCreate: "/dynamicForms/insert"
3637
- }, $d = ({ id: e, page: t, setPage: n, filters: a, setFilter: s, sortByField: o, sortByType: i, setSortBy: c, appUrls: { appDetail: l = nr.appDetail } = nr, apiUrls: { apiSchemaGet: u = rt.apiSchemaGet, apiDataGet: d = rt.apiDataGet, apiItemPost: m = rt.apiItemPost, apiItemDelete: x = rt.apiItemDelete, apiItemCreate: v = rt.apiItemCreate } = rt }) => {
3638
- var le, we, ce, ae, Se, De;
3639
- const { texts: { dynamicForms: h }, ProjectIconComponent: p } = Q(ge), g = et(), { startLoading: j, stopLoading: y } = Q(Tt), [f, b] = E(null), [N, k] = E(null), [I, F] = E(null), [C, R] = E(null), [O, _] = E(!1), { addNotification: U } = xr(), [V, X] = E([]), { confirm: L } = Ot(), D = 20, P = D + 1, H = C ? Math.ceil(C.length / D) : 1, J = t ? t > 1 : !1, $ = t ? t < H : !1, Y = t ? (t - 1) * D : 0, ie = t ? t * D : D, [M, z] = E(!1), me = M ? C == null ? void 0 : C.slice(Y, ie) : C, [G, pe] = E(null);
3640
- A(() => {
3641
- b(null), k(null), _(!1), X([]), pe(null);
3642
- }, [e]);
3643
- const Ne = S(async () => {
3644
- j("dynamicFormSchema"), await g.get(`${u}?id=${e}`).then(({ data: W }) => {
3645
- b(W), y("dynamicFormSchema");
3646
- }).catch(() => y("dynamicFormSchema"));
3647
- }, [g, e, j, y, u]), Ie = S(async () => {
3648
- var W;
3649
- if (!(f === null || ((W = f.id) == null ? void 0 : W.toString()) !== e)) {
3650
- if (f.masterReference && !G) {
3651
- k([]);
3652
- return;
3653
- }
3654
- j("dynamicFormData"), await g.get(`${d}?id=${e}&showArchive=${O}${f.masterReference ? `&master=${G}` : ""}`).then(({ data: re }) => {
3655
- const he = re.map((oe) => {
3656
- var xe;
3657
- return Object.fromEntries(((xe = f.columns) == null ? void 0 : xe.filter((je) => je.field).map((je) => [
3658
- je.field,
3659
- { value: oe[je.field ?? ""], defaultValue: oe[je.field ?? ""] }
3660
- ])) ?? []);
3661
- });
3662
- k(he), y("dynamicFormData");
3663
- }).catch(() => y("dynamicFormData"));
3664
- }
3665
- }, [g, e, f, j, y, O, G, d]), We = S(async (W) => (j("dynamicFormEdit"), g.post(`${m}?id=${e}`, W).then(() => (y("dynamicFormEdit"), X([]), !0)).catch((re) => (y("dynamicFormEdit"), X(Vt(re)), !1))), [g, e, j, y, m]), K = S(async (W) => (j("dynamicFormDelete"), g.delete(`${x}?id=${e}&pk=${W}`).then(() => (y("dynamicFormDelete"), X([]), !0)).catch((re) => (y("dynamicFormDelete"), X(Vt(re)), !1))), [g, e, j, y, x]), fe = S(async (W) => (j("dynamicFormCreate"), g.post(`${v}?id=${e}`, W).then(({ data: re }) => (y("dynamicFormCreate"), X([]), re)).catch((re) => (y("dynamicFormCreate"), X(Vt(re)), null))), [g, e, j, y, v]), _e = S(async (W) => {
3666
- f && await We(f.masterReference ? { ...W, [f.masterReferenceColumn ?? ""]: G } : W) && (U(h.editSuccess, "success"), k((re) => re && re.map((he) => {
3667
- var oe;
3668
- return ((oe = he[(f == null ? void 0 : f.primaryKey) ?? ""]) == null ? void 0 : oe.value) === W[(f == null ? void 0 : f.primaryKey) ?? ""] ? er(W, f) : he;
3669
- })));
3670
- }, [U, We, f, G, h]), ze = S(async (W) => {
3671
- await L(h.deleteConfirm) && await K(W) && (U(h.deleteSuccess, "success"), k((re) => re && re.filter((he) => {
3672
- var oe;
3673
- return ((oe = he[(f == null ? void 0 : f.primaryKey) ?? ""]) == null ? void 0 : oe.value) !== W;
3674
- })));
3675
- }, [U, K, h, L, f]), tt = S(async (W) => {
3676
- if (!f)
3677
- return !1;
3678
- const re = await fe(f.masterReference ? { ...W, [f.masterReferenceColumn ?? ""]: G } : W);
3679
- if (re !== null) {
3680
- U(h.createSuccess, "success");
3681
- const he = er(W, f);
3682
- return he[(f == null ? void 0 : f.primaryKey) ?? ""] = { value: re, defaultValue: re }, k((oe) => [...oe ?? [], he]), !0;
3683
- }
3684
- return !1;
3685
- }, [U, fe, h, f, G]), T = (W) => {
3686
- W > H ? n(H) : W < 1 && n(1), n(W);
3687
- }, B = S(() => {
3688
- if (!N || !f) {
3689
- F(null);
3690
- return;
3691
- }
3692
- const W = N.filter((re) => Object.entries(a).every(([he, oe]) => {
3693
- var ct, dt, ut;
3694
- if (oe === null)
3695
- return !0;
3696
- const xe = (ct = re[he]) == null ? void 0 : ct.value;
3697
- if (xe == null)
3698
- return !1;
3699
- const je = (dt = f.columns) == null ? void 0 : dt.find((bt) => bt.field === he), it = je == null ? void 0 : je.type, lt = (je == null ? void 0 : je.values) && ((ut = je == null ? void 0 : je.values) == null ? void 0 : ut.length) > 0;
3700
- if (!it)
3701
- return !1;
3702
- switch (it) {
3703
- case "STR":
3704
- return lt ? xe === oe : xe.toString().toLowerCase().includes(oe.toLowerCase());
3705
- case "NUM":
3706
- return lt ? Number(xe) === Number(oe) : xe.toString().toLowerCase().includes(oe.toLowerCase());
3707
- case "DT":
3708
- return xe.toString().toLowerCase().includes(oe.toLowerCase());
3709
- case "BIT":
3710
- return Number(xe) === Number(oe);
3711
- default:
3712
- return xe.toString().toLowerCase().includes(oe.toLowerCase());
3713
- }
3714
- }));
3715
- F(W);
3716
- }, [N, a, f]), q = S(() => {
3717
- if (!I || !f) {
3718
- R([]);
3719
- return;
3720
- }
3721
- if (!o) {
3722
- R(I);
3723
- return;
3724
- }
3725
- R([...I].sort((W, re) => {
3726
- var it, lt, ct, dt, ut, bt;
3727
- const he = ((lt = (it = W[o]) == null ? void 0 : it.value) == null ? void 0 : lt.toString()) ?? "", oe = ((dt = (ct = re[o]) == null ? void 0 : ct.value) == null ? void 0 : dt.toString()) ?? "", xe = f.columns.find(($e) => $e.field === o), je = xe == null ? void 0 : xe.type;
3728
- if (!xe || !je || !he && !oe)
3729
- return 0;
3730
- if (!he)
3731
- return 1;
3732
- if (!oe)
3733
- return -1;
3734
- if (xe.values && xe.values.length > 0) {
3735
- const $e = ((ut = xe.values.find((At) => {
3736
- var ft;
3737
- return ((ft = At.id) == null ? void 0 : ft.toString()) === he;
3738
- })) == null ? void 0 : ut.name) ?? "", Te = ((bt = xe.values.find((At) => {
3739
- var ft;
3740
- return ((ft = At.id) == null ? void 0 : ft.toString()) === oe;
3741
- })) == null ? void 0 : bt.name) ?? "";
3742
- return i === "asc" ? $e.localeCompare(Te) : Te.localeCompare($e);
3743
- }
3744
- if (je === "NUM") {
3745
- const $e = Number(he), Te = Number(oe);
3746
- return i === "asc" ? $e - Te : Te - $e;
3747
- }
3748
- if (je === "DT") {
3749
- const $e = vt(he == null ? void 0 : he.toString()).getTime(), Te = vt(oe == null ? void 0 : oe.toString()).getTime();
3750
- return i === "asc" ? $e - Te : Te - $e;
3751
- }
3752
- return i === "asc" ? he.toString().localeCompare(oe.toString()) : oe.toString().localeCompare(he.toString());
3753
- }));
3754
- }, [I, f, o, i]);
3755
- return A(() => {
3756
- Ne();
3757
- }, [Ne]), A(() => {
3758
- Ie();
3759
- }, [Ie]), A(() => {
3760
- B();
3761
- }, [B]), A(() => {
3762
- q();
3763
- }, [q]), A(() => {
3764
- C && C.length > P ? (z(!0), t || n(1)) : (z(!1), C && n(null));
3765
- }, [C, n, t, P]), A(() => {
3766
- !M || !t || (t > H && n(H), t < 1 && n(1));
3767
- }, [t, M, H, n]), /* @__PURE__ */ r.jsxs("div", { className: "h-100 w-100 d-flex flex-column", children: [
3768
- /* @__PURE__ */ r.jsxs("div", { className: "mb-3 d-flex justify-content-between align-items-center", children: [
3769
- /* @__PURE__ */ r.jsx(Z, { variant: "h3", children: (f == null ? void 0 : f.name) ?? "" }),
3770
- /* @__PURE__ */ r.jsx(aa, { label: h.showArchived, value: O === !0, onChange: (W) => _(W) })
3771
- ] }),
3772
- (f == null ? void 0 : f.description) && /* @__PURE__ */ r.jsx(Z, { variant: "body2", className: "mb-3", children: f == null ? void 0 : f.description }),
3773
- (f == null ? void 0 : f.masterReference) && /* @__PURE__ */ r.jsx("div", { className: "mb-3 d-flex", children: /* @__PURE__ */ r.jsx(Tc, { label: ((we = (le = f.columns) == null ? void 0 : le.find((W) => W.field === f.masterReferenceColumn)) == null ? void 0 : we.caption) ?? "", options: ((ae = (ce = f.columns) == null ? void 0 : ce.find((W) => W.field === f.masterReferenceColumn)) == null ? void 0 : ae.values) ?? [], master: G, onChange: (W) => pe(W) }) }),
3774
- (f == null ? void 0 : f.slaves) && f.slaves.length > 0 && /* @__PURE__ */ r.jsx("div", { className: "mb-3 d-flex align-items-center flex-start", children: f.slaves.map((W) => {
3775
- var re;
3776
- return /* @__PURE__ */ r.jsx(ot, { as: "link", href: `${kt(l, { id: (re = W.id) == null ? void 0 : re.toString() })}?type=dynamic-form`, children: W.name }, W.id);
3777
- }) }),
3778
- f != null && f.masterReference && !G ? /* @__PURE__ */ r.jsx(xa, { variant: "warning", children: h.selectMaster(((De = (Se = f.columns) == null ? void 0 : Se.find((W) => W.field === f.masterReferenceColumn)) == null ? void 0 : De.caption) ?? "").toLowerCase() }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3779
- f && V.length > 0 && /* @__PURE__ */ r.jsx("div", { className: "mb-2", children: /* @__PURE__ */ r.jsx(pc, { errors: V, schema: f }) }),
3780
- f && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3781
- /* @__PURE__ */ r.jsx("div", { className: w("rounded border overflow-auto", tr.tableContainer), children: /* @__PURE__ */ r.jsx(Ec, { schema: f, items: (M ? me : C) ?? [], onEditItem: _e, onDeleteItem: ze, onCreateItem: tt, filters: a, setFilter: s, sortByField: o, sortByType: i, setSortBy: c, selectedMaster: (G == null ? void 0 : G.toString()) ?? null }) }),
3782
- M && t && /* @__PURE__ */ r.jsxs("div", { className: w(tr.pagination, "d-flex align-items-center gap-3 p-1 border-bottom border-start border-end rounded"), children: [
3783
- /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center gap-1", children: [
3784
- /* @__PURE__ */ r.jsx(ne, { color: "primary", onClick: () => T(1), disabled: !J, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-double-left" }) }),
3785
- /* @__PURE__ */ r.jsx(ne, { color: "primary", onClick: () => T(t - 1), disabled: !J, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-left" }) }),
3786
- /* @__PURE__ */ r.jsx(ne, { color: "primary", onClick: () => T(t + 1), disabled: !$, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-right" }) }),
3787
- /* @__PURE__ */ r.jsx(ne, { color: "primary", onClick: () => T(H), disabled: !$, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-double-right" }) })
3788
- ] }),
3789
- /* @__PURE__ */ r.jsxs(Z, { variant: "body", children: [
3790
- h.tablePage,
3791
- " ",
3792
- t,
3793
- " ",
3794
- h.tablePageFrom,
3795
- " ",
3796
- H
3797
- ] })
3798
- ] })
3799
- ] })
3800
- ] })
3801
- ] });
3802
- }, rr = {
3803
- appDetail: "/settings/:id"
3804
- }, ar = {
3805
- apiDynamicFormsGet: "/dynamicForms"
3806
- }, Rc = ({ item: e, children: t }) => e.description ? /* @__PURE__ */ r.jsx(mn, { placement: "left", text: e.description ?? "", children: /* @__PURE__ */ r.jsx("div", { children: t }) }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: t }), Fd = ({ activeId: e, otherForms: t = [], groupsDefs: n = [], searchQuery: a, fullSize: s, appUrls: { appDetail: o = rr.appDetail } = rr, apiUrls: { apiDynamicFormsGet: i = ar.apiDynamicFormsGet } = ar }) => {
3807
- const c = et(), { startLoading: l, stopLoading: u } = Q(Tt), [d, m] = E(null), x = te(() => [
3808
- ...(d == null ? void 0 : d.map((p) => ({
3809
- ...p,
3810
- type: "dynamic-form"
3811
- }))) ?? [],
3812
- ...t
3813
- ].filter((p) => en(p.name, a) || en(p.description, a)).sort((p, g) => (p.name ?? "").localeCompare(g.name ?? "")) ?? [], [d, t, a]), v = te(() => n.map((p) => ({
3814
- id: p.id,
3815
- name: p.name ?? "",
3816
- items: x.filter((g) => g.group === p.id)
3817
- })).filter((p) => p.items.length > 0), [n, x]), h = S(async () => {
3818
- l("dynamicForms"), await c.get(i).then(({ data: p }) => {
3819
- m(p), u("dynamicForms");
3820
- }).catch(() => u("dynamicForms"));
3821
- }, [c, l, u, i]);
3822
- return A(() => {
3823
- !d && h();
3824
- }, [h, d]), x.length > 0 ? /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx("div", { className: "w-auto list-group forms-items overflow-x-hidden", children: v.map((p) => /* @__PURE__ */ r.jsx(Ti, { title: p.name, defaultOpen: !0, children: p.items.map((g) => {
3825
- var j, y, f, b;
3826
- return s ? /* @__PURE__ */ r.jsxs(Ze, { to: `${kt(o, { id: (j = g.id) == null ? void 0 : j.toString() })}?type=${g.type}`, className: `text-nowrap list-group-item list-group-item-action ${(e == null ? void 0 : e.toString()) === ((y = g.id) == null ? void 0 : y.toString()) ? "active" : ""}`, children: [
3827
- /* @__PURE__ */ r.jsx(Z, { variant: "body", children: g.name }),
3828
- g.description && /* @__PURE__ */ r.jsx(Z, { variant: "body2", className: "text-muted mt-2", children: g.description })
3829
- ] }, g.id) : /* @__PURE__ */ r.jsx(Rc, { item: g, children: /* @__PURE__ */ r.jsx(Ze, { to: `${kt(o, { id: (f = g.id) == null ? void 0 : f.toString() })}?type=${g.type}`, className: `text-nowrap list-group-item list-group-item-action ${(e == null ? void 0 : e.toString()) === ((b = g.id) == null ? void 0 : b.toString()) ? "active" : ""}`, children: /* @__PURE__ */ r.jsx(Z, { variant: "body2", children: g.name }) }) }, g.id);
3830
- }) }, p.id)) }) }) : null;
3831
- }, Od = ({ label: e, to: t, value: n }) => /* @__PURE__ */ r.jsxs(Pe, { label: e, children: [
3832
- /* @__PURE__ */ r.jsx("input", { disabled: !0, className: "form-control d-none" }),
3833
- t ? /* @__PURE__ */ r.jsx(Ze, { to: t, className: "border-bottom luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center", children: n }) : /* @__PURE__ */ r.jsx("div", { className: "luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center", children: n })
3834
- ] }), Ed = () => {
3835
- const { localizationContext: e } = Q(ge), { language: t, setLanguage: n } = Q(e), a = (s) => {
3836
- n(s);
3837
- };
3838
- return /* @__PURE__ */ r.jsx(Qe, { onClick: (s) => {
3839
- a(t === "cz" ? "en" : "cz"), s.stopPropagation();
3840
- }, children: t === "cz" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3841
- /* @__PURE__ */ r.jsx("strong", { children: "CZ" }),
3842
- /* @__PURE__ */ r.jsx(Sn, {}),
3843
- /* @__PURE__ */ r.jsx("span", { children: "EN" })
3844
- ] }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3845
- /* @__PURE__ */ r.jsx("strong", { children: "EN" }),
3846
- /* @__PURE__ */ r.jsx(Sn, {}),
3847
- /* @__PURE__ */ r.jsx("span", { children: "CZ" })
3848
- ] }) });
3849
- }, Td = ({ controlId: e, ...t }) => /* @__PURE__ */ r.jsx(ye.Group, { controlId: e, ...t }), Ld = ({ employeeId: e, alt: t, noPhotoImage: n, cafmApiUrl: a, showLargeInLightBox: s = !1 }) => {
3850
- const { user: o } = Q(Et), { photoPath: i, photoPathSm: c } = Ls(e);
3851
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: e && /* @__PURE__ */ r.jsx(r.Fragment, { children: s ? /* @__PURE__ */ r.jsx(Ul, { baseUrl: a, customToken: o.cafmToken ?? void 0, photos: [
3852
- {
3853
- id: e.toString(),
3854
- alt: t ?? "",
3855
- isDefault: !0,
3856
- smSrc: c,
3857
- lgSrc: i
3858
- }
3859
- ], placeholder: n, ImgComponent: Zn }) : /* @__PURE__ */ r.jsx(Zn, { baseUrl: a, customToken: o.cafmToken ?? void 0, src: c, alt: t, placeholder: n, className: "rounded w-100" }) }) });
3860
- }, Rd = ({ text: e, setText: t, onSearchButtonClick: n, className: a }) => {
3861
- const s = (o) => {
3862
- t(o);
3863
- };
3864
- return /* @__PURE__ */ r.jsxs(Nt, { className: `${a}`, children: [
3865
- /* @__PURE__ */ r.jsx(ye.Control, { value: e, onChange: (o) => t(o.target.value) }),
3866
- e && /* @__PURE__ */ r.jsx(Jt, { onClick: () => s(""), variant: "link", className: "border text-muted", children: /* @__PURE__ */ r.jsx(Oe, {}) }),
3867
- /* @__PURE__ */ r.jsx(Jt, { onClick: () => n && n(e), variant: "link", className: "border", children: /* @__PURE__ */ r.jsx(ys, {}) })
3868
- ] });
3869
- }, Ad = ({ value: e, numberPrefix: t, numberSuffix: n, decimalScale: a = 2, className: s }) => /* @__PURE__ */ r.jsx(yn, { value: e, displayType: "text", thousandSeparator: " ", decimalScale: a, defaultValue: "", prefix: t, suffix: n, className: s });
3870
- export {
3871
- xa as Alert,
3872
- Jl as AlertItem,
3873
- Zc as ApiFileDownloadButton,
3874
- wd as AppSearch,
3875
- _d as AuthTemplate,
3876
- jr as AvatarIcon,
3877
- ga as Backdrop,
3878
- bd as Badge,
3879
- wl as Card,
3880
- aa as CheckInput,
3881
- Ti as Collapse,
3882
- ot as ContextButton,
3883
- Od as DisabledRowLabelLink,
3884
- Bd as Documents,
3885
- dn as Dropdown,
3886
- md as DropdownDivider,
3887
- Qe as DropdownItem,
3888
- ed as DropdownPicker,
3889
- un as DropdownToggle,
3890
- $d as DynamicForm,
3891
- Ld as EmployeeSmallPhoto,
3892
- _i as ErrorBoundary,
3893
- Pd as FileExtensionIcon,
3894
- Xc as FileUploadButton,
3895
- na as FileUploadContextButton,
3896
- fd as FileUploadDropdownItem,
3897
- qo as Flexmonster,
3898
- tc as FloatingActionContainer,
3899
- ho as FloatingFormSubmit,
3900
- Je as FloatingLabelInput,
3901
- Sd as FromToDatePicker,
3902
- yd as HomeDashboard,
3903
- ad as HookFormCheckInput,
3904
- od as HookFormDropdownPicker,
3905
- id as HookFormFileInput,
3906
- ld as HookFormFloatingSubmit,
3907
- dd as HookFormNumericStepperInput,
3908
- ud as HookFormNumericTextInput,
3909
- sd as HookFormRadioInput,
3910
- cd as HookFormSelectInput,
3911
- Hd as HookFormTextAreaInput,
3912
- Wd as HookFormTextInput,
3913
- Jc as HtmlTooltip,
3914
- ne as IconButton,
3915
- Zn as ImgApi,
3916
- pa as ImgDirect,
3917
- Xe as InvalidFeedback,
3918
- Ed as LanguageSwitch,
3919
- kn as Loading,
3920
- Ms as LoadingBlock,
3921
- pd as MessageBoard,
3922
- po as MonthPicker,
3923
- kd as MonthPickerSearchParams,
3924
- Fe as NoInputContainer,
3925
- Ad as NumericFormat,
3926
- nd as NumericStepperInput,
3927
- rd as NumericTextInput,
3928
- Ul as PhotoLibrary,
3929
- zl as PhotoLightbox,
3930
- Dd as PieChart,
3931
- Xt as PrimaryButton,
3932
- hd as ReportPage,
3933
- zd as ResponsiveContextDropdown,
3934
- Ud as ResponsiveContextDropdownItem,
3935
- Pe as RowLabelInput,
3936
- Rd as SearchBox,
3937
- Dt as SelectInput,
3938
- Fd as SettingsFormPicker,
3939
- wn as SimplePicker,
3940
- vr as SimpleToggle,
3941
- mn as SimpleTooltip,
3942
- jd as Tab,
3943
- xd as TabPanel,
3944
- vd as Tabs,
3945
- td as TextAreaInput,
3946
- at as TextInput,
3947
- Cd as Timeline,
3948
- Td as TypedFormGroup,
3949
- Z as Typography,
3950
- Gd as UserAvatarToggle,
3951
- gd as UserAvatarValueFormat,
3952
- Nd as VersionInfo,
3953
- Yn as WidgetCard,
3954
- jo as YearPicker,
3955
- Id as YearPickerSearchParams
3956
- };