@nivaro/react 0.3.113 → 0.3.115
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/dist/components/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e, Fragment as X } from "react/jsx-runtime";
|
|
2
|
-
import { readUser as
|
|
3
|
-
import { useQueryClient as M, useQuery as
|
|
4
|
-
import { Loader2 as ce, Camera as
|
|
5
|
-
import { useRef as
|
|
2
|
+
import { readUser as fe, readUserCard as ye, updateUser as de, readMyScopes as ve, saveMyScopeDefaults as ke, readItems as te } from "@nivaro/sdk";
|
|
3
|
+
import { useQueryClient as M, useQuery as v, useMutation as _ } from "@tanstack/react-query";
|
|
4
|
+
import { Loader2 as ce, Camera as Ne, Building2 as we, Mail as _e, Phone as Se, Clock as Ce, Undo2 as qe, Check as Pe, UserRound as Ae, Filter as Te, LogOut as Fe, ShieldCheck as Le } from "lucide-react";
|
|
5
|
+
import { useRef as be, useEffect as Oe, useState as q, useMemo as Me } from "react";
|
|
6
6
|
import { useNivaroClient as F, useItemEditAuth as ne } from "../context.js";
|
|
7
|
-
import { get as T, patch as
|
|
7
|
+
import { get as T, patch as G, post as ee, put as De, del as Ke } from "../lib/commands.js";
|
|
8
|
+
import { parseLiveMode as ue, LIVE_MODE_LABELS as Re, useLivePreference as Ee } from "../lib/live-preference.js";
|
|
8
9
|
import { playNotificationSound as me } from "../lib/notification-sound.js";
|
|
9
|
-
import { restrictedScopeSelections as
|
|
10
|
-
import { BRAND_ACCENT as ae, parseThemeAccents as
|
|
10
|
+
import { restrictedScopeSelections as Ie, cascadeFilter as je, fetchCascadeRelations as Ue } from "../lib/quick-filter-cascade.js";
|
|
11
|
+
import { BRAND_ACCENT as ae, parseThemeAccents as Qe, DEFAULT_THEME_ACCENTS as pe } from "../lib/theme-accents.js";
|
|
12
|
+
import { playUrgentChime as xe } from "../lib/urgent-chime.js";
|
|
11
13
|
import { announceLocalPrefs as re } from "../lib/user-sync.js";
|
|
12
|
-
import { cn as
|
|
13
|
-
import { CustomStatusEditor as
|
|
14
|
-
import { mergeNotifyRulesClient as
|
|
15
|
-
import { TestMyRules as
|
|
16
|
-
import { AgentsPanel as
|
|
17
|
-
import { AiMemoryCard as
|
|
18
|
-
import { BrowserPushCard as
|
|
19
|
-
import { DelegationCard as
|
|
20
|
-
import { MailSuppressedPill as
|
|
21
|
-
import { PersonDidPanel as
|
|
22
|
-
import { TeamLoadCard as
|
|
23
|
-
import { TeamsConnect as
|
|
24
|
-
import { NotificationSourcesCard as
|
|
25
|
-
import { MyDefaultsCard as
|
|
26
|
-
import { UserScopesCard as
|
|
27
|
-
import { PersonProfile as
|
|
28
|
-
import { Toggle as
|
|
29
|
-
import { SignedInDevices as
|
|
30
|
-
import { SimpleSelectXs as
|
|
31
|
-
const
|
|
32
|
-
var
|
|
33
|
-
return (`${((
|
|
34
|
-
},
|
|
35
|
-
function
|
|
36
|
-
const
|
|
14
|
+
import { cn as z, setDisplayTimezone as $e } from "../lib/utils.js";
|
|
15
|
+
import { CustomStatusEditor as ze, activeCustomStatus as Be } from "./CustomStatusEditor.js";
|
|
16
|
+
import { mergeNotifyRulesClient as He, NOTIFY_RULE_CATS as Ye, NotificationRulesEditor as We } from "./notifications/NotificationRulesEditor.js";
|
|
17
|
+
import { TestMyRules as Ve } from "./notifications/TestMyRules.js";
|
|
18
|
+
import { AgentsPanel as Ge } from "./profile/AgentsPanel.js";
|
|
19
|
+
import { AiMemoryCard as Je, AiHistoryCard as Ze } from "./profile/AiMemoryCard.js";
|
|
20
|
+
import { BrowserPushCard as Xe } from "./profile/BrowserPushCard.js";
|
|
21
|
+
import { DelegationCard as et } from "./profile/DelegationCard.js";
|
|
22
|
+
import { MailSuppressedPill as tt } from "./profile/MailSuppressedPill.js";
|
|
23
|
+
import { PersonDidPanel as at } from "./profile/PersonDidPanel.js";
|
|
24
|
+
import { TeamLoadCard as rt } from "./profile/PersonExtras.js";
|
|
25
|
+
import { TeamsConnect as nt } from "./profile/TeamsConnect.js";
|
|
26
|
+
import { NotificationSourcesCard as st } from "./NotificationSourcesCard.js";
|
|
27
|
+
import { MyDefaultsCard as lt } from "./profile/MyDefaultsCard.js";
|
|
28
|
+
import { UserScopesCard as ot } from "./profile/PersonAccess.js";
|
|
29
|
+
import { PersonProfile as it } from "./profile/PersonProfile.js";
|
|
30
|
+
import { Toggle as ge, SectionCard as se, Field as W, ConfirmButton as he } from "./profile/primitives.js";
|
|
31
|
+
import { SignedInDevices as dt } from "./profile/SignedInDevices.js";
|
|
32
|
+
import { SimpleSelectXs as E } from "./ui/SimpleSelect.js";
|
|
33
|
+
const ct = (s) => [s.first_name, s.last_name].filter(Boolean).join(" ") || (s.email ?? "Unknown"), ut = (s) => {
|
|
34
|
+
var u, r;
|
|
35
|
+
return (`${((u = s.first_name) == null ? void 0 : u[0]) ?? ""}${((r = s.last_name) == null ? void 0 : r[0]) ?? ""}` || (s.email ?? "?").slice(0, 2)).toUpperCase();
|
|
36
|
+
}, mt = Ye;
|
|
37
|
+
function pt() {
|
|
38
|
+
const s = F(), u = M(), { data: r = [] } = v({
|
|
37
39
|
queryKey: ["nvr-profile-fields"],
|
|
38
|
-
queryFn: () =>
|
|
39
|
-
}), [
|
|
40
|
-
mutationFn: (a) =>
|
|
40
|
+
queryFn: () => s.request(T("/profile-fields/mine")).then((a) => a.data ?? []).catch(() => [])
|
|
41
|
+
}), [n, o] = q(null), d = _({
|
|
42
|
+
mutationFn: (a) => s.request(De("/profile-fields/mine", { values: a })),
|
|
41
43
|
onSuccess: () => {
|
|
42
|
-
|
|
44
|
+
o(null), u.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
|
-
if (
|
|
46
|
-
const c =
|
|
47
|
+
if (r.length === 0) return null;
|
|
48
|
+
const c = n ?? Object.fromEntries(r.map((a) => [a.key, a.value ?? ""])), i = (a) => Array.isArray(a) ? a.map(String) : Array.isArray(a == null ? void 0 : a.choices) ? a.choices.map(
|
|
47
49
|
(h) => typeof h == "object" && h != null ? String(h.value ?? "") : String(h)
|
|
48
50
|
) : [];
|
|
49
51
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
@@ -51,47 +53,47 @@ function dt() {
|
|
|
51
53
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Profile fields" }),
|
|
52
54
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Extra details your organization tracks about people." })
|
|
53
55
|
] }),
|
|
54
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children:
|
|
56
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children: r.map((a) => /* @__PURE__ */ t("div", { children: [
|
|
55
57
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium text-slate-500", children: [
|
|
56
58
|
a.label,
|
|
57
59
|
a.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-red-500", children: "*" })
|
|
58
60
|
] }),
|
|
59
61
|
a.type === "boolean" ? /* @__PURE__ */ e(
|
|
60
|
-
|
|
62
|
+
E,
|
|
61
63
|
{
|
|
62
64
|
value: c[a.key] || "false",
|
|
63
65
|
options: [
|
|
64
66
|
{ value: "true", label: "Yes" },
|
|
65
67
|
{ value: "false", label: "No" }
|
|
66
68
|
],
|
|
67
|
-
onChange: (h) =>
|
|
69
|
+
onChange: (h) => o({ ...c, [a.key]: h })
|
|
68
70
|
}
|
|
69
71
|
) : a.type === "select" ? /* @__PURE__ */ e(
|
|
70
|
-
|
|
72
|
+
E,
|
|
71
73
|
{
|
|
72
74
|
value: c[a.key] || "",
|
|
73
75
|
options: [
|
|
74
76
|
{ value: "", label: "—" },
|
|
75
|
-
...
|
|
77
|
+
...i(a.options).map((h) => ({ value: h, label: h }))
|
|
76
78
|
],
|
|
77
|
-
onChange: (h) =>
|
|
79
|
+
onChange: (h) => o({ ...c, [a.key]: h })
|
|
78
80
|
}
|
|
79
81
|
) : /* @__PURE__ */ e(
|
|
80
82
|
"input",
|
|
81
83
|
{
|
|
82
84
|
type: a.type === "number" ? "number" : a.type === "date" ? "date" : "text",
|
|
83
85
|
value: c[a.key] ?? "",
|
|
84
|
-
onChange: (h) =>
|
|
86
|
+
onChange: (h) => o({ ...c, [a.key]: h.target.value }),
|
|
85
87
|
className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] dark:border-border"
|
|
86
88
|
}
|
|
87
89
|
)
|
|
88
90
|
] }, a.key)) }),
|
|
89
|
-
|
|
91
|
+
n && /* @__PURE__ */ t("div", { className: "flex justify-end gap-2 border-t border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
90
92
|
/* @__PURE__ */ e(
|
|
91
93
|
"button",
|
|
92
94
|
{
|
|
93
95
|
type: "button",
|
|
94
|
-
onClick: () =>
|
|
96
|
+
onClick: () => o(null),
|
|
95
97
|
className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500",
|
|
96
98
|
children: "Cancel"
|
|
97
99
|
}
|
|
@@ -100,101 +102,101 @@ function dt() {
|
|
|
100
102
|
"button",
|
|
101
103
|
{
|
|
102
104
|
type: "button",
|
|
103
|
-
disabled:
|
|
104
|
-
onClick: () =>
|
|
105
|
+
disabled: d.isPending,
|
|
106
|
+
onClick: () => d.mutate(c),
|
|
105
107
|
className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
106
|
-
children:
|
|
108
|
+
children: d.isPending ? "Saving…" : "Save"
|
|
107
109
|
}
|
|
108
110
|
)
|
|
109
111
|
] })
|
|
110
112
|
] });
|
|
111
113
|
}
|
|
112
|
-
function
|
|
113
|
-
var
|
|
114
|
-
const
|
|
114
|
+
function ht() {
|
|
115
|
+
var V, le, oe;
|
|
116
|
+
const s = F(), u = ne(), r = M(), { data: n } = v({
|
|
115
117
|
queryKey: ["nvr-profile-prefs"],
|
|
116
|
-
queryFn: () =>
|
|
118
|
+
queryFn: () => s.request(T("/users/me")).then((l) => {
|
|
117
119
|
var b;
|
|
118
|
-
return ((b =
|
|
120
|
+
return ((b = l.data) == null ? void 0 : b.preferences) ?? {};
|
|
119
121
|
})
|
|
120
|
-
}), { data:
|
|
122
|
+
}), { data: o } = v({
|
|
121
123
|
queryKey: ["nvr-profile-teams"],
|
|
122
|
-
queryFn: () =>
|
|
124
|
+
queryFn: () => s.request(T("/users/me")).then((l) => {
|
|
123
125
|
var b, w;
|
|
124
126
|
return {
|
|
125
|
-
available: ((b =
|
|
126
|
-
link: ((w =
|
|
127
|
+
available: ((b = l.data) == null ? void 0 : b.teams_available) === !0,
|
|
128
|
+
link: ((w = l.data) == null ? void 0 : w.teams_link) ?? null
|
|
127
129
|
};
|
|
128
130
|
})
|
|
129
|
-
}),
|
|
130
|
-
|
|
131
|
-
var
|
|
132
|
-
!a || typeof window > "u" || window.location.hash === "#notification-rules" && ((
|
|
131
|
+
}), d = (o == null ? void 0 : o.available) === !0, c = ((V = o == null ? void 0 : o.link) == null ? void 0 : V.status) === "active", i = be(null), a = n != null;
|
|
132
|
+
Oe(() => {
|
|
133
|
+
var l;
|
|
134
|
+
!a || typeof window > "u" || window.location.hash === "#notification-rules" && ((l = i.current) == null || l.scrollIntoView({ block: "start", behavior: "smooth" }));
|
|
133
135
|
}, [a]);
|
|
134
|
-
const h = (
|
|
136
|
+
const h = (n == null ? void 0 : n.notification_prefs) ?? {}, { data: m } = v({
|
|
135
137
|
queryKey: ["nvr-my-rule-defaults"],
|
|
136
|
-
queryFn: () =>
|
|
138
|
+
queryFn: () => s.request(T("/notifications/my-rule-defaults")).then((l) => l.data).catch(() => null),
|
|
137
139
|
staleTime: 6e4
|
|
138
|
-
}), P = (
|
|
140
|
+
}), P = (n == null ? void 0 : n.email_digest) === "daily" ? "daily" : "instant", C = He(h, m != null && m.role ? m.rules : null), D = (l) => {
|
|
139
141
|
var b, w, Y, ie;
|
|
140
|
-
return ((w = (b = h.matrix) == null ? void 0 : b[
|
|
141
|
-
}, y =
|
|
142
|
-
mutationFn: (
|
|
142
|
+
return ((w = (b = h.matrix) == null ? void 0 : b[l]) == null ? void 0 : w.email) ?? (P === "daily" ? "daily" : ((ie = (Y = C.matrix) == null ? void 0 : Y[l]) == null ? void 0 : ie.email) ?? P);
|
|
143
|
+
}, y = _({
|
|
144
|
+
mutationFn: (l) => s.request(G("/users/me/preferences", { notification_prefs: l })),
|
|
143
145
|
onSuccess: () => {
|
|
144
|
-
|
|
146
|
+
r.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(["notification_prefs"]);
|
|
145
147
|
}
|
|
146
|
-
}),
|
|
147
|
-
mutationFn: (
|
|
148
|
-
onSuccess: (
|
|
149
|
-
|
|
148
|
+
}), S = _({
|
|
149
|
+
mutationFn: (l) => s.request(G("/users/me/preferences", l)),
|
|
150
|
+
onSuccess: (l, b) => {
|
|
151
|
+
r.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(b));
|
|
150
152
|
}
|
|
151
|
-
}), [
|
|
152
|
-
mutationFn: (
|
|
153
|
-
onSuccess: (
|
|
154
|
-
total:
|
|
155
|
-
current:
|
|
156
|
-
proposed:
|
|
153
|
+
}), [k, L] = q(null), f = _({
|
|
154
|
+
mutationFn: (l) => s.request(ee("/notifications/rules-preview", { notification_prefs: l })),
|
|
155
|
+
onSuccess: (l) => L({
|
|
156
|
+
total: l.data.total_notifications,
|
|
157
|
+
current: l.data.current,
|
|
158
|
+
proposed: l.data.proposed
|
|
157
159
|
})
|
|
158
|
-
}), I = (
|
|
160
|
+
}), I = (l) => {
|
|
159
161
|
const b = {
|
|
160
|
-
...
|
|
162
|
+
...l,
|
|
161
163
|
// Kept as-is: "mute 1h" said to the bot lives here, and a save must not wipe it.
|
|
162
164
|
...h.teams_muted_until ? { teams_muted_until: h.teams_muted_until } : {}
|
|
163
165
|
};
|
|
164
166
|
f.mutate(b), y.mutate(b);
|
|
165
|
-
},
|
|
167
|
+
}, $ = (l) => I({ ...h, ...l }), x = (n == null ? void 0 : n.notification_sounds) ?? {}, K = (l, b) => {
|
|
166
168
|
const w = { ...x };
|
|
167
|
-
b === "default" ? delete w[
|
|
168
|
-
}, { data: H } =
|
|
169
|
+
b === "default" ? delete w[l] : w[l] = b, b !== "default" && me(b, { preview: !0 }), S.mutate({ notification_sounds: Object.keys(w).length ? w : null });
|
|
170
|
+
}, { data: H } = v({
|
|
169
171
|
queryKey: ["nvr-noise-suggestions"],
|
|
170
|
-
queryFn: () =>
|
|
172
|
+
queryFn: () => s.request(T("/notifications/noise-suggestions")).then((l) => l.data ?? []),
|
|
171
173
|
staleTime: 6e5
|
|
172
|
-
}), [j, g] = q({}), [
|
|
174
|
+
}), [j, g] = q({}), [U, Q] = q(() => {
|
|
173
175
|
try {
|
|
174
|
-
const
|
|
175
|
-
return
|
|
176
|
+
const l = JSON.parse(localStorage.getItem("nvr-noise-dismissed") ?? "null");
|
|
177
|
+
return l && Date.now() - l.at < 30 * 864e5 ? l.cats : [];
|
|
176
178
|
} catch {
|
|
177
179
|
return [];
|
|
178
180
|
}
|
|
179
|
-
}), B = (
|
|
180
|
-
const b = [...
|
|
181
|
+
}), B = (l) => {
|
|
182
|
+
const b = [...U, l];
|
|
181
183
|
Q(b);
|
|
182
184
|
try {
|
|
183
185
|
localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats: b }));
|
|
184
186
|
} catch {
|
|
185
187
|
}
|
|
186
|
-
},
|
|
187
|
-
mutationFn: () =>
|
|
188
|
-
onSuccess: (
|
|
188
|
+
}, p = Number.isInteger(Number(n == null ? void 0 : n.digest_hour)) ? Number(n == null ? void 0 : n.digest_hour) : 7, N = (l) => `${l % 12 === 0 ? 12 : l % 12}:45 ${l < 12 ? "AM" : "PM"}`, [A, R] = q(null), O = _({
|
|
189
|
+
mutationFn: () => s.request(ee("/users/me/digest-test", {})),
|
|
190
|
+
onSuccess: (l) => R(l.data.note),
|
|
189
191
|
onError: () => R("Test send failed — try again.")
|
|
190
|
-
}),
|
|
192
|
+
}), J = mt.some((l) => D(l.key) === "daily"), Z = ({ text: l }) => /* @__PURE__ */ e(
|
|
191
193
|
"span",
|
|
192
194
|
{
|
|
193
195
|
className: "ml-1 inline-flex h-3.5 w-3.5 cursor-help items-center justify-center rounded-full border border-slate-300 text-[9px] font-semibold normal-case tracking-normal text-slate-400 dark:border-border",
|
|
194
196
|
role: "img",
|
|
195
|
-
title:
|
|
196
|
-
"data-tip":
|
|
197
|
-
"aria-label":
|
|
197
|
+
title: l,
|
|
198
|
+
"data-tip": l,
|
|
199
|
+
"aria-label": l,
|
|
198
200
|
children: "?"
|
|
199
201
|
}
|
|
200
202
|
);
|
|
@@ -202,7 +204,7 @@ function ct() {
|
|
|
202
204
|
"div",
|
|
203
205
|
{
|
|
204
206
|
id: "notification-rules",
|
|
205
|
-
ref:
|
|
207
|
+
ref: i,
|
|
206
208
|
"data-profile-card": "notifications",
|
|
207
209
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
208
210
|
children: [
|
|
@@ -211,28 +213,28 @@ function ct() {
|
|
|
211
213
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Per category: whether it lands in your in-app inbox, whether your browser pushes it, and how it reaches your email — each one as it happens, folded into the daily action summary, or not at all. Quiet hours pause pushes and hold emails until morning unless a category is let through them; critical alerts (SLA escalations, maintenance, monitor failures) always get through." })
|
|
212
214
|
] }),
|
|
213
215
|
/* @__PURE__ */ t("div", { className: "space-y-3 p-4", children: [
|
|
214
|
-
(H ?? []).filter((
|
|
216
|
+
(H ?? []).filter((l) => !U.includes(l.category)).map((l) => /* @__PURE__ */ t(
|
|
215
217
|
"div",
|
|
216
218
|
{
|
|
217
|
-
"data-noise-suggestion":
|
|
219
|
+
"data-noise-suggestion": l.category,
|
|
218
220
|
className: "flex flex-wrap items-center gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[12px] text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200",
|
|
219
221
|
children: [
|
|
220
222
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
|
|
221
|
-
|
|
223
|
+
l.message,
|
|
222
224
|
" Mute them?"
|
|
223
225
|
] }),
|
|
224
|
-
|
|
226
|
+
l.category in j ? /* @__PURE__ */ e(
|
|
225
227
|
"button",
|
|
226
228
|
{
|
|
227
229
|
type: "button",
|
|
228
230
|
className: "underline",
|
|
229
231
|
onClick: () => {
|
|
230
|
-
|
|
232
|
+
$({
|
|
231
233
|
matrix: {
|
|
232
234
|
...h.matrix ?? {},
|
|
233
|
-
[
|
|
235
|
+
[l.category]: j[l.category]
|
|
234
236
|
}
|
|
235
|
-
}), g(({ [
|
|
237
|
+
}), g(({ [l.category]: b, ...w }) => w);
|
|
236
238
|
},
|
|
237
239
|
children: "Muted — undo"
|
|
238
240
|
}
|
|
@@ -244,24 +246,24 @@ function ct() {
|
|
|
244
246
|
className: "rounded border border-amber-300 px-2 py-0.5 font-medium dark:border-amber-800",
|
|
245
247
|
onClick: () => {
|
|
246
248
|
var w;
|
|
247
|
-
const b = ((w = h.matrix) == null ? void 0 : w[
|
|
248
|
-
g((Y) => ({ ...Y, [
|
|
249
|
+
const b = ((w = h.matrix) == null ? void 0 : w[l.category]) ?? { inapp: !0, push: !0 };
|
|
250
|
+
g((Y) => ({ ...Y, [l.category]: b })), $({
|
|
249
251
|
matrix: {
|
|
250
252
|
...h.matrix ?? {},
|
|
251
|
-
[
|
|
253
|
+
[l.category]: { ...b, inapp: !1, push: !1 }
|
|
252
254
|
}
|
|
253
255
|
});
|
|
254
256
|
},
|
|
255
257
|
children: "Mute"
|
|
256
258
|
}
|
|
257
259
|
),
|
|
258
|
-
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => B(
|
|
260
|
+
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => B(l.category), children: "Not now" })
|
|
259
261
|
] })
|
|
260
262
|
]
|
|
261
263
|
},
|
|
262
|
-
|
|
264
|
+
l.category
|
|
263
265
|
)),
|
|
264
|
-
|
|
266
|
+
k && k.total > 0 && /* @__PURE__ */ t(
|
|
265
267
|
"div",
|
|
266
268
|
{
|
|
267
269
|
"data-rules-preview": !0,
|
|
@@ -269,52 +271,52 @@ function ct() {
|
|
|
269
271
|
children: [
|
|
270
272
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
|
|
271
273
|
"Last week with this change: ",
|
|
272
|
-
|
|
274
|
+
k.proposed.inapp,
|
|
273
275
|
" in-app instead of",
|
|
274
276
|
" ",
|
|
275
|
-
|
|
277
|
+
k.current.inapp,
|
|
276
278
|
", ",
|
|
277
|
-
|
|
279
|
+
k.proposed.email_sent,
|
|
278
280
|
" emails instead of",
|
|
279
281
|
" ",
|
|
280
|
-
|
|
282
|
+
k.current.email_sent,
|
|
281
283
|
", ",
|
|
282
|
-
|
|
284
|
+
k.proposed.push,
|
|
283
285
|
" pushes instead of",
|
|
284
286
|
" ",
|
|
285
|
-
|
|
287
|
+
k.current.push,
|
|
286
288
|
"."
|
|
287
289
|
] }),
|
|
288
|
-
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () =>
|
|
290
|
+
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => L(null), children: "Dismiss" })
|
|
289
291
|
]
|
|
290
292
|
}
|
|
291
293
|
),
|
|
292
294
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
293
295
|
"Sound:",
|
|
294
296
|
/* @__PURE__ */ e(
|
|
295
|
-
|
|
297
|
+
E,
|
|
296
298
|
{
|
|
297
|
-
value: String((
|
|
299
|
+
value: String((n == null ? void 0 : n.notification_sound) ?? "off"),
|
|
298
300
|
options: [
|
|
299
301
|
{ value: "off", label: "Off" },
|
|
300
302
|
{ value: "subtle", label: "Subtle blip" },
|
|
301
303
|
{ value: "chime", label: "Chime" }
|
|
302
304
|
],
|
|
303
|
-
onChange: (
|
|
304
|
-
me(
|
|
305
|
+
onChange: (l) => {
|
|
306
|
+
me(l, { preview: !0 }), S.mutate({ notification_sound: l });
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
309
|
),
|
|
308
310
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "plays when a notification or a direct message arrives" }),
|
|
309
|
-
/* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(
|
|
311
|
+
/* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(Ve, {}) })
|
|
310
312
|
] }),
|
|
311
313
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
312
314
|
/* @__PURE__ */ e(
|
|
313
|
-
|
|
315
|
+
ge,
|
|
314
316
|
{
|
|
315
|
-
on: (
|
|
316
|
-
onChange: () =>
|
|
317
|
-
huddle_hold_notifications: (
|
|
317
|
+
on: (n == null ? void 0 : n.huddle_hold_notifications) !== !1,
|
|
318
|
+
onChange: () => S.mutate({
|
|
319
|
+
huddle_hold_notifications: (n == null ? void 0 : n.huddle_hold_notifications) === !1
|
|
318
320
|
}),
|
|
319
321
|
label: "Hold notifications during huddles"
|
|
320
322
|
}
|
|
@@ -323,39 +325,48 @@ function ct() {
|
|
|
323
325
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "toasts and sounds wait while you talk; you get one summary when you leave" })
|
|
324
326
|
] }),
|
|
325
327
|
/* @__PURE__ */ e(
|
|
326
|
-
|
|
328
|
+
Tt,
|
|
329
|
+
{
|
|
330
|
+
on: (n == null ? void 0 : n.urgent_sound) === !0,
|
|
331
|
+
onChange: (l) => {
|
|
332
|
+
l && xe({ preview: !0 }), S.mutate({ urgent_sound: l ? !0 : null });
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
),
|
|
336
|
+
/* @__PURE__ */ e(
|
|
337
|
+
We,
|
|
327
338
|
{
|
|
328
339
|
subject: "person",
|
|
329
|
-
isAdmin:
|
|
340
|
+
isAdmin: u.isAdmin,
|
|
330
341
|
value: h,
|
|
331
342
|
inherited: m != null && m.role ? m.rules : null,
|
|
332
343
|
inheritedName: ((le = m == null ? void 0 : m.role) == null ? void 0 : le.name) ?? null,
|
|
333
344
|
legacyEmail: P,
|
|
334
345
|
saving: y.isPending,
|
|
335
|
-
onCommit: (
|
|
336
|
-
onLegacyEmail: (
|
|
337
|
-
teams:
|
|
346
|
+
onCommit: (l) => I(l),
|
|
347
|
+
onLegacyEmail: (l) => S.mutate({ email_digest: l }),
|
|
348
|
+
teams: d ? {
|
|
338
349
|
available: !0,
|
|
339
350
|
linked: c,
|
|
340
|
-
header: /* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(
|
|
351
|
+
header: /* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(nt, { linked: c, linkedAt: (oe = o == null ? void 0 : o.link) == null ? void 0 : oe.linked_at }) })
|
|
341
352
|
} : null,
|
|
342
353
|
extraColumn: {
|
|
343
354
|
header: /* @__PURE__ */ t(X, { children: [
|
|
344
355
|
"Sound",
|
|
345
356
|
/* @__PURE__ */ e(Z, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
|
|
346
357
|
] }),
|
|
347
|
-
cell: (
|
|
348
|
-
|
|
358
|
+
cell: (l, b) => /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
|
|
359
|
+
E,
|
|
349
360
|
{
|
|
350
361
|
ariaLabel: `Sound for ${b}`,
|
|
351
|
-
value: x[
|
|
362
|
+
value: x[l] ?? "default",
|
|
352
363
|
options: [
|
|
353
364
|
{ value: "default", label: "Default" },
|
|
354
365
|
{ value: "off", label: "None" },
|
|
355
366
|
{ value: "subtle", label: "Subtle blip" },
|
|
356
367
|
{ value: "chime", label: "Chime" }
|
|
357
368
|
],
|
|
358
|
-
onChange: (w) =>
|
|
369
|
+
onChange: (w) => K(l, w)
|
|
359
370
|
}
|
|
360
371
|
) })
|
|
361
372
|
}
|
|
@@ -366,19 +377,19 @@ function ct() {
|
|
|
366
377
|
"Daily action summary",
|
|
367
378
|
/* @__PURE__ */ t("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: [
|
|
368
379
|
"one morning email — every category set to Daily summary, plus items assigned to you and invoices awaiting your review",
|
|
369
|
-
!
|
|
380
|
+
!J && " · nothing is set to Daily summary yet"
|
|
370
381
|
] })
|
|
371
382
|
] }),
|
|
372
383
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
|
|
373
384
|
/* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
|
|
374
385
|
"Deliver at",
|
|
375
386
|
/* @__PURE__ */ e(
|
|
376
|
-
|
|
387
|
+
E,
|
|
377
388
|
{
|
|
378
389
|
ariaLabel: "Digest delivery hour",
|
|
379
|
-
value: String(
|
|
380
|
-
onChange: (
|
|
381
|
-
options: Array.from({ length: 24 }, (
|
|
390
|
+
value: String(p),
|
|
391
|
+
onChange: (l) => S.mutate({ digest_hour: Number(l) }),
|
|
392
|
+
options: Array.from({ length: 24 }, (l, b) => ({
|
|
382
393
|
value: String(b),
|
|
383
394
|
label: N(b)
|
|
384
395
|
}))
|
|
@@ -391,8 +402,8 @@ function ct() {
|
|
|
391
402
|
"input",
|
|
392
403
|
{
|
|
393
404
|
type: "checkbox",
|
|
394
|
-
checked: (
|
|
395
|
-
onChange: (
|
|
405
|
+
checked: (n == null ? void 0 : n.digest_layout) === "compact",
|
|
406
|
+
onChange: (l) => S.mutate({ digest_layout: l.target.checked ? "compact" : "detailed" }),
|
|
396
407
|
className: "rounded"
|
|
397
408
|
}
|
|
398
409
|
),
|
|
@@ -402,10 +413,10 @@ function ct() {
|
|
|
402
413
|
"button",
|
|
403
414
|
{
|
|
404
415
|
type: "button",
|
|
405
|
-
disabled:
|
|
406
|
-
onClick: () =>
|
|
416
|
+
disabled: O.isPending,
|
|
417
|
+
onClick: () => O.mutate(),
|
|
407
418
|
className: "text-[12px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-slate-700 disabled:opacity-50 dark:text-slate-400 dark:hover:text-slate-200",
|
|
408
|
-
children:
|
|
419
|
+
children: O.isPending ? "Building…" : "Send me a test summary now"
|
|
409
420
|
}
|
|
410
421
|
),
|
|
411
422
|
A && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: A })
|
|
@@ -417,25 +428,25 @@ function ct() {
|
|
|
417
428
|
["created", "create"],
|
|
418
429
|
["commented", "comment on"],
|
|
419
430
|
["transitioned", "move through a workflow"]
|
|
420
|
-
].map(([
|
|
431
|
+
].map(([l, b]) => {
|
|
421
432
|
var w;
|
|
422
433
|
return /* @__PURE__ */ t("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
|
|
423
434
|
/* @__PURE__ */ e(
|
|
424
435
|
"input",
|
|
425
436
|
{
|
|
426
437
|
type: "checkbox",
|
|
427
|
-
checked: ((w =
|
|
428
|
-
onChange: (Y) =>
|
|
438
|
+
checked: ((w = n == null ? void 0 : n.auto_watch) == null ? void 0 : w[l]) === !0,
|
|
439
|
+
onChange: (Y) => S.mutate({
|
|
429
440
|
auto_watch: {
|
|
430
|
-
...(
|
|
431
|
-
[
|
|
441
|
+
...(n == null ? void 0 : n.auto_watch) ?? {},
|
|
442
|
+
[l]: Y.target.checked
|
|
432
443
|
}
|
|
433
444
|
}),
|
|
434
445
|
className: "rounded"
|
|
435
446
|
}
|
|
436
447
|
),
|
|
437
448
|
b
|
|
438
|
-
] },
|
|
449
|
+
] }, l);
|
|
439
450
|
})
|
|
440
451
|
] })
|
|
441
452
|
] })
|
|
@@ -443,16 +454,16 @@ function ct() {
|
|
|
443
454
|
}
|
|
444
455
|
);
|
|
445
456
|
}
|
|
446
|
-
function
|
|
447
|
-
const
|
|
457
|
+
function bt() {
|
|
458
|
+
const s = F(), u = M(), { data: r } = v({
|
|
448
459
|
queryKey: ["nvr-profile-prefs"],
|
|
449
|
-
queryFn: () =>
|
|
450
|
-
var
|
|
451
|
-
return ((
|
|
460
|
+
queryFn: () => s.request(T("/users/me")).then((c) => {
|
|
461
|
+
var i;
|
|
462
|
+
return ((i = c.data) == null ? void 0 : i.preferences) ?? {};
|
|
452
463
|
})
|
|
453
|
-
}),
|
|
454
|
-
mutationFn: (c) =>
|
|
455
|
-
onSuccess: () => void
|
|
464
|
+
}), n = (r == null ? void 0 : r.link_app) === "portal" || (r == null ? void 0 : r.link_app) === "admin" ? r.link_app : "auto", o = _({
|
|
465
|
+
mutationFn: (c) => s.request(G("/users/me/preferences", { link_app: c })),
|
|
466
|
+
onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
|
|
456
467
|
});
|
|
457
468
|
return /* @__PURE__ */ t(
|
|
458
469
|
"div",
|
|
@@ -471,8 +482,8 @@ function mt() {
|
|
|
471
482
|
{
|
|
472
483
|
type: "button",
|
|
473
484
|
title: c.hint,
|
|
474
|
-
onClick: () =>
|
|
475
|
-
className:
|
|
485
|
+
onClick: () => o.mutate(c.v),
|
|
486
|
+
className: n === c.v ? "rounded bg-nvr-cyan px-3 py-1 text-[12.5px] font-medium text-white" : "rounded px-3 py-1 text-[12.5px] font-medium text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted",
|
|
476
487
|
children: c.label
|
|
477
488
|
},
|
|
478
489
|
c.v
|
|
@@ -481,14 +492,14 @@ function mt() {
|
|
|
481
492
|
}
|
|
482
493
|
);
|
|
483
494
|
}
|
|
484
|
-
function
|
|
485
|
-
const
|
|
495
|
+
function xt() {
|
|
496
|
+
const s = F(), u = M(), [r, n] = q(""), o = (() => {
|
|
486
497
|
try {
|
|
487
498
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
488
499
|
} catch {
|
|
489
500
|
return "UTC";
|
|
490
501
|
}
|
|
491
|
-
})(),
|
|
502
|
+
})(), d = (() => {
|
|
492
503
|
var m;
|
|
493
504
|
try {
|
|
494
505
|
return ((m = Intl.supportedValuesOf) == null ? void 0 : m.call(
|
|
@@ -498,18 +509,18 @@ function ut() {
|
|
|
498
509
|
} catch {
|
|
499
510
|
return [];
|
|
500
511
|
}
|
|
501
|
-
})(), { data: c } =
|
|
512
|
+
})(), { data: c } = v({
|
|
502
513
|
queryKey: ["nvr-profile-prefs"],
|
|
503
|
-
queryFn: () =>
|
|
514
|
+
queryFn: () => s.request(T("/users/me")).then((m) => {
|
|
504
515
|
var P;
|
|
505
516
|
return ((P = m.data) == null ? void 0 : P.preferences) ?? {};
|
|
506
517
|
})
|
|
507
|
-
}),
|
|
508
|
-
mutationFn: (m) =>
|
|
518
|
+
}), i = typeof (c == null ? void 0 : c.timezone) == "string" ? c.timezone : null, a = _({
|
|
519
|
+
mutationFn: (m) => s.request(G("/users/me/preferences", { timezone: m })),
|
|
509
520
|
onSuccess: (m, P) => {
|
|
510
|
-
|
|
521
|
+
$e(P), n(""), u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
|
|
511
522
|
}
|
|
512
|
-
}), h =
|
|
523
|
+
}), h = r.length > 1 ? d.filter((m) => m.toLowerCase().includes(r.toLowerCase())).slice(0, 8) : [];
|
|
513
524
|
return /* @__PURE__ */ t(
|
|
514
525
|
"div",
|
|
515
526
|
{
|
|
@@ -520,12 +531,12 @@ function ut() {
|
|
|
520
531
|
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
521
532
|
"Dates and times render in this zone. Your browser reports",
|
|
522
533
|
" ",
|
|
523
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
534
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: o }),
|
|
524
535
|
"."
|
|
525
536
|
] }),
|
|
526
537
|
/* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
|
|
527
|
-
/* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children:
|
|
528
|
-
|
|
538
|
+
/* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children: i ?? `${o} (browser default)` }),
|
|
539
|
+
i && /* @__PURE__ */ e(
|
|
529
540
|
"button",
|
|
530
541
|
{
|
|
531
542
|
type: "button",
|
|
@@ -539,8 +550,8 @@ function ut() {
|
|
|
539
550
|
/* @__PURE__ */ e(
|
|
540
551
|
"input",
|
|
541
552
|
{
|
|
542
|
-
value:
|
|
543
|
-
onChange: (m) =>
|
|
553
|
+
value: r,
|
|
554
|
+
onChange: (m) => n(m.target.value),
|
|
544
555
|
placeholder: "Change zone… (e.g. America/Denver)",
|
|
545
556
|
className: "h-8 w-[280px] rounded-md border border-slate-200 bg-background px-2.5 text-[12.5px] dark:border-border"
|
|
546
557
|
}
|
|
@@ -560,255 +571,255 @@ function ut() {
|
|
|
560
571
|
}
|
|
561
572
|
);
|
|
562
573
|
}
|
|
563
|
-
function
|
|
564
|
-
const
|
|
574
|
+
function gt() {
|
|
575
|
+
const s = F(), u = M(), { data: r } = v({
|
|
565
576
|
queryKey: ["nvr-profile-scopes"],
|
|
566
|
-
queryFn: () =>
|
|
567
|
-
}),
|
|
568
|
-
mutationFn: ({ dimension:
|
|
569
|
-
onSuccess: () => void
|
|
577
|
+
queryFn: () => s.request(ve()).then((o) => o.data)
|
|
578
|
+
}), n = _({
|
|
579
|
+
mutationFn: ({ dimension: o, values: d }) => s.request(ke(o, d)),
|
|
580
|
+
onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
|
|
570
581
|
});
|
|
571
|
-
return !
|
|
582
|
+
return !r || r.dimensions.length === 0 ? null : /* @__PURE__ */ e(
|
|
572
583
|
se,
|
|
573
584
|
{
|
|
574
585
|
testId: "scopes",
|
|
575
|
-
icon: /* @__PURE__ */ e(
|
|
586
|
+
icon: /* @__PURE__ */ e(Te, { className: "h-4 w-4" }),
|
|
576
587
|
title: "Default filters",
|
|
577
588
|
hint: "Pre-selected in browsers and reports — clear anytime",
|
|
578
|
-
children: /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
579
|
-
|
|
589
|
+
children: /* @__PURE__ */ e("div", { className: "space-y-3", children: r.dimensions.map((o) => /* @__PURE__ */ e(
|
|
590
|
+
ft,
|
|
580
591
|
{
|
|
581
|
-
dimension:
|
|
582
|
-
selected:
|
|
583
|
-
restricted:
|
|
584
|
-
scopes:
|
|
585
|
-
onSave: (
|
|
592
|
+
dimension: o,
|
|
593
|
+
selected: r.defaults[o.name] ?? [],
|
|
594
|
+
restricted: r.restricted[o.name],
|
|
595
|
+
scopes: r,
|
|
596
|
+
onSave: (d) => n.mutate({ dimension: o.name, values: d })
|
|
586
597
|
},
|
|
587
|
-
|
|
598
|
+
o.name
|
|
588
599
|
)) })
|
|
589
600
|
}
|
|
590
601
|
);
|
|
591
602
|
}
|
|
592
|
-
function
|
|
593
|
-
dimension:
|
|
594
|
-
selected:
|
|
595
|
-
restricted:
|
|
596
|
-
scopes:
|
|
597
|
-
onSave:
|
|
603
|
+
function ft({
|
|
604
|
+
dimension: s,
|
|
605
|
+
selected: u,
|
|
606
|
+
restricted: r,
|
|
607
|
+
scopes: n,
|
|
608
|
+
onSave: o
|
|
598
609
|
}) {
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
await
|
|
610
|
+
const d = F(), c = M(), i = s.display_field ?? "name", [a, h] = q(""), [m, P] = q(!1), C = Ie(s.target_collection, n), D = async () => C.length ? je(
|
|
611
|
+
s.target_collection,
|
|
612
|
+
await Ue(d, c, s.target_collection),
|
|
602
613
|
C
|
|
603
|
-
) : null, { data: y = [] } =
|
|
604
|
-
queryKey: ["nvr-scope-options",
|
|
614
|
+
) : null, { data: y = [] } = v({
|
|
615
|
+
queryKey: ["nvr-scope-options", s.name, C],
|
|
605
616
|
queryFn: async () => {
|
|
606
|
-
const
|
|
607
|
-
return ((await
|
|
608
|
-
te(
|
|
609
|
-
fields: ["id",
|
|
610
|
-
...
|
|
611
|
-
sort:
|
|
617
|
+
const p = await D();
|
|
618
|
+
return ((await d.request(
|
|
619
|
+
te(s.target_collection, {
|
|
620
|
+
fields: ["id", i],
|
|
621
|
+
...p ? { filter: p } : {},
|
|
622
|
+
sort: s.options_sort ? [s.options_sort] : void 0,
|
|
612
623
|
limit: 200
|
|
613
624
|
})
|
|
614
625
|
)).data ?? []).map((A) => ({
|
|
615
626
|
id: A.id,
|
|
616
|
-
label: String(A[
|
|
627
|
+
label: String(A[i] ?? A.id)
|
|
617
628
|
}));
|
|
618
629
|
}
|
|
619
|
-
}),
|
|
620
|
-
queryKey: ["nvr-scope-search",
|
|
630
|
+
}), S = r != null && r.length ? new Set(r.map(String)) : null, k = S ? y.filter((p) => S.has(String(p.id))) : y, L = new Set(u.map(String)), f = k.length > 24 || y.length >= 200 && !S, { data: I = [], isFetching: $ } = v({
|
|
631
|
+
queryKey: ["nvr-scope-search", s.name, a, C],
|
|
621
632
|
queryFn: async () => {
|
|
622
|
-
const
|
|
623
|
-
te(
|
|
624
|
-
fields: ["id",
|
|
625
|
-
filter:
|
|
626
|
-
sort:
|
|
633
|
+
const p = await D(), N = { [i]: { _contains: a } }, R = ((await d.request(
|
|
634
|
+
te(s.target_collection, {
|
|
635
|
+
fields: ["id", i],
|
|
636
|
+
filter: p ? { _and: [N, p] } : N,
|
|
637
|
+
sort: s.options_sort ? [s.options_sort] : void 0,
|
|
627
638
|
limit: 30
|
|
628
639
|
})
|
|
629
|
-
)).data ?? []).map((
|
|
630
|
-
id:
|
|
631
|
-
label: String(
|
|
640
|
+
)).data ?? []).map((O) => ({
|
|
641
|
+
id: O.id,
|
|
642
|
+
label: String(O[i] ?? O.id)
|
|
632
643
|
}));
|
|
633
|
-
return
|
|
644
|
+
return S ? R.filter((O) => S.has(String(O.id))) : R;
|
|
634
645
|
},
|
|
635
646
|
enabled: f && a.trim().length > 0,
|
|
636
|
-
placeholderData: (
|
|
637
|
-
}), x = new Map(y.map((
|
|
638
|
-
for (const
|
|
639
|
-
const
|
|
640
|
-
queryKey: ["nvr-scope-selected-labels",
|
|
641
|
-
queryFn: async () => ((await
|
|
642
|
-
te(
|
|
643
|
-
fields: ["id",
|
|
644
|
-
filter: { id: { _in:
|
|
647
|
+
placeholderData: (p) => p
|
|
648
|
+
}), x = new Map(y.map((p) => [String(p.id), p.label]));
|
|
649
|
+
for (const p of I) x.set(String(p.id), p.label);
|
|
650
|
+
const K = u.filter((p) => !x.has(String(p))), { data: H = [] } = v({
|
|
651
|
+
queryKey: ["nvr-scope-selected-labels", s.name, K.map(String).sort().join(",")],
|
|
652
|
+
queryFn: async () => ((await d.request(
|
|
653
|
+
te(s.target_collection, {
|
|
654
|
+
fields: ["id", i],
|
|
655
|
+
filter: { id: { _in: K } },
|
|
645
656
|
limit: 100
|
|
646
657
|
})
|
|
647
658
|
)).data ?? []).map((N) => ({
|
|
648
659
|
id: N.id,
|
|
649
|
-
label: String(N[
|
|
660
|
+
label: String(N[i] ?? N.id)
|
|
650
661
|
})),
|
|
651
|
-
enabled:
|
|
662
|
+
enabled: K.length > 0
|
|
652
663
|
});
|
|
653
|
-
for (const
|
|
654
|
-
const j = (
|
|
655
|
-
const N =
|
|
656
|
-
|
|
657
|
-
}, g = a.trim().toLowerCase(),
|
|
664
|
+
for (const p of H) x.set(String(p.id), p.label);
|
|
665
|
+
const j = (p) => {
|
|
666
|
+
const N = L.has(String(p));
|
|
667
|
+
o(N ? u.filter((A) => String(A) !== String(p)) : [...u, p]);
|
|
668
|
+
}, g = a.trim().toLowerCase(), U = g ? k.filter((p) => p.label.toLowerCase().includes(g)) : k, Q = g.length === 0 ? k.slice(0, 30) : $ && I.length === 0 ? U.slice(0, 30) : I, B = f && (m || g.length > 0);
|
|
658
669
|
return /* @__PURE__ */ t("div", { children: [
|
|
659
670
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
671
|
+
s.label,
|
|
672
|
+
r != null && r.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
|
|
673
|
+
u.length > 0 && /* @__PURE__ */ t(
|
|
663
674
|
"button",
|
|
664
675
|
{
|
|
665
676
|
type: "button",
|
|
666
|
-
onClick: () =>
|
|
677
|
+
onClick: () => o([]),
|
|
667
678
|
className: "ml-2 normal-case tracking-normal text-slate-400 underline-offset-2 hover:text-slate-600 hover:underline",
|
|
668
679
|
children: [
|
|
669
680
|
"clear ",
|
|
670
|
-
|
|
681
|
+
u.length
|
|
671
682
|
]
|
|
672
683
|
}
|
|
673
684
|
)
|
|
674
685
|
] }),
|
|
675
686
|
f ? /* @__PURE__ */ t("div", { className: "max-w-xl", children: [
|
|
676
|
-
|
|
687
|
+
u.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: u.map((p) => /* @__PURE__ */ t(
|
|
677
688
|
"span",
|
|
678
689
|
{
|
|
679
690
|
className: "inline-flex items-center gap-1 rounded-full border border-nvr-cyan bg-nvr-cyan/10 py-0.5 pl-2.5 pr-1 text-[11.5px] font-medium text-nvr-navy dark:text-nvr-cyan",
|
|
680
691
|
children: [
|
|
681
|
-
x.get(String(
|
|
692
|
+
x.get(String(p)) ?? String(p),
|
|
682
693
|
/* @__PURE__ */ e(
|
|
683
694
|
"button",
|
|
684
695
|
{
|
|
685
696
|
type: "button",
|
|
686
|
-
onClick: () => j(
|
|
687
|
-
"aria-label": `Remove ${x.get(String(
|
|
697
|
+
onClick: () => j(p),
|
|
698
|
+
"aria-label": `Remove ${x.get(String(p)) ?? p}`,
|
|
688
699
|
className: "rounded-full px-1 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
|
|
689
700
|
children: "×"
|
|
690
701
|
}
|
|
691
702
|
)
|
|
692
703
|
]
|
|
693
704
|
},
|
|
694
|
-
String(
|
|
705
|
+
String(p)
|
|
695
706
|
)) }),
|
|
696
707
|
/* @__PURE__ */ e(
|
|
697
708
|
"input",
|
|
698
709
|
{
|
|
699
710
|
value: a,
|
|
700
|
-
onChange: (
|
|
711
|
+
onChange: (p) => h(p.target.value),
|
|
701
712
|
onFocus: () => P(!0),
|
|
702
713
|
onBlur: () => P(!1),
|
|
703
|
-
placeholder: `Search ${
|
|
714
|
+
placeholder: `Search ${s.label.toLowerCase()} to add…`,
|
|
704
715
|
className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2.5 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-card"
|
|
705
716
|
}
|
|
706
717
|
),
|
|
707
718
|
B && /* @__PURE__ */ t(
|
|
708
719
|
"div",
|
|
709
720
|
{
|
|
710
|
-
onMouseDown: (
|
|
721
|
+
onMouseDown: (p) => p.preventDefault(),
|
|
711
722
|
className: "mt-1 max-h-44 overflow-y-auto rounded-md border border-slate-200 dark:border-border",
|
|
712
723
|
children: [
|
|
713
|
-
Q.map((
|
|
714
|
-
const N =
|
|
724
|
+
Q.map((p) => {
|
|
725
|
+
const N = L.has(String(p.id));
|
|
715
726
|
return /* @__PURE__ */ t(
|
|
716
727
|
"button",
|
|
717
728
|
{
|
|
718
729
|
type: "button",
|
|
719
|
-
onClick: () => j(
|
|
720
|
-
className:
|
|
730
|
+
onClick: () => j(p.id),
|
|
731
|
+
className: z(
|
|
721
732
|
"flex w-full items-center justify-between px-2.5 py-1.5 text-left text-[12px] hover:bg-slate-50 dark:hover:bg-muted",
|
|
722
733
|
N ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
|
|
723
734
|
),
|
|
724
735
|
children: [
|
|
725
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
736
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: p.label }),
|
|
726
737
|
/* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: N ? "Remove" : "Add" })
|
|
727
738
|
]
|
|
728
739
|
},
|
|
729
|
-
String(
|
|
740
|
+
String(p.id)
|
|
730
741
|
);
|
|
731
742
|
}),
|
|
732
|
-
Q.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children:
|
|
733
|
-
g.length === 0 &&
|
|
743
|
+
Q.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: $ ? "Searching…" : g ? "No matches." : "No options." }),
|
|
744
|
+
g.length === 0 && k.length > 30 && /* @__PURE__ */ e("p", { className: "border-t border-slate-100 px-2.5 py-1.5 text-[11px] text-slate-400 dark:border-border", children: "Showing first 30 — type to narrow." })
|
|
734
745
|
]
|
|
735
746
|
}
|
|
736
747
|
),
|
|
737
|
-
!B &&
|
|
748
|
+
!B && u.length === 0 && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-slate-400", children: "No defaults set — click to browse or type to search." })
|
|
738
749
|
] }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: [
|
|
739
|
-
|
|
740
|
-
const N =
|
|
750
|
+
k.map((p) => {
|
|
751
|
+
const N = L.has(String(p.id));
|
|
741
752
|
return /* @__PURE__ */ e(
|
|
742
753
|
"button",
|
|
743
754
|
{
|
|
744
755
|
type: "button",
|
|
745
|
-
onClick: () => j(
|
|
746
|
-
className:
|
|
756
|
+
onClick: () => j(p.id),
|
|
757
|
+
className: z(
|
|
747
758
|
"rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
|
|
748
759
|
N ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:border-slate-300 dark:border-border"
|
|
749
760
|
),
|
|
750
|
-
children:
|
|
761
|
+
children: p.label
|
|
751
762
|
},
|
|
752
|
-
String(
|
|
763
|
+
String(p.id)
|
|
753
764
|
);
|
|
754
765
|
}),
|
|
755
|
-
|
|
766
|
+
k.length === 0 && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "No options." })
|
|
756
767
|
] })
|
|
757
768
|
] });
|
|
758
769
|
}
|
|
759
|
-
function
|
|
760
|
-
const { data:
|
|
770
|
+
function yt() {
|
|
771
|
+
const { data: s } = v({
|
|
761
772
|
queryKey: ["nvr-settings-2fa"],
|
|
762
|
-
queryFn: () =>
|
|
773
|
+
queryFn: () => r.request({ _method: "GET", _path: "/settings/" }).then((f) => (f == null ? void 0 : f.data) ?? null).catch(() => null),
|
|
763
774
|
staleTime: 6e5
|
|
764
|
-
}),
|
|
775
|
+
}), u = (s == null ? void 0 : s.two_factor_enabled) !== !1, r = F(), n = M(), [o, d] = q(null), [c, i] = q(""), [a, h] = q(null), { data: m } = v({
|
|
765
776
|
queryKey: ["nvr-profile-totp"],
|
|
766
|
-
queryFn: () =>
|
|
767
|
-
}), P = () => void
|
|
768
|
-
mutationFn: () =>
|
|
769
|
-
onSuccess: (f) =>
|
|
770
|
-
}),
|
|
771
|
-
mutationFn: (f) =>
|
|
777
|
+
queryFn: () => r.request({ _method: "GET", _path: "/two-factor/status" }).then((f) => f.data)
|
|
778
|
+
}), P = () => void n.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), C = _({
|
|
779
|
+
mutationFn: () => r.request({ _method: "POST", _path: "/two-factor/setup" }).then((f) => f.data),
|
|
780
|
+
onSuccess: (f) => d(f)
|
|
781
|
+
}), D = _({
|
|
782
|
+
mutationFn: (f) => r.request({
|
|
772
783
|
_method: "POST",
|
|
773
784
|
_path: "/two-factor/verify",
|
|
774
785
|
_body: { token: f }
|
|
775
786
|
}),
|
|
776
787
|
onSuccess: () => {
|
|
777
|
-
|
|
788
|
+
d(null), i(""), P();
|
|
778
789
|
}
|
|
779
|
-
}), y =
|
|
780
|
-
mutationFn: (f) =>
|
|
790
|
+
}), y = _({
|
|
791
|
+
mutationFn: (f) => r.request({
|
|
781
792
|
_method: "POST",
|
|
782
793
|
_path: "/two-factor/disable",
|
|
783
794
|
_body: { token: f }
|
|
784
795
|
}),
|
|
785
796
|
onSuccess: () => {
|
|
786
|
-
|
|
797
|
+
i(""), P();
|
|
787
798
|
}
|
|
788
|
-
}),
|
|
789
|
-
mutationFn: () =>
|
|
799
|
+
}), S = _({
|
|
800
|
+
mutationFn: () => r.request({ _method: "POST", _path: "/users/me/token" }).then((f) => f.data),
|
|
790
801
|
onSuccess: (f) => h(f.token)
|
|
791
|
-
}),
|
|
792
|
-
mutationFn: () =>
|
|
802
|
+
}), k = _({
|
|
803
|
+
mutationFn: () => r.request({ _method: "DELETE", _path: "/users/me/token" }),
|
|
793
804
|
onSuccess: () => h(null)
|
|
794
|
-
}),
|
|
795
|
-
mutationFn: () =>
|
|
805
|
+
}), L = _({
|
|
806
|
+
mutationFn: () => r.request({ _method: "POST", _path: "/auth/logout-all" }),
|
|
796
807
|
onSuccess: () => window.location.assign("/login")
|
|
797
808
|
});
|
|
798
809
|
return /* @__PURE__ */ e(
|
|
799
810
|
se,
|
|
800
811
|
{
|
|
801
|
-
icon: /* @__PURE__ */ e(
|
|
812
|
+
icon: /* @__PURE__ */ e(Le, { className: "h-4 w-4" }),
|
|
802
813
|
title: "Security",
|
|
803
|
-
hint:
|
|
814
|
+
hint: u ? "Two-factor sign-in and API access" : "API access",
|
|
804
815
|
children: /* @__PURE__ */ t("div", { className: "space-y-4", children: [
|
|
805
|
-
|
|
816
|
+
u && /* @__PURE__ */ t("div", { children: [
|
|
806
817
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
807
818
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Two-factor authentication" }),
|
|
808
819
|
/* @__PURE__ */ e(
|
|
809
820
|
"span",
|
|
810
821
|
{
|
|
811
|
-
className:
|
|
822
|
+
className: z(
|
|
812
823
|
"rounded-full px-1.5 py-px text-[10px] font-semibold",
|
|
813
824
|
m != null && m.enabled ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400"
|
|
814
825
|
),
|
|
@@ -816,7 +827,7 @@ function bt() {
|
|
|
816
827
|
}
|
|
817
828
|
)
|
|
818
829
|
] }),
|
|
819
|
-
!(m != null && m.enabled) && !
|
|
830
|
+
!(m != null && m.enabled) && !o && /* @__PURE__ */ e(
|
|
820
831
|
"button",
|
|
821
832
|
{
|
|
822
833
|
type: "button",
|
|
@@ -825,11 +836,11 @@ function bt() {
|
|
|
825
836
|
children: C.isPending ? "Preparing…" : "Set up 2FA"
|
|
826
837
|
}
|
|
827
838
|
),
|
|
828
|
-
|
|
839
|
+
o && /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
|
|
829
840
|
/* @__PURE__ */ e(
|
|
830
841
|
"img",
|
|
831
842
|
{
|
|
832
|
-
src:
|
|
843
|
+
src: o.qr,
|
|
833
844
|
alt: "Scan with your authenticator app",
|
|
834
845
|
className: "h-32 w-32 rounded-md border border-slate-200 dark:border-border"
|
|
835
846
|
}
|
|
@@ -841,7 +852,7 @@ function bt() {
|
|
|
841
852
|
"input",
|
|
842
853
|
{
|
|
843
854
|
value: c,
|
|
844
|
-
onChange: (f) =>
|
|
855
|
+
onChange: (f) => i(f.target.value),
|
|
845
856
|
placeholder: "123456",
|
|
846
857
|
inputMode: "numeric",
|
|
847
858
|
className: "h-8 w-[110px] rounded-md border border-slate-200 px-2.5 text-center text-[13px] tabular-nums tracking-widest dark:border-border dark:bg-background"
|
|
@@ -851,8 +862,8 @@ function bt() {
|
|
|
851
862
|
"button",
|
|
852
863
|
{
|
|
853
864
|
type: "button",
|
|
854
|
-
disabled: c.trim().length < 6 ||
|
|
855
|
-
onClick: () =>
|
|
865
|
+
disabled: c.trim().length < 6 || D.isPending,
|
|
866
|
+
onClick: () => D.mutate(c.trim()),
|
|
856
867
|
className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
857
868
|
children: "Confirm"
|
|
858
869
|
}
|
|
@@ -865,7 +876,7 @@ function bt() {
|
|
|
865
876
|
"input",
|
|
866
877
|
{
|
|
867
878
|
value: c,
|
|
868
|
-
onChange: (f) =>
|
|
879
|
+
onChange: (f) => i(f.target.value),
|
|
869
880
|
placeholder: "Code to disable",
|
|
870
881
|
inputMode: "numeric",
|
|
871
882
|
className: "h-8 w-[130px] rounded-md border border-slate-200 px-2.5 text-[12px] dark:border-border dark:bg-background"
|
|
@@ -886,7 +897,7 @@ function bt() {
|
|
|
886
897
|
/* @__PURE__ */ t(
|
|
887
898
|
"div",
|
|
888
899
|
{
|
|
889
|
-
className:
|
|
900
|
+
className: u ? "border-t border-slate-100 pt-3 dark:border-border/60" : void 0,
|
|
890
901
|
children: [
|
|
891
902
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "API token" }),
|
|
892
903
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "Personal Bearer token for scripts and integrations. Shown once — creating a new one replaces the old." }),
|
|
@@ -896,16 +907,16 @@ function bt() {
|
|
|
896
907
|
"button",
|
|
897
908
|
{
|
|
898
909
|
type: "button",
|
|
899
|
-
onClick: () =>
|
|
910
|
+
onClick: () => S.mutate(),
|
|
900
911
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:text-slate-300 dark:hover:text-nvr-cyan",
|
|
901
|
-
children:
|
|
912
|
+
children: S.isPending ? "Generating…" : "Generate token"
|
|
902
913
|
}
|
|
903
914
|
),
|
|
904
915
|
/* @__PURE__ */ e(
|
|
905
|
-
|
|
916
|
+
he,
|
|
906
917
|
{
|
|
907
918
|
title: "Revoke API token",
|
|
908
|
-
onConfirm: () =>
|
|
919
|
+
onConfirm: () => k.mutate(),
|
|
909
920
|
confirmLabel: "Revoke token?",
|
|
910
921
|
className: "h-8 rounded-md px-3 text-[12px] font-medium text-slate-400 transition-colors hover:text-red-500",
|
|
911
922
|
armedClassName: "font-semibold text-red-500",
|
|
@@ -920,16 +931,16 @@ function bt() {
|
|
|
920
931
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Sessions" }),
|
|
921
932
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "Signs you out on every device and browser, including this one." }),
|
|
922
933
|
/* @__PURE__ */ t(
|
|
923
|
-
|
|
934
|
+
he,
|
|
924
935
|
{
|
|
925
936
|
title: "Sign out everywhere",
|
|
926
|
-
onConfirm: () =>
|
|
937
|
+
onConfirm: () => L.mutate(),
|
|
927
938
|
confirmLabel: "Sign out everywhere?",
|
|
928
939
|
className: "mt-2 inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 transition-colors hover:border-red-300 hover:text-red-500 dark:border-border dark:text-slate-300 dark:hover:border-red-500/40 dark:hover:text-red-400",
|
|
929
940
|
armedClassName: "border-red-300 font-semibold text-red-500 dark:border-red-500/40 dark:text-red-400",
|
|
930
941
|
children: [
|
|
931
|
-
/* @__PURE__ */ e(
|
|
932
|
-
|
|
942
|
+
/* @__PURE__ */ e(Fe, { className: "h-3.5 w-3.5" }),
|
|
943
|
+
L.isPending ? "Signing out…" : "Sign out everywhere"
|
|
933
944
|
]
|
|
934
945
|
}
|
|
935
946
|
)
|
|
@@ -938,31 +949,31 @@ function bt() {
|
|
|
938
949
|
}
|
|
939
950
|
);
|
|
940
951
|
}
|
|
941
|
-
function
|
|
942
|
-
userId:
|
|
943
|
-
className:
|
|
944
|
-
initialTab:
|
|
945
|
-
extra:
|
|
946
|
-
pushServiceWorker:
|
|
952
|
+
function da({
|
|
953
|
+
userId: s,
|
|
954
|
+
className: u,
|
|
955
|
+
initialTab: r,
|
|
956
|
+
extra: n,
|
|
957
|
+
pushServiceWorker: o = "/sw.js"
|
|
947
958
|
}) {
|
|
948
|
-
const
|
|
949
|
-
return !
|
|
959
|
+
const d = ne();
|
|
960
|
+
return !s || (d == null ? void 0 : d.userId) != null && String(d.userId) === String(s) ? /* @__PURE__ */ e(vt, { className: u, extra: n, pushServiceWorker: o }) : /* @__PURE__ */ e(it, { userId: s, className: u, initialTab: r });
|
|
950
961
|
}
|
|
951
|
-
function
|
|
952
|
-
className:
|
|
953
|
-
extra:
|
|
954
|
-
pushServiceWorker:
|
|
962
|
+
function vt({
|
|
963
|
+
className: s,
|
|
964
|
+
extra: u,
|
|
965
|
+
pushServiceWorker: r
|
|
955
966
|
}) {
|
|
956
967
|
var j;
|
|
957
|
-
const
|
|
958
|
-
queryKey: ["nvr-profile-user",
|
|
959
|
-
queryFn: () =>
|
|
968
|
+
const n = F(), o = M(), d = ne(), c = !0, i = "me", { data: a } = v({
|
|
969
|
+
queryKey: ["nvr-profile-user", i],
|
|
970
|
+
queryFn: () => n.request(fe(i)).then((g) => g.data),
|
|
960
971
|
enabled: c
|
|
961
|
-
}), h = (a == null ? void 0 : a.id) ?? null, { data: m } =
|
|
972
|
+
}), h = (a == null ? void 0 : a.id) ?? null, { data: m } = v({
|
|
962
973
|
queryKey: ["nvr-profile-card", h],
|
|
963
|
-
queryFn: () =>
|
|
974
|
+
queryFn: () => n.request(ye(h)).then((g) => g.data),
|
|
964
975
|
enabled: !!h
|
|
965
|
-
}), [P, C] = q(null),
|
|
976
|
+
}), [P, C] = q(null), D = Me(
|
|
966
977
|
() => ({
|
|
967
978
|
first_name: (a == null ? void 0 : a.first_name) ?? "",
|
|
968
979
|
last_name: (a == null ? void 0 : a.last_name) ?? "",
|
|
@@ -971,35 +982,35 @@ function xt({
|
|
|
971
982
|
phone: (a == null ? void 0 : a.phone) ?? ""
|
|
972
983
|
}),
|
|
973
984
|
[a]
|
|
974
|
-
), y = P ??
|
|
975
|
-
mutationFn: () =>
|
|
985
|
+
), y = P ?? D, S = JSON.stringify(y) !== JSON.stringify(D), k = _({
|
|
986
|
+
mutationFn: () => n.request(de(a.id, y)),
|
|
976
987
|
onSuccess: () => {
|
|
977
|
-
C(null),
|
|
988
|
+
C(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
|
|
978
989
|
}
|
|
979
|
-
}), [
|
|
990
|
+
}), [L, f] = q(kt), I = be(null), $ = _({
|
|
980
991
|
mutationFn: async (g) => {
|
|
981
|
-
const
|
|
982
|
-
const
|
|
983
|
-
|
|
992
|
+
const U = await new Promise((Q, B) => {
|
|
993
|
+
const p = new Image(), N = URL.createObjectURL(g);
|
|
994
|
+
p.onload = () => {
|
|
984
995
|
URL.revokeObjectURL(N);
|
|
985
996
|
const A = 96, R = document.createElement("canvas");
|
|
986
997
|
R.width = A, R.height = A;
|
|
987
|
-
const
|
|
988
|
-
if (!
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
},
|
|
998
|
+
const O = R.getContext("2d");
|
|
999
|
+
if (!O) return B(new Error("canvas unavailable"));
|
|
1000
|
+
const J = Math.max(A / p.width, A / p.height), Z = p.width * J, V = p.height * J;
|
|
1001
|
+
O.drawImage(p, (A - Z) / 2, (A - V) / 2, Z, V), Q(R.toDataURL("image/jpeg", 0.85));
|
|
1002
|
+
}, p.onerror = () => {
|
|
992
1003
|
URL.revokeObjectURL(N), B(new Error("not an image"));
|
|
993
|
-
},
|
|
1004
|
+
}, p.src = N;
|
|
994
1005
|
});
|
|
995
|
-
await
|
|
1006
|
+
await n.request(de(a.id, { avatar: U }));
|
|
996
1007
|
},
|
|
997
1008
|
onSuccess: () => {
|
|
998
|
-
|
|
1009
|
+
o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] }), o.invalidateQueries({ queryKey: ["user-card"] }), o.invalidateQueries({ queryKey: ["user-avatar"] });
|
|
999
1010
|
}
|
|
1000
1011
|
}), x = m ?? (a ? { ...a, role_name: null } : null);
|
|
1001
1012
|
if (!x)
|
|
1002
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1013
|
+
return /* @__PURE__ */ t("div", { className: z("flex animate-pulse flex-col gap-4", s), "aria-busy": "true", children: [
|
|
1003
1014
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-5 rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
|
|
1004
1015
|
/* @__PURE__ */ e("div", { className: "h-[76px] w-[76px] rounded-full bg-slate-100 dark:bg-muted" }),
|
|
1005
1016
|
/* @__PURE__ */ t("div", { className: "flex-1 space-y-2.5", children: [
|
|
@@ -1013,22 +1024,22 @@ function xt({
|
|
|
1013
1024
|
/* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" })
|
|
1014
1025
|
] })
|
|
1015
1026
|
] });
|
|
1016
|
-
const
|
|
1017
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1027
|
+
const K = (a == null ? void 0 : a.avatar) ?? null, H = x.status === "active";
|
|
1028
|
+
return /* @__PURE__ */ t("div", { className: z("flex flex-col gap-4", s), "data-nvr-profile": !0, children: [
|
|
1018
1029
|
/* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-4 p-5", children: [
|
|
1019
1030
|
/* @__PURE__ */ t("div", { className: "relative", children: [
|
|
1020
|
-
|
|
1031
|
+
K ? /* @__PURE__ */ e(
|
|
1021
1032
|
"img",
|
|
1022
1033
|
{
|
|
1023
|
-
src:
|
|
1034
|
+
src: K.startsWith("data:") ? K : `/api/files/${K}`,
|
|
1024
1035
|
alt: "",
|
|
1025
1036
|
className: "h-[76px] w-[76px] rounded-full border border-slate-200 object-cover dark:border-border"
|
|
1026
1037
|
}
|
|
1027
|
-
) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children:
|
|
1038
|
+
) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: ut(x) }),
|
|
1028
1039
|
/* @__PURE__ */ e(
|
|
1029
1040
|
"span",
|
|
1030
1041
|
{
|
|
1031
|
-
className:
|
|
1042
|
+
className: z(
|
|
1032
1043
|
"absolute bottom-0.5 right-0.5 h-3 w-3 rounded-full border-2 border-white dark:border-card",
|
|
1033
1044
|
H ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1034
1045
|
),
|
|
@@ -1047,7 +1058,7 @@ function xt({
|
|
|
1047
1058
|
return (g = I.current) == null ? void 0 : g.click();
|
|
1048
1059
|
},
|
|
1049
1060
|
className: "absolute -right-1 -top-1 flex h-7 w-7 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 shadow-sm transition-colors hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:bg-background dark:text-slate-300 dark:hover:text-nvr-cyan",
|
|
1050
|
-
children:
|
|
1061
|
+
children: $.isPending ? /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
|
|
1051
1062
|
}
|
|
1052
1063
|
),
|
|
1053
1064
|
/* @__PURE__ */ e(
|
|
@@ -1059,8 +1070,8 @@ function xt({
|
|
|
1059
1070
|
className: "hidden",
|
|
1060
1071
|
onChange: (g) => {
|
|
1061
1072
|
var Q;
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1073
|
+
const U = (Q = g.target.files) == null ? void 0 : Q[0];
|
|
1074
|
+
U && $.mutate(U), g.target.value = "";
|
|
1064
1075
|
}
|
|
1065
1076
|
}
|
|
1066
1077
|
)
|
|
@@ -1068,17 +1079,17 @@ function xt({
|
|
|
1068
1079
|
] }),
|
|
1069
1080
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
|
|
1070
1081
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1071
|
-
/* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children:
|
|
1082
|
+
/* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: ct(x) }),
|
|
1072
1083
|
x.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: x.role_name }),
|
|
1073
1084
|
x.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
|
|
1074
|
-
/* @__PURE__ */ e(
|
|
1085
|
+
/* @__PURE__ */ e(tt, { email: x.email, canClear: d.isAdmin })
|
|
1075
1086
|
] }),
|
|
1076
1087
|
a && // The same status the chat panel's Online tab sets — one editor,
|
|
1077
1088
|
// one preference, so the profile always agrees with the top bar.
|
|
1078
1089
|
/* @__PURE__ */ e(
|
|
1079
|
-
|
|
1090
|
+
ze,
|
|
1080
1091
|
{
|
|
1081
|
-
status:
|
|
1092
|
+
status: Be(
|
|
1082
1093
|
(j = a.preferences) == null ? void 0 : j.custom_status
|
|
1083
1094
|
),
|
|
1084
1095
|
showExpiry: !0,
|
|
@@ -1088,7 +1099,7 @@ function xt({
|
|
|
1088
1099
|
(x.title || x.department) && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-[13px] text-slate-500 dark:text-slate-400", children: [x.title, x.department].filter(Boolean).join(" · ") }),
|
|
1089
1100
|
/* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
|
|
1090
1101
|
x.company && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1091
|
-
/* @__PURE__ */ e(
|
|
1102
|
+
/* @__PURE__ */ e(we, { className: "h-3.5 w-3.5" }),
|
|
1092
1103
|
" ",
|
|
1093
1104
|
x.company
|
|
1094
1105
|
] }),
|
|
@@ -1098,7 +1109,7 @@ function xt({
|
|
|
1098
1109
|
href: `mailto:${x.email}`,
|
|
1099
1110
|
className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
|
|
1100
1111
|
children: [
|
|
1101
|
-
/* @__PURE__ */ e(
|
|
1112
|
+
/* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
|
|
1102
1113
|
" ",
|
|
1103
1114
|
x.email
|
|
1104
1115
|
]
|
|
@@ -1110,14 +1121,14 @@ function xt({
|
|
|
1110
1121
|
href: `tel:${x.phone}`,
|
|
1111
1122
|
className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
|
|
1112
1123
|
children: [
|
|
1113
|
-
/* @__PURE__ */ e(
|
|
1124
|
+
/* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5" }),
|
|
1114
1125
|
" ",
|
|
1115
1126
|
x.phone
|
|
1116
1127
|
]
|
|
1117
1128
|
}
|
|
1118
1129
|
),
|
|
1119
1130
|
x.last_access && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
|
|
1120
|
-
/* @__PURE__ */ e(
|
|
1131
|
+
/* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5" }),
|
|
1121
1132
|
new Date(x.last_access).toLocaleDateString(void 0, {
|
|
1122
1133
|
month: "short",
|
|
1123
1134
|
day: "numeric"
|
|
@@ -1126,10 +1137,10 @@ function xt({
|
|
|
1126
1137
|
] })
|
|
1127
1138
|
] })
|
|
1128
1139
|
] }) }),
|
|
1129
|
-
/* @__PURE__ */ e(
|
|
1130
|
-
|
|
1140
|
+
/* @__PURE__ */ e(Nt, { tab: L, onChange: f }),
|
|
1141
|
+
L === "agents" ? /* @__PURE__ */ e(Ge, {}) : L === "did" && a ? (
|
|
1131
1142
|
// #13 — your own audit trail, by day and collection.
|
|
1132
|
-
/* @__PURE__ */ e(
|
|
1143
|
+
/* @__PURE__ */ e(at, { userId: String(a.id), name: null })
|
|
1133
1144
|
) : a ? (
|
|
1134
1145
|
// One list in reading order — you, then notifications, then access
|
|
1135
1146
|
// and security — flowing into two balanced columns. Two fixed stacks
|
|
@@ -1144,10 +1155,10 @@ function xt({
|
|
|
1144
1155
|
/* @__PURE__ */ e(
|
|
1145
1156
|
se,
|
|
1146
1157
|
{
|
|
1147
|
-
icon: /* @__PURE__ */ e(
|
|
1158
|
+
icon: /* @__PURE__ */ e(Ae, { className: "h-4 w-4" }),
|
|
1148
1159
|
title: "About you",
|
|
1149
1160
|
hint: "Shown on your contact card across the app",
|
|
1150
|
-
actions:
|
|
1161
|
+
actions: S && /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
|
|
1151
1162
|
/* @__PURE__ */ t(
|
|
1152
1163
|
"button",
|
|
1153
1164
|
{
|
|
@@ -1156,7 +1167,7 @@ function xt({
|
|
|
1156
1167
|
onClick: () => C(null),
|
|
1157
1168
|
className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] font-medium text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-200",
|
|
1158
1169
|
children: [
|
|
1159
|
-
/* @__PURE__ */ e(
|
|
1170
|
+
/* @__PURE__ */ e(qe, { className: "h-3 w-3" }),
|
|
1160
1171
|
" Reset"
|
|
1161
1172
|
]
|
|
1162
1173
|
}
|
|
@@ -1165,11 +1176,11 @@ function xt({
|
|
|
1165
1176
|
"button",
|
|
1166
1177
|
{
|
|
1167
1178
|
type: "button",
|
|
1168
|
-
disabled:
|
|
1169
|
-
onClick: () =>
|
|
1179
|
+
disabled: k.isPending,
|
|
1180
|
+
onClick: () => k.mutate(),
|
|
1170
1181
|
className: "inline-flex h-7 items-center gap-1 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-semibold text-white transition-opacity disabled:opacity-50",
|
|
1171
1182
|
children: [
|
|
1172
|
-
|
|
1183
|
+
k.isPending ? /* @__PURE__ */ e(ce, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-3 w-3" }),
|
|
1173
1184
|
" ",
|
|
1174
1185
|
"Save"
|
|
1175
1186
|
]
|
|
@@ -1225,57 +1236,57 @@ function xt({
|
|
|
1225
1236
|
}
|
|
1226
1237
|
),
|
|
1227
1238
|
/* @__PURE__ */ e(
|
|
1228
|
-
|
|
1239
|
+
et,
|
|
1229
1240
|
{
|
|
1230
1241
|
user: a,
|
|
1231
1242
|
onSaved: () => {
|
|
1232
|
-
|
|
1243
|
+
o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
|
|
1233
1244
|
}
|
|
1234
1245
|
}
|
|
1235
1246
|
),
|
|
1236
|
-
/* @__PURE__ */ e(
|
|
1237
|
-
/* @__PURE__ */ e(
|
|
1247
|
+
/* @__PURE__ */ e(pt, {}),
|
|
1248
|
+
/* @__PURE__ */ e(xt, {}),
|
|
1249
|
+
/* @__PURE__ */ e(At, {}),
|
|
1250
|
+
/* @__PURE__ */ e(lt, {}),
|
|
1251
|
+
/* @__PURE__ */ e(bt, {}),
|
|
1252
|
+
/* @__PURE__ */ e(Je, {}),
|
|
1253
|
+
/* @__PURE__ */ e(Ze, {}),
|
|
1254
|
+
d.isAdmin && (a != null && a.id) ? /* @__PURE__ */ e(ot, { userId: String(a.id) }) : /* @__PURE__ */ e(gt, {}),
|
|
1255
|
+
/* @__PURE__ */ e(_t, {}),
|
|
1256
|
+
/* @__PURE__ */ e(rt, { userId: "me" }),
|
|
1238
1257
|
/* @__PURE__ */ e(St, {}),
|
|
1239
|
-
/* @__PURE__ */ e(
|
|
1240
|
-
/* @__PURE__ */ e(mt, {}),
|
|
1241
|
-
/* @__PURE__ */ e(He, {}),
|
|
1242
|
-
/* @__PURE__ */ e(Ye, {}),
|
|
1243
|
-
i.isAdmin && (a != null && a.id) ? /* @__PURE__ */ e(at, { userId: String(a.id) }) : /* @__PURE__ */ e(pt, {}),
|
|
1244
|
-
/* @__PURE__ */ e(vt, {}),
|
|
1245
|
-
/* @__PURE__ */ e(Ze, { userId: "me" }),
|
|
1246
|
-
/* @__PURE__ */ e(kt, {}),
|
|
1247
|
-
/* @__PURE__ */ e(ct, {}),
|
|
1248
|
-
/* @__PURE__ */ e(et, {}),
|
|
1249
|
-
n !== !1 && /* @__PURE__ */ e(We, { serviceWorkerPath: n }),
|
|
1250
|
-
/* @__PURE__ */ e(Nt, {}),
|
|
1258
|
+
/* @__PURE__ */ e(ht, {}),
|
|
1251
1259
|
/* @__PURE__ */ e(st, {}),
|
|
1252
|
-
/* @__PURE__ */ e(
|
|
1253
|
-
/* @__PURE__ */ e(
|
|
1260
|
+
r !== !1 && /* @__PURE__ */ e(Xe, { serviceWorkerPath: r }),
|
|
1261
|
+
/* @__PURE__ */ e(Ct, {}),
|
|
1262
|
+
/* @__PURE__ */ e(dt, {}),
|
|
1254
1263
|
/* @__PURE__ */ e(yt, {}),
|
|
1255
|
-
|
|
1264
|
+
/* @__PURE__ */ e(qt, {}),
|
|
1265
|
+
/* @__PURE__ */ e(wt, {}),
|
|
1266
|
+
u
|
|
1256
1267
|
]
|
|
1257
1268
|
}
|
|
1258
1269
|
)
|
|
1259
1270
|
) : null
|
|
1260
1271
|
] });
|
|
1261
1272
|
}
|
|
1262
|
-
function
|
|
1273
|
+
function kt() {
|
|
1263
1274
|
try {
|
|
1264
|
-
const
|
|
1265
|
-
return
|
|
1275
|
+
const s = new URLSearchParams(window.location.search).get("tab");
|
|
1276
|
+
return s === "agents" || s === "did" ? s : "profile";
|
|
1266
1277
|
} catch {
|
|
1267
1278
|
return "profile";
|
|
1268
1279
|
}
|
|
1269
1280
|
}
|
|
1270
|
-
function
|
|
1271
|
-
tab:
|
|
1272
|
-
onChange:
|
|
1281
|
+
function Nt({
|
|
1282
|
+
tab: s,
|
|
1283
|
+
onChange: u
|
|
1273
1284
|
}) {
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1285
|
+
const r = (o) => {
|
|
1286
|
+
u(o);
|
|
1276
1287
|
try {
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1288
|
+
const d = new URL(window.location.href);
|
|
1289
|
+
o !== "profile" ? d.searchParams.set("tab", o) : d.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", d);
|
|
1279
1290
|
} catch {
|
|
1280
1291
|
}
|
|
1281
1292
|
};
|
|
@@ -1289,55 +1300,55 @@ function ft({
|
|
|
1289
1300
|
["profile", "Profile"],
|
|
1290
1301
|
["agents", "What my agents did"],
|
|
1291
1302
|
["did", "What I did"]
|
|
1292
|
-
].map(([
|
|
1303
|
+
].map(([o, d]) => /* @__PURE__ */ e(
|
|
1293
1304
|
"button",
|
|
1294
1305
|
{
|
|
1295
1306
|
type: "button",
|
|
1296
1307
|
role: "tab",
|
|
1297
|
-
"aria-selected":
|
|
1298
|
-
onClick: () =>
|
|
1299
|
-
className:
|
|
1308
|
+
"aria-selected": s === o,
|
|
1309
|
+
onClick: () => r(o),
|
|
1310
|
+
className: z(
|
|
1300
1311
|
"-mb-px border-b-2 px-3 py-2 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40",
|
|
1301
|
-
|
|
1312
|
+
s === o ? "border-nvr-cyan text-slate-900 dark:text-white" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
|
|
1302
1313
|
),
|
|
1303
|
-
children:
|
|
1314
|
+
children: d
|
|
1304
1315
|
},
|
|
1305
|
-
|
|
1316
|
+
o
|
|
1306
1317
|
))
|
|
1307
1318
|
}
|
|
1308
1319
|
);
|
|
1309
1320
|
}
|
|
1310
|
-
function
|
|
1311
|
-
const
|
|
1321
|
+
function wt() {
|
|
1322
|
+
const s = F(), [u, r] = q(!1), { data: n = [], isLoading: o } = v({
|
|
1312
1323
|
queryKey: ["my-matrix-seats"],
|
|
1313
|
-
queryFn: () =>
|
|
1314
|
-
enabled:
|
|
1324
|
+
queryFn: () => s.request(T("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
|
|
1325
|
+
enabled: u,
|
|
1315
1326
|
staleTime: 6e4
|
|
1316
|
-
}),
|
|
1317
|
-
for (const c of
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1327
|
+
}), d = /* @__PURE__ */ new Map();
|
|
1328
|
+
for (const c of n) {
|
|
1329
|
+
const i = d.get(c.template_name) ?? [];
|
|
1330
|
+
i.push(c), d.set(c.template_name, i);
|
|
1320
1331
|
}
|
|
1321
1332
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
1322
1333
|
/* @__PURE__ */ t(
|
|
1323
1334
|
"button",
|
|
1324
1335
|
{
|
|
1325
1336
|
type: "button",
|
|
1326
|
-
onClick: () =>
|
|
1337
|
+
onClick: () => r((c) => !c),
|
|
1327
1338
|
className: "flex w-full items-center justify-between text-left",
|
|
1328
1339
|
children: [
|
|
1329
1340
|
/* @__PURE__ */ t("div", { children: [
|
|
1330
1341
|
/* @__PURE__ */ e("h3", { className: "text-[14px] font-semibold", children: "My approval seats" }),
|
|
1331
1342
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "Every owner-matrix cell you sit in — why records land in your queue." })
|
|
1332
1343
|
] }),
|
|
1333
|
-
/* @__PURE__ */ e("span", { className: "text-slate-400", children:
|
|
1344
|
+
/* @__PURE__ */ e("span", { className: "text-slate-400", children: u ? "▾" : "▸" })
|
|
1334
1345
|
]
|
|
1335
1346
|
}
|
|
1336
1347
|
),
|
|
1337
|
-
|
|
1348
|
+
u && (o ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : n.length === 0 ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "You're not in any owner groups — approvals never route to you automatically." }) : /* @__PURE__ */ e("div", { className: "mt-3 space-y-3", children: [...d.entries()].map(([c, i]) => /* @__PURE__ */ t("div", { children: [
|
|
1338
1349
|
/* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: c }),
|
|
1339
1350
|
/* @__PURE__ */ t("ul", { className: "mt-1 space-y-1.5", children: [
|
|
1340
|
-
|
|
1351
|
+
i.slice(0, 40).map((a) => /* @__PURE__ */ t("li", { className: "text-[12.5px]", children: [
|
|
1341
1352
|
/* @__PURE__ */ e("span", { className: "font-medium", children: a.state_label || a.state_key }),
|
|
1342
1353
|
a.group_name && /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
|
|
1343
1354
|
" ",
|
|
@@ -1362,28 +1373,28 @@ function yt() {
|
|
|
1362
1373
|
}
|
|
1363
1374
|
)
|
|
1364
1375
|
] }, a.group_id)),
|
|
1365
|
-
|
|
1376
|
+
i.length > 40 && /* @__PURE__ */ t("li", { className: "text-[11.5px] text-slate-400", children: [
|
|
1366
1377
|
"…and ",
|
|
1367
|
-
|
|
1378
|
+
i.length - 40,
|
|
1368
1379
|
" more"
|
|
1369
1380
|
] })
|
|
1370
1381
|
] })
|
|
1371
1382
|
] }, c)) }))
|
|
1372
1383
|
] });
|
|
1373
1384
|
}
|
|
1374
|
-
function
|
|
1375
|
-
const
|
|
1385
|
+
function _t() {
|
|
1386
|
+
const s = F(), u = M(), { data: r = [] } = v({
|
|
1376
1387
|
queryKey: ["my-reminders"],
|
|
1377
|
-
queryFn: () =>
|
|
1388
|
+
queryFn: () => s.request(T("/reminders")).then((m) => m.data).catch(() => []),
|
|
1378
1389
|
staleTime: 3e4
|
|
1379
|
-
}), [
|
|
1380
|
-
mutationFn: () =>
|
|
1390
|
+
}), [n, o] = q(""), [d, c] = q(""), i = () => void u.invalidateQueries({ queryKey: ["my-reminders"] }), a = _({
|
|
1391
|
+
mutationFn: () => s.request(ee("/reminders", { note: n, remind_at: new Date(d).toISOString() })),
|
|
1381
1392
|
onSuccess: () => {
|
|
1382
|
-
|
|
1393
|
+
o(""), c(""), i();
|
|
1383
1394
|
}
|
|
1384
|
-
}), h =
|
|
1385
|
-
mutationFn: (m) =>
|
|
1386
|
-
onSuccess:
|
|
1395
|
+
}), h = _({
|
|
1396
|
+
mutationFn: (m) => s.request(Ke(`/reminders/${m}`)),
|
|
1397
|
+
onSuccess: i
|
|
1387
1398
|
});
|
|
1388
1399
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1389
1400
|
/* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
@@ -1391,8 +1402,8 @@ function vt() {
|
|
|
1391
1402
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: `Personal nudges delivered as notifications at the time you pick. The chat bot's "remind me…" requests land here too.` })
|
|
1392
1403
|
] }),
|
|
1393
1404
|
/* @__PURE__ */ t("div", { className: "space-y-2 px-4 py-3", children: [
|
|
1394
|
-
|
|
1395
|
-
|
|
1405
|
+
r.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No upcoming reminders." }),
|
|
1406
|
+
r.map((m) => /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
1396
1407
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
|
|
1397
1408
|
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: m.note }),
|
|
1398
1409
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(m.remind_at).toLocaleString() })
|
|
@@ -1412,14 +1423,14 @@ function vt() {
|
|
|
1412
1423
|
{
|
|
1413
1424
|
className: "flex flex-wrap items-center gap-2 pt-1",
|
|
1414
1425
|
onSubmit: (m) => {
|
|
1415
|
-
m.preventDefault(),
|
|
1426
|
+
m.preventDefault(), n.trim() && d && a.mutate();
|
|
1416
1427
|
},
|
|
1417
1428
|
children: [
|
|
1418
1429
|
/* @__PURE__ */ e(
|
|
1419
1430
|
"input",
|
|
1420
1431
|
{
|
|
1421
|
-
value:
|
|
1422
|
-
onChange: (m) =>
|
|
1432
|
+
value: n,
|
|
1433
|
+
onChange: (m) => o(m.target.value),
|
|
1423
1434
|
placeholder: "Remind me to…",
|
|
1424
1435
|
className: "h-7 min-w-[160px] flex-1 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
|
|
1425
1436
|
}
|
|
@@ -1428,7 +1439,7 @@ function vt() {
|
|
|
1428
1439
|
"input",
|
|
1429
1440
|
{
|
|
1430
1441
|
type: "datetime-local",
|
|
1431
|
-
value:
|
|
1442
|
+
value: d,
|
|
1432
1443
|
onChange: (m) => c(m.target.value),
|
|
1433
1444
|
className: "h-7 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
|
|
1434
1445
|
}
|
|
@@ -1437,7 +1448,7 @@ function vt() {
|
|
|
1437
1448
|
"button",
|
|
1438
1449
|
{
|
|
1439
1450
|
type: "submit",
|
|
1440
|
-
disabled: !
|
|
1451
|
+
disabled: !n.trim() || !d || a.isPending,
|
|
1441
1452
|
className: "h-7 rounded bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white hover:bg-nvr-cyan-dark disabled:opacity-50",
|
|
1442
1453
|
children: a.isPending ? "Adding…" : "Add"
|
|
1443
1454
|
}
|
|
@@ -1448,36 +1459,36 @@ function vt() {
|
|
|
1448
1459
|
] })
|
|
1449
1460
|
] });
|
|
1450
1461
|
}
|
|
1451
|
-
function
|
|
1452
|
-
const
|
|
1462
|
+
function St() {
|
|
1463
|
+
const s = F(), { data: u } = v({
|
|
1453
1464
|
queryKey: ["my-stats"],
|
|
1454
|
-
queryFn: () =>
|
|
1465
|
+
queryFn: () => s.request(T("/users/me/stats")).then((n) => n.data).catch(() => null),
|
|
1455
1466
|
staleTime: 5 * 6e4
|
|
1456
1467
|
});
|
|
1457
|
-
if (!
|
|
1458
|
-
const
|
|
1468
|
+
if (!u) return null;
|
|
1469
|
+
const r = Math.max(1, ...u.weeks.map((n) => n.transitions + n.tasks_done + n.created));
|
|
1459
1470
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1460
1471
|
/* @__PURE__ */ t("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
1461
1472
|
/* @__PURE__ */ t("div", { children: [
|
|
1462
1473
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "My activity" }),
|
|
1463
1474
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Last 8 weeks — just yours." })
|
|
1464
1475
|
] }),
|
|
1465
|
-
|
|
1466
|
-
|
|
1476
|
+
u.streak_days > 1 && /* @__PURE__ */ t("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan", children: [
|
|
1477
|
+
u.streak_days,
|
|
1467
1478
|
"-day streak"
|
|
1468
1479
|
] })
|
|
1469
1480
|
] }),
|
|
1470
1481
|
/* @__PURE__ */ t("div", { className: "px-4 py-3", children: [
|
|
1471
|
-
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children:
|
|
1472
|
-
const
|
|
1482
|
+
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: u.weeks.map((n, o) => {
|
|
1483
|
+
const d = n.transitions + n.tasks_done + n.created;
|
|
1473
1484
|
return /* @__PURE__ */ e(
|
|
1474
1485
|
"div",
|
|
1475
1486
|
{
|
|
1476
1487
|
className: "flex-1 rounded-t bg-nvr-cyan/60 transition-all dark:bg-nvr-cyan/40",
|
|
1477
|
-
style: { height: `${Math.max(4,
|
|
1478
|
-
"data-tip": `${
|
|
1488
|
+
style: { height: `${Math.max(4, d / r * 100)}%` },
|
|
1489
|
+
"data-tip": `${d} action${d === 1 ? "" : "s"}: ${n.transitions} transitions, ${n.tasks_done} tasks done, ${n.created} created`
|
|
1479
1490
|
},
|
|
1480
|
-
|
|
1491
|
+
o
|
|
1481
1492
|
);
|
|
1482
1493
|
}) }),
|
|
1483
1494
|
/* @__PURE__ */ t("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
|
|
@@ -1486,17 +1497,17 @@ function kt() {
|
|
|
1486
1497
|
] }),
|
|
1487
1498
|
/* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
1488
1499
|
/* @__PURE__ */ t("span", { children: [
|
|
1489
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1500
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.transitions }),
|
|
1490
1501
|
" ",
|
|
1491
1502
|
"transitions"
|
|
1492
1503
|
] }),
|
|
1493
1504
|
/* @__PURE__ */ t("span", { children: [
|
|
1494
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1505
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.tasks_done }),
|
|
1495
1506
|
" ",
|
|
1496
1507
|
"tasks done"
|
|
1497
1508
|
] }),
|
|
1498
1509
|
/* @__PURE__ */ t("span", { children: [
|
|
1499
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1510
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.created }),
|
|
1500
1511
|
" ",
|
|
1501
1512
|
"records created"
|
|
1502
1513
|
] })
|
|
@@ -1504,25 +1515,25 @@ function kt() {
|
|
|
1504
1515
|
] })
|
|
1505
1516
|
] });
|
|
1506
1517
|
}
|
|
1507
|
-
function
|
|
1508
|
-
const
|
|
1518
|
+
function Ct() {
|
|
1519
|
+
const s = F(), u = M(), { data: r } = v({
|
|
1509
1520
|
queryKey: ["my-security"],
|
|
1510
|
-
queryFn: () =>
|
|
1521
|
+
queryFn: () => s.request(T("/security/my/sessions")).then((d) => d.data).catch(() => ({ sessions: [], logins: [] })),
|
|
1511
1522
|
staleTime: 3e4
|
|
1512
|
-
}),
|
|
1513
|
-
mutationFn: () =>
|
|
1514
|
-
onSuccess: (
|
|
1515
|
-
|
|
1523
|
+
}), n = _({
|
|
1524
|
+
mutationFn: () => s.request(ee("/security/my/sessions/sign-out-others", {})).then((d) => d.data),
|
|
1525
|
+
onSuccess: (d) => {
|
|
1526
|
+
u.invalidateQueries({ queryKey: ["my-security"] }), o(`Signed out ${(d == null ? void 0 : d.revoked) ?? 0} other session(s)`);
|
|
1516
1527
|
},
|
|
1517
|
-
onError: (
|
|
1518
|
-
var
|
|
1519
|
-
const c = ((a = (
|
|
1528
|
+
onError: (d) => {
|
|
1529
|
+
var i, a;
|
|
1530
|
+
const c = ((a = (i = d == null ? void 0 : d.response) == null ? void 0 : i.data) == null ? void 0 : a.error) ?? "Could not sign out your other sessions — try again.";
|
|
1520
1531
|
import("sonner").then(({ toast: h }) => h.error(c)).catch(() => {
|
|
1521
1532
|
});
|
|
1522
1533
|
}
|
|
1523
|
-
}),
|
|
1534
|
+
}), o = (d) => {
|
|
1524
1535
|
try {
|
|
1525
|
-
import("sonner").then(({ toast: c }) => c.success(
|
|
1536
|
+
import("sonner").then(({ toast: c }) => c.success(d));
|
|
1526
1537
|
} catch {
|
|
1527
1538
|
}
|
|
1528
1539
|
};
|
|
@@ -1532,12 +1543,12 @@ function Nt() {
|
|
|
1532
1543
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Security" }),
|
|
1533
1544
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your active sessions and recent sign-ins." })
|
|
1534
1545
|
] }),
|
|
1535
|
-
((
|
|
1546
|
+
((r == null ? void 0 : r.sessions.length) ?? 0) > 1 && /* @__PURE__ */ e(
|
|
1536
1547
|
"button",
|
|
1537
1548
|
{
|
|
1538
1549
|
type: "button",
|
|
1539
|
-
disabled:
|
|
1540
|
-
onClick: () =>
|
|
1550
|
+
disabled: n.isPending,
|
|
1551
|
+
onClick: () => n.mutate(),
|
|
1541
1552
|
className: "rounded-md border border-red-200 px-2 py-1 text-[11.5px] text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-500/30",
|
|
1542
1553
|
children: "Sign out everywhere else"
|
|
1543
1554
|
}
|
|
@@ -1546,47 +1557,47 @@ function Nt() {
|
|
|
1546
1557
|
/* @__PURE__ */ t("div", { className: "space-y-2 p-4", children: [
|
|
1547
1558
|
/* @__PURE__ */ t("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
1548
1559
|
"Active sessions (",
|
|
1549
|
-
(
|
|
1560
|
+
(r == null ? void 0 : r.sessions.length) ?? 0,
|
|
1550
1561
|
")"
|
|
1551
1562
|
] }),
|
|
1552
|
-
((
|
|
1563
|
+
((r == null ? void 0 : r.sessions) ?? []).map((d) => /* @__PURE__ */ t(
|
|
1553
1564
|
"p",
|
|
1554
1565
|
{
|
|
1555
1566
|
className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300",
|
|
1556
1567
|
children: [
|
|
1557
1568
|
/* @__PURE__ */ t("span", { className: "font-mono text-slate-400", children: [
|
|
1558
|
-
|
|
1569
|
+
d.sid_prefix,
|
|
1559
1570
|
"…"
|
|
1560
1571
|
] }),
|
|
1561
|
-
|
|
1572
|
+
d.current && /* @__PURE__ */ e("span", { className: "rounded bg-nvr-cyan/[0.08] px-1.5 py-px text-[10px] font-medium text-[#007a99] dark:text-nvr-cyan", children: "this session" }),
|
|
1562
1573
|
/* @__PURE__ */ t("span", { className: "ml-auto text-[11px] text-slate-400", children: [
|
|
1563
1574
|
"expires in ",
|
|
1564
|
-
Math.round(
|
|
1575
|
+
Math.round(d.ttl_seconds / 3600),
|
|
1565
1576
|
"h"
|
|
1566
1577
|
] })
|
|
1567
1578
|
]
|
|
1568
1579
|
},
|
|
1569
|
-
|
|
1580
|
+
d.sid_prefix
|
|
1570
1581
|
)),
|
|
1571
|
-
((
|
|
1582
|
+
((r == null ? void 0 : r.logins) ?? []).length > 0 && /* @__PURE__ */ t(X, { children: [
|
|
1572
1583
|
/* @__PURE__ */ e("p", { className: "pt-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: "Recent sign-ins" }),
|
|
1573
|
-
((
|
|
1584
|
+
((r == null ? void 0 : r.logins) ?? []).slice(0, 8).map((d, c) => (
|
|
1574
1585
|
// biome-ignore lint/suspicious/noArrayIndexKey: log rows
|
|
1575
1586
|
/* @__PURE__ */ t("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
|
|
1576
|
-
/* @__PURE__ */ e("span", { className: "font-mono", children:
|
|
1577
|
-
|
|
1578
|
-
/* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(
|
|
1587
|
+
/* @__PURE__ */ e("span", { className: "font-mono", children: d.ip ?? "—" }),
|
|
1588
|
+
d.new_ip && /* @__PURE__ */ e("span", { className: "rounded bg-amber-100 px-1 text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: "new IP" }),
|
|
1589
|
+
/* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(d.created_at).toLocaleString() })
|
|
1579
1590
|
] }, c)
|
|
1580
1591
|
))
|
|
1581
1592
|
] })
|
|
1582
1593
|
] })
|
|
1583
1594
|
] });
|
|
1584
1595
|
}
|
|
1585
|
-
function
|
|
1586
|
-
const
|
|
1596
|
+
function qt() {
|
|
1597
|
+
const s = F(), [u, r] = q(!1), { data: n } = v({
|
|
1587
1598
|
queryKey: ["my-permissions"],
|
|
1588
|
-
queryFn: () =>
|
|
1589
|
-
enabled:
|
|
1599
|
+
queryFn: () => s.request(T("/security/my/permissions")).then((o) => o.data),
|
|
1600
|
+
enabled: u,
|
|
1590
1601
|
staleTime: 5 * 6e4
|
|
1591
1602
|
});
|
|
1592
1603
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
@@ -1594,77 +1605,110 @@ function wt() {
|
|
|
1594
1605
|
"button",
|
|
1595
1606
|
{
|
|
1596
1607
|
type: "button",
|
|
1597
|
-
onClick: () =>
|
|
1608
|
+
onClick: () => r((o) => !o),
|
|
1598
1609
|
className: "flex w-full items-center justify-between px-4 py-2.5 text-left",
|
|
1599
1610
|
children: [
|
|
1600
1611
|
/* @__PURE__ */ t("div", { children: [
|
|
1601
1612
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "What can I access?" }),
|
|
1602
1613
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your role, collections, and data limits in plain language." })
|
|
1603
1614
|
] }),
|
|
1604
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children:
|
|
1615
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: u ? "Hide" : "Show" })
|
|
1605
1616
|
]
|
|
1606
1617
|
}
|
|
1607
1618
|
),
|
|
1608
|
-
|
|
1619
|
+
u && n && /* @__PURE__ */ t("div", { className: "space-y-2 border-t border-slate-100 px-4 py-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-slate-300", children: [
|
|
1609
1620
|
/* @__PURE__ */ t("p", { children: [
|
|
1610
1621
|
"Your role is ",
|
|
1611
|
-
/* @__PURE__ */ e("b", { children:
|
|
1612
|
-
|
|
1622
|
+
/* @__PURE__ */ e("b", { children: n.role ?? "unassigned" }),
|
|
1623
|
+
n.is_admin && " — an administrator role with access to everything",
|
|
1613
1624
|
"."
|
|
1614
1625
|
] }),
|
|
1615
|
-
|
|
1626
|
+
n.scopes.length > 0 && /* @__PURE__ */ t("p", { children: [
|
|
1616
1627
|
"Your data is limited to:",
|
|
1617
1628
|
" ",
|
|
1618
|
-
|
|
1629
|
+
n.scopes.map((o) => `${o.dimension}: ${o.values.join(", ")}`).join(" · ")
|
|
1619
1630
|
] }),
|
|
1620
|
-
!
|
|
1631
|
+
!n.is_admin && /* @__PURE__ */ t("div", { children: [
|
|
1621
1632
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
1622
1633
|
"Collections (",
|
|
1623
|
-
|
|
1634
|
+
n.collections.length,
|
|
1624
1635
|
")"
|
|
1625
1636
|
] }),
|
|
1626
|
-
/* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children:
|
|
1637
|
+
/* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: n.collections.map((o) => /* @__PURE__ */ t(
|
|
1627
1638
|
"p",
|
|
1628
1639
|
{
|
|
1629
1640
|
className: "flex items-center gap-2 border-b border-slate-50 py-0.5 text-[12px] last:border-b-0 dark:border-border/40",
|
|
1630
1641
|
children: [
|
|
1631
|
-
/* @__PURE__ */ e("span", { className: "font-mono", children:
|
|
1632
|
-
/* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(
|
|
1642
|
+
/* @__PURE__ */ e("span", { className: "font-mono", children: o.collection }),
|
|
1643
|
+
/* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(o.actions)].join(" · ") })
|
|
1633
1644
|
]
|
|
1634
1645
|
},
|
|
1635
|
-
|
|
1646
|
+
o.collection
|
|
1636
1647
|
)) })
|
|
1637
1648
|
] })
|
|
1638
1649
|
] })
|
|
1639
1650
|
] });
|
|
1640
1651
|
}
|
|
1641
|
-
function
|
|
1642
|
-
|
|
1652
|
+
function Pt({
|
|
1653
|
+
value: s,
|
|
1654
|
+
onChange: u
|
|
1655
|
+
}) {
|
|
1656
|
+
const r = F(), { data: n } = v({
|
|
1657
|
+
queryKey: ["live-preference-default"],
|
|
1658
|
+
queryFn: () => r.request(T("/live-preference/default")).then((i) => {
|
|
1659
|
+
var a;
|
|
1660
|
+
return ue((a = i.data) == null ? void 0 : a.mode);
|
|
1661
|
+
}).catch(() => null),
|
|
1662
|
+
staleTime: 5 * 6e4
|
|
1663
|
+
}), o = ue(s), d = Re[n ?? "normal"], c = {
|
|
1664
|
+
normal: "Changes appear as they happen, with a short fade.",
|
|
1665
|
+
calm: "Changes appear without fades or marks; lists keep their order until you pause.",
|
|
1666
|
+
off: "Nothing updates by itself — press ↻ to see the latest."
|
|
1667
|
+
}[o ?? n ?? "normal"];
|
|
1668
|
+
return /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", "data-pref": "live-mode", "data-tip": c, children: [
|
|
1669
|
+
"Live updates",
|
|
1670
|
+
/* @__PURE__ */ e(
|
|
1671
|
+
E,
|
|
1672
|
+
{
|
|
1673
|
+
value: o ?? "auto",
|
|
1674
|
+
onChange: (i) => u(i),
|
|
1675
|
+
options: [
|
|
1676
|
+
{ value: "auto", label: `Role default (${d})` },
|
|
1677
|
+
{ value: "normal", label: "Normal" },
|
|
1678
|
+
{ value: "calm", label: "Calm" },
|
|
1679
|
+
{ value: "off", label: "Off" }
|
|
1680
|
+
]
|
|
1681
|
+
}
|
|
1682
|
+
)
|
|
1683
|
+
] });
|
|
1684
|
+
}
|
|
1685
|
+
function At() {
|
|
1686
|
+
const s = F(), u = M(), { data: r } = v({
|
|
1643
1687
|
queryKey: ["nvr-profile-prefs"],
|
|
1644
|
-
queryFn: () =>
|
|
1688
|
+
queryFn: () => s.request(T("/users/me")).then((i) => {
|
|
1645
1689
|
var a;
|
|
1646
|
-
return ((a =
|
|
1690
|
+
return ((a = i.data) == null ? void 0 : a.preferences) ?? {};
|
|
1647
1691
|
})
|
|
1648
|
-
}),
|
|
1649
|
-
mutationFn: (
|
|
1650
|
-
onSuccess: (
|
|
1651
|
-
|
|
1692
|
+
}), n = _({
|
|
1693
|
+
mutationFn: (i) => s.request(G("/users/me/preferences", i)),
|
|
1694
|
+
onSuccess: (i, a) => {
|
|
1695
|
+
u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(a)), import("sonner").then(
|
|
1652
1696
|
({ toast: h }) => h.success("Saved — applied on all your open tabs and devices")
|
|
1653
1697
|
);
|
|
1654
1698
|
}
|
|
1655
|
-
}),
|
|
1699
|
+
}), o = (r == null ? void 0 : r.number_format) ?? {}, { data: d = [ae, ...pe] } = v({
|
|
1656
1700
|
queryKey: ["nvr-theme-accents"],
|
|
1657
|
-
queryFn: () =>
|
|
1701
|
+
queryFn: () => s.request(
|
|
1658
1702
|
T("/settings")
|
|
1659
|
-
).then((
|
|
1703
|
+
).then((i) => {
|
|
1660
1704
|
var a, h;
|
|
1661
1705
|
return [
|
|
1662
|
-
{ ...ae, color: ((a =
|
|
1663
|
-
...
|
|
1706
|
+
{ ...ae, color: ((a = i.data) == null ? void 0 : a.project_color) ?? null },
|
|
1707
|
+
...Qe((h = i.data) == null ? void 0 : h.theme_accents)
|
|
1664
1708
|
];
|
|
1665
|
-
}).catch(() => [ae, ...
|
|
1709
|
+
}).catch(() => [ae, ...pe]),
|
|
1666
1710
|
staleTime: 5 * 6e4
|
|
1667
|
-
}), c = typeof (
|
|
1711
|
+
}), c = typeof (r == null ? void 0 : r.theme_accent) == "string" ? r.theme_accent : "brand";
|
|
1668
1712
|
return /* @__PURE__ */ t(
|
|
1669
1713
|
"div",
|
|
1670
1714
|
{
|
|
@@ -1679,10 +1723,10 @@ function St() {
|
|
|
1679
1723
|
/* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
|
|
1680
1724
|
"Timestamps",
|
|
1681
1725
|
/* @__PURE__ */ e(
|
|
1682
|
-
|
|
1726
|
+
E,
|
|
1683
1727
|
{
|
|
1684
|
-
value: String((
|
|
1685
|
-
onChange: (
|
|
1728
|
+
value: String((r == null ? void 0 : r.time_display) ?? "relative"),
|
|
1729
|
+
onChange: (i) => n.mutate({ time_display: i }),
|
|
1686
1730
|
options: [
|
|
1687
1731
|
{ value: "relative", label: "Relative (3h ago)" },
|
|
1688
1732
|
{ value: "exact", label: "Exact (Aug 24, 3:12 PM)" }
|
|
@@ -1697,8 +1741,8 @@ function St() {
|
|
|
1697
1741
|
id: "pref-compact-numbers",
|
|
1698
1742
|
type: "checkbox",
|
|
1699
1743
|
"aria-label": "Compact numbers (1.2M)",
|
|
1700
|
-
checked:
|
|
1701
|
-
onChange: (
|
|
1744
|
+
checked: o.compact === !0,
|
|
1745
|
+
onChange: (i) => n.mutate({ number_format: { ...o, compact: i.target.checked } }),
|
|
1702
1746
|
className: "rounded"
|
|
1703
1747
|
}
|
|
1704
1748
|
),
|
|
@@ -1709,8 +1753,8 @@ function St() {
|
|
|
1709
1753
|
/* @__PURE__ */ e(
|
|
1710
1754
|
"input",
|
|
1711
1755
|
{
|
|
1712
|
-
defaultValue:
|
|
1713
|
-
onBlur: (
|
|
1756
|
+
defaultValue: o.locale ?? "",
|
|
1757
|
+
onBlur: (i) => n.mutate({ number_format: { ...o, locale: i.target.value.trim() || void 0 } }),
|
|
1714
1758
|
placeholder: "en-US",
|
|
1715
1759
|
className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
1716
1760
|
}
|
|
@@ -1719,10 +1763,10 @@ function St() {
|
|
|
1719
1763
|
/* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
|
|
1720
1764
|
"Week starts",
|
|
1721
1765
|
/* @__PURE__ */ e(
|
|
1722
|
-
|
|
1766
|
+
E,
|
|
1723
1767
|
{
|
|
1724
|
-
value: String((
|
|
1725
|
-
onChange: (
|
|
1768
|
+
value: String((r == null ? void 0 : r.week_start) ?? "sun"),
|
|
1769
|
+
onChange: (i) => n.mutate({ week_start: i }),
|
|
1726
1770
|
options: [
|
|
1727
1771
|
{ value: "sun", label: "Sunday" },
|
|
1728
1772
|
{ value: "mon", label: "Monday" }
|
|
@@ -1732,34 +1776,70 @@ function St() {
|
|
|
1732
1776
|
] }),
|
|
1733
1777
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
|
|
1734
1778
|
"Accent",
|
|
1735
|
-
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children:
|
|
1736
|
-
const a =
|
|
1779
|
+
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: d.map((i) => {
|
|
1780
|
+
const a = i.key === "brand" && c === "brand" || i.key === c;
|
|
1737
1781
|
return /* @__PURE__ */ e(
|
|
1738
1782
|
"button",
|
|
1739
1783
|
{
|
|
1740
1784
|
type: "button",
|
|
1741
|
-
title:
|
|
1742
|
-
"aria-label": `Accent ${
|
|
1785
|
+
title: i.label,
|
|
1786
|
+
"aria-label": `Accent ${i.label}`,
|
|
1743
1787
|
"aria-pressed": a,
|
|
1744
|
-
"data-theme-accent":
|
|
1745
|
-
onClick: () =>
|
|
1746
|
-
className:
|
|
1788
|
+
"data-theme-accent": i.key,
|
|
1789
|
+
onClick: () => n.mutate({ theme_accent: i.key === "brand" ? null : i.key }),
|
|
1790
|
+
className: z(
|
|
1747
1791
|
"h-5 w-5 rounded-full border-2 transition-transform",
|
|
1748
1792
|
a ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
|
|
1749
1793
|
),
|
|
1750
|
-
style: { background:
|
|
1794
|
+
style: { background: i.color ?? "var(--nvr-cyan)" }
|
|
1751
1795
|
},
|
|
1752
|
-
|
|
1796
|
+
i.key
|
|
1753
1797
|
);
|
|
1754
1798
|
}) })
|
|
1755
1799
|
] }),
|
|
1800
|
+
/* @__PURE__ */ t("label", { htmlFor: "pref-tab-count", className: "flex cursor-pointer items-center gap-1.5", children: [
|
|
1801
|
+
/* @__PURE__ */ e(
|
|
1802
|
+
"input",
|
|
1803
|
+
{
|
|
1804
|
+
id: "pref-tab-count",
|
|
1805
|
+
type: "checkbox",
|
|
1806
|
+
"aria-label": "Show what is waiting on me in the browser tab",
|
|
1807
|
+
checked: (r == null ? void 0 : r.tab_count) !== "off",
|
|
1808
|
+
onChange: (i) => n.mutate({ tab_count: i.target.checked ? "on" : "off" }),
|
|
1809
|
+
className: "rounded"
|
|
1810
|
+
}
|
|
1811
|
+
),
|
|
1812
|
+
"Count in the browser tab"
|
|
1813
|
+
] }),
|
|
1814
|
+
/* @__PURE__ */ e(
|
|
1815
|
+
Pt,
|
|
1816
|
+
{
|
|
1817
|
+
value: r == null ? void 0 : r.live_mode,
|
|
1818
|
+
onChange: (i) => n.mutate({ live_mode: i === "auto" ? null : i })
|
|
1819
|
+
}
|
|
1820
|
+
),
|
|
1821
|
+
/* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
|
|
1822
|
+
"Live changes (screen readers)",
|
|
1823
|
+
/* @__PURE__ */ e(
|
|
1824
|
+
E,
|
|
1825
|
+
{
|
|
1826
|
+
value: String((r == null ? void 0 : r.live_announce) ?? "full"),
|
|
1827
|
+
onChange: (i) => n.mutate({ live_announce: i }),
|
|
1828
|
+
options: [
|
|
1829
|
+
{ value: "full", label: "Say what changed" },
|
|
1830
|
+
{ value: "brief", label: "Brief" },
|
|
1831
|
+
{ value: "off", label: "Off" }
|
|
1832
|
+
]
|
|
1833
|
+
}
|
|
1834
|
+
)
|
|
1835
|
+
] }),
|
|
1756
1836
|
/* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
|
|
1757
1837
|
"Text size",
|
|
1758
1838
|
/* @__PURE__ */ e(
|
|
1759
|
-
|
|
1839
|
+
E,
|
|
1760
1840
|
{
|
|
1761
|
-
value: String((
|
|
1762
|
-
onChange: (
|
|
1841
|
+
value: String((r == null ? void 0 : r.font_size) ?? "default"),
|
|
1842
|
+
onChange: (i) => n.mutate({ font_size: i }),
|
|
1763
1843
|
options: [
|
|
1764
1844
|
{ value: "small", label: "Small" },
|
|
1765
1845
|
{ value: "default", label: "Default" },
|
|
@@ -1773,12 +1853,52 @@ function St() {
|
|
|
1773
1853
|
}
|
|
1774
1854
|
);
|
|
1775
1855
|
}
|
|
1856
|
+
function Tt({
|
|
1857
|
+
on: s,
|
|
1858
|
+
onChange: u
|
|
1859
|
+
}) {
|
|
1860
|
+
const r = Ee();
|
|
1861
|
+
return /* @__PURE__ */ t(
|
|
1862
|
+
"div",
|
|
1863
|
+
{
|
|
1864
|
+
"data-urgent-sound": !0,
|
|
1865
|
+
className: "flex items-start gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground",
|
|
1866
|
+
children: [
|
|
1867
|
+
/* @__PURE__ */ e("span", { className: "pt-px", children: /* @__PURE__ */ e(ge, { on: s, onChange: () => u(!s), label: "Play a sound for urgent items" }) }),
|
|
1868
|
+
/* @__PURE__ */ t("div", { className: "min-w-0", children: [
|
|
1869
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-2", children: [
|
|
1870
|
+
/* @__PURE__ */ e("span", { children: "Play a sound for urgent items" }),
|
|
1871
|
+
/* @__PURE__ */ e(
|
|
1872
|
+
"button",
|
|
1873
|
+
{
|
|
1874
|
+
type: "button",
|
|
1875
|
+
onClick: () => xe({ preview: !0 }),
|
|
1876
|
+
className: "rounded px-1 py-0.5 text-[11.5px] font-medium text-[#007a99] underline decoration-dotted underline-offset-2 hover:bg-nvr-cyan/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-nvr-cyan",
|
|
1877
|
+
children: "Hear it"
|
|
1878
|
+
}
|
|
1879
|
+
)
|
|
1880
|
+
] }),
|
|
1881
|
+
/* @__PURE__ */ e("p", { className: "mt-0.5 max-w-[68ch] text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "One short chime when an urgent task, a missed deadline you own or a priority record lands on you. Never in quiet hours, do not disturb or focus mode." }),
|
|
1882
|
+
s && r.off && /* @__PURE__ */ e(
|
|
1883
|
+
"p",
|
|
1884
|
+
{
|
|
1885
|
+
"data-urgent-sound-off": !0,
|
|
1886
|
+
className: "mt-1 text-[11.5px] text-amber-700 dark:text-amber-300",
|
|
1887
|
+
children: "Live updates are Off, so it stays silent until you turn them back on (Display)."
|
|
1888
|
+
}
|
|
1889
|
+
)
|
|
1890
|
+
] })
|
|
1891
|
+
]
|
|
1892
|
+
}
|
|
1893
|
+
);
|
|
1894
|
+
}
|
|
1776
1895
|
export {
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1896
|
+
et as DelegationCard,
|
|
1897
|
+
At as DisplayPrefsCard,
|
|
1898
|
+
bt as LinkAppCard,
|
|
1899
|
+
ht as NotificationRulesCard,
|
|
1900
|
+
pt as ProfileFieldsCard,
|
|
1901
|
+
da as ProfileView,
|
|
1902
|
+
xt as TimezoneCard,
|
|
1903
|
+
Tt as UrgentSoundRow
|
|
1784
1904
|
};
|