@burdenoff/fe-libs 2026.924.1 → 2026.924.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/shared/assistant/autoRouting.d.ts +197 -0
  2. package/dist/shared/assistant/autoRouting.d.ts.map +1 -0
  3. package/dist/shared/assistant/autoRouting.js +854 -0
  4. package/dist/shared/assistant/conversation.d.ts +13 -0
  5. package/dist/shared/assistant/conversation.d.ts.map +1 -1
  6. package/dist/shared/assistant/i18nManifest.d.ts +2 -0
  7. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  8. package/dist/shared/assistant/i18nManifest.js +2 -0
  9. package/dist/shared/assistant/index.d.ts +1 -0
  10. package/dist/shared/assistant/index.d.ts.map +1 -1
  11. package/dist/shared/assistant/store.d.ts +32 -2
  12. package/dist/shared/assistant/store.d.ts.map +1 -1
  13. package/dist/shared/assistant/store.js +69 -29
  14. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  15. package/dist/shared/assistant/ui/AssistantChatArea.js +428 -341
  16. package/dist/shared/assistant/ui/AssistantEmptyState.d.ts +17 -1
  17. package/dist/shared/assistant/ui/AssistantEmptyState.d.ts.map +1 -1
  18. package/dist/shared/assistant/ui/AssistantEmptyState.js +14 -9
  19. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +3 -0
  20. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
  21. package/dist/shared/assistant/ui/composer/AssistantComposer.js +110 -109
  22. package/dist/shared/assistant/ui/composer/AssistantModeSelector.d.ts +20 -0
  23. package/dist/shared/assistant/ui/composer/AssistantModeSelector.d.ts.map +1 -1
  24. package/dist/shared/assistant/ui/composer/AssistantModeSelector.js +89 -45
  25. package/dist/shared/config/products.d.ts.map +1 -1
  26. package/dist/shared/config/products.js +1 -2
  27. package/dist/shared-assistant.js +80 -79
  28. package/package.json +1 -1
