@adecore/agents-react 0.74.1 → 0.75.1

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 (53) hide show
  1. package/dist/chat/logic/timeline.js +3 -0
  2. package/dist/chat/mentions.d.ts +11 -2
  3. package/dist/chat/mentions.js +57 -18
  4. package/dist/chat/stop-task.d.ts +1 -0
  5. package/dist/chat/stop-task.js +34 -0
  6. package/dist/chat/tag-suggestions.d.ts +3 -1
  7. package/dist/chat/tag-suggestions.js +54 -10
  8. package/dist/chat/ui/ChatActivity.js +20 -42
  9. package/dist/chat/ui/Composer.js +397 -381
  10. package/dist/chat/ui/NamedChip.js +49 -44
  11. package/dist/chat/ui/ReferenceChip.d.ts +2 -1
  12. package/dist/chat/ui/ReferenceChip.js +64 -48
  13. package/dist/chat/ui/chip-clipboard.js +17 -6
  14. package/dist/chat/ui/composer/ComposerMenu.js +28 -24
  15. package/dist/chat/ui/composer/QueuedMessages.d.ts +5 -1
  16. package/dist/chat/ui/composer/QueuedMessages.js +60 -30
  17. package/dist/chat/ui/composer/chips.js +19 -8
  18. package/dist/chat/ui/composer/use-prompt-menus.js +138 -137
  19. package/dist/chat/ui/named-chip-look.d.ts +2 -1
  20. package/dist/chat/ui/named-chip-look.js +18 -8
  21. package/dist/chat/ui/rehype-chips.js +6 -3
  22. package/dist/chat/ui/rows/MessageRows.d.ts +6 -2
  23. package/dist/chat/ui/rows/MessageRows.js +122 -45
  24. package/dist/chat/ui/rows/Rows.js +65 -61
  25. package/dist/chat/waiting-on.d.ts +6 -0
  26. package/dist/chat/waiting-on.js +13 -2
  27. package/dist/host/timeline-row.d.ts +1 -0
  28. package/dist/locales/en/agent-chat.d.ts +4 -0
  29. package/dist/locales/en/agent-chat.js +5 -1
  30. package/dist/locales/nl/agent-chat.d.ts +4 -0
  31. package/dist/locales/nl/agent-chat.js +5 -1
  32. package/package.json +9 -9
  33. package/src/chat/logic/timeline.ts +2 -1
  34. package/src/chat/mentions.ts +69 -18
  35. package/src/chat/stop-task.ts +17 -0
  36. package/src/chat/tag-suggestions.ts +73 -11
  37. package/src/chat/ui/ChatActivity.tsx +2 -10
  38. package/src/chat/ui/Composer.tsx +3 -0
  39. package/src/chat/ui/NamedChip.tsx +10 -10
  40. package/src/chat/ui/ReferenceChip.tsx +4 -1
  41. package/src/chat/ui/chip-clipboard.ts +9 -5
  42. package/src/chat/ui/composer/ComposerMenu.tsx +6 -3
  43. package/src/chat/ui/composer/QueuedMessages.tsx +21 -1
  44. package/src/chat/ui/composer/chips.ts +18 -7
  45. package/src/chat/ui/composer/use-prompt-menus.ts +2 -2
  46. package/src/chat/ui/named-chip-look.ts +19 -8
  47. package/src/chat/ui/rehype-chips.ts +7 -3
  48. package/src/chat/ui/rows/MessageRows.tsx +34 -3
  49. package/src/chat/ui/rows/Rows.tsx +1 -1
  50. package/src/chat/waiting-on.ts +13 -2
  51. package/src/host/timeline-row.ts +1 -1
  52. package/src/locales/en/agent-chat.ts +5 -1
  53. package/src/locales/nl/agent-chat.ts +5 -1
@@ -57,7 +57,7 @@ function sendLabelKey(busy, steerable, delivery) {
57
57
  return delivery === 'steer' ? 'composer.steerButton' : 'composer.queueWithSteerButton';
58
58
  }
