@nivaro/react 0.3.137 → 0.3.139
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 +95 -4
- package/dist/index.js +748 -743
- package/dist/shared/components/CollectionBrowserView.js +392 -389
- package/dist/shared/components/DelegateCoverLine.js +80 -87
- package/dist/shared/components/ItemEditForm.js +589 -588
- package/dist/shared/components/MyWorkView.js +284 -286
- package/dist/shared/components/NotificationBell.js +251 -205
- package/dist/shared/components/ai/AiAnalyticsView.js +878 -417
- package/dist/shared/components/ai/AiPlanCard.js +164 -122
- package/dist/shared/components/ai/AiPlanUndo.js +291 -0
- package/dist/shared/components/ai/call-log/CallDrawer.js +357 -0
- package/dist/shared/components/ai/call-log/RawJson.js +126 -0
- package/dist/shared/components/ai/call-log/ThreadView.js +223 -0
- package/dist/shared/components/ai/call-log/TranscriptView.js +227 -0
- package/dist/shared/components/ai/call-log/controls.js +364 -0
- package/dist/shared/components/ai/call-log/format.js +46 -0
- package/dist/shared/components/ai/call-log/url.js +105 -0
- package/dist/shared/components/chat/chat-core.js +422 -346
- package/dist/shared/components/integrations/IntegrationObligationsView.js +98 -98
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +102 -93
- package/dist/shared/components/integrations/console/api.js +11 -1
- package/dist/shared/components/item-edit/HeaderRollupExplainer.js +5 -1
- package/dist/shared/components/item-edit/RecordLiveSync.js +241 -229
- package/dist/shared/components/item-edit/RecordRecapChanges.js +166 -0
- package/dist/shared/components/item-edit/RecordRecapStrip.js +254 -84
- package/dist/shared/components/item-edit/live-related.js +34 -18
- package/dist/shared/components/panels/RevisionsPanel.js +735 -683
- package/dist/shared/components/queue/QueueWorklist.js +323 -316
- package/dist/shared/components/support/SupportRequestDialog.js +198 -181
- package/dist/shared/components/trackers/use-tracker-link.js +74 -65
- package/dist/shared/lib/activity-sentence.js +167 -151
- package/dist/shared/lib/config-update-refresh.js +34 -0
- package/dist/shared/lib/config-watch.js +17 -17
- package/dist/shared/lib/gap-refresh.js +49 -0
- package/dist/shared/lib/integration-dots.js +8 -8
- package/dist/shared/lib/live-ops.js +26 -23
- package/dist/shared/lib/live-pickers.js +1 -1
- package/dist/shared/lib/live-queries.js +223 -195
- package/dist/shared/lib/live.js +56 -51
- package/dist/shared/lib/obligation-banner.js +11 -10
- package/dist/shared/lib/obligation-filters.js +22 -18
- package/dist/shared/lib/obligation-reason-text.js +18 -8
- package/dist/shared/lib/presence-hooks.js +133 -132
- package/dist/shared/lib/reconnect-resync.js +90 -0
- package/dist/shared/lib/record-room-holds.js +43 -0
- package/dist/shared/lib/socket-realtime.js +116 -105
- package/dist/shared/lib/user-sync.js +1 -6
- package/package.json +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { useQueryClient as
|
|
2
|
-
import { useSyncExternalStore as
|
|
3
|
-
import { expandCoalesced as
|
|
4
|
-
import { getLiveMode as
|
|
5
|
-
import { LIVE_WIDGET_SAFETY_MS as
|
|
6
|
-
import { isOwnWrite as
|
|
7
|
-
import { useOptionalRealtime as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useQueryClient as ae } from "@tanstack/react-query";
|
|
2
|
+
import { useSyncExternalStore as ye, useRef as me, useEffect as ce } from "react";
|
|
3
|
+
import { expandCoalesced as be } from "./live.js";
|
|
4
|
+
import { getLiveMode as le } from "./live-preference.js";
|
|
5
|
+
import { LIVE_WIDGET_SAFETY_MS as Me } from "./live-widgets.js";
|
|
6
|
+
import { isOwnWrite as Se } from "./own-writes.js";
|
|
7
|
+
import { useOptionalRealtime as fe, useRealtimeStatus as Oe } from "./realtime.js";
|
|
8
|
+
import { onResync as Re } from "./reconnect-resync.js";
|
|
9
|
+
import { setScreenRefreshClient as Ee } from "./screen-refresh.js";
|
|
10
|
+
function Be(t) {
|
|
11
|
+
return { live: t };
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
+
const Ce = [
|
|
13
14
|
"item",
|
|
14
15
|
"rrv-record",
|
|
15
16
|
"revisions",
|
|
@@ -46,269 +47,296 @@ const Oe = [
|
|
|
46
47
|
"live-record",
|
|
47
48
|
"live-list",
|
|
48
49
|
// Realtime round 2 (rt2-record): the record page's SLA clock re-reads after a reconnect too.
|
|
49
|
-
"sla-breach"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
"sla-breach",
|
|
51
|
+
// rt-fix C: record panels kept live by RecordLiveSync (proposals, obligation lines, external
|
|
52
|
+
// ids, dynamic attributes) re-read after a reconnect too.
|
|
53
|
+
"change-proposals",
|
|
54
|
+
"integration-obligations",
|
|
55
|
+
"record-external-ids",
|
|
56
|
+
"attribute-values"
|
|
57
|
+
], Le = [
|
|
58
|
+
"notification-count",
|
|
59
|
+
"notifications",
|
|
60
|
+
"nvr-chat",
|
|
61
|
+
"nvr-chat-rooms",
|
|
62
|
+
"nvr-chat-thread",
|
|
63
|
+
"pipeline-all-owners",
|
|
64
|
+
"pipeline-instance-owners",
|
|
65
|
+
"pipeline-owners-resolved",
|
|
66
|
+
"cbv-owners",
|
|
67
|
+
"approval-brief",
|
|
68
|
+
"my-work",
|
|
69
|
+
"my-work-count"
|
|
70
|
+
], w = (t) => {
|
|
71
|
+
var o;
|
|
72
|
+
const s = (o = t.meta) == null ? void 0 : o.live;
|
|
53
73
|
return s && typeof s == "object" ? s : null;
|
|
54
74
|
};
|
|
55
|
-
function
|
|
56
|
-
var
|
|
57
|
-
if (!
|
|
75
|
+
function Te(t) {
|
|
76
|
+
var o;
|
|
77
|
+
if (!t || t.reconcileOnly) return [];
|
|
58
78
|
const s = /* @__PURE__ */ new Set();
|
|
59
|
-
for (const
|
|
60
|
-
return (
|
|
79
|
+
for (const a of t.reads ?? []) a && s.add(a);
|
|
80
|
+
return (o = t.record) != null && o.collection && s.add(t.record.collection), [...s];
|
|
61
81
|
}
|
|
62
|
-
function
|
|
82
|
+
function ke(t, s, o) {
|
|
63
83
|
var k;
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
if (!v && !(
|
|
67
|
-
const
|
|
68
|
-
for (const
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
73
|
-
const E =
|
|
74
|
-
if (E.length > 0 && (!
|
|
75
|
-
var
|
|
76
|
-
return (
|
|
77
|
-
})) || (k =
|
|
78
|
-
var
|
|
79
|
-
return (
|
|
84
|
+
if (t.reconcileOnly) return !1;
|
|
85
|
+
const a = t.record, v = !!a && a.collection === s;
|
|
86
|
+
if (!v && !(t.reads ?? []).includes(s)) return !1;
|
|
87
|
+
const R = t.includeOwn ?? !v, T = v ? String(a == null ? void 0 : a.id) : null;
|
|
88
|
+
for (const g of o) {
|
|
89
|
+
if (g.own && !R || T !== null && String(g.item) !== T && g.item !== "*") continue;
|
|
90
|
+
if (g.action === "create" || g.action === "delete") return !0;
|
|
91
|
+
const d = g.changed_fields;
|
|
92
|
+
if (!d || d.length === 0) return !0;
|
|
93
|
+
const E = d.filter((u) => !u.startsWith("$"));
|
|
94
|
+
if (E.length > 0 && (!t.fields || E.some((u) => {
|
|
95
|
+
var y;
|
|
96
|
+
return (y = t.fields) == null ? void 0 : y.includes(u);
|
|
97
|
+
})) || (k = t.aspects) != null && k.length && d.some((u) => {
|
|
98
|
+
var y;
|
|
99
|
+
return (y = t.aspects) == null ? void 0 : y.includes(u);
|
|
80
100
|
})) return !0;
|
|
81
101
|
}
|
|
82
102
|
return !1;
|
|
83
103
|
}
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
for (const
|
|
104
|
+
const q = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Set(), ue = (t, s) => {
|
|
105
|
+
const o = (q.get(t) ?? 0) + s;
|
|
106
|
+
o > 0 ? q.set(t, o) : q.delete(t);
|
|
107
|
+
for (const a of F) a();
|
|
88
108
|
};
|
|
89
|
-
function
|
|
90
|
-
var
|
|
91
|
-
const
|
|
92
|
-
let
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
const
|
|
96
|
-
if (!
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
for (const c of
|
|
100
|
-
if (
|
|
101
|
-
|
|
109
|
+
function Qe(t, s, o = {}) {
|
|
110
|
+
var Z, ee;
|
|
111
|
+
const a = o.windowMs ?? 300, v = o.readsGapMs ?? 1e4, R = o.hiddenReconcileMs ?? 5 * 6e4, T = o.lingerMs ?? 3e4, k = o.jitterMs ?? 1500, g = o.isOwn ?? ((e, n) => Se(e, n)), d = o.now ?? (() => Date.now()), E = o.random ?? Math.random, u = o.doc === void 0 ? typeof document > "u" ? null : document : o.doc, y = o.win === void 0 ? typeof window > "u" ? null : window : o.win, Q = t.getQueryCache(), C = { events: 0, refetches: 0, reconciles: 0, deferred: 0 };
|
|
112
|
+
let h = !1;
|
|
113
|
+
const p = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), de = 500, ve = (e) => {
|
|
114
|
+
if (h || !(e != null && e.collection)) return;
|
|
115
|
+
const n = String(e.collection);
|
|
116
|
+
if (!p.has(n)) return;
|
|
117
|
+
C.events++;
|
|
118
|
+
const i = A.get(n) ?? [];
|
|
119
|
+
for (const c of be(e)) {
|
|
120
|
+
if (i.length >= de) {
|
|
121
|
+
i.length = 0, i.push({ collection: n, item: "*", own: !1 });
|
|
102
122
|
break;
|
|
103
123
|
}
|
|
104
|
-
|
|
124
|
+
i.push({ ...c, own: c.item != null && c.item !== "*" && g(n, c.item) });
|
|
105
125
|
}
|
|
106
|
-
A.set(
|
|
107
|
-
|
|
108
|
-
setTimeout(() =>
|
|
126
|
+
A.set(n, i), _.has(n) || _.set(
|
|
127
|
+
n,
|
|
128
|
+
setTimeout(() => pe(n), a)
|
|
109
129
|
);
|
|
110
|
-
},
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
for (const
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
if (!(
|
|
117
|
-
for (const c of
|
|
130
|
+
}, K = () => {
|
|
131
|
+
if (h) return;
|
|
132
|
+
const e = /* @__PURE__ */ new Set();
|
|
133
|
+
for (const n of Q.getAll()) {
|
|
134
|
+
if (n.getObserversCount() === 0) continue;
|
|
135
|
+
const i = w(n);
|
|
136
|
+
if (!(i != null && i.staleOnly && !n.state.dataUpdatedAt))
|
|
137
|
+
for (const c of Te(i)) e.add(c);
|
|
118
138
|
}
|
|
119
|
-
for (const
|
|
120
|
-
const
|
|
121
|
-
|
|
139
|
+
for (const n of e) {
|
|
140
|
+
const i = b.get(n);
|
|
141
|
+
i && (clearTimeout(i), b.delete(n)), p.has(n) || p.set(n, s.subscribeCollections([n], ve));
|
|
122
142
|
}
|
|
123
|
-
for (const
|
|
124
|
-
|
|
125
|
-
|
|
143
|
+
for (const n of p.keys())
|
|
144
|
+
e.has(n) || b.has(n) || b.set(
|
|
145
|
+
n,
|
|
126
146
|
setTimeout(() => {
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
},
|
|
147
|
+
var i;
|
|
148
|
+
b.delete(n), (i = p.get(n)) == null || i(), p.delete(n);
|
|
149
|
+
}, T)
|
|
130
150
|
);
|
|
131
151
|
};
|
|
132
|
-
let
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
let D = !1;
|
|
153
|
+
const U = () => {
|
|
154
|
+
D || (D = !0, queueMicrotask(() => {
|
|
155
|
+
D = !1, K();
|
|
136
156
|
}));
|
|
137
|
-
},
|
|
138
|
-
var
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
else if (
|
|
142
|
-
const c =
|
|
143
|
-
(
|
|
157
|
+
}, W = /* @__PURE__ */ new WeakSet(), he = Q.subscribe((e) => {
|
|
158
|
+
var n, i;
|
|
159
|
+
if (e.type === "added" || e.type === "removed" || e.type === "observerAdded" || e.type === "observerRemoved" || e.type === "observerOptionsUpdated")
|
|
160
|
+
U();
|
|
161
|
+
else if (e.type === "updated" && ((n = e.action) == null ? void 0 : n.type) === "success") {
|
|
162
|
+
const c = e.query;
|
|
163
|
+
(i = w(c)) != null && i.staleOnly && !W.has(c) && (W.add(c), U());
|
|
144
164
|
}
|
|
145
|
-
}),
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
for (const l of
|
|
149
|
-
|
|
150
|
-
{ predicate: (l) =>
|
|
151
|
-
{ cancelRefetch:
|
|
165
|
+
}), G = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Set(), Y = (e, n) => {
|
|
166
|
+
if (e.length === 0) return;
|
|
167
|
+
const i = new Set(e), c = d();
|
|
168
|
+
for (const l of e) G.set(l, c);
|
|
169
|
+
C.refetches += e.filter((l) => l.getObserversCount() > 0).length, t.invalidateQueries(
|
|
170
|
+
{ predicate: (l) => i.has(l) },
|
|
171
|
+
{ cancelRefetch: n }
|
|
152
172
|
);
|
|
153
|
-
}, N = (
|
|
154
|
-
var
|
|
155
|
-
const
|
|
156
|
-
for (const r of
|
|
157
|
-
r.getObserversCount() === 0 || (
|
|
173
|
+
}, N = (e, n = !0) => {
|
|
174
|
+
var te, se, oe;
|
|
175
|
+
const i = [], c = [];
|
|
176
|
+
for (const r of e)
|
|
177
|
+
r.getObserversCount() === 0 || (te = w(r)) != null && te.staleOnly ? c.push(r) : u != null && u.hidden ? (c.push(r), j.add(r)) : i.push(r);
|
|
158
178
|
if (c.length) {
|
|
159
179
|
const r = new Set(c);
|
|
160
|
-
|
|
180
|
+
C.deferred += c.length, t.invalidateQueries({ predicate: (f) => r.has(f), refetchType: "none" });
|
|
161
181
|
}
|
|
162
|
-
const l =
|
|
163
|
-
for (const r of
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
} else
|
|
182
|
+
const l = d(), m = [];
|
|
183
|
+
for (const r of i) {
|
|
184
|
+
const f = w(r), O = (f == null ? void 0 : f.minGapMs) ?? (f != null && f.record ? 0 : v), ie = G.get(r) ?? 0;
|
|
185
|
+
if (O <= 0 || l - ie >= O) {
|
|
186
|
+
const re = M.get(r);
|
|
187
|
+
re && (clearTimeout(re), M.delete(r)), m.push(r);
|
|
188
|
+
} else M.has(r) || M.set(
|
|
169
189
|
r,
|
|
170
190
|
setTimeout(
|
|
171
191
|
() => {
|
|
172
|
-
|
|
192
|
+
M.delete(r), h || N([r]);
|
|
173
193
|
},
|
|
174
|
-
|
|
194
|
+
ie + O - l
|
|
175
195
|
)
|
|
176
196
|
);
|
|
177
197
|
}
|
|
178
|
-
const
|
|
179
|
-
for (const r of
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
|
|
198
|
+
const ne = [];
|
|
199
|
+
for (const r of m) {
|
|
200
|
+
const f = ((se = w(r)) == null ? void 0 : se.jitterMs) ?? 0, O = ((oe = w(r)) == null ? void 0 : oe.delayMs) ?? 0;
|
|
201
|
+
if (f <= 0 && O <= 0) {
|
|
202
|
+
ne.push(r);
|
|
183
203
|
continue;
|
|
184
204
|
}
|
|
185
|
-
I.has(r) || (
|
|
205
|
+
I.has(r) || (G.set(r, l), I.set(
|
|
186
206
|
r,
|
|
187
207
|
setTimeout(
|
|
188
208
|
() => {
|
|
189
|
-
I.delete(r),
|
|
209
|
+
I.delete(r), h || Y([r], n);
|
|
190
210
|
},
|
|
191
|
-
|
|
211
|
+
O + Math.floor(E() * Math.max(0, f))
|
|
192
212
|
)
|
|
193
213
|
));
|
|
194
214
|
}
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
if (A.delete(
|
|
200
|
-
const
|
|
215
|
+
Y(ne, n);
|
|
216
|
+
}, pe = (e) => {
|
|
217
|
+
_.delete(e);
|
|
218
|
+
const n = A.get(e) ?? [];
|
|
219
|
+
if (A.delete(e), h || n.length === 0) return;
|
|
220
|
+
const i = [];
|
|
201
221
|
for (const c of Q.getAll()) {
|
|
202
|
-
const l =
|
|
203
|
-
l &&
|
|
222
|
+
const l = w(c);
|
|
223
|
+
l && ke(l, e, n) && i.push(c);
|
|
204
224
|
}
|
|
205
|
-
N(
|
|
206
|
-
},
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
const
|
|
225
|
+
N(i);
|
|
226
|
+
}, ge = new Set(Ce), H = (e) => {
|
|
227
|
+
if (h || le() === "off") return;
|
|
228
|
+
C.reconciles++;
|
|
229
|
+
const n = [], i = /* @__PURE__ */ new Set();
|
|
210
230
|
for (const l of Q.getAll()) {
|
|
211
|
-
const
|
|
212
|
-
|
|
231
|
+
const m = w(l);
|
|
232
|
+
m != null && m.staleOnly ? i.add(l) : m && n.push(l);
|
|
213
233
|
}
|
|
214
|
-
|
|
215
|
-
predicate: (l) =>
|
|
234
|
+
j.clear(), i.size > 0 && t.invalidateQueries({
|
|
235
|
+
predicate: (l) => i.has(l),
|
|
216
236
|
refetchType: "none"
|
|
217
237
|
});
|
|
218
|
-
const c = new Set(
|
|
219
|
-
|
|
238
|
+
const c = new Set(n);
|
|
239
|
+
t.invalidateQueries(
|
|
220
240
|
{
|
|
221
|
-
predicate: (l) => c.has(l) || l.getObserversCount() > 0 &&
|
|
241
|
+
predicate: (l) => c.has(l) || l.getObserversCount() > 0 && ge.has(String(l.queryKey[0]))
|
|
222
242
|
},
|
|
223
243
|
{ cancelRefetch: !1 }
|
|
224
244
|
);
|
|
225
245
|
};
|
|
226
|
-
let
|
|
227
|
-
const
|
|
228
|
-
|
|
246
|
+
let L = null;
|
|
247
|
+
const z = (e) => {
|
|
248
|
+
L || (L = setTimeout(
|
|
229
249
|
() => {
|
|
230
|
-
|
|
250
|
+
L = null, H();
|
|
231
251
|
},
|
|
232
252
|
Math.floor(E() * k)
|
|
233
253
|
));
|
|
234
254
|
};
|
|
235
|
-
let P = ((
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
}),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
255
|
+
let P = ((Z = s.status) == null ? void 0 : Z.call(s).state) !== "reconnecting";
|
|
256
|
+
const V = (ee = s.onStatus) == null ? void 0 : ee.call(s, (e) => {
|
|
257
|
+
const n = e.state === "live";
|
|
258
|
+
n && !P && (e.resumed === "unverified" || e.resumed === void 0) && z(), P = n;
|
|
259
|
+
}), we = /* @__PURE__ */ new Set([...Le, ...o.resyncHeads ?? []]), X = () => {
|
|
260
|
+
h || le() === "off" || t.invalidateQueries(
|
|
261
|
+
{
|
|
262
|
+
predicate: (e) => e.getObserversCount() > 0 && we.has(String(e.queryKey[0]))
|
|
263
|
+
},
|
|
264
|
+
{ cancelRefetch: !1 }
|
|
265
|
+
);
|
|
266
|
+
}, B = o.onResync === null ? void 0 : o.onResync ? o.onResync(X) : Re(s, X), $ = () => z(), S = o.reconcileOnCatchupFull === !1 ? null : y;
|
|
267
|
+
S == null || S.addEventListener("nvr:catchup-full", $);
|
|
268
|
+
let x = u != null && u.hidden ? d() : null;
|
|
269
|
+
const J = () => {
|
|
243
270
|
if (!u) return;
|
|
244
271
|
if (u.hidden) {
|
|
245
|
-
|
|
272
|
+
x ?? (x = d());
|
|
246
273
|
return;
|
|
247
274
|
}
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
|
|
275
|
+
const e = x == null ? 0 : d() - x;
|
|
276
|
+
if (x = null, e >= R) {
|
|
277
|
+
H();
|
|
251
278
|
return;
|
|
252
279
|
}
|
|
253
|
-
const
|
|
254
|
-
|
|
280
|
+
const n = [...j].filter((i) => i.getObserversCount() > 0);
|
|
281
|
+
j.clear(), N(n, !1);
|
|
255
282
|
};
|
|
256
|
-
return u == null || u.addEventListener("visibilitychange",
|
|
257
|
-
reconcile:
|
|
258
|
-
collections: () => [...
|
|
259
|
-
stats: () => ({ ...
|
|
283
|
+
return u == null || u.addEventListener("visibilitychange", J), ue(t, 1), K(), {
|
|
284
|
+
reconcile: H,
|
|
285
|
+
collections: () => [...p.keys()],
|
|
286
|
+
stats: () => ({ ...C }),
|
|
260
287
|
dispose() {
|
|
261
|
-
if (!
|
|
262
|
-
|
|
263
|
-
for (const
|
|
264
|
-
...
|
|
265
|
-
...M.values(),
|
|
288
|
+
if (!h) {
|
|
289
|
+
h = !0, he(), V == null || V(), B == null || B(), S == null || S.removeEventListener("nvr:catchup-full", $), u == null || u.removeEventListener("visibilitychange", J);
|
|
290
|
+
for (const e of [
|
|
291
|
+
..._.values(),
|
|
266
292
|
...b.values(),
|
|
293
|
+
...M.values(),
|
|
267
294
|
...I.values()
|
|
268
295
|
])
|
|
269
|
-
clearTimeout(
|
|
270
|
-
|
|
271
|
-
for (const
|
|
272
|
-
|
|
296
|
+
clearTimeout(e);
|
|
297
|
+
L && clearTimeout(L);
|
|
298
|
+
for (const e of p.values()) e();
|
|
299
|
+
p.clear(), ue(t, -1);
|
|
273
300
|
}
|
|
274
301
|
}
|
|
275
302
|
};
|
|
276
303
|
}
|
|
277
|
-
function
|
|
278
|
-
const s =
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}, [s]),
|
|
282
|
-
if (!
|
|
283
|
-
const v =
|
|
304
|
+
function Fe(t) {
|
|
305
|
+
const s = ae(), o = fe(), a = me(t);
|
|
306
|
+
ce(() => {
|
|
307
|
+
Ee(s);
|
|
308
|
+
}, [s]), ce(() => {
|
|
309
|
+
if (!o) return;
|
|
310
|
+
const v = Qe(s, o, a.current);
|
|
284
311
|
return () => v.dispose();
|
|
285
|
-
}, [s,
|
|
312
|
+
}, [s, o]);
|
|
286
313
|
}
|
|
287
|
-
function
|
|
288
|
-
const
|
|
289
|
-
return
|
|
290
|
-
(s) => (
|
|
291
|
-
|
|
314
|
+
function Ae() {
|
|
315
|
+
const t = ae();
|
|
316
|
+
return ye(
|
|
317
|
+
(s) => (F.add(s), () => {
|
|
318
|
+
F.delete(s);
|
|
292
319
|
}),
|
|
293
|
-
() =>
|
|
320
|
+
() => q.has(t),
|
|
294
321
|
() => !1
|
|
295
322
|
);
|
|
296
323
|
}
|
|
297
|
-
function
|
|
298
|
-
const
|
|
299
|
-
return
|
|
324
|
+
function Ke(t, s = {}) {
|
|
325
|
+
const o = fe(), a = Oe(), v = Ae(), R = s.enabled !== !1 && !!o && (a == null ? void 0 : a.state) !== "reconnecting" && (!s.requireBridge || v);
|
|
326
|
+
return _e(R, t, s.safetyMs);
|
|
300
327
|
}
|
|
301
|
-
function
|
|
302
|
-
return !
|
|
328
|
+
function _e(t, s, o = Me) {
|
|
329
|
+
return !t || s == null || s === !1 ? s : Math.max(s, o);
|
|
303
330
|
}
|
|
304
331
|
export {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
332
|
+
Ce as LIVE_RECONCILE_HEADS,
|
|
333
|
+
Le as LIVE_RESYNC_HEADS,
|
|
334
|
+
Qe as createLiveQueryBridge,
|
|
335
|
+
Te as liveCollectionsOf,
|
|
336
|
+
ke as liveEventsMatch,
|
|
337
|
+
Be as liveQueryMeta,
|
|
338
|
+
_e as liveRefetchInterval,
|
|
339
|
+
Ae as useLiveQueriesOn,
|
|
340
|
+
Fe as useLiveQueryBridge,
|
|
341
|
+
Ke as useLiveRefetchInterval
|
|
314
342
|
};
|