@nivaro/react 0.3.117 → 0.3.119
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 +136 -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 +3757 -3695
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4451 -4385
- 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/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/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/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 +135 -94
- 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 +88 -85
- 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 +245 -141
- 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 +15 -16
- 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/addendum-view.js +6 -0
- 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 +151 -130
- 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/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- 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/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -4,78 +4,78 @@ import { DEFAULT_REPLAY_MASKING as Y, normalizeReplayMasking as z, buildReplayMa
|
|
|
4
4
|
const J = 6e4, X = 200, G = 1e4, K = 24e6, L = /* @__PURE__ */ new Set([2, 3, 4]), Q = 2, V = 4;
|
|
5
5
|
let v = null;
|
|
6
6
|
function oe(e) {
|
|
7
|
-
return v = e,
|
|
8
|
-
v === e && (v = null,
|
|
7
|
+
return v = e, _(), () => {
|
|
8
|
+
v === e && (v = null, _());
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
function ie() {
|
|
12
12
|
return v;
|
|
13
13
|
}
|
|
14
14
|
function W(e) {
|
|
15
|
-
return e.filter((
|
|
15
|
+
return e.filter((a) => L.has(Number(a == null ? void 0 : a.type)));
|
|
16
16
|
}
|
|
17
|
-
function Z(e,
|
|
18
|
-
const n = JSON.stringify(
|
|
19
|
-
for (let
|
|
20
|
-
|
|
21
|
-
return
|
|
17
|
+
function Z(e, a, r = J) {
|
|
18
|
+
const n = JSON.stringify(a), c = Math.max(1, Math.ceil(n.length / r)), o = [];
|
|
19
|
+
for (let u = 0; u < c; u++)
|
|
20
|
+
o.push({ seq: e, part: u, parts: c, data: n.slice(u * r, (u + 1) * r) });
|
|
21
|
+
return o;
|
|
22
22
|
}
|
|
23
23
|
function ae() {
|
|
24
24
|
const e = /* @__PURE__ */ new Map();
|
|
25
|
-
let
|
|
25
|
+
let a = -1, r = !0;
|
|
26
26
|
return {
|
|
27
27
|
/** Feed one part; returns the events to play now (maybe none) and whether a gap was seen. */
|
|
28
28
|
push(n) {
|
|
29
29
|
const c = { events: [], gap: !1, snapshot: !1 };
|
|
30
|
-
if (!Number.isSafeInteger(n.seq) || n.seq <=
|
|
31
|
-
let
|
|
32
|
-
if (
|
|
33
|
-
for (const
|
|
30
|
+
if (!Number.isSafeInteger(n.seq) || n.seq <= a - 1e3) return c;
|
|
31
|
+
let o = e.get(n.seq);
|
|
32
|
+
if (o || (o = { parts: n.parts, got: /* @__PURE__ */ new Map() }, e.set(n.seq, o)), o.got.set(n.part, n.data), o.got.size < o.parts) {
|
|
33
|
+
for (const s of [...e.keys()]) s < n.seq - 50 && e.delete(s);
|
|
34
34
|
return c;
|
|
35
35
|
}
|
|
36
36
|
e.delete(n.seq);
|
|
37
|
-
let
|
|
37
|
+
let u;
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const s = Array.from({ length: o.parts }, (S, m) => (o == null ? void 0 : o.got.get(m)) ?? "").join(""), i = JSON.parse(s);
|
|
40
|
+
u = Array.isArray(i) ? i : [];
|
|
41
41
|
} catch {
|
|
42
|
-
|
|
42
|
+
u = [];
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
n.seq >
|
|
46
|
-
const f =
|
|
47
|
-
if (
|
|
48
|
-
if (f < 0) return { events: [], gap:
|
|
44
|
+
const g = a >= 0 && n.seq !== a + 1;
|
|
45
|
+
n.seq > a && (a = n.seq), u = W(u);
|
|
46
|
+
const f = u.findIndex((s) => Number(s.type) === Q);
|
|
47
|
+
if (g && (r = !0), r) {
|
|
48
|
+
if (f < 0) return { events: [], gap: g, snapshot: !1 };
|
|
49
49
|
r = !1;
|
|
50
|
-
let
|
|
51
|
-
for (let
|
|
52
|
-
if (Number(
|
|
53
|
-
|
|
50
|
+
let s = -1;
|
|
51
|
+
for (let i = f - 1; i >= 0; i--)
|
|
52
|
+
if (Number(u[i].type) === V) {
|
|
53
|
+
s = i;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
|
-
return { events:
|
|
56
|
+
return { events: u.slice(s >= 0 ? s : f), gap: g, snapshot: !0 };
|
|
57
57
|
}
|
|
58
|
-
return { events:
|
|
58
|
+
return { events: u, gap: g, snapshot: f >= 0 };
|
|
59
59
|
},
|
|
60
60
|
reset() {
|
|
61
|
-
e.clear(),
|
|
61
|
+
e.clear(), a = -1, r = !0;
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
let p = null;
|
|
66
|
-
const
|
|
67
|
-
function
|
|
68
|
-
for (const e of
|
|
66
|
+
const T = /* @__PURE__ */ new Set();
|
|
67
|
+
function _() {
|
|
68
|
+
for (const e of T) e();
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
p = e,
|
|
70
|
+
function E(e) {
|
|
71
|
+
p = e, _();
|
|
72
72
|
}
|
|
73
73
|
function ee() {
|
|
74
74
|
return p;
|
|
75
75
|
}
|
|
76
76
|
function F(e) {
|
|
77
|
-
return
|
|
78
|
-
|
|
77
|
+
return T.add(e), () => {
|
|
78
|
+
T.delete(e);
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
function ue() {
|
|
@@ -88,9 +88,9 @@ function ce() {
|
|
|
88
88
|
() => !1
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
let
|
|
91
|
+
let q = null;
|
|
92
92
|
function le() {
|
|
93
|
-
|
|
93
|
+
q == null || q.stop("stopped");
|
|
94
94
|
}
|
|
95
95
|
const R = {
|
|
96
96
|
stopped: "You stopped sharing",
|
|
@@ -103,42 +103,42 @@ const R = {
|
|
|
103
103
|
gone: "Sharing stopped"
|
|
104
104
|
};
|
|
105
105
|
async function fe(e) {
|
|
106
|
-
const
|
|
107
|
-
if (!
|
|
108
|
-
const r = await
|
|
106
|
+
const a = e.runtime ?? v;
|
|
107
|
+
if (!a || q) return !1;
|
|
108
|
+
const r = await a.loadRecord().catch(() => null);
|
|
109
109
|
if (!r) return !1;
|
|
110
|
-
const { share: n, transport: c } = e,
|
|
111
|
-
let f = !1,
|
|
112
|
-
const
|
|
113
|
-
!f ||
|
|
114
|
-
},
|
|
115
|
-
if (
|
|
116
|
-
const t =
|
|
117
|
-
t && (m -= t.data.length, c.emit("screenshare:frame", { ticket: n.ticket, share: n.id, ...t }),
|
|
110
|
+
const { share: n, transport: c } = e, o = e.now ?? Date.now, u = e.win === void 0 ? typeof window < "u" ? window : null : e.win, g = e.masking == null ? Y : z(e.masking);
|
|
111
|
+
let f = !1, s = [], i = 0, S = [], m = 0, h = null, l = null, w = !1;
|
|
112
|
+
const k = [], x = (t) => {
|
|
113
|
+
!f || w || L.has(Number(t == null ? void 0 : t.type)) && s.push(t);
|
|
114
|
+
}, M = () => {
|
|
115
|
+
if (h = null, w) return;
|
|
116
|
+
const t = S.shift();
|
|
117
|
+
t && (m -= t.data.length, c.emit("screenshare:frame", { ticket: n.ticket, share: n.id, ...t }), h = setTimeout(M, Math.max(16, Math.round(t.data.length / 1e3))));
|
|
118
118
|
}, I = () => {
|
|
119
|
-
if (
|
|
120
|
-
const t =
|
|
121
|
-
|
|
122
|
-
const d = Z(
|
|
123
|
-
for (const
|
|
124
|
-
|
|
125
|
-
m > K && (
|
|
126
|
-
},
|
|
119
|
+
if (w || s.length === 0) return;
|
|
120
|
+
const t = s;
|
|
121
|
+
s = [];
|
|
122
|
+
const d = Z(i++, t);
|
|
123
|
+
for (const y of d)
|
|
124
|
+
S.push(y), m += y.data.length;
|
|
125
|
+
m > K && (S = [], m = 0), h || M();
|
|
126
|
+
}, U = async () => {
|
|
127
127
|
var t, d;
|
|
128
|
-
if (!
|
|
128
|
+
if (!w) {
|
|
129
129
|
f = !0;
|
|
130
130
|
try {
|
|
131
|
-
const
|
|
132
|
-
|
|
131
|
+
const y = O();
|
|
132
|
+
l ? (d = r.takeFullSnapshot) == null || d.call(r, !0) : y === "full" || y === "clip" ? (l = j(x), (t = r.takeFullSnapshot) == null || t.call(r, !0)) : l = r({ emit: x, ...B(() => g) }) ?? null;
|
|
133
133
|
} catch {
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
},
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
for (const D of
|
|
136
|
+
}, A = (t, d) => {
|
|
137
|
+
if (w) return;
|
|
138
|
+
w = !0, f = !1, q = null, clearInterval(C), clearInterval(H), clearTimeout(P), h && clearTimeout(h), S = [], s = [];
|
|
139
|
+
for (const D of k) D();
|
|
140
140
|
try {
|
|
141
|
-
|
|
141
|
+
l == null || l();
|
|
142
142
|
} catch {
|
|
143
143
|
}
|
|
144
144
|
if (t !== "ended")
|
|
@@ -149,68 +149,72 @@ async function fe(e) {
|
|
|
149
149
|
});
|
|
150
150
|
} catch {
|
|
151
151
|
}
|
|
152
|
-
|
|
153
|
-
(p == null ? void 0 : p.share.id) === n.id && p.ended &&
|
|
152
|
+
E({ share: n, watching: [], ended: R[t === "ended" ? d ?? "gone" : t] ?? R.gone }), setTimeout(() => {
|
|
153
|
+
(p == null ? void 0 : p.share.id) === n.id && p.ended && E(null);
|
|
154
154
|
}, 4e3);
|
|
155
|
-
},
|
|
156
|
-
if (
|
|
155
|
+
}, b = (t) => !!t && Number(t.ticket) === n.ticket && t.share === n.id;
|
|
156
|
+
if (k.push(
|
|
157
157
|
c.on("screenshare:snapshot", (t) => {
|
|
158
|
-
|
|
158
|
+
b(t) && U();
|
|
159
159
|
}),
|
|
160
160
|
c.on("screenshare:watching", (t) => {
|
|
161
|
-
if (!
|
|
162
|
-
const d = Array.isArray(t.names) ? t.names.filter((
|
|
163
|
-
d.length === 0 && (f = !1), (p == null ? void 0 : p.share.id) === n.id && !p.ended &&
|
|
161
|
+
if (!b(t)) return;
|
|
162
|
+
const d = Array.isArray(t.names) ? t.names.filter((y) => typeof y == "string") : [];
|
|
163
|
+
d.length === 0 && (f = !1), (p == null ? void 0 : p.share.id) === n.id && !p.ended && E({ ...p, watching: d });
|
|
164
164
|
}),
|
|
165
165
|
c.on("screenshare:ended", (t) => {
|
|
166
|
-
|
|
166
|
+
b(t) && A("ended", typeof t.reason == "string" ? t.reason : void 0);
|
|
167
167
|
})
|
|
168
|
-
),
|
|
168
|
+
), u) {
|
|
169
169
|
const t = (d) => {
|
|
170
|
-
d.persisted ||
|
|
170
|
+
d.persisted || A("page");
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
u.addEventListener("pagehide", t), k.push(() => u.removeEventListener("pagehide", t));
|
|
173
173
|
}
|
|
174
|
-
const
|
|
175
|
-
return
|
|
174
|
+
const N = () => c.emit("screenshare:beat", { ticket: n.ticket, share: n.id }), C = setInterval(I, X), H = setInterval(N, G), P = setTimeout(() => A("expired"), Math.max(1e3, n.expires_at - o()));
|
|
175
|
+
return q = { stop: A }, E({ share: n, watching: [], ended: null }), N(), !0;
|
|
176
176
|
}
|
|
177
177
|
function te(e) {
|
|
178
178
|
return /^Stopped sharing/i.test(e) ? null : /page closed/i.test(e) ? "ended when the page closed" : /30 minutes/i.test(e) ? "ended after 30 minutes" : /moved/i.test(e) ? "ended when the request moved" : /request closed/i.test(e) ? "ended when the request closed" : /restarted/i.test(e) ? "restarted" : "ended";
|
|
179
179
|
}
|
|
180
|
-
function he(e,
|
|
180
|
+
function he(e, a) {
|
|
181
181
|
if (e.action !== "support-traffic-view") return { text: e.text, showAuthor: !0 };
|
|
182
182
|
const r = e.user_name ?? "Someone";
|
|
183
|
-
if (
|
|
183
|
+
if (a.isRequester)
|
|
184
184
|
return { text: `${r} looked at your recent activity around this ticket`, showAuthor: !1 };
|
|
185
|
-
const n =
|
|
185
|
+
const n = a.requesterName ? `${a.requesterName}'s` : "the requester’s";
|
|
186
186
|
return { text: `${r} viewed ${n} activity around the ticket`, showAuthor: !1 };
|
|
187
187
|
}
|
|
188
|
-
function de(e) {
|
|
189
|
-
var
|
|
190
|
-
const
|
|
191
|
-
let
|
|
192
|
-
const
|
|
193
|
-
if (!
|
|
194
|
-
const { to:
|
|
195
|
-
|
|
188
|
+
function de(e, a = {}) {
|
|
189
|
+
var g, f;
|
|
190
|
+
const r = [], n = a.requester ? String(a.requester).toUpperCase() : null, c = /* @__PURE__ */ new Set();
|
|
191
|
+
let o = null;
|
|
192
|
+
const u = (s, i, S) => {
|
|
193
|
+
if (!o) return;
|
|
194
|
+
const { to: m, watchers: h } = o, l = [
|
|
195
|
+
S ? `Sharing their screen with ${m} now` : `Shared their screen with ${m}`
|
|
196
196
|
];
|
|
197
|
-
s &&
|
|
198
|
-
const
|
|
199
|
-
|
|
197
|
+
s && l.push(s);
|
|
198
|
+
const w = h.length > 0 && h.every((k) => k === m);
|
|
199
|
+
S ? l.push(h.length ? "watching now" : "not opened yet") : h.length === 0 ? l.push("not watched") : l.push(w ? "watched" : `watched by ${h.join(", ")}`), i && l.push(i), r[o.at] = { ...o.row, text: l.join(" · ") }, o = null;
|
|
200
200
|
};
|
|
201
201
|
for (const s of e)
|
|
202
202
|
if (s.action === "screen-share-start") {
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
} else if (s.action === "screen-share-watch" &&
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
} else if (s.action === "screen-share-stop" &&
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
} else
|
|
213
|
-
|
|
203
|
+
u(null, "restarted", !1);
|
|
204
|
+
const i = ((g = /with (.+)$/.exec(s.text)) == null ? void 0 : g[1]) ?? "support";
|
|
205
|
+
o = { at: r.length, row: s, to: i, watchers: [] }, r.push(s);
|
|
206
|
+
} else if (s.action === "screen-share-watch" && o) {
|
|
207
|
+
const i = s.user_name ?? "someone";
|
|
208
|
+
o.watchers.includes(i) || o.watchers.push(i);
|
|
209
|
+
} else if (s.action === "screen-share-stop" && o) {
|
|
210
|
+
const i = ((f = /\(([^)]+)\)\s*$/.exec(s.text)) == null ? void 0 : f[1]) ?? null;
|
|
211
|
+
u(i, te(s.text), !1);
|
|
212
|
+
} else if (s.action === "support-traffic-view") {
|
|
213
|
+
const i = String(s.user ?? s.user_name ?? "").toUpperCase();
|
|
214
|
+
if (n && i === n || i && c.has(i)) continue;
|
|
215
|
+
i && c.add(i), r.push(s);
|
|
216
|
+
} else r.push(s);
|
|
217
|
+
return u(null, null, !0), r;
|
|
214
218
|
}
|
|
215
219
|
export {
|
|
216
220
|
G as BEAT_MS,
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import { describeError as
|
|
2
|
-
import { partnerWords as
|
|
3
|
-
import { getDisplayTimezone as
|
|
4
|
-
|
|
1
|
+
import { describeError as R } from "./error-message.js";
|
|
2
|
+
import { partnerWords as k, partnerOutcome as I, partnerSaid as U } from "./partner-failure.js";
|
|
3
|
+
import { getDisplayTimezone as v } from "./utils.js";
|
|
4
|
+
const T = "Integrations at the top of the record";
|
|
5
|
+
function A(t, e = Date.now()) {
|
|
5
6
|
const n = t instanceof Date ? t : new Date(t);
|
|
6
7
|
if (Number.isNaN(n.getTime())) return "";
|
|
7
|
-
const r =
|
|
8
|
-
...
|
|
8
|
+
const r = v(), o = r ? { timeZone: r } : {}, i = (c) => new Intl.DateTimeFormat("en-US", {
|
|
9
|
+
...o,
|
|
9
10
|
year: "numeric",
|
|
10
11
|
month: "numeric",
|
|
11
12
|
day: "numeric"
|
|
12
|
-
}).format(
|
|
13
|
-
...
|
|
13
|
+
}).format(c), u = new Intl.DateTimeFormat("en-US", {
|
|
14
|
+
...o,
|
|
14
15
|
hour: "numeric",
|
|
15
16
|
minute: "2-digit"
|
|
16
17
|
}).format(n);
|
|
17
|
-
return
|
|
18
|
+
return i(n) === i(new Date(e)) ? u : `${new Intl.DateTimeFormat("en-US", { ...o, month: "short", day: "numeric" }).format(
|
|
18
19
|
n
|
|
19
|
-
)}, ${
|
|
20
|
+
)}, ${u}`;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function L(t, e = Date.now()) {
|
|
23
|
+
const n = A(t, e);
|
|
24
|
+
if (!n) return "";
|
|
25
|
+
const r = /^(.+), (\d{1,2}:\d{2}\s?[AP]M)$/.exec(n);
|
|
26
|
+
return r ? `on ${r[1]} at ${r[2]}` : `at ${n}`;
|
|
27
|
+
}
|
|
28
|
+
function f(t) {
|
|
22
29
|
if (!Number.isFinite(t) || t < 6e4) return "less than a minute";
|
|
23
30
|
const e = Math.round(t / 6e4);
|
|
24
31
|
if (e < 60) return `${e} minute${e === 1 ? "" : "s"}`;
|
|
@@ -27,106 +34,115 @@ function w(t) {
|
|
|
27
34
|
const r = Math.round(t / 864e5);
|
|
28
35
|
return `${r} day${r === 1 ? "" : "s"}`;
|
|
29
36
|
}
|
|
30
|
-
function
|
|
37
|
+
function z(t) {
|
|
31
38
|
const e = (t ?? "").trim();
|
|
32
39
|
if (!e) return { text: "", quoted: !1 };
|
|
33
|
-
const n = /\bHTTP \d{3}: /.exec(e), r =
|
|
34
|
-
return r ? { text: r.replace(/[\s.,;:]+$/, ""), quoted: !0 } : { text:
|
|
40
|
+
const n = /\bHTTP \d{3}: /.exec(e), r = k(n ? e.slice(n.index) : e);
|
|
41
|
+
return r ? { text: F(r).replace(/[\s.,;:]+$/, ""), quoted: !0 } : { text: S(e), quoted: !1 };
|
|
42
|
+
}
|
|
43
|
+
function F(t) {
|
|
44
|
+
const e = t.replace(
|
|
45
|
+
/(^|[.!]\s*)(please\s+)?contact\s+(support|(the\s+)?help\s*desk|your\s+(system\s+)?administrator|an?\s+administrator)[^.!]*[.!]?\s*$/i,
|
|
46
|
+
"$1"
|
|
47
|
+
);
|
|
48
|
+
return e.trim() ? e.trim() : t;
|
|
35
49
|
}
|
|
36
|
-
function
|
|
50
|
+
function S(t) {
|
|
37
51
|
const e = (t ?? "").trim();
|
|
38
52
|
if (!e) return "";
|
|
39
|
-
const n = /\bHTTP \d{3}: /.exec(e), r =
|
|
40
|
-
return r ? r.replace(/[\s.,;:]+$/, "") :
|
|
53
|
+
const n = /\bHTTP \d{3}: /.exec(e), r = k(n ? e.slice(n.index) : e) ?? I(e) ?? U(e);
|
|
54
|
+
return r ? F(r).replace(/[\s.,;:]+$/, "") : R({ message: e }, "").title.replace(/[\s.,;:]+$/, "");
|
|
41
55
|
}
|
|
42
|
-
const
|
|
43
|
-
function
|
|
44
|
-
var
|
|
45
|
-
const n = e.now ?? Date.now(), r = e.time ?? ((s) =>
|
|
56
|
+
const E = /* @__PURE__ */ new Set(["transient", "rate_limited"]);
|
|
57
|
+
function j(t, e = {}) {
|
|
58
|
+
var _, p, x, N;
|
|
59
|
+
const n = e.now ?? Date.now(), r = e.time ?? ((s) => A(s, n)), o = (s) => e.time ? `at ${e.time(s)}` : L(s, n);
|
|
46
60
|
e.reason;
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
61
|
+
const i = ((_ = t.api) == null ? void 0 : _.trim()) || "the other system", u = (t.status ?? "").toLowerCase(), d = t.finished_at ?? t.started_at;
|
|
62
|
+
if (u === "sending") {
|
|
49
63
|
const s = t.answer_by ? new Date(t.answer_by).getTime() : Number.NaN;
|
|
50
64
|
return Number.isFinite(s) && n > s ? {
|
|
51
65
|
state: "no_answer",
|
|
52
66
|
tone: "held",
|
|
53
|
-
text: `No answer from ${
|
|
67
|
+
text: `No answer from ${i} after ${f(n - new Date(t.started_at).getTime())} — the send is held and will not be repeated automatically. An administrator can mark it received or not received.`
|
|
54
68
|
} : {
|
|
55
69
|
state: "sending",
|
|
56
70
|
tone: "busy",
|
|
57
|
-
text: `Sending to ${
|
|
71
|
+
text: `Sending to ${i} now (started ${r(t.started_at)})`
|
|
58
72
|
};
|
|
59
73
|
}
|
|
60
|
-
if (
|
|
61
|
-
const s = t.usual_answer_ms != null && t.usual_answer_ms > 0 ? ` · usually answers within ${
|
|
74
|
+
if (u === "pending") {
|
|
75
|
+
const s = t.usual_answer_ms != null && t.usual_answer_ms > 0 ? ` · usually answers within ${f(t.usual_answer_ms)}` : "";
|
|
62
76
|
return {
|
|
63
77
|
state: "waiting",
|
|
64
78
|
tone: "waiting",
|
|
65
|
-
text: `Sent to ${
|
|
79
|
+
text: `Sent to ${i} ${o(t.started_at)} — waiting for ${i}'s answer${s}`
|
|
66
80
|
};
|
|
67
81
|
}
|
|
68
|
-
if (
|
|
69
|
-
const s = (
|
|
82
|
+
if (u === "accepted") {
|
|
83
|
+
const s = (p = t.external_ref) == null ? void 0 : p.trim(), h = ((x = t.ref_label) == null ? void 0 : x.trim()) || "reference";
|
|
70
84
|
return {
|
|
71
85
|
state: "accepted",
|
|
72
86
|
tone: "ok",
|
|
73
|
-
text: `${
|
|
87
|
+
text: `${i} accepted it ${o(d)}${s ? ` — ${h} ${s}` : ""}`
|
|
74
88
|
};
|
|
75
89
|
}
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
90
|
+
const c = (t.error_class ?? "").toLowerCase(), m = e.reason ? { text: e.reason(t.reason), quoted: !1 } : z(t.reason), a = t.retry && t.retry.at ? t.retry : null, y = a ? new Date(a.at).getTime() : Number.NaN, $ = a ? `${Number.isFinite(y) && y > n ? `Retrying at ${r(a.at)}` : "Retrying now"} (attempt ${a.attempt} of ${a.of})` : "", g = (N = t.no_retry) == null ? void 0 : N.trim(), w = (s) => a ? { retry_at: a.at } : s && g ? { detail: `It won't be sent again automatically — ${g}.` } : {};
|
|
91
|
+
if (E.has(c)) {
|
|
92
|
+
const h = c === "rate_limited" ? `${i} was too busy to take it ${o(d)} — nothing was sent.` : `Couldn't reach ${i} — nothing was sent.`, D = !a && t.can_resend === !0, M = a ? ` ${$}` : D ? "" : " Ask an admin to send it again.";
|
|
79
93
|
return {
|
|
80
94
|
state: "not_taken",
|
|
81
|
-
tone:
|
|
82
|
-
text: `${
|
|
83
|
-
...
|
|
84
|
-
...
|
|
95
|
+
tone: a ? "waiting" : "problem",
|
|
96
|
+
text: `${h}${M}`,
|
|
97
|
+
...D ? { resend: !0 } : {},
|
|
98
|
+
...w(!0)
|
|
85
99
|
};
|
|
86
100
|
}
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
101
|
+
const b = `${i} refused it ${o(d)}`;
|
|
102
|
+
if (c === "auth")
|
|
89
103
|
return {
|
|
90
104
|
state: "refused",
|
|
91
|
-
tone:
|
|
92
|
-
text: `${
|
|
93
|
-
...
|
|
105
|
+
tone: a ? "waiting" : "problem",
|
|
106
|
+
text: `${b}: it did not accept this app's sign-in. ${a ? $ : `An administrator needs to check the connection to ${i}.`}`,
|
|
107
|
+
...w(!0)
|
|
94
108
|
};
|
|
95
|
-
const
|
|
109
|
+
const l = !m.quoted && /^The other system refused the request\.?$/.test(m.text) ? "" : m.text, C = l ? m.quoted ? `: “${l}.”` : `: ${l}.` : " without giving a reason.", q = u === "rejected" || ["validation", "not_found"].includes(c);
|
|
96
110
|
return {
|
|
97
111
|
state: "refused",
|
|
98
|
-
tone:
|
|
99
|
-
text: `${
|
|
112
|
+
tone: a ? "waiting" : "problem",
|
|
113
|
+
text: `${b}${C} ${a ? $ : l ? `Change that on the record, then send it again from ${T}.` : `Check the record, then send it again from ${T}.`}`,
|
|
100
114
|
// "Repeating it cannot fix it" is already what the next step says.
|
|
101
|
-
...
|
|
115
|
+
...w(!q)
|
|
102
116
|
};
|
|
103
117
|
}
|
|
104
|
-
function
|
|
118
|
+
function G(t, e = Date.now()) {
|
|
105
119
|
if (!t) return null;
|
|
106
120
|
const n = new Date(t).getTime();
|
|
107
121
|
if (!Number.isFinite(n) || n <= e) return null;
|
|
108
122
|
const r = Math.ceil((n - e) / 6e4);
|
|
109
|
-
return r < 60 ? `in ${r} minute${r === 1 ? "" : "s"}` : `in ${
|
|
123
|
+
return r < 60 ? `in ${r} minute${r === 1 ? "" : "s"}` : `in ${f(n - e)}`;
|
|
110
124
|
}
|
|
111
|
-
function
|
|
112
|
-
var
|
|
113
|
-
const n = (
|
|
125
|
+
function K(t, e = Date.now()) {
|
|
126
|
+
var o;
|
|
127
|
+
const n = (o = t.retry) != null && o.at ? new Date(t.retry.at).getTime() : Number.NaN;
|
|
114
128
|
if (!Number.isFinite(n) || n <= e) return null;
|
|
115
129
|
const r = n - e;
|
|
116
130
|
return Math.min(r, (r - 1) % 6e4 + 1) + 250;
|
|
117
131
|
}
|
|
118
|
-
function
|
|
132
|
+
function Z(t, e = Date.now()) {
|
|
119
133
|
if ((t.status ?? "").toLowerCase() !== "sending" || !t.answer_by) return null;
|
|
120
134
|
const n = new Date(t.answer_by).getTime();
|
|
121
135
|
return !Number.isFinite(n) || n < e ? null : n - e + 500;
|
|
122
136
|
}
|
|
123
137
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
138
|
+
A as atClock,
|
|
139
|
+
L as atWhen,
|
|
140
|
+
Z as msUntilNoAnswer,
|
|
141
|
+
K as msUntilRetryTick,
|
|
142
|
+
f as plainDuration,
|
|
143
|
+
S as plainSendReason,
|
|
144
|
+
G as retryCountdown,
|
|
145
|
+
z as sendReason,
|
|
146
|
+
j as sendStatusWords,
|
|
147
|
+
F as withoutContactLine
|
|
132
148
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function a(n, t) {
|
|
2
|
+
if (t <= 0) return 0;
|
|
3
|
+
const l = n.lastIndexOf(" ", t);
|
|
4
|
+
return l > 0 && t - l <= 12 ? l + 1 : t;
|
|
5
|
+
}
|
|
6
|
+
function $(n, t) {
|
|
7
|
+
if (t >= n.length) return n.length;
|
|
8
|
+
const l = n.indexOf(" ", t);
|
|
9
|
+
return l >= 0 && l - t <= 12 ? l : t;
|
|
10
|
+
}
|
|
11
|
+
function p(n, t, { max: l = 60, context: r = 20 } = {}) {
|
|
12
|
+
if (n.length <= l && t.length <= l) return { before: n, after: t, trimmed: !1 };
|
|
13
|
+
let e = 0;
|
|
14
|
+
const u = Math.min(n.length, t.length);
|
|
15
|
+
for (; e < u && n[e] === t[e]; ) e++;
|
|
16
|
+
let c = 0;
|
|
17
|
+
for (; c < u - e && n[n.length - 1 - c] === t[t.length - 1 - c]; )
|
|
18
|
+
c++;
|
|
19
|
+
const d = (h) => {
|
|
20
|
+
const m = Math.max(0, e - r), w = Math.min(h.length, h.length - c + r), g = a(h, m), o = $(h, w);
|
|
21
|
+
let i = h.slice(g, o);
|
|
22
|
+
const s = l + r * 2;
|
|
23
|
+
return i.length > s && (i = `${i.slice(0, s - 20)}…${i.slice(-19)}`), `${g > 0 ? "…" : ""}${i.trim()}${o < h.length ? "…" : ""}`;
|
|
24
|
+
};
|
|
25
|
+
return { before: d(n), after: d(t), trimmed: !0 };
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
p as diffWindow
|
|
29
|
+
};
|