@nivaro/react 0.2.54 → 0.2.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. package/package.json +1 -1
@@ -1,53 +1,54 @@
1
1
  import { endSessionRecording as $, appendSessionRecordingEvents as X, sessionRecordingEnabled as ce, startSessionRecording as T } from "@nivaro/sdk";
2
2
  import { useRef as de, useEffect as fe } from "react";
3
- import { sessionStore as pe, sharedChunkStore as he, ReplayUploader as me, clearResume as P, ORPHAN_TTL_MS as we, readResume as ve, isResumable as ge, splitBySize as Z, writeResume as ye, KEEPALIVE_CHUNK_BYTES as be, CHUNK_BYTES as Re, backoffDelay as Se } from "./replayUploadQueue.js";
4
- import { useAutoRecord as Ee } from "./useAutoRecord.js";
5
- import { useOptionalNivaroClient as ke } from "../shared/context.js";
3
+ import { sessionStore as pe, sharedChunkStore as me, ReplayUploader as he, clearResume as P, ORPHAN_TTL_MS as we, readResume as ge, isResumable as ve, splitBySize as Z, writeResume as ye, KEEPALIVE_CHUNK_BYTES as be, CHUNK_BYTES as Re, backoffDelay as Se } from "./replayUploadQueue.js";
4
+ import { useAutoRecord as ke } from "./useAutoRecord.js";
5
+ import { useOptionalNivaroClient as Ee } from "../shared/context.js";
6
6
  import { normalizeReplayMasking as B, buildReplayMaskingOptions as z } from "../shared/lib/replay-masking.js";
7
7
  import { normalizeReplaySampling as x, replaySampleDraw as Ae, currentReplayRoute as _, isReplayRouteSampled as Y, attributeChunkRoutes as ee } from "../shared/lib/replay-sampling.js";
8
8
  import { emitReplayTap as Ce, setReplayRecorderMode as N, registerReplayCapture as Ie, clipEndOffset as _e, withClipKind as De } from "../shared/lib/replay-capture.js";
9
9
  import { instrumentConsole as qe, instrumentRequests as Le, redactSecrets as Te } from "../shared/lib/replay-context.js";
