ezux 1.1.13 → 1.1.18
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.
- package/README.md +58 -15
- package/dist/DeleteConfirmationModal-CukNDgtX.cjs +1 -0
- package/dist/DeleteConfirmationModal-p8XGDGIw.js +38 -0
- package/dist/EzContextMenu-BCUoEQp5.cjs +1 -0
- package/dist/EzContextMenu-srLxujt8.js +287 -0
- package/dist/EzErrorBoundary-C7a6VisX.js +74 -0
- package/dist/EzErrorBoundary-d_2g-_EK.cjs +1 -0
- package/dist/EzEventModal-C079wLjP.js +725 -0
- package/dist/EzEventModal-CAA9cAM0.cjs +1 -0
- package/dist/EzFlow-C74NbZA9.js +2545 -0
- package/dist/EzFlow-CQFeY7DL.cjs +5 -0
- package/dist/EzGroupingPanel-BVaAJaVU.js +107 -0
- package/dist/EzGroupingPanel-BwWDWEuW.cjs +1 -0
- package/dist/EzKanban-BlJWybKe.js +1575 -0
- package/dist/EzKanban-DdKODRRv.cjs +2 -0
- package/dist/EzLayout-BGnqFtvO.cjs +1 -0
- package/dist/EzLayout-CiaPLniV.js +7005 -0
- package/dist/EzProvider-AlmsYIDk.js +982 -0
- package/dist/EzProvider-L2qQMq-v.cjs +1 -0
- package/dist/EzScheduler-C1Jtvvju.js +2700 -0
- package/dist/EzScheduler-CkqTngI6.cjs +1 -0
- package/dist/EzSchedulerQuickAdd-BIC8xbSn.js +124 -0
- package/dist/EzSchedulerQuickAdd-BeNfGdWs.cjs +1 -0
- package/dist/EzSchedulerToolbar-BJwTpgas.cjs +1 -0
- package/dist/EzSchedulerToolbar-Ba4gbvUg.js +305 -0
- package/dist/EzSignature-7UHO5lSP.js +386 -0
- package/dist/EzSignature-Df7UZ-IS.cjs +1 -0
- package/dist/EzTable-CEXvJR1t.cjs +3 -0
- package/dist/EzTable-D2p1IWHc.js +4290 -0
- package/dist/EzTableEditDialog-BXnnYSSy.cjs +1 -0
- package/dist/EzTableEditDialog-Ccd5XoHm.js +84 -0
- package/dist/EzTableFooter-CtexeDAC.cjs +1 -0
- package/dist/EzTableFooter-DrLoWelo.js +35 -0
- package/dist/EzTableToolbar-BH5z9fSJ.js +160 -0
- package/dist/EzTableToolbar-DwuumvWP.cjs +1 -0
- package/dist/EzTreeView-D1G0Aomc.js +818 -0
- package/dist/EzTreeView-KMGlU4ax.cjs +1 -0
- package/dist/HighlightText-BViuwe03.cjs +1 -0
- package/dist/HighlightText-DNA2R2uf.js +56 -0
- package/dist/KanbanBoard-B7_Z5sh1.js +1697 -0
- package/dist/KanbanBoard-CyitudI1.cjs +1 -0
- package/dist/Modal-BmX1C448.cjs +1 -0
- package/dist/Modal-CrzpKyjK.js +74 -0
- package/dist/NotificationPanel-BzpDc10Q.js +54 -0
- package/dist/NotificationPanel-CFME00wq.cjs +1 -0
- package/dist/TooltipWrapper-BSAmUx9H.js +44 -0
- package/dist/TooltipWrapper-DfbFAZ1U.cjs +1 -0
- package/dist/advanced.cjs +10 -0
- package/dist/advanced.d.ts +44 -0
- package/dist/advanced.es.js +400 -0
- package/dist/avatar-BSdRHETK.cjs +1 -0
- package/dist/avatar-BvCUJ-_r.js +27 -0
- package/dist/button-BBMwzUtG.cjs +1 -0
- package/dist/button-CYyNwV8S.js +44 -0
- package/dist/calendar-DEHX32Cp.cjs +1 -0
- package/dist/calendar-DOIPGsyI.js +112 -0
- package/dist/card-CPlRZxbq.cjs +1 -0
- package/dist/card-ZUNxcdIM.js +60 -0
- package/dist/checkbox-BrCh_Iid.cjs +1 -0
- package/dist/checkbox-DRkQuB4W.js +21 -0
- package/dist/components/EzFlow/EzConnectionLine.d.ts +5 -0
- package/dist/components/EzFlow/EzFlow.examples.d.ts +5 -0
- package/dist/components/EzFlow/EzFlow.types.d.ts +260 -0
- package/dist/components/EzFlow/EzFlowBackground.d.ts +5 -0
- package/dist/components/EzFlow/EzFlowCanvas.d.ts +3 -0
- package/dist/components/EzFlow/EzFlowControls.d.ts +5 -0
- package/dist/components/EzFlow/EzFlowEdge.d.ts +5 -0
- package/dist/components/EzFlow/EzFlowHeader.d.ts +6 -0
- package/dist/components/EzFlow/EzFlowToolbox.d.ts +6 -0
- package/dist/components/EzFlow/EzWorkflow.d.ts +5 -0
- package/dist/components/EzFlow/EzWorkflowPerformance.d.ts +3 -0
- package/dist/components/EzFlow/EzWorkflowServiceAdapters.d.ts +24 -0
- package/dist/components/EzFlow/EzWorkflowValidation.d.ts +95 -0
- package/dist/components/EzFlow/index.d.ts +13 -0
- package/dist/components/EzFlow/nodes/ActionNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/ApprovalNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/DecisionNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/DelayNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/EndNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/GroupNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/LoopNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/RequestNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/StartNode.d.ts +3 -0
- package/dist/components/EzFlow/nodes/index.d.ts +9 -0
- package/dist/components/EzKanban/EzKanban.types.d.ts +808 -0
- package/dist/components/EzKanban/components/CardEditorModal.d.ts +23 -0
- package/dist/components/EzKanban/components/EzKanbanErrorFallback.d.ts +1 -0
- package/dist/components/EzKanban/components/FilterPopover.d.ts +10 -0
- package/dist/components/EzKanban/components/KanbanBoard.d.ts +59 -0
- package/dist/components/EzKanban/components/KanbanCard.d.ts +46 -0
- package/dist/components/EzKanban/components/KanbanColumn.d.ts +55 -0
- package/dist/components/EzKanban/components/KanbanSwimlane.d.ts +45 -0
- package/dist/components/EzKanban/components/KanbanToolbar.d.ts +41 -0
- package/dist/components/EzKanban/exports.d.ts +4 -0
- package/dist/components/EzKanban/hooks/useKanbanCards.d.ts +36 -0
- package/dist/components/EzKanban/hooks/useKanbanColumns.d.ts +27 -0
- package/dist/components/EzKanban/hooks/useKanbanDragDrop.d.ts +31 -0
- package/dist/components/EzKanban/hooks/useKanbanFilters.d.ts +23 -0
- package/dist/components/EzKanban/hooks/useKanbanState.d.ts +79 -0
- package/dist/components/EzKanban/hooks/useKanbanSwimlanes.d.ts +27 -0
- package/dist/components/EzKanban/hooks/useKanbanVirtualization.d.ts +16 -0
- package/dist/components/EzKanban/index.d.ts +51 -0
- package/dist/components/EzKanban/services/KanbanService.d.ts +31 -0
- package/dist/components/EzKanban/state/kanban.store.d.ts +33 -0
- package/dist/components/EzKanban/useEzKanban.d.ts +87 -0
- package/dist/components/EzKanban/views/KanbanTimelineView.d.ts +15 -0
- package/dist/components/EzLayout/Authentication/AuthSlider.d.ts +13 -0
- package/dist/components/EzLayout/Authentication/InputPassword.d.ts +7 -0
- package/dist/components/EzLayout/Authentication/SignInForm.d.ts +21 -0
- package/dist/components/EzLayout/Authentication/SignUpForm.d.ts +20 -0
- package/dist/components/EzLayout/EzHeader.d.ts +48 -0
- package/dist/components/EzLayout/EzLanguageSwitcher.d.ts +4 -0
- package/dist/components/EzLayout/EzLayout.types.d.ts +261 -0
- package/dist/components/EzLayout/EzOrganizationSwitcher.d.ts +14 -0
- package/dist/components/EzLayout/EzSidebar.d.ts +24 -0
- package/dist/components/EzLayout/EzThemeColorChanger.d.ts +9 -0
- package/dist/components/EzLayout/EzThemeSwitcher.d.ts +8 -0
- package/dist/components/EzLayout/EzUserProfile.d.ts +27 -0
- package/dist/components/EzLayout/components/EzSidebarFooter.d.ts +8 -0
- package/dist/components/EzLayout/components/EzSidebarNav.d.ts +10 -0
- package/dist/components/EzLayout/components/EzSidebarNavItem.d.ts +11 -0
- package/dist/components/EzLayout/components/MainContent.d.ts +13 -0
- package/dist/components/EzLayout/hooks/useLayoutImperative.d.ts +17 -0
- package/dist/components/EzLayout/hooks/useLayoutState.d.ts +25 -0
- package/dist/components/EzLayout/index.d.ts +23 -0
- package/dist/components/EzLayout/useEzLayout.d.ts +34 -0
- package/dist/components/EzScheduler/EzScheduler.types.d.ts +1252 -0
- package/dist/components/EzScheduler/EzSchedulerToolbar.d.ts +117 -0
- package/dist/components/EzScheduler/components/EzEventModal.d.ts +23 -0
- package/dist/components/EzScheduler/components/EzOverlapAlert.d.ts +12 -0
- package/dist/components/EzScheduler/components/EzQuickInfoPopup.d.ts +22 -0
- package/dist/components/EzScheduler/components/EzResourceSidebar.d.ts +33 -0
- package/dist/components/EzScheduler/components/EzSchedulerContent.d.ts +111 -0
- package/dist/components/EzScheduler/components/EzSchedulerQuickAdd.d.ts +17 -0
- package/dist/components/EzScheduler/components/RecurrenceEditor.d.ts +7 -0
- package/dist/components/EzScheduler/components/SchedulerLoadingSpinner.d.ts +2 -0
- package/dist/components/EzScheduler/components/dnd/DraggableEvent.d.ts +24 -0
- package/dist/components/EzScheduler/components/dnd/DroppableSlot.d.ts +19 -0
- package/dist/components/EzScheduler/hooks/useRecurrence.d.ts +2 -0
- package/dist/components/EzScheduler/hooks/useSchedulerEventHandlers.d.ts +15 -0
- package/dist/components/EzScheduler/hooks/useSchedulerEvents.d.ts +27 -0
- package/dist/components/EzScheduler/hooks/useSchedulerImperative.d.ts +19 -0
- package/dist/components/EzScheduler/hooks/useSchedulerNavigation.d.ts +9 -0
- package/dist/components/EzScheduler/hooks/useSchedulerResources.d.ts +10 -0
- package/dist/components/EzScheduler/hooks/useSchedulerState.d.ts +14 -0
- package/dist/components/EzScheduler/hooks/useSchedulerVirtualization.d.ts +9 -0
- package/dist/components/EzScheduler/index.d.ts +43 -0
- package/dist/components/EzScheduler/models/EventSettings.d.ts +11 -0
- package/dist/components/EzScheduler/models/View.d.ts +49 -0
- package/dist/components/EzScheduler/models/index.d.ts +2 -0
- package/dist/components/EzScheduler/services/AttendeeService.d.ts +15 -0
- package/dist/components/EzScheduler/services/AuditService.d.ts +15 -0
- package/dist/components/EzScheduler/services/CollisionDetectionService.d.ts +19 -0
- package/dist/components/EzScheduler/services/DragAndDropService.d.ts +16 -0
- package/dist/components/EzScheduler/services/HistoryService.d.ts +31 -0
- package/dist/components/EzScheduler/services/ICalendarImportService.d.ts +16 -0
- package/dist/components/EzScheduler/services/PrintService.d.ts +7 -0
- package/dist/components/EzScheduler/services/RecurrenceEngine.d.ts +7 -0
- package/dist/components/EzScheduler/services/ReminderService.d.ts +17 -0
- package/dist/components/EzScheduler/services/SchedulerService.d.ts +71 -0
- package/dist/components/EzScheduler/services/SearchService.d.ts +11 -0
- package/dist/components/EzScheduler/services/SecurityService.d.ts +25 -0
- package/dist/components/EzScheduler/services/TimezoneService.d.ts +20 -0
- package/dist/components/EzScheduler/services/VirtualScrollingService.d.ts +34 -0
- package/dist/components/EzScheduler/state/scheduler.store.d.ts +27 -0
- package/dist/components/EzScheduler/templates/CellTemplate.d.ts +42 -0
- package/dist/components/EzScheduler/templates/EditorTemplate.d.ts +32 -0
- package/dist/components/EzScheduler/templates/HeaderTemplate.d.ts +36 -0
- package/dist/components/EzScheduler/useEzScheduler.d.ts +104 -0
- package/dist/components/EzScheduler/utils/createDragConstraint.d.ts +7 -0
- package/dist/components/EzScheduler/utils/getWeekNumber.d.ts +8 -0
- package/dist/components/EzScheduler/utils/sanitizeHtml.d.ts +18 -0
- package/dist/components/EzScheduler/views/AgendaView.d.ts +28 -0
- package/dist/components/EzScheduler/views/DayWeekView.d.ts +177 -0
- package/dist/components/EzScheduler/views/MonthView.d.ts +60 -0
- package/dist/components/EzScheduler/views/TimelineView.d.ts +116 -0
- package/dist/components/EzSignature/EzSignature.d.ts +42 -0
- package/dist/components/EzSignature/EzSignature.types.d.ts +132 -0
- package/dist/components/EzSignature/index.d.ts +2 -0
- package/dist/components/EzTable/EzColumnMenu.d.ts +7 -0
- package/dist/components/EzTable/EzDateFilterTree.d.ts +7 -0
- package/dist/components/EzTable/EzExcelFilter.d.ts +8 -0
- package/dist/components/EzTable/EzFilterBuilder.d.ts +12 -0
- package/dist/components/EzTable/EzGroupingPanel.d.ts +9 -0
- package/dist/components/EzTable/EzHeaderContextMenu.d.ts +8 -0
- package/dist/components/EzTable/EzPagination.d.ts +19 -0
- package/dist/components/EzTable/EzTable.types.d.ts +1 -0
- package/dist/components/EzTable/EzTableEditDialog.d.ts +15 -0
- package/dist/components/EzTable/EzTableFooter.d.ts +10 -0
- package/dist/components/EzTable/EzTableOverlays.d.ts +11 -0
- package/dist/components/EzTable/EzTableStatusBar.d.ts +10 -0
- package/dist/components/EzTable/EzTableToolbar.d.ts +60 -0
- package/dist/components/EzTable/SmartCell.d.ts +7 -0
- package/dist/components/EzTable/components/AdvancedColumnFilter.d.ts +16 -0
- package/dist/components/EzTable/components/BooleanFilterSection.d.ts +7 -0
- package/dist/components/EzTable/components/EzDraggableHeader.d.ts +10 -0
- package/dist/components/EzTable/components/EzHeaderDragPreview.d.ts +7 -0
- package/dist/components/EzTable/components/EzTableBodySection.d.ts +72 -0
- package/dist/components/EzTable/components/EzTableCell.d.ts +46 -0
- package/dist/components/EzTable/components/EzTableHeaderSection.d.ts +23 -0
- package/dist/components/EzTable/components/EzTablePaginationSection.d.ts +31 -0
- package/dist/components/EzTable/components/EzTableRow.d.ts +58 -0
- package/dist/components/EzTable/components/FilterActionButtons.d.ts +16 -0
- package/dist/components/EzTable/components/FilterRuleSelect.d.ts +26 -0
- package/dist/components/EzTable/components/SelectAllCheckbox.d.ts +21 -0
- package/dist/components/EzTable/components/SelectFilterSection.d.ts +18 -0
- package/dist/components/EzTable/components/VirtualizedFilterList.d.ts +21 -0
- package/dist/components/EzTable/constants/filterOptions.d.ts +47 -0
- package/dist/components/EzTable/context/EzTableContext.d.ts +10 -0
- package/dist/components/EzTable/context/TableConfigContext.d.ts +13 -0
- package/dist/components/EzTable/context/TableStore.d.ts +17 -0
- package/dist/components/EzTable/filterUtils.d.ts +5 -0
- package/dist/components/EzTable/hooks/useAutoFit.d.ts +4 -0
- package/dist/components/EzTable/hooks/useCellEventHandlers.d.ts +16 -0
- package/dist/components/EzTable/hooks/useColumnSizeVars.d.ts +6 -0
- package/dist/components/EzTable/hooks/useContainerResize.d.ts +11 -0
- package/dist/components/EzTable/hooks/useDialogStateInitialization.d.ts +8 -0
- package/dist/components/EzTable/hooks/useFilterSelection.d.ts +12 -0
- package/dist/components/EzTable/hooks/useTableFiltering.d.ts +23 -0
- package/dist/components/EzTable/hooks/useTableHistory.d.ts +87 -0
- package/dist/components/EzTable/hooks/useTableImperative.d.ts +42 -0
- package/dist/components/EzTable/hooks/useTableSelection.d.ts +32 -0
- package/dist/components/EzTable/hooks/useTableState.d.ts +33 -0
- package/dist/components/EzTable/hooks/useTableVirtualization.d.ts +35 -0
- package/dist/components/EzTable/index.d.ts +54 -0
- package/dist/components/EzTable/renderers/index.d.ts +6 -0
- package/dist/components/EzTable/services/TableService.d.ts +29 -0
- package/dist/components/EzTable/types/EzTableColumn.types.d.ts +146 -0
- package/dist/components/EzTable/types/EzTableEdit.types.d.ts +58 -0
- package/dist/components/EzTable/types/EzTableFilter.types.d.ts +50 -0
- package/dist/components/EzTable/types/EzTableProps.d.ts +750 -0
- package/dist/components/EzTable/types/index.d.ts +4 -0
- package/dist/components/EzTable/useEzTable.d.ts +17 -0
- package/dist/components/EzTable/utils/SizingUtils.d.ts +11 -0
- package/dist/components/EzTable/utils/TextMeasurer.d.ts +1 -0
- package/dist/components/EzTable/utils/TruncatedTooltip.d.ts +7 -0
- package/dist/components/EzTable/utils/columnTypeDetector.d.ts +5 -0
- package/dist/components/EzTable/utils/filterTypeGuards.d.ts +3 -0
- package/dist/components/EzTable/utils/index.d.ts +1 -0
- package/dist/components/EzTreeView/EzTreeView.types.d.ts +364 -0
- package/dist/components/EzTreeView/EzTreeViewItem.d.ts +89 -0
- package/dist/components/EzTreeView/EzVirtualTree.d.ts +84 -0
- package/dist/components/EzTreeView/components/EzTreeViewLoadingSpinner.d.ts +2 -0
- package/dist/components/EzTreeView/hooks/useTreeDragDrop.d.ts +31 -0
- package/dist/components/EzTreeView/hooks/useTreeExpansion.d.ts +21 -0
- package/dist/components/EzTreeView/hooks/useTreeImperative.d.ts +28 -0
- package/dist/components/EzTreeView/hooks/useTreeSelection.d.ts +31 -0
- package/dist/components/EzTreeView/hooks/useTreeState.d.ts +21 -0
- package/dist/components/EzTreeView/hooks/useTreeVirtualization.d.ts +18 -0
- package/dist/components/EzTreeView/index.d.ts +40 -0
- package/dist/components/EzTreeView/services/TreeService.d.ts +11 -0
- package/dist/components/EzTreeView/useEzTreeView.d.ts +50 -0
- package/dist/components/EzTreeView/utils/treeUtils.d.ts +17 -0
- package/dist/components/shared/components/EzErrorBoundary.d.ts +18 -0
- package/dist/components/shared/components/EzLayoutErrorFallback.d.ts +2 -0
- package/dist/components/shared/components/EzLoadingSpinner.d.ts +8 -0
- package/dist/components/shared/components/EzSchedulerErrorFallback.d.ts +2 -0
- package/dist/components/shared/components/EzSortableList.d.ts +12 -0
- package/dist/components/shared/components/EzTableErrorFallback.d.ts +2 -0
- package/dist/components/shared/components/EzTreeViewErrorFallback.d.ts +2 -0
- package/dist/components/ui/avatar.d.ts +10 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/calendar.d.ts +15 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/checkbox.d.ts +7 -0
- package/dist/components/ui/combobox.d.ts +19 -0
- package/dist/components/ui/command.d.ts +78 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/date-time-picker.d.ts +14 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/index.d.ts +27 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/label.d.ts +9 -0
- package/dist/components/ui/modal.d.ts +9 -0
- package/dist/components/ui/password-input.d.ts +5 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/progress.d.ts +7 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +26 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +22 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/date-time-picker-Bs-7XzHD.cjs +1 -0
- package/dist/date-time-picker-fUzf4TnU.js +127 -0
- package/dist/dropdown-menu-BRP0tyR_.cjs +1 -0
- package/dist/dropdown-menu-B_7_K13o.js +78 -0
- package/dist/ezux.css +2 -1
- package/dist/flow.cjs +1 -0
- package/dist/flow.d.ts +2 -0
- package/dist/flow.es.js +2 -0
- package/dist/index.cjs +3 -12
- package/dist/index.d.ts +66 -6404
- package/dist/index.es.js +229 -1041
- package/dist/input-CYlvlbF7.cjs +1 -0
- package/dist/input-Cj3sQK3M.js +14 -0
- package/dist/kanban.cjs +1 -1
- package/dist/kanban.d.ts +2 -1343
- package/dist/kanban.es.js +4 -17
- package/dist/label-BGgvoZWD.cjs +1 -0
- package/dist/label-DWEV--5W.js +16 -0
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +2 -690
- package/dist/layout.es.js +2 -20
- package/dist/lib/perfect-freehand.d.ts +221 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/mock-services.cjs +1 -0
- package/dist/mock-services.d.ts +8 -0
- package/dist/mock-services.es.js +161 -0
- package/dist/popover-D1akYj0W.js +17 -0
- package/dist/popover-wZKNvYM5.cjs +1 -0
- package/dist/scheduler.cjs +1 -1
- package/dist/scheduler.d.ts +2 -1430
- package/dist/scheduler.es.js +2 -11
- package/dist/scroll-area-BJs87d45.js +35 -0
- package/dist/scroll-area-DSkE2KB_.cjs +1 -0
- package/dist/select-D4tFaSai.js +43 -0
- package/dist/select-sVieKbLu.cjs +1 -0
- package/dist/shared/components/AnimatedText.d.ts +44 -0
- package/dist/shared/components/BaseCell.d.ts +14 -0
- package/dist/shared/components/BooleanRenderer.d.ts +34 -0
- package/dist/shared/components/ChartRenderer.d.ts +19 -0
- package/dist/shared/components/DeleteConfirmationModal.d.ts +11 -0
- package/dist/shared/components/EzContextMenu.d.ts +12 -0
- package/dist/shared/components/EzNotificationDropdown.d.ts +2 -0
- package/dist/shared/components/HighlightText.d.ts +4 -0
- package/dist/shared/components/Modal.d.ts +13 -0
- package/dist/shared/components/NotificationPanel.d.ts +2 -0
- package/dist/shared/components/PrimitiveRenderer.d.ts +39 -0
- package/dist/shared/components/SearchableSelect.d.ts +13 -0
- package/dist/shared/components/SelectRenderer.d.ts +33 -0
- package/dist/shared/components/StatusBadge.d.ts +21 -0
- package/dist/shared/components/TooltipWrapper.d.ts +12 -0
- package/dist/shared/components/index.d.ts +9 -0
- package/dist/shared/contexts/EzProvider.d.ts +56 -0
- package/dist/shared/hooks/index.d.ts +56 -0
- package/dist/shared/hooks/useBaseComponent.d.ts +59 -0
- package/dist/shared/hooks/useComponentImperativeAPI.d.ts +11 -0
- package/dist/shared/hooks/useComponentState.d.ts +39 -0
- package/dist/shared/hooks/useCurrentTime.d.ts +6 -0
- package/dist/shared/hooks/useDataChangeEvents.d.ts +53 -0
- package/dist/shared/hooks/useDebounce.d.ts +10 -0
- package/dist/shared/hooks/useDeleteConfirmation.d.ts +9 -0
- package/dist/shared/hooks/useDialogState.d.ts +21 -0
- package/dist/shared/hooks/useDndHandlers.d.ts +19 -0
- package/dist/shared/hooks/useEditing.d.ts +107 -0
- package/dist/shared/hooks/useEventHandlers.d.ts +61 -0
- package/dist/shared/hooks/useEzTheme.d.ts +22 -0
- package/dist/shared/hooks/useFieldValidation.d.ts +24 -0
- package/dist/shared/hooks/useHistory.d.ts +13 -0
- package/dist/shared/hooks/useI18n.d.ts +8 -0
- package/dist/shared/hooks/useImperativeAPI.d.ts +8 -0
- package/dist/shared/hooks/useInitCoreServices.d.ts +5 -0
- package/dist/shared/hooks/useKeyboardNavigation.d.ts +36 -0
- package/dist/shared/hooks/useKeyboardShortcuts.d.ts +14 -0
- package/dist/shared/hooks/useLifecycleEvents.d.ts +22 -0
- package/dist/shared/hooks/useLoadingState.d.ts +17 -0
- package/dist/shared/hooks/useMediaQuery.d.ts +6 -0
- package/dist/shared/hooks/useNotificationService.d.ts +8 -0
- package/dist/shared/hooks/usePerformanceMonitor.d.ts +22 -0
- package/dist/shared/hooks/useRowSelectionEvents.d.ts +44 -0
- package/dist/shared/hooks/useSelection.d.ts +73 -0
- package/dist/shared/hooks/useService.d.ts +12 -0
- package/dist/shared/hooks/useServiceState.d.ts +1 -0
- package/dist/shared/hooks/useStateChangeEvents.d.ts +61 -0
- package/dist/shared/hooks/useTheme.d.ts +13 -0
- package/dist/shared/hooks/useVirtualization.d.ts +85 -0
- package/dist/shared/services/BaseService.d.ts +57 -0
- package/dist/shared/services/ContextMenuService.d.ts +58 -0
- package/dist/shared/services/ExportService.d.ts +35 -0
- package/dist/shared/services/FocusManagerService.d.ts +33 -0
- package/dist/shared/services/HierarchyService.d.ts +43 -0
- package/dist/shared/services/I18nService.d.ts +84 -0
- package/dist/shared/services/LayoutService.d.ts +80 -0
- package/dist/shared/services/NotificationService.d.ts +44 -0
- package/dist/shared/services/PersistenceService.d.ts +69 -0
- package/dist/shared/services/ServiceRegistry.d.ts +52 -0
- package/dist/shared/services/ThemeService.d.ts +49 -0
- package/dist/shared/services/VirtualizationService.d.ts +51 -0
- package/dist/shared/state/store.d.ts +10 -0
- package/dist/shared/themes.d.ts +25 -0
- package/dist/shared/types/BaseProps.d.ts +17 -0
- package/dist/shared/types/common.d.ts +373 -0
- package/dist/shared/types/index.d.ts +2 -0
- package/dist/shared/utils/canvasUtils.d.ts +16 -0
- package/dist/shared/utils/commonUtils.d.ts +28 -0
- package/dist/shared/utils/csvUtils.d.ts +7 -0
- package/dist/shared/utils/dateUtils.d.ts +5 -0
- package/dist/shared/utils/dndUtils.d.ts +16 -0
- package/dist/shared/utils/formatUtils.d.ts +20 -0
- package/dist/shared/utils/imperativeApiUtils.d.ts +36 -0
- package/dist/shared/utils/index.d.ts +11 -0
- package/dist/shared/utils/renderUtils.d.ts +6 -0
- package/dist/shared/utils/serviceUtils.d.ts +10 -0
- package/dist/shared/utils/styleUtils.d.ts +121 -0
- package/dist/shared/utils/validationUtils.d.ts +16 -0
- package/dist/signature.cjs +1 -1
- package/dist/signature.d.ts +2 -410
- package/dist/signature.es.js +2 -4
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +2 -1059
- package/dist/table.es.js +2 -17
- package/dist/theme-vars.css +143 -135
- package/dist/tooltip-B1wC9m05.js +16 -0
- package/dist/tooltip-Qmzrg5u5.cjs +1 -0
- package/dist/treeview.cjs +1 -1
- package/dist/treeview.d.ts +2 -656
- package/dist/treeview.es.js +2 -954
- package/dist/useComponentState-DiSFLYju.js +57 -0
- package/dist/useComponentState-Wcz6pjd6.cjs +1 -0
- package/dist/useImperativeAPI-Dbx2hMTb.js +7 -0
- package/dist/useImperativeAPI-VrgLwXEO.cjs +1 -0
- package/dist/useInitCoreServices-CuBrviDM.js +40 -0
- package/dist/useInitCoreServices-DlALVDNx.cjs +1 -0
- package/dist/useService-CnCBGG3G.js +10 -0
- package/dist/useService-CyF782jv.cjs +1 -0
- package/dist/useServiceState-CkrJZm1D.js +21 -0
- package/dist/useServiceState-PyYQWxHi.cjs +1 -0
- package/package.json +76 -56
- package/dist/EzContextMenu-B6HBUjWv.cjs +0 -5
- package/dist/EzContextMenu-BSA_B6Pr.js +0 -3500
- package/dist/EzErrorBoundary-CEdz_hDo.cjs +0 -41
- package/dist/EzErrorBoundary-D4NBadES.js +0 -3727
- package/dist/EzEventModal-BUMp_BFi.js +0 -689
- package/dist/EzEventModal-xzHfzi0O.cjs +0 -1
- package/dist/EzGroupingPanel-BUsIYDRi.js +0 -143
- package/dist/EzGroupingPanel-D0HdSomF.cjs +0 -1
- package/dist/EzSchedulerQuickAdd-C653LTGh.js +0 -118
- package/dist/EzSchedulerQuickAdd-UnOWCpJd.cjs +0 -1
- package/dist/EzSchedulerToolbar-C-5OdRY6.cjs +0 -1
- package/dist/EzSchedulerToolbar-CO5jjDQg.js +0 -240
- package/dist/EzSignature-BaNesxwC.cjs +0 -1
- package/dist/EzSignature-D4EYwo9W.js +0 -419
- package/dist/EzTableEditDialog-Cd948V1C.js +0 -63
- package/dist/EzTableEditDialog-NiOubaMT.cjs +0 -1
- package/dist/EzTableFooter-CWjfGCjL.cjs +0 -1
- package/dist/EzTableFooter-DveD12RC.js +0 -54
- package/dist/EzTableToolbar-Bz8UWv6j.js +0 -246
- package/dist/EzTableToolbar-DHE7Bb1R.cjs +0 -1
- package/dist/HighlightText-8D6KEyBw.js +0 -68
- package/dist/HighlightText-LtZmzCle.cjs +0 -1
- package/dist/NotificationPanel-D2Y-_ahk.js +0 -68
- package/dist/NotificationPanel-zLxrtTGf.cjs +0 -1
- package/dist/TooltipWrapper-BrRTi5EJ.js +0 -2021
- package/dist/TooltipWrapper-DWts4bAI.cjs +0 -1
- package/dist/avatar-BeK0E4mn.js +0 -41
- package/dist/avatar-DZAaTK2f.cjs +0 -1
- package/dist/bell-DAz8P0BR.js +0 -14
- package/dist/bell-DOX2y38e.cjs +0 -1
- package/dist/calendar-BMZ8ddOf.cjs +0 -1
- package/dist/calendar-Dy3rVMW2.js +0 -90
- package/dist/checkbox-B0lGHUyy.cjs +0 -1
- package/dist/checkbox-boJRxICT.js +0 -46
- package/dist/chevron-down-C3s8jU6B.js +0 -5
- package/dist/chevron-down-DZVL7VHW.cjs +0 -1
- package/dist/chevron-left-BFr8XZyF.js +0 -5
- package/dist/chevron-left-HWhRo6IH.cjs +0 -1
- package/dist/circle-alert-77QqFR-z.cjs +0 -1
- package/dist/circle-alert-B2AMDd8N.js +0 -9
- package/dist/circle-x-Cv7bfIC_.js +0 -9
- package/dist/circle-x-DwVXxhXr.cjs +0 -1
- package/dist/date-time-picker-DTxHdPgQ.cjs +0 -1
- package/dist/date-time-picker-Dj2eftJI.js +0 -1636
- package/dist/download-0ZhO2XaW.cjs +0 -1
- package/dist/download-panVHmk6.js +0 -9
- package/dist/ellipsis-CuqNthAj.js +0 -9
- package/dist/ellipsis-CzlqJf-i.cjs +0 -1
- package/dist/grip-vertical-CSyDKBul.js +0 -12
- package/dist/grip-vertical-DZNBW1Dn.cjs +0 -1
- package/dist/index-B3ipEEhH.cjs +0 -2
- package/dist/index-BPPb7bcs.js +0 -3220
- package/dist/index-BQKw_Vho.js +0 -9604
- package/dist/index-C5STgBSy.js +0 -5203
- package/dist/index-C6NfgycP.js +0 -4644
- package/dist/index-D4f2ZdrG.cjs +0 -2
- package/dist/index-DUY1SqMo.cjs +0 -1
- package/dist/index-c1Zg--dt.cjs +0 -7
- package/dist/input-BgM_la4k.cjs +0 -1
- package/dist/input-jYQ5VKNR.js +0 -21
- package/dist/isBefore-C3Y_wbk3.js +0 -15
- package/dist/isBefore-Cp1ttk6q.cjs +0 -1
- package/dist/label-ClOW9UCt.js +0 -55
- package/dist/label-Dx6oDB-X.cjs +0 -1
- package/dist/layers-BA4i1fYX.js +0 -27
- package/dist/layers-xSPd-hz3.cjs +0 -1
- package/dist/popover-BJq1CKmi.cjs +0 -1
- package/dist/popover-Cmlb7w3R.js +0 -341
- package/dist/scroll-area-9fwpVNxT.js +0 -573
- package/dist/scroll-area-CwwZSSA4.cjs +0 -1
- package/dist/select-GxA46anr.cjs +0 -1
- package/dist/select-mDCun_IR.js +0 -35
- package/dist/settings-CvyjK75A.js +0 -31
- package/dist/settings-DKPknrt8.cjs +0 -1
- package/dist/sortable.esm-CsRPuXyD.cjs +0 -1
- package/dist/sortable.esm-CzMCDPet.js +0 -477
- package/dist/tooltip-B41iztKT.cjs +0 -1
- package/dist/tooltip-BCtrEe0z.js +0 -490
- package/dist/useComponentState-C87xXa5d.js +0 -64
- package/dist/useComponentState-DDgGbBXv.cjs +0 -1
- package/dist/useImperativeAPI-DXmCQvPL.js +0 -7
- package/dist/useImperativeAPI-DbZ3owSV.cjs +0 -1
- package/dist/useInitCoreServices-CwXv2p4S.cjs +0 -1
- package/dist/useInitCoreServices-D1WaWlaI.js +0 -3929
- package/dist/useService-8OoezWr8.cjs +0 -1
- package/dist/useService-BUi3uAqE.js +0 -10
- package/dist/useServiceState-BjpCjUn2.cjs +0 -1
- package/dist/useServiceState-VE-viK8b.js +0 -24
package/dist/index-C6NfgycP.js
DELETED
|
@@ -1,4644 +0,0 @@
|
|
|
1
|
-
import { jsx as c, jsxs as w, Fragment as xt } from "react/jsx-runtime";
|
|
2
|
-
import qe, { useState as Re, useEffect as _e, useCallback as je, useMemo as ze, useRef as Mt, forwardRef as In } from "react";
|
|
3
|
-
import { u as ar, B as or, a as ir, c as V, b as sr } from "./useInitCoreServices-D1WaWlaI.js";
|
|
4
|
-
import { useStore as cr } from "@tanstack/react-store";
|
|
5
|
-
import { Store as lr } from "@tanstack/store";
|
|
6
|
-
import { u as dr, h as ur, a as zt, e as fr, d as mr, c as hr, f as gr, i as pr, T as br, Q as wr, b as yr } from "./TooltipWrapper-BrRTi5EJ.js";
|
|
7
|
-
import { RRule as mn } from "rrule";
|
|
8
|
-
import { c as xr, g as it, K as vr, T as Sr, M as Er, N as kr } from "./EzErrorBoundary-D4NBadES.js";
|
|
9
|
-
import { o as Tr, k as Dr, l as Mr, P as Nr, d as Ft, C as _r, E as Rn, u as Cr, c as Pn, D as Ar, m as Or } from "./EzContextMenu-BSA_B6Pr.js";
|
|
10
|
-
import { u as Ir } from "./useServiceState-VE-viK8b.js";
|
|
11
|
-
import { X as Ln, T as Rr, b as Pr, d as Lr, e as zr, B as jt } from "./tooltip-BCtrEe0z.js";
|
|
12
|
-
import { A as qt, b as Qt, a as Xt } from "./avatar-BeK0E4mn.js";
|
|
13
|
-
import { createPortal as Fr } from "react-dom";
|
|
14
|
-
const Hr = [
|
|
15
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
16
|
-
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
|
|
17
|
-
], Wr = xr("clock", Hr);
|
|
18
|
-
function zn(e) {
|
|
19
|
-
const [t, n] = Re(() => typeof window < "u" ? window.matchMedia(e).matches : !1);
|
|
20
|
-
return _e(() => {
|
|
21
|
-
if (typeof window > "u") return;
|
|
22
|
-
const r = window.matchMedia(e), a = () => n(r.matches);
|
|
23
|
-
return r.addEventListener ? r.addEventListener("change", a) : r.addListener(a), () => {
|
|
24
|
-
r.removeEventListener ? r.removeEventListener("change", a) : r.removeListener(a);
|
|
25
|
-
};
|
|
26
|
-
}, [e]), t;
|
|
27
|
-
}
|
|
28
|
-
function Zt(e = 6e4) {
|
|
29
|
-
const [t, n] = Re(() => /* @__PURE__ */ new Date());
|
|
30
|
-
return _e(() => {
|
|
31
|
-
const r = setInterval(() => {
|
|
32
|
-
n(/* @__PURE__ */ new Date());
|
|
33
|
-
}, e);
|
|
34
|
-
return () => clearInterval(r);
|
|
35
|
-
}, [e]), t;
|
|
36
|
-
}
|
|
37
|
-
const Br = ({
|
|
38
|
-
totalItems: e,
|
|
39
|
-
columns: t = 1,
|
|
40
|
-
onSelect: n,
|
|
41
|
-
onAction: r,
|
|
42
|
-
onCancel: a,
|
|
43
|
-
wrap: i = !0,
|
|
44
|
-
enabled: l = !0
|
|
45
|
-
}) => {
|
|
46
|
-
const [d, m] = Re(-1), p = je((u) => {
|
|
47
|
-
if (!l || e === 0) return;
|
|
48
|
-
let s = d;
|
|
49
|
-
switch (u.key) {
|
|
50
|
-
case "ArrowDown":
|
|
51
|
-
d === -1 ? s = 0 : (s = d + t, s >= e && (s = i ? s % t : d)), u.preventDefault();
|
|
52
|
-
break;
|
|
53
|
-
case "ArrowUp":
|
|
54
|
-
if (d === -1)
|
|
55
|
-
s = e - 1;
|
|
56
|
-
else if (s = d - t, s < 0)
|
|
57
|
-
if (i) {
|
|
58
|
-
const N = d % t;
|
|
59
|
-
s = (Math.ceil(e / t) - 1) * t + N, s >= e && (s -= t);
|
|
60
|
-
} else
|
|
61
|
-
s = d;
|
|
62
|
-
u.preventDefault();
|
|
63
|
-
break;
|
|
64
|
-
case "ArrowRight":
|
|
65
|
-
d === -1 ? s = 0 : (s = d + 1, s >= e && (s = i ? 0 : d)), u.preventDefault();
|
|
66
|
-
break;
|
|
67
|
-
case "ArrowLeft":
|
|
68
|
-
d === -1 ? s = e - 1 : (s = d - 1, s < 0 && (s = i ? e - 1 : d)), u.preventDefault();
|
|
69
|
-
break;
|
|
70
|
-
case "Enter":
|
|
71
|
-
d !== -1 && r && (r(d), u.preventDefault());
|
|
72
|
-
break;
|
|
73
|
-
case "Escape":
|
|
74
|
-
a && (a(), u.preventDefault()), m(-1);
|
|
75
|
-
break;
|
|
76
|
-
default:
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
s !== d && (m(s), n?.(s));
|
|
80
|
-
}, [d, e, t, n, r, a, i, l]);
|
|
81
|
-
return _e(() => {
|
|
82
|
-
if (l)
|
|
83
|
-
return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
|
|
84
|
-
}, [l, p]), {
|
|
85
|
-
/** The current focused index (-1 if none). @group State */
|
|
86
|
-
selectedIndex: d,
|
|
87
|
-
/** Manually sets the focused index. @group Methods */
|
|
88
|
-
setSelectedIndex: m
|
|
89
|
-
};
|
|
90
|
-
}, Fn = 6048e5, Ur = 864e5, Hn = 6e4, yi = 36e5, xi = 1e3, hn = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
91
|
-
function He(e, t) {
|
|
92
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" && hn in e ? e[hn](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
93
|
-
}
|
|
94
|
-
function ie(e, t) {
|
|
95
|
-
return He(t || e, e);
|
|
96
|
-
}
|
|
97
|
-
function vt(e, t, n) {
|
|
98
|
-
const r = ie(e, n?.in);
|
|
99
|
-
return isNaN(t) ? He(n?.in || e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
100
|
-
}
|
|
101
|
-
function Wn(e, t, n) {
|
|
102
|
-
const r = ie(e, n?.in);
|
|
103
|
-
if (isNaN(t)) return He(e, NaN);
|
|
104
|
-
if (!t)
|
|
105
|
-
return r;
|
|
106
|
-
const a = r.getDate(), i = He(e, r.getTime());
|
|
107
|
-
i.setMonth(r.getMonth() + t + 1, 0);
|
|
108
|
-
const l = i.getDate();
|
|
109
|
-
return a >= l ? i : (r.setFullYear(
|
|
110
|
-
i.getFullYear(),
|
|
111
|
-
i.getMonth(),
|
|
112
|
-
a
|
|
113
|
-
), r);
|
|
114
|
-
}
|
|
115
|
-
let Yr = {};
|
|
116
|
-
function St() {
|
|
117
|
-
return Yr;
|
|
118
|
-
}
|
|
119
|
-
function st(e, t) {
|
|
120
|
-
const n = St(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = ie(e, t?.in), i = a.getDay(), l = (i < r ? 7 : 0) + i - r;
|
|
121
|
-
return a.setDate(a.getDate() - l), a.setHours(0, 0, 0, 0), a;
|
|
122
|
-
}
|
|
123
|
-
function Ot(e, t) {
|
|
124
|
-
return st(e, { ...t, weekStartsOn: 1 });
|
|
125
|
-
}
|
|
126
|
-
function Bn(e, t) {
|
|
127
|
-
const n = ie(e, t?.in), r = n.getFullYear(), a = He(n, 0);
|
|
128
|
-
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
129
|
-
const i = Ot(a), l = He(n, 0);
|
|
130
|
-
l.setFullYear(r, 0, 4), l.setHours(0, 0, 0, 0);
|
|
131
|
-
const d = Ot(l);
|
|
132
|
-
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1;
|
|
133
|
-
}
|
|
134
|
-
function gn(e) {
|
|
135
|
-
const t = ie(e), n = new Date(
|
|
136
|
-
Date.UTC(
|
|
137
|
-
t.getFullYear(),
|
|
138
|
-
t.getMonth(),
|
|
139
|
-
t.getDate(),
|
|
140
|
-
t.getHours(),
|
|
141
|
-
t.getMinutes(),
|
|
142
|
-
t.getSeconds(),
|
|
143
|
-
t.getMilliseconds()
|
|
144
|
-
)
|
|
145
|
-
);
|
|
146
|
-
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
147
|
-
}
|
|
148
|
-
function It(e, ...t) {
|
|
149
|
-
const n = He.bind(
|
|
150
|
-
null,
|
|
151
|
-
t.find((r) => typeof r == "object")
|
|
152
|
-
);
|
|
153
|
-
return t.map(n);
|
|
154
|
-
}
|
|
155
|
-
function Le(e, t) {
|
|
156
|
-
const n = ie(e, t?.in);
|
|
157
|
-
return n.setHours(0, 0, 0, 0), n;
|
|
158
|
-
}
|
|
159
|
-
function Gr(e, t, n) {
|
|
160
|
-
const [r, a] = It(
|
|
161
|
-
n?.in,
|
|
162
|
-
e,
|
|
163
|
-
t
|
|
164
|
-
), i = Le(r), l = Le(a), d = +i - gn(i), m = +l - gn(l);
|
|
165
|
-
return Math.round((d - m) / Ur);
|
|
166
|
-
}
|
|
167
|
-
function $r(e, t) {
|
|
168
|
-
const n = Bn(e, t), r = He(e, 0);
|
|
169
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), Ot(r);
|
|
170
|
-
}
|
|
171
|
-
function tt(e, t, n) {
|
|
172
|
-
const r = ie(e, n?.in);
|
|
173
|
-
return r.setTime(r.getTime() + t * Hn), r;
|
|
174
|
-
}
|
|
175
|
-
function Un(e, t, n) {
|
|
176
|
-
return vt(e, t * 7, n);
|
|
177
|
-
}
|
|
178
|
-
function Nt(e, t, n) {
|
|
179
|
-
const [r, a] = [
|
|
180
|
-
+ie(e.start, n?.in),
|
|
181
|
-
+ie(e.end, n?.in)
|
|
182
|
-
].sort((d, m) => d - m), [i, l] = [
|
|
183
|
-
+ie(t.start, n?.in),
|
|
184
|
-
+ie(t.end, n?.in)
|
|
185
|
-
].sort((d, m) => d - m);
|
|
186
|
-
return r < l && i < a;
|
|
187
|
-
}
|
|
188
|
-
function ye(e, t, n) {
|
|
189
|
-
const [r, a] = It(
|
|
190
|
-
n?.in,
|
|
191
|
-
e,
|
|
192
|
-
t
|
|
193
|
-
);
|
|
194
|
-
return +Le(r) == +Le(a);
|
|
195
|
-
}
|
|
196
|
-
function Vr(e) {
|
|
197
|
-
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
198
|
-
}
|
|
199
|
-
function jr(e) {
|
|
200
|
-
return !(!Vr(e) && typeof e != "number" || isNaN(+ie(e)));
|
|
201
|
-
}
|
|
202
|
-
function qr(e) {
|
|
203
|
-
return (t) => {
|
|
204
|
-
const n = Math.trunc, r = n(t);
|
|
205
|
-
return r === 0 ? 0 : r;
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function Qr(e, t) {
|
|
209
|
-
return +ie(e) - +ie(t);
|
|
210
|
-
}
|
|
211
|
-
function Xr(e, t, n) {
|
|
212
|
-
const r = Qr(e, t) / Hn;
|
|
213
|
-
return qr()(r);
|
|
214
|
-
}
|
|
215
|
-
function Ht(e, t) {
|
|
216
|
-
const n = ie(e, t?.in);
|
|
217
|
-
return n.setHours(23, 59, 59, 999), n;
|
|
218
|
-
}
|
|
219
|
-
function pn(e, t) {
|
|
220
|
-
const n = ie(e, t?.in), r = n.getMonth();
|
|
221
|
-
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
222
|
-
}
|
|
223
|
-
function Kr(e, t) {
|
|
224
|
-
const [n, r] = It(e, t.start, t.end);
|
|
225
|
-
return { start: n, end: r };
|
|
226
|
-
}
|
|
227
|
-
function Jr(e, t) {
|
|
228
|
-
const { start: n, end: r } = Kr(t?.in, e);
|
|
229
|
-
let a = +n > +r;
|
|
230
|
-
const i = a ? +n : +r, l = a ? r : n;
|
|
231
|
-
l.setHours(0, 0, 0, 0);
|
|
232
|
-
let d = 1;
|
|
233
|
-
const m = [];
|
|
234
|
-
for (; +l <= i; )
|
|
235
|
-
m.push(He(n, l)), l.setDate(l.getDate() + d), l.setHours(0, 0, 0, 0);
|
|
236
|
-
return a ? m.reverse() : m;
|
|
237
|
-
}
|
|
238
|
-
function bn(e, t) {
|
|
239
|
-
const n = ie(e, t?.in);
|
|
240
|
-
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
241
|
-
}
|
|
242
|
-
function Zr(e, t) {
|
|
243
|
-
const n = ie(e, t?.in);
|
|
244
|
-
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
245
|
-
}
|
|
246
|
-
function wn(e, t) {
|
|
247
|
-
const n = St(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = ie(e, t?.in), i = a.getDay(), l = (i < r ? -7 : 0) + 6 - (i - r);
|
|
248
|
-
return a.setDate(a.getDate() + l), a.setHours(23, 59, 59, 999), a;
|
|
249
|
-
}
|
|
250
|
-
const ea = {
|
|
251
|
-
lessThanXSeconds: {
|
|
252
|
-
one: "less than a second",
|
|
253
|
-
other: "less than {{count}} seconds"
|
|
254
|
-
},
|
|
255
|
-
xSeconds: {
|
|
256
|
-
one: "1 second",
|
|
257
|
-
other: "{{count}} seconds"
|
|
258
|
-
},
|
|
259
|
-
halfAMinute: "half a minute",
|
|
260
|
-
lessThanXMinutes: {
|
|
261
|
-
one: "less than a minute",
|
|
262
|
-
other: "less than {{count}} minutes"
|
|
263
|
-
},
|
|
264
|
-
xMinutes: {
|
|
265
|
-
one: "1 minute",
|
|
266
|
-
other: "{{count}} minutes"
|
|
267
|
-
},
|
|
268
|
-
aboutXHours: {
|
|
269
|
-
one: "about 1 hour",
|
|
270
|
-
other: "about {{count}} hours"
|
|
271
|
-
},
|
|
272
|
-
xHours: {
|
|
273
|
-
one: "1 hour",
|
|
274
|
-
other: "{{count}} hours"
|
|
275
|
-
},
|
|
276
|
-
xDays: {
|
|
277
|
-
one: "1 day",
|
|
278
|
-
other: "{{count}} days"
|
|
279
|
-
},
|
|
280
|
-
aboutXWeeks: {
|
|
281
|
-
one: "about 1 week",
|
|
282
|
-
other: "about {{count}} weeks"
|
|
283
|
-
},
|
|
284
|
-
xWeeks: {
|
|
285
|
-
one: "1 week",
|
|
286
|
-
other: "{{count}} weeks"
|
|
287
|
-
},
|
|
288
|
-
aboutXMonths: {
|
|
289
|
-
one: "about 1 month",
|
|
290
|
-
other: "about {{count}} months"
|
|
291
|
-
},
|
|
292
|
-
xMonths: {
|
|
293
|
-
one: "1 month",
|
|
294
|
-
other: "{{count}} months"
|
|
295
|
-
},
|
|
296
|
-
aboutXYears: {
|
|
297
|
-
one: "about 1 year",
|
|
298
|
-
other: "about {{count}} years"
|
|
299
|
-
},
|
|
300
|
-
xYears: {
|
|
301
|
-
one: "1 year",
|
|
302
|
-
other: "{{count}} years"
|
|
303
|
-
},
|
|
304
|
-
overXYears: {
|
|
305
|
-
one: "over 1 year",
|
|
306
|
-
other: "over {{count}} years"
|
|
307
|
-
},
|
|
308
|
-
almostXYears: {
|
|
309
|
-
one: "almost 1 year",
|
|
310
|
-
other: "almost {{count}} years"
|
|
311
|
-
}
|
|
312
|
-
}, ta = (e, t, n) => {
|
|
313
|
-
let r;
|
|
314
|
-
const a = ea[e];
|
|
315
|
-
return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
316
|
-
};
|
|
317
|
-
function Wt(e) {
|
|
318
|
-
return (t = {}) => {
|
|
319
|
-
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
320
|
-
return e.formats[n] || e.formats[e.defaultWidth];
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
const na = {
|
|
324
|
-
full: "EEEE, MMMM do, y",
|
|
325
|
-
long: "MMMM do, y",
|
|
326
|
-
medium: "MMM d, y",
|
|
327
|
-
short: "MM/dd/yyyy"
|
|
328
|
-
}, ra = {
|
|
329
|
-
full: "h:mm:ss a zzzz",
|
|
330
|
-
long: "h:mm:ss a z",
|
|
331
|
-
medium: "h:mm:ss a",
|
|
332
|
-
short: "h:mm a"
|
|
333
|
-
}, aa = {
|
|
334
|
-
full: "{{date}} 'at' {{time}}",
|
|
335
|
-
long: "{{date}} 'at' {{time}}",
|
|
336
|
-
medium: "{{date}}, {{time}}",
|
|
337
|
-
short: "{{date}}, {{time}}"
|
|
338
|
-
}, oa = {
|
|
339
|
-
date: Wt({
|
|
340
|
-
formats: na,
|
|
341
|
-
defaultWidth: "full"
|
|
342
|
-
}),
|
|
343
|
-
time: Wt({
|
|
344
|
-
formats: ra,
|
|
345
|
-
defaultWidth: "full"
|
|
346
|
-
}),
|
|
347
|
-
dateTime: Wt({
|
|
348
|
-
formats: aa,
|
|
349
|
-
defaultWidth: "full"
|
|
350
|
-
})
|
|
351
|
-
}, ia = {
|
|
352
|
-
lastWeek: "'last' eeee 'at' p",
|
|
353
|
-
yesterday: "'yesterday at' p",
|
|
354
|
-
today: "'today at' p",
|
|
355
|
-
tomorrow: "'tomorrow at' p",
|
|
356
|
-
nextWeek: "eeee 'at' p",
|
|
357
|
-
other: "P"
|
|
358
|
-
}, sa = (e, t, n, r) => ia[e];
|
|
359
|
-
function mt(e) {
|
|
360
|
-
return (t, n) => {
|
|
361
|
-
const r = n?.context ? String(n.context) : "standalone";
|
|
362
|
-
let a;
|
|
363
|
-
if (r === "formatting" && e.formattingValues) {
|
|
364
|
-
const l = e.defaultFormattingWidth || e.defaultWidth, d = n?.width ? String(n.width) : l;
|
|
365
|
-
a = e.formattingValues[d] || e.formattingValues[l];
|
|
366
|
-
} else {
|
|
367
|
-
const l = e.defaultWidth, d = n?.width ? String(n.width) : e.defaultWidth;
|
|
368
|
-
a = e.values[d] || e.values[l];
|
|
369
|
-
}
|
|
370
|
-
const i = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
371
|
-
return a[i];
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
const ca = {
|
|
375
|
-
narrow: ["B", "A"],
|
|
376
|
-
abbreviated: ["BC", "AD"],
|
|
377
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
378
|
-
}, la = {
|
|
379
|
-
narrow: ["1", "2", "3", "4"],
|
|
380
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
381
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
382
|
-
}, da = {
|
|
383
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
384
|
-
abbreviated: [
|
|
385
|
-
"Jan",
|
|
386
|
-
"Feb",
|
|
387
|
-
"Mar",
|
|
388
|
-
"Apr",
|
|
389
|
-
"May",
|
|
390
|
-
"Jun",
|
|
391
|
-
"Jul",
|
|
392
|
-
"Aug",
|
|
393
|
-
"Sep",
|
|
394
|
-
"Oct",
|
|
395
|
-
"Nov",
|
|
396
|
-
"Dec"
|
|
397
|
-
],
|
|
398
|
-
wide: [
|
|
399
|
-
"January",
|
|
400
|
-
"February",
|
|
401
|
-
"March",
|
|
402
|
-
"April",
|
|
403
|
-
"May",
|
|
404
|
-
"June",
|
|
405
|
-
"July",
|
|
406
|
-
"August",
|
|
407
|
-
"September",
|
|
408
|
-
"October",
|
|
409
|
-
"November",
|
|
410
|
-
"December"
|
|
411
|
-
]
|
|
412
|
-
}, ua = {
|
|
413
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
414
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
415
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
416
|
-
wide: [
|
|
417
|
-
"Sunday",
|
|
418
|
-
"Monday",
|
|
419
|
-
"Tuesday",
|
|
420
|
-
"Wednesday",
|
|
421
|
-
"Thursday",
|
|
422
|
-
"Friday",
|
|
423
|
-
"Saturday"
|
|
424
|
-
]
|
|
425
|
-
}, fa = {
|
|
426
|
-
narrow: {
|
|
427
|
-
am: "a",
|
|
428
|
-
pm: "p",
|
|
429
|
-
midnight: "mi",
|
|
430
|
-
noon: "n",
|
|
431
|
-
morning: "morning",
|
|
432
|
-
afternoon: "afternoon",
|
|
433
|
-
evening: "evening",
|
|
434
|
-
night: "night"
|
|
435
|
-
},
|
|
436
|
-
abbreviated: {
|
|
437
|
-
am: "AM",
|
|
438
|
-
pm: "PM",
|
|
439
|
-
midnight: "midnight",
|
|
440
|
-
noon: "noon",
|
|
441
|
-
morning: "morning",
|
|
442
|
-
afternoon: "afternoon",
|
|
443
|
-
evening: "evening",
|
|
444
|
-
night: "night"
|
|
445
|
-
},
|
|
446
|
-
wide: {
|
|
447
|
-
am: "a.m.",
|
|
448
|
-
pm: "p.m.",
|
|
449
|
-
midnight: "midnight",
|
|
450
|
-
noon: "noon",
|
|
451
|
-
morning: "morning",
|
|
452
|
-
afternoon: "afternoon",
|
|
453
|
-
evening: "evening",
|
|
454
|
-
night: "night"
|
|
455
|
-
}
|
|
456
|
-
}, ma = {
|
|
457
|
-
narrow: {
|
|
458
|
-
am: "a",
|
|
459
|
-
pm: "p",
|
|
460
|
-
midnight: "mi",
|
|
461
|
-
noon: "n",
|
|
462
|
-
morning: "in the morning",
|
|
463
|
-
afternoon: "in the afternoon",
|
|
464
|
-
evening: "in the evening",
|
|
465
|
-
night: "at night"
|
|
466
|
-
},
|
|
467
|
-
abbreviated: {
|
|
468
|
-
am: "AM",
|
|
469
|
-
pm: "PM",
|
|
470
|
-
midnight: "midnight",
|
|
471
|
-
noon: "noon",
|
|
472
|
-
morning: "in the morning",
|
|
473
|
-
afternoon: "in the afternoon",
|
|
474
|
-
evening: "in the evening",
|
|
475
|
-
night: "at night"
|
|
476
|
-
},
|
|
477
|
-
wide: {
|
|
478
|
-
am: "a.m.",
|
|
479
|
-
pm: "p.m.",
|
|
480
|
-
midnight: "midnight",
|
|
481
|
-
noon: "noon",
|
|
482
|
-
morning: "in the morning",
|
|
483
|
-
afternoon: "in the afternoon",
|
|
484
|
-
evening: "in the evening",
|
|
485
|
-
night: "at night"
|
|
486
|
-
}
|
|
487
|
-
}, ha = (e, t) => {
|
|
488
|
-
const n = Number(e), r = n % 100;
|
|
489
|
-
if (r > 20 || r < 10)
|
|
490
|
-
switch (r % 10) {
|
|
491
|
-
case 1:
|
|
492
|
-
return n + "st";
|
|
493
|
-
case 2:
|
|
494
|
-
return n + "nd";
|
|
495
|
-
case 3:
|
|
496
|
-
return n + "rd";
|
|
497
|
-
}
|
|
498
|
-
return n + "th";
|
|
499
|
-
}, ga = {
|
|
500
|
-
ordinalNumber: ha,
|
|
501
|
-
era: mt({
|
|
502
|
-
values: ca,
|
|
503
|
-
defaultWidth: "wide"
|
|
504
|
-
}),
|
|
505
|
-
quarter: mt({
|
|
506
|
-
values: la,
|
|
507
|
-
defaultWidth: "wide",
|
|
508
|
-
argumentCallback: (e) => e - 1
|
|
509
|
-
}),
|
|
510
|
-
month: mt({
|
|
511
|
-
values: da,
|
|
512
|
-
defaultWidth: "wide"
|
|
513
|
-
}),
|
|
514
|
-
day: mt({
|
|
515
|
-
values: ua,
|
|
516
|
-
defaultWidth: "wide"
|
|
517
|
-
}),
|
|
518
|
-
dayPeriod: mt({
|
|
519
|
-
values: fa,
|
|
520
|
-
defaultWidth: "wide",
|
|
521
|
-
formattingValues: ma,
|
|
522
|
-
defaultFormattingWidth: "wide"
|
|
523
|
-
})
|
|
524
|
-
};
|
|
525
|
-
function ht(e) {
|
|
526
|
-
return (t, n = {}) => {
|
|
527
|
-
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
|
|
528
|
-
if (!i)
|
|
529
|
-
return null;
|
|
530
|
-
const l = i[0], d = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], m = Array.isArray(d) ? ba(d, (s) => s.test(l)) : (
|
|
531
|
-
// [TODO] -- I challenge you to fix the type
|
|
532
|
-
pa(d, (s) => s.test(l))
|
|
533
|
-
);
|
|
534
|
-
let p;
|
|
535
|
-
p = e.valueCallback ? e.valueCallback(m) : m, p = n.valueCallback ? (
|
|
536
|
-
// [TODO] -- I challenge you to fix the type
|
|
537
|
-
n.valueCallback(p)
|
|
538
|
-
) : p;
|
|
539
|
-
const u = t.slice(l.length);
|
|
540
|
-
return { value: p, rest: u };
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
function pa(e, t) {
|
|
544
|
-
for (const n in e)
|
|
545
|
-
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
546
|
-
return n;
|
|
547
|
-
}
|
|
548
|
-
function ba(e, t) {
|
|
549
|
-
for (let n = 0; n < e.length; n++)
|
|
550
|
-
if (t(e[n]))
|
|
551
|
-
return n;
|
|
552
|
-
}
|
|
553
|
-
function wa(e) {
|
|
554
|
-
return (t, n = {}) => {
|
|
555
|
-
const r = t.match(e.matchPattern);
|
|
556
|
-
if (!r) return null;
|
|
557
|
-
const a = r[0], i = t.match(e.parsePattern);
|
|
558
|
-
if (!i) return null;
|
|
559
|
-
let l = e.valueCallback ? e.valueCallback(i[0]) : i[0];
|
|
560
|
-
l = n.valueCallback ? n.valueCallback(l) : l;
|
|
561
|
-
const d = t.slice(a.length);
|
|
562
|
-
return { value: l, rest: d };
|
|
563
|
-
};
|
|
564
|
-
}
|
|
565
|
-
const ya = /^(\d+)(th|st|nd|rd)?/i, xa = /\d+/i, va = {
|
|
566
|
-
narrow: /^(b|a)/i,
|
|
567
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
568
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
569
|
-
}, Sa = {
|
|
570
|
-
any: [/^b/i, /^(a|c)/i]
|
|
571
|
-
}, Ea = {
|
|
572
|
-
narrow: /^[1234]/i,
|
|
573
|
-
abbreviated: /^q[1234]/i,
|
|
574
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
575
|
-
}, ka = {
|
|
576
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
577
|
-
}, Ta = {
|
|
578
|
-
narrow: /^[jfmasond]/i,
|
|
579
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
580
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
581
|
-
}, Da = {
|
|
582
|
-
narrow: [
|
|
583
|
-
/^j/i,
|
|
584
|
-
/^f/i,
|
|
585
|
-
/^m/i,
|
|
586
|
-
/^a/i,
|
|
587
|
-
/^m/i,
|
|
588
|
-
/^j/i,
|
|
589
|
-
/^j/i,
|
|
590
|
-
/^a/i,
|
|
591
|
-
/^s/i,
|
|
592
|
-
/^o/i,
|
|
593
|
-
/^n/i,
|
|
594
|
-
/^d/i
|
|
595
|
-
],
|
|
596
|
-
any: [
|
|
597
|
-
/^ja/i,
|
|
598
|
-
/^f/i,
|
|
599
|
-
/^mar/i,
|
|
600
|
-
/^ap/i,
|
|
601
|
-
/^may/i,
|
|
602
|
-
/^jun/i,
|
|
603
|
-
/^jul/i,
|
|
604
|
-
/^au/i,
|
|
605
|
-
/^s/i,
|
|
606
|
-
/^o/i,
|
|
607
|
-
/^n/i,
|
|
608
|
-
/^d/i
|
|
609
|
-
]
|
|
610
|
-
}, Ma = {
|
|
611
|
-
narrow: /^[smtwf]/i,
|
|
612
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
613
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
614
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
615
|
-
}, Na = {
|
|
616
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
617
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
618
|
-
}, _a = {
|
|
619
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
620
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
621
|
-
}, Ca = {
|
|
622
|
-
any: {
|
|
623
|
-
am: /^a/i,
|
|
624
|
-
pm: /^p/i,
|
|
625
|
-
midnight: /^mi/i,
|
|
626
|
-
noon: /^no/i,
|
|
627
|
-
morning: /morning/i,
|
|
628
|
-
afternoon: /afternoon/i,
|
|
629
|
-
evening: /evening/i,
|
|
630
|
-
night: /night/i
|
|
631
|
-
}
|
|
632
|
-
}, Aa = {
|
|
633
|
-
ordinalNumber: wa({
|
|
634
|
-
matchPattern: ya,
|
|
635
|
-
parsePattern: xa,
|
|
636
|
-
valueCallback: (e) => parseInt(e, 10)
|
|
637
|
-
}),
|
|
638
|
-
era: ht({
|
|
639
|
-
matchPatterns: va,
|
|
640
|
-
defaultMatchWidth: "wide",
|
|
641
|
-
parsePatterns: Sa,
|
|
642
|
-
defaultParseWidth: "any"
|
|
643
|
-
}),
|
|
644
|
-
quarter: ht({
|
|
645
|
-
matchPatterns: Ea,
|
|
646
|
-
defaultMatchWidth: "wide",
|
|
647
|
-
parsePatterns: ka,
|
|
648
|
-
defaultParseWidth: "any",
|
|
649
|
-
valueCallback: (e) => e + 1
|
|
650
|
-
}),
|
|
651
|
-
month: ht({
|
|
652
|
-
matchPatterns: Ta,
|
|
653
|
-
defaultMatchWidth: "wide",
|
|
654
|
-
parsePatterns: Da,
|
|
655
|
-
defaultParseWidth: "any"
|
|
656
|
-
}),
|
|
657
|
-
day: ht({
|
|
658
|
-
matchPatterns: Ma,
|
|
659
|
-
defaultMatchWidth: "wide",
|
|
660
|
-
parsePatterns: Na,
|
|
661
|
-
defaultParseWidth: "any"
|
|
662
|
-
}),
|
|
663
|
-
dayPeriod: ht({
|
|
664
|
-
matchPatterns: _a,
|
|
665
|
-
defaultMatchWidth: "any",
|
|
666
|
-
parsePatterns: Ca,
|
|
667
|
-
defaultParseWidth: "any"
|
|
668
|
-
})
|
|
669
|
-
}, Oa = {
|
|
670
|
-
code: "en-US",
|
|
671
|
-
formatDistance: ta,
|
|
672
|
-
formatLong: oa,
|
|
673
|
-
formatRelative: sa,
|
|
674
|
-
localize: ga,
|
|
675
|
-
match: Aa,
|
|
676
|
-
options: {
|
|
677
|
-
weekStartsOn: 0,
|
|
678
|
-
firstWeekContainsDate: 1
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
function Ia(e, t) {
|
|
682
|
-
const n = ie(e, t?.in);
|
|
683
|
-
return Gr(n, Zr(n)) + 1;
|
|
684
|
-
}
|
|
685
|
-
function Yn(e, t) {
|
|
686
|
-
const n = ie(e, t?.in), r = +Ot(n) - +$r(n);
|
|
687
|
-
return Math.round(r / Fn) + 1;
|
|
688
|
-
}
|
|
689
|
-
function Gn(e, t) {
|
|
690
|
-
const n = ie(e, t?.in), r = n.getFullYear(), a = St(), i = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, l = He(t?.in || e, 0);
|
|
691
|
-
l.setFullYear(r + 1, 0, i), l.setHours(0, 0, 0, 0);
|
|
692
|
-
const d = st(l, t), m = He(t?.in || e, 0);
|
|
693
|
-
m.setFullYear(r, 0, i), m.setHours(0, 0, 0, 0);
|
|
694
|
-
const p = st(m, t);
|
|
695
|
-
return +n >= +d ? r + 1 : +n >= +p ? r : r - 1;
|
|
696
|
-
}
|
|
697
|
-
function Ra(e, t) {
|
|
698
|
-
const n = St(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = Gn(e, t), i = He(t?.in || e, 0);
|
|
699
|
-
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), st(i, t);
|
|
700
|
-
}
|
|
701
|
-
function _t(e, t) {
|
|
702
|
-
const n = ie(e, t?.in), r = +st(n, t) - +Ra(n, t);
|
|
703
|
-
return Math.round(r / Fn) + 1;
|
|
704
|
-
}
|
|
705
|
-
function re(e, t) {
|
|
706
|
-
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
707
|
-
return n + r;
|
|
708
|
-
}
|
|
709
|
-
const et = {
|
|
710
|
-
// Year
|
|
711
|
-
y(e, t) {
|
|
712
|
-
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
713
|
-
return re(t === "yy" ? r % 100 : r, t.length);
|
|
714
|
-
},
|
|
715
|
-
// Month
|
|
716
|
-
M(e, t) {
|
|
717
|
-
const n = e.getMonth();
|
|
718
|
-
return t === "M" ? String(n + 1) : re(n + 1, 2);
|
|
719
|
-
},
|
|
720
|
-
// Day of the month
|
|
721
|
-
d(e, t) {
|
|
722
|
-
return re(e.getDate(), t.length);
|
|
723
|
-
},
|
|
724
|
-
// AM or PM
|
|
725
|
-
a(e, t) {
|
|
726
|
-
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
727
|
-
switch (t) {
|
|
728
|
-
case "a":
|
|
729
|
-
case "aa":
|
|
730
|
-
return n.toUpperCase();
|
|
731
|
-
case "aaa":
|
|
732
|
-
return n;
|
|
733
|
-
case "aaaaa":
|
|
734
|
-
return n[0];
|
|
735
|
-
default:
|
|
736
|
-
return n === "am" ? "a.m." : "p.m.";
|
|
737
|
-
}
|
|
738
|
-
},
|
|
739
|
-
// Hour [1-12]
|
|
740
|
-
h(e, t) {
|
|
741
|
-
return re(e.getHours() % 12 || 12, t.length);
|
|
742
|
-
},
|
|
743
|
-
// Hour [0-23]
|
|
744
|
-
H(e, t) {
|
|
745
|
-
return re(e.getHours(), t.length);
|
|
746
|
-
},
|
|
747
|
-
// Minute
|
|
748
|
-
m(e, t) {
|
|
749
|
-
return re(e.getMinutes(), t.length);
|
|
750
|
-
},
|
|
751
|
-
// Second
|
|
752
|
-
s(e, t) {
|
|
753
|
-
return re(e.getSeconds(), t.length);
|
|
754
|
-
},
|
|
755
|
-
// Fraction of second
|
|
756
|
-
S(e, t) {
|
|
757
|
-
const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
|
|
758
|
-
r * Math.pow(10, n - 3)
|
|
759
|
-
);
|
|
760
|
-
return re(a, t.length);
|
|
761
|
-
}
|
|
762
|
-
}, dt = {
|
|
763
|
-
midnight: "midnight",
|
|
764
|
-
noon: "noon",
|
|
765
|
-
morning: "morning",
|
|
766
|
-
afternoon: "afternoon",
|
|
767
|
-
evening: "evening",
|
|
768
|
-
night: "night"
|
|
769
|
-
}, yn = {
|
|
770
|
-
// Era
|
|
771
|
-
G: function(e, t, n) {
|
|
772
|
-
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
773
|
-
switch (t) {
|
|
774
|
-
// AD, BC
|
|
775
|
-
case "G":
|
|
776
|
-
case "GG":
|
|
777
|
-
case "GGG":
|
|
778
|
-
return n.era(r, { width: "abbreviated" });
|
|
779
|
-
// A, B
|
|
780
|
-
case "GGGGG":
|
|
781
|
-
return n.era(r, { width: "narrow" });
|
|
782
|
-
default:
|
|
783
|
-
return n.era(r, { width: "wide" });
|
|
784
|
-
}
|
|
785
|
-
},
|
|
786
|
-
// Year
|
|
787
|
-
y: function(e, t, n) {
|
|
788
|
-
if (t === "yo") {
|
|
789
|
-
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
790
|
-
return n.ordinalNumber(a, { unit: "year" });
|
|
791
|
-
}
|
|
792
|
-
return et.y(e, t);
|
|
793
|
-
},
|
|
794
|
-
// Local week-numbering year
|
|
795
|
-
Y: function(e, t, n, r) {
|
|
796
|
-
const a = Gn(e, r), i = a > 0 ? a : 1 - a;
|
|
797
|
-
if (t === "YY") {
|
|
798
|
-
const l = i % 100;
|
|
799
|
-
return re(l, 2);
|
|
800
|
-
}
|
|
801
|
-
return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : re(i, t.length);
|
|
802
|
-
},
|
|
803
|
-
// ISO week-numbering year
|
|
804
|
-
R: function(e, t) {
|
|
805
|
-
const n = Bn(e);
|
|
806
|
-
return re(n, t.length);
|
|
807
|
-
},
|
|
808
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
809
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
810
|
-
// | Year | `y` | `u` |
|
|
811
|
-
// |------|-----|-----|
|
|
812
|
-
// | AC 1 | 1 | 1 |
|
|
813
|
-
// | BC 1 | 1 | 0 |
|
|
814
|
-
// | BC 2 | 2 | -1 |
|
|
815
|
-
// Also `yy` always returns the last two digits of a year,
|
|
816
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
817
|
-
u: function(e, t) {
|
|
818
|
-
const n = e.getFullYear();
|
|
819
|
-
return re(n, t.length);
|
|
820
|
-
},
|
|
821
|
-
// Quarter
|
|
822
|
-
Q: function(e, t, n) {
|
|
823
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
824
|
-
switch (t) {
|
|
825
|
-
// 1, 2, 3, 4
|
|
826
|
-
case "Q":
|
|
827
|
-
return String(r);
|
|
828
|
-
// 01, 02, 03, 04
|
|
829
|
-
case "QQ":
|
|
830
|
-
return re(r, 2);
|
|
831
|
-
// 1st, 2nd, 3rd, 4th
|
|
832
|
-
case "Qo":
|
|
833
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
834
|
-
// Q1, Q2, Q3, Q4
|
|
835
|
-
case "QQQ":
|
|
836
|
-
return n.quarter(r, {
|
|
837
|
-
width: "abbreviated",
|
|
838
|
-
context: "formatting"
|
|
839
|
-
});
|
|
840
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
841
|
-
case "QQQQQ":
|
|
842
|
-
return n.quarter(r, {
|
|
843
|
-
width: "narrow",
|
|
844
|
-
context: "formatting"
|
|
845
|
-
});
|
|
846
|
-
default:
|
|
847
|
-
return n.quarter(r, {
|
|
848
|
-
width: "wide",
|
|
849
|
-
context: "formatting"
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
|
-
},
|
|
853
|
-
// Stand-alone quarter
|
|
854
|
-
q: function(e, t, n) {
|
|
855
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
856
|
-
switch (t) {
|
|
857
|
-
// 1, 2, 3, 4
|
|
858
|
-
case "q":
|
|
859
|
-
return String(r);
|
|
860
|
-
// 01, 02, 03, 04
|
|
861
|
-
case "qq":
|
|
862
|
-
return re(r, 2);
|
|
863
|
-
// 1st, 2nd, 3rd, 4th
|
|
864
|
-
case "qo":
|
|
865
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
866
|
-
// Q1, Q2, Q3, Q4
|
|
867
|
-
case "qqq":
|
|
868
|
-
return n.quarter(r, {
|
|
869
|
-
width: "abbreviated",
|
|
870
|
-
context: "standalone"
|
|
871
|
-
});
|
|
872
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
873
|
-
case "qqqqq":
|
|
874
|
-
return n.quarter(r, {
|
|
875
|
-
width: "narrow",
|
|
876
|
-
context: "standalone"
|
|
877
|
-
});
|
|
878
|
-
default:
|
|
879
|
-
return n.quarter(r, {
|
|
880
|
-
width: "wide",
|
|
881
|
-
context: "standalone"
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
},
|
|
885
|
-
// Month
|
|
886
|
-
M: function(e, t, n) {
|
|
887
|
-
const r = e.getMonth();
|
|
888
|
-
switch (t) {
|
|
889
|
-
case "M":
|
|
890
|
-
case "MM":
|
|
891
|
-
return et.M(e, t);
|
|
892
|
-
// 1st, 2nd, ..., 12th
|
|
893
|
-
case "Mo":
|
|
894
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
895
|
-
// Jan, Feb, ..., Dec
|
|
896
|
-
case "MMM":
|
|
897
|
-
return n.month(r, {
|
|
898
|
-
width: "abbreviated",
|
|
899
|
-
context: "formatting"
|
|
900
|
-
});
|
|
901
|
-
// J, F, ..., D
|
|
902
|
-
case "MMMMM":
|
|
903
|
-
return n.month(r, {
|
|
904
|
-
width: "narrow",
|
|
905
|
-
context: "formatting"
|
|
906
|
-
});
|
|
907
|
-
default:
|
|
908
|
-
return n.month(r, { width: "wide", context: "formatting" });
|
|
909
|
-
}
|
|
910
|
-
},
|
|
911
|
-
// Stand-alone month
|
|
912
|
-
L: function(e, t, n) {
|
|
913
|
-
const r = e.getMonth();
|
|
914
|
-
switch (t) {
|
|
915
|
-
// 1, 2, ..., 12
|
|
916
|
-
case "L":
|
|
917
|
-
return String(r + 1);
|
|
918
|
-
// 01, 02, ..., 12
|
|
919
|
-
case "LL":
|
|
920
|
-
return re(r + 1, 2);
|
|
921
|
-
// 1st, 2nd, ..., 12th
|
|
922
|
-
case "Lo":
|
|
923
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
924
|
-
// Jan, Feb, ..., Dec
|
|
925
|
-
case "LLL":
|
|
926
|
-
return n.month(r, {
|
|
927
|
-
width: "abbreviated",
|
|
928
|
-
context: "standalone"
|
|
929
|
-
});
|
|
930
|
-
// J, F, ..., D
|
|
931
|
-
case "LLLLL":
|
|
932
|
-
return n.month(r, {
|
|
933
|
-
width: "narrow",
|
|
934
|
-
context: "standalone"
|
|
935
|
-
});
|
|
936
|
-
default:
|
|
937
|
-
return n.month(r, { width: "wide", context: "standalone" });
|
|
938
|
-
}
|
|
939
|
-
},
|
|
940
|
-
// Local week of year
|
|
941
|
-
w: function(e, t, n, r) {
|
|
942
|
-
const a = _t(e, r);
|
|
943
|
-
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : re(a, t.length);
|
|
944
|
-
},
|
|
945
|
-
// ISO week of year
|
|
946
|
-
I: function(e, t, n) {
|
|
947
|
-
const r = Yn(e);
|
|
948
|
-
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : re(r, t.length);
|
|
949
|
-
},
|
|
950
|
-
// Day of the month
|
|
951
|
-
d: function(e, t, n) {
|
|
952
|
-
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : et.d(e, t);
|
|
953
|
-
},
|
|
954
|
-
// Day of year
|
|
955
|
-
D: function(e, t, n) {
|
|
956
|
-
const r = Ia(e);
|
|
957
|
-
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : re(r, t.length);
|
|
958
|
-
},
|
|
959
|
-
// Day of week
|
|
960
|
-
E: function(e, t, n) {
|
|
961
|
-
const r = e.getDay();
|
|
962
|
-
switch (t) {
|
|
963
|
-
// Tue
|
|
964
|
-
case "E":
|
|
965
|
-
case "EE":
|
|
966
|
-
case "EEE":
|
|
967
|
-
return n.day(r, {
|
|
968
|
-
width: "abbreviated",
|
|
969
|
-
context: "formatting"
|
|
970
|
-
});
|
|
971
|
-
// T
|
|
972
|
-
case "EEEEE":
|
|
973
|
-
return n.day(r, {
|
|
974
|
-
width: "narrow",
|
|
975
|
-
context: "formatting"
|
|
976
|
-
});
|
|
977
|
-
// Tu
|
|
978
|
-
case "EEEEEE":
|
|
979
|
-
return n.day(r, {
|
|
980
|
-
width: "short",
|
|
981
|
-
context: "formatting"
|
|
982
|
-
});
|
|
983
|
-
default:
|
|
984
|
-
return n.day(r, {
|
|
985
|
-
width: "wide",
|
|
986
|
-
context: "formatting"
|
|
987
|
-
});
|
|
988
|
-
}
|
|
989
|
-
},
|
|
990
|
-
// Local day of week
|
|
991
|
-
e: function(e, t, n, r) {
|
|
992
|
-
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
993
|
-
switch (t) {
|
|
994
|
-
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
995
|
-
case "e":
|
|
996
|
-
return String(i);
|
|
997
|
-
// Padded numerical value
|
|
998
|
-
case "ee":
|
|
999
|
-
return re(i, 2);
|
|
1000
|
-
// 1st, 2nd, ..., 7th
|
|
1001
|
-
case "eo":
|
|
1002
|
-
return n.ordinalNumber(i, { unit: "day" });
|
|
1003
|
-
case "eee":
|
|
1004
|
-
return n.day(a, {
|
|
1005
|
-
width: "abbreviated",
|
|
1006
|
-
context: "formatting"
|
|
1007
|
-
});
|
|
1008
|
-
// T
|
|
1009
|
-
case "eeeee":
|
|
1010
|
-
return n.day(a, {
|
|
1011
|
-
width: "narrow",
|
|
1012
|
-
context: "formatting"
|
|
1013
|
-
});
|
|
1014
|
-
// Tu
|
|
1015
|
-
case "eeeeee":
|
|
1016
|
-
return n.day(a, {
|
|
1017
|
-
width: "short",
|
|
1018
|
-
context: "formatting"
|
|
1019
|
-
});
|
|
1020
|
-
default:
|
|
1021
|
-
return n.day(a, {
|
|
1022
|
-
width: "wide",
|
|
1023
|
-
context: "formatting"
|
|
1024
|
-
});
|
|
1025
|
-
}
|
|
1026
|
-
},
|
|
1027
|
-
// Stand-alone local day of week
|
|
1028
|
-
c: function(e, t, n, r) {
|
|
1029
|
-
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
1030
|
-
switch (t) {
|
|
1031
|
-
// Numerical value (same as in `e`)
|
|
1032
|
-
case "c":
|
|
1033
|
-
return String(i);
|
|
1034
|
-
// Padded numerical value
|
|
1035
|
-
case "cc":
|
|
1036
|
-
return re(i, t.length);
|
|
1037
|
-
// 1st, 2nd, ..., 7th
|
|
1038
|
-
case "co":
|
|
1039
|
-
return n.ordinalNumber(i, { unit: "day" });
|
|
1040
|
-
case "ccc":
|
|
1041
|
-
return n.day(a, {
|
|
1042
|
-
width: "abbreviated",
|
|
1043
|
-
context: "standalone"
|
|
1044
|
-
});
|
|
1045
|
-
// T
|
|
1046
|
-
case "ccccc":
|
|
1047
|
-
return n.day(a, {
|
|
1048
|
-
width: "narrow",
|
|
1049
|
-
context: "standalone"
|
|
1050
|
-
});
|
|
1051
|
-
// Tu
|
|
1052
|
-
case "cccccc":
|
|
1053
|
-
return n.day(a, {
|
|
1054
|
-
width: "short",
|
|
1055
|
-
context: "standalone"
|
|
1056
|
-
});
|
|
1057
|
-
default:
|
|
1058
|
-
return n.day(a, {
|
|
1059
|
-
width: "wide",
|
|
1060
|
-
context: "standalone"
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
},
|
|
1064
|
-
// ISO day of week
|
|
1065
|
-
i: function(e, t, n) {
|
|
1066
|
-
const r = e.getDay(), a = r === 0 ? 7 : r;
|
|
1067
|
-
switch (t) {
|
|
1068
|
-
// 2
|
|
1069
|
-
case "i":
|
|
1070
|
-
return String(a);
|
|
1071
|
-
// 02
|
|
1072
|
-
case "ii":
|
|
1073
|
-
return re(a, t.length);
|
|
1074
|
-
// 2nd
|
|
1075
|
-
case "io":
|
|
1076
|
-
return n.ordinalNumber(a, { unit: "day" });
|
|
1077
|
-
// Tue
|
|
1078
|
-
case "iii":
|
|
1079
|
-
return n.day(r, {
|
|
1080
|
-
width: "abbreviated",
|
|
1081
|
-
context: "formatting"
|
|
1082
|
-
});
|
|
1083
|
-
// T
|
|
1084
|
-
case "iiiii":
|
|
1085
|
-
return n.day(r, {
|
|
1086
|
-
width: "narrow",
|
|
1087
|
-
context: "formatting"
|
|
1088
|
-
});
|
|
1089
|
-
// Tu
|
|
1090
|
-
case "iiiiii":
|
|
1091
|
-
return n.day(r, {
|
|
1092
|
-
width: "short",
|
|
1093
|
-
context: "formatting"
|
|
1094
|
-
});
|
|
1095
|
-
default:
|
|
1096
|
-
return n.day(r, {
|
|
1097
|
-
width: "wide",
|
|
1098
|
-
context: "formatting"
|
|
1099
|
-
});
|
|
1100
|
-
}
|
|
1101
|
-
},
|
|
1102
|
-
// AM or PM
|
|
1103
|
-
a: function(e, t, n) {
|
|
1104
|
-
const a = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1105
|
-
switch (t) {
|
|
1106
|
-
case "a":
|
|
1107
|
-
case "aa":
|
|
1108
|
-
return n.dayPeriod(a, {
|
|
1109
|
-
width: "abbreviated",
|
|
1110
|
-
context: "formatting"
|
|
1111
|
-
});
|
|
1112
|
-
case "aaa":
|
|
1113
|
-
return n.dayPeriod(a, {
|
|
1114
|
-
width: "abbreviated",
|
|
1115
|
-
context: "formatting"
|
|
1116
|
-
}).toLowerCase();
|
|
1117
|
-
case "aaaaa":
|
|
1118
|
-
return n.dayPeriod(a, {
|
|
1119
|
-
width: "narrow",
|
|
1120
|
-
context: "formatting"
|
|
1121
|
-
});
|
|
1122
|
-
default:
|
|
1123
|
-
return n.dayPeriod(a, {
|
|
1124
|
-
width: "wide",
|
|
1125
|
-
context: "formatting"
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
},
|
|
1129
|
-
// AM, PM, midnight, noon
|
|
1130
|
-
b: function(e, t, n) {
|
|
1131
|
-
const r = e.getHours();
|
|
1132
|
-
let a;
|
|
1133
|
-
switch (r === 12 ? a = dt.noon : r === 0 ? a = dt.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
1134
|
-
case "b":
|
|
1135
|
-
case "bb":
|
|
1136
|
-
return n.dayPeriod(a, {
|
|
1137
|
-
width: "abbreviated",
|
|
1138
|
-
context: "formatting"
|
|
1139
|
-
});
|
|
1140
|
-
case "bbb":
|
|
1141
|
-
return n.dayPeriod(a, {
|
|
1142
|
-
width: "abbreviated",
|
|
1143
|
-
context: "formatting"
|
|
1144
|
-
}).toLowerCase();
|
|
1145
|
-
case "bbbbb":
|
|
1146
|
-
return n.dayPeriod(a, {
|
|
1147
|
-
width: "narrow",
|
|
1148
|
-
context: "formatting"
|
|
1149
|
-
});
|
|
1150
|
-
default:
|
|
1151
|
-
return n.dayPeriod(a, {
|
|
1152
|
-
width: "wide",
|
|
1153
|
-
context: "formatting"
|
|
1154
|
-
});
|
|
1155
|
-
}
|
|
1156
|
-
},
|
|
1157
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
1158
|
-
B: function(e, t, n) {
|
|
1159
|
-
const r = e.getHours();
|
|
1160
|
-
let a;
|
|
1161
|
-
switch (r >= 17 ? a = dt.evening : r >= 12 ? a = dt.afternoon : r >= 4 ? a = dt.morning : a = dt.night, t) {
|
|
1162
|
-
case "B":
|
|
1163
|
-
case "BB":
|
|
1164
|
-
case "BBB":
|
|
1165
|
-
return n.dayPeriod(a, {
|
|
1166
|
-
width: "abbreviated",
|
|
1167
|
-
context: "formatting"
|
|
1168
|
-
});
|
|
1169
|
-
case "BBBBB":
|
|
1170
|
-
return n.dayPeriod(a, {
|
|
1171
|
-
width: "narrow",
|
|
1172
|
-
context: "formatting"
|
|
1173
|
-
});
|
|
1174
|
-
default:
|
|
1175
|
-
return n.dayPeriod(a, {
|
|
1176
|
-
width: "wide",
|
|
1177
|
-
context: "formatting"
|
|
1178
|
-
});
|
|
1179
|
-
}
|
|
1180
|
-
},
|
|
1181
|
-
// Hour [1-12]
|
|
1182
|
-
h: function(e, t, n) {
|
|
1183
|
-
if (t === "ho") {
|
|
1184
|
-
let r = e.getHours() % 12;
|
|
1185
|
-
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1186
|
-
}
|
|
1187
|
-
return et.h(e, t);
|
|
1188
|
-
},
|
|
1189
|
-
// Hour [0-23]
|
|
1190
|
-
H: function(e, t, n) {
|
|
1191
|
-
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : et.H(e, t);
|
|
1192
|
-
},
|
|
1193
|
-
// Hour [0-11]
|
|
1194
|
-
K: function(e, t, n) {
|
|
1195
|
-
const r = e.getHours() % 12;
|
|
1196
|
-
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : re(r, t.length);
|
|
1197
|
-
},
|
|
1198
|
-
// Hour [1-24]
|
|
1199
|
-
k: function(e, t, n) {
|
|
1200
|
-
let r = e.getHours();
|
|
1201
|
-
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : re(r, t.length);
|
|
1202
|
-
},
|
|
1203
|
-
// Minute
|
|
1204
|
-
m: function(e, t, n) {
|
|
1205
|
-
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : et.m(e, t);
|
|
1206
|
-
},
|
|
1207
|
-
// Second
|
|
1208
|
-
s: function(e, t, n) {
|
|
1209
|
-
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : et.s(e, t);
|
|
1210
|
-
},
|
|
1211
|
-
// Fraction of second
|
|
1212
|
-
S: function(e, t) {
|
|
1213
|
-
return et.S(e, t);
|
|
1214
|
-
},
|
|
1215
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1216
|
-
X: function(e, t, n) {
|
|
1217
|
-
const r = e.getTimezoneOffset();
|
|
1218
|
-
if (r === 0)
|
|
1219
|
-
return "Z";
|
|
1220
|
-
switch (t) {
|
|
1221
|
-
// Hours and optional minutes
|
|
1222
|
-
case "X":
|
|
1223
|
-
return vn(r);
|
|
1224
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
1225
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1226
|
-
// so this token always has the same output as `XX`
|
|
1227
|
-
case "XXXX":
|
|
1228
|
-
case "XX":
|
|
1229
|
-
return ot(r);
|
|
1230
|
-
// Hours and minutes with `:` delimiter
|
|
1231
|
-
default:
|
|
1232
|
-
return ot(r, ":");
|
|
1233
|
-
}
|
|
1234
|
-
},
|
|
1235
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1236
|
-
x: function(e, t, n) {
|
|
1237
|
-
const r = e.getTimezoneOffset();
|
|
1238
|
-
switch (t) {
|
|
1239
|
-
// Hours and optional minutes
|
|
1240
|
-
case "x":
|
|
1241
|
-
return vn(r);
|
|
1242
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
1243
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1244
|
-
// so this token always has the same output as `xx`
|
|
1245
|
-
case "xxxx":
|
|
1246
|
-
case "xx":
|
|
1247
|
-
return ot(r);
|
|
1248
|
-
// Hours and minutes with `:` delimiter
|
|
1249
|
-
default:
|
|
1250
|
-
return ot(r, ":");
|
|
1251
|
-
}
|
|
1252
|
-
},
|
|
1253
|
-
// Timezone (GMT)
|
|
1254
|
-
O: function(e, t, n) {
|
|
1255
|
-
const r = e.getTimezoneOffset();
|
|
1256
|
-
switch (t) {
|
|
1257
|
-
// Short
|
|
1258
|
-
case "O":
|
|
1259
|
-
case "OO":
|
|
1260
|
-
case "OOO":
|
|
1261
|
-
return "GMT" + xn(r, ":");
|
|
1262
|
-
default:
|
|
1263
|
-
return "GMT" + ot(r, ":");
|
|
1264
|
-
}
|
|
1265
|
-
},
|
|
1266
|
-
// Timezone (specific non-location)
|
|
1267
|
-
z: function(e, t, n) {
|
|
1268
|
-
const r = e.getTimezoneOffset();
|
|
1269
|
-
switch (t) {
|
|
1270
|
-
// Short
|
|
1271
|
-
case "z":
|
|
1272
|
-
case "zz":
|
|
1273
|
-
case "zzz":
|
|
1274
|
-
return "GMT" + xn(r, ":");
|
|
1275
|
-
default:
|
|
1276
|
-
return "GMT" + ot(r, ":");
|
|
1277
|
-
}
|
|
1278
|
-
},
|
|
1279
|
-
// Seconds timestamp
|
|
1280
|
-
t: function(e, t, n) {
|
|
1281
|
-
const r = Math.trunc(+e / 1e3);
|
|
1282
|
-
return re(r, t.length);
|
|
1283
|
-
},
|
|
1284
|
-
// Milliseconds timestamp
|
|
1285
|
-
T: function(e, t, n) {
|
|
1286
|
-
return re(+e, t.length);
|
|
1287
|
-
}
|
|
1288
|
-
};
|
|
1289
|
-
function xn(e, t = "") {
|
|
1290
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
|
|
1291
|
-
return i === 0 ? n + String(a) : n + String(a) + t + re(i, 2);
|
|
1292
|
-
}
|
|
1293
|
-
function vn(e, t) {
|
|
1294
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") + re(Math.abs(e) / 60, 2) : ot(e, t);
|
|
1295
|
-
}
|
|
1296
|
-
function ot(e, t = "") {
|
|
1297
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = re(Math.trunc(r / 60), 2), i = re(r % 60, 2);
|
|
1298
|
-
return n + a + t + i;
|
|
1299
|
-
}
|
|
1300
|
-
const Sn = (e, t) => {
|
|
1301
|
-
switch (e) {
|
|
1302
|
-
case "P":
|
|
1303
|
-
return t.date({ width: "short" });
|
|
1304
|
-
case "PP":
|
|
1305
|
-
return t.date({ width: "medium" });
|
|
1306
|
-
case "PPP":
|
|
1307
|
-
return t.date({ width: "long" });
|
|
1308
|
-
default:
|
|
1309
|
-
return t.date({ width: "full" });
|
|
1310
|
-
}
|
|
1311
|
-
}, $n = (e, t) => {
|
|
1312
|
-
switch (e) {
|
|
1313
|
-
case "p":
|
|
1314
|
-
return t.time({ width: "short" });
|
|
1315
|
-
case "pp":
|
|
1316
|
-
return t.time({ width: "medium" });
|
|
1317
|
-
case "ppp":
|
|
1318
|
-
return t.time({ width: "long" });
|
|
1319
|
-
default:
|
|
1320
|
-
return t.time({ width: "full" });
|
|
1321
|
-
}
|
|
1322
|
-
}, Pa = (e, t) => {
|
|
1323
|
-
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1324
|
-
if (!a)
|
|
1325
|
-
return Sn(e, t);
|
|
1326
|
-
let i;
|
|
1327
|
-
switch (r) {
|
|
1328
|
-
case "P":
|
|
1329
|
-
i = t.dateTime({ width: "short" });
|
|
1330
|
-
break;
|
|
1331
|
-
case "PP":
|
|
1332
|
-
i = t.dateTime({ width: "medium" });
|
|
1333
|
-
break;
|
|
1334
|
-
case "PPP":
|
|
1335
|
-
i = t.dateTime({ width: "long" });
|
|
1336
|
-
break;
|
|
1337
|
-
default:
|
|
1338
|
-
i = t.dateTime({ width: "full" });
|
|
1339
|
-
break;
|
|
1340
|
-
}
|
|
1341
|
-
return i.replace("{{date}}", Sn(r, t)).replace("{{time}}", $n(a, t));
|
|
1342
|
-
}, La = {
|
|
1343
|
-
p: $n,
|
|
1344
|
-
P: Pa
|
|
1345
|
-
}, za = /^D+$/, Fa = /^Y+$/, Ha = ["D", "DD", "YY", "YYYY"];
|
|
1346
|
-
function Wa(e) {
|
|
1347
|
-
return za.test(e);
|
|
1348
|
-
}
|
|
1349
|
-
function Ba(e) {
|
|
1350
|
-
return Fa.test(e);
|
|
1351
|
-
}
|
|
1352
|
-
function Ua(e, t, n) {
|
|
1353
|
-
const r = Ya(e, t, n);
|
|
1354
|
-
if (console.warn(r), Ha.includes(e)) throw new RangeError(r);
|
|
1355
|
-
}
|
|
1356
|
-
function Ya(e, t, n) {
|
|
1357
|
-
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1358
|
-
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1359
|
-
}
|
|
1360
|
-
const Ga = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, $a = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Va = /^'([^]*?)'?$/, ja = /''/g, qa = /[a-zA-Z]/;
|
|
1361
|
-
function ue(e, t, n) {
|
|
1362
|
-
const r = St(), a = r.locale ?? Oa, i = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, l = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, d = ie(e, n?.in);
|
|
1363
|
-
if (!jr(d))
|
|
1364
|
-
throw new RangeError("Invalid time value");
|
|
1365
|
-
let m = t.match($a).map((u) => {
|
|
1366
|
-
const s = u[0];
|
|
1367
|
-
if (s === "p" || s === "P") {
|
|
1368
|
-
const N = La[s];
|
|
1369
|
-
return N(u, a.formatLong);
|
|
1370
|
-
}
|
|
1371
|
-
return u;
|
|
1372
|
-
}).join("").match(Ga).map((u) => {
|
|
1373
|
-
if (u === "''")
|
|
1374
|
-
return { isToken: !1, value: "'" };
|
|
1375
|
-
const s = u[0];
|
|
1376
|
-
if (s === "'")
|
|
1377
|
-
return { isToken: !1, value: Qa(u) };
|
|
1378
|
-
if (yn[s])
|
|
1379
|
-
return { isToken: !0, value: u };
|
|
1380
|
-
if (s.match(qa))
|
|
1381
|
-
throw new RangeError(
|
|
1382
|
-
"Format string contains an unescaped latin alphabet character `" + s + "`"
|
|
1383
|
-
);
|
|
1384
|
-
return { isToken: !1, value: u };
|
|
1385
|
-
});
|
|
1386
|
-
a.localize.preprocessor && (m = a.localize.preprocessor(d, m));
|
|
1387
|
-
const p = {
|
|
1388
|
-
firstWeekContainsDate: i,
|
|
1389
|
-
weekStartsOn: l,
|
|
1390
|
-
locale: a
|
|
1391
|
-
};
|
|
1392
|
-
return m.map((u) => {
|
|
1393
|
-
if (!u.isToken) return u.value;
|
|
1394
|
-
const s = u.value;
|
|
1395
|
-
(Ba(s) || Wa(s)) && Ua(s, t, String(e));
|
|
1396
|
-
const N = yn[s[0]];
|
|
1397
|
-
return N(d, s, a.localize, p);
|
|
1398
|
-
}).join("");
|
|
1399
|
-
}
|
|
1400
|
-
function Qa(e) {
|
|
1401
|
-
const t = e.match(Va);
|
|
1402
|
-
return t ? t[1].replace(ja, "'") : e;
|
|
1403
|
-
}
|
|
1404
|
-
function Xa(e, t, n) {
|
|
1405
|
-
const [r, a] = It(
|
|
1406
|
-
n?.in,
|
|
1407
|
-
e,
|
|
1408
|
-
t
|
|
1409
|
-
);
|
|
1410
|
-
return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth();
|
|
1411
|
-
}
|
|
1412
|
-
function En(e, t, n) {
|
|
1413
|
-
const r = +ie(e, n?.in), [a, i] = [
|
|
1414
|
-
+ie(t.start, n?.in),
|
|
1415
|
-
+ie(t.end, n?.in)
|
|
1416
|
-
].sort((l, d) => l - d);
|
|
1417
|
-
return r >= a && r <= i;
|
|
1418
|
-
}
|
|
1419
|
-
function Ka(e, t, n) {
|
|
1420
|
-
return vt(e, -1, n);
|
|
1421
|
-
}
|
|
1422
|
-
function Ja(e, t, n) {
|
|
1423
|
-
return Wn(e, -1, n);
|
|
1424
|
-
}
|
|
1425
|
-
function Za(e, t, n) {
|
|
1426
|
-
return Un(e, -1, n);
|
|
1427
|
-
}
|
|
1428
|
-
const eo = (e) => new lr({
|
|
1429
|
-
events: [],
|
|
1430
|
-
resources: [],
|
|
1431
|
-
view: "week",
|
|
1432
|
-
currentDate: /* @__PURE__ */ new Date(),
|
|
1433
|
-
selectedDate: /* @__PURE__ */ new Date(),
|
|
1434
|
-
selectedEventId: null,
|
|
1435
|
-
slotDuration: 30,
|
|
1436
|
-
is24Hour: !0,
|
|
1437
|
-
...e
|
|
1438
|
-
}), to = (e) => ({
|
|
1439
|
-
setEvents: (t) => {
|
|
1440
|
-
e.setState((n) => ({ ...n, events: t }));
|
|
1441
|
-
},
|
|
1442
|
-
addEvent: (t) => {
|
|
1443
|
-
e.setState((n) => ({ ...n, events: [...n.events, t] }));
|
|
1444
|
-
},
|
|
1445
|
-
updateEvent: (t) => {
|
|
1446
|
-
e.setState((n) => ({
|
|
1447
|
-
...n,
|
|
1448
|
-
events: n.events.map((r) => r.id === t.id ? t : r)
|
|
1449
|
-
}));
|
|
1450
|
-
},
|
|
1451
|
-
deleteEvent: (t) => {
|
|
1452
|
-
e.setState((n) => ({
|
|
1453
|
-
...n,
|
|
1454
|
-
events: n.events.filter((r) => r.id !== t)
|
|
1455
|
-
}));
|
|
1456
|
-
},
|
|
1457
|
-
setResources: (t) => {
|
|
1458
|
-
e.setState((n) => ({ ...n, resources: t }));
|
|
1459
|
-
},
|
|
1460
|
-
setView: (t) => {
|
|
1461
|
-
e.setState((n) => ({ ...n, view: t }));
|
|
1462
|
-
},
|
|
1463
|
-
setCurrentDate: (t) => {
|
|
1464
|
-
e.setState((n) => ({ ...n, currentDate: t }));
|
|
1465
|
-
},
|
|
1466
|
-
setSelectedDate: (t) => {
|
|
1467
|
-
e.setState((n) => ({ ...n, selectedDate: t }));
|
|
1468
|
-
},
|
|
1469
|
-
setSelectedEventId: (t) => {
|
|
1470
|
-
e.setState((n) => ({ ...n, selectedEventId: t }));
|
|
1471
|
-
},
|
|
1472
|
-
setSlotDuration: (t) => {
|
|
1473
|
-
e.setState((n) => ({ ...n, slotDuration: t }));
|
|
1474
|
-
},
|
|
1475
|
-
setIs24Hour: (t) => {
|
|
1476
|
-
e.setState((n) => ({ ...n, is24Hour: t }));
|
|
1477
|
-
}
|
|
1478
|
-
}), we = {
|
|
1479
|
-
events: /* @__PURE__ */ new Map(),
|
|
1480
|
-
resources: /* @__PURE__ */ new Map()
|
|
1481
|
-
};
|
|
1482
|
-
class no {
|
|
1483
|
-
name = "SchedulerService";
|
|
1484
|
-
constructor(t = []) {
|
|
1485
|
-
this.initializeWithData(t);
|
|
1486
|
-
}
|
|
1487
|
-
/**
|
|
1488
|
-
* Initializes the service.
|
|
1489
|
-
* @group Methods
|
|
1490
|
-
*/
|
|
1491
|
-
async init() {
|
|
1492
|
-
console.log("[SchedulerService] Initialized");
|
|
1493
|
-
}
|
|
1494
|
-
/**
|
|
1495
|
-
* Cleans up the service.
|
|
1496
|
-
* @group Methods
|
|
1497
|
-
*/
|
|
1498
|
-
async cleanup() {
|
|
1499
|
-
}
|
|
1500
|
-
/**
|
|
1501
|
-
* Seeds the mock database with initial data.
|
|
1502
|
-
* @param events Initial events
|
|
1503
|
-
* @param resources Initial resources
|
|
1504
|
-
* @group Methods
|
|
1505
|
-
*/
|
|
1506
|
-
initializeWithData(t, n = []) {
|
|
1507
|
-
we.events.clear(), we.resources.clear(), t.forEach((r) => {
|
|
1508
|
-
we.events.set(String(r.id), JSON.parse(JSON.stringify(r)));
|
|
1509
|
-
}), n.forEach((r) => {
|
|
1510
|
-
we.resources.set(String(r.id), JSON.parse(JSON.stringify(r)));
|
|
1511
|
-
});
|
|
1512
|
-
}
|
|
1513
|
-
// --- Event Operations ---
|
|
1514
|
-
/**
|
|
1515
|
-
* Retrieves events within a date range.
|
|
1516
|
-
* @param start Start date
|
|
1517
|
-
* @param end End date
|
|
1518
|
-
* @returns Promise resolving to an array of scheduler events
|
|
1519
|
-
* @group Methods
|
|
1520
|
-
*/
|
|
1521
|
-
async getEvents(t, n) {
|
|
1522
|
-
return await this.simulateLatency(), !t || !n ? Array.from(we.events.values()) : Array.from(we.events.values()).filter((a) => {
|
|
1523
|
-
const i = new Date(a.start), l = new Date(a.end);
|
|
1524
|
-
return i >= t && i < n || l > t && l <= n || i <= t && l >= n;
|
|
1525
|
-
}).map((a) => ({
|
|
1526
|
-
...a,
|
|
1527
|
-
start: new Date(a.start),
|
|
1528
|
-
end: new Date(a.end)
|
|
1529
|
-
}));
|
|
1530
|
-
}
|
|
1531
|
-
/**
|
|
1532
|
-
* Adds a new event to the scheduler.
|
|
1533
|
-
* @param event The event to add
|
|
1534
|
-
* @returns Promise resolving to the added event
|
|
1535
|
-
* @group Methods
|
|
1536
|
-
*/
|
|
1537
|
-
async addEvent(t) {
|
|
1538
|
-
await this.simulateLatency();
|
|
1539
|
-
const n = {
|
|
1540
|
-
id: t.id || Math.random().toString(36).substring(2, 9),
|
|
1541
|
-
title: t.title || "Untitled Event",
|
|
1542
|
-
start: t.start || /* @__PURE__ */ new Date(),
|
|
1543
|
-
end: t.end || new Date((/* @__PURE__ */ new Date()).getTime() + 3600 * 1e3),
|
|
1544
|
-
description: t.description,
|
|
1545
|
-
resourceId: t.resourceId,
|
|
1546
|
-
resourceIds: t.resourceIds,
|
|
1547
|
-
allDay: t.allDay || !1,
|
|
1548
|
-
...t
|
|
1549
|
-
};
|
|
1550
|
-
return we.events.set(n.id, n), n;
|
|
1551
|
-
}
|
|
1552
|
-
/**
|
|
1553
|
-
* Updates an existing event.
|
|
1554
|
-
* @param event The event to update
|
|
1555
|
-
* @returns Promise resolving to the updated event
|
|
1556
|
-
* @group Methods
|
|
1557
|
-
*/
|
|
1558
|
-
async updateEvent(t) {
|
|
1559
|
-
console.log("[SchedulerService] Updating event:", t.id, t.start, t.end), await this.simulateLatency();
|
|
1560
|
-
const n = String(t.id);
|
|
1561
|
-
if (we.events.has(n)) {
|
|
1562
|
-
const a = { ...we.events.get(n), ...t, id: n };
|
|
1563
|
-
return we.events.set(n, a), console.log("[SchedulerService] Event updated in DB:", a), a;
|
|
1564
|
-
} else if (we.events.has(t.id)) {
|
|
1565
|
-
const a = { ...we.events.get(t.id), ...t };
|
|
1566
|
-
return we.events.set(t.id, a), a;
|
|
1567
|
-
}
|
|
1568
|
-
throw console.error("[SchedulerService] Event not found in DB:", t.id, "Keys:", Array.from(we.events.keys())), new Error(`Event with ID ${t.id} not found`);
|
|
1569
|
-
}
|
|
1570
|
-
/**
|
|
1571
|
-
* Deletes an event by ID.
|
|
1572
|
-
* @param id The ID of the event to delete
|
|
1573
|
-
* @returns Promise void
|
|
1574
|
-
* @group Methods
|
|
1575
|
-
*/
|
|
1576
|
-
async deleteEvent(t) {
|
|
1577
|
-
await this.simulateLatency();
|
|
1578
|
-
const n = String(t);
|
|
1579
|
-
we.events.has(n) ? we.events.delete(n) : we.events.has(t) && we.events.delete(t);
|
|
1580
|
-
}
|
|
1581
|
-
// --- Resource Operations ---
|
|
1582
|
-
/**
|
|
1583
|
-
* Retrieves all resources.
|
|
1584
|
-
* @returns Promise resolving to an array of resources
|
|
1585
|
-
* @group Methods
|
|
1586
|
-
*/
|
|
1587
|
-
async getResources() {
|
|
1588
|
-
return await this.simulateLatency(), Array.from(we.resources.values());
|
|
1589
|
-
}
|
|
1590
|
-
/**
|
|
1591
|
-
* Adds a new resource.
|
|
1592
|
-
* @param resource The resource to add
|
|
1593
|
-
* @returns Promise resolving to the added resource
|
|
1594
|
-
* @group Methods
|
|
1595
|
-
*/
|
|
1596
|
-
async addResource(t) {
|
|
1597
|
-
return await this.simulateLatency(), t.id || (t.id = Math.random().toString(36).substring(2, 9)), we.resources.set(t.id, t), t;
|
|
1598
|
-
}
|
|
1599
|
-
simulateLatency() {
|
|
1600
|
-
return new Promise((t) => setTimeout(t, 300));
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
class ro {
|
|
1604
|
-
name = "RecurrenceEngine";
|
|
1605
|
-
expandEvents(t, n, r) {
|
|
1606
|
-
const a = [];
|
|
1607
|
-
return t.forEach((i) => {
|
|
1608
|
-
if (i.recurrenceRule || i.rrule)
|
|
1609
|
-
try {
|
|
1610
|
-
const l = i.recurrenceRule || i.rrule || "";
|
|
1611
|
-
if (!l) return;
|
|
1612
|
-
const d = new Date(i.start), m = new Date(i.end), p = mn.parseString(l);
|
|
1613
|
-
p.dtstart = d;
|
|
1614
|
-
const s = new mn(p).between(n, r, !0), N = /* @__PURE__ */ new Set();
|
|
1615
|
-
i.exdate && Array.isArray(i.exdate) ? i.exdate.forEach((g) => {
|
|
1616
|
-
const h = new Date(g).getTime();
|
|
1617
|
-
isNaN(h) || N.add(h);
|
|
1618
|
-
}) : typeof i.recurrenceException == "string" && i.recurrenceException.split(",").forEach((g) => {
|
|
1619
|
-
const h = new Date(g).getTime();
|
|
1620
|
-
isNaN(h) || N.add(h);
|
|
1621
|
-
}), s.forEach((g) => {
|
|
1622
|
-
if (N.has(g.getTime())) return;
|
|
1623
|
-
const h = m.getTime() - d.getTime();
|
|
1624
|
-
if (isNaN(h)) return;
|
|
1625
|
-
const _ = new Date(g.getTime() + h);
|
|
1626
|
-
a.push({
|
|
1627
|
-
...i,
|
|
1628
|
-
id: `${i.id}-${g.getTime()}`,
|
|
1629
|
-
// Synthetic ID for valid key
|
|
1630
|
-
recurrenceId: String(i.id),
|
|
1631
|
-
start: g,
|
|
1632
|
-
end: _,
|
|
1633
|
-
originalStart: d
|
|
1634
|
-
});
|
|
1635
|
-
});
|
|
1636
|
-
} catch (l) {
|
|
1637
|
-
console.error(`Error processing recurrence rule for event ${i.id}:`, l), a.push(i);
|
|
1638
|
-
}
|
|
1639
|
-
else
|
|
1640
|
-
a.push(i);
|
|
1641
|
-
}), a;
|
|
1642
|
-
}
|
|
1643
|
-
cleanup() {
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
const ao = (e, t, n) => {
|
|
1647
|
-
const r = ar(), {
|
|
1648
|
-
events: a,
|
|
1649
|
-
serviceRegistry: i = r,
|
|
1650
|
-
showWeekend: l = !0,
|
|
1651
|
-
recurrenceEngine: d,
|
|
1652
|
-
onEventCreate: m,
|
|
1653
|
-
onEventChange: p,
|
|
1654
|
-
onEventDelete: u
|
|
1655
|
-
} = e, s = dr(), N = it(
|
|
1656
|
-
i,
|
|
1657
|
-
"SchedulerService",
|
|
1658
|
-
() => new no(a || [])
|
|
1659
|
-
), g = d || it(
|
|
1660
|
-
i,
|
|
1661
|
-
"RecurrenceEngine",
|
|
1662
|
-
() => new ro()
|
|
1663
|
-
);
|
|
1664
|
-
_e(() => {
|
|
1665
|
-
a && a.length > 0 && (N.initializeWithData(a), s.invalidateQueries({ queryKey: ["scheduler-events"] }));
|
|
1666
|
-
}, [a, N, s]);
|
|
1667
|
-
const h = ze(() => {
|
|
1668
|
-
let k, M;
|
|
1669
|
-
if (t === "day" || t === "timeline-day")
|
|
1670
|
-
k = Le(n), M = Ht(n);
|
|
1671
|
-
else if (t === "month" || t === "timeline-month")
|
|
1672
|
-
k = t === "month" ? st(bn(n), { weekStartsOn: 0 }) : bn(n), M = t === "month" ? wn(pn(n), { weekStartsOn: 0 }) : pn(n);
|
|
1673
|
-
else if (t === "week" || t === "workweek" || t === "timeline-week") {
|
|
1674
|
-
const S = st(n, { weekStartsOn: 0 });
|
|
1675
|
-
k = t === "workweek" ? vt(S, 1) : S, M = t === "workweek" ? vt(S, 5) : wn(n, { weekStartsOn: 0 });
|
|
1676
|
-
} else
|
|
1677
|
-
k = Le(n), M = Ht(n);
|
|
1678
|
-
try {
|
|
1679
|
-
const S = Jr({ start: k, end: M });
|
|
1680
|
-
return l ? S : S.filter((K) => {
|
|
1681
|
-
const G = K.getDay();
|
|
1682
|
-
return G !== 0 && G !== 6;
|
|
1683
|
-
});
|
|
1684
|
-
} catch {
|
|
1685
|
-
return [n];
|
|
1686
|
-
}
|
|
1687
|
-
}, [t, n, l]), _ = h.length > 0 ? Le(h[0]) : /* @__PURE__ */ new Date(), z = h.length > 0 ? Ht(h[h.length - 1]) : /* @__PURE__ */ new Date(), { data: $ = [] } = ur({
|
|
1688
|
-
queryKey: ["scheduler-events", _.toISOString(), z.toISOString()],
|
|
1689
|
-
queryFn: () => N.getEvents(_, z),
|
|
1690
|
-
// If props.events are provided, we can use them as placeholder,
|
|
1691
|
-
// but typically the service.initializeWithData handles the seed.
|
|
1692
|
-
placeholderData: a || []
|
|
1693
|
-
// staleTime: 5000 // Optional: Cache for 5s
|
|
1694
|
-
}), D = ze(() => h.length === 0 ? [] : g.expandEvents($, _, z), [$, h, g, _, z]), B = ze(() => h.length ? D.filter(
|
|
1695
|
-
(k) => En(k.start, { start: _, end: z }) || En(k.end, { start: _, end: z }) || k.start < _ && k.end > z
|
|
1696
|
-
) : [], [D, h, _, z]), F = zt({
|
|
1697
|
-
mutationFn: async (k) => {
|
|
1698
|
-
const M = await N.addEvent(k);
|
|
1699
|
-
return m && await m(M), M;
|
|
1700
|
-
},
|
|
1701
|
-
onMutate: async (k) => {
|
|
1702
|
-
const M = ["scheduler-events", _.toISOString(), z.toISOString()];
|
|
1703
|
-
await s.cancelQueries({ queryKey: M });
|
|
1704
|
-
const S = s.getQueryData(M);
|
|
1705
|
-
return s.setQueryData(M, (K = []) => {
|
|
1706
|
-
const G = {
|
|
1707
|
-
...k,
|
|
1708
|
-
id: k.id || Date.now().toString(),
|
|
1709
|
-
start: k.start || /* @__PURE__ */ new Date(),
|
|
1710
|
-
end: k.end || /* @__PURE__ */ new Date()
|
|
1711
|
-
};
|
|
1712
|
-
return [...K, G];
|
|
1713
|
-
}), { previousEvents: S, queryKey: M };
|
|
1714
|
-
},
|
|
1715
|
-
onError: (k, M, S) => {
|
|
1716
|
-
S?.previousEvents && s.setQueryData(S.queryKey, S.previousEvents);
|
|
1717
|
-
},
|
|
1718
|
-
onSettled: () => {
|
|
1719
|
-
s.invalidateQueries({ queryKey: ["scheduler-events"] });
|
|
1720
|
-
}
|
|
1721
|
-
}), ae = zt({
|
|
1722
|
-
mutationFn: async (k) => {
|
|
1723
|
-
const M = await N.updateEvent(k);
|
|
1724
|
-
return p && await p(M), M;
|
|
1725
|
-
},
|
|
1726
|
-
onMutate: async (k) => {
|
|
1727
|
-
const M = ["scheduler-events", _.toISOString(), z.toISOString()];
|
|
1728
|
-
await s.cancelQueries({ queryKey: M });
|
|
1729
|
-
const S = s.getQueryData(M);
|
|
1730
|
-
return s.setQueryData(M, (K = []) => K.map((G) => G.id === k.id ? k : G)), { previousEvents: S, queryKey: M };
|
|
1731
|
-
},
|
|
1732
|
-
onError: (k, M, S) => {
|
|
1733
|
-
S?.previousEvents && s.setQueryData(S.queryKey, S.previousEvents);
|
|
1734
|
-
},
|
|
1735
|
-
onSettled: () => {
|
|
1736
|
-
s.invalidateQueries({ queryKey: ["scheduler-events"] });
|
|
1737
|
-
}
|
|
1738
|
-
}), x = zt({
|
|
1739
|
-
mutationFn: async (k) => (await N.deleteEvent(k), u && await u(k.toString()), k),
|
|
1740
|
-
onMutate: async (k) => {
|
|
1741
|
-
const M = ["scheduler-events", _.toISOString(), z.toISOString()];
|
|
1742
|
-
await s.cancelQueries({ queryKey: M });
|
|
1743
|
-
const S = s.getQueryData(M);
|
|
1744
|
-
return s.setQueryData(M, (K = []) => K.filter((G) => G.id !== k)), { previousEvents: S, queryKey: M };
|
|
1745
|
-
},
|
|
1746
|
-
onError: (k, M, S) => {
|
|
1747
|
-
S?.previousEvents && s.setQueryData(S.queryKey, S.previousEvents);
|
|
1748
|
-
},
|
|
1749
|
-
onSettled: () => {
|
|
1750
|
-
s.invalidateQueries({ queryKey: ["scheduler-events"] });
|
|
1751
|
-
}
|
|
1752
|
-
});
|
|
1753
|
-
return {
|
|
1754
|
-
schedulerService: N,
|
|
1755
|
-
recurrenceEngine: g,
|
|
1756
|
-
daysInView: h,
|
|
1757
|
-
visibleEvents: B,
|
|
1758
|
-
allEvents: $,
|
|
1759
|
-
addEvent: F.mutateAsync,
|
|
1760
|
-
updateEvent: ae.mutateAsync,
|
|
1761
|
-
deleteEvent: x.mutateAsync,
|
|
1762
|
-
isUpdating: F.isPending || ae.isPending || x.isPending
|
|
1763
|
-
};
|
|
1764
|
-
}, oo = (e) => {
|
|
1765
|
-
const { overscanCount: t = 2, startHour: n = "00:00", endHour: r = "24:00" } = e, a = parseInt(n.split(":")[0], 10), i = parseInt(r.split(":")[0], 10), d = 60 / (e.slotDuration || 30), m = Math.max(1, (i - a) * d), { rowVirtualizer: p, columnVirtualizer: u, parentRef: s } = Tr({
|
|
1766
|
-
// Row Config
|
|
1767
|
-
rowCount: m,
|
|
1768
|
-
rowHeight: 64,
|
|
1769
|
-
// Standard slot height
|
|
1770
|
-
overscanCount: t,
|
|
1771
|
-
progressiveRendering: e.progressiveRendering,
|
|
1772
|
-
prefetchDistance: e.prefetchDistance,
|
|
1773
|
-
// Column Config (for Timeline views)
|
|
1774
|
-
enableColumnVirtualization: e.view?.startsWith("timeline"),
|
|
1775
|
-
columnCount: e.view?.startsWith("timeline") ? m : 0,
|
|
1776
|
-
columnWidth: 100,
|
|
1777
|
-
// Standard column width
|
|
1778
|
-
id: e.id,
|
|
1779
|
-
debug: e.debugVirtualization,
|
|
1780
|
-
onScrollStart: () => {
|
|
1781
|
-
e.virtualScrollStart && e.virtualScrollStart({ virtualizer: {} });
|
|
1782
|
-
},
|
|
1783
|
-
onScrollStop: () => {
|
|
1784
|
-
e.virtualScrollStop && e.virtualScrollStop({ virtualizer: {} });
|
|
1785
|
-
}
|
|
1786
|
-
});
|
|
1787
|
-
return {
|
|
1788
|
-
parentRef: s,
|
|
1789
|
-
rowVirtualizer: p,
|
|
1790
|
-
columnVirtualizer: u
|
|
1791
|
-
};
|
|
1792
|
-
}, io = (e, t, n, r) => {
|
|
1793
|
-
const a = (m) => {
|
|
1794
|
-
t(m), r?.(m);
|
|
1795
|
-
};
|
|
1796
|
-
return { next: () => {
|
|
1797
|
-
let m = e;
|
|
1798
|
-
n === "day" || n === "timeline-day" ? m = vt(e, 1) : n === "week" || n === "workweek" || n === "timeline-week" ? m = Un(e, 1) : (n === "month" || n === "timeline-month") && (m = Wn(e, 1)), a(m);
|
|
1799
|
-
}, prev: () => {
|
|
1800
|
-
let m = e;
|
|
1801
|
-
n === "day" || n === "timeline-day" ? m = Ka(e) : n === "week" || n === "workweek" || n === "timeline-week" ? m = Za(e) : (n === "month" || n === "timeline-month") && (m = Ja(e)), a(m);
|
|
1802
|
-
}, today: () => {
|
|
1803
|
-
a(/* @__PURE__ */ new Date());
|
|
1804
|
-
} };
|
|
1805
|
-
};
|
|
1806
|
-
class so extends or {
|
|
1807
|
-
name = "HistoryService";
|
|
1808
|
-
undoStack = [];
|
|
1809
|
-
redoStack = [];
|
|
1810
|
-
maxHistorySize = 50;
|
|
1811
|
-
constructor() {
|
|
1812
|
-
super({ canUndo: !1, canRedo: !1 });
|
|
1813
|
-
}
|
|
1814
|
-
/**
|
|
1815
|
-
* Records an action for potential undo
|
|
1816
|
-
*/
|
|
1817
|
-
record(t) {
|
|
1818
|
-
const n = {
|
|
1819
|
-
...t,
|
|
1820
|
-
timestamp: Date.now()
|
|
1821
|
-
};
|
|
1822
|
-
this.undoStack.push(n), this.undoStack.length > this.maxHistorySize && this.undoStack.shift(), this.redoStack = [], this.updateState();
|
|
1823
|
-
}
|
|
1824
|
-
undo() {
|
|
1825
|
-
if (this.undoStack.length === 0) return null;
|
|
1826
|
-
const t = this.undoStack.pop();
|
|
1827
|
-
return this.redoStack.push(t), this.updateState(), t;
|
|
1828
|
-
}
|
|
1829
|
-
redo() {
|
|
1830
|
-
if (this.redoStack.length === 0) return null;
|
|
1831
|
-
const t = this.redoStack.pop();
|
|
1832
|
-
return this.undoStack.push(t), this.updateState(), t;
|
|
1833
|
-
}
|
|
1834
|
-
clear() {
|
|
1835
|
-
this.undoStack = [], this.redoStack = [], this.updateState();
|
|
1836
|
-
}
|
|
1837
|
-
updateState() {
|
|
1838
|
-
this.setState({
|
|
1839
|
-
canUndo: this.undoStack.length > 0,
|
|
1840
|
-
canRedo: this.redoStack.length > 0
|
|
1841
|
-
});
|
|
1842
|
-
}
|
|
1843
|
-
cleanup() {
|
|
1844
|
-
this.clear(), super.cleanup();
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
class co {
|
|
1848
|
-
name = "SearchService";
|
|
1849
|
-
search(t, n, r = {}) {
|
|
1850
|
-
if (!n || !n.trim()) return t;
|
|
1851
|
-
const a = r.matchCase ? n : n.toLowerCase(), i = r.fields || ["title", "description", "location"];
|
|
1852
|
-
return t.filter((l) => i.some((d) => {
|
|
1853
|
-
const m = l[d];
|
|
1854
|
-
return typeof m != "string" ? !1 : r.matchCase ? m.includes(a) : m.toLowerCase().includes(a);
|
|
1855
|
-
}));
|
|
1856
|
-
}
|
|
1857
|
-
cleanup() {
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
class lo {
|
|
1861
|
-
name = "TimezoneService";
|
|
1862
|
-
constructor() {
|
|
1863
|
-
}
|
|
1864
|
-
/**
|
|
1865
|
-
* Converts a date to a specific timezone
|
|
1866
|
-
* @param date Date object
|
|
1867
|
-
* @param timeZone Target time zone (e.g., 'America/New_York')
|
|
1868
|
-
*/
|
|
1869
|
-
toTimezone(t, n) {
|
|
1870
|
-
if (!n || n === "UTC" || n === "Local")
|
|
1871
|
-
return new Date(t);
|
|
1872
|
-
try {
|
|
1873
|
-
const a = new Date(t).toLocaleString("en-US", { timeZone: n });
|
|
1874
|
-
return new Date(a);
|
|
1875
|
-
} catch (r) {
|
|
1876
|
-
return console.warn(`TimezoneService: Invalid timezone ${n}`, r), new Date(t);
|
|
1877
|
-
}
|
|
1878
|
-
}
|
|
1879
|
-
/**
|
|
1880
|
-
* Formats a date in a specific timezone
|
|
1881
|
-
*/
|
|
1882
|
-
formatInTimezone(t, n, r) {
|
|
1883
|
-
try {
|
|
1884
|
-
return new Intl.DateTimeFormat("en-US", {
|
|
1885
|
-
...r,
|
|
1886
|
-
timeZone: n
|
|
1887
|
-
}).format(new Date(t));
|
|
1888
|
-
} catch (a) {
|
|
1889
|
-
return console.error("TimezoneService formatting error:", a), "";
|
|
1890
|
-
}
|
|
1891
|
-
}
|
|
1892
|
-
/**
|
|
1893
|
-
* Get local browser timezone name
|
|
1894
|
-
*/
|
|
1895
|
-
getLocalTimezone() {
|
|
1896
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1897
|
-
}
|
|
1898
|
-
cleanup() {
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
class uo {
|
|
1902
|
-
name = "AttendeeService";
|
|
1903
|
-
constructor() {
|
|
1904
|
-
}
|
|
1905
|
-
/**
|
|
1906
|
-
* Validates attendee email format
|
|
1907
|
-
*/
|
|
1908
|
-
isValidEmail(t) {
|
|
1909
|
-
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t);
|
|
1910
|
-
}
|
|
1911
|
-
/**
|
|
1912
|
-
* Format status for display
|
|
1913
|
-
*/
|
|
1914
|
-
getStatusLabel(t) {
|
|
1915
|
-
switch (t) {
|
|
1916
|
-
case "accepted":
|
|
1917
|
-
return "Accepted";
|
|
1918
|
-
case "declined":
|
|
1919
|
-
return "Declined";
|
|
1920
|
-
case "tentative":
|
|
1921
|
-
return "Tentative";
|
|
1922
|
-
case "needs-action":
|
|
1923
|
-
return "Needs Action";
|
|
1924
|
-
default:
|
|
1925
|
-
return "Unknown";
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
cleanup() {
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
class fo {
|
|
1932
|
-
name = "ReminderService";
|
|
1933
|
-
timer = null;
|
|
1934
|
-
checkInterval = 6e4;
|
|
1935
|
-
// Check every minute
|
|
1936
|
-
onReminderTriggered;
|
|
1937
|
-
constructor() {
|
|
1938
|
-
}
|
|
1939
|
-
start(t) {
|
|
1940
|
-
this.onReminderTriggered = t, this.timer && clearInterval(this.timer), this.timer = setInterval(() => this.checkReminders(), this.checkInterval);
|
|
1941
|
-
}
|
|
1942
|
-
stop() {
|
|
1943
|
-
this.timer && (clearInterval(this.timer), this.timer = null);
|
|
1944
|
-
}
|
|
1945
|
-
checkReminders() {
|
|
1946
|
-
console.log("[ReminderService] Checking for due reminders...", this.onReminderTriggered);
|
|
1947
|
-
}
|
|
1948
|
-
/**
|
|
1949
|
-
* Calculates trigger time for a reminder
|
|
1950
|
-
*/
|
|
1951
|
-
getTriggerTime(t, n) {
|
|
1952
|
-
return new Date(t.getTime() - n * 6e4);
|
|
1953
|
-
}
|
|
1954
|
-
cleanup() {
|
|
1955
|
-
this.stop();
|
|
1956
|
-
}
|
|
1957
|
-
}
|
|
1958
|
-
const mo = (e) => {
|
|
1959
|
-
const t = ir(e), { serviceRegistry: n, state: r, api: a } = t, l = Ir("I18nService")?.dir || "ltr", m = e.dir === "auto" || !e.dir ? l : e.dir, p = ze(() => eo({
|
|
1960
|
-
events: e.events || [],
|
|
1961
|
-
resources: e.resources || [],
|
|
1962
|
-
view: e.view ? e.view.toLowerCase() : "week",
|
|
1963
|
-
currentDate: e.selectedDate || /* @__PURE__ */ new Date(),
|
|
1964
|
-
selectedDate: e.selectedDate || /* @__PURE__ */ new Date(),
|
|
1965
|
-
slotDuration: e.slotDuration || 30,
|
|
1966
|
-
is24Hour: e.is24Hour ?? !0
|
|
1967
|
-
}), []), u = ze(() => to(p), [p]), s = cr(p, (H) => H);
|
|
1968
|
-
_e(() => {
|
|
1969
|
-
e.events && u.setEvents(e.events);
|
|
1970
|
-
}, [e.events]), _e(() => {
|
|
1971
|
-
e.resources && u.setResources(e.resources);
|
|
1972
|
-
}, [e.resources]), _e(() => {
|
|
1973
|
-
if (e.view) {
|
|
1974
|
-
const H = e.view.toLowerCase().replace(/[^a-z]/g, ""), R = {
|
|
1975
|
-
day: "day",
|
|
1976
|
-
week: "week",
|
|
1977
|
-
workweek: "workweek",
|
|
1978
|
-
month: "month",
|
|
1979
|
-
timelineday: "timeline-day",
|
|
1980
|
-
timelineweek: "timeline-week",
|
|
1981
|
-
timelineworkweek: "timeline-week",
|
|
1982
|
-
timelinemonth: "timeline-month",
|
|
1983
|
-
agenda: "agenda",
|
|
1984
|
-
timeline: "timeline-day"
|
|
1985
|
-
};
|
|
1986
|
-
u.setView(R[H] || H);
|
|
1987
|
-
}
|
|
1988
|
-
}, [e.view, u]), _e(() => {
|
|
1989
|
-
e.selectedDate && (u.setCurrentDate(e.selectedDate), u.setSelectedDate(e.selectedDate));
|
|
1990
|
-
}, [e.selectedDate]), _e(() => {
|
|
1991
|
-
e.slotDuration !== void 0 && u.setSlotDuration(e.slotDuration);
|
|
1992
|
-
}, [e.slotDuration]), _e(() => {
|
|
1993
|
-
e.is24Hour !== void 0 && u.setIs24Hour(e.is24Hour);
|
|
1994
|
-
}, [e.is24Hour]);
|
|
1995
|
-
const { view: N, currentDate: g, events: h } = s, {
|
|
1996
|
-
schedulerService: _,
|
|
1997
|
-
recurrenceEngine: z,
|
|
1998
|
-
daysInView: $,
|
|
1999
|
-
visibleEvents: D,
|
|
2000
|
-
allEvents: B,
|
|
2001
|
-
addEvent: F,
|
|
2002
|
-
updateEvent: ae,
|
|
2003
|
-
deleteEvent: x,
|
|
2004
|
-
isUpdating: k
|
|
2005
|
-
} = ao({ ...e, events: h }, N, g), {
|
|
2006
|
-
parentRef: M,
|
|
2007
|
-
rowVirtualizer: S,
|
|
2008
|
-
columnVirtualizer: K
|
|
2009
|
-
} = oo(e), { next: G, prev: j, today: De } = io(
|
|
2010
|
-
g,
|
|
2011
|
-
u.setCurrentDate,
|
|
2012
|
-
N,
|
|
2013
|
-
e.onDateChange
|
|
2014
|
-
), [X, ne] = Re(null), { selectedIndex: Me, setSelectedIndex: fe } = Br({
|
|
2015
|
-
totalItems: D.length,
|
|
2016
|
-
enabled: !0,
|
|
2017
|
-
onSelect: (H) => {
|
|
2018
|
-
const R = D[H];
|
|
2019
|
-
R && (ne(R.id), (document.getElementById(`event-${R.id}`) || document.querySelector(`[data-event-id="${R.id}"]`))?.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
2020
|
-
},
|
|
2021
|
-
onAction: (H) => {
|
|
2022
|
-
const R = D[H];
|
|
2023
|
-
R && e.onEventClick && e.onEventClick(R);
|
|
2024
|
-
}
|
|
2025
|
-
}), ve = ze(() => ({
|
|
2026
|
-
showWeekend: e.showWeekend ?? !0,
|
|
2027
|
-
timeFormat: e.timeFormat,
|
|
2028
|
-
weekRule: e.weekRule || "FirstDay",
|
|
2029
|
-
monthsCount: e.monthsCount || 1,
|
|
2030
|
-
eventDragArea: e.eventDragArea,
|
|
2031
|
-
dir: m || "ltr"
|
|
2032
|
-
}), [e.showWeekend, e.timeFormat, e.weekRule, e.monthsCount, e.eventDragArea, m]), se = it(n, "HistoryService", () => new so()), de = it(n, "SearchService", () => new co()), Z = it(n, "TimezoneService", () => new lo()), me = it(n, "AttendeeService", () => new uo()), ee = it(n, "ReminderService", () => new fo());
|
|
2033
|
-
return {
|
|
2034
|
-
/**
|
|
2035
|
-
* Namespaced state properties
|
|
2036
|
-
* @group State
|
|
2037
|
-
*/
|
|
2038
|
-
state: {
|
|
2039
|
-
currentView: s.view,
|
|
2040
|
-
selectedDate: s.selectedDate,
|
|
2041
|
-
currentDate: g,
|
|
2042
|
-
events: s.events,
|
|
2043
|
-
resources: s.resources,
|
|
2044
|
-
viewEvents: D,
|
|
2045
|
-
daysInView: $,
|
|
2046
|
-
allEvents: B,
|
|
2047
|
-
slotDuration: s.slotDuration,
|
|
2048
|
-
is24Hour: s.is24Hour,
|
|
2049
|
-
isUpdating: k,
|
|
2050
|
-
selectedIndex: Me,
|
|
2051
|
-
highlightedEventId: X
|
|
2052
|
-
},
|
|
2053
|
-
/**
|
|
2054
|
-
* Namespaced action methods
|
|
2055
|
-
* @group Actions
|
|
2056
|
-
*/
|
|
2057
|
-
actions: {
|
|
2058
|
-
nextPeriod: G,
|
|
2059
|
-
prevPeriod: j,
|
|
2060
|
-
today: De,
|
|
2061
|
-
setView: u.setView,
|
|
2062
|
-
setDate: u.setSelectedDate,
|
|
2063
|
-
setCurrentDate: u.setCurrentDate,
|
|
2064
|
-
addEvent: F,
|
|
2065
|
-
updateEvent: ae,
|
|
2066
|
-
deleteEvent: x,
|
|
2067
|
-
setSlotDuration: u.setSlotDuration,
|
|
2068
|
-
setIs24Hour: u.setIs24Hour,
|
|
2069
|
-
setSelectedIndex: fe,
|
|
2070
|
-
setHighlightedEventId: ne
|
|
2071
|
-
},
|
|
2072
|
-
/**
|
|
2073
|
-
* Namespaced core services
|
|
2074
|
-
* @group Services
|
|
2075
|
-
*/
|
|
2076
|
-
services: {
|
|
2077
|
-
schedulerService: _,
|
|
2078
|
-
recurrenceEngine: z,
|
|
2079
|
-
historyService: se,
|
|
2080
|
-
searchService: de,
|
|
2081
|
-
timezoneService: Z,
|
|
2082
|
-
attendeeService: me,
|
|
2083
|
-
reminderService: ee,
|
|
2084
|
-
serviceRegistry: n
|
|
2085
|
-
},
|
|
2086
|
-
/**
|
|
2087
|
-
* Scheduler configuration properties
|
|
2088
|
-
* @group Config
|
|
2089
|
-
*/
|
|
2090
|
-
config: ve,
|
|
2091
|
-
/**
|
|
2092
|
-
* DOM and component references
|
|
2093
|
-
* @group Refs
|
|
2094
|
-
*/
|
|
2095
|
-
refs: {
|
|
2096
|
-
parentRef: M,
|
|
2097
|
-
rowVirtualizer: S,
|
|
2098
|
-
columnVirtualizer: K
|
|
2099
|
-
},
|
|
2100
|
-
// --- Base API ---
|
|
2101
|
-
baseState: r,
|
|
2102
|
-
baseApi: a,
|
|
2103
|
-
dir: m
|
|
2104
|
-
};
|
|
2105
|
-
}, ho = (e, t, n, r, a, i, l = {}) => {
|
|
2106
|
-
const d = ze(() => {
|
|
2107
|
-
const m = fr(a.scrollToIndex), p = pr(
|
|
2108
|
-
() => n.getEvents(),
|
|
2109
|
-
(g) => n.addEvent(g),
|
|
2110
|
-
(g) => n.updateEvent(g),
|
|
2111
|
-
(g) => n.deleteEvent(g)
|
|
2112
|
-
), u = mr(a.showSpinner, a.hideSpinner), s = hr(() => {
|
|
2113
|
-
}, a.forceUpdate), N = gr(
|
|
2114
|
-
() => l.onExportExcel?.(r),
|
|
2115
|
-
() => l.onExportICS?.(r),
|
|
2116
|
-
() => {
|
|
2117
|
-
window.print();
|
|
2118
|
-
}
|
|
2119
|
-
);
|
|
2120
|
-
return {
|
|
2121
|
-
// Navigation
|
|
2122
|
-
changeView: a.changeView,
|
|
2123
|
-
changeCurrentView: a.changeView,
|
|
2124
|
-
next: a.next,
|
|
2125
|
-
prev: a.prev,
|
|
2126
|
-
today: a.today,
|
|
2127
|
-
...m,
|
|
2128
|
-
scrollTo: (g, h = 0) => {
|
|
2129
|
-
const z = parseInt(g.split(":")[0]) * 60 + h, D = Math.floor(z / 30);
|
|
2130
|
-
a.scrollToIndex(D);
|
|
2131
|
-
},
|
|
2132
|
-
scrollToTime: (g, h) => {
|
|
2133
|
-
const _ = g * 60 + h, $ = Math.floor(_ / 30);
|
|
2134
|
-
a.scrollToIndex($);
|
|
2135
|
-
},
|
|
2136
|
-
// DataOperations
|
|
2137
|
-
...p,
|
|
2138
|
-
getEvents: async () => n.getEvents(),
|
|
2139
|
-
getEventsInDateRange: async (g, h) => n.getEvents(g, h),
|
|
2140
|
-
addEvent: async (g) => {
|
|
2141
|
-
await n.addEvent(g);
|
|
2142
|
-
},
|
|
2143
|
-
saveEvent: async (g) => {
|
|
2144
|
-
await n.updateEvent(g);
|
|
2145
|
-
},
|
|
2146
|
-
deleteEvent: async (g) => {
|
|
2147
|
-
await n.deleteEvent(g);
|
|
2148
|
-
},
|
|
2149
|
-
getCurrentViewEvents: () => r,
|
|
2150
|
-
addResource: async (g) => {
|
|
2151
|
-
a.setResources((h) => [...h, g]);
|
|
2152
|
-
},
|
|
2153
|
-
removeResource: async (g) => {
|
|
2154
|
-
a.setResources((h) => h.filter((_) => _.id !== g));
|
|
2155
|
-
},
|
|
2156
|
-
// Editor
|
|
2157
|
-
openEditor: (g, h = "Add") => {
|
|
2158
|
-
a.setEditorState({
|
|
2159
|
-
isOpen: !0,
|
|
2160
|
-
mode: h === "Edit" ? "edit" : h === "view" ? "view" : "create",
|
|
2161
|
-
event: g
|
|
2162
|
-
});
|
|
2163
|
-
},
|
|
2164
|
-
closeEditor: () => a.setEditorState({ isOpen: !1, mode: "create", event: void 0 }),
|
|
2165
|
-
closeQuickInfoPopup: a.closeQuickInfoPopup,
|
|
2166
|
-
// Spinner
|
|
2167
|
-
...u,
|
|
2168
|
-
// Core
|
|
2169
|
-
...s,
|
|
2170
|
-
// Exporting
|
|
2171
|
-
...N,
|
|
2172
|
-
// View State
|
|
2173
|
-
currentView: e,
|
|
2174
|
-
// Extra
|
|
2175
|
-
...l
|
|
2176
|
-
};
|
|
2177
|
-
}, [e, t, r, a, n, l]);
|
|
2178
|
-
vr(i, d);
|
|
2179
|
-
}, go = ({ resources: e }) => {
|
|
2180
|
-
const t = ze(() => !e || e.length === 0 ? [] : "dataSource" in e[0] ? e.flatMap((a) => a.dataSource) : e, [e]), [n, r] = Re(t);
|
|
2181
|
-
return _e(() => {
|
|
2182
|
-
r(t);
|
|
2183
|
-
}, [t]), { resources: t, internalResources: n, setInternalResources: r };
|
|
2184
|
-
}, po = ({
|
|
2185
|
-
events: e,
|
|
2186
|
-
onEventChange: t,
|
|
2187
|
-
slotDuration: n = 30
|
|
2188
|
-
}) => {
|
|
2189
|
-
const r = je((i) => {
|
|
2190
|
-
const { active: l, over: d, delta: m } = i, p = e.find(
|
|
2191
|
-
(s) => s.id === l.id || s.id === (l.data?.current?.eventId || l.data?.current?.id)
|
|
2192
|
-
);
|
|
2193
|
-
if (!p) return;
|
|
2194
|
-
if (l.data?.current?.type?.startsWith("resize-")) {
|
|
2195
|
-
const s = l.data.current.type, N = l.data.current, g = N?.orientation || "vertical", h = N?.pixelsPerSlot || 64, _ = g === "vertical" ? m.y : m.x, z = Math.round(_ / h) * n;
|
|
2196
|
-
if (z === 0) return;
|
|
2197
|
-
if (s === "resize-bottom") {
|
|
2198
|
-
const $ = new Date(p.end.getTime() + z * 60 * 1e3), D = new Date(p.start.getTime() + n * 60 * 1e3), B = $ < D ? D : $;
|
|
2199
|
-
t?.({
|
|
2200
|
-
...p,
|
|
2201
|
-
end: B
|
|
2202
|
-
});
|
|
2203
|
-
} else if (s === "resize-top") {
|
|
2204
|
-
const $ = new Date(p.start.getTime() + z * 60 * 1e3), D = new Date(p.end.getTime() - n * 60 * 1e3), B = $ > D ? D : $;
|
|
2205
|
-
t?.({
|
|
2206
|
-
...p,
|
|
2207
|
-
start: B
|
|
2208
|
-
});
|
|
2209
|
-
}
|
|
2210
|
-
return;
|
|
2211
|
-
}
|
|
2212
|
-
if (typeof d.id == "string" && d.id.startsWith("slot-")) {
|
|
2213
|
-
const s = d.data?.current?.date, N = d.data?.current?.resourceId;
|
|
2214
|
-
if (s) {
|
|
2215
|
-
const g = p.end.getTime() - p.start.getTime(), h = new Date(s), _ = new Date(h.getTime() + g);
|
|
2216
|
-
t?.({
|
|
2217
|
-
...p,
|
|
2218
|
-
start: h,
|
|
2219
|
-
end: _,
|
|
2220
|
-
resourceId: N === "none" ? void 0 : N
|
|
2221
|
-
});
|
|
2222
|
-
}
|
|
2223
|
-
return;
|
|
2224
|
-
}
|
|
2225
|
-
const u = typeof d.id == "string" && d.id.startsWith("header-") ? d.id.replace("header-", "") : null;
|
|
2226
|
-
if (u) {
|
|
2227
|
-
const s = {
|
|
2228
|
-
...p,
|
|
2229
|
-
resourceId: u
|
|
2230
|
-
};
|
|
2231
|
-
t?.(s);
|
|
2232
|
-
}
|
|
2233
|
-
}, [e, t, n]);
|
|
2234
|
-
return {
|
|
2235
|
-
sensors: Dr(
|
|
2236
|
-
Mr(Nr, {
|
|
2237
|
-
activationConstraint: {
|
|
2238
|
-
distance: 8
|
|
2239
|
-
}
|
|
2240
|
-
})
|
|
2241
|
-
),
|
|
2242
|
-
handleDragEnd: r
|
|
2243
|
-
};
|
|
2244
|
-
}, bo = () => /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center min-h-screen p-4", children: /* @__PURE__ */ w("div", { className: "flex flex-col items-center gap-4 max-w-md w-full", children: [
|
|
2245
|
-
/* @__PURE__ */ c("div", { className: "flex items-center justify-center w-16 h-16 rounded-full bg-destructive/10", children: /* @__PURE__ */ c(Sr, { className: "w-8 h-8 text-destructive" }) }),
|
|
2246
|
-
/* @__PURE__ */ w("div", { className: "flex flex-col items-center gap-2 text-center", children: [
|
|
2247
|
-
/* @__PURE__ */ c("h2", { className: "text-lg font-semibold", children: "Scheduler Error" }),
|
|
2248
|
-
/* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Something went wrong with the scheduler. Please refresh the page or try again." })
|
|
2249
|
-
] }),
|
|
2250
|
-
/* @__PURE__ */ w(
|
|
2251
|
-
"button",
|
|
2252
|
-
{
|
|
2253
|
-
onClick: () => window.location.reload(),
|
|
2254
|
-
className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/10 rounded-md transition-colors",
|
|
2255
|
-
children: [
|
|
2256
|
-
/* @__PURE__ */ c(Er, { className: "w-4 h-4" }),
|
|
2257
|
-
"Refresh Page"
|
|
2258
|
-
]
|
|
2259
|
-
}
|
|
2260
|
-
)
|
|
2261
|
-
] }) }), wo = ({
|
|
2262
|
-
variant: e = "primary",
|
|
2263
|
-
text: t = "Loading",
|
|
2264
|
-
className: n
|
|
2265
|
-
}) => {
|
|
2266
|
-
const r = "absolute inset-0 bg-background/40 backdrop-blur-[2px] z-[100] flex items-center justify-center transition-all duration-300", a = {
|
|
2267
|
-
md: "w-10 h-10"
|
|
2268
|
-
}, i = {
|
|
2269
|
-
primary: "border-primary/20 border-t-primary",
|
|
2270
|
-
secondary: "border-muted-foreground/20 border-t-muted-foreground"
|
|
2271
|
-
};
|
|
2272
|
-
return /* @__PURE__ */ c("div", { className: V(r, n), children: /* @__PURE__ */ w("div", { className: "flex flex-col items-center gap-3", children: [
|
|
2273
|
-
/* @__PURE__ */ c("div", { className: V(
|
|
2274
|
-
a.md,
|
|
2275
|
-
i[e],
|
|
2276
|
-
"rounded-full animate-spin"
|
|
2277
|
-
) }),
|
|
2278
|
-
/* @__PURE__ */ c("span", { className: "text-[10px] font-black uppercase tracking-widest text-primary animate-pulse", children: t })
|
|
2279
|
-
] }) });
|
|
2280
|
-
}, yo = () => /* @__PURE__ */ c(wo, { text: "Synchronizing" }), Vn = ({
|
|
2281
|
-
event: e,
|
|
2282
|
-
style: t,
|
|
2283
|
-
onClick: n,
|
|
2284
|
-
onDoubleClick: r,
|
|
2285
|
-
onDelete: a,
|
|
2286
|
-
orientation: i = "vertical",
|
|
2287
|
-
resizable: l = !1,
|
|
2288
|
-
className: d,
|
|
2289
|
-
showTime: m = !0,
|
|
2290
|
-
isBlocked: p = !1,
|
|
2291
|
-
isPast: u = !1,
|
|
2292
|
-
isHighlighted: s = !1,
|
|
2293
|
-
slotDuration: N = 30,
|
|
2294
|
-
pixelsPerSlot: g
|
|
2295
|
-
}) => {
|
|
2296
|
-
const h = p || e.isBlock, _ = h || u, { attributes: z, listeners: $, setNodeRef: D, transform: B, isDragging: F } = Ft({
|
|
2297
|
-
id: e.id,
|
|
2298
|
-
data: e,
|
|
2299
|
-
disabled: _
|
|
2300
|
-
}), ae = g || (i === "vertical" ? 64 : 80), { attributes: x, listeners: k, setNodeRef: M, transform: S, isDragging: K } = Ft({
|
|
2301
|
-
id: `resize-bottom-${e.id}`,
|
|
2302
|
-
data: {
|
|
2303
|
-
type: "resize-bottom",
|
|
2304
|
-
eventId: e.id,
|
|
2305
|
-
orientation: i,
|
|
2306
|
-
pixelsPerSlot: ae
|
|
2307
|
-
},
|
|
2308
|
-
disabled: !l || _
|
|
2309
|
-
}), { attributes: G, listeners: j, setNodeRef: De, transform: X, isDragging: ne } = Ft({
|
|
2310
|
-
id: `resize-top-${e.id}`,
|
|
2311
|
-
data: {
|
|
2312
|
-
type: "resize-top",
|
|
2313
|
-
eventId: e.id,
|
|
2314
|
-
orientation: i,
|
|
2315
|
-
pixelsPerSlot: ae
|
|
2316
|
-
},
|
|
2317
|
-
disabled: !l || _
|
|
2318
|
-
}), Me = K || ne, fe = ae / N;
|
|
2319
|
-
let ve = new Date(e.start), se = new Date(e.end);
|
|
2320
|
-
if (F && B) {
|
|
2321
|
-
const H = i === "vertical" ? B.y : B.x, R = Math.round(H / fe / 15) * 15;
|
|
2322
|
-
ve = tt(ve, R), se = tt(se, R);
|
|
2323
|
-
} else if (ne && X) {
|
|
2324
|
-
const H = i === "vertical" ? X.y : X.x, R = Math.round(H / fe / 15) * 15;
|
|
2325
|
-
ve = tt(ve, R);
|
|
2326
|
-
} else if (K && S) {
|
|
2327
|
-
const H = i === "vertical" ? S.y : S.x, R = Math.round(H / fe / 15) * 15;
|
|
2328
|
-
se = tt(se, R);
|
|
2329
|
-
}
|
|
2330
|
-
const de = t?.borderColor || e.color || "hsl(var(--primary))", Z = h ? {
|
|
2331
|
-
backgroundImage: "repeating - linear - gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.05) 10px, rgba(0, 0, 0, 0.05) 20px)",
|
|
2332
|
-
backgroundColor: "rgba(0,0,0,0.02)",
|
|
2333
|
-
color: "gray",
|
|
2334
|
-
borderLeftWidth: "4px",
|
|
2335
|
-
borderColor: "#d1d5db",
|
|
2336
|
-
borderStyle: "solid",
|
|
2337
|
-
opacity: 1
|
|
2338
|
-
} : {}, me = {
|
|
2339
|
-
...t,
|
|
2340
|
-
transform: _r.Translate.toString(B),
|
|
2341
|
-
opacity: F ? 0.6 : u ? 0.7 : 1,
|
|
2342
|
-
zIndex: F || Me ? 100 : _ ? 10 : 20,
|
|
2343
|
-
touchAction: "none",
|
|
2344
|
-
pointerEvents: F || Me ? "none" : "auto",
|
|
2345
|
-
position: "absolute",
|
|
2346
|
-
backgroundColor: `color-mix(in srgb, ${de} 12%, transparent)`,
|
|
2347
|
-
color: `color-mix(in srgb, ${de} 90%, black)`,
|
|
2348
|
-
borderLeftWidth: "4px",
|
|
2349
|
-
borderColor: de,
|
|
2350
|
-
...h ? Z : {},
|
|
2351
|
-
...K && i === "vertical" && S ? {
|
|
2352
|
-
height: `${Math.max((parseInt(t?.height) || 0) + S.y, 24)}px`
|
|
2353
|
-
} : {},
|
|
2354
|
-
...ne && i === "vertical" && X ? {
|
|
2355
|
-
top: `${(parseInt(t?.top) || 0) + X.y}px`,
|
|
2356
|
-
height: `${Math.max((parseInt(t?.height) || 0) - X.y, 24)}px`
|
|
2357
|
-
} : {},
|
|
2358
|
-
...K && i === "horizontal" && S ? {
|
|
2359
|
-
width: `${Math.max((parseInt(t?.width) || 0) + S.x, 24)}px`
|
|
2360
|
-
} : {},
|
|
2361
|
-
...ne && i === "horizontal" && X ? {
|
|
2362
|
-
left: `${(parseInt(t?.left) || 0) + X.x}px`,
|
|
2363
|
-
width: `${Math.max((parseInt(t?.width) || 0) - X.x, 24)}px`
|
|
2364
|
-
} : {}
|
|
2365
|
-
}, ee = /* @__PURE__ */ w(
|
|
2366
|
-
"div",
|
|
2367
|
-
{
|
|
2368
|
-
ref: D,
|
|
2369
|
-
style: me,
|
|
2370
|
-
...z,
|
|
2371
|
-
...$,
|
|
2372
|
-
className: V(
|
|
2373
|
-
"absolute rounded-md text-xs border overflow-hidden group select-none flex flex-col",
|
|
2374
|
-
"bg-primary/10 border-primary/20 text-foreground shadow-sm hover:shadow-md transition-shadow",
|
|
2375
|
-
F && "opacity-50 z-50 shadow-xl scale-105 cursor-grabbing ring-2 ring-primary ring-offset-2",
|
|
2376
|
-
s && "ring-2 ring-primary ring-offset-1 bg-primary/20 shadow-md transition-all duration-300",
|
|
2377
|
-
h && "bg-muted/50 border-muted opacity-80",
|
|
2378
|
-
!h && "pointer-events-auto",
|
|
2379
|
-
h && "pointer-events-auto select-none grayscale",
|
|
2380
|
-
d
|
|
2381
|
-
),
|
|
2382
|
-
onClick: (H) => {
|
|
2383
|
-
!F && !Me && (H.stopPropagation(), n?.(e));
|
|
2384
|
-
},
|
|
2385
|
-
onDoubleClick: (H) => {
|
|
2386
|
-
H.stopPropagation(), r?.(e);
|
|
2387
|
-
},
|
|
2388
|
-
role: "button",
|
|
2389
|
-
"aria-label": `Event: ${e.title}`,
|
|
2390
|
-
children: [
|
|
2391
|
-
/* @__PURE__ */ w("div", { className: "flex-1 min-h-0 relative px-2 py-1", children: [
|
|
2392
|
-
/* @__PURE__ */ w("div", { className: "flex items-start justify-between gap-1", children: [
|
|
2393
|
-
/* @__PURE__ */ c("div", { className: "font-semibold truncate pr-4 leading-tight", children: e.title }),
|
|
2394
|
-
!h && /* @__PURE__ */ c(
|
|
2395
|
-
"button",
|
|
2396
|
-
{
|
|
2397
|
-
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 hover:bg-destructive/10 rounded absolute top-0 right-0 z-10",
|
|
2398
|
-
onClick: (H) => {
|
|
2399
|
-
H.stopPropagation(), a?.(e.id);
|
|
2400
|
-
},
|
|
2401
|
-
onPointerDown: (H) => H.stopPropagation(),
|
|
2402
|
-
children: /* @__PURE__ */ c(Ln, { className: "h-3 w-3 text-muted-foreground hover:text-destructive" })
|
|
2403
|
-
}
|
|
2404
|
-
)
|
|
2405
|
-
] }),
|
|
2406
|
-
m && !h && /* @__PURE__ */ w("div", { className: "text-[10px] text-muted-foreground truncate leading-tight", children: [
|
|
2407
|
-
ue(ve, "h:mm a"),
|
|
2408
|
-
" - ",
|
|
2409
|
-
ue(se, "h:mm a")
|
|
2410
|
-
] }),
|
|
2411
|
-
e.description && /* @__PURE__ */ c("div", { className: "text-[10px] text-muted-foreground line-clamp-2 leading-tight mt-0.5", children: e.description }),
|
|
2412
|
-
h && /* @__PURE__ */ c("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ c("span", { className: "text-xs font-medium text-muted-foreground opacity-70 -rotate-45 select-none", children: "BLOCKED" }) })
|
|
2413
|
-
] }),
|
|
2414
|
-
l && !h && /* @__PURE__ */ w(xt, { children: [
|
|
2415
|
-
/* @__PURE__ */ c(
|
|
2416
|
-
"div",
|
|
2417
|
-
{
|
|
2418
|
-
ref: M,
|
|
2419
|
-
...x,
|
|
2420
|
-
...k,
|
|
2421
|
-
className: V(
|
|
2422
|
-
"absolute z-20 hover:bg-primary/20 transition-colors flex items-center justify-center opacity-0 group-hover:opacity-100",
|
|
2423
|
-
i === "vertical" ? "bottom-0 left-0 right-0 h-3 cursor-ns-resize" : "right-0 top-0 bottom-0 w-3 cursor-ew-resize"
|
|
2424
|
-
),
|
|
2425
|
-
style: { touchAction: "none" },
|
|
2426
|
-
children: /* @__PURE__ */ c("div", { className: V(
|
|
2427
|
-
"bg-primary/40 rounded-full",
|
|
2428
|
-
i === "vertical" ? "w-10 h-1" : "h-10 w-1"
|
|
2429
|
-
) })
|
|
2430
|
-
}
|
|
2431
|
-
),
|
|
2432
|
-
/* @__PURE__ */ c(
|
|
2433
|
-
"div",
|
|
2434
|
-
{
|
|
2435
|
-
ref: De,
|
|
2436
|
-
...G,
|
|
2437
|
-
...j,
|
|
2438
|
-
className: V(
|
|
2439
|
-
"absolute z-20 hover:bg-primary/20 transition-colors flex items-center justify-center opacity-0 group-hover:opacity-100",
|
|
2440
|
-
i === "vertical" ? "top-0 left-0 right-0 h-3 cursor-ns-resize" : "left-0 top-0 bottom-0 w-3 cursor-ew-resize"
|
|
2441
|
-
),
|
|
2442
|
-
style: { touchAction: "none" },
|
|
2443
|
-
children: /* @__PURE__ */ c("div", { className: V(
|
|
2444
|
-
"bg-primary/40 rounded-full",
|
|
2445
|
-
i === "vertical" ? "w-10 h-1 shadow-[0_-1px_0_rgba(0,0,0,0.1)]" : "h-10 w-1 shadow-[-1px_0_0_rgba(0,0,0,0.1)]"
|
|
2446
|
-
) })
|
|
2447
|
-
}
|
|
2448
|
-
)
|
|
2449
|
-
] })
|
|
2450
|
-
]
|
|
2451
|
-
}
|
|
2452
|
-
);
|
|
2453
|
-
return /* @__PURE__ */ c(br, { content: e.description, enabled: !!e.description && !F, children: /* @__PURE__ */ c(Rn, { contextId: "scheduler-event", data: e, children: ee }) });
|
|
2454
|
-
}, xo = ({
|
|
2455
|
-
date: e,
|
|
2456
|
-
resourceId: t,
|
|
2457
|
-
children: n,
|
|
2458
|
-
className: r,
|
|
2459
|
-
style: a,
|
|
2460
|
-
onClick: i,
|
|
2461
|
-
onDoubleClick: l,
|
|
2462
|
-
onMouseDown: d,
|
|
2463
|
-
onMouseEnter: m,
|
|
2464
|
-
onContextMenu: p,
|
|
2465
|
-
data: u,
|
|
2466
|
-
isSelected: s,
|
|
2467
|
-
isWorkHour: N
|
|
2468
|
-
}) => {
|
|
2469
|
-
const { active: g } = Cr(), { setNodeRef: h, isOver: _ } = Pn({
|
|
2470
|
-
id: `slot-${e.toISOString()}-${t || "none"}`,
|
|
2471
|
-
data: { date: e, resourceId: t, ...u || {} }
|
|
2472
|
-
});
|
|
2473
|
-
return /* @__PURE__ */ c(
|
|
2474
|
-
"div",
|
|
2475
|
-
{
|
|
2476
|
-
ref: h,
|
|
2477
|
-
"data-testid": "scheduler-slot",
|
|
2478
|
-
"data-shaded": N === !1,
|
|
2479
|
-
className: V(
|
|
2480
|
-
"relative transition-all duration-200",
|
|
2481
|
-
s && "bg-primary/15",
|
|
2482
|
-
!s && N === !1 && "bg-background",
|
|
2483
|
-
// Highlight valid drop areas when dragging
|
|
2484
|
-
!!g && "before:absolute before:inset-0 before:border before:border-dashed before:border-primary/10 before:pointer-events-none before:z-0",
|
|
2485
|
-
_ && "bg-primary/20 ring-2 ring-primary ring-inset z-10 before:opacity-0",
|
|
2486
|
-
r
|
|
2487
|
-
),
|
|
2488
|
-
style: a,
|
|
2489
|
-
onClick: i,
|
|
2490
|
-
onDoubleClick: l,
|
|
2491
|
-
onMouseDown: d,
|
|
2492
|
-
onMouseEnter: m,
|
|
2493
|
-
onContextMenu: p,
|
|
2494
|
-
children: n
|
|
2495
|
-
}
|
|
2496
|
-
);
|
|
2497
|
-
};
|
|
2498
|
-
const {
|
|
2499
|
-
entries: jn,
|
|
2500
|
-
setPrototypeOf: kn,
|
|
2501
|
-
isFrozen: vo,
|
|
2502
|
-
getPrototypeOf: So,
|
|
2503
|
-
getOwnPropertyDescriptor: Eo
|
|
2504
|
-
} = Object;
|
|
2505
|
-
let {
|
|
2506
|
-
freeze: Ce,
|
|
2507
|
-
seal: We,
|
|
2508
|
-
create: Ct
|
|
2509
|
-
} = Object, {
|
|
2510
|
-
apply: Kt,
|
|
2511
|
-
construct: Jt
|
|
2512
|
-
} = typeof Reflect < "u" && Reflect;
|
|
2513
|
-
Ce || (Ce = function(t) {
|
|
2514
|
-
return t;
|
|
2515
|
-
});
|
|
2516
|
-
We || (We = function(t) {
|
|
2517
|
-
return t;
|
|
2518
|
-
});
|
|
2519
|
-
Kt || (Kt = function(t, n) {
|
|
2520
|
-
for (var r = arguments.length, a = new Array(r > 2 ? r - 2 : 0), i = 2; i < r; i++)
|
|
2521
|
-
a[i - 2] = arguments[i];
|
|
2522
|
-
return t.apply(n, a);
|
|
2523
|
-
});
|
|
2524
|
-
Jt || (Jt = function(t) {
|
|
2525
|
-
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
|
|
2526
|
-
r[a - 1] = arguments[a];
|
|
2527
|
-
return new t(...r);
|
|
2528
|
-
});
|
|
2529
|
-
const Tt = Ae(Array.prototype.forEach), ko = Ae(Array.prototype.lastIndexOf), Tn = Ae(Array.prototype.pop), gt = Ae(Array.prototype.push), To = Ae(Array.prototype.splice), At = Ae(String.prototype.toLowerCase), Bt = Ae(String.prototype.toString), Ut = Ae(String.prototype.match), pt = Ae(String.prototype.replace), Do = Ae(String.prototype.indexOf), Mo = Ae(String.prototype.trim), Pe = Ae(Object.prototype.hasOwnProperty), Ne = Ae(RegExp.prototype.test), bt = No(TypeError);
|
|
2530
|
-
function Ae(e) {
|
|
2531
|
-
return function(t) {
|
|
2532
|
-
t instanceof RegExp && (t.lastIndex = 0);
|
|
2533
|
-
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
|
|
2534
|
-
r[a - 1] = arguments[a];
|
|
2535
|
-
return Kt(e, t, r);
|
|
2536
|
-
};
|
|
2537
|
-
}
|
|
2538
|
-
function No(e) {
|
|
2539
|
-
return function() {
|
|
2540
|
-
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
2541
|
-
n[r] = arguments[r];
|
|
2542
|
-
return Jt(e, n);
|
|
2543
|
-
};
|
|
2544
|
-
}
|
|
2545
|
-
function Q(e, t) {
|
|
2546
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : At;
|
|
2547
|
-
kn && kn(e, null);
|
|
2548
|
-
let r = t.length;
|
|
2549
|
-
for (; r--; ) {
|
|
2550
|
-
let a = t[r];
|
|
2551
|
-
if (typeof a == "string") {
|
|
2552
|
-
const i = n(a);
|
|
2553
|
-
i !== a && (vo(t) || (t[r] = i), a = i);
|
|
2554
|
-
}
|
|
2555
|
-
e[a] = !0;
|
|
2556
|
-
}
|
|
2557
|
-
return e;
|
|
2558
|
-
}
|
|
2559
|
-
function _o(e) {
|
|
2560
|
-
for (let t = 0; t < e.length; t++)
|
|
2561
|
-
Pe(e, t) || (e[t] = null);
|
|
2562
|
-
return e;
|
|
2563
|
-
}
|
|
2564
|
-
function Ve(e) {
|
|
2565
|
-
const t = Ct(null);
|
|
2566
|
-
for (const [n, r] of jn(e))
|
|
2567
|
-
Pe(e, n) && (Array.isArray(r) ? t[n] = _o(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = Ve(r) : t[n] = r);
|
|
2568
|
-
return t;
|
|
2569
|
-
}
|
|
2570
|
-
function wt(e, t) {
|
|
2571
|
-
for (; e !== null; ) {
|
|
2572
|
-
const r = Eo(e, t);
|
|
2573
|
-
if (r) {
|
|
2574
|
-
if (r.get)
|
|
2575
|
-
return Ae(r.get);
|
|
2576
|
-
if (typeof r.value == "function")
|
|
2577
|
-
return Ae(r.value);
|
|
2578
|
-
}
|
|
2579
|
-
e = So(e);
|
|
2580
|
-
}
|
|
2581
|
-
function n() {
|
|
2582
|
-
return null;
|
|
2583
|
-
}
|
|
2584
|
-
return n;
|
|
2585
|
-
}
|
|
2586
|
-
const Dn = Ce(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Yt = Ce(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Gt = Ce(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Co = Ce(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), $t = Ce(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ao = Ce(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Mn = Ce(["#text"]), Nn = Ce(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Vt = Ce(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), _n = Ce(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Dt = Ce(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Oo = We(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Io = We(/<%[\w\W]*|[\w\W]*%>/gm), Ro = We(/\$\{[\w\W]*/gm), Po = We(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lo = We(/^aria-[\-\w]+$/), qn = We(
|
|
2587
|
-
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
2588
|
-
// eslint-disable-line no-useless-escape
|
|
2589
|
-
), zo = We(/^(?:\w+script|data):/i), Fo = We(
|
|
2590
|
-
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
2591
|
-
// eslint-disable-line no-control-regex
|
|
2592
|
-
), Qn = We(/^html$/i), Ho = We(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
2593
|
-
var Cn = /* @__PURE__ */ Object.freeze({
|
|
2594
|
-
__proto__: null,
|
|
2595
|
-
ARIA_ATTR: Lo,
|
|
2596
|
-
ATTR_WHITESPACE: Fo,
|
|
2597
|
-
CUSTOM_ELEMENT: Ho,
|
|
2598
|
-
DATA_ATTR: Po,
|
|
2599
|
-
DOCTYPE_NAME: Qn,
|
|
2600
|
-
ERB_EXPR: Io,
|
|
2601
|
-
IS_ALLOWED_URI: qn,
|
|
2602
|
-
IS_SCRIPT_OR_DATA: zo,
|
|
2603
|
-
MUSTACHE_EXPR: Oo,
|
|
2604
|
-
TMPLIT_EXPR: Ro
|
|
2605
|
-
});
|
|
2606
|
-
const yt = {
|
|
2607
|
-
element: 1,
|
|
2608
|
-
text: 3,
|
|
2609
|
-
// Deprecated
|
|
2610
|
-
progressingInstruction: 7,
|
|
2611
|
-
comment: 8,
|
|
2612
|
-
document: 9
|
|
2613
|
-
}, Wo = function() {
|
|
2614
|
-
return typeof window > "u" ? null : window;
|
|
2615
|
-
}, Bo = function(t, n) {
|
|
2616
|
-
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
2617
|
-
return null;
|
|
2618
|
-
let r = null;
|
|
2619
|
-
const a = "data-tt-policy-suffix";
|
|
2620
|
-
n && n.hasAttribute(a) && (r = n.getAttribute(a));
|
|
2621
|
-
const i = "dompurify" + (r ? "#" + r : "");
|
|
2622
|
-
try {
|
|
2623
|
-
return t.createPolicy(i, {
|
|
2624
|
-
createHTML(l) {
|
|
2625
|
-
return l;
|
|
2626
|
-
},
|
|
2627
|
-
createScriptURL(l) {
|
|
2628
|
-
return l;
|
|
2629
|
-
}
|
|
2630
|
-
});
|
|
2631
|
-
} catch {
|
|
2632
|
-
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2633
|
-
}
|
|
2634
|
-
}, An = function() {
|
|
2635
|
-
return {
|
|
2636
|
-
afterSanitizeAttributes: [],
|
|
2637
|
-
afterSanitizeElements: [],
|
|
2638
|
-
afterSanitizeShadowDOM: [],
|
|
2639
|
-
beforeSanitizeAttributes: [],
|
|
2640
|
-
beforeSanitizeElements: [],
|
|
2641
|
-
beforeSanitizeShadowDOM: [],
|
|
2642
|
-
uponSanitizeAttribute: [],
|
|
2643
|
-
uponSanitizeElement: [],
|
|
2644
|
-
uponSanitizeShadowNode: []
|
|
2645
|
-
};
|
|
2646
|
-
};
|
|
2647
|
-
function Xn() {
|
|
2648
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Wo();
|
|
2649
|
-
const t = (A) => Xn(A);
|
|
2650
|
-
if (t.version = "3.3.2", t.removed = [], !e || !e.document || e.document.nodeType !== yt.document || !e.Element)
|
|
2651
|
-
return t.isSupported = !1, t;
|
|
2652
|
-
let {
|
|
2653
|
-
document: n
|
|
2654
|
-
} = e;
|
|
2655
|
-
const r = n, a = r.currentScript, {
|
|
2656
|
-
DocumentFragment: i,
|
|
2657
|
-
HTMLTemplateElement: l,
|
|
2658
|
-
Node: d,
|
|
2659
|
-
Element: m,
|
|
2660
|
-
NodeFilter: p,
|
|
2661
|
-
NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap,
|
|
2662
|
-
HTMLFormElement: s,
|
|
2663
|
-
DOMParser: N,
|
|
2664
|
-
trustedTypes: g
|
|
2665
|
-
} = e, h = m.prototype, _ = wt(h, "cloneNode"), z = wt(h, "remove"), $ = wt(h, "nextSibling"), D = wt(h, "childNodes"), B = wt(h, "parentNode");
|
|
2666
|
-
if (typeof l == "function") {
|
|
2667
|
-
const A = n.createElement("template");
|
|
2668
|
-
A.content && A.content.ownerDocument && (n = A.content.ownerDocument);
|
|
2669
|
-
}
|
|
2670
|
-
let F, ae = "";
|
|
2671
|
-
const {
|
|
2672
|
-
implementation: x,
|
|
2673
|
-
createNodeIterator: k,
|
|
2674
|
-
createDocumentFragment: M,
|
|
2675
|
-
getElementsByTagName: S
|
|
2676
|
-
} = n, {
|
|
2677
|
-
importNode: K
|
|
2678
|
-
} = r;
|
|
2679
|
-
let G = An();
|
|
2680
|
-
t.isSupported = typeof jn == "function" && typeof B == "function" && x && x.createHTMLDocument !== void 0;
|
|
2681
|
-
const {
|
|
2682
|
-
MUSTACHE_EXPR: j,
|
|
2683
|
-
ERB_EXPR: De,
|
|
2684
|
-
TMPLIT_EXPR: X,
|
|
2685
|
-
DATA_ATTR: ne,
|
|
2686
|
-
ARIA_ATTR: Me,
|
|
2687
|
-
IS_SCRIPT_OR_DATA: fe,
|
|
2688
|
-
ATTR_WHITESPACE: ve,
|
|
2689
|
-
CUSTOM_ELEMENT: se
|
|
2690
|
-
} = Cn;
|
|
2691
|
-
let {
|
|
2692
|
-
IS_ALLOWED_URI: de
|
|
2693
|
-
} = Cn, Z = null;
|
|
2694
|
-
const me = Q({}, [...Dn, ...Yt, ...Gt, ...$t, ...Mn]);
|
|
2695
|
-
let ee = null;
|
|
2696
|
-
const H = Q({}, [...Nn, ...Vt, ..._n, ...Dt]);
|
|
2697
|
-
let R = Object.seal(Ct(null, {
|
|
2698
|
-
tagNameCheck: {
|
|
2699
|
-
writable: !0,
|
|
2700
|
-
configurable: !1,
|
|
2701
|
-
enumerable: !0,
|
|
2702
|
-
value: null
|
|
2703
|
-
},
|
|
2704
|
-
attributeNameCheck: {
|
|
2705
|
-
writable: !0,
|
|
2706
|
-
configurable: !1,
|
|
2707
|
-
enumerable: !0,
|
|
2708
|
-
value: null
|
|
2709
|
-
},
|
|
2710
|
-
allowCustomizedBuiltInElements: {
|
|
2711
|
-
writable: !0,
|
|
2712
|
-
configurable: !1,
|
|
2713
|
-
enumerable: !0,
|
|
2714
|
-
value: !1
|
|
2715
|
-
}
|
|
2716
|
-
})), Be = null, he = null;
|
|
2717
|
-
const Oe = Object.seal(Ct(null, {
|
|
2718
|
-
tagCheck: {
|
|
2719
|
-
writable: !0,
|
|
2720
|
-
configurable: !1,
|
|
2721
|
-
enumerable: !0,
|
|
2722
|
-
value: null
|
|
2723
|
-
},
|
|
2724
|
-
attributeCheck: {
|
|
2725
|
-
writable: !0,
|
|
2726
|
-
configurable: !1,
|
|
2727
|
-
enumerable: !0,
|
|
2728
|
-
value: null
|
|
2729
|
-
}
|
|
2730
|
-
}));
|
|
2731
|
-
let v = !0, U = !0, q = !1, le = !0, oe = !1, Je = !0, Ue = !1, Ye = !1, Fe = !1, b = !1, O = !1, y = !1, C = !0, E = !1;
|
|
2732
|
-
const I = "user-content-";
|
|
2733
|
-
let W = !0, Y = !1, P = {}, L = null;
|
|
2734
|
-
const te = Q({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
2735
|
-
let J = null;
|
|
2736
|
-
const Se = Q({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
2737
|
-
let ge = null;
|
|
2738
|
-
const Ge = Q({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), nt = "http://www.w3.org/1998/Math/MathML", Qe = "http://www.w3.org/2000/svg", pe = "http://www.w3.org/1999/xhtml";
|
|
2739
|
-
let Ze = pe, ut = !1, Ee = null;
|
|
2740
|
-
const rt = Q({}, [nt, Qe, pe], Bt);
|
|
2741
|
-
let Et = Q({}, ["mi", "mo", "mn", "ms", "mtext"]), kt = Q({}, ["annotation-xml"]);
|
|
2742
|
-
const Jn = Q({}, ["title", "style", "font", "a", "script"]);
|
|
2743
|
-
let ft = null;
|
|
2744
|
-
const Zn = ["application/xhtml+xml", "text/html"], er = "text/html";
|
|
2745
|
-
let xe = null, ct = null;
|
|
2746
|
-
const tr = n.createElement("form"), en = function(o) {
|
|
2747
|
-
return o instanceof RegExp || o instanceof Function;
|
|
2748
|
-
}, Rt = function() {
|
|
2749
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2750
|
-
if (!(ct && ct === o)) {
|
|
2751
|
-
if ((!o || typeof o != "object") && (o = {}), o = Ve(o), ft = // eslint-disable-next-line unicorn/prefer-includes
|
|
2752
|
-
Zn.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? er : o.PARSER_MEDIA_TYPE, xe = ft === "application/xhtml+xml" ? Bt : At, Z = Pe(o, "ALLOWED_TAGS") ? Q({}, o.ALLOWED_TAGS, xe) : me, ee = Pe(o, "ALLOWED_ATTR") ? Q({}, o.ALLOWED_ATTR, xe) : H, Ee = Pe(o, "ALLOWED_NAMESPACES") ? Q({}, o.ALLOWED_NAMESPACES, Bt) : rt, ge = Pe(o, "ADD_URI_SAFE_ATTR") ? Q(Ve(Ge), o.ADD_URI_SAFE_ATTR, xe) : Ge, J = Pe(o, "ADD_DATA_URI_TAGS") ? Q(Ve(Se), o.ADD_DATA_URI_TAGS, xe) : Se, L = Pe(o, "FORBID_CONTENTS") ? Q({}, o.FORBID_CONTENTS, xe) : te, Be = Pe(o, "FORBID_TAGS") ? Q({}, o.FORBID_TAGS, xe) : Ve({}), he = Pe(o, "FORBID_ATTR") ? Q({}, o.FORBID_ATTR, xe) : Ve({}), P = Pe(o, "USE_PROFILES") ? o.USE_PROFILES : !1, v = o.ALLOW_ARIA_ATTR !== !1, U = o.ALLOW_DATA_ATTR !== !1, q = o.ALLOW_UNKNOWN_PROTOCOLS || !1, le = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, oe = o.SAFE_FOR_TEMPLATES || !1, Je = o.SAFE_FOR_XML !== !1, Ue = o.WHOLE_DOCUMENT || !1, b = o.RETURN_DOM || !1, O = o.RETURN_DOM_FRAGMENT || !1, y = o.RETURN_TRUSTED_TYPE || !1, Fe = o.FORCE_BODY || !1, C = o.SANITIZE_DOM !== !1, E = o.SANITIZE_NAMED_PROPS || !1, W = o.KEEP_CONTENT !== !1, Y = o.IN_PLACE || !1, de = o.ALLOWED_URI_REGEXP || qn, Ze = o.NAMESPACE || pe, Et = o.MATHML_TEXT_INTEGRATION_POINTS || Et, kt = o.HTML_INTEGRATION_POINTS || kt, R = o.CUSTOM_ELEMENT_HANDLING || {}, o.CUSTOM_ELEMENT_HANDLING && en(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = o.CUSTOM_ELEMENT_HANDLING.tagNameCheck), o.CUSTOM_ELEMENT_HANDLING && en(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), oe && (U = !1), O && (b = !0), P && (Z = Q({}, Mn), ee = Ct(null), P.html === !0 && (Q(Z, Dn), Q(ee, Nn)), P.svg === !0 && (Q(Z, Yt), Q(ee, Vt), Q(ee, Dt)), P.svgFilters === !0 && (Q(Z, Gt), Q(ee, Vt), Q(ee, Dt)), P.mathMl === !0 && (Q(Z, $t), Q(ee, _n), Q(ee, Dt))), Pe(o, "ADD_TAGS") || (Oe.tagCheck = null), Pe(o, "ADD_ATTR") || (Oe.attributeCheck = null), o.ADD_TAGS && (typeof o.ADD_TAGS == "function" ? Oe.tagCheck = o.ADD_TAGS : (Z === me && (Z = Ve(Z)), Q(Z, o.ADD_TAGS, xe))), o.ADD_ATTR && (typeof o.ADD_ATTR == "function" ? Oe.attributeCheck = o.ADD_ATTR : (ee === H && (ee = Ve(ee)), Q(ee, o.ADD_ATTR, xe))), o.ADD_URI_SAFE_ATTR && Q(ge, o.ADD_URI_SAFE_ATTR, xe), o.FORBID_CONTENTS && (L === te && (L = Ve(L)), Q(L, o.FORBID_CONTENTS, xe)), o.ADD_FORBID_CONTENTS && (L === te && (L = Ve(L)), Q(L, o.ADD_FORBID_CONTENTS, xe)), W && (Z["#text"] = !0), Ue && Q(Z, ["html", "head", "body"]), Z.table && (Q(Z, ["tbody"]), delete Be.tbody), o.TRUSTED_TYPES_POLICY) {
|
|
2753
|
-
if (typeof o.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
2754
|
-
throw bt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2755
|
-
if (typeof o.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
2756
|
-
throw bt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2757
|
-
F = o.TRUSTED_TYPES_POLICY, ae = F.createHTML("");
|
|
2758
|
-
} else
|
|
2759
|
-
F === void 0 && (F = Bo(g, a)), F !== null && typeof ae == "string" && (ae = F.createHTML(""));
|
|
2760
|
-
Ce && Ce(o), ct = o;
|
|
2761
|
-
}
|
|
2762
|
-
}, tn = Q({}, [...Yt, ...Gt, ...Co]), nn = Q({}, [...$t, ...Ao]), nr = function(o) {
|
|
2763
|
-
let f = B(o);
|
|
2764
|
-
(!f || !f.tagName) && (f = {
|
|
2765
|
-
namespaceURI: Ze,
|
|
2766
|
-
tagName: "template"
|
|
2767
|
-
});
|
|
2768
|
-
const T = At(o.tagName), ce = At(f.tagName);
|
|
2769
|
-
return Ee[o.namespaceURI] ? o.namespaceURI === Qe ? f.namespaceURI === pe ? T === "svg" : f.namespaceURI === nt ? T === "svg" && (ce === "annotation-xml" || Et[ce]) : !!tn[T] : o.namespaceURI === nt ? f.namespaceURI === pe ? T === "math" : f.namespaceURI === Qe ? T === "math" && kt[ce] : !!nn[T] : o.namespaceURI === pe ? f.namespaceURI === Qe && !kt[ce] || f.namespaceURI === nt && !Et[ce] ? !1 : !nn[T] && (Jn[T] || !tn[T]) : !!(ft === "application/xhtml+xml" && Ee[o.namespaceURI]) : !1;
|
|
2770
|
-
}, $e = function(o) {
|
|
2771
|
-
gt(t.removed, {
|
|
2772
|
-
element: o
|
|
2773
|
-
});
|
|
2774
|
-
try {
|
|
2775
|
-
B(o).removeChild(o);
|
|
2776
|
-
} catch {
|
|
2777
|
-
z(o);
|
|
2778
|
-
}
|
|
2779
|
-
}, at = function(o, f) {
|
|
2780
|
-
try {
|
|
2781
|
-
gt(t.removed, {
|
|
2782
|
-
attribute: f.getAttributeNode(o),
|
|
2783
|
-
from: f
|
|
2784
|
-
});
|
|
2785
|
-
} catch {
|
|
2786
|
-
gt(t.removed, {
|
|
2787
|
-
attribute: null,
|
|
2788
|
-
from: f
|
|
2789
|
-
});
|
|
2790
|
-
}
|
|
2791
|
-
if (f.removeAttribute(o), o === "is")
|
|
2792
|
-
if (b || O)
|
|
2793
|
-
try {
|
|
2794
|
-
$e(f);
|
|
2795
|
-
} catch {
|
|
2796
|
-
}
|
|
2797
|
-
else
|
|
2798
|
-
try {
|
|
2799
|
-
f.setAttribute(o, "");
|
|
2800
|
-
} catch {
|
|
2801
|
-
}
|
|
2802
|
-
}, rn = function(o) {
|
|
2803
|
-
let f = null, T = null;
|
|
2804
|
-
if (Fe)
|
|
2805
|
-
o = "<remove></remove>" + o;
|
|
2806
|
-
else {
|
|
2807
|
-
const be = Ut(o, /^[\r\n\t ]+/);
|
|
2808
|
-
T = be && be[0];
|
|
2809
|
-
}
|
|
2810
|
-
ft === "application/xhtml+xml" && Ze === pe && (o = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + o + "</body></html>");
|
|
2811
|
-
const ce = F ? F.createHTML(o) : o;
|
|
2812
|
-
if (Ze === pe)
|
|
2813
|
-
try {
|
|
2814
|
-
f = new N().parseFromString(ce, ft);
|
|
2815
|
-
} catch {
|
|
2816
|
-
}
|
|
2817
|
-
if (!f || !f.documentElement) {
|
|
2818
|
-
f = x.createDocument(Ze, "template", null);
|
|
2819
|
-
try {
|
|
2820
|
-
f.documentElement.innerHTML = ut ? ae : ce;
|
|
2821
|
-
} catch {
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
const Te = f.body || f.documentElement;
|
|
2825
|
-
return o && T && Te.insertBefore(n.createTextNode(T), Te.childNodes[0] || null), Ze === pe ? S.call(f, Ue ? "html" : "body")[0] : Ue ? f.documentElement : Te;
|
|
2826
|
-
}, an = function(o) {
|
|
2827
|
-
return k.call(
|
|
2828
|
-
o.ownerDocument || o,
|
|
2829
|
-
o,
|
|
2830
|
-
// eslint-disable-next-line no-bitwise
|
|
2831
|
-
p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
|
|
2832
|
-
null
|
|
2833
|
-
);
|
|
2834
|
-
}, Pt = function(o) {
|
|
2835
|
-
return o instanceof s && (typeof o.nodeName != "string" || typeof o.textContent != "string" || typeof o.removeChild != "function" || !(o.attributes instanceof u) || typeof o.removeAttribute != "function" || typeof o.setAttribute != "function" || typeof o.namespaceURI != "string" || typeof o.insertBefore != "function" || typeof o.hasChildNodes != "function");
|
|
2836
|
-
}, on = function(o) {
|
|
2837
|
-
return typeof d == "function" && o instanceof d;
|
|
2838
|
-
};
|
|
2839
|
-
function Xe(A, o, f) {
|
|
2840
|
-
Tt(A, (T) => {
|
|
2841
|
-
T.call(t, o, f, ct);
|
|
2842
|
-
});
|
|
2843
|
-
}
|
|
2844
|
-
const sn = function(o) {
|
|
2845
|
-
let f = null;
|
|
2846
|
-
if (Xe(G.beforeSanitizeElements, o, null), Pt(o))
|
|
2847
|
-
return $e(o), !0;
|
|
2848
|
-
const T = xe(o.nodeName);
|
|
2849
|
-
if (Xe(G.uponSanitizeElement, o, {
|
|
2850
|
-
tagName: T,
|
|
2851
|
-
allowedTags: Z
|
|
2852
|
-
}), Je && o.hasChildNodes() && !on(o.firstElementChild) && Ne(/<[/\w!]/g, o.innerHTML) && Ne(/<[/\w!]/g, o.textContent) || o.nodeType === yt.progressingInstruction || Je && o.nodeType === yt.comment && Ne(/<[/\w]/g, o.data))
|
|
2853
|
-
return $e(o), !0;
|
|
2854
|
-
if (!(Oe.tagCheck instanceof Function && Oe.tagCheck(T)) && (!Z[T] || Be[T])) {
|
|
2855
|
-
if (!Be[T] && ln(T) && (R.tagNameCheck instanceof RegExp && Ne(R.tagNameCheck, T) || R.tagNameCheck instanceof Function && R.tagNameCheck(T)))
|
|
2856
|
-
return !1;
|
|
2857
|
-
if (W && !L[T]) {
|
|
2858
|
-
const ce = B(o) || o.parentNode, Te = D(o) || o.childNodes;
|
|
2859
|
-
if (Te && ce) {
|
|
2860
|
-
const be = Te.length;
|
|
2861
|
-
for (let Ie = be - 1; Ie >= 0; --Ie) {
|
|
2862
|
-
const Ke = _(Te[Ie], !0);
|
|
2863
|
-
Ke.__removalCount = (o.__removalCount || 0) + 1, ce.insertBefore(Ke, $(o));
|
|
2864
|
-
}
|
|
2865
|
-
}
|
|
2866
|
-
}
|
|
2867
|
-
return $e(o), !0;
|
|
2868
|
-
}
|
|
2869
|
-
return o instanceof m && !nr(o) || (T === "noscript" || T === "noembed" || T === "noframes") && Ne(/<\/no(script|embed|frames)/i, o.innerHTML) ? ($e(o), !0) : (oe && o.nodeType === yt.text && (f = o.textContent, Tt([j, De, X], (ce) => {
|
|
2870
|
-
f = pt(f, ce, " ");
|
|
2871
|
-
}), o.textContent !== f && (gt(t.removed, {
|
|
2872
|
-
element: o.cloneNode()
|
|
2873
|
-
}), o.textContent = f)), Xe(G.afterSanitizeElements, o, null), !1);
|
|
2874
|
-
}, cn = function(o, f, T) {
|
|
2875
|
-
if (he[f] || C && (f === "id" || f === "name") && (T in n || T in tr))
|
|
2876
|
-
return !1;
|
|
2877
|
-
if (!(U && !he[f] && Ne(ne, f))) {
|
|
2878
|
-
if (!(v && Ne(Me, f))) {
|
|
2879
|
-
if (!(Oe.attributeCheck instanceof Function && Oe.attributeCheck(f, o))) {
|
|
2880
|
-
if (!ee[f] || he[f]) {
|
|
2881
|
-
if (
|
|
2882
|
-
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
2883
|
-
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2884
|
-
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
2885
|
-
!(ln(o) && (R.tagNameCheck instanceof RegExp && Ne(R.tagNameCheck, o) || R.tagNameCheck instanceof Function && R.tagNameCheck(o)) && (R.attributeNameCheck instanceof RegExp && Ne(R.attributeNameCheck, f) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(f, o)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
2886
|
-
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2887
|
-
f === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && Ne(R.tagNameCheck, T) || R.tagNameCheck instanceof Function && R.tagNameCheck(T)))
|
|
2888
|
-
) return !1;
|
|
2889
|
-
} else if (!ge[f]) {
|
|
2890
|
-
if (!Ne(de, pt(T, ve, ""))) {
|
|
2891
|
-
if (!((f === "src" || f === "xlink:href" || f === "href") && o !== "script" && Do(T, "data:") === 0 && J[o])) {
|
|
2892
|
-
if (!(q && !Ne(fe, pt(T, ve, "")))) {
|
|
2893
|
-
if (T)
|
|
2894
|
-
return !1;
|
|
2895
|
-
}
|
|
2896
|
-
}
|
|
2897
|
-
}
|
|
2898
|
-
}
|
|
2899
|
-
}
|
|
2900
|
-
}
|
|
2901
|
-
}
|
|
2902
|
-
return !0;
|
|
2903
|
-
}, ln = function(o) {
|
|
2904
|
-
return o !== "annotation-xml" && Ut(o, se);
|
|
2905
|
-
}, dn = function(o) {
|
|
2906
|
-
Xe(G.beforeSanitizeAttributes, o, null);
|
|
2907
|
-
const {
|
|
2908
|
-
attributes: f
|
|
2909
|
-
} = o;
|
|
2910
|
-
if (!f || Pt(o))
|
|
2911
|
-
return;
|
|
2912
|
-
const T = {
|
|
2913
|
-
attrName: "",
|
|
2914
|
-
attrValue: "",
|
|
2915
|
-
keepAttr: !0,
|
|
2916
|
-
allowedAttributes: ee,
|
|
2917
|
-
forceKeepAttr: void 0
|
|
2918
|
-
};
|
|
2919
|
-
let ce = f.length;
|
|
2920
|
-
for (; ce--; ) {
|
|
2921
|
-
const Te = f[ce], {
|
|
2922
|
-
name: be,
|
|
2923
|
-
namespaceURI: Ie,
|
|
2924
|
-
value: Ke
|
|
2925
|
-
} = Te, lt = xe(be), Lt = Ke;
|
|
2926
|
-
let ke = be === "value" ? Lt : Mo(Lt);
|
|
2927
|
-
if (T.attrName = lt, T.attrValue = ke, T.keepAttr = !0, T.forceKeepAttr = void 0, Xe(G.uponSanitizeAttribute, o, T), ke = T.attrValue, E && (lt === "id" || lt === "name") && (at(be, o), ke = I + ke), Je && Ne(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ke)) {
|
|
2928
|
-
at(be, o);
|
|
2929
|
-
continue;
|
|
2930
|
-
}
|
|
2931
|
-
if (lt === "attributename" && Ut(ke, "href")) {
|
|
2932
|
-
at(be, o);
|
|
2933
|
-
continue;
|
|
2934
|
-
}
|
|
2935
|
-
if (T.forceKeepAttr)
|
|
2936
|
-
continue;
|
|
2937
|
-
if (!T.keepAttr) {
|
|
2938
|
-
at(be, o);
|
|
2939
|
-
continue;
|
|
2940
|
-
}
|
|
2941
|
-
if (!le && Ne(/\/>/i, ke)) {
|
|
2942
|
-
at(be, o);
|
|
2943
|
-
continue;
|
|
2944
|
-
}
|
|
2945
|
-
oe && Tt([j, De, X], (fn) => {
|
|
2946
|
-
ke = pt(ke, fn, " ");
|
|
2947
|
-
});
|
|
2948
|
-
const un = xe(o.nodeName);
|
|
2949
|
-
if (!cn(un, lt, ke)) {
|
|
2950
|
-
at(be, o);
|
|
2951
|
-
continue;
|
|
2952
|
-
}
|
|
2953
|
-
if (F && typeof g == "object" && typeof g.getAttributeType == "function" && !Ie)
|
|
2954
|
-
switch (g.getAttributeType(un, lt)) {
|
|
2955
|
-
case "TrustedHTML": {
|
|
2956
|
-
ke = F.createHTML(ke);
|
|
2957
|
-
break;
|
|
2958
|
-
}
|
|
2959
|
-
case "TrustedScriptURL": {
|
|
2960
|
-
ke = F.createScriptURL(ke);
|
|
2961
|
-
break;
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2964
|
-
if (ke !== Lt)
|
|
2965
|
-
try {
|
|
2966
|
-
Ie ? o.setAttributeNS(Ie, be, ke) : o.setAttribute(be, ke), Pt(o) ? $e(o) : Tn(t.removed);
|
|
2967
|
-
} catch {
|
|
2968
|
-
at(be, o);
|
|
2969
|
-
}
|
|
2970
|
-
}
|
|
2971
|
-
Xe(G.afterSanitizeAttributes, o, null);
|
|
2972
|
-
}, rr = function A(o) {
|
|
2973
|
-
let f = null;
|
|
2974
|
-
const T = an(o);
|
|
2975
|
-
for (Xe(G.beforeSanitizeShadowDOM, o, null); f = T.nextNode(); )
|
|
2976
|
-
Xe(G.uponSanitizeShadowNode, f, null), sn(f), dn(f), f.content instanceof i && A(f.content);
|
|
2977
|
-
Xe(G.afterSanitizeShadowDOM, o, null);
|
|
2978
|
-
};
|
|
2979
|
-
return t.sanitize = function(A) {
|
|
2980
|
-
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = null, T = null, ce = null, Te = null;
|
|
2981
|
-
if (ut = !A, ut && (A = "<!-->"), typeof A != "string" && !on(A))
|
|
2982
|
-
if (typeof A.toString == "function") {
|
|
2983
|
-
if (A = A.toString(), typeof A != "string")
|
|
2984
|
-
throw bt("dirty is not a string, aborting");
|
|
2985
|
-
} else
|
|
2986
|
-
throw bt("toString is not a function");
|
|
2987
|
-
if (!t.isSupported)
|
|
2988
|
-
return A;
|
|
2989
|
-
if (Ye || Rt(o), t.removed = [], typeof A == "string" && (Y = !1), Y) {
|
|
2990
|
-
if (A.nodeName) {
|
|
2991
|
-
const Ke = xe(A.nodeName);
|
|
2992
|
-
if (!Z[Ke] || Be[Ke])
|
|
2993
|
-
throw bt("root node is forbidden and cannot be sanitized in-place");
|
|
2994
|
-
}
|
|
2995
|
-
} else if (A instanceof d)
|
|
2996
|
-
f = rn("<!---->"), T = f.ownerDocument.importNode(A, !0), T.nodeType === yt.element && T.nodeName === "BODY" || T.nodeName === "HTML" ? f = T : f.appendChild(T);
|
|
2997
|
-
else {
|
|
2998
|
-
if (!b && !oe && !Ue && // eslint-disable-next-line unicorn/prefer-includes
|
|
2999
|
-
A.indexOf("<") === -1)
|
|
3000
|
-
return F && y ? F.createHTML(A) : A;
|
|
3001
|
-
if (f = rn(A), !f)
|
|
3002
|
-
return b ? null : y ? ae : "";
|
|
3003
|
-
}
|
|
3004
|
-
f && Fe && $e(f.firstChild);
|
|
3005
|
-
const be = an(Y ? A : f);
|
|
3006
|
-
for (; ce = be.nextNode(); )
|
|
3007
|
-
sn(ce), dn(ce), ce.content instanceof i && rr(ce.content);
|
|
3008
|
-
if (Y)
|
|
3009
|
-
return A;
|
|
3010
|
-
if (b) {
|
|
3011
|
-
if (O)
|
|
3012
|
-
for (Te = M.call(f.ownerDocument); f.firstChild; )
|
|
3013
|
-
Te.appendChild(f.firstChild);
|
|
3014
|
-
else
|
|
3015
|
-
Te = f;
|
|
3016
|
-
return (ee.shadowroot || ee.shadowrootmode) && (Te = K.call(r, Te, !0)), Te;
|
|
3017
|
-
}
|
|
3018
|
-
let Ie = Ue ? f.outerHTML : f.innerHTML;
|
|
3019
|
-
return Ue && Z["!doctype"] && f.ownerDocument && f.ownerDocument.doctype && f.ownerDocument.doctype.name && Ne(Qn, f.ownerDocument.doctype.name) && (Ie = "<!DOCTYPE " + f.ownerDocument.doctype.name + `>
|
|
3020
|
-
` + Ie), oe && Tt([j, De, X], (Ke) => {
|
|
3021
|
-
Ie = pt(Ie, Ke, " ");
|
|
3022
|
-
}), F && y ? F.createHTML(Ie) : Ie;
|
|
3023
|
-
}, t.setConfig = function() {
|
|
3024
|
-
let A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3025
|
-
Rt(A), Ye = !0;
|
|
3026
|
-
}, t.clearConfig = function() {
|
|
3027
|
-
ct = null, Ye = !1;
|
|
3028
|
-
}, t.isValidAttribute = function(A, o, f) {
|
|
3029
|
-
ct || Rt({});
|
|
3030
|
-
const T = xe(A), ce = xe(o);
|
|
3031
|
-
return cn(T, ce, f);
|
|
3032
|
-
}, t.addHook = function(A, o) {
|
|
3033
|
-
typeof o == "function" && gt(G[A], o);
|
|
3034
|
-
}, t.removeHook = function(A, o) {
|
|
3035
|
-
if (o !== void 0) {
|
|
3036
|
-
const f = ko(G[A], o);
|
|
3037
|
-
return f === -1 ? void 0 : To(G[A], f, 1)[0];
|
|
3038
|
-
}
|
|
3039
|
-
return Tn(G[A]);
|
|
3040
|
-
}, t.removeHooks = function(A) {
|
|
3041
|
-
G[A] = [];
|
|
3042
|
-
}, t.removeAllHooks = function() {
|
|
3043
|
-
G = An();
|
|
3044
|
-
}, t;
|
|
3045
|
-
}
|
|
3046
|
-
var Uo = Xn();
|
|
3047
|
-
function On(e, t = !0) {
|
|
3048
|
-
return t ? Uo.sanitize(e, {
|
|
3049
|
-
ALLOWED_TAGS: [
|
|
3050
|
-
"b",
|
|
3051
|
-
"i",
|
|
3052
|
-
"em",
|
|
3053
|
-
"strong",
|
|
3054
|
-
"u",
|
|
3055
|
-
"span",
|
|
3056
|
-
"div",
|
|
3057
|
-
"p",
|
|
3058
|
-
"br",
|
|
3059
|
-
"h1",
|
|
3060
|
-
"h2",
|
|
3061
|
-
"h3",
|
|
3062
|
-
"h4",
|
|
3063
|
-
"h5",
|
|
3064
|
-
"h6",
|
|
3065
|
-
"ul",
|
|
3066
|
-
"ol",
|
|
3067
|
-
"li",
|
|
3068
|
-
"a",
|
|
3069
|
-
"img",
|
|
3070
|
-
"table",
|
|
3071
|
-
"thead",
|
|
3072
|
-
"tbody",
|
|
3073
|
-
"tr",
|
|
3074
|
-
"th",
|
|
3075
|
-
"td"
|
|
3076
|
-
],
|
|
3077
|
-
ALLOWED_ATTR: ["class", "style", "href", "src", "alt", "title"],
|
|
3078
|
-
ALLOW_DATA_ATTR: !1
|
|
3079
|
-
}) : e;
|
|
3080
|
-
}
|
|
3081
|
-
function Yo(e, t, n = !0) {
|
|
3082
|
-
if (!e) return null;
|
|
3083
|
-
if (typeof e == "function") {
|
|
3084
|
-
const r = e(t);
|
|
3085
|
-
return typeof r == "string" ? { __html: On(r, n) } : r;
|
|
3086
|
-
}
|
|
3087
|
-
return typeof e == "string" ? { __html: On(e, n) } : null;
|
|
3088
|
-
}
|
|
3089
|
-
function Go(e, t = "FirstDay") {
|
|
3090
|
-
switch (t) {
|
|
3091
|
-
case "FirstDay":
|
|
3092
|
-
return _t(e, { weekStartsOn: 0 });
|
|
3093
|
-
case "FirstFourDayWeek":
|
|
3094
|
-
return Yn(e);
|
|
3095
|
-
case "FirstFullWeek":
|
|
3096
|
-
return _t(e, {
|
|
3097
|
-
weekStartsOn: 0,
|
|
3098
|
-
firstWeekContainsDate: 1
|
|
3099
|
-
});
|
|
3100
|
-
default:
|
|
3101
|
-
return _t(e);
|
|
3102
|
-
}
|
|
3103
|
-
}
|
|
3104
|
-
const $o = (e, t, n, r, a, i, l, d, m, p = !0, u = !1) => {
|
|
3105
|
-
let s = 0, N = 0;
|
|
3106
|
-
if (p) {
|
|
3107
|
-
const $ = a / r, D = $ / l;
|
|
3108
|
-
s = t * a + n * $ + i * D, N = D * 0.98;
|
|
3109
|
-
} else {
|
|
3110
|
-
const $ = a / r, D = $ / l;
|
|
3111
|
-
s = n * a + t * $ + i * D, N = D * 0.98;
|
|
3112
|
-
}
|
|
3113
|
-
const h = ((e.start.getHours() - d) * 60 + e.start.getMinutes()) / m * 64, z = (e.end.getTime() - e.start.getTime()) / (1e3 * 60) / m * 64;
|
|
3114
|
-
return {
|
|
3115
|
-
top: `${h}px`,
|
|
3116
|
-
height: `${Math.max(z, 24)}px`,
|
|
3117
|
-
[u ? "right" : "left"]: `${s}%`,
|
|
3118
|
-
width: `${N}%`,
|
|
3119
|
-
[u ? "borderRightWidth" : "borderLeftWidth"]: "4px",
|
|
3120
|
-
borderColor: e.color || "hsl(var(--primary))"
|
|
3121
|
-
};
|
|
3122
|
-
}, Vo = ({ startHour: e, slotDuration: t, isRtl: n }) => {
|
|
3123
|
-
const r = Zt(), i = ((r.getHours() - e) * 60 + r.getMinutes()) / t * 64;
|
|
3124
|
-
return i < 0 ? null : /* @__PURE__ */ w(
|
|
3125
|
-
"div",
|
|
3126
|
-
{
|
|
3127
|
-
className: V("absolute inset-x-0 z-50 pointer-events-none flex items-center"),
|
|
3128
|
-
style: { top: `${i}px` },
|
|
3129
|
-
children: [
|
|
3130
|
-
/* @__PURE__ */ c("div", { className: "w-full border-t-2 border-primary" }),
|
|
3131
|
-
/* @__PURE__ */ c("div", { className: V("absolute w-3 h-3 bg-primary rounded-full shadow-sm ring-2 ring-background", n ? "-right-1.5" : "-left-1.5") })
|
|
3132
|
-
]
|
|
3133
|
-
}
|
|
3134
|
-
);
|
|
3135
|
-
}, jo = ({
|
|
3136
|
-
daysInView: e,
|
|
3137
|
-
visibleEvents: t,
|
|
3138
|
-
rowVirtualizer: n,
|
|
3139
|
-
resources: r = [],
|
|
3140
|
-
showResourcesInDayView: a = !1,
|
|
3141
|
-
onEventClick: i,
|
|
3142
|
-
onEventDoubleClick: l,
|
|
3143
|
-
onEventDelete: d,
|
|
3144
|
-
scrollRef: m,
|
|
3145
|
-
onViewChange: p,
|
|
3146
|
-
onDateChange: u,
|
|
3147
|
-
locale: s,
|
|
3148
|
-
onRangeSelect: N,
|
|
3149
|
-
onSlotClick: g,
|
|
3150
|
-
onSlotDoubleClick: h,
|
|
3151
|
-
dateHeaderTemplate: _,
|
|
3152
|
-
showWeekNumber: z = !1,
|
|
3153
|
-
weekRule: $ = "FirstDay",
|
|
3154
|
-
// timeFormat, // Unused
|
|
3155
|
-
cellTemplate: D,
|
|
3156
|
-
enableHtmlSanitizer: B = !0,
|
|
3157
|
-
showUnassignedLane: F = !1,
|
|
3158
|
-
startHour: ae = "00:00",
|
|
3159
|
-
slotDuration: x = 30,
|
|
3160
|
-
is24Hour: k = !0,
|
|
3161
|
-
setIs24Hour: M,
|
|
3162
|
-
// endHour, // Handled by rowVirtualizer
|
|
3163
|
-
group: S,
|
|
3164
|
-
onCellContextMenu: K,
|
|
3165
|
-
dir: G
|
|
3166
|
-
}) => {
|
|
3167
|
-
const j = G === "rtl", De = Zt(), X = parseInt(ae.split(":")[0], 10), [ne, Me] = Re(null), [fe, ve] = Re(!1), se = Mt(null), de = (y, C, E) => t.some(
|
|
3168
|
-
(W) => (W.isHoliday || W.isFullyBooked) && ye(W.start, y)
|
|
3169
|
-
) ? !0 : t.some(
|
|
3170
|
-
(W) => W.isBlock && // Check resource constraint: applies to specific resource, or globally if neither has resourceId
|
|
3171
|
-
(W.resourceId === E || !W.resourceId && !E) && Nt({ start: W.start, end: W.end }, { start: y, end: C })
|
|
3172
|
-
), Z = (y, C) => {
|
|
3173
|
-
const E = tt(y, x);
|
|
3174
|
-
if (de(y, E, C)) return;
|
|
3175
|
-
ve(!0);
|
|
3176
|
-
const I = { start: y, end: E, resourceId: C };
|
|
3177
|
-
Me(I), se.current = I;
|
|
3178
|
-
}, me = (y) => {
|
|
3179
|
-
if (!fe || !se.current) return;
|
|
3180
|
-
const C = new Date(y.getTime() + x * 60 * 1e3), E = { ...se.current, end: C };
|
|
3181
|
-
Me(E), se.current = E;
|
|
3182
|
-
};
|
|
3183
|
-
_e(() => {
|
|
3184
|
-
const y = (C) => {
|
|
3185
|
-
if (fe && se.current) {
|
|
3186
|
-
const { start: E, end: I, resourceId: W } = se.current, Y = E < I ? E : I, P = E < I ? I : E;
|
|
3187
|
-
de(Y, P, W) || (N?.(Y, P, W, { x: C.clientX, y: C.clientY }), g?.(Y, W));
|
|
3188
|
-
}
|
|
3189
|
-
ve(!1), Me(null), se.current = null;
|
|
3190
|
-
};
|
|
3191
|
-
return window.addEventListener("mouseup", y), () => window.removeEventListener("mouseup", y);
|
|
3192
|
-
}, [fe, N, g]);
|
|
3193
|
-
const ee = zn("(max-width: 768px)"), H = ze(() => {
|
|
3194
|
-
let y = a && r.length > 0 ? [...r] : [];
|
|
3195
|
-
return (F || a && y.length === 0) && (y.find((C) => C.id === "" || C.id === "unassigned") || y.unshift({ id: "unassigned", name: "Unassigned", type: "Global Inbox", color: "hsl(var(--muted-foreground))" })), y.length > 0 ? y : [{ id: "", name: "" }];
|
|
3196
|
-
}, [r, a, F]), R = ee && a && H.length > 1, Be = !ee && (H.length > 3 || e.length > 3 && H.length > 1), he = R || Be, U = e.length * H.length * 150, q = {
|
|
3197
|
-
width: he && U > 0 ? `${U}px` : "100%",
|
|
3198
|
-
minWidth: "100%"
|
|
3199
|
-
}, le = new Intl.DateTimeFormat(s, { day: "numeric" }), oe = S?.byDate ?? !0, Je = oe ? e : H, Ue = oe ? H : e, Ye = Je, Fe = Ue, b = 100 / Ye.length, O = 100 / Fe.length;
|
|
3200
|
-
return /* @__PURE__ */ w(
|
|
3201
|
-
"div",
|
|
3202
|
-
{
|
|
3203
|
-
ref: m,
|
|
3204
|
-
"data-testid": "scheduler-scroll-container",
|
|
3205
|
-
"data-view": "day-week",
|
|
3206
|
-
style: { scrollbarGutter: "stable" },
|
|
3207
|
-
className: V(
|
|
3208
|
-
"flex-1 flex flex-col min-h-0 relative overflow-auto bg-background select-none border border-border rounded-lg",
|
|
3209
|
-
he && "snap-x snap-mandatory"
|
|
3210
|
-
),
|
|
3211
|
-
children: [
|
|
3212
|
-
/* @__PURE__ */ w(
|
|
3213
|
-
"div",
|
|
3214
|
-
{
|
|
3215
|
-
className: "sticky top-0 z-50 bg-background/95 backdrop-blur-md border-b border-border flex shrink-0",
|
|
3216
|
-
style: q,
|
|
3217
|
-
children: [
|
|
3218
|
-
z && /* @__PURE__ */ c("div", { className: V(
|
|
3219
|
-
"w-12 shrink-0 sticky z-50 bg-background border-e border-border flex items-center justify-center",
|
|
3220
|
-
j ? "right-0" : "left-0"
|
|
3221
|
-
), children: /* @__PURE__ */ c("span", { className: "text-[9px] font-bold text-muted-foreground uppercase tracking-wider", children: "WK" }) }),
|
|
3222
|
-
/* @__PURE__ */ w(
|
|
3223
|
-
"div",
|
|
3224
|
-
{
|
|
3225
|
-
className: V(
|
|
3226
|
-
"w-24 shrink-0 sticky bg-background border-e border-border z-50 cursor-pointer hover:bg-muted/50 transition-colors flex flex-col items-center justify-center gap-1 group",
|
|
3227
|
-
z ? j ? "right-12" : "left-12" : j ? "right-0" : "left-0"
|
|
3228
|
-
),
|
|
3229
|
-
onClick: () => M?.(!k),
|
|
3230
|
-
title: "Toggle 24h / AM-PM format",
|
|
3231
|
-
children: [
|
|
3232
|
-
/* @__PURE__ */ c(Wr, { className: "w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" }),
|
|
3233
|
-
/* @__PURE__ */ c("span", { className: "text-[9px] font-bold uppercase text-muted-foreground/60 group-hover:text-primary/70", children: k ? "24 Hours" : "AM / PM" })
|
|
3234
|
-
]
|
|
3235
|
-
}
|
|
3236
|
-
),
|
|
3237
|
-
/* @__PURE__ */ c("div", { className: "flex flex-1", style: he ? { width: "100%" } : void 0, children: Ye.map((y) => {
|
|
3238
|
-
const C = oe, E = C ? y : null, I = C ? null : y, W = C && ye(E, /* @__PURE__ */ new Date());
|
|
3239
|
-
return /* @__PURE__ */ w(
|
|
3240
|
-
"div",
|
|
3241
|
-
{
|
|
3242
|
-
style: { width: `${b}%` },
|
|
3243
|
-
className: "flex flex-col border-e border-border last:border-e-0",
|
|
3244
|
-
children: [
|
|
3245
|
-
/* @__PURE__ */ c(
|
|
3246
|
-
"div",
|
|
3247
|
-
{
|
|
3248
|
-
className: V(
|
|
3249
|
-
"flex flex-col items-center justify-center py-3 transition-colors shrink-0 border-e-2 border-foreground/20",
|
|
3250
|
-
W && "bg-background"
|
|
3251
|
-
),
|
|
3252
|
-
children: C ? (() => {
|
|
3253
|
-
const Y = t.find((P) => (P.isHoliday || P.isFullyBooked) && ye(P.start, E));
|
|
3254
|
-
return /* @__PURE__ */ w("div", { className: "flex flex-col items-center relative w-full", children: [
|
|
3255
|
-
Y?.isHoliday && /* @__PURE__ */ c("span", { className: "absolute -top-1 px-1.5 py-0.5 bg-destructive/10 text-destructive text-[9px] font-black uppercase tracking-tighter rounded-full border border-destructive/20 mb-1 leading-none shadow-sm", children: "Holiday" }),
|
|
3256
|
-
Y?.isFullyBooked && /* @__PURE__ */ c("span", { className: "absolute -top-1 px-1.5 py-0.5 bg-warning/10 text-warning-foreground text-[9px] font-black uppercase tracking-tighter rounded-full border border-warning/20 mb-1 leading-none shadow-sm", children: "Fully Booked" }),
|
|
3257
|
-
_ ? /* @__PURE__ */ c("div", { className: "h-full w-full flex items-center justify-center pt-2", children: typeof _ == "function" ? _({ date: E, type: "Day", text: le.format(E) }) : _ }) : /* @__PURE__ */ c(
|
|
3258
|
-
"div",
|
|
3259
|
-
{
|
|
3260
|
-
className: "flex flex-col items-center cursor-pointer hover:bg-muted/50 transition-colors pt-2",
|
|
3261
|
-
onClick: () => {
|
|
3262
|
-
p && u && (u(E), p("day"));
|
|
3263
|
-
},
|
|
3264
|
-
children: e.length > 1 && /* @__PURE__ */ w(xt, { children: [
|
|
3265
|
-
/* @__PURE__ */ c("span", { className: V("text-base font-medium mt-0.5", W ? "text-primary font-bold" : "text-foreground"), children: ue(E, "dd MMM yyyy") }),
|
|
3266
|
-
/* @__PURE__ */ c("span", { className: V("text-sm font-medium uppercase tracking-wider", W ? "text-primary" : "text-muted-foreground/80"), children: ue(E, "EEE") })
|
|
3267
|
-
] })
|
|
3268
|
-
}
|
|
3269
|
-
)
|
|
3270
|
-
] });
|
|
3271
|
-
})() : (
|
|
3272
|
-
// Resource Header Logic (New Top Level)
|
|
3273
|
-
/* @__PURE__ */ w("div", { className: "flex items-center gap-2 px-2", children: [
|
|
3274
|
-
/* @__PURE__ */ w(qt, { className: "h-8 w-8 shadow-sm border border-background", children: [
|
|
3275
|
-
I.avatar && /* @__PURE__ */ c(Qt, { src: I.avatar }),
|
|
3276
|
-
/* @__PURE__ */ c(Xt, { className: "text-xs font-bold", children: I.name?.charAt(0) })
|
|
3277
|
-
] }),
|
|
3278
|
-
/* @__PURE__ */ w("div", { className: "flex flex-col", children: [
|
|
3279
|
-
/* @__PURE__ */ c("span", { className: "text-sm font-bold truncate", children: I.name }),
|
|
3280
|
-
/* @__PURE__ */ c("span", { className: "text-[10px] text-muted-foreground truncate", children: I.type || "Resource" })
|
|
3281
|
-
] })
|
|
3282
|
-
] })
|
|
3283
|
-
)
|
|
3284
|
-
}
|
|
3285
|
-
),
|
|
3286
|
-
Fe.length > 0 && /* @__PURE__ */ c("div", { className: "flex w-full border-t border-border bg-background h-10 shrink-0", children: Fe.map((Y, P) => {
|
|
3287
|
-
const L = C ? null : Y, te = C ? Y : null, J = L ? t.find((ge) => ge.isHoliday && ye(ge.start, L)) : null, Se = L ? t.find((ge) => ge.isFullyBooked && ye(ge.start, L)) : null;
|
|
3288
|
-
return /* @__PURE__ */ c(
|
|
3289
|
-
"div",
|
|
3290
|
-
{
|
|
3291
|
-
style: { width: `${O}%` },
|
|
3292
|
-
className: V(
|
|
3293
|
-
"flex items-center justify-center px-1 border-e border-border/30 last:border-e-0 group",
|
|
3294
|
-
he && "snap-center",
|
|
3295
|
-
(P % 2 === 0, "bg-background")
|
|
3296
|
-
),
|
|
3297
|
-
children: C ? (
|
|
3298
|
-
// Secondary: Resource (Existing logic)
|
|
3299
|
-
/* @__PURE__ */ w(xt, { children: [
|
|
3300
|
-
/* @__PURE__ */ w(qt, { className: "h-4 w-4 me-1 shadow-sm border border-background", children: [
|
|
3301
|
-
te.avatar && /* @__PURE__ */ c(Qt, { src: te.avatar }),
|
|
3302
|
-
/* @__PURE__ */ c(Xt, { className: "text-[7px] font-bold", children: te.name?.charAt(0) })
|
|
3303
|
-
] }),
|
|
3304
|
-
/* @__PURE__ */ c("span", { className: "text-[9px] font-bold text-muted-foreground truncate group-hover:text-foreground transition-colors", children: te.name })
|
|
3305
|
-
] })
|
|
3306
|
-
) : (
|
|
3307
|
-
// Secondary: Day (New Logic)
|
|
3308
|
-
/* @__PURE__ */ w("div", { className: "flex flex-col items-center justify-center", children: [
|
|
3309
|
-
J && /* @__PURE__ */ c("span", { className: "text-xs font-black uppercase tracking-wider text-destructive bg-destructive/10 px-2 py-0.5 rounded-sm mb-0.5", children: "Holiday" }),
|
|
3310
|
-
Se && /* @__PURE__ */ c("span", { className: "text-xs font-black uppercase tracking-wider text-warning-foreground bg-warning/10 px-2 py-0.5 rounded-sm mb-0.5", children: "Fully Booked" }),
|
|
3311
|
-
/* @__PURE__ */ c("span", { className: V(
|
|
3312
|
-
"text-[10px] font-bold text-muted-foreground uppercase",
|
|
3313
|
-
J && "text-destructive",
|
|
3314
|
-
Se && "text-amber-600"
|
|
3315
|
-
), children: ue(L, "EEE d") })
|
|
3316
|
-
] })
|
|
3317
|
-
)
|
|
3318
|
-
},
|
|
3319
|
-
L ? L.toISOString() : te.id
|
|
3320
|
-
);
|
|
3321
|
-
}) })
|
|
3322
|
-
]
|
|
3323
|
-
},
|
|
3324
|
-
C ? E.toISOString() : I.id
|
|
3325
|
-
);
|
|
3326
|
-
}) })
|
|
3327
|
-
]
|
|
3328
|
-
}
|
|
3329
|
-
),
|
|
3330
|
-
/* @__PURE__ */ w(
|
|
3331
|
-
"div",
|
|
3332
|
-
{
|
|
3333
|
-
"data-testid": "scheduler-virtual-body",
|
|
3334
|
-
className: "relative shrink-0",
|
|
3335
|
-
style: {
|
|
3336
|
-
height: `${n.getTotalSize()}px`,
|
|
3337
|
-
...q
|
|
3338
|
-
},
|
|
3339
|
-
children: [
|
|
3340
|
-
n.getVirtualItems().map((y) => {
|
|
3341
|
-
const C = y.index * x, E = X + Math.floor(C / 60), I = C % 60;
|
|
3342
|
-
let W = "";
|
|
3343
|
-
if (k)
|
|
3344
|
-
W = `${E < 10 ? "0" + E : E}:${I < 10 ? "0" + I : I}`;
|
|
3345
|
-
else {
|
|
3346
|
-
const Y = E >= 12 ? "PM" : "AM", P = E % 12 || 12;
|
|
3347
|
-
W = `${P < 10 ? "0" + P : P}:${I < 10 ? "0" + I : I} ${Y}`;
|
|
3348
|
-
}
|
|
3349
|
-
return /* @__PURE__ */ w(
|
|
3350
|
-
"div",
|
|
3351
|
-
{
|
|
3352
|
-
className: "absolute left-0 w-full flex",
|
|
3353
|
-
style: {
|
|
3354
|
-
height: "64px",
|
|
3355
|
-
top: `${y.start}px`
|
|
3356
|
-
},
|
|
3357
|
-
children: [
|
|
3358
|
-
/* @__PURE__ */ w("div", { className: V(
|
|
3359
|
-
"w-24 shrink-0 flex flex-col items-end justify-center pe-3 border-e border-border bg-background z-50 sticky backdrop-blur-md",
|
|
3360
|
-
j ? "right-0" : "left-0"
|
|
3361
|
-
), children: [
|
|
3362
|
-
W && /* @__PURE__ */ c("span", { className: "text-sm text-foreground font-black bg-background px-1 relative z-50 uppercase tracking-tighter tabular-nums", children: W }),
|
|
3363
|
-
z && E === 0 && /* @__PURE__ */ w("span", { className: "text-[9px] text-muted-foreground/60 font-semibold mt-1", children: [
|
|
3364
|
-
"W",
|
|
3365
|
-
Go(e[0], $)
|
|
3366
|
-
] })
|
|
3367
|
-
] }),
|
|
3368
|
-
/* @__PURE__ */ w("div", { className: "flex flex-1 relative", style: { height: "64px" }, children: [
|
|
3369
|
-
/* @__PURE__ */ c("div", { className: "absolute bottom-0 left-0 w-full border-b border-border/40" }),
|
|
3370
|
-
/* @__PURE__ */ c("div", { className: "absolute top-1/2 left-0 w-full border-b border-dashed border-border/20 h-px" }),
|
|
3371
|
-
Ye.map((Y) => /* @__PURE__ */ c("div", { style: { width: `${b}%` }, className: "h-full flex relative border-e-2 border-foreground/20 last:border-e-0", children: Fe.map((P, L) => {
|
|
3372
|
-
const te = oe ? Y : P, J = oe ? P : Y, Se = y.index + X, ge = te.getDay(), Ge = t.find((Ee) => Ee.isHoliday && ye(Ee.start, te)), nt = t.find((Ee) => Ee.isFullyBooked && ye(Ee.start, te));
|
|
3373
|
-
let Qe = !0;
|
|
3374
|
-
J.workingHours ? Qe = J.workingHours.days.includes(ge) && Se >= J.workingHours.start && Se < J.workingHours.end : Qe = ge !== 0 && ge !== 6 && Se >= 9 && Se < 17;
|
|
3375
|
-
const pe = new Date(new Date(te).setHours(E, I, 0, 0)), Ze = ye(te, /* @__PURE__ */ new Date()), ut = !!ne && ne.resourceId === J.id && pe >= ne.start && pe < ne.end;
|
|
3376
|
-
return /* @__PURE__ */ c(
|
|
3377
|
-
xo,
|
|
3378
|
-
{
|
|
3379
|
-
date: pe,
|
|
3380
|
-
resourceId: J.id,
|
|
3381
|
-
isWorkHour: Qe,
|
|
3382
|
-
isSelected: ut,
|
|
3383
|
-
onMouseDown: () => Z(pe, J.id),
|
|
3384
|
-
onMouseEnter: () => me(pe),
|
|
3385
|
-
onDoubleClick: () => {
|
|
3386
|
-
const Ee = tt(pe, x);
|
|
3387
|
-
de(pe, Ee, J.id) || h?.(pe, J.id);
|
|
3388
|
-
},
|
|
3389
|
-
onContextMenu: (Ee) => {
|
|
3390
|
-
Ee.preventDefault(), K?.({ date: pe, x: Ee.clientX, y: Ee.clientY });
|
|
3391
|
-
},
|
|
3392
|
-
style: {
|
|
3393
|
-
width: `${O}%`,
|
|
3394
|
-
minWidth: "auto",
|
|
3395
|
-
// Fix minWidth logic later if needed
|
|
3396
|
-
height: "100%"
|
|
3397
|
-
},
|
|
3398
|
-
className: V(
|
|
3399
|
-
"border-e border-border/30 relative cursor-pointer hover:bg-primary/5 transition-colors pointer-events-auto",
|
|
3400
|
-
L === Fe.length - 1 && "border-e-0",
|
|
3401
|
-
// Remove border for last sub-column only
|
|
3402
|
-
he && "snap-center",
|
|
3403
|
-
Ge && "bg-[repeating-linear-gradient(-45deg,hsl(var(--destructive)/0.05)_0px,hsl(var(--destructive)/0.05)_10px,transparent_10px,transparent_20px)] bg-destructive/[0.02]",
|
|
3404
|
-
nt && "bg-[repeating-linear-gradient(-45deg,theme(colors.warning/0.05)_0px,theme(colors.warning/0.05)_10px,transparent_10px,transparent_20px)] bg-warning/[0.02]",
|
|
3405
|
-
!Ge && !nt && "bg-background"
|
|
3406
|
-
),
|
|
3407
|
-
children: D ? (() => {
|
|
3408
|
-
const Ee = { date: pe, resourceId: J.id, isWorkHour: Qe, isToday: Ze }, rt = Yo(D, Ee, B);
|
|
3409
|
-
return rt && typeof rt == "object" && "__html" in rt ? /* @__PURE__ */ c("div", { className: "w-full h-full", dangerouslySetInnerHTML: rt }) : /* @__PURE__ */ c("div", { className: "w-full h-full", children: rt });
|
|
3410
|
-
})() : null
|
|
3411
|
-
},
|
|
3412
|
-
oe ? J.id || L : te.toISOString() || L
|
|
3413
|
-
);
|
|
3414
|
-
}) }, oe ? Y.toISOString() : Y.id))
|
|
3415
|
-
] })
|
|
3416
|
-
]
|
|
3417
|
-
},
|
|
3418
|
-
y.index
|
|
3419
|
-
);
|
|
3420
|
-
}),
|
|
3421
|
-
/* @__PURE__ */ w(
|
|
3422
|
-
"div",
|
|
3423
|
-
{
|
|
3424
|
-
className: "absolute top-0 h-full z-10",
|
|
3425
|
-
style: {
|
|
3426
|
-
width: "calc(100% - 6rem)",
|
|
3427
|
-
[j ? "right" : "left"]: "6rem",
|
|
3428
|
-
pointerEvents: "none"
|
|
3429
|
-
},
|
|
3430
|
-
children: [
|
|
3431
|
-
/* @__PURE__ */ c(Vo, { startHour: X, slotDuration: x, isRtl: j }),
|
|
3432
|
-
e.map((y, C) => {
|
|
3433
|
-
const E = t.filter((W) => ye(y, W.start));
|
|
3434
|
-
E.sort((W, Y) => W.start.getTime() - Y.start.getTime());
|
|
3435
|
-
const I = /* @__PURE__ */ new Map();
|
|
3436
|
-
return E.forEach((W) => {
|
|
3437
|
-
let Y = W.resourceId;
|
|
3438
|
-
!Y && F && (Y = "unassigned");
|
|
3439
|
-
let P = H.findIndex((L) => L.id === Y);
|
|
3440
|
-
if (P === -1)
|
|
3441
|
-
if (H.length === 1 && (H[0].id === "" || !a))
|
|
3442
|
-
P = 0;
|
|
3443
|
-
else
|
|
3444
|
-
return;
|
|
3445
|
-
I.has(P) || I.set(P, []), I.get(P).push(W);
|
|
3446
|
-
}), [...I.entries()].map(([W, Y]) => {
|
|
3447
|
-
const P = [];
|
|
3448
|
-
return Y.forEach((L) => {
|
|
3449
|
-
let te = !1;
|
|
3450
|
-
for (const J of P)
|
|
3451
|
-
if (J.some((Se) => Nt({ start: Se.start, end: Se.end }, { start: L.start, end: L.end }))) {
|
|
3452
|
-
J.push(L), te = !0;
|
|
3453
|
-
break;
|
|
3454
|
-
}
|
|
3455
|
-
te || P.push([L]);
|
|
3456
|
-
}), P.map((L) => {
|
|
3457
|
-
const te = [];
|
|
3458
|
-
return L.forEach((J) => {
|
|
3459
|
-
let Se = !1;
|
|
3460
|
-
for (let ge = 0; ge < te.length; ge++)
|
|
3461
|
-
if (!te[ge].some((Ge) => Nt({ start: Ge.start, end: Ge.end }, { start: J.start, end: J.end }))) {
|
|
3462
|
-
te[ge].push(J), Se = !0;
|
|
3463
|
-
break;
|
|
3464
|
-
}
|
|
3465
|
-
Se || te.push([J]);
|
|
3466
|
-
}), L.map((J) => {
|
|
3467
|
-
const Se = te.findIndex((Ge) => Ge.includes(J)), ge = $o(
|
|
3468
|
-
J,
|
|
3469
|
-
C,
|
|
3470
|
-
W,
|
|
3471
|
-
oe ? H.length : e.length,
|
|
3472
|
-
b,
|
|
3473
|
-
Se,
|
|
3474
|
-
te.length,
|
|
3475
|
-
X,
|
|
3476
|
-
x,
|
|
3477
|
-
oe,
|
|
3478
|
-
j
|
|
3479
|
-
);
|
|
3480
|
-
return /* @__PURE__ */ c(
|
|
3481
|
-
Vn,
|
|
3482
|
-
{
|
|
3483
|
-
event: J,
|
|
3484
|
-
style: ge,
|
|
3485
|
-
onClick: i,
|
|
3486
|
-
onDoubleClick: l,
|
|
3487
|
-
onDelete: d,
|
|
3488
|
-
orientation: "vertical",
|
|
3489
|
-
resizable: !0,
|
|
3490
|
-
isBlocked: J.isBlock,
|
|
3491
|
-
isPast: J.end < De,
|
|
3492
|
-
slotDuration: x,
|
|
3493
|
-
pixelsPerSlot: 64
|
|
3494
|
-
},
|
|
3495
|
-
J.id
|
|
3496
|
-
);
|
|
3497
|
-
});
|
|
3498
|
-
});
|
|
3499
|
-
});
|
|
3500
|
-
})
|
|
3501
|
-
]
|
|
3502
|
-
}
|
|
3503
|
-
)
|
|
3504
|
-
]
|
|
3505
|
-
}
|
|
3506
|
-
)
|
|
3507
|
-
]
|
|
3508
|
-
}
|
|
3509
|
-
);
|
|
3510
|
-
}, qo = ({
|
|
3511
|
-
currentDate: e,
|
|
3512
|
-
daysInView: t,
|
|
3513
|
-
visibleEvents: n,
|
|
3514
|
-
onSlotClick: r,
|
|
3515
|
-
onSlotDoubleClick: a,
|
|
3516
|
-
onEventClick: i,
|
|
3517
|
-
moreEventsClick: l,
|
|
3518
|
-
// monthsCount = 1,
|
|
3519
|
-
dir: d
|
|
3520
|
-
}) => {
|
|
3521
|
-
const m = d === "rtl", p = (u) => n.filter((s) => ye(s.start, u));
|
|
3522
|
-
return /* @__PURE__ */ c(Rr, { children: /* @__PURE__ */ w("div", { className: "flex flex-col h-full w-full bg-background rounded-xl border border-border overflow-hidden shadow-sm", children: [
|
|
3523
|
-
/* @__PURE__ */ c("div", { className: "grid grid-cols-7 border-b border-border bg-muted/30", children: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].map((u, s) => /* @__PURE__ */ c("div", { className: "py-3 text-center text-xs font-semibold uppercase text-muted-foreground tracking-widest", children: u }, s)) }),
|
|
3524
|
-
/* @__PURE__ */ c("div", { className: "grid grid-cols-7 grid-rows-6 flex-1 min-h-0 bg-muted/20 gap-px", children: t.map((u) => {
|
|
3525
|
-
const s = p(u).filter((D) => !D.isBlock), N = Xa(u, e), g = ye(u, /* @__PURE__ */ new Date()), h = 4, _ = s.slice(0, h), z = s.length - h, $ = s.length;
|
|
3526
|
-
return /* @__PURE__ */ w(
|
|
3527
|
-
"div",
|
|
3528
|
-
{
|
|
3529
|
-
onClick: () => r?.(u),
|
|
3530
|
-
onDoubleClick: () => a?.(u),
|
|
3531
|
-
className: V(
|
|
3532
|
-
"relative flex flex-col p-2 transition-colors group bg-background focus-visible:z-10",
|
|
3533
|
-
!N && "bg-muted/5 text-muted-foreground/50",
|
|
3534
|
-
N && "hover:bg-muted/30",
|
|
3535
|
-
"min-h-[100px]"
|
|
3536
|
-
),
|
|
3537
|
-
children: [
|
|
3538
|
-
/* @__PURE__ */ w("div", { className: V("flex items-center justify-between mb-1"), children: [
|
|
3539
|
-
/* @__PURE__ */ c(
|
|
3540
|
-
"span",
|
|
3541
|
-
{
|
|
3542
|
-
className: V(
|
|
3543
|
-
"text-sm font-medium w-7 h-7 flex items-center justify-center rounded-full transition-all",
|
|
3544
|
-
g ? "bg-primary text-primary-foreground shadow-sm font-bold scale-110" : "text-foreground group-hover:bg-muted/50",
|
|
3545
|
-
!N && "text-muted-foreground opacity-50"
|
|
3546
|
-
),
|
|
3547
|
-
children: ue(u, "d")
|
|
3548
|
-
}
|
|
3549
|
-
),
|
|
3550
|
-
$ > 0 && /* @__PURE__ */ c("span", { className: "text-[10px] text-muted-foreground font-medium px-1.5 py-0.5 rounded-full bg-muted/50", children: $ })
|
|
3551
|
-
] }),
|
|
3552
|
-
/* @__PURE__ */ w("div", { className: "flex-1 flex flex-col gap-1.5 min-w-0", children: [
|
|
3553
|
-
_.map((D) => /* @__PURE__ */ w(Pr, { delayDuration: 300, children: [
|
|
3554
|
-
/* @__PURE__ */ c(Lr, { asChild: !0, children: /* @__PURE__ */ w(
|
|
3555
|
-
"div",
|
|
3556
|
-
{
|
|
3557
|
-
onClick: (B) => {
|
|
3558
|
-
B.stopPropagation(), i?.(D);
|
|
3559
|
-
},
|
|
3560
|
-
className: V(
|
|
3561
|
-
"group/event relative",
|
|
3562
|
-
"flex items-center gap-2 px-2 py-1 rounded-md text-xs font-medium cursor-pointer transition-all shadow-sm hover:shadow-md border border-transparent hover:border-border/50 overflow-hidden bg-card hover:bg-accent/50",
|
|
3563
|
-
!N && "opacity-60 grayscale"
|
|
3564
|
-
),
|
|
3565
|
-
style: {
|
|
3566
|
-
[m ? "borderRight" : "borderLeft"]: `3px solid ${D.color || "oklch(var(--primary))"}`
|
|
3567
|
-
},
|
|
3568
|
-
children: [
|
|
3569
|
-
/* @__PURE__ */ c("div", { className: "flex-1 truncate leading-tight", children: D.title }),
|
|
3570
|
-
D.start && /* @__PURE__ */ c("span", { className: "text-[10px] text-muted-foreground/70 tabular-nums shrink-0", children: ue(D.start, "h:mm a") })
|
|
3571
|
-
]
|
|
3572
|
-
}
|
|
3573
|
-
) }),
|
|
3574
|
-
/* @__PURE__ */ c(zr, { className: "p-3 max-w-xs bg-popover/95 backdrop-blur-sm border-border/50 shadow-xl", sideOffset: 5, children: /* @__PURE__ */ w("div", { className: "space-y-1.5", children: [
|
|
3575
|
-
/* @__PURE__ */ w("div", { className: "flex items-center gap-2 border-b border-border/50 pb-1.5", children: [
|
|
3576
|
-
/* @__PURE__ */ c("div", { className: "w-2 h-2 rounded-full shrink-0", style: { backgroundColor: D.color || "oklch(var(--primary))" } }),
|
|
3577
|
-
/* @__PURE__ */ c("span", { className: "font-semibold text-sm truncate", children: D.title })
|
|
3578
|
-
] }),
|
|
3579
|
-
/* @__PURE__ */ w("div", { className: "text-xs text-muted-foreground space-y-0.5", children: [
|
|
3580
|
-
/* @__PURE__ */ w("div", { className: "flex items-center gap-1.5", children: [
|
|
3581
|
-
/* @__PURE__ */ c("span", { className: "font-medium text-foreground/80", children: "Time:" }),
|
|
3582
|
-
/* @__PURE__ */ w("span", { children: [
|
|
3583
|
-
ue(D.start, "MMM d, h:mm a"),
|
|
3584
|
-
" - ",
|
|
3585
|
-
ue(D.end, "h:mm a")
|
|
3586
|
-
] })
|
|
3587
|
-
] }),
|
|
3588
|
-
D.location && /* @__PURE__ */ w("div", { className: "flex items-center gap-1.5", children: [
|
|
3589
|
-
/* @__PURE__ */ c("span", { className: "font-medium text-foreground/80", children: "Location:" }),
|
|
3590
|
-
/* @__PURE__ */ c("span", { children: D.location })
|
|
3591
|
-
] }),
|
|
3592
|
-
D.description && /* @__PURE__ */ c("div", { className: "pt-1 mt-1 border-t border-border/30 text-muted-foreground/80 line-clamp-3", children: D.description })
|
|
3593
|
-
] })
|
|
3594
|
-
] }) })
|
|
3595
|
-
] }, D.id)),
|
|
3596
|
-
z > 0 && /* @__PURE__ */ w(
|
|
3597
|
-
"button",
|
|
3598
|
-
{
|
|
3599
|
-
onClick: (D) => {
|
|
3600
|
-
D.stopPropagation(), l?.({ date: u });
|
|
3601
|
-
},
|
|
3602
|
-
className: "mt-auto self-start text-[10px] bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground font-medium px-2 py-1 rounded-md transition-colors w-full text-left",
|
|
3603
|
-
children: [
|
|
3604
|
-
"+",
|
|
3605
|
-
z,
|
|
3606
|
-
" more"
|
|
3607
|
-
]
|
|
3608
|
-
}
|
|
3609
|
-
)
|
|
3610
|
-
] })
|
|
3611
|
-
]
|
|
3612
|
-
},
|
|
3613
|
-
u.toISOString()
|
|
3614
|
-
);
|
|
3615
|
-
}) })
|
|
3616
|
-
] }) });
|
|
3617
|
-
}, Qo = ({
|
|
3618
|
-
view: e,
|
|
3619
|
-
daysInView: t,
|
|
3620
|
-
visibleEvents: n,
|
|
3621
|
-
resources: r = [],
|
|
3622
|
-
onSlotClick: a,
|
|
3623
|
-
onSlotDoubleClick: i,
|
|
3624
|
-
onEventClick: l,
|
|
3625
|
-
onEventDelete: d,
|
|
3626
|
-
onRangeSelect: m,
|
|
3627
|
-
currentTimeIndicator: p,
|
|
3628
|
-
showResourceHeaders: u = !0,
|
|
3629
|
-
group: s,
|
|
3630
|
-
showUnassignedLane: N = !1,
|
|
3631
|
-
startHour: g = "00:00",
|
|
3632
|
-
endHour: h = "24:00",
|
|
3633
|
-
slotDuration: _ = 60,
|
|
3634
|
-
is24Hour: z = !1,
|
|
3635
|
-
scrollRef: $,
|
|
3636
|
-
dir: D
|
|
3637
|
-
}) => {
|
|
3638
|
-
const B = D === "rtl", F = Zt(), ae = g ? parseInt(g.split(":")[0], 10) : 0, x = h ? parseInt(h.split(":")[0], 10) : 24, k = x - ae, [M, S] = Re(null), [K, G] = Re(!1), j = Mt(null), De = Mt(null), X = e === "timeline-month", ne = X ? 1440 : _, Me = 60 / ne, fe = X ? 1 : k * Me, ve = t.length * fe, se = X ? 120 : 80, de = ve * se, Z = ze(() => {
|
|
3639
|
-
const b = r.length > 0 ? [...r] : [];
|
|
3640
|
-
return (N || b.length === 0) && (b.find((O) => O.id === "unassigned") || b.unshift({ id: "unassigned", name: "Unassigned", type: "Global Inbox", color: "hsl(var(--muted-foreground))" })), b;
|
|
3641
|
-
}, [r, N]), me = ze(() => {
|
|
3642
|
-
if (!s || !s.resources || s.resources.length === 0)
|
|
3643
|
-
return {
|
|
3644
|
-
isGrouped: !1,
|
|
3645
|
-
groups: [{ name: "All", resources: Z }]
|
|
3646
|
-
};
|
|
3647
|
-
const b = s.resources[0], O = /* @__PURE__ */ new Map();
|
|
3648
|
-
Z.forEach((C) => {
|
|
3649
|
-
const E = C[b] || "Unassigned";
|
|
3650
|
-
O.has(E) || O.set(E, []), O.get(E)?.push(C);
|
|
3651
|
-
});
|
|
3652
|
-
const y = [];
|
|
3653
|
-
return O.forEach((C, E) => {
|
|
3654
|
-
y.push({ name: E, resources: C });
|
|
3655
|
-
}), { isGrouped: !0, groups: y };
|
|
3656
|
-
}, [Z, s]), ee = ze(() => me.groups.flatMap((b) => b.resources), [me]), H = (b) => {
|
|
3657
|
-
if (X)
|
|
3658
|
-
return Le(t[b]);
|
|
3659
|
-
const O = Math.floor(b / fe), y = b % fe, C = Le(t[O]);
|
|
3660
|
-
return tt(C, ae * 60 + y * ne);
|
|
3661
|
-
}, R = (b) => {
|
|
3662
|
-
if (X) {
|
|
3663
|
-
const I = t.findIndex((W) => ye(W, Le(b)));
|
|
3664
|
-
return I !== -1 ? I * se : -1;
|
|
3665
|
-
}
|
|
3666
|
-
const O = Le(b), y = t.findIndex((I) => ye(I, O));
|
|
3667
|
-
if (y === -1) return -1;
|
|
3668
|
-
const E = Xr(b, O) - ae * 60;
|
|
3669
|
-
return (y * k * 60 + E) / ne * se;
|
|
3670
|
-
}, he = (() => {
|
|
3671
|
-
if (X) {
|
|
3672
|
-
const y = Le(t[0]), C = Le(t[t.length - 1]);
|
|
3673
|
-
return F < y || F > C ? null : R(F);
|
|
3674
|
-
}
|
|
3675
|
-
const b = R(F), O = F.getHours();
|
|
3676
|
-
return b === -1 || O < ae || O >= x ? null : b;
|
|
3677
|
-
})(), Oe = Mt(!1);
|
|
3678
|
-
_e(() => {
|
|
3679
|
-
$?.current && he !== null && !Oe.current && setTimeout(() => {
|
|
3680
|
-
$.current && (B ? $.current.scrollLeft = -he : $.current.scrollLeft = he, Oe.current = !0);
|
|
3681
|
-
}, 50);
|
|
3682
|
-
}, [$, he, e]);
|
|
3683
|
-
const v = (b, O) => {
|
|
3684
|
-
const y = H(b);
|
|
3685
|
-
if (n.some(
|
|
3686
|
-
(I) => (I.isHoliday || I.isFullyBooked) && ye(I.start, y)
|
|
3687
|
-
)) return;
|
|
3688
|
-
G(!0);
|
|
3689
|
-
const E = { startSlot: b, endSlot: b, resourceId: O };
|
|
3690
|
-
S(E), j.current = E;
|
|
3691
|
-
}, U = (b) => {
|
|
3692
|
-
if (!K || !j.current) return;
|
|
3693
|
-
const O = { ...j.current, endSlot: b };
|
|
3694
|
-
S(O), j.current = O;
|
|
3695
|
-
};
|
|
3696
|
-
_e(() => {
|
|
3697
|
-
const b = (O) => {
|
|
3698
|
-
if (K && j.current) {
|
|
3699
|
-
const { startSlot: y, endSlot: C, resourceId: E } = j.current, I = Math.min(y, C), W = Math.max(y, C), Y = H(I), P = H(W + 1);
|
|
3700
|
-
n.some(
|
|
3701
|
-
(te) => (te.isHoliday || te.isFullyBooked) && ye(te.start, Y)
|
|
3702
|
-
) || (m?.(Y, P, E, { x: O.clientX, y: O.clientY }), a?.(Y, E));
|
|
3703
|
-
}
|
|
3704
|
-
G(!1), S(null), j.current = null;
|
|
3705
|
-
};
|
|
3706
|
-
return window.addEventListener("mouseup", b), () => window.removeEventListener("mouseup", b);
|
|
3707
|
-
}, [K, m, a, t]);
|
|
3708
|
-
const q = (b, O) => {
|
|
3709
|
-
if (!M || M.resourceId !== O) return !1;
|
|
3710
|
-
const y = Math.min(M.startSlot, M.endSlot), C = Math.max(M.startSlot, M.endSlot);
|
|
3711
|
-
return b >= y && b <= C;
|
|
3712
|
-
}, { resourceMap: le, maxLevels: oe } = ze(() => {
|
|
3713
|
-
const b = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
|
|
3714
|
-
return ee.forEach((y) => {
|
|
3715
|
-
b.set(y.id, []), O.set(y.id, 1);
|
|
3716
|
-
}), n.forEach((y) => {
|
|
3717
|
-
const C = y.resourceId || "unassigned", E = String(C);
|
|
3718
|
-
b.has(E) ? b.get(E)?.push(y) : b.has("unassigned");
|
|
3719
|
-
}), b.forEach((y, C) => {
|
|
3720
|
-
const E = [...y].sort((Y, P) => Y.start.getTime() - P.start.getTime()), I = [], W = E.map((Y) => {
|
|
3721
|
-
let P = 0;
|
|
3722
|
-
const L = 300 * 1e3;
|
|
3723
|
-
for (; I[P] !== void 0 && I[P] > Y.start.getTime() + L; )
|
|
3724
|
-
P++;
|
|
3725
|
-
return I[P] = Y.end.getTime(), { ...Y, level: P };
|
|
3726
|
-
});
|
|
3727
|
-
b.set(C, W), O.set(C, I.length || 1);
|
|
3728
|
-
}), { resourceMap: b, maxLevels: O };
|
|
3729
|
-
}, [n, ee]), Je = (b) => {
|
|
3730
|
-
const O = R(b.start), y = R(b.end);
|
|
3731
|
-
if (O === -1 && y === -1) return { display: "none" };
|
|
3732
|
-
const C = Math.max(0, O), E = y === -1 ? de : Math.min(de, y), I = Math.max(0, E - C);
|
|
3733
|
-
if (I <= 4) return { display: "none" };
|
|
3734
|
-
const W = 36, P = 20 + b.level * (W + 10), L = b.color || "hsl(var(--primary))";
|
|
3735
|
-
return {
|
|
3736
|
-
[B ? "right" : "left"]: `${C}px`,
|
|
3737
|
-
width: `${Math.max(I, 4)}px`,
|
|
3738
|
-
// Min width
|
|
3739
|
-
top: `${P}px`,
|
|
3740
|
-
height: `${W}px`,
|
|
3741
|
-
// Modern Glassmorphic Look
|
|
3742
|
-
background: `linear-gradient(135deg, color-mix(in srgb, ${L} 20%, transparent), color-mix(in srgb, ${L} 10%, transparent))`,
|
|
3743
|
-
backdropFilter: "blur(4px)",
|
|
3744
|
-
[B ? "borderRight" : "borderLeft"]: `4px solid ${L}`,
|
|
3745
|
-
borderTop: `1px solid color-mix(in srgb, ${L} 30%, transparent)`,
|
|
3746
|
-
[B ? "borderLeft" : "borderRight"]: `1px solid color-mix(in srgb, ${L} 30%, transparent)`,
|
|
3747
|
-
borderBottom: `1px solid color-mix(in srgb, ${L} 30%, transparent)`,
|
|
3748
|
-
color: "hsl(var(--foreground))",
|
|
3749
|
-
borderRadius: "6px",
|
|
3750
|
-
boxShadow: "0 2px 8px -2px rgba(0,0,0,0.1)",
|
|
3751
|
-
display: "flex",
|
|
3752
|
-
alignItems: "center",
|
|
3753
|
-
fontSize: "12px",
|
|
3754
|
-
fontWeight: "600",
|
|
3755
|
-
paddingInlineStart: "12px",
|
|
3756
|
-
paddingInlineEnd: "8px",
|
|
3757
|
-
whiteSpace: "nowrap",
|
|
3758
|
-
overflow: "hidden",
|
|
3759
|
-
textOverflow: "ellipsis",
|
|
3760
|
-
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
3761
|
-
zIndex: 20 + b.level,
|
|
3762
|
-
cursor: "pointer"
|
|
3763
|
-
};
|
|
3764
|
-
}, Ue = 40, Ye = 240, Fe = u ? me.isGrouped ? Ue + Ye : Ye : 0;
|
|
3765
|
-
return /* @__PURE__ */ w("div", { className: "flex flex-col h-full w-full overflow-hidden border border-border/40 rounded-xl bg-background shadow-sm", children: [
|
|
3766
|
-
/* @__PURE__ */ w("div", { className: "flex bg-background z-40 sticky top-0 border-b border-border/40 shadow-[0_1px_2px_rgba(0,0,0,0.03)] items-center", children: [
|
|
3767
|
-
u && me.isGrouped && /* @__PURE__ */ c("div", { className: V(
|
|
3768
|
-
"w-[40px] shrink-0 border-e border-border/40 p-1 flex items-center justify-center bg-background select-none sticky z-50",
|
|
3769
|
-
B ? "right-0" : "left-0"
|
|
3770
|
-
), children: /* @__PURE__ */ c("div", { className: "writing-mode-vertical rotate-180 font-bold text-[10px] uppercase tracking-widest text-muted-foreground/70", children: "Group" }) }),
|
|
3771
|
-
u && /* @__PURE__ */ c("div", { className: V(
|
|
3772
|
-
"w-[240px] shrink-0 border-e border-border/40 px-6 py-4 font-bold text-[11px] uppercase tracking-widest flex items-center bg-background text-muted-foreground select-none sticky z-50",
|
|
3773
|
-
me.isGrouped ? B ? "right-[40px]" : "left-[40px]" : B ? "right-0" : "left-0"
|
|
3774
|
-
), children: "RESOURCES" }),
|
|
3775
|
-
/* @__PURE__ */ c("div", { ref: De, className: "overflow-hidden flex-1 relative", children: /* @__PURE__ */ c("div", { className: "flex", style: { width: de }, children: t.map((b) => {
|
|
3776
|
-
const O = t.length === 1, y = b.getDay() === 0 || b.getDay() === 6;
|
|
3777
|
-
return X ? /* @__PURE__ */ w("div", { className: V(
|
|
3778
|
-
"flex shrink-0 border-e border-border/30 h-14 flex-col justify-center items-center transition-colors select-none",
|
|
3779
|
-
y ? "bg-muted/10" : "bg-transparent hover:bg-muted/5"
|
|
3780
|
-
), style: { width: se }, children: [
|
|
3781
|
-
/* @__PURE__ */ c("span", { className: V(
|
|
3782
|
-
"text-[10px] font-bold uppercase mb-0.5 tracking-wider",
|
|
3783
|
-
y ? "text-muted-foreground" : "text-primary"
|
|
3784
|
-
), children: ue(b, "EEE") }),
|
|
3785
|
-
/* @__PURE__ */ c("span", { className: V(
|
|
3786
|
-
"text-xs font-semibold",
|
|
3787
|
-
y ? "text-muted-foreground/70" : "text-foreground/80"
|
|
3788
|
-
), children: ue(b, "d") })
|
|
3789
|
-
] }, b.toISOString()) : /* @__PURE__ */ c("div", { className: "flex shrink-0 border-e border-border/40", style: { width: de / t.length }, children: Array.from({ length: fe }).map((C, E) => {
|
|
3790
|
-
const I = E * ne, W = ae + Math.floor(I / 60), Y = I % 60, P = new Date((/* @__PURE__ */ new Date()).setHours(W, Y, 0, 0));
|
|
3791
|
-
let L = "";
|
|
3792
|
-
return z ? L = ue(P, "HH:mm") : L = ne < 60 || Y !== 0 ? ue(P, "h:mm a") : ue(P, "ha"), /* @__PURE__ */ w("div", { className: "flex flex-col justify-end pb-2 border-e border-border/10 last:border-e-0 relative h-14", style: { width: se }, children: [
|
|
3793
|
-
!O && E === 0 && /* @__PURE__ */ c("div", { className: V("absolute top-2 px-2 py-0.5 rounded text-[10px] font-bold text-foreground/80 bg-muted/50 border border-border/20 whitespace-nowrap", B ? "right-2" : "left-2"), children: ue(b, "EEE, MMM d") }),
|
|
3794
|
-
/* @__PURE__ */ c("span", { className: "text-[11px] font-black text-foreground text-center px-1 select-none tabular-nums truncate", children: L })
|
|
3795
|
-
] }, E);
|
|
3796
|
-
}) }, b.toISOString());
|
|
3797
|
-
}) }) })
|
|
3798
|
-
] }),
|
|
3799
|
-
/* @__PURE__ */ c(
|
|
3800
|
-
"div",
|
|
3801
|
-
{
|
|
3802
|
-
ref: $,
|
|
3803
|
-
"data-testid": "scheduler-scroll-container",
|
|
3804
|
-
className: "flex-1 overflow-auto relative custom-scrollbar bg-background",
|
|
3805
|
-
onScroll: (b) => {
|
|
3806
|
-
De.current && (De.current.scrollLeft = b.currentTarget.scrollLeft);
|
|
3807
|
-
},
|
|
3808
|
-
children: /* @__PURE__ */ w("div", { className: "relative min-w-max", style: { width: de + Fe, minHeight: "100%" }, children: [
|
|
3809
|
-
he !== null && p !== !1 && /* @__PURE__ */ w(
|
|
3810
|
-
"div",
|
|
3811
|
-
{
|
|
3812
|
-
className: "current-time-indicator z-50 pointer-events-none",
|
|
3813
|
-
style: { [B ? "right" : "left"]: `${he + Fe}px`, height: "100%" },
|
|
3814
|
-
children: [
|
|
3815
|
-
/* @__PURE__ */ c("div", { className: "absolute top-0 -translate-x-1/2 w-[2px] h-full bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]" }),
|
|
3816
|
-
/* @__PURE__ */ c("div", { className: "absolute top-0 -translate-x-1/2 -mt-1 w-2.5 h-2.5 rounded-full bg-red-500 shadow-md border-2 border-background" })
|
|
3817
|
-
]
|
|
3818
|
-
}
|
|
3819
|
-
),
|
|
3820
|
-
me.groups.map((b) => /* @__PURE__ */ w("div", { className: "flex border-b border-border/30 relative", children: [
|
|
3821
|
-
u && me.isGrouped && /* @__PURE__ */ w(
|
|
3822
|
-
"div",
|
|
3823
|
-
{
|
|
3824
|
-
className: V(
|
|
3825
|
-
"w-[40px] shrink-0 sticky z-30 bg-background border-e border-border/40 flex items-center justify-center p-1",
|
|
3826
|
-
B ? "right-0" : "left-0"
|
|
3827
|
-
),
|
|
3828
|
-
style: { height: "auto" },
|
|
3829
|
-
children: [
|
|
3830
|
-
/* @__PURE__ */ c("div", { className: "absolute inset-0 bg-background/80" }),
|
|
3831
|
-
/* @__PURE__ */ c("div", { className: "relative writing-mode-vertical transform rotate-180 text-[10px] font-bold uppercase tracking-wide text-foreground/70 whitespace-nowrap py-2 overflow-hidden text-ellipsis max-h-full", children: b.name })
|
|
3832
|
-
]
|
|
3833
|
-
}
|
|
3834
|
-
),
|
|
3835
|
-
/* @__PURE__ */ c("div", { className: "flex flex-col w-full", children: b.resources.map((O, y) => {
|
|
3836
|
-
const E = (oe.get(O.id) || 1) * 46 + 40;
|
|
3837
|
-
return /* @__PURE__ */ w(
|
|
3838
|
-
"div",
|
|
3839
|
-
{
|
|
3840
|
-
className: V(
|
|
3841
|
-
"flex border-b border-border/30 last:border-b-0 group/row hover:bg-muted/5 transition-colors",
|
|
3842
|
-
(y % 2 === 0, "bg-background")
|
|
3843
|
-
),
|
|
3844
|
-
style: { height: `${E}px` },
|
|
3845
|
-
children: [
|
|
3846
|
-
/* @__PURE__ */ c(
|
|
3847
|
-
"div",
|
|
3848
|
-
{
|
|
3849
|
-
className: V(
|
|
3850
|
-
"w-[240px] shrink-0 sticky z-30 bg-background/95 backdrop-blur border-e border-border/40 px-6 py-4 flex items-center gap-4 transition-all shadow-[1px_0_4px_rgba(0,0,0,0.02)]",
|
|
3851
|
-
me.isGrouped ? B ? "right-[40px]" : "left-[40px]" : B ? "right-0" : "left-0",
|
|
3852
|
-
!u && "hidden"
|
|
3853
|
-
),
|
|
3854
|
-
children: /* @__PURE__ */ w(xt, { children: [
|
|
3855
|
-
/* @__PURE__ */ w(qt, { className: "h-9 w-9 border border-border/60 shadow-sm", children: [
|
|
3856
|
-
O.avatar && /* @__PURE__ */ c(Qt, { src: O.avatar, alt: O.name, className: "object-cover" }),
|
|
3857
|
-
/* @__PURE__ */ c(Xt, { className: "text-xs font-bold bg-primary/5 text-primary", children: O.name.charAt(0) })
|
|
3858
|
-
] }),
|
|
3859
|
-
/* @__PURE__ */ w("div", { className: "flex flex-col min-w-0", children: [
|
|
3860
|
-
/* @__PURE__ */ c("span", { className: "text-[13px] font-semibold truncate text-foreground/90 tracking-tight leading-none mb-1.5", children: O.name }),
|
|
3861
|
-
/* @__PURE__ */ w("div", { className: "flex items-center gap-1.5", children: [
|
|
3862
|
-
/* @__PURE__ */ c("span", { className: V(
|
|
3863
|
-
"w-1.5 h-1.5 rounded-full",
|
|
3864
|
-
O.type === "Internal" ? "bg-primary shadow-[0_0_6px_var(--primary)]/50" : "bg-success shadow-[0_0_6px_var(--success)]/50"
|
|
3865
|
-
) }),
|
|
3866
|
-
/* @__PURE__ */ c("span", { className: "text-[10px] text-muted-foreground font-medium uppercase tracking-wider", children: O.type || "Available" })
|
|
3867
|
-
] })
|
|
3868
|
-
] })
|
|
3869
|
-
] })
|
|
3870
|
-
}
|
|
3871
|
-
),
|
|
3872
|
-
/* @__PURE__ */ c(
|
|
3873
|
-
Xo,
|
|
3874
|
-
{
|
|
3875
|
-
resource: O,
|
|
3876
|
-
totalSlots: ve,
|
|
3877
|
-
slotWidth: se,
|
|
3878
|
-
totalWidth: de,
|
|
3879
|
-
slotToDate: H,
|
|
3880
|
-
onSlotMouseDown: v,
|
|
3881
|
-
onSlotMouseEnter: U,
|
|
3882
|
-
onSlotDoubleClick: i,
|
|
3883
|
-
isSlotSelected: q,
|
|
3884
|
-
resourceMap: le,
|
|
3885
|
-
getEventStyle: Je,
|
|
3886
|
-
onEventClick: l,
|
|
3887
|
-
onEventDelete: d,
|
|
3888
|
-
slotDuration: ne,
|
|
3889
|
-
now: F,
|
|
3890
|
-
visibleEvents: n,
|
|
3891
|
-
slotsPerDay: fe,
|
|
3892
|
-
daysInView: t,
|
|
3893
|
-
dir: D
|
|
3894
|
-
}
|
|
3895
|
-
)
|
|
3896
|
-
]
|
|
3897
|
-
},
|
|
3898
|
-
O.id
|
|
3899
|
-
);
|
|
3900
|
-
}) })
|
|
3901
|
-
] }, b.name))
|
|
3902
|
-
] })
|
|
3903
|
-
}
|
|
3904
|
-
)
|
|
3905
|
-
] });
|
|
3906
|
-
}, Xo = ({
|
|
3907
|
-
resource: e,
|
|
3908
|
-
totalSlots: t,
|
|
3909
|
-
slotWidth: n,
|
|
3910
|
-
totalWidth: r,
|
|
3911
|
-
slotToDate: a,
|
|
3912
|
-
onSlotMouseDown: i,
|
|
3913
|
-
onSlotMouseEnter: l,
|
|
3914
|
-
onSlotDoubleClick: d,
|
|
3915
|
-
isSlotSelected: m,
|
|
3916
|
-
resourceMap: p,
|
|
3917
|
-
getEventStyle: u,
|
|
3918
|
-
onEventClick: s,
|
|
3919
|
-
onEventDelete: N,
|
|
3920
|
-
slotDuration: g,
|
|
3921
|
-
now: h,
|
|
3922
|
-
visibleEvents: _,
|
|
3923
|
-
slotsPerDay: z,
|
|
3924
|
-
daysInView: $,
|
|
3925
|
-
dir: D
|
|
3926
|
-
}) => {
|
|
3927
|
-
const B = D === "rtl", { setNodeRef: F, isOver: ae } = Pn({
|
|
3928
|
-
id: `row-${e.id}`,
|
|
3929
|
-
data: { resourceId: e.id }
|
|
3930
|
-
});
|
|
3931
|
-
return /* @__PURE__ */ w(
|
|
3932
|
-
"div",
|
|
3933
|
-
{
|
|
3934
|
-
ref: F,
|
|
3935
|
-
className: V(
|
|
3936
|
-
"relative flex-1 group/interactive",
|
|
3937
|
-
ae && "bg-primary/5 shadow-inner"
|
|
3938
|
-
),
|
|
3939
|
-
style: { width: r },
|
|
3940
|
-
onMouseMove: (x) => {
|
|
3941
|
-
const k = x.currentTarget.getBoundingClientRect(), M = x.clientX - k.left, S = Math.floor(B ? (k.width - M) / n : M / n);
|
|
3942
|
-
S >= 0 && S < t && l(S);
|
|
3943
|
-
},
|
|
3944
|
-
onMouseDown: (x) => {
|
|
3945
|
-
const k = x.currentTarget.getBoundingClientRect(), M = x.clientX - k.left, S = Math.floor(B ? (k.width - M) / n : M / n);
|
|
3946
|
-
S >= 0 && S < t && i(S, e.id);
|
|
3947
|
-
},
|
|
3948
|
-
onDoubleClick: (x) => {
|
|
3949
|
-
const k = x.currentTarget.getBoundingClientRect(), M = x.clientX - k.left, S = Math.floor(B ? (k.width - M) / n : M / n);
|
|
3950
|
-
if (S >= 0 && S < t) {
|
|
3951
|
-
const K = a(S);
|
|
3952
|
-
_.some(
|
|
3953
|
-
(j) => (j.isHoliday || j.isFullyBooked) && ye(j.start, K)
|
|
3954
|
-
) || d?.(K, e.id);
|
|
3955
|
-
}
|
|
3956
|
-
},
|
|
3957
|
-
children: [
|
|
3958
|
-
/* @__PURE__ */ c(
|
|
3959
|
-
"div",
|
|
3960
|
-
{
|
|
3961
|
-
className: "absolute inset-0 pointer-events-none",
|
|
3962
|
-
style: {
|
|
3963
|
-
backgroundImage: `repeating-linear-gradient(${B ? "to left" : "to right"}, transparent, transparent ${n - 1}px, hsl(var(--border) / 0.1) ${n - 1}px, hsl(var(--border) / 0.1) ${n}px)`,
|
|
3964
|
-
backgroundSize: `${n}px 100%`
|
|
3965
|
-
}
|
|
3966
|
-
}
|
|
3967
|
-
),
|
|
3968
|
-
/* @__PURE__ */ c("div", { className: "absolute inset-0 pointer-events-none flex", children: $.map((x, k) => {
|
|
3969
|
-
const M = _.find((K) => K.isHoliday && ye(K.start, x)), S = _.find((K) => K.isFullyBooked && ye(K.start, x));
|
|
3970
|
-
return !M && !S ? /* @__PURE__ */ c("div", { style: { width: z * n } }, k) : /* @__PURE__ */ c(
|
|
3971
|
-
"div",
|
|
3972
|
-
{
|
|
3973
|
-
style: { width: z * n },
|
|
3974
|
-
className: V(
|
|
3975
|
-
"h-full border-e border-border/10",
|
|
3976
|
-
M && "bg-[repeating-linear-gradient(-45deg,hsl(var(--destructive)/0.05)_0px,hsl(var(--destructive)/0.05)_10px,transparent_10px,transparent_20px)] bg-destructive/[0.02]",
|
|
3977
|
-
S && "bg-[repeating-linear-gradient(-45deg,theme(colors.amber.500/0.05)_0px,theme(colors.amber.500/0.05)_10px,transparent_10px,transparent_20px)] bg-amber-500/[0.02]"
|
|
3978
|
-
)
|
|
3979
|
-
},
|
|
3980
|
-
k
|
|
3981
|
-
);
|
|
3982
|
-
}) }),
|
|
3983
|
-
/* @__PURE__ */ c(
|
|
3984
|
-
Ko,
|
|
3985
|
-
{
|
|
3986
|
-
totalSlots: t,
|
|
3987
|
-
resourceId: e.id,
|
|
3988
|
-
slotWidth: n,
|
|
3989
|
-
isSlotSelected: m,
|
|
3990
|
-
isRtl: B
|
|
3991
|
-
}
|
|
3992
|
-
),
|
|
3993
|
-
p.get(e.id)?.map((x) => /* @__PURE__ */ c(
|
|
3994
|
-
Vn,
|
|
3995
|
-
{
|
|
3996
|
-
event: x,
|
|
3997
|
-
style: u(x),
|
|
3998
|
-
onClick: s,
|
|
3999
|
-
onDelete: N,
|
|
4000
|
-
orientation: "horizontal",
|
|
4001
|
-
resizable: !0,
|
|
4002
|
-
isBlocked: x.isBlock,
|
|
4003
|
-
isPast: x.end < h,
|
|
4004
|
-
slotDuration: g,
|
|
4005
|
-
pixelsPerSlot: n
|
|
4006
|
-
},
|
|
4007
|
-
x.id
|
|
4008
|
-
))
|
|
4009
|
-
]
|
|
4010
|
-
}
|
|
4011
|
-
);
|
|
4012
|
-
}, Ko = qe.memo(({
|
|
4013
|
-
totalSlots: e,
|
|
4014
|
-
resourceId: t,
|
|
4015
|
-
slotWidth: n,
|
|
4016
|
-
isSlotSelected: r,
|
|
4017
|
-
isRtl: a
|
|
4018
|
-
}) => {
|
|
4019
|
-
const i = [];
|
|
4020
|
-
let l = null;
|
|
4021
|
-
for (let d = 0; d < e; d++)
|
|
4022
|
-
r(d, t) ? l ? l.length++ : (l = { start: d, length: 1 }, i.push(l)) : l = null;
|
|
4023
|
-
return /* @__PURE__ */ c(xt, { children: i.map((d, m) => /* @__PURE__ */ c(
|
|
4024
|
-
"div",
|
|
4025
|
-
{
|
|
4026
|
-
className: "absolute top-0 bottom-0 bg-primary/20 border-x border-primary/30 z-10 pointer-events-none",
|
|
4027
|
-
style: {
|
|
4028
|
-
[a ? "right" : "left"]: `${d.start * n}px`,
|
|
4029
|
-
width: `${d.length * n}px`
|
|
4030
|
-
}
|
|
4031
|
-
},
|
|
4032
|
-
m
|
|
4033
|
-
)) });
|
|
4034
|
-
}), Jo = ({
|
|
4035
|
-
daysInView: e,
|
|
4036
|
-
visibleEvents: t,
|
|
4037
|
-
onEventClick: n
|
|
4038
|
-
}) => /* @__PURE__ */ c(
|
|
4039
|
-
"div",
|
|
4040
|
-
{
|
|
4041
|
-
"data-testid": "scheduler-scroll-container",
|
|
4042
|
-
className: "flex flex-col h-full w-full bg-background overflow-y-auto border border-border rounded-lg",
|
|
4043
|
-
children: e.map((r) => {
|
|
4044
|
-
const a = t.filter((l) => ye(l.start, r)).sort((l, d) => l.start.getTime() - d.start.getTime()), i = ye(r, /* @__PURE__ */ new Date());
|
|
4045
|
-
return /* @__PURE__ */ w("div", { className: "flex flex-col border-b border-border pb-2 last:border-b-0", children: [
|
|
4046
|
-
/* @__PURE__ */ w("div", { className: V(
|
|
4047
|
-
"flex items-center px-4 py-2 sticky top-0 bg-background/95 backdrop-blur z-10 border-b border-border",
|
|
4048
|
-
i && "text-primary font-semibold"
|
|
4049
|
-
), children: [
|
|
4050
|
-
/* @__PURE__ */ w("div", { className: "flex flex-col items-center mr-4 w-12 shrink-0", children: [
|
|
4051
|
-
/* @__PURE__ */ c("span", { className: "text-[10px] uppercase font-bold text-muted-foreground", children: ue(r, "EEE") }),
|
|
4052
|
-
/* @__PURE__ */ c("span", { className: "text-xl font-bold leading-none", children: ue(r, "d") })
|
|
4053
|
-
] }),
|
|
4054
|
-
/* @__PURE__ */ c("div", { className: "text-sm font-medium text-muted-foreground", children: ue(r, "MMMM yyyy") })
|
|
4055
|
-
] }),
|
|
4056
|
-
/* @__PURE__ */ c("div", { className: "flex flex-col px-2 py-1 gap-2", children: a.length === 0 ? /* @__PURE__ */ c("div", { className: "text-sm text-muted-foreground px-4 py-2 italic opacity-50", children: "No events" }) : a.map((l) => /* @__PURE__ */ c(Rn, { contextId: "scheduler-event", data: l, children: /* @__PURE__ */ w(
|
|
4057
|
-
"div",
|
|
4058
|
-
{
|
|
4059
|
-
"data-testid": `scheduler-event-${l.id}`,
|
|
4060
|
-
className: V(
|
|
4061
|
-
"flex items-center p-3 rounded-lg border bg-card text-card-foreground shadow-sm cursor-pointer hover:bg-muted/50 transition-colors",
|
|
4062
|
-
l.color && `border-l-4 border-l-[${l.color}]`
|
|
4063
|
-
),
|
|
4064
|
-
style: { borderLeftColor: l.color },
|
|
4065
|
-
onClick: () => n?.(l),
|
|
4066
|
-
children: [
|
|
4067
|
-
/* @__PURE__ */ w("div", { className: "flex flex-col mr-4 min-w-[80px] shrink-0", children: [
|
|
4068
|
-
/* @__PURE__ */ c("span", { className: "text-sm font-bold", children: ue(l.start, "h:mm a") }),
|
|
4069
|
-
/* @__PURE__ */ c("span", { className: "text-xs text-muted-foreground", children: ue(l.end, "h:mm a") })
|
|
4070
|
-
] }),
|
|
4071
|
-
/* @__PURE__ */ w("div", { className: "flex-1 min-w-0", children: [
|
|
4072
|
-
/* @__PURE__ */ c("div", { className: "font-semibold truncate", children: l.title }),
|
|
4073
|
-
l.description && /* @__PURE__ */ c("div", { className: "text-xs text-muted-foreground truncate", children: l.description })
|
|
4074
|
-
] }),
|
|
4075
|
-
l.resourceId && /* @__PURE__ */ c("div", { className: "hidden sm:block ml-2 px-2 py-0.5 rounded-full bg-muted text-[10px] text-muted-foreground", children: l.resourceId })
|
|
4076
|
-
]
|
|
4077
|
-
}
|
|
4078
|
-
) }, l.id)) })
|
|
4079
|
-
] }, r.toISOString());
|
|
4080
|
-
})
|
|
4081
|
-
}
|
|
4082
|
-
);
|
|
4083
|
-
function Zo({
|
|
4084
|
-
view: e,
|
|
4085
|
-
daysInView: t,
|
|
4086
|
-
visibleEvents: n,
|
|
4087
|
-
rowVirtualizer: r,
|
|
4088
|
-
resources: a,
|
|
4089
|
-
handleSlotDoubleClick: i,
|
|
4090
|
-
handleEventDoubleClick: l,
|
|
4091
|
-
handleEventDelete: d,
|
|
4092
|
-
parentRef: m,
|
|
4093
|
-
setView: p,
|
|
4094
|
-
setCurrentDate: u,
|
|
4095
|
-
props: s,
|
|
4096
|
-
handleRangeSelect: N,
|
|
4097
|
-
currentDate: g,
|
|
4098
|
-
showUnassignedLane: h,
|
|
4099
|
-
slotDuration: _,
|
|
4100
|
-
is24Hour: z,
|
|
4101
|
-
setIs24Hour: $,
|
|
4102
|
-
dir: D
|
|
4103
|
-
}) {
|
|
4104
|
-
const B = zn("(max-width: 768px)"), F = typeof s.cell == "function" ? s.cell : void 0;
|
|
4105
|
-
switch (B && (e === "week" || e === "workweek") ? "agenda" : e) {
|
|
4106
|
-
case "day":
|
|
4107
|
-
case "week":
|
|
4108
|
-
case "workweek":
|
|
4109
|
-
return /* @__PURE__ */ c(
|
|
4110
|
-
jo,
|
|
4111
|
-
{
|
|
4112
|
-
daysInView: t,
|
|
4113
|
-
visibleEvents: n,
|
|
4114
|
-
rowVirtualizer: r,
|
|
4115
|
-
resources: a,
|
|
4116
|
-
onSlotDoubleClick: i,
|
|
4117
|
-
onEventDoubleClick: l,
|
|
4118
|
-
onEventDelete: d,
|
|
4119
|
-
scrollRef: m,
|
|
4120
|
-
onViewChange: p,
|
|
4121
|
-
onDateChange: u,
|
|
4122
|
-
onRangeSelect: N,
|
|
4123
|
-
onSlotClick: (x, k) => s.onCellClick?.(x, k),
|
|
4124
|
-
onEventClick: (x) => s.onEventClick?.(x),
|
|
4125
|
-
showResourcesInDayView: s.showResourcesInDayView,
|
|
4126
|
-
showWeekNumber: s.showWeekNumber,
|
|
4127
|
-
weekRule: s.weekRule,
|
|
4128
|
-
cellTemplate: F,
|
|
4129
|
-
enableHtmlSanitizer: s.enableHtmlSanitizer,
|
|
4130
|
-
showUnassignedLane: h,
|
|
4131
|
-
startHour: s.startHour,
|
|
4132
|
-
endHour: s.endHour,
|
|
4133
|
-
slotDuration: _,
|
|
4134
|
-
is24Hour: z,
|
|
4135
|
-
setIs24Hour: $,
|
|
4136
|
-
group: s.group,
|
|
4137
|
-
onCellContextMenu: s.onCellContextMenu,
|
|
4138
|
-
dir: D
|
|
4139
|
-
}
|
|
4140
|
-
);
|
|
4141
|
-
case "month":
|
|
4142
|
-
return /* @__PURE__ */ c(
|
|
4143
|
-
qo,
|
|
4144
|
-
{
|
|
4145
|
-
currentDate: g,
|
|
4146
|
-
daysInView: t,
|
|
4147
|
-
visibleEvents: n,
|
|
4148
|
-
onSlotClick: (x) => s.onCellClick?.(x),
|
|
4149
|
-
onSlotDoubleClick: (x) => i(x),
|
|
4150
|
-
onEventClick: (x) => s.onEventClick?.(x) || l(x),
|
|
4151
|
-
monthsCount: s.monthsCount,
|
|
4152
|
-
dir: D
|
|
4153
|
-
}
|
|
4154
|
-
);
|
|
4155
|
-
case "timeline":
|
|
4156
|
-
case "timeline-day":
|
|
4157
|
-
case "timelineday":
|
|
4158
|
-
case "timeline-week":
|
|
4159
|
-
case "timelineweek":
|
|
4160
|
-
case "timeline-month":
|
|
4161
|
-
case "timelinemonth":
|
|
4162
|
-
return /* @__PURE__ */ c(
|
|
4163
|
-
Qo,
|
|
4164
|
-
{
|
|
4165
|
-
view: e,
|
|
4166
|
-
currentDate: g,
|
|
4167
|
-
daysInView: t,
|
|
4168
|
-
visibleEvents: n,
|
|
4169
|
-
resources: a,
|
|
4170
|
-
onSlotClick: (x, k) => s.onCellClick?.(x, k),
|
|
4171
|
-
onSlotDoubleClick: i,
|
|
4172
|
-
onEventClick: (x) => s.onEventClick?.(x) || l(x),
|
|
4173
|
-
onEventDelete: d,
|
|
4174
|
-
onRangeSelect: N,
|
|
4175
|
-
currentTimeIndicator: s.currentTimeIndicator,
|
|
4176
|
-
showResourceHeaders: s.showResourceHeaders,
|
|
4177
|
-
group: s.group,
|
|
4178
|
-
showUnassignedLane: s.showUnassignedLane,
|
|
4179
|
-
startHour: s.startHour,
|
|
4180
|
-
endHour: s.endHour,
|
|
4181
|
-
slotDuration: _,
|
|
4182
|
-
is24Hour: z,
|
|
4183
|
-
scrollRef: m,
|
|
4184
|
-
dir: D
|
|
4185
|
-
}
|
|
4186
|
-
);
|
|
4187
|
-
case "agenda":
|
|
4188
|
-
return /* @__PURE__ */ c(
|
|
4189
|
-
Jo,
|
|
4190
|
-
{
|
|
4191
|
-
daysInView: t,
|
|
4192
|
-
visibleEvents: n,
|
|
4193
|
-
onEventClick: (x) => s.onEventClick?.(x) || l(x)
|
|
4194
|
-
}
|
|
4195
|
-
);
|
|
4196
|
-
default:
|
|
4197
|
-
return /* @__PURE__ */ w("div", { children: [
|
|
4198
|
-
"View ",
|
|
4199
|
-
e,
|
|
4200
|
-
" not implemented"
|
|
4201
|
-
] });
|
|
4202
|
-
}
|
|
4203
|
-
}
|
|
4204
|
-
const ei = ({
|
|
4205
|
-
isOpen: e,
|
|
4206
|
-
onClose: t,
|
|
4207
|
-
title: n,
|
|
4208
|
-
children: r,
|
|
4209
|
-
footer: a,
|
|
4210
|
-
className: i,
|
|
4211
|
-
size: l = "md",
|
|
4212
|
-
closeOnBackdropClick: d = !0,
|
|
4213
|
-
showCloseButton: m = !0
|
|
4214
|
-
}) => {
|
|
4215
|
-
if (_e(() => {
|
|
4216
|
-
if (e)
|
|
4217
|
-
return document.body.style.overflow = "hidden", () => {
|
|
4218
|
-
document.body.style.overflow = "unset";
|
|
4219
|
-
};
|
|
4220
|
-
}, [e]), !e) return null;
|
|
4221
|
-
const u = /* @__PURE__ */ w("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center p-4 sm:p-6", role: "dialog", "aria-modal": "true", children: [
|
|
4222
|
-
/* @__PURE__ */ c(
|
|
4223
|
-
"div",
|
|
4224
|
-
{
|
|
4225
|
-
className: "fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity animate-in fade-in duration-200",
|
|
4226
|
-
onClick: d ? t : void 0,
|
|
4227
|
-
"aria-hidden": "true"
|
|
4228
|
-
}
|
|
4229
|
-
),
|
|
4230
|
-
/* @__PURE__ */ w(
|
|
4231
|
-
"div",
|
|
4232
|
-
{
|
|
4233
|
-
className: V(
|
|
4234
|
-
"relative w-full bg-background rounded-xl border border-border shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 slide-in-from-bottom-2 duration-200",
|
|
4235
|
-
{
|
|
4236
|
-
sm: "max-w-sm",
|
|
4237
|
-
md: "max-w-lg",
|
|
4238
|
-
lg: "max-w-2xl",
|
|
4239
|
-
xl: "max-w-4xl",
|
|
4240
|
-
full: "max-w-[95vw] h-[95vh]"
|
|
4241
|
-
}[l],
|
|
4242
|
-
i
|
|
4243
|
-
),
|
|
4244
|
-
children: [
|
|
4245
|
-
(n || m) && /* @__PURE__ */ w("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border bg-muted/10 shrink-0", children: [
|
|
4246
|
-
/* @__PURE__ */ c("div", { className: "text-lg font-semibold leading-none tracking-tight", children: n }),
|
|
4247
|
-
m && /* @__PURE__ */ w(
|
|
4248
|
-
jt,
|
|
4249
|
-
{
|
|
4250
|
-
variant: "ghost",
|
|
4251
|
-
size: "icon",
|
|
4252
|
-
onClick: t,
|
|
4253
|
-
className: "h-8 w-8 rounded-full p-0 text-muted-foreground hover:bg-muted",
|
|
4254
|
-
children: [
|
|
4255
|
-
/* @__PURE__ */ c(Ln, { className: "h-4 w-4" }),
|
|
4256
|
-
/* @__PURE__ */ c("span", { className: "sr-only", children: "Close" })
|
|
4257
|
-
]
|
|
4258
|
-
}
|
|
4259
|
-
)
|
|
4260
|
-
] }),
|
|
4261
|
-
/* @__PURE__ */ c("div", { className: "flex-1 overflow-y-auto p-6 custom-scrollbar", children: r }),
|
|
4262
|
-
a && /* @__PURE__ */ c("div", { className: "flex items-center justify-end gap-2 px-6 py-4 border-t border-border bg-muted/5 shrink-0", children: a })
|
|
4263
|
-
]
|
|
4264
|
-
}
|
|
4265
|
-
)
|
|
4266
|
-
] });
|
|
4267
|
-
return Fr(u, document.body);
|
|
4268
|
-
}, ti = qe.lazy(() => import("./EzEventModal-BUMp_BFi.js").then((e) => ({ default: e.EzEventModal }))), ni = qe.lazy(() => import("./EzSchedulerQuickAdd-C653LTGh.js").then((e) => ({ default: e.EzSchedulerQuickAdd }))), ri = qe.lazy(() => import("./EzSchedulerToolbar-CO5jjDQg.js").then((e) => e.b).then((e) => ({ default: e.EzSchedulerToolbar }))), ai = new wr(), oi = In((e, t) => (sr(), /* @__PURE__ */ c(yr, { client: ai, children: /* @__PURE__ */ c(Kn, { ...e, ref: t }) })));
|
|
4269
|
-
oi.displayName = "EzScheduler";
|
|
4270
|
-
const Kn = In((e, t) => {
|
|
4271
|
-
const n = mo({
|
|
4272
|
-
...e,
|
|
4273
|
-
view: e.view || e.defaultView || "Week",
|
|
4274
|
-
selectedDate: e.selectedDate ?? e.defaultSelectedDate
|
|
4275
|
-
}), { state: r, actions: a, services: i, refs: l, baseApi: d, dir: m } = n, { currentView: p, currentDate: u, viewEvents: s, daysInView: N, slotDuration: g, is24Hour: h } = r, { setView: _, setCurrentDate: z } = a, { rowVirtualizer: $, parentRef: D } = l, { schedulerService: B, serviceRegistry: F } = i, ae = (v) => {
|
|
4276
|
-
if (!v.start || !v.end) return { hasBlockOverlap: !1, hasRegularOverlap: !1, overlappingEvents: [] };
|
|
4277
|
-
const U = s.filter((q) => q.id === v.id || !(q.resourceId === v.resourceId || q.resourceIds?.some((oe) => v.resourceId === oe) || !q.resourceId && !v.resourceId) ? !1 : Nt(
|
|
4278
|
-
{ start: q.start, end: q.end },
|
|
4279
|
-
{ start: v.start, end: v.end }
|
|
4280
|
-
));
|
|
4281
|
-
return {
|
|
4282
|
-
hasBlockOverlap: U.some((q) => q.isBlock),
|
|
4283
|
-
hasRegularOverlap: U.length > 0,
|
|
4284
|
-
overlappingEvents: U
|
|
4285
|
-
};
|
|
4286
|
-
}, x = (v = "regular") => {
|
|
4287
|
-
const U = F.get("NotificationService");
|
|
4288
|
-
if (U) {
|
|
4289
|
-
let q = "", le = "warning";
|
|
4290
|
-
v === "block" ? (q = "Cannot place event here: This time is blocked (e.g. Lunch Break).", le = "error") : v === "past" ? (q = "Cannot move or create events in the past.", le = "error") : (q = "Warning: This event overlaps with an existing event.", le = "warning"), U.add({
|
|
4291
|
-
type: le,
|
|
4292
|
-
message: q,
|
|
4293
|
-
duration: 5e3
|
|
4294
|
-
});
|
|
4295
|
-
}
|
|
4296
|
-
}, { sensors: k, handleDragEnd: M } = po({
|
|
4297
|
-
events: s,
|
|
4298
|
-
slotDuration: g,
|
|
4299
|
-
onEventChange: (v) => {
|
|
4300
|
-
if (!e.allowPastEvents && v.start < /* @__PURE__ */ new Date()) {
|
|
4301
|
-
x("past");
|
|
4302
|
-
return;
|
|
4303
|
-
}
|
|
4304
|
-
const { hasBlockOverlap: U, hasRegularOverlap: q, overlappingEvents: le } = ae(v);
|
|
4305
|
-
if (U) {
|
|
4306
|
-
x("block");
|
|
4307
|
-
return;
|
|
4308
|
-
}
|
|
4309
|
-
if (q) {
|
|
4310
|
-
if (e.onEventOverlap) {
|
|
4311
|
-
const oe = { event: v, existingEvents: le, cancel: !1 };
|
|
4312
|
-
if (e.onEventOverlap(oe), oe.cancel) return;
|
|
4313
|
-
}
|
|
4314
|
-
x("regular");
|
|
4315
|
-
}
|
|
4316
|
-
console.log("[EzScheduler] Calling scheduler.updateEvent", v), a.updateEvent(v);
|
|
4317
|
-
}
|
|
4318
|
-
}), { internalResources: S, setInternalResources: K } = go({
|
|
4319
|
-
resources: e.resources
|
|
4320
|
-
}), [G, j] = Re({ isOpen: !1, mode: "create" }), [De, X] = Re(!1), [ne, Me] = Re(null), [fe, ve] = Re({ x: 0, y: 0 }), se = qe.useMemo(() => ({
|
|
4321
|
-
...n.baseApi,
|
|
4322
|
-
onExportExcel: e.onExportExcel,
|
|
4323
|
-
onExportCSV: e.onExportCSV,
|
|
4324
|
-
onExportICS: e.onExportICS,
|
|
4325
|
-
get currentView() {
|
|
4326
|
-
return p;
|
|
4327
|
-
},
|
|
4328
|
-
destroy: () => {
|
|
4329
|
-
e.destroyed && e.destroyed({});
|
|
4330
|
-
}
|
|
4331
|
-
}), [n.baseApi, p, e.destroyed, e.onExportExcel, e.onExportCSV, e.onExportICS]);
|
|
4332
|
-
ho(
|
|
4333
|
-
p,
|
|
4334
|
-
u,
|
|
4335
|
-
B,
|
|
4336
|
-
s,
|
|
4337
|
-
{
|
|
4338
|
-
setEditorState: j,
|
|
4339
|
-
setResources: K,
|
|
4340
|
-
scrollToIndex: (v) => {
|
|
4341
|
-
D.current && (D.current.scrollTop = v * 64);
|
|
4342
|
-
},
|
|
4343
|
-
forceUpdate: () => {
|
|
4344
|
-
},
|
|
4345
|
-
showSpinner: d.showSpinner,
|
|
4346
|
-
hideSpinner: d.hideSpinner,
|
|
4347
|
-
closeQuickInfoPopup: () => X(!1),
|
|
4348
|
-
changeView: (v) => _(v.toLowerCase()),
|
|
4349
|
-
next: a.nextPeriod,
|
|
4350
|
-
prev: a.prevPeriod,
|
|
4351
|
-
today: a.today
|
|
4352
|
-
},
|
|
4353
|
-
t,
|
|
4354
|
-
se
|
|
4355
|
-
);
|
|
4356
|
-
const de = (v, U) => {
|
|
4357
|
-
e.onCellDoubleClick ? e.onCellDoubleClick(v, U) : j({
|
|
4358
|
-
isOpen: !0,
|
|
4359
|
-
mode: "create",
|
|
4360
|
-
event: { start: v, end: tt(v, 30), resourceId: U, resourceIds: U ? [U] : [] }
|
|
4361
|
-
});
|
|
4362
|
-
}, Z = (v) => {
|
|
4363
|
-
if (e.onEventDoubleClick) e.onEventDoubleClick(v);
|
|
4364
|
-
else {
|
|
4365
|
-
const U = v.end < /* @__PURE__ */ new Date();
|
|
4366
|
-
j({ isOpen: !0, mode: U ? "view" : "edit", event: v });
|
|
4367
|
-
}
|
|
4368
|
-
}, me = async (v) => {
|
|
4369
|
-
if (!e.allowPastEvents && v.start && v.start < /* @__PURE__ */ new Date()) {
|
|
4370
|
-
x("past");
|
|
4371
|
-
return;
|
|
4372
|
-
}
|
|
4373
|
-
const { hasBlockOverlap: U, hasRegularOverlap: q } = ae(v);
|
|
4374
|
-
if (U) {
|
|
4375
|
-
x("block");
|
|
4376
|
-
return;
|
|
4377
|
-
}
|
|
4378
|
-
q && x("regular"), G.mode === "create" ? (await e.onEventCreate?.(v), a.addEvent(v)) : (await e.onEventChange?.(v), a.updateEvent(v)), j((le) => ({ ...le, isOpen: !1 }));
|
|
4379
|
-
}, [ee, H] = Re({ isOpen: !1 }), R = async (v) => {
|
|
4380
|
-
H({ isOpen: !0, eventId: v });
|
|
4381
|
-
}, Be = async () => {
|
|
4382
|
-
const v = ee.eventId;
|
|
4383
|
-
if (!v) return;
|
|
4384
|
-
const U = s.find((q) => q.id === v);
|
|
4385
|
-
if (U) {
|
|
4386
|
-
await e.onEventDelete?.(v), a.deleteEvent(v);
|
|
4387
|
-
const q = F.get("NotificationService");
|
|
4388
|
-
if (q) {
|
|
4389
|
-
const le = ue(U.start, "MMM d, yyyy h:mm a");
|
|
4390
|
-
q.add({
|
|
4391
|
-
type: "success",
|
|
4392
|
-
message: `Event "${U.title}" on ${le} has been cancelled.`,
|
|
4393
|
-
duration: 5e3
|
|
4394
|
-
});
|
|
4395
|
-
}
|
|
4396
|
-
}
|
|
4397
|
-
H({ isOpen: !1 });
|
|
4398
|
-
}, he = (v) => {
|
|
4399
|
-
if (!e.allowPastEvents && v.start && v.start < /* @__PURE__ */ new Date()) {
|
|
4400
|
-
x("past");
|
|
4401
|
-
return;
|
|
4402
|
-
}
|
|
4403
|
-
a.addEvent(v), e.onEventCreate?.(v), X(!1);
|
|
4404
|
-
}, Oe = (v, U, q, le) => {
|
|
4405
|
-
e.showQuickInfoPopup && (Me({ start: v, end: U, resourceId: q }), ve({ x: le?.x || 0, y: le?.y || 0 }), X(!0));
|
|
4406
|
-
};
|
|
4407
|
-
return /* @__PURE__ */ c(kr, { fallback: /* @__PURE__ */ c(bo, {}), children: /* @__PURE__ */ w(
|
|
4408
|
-
"div",
|
|
4409
|
-
{
|
|
4410
|
-
className: V("ez-scheduler flex flex-col w-full h-full bg-background select-none overflow-hidden", e.className),
|
|
4411
|
-
dir: m,
|
|
4412
|
-
children: [
|
|
4413
|
-
e.showHeaderBar !== !1 && /* @__PURE__ */ c(qe.Suspense, { fallback: /* @__PURE__ */ c("div", { className: "h-12 w-full animate-pulse bg-muted/20 rounded-md mb-4" }), children: (() => {
|
|
4414
|
-
const v = e.slots?.toolbar;
|
|
4415
|
-
return v ? /* @__PURE__ */ c(
|
|
4416
|
-
v,
|
|
4417
|
-
{
|
|
4418
|
-
view: p,
|
|
4419
|
-
setView: _,
|
|
4420
|
-
currentDate: u,
|
|
4421
|
-
next: a.nextPeriod,
|
|
4422
|
-
prev: a.prevPeriod,
|
|
4423
|
-
today: a.today,
|
|
4424
|
-
onAddClick: je(() => j({ isOpen: !0, mode: "create", event: {} }), []),
|
|
4425
|
-
slotDuration: g,
|
|
4426
|
-
setSlotDuration: a.setSlotDuration,
|
|
4427
|
-
setCurrentDate: z,
|
|
4428
|
-
onPrev: a.prevPeriod,
|
|
4429
|
-
onNext: a.nextPeriod,
|
|
4430
|
-
onToday: a.today,
|
|
4431
|
-
currentView: p,
|
|
4432
|
-
onViewChange: (U) => {
|
|
4433
|
-
const q = U.toLowerCase().replace(/[^a-z]/g, ""), oe = {
|
|
4434
|
-
day: "day",
|
|
4435
|
-
week: "week",
|
|
4436
|
-
workweek: "workweek",
|
|
4437
|
-
month: "month",
|
|
4438
|
-
timelineday: "timeline-day",
|
|
4439
|
-
timelineweek: "timeline-week",
|
|
4440
|
-
timelineworkweek: "timeline-week",
|
|
4441
|
-
timelinemonth: "timeline-month",
|
|
4442
|
-
agenda: "agenda",
|
|
4443
|
-
timeline: "timeline-day"
|
|
4444
|
-
}[q] || q;
|
|
4445
|
-
_(oe);
|
|
4446
|
-
},
|
|
4447
|
-
views: e.views || ["Day", "Week", "Month"],
|
|
4448
|
-
onExportExcel: je(() => e.onExportExcel?.(s), [e.onExportExcel, s]),
|
|
4449
|
-
onExportCSV: je(() => e.onExportCSV?.(s), [e.onExportCSV, s]),
|
|
4450
|
-
onExportICS: je(() => e.onExportICS?.(s), [e.onExportICS, s]),
|
|
4451
|
-
dir: m,
|
|
4452
|
-
...e.slotProps?.toolbar
|
|
4453
|
-
}
|
|
4454
|
-
) : /* @__PURE__ */ c(
|
|
4455
|
-
ri,
|
|
4456
|
-
{
|
|
4457
|
-
view: p,
|
|
4458
|
-
setView: _,
|
|
4459
|
-
currentDate: u,
|
|
4460
|
-
next: a.nextPeriod,
|
|
4461
|
-
prev: a.prevPeriod,
|
|
4462
|
-
today: a.today,
|
|
4463
|
-
onAddClick: je(() => j({ isOpen: !0, mode: "create", event: {} }), []),
|
|
4464
|
-
slotDuration: g,
|
|
4465
|
-
setSlotDuration: a.setSlotDuration,
|
|
4466
|
-
setCurrentDate: z,
|
|
4467
|
-
onPrev: a.prevPeriod,
|
|
4468
|
-
onNext: a.nextPeriod,
|
|
4469
|
-
onToday: a.today,
|
|
4470
|
-
currentView: p,
|
|
4471
|
-
onViewChange: (U) => {
|
|
4472
|
-
const q = U.toLowerCase().replace(/[^a-z]/g, ""), oe = {
|
|
4473
|
-
day: "day",
|
|
4474
|
-
week: "week",
|
|
4475
|
-
workweek: "workweek",
|
|
4476
|
-
month: "month",
|
|
4477
|
-
timelineday: "timeline-day",
|
|
4478
|
-
timelineweek: "timeline-week",
|
|
4479
|
-
timelineworkweek: "timeline-week",
|
|
4480
|
-
timelinemonth: "timeline-month",
|
|
4481
|
-
agenda: "agenda",
|
|
4482
|
-
timeline: "timeline-day"
|
|
4483
|
-
}[q] || q;
|
|
4484
|
-
_(oe);
|
|
4485
|
-
},
|
|
4486
|
-
views: e.views || ["Day", "Week", "Month"],
|
|
4487
|
-
onExportExcel: je(() => e.onExportExcel?.(s), [e.onExportExcel, s]),
|
|
4488
|
-
onExportCSV: je(() => e.onExportCSV?.(s), [e.onExportCSV, s]),
|
|
4489
|
-
onExportICS: je(() => e.onExportICS?.(s), [e.onExportICS, s]),
|
|
4490
|
-
dir: m
|
|
4491
|
-
}
|
|
4492
|
-
);
|
|
4493
|
-
})() }),
|
|
4494
|
-
/* @__PURE__ */ w(Ar, { sensors: k, onDragEnd: M, collisionDetection: Or, children: [
|
|
4495
|
-
/* @__PURE__ */ w("div", { className: "flex-1 overflow-hidden relative flex flex-col", children: [
|
|
4496
|
-
/* @__PURE__ */ c(
|
|
4497
|
-
Zo,
|
|
4498
|
-
{
|
|
4499
|
-
view: p,
|
|
4500
|
-
daysInView: N,
|
|
4501
|
-
visibleEvents: s,
|
|
4502
|
-
rowVirtualizer: $,
|
|
4503
|
-
resources: S,
|
|
4504
|
-
handleSlotDoubleClick: de,
|
|
4505
|
-
handleEventDoubleClick: Z,
|
|
4506
|
-
handleEventDelete: R,
|
|
4507
|
-
parentRef: D,
|
|
4508
|
-
setView: _,
|
|
4509
|
-
setCurrentDate: z,
|
|
4510
|
-
props: e,
|
|
4511
|
-
handleRangeSelect: Oe,
|
|
4512
|
-
currentDate: u,
|
|
4513
|
-
showUnassignedLane: e.showUnassignedLane,
|
|
4514
|
-
slotDuration: g,
|
|
4515
|
-
is24Hour: h,
|
|
4516
|
-
setIs24Hour: a.setIs24Hour,
|
|
4517
|
-
dir: m
|
|
4518
|
-
}
|
|
4519
|
-
),
|
|
4520
|
-
e.isLoading && /* @__PURE__ */ c(yo, {})
|
|
4521
|
-
] }),
|
|
4522
|
-
(() => {
|
|
4523
|
-
if (De && ne) {
|
|
4524
|
-
const v = e.slots?.quickAdd;
|
|
4525
|
-
return v ? /* @__PURE__ */ c(qe.Suspense, { fallback: null, children: /* @__PURE__ */ c(
|
|
4526
|
-
v,
|
|
4527
|
-
{
|
|
4528
|
-
start: ne.start,
|
|
4529
|
-
end: ne.end,
|
|
4530
|
-
resourceId: ne.resourceId,
|
|
4531
|
-
resources: S,
|
|
4532
|
-
onSave: he,
|
|
4533
|
-
onCancel: () => X(!1),
|
|
4534
|
-
onMoreOptions: (U) => {
|
|
4535
|
-
X(!1), j({ isOpen: !0, mode: "create", event: U });
|
|
4536
|
-
},
|
|
4537
|
-
position: fe,
|
|
4538
|
-
...e.slotProps?.quickAdd
|
|
4539
|
-
}
|
|
4540
|
-
) }) : /* @__PURE__ */ c(qe.Suspense, { fallback: null, children: /* @__PURE__ */ c(
|
|
4541
|
-
ni,
|
|
4542
|
-
{
|
|
4543
|
-
start: ne.start,
|
|
4544
|
-
end: ne.end,
|
|
4545
|
-
resourceId: ne.resourceId,
|
|
4546
|
-
resources: S,
|
|
4547
|
-
onSave: he,
|
|
4548
|
-
onCancel: () => X(!1),
|
|
4549
|
-
onMoreOptions: (U) => {
|
|
4550
|
-
X(!1), j({ isOpen: !0, mode: "create", event: U });
|
|
4551
|
-
},
|
|
4552
|
-
position: fe
|
|
4553
|
-
}
|
|
4554
|
-
) });
|
|
4555
|
-
}
|
|
4556
|
-
return null;
|
|
4557
|
-
})(),
|
|
4558
|
-
(() => {
|
|
4559
|
-
const v = e.slots?.eventModal;
|
|
4560
|
-
return v ? /* @__PURE__ */ c(qe.Suspense, { fallback: null, children: /* @__PURE__ */ c(
|
|
4561
|
-
v,
|
|
4562
|
-
{
|
|
4563
|
-
isOpen: G.isOpen,
|
|
4564
|
-
onClose: () => j((U) => ({ ...U, isOpen: !1 })),
|
|
4565
|
-
mode: G.mode,
|
|
4566
|
-
event: G.event,
|
|
4567
|
-
onSave: me,
|
|
4568
|
-
onDelete: R,
|
|
4569
|
-
resources: S,
|
|
4570
|
-
locale: e.locale,
|
|
4571
|
-
...e.slotProps?.eventModal
|
|
4572
|
-
}
|
|
4573
|
-
) }) : /* @__PURE__ */ c(qe.Suspense, { fallback: null, children: /* @__PURE__ */ c(
|
|
4574
|
-
ti,
|
|
4575
|
-
{
|
|
4576
|
-
isOpen: G.isOpen,
|
|
4577
|
-
onClose: () => j((U) => ({ ...U, isOpen: !1 })),
|
|
4578
|
-
mode: G.mode,
|
|
4579
|
-
event: G.event,
|
|
4580
|
-
onSave: me,
|
|
4581
|
-
onDelete: R,
|
|
4582
|
-
resources: S,
|
|
4583
|
-
locale: e.locale
|
|
4584
|
-
}
|
|
4585
|
-
) });
|
|
4586
|
-
})(),
|
|
4587
|
-
/* @__PURE__ */ c(
|
|
4588
|
-
ei,
|
|
4589
|
-
{
|
|
4590
|
-
isOpen: ee.isOpen,
|
|
4591
|
-
onClose: () => H({ isOpen: !1 }),
|
|
4592
|
-
title: "Delete Event",
|
|
4593
|
-
footer: /* @__PURE__ */ w("div", { className: "flex gap-2", children: [
|
|
4594
|
-
/* @__PURE__ */ c(jt, { variant: "ghost", onClick: () => H({ isOpen: !1 }), children: "Cancel" }),
|
|
4595
|
-
/* @__PURE__ */ c(jt, { variant: "destructive", onClick: Be, children: "Delete" })
|
|
4596
|
-
] }),
|
|
4597
|
-
children: /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Are you sure you want to delete this event? This action cannot be undone." })
|
|
4598
|
-
}
|
|
4599
|
-
)
|
|
4600
|
-
] })
|
|
4601
|
-
]
|
|
4602
|
-
}
|
|
4603
|
-
) });
|
|
4604
|
-
});
|
|
4605
|
-
Kn.displayName = "EzSchedulerInner";
|
|
4606
|
-
export {
|
|
4607
|
-
La as A,
|
|
4608
|
-
Ba as B,
|
|
4609
|
-
Wr as C,
|
|
4610
|
-
Ua as D,
|
|
4611
|
-
oi as E,
|
|
4612
|
-
Wa as F,
|
|
4613
|
-
jr as G,
|
|
4614
|
-
tt as H,
|
|
4615
|
-
Br as I,
|
|
4616
|
-
ei as M,
|
|
4617
|
-
no as S,
|
|
4618
|
-
bn as a,
|
|
4619
|
-
pn as b,
|
|
4620
|
-
He as c,
|
|
4621
|
-
Jr as d,
|
|
4622
|
-
wn as e,
|
|
4623
|
-
ue as f,
|
|
4624
|
-
Xa as g,
|
|
4625
|
-
Le as h,
|
|
4626
|
-
ye as i,
|
|
4627
|
-
Ja as j,
|
|
4628
|
-
Wn as k,
|
|
4629
|
-
zn as l,
|
|
4630
|
-
St as m,
|
|
4631
|
-
yi as n,
|
|
4632
|
-
Hn as o,
|
|
4633
|
-
xi as p,
|
|
4634
|
-
Gn as q,
|
|
4635
|
-
Ot as r,
|
|
4636
|
-
st as s,
|
|
4637
|
-
ie as t,
|
|
4638
|
-
mo as u,
|
|
4639
|
-
_t as v,
|
|
4640
|
-
Yn as w,
|
|
4641
|
-
vt as x,
|
|
4642
|
-
gn as y,
|
|
4643
|
-
Oa as z
|
|
4644
|
-
};
|