@@ -0,0 +1,854 @@
1
+ //#region src/shared/assistant/autoRouting.ts
2
+ var e = "assistant", t = "api-calls";
3
+ function n(e) {
4
+ return e.some((e) => e.id === "assistant") && e.some((e) => e.id === "api-calls");
5
+ }
6
+ var r = /^(?:(?:ok(?:ay)?|alright|right|now|then|so|and|but|also|just|actually|instead|fine|good|great|perfect|well|oh|hmm+|um+|hey|hi|hello|thanks|thank\s+you|cool|yes|yeah|sure|yo|btw|by\s+the\s+way|quick\s+(?:favou?r|one)|on\s+second\s+thoughts?|in\s+that\s+case)\b[\s,.!:-]*)+/, i = /^(?:please\s+)?(?:go\s+ahead|do\s+(?:it|that|this|so)|proceed|make\s+it\s+so)(?:\s+(?:please|now))?$/, a = RegExp("^(?:" + (/* @__PURE__ */ "how.what.what's.whats.why.where.when.which.who.whom.whose.is.are.am.was.were.do.does.did.can\\s+i.could\\s+i.may\\s+i.should.shall.would\\s+it.will\\s+it.explain.describe.tell\\s+me.show.list.find.search.look\\s+up.compare.summari[sz]e.analy[sz]e.check.open.go\\s+to.take\\s+me.take\\s+a\\s+look.update\\s+(?:me|us)\\b.run\\s+(?:me|us)\\s+through.have\\s+a\\s+look.pull\\s+up.point\\s+me.remind\\s+me.let\\s+me\\s+(?:know|see).navigate.view.see.walk\\s+me\\s+through.teach\\s+me.give\\s+me\\s+(?:an?\\s+)?(?:overview|summary|explanation)".split(".")).join("|") + ")\\b"), o = RegExp("^(?:(?:please|pls|kindly)\\s+)?(?:" + [
7
+ "(?:can|could|would|will)\\s+(?:you|u|someone|somebody|anyone)",
8
+ "(?:is\\s+there\\s+)?any\\s+chance\\s+(?:you|u)\\s+(?:could|can|would)",
9
+ "i(?:\\s+(?:want|need|would\\s+like|wanna)|'d\\s+like)(?:\\s+you)?\\s+to",
10
+ "i\\s+was\\s+wondering\\s+if\\s+(?:you|someone|somebody)\\s+(?:could|would|can)",
11
+ "i\\s+was\\s+wondering\\s+if\\s+(?:it'?s|it\\s+is|it\\s+would\\s+be)\\s+possible\\s+for\\s+you\\s+to",
12
+ "i(?:'d|\\s+would)\\s+appreciate\\s+(?:it\\s+)?if\\s+you\\s+(?:could|would)",
13
+ "it(?:'d|\\s+would)\\s+(?:really\\s+)?(?:be\\s+(?:really\\s+|so\\s+)?(?:great|nice|good|helpful|awesome|amazing|lovely|ideal|perfect|handy)|help(?:\\s+(?:a\\s+lot|me))?)\\s+if\\s+you\\s+(?:could|would|can)",
14
+ "would\\s+it\\s+be\\s+possible\\s+(?:for\\s+you\\s+)?to",
15
+ "let'?s",
16
+ "go\\s+ahead\\s+and",
17
+ "help\\s+me"
18
+ ].join("|") + ")\\s+(?:(?:please|kindly|just|finally|quickly|also|actually|maybe)\\s+)*|^(?:please|pls|kindly|just)\\s+"), s = [
19
+ [
20
+ "create",
21
+ "creating",
22
+ "created"
23
+ ],
24
+ [
25
+ "add",
26
+ "adding",
27
+ "added"
28
+ ],
29
+ [
30
+ "make",
31
+ "making",
32
+ "made"
33
+ ],
34
+ [
35
+ "build",
36
+ "building",
37
+ "built"
38
+ ],
39
+ [
40
+ "set up",
41
+ "setting up",
42
+ "set up"
43
+ ],
44
+ [
45
+ "setup",
46
+ "setting up",
47
+ "set up"
48
+ ],
49
+ [
50
+ "set(?!\\s+(?:up|of)\\b)",
51
+ "setting",
52
+ "set"
53
+ ],
54
+ [
55
+ "generate",
56
+ "generating",
57
+ "generated"
58
+ ],
59
+ [
60
+ "insert",
61
+ "inserting",
62
+ "inserted"
63
+ ],
64
+ [
65
+ "delete",
66
+ "deleting",
67
+ "deleted"
68
+ ],
69
+ [
70
+ "remove",
71
+ "removing",
72
+ "removed"
73
+ ],
74
+ [
75
+ "get rid of",
76
+ "getting rid of",
77
+ "(?:got|gotten) rid of"
78
+ ],
79
+ [
80
+ "clean up",
81
+ "cleaning up",
82
+ "cleaned up"
83
+ ],
84
+ [
85
+ "update",
86
+ "updating",
87
+ "updated"
88
+ ],
89
+ [
90
+ "change",
91
+ "changing",
92
+ "changed"
93
+ ],
94
+ [
95
+ "edit",
96
+ "editing",
97
+ "edited"
98
+ ],
99
+ [
100
+ "modify",
101
+ "modifying",
102
+ "modified"
103
+ ],
104
+ [
105
+ "rename",
106
+ "renaming",
107
+ "renamed"
108
+ ],
109
+ [
110
+ "replace",
111
+ "replacing",
112
+ "replaced"
113
+ ],
114
+ [
115
+ "fix",
116
+ "fixing",
117
+ "fixed"
118
+ ],
119
+ [
120
+ "fill (?:in|out)",
121
+ "filling (?:in|out)",
122
+ "filled (?:in|out)"
123
+ ],
124
+ [
125
+ "log",
126
+ "logging",
127
+ "logged"
128
+ ],
129
+ [
130
+ "record",
131
+ "recording",
132
+ "recorded"
133
+ ],
134
+ [
135
+ "schedule",
136
+ "scheduling",
137
+ "scheduled"
138
+ ],
139
+ [
140
+ "reschedule",
141
+ "rescheduling",
142
+ "rescheduled"
143
+ ],
144
+ [
145
+ "assign",
146
+ "assigning",
147
+ "assigned"
148
+ ],
149
+ [
150
+ "unassign",
151
+ "unassigning",
152
+ "unassigned"
153
+ ],
154
+ [
155
+ "move",
156
+ "moving",
157
+ "moved"
158
+ ],
159
+ [
160
+ "duplicate",
161
+ "duplicating",
162
+ "duplicated"
163
+ ],
164
+ [
165
+ "copy",
166
+ "copying",
167
+ "copied"
168
+ ],
169
+ [
170
+ "clone",
171
+ "cloning",
172
+ "cloned"
173
+ ],
174
+ [
175
+ "merge",
176
+ "merging",
177
+ "merged"
178
+ ],
179
+ [
180
+ "import",
181
+ "importing",
182
+ "imported"
183
+ ],
184
+ [
185
+ "upload",
186
+ "uploading",
187
+ "uploaded"
188
+ ],
189
+ [
190
+ "connect",
191
+ "connecting",
192
+ "connected"
193
+ ],
194
+ [
195
+ "reconnect",
196
+ "reconnecting",
197
+ "reconnected"
198
+ ],
199
+ [
200
+ "disconnect",
201
+ "disconnecting",
202
+ "disconnected"
203
+ ],
204
+ [
205
+ "link",
206
+ "linking",
207
+ "linked"
208
+ ],
209
+ [
210
+ "unlink",
211
+ "unlinking",
212
+ "unlinked"
213
+ ],
214
+ [
215
+ "share",
216
+ "sharing",
217
+ "shared"
218
+ ],
219
+ [
220
+ "invite",
221
+ "inviting",
222
+ "invited"
223
+ ],
224
+ [
225
+ "enable",
226
+ "enabling",
227
+ "enabled"
228
+ ],
229
+ [
230
+ "disable",
231
+ "disabling",
232
+ "disabled"
233
+ ],
234
+ [
235
+ "turn (?:on|off)",
236
+ "turning (?:on|off)",
237
+ "turned (?:on|off)"
238
+ ],
239
+ [
240
+ "switch(?!\\s+(?:over\\s+)?to\\b)",
241
+ "switching",
242
+ "switched"
243
+ ],
244
+ [
245
+ "increase",
246
+ "increasing",
247
+ "increased"
248
+ ],
249
+ [
250
+ "decrease",
251
+ "decreasing",
252
+ "decreased"
253
+ ],
254
+ [
255
+ "reduce",
256
+ "reducing",
257
+ "reduced"
258
+ ],
259
+ [
260
+ "archive",
261
+ "archiving",
262
+ "archived"
263
+ ],
264
+ [
265
+ "unarchive",
266
+ "unarchiving",
267
+ "unarchived"
268
+ ],
269
+ [
270
+ "restore",
271
+ "restoring",
272
+ "restored"
273
+ ],
274
+ [
275
+ "revert",
276
+ "reverting",
277
+ "reverted"
278
+ ],
279
+ [
280
+ "undo",
281
+ "undoing",
282
+ "undone"
283
+ ],
284
+ [
285
+ "roll back",
286
+ "rolling back",
287
+ "rolled back"
288
+ ],
289
+ [
290
+ "mark",
291
+ "marking",
292
+ "marked"
293
+ ],
294
+ [
295
+ "pin",
296
+ "pinning",
297
+ "pinned"
298
+ ],
299
+ [
300
+ "unpin",
301
+ "unpinning",
302
+ "unpinned"
303
+ ],
304
+ [
305
+ "save(?!\\s+(?:me|us|you|them|time|some)\\b)",
306
+ "saving",
307
+ "saved"
308
+ ],
309
+ [
310
+ "publish",
311
+ "publishing",
312
+ "published"
313
+ ],
314
+ [
315
+ "unpublish",
316
+ "unpublishing",
317
+ "unpublished"
318
+ ],
319
+ [
320
+ "submit",
321
+ "submitting",
322
+ "submitted"
323
+ ],
324
+ [
325
+ "register",
326
+ "registering",
327
+ "registered"
328
+ ],
329
+ [
330
+ "apply",
331
+ "applying",
332
+ "applied"
333
+ ],
334
+ [
335
+ "configure",
336
+ "configuring",
337
+ "configured"
338
+ ],
339
+ [
340
+ "install",
341
+ "installing",
342
+ "installed"
343
+ ],
344
+ [
345
+ "uninstall",
346
+ "uninstalling",
347
+ "uninstalled"
348
+ ],
349
+ [
350
+ "deploy",
351
+ "deploying",
352
+ "deployed"
353
+ ],
354
+ [
355
+ "sync",
356
+ "syncing",
357
+ "synced"
358
+ ],
359
+ [
360
+ "reset",
361
+ "resetting",
362
+ "reset"
363
+ ],
364
+ [
365
+ "cancel",
366
+ "cancel(?:l)?ing",
367
+ "cancel(?:l)?ed"
368
+ ],
369
+ [
370
+ "start",
371
+ "starting",
372
+ "started"
373
+ ],
374
+ [
375
+ "restart",
376
+ "restarting",
377
+ "restarted"
378
+ ],
379
+ [
380
+ "stop",
381
+ "stopping",
382
+ "stopped"
383
+ ],
384
+ [
385
+ "end(?!\\s+of\\b)",
386
+ "ending",
387
+ "ended"
388
+ ],
389
+ [
390
+ "kill",
391
+ "killing",
392
+ "killed"
393
+ ],
394
+ [
395
+ "terminate",
396
+ "terminating",
397
+ "terminated"
398
+ ],
399
+ [
400
+ "run",
401
+ "running",
402
+ "run"
403
+ ],
404
+ [
405
+ "rerun",
406
+ "rerunning",
407
+ "rerun"
408
+ ],
409
+ [
410
+ "re-run",
411
+ "re-running",
412
+ "re-run"
413
+ ],
414
+ [
415
+ "retry",
416
+ "retrying",
417
+ "retried"
418
+ ],
419
+ [
420
+ "trigger",
421
+ "triggering",
422
+ "triggered"
423
+ ],
424
+ [
425
+ "execute",
426
+ "executing",
427
+ "executed"
428
+ ],
429
+ [
430
+ "pause",
431
+ "pausing",
432
+ "paused"
433
+ ],
434
+ [
435
+ "resume",
436
+ "resuming",
437
+ "resumed"
438
+ ],
439
+ [
440
+ "approve",
441
+ "approving",
442
+ "approved"
443
+ ],
444
+ [
445
+ "reject",
446
+ "rejecting",
447
+ "rejected"
448
+ ],
449
+ [
450
+ "accept",
451
+ "accepting",
452
+ "accepted"
453
+ ],
454
+ [
455
+ "decline",
456
+ "declining",
457
+ "declined"
458
+ ],
459
+ [
460
+ "subscribe",
461
+ "subscribing",
462
+ "subscribed"
463
+ ],
464
+ [
465
+ "unsubscribe",
466
+ "unsubscribing",
467
+ "unsubscribed"
468
+ ],
469
+ [
470
+ "upgrade",
471
+ "upgrading",
472
+ "upgraded"
473
+ ],
474
+ [
475
+ "downgrade",
476
+ "downgrading",
477
+ "downgraded"
478
+ ],
479
+ [
480
+ "rotate",
481
+ "rotating",
482
+ "rotated"
483
+ ],
484
+ [
485
+ "split",
486
+ "splitting",
487
+ "split"
488
+ ],
489
+ [
490
+ "swap",
491
+ "swapping",
492
+ "swapped"
493
+ ],
494
+ [
495
+ "place",
496
+ "placing",
497
+ "placed"
498
+ ],
499
+ [
500
+ "stick",
501
+ "sticking",
502
+ ""
503
+ ],
504
+ [
505
+ "attach",
506
+ "attaching",
507
+ "attached"
508
+ ],
509
+ [
510
+ "detach",
511
+ "detaching",
512
+ "detached"
513
+ ],
514
+ [
515
+ "convert",
516
+ "converting",
517
+ "converted"
518
+ ],
519
+ [
520
+ "adjust",
521
+ "adjusting",
522
+ "adjusted"
523
+ ],
524
+ [
525
+ "tweak",
526
+ "tweaking",
527
+ "tweaked"
528
+ ],
529
+ [
530
+ "reorder",
531
+ "reordering",
532
+ "reordered"
533
+ ],
534
+ [
535
+ "rearrange",
536
+ "rearranging",
537
+ "rearranged"
538
+ ],
539
+ [
540
+ "resize",
541
+ "resizing",
542
+ "resized"
543
+ ],
544
+ [
545
+ "drop",
546
+ "dropping",
547
+ "dropped"
548
+ ],
549
+ [
550
+ "retire",
551
+ "retiring",
552
+ "retired"
553
+ ],
554
+ [
555
+ "enrol(?:l)?",
556
+ "enrol(?:l)?ing",
557
+ "enrol(?:l)?ed"
558
+ ],
559
+ [
560
+ "point",
561
+ "pointing",
562
+ "pointed"
563
+ ],
564
+ [
565
+ "reopen",
566
+ "reopening",
567
+ "reopened"
568
+ ],
569
+ [
570
+ "calibrate",
571
+ "calibrating",
572
+ "calibrated"
573
+ ],
574
+ [
575
+ "recalibrate",
576
+ "recalibrating",
577
+ "recalibrated"
578
+ ],
579
+ [
580
+ "lock",
581
+ "locking",
582
+ "locked"
583
+ ],
584
+ [
585
+ "unlock",
586
+ "unlocking",
587
+ "unlocked"
588
+ ],
589
+ [
590
+ "sort out",
591
+ "sorting out",
592
+ "sorted(?:\\s+out)?"
593
+ ],
594
+ [
595
+ "spin up",
596
+ "spinning up",
597
+ "spun up"
598
+ ],
599
+ [
600
+ "shut down",
601
+ "shutting down",
602
+ "shut down"
603
+ ],
604
+ [
605
+ "hook up",
606
+ "hooking up",
607
+ "hooked up"
608
+ ],
609
+ [
610
+ "wire up",
611
+ "wiring up",
612
+ "wired up"
613
+ ],
614
+ [
615
+ "take (?:off|out|down|away|offline)",
616
+ "taking (?:off|out|down|away|offline)",
617
+ "taken (?:off|out|down|away|offline)"
618
+ ],
619
+ [
620
+ "pull (?:off|out|down)",
621
+ "pulling (?:off|out|down)",
622
+ "pulled (?:off|out|down)"
623
+ ],
624
+ [
625
+ "bump (?:up|down)",
626
+ "bumping (?:up|down)",
627
+ "bumped (?:up|down)"
628
+ ],
629
+ [
630
+ "rebuild",
631
+ "rebuilding",
632
+ "rebuilt"
633
+ ],
634
+ [
635
+ "recreate",
636
+ "recreating",
637
+ "recreated"
638
+ ],
639
+ [
640
+ "redo",
641
+ "redoing",
642
+ "redone"
643
+ ],
644
+ [
645
+ "clear out",
646
+ "clearing out",
647
+ "cleared out"
648
+ ],
649
+ [
650
+ "queue(?:\\s+up)?",
651
+ "queuing(?:\\s+up)?",
652
+ "queued(?:\\s+up)?"
653
+ ],
654
+ [
655
+ "(?:throw|knock|put|pull) together",
656
+ "(?:throwing|knocking|putting|pulling) together",
657
+ "(?:thrown|knocked|put|pulled) together"
658
+ ],
659
+ [
660
+ "whip up",
661
+ "whipping up",
662
+ "whipped up"
663
+ ],
664
+ [
665
+ "knock (?:up|out)",
666
+ "knocking (?:up|out)",
667
+ "knocked (?:up|out)"
668
+ ],
669
+ [
670
+ "spin off",
671
+ "spinning off",
672
+ "spun off"
673
+ ],
674
+ [
675
+ "axe",
676
+ "axing",
677
+ "axed"
678
+ ]
679
+ ], c = (e) => [...new Set(s.map((t) => t[e]).filter(Boolean).map((e) => e.replace(/ /g, "\\s+")))].join("|"), l = RegExp(`^(?:${c(0)})\\b`), u = RegExp(`^(?:${c(1)})\\b`), d = RegExp("^(?:" + [
680
+ "take\\s+(?!me\\b|a\\s+look\\b)(?:[^,;]{1,50}?\\s)?(?:off|out|down|offline|away)",
681
+ "pull\\s+(?!up\\b)(?:[^,;]{1,50}?\\s)?(?:off|out|down)",
682
+ "put\\s+(?:[^,;]{1,50}?\\s)?back",
683
+ "(?:hook|wire)\\s+(?:[^,;]{1,50}?\\s)?(?:up|in|into)",
684
+ "spin\\s+(?:[^,;]{1,50}?\\s)?(?:up|down|off)",
685
+ "(?:slap|throw|stick)\\s+(?:[^,;]{1,50}?\\s)?(?:on|onto|in|into)",
686
+ "clear\\s+(?:[^,;]{1,50}?\\s)?out",
687
+ "queue\\s+(?:[^,;]{1,50}?\\s)?up",
688
+ "shut\\s+(?:[^,;]{1,50}?\\s)?(?:down|off)",
689
+ "turn\\s+(?:[^,;]{1,50}?\\s)?(?:on|off|into)",
690
+ "switch\\s+(?:[^,;]{1,50}?\\s)?(?:on|off|over)",
691
+ "set\\s+(?:[^,;]{1,50}?\\s)?up",
692
+ "swap\\s+(?:[^,;]{1,50}?\\s)?(?:out|in|for)",
693
+ "clean\\s+(?:[^,;]{1,50}?\\s)?(?:up|out)",
694
+ "bump\\s+(?:[^,;]{1,50}?\\s)?(?:up|down)"
695
+ ].join("|") + ")\\b"), f = /^(?:(?:please|pls|kindly)\s+)?(?:(?:(?:would|do)\s+you\s+)?mind|i\s+need\s+help(?:\s+with)?|(?:can|could)\s+you\s+help\s+(?:me\s+)?with)\s+(?:(?:please|just)\s+)?/, p = RegExp(`^(?:i(?:'d|\\s+would)?\\s+(?:like|want|need)|(?:can|could|may)\\s+(?:i|we)\\s+(?:get|have))\\s+(?!to\\b)(?:[^,;]{1,80}?\\s)?(?<!\\b(?:the|a|an|my|our|your|their|its)\\s)(?:${c(2)})\\b`), m = RegExp(`^get\\s+(?!started\\b|rid\\b)(?:[^,;]{1,60}?\\s)?(?<!\\b(?:the|a|an|my|our|your|their|its)\\s)(?:${c(2)})\\b`), h = /^(?:(?:the|a|an|this|that|these|those|it|them|me|us|my|our|your|his|her|their|its|all|every|each|any|some|both|another|one|whichever|whatever)\b|\d|["'`])/, g = /\b(?:is|are|was|were|has|have|had|keeps?|kept|looks?|looked|seems?|seemed|appears?|appeared|shows?|showed|becomes?|became|goes|went|gets?|got|needs?|needed|takes?|took|causes?|caused|comes?|came|dropped|doubled|tripled|halved|fails|failed|broke|breaks|exceeds|exceeded|increased|decreased|happens|happened|isn't|aren't|wasn't|weren't|doesn't|don't|didn't|won't|can't|hasn't|haven't|hadn't)\b/, _ = /\b(?:that|which|whichever|who|whoever|whom|whose|what|whatever|where|when|whenever|if|unless|until|because|since|while|once|after|before)\b/;
696
+ function v(e) {
697
+ let t = (e.split(/[,;:]/)[0] ?? "").trim();
698
+ if (!t || h.test(t)) return !1;
699
+ let n = g.exec(t);
700
+ if (!n) return !1;
701
+ let r = t.slice(0, n.index);
702
+ return _.test(r) ? !1 : !/\b(?:i|we|you|they|he|she)\s+$/.test(r);
703
+ }
704
+ var y = /^(?:how|what|what's|whats|why|which|who|whom|whose|is|are|am|was|were|do\s+(?:i|you|we|they)\b(?!\s+mind\b)|does|did|can\s+i|could\s+i|may\s+i|should|shall|would\s+it(?!\s+be\s+possible\b)|will\s+it)\b/, b = /^(?:when|where)\b/, x = /^(?:any\s+way|do|does|did|will|would|can|could|is|are|was|were|has|have)\b/;
705
+ function S(e) {
706
+ return x.test(e) && !R(e).lead && !f.test(e);
707
+ }
708
+ var C = /^(?:(?:please|pls|kindly)\b|(?:can|could|would|will)\s+(?:you|u|someone|somebody|anyone)\b|go\s+ahead\b|i\s+(?:want|need)\s+you\b|i(?:'d|\s+would)\s+like\s+you\b)/, w = /\b(?:(?:can|could|would|will)\s+(?:you|u|someone)\s+(?:please\s+|just\s+)?(?:do|handle|sort|take\s+care\s+of|deal\s+with)|(?:would\s+you\s+)?mind\s+(?:doing|handling|sorting))\s+(?:it|that|this|them|those)\b/, T = RegExp(`\\b(?:${c(0)}|${c(1)})\\b`), E = RegExp(`^it(?:'d|\\s+would)\\s+(?:really\\s+)?(?:be\\s+(?:really\\s+|so\\s+)?\\w+|help(?:\\s+a\\s+lot)?)\\s+if\\s+[^,;]{1,80}?\\s(?:could|can|would)\\s+be\\s+(?:${c(2)})\\b`), D = /\s(?=(?:(?:please|pls)\s+)?(?:can|could|would|will)\s+(?:you|u|someone)\b)/, O = /^(?:please\s+)?(?:don'?t|do\s+not|never|no\s+need\s+to)\b/, k = /^(?:once|after|when|whenever|if|as\s+soon\s+as|before|unless|in\s+case|say|suppose|supposing|imagine|let'?s\s+say|what\s+if)\b/, A = /,\s*(?=(?:(?:and|but)\s+)?(?:then|now|also|please|instead|just|go\s+ahead|so)\b|(?:please\s+)?(?:can|could|would|will)\s+you\b|i(?:'d|\s+would)\s+like\b|i\s+(?:want|need)\s+you\b|let'?s\b)/, j = RegExp(`,?\\s+(?:and|&)\\s+(?=(?:then\\s+|also\\s+|please\\s+)?(?:${c(0)})\\s+(?:the|a|an|this|that|these|those|it|them|my|our|all|every|each|any|some|both|another)\\b)`);
709
+ function M(e) {
710
+ let t = l.exec(e);
711
+ return t !== null && h.test(e.slice(t[0].length).trim()) || d.test(e) || m.test(e);
712
+ }
713
+ var N = RegExp(`\\bto\\s+(?:${c(0)})\\b`);
714
+ function P(e) {
715
+ let t = e.split(","), n = [t[0] ?? ""];
716
+ for (let e of t.slice(1)) {
717
+ let t = L(e), r = n[n.length - 1] ?? "";
718
+ M(t) && !/\bor\b/.test(t) && !N.test(L(r)) ? n.push(e) : n[n.length - 1] = `${r},${e}`;
719
+ }
720
+ return n;
721
+ }
722
+ function F(e) {
723
+ let t = e.split(j), n = [t[0] ?? ""];
724
+ for (let e of t.slice(1)) {
725
+ let t = n[n.length - 1] ?? "";
726
+ N.test(L(t)) ? n[n.length - 1] = `${t} and ${e}` : n.push(e);
727
+ }
728
+ return n;
729
+ }
730
+ function I(e, t) {
731
+ if (O.test(t)) return e.split(",");
732
+ if (k.test(t)) {
733
+ let t = e.split(","), n = t.length > 1 ? t[t.length - 1] : "";
734
+ return !n || /^\s*(?:and|or)\b/i.test(n) ? [] : [n];
735
+ }
736
+ return e.split(A).flatMap(P);
737
+ }
738
+ function L(e) {
739
+ return e.toLowerCase().replace(/[’‘]/g, "'").replace(/\s+/g, " ").trim().replace(/[\s.!?;,]+$/, "").replace(r, "").trim();
740
+ }
741
+ function R(e) {
742
+ let t = e;
743
+ for (let e = 0; e < 3; e += 1) {
744
+ let e = o.exec(t);
745
+ if (!e || e[0].length === 0) break;
746
+ t = t.slice(e[0].length);
747
+ }
748
+ return {
749
+ lead: t !== e,
750
+ rest: t
751
+ };
752
+ }
753
+ function z(e) {
754
+ let t = L(e);
755
+ if (!t) return null;
756
+ if (i.test(t)) return "act";
757
+ let n = f.exec(t);
758
+ if (n && u.test(t.slice(n[0].length))) return "act";
759
+ let { lead: r, rest: o } = R(t);
760
+ if (a.test(o)) return "read";
761
+ if (d.test(o) || m.test(o)) return "act";
762
+ let s = l.exec(o);
763
+ if (!s) return null;
764
+ let c = o.slice(s[0].length);
765
+ if (/^'(?:s|re|ve|ll|d)\b/.test(c)) return null;
766
+ let p = /\b(?:by\s+(?:mistake|accident)|accidentally)\b/.exec(c);
767
+ return p && !/\b(?:i|we|you|they|he|she|someone|somebody)\b/.test(c.slice(0, p.index)) || !r && v(c) ? null : "act";
768
+ }
769
+ function B(e) {
770
+ return (e.replace(/\s+-\s+/g, " — ").match(/[^.!?;\n]+[.!?;]*/g) ?? []).some((e) => {
771
+ let t = e.split(/[—–]/), n = (t[t.length - 1] ?? "").trim();
772
+ return t.length > 1 && n.endsWith("?") && (y.test(L(n)) || S(L(n))) ? !1 : t.some(V);
773
+ }) ? "act" : "read";
774
+ }
775
+ function V(e) {
776
+ let t = e.trim(), n = L(t);
777
+ if (!n) return !1;
778
+ if (p.test(n) || E.test(n) || w.test(n) && T.test(n)) return !0;
779
+ let r = I(t, n);
780
+ if (r.length === 0) return !1;
781
+ let i = L(r[r.length - 1] ?? "");
782
+ return (y.test(n) || b.test(n) && t.endsWith("?") || t.endsWith("?") && S(i)) && !C.test(i) ? !1 : r.flatMap((e) => e.split(D)).flatMap(F).some((e) => z(e) === "act");
783
+ }
784
+ function H({ intent: n, dictated: r, conversation: i }) {
785
+ let a = n === "act" && !r ? t : e;
786
+ return i ? i.hasHistory ? i.routedBy === "auto" ? i.mode === "assistant" && a === "api-calls" ? {
787
+ action: "escalate",
788
+ mode: a
789
+ } : {
790
+ action: "continue",
791
+ mode: i.mode
792
+ } : {
793
+ action: "new",
794
+ mode: a
795
+ } : {
796
+ action: "adopt",
797
+ mode: a
798
+ } : {
799
+ action: "new",
800
+ mode: a
801
+ };
802
+ }
803
+ function U(e, t, n, r) {
804
+ return !e || !n || n.routedBy !== "auto" || n.mode !== t || n.backendSessionId ? null : {
805
+ mode: e.mode,
806
+ backendSessionId: r(e.mode) ? e.backendSessionId : null
807
+ };
808
+ }
809
+ var W = 6, G = 500, K = 3e3, q = "[Earlier in this conversation the person wrote the following, oldest first. Use it only to understand what the request below refers to; do not act on it by itself. Your earlier replies are not included.]", J = "[End of earlier messages]";
810
+ function Y(e, t) {
811
+ return e.length <= t ? e : `${e.slice(0, t - 1).trimEnd()}…`;
812
+ }
813
+ function X(e, t) {
814
+ let n = e.map((e) => e.trim()).filter(Boolean), r = t.trim();
815
+ for (; n.length > 0 && n[n.length - 1] === r;) n.pop();
816
+ let i = [], a = 0;
817
+ for (let e = n.length - 1; e >= 0 && !(i.length >= 6); --e) {
818
+ let t = Y(n[e].replace(/\s+/g, " "), 500);
819
+ if (a + t.length > 3e3) break;
820
+ i.unshift(t), a += t.length;
821
+ }
822
+ return i.length === 0 ? "" : [
823
+ q,
824
+ ...i.map((e) => `- ${e}`),
825
+ J,
826
+ "",
827
+ ""
828
+ ].join("\n");
829
+ }
830
+ function Z(e, t, n) {
831
+ return !e || e.routedBy !== "auto" || !n ? "" : X(e.messages.filter((e) => e.role === "user").map((e) => e.content), t);
832
+ }
833
+ function Q(e, t, n = 4) {
834
+ let r = [], i = /* @__PURE__ */ new Set(), a = (e, t) => {
835
+ e === void 0 || i.has(e) || r.length >= n || (i.add(e), r.push({
836
+ text: e,
837
+ intent: t
838
+ }));
839
+ };
840
+ for (let n = 0; n < Math.max(e.length, t.length); n += 1) a(e[n], "read"), a(t[n], "act");
841
+ return r;
842
+ }
843
+ function $(e) {
844
+ if (typeof e != "object" || !e) return !0;
845
+ let t = Object.fromEntries(Object.entries(e));
846
+ if (typeof t.autoRouting == "boolean") return t.autoRouting;
847
+ let n = (Array.isArray(t.conversations) ? t.conversations : []).find((e) => typeof e == "object" && !!e && "id" in e && e.id === t.activeConversationId), r = typeof n == "object" && n ? Object.fromEntries(Object.entries(n)) : {};
848
+ if (r.routedBy === "auto") return !0;
849
+ if ((Array.isArray(r.messages) ? r.messages : []).length > 0 || r.backendSessionId) return !1;
850
+ let i = t.mode ?? r.mode;
851
+ return i === void 0 || i === "assistant";
852
+ }
853
+ //#endregion
854
+ export { K as AUTO_CARRY_OVER_MAX_CHARS, G as AUTO_CARRY_OVER_MAX_CHARS_PER_MESSAGE, W as AUTO_CARRY_OVER_MAX_MESSAGES, e as AUTO_READ_MODE, t as AUTO_WRITE_MODE, Z as autoCarryOverFor, Q as autoSuggestions, X as buildAutoCarryOver, B as classifyAssistantIntent, U as escalationToUndo, n as isAutoRoutingOffered, H as resolveAutoRoute, $ as restoreAutoRouting };