59
59
  export function Composer(t0) {
60
- const $ = _c(260);
60
+ const $ = _c(265);
61
61
  const {
62
62
  chatId,
63
63
  info,
@@ -403,35 +403,49 @@ export function Composer(t0) {
403
403
  t26 = $[76];
404
404
  }
405
405
  const queue = t26;
406
+ const heldTask = info.queueHeld?.task;
406
407
  let t27;
407
- if ($[77] !== draft) {
408
- t27 = isEmptyDraft(draft);
409
- $[77] = draft;
410
- $[78] = t27;
408
+ if ($[77] !== heldTask || $[78] !== info.background || $[79] !== info.queueHeld) {
409
+ t27 = info.queueHeld === undefined ? undefined : {
410
+ task: (info.background ?? []).find(task => task.id === heldTask) ?? null
411
+ };
412
+ $[77] = heldTask;
413
+ $[78] = info.background;
414
+ $[79] = info.queueHeld;
415
+ $[80] = t27;
411
416
  } else {
412
- t27 = $[78];
417
+ t27 = $[80];
413
418
  }
414
- const empty = t27;
419
+ const held = t27;
415
420
  let t28;
421
+ if ($[81] !== draft) {
422
+ t28 = isEmptyDraft(draft);
423
+ $[81] = draft;
424
+ $[82] = t28;
425
+ } else {
426
+ t28 = $[82];
427
+ }
428
+ const empty = t28;
416
429
  let t29;
417
- if ($[79] !== focused) {
418
- t28 = () => {
430
+ let t30;
431
+ if ($[83] !== focused) {
432
+ t29 = () => {
419
433
  if (focused) {
420
434
  inputRef.current?.focus();
421
435
  }
422
436
  };
423
- t29 = [focused];
424
- $[79] = focused;
425
- $[80] = t28;
426
- $[81] = t29;
437
+ t30 = [focused];
438
+ $[83] = focused;
439
+ $[84] = t29;
440
+ $[85] = t30;
427
441
  } else {
428
- t28 = $[80];
429
- t29 = $[81];
442
+ t29 = $[84];
443
+ t30 = $[85];
430
444
  }
431
- useEffect(t28, t29);
432
- let t30;
433
- if ($[82] !== chatId || $[83] !== draft.text || $[84] !== files.noteKey || $[85] !== history || $[86] !== host || $[87] !== menus || $[88] !== sendKey || $[89] !== submit || $[90] !== suggestion || $[91] !== toggleStash) {
434
- t30 = composerKeyHandler({
445
+ useEffect(t29, t30);
446
+ let t31;
447
+ if ($[86] !== chatId || $[87] !== draft.text || $[88] !== files.noteKey || $[89] !== history || $[90] !== host || $[91] !== menus || $[92] !== sendKey || $[93] !== submit || $[94] !== suggestion || $[95] !== toggleStash) {
448
+ t31 = composerKeyHandler({
435
449
  chatId,
436
450
  host,
437
451
  sendKey,
@@ -443,41 +457,41 @@ export function Composer(t0) {
443
457
  toggleStash,
444
458
  submit
445
459
  });
446
- $[82] = chatId;
447
- $[83] = draft.text;
448
- $[84] = files.noteKey;
449
- $[85] = history;
450
- $[86] = host;
451
- $[87] = menus;
452
- $[88] = sendKey;
453
- $[89] = submit;
454
- $[90] = suggestion;
455
- $[91] = toggleStash;
456
- $[92] = t30;
460
+ $[86] = chatId;
461
+ $[87] = draft.text;
462
+ $[88] = files.noteKey;
463
+ $[89] = history;
464
+ $[90] = host;
465
+ $[91] = menus;
466
+ $[92] = sendKey;
467
+ $[93] = submit;
468
+ $[94] = suggestion;
469
+ $[95] = toggleStash;
470
+ $[96] = t31;
457
471
  } else {
458
- t30 = $[92];
472
+ t31 = $[96];
459
473
  }
460
- const onKeyDown = t30;
474
+ const onKeyDown = t31;
461
475
  const pointSurface = _temp4;
462
- let t31;
463
- if ($[93] !== writable) {
464
- t31 = event_0 => {
476
+ let t32;
477
+ if ($[97] !== writable) {
478
+ t32 = event_0 => {
465
479
  if (!writable || event_0.button !== 0 || event_0.defaultPrevented || surfacePartOf(event_0.target, event_0.currentTarget) !== "surface") {
466
480
  return;
467
481
  }
468
482
  event_0.preventDefault();
469
483
  inputRef.current?.setCaret(Infinity);
470
484
  };
471
- $[93] = writable;
472
- $[94] = t31;
485
+ $[97] = writable;
486
+ $[98] = t32;
473
487
  } else {
474
- t31 = $[94];
488
+ t32 = $[98];
475
489
  }
476
- const pressSurface = t31;
477
- const t32 = "chat-composer-content pointer-events-none relative z-10 @container/composer-area w-full";
478
- let t33;
479
- if ($[95] !== atEnd || $[96] !== chatId || $[97] !== readOnly || $[98] !== t) {
480
- t33 = !atEnd && !readOnly && /*#__PURE__*/_jsx("div", {
490
+ const pressSurface = t32;
491
+ const t33 = "chat-composer-content pointer-events-none relative z-10 @container/composer-area w-full";
492
+ let t34;
493
+ if ($[99] !== atEnd || $[100] !== chatId || $[101] !== readOnly || $[102] !== t) {
494
+ t34 = !atEnd && !readOnly && /*#__PURE__*/_jsx("div", {
481
495
  className: "absolute inset-x-0 bottom-full mb-2 flex justify-center",
482
496
  children: /*#__PURE__*/_jsx(Tooltip, {
483
497
  label: t("composer.jumpToEnd"),
@@ -494,524 +508,526 @@ export function Composer(t0) {
494
508
  })
495
509
  })
496
510
  });
497
- $[95] = atEnd;
498
- $[96] = chatId;
499
- $[97] = readOnly;
500
- $[98] = t;
501
- $[99] = t33;
511
+ $[99] = atEnd;
512
+ $[100] = chatId;
513
+ $[101] = readOnly;
514
+ $[102] = t;
515
+ $[103] = t34;
502
516
  } else {
503
- t33 = $[99];
517
+ t34 = $[103];
504
518
  }
505
- let t34;
506
- if ($[100] !== chatId || $[101] !== workflowPill) {
507
- t34 = /*#__PURE__*/_jsx(ChatActivity, {
519
+ let t35;
520
+ if ($[104] !== chatId || $[105] !== workflowPill) {
521
+ t35 = /*#__PURE__*/_jsx(ChatActivity, {
508
522
  chatId: chatId,
509
523
  workflows: workflowPill
510
524
  });
511
- $[100] = chatId;
512
- $[101] = workflowPill;
513
- $[102] = t34;
525
+ $[104] = chatId;
526
+ $[105] = workflowPill;
527
+ $[106] = t35;
514
528
  } else {
515
- t34 = $[102];
529
+ t35 = $[106];
516
530
  }
517
- const t35 = files.dragging ? "border-accent bg-[color-mix(in_srgb,var(--accent-soft)_60%,var(--surface-raised))]" : "border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)]";
518
- let t36;
519
- if ($[103] !== t35) {
520
- t36 = clsx("@container/composer pointer-events-auto relative z-1 flex flex-col overflow-hidden rounded-2xl border shadow-float backdrop-blur-[14px] focus-ring-within", t35);
521
- $[103] = t35;
522
- $[104] = t36;
531
+ const t36 = files.dragging ? "border-accent bg-[color-mix(in_srgb,var(--accent-soft)_60%,var(--surface-raised))]" : "border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)]";
532
+ let t37;
533
+ if ($[107] !== t36) {
534
+ t37 = clsx("@container/composer pointer-events-auto relative z-1 flex flex-col overflow-hidden rounded-2xl border shadow-float backdrop-blur-[14px] focus-ring-within", t36);
535
+ $[107] = t36;
536
+ $[108] = t37;
523
537
  } else {
524
- t36 = $[104];
538
+ t37 = $[108];
525
539
  }
526
- const t37 = files.dropTarget;
527
- let t38;
528
- if ($[105] !== chatId || $[106] !== focused || $[107] !== host.ComposerHeaderSlot || $[108] !== scope.id || $[109] !== writable) {
529
- t38 = host.ComposerHeaderSlot && /*#__PURE__*/_jsx(host.ComposerHeaderSlot, {
540
+ const t38 = files.dropTarget;
541
+ let t39;
542
+ if ($[109] !== chatId || $[110] !== focused || $[111] !== host.ComposerHeaderSlot || $[112] !== scope.id || $[113] !== writable) {
543
+ t39 = host.ComposerHeaderSlot && /*#__PURE__*/_jsx(host.ComposerHeaderSlot, {
530
544
  scopeId: scope.id,
531
545
  chatId: chatId,
532
546
  disabled: !writable,
533
547
  focused: focused
534
548
  });
535
- $[105] = chatId;
536
- $[106] = focused;
537
- $[107] = host.ComposerHeaderSlot;
538
- $[108] = scope.id;
539
- $[109] = writable;
540
- $[110] = t38;
549
+ $[109] = chatId;
550
+ $[110] = focused;
551
+ $[111] = host.ComposerHeaderSlot;
552
+ $[112] = scope.id;
553
+ $[113] = writable;
554
+ $[114] = t39;
541
555
  } else {
542
- t38 = $[110];
556
+ t39 = $[114];
543
557
  }
544
558
  const T0 = PromptComposer;
545
- const t39 = !empty;
546
- const t40 = capabilities?.denyReason === true;
547
- let t41;
548
- if ($[111] === Symbol.for("react.memo_cache_sentinel")) {
549
- t41 = () => inputRef.current?.focus();
550
- $[111] = t41;
559
+ const t40 = !empty;
560
+ const t41 = capabilities?.denyReason === true;
561
+ let t42;
562
+ if ($[115] === Symbol.for("react.memo_cache_sentinel")) {
563
+ t42 = () => inputRef.current?.focus();
564
+ $[115] = t42;
551
565
  } else {
552
- t41 = $[111];
566
+ t42 = $[115];
553
567
  }
554
- const t42 = writable && "data-[text-cursor]:cursor-text";
555
- let t43;
556
- if ($[112] !== t42) {
557
- t43 = clsx(t42);
558
- $[112] = t42;
559
- $[113] = t43;
568
+ const t43 = writable && "data-[text-cursor]:cursor-text";
569
+ let t44;
570
+ if ($[116] !== t43) {
571
+ t44 = clsx(t43);
572
+ $[116] = t43;
573
+ $[117] = t44;
560
574
  } else {
561
- t43 = $[113];
575
+ t44 = $[117];
562
576
  }
563
- let t44;
564
- if ($[114] !== chatId || $[115] !== info) {
565
- t44 = /*#__PURE__*/_jsx(LimitDock, {
577
+ let t45;
578
+ if ($[118] !== chatId || $[119] !== info) {
579
+ t45 = /*#__PURE__*/_jsx(LimitDock, {
566
580
  chatId: chatId,
567
581
  info: info
568
582
  });
569
- $[114] = chatId;
570
- $[115] = info;
571
- $[116] = t44;
583
+ $[118] = chatId;
584
+ $[119] = info;
585
+ $[120] = t45;
572
586
  } else {
573
- t44 = $[116];
587
+ t45 = $[120];
574
588
  }
575
- const t45 = capabilities?.goals;
576
- let t46;
577
- if ($[117] !== chatId || $[118] !== info || $[119] !== t45) {
578
- t46 = /*#__PURE__*/_jsx(GoalDock, {
589
+ const t46 = capabilities?.goals;
590
+ let t47;
591
+ if ($[121] !== chatId || $[122] !== info || $[123] !== t46) {
592
+ t47 = /*#__PURE__*/_jsx(GoalDock, {
579
593
  chatId: chatId,
580
594
  info: info,
581
- goals: t45
595
+ goals: t46
582
596
  });
583
- $[117] = chatId;
584
- $[118] = info;
585
- $[119] = t45;
586
- $[120] = t46;
597
+ $[121] = chatId;
598
+ $[122] = info;
599
+ $[123] = t46;
600
+ $[124] = t47;
587
601
  } else {
588
- t46 = $[120];
602
+ t47 = $[124];
589
603
  }
590
- let t47;
591
- if ($[121] !== chatId || $[122] !== compactionOffer || $[123] !== controls.compact || $[124] !== scope) {
592
- t47 = compactionOffer && /*#__PURE__*/_jsx(ResumeCompactionDock, {
604
+ let t48;
605
+ if ($[125] !== chatId || $[126] !== compactionOffer || $[127] !== controls.compact || $[128] !== scope) {
606
+ t48 = compactionOffer && /*#__PURE__*/_jsx(ResumeCompactionDock, {
593
607
  tokens: compactionOffer.tokens,
594
608
  reason: compactionOffer.reason,
595
609
  onCompact: controls.compact,
596
610
  onDismiss: () => dismissResumeCompaction(scope, chatId, compactionOffer.turnId)
597
611
  });
598
- $[121] = chatId;
599
- $[122] = compactionOffer;
600
- $[123] = controls.compact;
601
- $[124] = scope;
602
- $[125] = t47;
612
+ $[125] = chatId;
613
+ $[126] = compactionOffer;
614
+ $[127] = controls.compact;
615
+ $[128] = scope;
616
+ $[129] = t48;
603
617
  } else {
604
- t47 = $[125];
618
+ t48 = $[129];
605
619
  }
606
- let t48;
607
- if ($[126] !== menus) {
608
- t48 = /*#__PURE__*/_jsx(ComposerMenu, {
620
+ let t49;
621
+ if ($[130] !== menus) {
622
+ t49 = /*#__PURE__*/_jsx(ComposerMenu, {
609
623
  menus: menus
610
624
  });
611
- $[126] = menus;
612
- $[127] = t48;
625
+ $[130] = menus;
626
+ $[131] = t49;
613
627
  } else {
614
- t48 = $[127];
628
+ t49 = $[131];
615
629
  }
616
- let t49;
617
- if ($[128] !== chatId || $[129] !== info.queuePaused || $[130] !== queue || $[131] !== takeBack || $[132] !== takingBack) {
618
- t49 = queue.length > 0 && /*#__PURE__*/_jsx(QueuedMessages, {
630
+ let t50;
631
+ if ($[132] !== chatId || $[133] !== held || $[134] !== info.queuePaused || $[135] !== queue || $[136] !== takeBack || $[137] !== takingBack) {
632
+ t50 = queue.length > 0 && /*#__PURE__*/_jsx(QueuedMessages, {
619
633
  chatId: chatId,
620
634
  queue: queue,
621
635
  paused: info.queuePaused === true,
636
+ held: held,
622
637
  takingBack: takingBack !== null,
623
638
  onEdit: message => void takeBack(message)
624
639
  });
625
- $[128] = chatId;
626
- $[129] = info.queuePaused;
627
- $[130] = queue;
628
- $[131] = takeBack;
629
- $[132] = takingBack;
630
- $[133] = t49;
640
+ $[132] = chatId;
641
+ $[133] = held;
642
+ $[134] = info.queuePaused;
643
+ $[135] = queue;
644
+ $[136] = takeBack;
645
+ $[137] = takingBack;
646
+ $[138] = t50;
631
647
  } else {
632
- t49 = $[133];
648
+ t50 = $[138];
633
649
  }
634
- let t50;
635
- if ($[134] !== box.removeQuote || $[135] !== chatId || $[136] !== draft.quote || $[137] !== draft.quoteSource || $[138] !== notice || $[139] !== t) {
636
- t50 = draft.quote !== "" && /*#__PURE__*/_jsx(DraftQuote, {
650
+ let t51;
651
+ if ($[139] !== box.removeQuote || $[140] !== chatId || $[141] !== draft.quote || $[142] !== draft.quoteSource || $[143] !== notice || $[144] !== t) {
652
+ t51 = draft.quote !== "" && /*#__PURE__*/_jsx(DraftQuote, {
637
653
  chatId: chatId,
638
654
  quote: draft.quote,
639
655
  source: draft.quoteSource,
640
656
  onRemove: box.removeQuote,
641
657
  onSourceGone: () => notice.setNotice(t("rows.user.quoteGone"), "info")
642
658
  });
643
- $[134] = box.removeQuote;
644
- $[135] = chatId;
645
- $[136] = draft.quote;
646
- $[137] = draft.quoteSource;
647
- $[138] = notice;
648
- $[139] = t;
649
- $[140] = t50;
659
+ $[139] = box.removeQuote;
660
+ $[140] = chatId;
661
+ $[141] = draft.quote;
662
+ $[142] = draft.quoteSource;
663
+ $[143] = notice;
664
+ $[144] = t;
665
+ $[145] = t51;
650
666
  } else {
651
- t50 = $[140];
667
+ t51 = $[145];
652
668
  }
653
- let t51;
654
- if ($[141] !== box.removeAttachment || $[142] !== draft.attachments) {
655
- t51 = draft.attachments.length > 0 && /*#__PURE__*/_jsx(DraftAttachments, {
669
+ let t52;
670
+ if ($[146] !== box.removeAttachment || $[147] !== draft.attachments) {
671
+ t52 = draft.attachments.length > 0 && /*#__PURE__*/_jsx(DraftAttachments, {
656
672
  attachments: draft.attachments,
657
673
  onRemove: box.removeAttachment
658
674
  });
659
- $[141] = box.removeAttachment;
660
- $[142] = draft.attachments;
661
- $[143] = t51;
675
+ $[146] = box.removeAttachment;
676
+ $[147] = draft.attachments;
677
+ $[148] = t52;
662
678
  } else {
663
- t51 = $[143];
679
+ t52 = $[148];
664
680
  }
665
- const t52 = !writable;
666
- let t53;
667
- if ($[144] !== box || $[145] !== history || $[146] !== hold || $[147] !== menus) {
668
- t53 = (value, selection, state) => {
681
+ const t53 = !writable;
682
+ let t54;
683
+ if ($[149] !== box || $[150] !== history || $[151] !== hold || $[152] !== menus) {
684
+ t54 = (value, selection, state) => {
669
685
  hold.noteInput();
670
686
  box.setText(value);
671
687
  menus.setMenuIndex(0);
672
688
  menus.trackTriggers(value, selection, state);
673
689
  history.edited(value);
674
690
  };
675
- $[144] = box;
676
- $[145] = history;
677
- $[146] = hold;
678
- $[147] = menus;
679
- $[148] = t53;
691
+ $[149] = box;
692
+ $[150] = history;
693
+ $[151] = hold;
694
+ $[152] = menus;
695
+ $[153] = t54;
680
696
  } else {
681
- t53 = $[148];
697
+ t54 = $[153];
682
698
  }
683
- let t54;
684
- if ($[149] !== hold || $[150] !== menus) {
685
- t54 = () => {
699
+ let t55;
700
+ if ($[154] !== hold || $[155] !== menus) {
701
+ t55 = () => {
686
702
  menus.close();
687
703
  hold.release("blur");
688
704
  };
689
- $[149] = hold;
690
- $[150] = menus;
691
- $[151] = t54;
705
+ $[154] = hold;
706
+ $[155] = menus;
707
+ $[156] = t55;
692
708
  } else {
693
- t54 = $[151];
709
+ t55 = $[156];
694
710
  }
695
- let t55;
696
- if ($[152] !== dictationToolbar || $[153] !== draft.text || $[154] !== editorExtensions || $[155] !== files.onCopy || $[156] !== files.onPaste || $[157] !== focused || $[158] !== hold.setComposing || $[159] !== menus.inputAria || $[160] !== menus.trackTriggers || $[161] !== onKeyDown || $[162] !== placeholder || $[163] !== t52 || $[164] !== t53 || $[165] !== t54) {
697
- t55 = /*#__PURE__*/_jsx(ComposerInput, {
711
+ let t56;
712
+ if ($[157] !== dictationToolbar || $[158] !== draft.text || $[159] !== editorExtensions || $[160] !== files.onCopy || $[161] !== files.onPaste || $[162] !== focused || $[163] !== hold.setComposing || $[164] !== menus.inputAria || $[165] !== menus.trackTriggers || $[166] !== onKeyDown || $[167] !== placeholder || $[168] !== t53 || $[169] !== t54 || $[170] !== t55) {
713
+ t56 = /*#__PURE__*/_jsx(ComposerInput, {
698
714
  ref: inputRef,
699
715
  dictationToolbar: dictationToolbar,
700
716
  className: "composer-input select-text text-sm leading-normal text-text",
701
717
  value: draft.text,
702
718
  placeholder: placeholder,
703
- disabled: t52,
719
+ disabled: t53,
704
720
  tabbable: focused,
705
721
  extensions: editorExtensions,
706
722
  aria: menus.inputAria,
707
- onChange: t53,
723
+ onChange: t54,
708
724
  onSelectionChange: menus.trackTriggers,
709
- onBlur: t54,
725
+ onBlur: t55,
710
726
  onComposing: hold.setComposing,
711
727
  onKeyDown: onKeyDown,
712
728
  onPaste: files.onPaste,
713
729
  onCopy: files.onCopy
714
730
  });
715
- $[152] = dictationToolbar;
716
- $[153] = draft.text;
717
- $[154] = editorExtensions;
718
- $[155] = files.onCopy;
719
- $[156] = files.onPaste;
720
- $[157] = focused;
721
- $[158] = hold.setComposing;
722
- $[159] = menus.inputAria;
723
- $[160] = menus.trackTriggers;
724
- $[161] = onKeyDown;
725
- $[162] = placeholder;
726
- $[163] = t52;
727
- $[164] = t53;
728
- $[165] = t54;
729
- $[166] = t55;
731
+ $[157] = dictationToolbar;
732
+ $[158] = draft.text;
733
+ $[159] = editorExtensions;
734
+ $[160] = files.onCopy;
735
+ $[161] = files.onPaste;
736
+ $[162] = focused;
737
+ $[163] = hold.setComposing;
738
+ $[164] = menus.inputAria;
739
+ $[165] = menus.trackTriggers;
740
+ $[166] = onKeyDown;
741
+ $[167] = placeholder;
742
+ $[168] = t53;
743
+ $[169] = t54;
744
+ $[170] = t55;
745
+ $[171] = t56;
730
746
  } else {
731
- t55 = $[166];
747
+ t56 = $[171];
732
748
  }
733
- let t56;
734
- if ($[167] !== notice.notice || $[168] !== notice.tone) {
735
- t56 = notice.notice && /*#__PURE__*/_jsx("div", {
749
+ let t57;
750
+ if ($[172] !== notice.notice || $[173] !== notice.tone) {
751
+ t57 = notice.notice && /*#__PURE__*/_jsx("div", {
736
752
  className: clsx("px-5 pb-1 text-xs @max-md/composer:px-3.5", notice.tone === "error" ? "text-status-error" : "text-text-muted"),
737
753
  role: notice.tone === "error" ? "alert" : "status",
738
754
  children: notice.notice
739
755
  });
740
- $[167] = notice.notice;
741
- $[168] = notice.tone;
742
- $[169] = t56;
756
+ $[172] = notice.notice;
757
+ $[173] = notice.tone;
758
+ $[174] = t57;
743
759
  } else {
744
- t56 = $[169];
760
+ t57 = $[174];
745
761
  }
746
- const t57 = guard.visible && /*#__PURE__*/_jsxs("div", {
762
+ const t58 = guard.visible && /*#__PURE__*/_jsxs("div", {
747
763
  className: clsx("px-5 pb-1 text-right text-xs tabular-nums @max-md/composer:px-3.5", guard.tooLong ? "text-status-error" : "text-text-faint"),
748
764
  children: [formatNumber(guard.count), " / ", formatNumber(PROMPT_MAX_CHARS), guard.tooLong && ` ${t("composer.tooLong")}`]
749
765
  });
750
766
  const T1 = ComposerControls;
751
- const t58 = capabilities?.attachments !== false;
752
- const t59 = !busy || !empty;
753
- const t60 = empty || !writable || guard.tooLong;
754
- const t61 = t(sendLabelKey(busy, steerable, sendDelivery));
755
- let t62;
756
- if ($[170] !== draft.text || $[171] !== sendKey) {
757
- t62 = sendShortcut(sendKey, draft.text.includes("\n"));
758
- $[170] = draft.text;
759
- $[171] = sendKey;
760
- $[172] = t62;
767
+ const t59 = capabilities?.attachments !== false;
768
+ const t60 = !busy || !empty;
769
+ const t61 = empty || !writable || guard.tooLong;
770
+ const t62 = t(sendLabelKey(busy, steerable, sendDelivery));
771
+ let t63;
772
+ if ($[175] !== draft.text || $[176] !== sendKey) {
773
+ t63 = sendShortcut(sendKey, draft.text.includes("\n"));
774
+ $[175] = draft.text;
775
+ $[176] = sendKey;
776
+ $[177] = t63;
761
777
  } else {
762
- t62 = $[172];
778
+ t63 = $[177];
763
779
  }
764
- let t63;
765
- if ($[173] !== submit) {
766
- t63 = alternate => submit(alternate ? "alternate" : "default");
767
- $[173] = submit;
768
- $[174] = t63;
780
+ let t64;
781
+ if ($[178] !== submit) {
782
+ t64 = alternate => submit(alternate ? "alternate" : "default");
783
+ $[178] = submit;
784
+ $[179] = t64;
769
785
  } else {
770
- t63 = $[174];
786
+ t64 = $[179];
771
787
  }
772
- const t64 = continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0 ? continueTurn : null;
773
- let t65;
774
- if ($[175] !== t59 || $[176] !== t60 || $[177] !== t61 || $[178] !== t62 || $[179] !== t63 || $[180] !== t64) {
775
- t65 = {
776
- visible: t59,
777
- disabled: t60,
778
- label: t61,
779
- kbd: t62,
780
- onSend: t63,
781
- onContinue: t64
788
+ const t65 = continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0 ? continueTurn : null;
789
+ let t66;
790
+ if ($[180] !== t60 || $[181] !== t61 || $[182] !== t62 || $[183] !== t63 || $[184] !== t64 || $[185] !== t65) {
791
+ t66 = {
792
+ visible: t60,
793
+ disabled: t61,
794
+ label: t62,
795
+ kbd: t63,
796
+ onSend: t64,
797
+ onContinue: t65
782
798
  };
783
- $[175] = t59;
784
- $[176] = t60;
785
- $[177] = t61;
786
- $[178] = t62;
787
- $[179] = t63;
788
- $[180] = t64;
789
- $[181] = t65;
799
+ $[180] = t60;
800
+ $[181] = t61;
801
+ $[182] = t62;
802
+ $[183] = t63;
803
+ $[184] = t64;
804
+ $[185] = t65;
805
+ $[186] = t66;
790
806
  } else {
791
- t65 = $[181];
807
+ t66 = $[186];
792
808
  }
793
- let t66;
794
- if ($[182] !== files) {
795
- t66 = picked => {
809
+ let t67;
810
+ if ($[187] !== files) {
811
+ t67 = picked => {
796
812
  files.addFiles(picked);
797
813
  inputRef.current?.focus();
798
814
  };
799
- $[182] = files;
800
- $[183] = t66;
815
+ $[187] = files;
816
+ $[188] = t67;
801
817
  } else {
802
- t66 = $[183];
818
+ t67 = $[188];
803
819
  }
804
- let t67;
805
820
  let t68;
806
- if ($[184] !== writable) {
807
- t67 = sigil => {
821
+ let t69;
822
+ if ($[189] !== writable) {
823
+ t68 = sigil => {
808
824
  if (writable) {
809
825
  inputRef.current?.insertSigil(sigil);
810
826
  }
811
827
  };
812
- t68 = added => {
828
+ t69 = added => {
813
829
  if (writable) {
814
830
  inputRef.current?.insert(added);
815
831
  }
816
832
  };
817
- $[184] = writable;
818
- $[185] = t67;
819
- $[186] = t68;
833
+ $[189] = writable;
834
+ $[190] = t68;
835
+ $[191] = t69;
820
836
  } else {
821
- t67 = $[185];
822
- t68 = $[186];
837
+ t68 = $[190];
838
+ t69 = $[191];
823
839
  }
824
- let t69;
825
- if ($[187] !== T1 || $[188] !== chatId || $[189] !== controls || $[190] !== empty || $[191] !== info || $[192] !== providerFixed || $[193] !== restoreStashed || $[194] !== setDictationToolbar || $[195] !== sigils || $[196] !== t58 || $[197] !== t65 || $[198] !== t66 || $[199] !== t67 || $[200] !== t68 || $[201] !== toggleStash || $[202] !== writable) {
826
- t69 = /*#__PURE__*/_jsx(T1, {
840
+ let t70;
841
+ if ($[192] !== T1 || $[193] !== chatId || $[194] !== controls || $[195] !== empty || $[196] !== info || $[197] !== providerFixed || $[198] !== restoreStashed || $[199] !== setDictationToolbar || $[200] !== sigils || $[201] !== t59 || $[202] !== t66 || $[203] !== t67 || $[204] !== t68 || $[205] !== t69 || $[206] !== toggleStash || $[207] !== writable) {
842
+ t70 = /*#__PURE__*/_jsx(T1, {
827
843
  chatId: chatId,
828
844
  info: info,
829
845
  providerFixed: providerFixed,
830
846
  writable: writable,
831
- attachable: t58,
847
+ attachable: t59,
832
848
  emptyDraft: empty,
833
849
  sigils: sigils,
834
850
  controls: controls,
835
- send: t65,
851
+ send: t66,
836
852
  dictationToolbar: setDictationToolbar,
837
- onFiles: t66,
853
+ onFiles: t67,
838
854
  onRestore: restoreStashed,
839
855
  onStash: toggleStash,
840
- onSigil: t67,
841
- insert: t68
856
+ onSigil: t68,
857
+ insert: t69
842
858
  });
843
- $[187] = T1;
844
- $[188] = chatId;
845
- $[189] = controls;
846
- $[190] = empty;
847
- $[191] = info;
848
- $[192] = providerFixed;
849
- $[193] = restoreStashed;
850
- $[194] = setDictationToolbar;
851
- $[195] = sigils;
852
- $[196] = t58;
853
- $[197] = t65;
854
- $[198] = t66;
855
- $[199] = t67;
856
- $[200] = t68;
857
- $[201] = toggleStash;
858
- $[202] = writable;
859
- $[203] = t69;
859
+ $[192] = T1;
860
+ $[193] = chatId;
861
+ $[194] = controls;
862
+ $[195] = empty;
863
+ $[196] = info;
864
+ $[197] = providerFixed;
865
+ $[198] = restoreStashed;
866
+ $[199] = setDictationToolbar;
867
+ $[200] = sigils;
868
+ $[201] = t59;
869
+ $[202] = t66;
870
+ $[203] = t67;
871
+ $[204] = t68;
872
+ $[205] = t69;
873
+ $[206] = toggleStash;
874
+ $[207] = writable;
875
+ $[208] = t70;
860
876
  } else {
861
- t69 = $[203];
877
+ t70 = $[208];
862
878
  }
863
- let t70;
864
- if ($[204] !== pointSurface || $[205] !== pressSurface || $[206] !== t43 || $[207] !== t44 || $[208] !== t46 || $[209] !== t47 || $[210] !== t48 || $[211] !== t49 || $[212] !== t50 || $[213] !== t51 || $[214] !== t55 || $[215] !== t56 || $[216] !== t57 || $[217] !== t69) {
865
- t70 = /*#__PURE__*/_jsxs("div", {
866
- className: t43,
879
+ let t71;
880
+ if ($[209] !== pointSurface || $[210] !== pressSurface || $[211] !== t44 || $[212] !== t45 || $[213] !== t47 || $[214] !== t48 || $[215] !== t49 || $[216] !== t50 || $[217] !== t51 || $[218] !== t52 || $[219] !== t56 || $[220] !== t57 || $[221] !== t58 || $[222] !== t70) {
881
+ t71 = /*#__PURE__*/_jsxs("div", {
882
+ className: t44,
867
883
  onPointerOver: pointSurface,
868
884
  onMouseDown: pressSurface,
869
- children: [t44, t46, t47, t48, t49, t50, t51, t55, t56, t57, t69]
885
+ children: [t45, t47, t48, t49, t50, t51, t52, t56, t57, t58, t70]
870
886
  });
871
- $[204] = pointSurface;
872
- $[205] = pressSurface;
873
- $[206] = t43;
874
- $[207] = t44;
875
- $[208] = t46;
876
- $[209] = t47;
877
- $[210] = t48;
878
- $[211] = t49;
879
- $[212] = t50;
880
- $[213] = t51;
881
- $[214] = t55;
882
- $[215] = t56;
883
- $[216] = t57;
884
- $[217] = t69;
885
- $[218] = t70;
887
+ $[209] = pointSurface;
888
+ $[210] = pressSurface;
889
+ $[211] = t44;
890
+ $[212] = t45;
891
+ $[213] = t47;
892
+ $[214] = t48;
893
+ $[215] = t49;
894
+ $[216] = t50;
895
+ $[217] = t51;
896
+ $[218] = t52;
897
+ $[219] = t56;
898
+ $[220] = t57;
899
+ $[221] = t58;
900
+ $[222] = t70;
901
+ $[223] = t71;
886
902
  } else {
887
- t70 = $[218];
903
+ t71 = $[223];
888
904
  }
889
- let t71;
890
- if ($[219] !== T0 || $[220] !== answerPromptsElsewhere || $[221] !== chatId || $[222] !== disabled || $[223] !== focused || $[224] !== hold || $[225] !== pending || $[226] !== t39 || $[227] !== t40 || $[228] !== t41 || $[229] !== t70) {
891
- t71 = /*#__PURE__*/_jsx(T0, {
905
+ let t72;
906
+ if ($[224] !== T0 || $[225] !== answerPromptsElsewhere || $[226] !== chatId || $[227] !== disabled || $[228] !== focused || $[229] !== hold || $[230] !== pending || $[231] !== t40 || $[232] !== t41 || $[233] !== t42 || $[234] !== t71) {
907
+ t72 = /*#__PURE__*/_jsx(T0, {
892
908
  chatId: chatId,
893
909
  pending: pending,
894
910
  focused: focused,
895
911
  onShowElsewhere: answerPromptsElsewhere,
896
912
  disabled: disabled,
897
- hasDraft: t39,
898
- denyReason: t40,
899
- onAllAnswered: t41,
913
+ hasDraft: t40,
914
+ denyReason: t41,
915
+ onAllAnswered: t42,
900
916
  hold: hold,
901
- children: t70
917
+ children: t71
902
918
  });
903
- $[219] = T0;
904
- $[220] = answerPromptsElsewhere;
905
- $[221] = chatId;
906
- $[222] = disabled;
907
- $[223] = focused;
908
- $[224] = hold;
909
- $[225] = pending;
910
- $[226] = t39;
911
- $[227] = t40;
912
- $[228] = t41;
913
- $[229] = t70;
914
- $[230] = t71;
915
- } else {
916
- t71 = $[230];
917
- }
918
- let t72;
919
- if ($[231] !== files.dropTarget || $[232] !== t36 || $[233] !== t38 || $[234] !== t71) {
920
- t72 = /*#__PURE__*/_jsxs("div", {
921
- className: t36,
922
- ...t37,
923
- children: [t38, t71]
924
- });
925
- $[231] = files.dropTarget;
926
- $[232] = t36;
927
- $[233] = t38;
919
+ $[224] = T0;
920
+ $[225] = answerPromptsElsewhere;
921
+ $[226] = chatId;
922
+ $[227] = disabled;
923
+ $[228] = focused;
924
+ $[229] = hold;
925
+ $[230] = pending;
926
+ $[231] = t40;
927
+ $[232] = t41;
928
+ $[233] = t42;
928
929
  $[234] = t71;
929
930
  $[235] = t72;
930
931
  } else {
931
932
  t72 = $[235];
932
933
  }
933
934
  let t73;
934
- if ($[236] !== statusItems) {
935
- t73 = /*#__PURE__*/_jsx(ComposerStatusLine, {
936
- items: statusItems
935
+ if ($[236] !== files.dropTarget || $[237] !== t37 || $[238] !== t39 || $[239] !== t72) {
936
+ t73 = /*#__PURE__*/_jsxs("div", {
937
+ className: t37,
938
+ ...t38,
939
+ children: [t39, t72]
937
940
  });
938
- $[236] = statusItems;
939
- $[237] = t73;
941
+ $[236] = files.dropTarget;
942
+ $[237] = t37;
943
+ $[238] = t39;
944
+ $[239] = t72;
945
+ $[240] = t73;
940
946
  } else {
941
- t73 = $[237];
947
+ t73 = $[240];
942
948
  }
943
- const t74 = controls.confirmClear;
944
- let t75;
945
- if ($[238] !== t) {
946
- t75 = t("composer.clear.title");
947
- $[238] = t;
948
- $[239] = t75;
949
+ let t74;
950
+ if ($[241] !== statusItems) {
951
+ t74 = /*#__PURE__*/_jsx(ComposerStatusLine, {
952
+ items: statusItems
953
+ });
954
+ $[241] = statusItems;
955
+ $[242] = t74;
949
956
  } else {
950
- t75 = $[239];
957
+ t74 = $[242];
951
958
  }
959
+ const t75 = controls.confirmClear;
952
960
  let t76;
953
- if ($[240] !== t) {
954
- t76 = t("composer.clear.description");
955
- $[240] = t;
956
- $[241] = t76;
961
+ if ($[243] !== t) {
962
+ t76 = t("composer.clear.title");
963
+ $[243] = t;
964
+ $[244] = t76;
957
965
  } else {
958
- t76 = $[241];
966
+ t76 = $[244];
959
967
  }
960
968
  let t77;
961
- if ($[242] !== t) {
962
- t77 = t("composer.clear.confirm");
963
- $[242] = t;
964
- $[243] = t77;
969
+ if ($[245] !== t) {
970
+ t77 = t("composer.clear.description");
971
+ $[245] = t;
972
+ $[246] = t77;
965
973
  } else {
966
- t77 = $[243];
974
+ t77 = $[246];
967
975
  }
968
976
  let t78;
969
- if ($[244] !== t) {
970
- t78 = t("composer.notice.clearFailed");
971
- $[244] = t;
972
- $[245] = t78;
977
+ if ($[247] !== t) {
978
+ t78 = t("composer.clear.confirm");
979
+ $[247] = t;
980
+ $[248] = t78;
973
981
  } else {
974
- t78 = $[245];
982
+ t78 = $[248];
975
983
  }
976
984
  let t79;
977
- if ($[246] !== controls.cancelClear || $[247] !== controls.confirmClear || $[248] !== controls.forceClearThread || $[249] !== t75 || $[250] !== t76 || $[251] !== t77 || $[252] !== t78) {
978
- t79 = /*#__PURE__*/_jsx(PromptDialog, {
979
- open: t74,
980
- title: t75,
981
- description: t76,
982
- confirmLabel: t77,
985
+ if ($[249] !== t) {
986
+ t79 = t("composer.notice.clearFailed");
987
+ $[249] = t;
988
+ $[250] = t79;
989
+ } else {
990
+ t79 = $[250];
991
+ }
992
+ let t80;
993
+ if ($[251] !== controls.cancelClear || $[252] !== controls.confirmClear || $[253] !== controls.forceClearThread || $[254] !== t76 || $[255] !== t77 || $[256] !== t78 || $[257] !== t79) {
994
+ t80 = /*#__PURE__*/_jsx(PromptDialog, {
995
+ open: t75,
996
+ title: t76,
997
+ description: t77,
998
+ confirmLabel: t78,
983
999
  danger: true,
984
- fallbackMessage: t78,
1000
+ fallbackMessage: t79,
985
1001
  onConfirm: controls.forceClearThread,
986
1002
  onOpenChange: controls.cancelClear
987
1003
  });
988
- $[246] = controls.cancelClear;
989
- $[247] = controls.confirmClear;
990
- $[248] = controls.forceClearThread;
991
- $[249] = t75;
992
- $[250] = t76;
993
- $[251] = t77;
994
- $[252] = t78;
995
- $[253] = t79;
1004
+ $[251] = controls.cancelClear;
1005
+ $[252] = controls.confirmClear;
1006
+ $[253] = controls.forceClearThread;
1007
+ $[254] = t76;
1008
+ $[255] = t77;
1009
+ $[256] = t78;
1010
+ $[257] = t79;
1011
+ $[258] = t80;
996
1012
  } else {
997
- t79 = $[253];
1013
+ t80 = $[258];
998
1014
  }
999
- let t80;
1000
- if ($[254] !== t33 || $[255] !== t34 || $[256] !== t72 || $[257] !== t73 || $[258] !== t79) {
1001
- t80 = /*#__PURE__*/_jsxs("div", {
1002
- className: t32,
1003
- children: [t33, t34, t72, t73, t79]
1015
+ let t81;
1016
+ if ($[259] !== t34 || $[260] !== t35 || $[261] !== t73 || $[262] !== t74 || $[263] !== t80) {
1017
+ t81 = /*#__PURE__*/_jsxs("div", {
1018
+ className: t33,
1019
+ children: [t34, t35, t73, t74, t80]
1004
1020
  });
1005
- $[254] = t33;
1006
- $[255] = t34;
1007
- $[256] = t72;
1008
- $[257] = t73;
1009
- $[258] = t79;
1010
- $[259] = t80;
1021
+ $[259] = t34;
1022
+ $[260] = t35;
1023
+ $[261] = t73;
1024
+ $[262] = t74;
1025
+ $[263] = t80;
1026
+ $[264] = t81;
1011
1027
  } else {
1012
- t80 = $[259];
1028
+ t81 = $[264];
1013
1029
  }
1014
- return t80;
1030
+ return t81;
1015
1031
  }
1016
1032
  function _temp4(event) {
1017
1033
  event.currentTarget.toggleAttribute("data-text-cursor", surfacePartOf(event.target, event.currentTarget) !== "action");