@opencxh/domain 1.130.0 → 1.132.0

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/index.js CHANGED
@@ -1,113 +1,504 @@
1
- function S(e) {
1
+ function $(e) {
2
2
  return e.replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<[^>]+>/g, " ").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/\s+/g, " ").trim();
3
3
  }
4
- function T(e) {
5
- const n = e.trim();
6
- return n.length <= 140 ? n : n.slice(0, 139).trimEnd() + "…";
7
- }
8
- function c(e) {
4
+ function p(e) {
9
5
  if (!e || e < 0) return "";
10
6
  const n = Math.floor(e / 60), t = Math.floor(e % 60);
11
7
  return `${n}:${t.toString().padStart(2, "0")}`;
12
8
  }
13
- function h(e) {
14
- switch (e.type) {
15
- case "EMAIL_RECEIVED":
16
- case "EMAIL_SENT": {
17
- const n = e.payload, t = n.bodySnippet?.trim() || S(n.body ?? "");
18
- return n.subject ? `${n.subject} — ${t}` : t;
9
+ function b(e) {
10
+ return e ? ` — ${Math.floor(e / 60)}m ${e % 60}s` : "";
11
+ }
12
+ function m(e) {
13
+ return e?.split("@")?.[0] || e || "";
14
+ }
15
+ function u(e) {
16
+ return e.map((n) => n.name).join(", ");
17
+ }
18
+ function A(e) {
19
+ return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
20
+ }
21
+ const s = {
22
+ /* ---- voice ---- */
23
+ VOICE_CALL_STARTED: {
24
+ shape: "event",
25
+ channelKind: "voice",
26
+ icon: "phone",
27
+ snippet: () => "Gesprek gestart",
28
+ timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${m(e.payload.from)}` : `Outbound call started — ${m(e.payload.to)}`
29
+ },
30
+ VOICE_CALL_ANSWERED: {
31
+ shape: "event",
32
+ channelKind: "voice",
33
+ icon: "phone",
34
+ snippet: () => "Gesprek aangenomen",
35
+ timeline: (e, n) => `Call answered — ${n}`
36
+ },
37
+ VOICE_CALL_HOLD: {
38
+ shape: "event",
39
+ channelKind: "voice",
40
+ icon: "phone",
41
+ snippet: () => "In de wacht",
42
+ timeline: (e, n) => `Call on hold — ${n}`
43
+ },
44
+ VOICE_CALL_UNHOLD: {
45
+ shape: "event",
46
+ channelKind: "voice",
47
+ icon: "phone",
48
+ snippet: () => "Hervat"
49
+ },
50
+ VOICE_CALL_ENDED: {
51
+ shape: "event",
52
+ channelKind: "voice",
53
+ icon: "phone",
54
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
55
+ timeline: (e) => `Call ended${b(e.payload.duration)}`
56
+ },
57
+ VOICE_CALL_MISSED: {
58
+ shape: "event",
59
+ channelKind: "voice",
60
+ icon: "phone",
61
+ snippet: () => "Gemiste oproep",
62
+ timeline: (e) => `Missed call — ${m(e.payload.from)}`
63
+ },
64
+ VOICE_CALL_FAILED: {
65
+ shape: "event",
66
+ channelKind: "voice",
67
+ icon: "phone",
68
+ snippet: () => "Gesprek mislukt",
69
+ timeline: () => "Call failed"
70
+ },
71
+ VOICE_CALL_VOICEMAIL: {
72
+ shape: "artifact",
73
+ channelKind: "voice",
74
+ icon: "phone",
75
+ snippet: (e) => e.payload.transcription?.trim() ? e.payload.transcription : "Voicemail ontvangen"
76
+ },
77
+ /* ---- video ---- */
78
+ VIDEO_CALL_STARTED: {
79
+ shape: "event",
80
+ channelKind: "video",
81
+ icon: "video",
82
+ snippet: () => "Gesprek gestart",
83
+ timeline: () => "Video call started"
84
+ },
85
+ VIDEO_CALL_ANSWERED: {
86
+ shape: "event",
87
+ channelKind: "video",
88
+ icon: "video",
89
+ snippet: () => "Gesprek aangenomen",
90
+ timeline: () => "Video call answered"
91
+ },
92
+ VIDEO_CALL_HOLD: {
93
+ shape: "event",
94
+ channelKind: "video",
95
+ icon: "video",
96
+ snippet: () => "In de wacht"
97
+ },
98
+ VIDEO_CALL_UNHOLD: {
99
+ shape: "event",
100
+ channelKind: "video",
101
+ icon: "video",
102
+ snippet: () => "Hervat"
103
+ },
104
+ VIDEO_CALL_ENDED: {
105
+ shape: "event",
106
+ channelKind: "video",
107
+ icon: "video",
108
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
109
+ timeline: () => "Video call ended"
110
+ },
111
+ VIDEO_CALL_MISSED: {
112
+ shape: "event",
113
+ channelKind: "video",
114
+ icon: "video",
115
+ snippet: () => "Gemiste oproep",
116
+ timeline: () => "Missed video call"
117
+ },
118
+ VIDEO_CALL_FAILED: {
119
+ shape: "event",
120
+ channelKind: "video",
121
+ icon: "video",
122
+ snippet: () => "Gesprek mislukt",
123
+ timeline: () => "Video call failed"
124
+ },
125
+ /* ---- mail ---- */
126
+ EMAIL_RECEIVED: {
127
+ shape: "message",
128
+ triggerable: !0,
129
+ displayNameKey: "communication:activity.EMAIL_RECEIVED",
130
+ component: "communication:EmailActivity",
131
+ channelKind: "mail",
132
+ icon: "mail",
133
+ replyable: !0,
134
+ carriesText: !0,
135
+ countsAs: "inbound_message",
136
+ snippet: I
137
+ },
138
+ EMAIL_SENT: {
139
+ shape: "message",
140
+ component: "communication:EmailActivity",
141
+ channelKind: "mail",
142
+ icon: "mail",
143
+ replyable: !0,
144
+ carriesText: !0,
145
+ countsAs: "outbound_message",
146
+ snippet: I
147
+ },
148
+ /* ---- chat ---- */
149
+ CHAT_MESSAGE_SENT: {
150
+ shape: "message",
151
+ component: "communication:ChatMessage",
152
+ channelKind: "chat",
153
+ icon: "message-circle",
154
+ replyable: !0,
155
+ carriesText: !0,
156
+ countsAs: "outbound_message",
157
+ snippet: (e) => e.payload.text ?? ""
158
+ },
159
+ CHAT_MESSAGE_RECEIVED: {
160
+ shape: "message",
161
+ triggerable: !0,
162
+ displayNameKey: "communication:activity.CHAT_MESSAGE_RECEIVED",
163
+ component: "communication:ChatMessage",
164
+ channelKind: "chat",
165
+ icon: "message-circle",
166
+ replyable: !0,
167
+ carriesText: !0,
168
+ countsAs: "inbound_message",
169
+ snippet: (e) => e.payload.text ?? ""
170
+ },
171
+ CHAT_MEMBER_JOINED: {
172
+ shape: "event",
173
+ channelKind: "chat",
174
+ icon: "message-circle",
175
+ snippet: (e) => `${u(e.payload.members)} toegevoegd`,
176
+ timeline: (e) => {
177
+ const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
178
+ return `${n} joined the chat${t}`;
19
179
  }
20
- case "CHAT_MESSAGE_SENT":
21
- case "CHAT_MESSAGE_RECEIVED":
22
- return e.payload.text ?? "";
23
- case "CHAT_RENAMED":
24
- return `Hernoemd naar "${e.payload.newName}"`;
25
- case "CHAT_MEMBER_JOINED":
26
- return `${e.payload.members.map((n) => n.name).join(", ")} toegevoegd`;
27
- case "CHAT_MEMBER_LEFT":
28
- return `${e.payload.members.map((n) => n.name).join(", ")} verlaten`;
29
- case "CHAT_CALL_STARTED":
30
- return "Gesprek gestart";
31
- case "CHAT_CALL_ENDED":
32
- return `Gesprek beëindigd${e.payload.duration ? ` (${c(e.payload.duration)})` : ""}`;
33
- case "CHAT_EVENT":
34
- return e.payload.text ?? e.payload.eventType;
35
- case "VOICE_CALL_STARTED":
36
- case "VIDEO_CALL_STARTED":
37
- return "Gesprek gestart";
38
- case "VOICE_CALL_ANSWERED":
39
- case "VIDEO_CALL_ANSWERED":
40
- return "Gesprek aangenomen";
41
- case "VOICE_CALL_HOLD":
42
- case "VIDEO_CALL_HOLD":
43
- return "In de wacht";
44
- case "VOICE_CALL_UNHOLD":
45
- case "VIDEO_CALL_UNHOLD":
46
- return "Hervat";
47
- case "VOICE_CALL_ENDED":
48
- case "VIDEO_CALL_ENDED":
49
- return `Gesprek beëindigd${e.payload.duration ? ` (${c(e.payload.duration)})` : ""}`;
50
- case "VOICE_CALL_MISSED":
51
- case "VIDEO_CALL_MISSED":
52
- return "Gemiste oproep";
53
- case "VOICE_CALL_FAILED":
54
- case "VIDEO_CALL_FAILED":
55
- return "Gesprek mislukt";
56
- case "VOICE_CALL_VOICEMAIL":
57
- return e.payload.transcription?.trim() ? e.payload.transcription : "Voicemail ontvangen";
58
- case "TRANSCRIPT_ADDED":
59
- return (e.payload.segments ?? []).map((n) => n.text).join(" ");
60
- case "AI_MESSAGE_ADDED":
61
- return e.payload.output?.text ?? e.payload.input?.text ?? "";
62
- case "AI_ACTION_PROPOSED":
63
- return `Voorstel wacht op goedkeuring (${e.payload.actions?.length ?? 0} actie(s))`;
64
- case "PLAYBOOK_STARTED":
65
- return `Playbook gestart${e.payload.playbookName ? `: ${e.payload.playbookName}` : ""}`;
66
- case "PLAYBOOK_COMPLETED":
67
- return "Playbook afgerond";
68
- case "PLAYBOOK_ESCALATED":
69
- return "Playbook geëscaleerd naar een mens";
70
- case "MEETING_SCHEDULED":
71
- return `Vergadering gepland: ${e.payload.title}`;
72
- case "MEETING_STARTED":
73
- return `Vergadering gestart: ${e.payload.title}`;
74
- case "MEETING_ENDED":
75
- return `Vergadering beëindigd${e.payload.duration ? ` (${c(e.payload.duration)})` : ""}`;
76
- case "MEETING_PARTICIPANT_JOINED":
77
- return `${e.payload.name} deelgenomen`;
78
- case "MEETING_PARTICIPANT_LEFT":
79
- return `${e.payload.name} verlaten`;
80
- case "COMMENT_ADDED":
81
- return e.payload.text ?? "";
82
- case "FILE_UPLOADED":
83
- return `Bestand: ${e.payload.fileName}`;
84
- case "INTERACTION_CREATED":
85
- return "Interactie aangemaakt";
86
- case "INTERACTION_STATUS_CHANGED":
87
- return `Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`;
88
- case "INTERACTION_ASSIGNED":
89
- return "Interactie toegewezen";
90
- default:
91
- return "";
180
+ },
181
+ CHAT_MEMBER_LEFT: {
182
+ shape: "event",
183
+ channelKind: "chat",
184
+ icon: "message-circle",
185
+ snippet: (e) => `${u(e.payload.members)} verlaten`,
186
+ timeline: (e) => {
187
+ const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
188
+ return `${n} left the chat${t}`;
189
+ }
190
+ },
191
+ CHAT_RENAMED: {
192
+ shape: "event",
193
+ channelKind: "chat",
194
+ icon: "message-circle",
195
+ snippet: (e) => `Hernoemd naar "${e.payload.newName}"`,
196
+ timeline: (e) => `Chat renamed to "${e.payload.newName}"${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`
197
+ },
198
+ CHAT_CALL_STARTED: {
199
+ shape: "event",
200
+ channelKind: "chat",
201
+ icon: "message-circle",
202
+ snippet: () => "Gesprek gestart",
203
+ timeline: (e) => `${A(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
204
+ joinUrl: (e) => e.payload.joinUrl
205
+ },
206
+ CHAT_CALL_ENDED: {
207
+ shape: "event",
208
+ channelKind: "chat",
209
+ icon: "message-circle",
210
+ snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
211
+ timeline: (e) => `${A(e.payload.callType)} ended${b(e.payload.duration)}`,
212
+ joinUrl: (e) => e.payload.joinUrl
213
+ },
214
+ CHAT_EVENT: {
215
+ shape: "event",
216
+ channelKind: "chat",
217
+ icon: "message-circle",
218
+ snippet: (e) => e.payload.text ?? e.payload.eventType,
219
+ timeline: (e) => e.payload.text || e.payload.eventType
220
+ },
221
+ /* ---- inhoud ---- */
222
+ TRANSCRIPT_ADDED: {
223
+ shape: "artifact",
224
+ triggerable: !0,
225
+ displayNameKey: "communication:activity.TRANSCRIPT_ADDED",
226
+ component: "communication:TranscriptionActivity",
227
+ icon: "captions",
228
+ carriesText: !0,
229
+ snippet: (e) => (e.payload.segments ?? []).map((n) => n.text).join(" ")
230
+ },
231
+ COMMENT_ADDED: {
232
+ shape: "note",
233
+ component: "communication:CommentActivity",
234
+ icon: "sticky-note",
235
+ carriesText: !0,
236
+ snippet: (e) => e.payload.text ?? ""
237
+ },
238
+ FILE_UPLOADED: {
239
+ shape: "artifact",
240
+ component: "communication:FileActivity",
241
+ icon: "paperclip",
242
+ snippet: (e) => `Bestand: ${e.payload.fileName}`
243
+ },
244
+ /* ---- AI & playbooks ---- */
245
+ AI_MESSAGE_ADDED: {
246
+ shape: "event",
247
+ triggerable: !0,
248
+ displayNameKey: "communication:activity.AI_MESSAGE_ADDED",
249
+ icon: "circle",
250
+ snippet: (e) => e.payload.output?.text ?? e.payload.input?.text ?? "",
251
+ timeline: () => "AI message added"
252
+ },
253
+ AI_ACTION_PROPOSED: {
254
+ shape: "event",
255
+ component: "communication:ProposedActionCard",
256
+ icon: "circle",
257
+ playbookAuthored: !0,
258
+ snippet: (e) => `Voorstel wacht op goedkeuring (${e.payload.actions?.length ?? 0} actie(s))`
259
+ },
260
+ PLAYBOOK_STARTED: {
261
+ shape: "event",
262
+ icon: "circle",
263
+ playbookAuthored: !0,
264
+ snippet: (e) => `Playbook gestart${e.payload.playbookName ? `: ${e.payload.playbookName}` : ""}`,
265
+ timeline: (e) => `Playbook gestart${e.payload.playbookName ? ` — ${e.payload.playbookName}` : ""}`
266
+ },
267
+ PLAYBOOK_COMPLETED: {
268
+ shape: "event",
269
+ icon: "circle",
270
+ playbookAuthored: !0,
271
+ snippet: () => "Playbook afgerond",
272
+ timeline: () => "Playbook afgerond"
273
+ },
274
+ PLAYBOOK_ESCALATED: {
275
+ shape: "event",
276
+ icon: "circle",
277
+ playbookAuthored: !0,
278
+ snippet: () => "Playbook geëscaleerd naar een mens",
279
+ timeline: () => "Playbook geëscaleerd naar een mens"
280
+ },
281
+ /* ---- meetings ---- */
282
+ MEETING_SCHEDULED: {
283
+ shape: "event",
284
+ icon: "calendar",
285
+ snippet: (e) => `Vergadering gepland: ${e.payload.title}`,
286
+ timeline: () => "Meeting scheduled",
287
+ joinUrl: (e) => e.payload.joinUrl
288
+ },
289
+ MEETING_STARTED: {
290
+ shape: "event",
291
+ icon: "calendar",
292
+ snippet: (e) => `Vergadering gestart: ${e.payload.title}`,
293
+ timeline: () => "Meeting started",
294
+ joinUrl: (e) => e.payload.joinUrl
295
+ },
296
+ MEETING_ENDED: {
297
+ shape: "event",
298
+ icon: "calendar",
299
+ snippet: (e) => `Vergadering beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
300
+ timeline: () => "Meeting ended"
301
+ },
302
+ MEETING_PARTICIPANT_JOINED: {
303
+ shape: "event",
304
+ icon: "calendar",
305
+ snippet: (e) => `${e.payload.name} deelgenomen`,
306
+ timeline: (e, n) => `${n} joined the meeting`
307
+ },
308
+ MEETING_PARTICIPANT_LEFT: {
309
+ shape: "event",
310
+ icon: "calendar",
311
+ snippet: (e) => `${e.payload.name} verlaten`,
312
+ timeline: (e, n) => `${n} left the meeting`
313
+ },
314
+ /* ---- interactie-levenscyclus ---- */
315
+ INTERACTION_CREATED: {
316
+ shape: "event",
317
+ icon: "circle",
318
+ snippet: () => "Interactie aangemaakt",
319
+ timeline: (e, n) => `Interaction started by ${n}`
320
+ },
321
+ INTERACTION_STATUS_CHANGED: {
322
+ shape: "event",
323
+ triggerable: !0,
324
+ displayNameKey: "communication:activity.INTERACTION_STATUS_CHANGED",
325
+ icon: "circle-dot",
326
+ snippet: (e) => `Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,
327
+ timeline: (e, n) => `Status changed to ${e.payload.toStatus} by ${n}`
328
+ },
329
+ INTERACTION_ASSIGNED: {
330
+ shape: "event",
331
+ icon: "user",
332
+ snippet: () => "Interactie toegewezen",
333
+ timeline: (e, n) => `Assigned by ${n}`
92
334
  }
335
+ };
336
+ function I(e) {
337
+ const n = e.payload, t = n.bodySnippet?.trim() || $(n.body ?? "");
338
+ return n.subject ? `${n.subject} — ${t}` : t;
339
+ }
340
+ function l(e) {
341
+ return s[e];
93
342
  }
94
- function ie(e) {
343
+ function Ae(e) {
344
+ return l(e)?.icon ?? "circle";
345
+ }
346
+ function Ie(e) {
347
+ return l(e)?.channelKind;
348
+ }
349
+ function _e(e) {
350
+ const n = l(e)?.shape;
351
+ return n === "message" || n === "note";
352
+ }
353
+ function Te(e) {
354
+ return l(e)?.replyable === !0;
355
+ }
356
+ function Me(e) {
357
+ return l(e)?.carriesText === !0;
358
+ }
359
+ function Se(e) {
360
+ return l(e)?.countsAs;
361
+ }
362
+ function ve(e) {
363
+ return l(e)?.playbookAuthored === !0;
364
+ }
365
+ function x(e) {
366
+ const n = l(e.type)?.snippet;
367
+ return n ? n(e) : "";
368
+ }
369
+ function Ce(e, n) {
370
+ const t = l(e.type)?.timeline;
371
+ return t ? t(e, n) : e.type.replace(/_/g, " ").toLowerCase();
372
+ }
373
+ function De(e) {
374
+ const n = l(e.type)?.joinUrl;
375
+ return n ? n(e) : void 0;
376
+ }
377
+ function g(e, n) {
378
+ let t = e;
379
+ for (const i of n.split(".")) {
380
+ if (t == null || typeof t != "object") return "";
381
+ t = t[i];
382
+ }
383
+ return t == null ? "" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : "";
384
+ }
385
+ function h(e, n, t) {
386
+ if (e === void 0) return null;
387
+ if (typeof e == "string") return e || null;
388
+ if ("value" in e)
389
+ return g(n, e.value) || null;
390
+ const i = {};
391
+ for (const [r, o] of Object.entries(e.params ?? {}))
392
+ i[r] = g(n, o);
393
+ const a = t(e.key, i);
394
+ return a === e.key ? null : a;
395
+ }
396
+ function U(e, n) {
397
+ if (!e || typeof e == "string" || "value" in e) return null;
398
+ const t = {};
399
+ for (const [i, a] of Object.entries(e.params ?? {}))
400
+ t[i] = g(n, a);
401
+ return { key: e.key, params: t };
402
+ }
403
+ const P = (e) => e;
404
+ function _(e) {
405
+ const n = s[e];
406
+ return {
407
+ type: e,
408
+ shape: n.shape,
409
+ channelKind: n.channelKind,
410
+ icon: n.icon,
411
+ replyable: n.replyable === !0,
412
+ countsAs: n.countsAs,
413
+ carriesText: n.carriesText === !0,
414
+ triggerable: n.triggerable === !0,
415
+ component: n.component,
416
+ builtIn: !0,
417
+ displayNameKey: n.displayNameKey
418
+ };
419
+ }
420
+ function T(e) {
421
+ return {
422
+ type: e.type,
423
+ shape: e.shape,
424
+ channelKind: e.channelKind,
425
+ icon: e.icon || "circle",
426
+ replyable: e.replyable === !0,
427
+ countsAs: e.countsAs,
428
+ carriesText: e.carriesText === !0,
429
+ triggerable: e.triggerable === !0,
430
+ component: e.component,
431
+ builtIn: !1,
432
+ displayNameKey: e.displayNameKey
433
+ };
434
+ }
435
+ class K {
436
+ constructor(n = [], t = P) {
437
+ this.translate = t;
438
+ for (const i of n)
439
+ i?.type && (i.type in s || this.declared.has(i.type) || this.declared.set(i.type, i));
440
+ }
441
+ declared = /* @__PURE__ */ new Map();
442
+ get(n) {
443
+ if (n in s) return _(n);
444
+ const t = this.declared.get(n);
445
+ return t ? T(t) : void 0;
446
+ }
447
+ /** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
448
+ triggerable() {
449
+ const n = Object.keys(s).filter((i) => s[i].triggerable).map(_), t = [...this.declared.values()].map(T).filter((i) => i.triggerable);
450
+ return [...n, ...t];
451
+ }
452
+ /**
453
+ * De tijdlijnregel. Ingebouwd komt uit de catalogus, gedeclareerd uit `text` + de
454
+ * meegeleverde vertaling. Zonder bruikbare tekst valt het terug op de ontstreepte
455
+ * typenaam — dezelfde regel die de feed altijd al toonde voor onbekende types.
456
+ */
457
+ timelineText(n, t) {
458
+ const i = s[n.type];
459
+ if (i?.timeline) return i.timeline(n, t);
460
+ const a = this.declared.get(n.type);
461
+ return h(a?.text, n, this.translate) ?? n.type.replace(/_/g, " ").toLowerCase();
462
+ }
463
+ /** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
464
+ snippet(n) {
465
+ const t = s[n.type];
466
+ if (t?.snippet) return t.snippet(n);
467
+ const i = this.declared.get(n.type);
468
+ return h(i?.text, n, this.translate) ?? "";
469
+ }
470
+ /** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
471
+ descriptor(n) {
472
+ return this.declared.get(n);
473
+ }
474
+ }
475
+ const Ne = new K(), M = 140;
476
+ function G(e) {
477
+ const n = e.trim();
478
+ return n.length <= M ? n : n.slice(0, M - 1).trimEnd() + "…";
479
+ }
480
+ function Oe(e, n) {
481
+ const t = U(n?.text, e), i = n ? h(n.text, e, (a) => a) : null;
95
482
  return {
96
483
  activityId: e.id,
97
484
  type: e.type,
98
- snippet: T(h(e)),
485
+ snippet: G(i ?? x(e)),
99
486
  authorName: e.author?.name ?? "",
100
487
  direction: e.direction,
101
- createdAt: e.createdAt ?? Date.now()
488
+ createdAt: e.createdAt ?? Date.now(),
489
+ ...t ? { snippetKey: t.key, snippetParams: t.params } : {}
102
490
  };
103
491
  }
104
- function se(e, n, t = []) {
105
- const r = e.createdAt;
106
- if (!r) return [];
492
+ function Le(e, n, t = []) {
493
+ const i = e.createdAt;
494
+ if (!i) return [];
107
495
  const a = new Set(t);
108
- return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(n).filter(([i, s]) => s >= r && !a.has(i)).map(([i]) => i);
496
+ return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(n).filter(([r, o]) => o >= i && !a.has(r)).map(([r]) => r);
109
497
  }
110
- const oe = [
498
+ function ke(e) {
499
+ return e.createdAt ?? 0;
500
+ }
501
+ const Re = [
111
502
  { id: "agent", label: "Agent", labelSource: "user" },
112
503
  { id: "team", label: "Team", labelSource: "team" },
113
504
  { id: "inbox", label: "Inbox", labelSource: "inbox" },
@@ -117,57 +508,57 @@ const oe = [
117
508
  { id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
118
509
  { id: "time", label: "Tijd", labelSource: "raw" }
119
510
  ];
120
- function le(e) {
511
+ function $e(e) {
121
512
  const n = [];
122
513
  for (const t of Object.keys(e))
123
- for (const r of Object.keys(e[t]))
124
- n.push({ lang: t, key: r, value: e[t][r] });
514
+ for (const i of Object.keys(e[t]))
515
+ n.push({ lang: t, key: i, value: e[t][i] });
125
516
  return n;
126
517
  }
127
- function u(e) {
518
+ function f(e) {
128
519
  return e < 10 ? `0${e}` : `${e}`;
129
520
  }
130
- function D(e, n) {
131
- const t = new Date(e), r = `${t.getUTCFullYear()}-${u(t.getUTCMonth() + 1)}-${u(t.getUTCDate())}`;
132
- return n === "day" ? r : `${r}T${u(t.getUTCHours())}`;
521
+ function w(e, n) {
522
+ const t = new Date(e), i = `${t.getUTCFullYear()}-${f(t.getUTCMonth() + 1)}-${f(t.getUTCDate())}`;
523
+ return n === "day" ? i : `${i}T${f(t.getUTCHours())}`;
133
524
  }
134
- function C(e, n) {
525
+ function V(e, n) {
135
526
  const t = new Date(e);
136
527
  return t.setUTCMinutes(0, 0, 0), n === "day" && t.setUTCHours(0), t.getTime();
137
528
  }
138
- const O = 36e5, N = 864e5;
139
- function ce(e, n, t) {
140
- const r = t === "hour" ? O : N, a = [];
141
- for (let i = C(e, t); i <= n; i += r)
142
- a.push(D(i, t));
529
+ const H = 36e5, j = 864e5;
530
+ function xe(e, n, t) {
531
+ const i = t === "hour" ? H : j, a = [];
532
+ for (let r = V(e, t); r <= n; r += i)
533
+ a.push(w(r, t));
143
534
  return a;
144
535
  }
145
- const L = [
536
+ const B = [
146
537
  { id: "resource", label: "Resource", labelSource: "raw" },
147
538
  { id: "origin", label: "Herkomst", labelSource: "raw" }
148
- ], R = L.map((e) => e.id);
149
- function y(e, n) {
539
+ ], F = B.map((e) => e.id);
540
+ function W(e, n) {
150
541
  return `${e}.usage.${n}`;
151
542
  }
152
- function ue(e, n) {
543
+ function Ue(e, n) {
153
544
  return n.map((t) => ({
154
- id: y(e, t.unit),
545
+ id: W(e, t.unit),
155
546
  label: t.label,
156
547
  category: "Verbruik",
157
548
  valueType: t.valueType ?? "count",
158
549
  aggregation: "sum",
159
550
  supportedDimensions: [
160
551
  "provider",
161
- ...R,
552
+ ...F,
162
553
  ...t.extraDimensions ?? [],
163
554
  "time"
164
555
  ]
165
556
  }));
166
557
  }
167
- function de(e) {
558
+ function Pe(e) {
168
559
  return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
169
560
  }
170
- const pe = [
561
+ const Ke = [
171
562
  { name: "text", type: "string" },
172
563
  { name: "subject", type: "string" },
173
564
  { name: "from", type: "string" },
@@ -190,7 +581,7 @@ const pe = [
190
581
  // een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
191
582
  { name: "contactId", type: "string" },
192
583
  { name: "companyId", type: "string" }
193
- ], fe = {
584
+ ], Ge = {
194
585
  topics: [
195
586
  { name: "topic", type: "string" },
196
587
  { name: "confidence", type: "number" }
@@ -201,7 +592,7 @@ const pe = [
201
592
  ],
202
593
  extract: []
203
594
  };
204
- function k(e) {
595
+ function Y(e) {
205
596
  switch (e.kind) {
206
597
  case "user":
207
598
  return `user:${e.userId}`;
@@ -211,22 +602,22 @@ function k(e) {
211
602
  return "org";
212
603
  }
213
604
  }
214
- function ge(e) {
605
+ function we(e) {
215
606
  if (typeof e != "string") return;
216
607
  const n = e.trim();
217
608
  if (n === "org") return { kind: "org" };
218
609
  const t = n.indexOf(":");
219
610
  if (t <= 0) return;
220
- const r = n.slice(0, t), a = n.slice(t + 1).trim();
611
+ const i = n.slice(0, t), a = n.slice(t + 1).trim();
221
612
  if (a) {
222
- if (r === "user") return { kind: "user", userId: a };
223
- if (r === "team") return { kind: "team", teamId: a };
613
+ if (i === "user") return { kind: "user", userId: a };
614
+ if (i === "team") return { kind: "team", teamId: a };
224
615
  }
225
616
  }
226
- function x(e) {
227
- return k(e);
617
+ function z(e) {
618
+ return Y(e);
228
619
  }
229
- function Ee(e) {
620
+ function Ve(e) {
230
621
  switch (e.kind) {
231
622
  case "personal":
232
623
  return { kind: "user", userId: e.userId };
@@ -236,20 +627,20 @@ function Ee(e) {
236
627
  return { kind: "org" };
237
628
  }
238
629
  }
239
- function me(e) {
240
- return x(e);
630
+ function He(e) {
631
+ return z(e);
241
632
  }
242
- const U = ["done", "escalated", "failed", "timed_out", "stopped"], P = ["awaiting_approval", "awaiting_reply"];
243
- function $(e) {
244
- return U.includes(e);
633
+ const q = ["done", "escalated", "failed", "timed_out", "stopped"], X = ["awaiting_approval", "awaiting_reply"];
634
+ function J(e) {
635
+ return q.includes(e);
245
636
  }
246
- function be(e) {
247
- return $(e);
637
+ function je(e) {
638
+ return J(e);
248
639
  }
249
- function Ie(e) {
250
- return P.includes(e);
640
+ function Be(e) {
641
+ return X.includes(e);
251
642
  }
252
- const _ = [
643
+ const k = [
253
644
  {
254
645
  id: "openai",
255
646
  label: "OpenAI",
@@ -337,53 +728,53 @@ const _ = [
337
728
  defaultModel: "default"
338
729
  }
339
730
  ];
340
- function d(e) {
341
- return _.find((n) => n.id === e);
731
+ function E(e) {
732
+ return k.find((n) => n.id === e);
342
733
  }
343
- function Ae(e) {
344
- return d(e)?.label ?? e;
734
+ function Fe(e) {
735
+ return E(e)?.label ?? e;
345
736
  }
346
- function _e(e, n = "gpt-5-mini") {
347
- return d(e)?.defaultModel ?? n;
737
+ function We(e, n = "gpt-5-mini") {
738
+ return E(e)?.defaultModel ?? n;
348
739
  }
349
- function Me(e) {
350
- return _.filter((n) => n.capabilities.includes(e));
740
+ function Ye(e) {
741
+ return k.filter((n) => n.capabilities.includes(e));
351
742
  }
352
- function Se(e) {
353
- const n = d(e);
743
+ function ze(e) {
744
+ const n = E(e);
354
745
  return !!n && !n.baseUrl;
355
746
  }
356
- const Te = /* @__PURE__ */ new Set(["mail", "message"]);
357
- function w(e, n) {
747
+ const qe = /* @__PURE__ */ new Set(["mail", "message"]);
748
+ function Q(e, n) {
358
749
  const t = e.settings?.signatures?.[n];
359
750
  return !t || !t.enabled || !t.body || t.body.trim() === "" ? null : t;
360
751
  }
361
- function he(e, n, t, r = "html") {
752
+ function Xe(e, n, t, i = "html") {
362
753
  if (!e) return t;
363
- const a = w(e, n);
364
- return a ? `${t}${r === "text" ? `
754
+ const a = Q(e, n);
755
+ return a ? `${t}${i === "text" ? `
365
756
 
366
757
  ` : n === "mail" ? "<br><br>-- <br>" : "<br><br>"}${a.body}` : t;
367
758
  }
368
- function De(e) {
759
+ function Je(e) {
369
760
  return e.endpoints ?? [];
370
761
  }
371
- const Ce = (e) => !!e.assignedUserId || !!e.assignedInboxId, Oe = (e) => e.status === "closed", Ne = (e) => ({
762
+ const Qe = (e) => !!e.assignedUserId || !!e.assignedInboxId, Ze = (e) => e.status === "closed", en = (e) => ({
372
763
  urgent: 10,
373
764
  high: 5,
374
765
  normal: 2,
375
766
  low: 1
376
- })[e.priority] || 0, Le = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
377
- function Re(e, n) {
767
+ })[e.priority] || 0, nn = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
768
+ function tn(e, n) {
378
769
  return e.lastActivityAt ? !(e.seenBy ?? []).includes(n) : !1;
379
770
  }
380
- const ye = 2e3, ke = 500, xe = 12e3, Ue = 4e3, G = ["contact", "company"];
381
- function Pe(e) {
771
+ const an = 2e3, rn = 500, on = 12e3, ln = 4e3, Z = ["contact", "company"];
772
+ function sn(e) {
382
773
  if (!e) return !1;
383
774
  const n = e.slice(0, e.indexOf(":"));
384
- return G.includes(n);
775
+ return Z.includes(n);
385
776
  }
386
- const p = {
777
+ const y = {
387
778
  // The lower bounds are deliberately generous: service ranges (0800/0900) are
388
779
  // shorter than geographic numbers, and a too-strict minimum silently drops them.
389
780
  // An over-permissive key is harmless — it simply matches nothing.
@@ -406,81 +797,81 @@ const p = {
406
797
  PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
407
798
  US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
408
799
  CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
409
- }, V = "NL", H = 15, B = 8, F = Array.from(
410
- new Set(Object.values(p).map((e) => e.callingCode))
800
+ }, ee = "NL", ne = 15, te = 8, ie = Array.from(
801
+ new Set(Object.values(y).map((e) => e.callingCode))
411
802
  ).sort((e, n) => n.length - e.length);
412
- function f(e) {
803
+ function S(e) {
413
804
  if (e)
414
- return p[e.trim().toUpperCase()];
805
+ return y[e.trim().toUpperCase()];
415
806
  }
416
- function l(e, n) {
807
+ function d(e, n) {
417
808
  return e.length >= n.nsnMin && e.length <= n.nsnMax;
418
809
  }
419
- function g(e) {
420
- if (e.length > H) return null;
421
- for (const n of F) {
810
+ function v(e) {
811
+ if (e.length > ne) return null;
812
+ for (const n of ie) {
422
813
  if (!e.startsWith(n)) continue;
423
814
  const t = e.slice(n.length);
424
- for (const r of Object.values(p)) {
425
- if (r.callingCode !== n) continue;
426
- const a = r.trunkPrefix, i = a && t.startsWith(a) ? t.slice(a.length) : t;
427
- if (l(i, r)) return `+${n}${i}`;
815
+ for (const i of Object.values(y)) {
816
+ if (i.callingCode !== n) continue;
817
+ const a = i.trunkPrefix, r = a && t.startsWith(a) ? t.slice(a.length) : t;
818
+ if (d(r, i)) return `+${n}${r}`;
428
819
  }
429
820
  return null;
430
821
  }
431
- return e.length < B ? null : `+${e}`;
822
+ return e.length < te ? null : `+${e}`;
432
823
  }
433
- function v(e) {
824
+ function ae(e) {
434
825
  let n = e.trim();
435
826
  const t = n.match(/^(sips?|tel|whatsapp):/i);
436
827
  t && (n = n.slice(t[0].length));
437
- const r = n.indexOf("@");
438
- return r >= 0 && (n = n.slice(0, r)), n.trim();
828
+ const i = n.indexOf("@");
829
+ return i >= 0 && (n = n.slice(0, i)), n.trim();
439
830
  }
440
- function $e(e) {
831
+ function cn(e) {
441
832
  if (!e) return !1;
442
833
  const n = e.indexOf("@");
443
834
  if (n <= 0) return !1;
444
835
  const t = e.slice(0, n).trim();
445
836
  return !/^[+\d\s().-]+$/.test(t);
446
837
  }
447
- function E(e, n) {
838
+ function C(e, n) {
448
839
  if (!e) return null;
449
- const t = v(e);
840
+ const t = ae(e);
450
841
  if (!t) return null;
451
- const r = t.startsWith("+"), a = t.replace(/\D/g, "");
842
+ const i = t.startsWith("+"), a = t.replace(/\D/g, "");
452
843
  if (!a) return null;
453
- if (r) return g(a);
454
- if (a.startsWith("00")) return g(a.slice(2));
455
- const i = f(n) ?? f(V);
456
- if (!i) return null;
457
- const s = i.trunkPrefix;
458
- if (s && a.startsWith(s)) {
459
- const o = a.slice(s.length);
460
- return l(o, i) ? `+${i.callingCode}${o}` : null;
844
+ if (i) return v(a);
845
+ if (a.startsWith("00")) return v(a.slice(2));
846
+ const r = S(n) ?? S(ee);
847
+ if (!r) return null;
848
+ const o = r.trunkPrefix;
849
+ if (o && a.startsWith(o)) {
850
+ const c = a.slice(o.length);
851
+ return d(c, r) ? `+${r.callingCode}${c}` : null;
461
852
  }
462
- if (a.startsWith(i.callingCode)) {
463
- const o = a.slice(i.callingCode.length);
464
- if (l(o, i)) return `+${i.callingCode}${o}`;
853
+ if (a.startsWith(r.callingCode)) {
854
+ const c = a.slice(r.callingCode.length);
855
+ if (d(c, r)) return `+${r.callingCode}${c}`;
465
856
  }
466
- return !s && l(a, i) ? `+${i.callingCode}${a}` : null;
857
+ return !o && d(a, r) ? `+${r.callingCode}${a}` : null;
467
858
  }
468
- function we(e, n = 9) {
859
+ function pn(e, n = 9) {
469
860
  const t = (e ?? "").replace(/\D/g, "");
470
861
  return t.length < n ? null : t.slice(-n);
471
862
  }
472
- function M(e) {
863
+ function R(e) {
473
864
  if (!e) return null;
474
865
  const n = e.trim().toLowerCase(), t = n.lastIndexOf("@");
475
866
  if (t <= 0 || t === n.length - 1) return null;
476
- const r = n.slice(0, t).split("+")[0], a = n.slice(t + 1);
477
- return !r || !a.includes(".") ? null : `${r}@${a}`;
867
+ const i = n.slice(0, t).split("+")[0], a = n.slice(t + 1);
868
+ return !i || !a.includes(".") ? null : `${i}@${a}`;
478
869
  }
479
- function Ge(e) {
480
- const n = M(e);
870
+ function un(e) {
871
+ const n = R(e);
481
872
  return n ? n.slice(n.lastIndexOf("@") + 1) : null;
482
873
  }
483
- const W = /* @__PURE__ */ new Set([
874
+ const re = /* @__PURE__ */ new Set([
484
875
  "co.uk",
485
876
  "org.uk",
486
877
  "gov.uk",
@@ -490,14 +881,14 @@ const W = /* @__PURE__ */ new Set([
490
881
  "com.br",
491
882
  "co.za"
492
883
  ]);
493
- function j(e) {
884
+ function oe(e) {
494
885
  if (!e) return null;
495
886
  const n = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
496
887
  if (n.length < 2) return null;
497
888
  const t = n.slice(-2).join(".");
498
- return W.has(t) && n.length >= 3 ? n.slice(-3).join(".") : t;
889
+ return re.has(t) && n.length >= 3 ? n.slice(-3).join(".") : t;
499
890
  }
500
- const K = /* @__PURE__ */ new Set([
891
+ const le = /* @__PURE__ */ new Set([
501
892
  "gmail.com",
502
893
  "googlemail.com",
503
894
  "outlook.com",
@@ -542,34 +933,34 @@ const K = /* @__PURE__ */ new Set([
542
933
  "proximus.be",
543
934
  "scarlet.be"
544
935
  ]);
545
- function Ve(e) {
546
- const n = j(e);
547
- return n ? K.has(n) : !1;
936
+ function dn(e) {
937
+ const n = oe(e);
938
+ return n ? le.has(n) : !1;
548
939
  }
549
- function He(e) {
940
+ function mn(e) {
550
941
  if (!e) return !1;
551
942
  const n = e.trim().toLowerCase();
552
943
  return n === "tel" || n === "sms" || n === "whatsapp" || n === "fax";
553
944
  }
554
- function Be(e, n, t) {
945
+ function fn(e, n, t) {
555
946
  if (!e || !n) return null;
556
- const r = e.trim().toLowerCase();
557
- if (r === "tel" || r === "sms" || r === "whatsapp") {
558
- const i = E(n, t);
559
- return i ? `tel:${i}` : null;
947
+ const i = e.trim().toLowerCase();
948
+ if (i === "tel" || i === "sms" || i === "whatsapp") {
949
+ const r = C(n, t);
950
+ return r ? `tel:${r}` : null;
560
951
  }
561
- if (r === "fax") {
562
- const i = E(n, t);
563
- return i ? `fax:${i}` : null;
952
+ if (i === "fax") {
953
+ const r = C(n, t);
954
+ return r ? `fax:${r}` : null;
564
955
  }
565
- if (r === "mailto" || r === "email") {
566
- const i = M(n);
567
- return i ? `mailto:${i}` : null;
956
+ if (i === "mailto" || i === "email") {
957
+ const r = R(n);
958
+ return r ? `mailto:${r}` : null;
568
959
  }
569
960
  const a = n.trim().toLowerCase();
570
- return a ? `${r}:${a}` : null;
961
+ return a ? `${i}:${a}` : null;
571
962
  }
572
- const Y = [
963
+ const se = [
573
964
  /<blockquote/i,
574
965
  /class="?gmail_quote/i,
575
966
  // Gmail quote container
@@ -582,107 +973,107 @@ const Y = [
582
973
  // Outlook underscore separator before "From:"
583
974
  /\bOn\b[\s\S]{0,200}?\bwrote:/i
584
975
  // Gmail "On <date> <name> wrote:"
585
- ], m = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, z = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
586
- function q(e) {
976
+ ], D = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, ce = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
977
+ function pe(e) {
587
978
  const n = e.split(`
588
979
  `);
589
980
  for (let t = 0; t < n.length; t++)
590
- if (z.test(n[t]) || m.test(n[t]) && n.slice(t + 1, t + 4).some((r) => m.test(r)))
981
+ if (ce.test(n[t]) || D.test(n[t]) && n.slice(t + 1, t + 4).some((i) => D.test(i)))
591
982
  return n.slice(0, t).join(`
592
983
  `).trim();
593
984
  return e;
594
985
  }
595
- function b(e) {
986
+ function N(e) {
596
987
  let n = e;
597
988
  return n = n.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), n = n.replace(/<br\s*\/?>/gi, `
598
989
  `), n = n.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi, `
599
990
  `), n = n.replace(/<[^>]+>/g, ""), n = n.replace(/<[^>]*$/, ""), n;
600
991
  }
601
- function I(e) {
992
+ function O(e) {
602
993
  return e.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#39;/gi, "'").replace(/&#(\d+);/g, (n, t) => String.fromCharCode(Number(t))).replace(/&amp;/gi, "&");
603
994
  }
604
- function A(e) {
995
+ function L(e) {
605
996
  return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
606
997
  `).replace(/\n{3,}/g, `
607
998
 
608
999
  `).trim();
609
1000
  }
610
- function Fe(e) {
1001
+ function gn(e) {
611
1002
  if (typeof e != "string" || !e) return "";
612
1003
  let n = e.length;
613
- for (const i of Y) {
614
- const s = e.search(i);
615
- s >= 0 && s < n && (n = s);
1004
+ for (const r of se) {
1005
+ const o = e.search(r);
1006
+ o >= 0 && o < n && (n = o);
616
1007
  }
617
1008
  const t = e.slice(0, n);
618
- let r = A(I(b(t)));
619
- return r || (r = A(I(b(e)))), q(r) || r;
1009
+ let i = L(O(N(t)));
1010
+ return i || (i = L(O(N(e)))), pe(i) || i;
620
1011
  }
621
- const X = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, J = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
622
- function ve(e, n) {
623
- return !!(e && X.test(e) || n && J.test(n));
1012
+ const ue = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, de = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
1013
+ function hn(e, n) {
1014
+ return !!(e && ue.test(e) || n && de.test(n));
624
1015
  }
625
- const Q = 3, Z = 600;
626
- function We(e, n) {
627
- return e >= Q || n >= Z;
1016
+ const me = 3, fe = 600;
1017
+ function En(e, n) {
1018
+ return e >= me || n >= fe;
628
1019
  }
629
- function ee(e, n) {
630
- const t = new Set(e.disabledIntents ?? []), r = e.intentOverrides ?? {}, a = n.intents.filter((s) => !t.has(s.intent)).map((s) => te(s, r[s.intent]));
1020
+ function ge(e, n) {
1021
+ const t = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, a = n.intents.filter((o) => !t.has(o.intent)).map((o) => Ee(o, i[o.intent]));
631
1022
  if (!e.extraIntents || e.extraIntents.length === 0) return a;
632
- const i = new Set(a.map((s) => s.intent));
633
- for (const s of e.extraIntents)
634
- i.has(s.intent) || (a.push(s), i.add(s.intent));
1023
+ const r = new Set(a.map((o) => o.intent));
1024
+ for (const o of e.extraIntents)
1025
+ r.has(o.intent) || (a.push(o), r.add(o.intent));
635
1026
  return a;
636
1027
  }
637
- function ne(e, n) {
1028
+ function he(e, n) {
638
1029
  const t = {};
639
- for (const r of e.intents) {
640
- if (!r.togglable) continue;
641
- const a = n?.[r.intent];
642
- t[r.intent] = a ?? r.defaultEnabled ?? !0;
1030
+ for (const i of e.intents) {
1031
+ if (!i.togglable) continue;
1032
+ const a = n?.[i.intent];
1033
+ t[i.intent] = a ?? i.defaultEnabled ?? !0;
643
1034
  }
644
1035
  return t;
645
1036
  }
646
- function je(e, n) {
647
- const t = ne(e, n);
648
- return Object.entries(t).filter(([, r]) => !r).map(([r]) => r);
1037
+ function yn(e, n) {
1038
+ const t = he(e, n);
1039
+ return Object.entries(t).filter(([, i]) => !i).map(([i]) => i);
649
1040
  }
650
- function te(e, n) {
1041
+ function Ee(e, n) {
651
1042
  return n ? {
652
1043
  intent: n.intent ?? e.intent,
653
1044
  targetSchemes: n.targetSchemes ?? e.targetSchemes,
654
1045
  transport: n.transport ?? e.transport
655
1046
  } : e;
656
1047
  }
657
- function Ke(e, n) {
1048
+ function bn(e, n) {
658
1049
  const t = [];
659
- for (const r of e) {
660
- if (!r.enabled) continue;
661
- const a = n[r.providerId];
1050
+ for (const i of e) {
1051
+ if (!i.enabled) continue;
1052
+ const a = n[i.providerId];
662
1053
  if (a)
663
- for (const i of ee(r, a))
664
- t.push({ channel: r, description: a, capability: i });
1054
+ for (const r of ge(i, a))
1055
+ t.push({ channel: i, description: a, capability: r });
665
1056
  }
666
1057
  return t;
667
1058
  }
668
- function Ye(e, n) {
1059
+ function An(e, n) {
669
1060
  return n.filter((t) => t.capability.intent === e);
670
1061
  }
671
- function re(e, n) {
1062
+ function ye(e, n) {
672
1063
  return n.filter((t) => t.capability.targetSchemes.includes(e));
673
1064
  }
674
- function ze(e, n) {
675
- return re(e.scheme, n);
1065
+ function In(e, n) {
1066
+ return ye(e.scheme, n);
676
1067
  }
677
- function qe(e, n, t) {
678
- const r = [];
1068
+ function _n(e, n, t) {
1069
+ const i = [];
679
1070
  for (const a of e)
680
- for (const i of t)
681
- i.capability.intent === n && i.capability.targetSchemes.includes(a.scheme) && r.push({ channelIntent: i, endpoint: a });
682
- return r;
1071
+ for (const r of t)
1072
+ r.capability.intent === n && r.capability.targetSchemes.includes(a.scheme) && i.push({ channelIntent: r, endpoint: a });
1073
+ return i;
683
1074
  }
684
- var ae = /* @__PURE__ */ ((e) => (e.MAILTO = "mailto", e.SIP = "sip", e.TEL = "tel", e.WEBHOOK = "webhook", e.USERNAME = "username", e.ID = "id", e.CUSTOM = "custom", e.URL = "url", e.TELEGRAM = "telegram", e.WHATSAPP = "whatsapp", e.MESSENGER = "messenger", e.INSTAGRAM = "instagram", e.VIBER = "viber", e.SMS = "sms", e.FAX = "fax", e.TEAMS = "teams", e.CALENDAR = "calendar", e))(ae || {});
685
- const Xe = "message_window", Je = "message_templates", Qe = {
1075
+ var be = /* @__PURE__ */ ((e) => (e.MAILTO = "mailto", e.SIP = "sip", e.TEL = "tel", e.WEBHOOK = "webhook", e.USERNAME = "username", e.ID = "id", e.CUSTOM = "custom", e.URL = "url", e.TELEGRAM = "telegram", e.WHATSAPP = "whatsapp", e.MESSENGER = "messenger", e.INSTAGRAM = "instagram", e.VIBER = "viber", e.SMS = "sms", e.FAX = "fax", e.TEAMS = "teams", e.CALENDAR = "calendar", e))(be || {});
1076
+ const Tn = "message_window", Mn = "message_templates", Sn = {
686
1077
  // E-mail
687
1078
  FROM: "from",
688
1079
  TO: "to",
@@ -699,87 +1090,105 @@ const Xe = "message_window", Je = "message_templates", Qe = {
699
1090
  // Voice/conference
700
1091
  HOST: "host",
701
1092
  PARTICIPANT: "participant"
702
- }, Ze = (e, n) => ({ intent: e, ...n }), en = "folder_management", nn = "remote_search", tn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, rn = 9e4, an = "installation-id";
1093
+ }, vn = (e, n) => ({ intent: e, ...n }), Cn = "folder_management", Dn = "remote_search", Nn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, On = 9e4, Ln = "installation-id";
703
1094
  export {
704
- _ as AI_VENDORS,
705
- fe as CLASSIFY_VARS,
706
- oe as CORE_DIMENSIONS,
707
- ae as CommunicationScheme,
708
- Ue as DEFAULT_MEMORY_BUDGET,
709
- V as DEFAULT_PHONE_REGION,
710
- en as FEATURE_FOLDER_MANAGEMENT,
711
- nn as FEATURE_REMOTE_SEARCH,
712
- an as INSTALLATION_HEADER,
713
- Qe as InteractionParticipantRole,
714
- xe as MAX_MEMORY_BUDGET,
715
- ye as MAX_MEMORY_CHARS,
716
- ke as MIN_MEMORY_BUDGET,
717
- P as PAUSED_RUN_STATUSES,
718
- p as PHONE_REGIONS,
719
- rn as PRESENCE_ONLINE_WINDOW_MS,
720
- Je as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
721
- Xe as PROVIDER_FEATURE_MESSAGE_WINDOW,
722
- K as PUBLIC_EMAIL_DOMAINS,
723
- G as RELATED_SUBJECT_KINDS,
724
- Te as SIGNATURE_INTENTS,
725
- Z as SUMMARY_MIN_LAST_CHARS,
726
- Q as SUMMARY_MIN_MESSAGES,
727
- U as TERMINAL_RUN_STATUSES,
728
- pe as TRIGGER_VARS,
729
- tn as UNSUPPORTED,
730
- L as USAGE_DIMENSIONS,
731
- R as USAGE_DIMENSION_IDS,
732
- x as actingIdentityKey,
733
- me as actorKey,
734
- _e as aiVendorDefaultModel,
735
- Ae as aiVendorLabel,
736
- Se as aiVendorNeedsBaseUrl,
737
- Me as aiVendorsWith,
738
- he as applySignature,
739
- ie as buildActivityPreview,
740
- Ke as buildChannelIntents,
741
- Fe as cleanMessageText,
742
- Ze as defineIntent,
743
- je as disabledIntentsFromCapabilities,
744
- Ge as emailDomain,
745
- Be as endpointKey,
746
- ze as filterByEndpoint,
747
- Ye as filterByIntent,
748
- re as filterByTargetScheme,
749
- d as findAiVendor,
750
- le as flattenLocales,
751
- C as floorToPeriod,
752
- k as formatActingIdentity,
753
- D as formatPeriod,
754
- se as getActivitySeenUserIds,
755
- De as getContactEndpoints,
756
- Le as getShortTitle,
757
- Ne as getUrgencyScore,
758
- de as humanizeAction,
759
- Ce as isAssigned,
760
- Oe as isClosed,
761
- Re as isInteractionUnseen,
762
- ve as isLikelyBulk,
763
- Ie as isPaused,
764
- Ve as isPublicEmailDomain,
765
- be as isRetryable,
766
- $ as isTerminal,
767
- We as isThreadLongEnough,
768
- $e as looksLikeEmail,
769
- qe as matchContactToIntents,
770
- He as needsPhoneRegion,
771
- M as normalizeEmail,
772
- ge as parseActingIdentity,
773
- ce as periodsInRange,
774
- we as phoneSuffix,
775
- Ee as playbookActor,
776
- j as registrableDomain,
777
- Pe as relatedByDefault,
778
- ne as resolveAccountCapabilities,
779
- ee as resolveChannelIntents,
780
- w as resolveSignature,
781
- S as stripHtml,
782
- E as toE164,
783
- y as usageMetricId,
784
- ue as usageMetrics
1095
+ s as ACTIVITY_CATALOG,
1096
+ k as AI_VENDORS,
1097
+ K as ActivityTypeRegistry,
1098
+ Ne as BUILT_IN_ONLY,
1099
+ Ge as CLASSIFY_VARS,
1100
+ Re as CORE_DIMENSIONS,
1101
+ be as CommunicationScheme,
1102
+ ln as DEFAULT_MEMORY_BUDGET,
1103
+ ee as DEFAULT_PHONE_REGION,
1104
+ Cn as FEATURE_FOLDER_MANAGEMENT,
1105
+ Dn as FEATURE_REMOTE_SEARCH,
1106
+ Ln as INSTALLATION_HEADER,
1107
+ Sn as InteractionParticipantRole,
1108
+ on as MAX_MEMORY_BUDGET,
1109
+ an as MAX_MEMORY_CHARS,
1110
+ rn as MIN_MEMORY_BUDGET,
1111
+ X as PAUSED_RUN_STATUSES,
1112
+ y as PHONE_REGIONS,
1113
+ On as PRESENCE_ONLINE_WINDOW_MS,
1114
+ Mn as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
1115
+ Tn as PROVIDER_FEATURE_MESSAGE_WINDOW,
1116
+ le as PUBLIC_EMAIL_DOMAINS,
1117
+ Z as RELATED_SUBJECT_KINDS,
1118
+ qe as SIGNATURE_INTENTS,
1119
+ fe as SUMMARY_MIN_LAST_CHARS,
1120
+ me as SUMMARY_MIN_MESSAGES,
1121
+ q as TERMINAL_RUN_STATUSES,
1122
+ Ke as TRIGGER_VARS,
1123
+ Nn as UNSUPPORTED,
1124
+ B as USAGE_DIMENSIONS,
1125
+ F as USAGE_DIMENSION_IDS,
1126
+ z as actingIdentityKey,
1127
+ Ae as activityIconOf,
1128
+ De as activityJoinUrl,
1129
+ x as activitySnippet,
1130
+ U as activityTextParams,
1131
+ Ce as activityTimelineText,
1132
+ ke as activityTimestamp,
1133
+ l as activityTypeInfo,
1134
+ He as actorKey,
1135
+ We as aiVendorDefaultModel,
1136
+ Fe as aiVendorLabel,
1137
+ ze as aiVendorNeedsBaseUrl,
1138
+ Ye as aiVendorsWith,
1139
+ Xe as applySignature,
1140
+ Oe as buildActivityPreview,
1141
+ bn as buildChannelIntents,
1142
+ Me as carriesText,
1143
+ Ie as channelKindOf,
1144
+ gn as cleanMessageText,
1145
+ vn as defineIntent,
1146
+ yn as disabledIntentsFromCapabilities,
1147
+ un as emailDomain,
1148
+ fn as endpointKey,
1149
+ In as filterByEndpoint,
1150
+ An as filterByIntent,
1151
+ ye as filterByTargetScheme,
1152
+ E as findAiVendor,
1153
+ $e as flattenLocales,
1154
+ V as floorToPeriod,
1155
+ Y as formatActingIdentity,
1156
+ w as formatPeriod,
1157
+ Le as getActivitySeenUserIds,
1158
+ Je as getContactEndpoints,
1159
+ nn as getShortTitle,
1160
+ en as getUrgencyScore,
1161
+ Pe as humanizeAction,
1162
+ Qe as isAssigned,
1163
+ Ze as isClosed,
1164
+ tn as isInteractionUnseen,
1165
+ hn as isLikelyBulk,
1166
+ _e as isMessageType,
1167
+ Be as isPaused,
1168
+ ve as isPlaybookAuthoredType,
1169
+ dn as isPublicEmailDomain,
1170
+ Te as isReplyableType,
1171
+ je as isRetryable,
1172
+ J as isTerminal,
1173
+ En as isThreadLongEnough,
1174
+ cn as looksLikeEmail,
1175
+ _n as matchContactToIntents,
1176
+ Se as messageCountsAs,
1177
+ mn as needsPhoneRegion,
1178
+ R as normalizeEmail,
1179
+ we as parseActingIdentity,
1180
+ xe as periodsInRange,
1181
+ pn as phoneSuffix,
1182
+ Ve as playbookActor,
1183
+ g as readPath,
1184
+ oe as registrableDomain,
1185
+ sn as relatedByDefault,
1186
+ he as resolveAccountCapabilities,
1187
+ h as resolveActivityText,
1188
+ ge as resolveChannelIntents,
1189
+ Q as resolveSignature,
1190
+ $ as stripHtml,
1191
+ C as toE164,
1192
+ W as usageMetricId,
1193
+ Ue as usageMetrics
785
1194
  };