@nivaro/react 0.3.116 → 0.3.118
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isOwnWrite as
|
|
2
|
-
const w = "nvr:list-return", x = 360 * 60 * 1e3, v = 500, S = (
|
|
3
|
-
function
|
|
4
|
-
var
|
|
1
|
+
import { isOwnWrite as h } from "./own-writes.js";
|
|
2
|
+
const w = "nvr:list-return", x = 360 * 60 * 1e3, v = 500, S = (t, e) => !!t && !!e && t.collection === e.collection && String(t.id).toLowerCase() === String(e.id).toLowerCase();
|
|
3
|
+
function g() {
|
|
4
|
+
var e, n;
|
|
5
5
|
if (typeof window > "u") return null;
|
|
6
|
-
const
|
|
7
|
-
return typeof
|
|
6
|
+
const t = (n = (e = window.history) == null ? void 0 : e.state) == null ? void 0 : n.idx;
|
|
7
|
+
return typeof t == "number" && Number.isFinite(t) ? t : null;
|
|
8
8
|
}
|
|
9
9
|
function m() {
|
|
10
10
|
try {
|
|
@@ -13,119 +13,131 @@ function m() {
|
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
19
|
-
const n =
|
|
20
|
-
for (const i of
|
|
16
|
+
function k(t) {
|
|
17
|
+
const e = m();
|
|
18
|
+
if (!e) return;
|
|
19
|
+
const n = g(), r = [], o = /* @__PURE__ */ new Set();
|
|
20
|
+
for (const i of t.rows) {
|
|
21
21
|
if (!(i != null && i.collection) || i.id == null || i.id === "") continue;
|
|
22
|
-
const
|
|
23
|
-
if (!o.has(
|
|
22
|
+
const s = `${i.collection}${String(i.id).toLowerCase()}`;
|
|
23
|
+
if (!o.has(s) && (o.add(s), r.push({ collection: i.collection, id: String(i.id) }), r.length >= v))
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
list:
|
|
28
|
-
label:
|
|
29
|
-
path:
|
|
26
|
+
const l = {
|
|
27
|
+
list: t.list,
|
|
28
|
+
label: t.label ?? null,
|
|
29
|
+
path: t.path ?? (typeof window < "u" ? `${window.location.pathname}${window.location.search}` : ""),
|
|
30
30
|
rows: r,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
...typeof t.total == "number" && Number.isFinite(t.total) && t.total >= 0 ? { total: Math.round(t.total), ...t.totalApprox ? { totalApprox: !0 } : {} } : {},
|
|
32
|
+
...typeof t.offset == "number" && Number.isFinite(t.offset) && t.offset > 0 ? { offset: Math.floor(t.offset) } : {},
|
|
33
|
+
current: { collection: t.opened.collection, id: String(t.opened.id) },
|
|
34
|
+
opened: { collection: t.opened.collection, id: String(t.opened.id) },
|
|
33
35
|
idx: n == null ? null : n + 1,
|
|
34
|
-
entry:
|
|
36
|
+
entry: t.entry ?? null,
|
|
35
37
|
at: Date.now()
|
|
36
38
|
};
|
|
37
39
|
try {
|
|
38
|
-
|
|
40
|
+
e.setItem(w, JSON.stringify(l));
|
|
39
41
|
} catch {
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
44
|
+
function y(t = Date.now()) {
|
|
45
|
+
const e = m();
|
|
46
|
+
if (!e) return null;
|
|
45
47
|
try {
|
|
46
|
-
const n =
|
|
48
|
+
const n = e.getItem(w);
|
|
47
49
|
if (!n) return null;
|
|
48
50
|
const r = JSON.parse(n);
|
|
49
|
-
return !r || typeof r.list != "string" || !Array.isArray(r.rows) || !r.current || !(
|
|
51
|
+
return !r || typeof r.list != "string" || !Array.isArray(r.rows) || !r.current || !(t - Number(r.at ?? 0) <= x) ? null : r;
|
|
50
52
|
} catch {
|
|
51
53
|
return null;
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
function R(
|
|
55
|
-
var
|
|
56
|
+
function R(t) {
|
|
57
|
+
var e;
|
|
56
58
|
try {
|
|
57
|
-
(
|
|
59
|
+
(e = m()) == null || e.setItem(w, JSON.stringify(t));
|
|
58
60
|
} catch {
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
|
-
function _(
|
|
62
|
-
if (!
|
|
63
|
-
const n =
|
|
64
|
-
|
|
63
|
+
function _(t, e) {
|
|
64
|
+
if (!t) return null;
|
|
65
|
+
const n = t.rows.findIndex((s) => S(s, e));
|
|
66
|
+
if (n < 0) return null;
|
|
67
|
+
const r = t.rows.length, o = typeof t.offset == "number" && Number.isFinite(t.offset) && t.offset > 0 ? Math.floor(t.offset) : 0, i = typeof t.total == "number" && Number.isFinite(t.total) ? Math.max(Number(t.total), o + r) : null;
|
|
68
|
+
return {
|
|
65
69
|
index: n + 1,
|
|
66
|
-
total:
|
|
67
|
-
prev: n > 0 ?
|
|
68
|
-
next: n <
|
|
70
|
+
total: r,
|
|
71
|
+
prev: n > 0 ? t.rows[n - 1] : null,
|
|
72
|
+
next: n < r - 1 ? t.rows[n + 1] : null,
|
|
73
|
+
position: o + n + 1,
|
|
74
|
+
listTotal: i,
|
|
75
|
+
approx: i != null && !!t.totalApprox,
|
|
76
|
+
moreAfter: i != null && o + r < i,
|
|
77
|
+
moreBefore: o > 0
|
|
69
78
|
};
|
|
70
79
|
}
|
|
71
|
-
function
|
|
72
|
-
if (!
|
|
73
|
-
const n =
|
|
74
|
-
return
|
|
80
|
+
function T(t, e = y()) {
|
|
81
|
+
if (!e || !S(e.current, t)) return null;
|
|
82
|
+
const n = g();
|
|
83
|
+
return e.idx != null && n != null && e.idx !== n ? null : _(e, t) ? e : null;
|
|
75
84
|
}
|
|
76
|
-
function
|
|
77
|
-
const
|
|
78
|
-
|
|
85
|
+
function $(t) {
|
|
86
|
+
const e = y();
|
|
87
|
+
e && R({ ...e, current: { collection: t.collection, id: String(t.id) }, at: Date.now() });
|
|
79
88
|
}
|
|
80
|
-
function
|
|
81
|
-
return !
|
|
89
|
+
function I(t, e = y()) {
|
|
90
|
+
return !e || e.list !== t ? null : e.current;
|
|
82
91
|
}
|
|
83
|
-
function
|
|
84
|
-
var
|
|
85
|
-
if (!
|
|
86
|
-
const n = typeof CSS < "u" && CSS.escape ? CSS.escape(
|
|
92
|
+
function O(t, e) {
|
|
93
|
+
var a;
|
|
94
|
+
if (!t || typeof window > "u" || !e) return !1;
|
|
95
|
+
const n = typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/"/g, '\\"'), r = t.querySelector(`[data-row-key="${n}"]`);
|
|
87
96
|
if (!r) return !1;
|
|
88
97
|
r.setAttribute("data-return-row", "");
|
|
89
98
|
let o = !1;
|
|
90
99
|
try {
|
|
91
|
-
o = !!((
|
|
100
|
+
o = !!((a = window.matchMedia) != null && a.call(window, "(prefers-reduced-motion: reduce)").matches);
|
|
92
101
|
} catch {
|
|
93
102
|
o = !1;
|
|
94
103
|
}
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
const l = Array.from(r.children);
|
|
105
|
+
if (o || l.some((u) => typeof u.animate != "function"))
|
|
106
|
+
return setTimeout(() => r.removeAttribute("data-return-row"), 1800), !0;
|
|
107
|
+
const s = `rgba(0, 206, 255, ${typeof document < "u" && document.documentElement.classList.contains("dark") ? 0.1 : 0.16})`;
|
|
108
|
+
return l.forEach((u, c) => {
|
|
109
|
+
const f = c === 0 ? "inset 3px 0 0 0 rgba(0, 206, 255, 0.85), " : "";
|
|
98
110
|
u.animate(
|
|
99
111
|
[
|
|
100
|
-
{ boxShadow: `${
|
|
101
|
-
{ boxShadow: `${
|
|
112
|
+
{ boxShadow: `${f}inset 0 0 0 9999px ${s}` },
|
|
113
|
+
{ boxShadow: `${f}inset 0 0 0 9999px ${s}`, offset: 0.55 },
|
|
102
114
|
{
|
|
103
|
-
boxShadow: `${
|
|
115
|
+
boxShadow: `${c === 0 ? "inset 3px 0 0 0 rgba(0, 206, 255, 0), " : ""}inset 0 0 0 9999px rgba(0, 206, 255, 0)`
|
|
104
116
|
}
|
|
105
117
|
],
|
|
106
118
|
{ duration: 2400, easing: "ease-out" }
|
|
107
119
|
);
|
|
108
|
-
}), setTimeout(() => r.removeAttribute("data-return-row"), 2400), !0
|
|
120
|
+
}), setTimeout(() => r.removeAttribute("data-return-row"), 2400), !0;
|
|
109
121
|
}
|
|
110
|
-
function C(
|
|
111
|
-
const n =
|
|
122
|
+
function C(t, e) {
|
|
123
|
+
const n = t.getBoundingClientRect(), r = { top: 0, bottom: typeof window < "u" ? window.innerHeight : 0 };
|
|
112
124
|
return n.bottom > r.top + 4 && n.top < r.bottom - 4;
|
|
113
125
|
}
|
|
114
|
-
const L = 300,
|
|
115
|
-
function
|
|
116
|
-
if (!
|
|
117
|
-
const { coalesced:
|
|
118
|
-
return r || !Array.isArray(n) ? [{ ...
|
|
126
|
+
const L = 300, b = 900 * 1e3, N = 40, p = /* @__PURE__ */ new Map();
|
|
127
|
+
function M(t) {
|
|
128
|
+
if (!t.coalesced) return [t];
|
|
129
|
+
const { coalesced: e, items: n, many: r, count: o, ...l } = t;
|
|
130
|
+
return r || !Array.isArray(n) ? [{ ...l, item: "*" }] : n.map((i) => ({ ...l, item: i }));
|
|
119
131
|
}
|
|
120
|
-
function d(
|
|
121
|
-
|
|
132
|
+
function d(t, e) {
|
|
133
|
+
t.complete && (t.complete = !1, t.reason = e, t.events = []);
|
|
122
134
|
}
|
|
123
|
-
function
|
|
135
|
+
function F(t, e, n) {
|
|
124
136
|
const r = [...new Set(n.filter(Boolean))];
|
|
125
|
-
if (!
|
|
137
|
+
if (!t || !e || r.length === 0) return () => {
|
|
126
138
|
};
|
|
127
139
|
const o = {
|
|
128
|
-
key:
|
|
140
|
+
key: e,
|
|
129
141
|
events: [],
|
|
130
142
|
complete: !0,
|
|
131
143
|
away: !1,
|
|
@@ -134,11 +146,11 @@ function D(e, t, n) {
|
|
|
134
146
|
stop: () => {
|
|
135
147
|
},
|
|
136
148
|
timer: null
|
|
137
|
-
},
|
|
149
|
+
}, l = (u) => {
|
|
138
150
|
if (!(!o.away || !o.complete))
|
|
139
|
-
for (const
|
|
140
|
-
if (!
|
|
141
|
-
if (String(
|
|
151
|
+
for (const c of M(u)) {
|
|
152
|
+
if (!c || !r.includes(String(c.collection))) continue;
|
|
153
|
+
if (String(c.item) === "*") {
|
|
142
154
|
d(o, "bulk");
|
|
143
155
|
return;
|
|
144
156
|
}
|
|
@@ -146,61 +158,61 @@ function D(e, t, n) {
|
|
|
146
158
|
d(o, "overflow");
|
|
147
159
|
return;
|
|
148
160
|
}
|
|
149
|
-
const f = Array.isArray(
|
|
161
|
+
const f = Array.isArray(c.changed_fields) ? c.changed_fields : null;
|
|
150
162
|
o.events.push({
|
|
151
|
-
collection: String(
|
|
152
|
-
item: String(
|
|
153
|
-
...
|
|
163
|
+
collection: String(c.collection),
|
|
164
|
+
item: String(c.item),
|
|
165
|
+
...c.action ? { action: c.action } : {},
|
|
154
166
|
...f ? { changed_fields: [...f] } : {},
|
|
155
|
-
own:
|
|
167
|
+
own: h(String(c.collection), String(c.item), f)
|
|
156
168
|
});
|
|
157
169
|
}
|
|
158
|
-
}, i =
|
|
159
|
-
o.away && (
|
|
170
|
+
}, i = t.subscribeCollections(r, l), s = t.onStatus ? t.onStatus((u) => {
|
|
171
|
+
o.away && (u.state === "reconnecting" ? o.dropped = !0 : o.dropped && (o.dropped = !1, u.resumed !== "replayed" && d(o, "reconnect")));
|
|
160
172
|
}) : () => {
|
|
161
173
|
}, a = () => {
|
|
162
174
|
o.away && d(o, "stale");
|
|
163
175
|
};
|
|
164
176
|
return typeof window < "u" && (window.addEventListener("nvr:catchup-full", a), window.addEventListener("nvr:realtime-stale", a)), o.stop = () => {
|
|
165
|
-
i(),
|
|
177
|
+
i(), s(), typeof window < "u" && (window.removeEventListener("nvr:catchup-full", a), window.removeEventListener("nvr:realtime-stale", a)), o.timer && clearTimeout(o.timer), o.timer = null;
|
|
166
178
|
}, () => {
|
|
167
|
-
const
|
|
168
|
-
|
|
179
|
+
const u = p.get(e);
|
|
180
|
+
u && u !== o && u.stop(), o.away = !0, o.leftAt = Date.now(), o.timer = setTimeout(() => {
|
|
169
181
|
o.stop(), d(o, "expired");
|
|
170
|
-
},
|
|
182
|
+
}, b), p.set(e, o);
|
|
171
183
|
};
|
|
172
184
|
}
|
|
173
|
-
function
|
|
174
|
-
const n =
|
|
185
|
+
function A(t, e) {
|
|
186
|
+
const n = e - t.leftAt > b;
|
|
175
187
|
return {
|
|
176
|
-
events:
|
|
177
|
-
complete:
|
|
178
|
-
...
|
|
179
|
-
leftAt:
|
|
180
|
-
awayMs: Math.max(0,
|
|
188
|
+
events: t.complete && !n ? [...t.events] : [],
|
|
189
|
+
complete: t.complete && !n,
|
|
190
|
+
...t.reason ? { reason: t.reason } : n ? { reason: "expired" } : {},
|
|
191
|
+
leftAt: t.leftAt,
|
|
192
|
+
awayMs: Math.max(0, e - t.leftAt)
|
|
181
193
|
};
|
|
182
194
|
}
|
|
183
|
-
function
|
|
184
|
-
const n = p.get(
|
|
185
|
-
return n != null && n.away ?
|
|
186
|
-
}
|
|
187
|
-
function
|
|
188
|
-
const n = p.get(
|
|
189
|
-
return n != null && n.away ? (p.delete(
|
|
190
|
-
}
|
|
191
|
-
function
|
|
192
|
-
return
|
|
193
|
-
}
|
|
194
|
-
function
|
|
195
|
-
if (!
|
|
196
|
-
const r = new Map(
|
|
197
|
-
for (const
|
|
198
|
-
const i = n(
|
|
199
|
-
if (!
|
|
200
|
-
const a = /* @__PURE__ */ new Set([...Object.keys(
|
|
201
|
-
for (const
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
195
|
+
function D(t, e = Date.now()) {
|
|
196
|
+
const n = p.get(t);
|
|
197
|
+
return n != null && n.away ? A(n, e) : null;
|
|
198
|
+
}
|
|
199
|
+
function J(t, e = Date.now()) {
|
|
200
|
+
const n = p.get(t);
|
|
201
|
+
return n != null && n.away ? (p.delete(t), n.stop(), A(n, e)) : null;
|
|
202
|
+
}
|
|
203
|
+
function W(t, e = {}) {
|
|
204
|
+
return t ? t.complete ? t.events.length === 0 ? "keep" : new Set(t.events.map((r) => `${r.collection}${String(r.item)}`)).size <= (e.maxRows ?? N) ? "replay" : "refetch" : "refetch" : "fresh";
|
|
205
|
+
}
|
|
206
|
+
function X(t, e, n = (r) => String(r.id)) {
|
|
207
|
+
if (!t || !e) return [];
|
|
208
|
+
const r = new Map(t.map((l) => [n(l), l])), o = [];
|
|
209
|
+
for (const l of e) {
|
|
210
|
+
const i = n(l), s = r.get(i);
|
|
211
|
+
if (!s) continue;
|
|
212
|
+
const a = /* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(l)]);
|
|
213
|
+
for (const u of a) {
|
|
214
|
+
const c = s[u], f = l[u];
|
|
215
|
+
if (c !== f && !(c && f && typeof c == "object" && typeof f == "object" && JSON.stringify(c) === JSON.stringify(f))) {
|
|
204
216
|
o.push(i);
|
|
205
217
|
break;
|
|
206
218
|
}
|
|
@@ -210,22 +222,22 @@ function j(e, t, n = (r) => String(r.id)) {
|
|
|
210
222
|
}
|
|
211
223
|
export {
|
|
212
224
|
L as AWAY_MAX_EVENTS,
|
|
213
|
-
|
|
225
|
+
b as AWAY_MAX_MS,
|
|
214
226
|
w as LIST_RETURN_KEY,
|
|
215
227
|
x as LIST_RETURN_MAX_AGE_MS,
|
|
216
228
|
v as LIST_RETURN_MAX_ROWS,
|
|
217
|
-
|
|
218
|
-
|
|
229
|
+
N as RETURN_MAX_ROWS,
|
|
230
|
+
X as changedRowIds,
|
|
219
231
|
_ as listNeighbors,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
232
|
+
T as listReturnFor,
|
|
233
|
+
O as markReturnRow,
|
|
234
|
+
k as noteListOpen,
|
|
235
|
+
D as peekListAway,
|
|
236
|
+
W as planListReturn,
|
|
237
|
+
y as readListReturn,
|
|
238
|
+
I as returnRowFor,
|
|
227
239
|
C as rowInView,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
240
|
+
F as standbyListAway,
|
|
241
|
+
$ as stepListReturn,
|
|
242
|
+
J as takeListAway
|
|
231
243
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useState as d, useEffect as f, useMemo as
|
|
1
|
+
import { useState as d, useEffect as f, useMemo as m } from "react";
|
|
2
2
|
function p(t) {
|
|
3
3
|
if (t == null) return null;
|
|
4
|
-
const
|
|
5
|
-
if (!/^-?\d{1,3}(,\d{3})*$|^-?\d+$/.test(
|
|
6
|
-
const r = Number(
|
|
4
|
+
const e = String(t).trim().replace(/−/g, "-");
|
|
5
|
+
if (!/^-?\d{1,3}(,\d{3})*$|^-?\d+$/.test(e)) return null;
|
|
6
|
+
const r = Number(e.replace(/,/g, ""));
|
|
7
7
|
return Number.isSafeInteger(r) ? r : null;
|
|
8
8
|
}
|
|
9
9
|
const o = (t) => String(t).padStart(2, "0");
|
|
@@ -11,36 +11,42 @@ function g(t) {
|
|
|
11
11
|
return `${t.getFullYear()}-${o(t.getMonth() + 1)}-${o(t.getDate())}`;
|
|
12
12
|
}
|
|
13
13
|
function N(t) {
|
|
14
|
-
const
|
|
15
|
-
return g(
|
|
14
|
+
const e = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 1);
|
|
15
|
+
return g(e);
|
|
16
16
|
}
|
|
17
|
-
function c(t,
|
|
18
|
-
const
|
|
19
|
-
return t ? t.day ===
|
|
20
|
-
day:
|
|
21
|
-
first:
|
|
17
|
+
function c(t, e, r = /* @__PURE__ */ new Date()) {
|
|
18
|
+
const n = g(r);
|
|
19
|
+
return t ? t.day === n ? t.last === e ? t : { ...t, last: e } : {
|
|
20
|
+
day: n,
|
|
21
|
+
first: e,
|
|
22
22
|
firstHour: r.getHours(),
|
|
23
|
-
last:
|
|
23
|
+
last: e,
|
|
24
24
|
// Only the day right before counts as "yesterday"; an older visit is no baseline.
|
|
25
25
|
prevLast: t.day === N(r) ? t.last : null
|
|
26
|
-
} : { day:
|
|
26
|
+
} : { day: n, first: e, firstHour: r.getHours(), last: e, prevLast: null };
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function h(t) {
|
|
29
29
|
if (!t) return null;
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
30
|
+
let e = t.last - t.first, r = t.firstHour < 12 ? "this morning" : "earlier today";
|
|
31
|
+
if (e === 0) {
|
|
32
32
|
if (t.prevLast == null || t.prevLast === t.last) return null;
|
|
33
|
-
|
|
33
|
+
e = t.last - t.prevLast, r = "yesterday";
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
return {
|
|
35
|
+
const n = `${e > 0 ? "+" : "−"}${Math.abs(e).toLocaleString("en-US")}`;
|
|
36
|
+
return {
|
|
37
|
+
delta: e,
|
|
38
|
+
sign: n,
|
|
39
|
+
since: r,
|
|
40
|
+
text: `${n} ${r === "yesterday" ? "vs yesterday" : "today"}`,
|
|
41
|
+
phrase: `${n} since ${r}`
|
|
42
|
+
};
|
|
37
43
|
}
|
|
38
|
-
const
|
|
44
|
+
const y = "nvr:chip:";
|
|
39
45
|
function i(t) {
|
|
40
46
|
try {
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
const r = JSON.parse(
|
|
47
|
+
const e = localStorage.getItem(y + t);
|
|
48
|
+
if (!e) return null;
|
|
49
|
+
const r = JSON.parse(e);
|
|
44
50
|
return typeof r.day != "string" || !Number.isFinite(r.first) || !Number.isFinite(r.last) || !Number.isFinite(r.firstHour) ? null : {
|
|
45
51
|
day: r.day,
|
|
46
52
|
first: Number(r.first),
|
|
@@ -52,30 +58,30 @@ function i(t) {
|
|
|
52
58
|
return null;
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
|
-
function
|
|
61
|
+
function S(t, e) {
|
|
56
62
|
try {
|
|
57
|
-
localStorage.setItem(
|
|
63
|
+
localStorage.setItem(y + t, JSON.stringify(e));
|
|
58
64
|
} catch {
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
67
|
+
function L(t, e, r = !0) {
|
|
68
|
+
const n = r ? p(e) : null, [u, a] = d(
|
|
63
69
|
() => r ? i(t) : null
|
|
64
70
|
);
|
|
65
71
|
return f(() => {
|
|
66
|
-
|
|
72
|
+
a(r ? i(t) : null);
|
|
67
73
|
}, [t, r]), f(() => {
|
|
68
|
-
|
|
69
|
-
const s = c(
|
|
70
|
-
return s !==
|
|
74
|
+
n != null && a((l) => {
|
|
75
|
+
const s = c(l ?? i(t), n);
|
|
76
|
+
return s !== l && S(t, s), s;
|
|
71
77
|
});
|
|
72
|
-
}, [
|
|
78
|
+
}, [n, t]), m(() => n == null ? null : h(c(u, n)), [n, u]);
|
|
73
79
|
}
|
|
74
80
|
export {
|
|
75
81
|
c as advanceBaseline,
|
|
76
82
|
g as dayKey,
|
|
77
|
-
|
|
83
|
+
h as deltaChip,
|
|
78
84
|
p as parseCount,
|
|
79
85
|
i as readBaseline,
|
|
80
|
-
|
|
86
|
+
L as useChangeChip
|
|
81
87
|
};
|