@opencxh/domain 1.134.14 → 1.136.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,4 +1,4 @@
1
- const Ce = 10, ve = 10, Ne = 10, Oe = 5, U = /* @__PURE__ */ new Set([
1
+ const De = 10, Le = 10, xe = 10, $e = 5, P = /* @__PURE__ */ new Set([
2
2
  "header",
3
3
  "section",
4
4
  "context",
@@ -8,85 +8,85 @@ const Ce = 10, ve = 10, Ne = 10, Oe = 5, U = /* @__PURE__ */ new Set([
8
8
  "actions",
9
9
  "attachments"
10
10
  ]);
11
- function m(e) {
11
+ function g(e) {
12
12
  if (typeof e == "string") return e.length > 0;
13
13
  if (!e || typeof e != "object") return !1;
14
- const n = e;
15
- return typeof n.key == "string" || typeof n.value == "string";
14
+ const t = e;
15
+ return typeof t.key == "string" || typeof t.value == "string";
16
16
  }
17
- function ke(e, n = () => {
17
+ function Re(e, t = () => {
18
18
  }) {
19
19
  if (!Array.isArray(e)) return [];
20
- const t = [];
20
+ const n = [];
21
21
  for (const i of e) {
22
- if (t.length >= 10) {
23
- n("more than 10 blocks; the rest was dropped");
22
+ if (n.length >= 10) {
23
+ t("more than 10 blocks; the rest was dropped");
24
24
  break;
25
25
  }
26
26
  if (!i || typeof i != "object") continue;
27
27
  const a = i;
28
- if (!U.has(a.type)) {
29
- n("unknown block type " + String(a.type));
28
+ if (!P.has(a.type)) {
29
+ t("unknown block type " + String(a.type));
30
30
  continue;
31
31
  }
32
32
  switch (a.type) {
33
33
  case "header":
34
- if (!m(a.text)) {
35
- n("a header without text");
34
+ if (!g(a.text)) {
35
+ t("a header without text");
36
36
  continue;
37
37
  }
38
38
  break;
39
39
  case "context":
40
- if (!m(a.text)) {
41
- n("a context block without text");
40
+ if (!g(a.text)) {
41
+ t("a context block without text");
42
42
  continue;
43
43
  }
44
44
  break;
45
45
  case "image":
46
46
  if (!a.url || !a.alt) {
47
- n("an image without url or alt");
47
+ t("an image without url or alt");
48
48
  continue;
49
49
  }
50
50
  break;
51
51
  case "section":
52
- Array.isArray(a.fields) && a.fields.length > 10 && (n("more than 10 fields in a section"), a.fields = a.fields.slice(0, 10));
52
+ Array.isArray(a.fields) && a.fields.length > 10 && (t("more than 10 fields in a section"), a.fields = a.fields.slice(0, 10));
53
53
  break;
54
54
  case "list":
55
55
  if (!Array.isArray(a.items) || a.items.length === 0) {
56
- n("a list without items");
56
+ t("a list without items");
57
57
  continue;
58
58
  }
59
- a.items.length > 10 && (n("more than 10 list items"), a.items = a.items.slice(0, 10));
59
+ a.items.length > 10 && (t("more than 10 list items"), a.items = a.items.slice(0, 10));
60
60
  break;
61
61
  case "actions": {
62
- const r = Array.isArray(a.elements) ? a.elements : [], o = r.filter((s) => s && s.action_id && s.invoke && m(s.text));
63
- if (o.length !== r.length && n("an action without action_id, invoke or text"), o.length === 0) continue;
64
- o.length > 5 && n("more than 5 actions"), a.elements = o.slice(0, 5);
62
+ const r = Array.isArray(a.elements) ? a.elements : [], o = r.filter((s) => s && s.action_id && s.invoke && g(s.text));
63
+ if (o.length !== r.length && t("an action without action_id, invoke or text"), o.length === 0) continue;
64
+ o.length > 5 && t("more than 5 actions"), a.elements = o.slice(0, 5);
65
65
  break;
66
66
  }
67
67
  }
68
- t.push(a);
68
+ n.push(a);
69
69
  }
70
- return t;
70
+ return n;
71
71
  }
72
- function P(e) {
72
+ function w(e) {
73
73
  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();
74
74
  }
75
75
  function p(e) {
76
76
  if (!e || e < 0) return "";
77
- const n = Math.floor(e / 60), t = Math.floor(e % 60);
78
- return `${n}:${t.toString().padStart(2, "0")}`;
77
+ const t = Math.floor(e / 60), n = Math.floor(e % 60);
78
+ return `${t}:${n.toString().padStart(2, "0")}`;
79
79
  }
80
- function A(e) {
80
+ function _(e) {
81
81
  return e ? ` — ${Math.floor(e / 60)}m ${e % 60}s` : "";
82
82
  }
83
- function f(e) {
83
+ function h(e) {
84
84
  return e?.split("@")?.[0] || e || "";
85
85
  }
86
- function u(e) {
87
- return e.map((n) => n.name).join(", ");
86
+ function d(e) {
87
+ return e.map((t) => t.name).join(", ");
88
88
  }
89
- function _(e) {
89
+ function I(e) {
90
90
  return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
91
91
  }
92
92
  const c = {
@@ -96,21 +96,21 @@ const c = {
96
96
  channelKind: "voice",
97
97
  icon: "phone",
98
98
  snippet: () => "Gesprek gestart",
99
- timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${f(e.payload.from)}` : `Outbound call started — ${f(e.payload.to)}`
99
+ timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${h(e.payload.from)}` : `Outbound call started — ${h(e.payload.to)}`
100
100
  },
101
101
  VOICE_CALL_ANSWERED: {
102
102
  shape: "event",
103
103
  channelKind: "voice",
104
104
  icon: "phone",
105
105
  snippet: () => "Gesprek aangenomen",
106
- timeline: (e, n) => `Call answered — ${n}`
106
+ timeline: (e, t) => `Call answered — ${t}`
107
107
  },
108
108
  VOICE_CALL_HOLD: {
109
109
  shape: "event",
110
110
  channelKind: "voice",
111
111
  icon: "phone",
112
112
  snippet: () => "In de wacht",
113
- timeline: (e, n) => `Call on hold — ${n}`
113
+ timeline: (e, t) => `Call on hold — ${t}`
114
114
  },
115
115
  VOICE_CALL_UNHOLD: {
116
116
  shape: "event",
@@ -123,14 +123,14 @@ const c = {
123
123
  channelKind: "voice",
124
124
  icon: "phone",
125
125
  snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
126
- timeline: (e) => `Call ended${A(e.payload.duration)}`
126
+ timeline: (e) => `Call ended${_(e.payload.duration)}`
127
127
  },
128
128
  VOICE_CALL_MISSED: {
129
129
  shape: "event",
130
130
  channelKind: "voice",
131
131
  icon: "phone",
132
132
  snippet: () => "Gemiste oproep",
133
- timeline: (e) => `Missed call — ${f(e.payload.from)}`
133
+ timeline: (e) => `Missed call — ${h(e.payload.from)}`
134
134
  },
135
135
  VOICE_CALL_FAILED: {
136
136
  shape: "event",
@@ -204,7 +204,7 @@ const c = {
204
204
  replyable: !0,
205
205
  carriesText: !0,
206
206
  countsAs: "inbound_message",
207
- snippet: I
207
+ snippet: T
208
208
  },
209
209
  EMAIL_SENT: {
210
210
  shape: "message",
@@ -214,7 +214,7 @@ const c = {
214
214
  replyable: !0,
215
215
  carriesText: !0,
216
216
  countsAs: "outbound_message",
217
- snippet: I
217
+ snippet: T
218
218
  },
219
219
  /* ---- chat ---- */
220
220
  CHAT_MESSAGE_SENT: {
@@ -243,20 +243,20 @@ const c = {
243
243
  shape: "event",
244
244
  channelKind: "chat",
245
245
  icon: "message-circle",
246
- snippet: (e) => `${u(e.payload.members)} toegevoegd`,
246
+ snippet: (e) => `${d(e.payload.members)} toegevoegd`,
247
247
  timeline: (e) => {
248
- const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
249
- return `${n} joined the chat${t}`;
248
+ const t = d(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
249
+ return `${t} joined the chat${n}`;
250
250
  }
251
251
  },
252
252
  CHAT_MEMBER_LEFT: {
253
253
  shape: "event",
254
254
  channelKind: "chat",
255
255
  icon: "message-circle",
256
- snippet: (e) => `${u(e.payload.members)} verlaten`,
256
+ snippet: (e) => `${d(e.payload.members)} verlaten`,
257
257
  timeline: (e) => {
258
- const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
259
- return `${n} left the chat${t}`;
258
+ const t = d(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
259
+ return `${t} left the chat${n}`;
260
260
  }
261
261
  },
262
262
  CHAT_RENAMED: {
@@ -271,7 +271,7 @@ const c = {
271
271
  channelKind: "chat",
272
272
  icon: "message-circle",
273
273
  snippet: () => "Gesprek gestart",
274
- timeline: (e) => `${_(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
274
+ timeline: (e) => `${I(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
275
275
  joinUrl: (e) => e.payload.joinUrl
276
276
  },
277
277
  CHAT_CALL_ENDED: {
@@ -279,7 +279,7 @@ const c = {
279
279
  channelKind: "chat",
280
280
  icon: "message-circle",
281
281
  snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
282
- timeline: (e) => `${_(e.payload.callType)} ended${A(e.payload.duration)}`,
282
+ timeline: (e) => `${I(e.payload.callType)} ended${_(e.payload.duration)}`,
283
283
  joinUrl: (e) => e.payload.joinUrl
284
284
  },
285
285
  CHAT_EVENT: {
@@ -297,7 +297,7 @@ const c = {
297
297
  component: "communication:TranscriptionActivity",
298
298
  icon: "captions",
299
299
  carriesText: !0,
300
- snippet: (e) => (e.payload.segments ?? []).map((n) => n.text).join(" ")
300
+ snippet: (e) => (e.payload.segments ?? []).map((t) => t.text).join(" ")
301
301
  },
302
302
  COMMENT_ADDED: {
303
303
  shape: "note",
@@ -374,20 +374,20 @@ const c = {
374
374
  shape: "event",
375
375
  icon: "calendar",
376
376
  snippet: (e) => `${e.payload.name} deelgenomen`,
377
- timeline: (e, n) => `${n} joined the meeting`
377
+ timeline: (e, t) => `${t} joined the meeting`
378
378
  },
379
379
  MEETING_PARTICIPANT_LEFT: {
380
380
  shape: "event",
381
381
  icon: "calendar",
382
382
  snippet: (e) => `${e.payload.name} verlaten`,
383
- timeline: (e, n) => `${n} left the meeting`
383
+ timeline: (e, t) => `${t} left the meeting`
384
384
  },
385
385
  /* ---- interactie-levenscyclus ---- */
386
386
  INTERACTION_CREATED: {
387
387
  shape: "event",
388
388
  icon: "circle",
389
389
  snippet: () => "Interactie aangemaakt",
390
- timeline: (e, n) => `Interaction started by ${n}`
390
+ timeline: (e, t) => `Interaction started by ${t}`
391
391
  },
392
392
  INTERACTION_STATUS_CHANGED: {
393
393
  shape: "event",
@@ -395,97 +395,97 @@ const c = {
395
395
  displayNameKey: "communication:activity.INTERACTION_STATUS_CHANGED",
396
396
  icon: "circle-dot",
397
397
  snippet: (e) => `Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,
398
- timeline: (e, n) => `Status changed to ${e.payload.toStatus} by ${n}`
398
+ timeline: (e, t) => `Status changed to ${e.payload.toStatus} by ${t}`
399
399
  },
400
400
  INTERACTION_ASSIGNED: {
401
401
  shape: "event",
402
402
  icon: "user",
403
403
  snippet: () => "Interactie toegewezen",
404
- timeline: (e, n) => `Assigned by ${n}`
404
+ timeline: (e, t) => `Assigned by ${t}`
405
405
  }
406
406
  };
407
- function I(e) {
408
- const n = e.payload, t = n.bodySnippet?.trim() || P(n.body ?? "");
409
- return n.subject ? `${n.subject} — ${t}` : t;
407
+ function T(e) {
408
+ const t = e.payload, n = t.bodySnippet?.trim() || w(t.body ?? "");
409
+ return t.subject ? `${t.subject} — ${n}` : n;
410
410
  }
411
411
  function l(e) {
412
412
  return c[e];
413
413
  }
414
- function De(e) {
414
+ function Ue(e) {
415
415
  return l(e)?.icon ?? "circle";
416
416
  }
417
- function Le(e) {
417
+ function Pe(e) {
418
418
  return l(e)?.channelKind;
419
419
  }
420
- function $e(e) {
421
- const n = l(e)?.shape;
422
- return n === "message" || n === "note";
420
+ function we(e) {
421
+ const t = l(e)?.shape;
422
+ return t === "message" || t === "note";
423
423
  }
424
- function Re(e) {
424
+ function Ke(e) {
425
425
  return l(e)?.replyable === !0;
426
426
  }
427
- function xe(e) {
427
+ function Ge(e) {
428
428
  return l(e)?.carriesText === !0;
429
429
  }
430
- function Ue(e) {
430
+ function Ve(e) {
431
431
  return l(e)?.countsAs;
432
432
  }
433
- function Pe(e) {
433
+ function He(e) {
434
434
  return l(e)?.playbookAuthored === !0;
435
435
  }
436
- function w(e) {
437
- const n = l(e.type)?.snippet;
438
- return n ? n(e) : "";
436
+ function K(e) {
437
+ const t = l(e.type)?.snippet;
438
+ return t ? t(e) : "";
439
439
  }
440
- function we(e, n) {
441
- const t = l(e.type)?.timeline;
442
- return t ? t(e, n) : e.type.replace(/_/g, " ").toLowerCase();
440
+ function je(e, t) {
441
+ const n = l(e.type)?.timeline;
442
+ return n ? n(e, t) : e.type.replace(/_/g, " ").toLowerCase();
443
443
  }
444
- function Ke(e) {
445
- const n = l(e.type)?.joinUrl;
446
- return n ? n(e) : void 0;
444
+ function Be(e) {
445
+ const t = l(e.type)?.joinUrl;
446
+ return t ? t(e) : void 0;
447
447
  }
448
- function h(e, n) {
449
- let t = e;
450
- for (const i of n.split(".")) {
451
- if (t == null || typeof t != "object") return "";
452
- t = t[i];
448
+ function y(e, t) {
449
+ let n = e;
450
+ for (const i of t.split(".")) {
451
+ if (n == null || typeof n != "object") return "";
452
+ n = n[i];
453
453
  }
454
- return t == null ? "" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : "";
454
+ return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : "";
455
455
  }
456
- function y(e, n, t) {
456
+ function b(e, t, n) {
457
457
  if (e === void 0) return null;
458
458
  if (typeof e == "string") return e || null;
459
459
  if ("value" in e)
460
- return h(n, e.value) || null;
460
+ return y(t, e.value) || null;
461
461
  const i = {};
462
462
  for (const [r, o] of Object.entries(e.params ?? {}))
463
- i[r] = h(n, o);
464
- const a = t(e.key, i);
463
+ i[r] = y(t, o);
464
+ const a = n(e.key, i);
465
465
  return a === e.key ? null : a;
466
466
  }
467
- function K(e, n) {
467
+ function G(e, t) {
468
468
  if (!e || typeof e == "string" || "value" in e) return null;
469
- const t = {};
469
+ const n = {};
470
470
  for (const [i, a] of Object.entries(e.params ?? {}))
471
- t[i] = h(n, a);
472
- return { key: e.key, params: t };
471
+ n[i] = y(t, a);
472
+ return { key: e.key, params: n };
473
473
  }
474
- const G = (e) => e;
475
- function T(e) {
476
- const n = c[e];
474
+ const V = (e) => e;
475
+ function M(e) {
476
+ const t = c[e];
477
477
  return {
478
478
  type: e,
479
- shape: n.shape,
480
- channelKind: n.channelKind,
481
- icon: n.icon,
482
- replyable: n.replyable === !0,
483
- countsAs: n.countsAs,
484
- carriesText: n.carriesText === !0,
485
- triggerable: n.triggerable === !0,
486
- component: n.component,
479
+ shape: t.shape,
480
+ channelKind: t.channelKind,
481
+ icon: t.icon,
482
+ replyable: t.replyable === !0,
483
+ countsAs: t.countsAs,
484
+ carriesText: t.carriesText === !0,
485
+ triggerable: t.triggerable === !0,
486
+ component: t.component,
487
487
  builtIn: !0,
488
- displayNameKey: n.displayNameKey
488
+ displayNameKey: t.displayNameKey
489
489
  };
490
490
  }
491
491
  function S(e) {
@@ -503,82 +503,82 @@ function S(e) {
503
503
  displayNameKey: e.displayNameKey
504
504
  };
505
505
  }
506
- class V {
507
- constructor(n = [], t = G) {
508
- this.translate = t;
509
- for (const i of n)
506
+ class H {
507
+ constructor(t = [], n = V) {
508
+ this.translate = n;
509
+ for (const i of t)
510
510
  i?.type && (i.type in c || this.declared.has(i.type) || this.declared.set(i.type, i));
511
511
  }
512
512
  declared = /* @__PURE__ */ new Map();
513
- get(n) {
514
- if (n in c) return T(n);
515
- const t = this.declared.get(n);
516
- return t ? S(t) : void 0;
513
+ get(t) {
514
+ if (t in c) return M(t);
515
+ const n = this.declared.get(t);
516
+ return n ? S(n) : void 0;
517
517
  }
518
518
  /** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
519
519
  triggerable() {
520
- const n = Object.keys(c).filter((i) => c[i].triggerable).map(T), t = [...this.declared.values()].map(S).filter((i) => i.triggerable);
521
- return [...n, ...t];
520
+ const t = Object.keys(c).filter((i) => c[i].triggerable).map(M), n = [...this.declared.values()].map(S).filter((i) => i.triggerable);
521
+ return [...t, ...n];
522
522
  }
523
523
  /**
524
524
  * De tijdlijnregel. Ingebouwd komt uit de catalogus, gedeclareerd uit `text` + de
525
525
  * meegeleverde vertaling. Zonder bruikbare tekst valt het terug op de ontstreepte
526
526
  * typenaam — dezelfde regel die de feed altijd al toonde voor onbekende types.
527
527
  */
528
- timelineText(n, t) {
529
- const i = c[n.type];
530
- if (i?.timeline) return i.timeline(n, t);
531
- const a = this.declared.get(n.type);
532
- return y(a?.text, n, this.translate) ?? n.type.replace(/_/g, " ").toLowerCase();
528
+ timelineText(t, n) {
529
+ const i = c[t.type];
530
+ if (i?.timeline) return i.timeline(t, n);
531
+ const a = this.declared.get(t.type);
532
+ return b(a?.text, t, this.translate) ?? t.type.replace(/_/g, " ").toLowerCase();
533
533
  }
534
534
  /** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
535
- snippet(n) {
536
- const t = c[n.type];
537
- if (t?.snippet) return t.snippet(n);
538
- const i = this.declared.get(n.type);
539
- return y(i?.text, n, this.translate) ?? "";
535
+ snippet(t) {
536
+ const n = c[t.type];
537
+ if (n?.snippet) return n.snippet(t);
538
+ const i = this.declared.get(t.type);
539
+ return b(i?.text, t, this.translate) ?? "";
540
540
  }
541
541
  /** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
542
- descriptor(n) {
543
- return this.declared.get(n);
542
+ descriptor(t) {
543
+ return this.declared.get(t);
544
544
  }
545
545
  /** De declaratieve blokken van een type, als het er heeft. */
546
- blocks(n) {
547
- const t = this.declared.get(n)?.render;
548
- return t?.length ? t : void 0;
546
+ blocks(t) {
547
+ const n = this.declared.get(t)?.render;
548
+ return n?.length ? n : void 0;
549
549
  }
550
550
  /** De vertaler die bij deze registry hoort, voor het oplossen van blokteksten. */
551
551
  get translator() {
552
552
  return this.translate;
553
553
  }
554
554
  }
555
- const Ge = new V(), M = 140;
556
- function H(e) {
557
- const n = e.trim();
558
- return n.length <= M ? n : n.slice(0, M - 1).trimEnd() + "…";
555
+ const Fe = new H(), C = 140;
556
+ function j(e) {
557
+ const t = e.trim();
558
+ return t.length <= C ? t : t.slice(0, C - 1).trimEnd() + "…";
559
559
  }
560
- function Ve(e, n) {
561
- const t = K(n?.text, e), i = n ? y(n.text, e, (a) => a) : null;
560
+ function Xe(e, t) {
561
+ const n = G(t?.text, e), i = t ? b(t.text, e, (a) => a) : null;
562
562
  return {
563
563
  activityId: e.id,
564
564
  type: e.type,
565
- snippet: H(i ?? w(e)),
565
+ snippet: j(i ?? K(e)),
566
566
  authorName: e.author?.name ?? "",
567
567
  direction: e.direction,
568
568
  createdAt: e.createdAt ?? Date.now(),
569
- ...t ? { snippetKey: t.key, snippetParams: t.params } : {}
569
+ ...n ? { snippetKey: n.key, snippetParams: n.params } : {}
570
570
  };
571
571
  }
572
- function He(e, n, t = []) {
572
+ function We(e, t, n = []) {
573
573
  const i = e.createdAt;
574
574
  if (!i) return [];
575
- const a = new Set(t);
576
- 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);
575
+ const a = new Set(n);
576
+ return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(t).filter(([r, o]) => o >= i && !a.has(r)).map(([r]) => r);
577
577
  }
578
- function je(e) {
578
+ function Ye(e) {
579
579
  return e.createdAt ?? 0;
580
580
  }
581
- const Be = [
581
+ const ze = [
582
582
  { id: "agent", label: "Agent", labelSource: "user" },
583
583
  { id: "team", label: "Team", labelSource: "team" },
584
584
  { id: "inbox", label: "Inbox", labelSource: "inbox" },
@@ -588,57 +588,57 @@ const Be = [
588
588
  { id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
589
589
  { id: "time", label: "Tijd", labelSource: "raw" }
590
590
  ];
591
- function Fe(e) {
592
- const n = [];
593
- for (const t of Object.keys(e))
594
- for (const i of Object.keys(e[t]))
595
- n.push({ lang: t, key: i, value: e[t][i] });
596
- return n;
591
+ function qe(e) {
592
+ const t = [];
593
+ for (const n of Object.keys(e))
594
+ for (const i of Object.keys(e[n]))
595
+ t.push({ lang: n, key: i, value: e[n][i] });
596
+ return t;
597
597
  }
598
- function g(e) {
598
+ function E(e) {
599
599
  return e < 10 ? `0${e}` : `${e}`;
600
600
  }
601
- function j(e, n) {
602
- const t = new Date(e), i = `${t.getUTCFullYear()}-${g(t.getUTCMonth() + 1)}-${g(t.getUTCDate())}`;
603
- return n === "day" ? i : `${i}T${g(t.getUTCHours())}`;
601
+ function B(e, t) {
602
+ const n = new Date(e), i = `${n.getUTCFullYear()}-${E(n.getUTCMonth() + 1)}-${E(n.getUTCDate())}`;
603
+ return t === "day" ? i : `${i}T${E(n.getUTCHours())}`;
604
604
  }
605
- function B(e, n) {
606
- const t = new Date(e);
607
- return t.setUTCMinutes(0, 0, 0), n === "day" && t.setUTCHours(0), t.getTime();
605
+ function F(e, t) {
606
+ const n = new Date(e);
607
+ return n.setUTCMinutes(0, 0, 0), t === "day" && n.setUTCHours(0), n.getTime();
608
608
  }
609
- const F = 36e5, X = 864e5;
610
- function Xe(e, n, t) {
611
- const i = t === "hour" ? F : X, a = [];
612
- for (let r = B(e, t); r <= n; r += i)
613
- a.push(j(r, t));
609
+ const X = 36e5, W = 864e5;
610
+ function Je(e, t, n) {
611
+ const i = n === "hour" ? X : W, a = [];
612
+ for (let r = F(e, n); r <= t; r += i)
613
+ a.push(B(r, n));
614
614
  return a;
615
615
  }
616
- const W = [
616
+ const Y = [
617
617
  { id: "resource", label: "Resource", labelSource: "raw" },
618
618
  { id: "origin", label: "Herkomst", labelSource: "raw" }
619
- ], Y = W.map((e) => e.id);
620
- function z(e, n) {
621
- return `${e}.usage.${n}`;
622
- }
623
- function We(e, n) {
624
- return n.map((t) => ({
625
- id: z(e, t.unit),
626
- label: t.label,
619
+ ], z = Y.map((e) => e.id);
620
+ function q(e, t) {
621
+ return `${e}.usage.${t}`;
622
+ }
623
+ function Qe(e, t) {
624
+ return t.map((n) => ({
625
+ id: q(e, n.unit),
626
+ label: n.label,
627
627
  category: "Verbruik",
628
- valueType: t.valueType ?? "count",
628
+ valueType: n.valueType ?? "count",
629
629
  aggregation: "sum",
630
630
  supportedDimensions: [
631
631
  "provider",
632
- ...Y,
633
- ...t.extraDimensions ?? [],
632
+ ...z,
633
+ ...n.extraDimensions ?? [],
634
634
  "time"
635
635
  ]
636
636
  }));
637
637
  }
638
- function Ye(e) {
638
+ function Ze(e) {
639
639
  return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
640
640
  }
641
- const ze = [
641
+ const et = [
642
642
  { name: "text", type: "string" },
643
643
  { name: "subject", type: "string" },
644
644
  { name: "from", type: "string" },
@@ -661,7 +661,7 @@ const ze = [
661
661
  // een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
662
662
  { name: "contactId", type: "string" },
663
663
  { name: "companyId", type: "string" }
664
- ], qe = {
664
+ ], tt = {
665
665
  topics: [
666
666
  { name: "topic", type: "string" },
667
667
  { name: "confidence", type: "number" }
@@ -672,7 +672,7 @@ const ze = [
672
672
  ],
673
673
  extract: []
674
674
  };
675
- function q(e) {
675
+ function J(e) {
676
676
  switch (e.kind) {
677
677
  case "user":
678
678
  return `user:${e.userId}`;
@@ -682,22 +682,22 @@ function q(e) {
682
682
  return "org";
683
683
  }
684
684
  }
685
- function Je(e) {
685
+ function nt(e) {
686
686
  if (typeof e != "string") return;
687
- const n = e.trim();
688
- if (n === "org") return { kind: "org" };
689
- const t = n.indexOf(":");
690
- if (t <= 0) return;
691
- const i = n.slice(0, t), a = n.slice(t + 1).trim();
687
+ const t = e.trim();
688
+ if (t === "org") return { kind: "org" };
689
+ const n = t.indexOf(":");
690
+ if (n <= 0) return;
691
+ const i = t.slice(0, n), a = t.slice(n + 1).trim();
692
692
  if (a) {
693
693
  if (i === "user") return { kind: "user", userId: a };
694
694
  if (i === "team") return { kind: "team", teamId: a };
695
695
  }
696
696
  }
697
- function J(e) {
698
- return q(e);
697
+ function Q(e) {
698
+ return J(e);
699
699
  }
700
- function Qe(e) {
700
+ function it(e) {
701
701
  switch (e.kind) {
702
702
  case "personal":
703
703
  return { kind: "user", userId: e.userId };
@@ -707,22 +707,23 @@ function Qe(e) {
707
707
  return { kind: "org" };
708
708
  }
709
709
  }
710
- function Ze(e) {
711
- return J(e);
710
+ function at(e) {
711
+ return Q(e);
712
712
  }
713
- const Q = ["done", "escalated", "failed", "timed_out", "stopped"], Z = ["awaiting_approval", "awaiting_reply"];
714
- function ee(e) {
715
- return Q.includes(e);
713
+ const Z = ["done", "escalated", "failed", "timed_out", "stopped"], ee = ["awaiting_approval", "awaiting_reply"];
714
+ function te(e) {
715
+ return Z.includes(e);
716
716
  }
717
- function en(e) {
718
- return ee(e);
717
+ function rt(e) {
718
+ return te(e);
719
719
  }
720
- function nn(e) {
721
- return Z.includes(e);
720
+ function ot(e) {
721
+ return ee.includes(e);
722
722
  }
723
723
  const R = [
724
724
  {
725
725
  id: "openai",
726
+ attachmentKinds: ["image", "pdf"],
726
727
  label: "OpenAI",
727
728
  capabilities: ["chat", "transcription", "embedding"],
728
729
  defaultModel: "gpt-5-mini",
@@ -730,6 +731,7 @@ const R = [
730
731
  },
731
732
  {
732
733
  id: "gemini",
734
+ attachmentKinds: ["image", "pdf"],
733
735
  label: "Google Gemini",
734
736
  capabilities: ["chat", "transcription", "embedding"],
735
737
  defaultModel: "gemini-3.5-flash",
@@ -737,6 +739,7 @@ const R = [
737
739
  },
738
740
  {
739
741
  id: "anthropic",
742
+ attachmentKinds: ["image", "pdf"],
740
743
  label: "Anthropic",
741
744
  capabilities: ["chat"],
742
745
  defaultModel: "claude-haiku-4-5",
@@ -808,53 +811,56 @@ const R = [
808
811
  defaultModel: "default"
809
812
  }
810
813
  ];
811
- function E(e) {
812
- return R.find((n) => n.id === e);
814
+ function f(e) {
815
+ return R.find((t) => t.id === e);
813
816
  }
814
- function tn(e) {
815
- return E(e)?.label ?? e;
817
+ function st(e) {
818
+ return f(e)?.label ?? e;
816
819
  }
817
- function an(e, n = "gpt-5-mini") {
818
- return E(e)?.defaultModel ?? n;
820
+ function lt(e, t = "gpt-5-mini") {
821
+ return f(e)?.defaultModel ?? t;
819
822
  }
820
- function rn(e) {
821
- return R.filter((n) => n.capabilities.includes(e));
823
+ function ct(e) {
824
+ return R.filter((t) => t.capabilities.includes(e));
822
825
  }
823
- function on(e) {
824
- const n = E(e);
825
- return !!n && !n.baseUrl;
826
+ function ut(e) {
827
+ const t = f(e);
828
+ return !!t && !t.baseUrl;
826
829
  }
827
- const sn = /* @__PURE__ */ new Set(["mail", "message"]);
828
- function ne(e, n) {
829
- const t = e.settings?.signatures?.[n];
830
- return !t || !t.enabled || !t.body || t.body.trim() === "" ? null : t;
830
+ function pt(e, t) {
831
+ return t === "text" ? !0 : f(e)?.attachmentKinds?.includes(t) === !0;
831
832
  }
832
- function ln(e, n, t, i = "html") {
833
- if (!e) return t;
834
- const a = ne(e, n);
835
- return a ? `${t}${i === "text" ? `
833
+ const dt = /* @__PURE__ */ new Set(["mail", "message"]);
834
+ function ne(e, t) {
835
+ const n = e.settings?.signatures?.[t];
836
+ return !n || !n.enabled || !n.body || n.body.trim() === "" ? null : n;
837
+ }
838
+ function mt(e, t, n, i = "html") {
839
+ if (!e) return n;
840
+ const a = ne(e, t);
841
+ return a ? `${n}${i === "text" ? `
836
842
 
837
- ` : n === "mail" ? "<br><br>-- <br>" : "<br><br>"}${a.body}` : t;
843
+ ` : t === "mail" ? "<br><br>-- <br>" : "<br><br>"}${a.body}` : n;
838
844
  }
839
- function cn(e) {
845
+ function ft(e) {
840
846
  return e.endpoints ?? [];
841
847
  }
842
- const pn = (e) => !!e.assignedUserId || !!e.assignedInboxId, un = (e) => e.status === "closed", dn = (e) => ({
848
+ const gt = (e) => !!e.assignedUserId || !!e.assignedInboxId, ht = (e) => e.status === "closed", Et = (e) => ({
843
849
  urgent: 10,
844
850
  high: 5,
845
851
  normal: 2,
846
852
  low: 1
847
- })[e.priority] || 0, mn = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
848
- function fn(e, n) {
849
- return e.lastActivityAt ? !(e.seenBy ?? []).includes(n) : !1;
853
+ })[e.priority] || 0, yt = (e, t = 30) => e.title?.length <= t ? e.title : `${e.title.substring(0, t)}...`;
854
+ function bt(e, t) {
855
+ return e.lastActivityAt ? !(e.seenBy ?? []).includes(t) : !1;
850
856
  }
851
- const gn = 2e3, hn = 500, yn = 12e3, En = 4e3, te = ["contact", "company"];
852
- function bn(e) {
857
+ const At = 2e3, _t = 500, It = 12e3, Tt = 4e3, ie = ["contact", "company"];
858
+ function Mt(e) {
853
859
  if (!e) return !1;
854
- const n = e.slice(0, e.indexOf(":"));
855
- return te.includes(n);
860
+ const t = e.slice(0, e.indexOf(":"));
861
+ return ie.includes(t);
856
862
  }
857
- const b = {
863
+ const A = {
858
864
  // The lower bounds are deliberately generous: service ranges (0800/0900) are
859
865
  // shorter than geographic numbers, and a too-strict minimum silently drops them.
860
866
  // An over-permissive key is harmless — it simply matches nothing.
@@ -877,81 +883,81 @@ const b = {
877
883
  PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
878
884
  US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
879
885
  CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
880
- }, ie = "NL", ae = 15, re = 8, oe = Array.from(
881
- new Set(Object.values(b).map((e) => e.callingCode))
882
- ).sort((e, n) => n.length - e.length);
883
- function C(e) {
886
+ }, ae = "NL", re = 15, oe = 8, se = Array.from(
887
+ new Set(Object.values(A).map((e) => e.callingCode))
888
+ ).sort((e, t) => t.length - e.length);
889
+ function N(e) {
884
890
  if (e)
885
- return b[e.trim().toUpperCase()];
891
+ return A[e.trim().toUpperCase()];
886
892
  }
887
- function d(e, n) {
888
- return e.length >= n.nsnMin && e.length <= n.nsnMax;
893
+ function m(e, t) {
894
+ return e.length >= t.nsnMin && e.length <= t.nsnMax;
889
895
  }
890
896
  function v(e) {
891
- if (e.length > ae) return null;
892
- for (const n of oe) {
893
- if (!e.startsWith(n)) continue;
894
- const t = e.slice(n.length);
895
- for (const i of Object.values(b)) {
896
- if (i.callingCode !== n) continue;
897
- const a = i.trunkPrefix, r = a && t.startsWith(a) ? t.slice(a.length) : t;
898
- if (d(r, i)) return `+${n}${r}`;
897
+ if (e.length > re) return null;
898
+ for (const t of se) {
899
+ if (!e.startsWith(t)) continue;
900
+ const n = e.slice(t.length);
901
+ for (const i of Object.values(A)) {
902
+ if (i.callingCode !== t) continue;
903
+ const a = i.trunkPrefix, r = a && n.startsWith(a) ? n.slice(a.length) : n;
904
+ if (m(r, i)) return `+${t}${r}`;
899
905
  }
900
906
  return null;
901
907
  }
902
- return e.length < re ? null : `+${e}`;
908
+ return e.length < oe ? null : `+${e}`;
903
909
  }
904
- function se(e) {
905
- let n = e.trim();
906
- const t = n.match(/^(sips?|tel|whatsapp):/i);
907
- t && (n = n.slice(t[0].length));
908
- const i = n.indexOf("@");
909
- return i >= 0 && (n = n.slice(0, i)), n.trim();
910
+ function le(e) {
911
+ let t = e.trim();
912
+ const n = t.match(/^(sips?|tel|whatsapp):/i);
913
+ n && (t = t.slice(n[0].length));
914
+ const i = t.indexOf("@");
915
+ return i >= 0 && (t = t.slice(0, i)), t.trim();
910
916
  }
911
- function An(e) {
917
+ function St(e) {
912
918
  if (!e) return !1;
913
- const n = e.indexOf("@");
914
- if (n <= 0) return !1;
915
- const t = e.slice(0, n).trim();
916
- return !/^[+\d\s().-]+$/.test(t);
919
+ const t = e.indexOf("@");
920
+ if (t <= 0) return !1;
921
+ const n = e.slice(0, t).trim();
922
+ return !/^[+\d\s().-]+$/.test(n);
917
923
  }
918
- function N(e, n) {
924
+ function O(e, t) {
919
925
  if (!e) return null;
920
- const t = se(e);
921
- if (!t) return null;
922
- const i = t.startsWith("+"), a = t.replace(/\D/g, "");
926
+ const n = le(e);
927
+ if (!n) return null;
928
+ const i = n.startsWith("+"), a = n.replace(/\D/g, "");
923
929
  if (!a) return null;
924
930
  if (i) return v(a);
925
931
  if (a.startsWith("00")) return v(a.slice(2));
926
- const r = C(n) ?? C(ie);
932
+ const r = N(t) ?? N(ae);
927
933
  if (!r) return null;
928
934
  const o = r.trunkPrefix;
929
935
  if (o && a.startsWith(o)) {
930
936
  const s = a.slice(o.length);
931
- return d(s, r) ? `+${r.callingCode}${s}` : null;
937
+ return m(s, r) ? `+${r.callingCode}${s}` : null;
932
938
  }
933
939
  if (a.startsWith(r.callingCode)) {
934
940
  const s = a.slice(r.callingCode.length);
935
- if (d(s, r)) return `+${r.callingCode}${s}`;
941
+ if (m(s, r)) return `+${r.callingCode}${s}`;
936
942
  }
937
- return !o && d(a, r) ? `+${r.callingCode}${a}` : null;
943
+ return !o && m(a, r) ? `+${r.callingCode}${a}` : null;
938
944
  }
939
- function _n(e, n = 9) {
940
- const t = (e ?? "").replace(/\D/g, "");
941
- return t.length < n ? null : t.slice(-n);
945
+ function Ct(e, t = 9) {
946
+ const n = (e ?? "").replace(/\D/g, "");
947
+ return n.length < t ? null : n.slice(-t);
942
948
  }
943
- function x(e) {
949
+ function U(e) {
944
950
  if (!e) return null;
945
- const n = e.trim().toLowerCase(), t = n.lastIndexOf("@");
946
- if (t <= 0 || t === n.length - 1) return null;
947
- const i = n.slice(0, t).split("+")[0], a = n.slice(t + 1);
951
+ const t = e.trim().toLowerCase(), n = t.lastIndexOf("@");
952
+ if (n <= 0 || n === t.length - 1) return null;
953
+ const i = t.slice(0, n).split("+")[0], a = t.slice(n + 1);
948
954
  return !i || !a.includes(".") ? null : `${i}@${a}`;
949
955
  }
950
- function In(e) {
951
- const n = x(e);
952
- return n ? n.slice(n.lastIndexOf("@") + 1) : null;
956
+ function Nt(e) {
957
+ const t = U(e);
958
+ return t ? t.slice(t.lastIndexOf("@") + 1) : null;
953
959
  }
954
- const le = /* @__PURE__ */ new Set([
960
+ const ce = /* @__PURE__ */ new Set([
955
961
  "co.uk",
956
962
  "org.uk",
957
963
  "gov.uk",
@@ -961,12 +967,12 @@ const le = /* @__PURE__ */ new Set([
961
967
  "com.br",
962
968
  "co.za"
963
969
  ]);
964
- function ce(e) {
970
+ function ue(e) {
965
971
  if (!e) return null;
966
- const n = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
967
- if (n.length < 2) return null;
968
- const t = n.slice(-2).join(".");
969
- return le.has(t) && n.length >= 3 ? n.slice(-3).join(".") : t;
972
+ const t = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
973
+ if (t.length < 2) return null;
974
+ const n = t.slice(-2).join(".");
975
+ return ce.has(n) && t.length >= 3 ? t.slice(-3).join(".") : n;
970
976
  }
971
977
  const pe = /* @__PURE__ */ new Set([
972
978
  "gmail.com",
@@ -1013,44 +1019,44 @@ const pe = /* @__PURE__ */ new Set([
1013
1019
  "proximus.be",
1014
1020
  "scarlet.be"
1015
1021
  ]);
1016
- function Tn(e) {
1017
- const n = ce(e);
1018
- return n ? pe.has(n) : !1;
1022
+ function vt(e) {
1023
+ const t = ue(e);
1024
+ return t ? pe.has(t) : !1;
1019
1025
  }
1020
- function Sn(e) {
1026
+ function Ot(e) {
1021
1027
  if (!e) return !1;
1022
- const n = e.trim().toLowerCase();
1023
- return n === "tel" || n === "sms" || n === "whatsapp" || n === "fax";
1028
+ const t = e.trim().toLowerCase();
1029
+ return t === "tel" || t === "sms" || t === "whatsapp" || t === "fax";
1024
1030
  }
1025
- function Mn(e, n, t) {
1026
- if (!e || !n) return null;
1031
+ function kt(e, t, n) {
1032
+ if (!e || !t) return null;
1027
1033
  const i = e.trim().toLowerCase();
1028
1034
  if (i === "tel" || i === "sms" || i === "whatsapp") {
1029
- const r = N(n, t);
1035
+ const r = O(t, n);
1030
1036
  return r ? `tel:${r}` : null;
1031
1037
  }
1032
1038
  if (i === "fax") {
1033
- const r = N(n, t);
1039
+ const r = O(t, n);
1034
1040
  return r ? `fax:${r}` : null;
1035
1041
  }
1036
1042
  if (i === "mailto" || i === "email") {
1037
- const r = x(n);
1043
+ const r = U(t);
1038
1044
  return r ? `mailto:${r}` : null;
1039
1045
  }
1040
- const a = n.trim().toLowerCase();
1046
+ const a = t.trim().toLowerCase();
1041
1047
  return a ? `${i}:${a}` : null;
1042
1048
  }
1043
- const ue = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, de = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
1044
- function Cn(e) {
1049
+ const de = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, me = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
1050
+ function Dt(e) {
1045
1051
  if (typeof e != "string" || !e) return "";
1046
- let n = e;
1047
- return n = n.replace(/```[a-z]*\n?/gi, "").replace(/~~~[a-z]*\n?/gi, ""), n = n.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1"), n = n.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1"), n = n.replace(/\[([^\]]*)\]\[[^\]]*\]/g, "$1"), n = n.replace(/<((?:https?|mailto):[^>\s]+)>/gi, "$1"), n = n.split(`
1052
+ let t = e;
1053
+ return t = t.replace(/```[a-z]*\n?/gi, "").replace(/~~~[a-z]*\n?/gi, ""), t = t.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\[[^\]]*\]/g, "$1"), t = t.replace(/<((?:https?|mailto):[^>\s]+)>/gi, "$1"), t = t.split(`
1048
1054
  `).map(
1049
- (t) => t.replace(/^\s{0,3}#{1,6}\s+/, "").replace(/^\s{0,3}>\s?/, "").replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+[.)]\s+/, "").replace(/^\s*(?:[-*_]\s*){3,}$/, "")
1055
+ (n) => n.replace(/^\s{0,3}#{1,6}\s+/, "").replace(/^\s{0,3}>\s?/, "").replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+[.)]\s+/, "").replace(/^\s*(?:[-*_]\s*){3,}$/, "")
1050
1056
  ).join(`
1051
- `), n = n.replace(ue, "$2"), n = n.replace(de, "$2"), n = n.replace(/~~(?=\S)([\s\S]*?\S)~~/g, "$1"), n = n.replace(/`([^`\n]+)`/g, "$1"), n.replace(/\s+/g, " ").trim();
1057
+ `), t = t.replace(de, "$2"), t = t.replace(me, "$2"), t = t.replace(/~~(?=\S)([\s\S]*?\S)~~/g, "$1"), t = t.replace(/`([^`\n]+)`/g, "$1"), t.replace(/\s+/g, " ").trim();
1052
1058
  }
1053
- const me = [
1059
+ const fe = [
1054
1060
  /<blockquote/i,
1055
1061
  /class="?gmail_quote/i,
1056
1062
  // Gmail quote container
@@ -1063,27 +1069,27 @@ const me = [
1063
1069
  // Outlook underscore separator before "From:"
1064
1070
  /\bOn\b[\s\S]{0,200}?\bwrote:/i
1065
1071
  // Gmail "On <date> <name> wrote:"
1066
- ], O = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, fe = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
1067
- function ge(e) {
1068
- const n = e.split(`
1072
+ ], k = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, ge = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
1073
+ function he(e) {
1074
+ const t = e.split(`
1069
1075
  `);
1070
- for (let t = 0; t < n.length; t++)
1071
- if (fe.test(n[t]) || O.test(n[t]) && n.slice(t + 1, t + 4).some((i) => O.test(i)))
1072
- return n.slice(0, t).join(`
1076
+ for (let n = 0; n < t.length; n++)
1077
+ if (ge.test(t[n]) || k.test(t[n]) && t.slice(n + 1, n + 4).some((i) => k.test(i)))
1078
+ return t.slice(0, n).join(`
1073
1079
  `).trim();
1074
1080
  return e;
1075
1081
  }
1076
- function k(e) {
1077
- let n = e;
1078
- return n = n.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), n = n.replace(/<br\s*\/?>/gi, `
1079
- `), n = n.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi, `
1080
- `), n = n.replace(/<[^>]+>/g, ""), n = n.replace(/<[^>]*$/, ""), n;
1081
- }
1082
1082
  function D(e) {
1083
- return !Number.isInteger(e) || e < 0 || e > 1114111 ? null : String.fromCodePoint(e);
1083
+ let t = e;
1084
+ return t = t.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), t = t.replace(/<br\s*\/?>/gi, `
1085
+ `), t = t.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi, `
1086
+ `), t = t.replace(/<[^>]+>/g, ""), t = t.replace(/<[^>]*$/, ""), t;
1084
1087
  }
1085
1088
  function L(e) {
1086
- return e.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#(\d+);/g, (n, t) => D(Number(t)) ?? n).replace(/&#x([0-9a-f]+);/gi, (n, t) => D(parseInt(t, 16)) ?? n).replace(/&amp;/gi, "&");
1089
+ return !Number.isInteger(e) || e < 0 || e > 1114111 ? null : String.fromCodePoint(e);
1090
+ }
1091
+ function x(e) {
1092
+ return e.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&quot;/gi, '"').replace(/&#(\d+);/g, (t, n) => L(Number(n)) ?? t).replace(/&#x([0-9a-f]+);/gi, (t, n) => L(parseInt(n, 16)) ?? t).replace(/&amp;/gi, "&");
1087
1093
  }
1088
1094
  function $(e) {
1089
1095
  return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
@@ -1091,82 +1097,105 @@ function $(e) {
1091
1097
 
1092
1098
  `).trim();
1093
1099
  }
1094
- function vn(e) {
1100
+ function Lt(e) {
1095
1101
  if (typeof e != "string" || !e) return "";
1096
- let n = e.length;
1097
- for (const r of me) {
1102
+ let t = e.length;
1103
+ for (const r of fe) {
1098
1104
  const o = e.search(r);
1099
- o >= 0 && o < n && (n = o);
1105
+ o >= 0 && o < t && (t = o);
1100
1106
  }
1101
- const t = e.slice(0, n);
1102
- let i = $(L(k(t)));
1103
- return i || (i = $(L(k(e)))), ge(i) || i;
1104
- }
1105
- const he = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, ye = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
1106
- function Nn(e, n) {
1107
- return !!(e && he.test(e) || n && ye.test(n));
1108
- }
1109
- const Ee = 3, be = 600;
1110
- function On(e, n) {
1111
- return e >= Ee || n >= be;
1112
- }
1113
- function Ae(e, n) {
1114
- const t = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, a = n.intents.filter((o) => !t.has(o.intent)).map((o) => Ie(o, i[o.intent]));
1107
+ const n = e.slice(0, t);
1108
+ let i = $(x(D(n)));
1109
+ return i || (i = $(x(D(e)))), he(i) || i;
1110
+ }
1111
+ const Ee = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, ye = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
1112
+ function xt(e, t) {
1113
+ return !!(e && Ee.test(e) || t && ye.test(t));
1114
+ }
1115
+ const be = 3, Ae = 600;
1116
+ function $t(e, t) {
1117
+ return e >= be || t >= Ae;
1118
+ }
1119
+ const _e = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "image/gif", "image/webp"]), Ie = /* @__PURE__ */ new Set([
1120
+ "text/plain",
1121
+ "text/markdown",
1122
+ "text/csv",
1123
+ "application/json",
1124
+ "text/html",
1125
+ "application/xml",
1126
+ "text/xml"
1127
+ ]);
1128
+ function Te(e) {
1129
+ const t = (e ?? "").trim().toLowerCase().split(";")[0];
1130
+ return t ? _e.has(t) ? "image" : t === "application/pdf" ? "pdf" : Ie.has(t) ? "text" : t.startsWith("audio/") ? "audio" : "unsupported" : "unsupported";
1131
+ }
1132
+ const u = 1024 * 1024, Me = {
1133
+ image: 5 * u,
1134
+ pdf: 20 * u,
1135
+ text: 1 * u,
1136
+ audio: 20 * u
1137
+ }, Rt = 25 * u, Ut = 5;
1138
+ function Pt(e, t) {
1139
+ const n = Te(e);
1140
+ return n === "unsupported" ? "unsupported" : t > Me[n] ? "too-large" : null;
1141
+ }
1142
+ function Se(e, t) {
1143
+ const n = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, a = t.intents.filter((o) => !n.has(o.intent)).map((o) => Ne(o, i[o.intent]));
1115
1144
  if (!e.extraIntents || e.extraIntents.length === 0) return a;
1116
1145
  const r = new Set(a.map((o) => o.intent));
1117
1146
  for (const o of e.extraIntents)
1118
1147
  r.has(o.intent) || (a.push(o), r.add(o.intent));
1119
1148
  return a;
1120
1149
  }
1121
- function _e(e, n) {
1122
- const t = {};
1150
+ function Ce(e, t) {
1151
+ const n = {};
1123
1152
  for (const i of e.intents) {
1124
1153
  if (!i.togglable) continue;
1125
- const a = n?.[i.intent];
1126
- t[i.intent] = a ?? i.defaultEnabled ?? !0;
1154
+ const a = t?.[i.intent];
1155
+ n[i.intent] = a ?? i.defaultEnabled ?? !0;
1127
1156
  }
1128
- return t;
1157
+ return n;
1129
1158
  }
1130
- function kn(e, n) {
1131
- const t = _e(e, n);
1132
- return Object.entries(t).filter(([, i]) => !i).map(([i]) => i);
1159
+ function wt(e, t) {
1160
+ const n = Ce(e, t);
1161
+ return Object.entries(n).filter(([, i]) => !i).map(([i]) => i);
1133
1162
  }
1134
- function Ie(e, n) {
1135
- return n ? {
1136
- intent: n.intent ?? e.intent,
1137
- targetSchemes: n.targetSchemes ?? e.targetSchemes,
1138
- transport: n.transport ?? e.transport
1163
+ function Ne(e, t) {
1164
+ return t ? {
1165
+ intent: t.intent ?? e.intent,
1166
+ targetSchemes: t.targetSchemes ?? e.targetSchemes,
1167
+ transport: t.transport ?? e.transport
1139
1168
  } : e;
1140
1169
  }
1141
- function Dn(e, n) {
1142
- const t = [];
1170
+ function Kt(e, t) {
1171
+ const n = [];
1143
1172
  for (const i of e) {
1144
1173
  if (!i.enabled) continue;
1145
- const a = n[i.providerId];
1174
+ const a = t[i.providerId];
1146
1175
  if (a)
1147
- for (const r of Ae(i, a))
1148
- t.push({ channel: i, description: a, capability: r });
1176
+ for (const r of Se(i, a))
1177
+ n.push({ channel: i, description: a, capability: r });
1149
1178
  }
1150
- return t;
1179
+ return n;
1151
1180
  }
1152
- function Ln(e, n) {
1153
- return n.filter((t) => t.capability.intent === e);
1181
+ function Gt(e, t) {
1182
+ return t.filter((n) => n.capability.intent === e);
1154
1183
  }
1155
- function Te(e, n) {
1156
- return n.filter((t) => t.capability.targetSchemes.includes(e));
1184
+ function ve(e, t) {
1185
+ return t.filter((n) => n.capability.targetSchemes.includes(e));
1157
1186
  }
1158
- function $n(e, n) {
1159
- return Te(e.scheme, n);
1187
+ function Vt(e, t) {
1188
+ return ve(e.scheme, t);
1160
1189
  }
1161
- function Rn(e, n, t) {
1190
+ function Ht(e, t, n) {
1162
1191
  const i = [];
1163
1192
  for (const a of e)
1164
- for (const r of t)
1165
- r.capability.intent === n && r.capability.targetSchemes.includes(a.scheme) && i.push({ channelIntent: r, endpoint: a });
1193
+ for (const r of n)
1194
+ r.capability.intent === t && r.capability.targetSchemes.includes(a.scheme) && i.push({ channelIntent: r, endpoint: a });
1166
1195
  return i;
1167
1196
  }
1168
- var Se = /* @__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))(Se || {});
1169
- const Me = {
1197
+ var Oe = /* @__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))(Oe || {});
1198
+ const ke = {
1170
1199
  mailto: "mail",
1171
1200
  sip: "tel",
1172
1201
  tel: "tel",
@@ -1188,10 +1217,10 @@ const Me = {
1188
1217
  id: "note",
1189
1218
  custom: "note"
1190
1219
  };
1191
- function xn(e) {
1192
- return e ? Me[e] ?? "note" : "note";
1220
+ function jt(e) {
1221
+ return e ? ke[e] ?? "note" : "note";
1193
1222
  }
1194
- const Un = "message_window", Pn = "message_templates", wn = {
1223
+ const Bt = "message_window", Ft = "message_templates", Xt = {
1195
1224
  // E-mail
1196
1225
  FROM: "from",
1197
1226
  TO: "to",
@@ -1208,112 +1237,118 @@ const Un = "message_window", Pn = "message_templates", wn = {
1208
1237
  // Voice/conference
1209
1238
  HOST: "host",
1210
1239
  PARTICIPANT: "participant"
1211
- }, Kn = (e, n) => ({ intent: e, ...n }), Gn = "folder_management", Vn = "remote_search", Hn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, jn = 9e4, Bn = "installation-id";
1240
+ }, Wt = (e, t) => ({ intent: e, ...t }), Yt = "folder_management", zt = "remote_search", qt = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, Jt = 9e4, Qt = "installation-id";
1212
1241
  export {
1213
1242
  c as ACTIVITY_CATALOG,
1243
+ Me as AI_ATTACHMENT_LIMITS,
1244
+ Ut as AI_ATTACHMENT_MAX_PER_TURN,
1245
+ Rt as AI_ATTACHMENT_TURN_BUDGET,
1214
1246
  R as AI_VENDORS,
1215
- V as ActivityTypeRegistry,
1216
- Ge as BUILT_IN_ONLY,
1217
- qe as CLASSIFY_VARS,
1218
- Be as CORE_DIMENSIONS,
1219
- Se as CommunicationScheme,
1220
- En as DEFAULT_MEMORY_BUDGET,
1221
- ie as DEFAULT_PHONE_REGION,
1222
- Gn as FEATURE_FOLDER_MANAGEMENT,
1223
- Vn as FEATURE_REMOTE_SEARCH,
1224
- Bn as INSTALLATION_HEADER,
1225
- wn as InteractionParticipantRole,
1226
- Oe as MAX_ACTIONS,
1227
- Ce as MAX_BLOCKS,
1228
- ve as MAX_FIELDS,
1229
- Ne as MAX_LIST_ITEMS,
1230
- yn as MAX_MEMORY_BUDGET,
1231
- gn as MAX_MEMORY_CHARS,
1232
- hn as MIN_MEMORY_BUDGET,
1233
- Z as PAUSED_RUN_STATUSES,
1234
- b as PHONE_REGIONS,
1235
- jn as PRESENCE_ONLINE_WINDOW_MS,
1236
- Pn as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
1237
- Un as PROVIDER_FEATURE_MESSAGE_WINDOW,
1247
+ H as ActivityTypeRegistry,
1248
+ Fe as BUILT_IN_ONLY,
1249
+ tt as CLASSIFY_VARS,
1250
+ ze as CORE_DIMENSIONS,
1251
+ Oe as CommunicationScheme,
1252
+ Tt as DEFAULT_MEMORY_BUDGET,
1253
+ ae as DEFAULT_PHONE_REGION,
1254
+ Yt as FEATURE_FOLDER_MANAGEMENT,
1255
+ zt as FEATURE_REMOTE_SEARCH,
1256
+ Qt as INSTALLATION_HEADER,
1257
+ Xt as InteractionParticipantRole,
1258
+ $e as MAX_ACTIONS,
1259
+ De as MAX_BLOCKS,
1260
+ Le as MAX_FIELDS,
1261
+ xe as MAX_LIST_ITEMS,
1262
+ It as MAX_MEMORY_BUDGET,
1263
+ At as MAX_MEMORY_CHARS,
1264
+ _t as MIN_MEMORY_BUDGET,
1265
+ ee as PAUSED_RUN_STATUSES,
1266
+ A as PHONE_REGIONS,
1267
+ Jt as PRESENCE_ONLINE_WINDOW_MS,
1268
+ Ft as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
1269
+ Bt as PROVIDER_FEATURE_MESSAGE_WINDOW,
1238
1270
  pe as PUBLIC_EMAIL_DOMAINS,
1239
- te as RELATED_SUBJECT_KINDS,
1240
- sn as SIGNATURE_INTENTS,
1241
- be as SUMMARY_MIN_LAST_CHARS,
1242
- Ee as SUMMARY_MIN_MESSAGES,
1243
- Q as TERMINAL_RUN_STATUSES,
1244
- ze as TRIGGER_VARS,
1245
- Hn as UNSUPPORTED,
1246
- W as USAGE_DIMENSIONS,
1247
- Y as USAGE_DIMENSION_IDS,
1248
- J as actingIdentityKey,
1249
- De as activityIconOf,
1250
- Ke as activityJoinUrl,
1251
- w as activitySnippet,
1252
- K as activityTextParams,
1253
- we as activityTimelineText,
1254
- je as activityTimestamp,
1271
+ ie as RELATED_SUBJECT_KINDS,
1272
+ dt as SIGNATURE_INTENTS,
1273
+ Ae as SUMMARY_MIN_LAST_CHARS,
1274
+ be as SUMMARY_MIN_MESSAGES,
1275
+ Z as TERMINAL_RUN_STATUSES,
1276
+ et as TRIGGER_VARS,
1277
+ qt as UNSUPPORTED,
1278
+ Y as USAGE_DIMENSIONS,
1279
+ z as USAGE_DIMENSION_IDS,
1280
+ Q as actingIdentityKey,
1281
+ Ue as activityIconOf,
1282
+ Be as activityJoinUrl,
1283
+ K as activitySnippet,
1284
+ G as activityTextParams,
1285
+ je as activityTimelineText,
1286
+ Ye as activityTimestamp,
1255
1287
  l as activityTypeInfo,
1256
- Ze as actorKey,
1257
- an as aiVendorDefaultModel,
1258
- tn as aiVendorLabel,
1259
- on as aiVendorNeedsBaseUrl,
1260
- rn as aiVendorsWith,
1261
- ln as applySignature,
1262
- Ve as buildActivityPreview,
1263
- Dn as buildChannelIntents,
1264
- xe as carriesText,
1265
- xn as channelKindForScheme,
1266
- Le as channelKindOf,
1267
- vn as cleanMessageText,
1268
- Kn as defineIntent,
1269
- kn as disabledIntentsFromCapabilities,
1270
- In as emailDomain,
1271
- Mn as endpointKey,
1272
- $n as filterByEndpoint,
1273
- Ln as filterByIntent,
1274
- Te as filterByTargetScheme,
1275
- E as findAiVendor,
1276
- Fe as flattenLocales,
1277
- B as floorToPeriod,
1278
- q as formatActingIdentity,
1279
- j as formatPeriod,
1280
- He as getActivitySeenUserIds,
1281
- cn as getContactEndpoints,
1282
- mn as getShortTitle,
1283
- dn as getUrgencyScore,
1284
- Ye as humanizeAction,
1285
- pn as isAssigned,
1286
- un as isClosed,
1287
- fn as isInteractionUnseen,
1288
- Nn as isLikelyBulk,
1289
- $e as isMessageType,
1290
- nn as isPaused,
1291
- Pe as isPlaybookAuthoredType,
1292
- Tn as isPublicEmailDomain,
1293
- Re as isReplyableType,
1294
- en as isRetryable,
1295
- ee as isTerminal,
1296
- On as isThreadLongEnough,
1297
- An as looksLikeEmail,
1298
- Rn as matchContactToIntents,
1299
- Ue as messageCountsAs,
1300
- Sn as needsPhoneRegion,
1301
- ke as normalizeBlocks,
1302
- x as normalizeEmail,
1303
- Je as parseActingIdentity,
1304
- Xe as periodsInRange,
1305
- _n as phoneSuffix,
1306
- Cn as plainTextFromMarkdown,
1307
- Qe as playbookActor,
1308
- h as readPath,
1309
- ce as registrableDomain,
1310
- bn as relatedByDefault,
1311
- _e as resolveAccountCapabilities,
1312
- y as resolveActivityText,
1313
- Ae as resolveChannelIntents,
1288
+ at as actorKey,
1289
+ Te as aiAttachmentKind,
1290
+ Pt as aiAttachmentRejection,
1291
+ pt as aiVendorAcceptsAttachment,
1292
+ lt as aiVendorDefaultModel,
1293
+ st as aiVendorLabel,
1294
+ ut as aiVendorNeedsBaseUrl,
1295
+ ct as aiVendorsWith,
1296
+ mt as applySignature,
1297
+ Xe as buildActivityPreview,
1298
+ Kt as buildChannelIntents,
1299
+ Ge as carriesText,
1300
+ jt as channelKindForScheme,
1301
+ Pe as channelKindOf,
1302
+ Lt as cleanMessageText,
1303
+ Wt as defineIntent,
1304
+ wt as disabledIntentsFromCapabilities,
1305
+ Nt as emailDomain,
1306
+ kt as endpointKey,
1307
+ Vt as filterByEndpoint,
1308
+ Gt as filterByIntent,
1309
+ ve as filterByTargetScheme,
1310
+ f as findAiVendor,
1311
+ qe as flattenLocales,
1312
+ F as floorToPeriod,
1313
+ J as formatActingIdentity,
1314
+ B as formatPeriod,
1315
+ We as getActivitySeenUserIds,
1316
+ ft as getContactEndpoints,
1317
+ yt as getShortTitle,
1318
+ Et as getUrgencyScore,
1319
+ Ze as humanizeAction,
1320
+ gt as isAssigned,
1321
+ ht as isClosed,
1322
+ bt as isInteractionUnseen,
1323
+ xt as isLikelyBulk,
1324
+ we as isMessageType,
1325
+ ot as isPaused,
1326
+ He as isPlaybookAuthoredType,
1327
+ vt as isPublicEmailDomain,
1328
+ Ke as isReplyableType,
1329
+ rt as isRetryable,
1330
+ te as isTerminal,
1331
+ $t as isThreadLongEnough,
1332
+ St as looksLikeEmail,
1333
+ Ht as matchContactToIntents,
1334
+ Ve as messageCountsAs,
1335
+ Ot as needsPhoneRegion,
1336
+ Re as normalizeBlocks,
1337
+ U as normalizeEmail,
1338
+ nt as parseActingIdentity,
1339
+ Je as periodsInRange,
1340
+ Ct as phoneSuffix,
1341
+ Dt as plainTextFromMarkdown,
1342
+ it as playbookActor,
1343
+ y as readPath,
1344
+ ue as registrableDomain,
1345
+ Mt as relatedByDefault,
1346
+ Ce as resolveAccountCapabilities,
1347
+ b as resolveActivityText,
1348
+ Se as resolveChannelIntents,
1314
1349
  ne as resolveSignature,
1315
- P as stripHtml,
1316
- N as toE164,
1317
- z as usageMetricId,
1318
- We as usageMetrics
1350
+ w as stripHtml,
1351
+ O as toE164,
1352
+ q as usageMetricId,
1353
+ Qe as usageMetrics
1319
1354
  };