10
- const Pe = "nivaro-react@0.2.54", j = 1e4, Ne = 150, Me = 3e3, Oe = 600, Ue = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
11
- function We(n) {
12
- return typeof n.url != "string" || typeof fetch != "function" ? null : (d, u) => {
13
- const c = typeof n.getToken == "function" ? n.getToken() : void 0, a = { "Content-Type": "application/json" };
14
- return c && (a.Authorization = `Bearer ${c}`), fetch(`${n.url}/api/session-recordings/${d}/events`, {
10
+ import { instrumentSocket as Pe } from "../shared/lib/replay-socket.js";
11
+ const Ne = "nivaro-react@0.2.55", j = 1e4, Me = 150, Oe = 3e3, Ue = 600, We = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
+ function Fe(n) {
13
+ return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
14
+ const l = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
15
+ return l && (d.Authorization = `Bearer ${l}`), fetch(`${n.url}/api/session-recordings/${f}/events`, {
15
16
  method: "POST",
16
17
  keepalive: !0,
17
- credentials: c ? "omit" : "include",
18
- headers: a,
19
- body: u
18
+ credentials: l ? "omit" : "include",
19
+ headers: d,
20
+ body: a
20
21
  });
21
22
  };
22
23
  }
23
- async function Fe(n, d, u, c, a) {
24
- var l;
25
- const p = Z(c), { routes: R } = ee(p, a.startRoute);
26
- for (const [e, y] of p.entries()) {
27
- const m = u();
24
+ async function He(n, f, a, l, d) {
25
+ var u;
26
+ const c = Z(l), { routes: R } = ee(c, d.startRoute);
27
+ for (const [e, y] of c.entries()) {
28
+ const h = a();
28
29
  try {
29
30
  await n.request(
30
- X(d, m, y, {
31
+ X(f, h, y, {
31
32
  route: R[e],
32
- ...a.build ? { build: a.build } : {}
33
+ ...d.build ? { build: d.build } : {}
33
34
  })
34
35
  );
35
- } catch (g) {
36
- const b = g.status ?? ((l = g.response) == null ? void 0 : l.status);
36
+ } catch (v) {
37
+ const b = v.status ?? ((u = v.response) == null ? void 0 : u.status);
37
38
  if (b === 409) return "closed";
38
- b === 413 && console.warn(`[session-recorder] chunk ${m} too large — dropped`);
39
+ b === 413 && console.warn(`[session-recorder] chunk ${h} too large — dropped`);
39
40
  }
40
41
  }
41
42
  return "ok";
42
43
  }
43
- const He = 3e4, Ke = 3e4;
44
- let J = !1, v = null, E = null;
45
- async function $e(n = "error") {
46
- if (!E) return null;
44
+ const Ke = 3e4, $e = 3e4;
45
+ let J = !1, g = null, k = null;
46
+ async function Be(n = "error") {
47
+ if (!k) return null;
47
48
  try {
48
49
  return await Promise.race([
49
- E(n),
50
- new Promise((d) => setTimeout(() => d(null), 4e3))
50
+ k(n),
51
+ new Promise((f) => setTimeout(() => f(null), 4e3))
51
52
  ]);
52
53
  } catch {
53
54
  return null;
@@ -62,27 +63,27 @@ async function Q() {
62
63
  )), null;
63
64
  }
64
65
  }
65
- function V(n, d) {
66
- const u = qe(n), c = Le(n), a = () => {
67
- d == null || d();
66
+ function V(n, f) {
67
+ const a = qe(n), l = Le(n), d = Pe(n), c = () => {
68
+ f == null || f();
68
69
  try {
69
70
  n("route", {
70
71
  path: Te(window.location.pathname + window.location.search)
71
72
  });
72
73
  } catch {
73
74
  }
74
- }, p = history.pushState.bind(history), R = history.replaceState.bind(history);
75
- return history.pushState = (...l) => {
76
- p(...l), a();
77
- }, history.replaceState = (...l) => {
78
- R(...l), a();
79
- }, window.addEventListener("popstate", a), a(), () => {
80
- u(), c(), history.pushState = p, history.replaceState = R, window.removeEventListener("popstate", a);
75
+ }, R = history.pushState.bind(history), u = history.replaceState.bind(history);
76
+ return history.pushState = (...e) => {
77
+ R(...e), c();
78
+ }, history.replaceState = (...e) => {
79
+ u(...e), c();
80
+ }, window.addEventListener("popstate", c), c(), () => {
81
+ a(), l(), d(), history.pushState = R, history.replaceState = u, window.removeEventListener("popstate", c);
81
82
  };
82
83
  }
83
- function Xe(n = {}) {
84
- const d = ke(), u = n.client ?? d, c = n.app, a = n.disabled ?? !1, p = n.build ?? Pe;
85
- Ee({ client: u, disabled: a });
84
+ function et(n = {}) {
85
+ const f = Ee(), a = n.client ?? f, l = n.app, d = n.disabled ?? !1, c = n.build ?? Ne;
86
+ ke({ client: a, disabled: d });
86
87
  const R = de({
87
88
  buffer: [],
88
89
  stop: null,
@@ -100,22 +101,22 @@ function Xe(n = {}) {
100
101
  sampled: !0
101
102
  });
102
103
  fe(() => {
103
- if (!u || a || typeof window > "u") return;
104
- let l = !1;
104
+ if (!a || d || typeof window > "u") return;
105
+ let u = !1;
105
106
  const e = R.current;
106
107
  e.dead = !1;
107
- const y = u, m = pe(), g = Ue(c), b = he(), k = We(y), te = async (t, r, i, h, s = {}) => {
108
- if (!h || !k) {
108
+ const y = a, h = pe(), v = We(l), b = me(), E = Fe(y), te = async (t, r, i, m, s = {}) => {
109
+ if (!m || !E) {
109
110
  await y.request(X(t, r, i, s));
110
111
  return;
111
112
  }
112
- const f = await k(t, JSON.stringify({ seq: r, events: i, ...s }));
113
- if (!f.ok) throw Object.assign(new Error(`HTTP ${f.status}`), { status: f.status });
114
- }, o = new me({ store: b, send: te, online: G });
113
+ const p = await E(t, JSON.stringify({ seq: r, events: i, ...s }));
114
+ if (!p.ok) throw Object.assign(new Error(`HTTP ${p.status}`), { status: p.status });
115
+ }, o = new he({ store: b, send: te, online: G });
115
116
  let S = null, A = 0;
116
- const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >= Me;
117
+ const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >= Oe;
117
118
  function C() {
118
- o.recordingId && ye(m, g, {
119
+ o.recordingId && ye(h, v, {
119
120
  recordingId: o.recordingId,
120
121
  nextSeq: o.nextSeq,
121
122
  startedAt: e.startedAt,
@@ -134,25 +135,25 @@ function Xe(n = {}) {
134
135
  }
135
136
  function M() {
136
137
  var t;
137
- e.dead = !0, (t = e.stop) == null || t.call(e), I(), o.discard(), P(m, g);
138
+ e.dead = !0, (t = e.stop) == null || t.call(e), I(), o.discard(), P(h, v);
138
139
  }
139
140
  function O(t) {
140
141
  if (e.buffer.length === 0 || !o.recordingId) return;
141
142
  const r = e.buffer;
142
143
  e.buffer = [];
143
- const i = Z(r, t ? be : Re), { routes: h } = ee(i, e.bufferRoute);
144
- for (const [s, f] of i.entries())
145
- o.enqueue(f, { route: h[s], ...p ? { build: p } : {} });
144
+ const i = Z(r, t ? be : Re), { routes: m } = ee(i, e.bufferRoute);
145
+ for (const [s, p] of i.entries())
146
+ o.enqueue(p, { route: m[s], ...c ? { build: c } : {} });
146
147
  C();
147
148
  }
148
149
  async function oe(t) {
149
- if (!l) {
150
+ if (!u) {
150
151
  if (t === "retry") ne();
151
152
  else if (t === "closed" || t === "abandoned") M();
152
153
  else if (t === "stale")
153
154
  try {
154
- const r = await y.request(T(c));
155
- if (l) return;
155
+ const r = await y.request(T(l));
156
+ if (u) return;
156
157
  o.rebase(r.data.id), e.startedAt = Date.now(), C(), e.flushAfter = !0;
157
158
  } catch {
158
159
  M();
@@ -160,7 +161,7 @@ function Xe(n = {}) {
160
161
  }
161
162
  }
162
163
  function w(t = !1, r = !1) {
163
- return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length < Oe || (O(r), !o.hasPending() || Date.now() < A) ? Promise.resolve() : (e.inFlight = o.drain(r).then(oe).catch(() => {
164
+ return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length < Ue || (O(r), !o.hasPending() || Date.now() < A) ? Promise.resolve() : (e.inFlight = o.drain(r).then(oe).catch(() => {
164
165
  }).finally(() => {
165
166
  e.inFlight = null, e.flushAfter && (e.flushAfter = !1, w(!0));
166
167
  }), e.inFlight);
@@ -171,29 +172,29 @@ function Xe(n = {}) {
171
172
  }
172
173
  async function ie() {
173
174
  const t = await Q();
174
- if (l || !t) return;
175
+ if (u || !t) return;
175
176
  b.prune(Date.now() - we);
176
- const r = ve(m, g);
177
- if (r && ge(r, Date.now())) {
177
+ const r = ge(h, v);
178
+ if (r && ve(r, Date.now())) {
178
179
  const s = await b.list(r.recordingId);
179
- if (l) return;
180
+ if (u) return;
180
181
  o.begin(r.recordingId, r.nextSeq, { trusted: !1, restored: s }), e.startedAt = r.startedAt;
181
182
  } else {
182
- r && (b.clear(r.recordingId), P(m, g));
183
- const s = await y.request(T(c));
184
- if (l) return;
183
+ r && (b.clear(r.recordingId), P(h, v));
184
+ const s = await y.request(T(l));
185
+ if (u) return;
185
186
  o.begin(s.data.id), e.startedAt = Date.now();
186
187
  }
187
188
  C(), e.lastNavAt = Date.now();
188
- const i = Ae(m);
189
+ const i = Ae(h);
189
190
  e.route = _(), e.bufferRoute = e.route, e.sampled = Y(q, e.route, i);
190
- const h = () => {
191
- var f;
191
+ const m = () => {
192
+ var p;
192
193
  e.route = _();
193
194
  const s = e.sampled;
194
195
  if (e.sampled = Y(q, e.route, i), e.sampled && !s)
195
196
  try {
196
- (f = t.takeFullSnapshot) == null || f.call(
197
+ (p = t.takeFullSnapshot) == null || p.call(
197
198
  t,
198
199
  !0
199
200
  );
@@ -202,24 +203,24 @@ function Xe(n = {}) {
202
203
  };
203
204
  e.stop = t({
204
205
  emit(s) {
205
- e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >= Ne && U());
206
+ e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >= Me && U());
206
207
  },
207
208
  ...z(() => D),
208
209
  checkoutEveryNms: 6e4
209
210
  }) ?? null, e.uninstrument = V(
210
- (s, f) => t.addCustomEvent(
211
+ (s, p) => t.addCustomEvent(
211
212
  s,
212
- f
213
+ p
213
214
  ),
214
215
  () => {
215
- e.lastNavAt = Date.now(), h();
216
+ e.lastNavAt = Date.now(), m();
216
217
  }
217
- ), E = async () => {
218
+ ), k = async () => {
218
219
  if (!o.recordingId) return null;
219
220
  const s = Date.now() - e.startedAt;
220
221
  return await w(!0).catch(() => {
221
222
  }), o.recordingId ? { recording_id: o.recordingId, offset_ms: s } : null;
222
- }, N("full"), v = () => {
223
+ }, N("full"), g = () => {
223
224
  if (!o.recordingId) return null;
224
225
  const s = Date.now() - e.startedAt;
225
226
  return async () => (await w(!0).catch(() => {
@@ -228,12 +229,12 @@ function Xe(n = {}) {
228
229
  }
229
230
  async function se() {
230
231
  const t = await Q();
231
- l || !t || (e.buffer = [], e.prevWindow = [], e.route = _(), e.bufferRoute = e.route, e.prevWindowRoute = e.route, e.stop = t({
232
+ u || !t || (e.buffer = [], e.prevWindow = [], e.route = _(), e.bufferRoute = e.route, e.prevWindowRoute = e.route, e.stop = t({
232
233
  emit(r, i) {
233
234
  Ce(r), i ? (e.prevWindow = e.buffer, e.prevWindowRoute = e.bufferRoute, e.buffer = [r], e.bufferRoute = e.route) : e.buffer.push(r);
234
235
  },
235
236
  ...z(() => D),
236
- checkoutEveryNms: He
237
+ checkoutEveryNms: Ke
237
238
  }) ?? null, e.uninstrument = V(
238
239
  (r, i) => t.addCustomEvent(
239
240
  r,
@@ -242,35 +243,35 @@ function Xe(n = {}) {
242
243
  () => {
243
244
  e.route = _();
244
245
  }
245
- ), N("clip"), v = (r) => {
246
- const i = [...e.prevWindow, ...e.buffer], h = e.prevWindow.length > 0 ? e.prevWindowRoute : e.bufferRoute;
247
- if (i.length === 0 || !u) return null;
246
+ ), N("clip"), g = (r) => {
247
+ const i = [...e.prevWindow, ...e.buffer], m = e.prevWindow.length > 0 ? e.prevWindowRoute : e.bufferRoute;
248
+ if (i.length === 0 || !a) return null;
248
249
  const s = _e(i, r);
249
250
  return async () => {
250
- const L = (await u.request(
251
- De(T(c ?? "error-clip", void 0, !0), r)
251
+ const L = (await a.request(
252
+ De(T(l ?? "error-clip", void 0, !0), r)
252
253
  )).data.id;
253
254
  let le = 0;
254
- return await Fe(u, L, () => le++, i, { startRoute: h, build: p }), await u.request($(L)).catch(() => {
255
+ return await He(a, L, () => le++, i, { startRoute: m, build: c }), await a.request($(L)).catch(() => {
255
256
  }), { recording_id: L, offset_ms: s };
256
257
  };
257
- }, E = async (r) => {
258
+ }, k = async (r) => {
258
259
  if (r === "error") {
259
- if (e.lastClip && Date.now() - e.lastClip.at < Ke)
260
+ if (e.lastClip && Date.now() - e.lastClip.at < $e)
260
261
  return e.lastClip.link;
261
262
  e.lastClip = { at: Date.now(), link: null };
262
263
  }
263
- const i = v == null ? void 0 : v(r);
264
+ const i = g == null ? void 0 : g(r);
264
265
  if (!i) return null;
265
- const h = await i();
266
- return r === "error" && (e.lastClip = { at: Date.now(), link: h }), h;
266
+ const m = await i();
267
+ return r === "error" && (e.lastClip = { at: Date.now(), link: m }), m;
267
268
  });
268
269
  }
269
270
  let W = !1, D = B(null), q = x(null);
270
271
  async function ae() {
271
272
  try {
272
- const t = await u.request(ce());
273
- if (l) return;
273
+ const t = await a.request(ce());
274
+ if (u) return;
274
275
  D = B(t.data.masking), q = x(t.data.sampling);
275
276
  const r = t.data.cap_reached === !0;
276
277
  W = t.data.enabled === !0 && !r;
@@ -285,10 +286,10 @@ function Xe(n = {}) {
285
286
  };
286
287
  document.addEventListener("visibilitychange", F);
287
288
  const H = () => {
288
- if (!(e.dead || !o.recordingId) && (O(!0), C(), !(!G() || !k)))
289
+ if (!(e.dead || !o.recordingId) && (O(!0), C(), !(!G() || !E)))
289
290
  for (const { chunk: t, body: r } of o.keepaliveBatch())
290
291
  try {
291
- k(t.recordingId, r).catch(() => {
292
+ E(t.recordingId, r).catch(() => {
292
293
  });
293
294
  } catch {
294
295
  }
@@ -299,19 +300,19 @@ function Xe(n = {}) {
299
300
  };
300
301
  return window.addEventListener("online", K), () => {
301
302
  var t, r;
302
- l = !0, E = null, v = null, N(null), document.removeEventListener("visibilitychange", F), window.removeEventListener("pagehide", H), window.removeEventListener("online", K), clearInterval(ue), I(), (t = e.uninstrument) == null || t.call(e), e.uninstrument = null, (r = e.stop) == null || r.call(e), e.stop = null, e.prevWindow = [], w(!0).then(() => {
303
+ u = !0, k = null, g = null, N(null), document.removeEventListener("visibilitychange", F), window.removeEventListener("pagehide", H), window.removeEventListener("online", K), clearInterval(ue), I(), (t = e.uninstrument) == null || t.call(e), e.uninstrument = null, (r = e.stop) == null || r.call(e), e.stop = null, e.prevWindow = [], w(!0).then(() => {
303
304
  const i = o.recordingId;
304
305
  i && (e.dead || y.request($(i)).catch(() => {
305
- }), o.discard(), o.recordingId = null, P(m, g));
306
+ }), o.discard(), o.recordingId = null, P(h, v));
306
307
  });
307
308
  };
308
- }, [u, a, c, p]);
309
+ }, [a, d, l, c]);
309
310
  }
310
311
  Ie(
311
- (n) => $e(n),
312
- (n) => (v == null ? void 0 : v(n)) ?? null
312
+ (n) => Be(n),
313
+ (n) => (g == null ? void 0 : g(n)) ?? null
313
314
  );
314
315
  export {
315
- $e as captureErrorClip,
316
- Xe as useSessionRecorder
316
+ Be as captureErrorClip,
317
+ et as useSessionRecorder
317
318
  };