inline-chat-kit 0.59.0 → 0.60.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/CHANGELOG.md +144 -0
- package/README.md +5 -1
- package/dist/{ChatExperience-BeLjIxHU.js → ChatExperience-BBd-p0wh.js} +1078 -899
- package/dist/ChatExperience-BBd-p0wh.js.map +1 -0
- package/dist/ChatHeader/ChatHeader.d.ts +7 -0
- package/dist/ChatInput/ChatInput.d.ts +7 -0
- package/dist/ChatTurnRow/ChatTurnRow.d.ts +23 -1
- package/dist/demo.js +1 -1
- package/dist/inline-chat-kit.css +1 -1
- package/dist/inline-chat-kit.js +1 -1
- package/package.json +1 -1
- package/theming.md +69 -0
- package/dist/ChatExperience-BeLjIxHU.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import e, { createContext as t, createElement as n, forwardRef as r, isValidElement as i, memo as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
|
|
3
3
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
4
4
|
import { AnimatePresence as y, LayoutGroup as b, MotionConfig as x, animate as S, motion as C, useAnimationControls as w, useMotionValue as T, useReducedMotion as E } from "motion/react";
|
|
5
|
-
import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as
|
|
5
|
+
import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as N, ChevronRight as ee, Copy as te, CornerDownLeft as P, File as F, FileText as I, Film as ne, Highlighter as L, Image as re, Link2 as ie, Maximize2 as R, MessageCircle as ae, Mic as oe, Minimize2 as se, Moon as ce, MoreHorizontal as le, Music as ue, Palette as de, Paperclip as z, Pencil as fe, Plus as pe, RotateCcw as me, Save as he, Share as ge, Square as _e, Sun as ve, TextCursor as ye, ThumbsDown as be, ThumbsUp as xe, Trash2 as Se, TriangleAlert as Ce, X as we } from "lucide-react";
|
|
6
6
|
var B = {
|
|
7
7
|
btn: "ick-btn-ZW5E",
|
|
8
8
|
xs: "ick-xs-rDs4",
|
|
@@ -47,6 +47,7 @@ var B = {
|
|
|
47
47
|
className: u,
|
|
48
48
|
disabled: s || i,
|
|
49
49
|
"aria-busy": i,
|
|
50
|
+
"data-ick-variant": e,
|
|
50
51
|
...c,
|
|
51
52
|
children: [
|
|
52
53
|
n && /* @__PURE__ */ _("span", {
|
|
@@ -269,7 +270,7 @@ function Me(e) {
|
|
|
269
270
|
var U = (e) => !!e.url && (e.type ?? "").startsWith("image/"), Ne = (e) => e.replace(/["\\]/g, encodeURIComponent);
|
|
270
271
|
function Pe({ type: e }) {
|
|
271
272
|
let t = (e ?? "").split("/")[0];
|
|
272
|
-
return _(t === "image" ?
|
|
273
|
+
return _(t === "image" ? re : t === "video" ? ne : t === "audio" ? ue : e === "application/pdf" || t === "text" ? I : F, {
|
|
273
274
|
size: 16,
|
|
274
275
|
"aria-hidden": !0
|
|
275
276
|
});
|
|
@@ -305,6 +306,7 @@ function Fe({ attachments: e, onRemove: t, labels: n, className: r, ...i }) {
|
|
|
305
306
|
className: De.remove,
|
|
306
307
|
children: /* @__PURE__ */ _(V, {
|
|
307
308
|
variant: "glass",
|
|
309
|
+
"data-ick-role": "remove-attachment",
|
|
308
310
|
size: "s",
|
|
309
311
|
onClick: () => t(e.id),
|
|
310
312
|
onPointerDown: (e) => e.stopPropagation(),
|
|
@@ -469,6 +471,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
469
471
|
},
|
|
470
472
|
children: /* @__PURE__ */ _(V, {
|
|
471
473
|
variant: "ghost",
|
|
474
|
+
"data-ick-role": "read-more",
|
|
472
475
|
icon: n ? c.readLess : c.readMore,
|
|
473
476
|
onClick: (e) => {
|
|
474
477
|
e.stopPropagation(), r((e) => !e);
|
|
@@ -483,7 +486,7 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
483
486
|
})
|
|
484
487
|
}, "read-more"), [{
|
|
485
488
|
id: "copy",
|
|
486
|
-
icon: /* @__PURE__ */ _(
|
|
489
|
+
icon: /* @__PURE__ */ _(te, {
|
|
487
490
|
size: 14,
|
|
488
491
|
"aria-hidden": !0
|
|
489
492
|
}),
|
|
@@ -516,6 +519,8 @@ function Re({ showActions: e, showReadMore: t, isExpanded: n, setIsExpanded: r,
|
|
|
516
519
|
},
|
|
517
520
|
children: /* @__PURE__ */ _(V, {
|
|
518
521
|
variant: "ghost",
|
|
522
|
+
"data-ick-role": "message-action",
|
|
523
|
+
"data-ick-action": e,
|
|
519
524
|
icon: t,
|
|
520
525
|
onClick: n,
|
|
521
526
|
"aria-label": r,
|
|
@@ -663,6 +668,7 @@ function Be({ isAddOpen: e, setIsAddOpen: t, onAdd: n, items: r, showInlineGlyph
|
|
|
663
668
|
},
|
|
664
669
|
children: /* @__PURE__ */ _(V, {
|
|
665
670
|
variant: "ghost",
|
|
671
|
+
"data-ick-role": "add-close",
|
|
666
672
|
icon: /* @__PURE__ */ _(we, {
|
|
667
673
|
size: 14,
|
|
668
674
|
"aria-hidden": !0
|
|
@@ -709,13 +715,13 @@ function Ke(e, t = "polite") {
|
|
|
709
715
|
}
|
|
710
716
|
//#endregion
|
|
711
717
|
//#region src/reducedMotion/reducedMotion.ts
|
|
712
|
-
var
|
|
713
|
-
function
|
|
714
|
-
return
|
|
718
|
+
var qe = "(prefers-reduced-motion: reduce)", Je;
|
|
719
|
+
function G() {
|
|
720
|
+
return Je === void 0 && (Je = typeof window < "u" && window.matchMedia ? window.matchMedia(qe) : null), Je?.matches ?? !1;
|
|
715
721
|
}
|
|
716
722
|
//#endregion
|
|
717
723
|
//#region src/voice/useVoiceInput.ts
|
|
718
|
-
var
|
|
724
|
+
var K = .6, q = .02, Ye = () => () => {}, Xe = () => typeof window < "u" && typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && window.MediaRecorder !== void 0, Ze = () => {
|
|
719
725
|
let e = [
|
|
720
726
|
"audio/webm;codecs=opus",
|
|
721
727
|
"audio/webm",
|
|
@@ -750,7 +756,7 @@ function Qe({ onTranscribe: e, onTranscript: t, onDone: n, meterRef: r, labels:
|
|
|
750
756
|
S.current = !0, x.current?.abort(), T();
|
|
751
757
|
}, [T]);
|
|
752
758
|
let E = o((e) => {
|
|
753
|
-
if (
|
|
759
|
+
if (G()) return;
|
|
754
760
|
let t = new Uint8Array(e.fftSize), n = 0, i = () => {
|
|
755
761
|
e.getByteTimeDomainData(t);
|
|
756
762
|
let a = 0;
|
|
@@ -758,8 +764,8 @@ function Qe({ onTranscribe: e, onTranscript: t, onDone: n, meterRef: r, labels:
|
|
|
758
764
|
let t = (e - 128) / 128;
|
|
759
765
|
a += t * t;
|
|
760
766
|
}
|
|
761
|
-
let o = Math.sqrt(a / t.length), s = o <
|
|
762
|
-
n = n *
|
|
767
|
+
let o = Math.sqrt(a / t.length), s = o < q ? 0 : Math.min(1, o * 3);
|
|
768
|
+
n = n * K + s * .4, r?.current?.style.setProperty("--ick-voice-level", n.toFixed(3)), y.current = requestAnimationFrame(i);
|
|
763
769
|
};
|
|
764
770
|
y.current = requestAnimationFrame(i);
|
|
765
771
|
}, [r]), D = o(async (e) => {
|
|
@@ -929,12 +935,20 @@ var nt = .9, rt = {
|
|
|
929
935
|
angle3: -50,
|
|
930
936
|
hoverPull: 12
|
|
931
937
|
}
|
|
932
|
-
}
|
|
938
|
+
};
|
|
939
|
+
function it(e) {
|
|
940
|
+
let { stiffness: t, damping: n, mass: r = 1 } = e;
|
|
941
|
+
return t === void 0 ? e : {
|
|
942
|
+
...e,
|
|
943
|
+
damping: Math.max(n ?? 0, 2 * Math.sqrt(t * r))
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
var at = {
|
|
933
947
|
type: "spring",
|
|
934
948
|
stiffness: 600,
|
|
935
949
|
damping: 21.5,
|
|
936
950
|
mass: .2
|
|
937
|
-
},
|
|
951
|
+
}, ot = (e) => {
|
|
938
952
|
if (typeof document.execCommand == "function") try {
|
|
939
953
|
if (document.execCommand("insertText", !1, e)) return !0;
|
|
940
954
|
} catch {}
|
|
@@ -944,24 +958,24 @@ var nt = .9, rt = {
|
|
|
944
958
|
n.deleteContents();
|
|
945
959
|
let r = document.createTextNode(e);
|
|
946
960
|
return n.insertNode(r), n.setStartAfter(r), n.collapse(!0), t.removeAllRanges(), t.addRange(n), !1;
|
|
947
|
-
},
|
|
948
|
-
let ne = l(),
|
|
961
|
+
}, st = r(function({ state: e, value: t, onChange: n, onSubmit: r, onStop: i, onAdd: a, attachments: s, onAttach: d, onRemoveAttachment: f, accept: h = "image/*", multiple: T = !1, onTranscribe: E, onCopy: D, onEdit: O, onCancelEdit: k, isEditing: A = !1, busy: j = !1, placeholder: M, menu: N, labels: ee, onLanded: te, animationConfig: P, style: F }, I) {
|
|
962
|
+
let ne = l(), L = H("input", ee), re = H("voice"), ie = M ?? L.placeholder, R = N !== !1, ae = p(null), oe = p(null), se = p(null), ce = p(null), [le, ue] = m(0), de = p(!1), z = p(null), [fe, me] = m(!1), [he, ge] = m(!1), [_e, ve] = m(!1), [ye, be] = m(!0), [xe, Se] = m(!1), [Ce, B] = m(!1), [Te, Ee] = m(!1), De = p(0), Oe = p(!1), ke = p(0), Ae = p(!1), je = p(null);
|
|
949
963
|
c(() => () => {
|
|
950
|
-
|
|
964
|
+
je.current && clearTimeout(je.current);
|
|
951
965
|
}, []);
|
|
952
|
-
let
|
|
953
|
-
|
|
954
|
-
let
|
|
955
|
-
|
|
956
|
-
let
|
|
966
|
+
let Me = w(), U = p(e), Ne = p(P);
|
|
967
|
+
Ne.current = P;
|
|
968
|
+
let Pe = p(null), [Ie, ze] = m([]), Ve = s ?? Ie, He = p(Ve);
|
|
969
|
+
He.current = Ve;
|
|
970
|
+
let Ue = p([]);
|
|
957
971
|
c(() => () => {
|
|
958
|
-
|
|
972
|
+
Ue.current.forEach((e) => URL.revokeObjectURL(e)), Ue.current = [];
|
|
959
973
|
}, []);
|
|
960
|
-
let
|
|
974
|
+
let We = o((e) => {
|
|
961
975
|
if (!e) return;
|
|
962
|
-
let t =
|
|
963
|
-
t !== -1 && (URL.revokeObjectURL(e),
|
|
964
|
-
}, []),
|
|
976
|
+
let t = Ue.current.indexOf(e);
|
|
977
|
+
t !== -1 && (URL.revokeObjectURL(e), Ue.current.splice(t, 1));
|
|
978
|
+
}, []), Ge = (e) => {
|
|
965
979
|
let t = Array.from(e.target.files ?? []);
|
|
966
980
|
if (e.target.value = "", t.length === 0) return;
|
|
967
981
|
if (d) {
|
|
@@ -970,7 +984,7 @@ var nt = .9, rt = {
|
|
|
970
984
|
}
|
|
971
985
|
let n = t.map((e) => {
|
|
972
986
|
let t = URL.createObjectURL(e);
|
|
973
|
-
return
|
|
987
|
+
return Ue.current.push(t), {
|
|
974
988
|
id: `${e.name}-${e.size}-${e.lastModified}`,
|
|
975
989
|
name: e.name,
|
|
976
990
|
type: e.type,
|
|
@@ -978,57 +992,57 @@ var nt = .9, rt = {
|
|
|
978
992
|
url: t
|
|
979
993
|
};
|
|
980
994
|
});
|
|
981
|
-
|
|
995
|
+
ze((e) => {
|
|
982
996
|
if (T) return [...e, ...n];
|
|
983
997
|
let t = n.slice(-1);
|
|
984
|
-
return e.forEach((e) =>
|
|
998
|
+
return e.forEach((e) => We(e.url)), n.slice(0, -1).forEach((e) => We(e.url)), t;
|
|
985
999
|
});
|
|
986
|
-
},
|
|
1000
|
+
}, Ke = o((e) => {
|
|
987
1001
|
if (f) {
|
|
988
1002
|
f(e);
|
|
989
1003
|
return;
|
|
990
1004
|
}
|
|
991
|
-
|
|
992
|
-
}, [f,
|
|
993
|
-
u(
|
|
994
|
-
focus: (e) =>
|
|
1005
|
+
ze((t) => (We(t.find((t) => t.id === e)?.url), t.filter((t) => t.id !== e)));
|
|
1006
|
+
}, [f, We]);
|
|
1007
|
+
u(I, () => ({
|
|
1008
|
+
focus: (e) => ae.current?.focus(e),
|
|
995
1009
|
setValue: (e) => {
|
|
996
|
-
let t =
|
|
1010
|
+
let t = ae.current;
|
|
997
1011
|
t && (t.textContent = e, $e(t)), n(e);
|
|
998
1012
|
},
|
|
999
1013
|
getValue: () => t
|
|
1000
1014
|
}), [n, t]);
|
|
1001
|
-
let
|
|
1015
|
+
let qe = p(null), Je = p(null), G = p(null);
|
|
1002
1016
|
c(() => {
|
|
1003
1017
|
if (!E) return;
|
|
1004
|
-
let e =
|
|
1018
|
+
let e = ae.current;
|
|
1005
1019
|
if (!e) return;
|
|
1006
1020
|
let t = () => {
|
|
1007
1021
|
let t = window.getSelection();
|
|
1008
|
-
!t || t.rangeCount === 0 || e.contains(t.getRangeAt(0).endContainer) && (
|
|
1022
|
+
!t || t.rangeCount === 0 || e.contains(t.getRangeAt(0).endContainer) && (G.current = et(e));
|
|
1009
1023
|
};
|
|
1010
1024
|
return document.addEventListener("selectionchange", t), () => document.removeEventListener("selectionchange", t);
|
|
1011
1025
|
}, [E]);
|
|
1012
|
-
let
|
|
1026
|
+
let K = Qe({
|
|
1013
1027
|
onTranscribe: E,
|
|
1014
1028
|
onTranscript: o((e) => {
|
|
1015
|
-
let t =
|
|
1029
|
+
let t = Je.current, r = ae.current;
|
|
1016
1030
|
if (!t || !r) return;
|
|
1017
1031
|
let i = t.base.slice(0, t.at) + e + t.base.slice(t.at);
|
|
1018
1032
|
r.textContent = i, tt(r, t.at + e.length), n(i);
|
|
1019
1033
|
}, [n]),
|
|
1020
1034
|
onDone: () => {
|
|
1021
|
-
|
|
1035
|
+
Je.current = null, ae.current?.focus();
|
|
1022
1036
|
},
|
|
1023
|
-
meterRef:
|
|
1037
|
+
meterRef: qe,
|
|
1024
1038
|
labels: re
|
|
1025
|
-
}),
|
|
1039
|
+
}), q = e === "responding" || e === "resting", Ye = q, Xe = t.trim().length > 0 || Ve.length > 0, Ze = e === "typing" || e === "idle", rt = Ze && Xe && !j, st = !!i && (e === "responding" || j && Ze), ct = j && Ze && Xe && !i, lt = e === "resting" && fe, ut = lt, dt = e === "resting" && Ce, ft = K.state === "listening" || K.state === "requesting" || K.state === "transcribing", pt = !!E && K.supported && !A, mt = rt || st || ct, J = P, ht = J ? {
|
|
1026
1040
|
type: "spring",
|
|
1027
1041
|
stiffness: J.bubble.stiffness,
|
|
1028
1042
|
damping: J.bubble.damping,
|
|
1029
1043
|
mass: J.bubble.mass
|
|
1030
|
-
} :
|
|
1031
|
-
let e =
|
|
1044
|
+
} : at, gt = o(() => {
|
|
1045
|
+
let e = oe.current, t = se.current;
|
|
1032
1046
|
if (!e || !t) return;
|
|
1033
1047
|
if (!(e.scrollHeight > e.clientHeight)) {
|
|
1034
1048
|
t.removeAttribute("data-fade");
|
|
@@ -1038,32 +1052,43 @@ var nt = .9, rt = {
|
|
|
1038
1052
|
!n && !r ? t.dataset.fade = "both" : n ? r ? t.removeAttribute("data-fade") : t.dataset.fade = "bottom" : t.dataset.fade = "top";
|
|
1039
1053
|
}, []);
|
|
1040
1054
|
c(() => {
|
|
1041
|
-
let e =
|
|
1042
|
-
if (e) return e.addEventListener("scroll",
|
|
1043
|
-
}, [
|
|
1055
|
+
let e = oe.current;
|
|
1056
|
+
if (e) return e.addEventListener("scroll", gt, { passive: !0 }), () => e.removeEventListener("scroll", gt);
|
|
1057
|
+
}, [gt]), c(() => {
|
|
1044
1058
|
let e = requestAnimationFrame(() => {
|
|
1045
|
-
let e =
|
|
1046
|
-
e && !
|
|
1059
|
+
let e = oe.current;
|
|
1060
|
+
e && !Ye && (e.scrollTop = e.scrollHeight), gt();
|
|
1047
1061
|
});
|
|
1048
1062
|
return () => cancelAnimationFrame(e);
|
|
1049
1063
|
}, [
|
|
1050
1064
|
t,
|
|
1051
|
-
|
|
1052
|
-
|
|
1065
|
+
Ye,
|
|
1066
|
+
gt
|
|
1053
1067
|
]), c(() => {
|
|
1054
|
-
(e === "idle" || e === "typing") &&
|
|
1068
|
+
(e === "idle" || e === "typing") && ae.current?.focus({ preventScroll: !0 });
|
|
1055
1069
|
}, [e]), c(() => {
|
|
1056
|
-
let e =
|
|
1057
|
-
e && (
|
|
1070
|
+
let e = ae.current;
|
|
1071
|
+
e && (De.current = e.scrollHeight || 17);
|
|
1058
1072
|
}, []), c(() => {
|
|
1059
|
-
let e =
|
|
1060
|
-
!e ||
|
|
1061
|
-
|
|
1062
|
-
|
|
1073
|
+
let e = ae.current;
|
|
1074
|
+
if (!e || q) return;
|
|
1075
|
+
let t = e.clientWidth, n = new ResizeObserver(() => {
|
|
1076
|
+
e.clientWidth !== t && (t = e.clientWidth, !e.textContent && e.scrollHeight && (De.current = e.scrollHeight));
|
|
1077
|
+
});
|
|
1078
|
+
return n.observe(e), () => n.disconnect();
|
|
1079
|
+
}, [q]), c(() => {
|
|
1080
|
+
let e = ae.current, n = z.current;
|
|
1081
|
+
!e || !De.current || requestAnimationFrame(() => {
|
|
1082
|
+
let r = n ? n.offsetWidth : 0, i = e.clientWidth - 16, a = (oe.current?.scrollHeight ?? 0) > De.current + 2, o = Ne.current, s = t.length === 0;
|
|
1083
|
+
if (!Oe.current) ke.current = i, !s && (a || r >= ke.current * (o?.wrap?.nearThreshold ?? .92)) && (Oe.current = !0, Ae.current = !0, be(!1));
|
|
1084
|
+
else {
|
|
1085
|
+
let e = a || r >= i - 2;
|
|
1086
|
+
(s || !e && r < ke.current * (o?.wrap?.exitThreshold ?? .75)) && (Oe.current = !1, Ae.current = !1, ve(!1), be(!0), je.current &&= (clearTimeout(je.current), null));
|
|
1087
|
+
}
|
|
1063
1088
|
});
|
|
1064
1089
|
}, [t]), c(() => {
|
|
1065
|
-
if (!
|
|
1066
|
-
let e =
|
|
1090
|
+
if (!q) return;
|
|
1091
|
+
let e = oe.current;
|
|
1067
1092
|
if (!e || e.scrollTop === 0) return;
|
|
1068
1093
|
let t = e.scrollTop;
|
|
1069
1094
|
S(t, 0, {
|
|
@@ -1075,25 +1100,44 @@ var nt = .9, rt = {
|
|
|
1075
1100
|
e.scrollTop = t;
|
|
1076
1101
|
}
|
|
1077
1102
|
});
|
|
1078
|
-
}, [
|
|
1079
|
-
|
|
1080
|
-
}, [
|
|
1081
|
-
if (!
|
|
1082
|
-
let e =
|
|
1083
|
-
e && (
|
|
1103
|
+
}, [q]), c(() => {
|
|
1104
|
+
q ? Ee(!1) : (Se(!1), B(!1));
|
|
1105
|
+
}, [q]), c(() => {
|
|
1106
|
+
if (!q) return;
|
|
1107
|
+
let e = se.current;
|
|
1108
|
+
e && (Ce && !xe ? e.dataset.fade = "bottom" : e.removeAttribute("data-fade"));
|
|
1084
1109
|
}, [
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1110
|
+
q,
|
|
1111
|
+
Ce,
|
|
1112
|
+
xe
|
|
1088
1113
|
]), c(() => {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
}),
|
|
1095
|
-
|
|
1096
|
-
|
|
1114
|
+
if (e !== "resting") return;
|
|
1115
|
+
let t = oe.current, n = ae.current;
|
|
1116
|
+
if (!t || !n) return;
|
|
1117
|
+
let r = () => {
|
|
1118
|
+
ue(t.scrollHeight), B(t.scrollHeight > 241), gt();
|
|
1119
|
+
}, i = requestAnimationFrame(r), a = new ResizeObserver(r);
|
|
1120
|
+
return a.observe(n), () => {
|
|
1121
|
+
cancelAnimationFrame(i), a.disconnect();
|
|
1122
|
+
};
|
|
1123
|
+
}, [e, gt]), c(() => {
|
|
1124
|
+
let e = ce.current;
|
|
1125
|
+
if (!te || !e) return;
|
|
1126
|
+
let t = performance.now(), n = e.getBoundingClientRect().top, r = 0, i = 0, a = 0, o = () => {
|
|
1127
|
+
let s = e.getBoundingClientRect().top, c = Math.abs(s - n);
|
|
1128
|
+
if (n = s, r += c, i = c < .5 ? i + 1 : 0, r > 3 && i >= 2 || r <= 3 && performance.now() - t > 150) {
|
|
1129
|
+
te();
|
|
1130
|
+
return;
|
|
1131
|
+
}
|
|
1132
|
+
a = requestAnimationFrame(o);
|
|
1133
|
+
};
|
|
1134
|
+
return a = requestAnimationFrame(o), () => cancelAnimationFrame(a);
|
|
1135
|
+
}, [te]), c(() => {
|
|
1136
|
+
let t = U.current;
|
|
1137
|
+
if (U.current = e, t !== "responding" || e !== "resting") return;
|
|
1138
|
+
ge(!0);
|
|
1139
|
+
let n = Ne.current;
|
|
1140
|
+
Me.start({
|
|
1097
1141
|
scaleX: [
|
|
1098
1142
|
1,
|
|
1099
1143
|
n?.ripple?.scaleX ?? 1.018,
|
|
@@ -1114,35 +1158,35 @@ var nt = .9, rt = {
|
|
|
1114
1158
|
]
|
|
1115
1159
|
}
|
|
1116
1160
|
});
|
|
1117
|
-
let r = window.setTimeout(() =>
|
|
1161
|
+
let r = window.setTimeout(() => ge(!1), n?.ripple?.pulseDuration ?? 260);
|
|
1118
1162
|
return () => clearTimeout(r);
|
|
1119
1163
|
}, [
|
|
1120
1164
|
e,
|
|
1121
|
-
|
|
1122
|
-
|
|
1165
|
+
Me,
|
|
1166
|
+
gt
|
|
1123
1167
|
]);
|
|
1124
|
-
let
|
|
1125
|
-
let e =
|
|
1126
|
-
e && (
|
|
1127
|
-
}, [n]),
|
|
1128
|
-
e.preventDefault(),
|
|
1129
|
-
}, [
|
|
1168
|
+
let Y = o(() => {
|
|
1169
|
+
let e = ae.current;
|
|
1170
|
+
e && (de.current = !0, n(e.textContent ?? ""));
|
|
1171
|
+
}, [n]), _t = o((e) => {
|
|
1172
|
+
e.preventDefault(), ot(e.clipboardData.getData("text/plain")) || Y();
|
|
1173
|
+
}, [Y]), vt = o((e) => {
|
|
1130
1174
|
if (e.key === "Enter") {
|
|
1131
|
-
if (e.preventDefault(), e.shiftKey)
|
|
1175
|
+
if (e.preventDefault(), e.shiftKey) ot("\n") || Y();
|
|
1132
1176
|
else if (j) return;
|
|
1133
|
-
else (t.trim().length > 0 ||
|
|
1177
|
+
else (t.trim().length > 0 || He.current.length > 0) && r(t, He.current);
|
|
1134
1178
|
}
|
|
1135
1179
|
}, [
|
|
1136
1180
|
t,
|
|
1137
1181
|
r,
|
|
1138
|
-
|
|
1182
|
+
Y,
|
|
1139
1183
|
j
|
|
1140
1184
|
]);
|
|
1141
1185
|
return c(() => {
|
|
1142
|
-
let e =
|
|
1186
|
+
let e = ae.current;
|
|
1143
1187
|
if (e) {
|
|
1144
|
-
if (
|
|
1145
|
-
|
|
1188
|
+
if (de.current) {
|
|
1189
|
+
de.current = !1;
|
|
1146
1190
|
return;
|
|
1147
1191
|
}
|
|
1148
1192
|
e.textContent !== t && (e.textContent = t, document.activeElement === e && $e(e));
|
|
@@ -1153,21 +1197,22 @@ var nt = .9, rt = {
|
|
|
1153
1197
|
id: ne,
|
|
1154
1198
|
children: /* @__PURE__ */ v("div", {
|
|
1155
1199
|
className: W.wrap,
|
|
1156
|
-
onMouseEnter: () =>
|
|
1157
|
-
onMouseLeave: () =>
|
|
1158
|
-
style:
|
|
1200
|
+
onMouseEnter: () => me(!0),
|
|
1201
|
+
onMouseLeave: () => me(!1),
|
|
1202
|
+
style: F,
|
|
1159
1203
|
children: [
|
|
1160
1204
|
/* @__PURE__ */ _(C.div, {
|
|
1161
|
-
className: `${W.root} ${
|
|
1205
|
+
className: `${W.root} ${q ? W.isGlassRoot : ""}`,
|
|
1206
|
+
ref: ce,
|
|
1162
1207
|
layout: !0,
|
|
1163
|
-
animate: { filter:
|
|
1208
|
+
animate: { filter: Te ? `blur(${J?.addCards?.inputBlur ?? 2}px)` : "blur(0px)" },
|
|
1164
1209
|
style: {
|
|
1165
|
-
pointerEvents:
|
|
1166
|
-
width:
|
|
1167
|
-
maxWidth:
|
|
1210
|
+
pointerEvents: Te ? "none" : "auto",
|
|
1211
|
+
width: F?.width === "100%" ? "100%" : void 0,
|
|
1212
|
+
maxWidth: F?.maxWidth
|
|
1168
1213
|
},
|
|
1169
1214
|
transition: {
|
|
1170
|
-
...
|
|
1215
|
+
...ht,
|
|
1171
1216
|
filter: {
|
|
1172
1217
|
type: "tween",
|
|
1173
1218
|
duration: .2,
|
|
@@ -1175,25 +1220,25 @@ var nt = .9, rt = {
|
|
|
1175
1220
|
}
|
|
1176
1221
|
},
|
|
1177
1222
|
children: /* @__PURE__ */ v(C.div, {
|
|
1178
|
-
className: `${W.surface} ${
|
|
1223
|
+
className: `${W.surface} ${q ? W.glass : ""} ${lt ? W.hovered : ""} ${he ? W.pulsed : ""}`,
|
|
1179
1224
|
style: {
|
|
1180
1225
|
alignItems: "stretch",
|
|
1181
1226
|
flexDirection: "column",
|
|
1182
1227
|
justifyContent: "center"
|
|
1183
1228
|
},
|
|
1184
|
-
transition:
|
|
1185
|
-
animate:
|
|
1186
|
-
onClick: () =>
|
|
1229
|
+
transition: ht,
|
|
1230
|
+
animate: Me,
|
|
1231
|
+
onClick: () => ae.current?.focus(),
|
|
1187
1232
|
children: [
|
|
1188
1233
|
/* @__PURE__ */ _("input", {
|
|
1189
1234
|
type: "file",
|
|
1190
|
-
ref:
|
|
1235
|
+
ref: Pe,
|
|
1191
1236
|
accept: h,
|
|
1192
1237
|
multiple: T,
|
|
1193
1238
|
style: { display: "none" },
|
|
1194
|
-
onChange:
|
|
1239
|
+
onChange: Ge
|
|
1195
1240
|
}),
|
|
1196
|
-
/* @__PURE__ */ _(y, { children:
|
|
1241
|
+
/* @__PURE__ */ _(y, { children: Ve.length > 0 && /* @__PURE__ */ _(C.div, {
|
|
1197
1242
|
initial: {
|
|
1198
1243
|
opacity: 0,
|
|
1199
1244
|
height: 0
|
|
@@ -1218,10 +1263,10 @@ var nt = .9, rt = {
|
|
|
1218
1263
|
},
|
|
1219
1264
|
children: /* @__PURE__ */ _("div", {
|
|
1220
1265
|
className: W.attachedTray,
|
|
1221
|
-
"data-glass":
|
|
1266
|
+
"data-glass": q || void 0,
|
|
1222
1267
|
children: /* @__PURE__ */ _(Fe, {
|
|
1223
|
-
attachments:
|
|
1224
|
-
onRemove:
|
|
1268
|
+
attachments: Ve,
|
|
1269
|
+
onRemove: q ? void 0 : Ke
|
|
1225
1270
|
})
|
|
1226
1271
|
})
|
|
1227
1272
|
}) }),
|
|
@@ -1230,15 +1275,15 @@ var nt = .9, rt = {
|
|
|
1230
1275
|
display: "flex",
|
|
1231
1276
|
flexDirection: "row",
|
|
1232
1277
|
alignItems: "center",
|
|
1233
|
-
flexWrap:
|
|
1234
|
-
justifyContent:
|
|
1278
|
+
flexWrap: _e ? "wrap" : "nowrap",
|
|
1279
|
+
justifyContent: _e ? "flex-end" : "flex-start",
|
|
1235
1280
|
width: "100%",
|
|
1236
1281
|
minWidth: 0,
|
|
1237
1282
|
flex: 1
|
|
1238
1283
|
},
|
|
1239
1284
|
children: [
|
|
1240
1285
|
/* @__PURE__ */ _("span", {
|
|
1241
|
-
ref:
|
|
1286
|
+
ref: z,
|
|
1242
1287
|
"aria-hidden": "true",
|
|
1243
1288
|
style: {
|
|
1244
1289
|
position: "absolute",
|
|
@@ -1251,16 +1296,16 @@ var nt = .9, rt = {
|
|
|
1251
1296
|
children: t
|
|
1252
1297
|
}),
|
|
1253
1298
|
/* @__PURE__ */ _("div", {
|
|
1254
|
-
ref:
|
|
1299
|
+
ref: se,
|
|
1255
1300
|
className: W.editorClip,
|
|
1256
|
-
style: { flexBasis:
|
|
1301
|
+
style: { flexBasis: _e ? "100%" : void 0 },
|
|
1257
1302
|
children: /* @__PURE__ */ _(C.div, {
|
|
1258
|
-
ref:
|
|
1259
|
-
className: `${W.editorWrap} ${
|
|
1303
|
+
ref: oe,
|
|
1304
|
+
className: `${W.editorWrap} ${q ? W.editorWrapGlass : ""}`,
|
|
1260
1305
|
layout: "position",
|
|
1261
|
-
animate:
|
|
1306
|
+
animate: q && Ce ? { maxHeight: xe ? le : 240 } : void 0,
|
|
1262
1307
|
transition: {
|
|
1263
|
-
...
|
|
1308
|
+
...ht,
|
|
1264
1309
|
maxHeight: {
|
|
1265
1310
|
type: "spring",
|
|
1266
1311
|
stiffness: 300,
|
|
@@ -1269,24 +1314,24 @@ var nt = .9, rt = {
|
|
|
1269
1314
|
}
|
|
1270
1315
|
},
|
|
1271
1316
|
children: /* @__PURE__ */ _("div", {
|
|
1272
|
-
ref:
|
|
1317
|
+
ref: ae,
|
|
1273
1318
|
className: W.editor,
|
|
1274
|
-
contentEditable:
|
|
1319
|
+
contentEditable: Ye ? "false" : "plaintext-only",
|
|
1275
1320
|
suppressContentEditableWarning: !0,
|
|
1276
|
-
onInput:
|
|
1277
|
-
onKeyDown:
|
|
1278
|
-
onPaste:
|
|
1321
|
+
onInput: Y,
|
|
1322
|
+
onKeyDown: vt,
|
|
1323
|
+
onPaste: _t,
|
|
1279
1324
|
spellCheck: !1,
|
|
1280
1325
|
role: "textbox",
|
|
1281
1326
|
"aria-multiline": "true",
|
|
1282
|
-
"aria-label":
|
|
1283
|
-
"data-placeholder":
|
|
1327
|
+
"aria-label": ie,
|
|
1328
|
+
"data-placeholder": Ye ? "" : ie
|
|
1284
1329
|
})
|
|
1285
1330
|
})
|
|
1286
1331
|
}),
|
|
1287
1332
|
/* @__PURE__ */ v("div", {
|
|
1288
1333
|
className: W.buttonGroup,
|
|
1289
|
-
children: [!
|
|
1334
|
+
children: [!q && ye && pt && /* @__PURE__ */ _(C.div, {
|
|
1290
1335
|
initial: {
|
|
1291
1336
|
opacity: 0,
|
|
1292
1337
|
scale: nt,
|
|
@@ -1304,7 +1349,7 @@ var nt = .9, rt = {
|
|
|
1304
1349
|
scale: nt,
|
|
1305
1350
|
width: 0,
|
|
1306
1351
|
marginLeft: 0,
|
|
1307
|
-
transition:
|
|
1352
|
+
transition: Ae.current ? {
|
|
1308
1353
|
type: "tween",
|
|
1309
1354
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1310
1355
|
ease: "easeOut",
|
|
@@ -1331,32 +1376,33 @@ var nt = .9, rt = {
|
|
|
1331
1376
|
},
|
|
1332
1377
|
children: /* @__PURE__ */ _(V, {
|
|
1333
1378
|
variant: "ghost",
|
|
1334
|
-
"data-
|
|
1379
|
+
"data-ick-role": "dictate",
|
|
1380
|
+
"data-voice": K.state,
|
|
1335
1381
|
icon: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
1336
|
-
ref:
|
|
1382
|
+
ref: qe,
|
|
1337
1383
|
className: W.voiceMeter,
|
|
1338
|
-
"data-live":
|
|
1384
|
+
"data-live": K.state === "listening" || void 0,
|
|
1339
1385
|
"aria-hidden": !0
|
|
1340
1386
|
}), /* @__PURE__ */ _(Le, {
|
|
1341
|
-
mode:
|
|
1387
|
+
mode: K.state === "listening" || K.state === "transcribing" ? "stop" : "mic",
|
|
1342
1388
|
size: 14
|
|
1343
1389
|
})] }),
|
|
1344
1390
|
onClick: (e) => {
|
|
1345
|
-
if (e.stopPropagation(),
|
|
1346
|
-
if (!
|
|
1347
|
-
let e = Math.min(
|
|
1348
|
-
|
|
1391
|
+
if (e.stopPropagation(), K.state !== "denied") {
|
|
1392
|
+
if (!ft) {
|
|
1393
|
+
let e = Math.min(G.current ?? t.length, t.length);
|
|
1394
|
+
Je.current = {
|
|
1349
1395
|
base: t,
|
|
1350
1396
|
at: e
|
|
1351
1397
|
};
|
|
1352
1398
|
}
|
|
1353
|
-
|
|
1399
|
+
K.toggle();
|
|
1354
1400
|
}
|
|
1355
1401
|
},
|
|
1356
|
-
"aria-busy":
|
|
1357
|
-
"aria-pressed":
|
|
1358
|
-
disabled:
|
|
1359
|
-
"aria-label":
|
|
1402
|
+
"aria-busy": K.state === "requesting" || K.state === "transcribing",
|
|
1403
|
+
"aria-pressed": K.state === "listening",
|
|
1404
|
+
disabled: K.state === "denied",
|
|
1405
|
+
"aria-label": K.state === "listening" ? L.stopListening : K.state === "requesting" ? L.waitingForMicrophone : K.state === "transcribing" ? L.cancelTranscription : K.state === "denied" ? L.microphoneBlocked : L.dictate,
|
|
1360
1406
|
style: {
|
|
1361
1407
|
width: "100%",
|
|
1362
1408
|
height: "100%",
|
|
@@ -1366,11 +1412,11 @@ var nt = .9, rt = {
|
|
|
1366
1412
|
}, "mic"), /* @__PURE__ */ v(y, {
|
|
1367
1413
|
initial: !1,
|
|
1368
1414
|
onExitComplete: () => {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
},
|
|
1415
|
+
Ae.current && (Ae.current = !1, ve(!0), je.current && clearTimeout(je.current), je.current = window.setTimeout(() => {
|
|
1416
|
+
be(!0), je.current = null;
|
|
1417
|
+
}, Ne.current?.wrap?.slideInDelay ?? 120));
|
|
1372
1418
|
},
|
|
1373
|
-
children: [!
|
|
1419
|
+
children: [!q && ye && (R || A) && /* @__PURE__ */ _(C.div, {
|
|
1374
1420
|
initial: {
|
|
1375
1421
|
opacity: 0,
|
|
1376
1422
|
scale: nt,
|
|
@@ -1385,7 +1431,7 @@ var nt = .9, rt = {
|
|
|
1385
1431
|
opacity: 0,
|
|
1386
1432
|
scale: nt,
|
|
1387
1433
|
width: 0,
|
|
1388
|
-
transition:
|
|
1434
|
+
transition: Ae.current ? {
|
|
1389
1435
|
type: "tween",
|
|
1390
1436
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1391
1437
|
ease: "easeOut",
|
|
@@ -1439,6 +1485,7 @@ var nt = .9, rt = {
|
|
|
1439
1485
|
},
|
|
1440
1486
|
children: /* @__PURE__ */ _(V, {
|
|
1441
1487
|
variant: "ghost",
|
|
1488
|
+
"data-ick-role": "cancel-edit",
|
|
1442
1489
|
icon: /* @__PURE__ */ _(we, {
|
|
1443
1490
|
size: 14,
|
|
1444
1491
|
"aria-hidden": !0
|
|
@@ -1446,14 +1493,14 @@ var nt = .9, rt = {
|
|
|
1446
1493
|
onClick: (e) => {
|
|
1447
1494
|
e.stopPropagation(), k?.();
|
|
1448
1495
|
},
|
|
1449
|
-
"aria-label":
|
|
1450
|
-
title:
|
|
1496
|
+
"aria-label": L.cancelEdit,
|
|
1497
|
+
title: L.cancelEdit,
|
|
1451
1498
|
style: {
|
|
1452
1499
|
width: "100%",
|
|
1453
1500
|
height: "100%"
|
|
1454
1501
|
}
|
|
1455
1502
|
})
|
|
1456
|
-
}, "cancel-btn") :
|
|
1503
|
+
}, "cancel-btn") : R && !Te ? /* @__PURE__ */ _(C.div, {
|
|
1457
1504
|
initial: {
|
|
1458
1505
|
opacity: 0,
|
|
1459
1506
|
scale: .5
|
|
@@ -1476,15 +1523,16 @@ var nt = .9, rt = {
|
|
|
1476
1523
|
},
|
|
1477
1524
|
children: /* @__PURE__ */ _(V, {
|
|
1478
1525
|
variant: "ghost",
|
|
1526
|
+
"data-ick-role": "add",
|
|
1479
1527
|
icon: /* @__PURE__ */ _(pe, {
|
|
1480
1528
|
size: 14,
|
|
1481
1529
|
"aria-hidden": !0
|
|
1482
1530
|
}),
|
|
1483
1531
|
onClick: (e) => {
|
|
1484
|
-
e.stopPropagation(),
|
|
1532
|
+
e.stopPropagation(), Ee(!0);
|
|
1485
1533
|
},
|
|
1486
|
-
"aria-label":
|
|
1487
|
-
title:
|
|
1534
|
+
"aria-label": L.add,
|
|
1535
|
+
title: L.add,
|
|
1488
1536
|
style: {
|
|
1489
1537
|
width: "100%",
|
|
1490
1538
|
height: "100%"
|
|
@@ -1492,7 +1540,7 @@ var nt = .9, rt = {
|
|
|
1492
1540
|
})
|
|
1493
1541
|
}, "plus-btn") : null
|
|
1494
1542
|
})
|
|
1495
|
-
}, "lead"),
|
|
1543
|
+
}, "lead"), mt && ye && /* @__PURE__ */ _(C.div, {
|
|
1496
1544
|
initial: {
|
|
1497
1545
|
opacity: 0,
|
|
1498
1546
|
scale: nt,
|
|
@@ -1510,7 +1558,7 @@ var nt = .9, rt = {
|
|
|
1510
1558
|
scale: nt,
|
|
1511
1559
|
width: 0,
|
|
1512
1560
|
marginLeft: 0,
|
|
1513
|
-
transition:
|
|
1561
|
+
transition: Ae.current ? {
|
|
1514
1562
|
type: "tween",
|
|
1515
1563
|
duration: J?.wrap?.exitDuration ?? .15,
|
|
1516
1564
|
ease: "easeOut"
|
|
@@ -1522,8 +1570,8 @@ var nt = .9, rt = {
|
|
|
1522
1570
|
type: "tween",
|
|
1523
1571
|
duration: .15
|
|
1524
1572
|
},
|
|
1525
|
-
width:
|
|
1526
|
-
marginLeft:
|
|
1573
|
+
width: it(ht),
|
|
1574
|
+
marginLeft: it(ht)
|
|
1527
1575
|
}
|
|
1528
1576
|
},
|
|
1529
1577
|
transition: {
|
|
@@ -1546,12 +1594,13 @@ var nt = .9, rt = {
|
|
|
1546
1594
|
},
|
|
1547
1595
|
children: /* @__PURE__ */ _(V, {
|
|
1548
1596
|
variant: "primary",
|
|
1549
|
-
|
|
1597
|
+
"data-ick-role": st ? "stop" : A ? "save" : "send",
|
|
1598
|
+
icon: /* @__PURE__ */ _(Le, { mode: st ? "stop" : A ? "check" : "send" }),
|
|
1550
1599
|
onClick: (e) => {
|
|
1551
|
-
e.stopPropagation(),
|
|
1600
|
+
e.stopPropagation(), st ? i?.() : j || r(t, Ve);
|
|
1552
1601
|
},
|
|
1553
|
-
disabled:
|
|
1554
|
-
"aria-label":
|
|
1602
|
+
disabled: ct,
|
|
1603
|
+
"aria-label": st ? L.stop : A ? L.save : L.send,
|
|
1555
1604
|
style: {
|
|
1556
1605
|
flexShrink: 0,
|
|
1557
1606
|
width: 28
|
|
@@ -1566,31 +1615,31 @@ var nt = .9, rt = {
|
|
|
1566
1615
|
})
|
|
1567
1616
|
}),
|
|
1568
1617
|
/* @__PURE__ */ _(Be, {
|
|
1569
|
-
isAddOpen:
|
|
1570
|
-
setIsAddOpen:
|
|
1571
|
-
items:
|
|
1618
|
+
isAddOpen: Te,
|
|
1619
|
+
setIsAddOpen: Ee,
|
|
1620
|
+
items: N || void 0,
|
|
1572
1621
|
onAdd: (e, t) => {
|
|
1573
|
-
let n =
|
|
1574
|
-
t === "attach" && !n?.onSelect &&
|
|
1622
|
+
let n = N ? N.find((e) => e.id === t) : void 0;
|
|
1623
|
+
t === "attach" && !n?.onSelect && Pe.current?.click(), a?.();
|
|
1575
1624
|
},
|
|
1576
|
-
showInlineGlyph:
|
|
1577
|
-
showButtons:
|
|
1625
|
+
showInlineGlyph: mt,
|
|
1626
|
+
showButtons: ye,
|
|
1578
1627
|
ac: J
|
|
1579
1628
|
}),
|
|
1580
1629
|
/* @__PURE__ */ _(Re, {
|
|
1581
|
-
showActions:
|
|
1582
|
-
showReadMore:
|
|
1583
|
-
isExpanded:
|
|
1584
|
-
setIsExpanded:
|
|
1630
|
+
showActions: ut,
|
|
1631
|
+
showReadMore: dt,
|
|
1632
|
+
isExpanded: xe,
|
|
1633
|
+
setIsExpanded: Se,
|
|
1585
1634
|
onCopy: D,
|
|
1586
1635
|
onEdit: O,
|
|
1587
1636
|
value: t,
|
|
1588
1637
|
ac: J
|
|
1589
1638
|
}),
|
|
1590
|
-
|
|
1639
|
+
pt && (K.state === "denied" || K.state === "failed") && /* @__PURE__ */ _("p", {
|
|
1591
1640
|
className: W.voiceNote,
|
|
1592
|
-
"data-tone":
|
|
1593
|
-
children:
|
|
1641
|
+
"data-tone": K.state,
|
|
1642
|
+
children: K.state === "denied" ? L.microphoneBlockedHelp : K.error ?? re.couldNotOpen
|
|
1594
1643
|
})
|
|
1595
1644
|
]
|
|
1596
1645
|
})
|
|
@@ -1599,7 +1648,7 @@ var nt = .9, rt = {
|
|
|
1599
1648
|
});
|
|
1600
1649
|
//#endregion
|
|
1601
1650
|
//#region src/turnParts/turnParts.ts
|
|
1602
|
-
function
|
|
1651
|
+
function ct(e, t) {
|
|
1603
1652
|
let n = e.findIndex((e) => e.id === t.id);
|
|
1604
1653
|
if (n === -1) return [...e, t];
|
|
1605
1654
|
let r = e.slice();
|
|
@@ -1610,15 +1659,15 @@ function st(e, t) {
|
|
|
1610
1659
|
}
|
|
1611
1660
|
//#endregion
|
|
1612
1661
|
//#region src/useChatTurns/useChatTurns.ts
|
|
1613
|
-
var
|
|
1614
|
-
id:
|
|
1662
|
+
var lt = 260, ut = 220, dt = "Generating response", ft = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : Math.random().toString(36).slice(2, 11), pt = () => ({
|
|
1663
|
+
id: ft(),
|
|
1615
1664
|
user: "",
|
|
1616
1665
|
ai: "",
|
|
1617
1666
|
parts: [],
|
|
1618
1667
|
versions: [],
|
|
1619
1668
|
versionIndex: 0,
|
|
1620
1669
|
state: "idle"
|
|
1621
|
-
}),
|
|
1670
|
+
}), mt = (e) => {
|
|
1622
1671
|
let t = e.versions;
|
|
1623
1672
|
if (!t?.length) return e;
|
|
1624
1673
|
let n = e.versionIndex ?? 0, r = t[n];
|
|
@@ -1630,7 +1679,7 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1630
1679
|
parts: e.parts
|
|
1631
1680
|
} : t)
|
|
1632
1681
|
};
|
|
1633
|
-
},
|
|
1682
|
+
}, J = (e) => typeof e == "object" && !!e && Symbol.asyncIterator in e, ht = (e, t, n) => {
|
|
1634
1683
|
let r = 1e3 / t, i = Array(e.length), a = 0;
|
|
1635
1684
|
for (let t = 0; t < e.length; t++) {
|
|
1636
1685
|
a += r;
|
|
@@ -1639,8 +1688,8 @@ var ct = 260, lt = 220, ut = "Generating response", J = () => typeof crypto < "u
|
|
|
1639
1688
|
}
|
|
1640
1689
|
return i;
|
|
1641
1690
|
};
|
|
1642
|
-
function
|
|
1643
|
-
let [a, s] = m(() => [
|
|
1691
|
+
function gt({ onSend: e, revealSpeed: t = lt, sentencePause: n = ut, announcements: r, nextTurn: i = "after-answer" }) {
|
|
1692
|
+
let [a, s] = m(() => [pt()]), [l, u] = m(!1), d = p(null), f = p(null), h = p(/* @__PURE__ */ new Map()), g = p(/* @__PURE__ */ new Map()), _ = p(null), v = p(e), y = p(r), b = p(a);
|
|
1644
1693
|
c(() => {
|
|
1645
1694
|
v.current = e, b.current = a, y.current = r;
|
|
1646
1695
|
});
|
|
@@ -1653,7 +1702,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1653
1702
|
...n,
|
|
1654
1703
|
...t
|
|
1655
1704
|
};
|
|
1656
|
-
return "versionIndex" in t || "versions" in t ? i :
|
|
1705
|
+
return "versionIndex" in t || "versions" in t ? i : mt(i);
|
|
1657
1706
|
});
|
|
1658
1707
|
return r ? (b.current = i, i) : n;
|
|
1659
1708
|
});
|
|
@@ -1665,10 +1714,10 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1665
1714
|
e.clear(), t.clear(), s((e) => {
|
|
1666
1715
|
let t = e.map((e) => {
|
|
1667
1716
|
let t = n.find(([t]) => t === e.id)?.[1], i = r.find(([t]) => t === e.id)?.[1];
|
|
1668
|
-
return t === void 0 && !i ? e :
|
|
1717
|
+
return t === void 0 && !i ? e : mt({
|
|
1669
1718
|
...e,
|
|
1670
1719
|
...t === void 0 ? null : { ai: t },
|
|
1671
|
-
...i ? { parts: i.reduce(
|
|
1720
|
+
...i ? { parts: i.reduce(ct, e.parts) } : null
|
|
1672
1721
|
});
|
|
1673
1722
|
});
|
|
1674
1723
|
return b.current = t, t;
|
|
@@ -1693,17 +1742,17 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1693
1742
|
let D = o(() => {
|
|
1694
1743
|
s((e) => {
|
|
1695
1744
|
if (e.some((e) => (e.state === "idle" || e.state === "typing") && e.ai === "")) return e;
|
|
1696
|
-
let t = [...e,
|
|
1745
|
+
let t = [...e, pt()];
|
|
1697
1746
|
return b.current = t, t;
|
|
1698
1747
|
});
|
|
1699
1748
|
}, []), O = o((e, t) => {
|
|
1700
1749
|
u(!1), d.current = null, x(e, { state: "resting" }), t || D();
|
|
1701
1750
|
}, [x, D]), k = o((e, r, i) => new Promise((a) => {
|
|
1702
|
-
if (
|
|
1751
|
+
if (G()) {
|
|
1703
1752
|
w(e, r), a();
|
|
1704
1753
|
return;
|
|
1705
1754
|
}
|
|
1706
|
-
let o =
|
|
1755
|
+
let o = ht(r, t, n), s = performance.now(), c = 0, l = () => {
|
|
1707
1756
|
if (i.aborted) {
|
|
1708
1757
|
w(e, r), a();
|
|
1709
1758
|
return;
|
|
@@ -1725,7 +1774,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1725
1774
|
let n = y.current;
|
|
1726
1775
|
if (n === !1) return;
|
|
1727
1776
|
if (e === "responding") {
|
|
1728
|
-
let e = n && "responding" in n ? n.responding :
|
|
1777
|
+
let e = n && "responding" in n ? n.responding : dt;
|
|
1729
1778
|
e && Ke(e);
|
|
1730
1779
|
return;
|
|
1731
1780
|
}
|
|
@@ -1754,7 +1803,7 @@ function ht({ onSend: e, revealSpeed: t = ct, sentencePause: n = lt, announcemen
|
|
|
1754
1803
|
turnId: e,
|
|
1755
1804
|
attachments: r
|
|
1756
1805
|
});
|
|
1757
|
-
if (
|
|
1806
|
+
if (J(n)) for await (let t of n) {
|
|
1758
1807
|
if (a.signal.aborted) break;
|
|
1759
1808
|
if (typeof t == "string") c += t, w(e, c);
|
|
1760
1809
|
else {
|
|
@@ -1854,23 +1903,23 @@ var Y = {
|
|
|
1854
1903
|
menuItem: "ick-menuItem-V7gI",
|
|
1855
1904
|
menuIcon: "ick-menuIcon-tjBi",
|
|
1856
1905
|
menuCount: "ick-menuCount-tC3s"
|
|
1857
|
-
},
|
|
1906
|
+
}, _t = {
|
|
1858
1907
|
s: "s",
|
|
1859
1908
|
m: "m",
|
|
1860
1909
|
l: "l"
|
|
1861
|
-
},
|
|
1910
|
+
}, vt = {
|
|
1862
1911
|
s: 14,
|
|
1863
1912
|
m: 16,
|
|
1864
1913
|
l: 18
|
|
1865
|
-
},
|
|
1914
|
+
}, yt = vt, bt = {
|
|
1866
1915
|
s: Y.s,
|
|
1867
1916
|
m: Y.m,
|
|
1868
1917
|
l: Y.l
|
|
1869
|
-
},
|
|
1918
|
+
}, xt = {
|
|
1870
1919
|
plain: Y.plain,
|
|
1871
1920
|
glass: Y.glass,
|
|
1872
1921
|
bordered: Y.bordered
|
|
1873
|
-
},
|
|
1922
|
+
}, St = (e) => e.count === void 0 ? e.label : `${e.label}, ${e.count}`, Ct = (e) => {
|
|
1874
1923
|
let t = e?.parentElement ?? null;
|
|
1875
1924
|
for (; t;) {
|
|
1876
1925
|
let { overflowY: e } = getComputedStyle(t);
|
|
@@ -1878,8 +1927,8 @@ var Y = {
|
|
|
1878
1927
|
t = t.parentElement;
|
|
1879
1928
|
}
|
|
1880
1929
|
return window;
|
|
1881
|
-
},
|
|
1882
|
-
let D = H("header"), k = l ?? D.back, A = d ?? D.more, j = p(null), [M,
|
|
1930
|
+
}, wt = r(function({ title: e, subtitle: t, avatar: n, headingLevel: r = 2, truncate: i = !0, onBack: a, backHref: s, backLabel: l, actions: u = [], overflowLabel: d, variant: f = "plain", size: h = "m", align: g = "start", sticky: y = !1, elevateOnScroll: b = y, collapseActionsAt: x = 520, landmark: S = !0, children: C, className: w, ...T }, E) {
|
|
1931
|
+
let D = H("header"), k = l ?? D.back, A = d ?? D.more, j = p(null), [M, N] = m(!1), [ee, te] = m(!1), P = o((e) => {
|
|
1883
1932
|
j.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
1884
1933
|
}, [E]);
|
|
1885
1934
|
c(() => {
|
|
@@ -1887,29 +1936,29 @@ var Y = {
|
|
|
1887
1936
|
if (!e || x === !1 || typeof ResizeObserver > "u") return;
|
|
1888
1937
|
let t = new ResizeObserver(([e]) => {
|
|
1889
1938
|
let t = e.contentRect.width;
|
|
1890
|
-
|
|
1939
|
+
N(t > 0 && t < x);
|
|
1891
1940
|
});
|
|
1892
1941
|
return t.observe(e), () => t.disconnect();
|
|
1893
1942
|
}, [x]), c(() => {
|
|
1894
1943
|
if (!b) return;
|
|
1895
|
-
let e =
|
|
1944
|
+
let e = Ct(j.current), t = () => {
|
|
1896
1945
|
let t = e === window ? window.scrollY : e.scrollTop;
|
|
1897
|
-
|
|
1946
|
+
te(t > 0);
|
|
1898
1947
|
};
|
|
1899
1948
|
return t(), e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
1900
1949
|
}, [b]);
|
|
1901
|
-
let F = x !== !1 && M,
|
|
1950
|
+
let F = x !== !1 && M, I = F ? u.filter((e) => e.pinned) : u, ne = F ? u.filter((e) => !e.pinned) : [], L = r ? `h${r}` : "span";
|
|
1902
1951
|
return /* @__PURE__ */ v(S ? "header" : "div", {
|
|
1903
1952
|
ref: P,
|
|
1904
1953
|
className: [
|
|
1905
1954
|
Y.header,
|
|
1906
|
-
|
|
1907
|
-
|
|
1955
|
+
bt[h],
|
|
1956
|
+
xt[f],
|
|
1908
1957
|
g === "center" ? Y.center : "",
|
|
1909
1958
|
y ? Y.sticky : "",
|
|
1910
1959
|
w ?? ""
|
|
1911
1960
|
].filter(Boolean).join(" "),
|
|
1912
|
-
"data-scrolled": b &&
|
|
1961
|
+
"data-scrolled": b && ee || void 0,
|
|
1913
1962
|
...T,
|
|
1914
1963
|
children: [/* @__PURE__ */ v("div", {
|
|
1915
1964
|
className: Y.start,
|
|
@@ -1918,15 +1967,17 @@ var Y = {
|
|
|
1918
1967
|
href: s,
|
|
1919
1968
|
className: Y.back,
|
|
1920
1969
|
"aria-label": k,
|
|
1970
|
+
"data-ick-role": "back",
|
|
1921
1971
|
children: /* @__PURE__ */ _(O, {
|
|
1922
|
-
size:
|
|
1972
|
+
size: yt[h],
|
|
1923
1973
|
"aria-hidden": !0
|
|
1924
1974
|
})
|
|
1925
1975
|
}) : a ? /* @__PURE__ */ _(V, {
|
|
1926
1976
|
variant: "secondary",
|
|
1927
|
-
|
|
1977
|
+
"data-ick-role": "back",
|
|
1978
|
+
size: _t[h],
|
|
1928
1979
|
icon: /* @__PURE__ */ _(O, {
|
|
1929
|
-
size:
|
|
1980
|
+
size: yt[h],
|
|
1930
1981
|
"aria-hidden": !0
|
|
1931
1982
|
}),
|
|
1932
1983
|
"aria-label": k,
|
|
@@ -1938,7 +1989,7 @@ var Y = {
|
|
|
1938
1989
|
}),
|
|
1939
1990
|
(e || t) && /* @__PURE__ */ v("div", {
|
|
1940
1991
|
className: Y.titles,
|
|
1941
|
-
children: [e && /* @__PURE__ */ _(
|
|
1992
|
+
children: [e && /* @__PURE__ */ _(L, {
|
|
1942
1993
|
className: [Y.title, i ? Y.truncate : ""].filter(Boolean).join(" "),
|
|
1943
1994
|
title: typeof e == "string" && i ? e : void 0,
|
|
1944
1995
|
children: e
|
|
@@ -1952,12 +2003,12 @@ var Y = {
|
|
|
1952
2003
|
className: Y.end,
|
|
1953
2004
|
children: [
|
|
1954
2005
|
C,
|
|
1955
|
-
|
|
2006
|
+
I.map((e) => /* @__PURE__ */ _(Tt, {
|
|
1956
2007
|
action: e,
|
|
1957
2008
|
size: h
|
|
1958
2009
|
}, e.id)),
|
|
1959
|
-
|
|
1960
|
-
actions:
|
|
2010
|
+
ne.length > 0 && /* @__PURE__ */ _(Et, {
|
|
2011
|
+
actions: ne,
|
|
1961
2012
|
size: h,
|
|
1962
2013
|
label: A
|
|
1963
2014
|
})
|
|
@@ -1965,8 +2016,8 @@ var Y = {
|
|
|
1965
2016
|
})]
|
|
1966
2017
|
});
|
|
1967
2018
|
});
|
|
1968
|
-
function
|
|
1969
|
-
let n =
|
|
2019
|
+
function Tt({ action: e, size: t }) {
|
|
2020
|
+
let n = St(e), r = e.count !== void 0 && e.count > 0 ? /* @__PURE__ */ _("span", {
|
|
1970
2021
|
className: Y.badge,
|
|
1971
2022
|
"aria-hidden": "true",
|
|
1972
2023
|
children: e.count > 99 ? "99+" : e.count
|
|
@@ -1976,12 +2027,16 @@ function wt({ action: e, size: t }) {
|
|
|
1976
2027
|
className: Y.back,
|
|
1977
2028
|
"aria-label": n,
|
|
1978
2029
|
title: e.label,
|
|
2030
|
+
"data-ick-role": "header-action",
|
|
2031
|
+
"data-ick-action": e.id,
|
|
1979
2032
|
children: [e.icon, r]
|
|
1980
2033
|
}) : /* @__PURE__ */ v("span", {
|
|
1981
2034
|
className: Y.actionWrap,
|
|
1982
2035
|
children: [/* @__PURE__ */ _(V, {
|
|
1983
|
-
variant: "secondary",
|
|
1984
|
-
|
|
2036
|
+
variant: e.variant ?? "secondary",
|
|
2037
|
+
"data-ick-role": "header-action",
|
|
2038
|
+
"data-ick-action": e.id,
|
|
2039
|
+
size: _t[t],
|
|
1985
2040
|
icon: e.icon,
|
|
1986
2041
|
"aria-label": n,
|
|
1987
2042
|
title: e.label,
|
|
@@ -1991,39 +2046,55 @@ function wt({ action: e, size: t }) {
|
|
|
1991
2046
|
}), r]
|
|
1992
2047
|
});
|
|
1993
2048
|
}
|
|
1994
|
-
function
|
|
1995
|
-
let [r, i] = m(!1), [a, s] = m(0), [u, d] = m(!1), f = p(null), h = p(null), g =
|
|
2049
|
+
function Et({ actions: e, size: t, label: n }) {
|
|
2050
|
+
let [r, i] = m(!1), [a, s] = m(0), [u, d] = m(!1), f = p(null), h = p(null), g = p(!1), y = l(), b = o((e) => {
|
|
1996
2051
|
i(!1), e && f.current?.focus();
|
|
1997
|
-
}, []),
|
|
2052
|
+
}, []), x = Math.min(a, Math.max(e.length - 1, 0));
|
|
1998
2053
|
return c(() => {
|
|
1999
|
-
r && (h.current?.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"]"))?.[
|
|
2054
|
+
r && (h.current?.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"]"))?.[x]?.focus();
|
|
2055
|
+
}, [r, x]), c(() => {
|
|
2056
|
+
if (!r) return;
|
|
2057
|
+
let e = (e) => {
|
|
2058
|
+
let t = e.target;
|
|
2059
|
+
t && (h.current?.contains(t) || f.current?.contains(t) || b(!1));
|
|
2060
|
+
};
|
|
2061
|
+
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
2000
2062
|
}, [r, b]), /* @__PURE__ */ v("span", {
|
|
2001
2063
|
className: Y.overflow,
|
|
2002
2064
|
children: [/* @__PURE__ */ _(V, {
|
|
2003
2065
|
ref: f,
|
|
2004
2066
|
variant: "secondary",
|
|
2005
|
-
|
|
2067
|
+
"data-ick-role": "header-more",
|
|
2068
|
+
size: _t[t],
|
|
2006
2069
|
icon: /* @__PURE__ */ _(le, {
|
|
2007
|
-
size:
|
|
2070
|
+
size: yt[t],
|
|
2008
2071
|
"aria-hidden": !0
|
|
2009
2072
|
}),
|
|
2010
2073
|
"aria-label": n,
|
|
2011
2074
|
"aria-haspopup": "menu",
|
|
2012
2075
|
"aria-expanded": r,
|
|
2013
|
-
"aria-controls": r ?
|
|
2076
|
+
"aria-controls": r ? y : void 0,
|
|
2077
|
+
onPointerDown: () => {
|
|
2078
|
+
g.current = r;
|
|
2079
|
+
},
|
|
2014
2080
|
onClick: (e) => {
|
|
2015
|
-
|
|
2081
|
+
let t = r || e.detail > 0 && g.current;
|
|
2082
|
+
if (g.current = !1, t) {
|
|
2083
|
+
b(!1);
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2086
|
+
d(e.detail === 0), s(0), i(!0);
|
|
2016
2087
|
}
|
|
2017
2088
|
}), r && /* @__PURE__ */ _("div", {
|
|
2018
2089
|
ref: h,
|
|
2019
|
-
id:
|
|
2090
|
+
id: y,
|
|
2020
2091
|
role: "menu",
|
|
2021
2092
|
"aria-label": n,
|
|
2022
2093
|
className: Y.menu,
|
|
2023
2094
|
"data-keyboard": u || void 0,
|
|
2024
2095
|
onKeyDown: (t) => {
|
|
2025
2096
|
if (t.key === "Escape") {
|
|
2026
|
-
t.stopPropagation(),
|
|
2097
|
+
t.stopPropagation(), b(!0);
|
|
2027
2098
|
return;
|
|
2028
2099
|
}
|
|
2029
2100
|
if ([
|
|
@@ -2046,17 +2117,19 @@ function Tt({ actions: e, size: t, label: n }) {
|
|
|
2046
2117
|
t.key === "End" && (t.preventDefault(), s(e.length - 1));
|
|
2047
2118
|
},
|
|
2048
2119
|
onBlur: (e) => {
|
|
2049
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
2120
|
+
e.currentTarget.contains(e.relatedTarget) || b(!1);
|
|
2050
2121
|
},
|
|
2051
2122
|
children: e.map((e, t) => /* @__PURE__ */ v("button", {
|
|
2052
2123
|
type: "button",
|
|
2053
2124
|
role: e.active === void 0 ? "menuitem" : "menuitemcheckbox",
|
|
2054
2125
|
"aria-checked": e.active,
|
|
2055
|
-
tabIndex:
|
|
2126
|
+
tabIndex: x === t ? 0 : -1,
|
|
2056
2127
|
className: Y.menuItem,
|
|
2128
|
+
"data-ick-role": "header-menu-item",
|
|
2129
|
+
"data-ick-action": e.id,
|
|
2057
2130
|
disabled: e.disabled,
|
|
2058
2131
|
onClick: () => {
|
|
2059
|
-
e.onClick?.(),
|
|
2132
|
+
e.onClick?.(), b(!0);
|
|
2060
2133
|
},
|
|
2061
2134
|
children: [
|
|
2062
2135
|
/* @__PURE__ */ _("span", {
|
|
@@ -2073,17 +2146,17 @@ function Tt({ actions: e, size: t, label: n }) {
|
|
|
2073
2146
|
})]
|
|
2074
2147
|
});
|
|
2075
2148
|
}
|
|
2076
|
-
var
|
|
2149
|
+
var Dt = {
|
|
2077
2150
|
row: "ick-row-yugg",
|
|
2078
2151
|
reveal: "ick-reveal-z3mw"
|
|
2079
|
-
},
|
|
2080
|
-
function
|
|
2152
|
+
}, Ot = 1600;
|
|
2153
|
+
function kt({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i = null, children: a, reveal: s = !1, busy: l = !1, labels: u, className: d, ...f }) {
|
|
2081
2154
|
let [h, y] = m(!1), b = p(null), x = H("answerActions", u);
|
|
2082
2155
|
c(() => () => {
|
|
2083
2156
|
b.current && clearTimeout(b.current);
|
|
2084
2157
|
}, []);
|
|
2085
2158
|
let S = o(() => {
|
|
2086
|
-
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), Ke(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1),
|
|
2159
|
+
t ? t(e) : navigator.clipboard?.writeText(e), y(!0), Ke(x.copied), b.current && clearTimeout(b.current), b.current = setTimeout(() => y(!1), Ot);
|
|
2087
2160
|
}, [
|
|
2088
2161
|
x.copied,
|
|
2089
2162
|
t,
|
|
@@ -2091,15 +2164,17 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2091
2164
|
]), C = (e) => r?.(i === e ? null : e);
|
|
2092
2165
|
return /* @__PURE__ */ v("div", {
|
|
2093
2166
|
className: [
|
|
2094
|
-
|
|
2095
|
-
s ?
|
|
2167
|
+
Dt.row,
|
|
2168
|
+
s ? Dt.reveal : "",
|
|
2096
2169
|
d ?? ""
|
|
2097
2170
|
].filter(Boolean).join(" "),
|
|
2098
2171
|
...f,
|
|
2099
2172
|
children: [
|
|
2100
2173
|
e.trim() && /* @__PURE__ */ _(V, {
|
|
2101
2174
|
variant: "ghost",
|
|
2102
|
-
|
|
2175
|
+
"data-ick-role": "answer-action",
|
|
2176
|
+
"data-ick-action": "copy",
|
|
2177
|
+
icon: _(h ? j : te, {
|
|
2103
2178
|
size: 14,
|
|
2104
2179
|
"aria-hidden": !0
|
|
2105
2180
|
}),
|
|
@@ -2109,6 +2184,8 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2109
2184
|
}),
|
|
2110
2185
|
n && /* @__PURE__ */ _(V, {
|
|
2111
2186
|
variant: "ghost",
|
|
2187
|
+
"data-ick-role": "answer-action",
|
|
2188
|
+
"data-ick-action": "regenerate",
|
|
2112
2189
|
icon: /* @__PURE__ */ _(me, {
|
|
2113
2190
|
size: 14,
|
|
2114
2191
|
"aria-hidden": !0
|
|
@@ -2121,6 +2198,8 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2121
2198
|
}),
|
|
2122
2199
|
r && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(V, {
|
|
2123
2200
|
variant: "ghost",
|
|
2201
|
+
"data-ick-role": "answer-action",
|
|
2202
|
+
"data-ick-action": "up",
|
|
2124
2203
|
icon: /* @__PURE__ */ _(xe, {
|
|
2125
2204
|
size: 14,
|
|
2126
2205
|
"aria-hidden": !0
|
|
@@ -2131,6 +2210,8 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2131
2210
|
title: x.up
|
|
2132
2211
|
}), /* @__PURE__ */ _(V, {
|
|
2133
2212
|
variant: "ghost",
|
|
2213
|
+
"data-ick-role": "answer-action",
|
|
2214
|
+
"data-ick-action": "down",
|
|
2134
2215
|
icon: /* @__PURE__ */ _(be, {
|
|
2135
2216
|
size: 14,
|
|
2136
2217
|
"aria-hidden": !0
|
|
@@ -2144,7 +2225,7 @@ function Ot({ text: e, onCopy: t, onRegenerate: n, onFeedback: r, feedback: i =
|
|
|
2144
2225
|
]
|
|
2145
2226
|
});
|
|
2146
2227
|
}
|
|
2147
|
-
var
|
|
2228
|
+
var At = {
|
|
2148
2229
|
branch: "ick-branch-lR6b",
|
|
2149
2230
|
step: "ick-step-JSch ick-target-vuT2",
|
|
2150
2231
|
count: "ick-count-kOmV",
|
|
@@ -2152,34 +2233,34 @@ var kt = {
|
|
|
2152
2233
|
};
|
|
2153
2234
|
//#endregion
|
|
2154
2235
|
//#region src/Branch/Branch.tsx
|
|
2155
|
-
function
|
|
2236
|
+
function jt({ total: e, index: t, onSelect: n, labels: r, className: i, ...a }) {
|
|
2156
2237
|
let o = H("branch", r);
|
|
2157
2238
|
if (e < 2) return null;
|
|
2158
2239
|
let s = Math.min(Math.max(t, 0), e - 1), c = o.position.replace("{index}", String(s + 1)).replace("{total}", String(e));
|
|
2159
2240
|
return /* @__PURE__ */ v("div", {
|
|
2160
|
-
className: [
|
|
2241
|
+
className: [At.branch, i ?? ""].filter(Boolean).join(" "),
|
|
2161
2242
|
role: "group",
|
|
2162
2243
|
"aria-label": c,
|
|
2163
2244
|
...a,
|
|
2164
2245
|
children: [
|
|
2165
2246
|
/* @__PURE__ */ _("button", {
|
|
2166
2247
|
type: "button",
|
|
2167
|
-
className:
|
|
2248
|
+
className: At.step,
|
|
2168
2249
|
onClick: () => n(s - 1),
|
|
2169
2250
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2170
2251
|
disabled: s === 0,
|
|
2171
2252
|
"aria-label": o.previous,
|
|
2172
|
-
children: /* @__PURE__ */ _(
|
|
2253
|
+
children: /* @__PURE__ */ _(N, {
|
|
2173
2254
|
size: 14,
|
|
2174
2255
|
"aria-hidden": !0
|
|
2175
2256
|
})
|
|
2176
2257
|
}),
|
|
2177
2258
|
/* @__PURE__ */ v("span", {
|
|
2178
|
-
className:
|
|
2259
|
+
className: At.count,
|
|
2179
2260
|
children: [
|
|
2180
2261
|
s + 1,
|
|
2181
2262
|
/* @__PURE__ */ _("span", {
|
|
2182
|
-
className:
|
|
2263
|
+
className: At.of,
|
|
2183
2264
|
children: "/"
|
|
2184
2265
|
}),
|
|
2185
2266
|
e
|
|
@@ -2187,12 +2268,12 @@ function At({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
2187
2268
|
}),
|
|
2188
2269
|
/* @__PURE__ */ _("button", {
|
|
2189
2270
|
type: "button",
|
|
2190
|
-
className:
|
|
2271
|
+
className: At.step,
|
|
2191
2272
|
onClick: () => n(s + 1),
|
|
2192
2273
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2193
2274
|
disabled: s === e - 1,
|
|
2194
2275
|
"aria-label": o.next,
|
|
2195
|
-
children: /* @__PURE__ */ _(
|
|
2276
|
+
children: /* @__PURE__ */ _(ee, {
|
|
2196
2277
|
size: 14,
|
|
2197
2278
|
"aria-hidden": !0
|
|
2198
2279
|
})
|
|
@@ -2200,7 +2281,7 @@ function At({ total: e, index: t, onSelect: n, labels: r, className: i, ...a })
|
|
|
2200
2281
|
]
|
|
2201
2282
|
});
|
|
2202
2283
|
}
|
|
2203
|
-
var
|
|
2284
|
+
var Mt = {
|
|
2204
2285
|
loader: "ick-loader-7WbG",
|
|
2205
2286
|
dot: "ick-dot-JJFT",
|
|
2206
2287
|
blink: "ick-blink-MCVu",
|
|
@@ -2210,10 +2291,10 @@ var jt = {
|
|
|
2210
2291
|
};
|
|
2211
2292
|
//#endregion
|
|
2212
2293
|
//#region src/Loader/Loader.tsx
|
|
2213
|
-
function
|
|
2294
|
+
function Nt({ variant: e = "dots", children: t, label: n = null, className: r, ...i }) {
|
|
2214
2295
|
let a = [
|
|
2215
|
-
|
|
2216
|
-
|
|
2296
|
+
Mt.loader,
|
|
2297
|
+
Mt[e],
|
|
2217
2298
|
r ?? ""
|
|
2218
2299
|
].filter(Boolean).join(" ");
|
|
2219
2300
|
return /* @__PURE__ */ v("div", {
|
|
@@ -2222,21 +2303,21 @@ function Mt({ variant: e = "dots", children: t, label: n = null, className: r, .
|
|
|
2222
2303
|
"aria-hidden": !n || void 0,
|
|
2223
2304
|
...i,
|
|
2224
2305
|
children: [n && /* @__PURE__ */ _("span", {
|
|
2225
|
-
className:
|
|
2306
|
+
className: Mt.srOnly,
|
|
2226
2307
|
children: n
|
|
2227
2308
|
}), e === "dots" ? /* @__PURE__ */ v(g, { children: [
|
|
2228
|
-
/* @__PURE__ */ _("span", { className:
|
|
2229
|
-
/* @__PURE__ */ _("span", { className:
|
|
2230
|
-
/* @__PURE__ */ _("span", { className:
|
|
2309
|
+
/* @__PURE__ */ _("span", { className: Mt.dot }),
|
|
2310
|
+
/* @__PURE__ */ _("span", { className: Mt.dot }),
|
|
2311
|
+
/* @__PURE__ */ _("span", { className: Mt.dot })
|
|
2231
2312
|
] }) : /* @__PURE__ */ _("span", {
|
|
2232
|
-
className:
|
|
2313
|
+
className: Mt.text,
|
|
2233
2314
|
children: t
|
|
2234
2315
|
})]
|
|
2235
2316
|
});
|
|
2236
2317
|
}
|
|
2237
2318
|
//#endregion
|
|
2238
2319
|
//#region src/disclosure/useDisclosure.ts
|
|
2239
|
-
function
|
|
2320
|
+
function Pt({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
2240
2321
|
let [i, a] = m(null), s = e ?? i ?? t ?? r;
|
|
2241
2322
|
return {
|
|
2242
2323
|
isOpen: s,
|
|
@@ -2250,7 +2331,7 @@ function Nt({ open: e, defaultOpen: t, onOpenChange: n, preferOpen: r }) {
|
|
|
2250
2331
|
])
|
|
2251
2332
|
};
|
|
2252
2333
|
}
|
|
2253
|
-
var
|
|
2334
|
+
var Ft = {
|
|
2254
2335
|
header: "ick-header-C0FS ick-target-vuT2",
|
|
2255
2336
|
chevron: "ick-chevron-RY4c",
|
|
2256
2337
|
static: "ick-static-6vUk",
|
|
@@ -2258,30 +2339,30 @@ var Pt = {
|
|
|
2258
2339
|
label: "ick-label-L-k2",
|
|
2259
2340
|
sweep: "ick-sweep-owLs",
|
|
2260
2341
|
meta: "ick-meta-wT3y"
|
|
2261
|
-
},
|
|
2262
|
-
function
|
|
2342
|
+
}, It = (...e) => e.filter(Boolean).join(" ");
|
|
2343
|
+
function Lt({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, glyph: a, label: o, pending: s, meta: c, children: l, className: u }) {
|
|
2263
2344
|
let d = /* @__PURE__ */ v(g, { children: [
|
|
2264
2345
|
a && /* @__PURE__ */ _("span", {
|
|
2265
|
-
className:
|
|
2346
|
+
className: Ft.glyph,
|
|
2266
2347
|
children: a
|
|
2267
2348
|
}),
|
|
2268
2349
|
/* @__PURE__ */ _("span", {
|
|
2269
|
-
className:
|
|
2350
|
+
className: Ft.label,
|
|
2270
2351
|
"data-pending": s || void 0,
|
|
2271
2352
|
children: o
|
|
2272
2353
|
}),
|
|
2273
2354
|
l,
|
|
2274
2355
|
c ? /* @__PURE__ */ _("span", {
|
|
2275
|
-
className:
|
|
2356
|
+
className: Ft.meta,
|
|
2276
2357
|
children: c
|
|
2277
2358
|
}) : null,
|
|
2278
2359
|
n && /* @__PURE__ */ _(M, {
|
|
2279
|
-
className:
|
|
2360
|
+
className: Ft.chevron,
|
|
2280
2361
|
size: 14,
|
|
2281
2362
|
"aria-hidden": !0
|
|
2282
2363
|
})
|
|
2283
2364
|
] }), f = {
|
|
2284
|
-
className: Ft
|
|
2365
|
+
className: It(Ft.header, u),
|
|
2285
2366
|
"data-fit": e
|
|
2286
2367
|
};
|
|
2287
2368
|
return n ? /* @__PURE__ */ _("button", {
|
|
@@ -2295,25 +2376,25 @@ function It({ fit: e = "band", open: t, onToggle: n, controls: r, disabled: i, g
|
|
|
2295
2376
|
children: d
|
|
2296
2377
|
}) : /* @__PURE__ */ _("div", {
|
|
2297
2378
|
...f,
|
|
2298
|
-
className:
|
|
2379
|
+
className: It(f.className, Ft.static),
|
|
2299
2380
|
children: d
|
|
2300
2381
|
});
|
|
2301
2382
|
}
|
|
2302
|
-
var
|
|
2383
|
+
var Rt = {
|
|
2303
2384
|
outer: "ick-outer-6UEA",
|
|
2304
2385
|
wrap: "ick-wrap-u6ww"
|
|
2305
2386
|
};
|
|
2306
2387
|
//#endregion
|
|
2307
2388
|
//#region src/disclosure/DisclosureBody.tsx
|
|
2308
|
-
function
|
|
2309
|
-
let i =
|
|
2389
|
+
function zt({ id: e, open: t, className: n, children: r }) {
|
|
2390
|
+
let i = G();
|
|
2310
2391
|
return /* @__PURE__ */ _("div", {
|
|
2311
2392
|
id: e,
|
|
2312
|
-
className:
|
|
2393
|
+
className: Rt.outer,
|
|
2313
2394
|
children: /* @__PURE__ */ _(y, {
|
|
2314
2395
|
initial: !1,
|
|
2315
2396
|
children: t && r ? /* @__PURE__ */ _(C.div, {
|
|
2316
|
-
className:
|
|
2397
|
+
className: Rt.wrap,
|
|
2317
2398
|
initial: i ? { opacity: 0 } : {
|
|
2318
2399
|
height: 0,
|
|
2319
2400
|
opacity: 0
|
|
@@ -2345,20 +2426,20 @@ function Rt({ id: e, open: t, className: n, children: r }) {
|
|
|
2345
2426
|
}
|
|
2346
2427
|
//#endregion
|
|
2347
2428
|
//#region src/duration/formatDuration.ts
|
|
2348
|
-
function
|
|
2429
|
+
function Bt(e) {
|
|
2349
2430
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
2350
2431
|
if (e < 1e3) return `${Math.round(e)}ms`;
|
|
2351
2432
|
let t = e / 1e3;
|
|
2352
2433
|
return `${t < 10 ? t.toFixed(1) : Math.round(t)}s`;
|
|
2353
2434
|
}
|
|
2354
|
-
var
|
|
2435
|
+
var Vt = {
|
|
2355
2436
|
reasoning: "ick-reasoning-qbLZ",
|
|
2356
2437
|
bodyInner: "ick-bodyInner-5PBC"
|
|
2357
2438
|
};
|
|
2358
2439
|
//#endregion
|
|
2359
2440
|
//#region src/Reasoning/Reasoning.tsx
|
|
2360
|
-
function
|
|
2361
|
-
let u = H("reasoning", o), d = l(), f = t === "thinking", { isOpen: p, toggle: h } =
|
|
2441
|
+
function Ht({ children: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2442
|
+
let u = H("reasoning", o), d = l(), f = t === "thinking", { isOpen: p, toggle: h } = Pt({
|
|
2362
2443
|
open: r,
|
|
2363
2444
|
defaultOpen: i,
|
|
2364
2445
|
onOpenChange: a,
|
|
@@ -2374,12 +2455,12 @@ function Vt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2374
2455
|
from: null,
|
|
2375
2456
|
took: e.from === null ? null : Date.now() - e.from
|
|
2376
2457
|
}));
|
|
2377
|
-
let S = n ?? b.took, C = f || S === null ? "" :
|
|
2458
|
+
let S = n ?? b.took, C = f || S === null ? "" : Bt(S);
|
|
2378
2459
|
return /* @__PURE__ */ v("div", {
|
|
2379
|
-
className: [
|
|
2460
|
+
className: [Vt.reasoning, s ?? ""].filter(Boolean).join(" "),
|
|
2380
2461
|
"data-state": t,
|
|
2381
2462
|
...c,
|
|
2382
|
-
children: [/* @__PURE__ */ _(
|
|
2463
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2383
2464
|
fit: "inline",
|
|
2384
2465
|
open: p,
|
|
2385
2466
|
onToggle: h,
|
|
@@ -2390,17 +2471,17 @@ function Vt({ children: e, state: t = "done", duration: n, open: r, defaultOpen:
|
|
|
2390
2471
|
}),
|
|
2391
2472
|
label: f ? u.thinking : C ? `${u.thoughtFor} ${C}` : u.thought,
|
|
2392
2473
|
pending: f
|
|
2393
|
-
}), /* @__PURE__ */ _(
|
|
2474
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2394
2475
|
id: d,
|
|
2395
2476
|
open: p,
|
|
2396
|
-
className:
|
|
2477
|
+
className: Vt.bodyInner,
|
|
2397
2478
|
children: e
|
|
2398
2479
|
})]
|
|
2399
2480
|
});
|
|
2400
2481
|
}
|
|
2401
2482
|
//#endregion
|
|
2402
2483
|
//#region src/CodeBlock/highlight.ts
|
|
2403
|
-
var
|
|
2484
|
+
var Ut = [
|
|
2404
2485
|
"bash",
|
|
2405
2486
|
"css",
|
|
2406
2487
|
"diff",
|
|
@@ -2412,7 +2493,7 @@ var Ht = [
|
|
|
2412
2493
|
"typescript",
|
|
2413
2494
|
"xml",
|
|
2414
2495
|
"yaml"
|
|
2415
|
-
],
|
|
2496
|
+
], Wt = {
|
|
2416
2497
|
js: "javascript",
|
|
2417
2498
|
jsx: "javascript",
|
|
2418
2499
|
mjs: "javascript",
|
|
@@ -2433,15 +2514,15 @@ var Ht = [
|
|
|
2433
2514
|
patch: "diff",
|
|
2434
2515
|
yml: "yaml",
|
|
2435
2516
|
yamllint: "yaml"
|
|
2436
|
-
},
|
|
2517
|
+
}, Gt = new Set(Ut), Kt = (e) => [{
|
|
2437
2518
|
value: e,
|
|
2438
2519
|
kind: null
|
|
2439
|
-
}],
|
|
2520
|
+
}], qt = (e) => {
|
|
2440
2521
|
if (!e) return null;
|
|
2441
|
-
let t =
|
|
2442
|
-
return
|
|
2443
|
-
},
|
|
2444
|
-
function
|
|
2522
|
+
let t = Wt[e.toLowerCase()] ?? e.toLowerCase();
|
|
2523
|
+
return Gt.has(t) ? t : null;
|
|
2524
|
+
}, Jt = (e) => qt(e) !== null;
|
|
2525
|
+
function Yt(e) {
|
|
2445
2526
|
let t = [], n = (e, n) => {
|
|
2446
2527
|
if (!e) return;
|
|
2447
2528
|
let r = t[t.length - 1];
|
|
@@ -2461,42 +2542,42 @@ function Jt(e) {
|
|
|
2461
2542
|
};
|
|
2462
2543
|
return r(e.children ?? [], null), t;
|
|
2463
2544
|
}
|
|
2464
|
-
var
|
|
2465
|
-
function
|
|
2466
|
-
return
|
|
2545
|
+
var Xt = null, Zt = null, Qt = () => Xt;
|
|
2546
|
+
function $t() {
|
|
2547
|
+
return Xt ? Promise.resolve(Xt) : Zt || (Zt = (async () => {
|
|
2467
2548
|
let { createHighlighter: e } = await import("./grammars-B19jp7qm.js"), t = e();
|
|
2468
|
-
return
|
|
2469
|
-
let r =
|
|
2470
|
-
if (!r) return
|
|
2549
|
+
return Xt = (e, n) => {
|
|
2550
|
+
let r = qt(n);
|
|
2551
|
+
if (!r) return Kt(e);
|
|
2471
2552
|
try {
|
|
2472
|
-
let n =
|
|
2473
|
-
return n.length > 0 ? n :
|
|
2553
|
+
let n = Yt(t.highlight(r, e));
|
|
2554
|
+
return n.length > 0 ? n : Kt(e);
|
|
2474
2555
|
} catch {
|
|
2475
|
-
return
|
|
2556
|
+
return Kt(e);
|
|
2476
2557
|
}
|
|
2477
|
-
},
|
|
2478
|
-
})(),
|
|
2558
|
+
}, Xt;
|
|
2559
|
+
})(), Zt);
|
|
2479
2560
|
}
|
|
2480
|
-
var
|
|
2561
|
+
var en = {
|
|
2481
2562
|
block: "ick-block-xN1a",
|
|
2482
2563
|
bar: "ick-bar-5YJ4",
|
|
2483
2564
|
lang: "ick-lang-pkCd",
|
|
2484
2565
|
copy: "ick-copy-KoCs ick-target-vuT2",
|
|
2485
2566
|
copyLabel: "ick-copyLabel-E8mN",
|
|
2486
2567
|
pre: "ick-pre-qaBX"
|
|
2487
|
-
},
|
|
2488
|
-
function
|
|
2489
|
-
let d = H("codeBlock", s), [h, g] = m(!1), y = p(null), [b, x] = m(
|
|
2568
|
+
}, tn = 1600;
|
|
2569
|
+
function nn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor: a = tn, labels: s, className: l, ...u }) {
|
|
2570
|
+
let d = H("codeBlock", s), [h, g] = m(!1), y = p(null), [b, x] = m(Qt);
|
|
2490
2571
|
c(() => {
|
|
2491
|
-
if (b || !
|
|
2572
|
+
if (b || !Jt(t)) return;
|
|
2492
2573
|
let e = !0;
|
|
2493
|
-
return
|
|
2574
|
+
return $t().then((t) => {
|
|
2494
2575
|
e && x(() => t);
|
|
2495
2576
|
}), () => {
|
|
2496
2577
|
e = !1;
|
|
2497
2578
|
};
|
|
2498
2579
|
}, [b, t]);
|
|
2499
|
-
let S = f(() => b ? b(e, t) :
|
|
2580
|
+
let S = f(() => b ? b(e, t) : Kt(e), [
|
|
2500
2581
|
b,
|
|
2501
2582
|
e,
|
|
2502
2583
|
t
|
|
@@ -2513,29 +2594,29 @@ function tn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2513
2594
|
d.copiedAnnouncement
|
|
2514
2595
|
]), w = n === !1 ? null : n ?? t ?? null, T = w !== null || r;
|
|
2515
2596
|
return /* @__PURE__ */ v("div", {
|
|
2516
|
-
className: [
|
|
2597
|
+
className: [en.block, l ?? ""].filter(Boolean).join(" "),
|
|
2517
2598
|
...u,
|
|
2518
2599
|
children: [T && /* @__PURE__ */ v("div", {
|
|
2519
|
-
className:
|
|
2600
|
+
className: en.bar,
|
|
2520
2601
|
children: [/* @__PURE__ */ _("span", {
|
|
2521
|
-
className:
|
|
2602
|
+
className: en.lang,
|
|
2522
2603
|
children: w
|
|
2523
2604
|
}), r && /* @__PURE__ */ v("button", {
|
|
2524
2605
|
type: "button",
|
|
2525
|
-
className:
|
|
2606
|
+
className: en.copy,
|
|
2526
2607
|
onClick: C,
|
|
2527
2608
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2528
2609
|
"aria-label": h ? d.copied : d.copyCode,
|
|
2529
|
-
children: [_(h ? j :
|
|
2610
|
+
children: [_(h ? j : te, {
|
|
2530
2611
|
size: 13,
|
|
2531
2612
|
"aria-hidden": !0
|
|
2532
2613
|
}), /* @__PURE__ */ _("span", {
|
|
2533
|
-
className:
|
|
2614
|
+
className: en.copyLabel,
|
|
2534
2615
|
children: h ? d.copied : d.copy
|
|
2535
2616
|
})]
|
|
2536
2617
|
})]
|
|
2537
2618
|
}), /* @__PURE__ */ _("pre", {
|
|
2538
|
-
className:
|
|
2619
|
+
className: en.pre,
|
|
2539
2620
|
children: /* @__PURE__ */ _("code", { children: S.map((e, t) => e.kind ? /* @__PURE__ */ _("span", {
|
|
2540
2621
|
"data-hl": e.kind,
|
|
2541
2622
|
children: e.value
|
|
@@ -2543,7 +2624,7 @@ function tn({ code: e, lang: t, label: n, copyable: r = !0, onCopy: i, copiedFor
|
|
|
2543
2624
|
})]
|
|
2544
2625
|
});
|
|
2545
2626
|
}
|
|
2546
|
-
var
|
|
2627
|
+
var rn = {
|
|
2547
2628
|
glyph: "ick-glyph-NSSW",
|
|
2548
2629
|
queued: "ick-queued-6cCj",
|
|
2549
2630
|
spinner: "ick-spinner-HeOp",
|
|
@@ -2551,15 +2632,15 @@ var nn = {
|
|
|
2551
2632
|
};
|
|
2552
2633
|
//#endregion
|
|
2553
2634
|
//#region src/stateGlyph/StateGlyph.tsx
|
|
2554
|
-
function
|
|
2635
|
+
function an({ state: e }) {
|
|
2555
2636
|
return /* @__PURE__ */ _("span", {
|
|
2556
|
-
className:
|
|
2637
|
+
className: rn.glyph,
|
|
2557
2638
|
"data-state": e,
|
|
2558
2639
|
"aria-hidden": !0,
|
|
2559
|
-
children: e === "running" ? /* @__PURE__ */ _("span", { className:
|
|
2640
|
+
children: e === "running" ? /* @__PURE__ */ _("span", { className: rn.spinner }) : e === "done" ? /* @__PURE__ */ _(j, { size: 13 }) : e === "error" ? /* @__PURE__ */ _(Ce, { size: 13 }) : /* @__PURE__ */ _("span", { className: rn.queued })
|
|
2560
2641
|
});
|
|
2561
2642
|
}
|
|
2562
|
-
var
|
|
2643
|
+
var on = {
|
|
2563
2644
|
tool: "ick-tool-en0M",
|
|
2564
2645
|
card: "ick-card-nzIg",
|
|
2565
2646
|
overview: "ick-overview-lVM-",
|
|
@@ -2571,7 +2652,7 @@ var an = {
|
|
|
2571
2652
|
};
|
|
2572
2653
|
//#endregion
|
|
2573
2654
|
//#region src/Tool/Tool.tsx
|
|
2574
|
-
function
|
|
2655
|
+
function sn(e) {
|
|
2575
2656
|
if (e == null) return null;
|
|
2576
2657
|
if (i(e)) return {
|
|
2577
2658
|
kind: "node",
|
|
@@ -2598,75 +2679,75 @@ function on(e) {
|
|
|
2598
2679
|
};
|
|
2599
2680
|
}
|
|
2600
2681
|
}
|
|
2601
|
-
function
|
|
2682
|
+
function cn({ label: e, value: t, tone: n }) {
|
|
2602
2683
|
if (!t) return null;
|
|
2603
|
-
if (t.kind === "json") return /* @__PURE__ */ _(
|
|
2684
|
+
if (t.kind === "json") return /* @__PURE__ */ _(nn, {
|
|
2604
2685
|
code: t.code,
|
|
2605
2686
|
lang: "json",
|
|
2606
2687
|
label: e
|
|
2607
2688
|
});
|
|
2608
2689
|
let r = t.kind === "text" ? /* @__PURE__ */ _("p", {
|
|
2609
|
-
className:
|
|
2690
|
+
className: on.text,
|
|
2610
2691
|
children: t.text
|
|
2611
2692
|
}) : t.node;
|
|
2612
2693
|
return /* @__PURE__ */ v("div", {
|
|
2613
|
-
className:
|
|
2694
|
+
className: on.section,
|
|
2614
2695
|
"data-tone": n,
|
|
2615
2696
|
children: [/* @__PURE__ */ _("span", {
|
|
2616
|
-
className:
|
|
2697
|
+
className: on.sectionLabel,
|
|
2617
2698
|
children: e
|
|
2618
2699
|
}), r]
|
|
2619
2700
|
});
|
|
2620
2701
|
}
|
|
2621
|
-
function
|
|
2622
|
-
let m = H("tool", d), h = l(), g = t === "error", { isOpen: y, toggle: b } =
|
|
2702
|
+
function ln({ name: e, state: t = "done", summary: n, input: r, output: i, error: a, duration: o, open: s, defaultOpen: c, onOpenChange: u, labels: d, className: f, ...p }) {
|
|
2703
|
+
let m = H("tool", d), h = l(), g = t === "error", { isOpen: y, toggle: b } = Pt({
|
|
2623
2704
|
open: s,
|
|
2624
2705
|
defaultOpen: c,
|
|
2625
2706
|
onOpenChange: u,
|
|
2626
2707
|
preferOpen: g
|
|
2627
|
-
}), x =
|
|
2708
|
+
}), x = sn(r), S = g ? null : sn(i), C = g ? sn(a) : null, w = !!(x || S || C || t === "running"), T = t === "done" || g ? Bt(o ?? NaN) : "";
|
|
2628
2709
|
return /* @__PURE__ */ v("div", {
|
|
2629
|
-
className: [
|
|
2710
|
+
className: [on.tool, f ?? ""].filter(Boolean).join(" "),
|
|
2630
2711
|
"data-state": t,
|
|
2631
2712
|
...p,
|
|
2632
|
-
children: [/* @__PURE__ */ _(
|
|
2713
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2633
2714
|
open: y,
|
|
2634
2715
|
onToggle: b,
|
|
2635
2716
|
controls: h,
|
|
2636
2717
|
disabled: !w,
|
|
2637
|
-
glyph: /* @__PURE__ */ _(
|
|
2718
|
+
glyph: /* @__PURE__ */ _(an, { state: t }),
|
|
2638
2719
|
label: e,
|
|
2639
2720
|
meta: T || void 0,
|
|
2640
2721
|
children: /* @__PURE__ */ _("span", {
|
|
2641
|
-
className:
|
|
2722
|
+
className: on.srOnly,
|
|
2642
2723
|
children: m[t]
|
|
2643
2724
|
})
|
|
2644
2725
|
}), /* @__PURE__ */ v("div", {
|
|
2645
|
-
className:
|
|
2726
|
+
className: on.card,
|
|
2646
2727
|
children: [/* @__PURE__ */ _("p", {
|
|
2647
|
-
className:
|
|
2728
|
+
className: on.overview,
|
|
2648
2729
|
children: n ?? m[t]
|
|
2649
|
-
}), /* @__PURE__ */ v(
|
|
2730
|
+
}), /* @__PURE__ */ v(zt, {
|
|
2650
2731
|
id: h,
|
|
2651
2732
|
open: y && w,
|
|
2652
|
-
className:
|
|
2733
|
+
className: on.bodyInner,
|
|
2653
2734
|
children: [
|
|
2654
|
-
/* @__PURE__ */ _(
|
|
2735
|
+
/* @__PURE__ */ _(cn, {
|
|
2655
2736
|
label: m.input,
|
|
2656
2737
|
value: x
|
|
2657
2738
|
}),
|
|
2658
2739
|
t === "running" && !S && /* @__PURE__ */ v("div", {
|
|
2659
|
-
className:
|
|
2740
|
+
className: on.section,
|
|
2660
2741
|
children: [/* @__PURE__ */ _("span", {
|
|
2661
|
-
className:
|
|
2742
|
+
className: on.sectionLabel,
|
|
2662
2743
|
children: m.output
|
|
2663
|
-
}), /* @__PURE__ */ _(
|
|
2744
|
+
}), /* @__PURE__ */ _(Nt, {})]
|
|
2664
2745
|
}),
|
|
2665
|
-
/* @__PURE__ */ _(
|
|
2746
|
+
/* @__PURE__ */ _(cn, {
|
|
2666
2747
|
label: m.output,
|
|
2667
2748
|
value: S
|
|
2668
2749
|
}),
|
|
2669
|
-
/* @__PURE__ */ _(
|
|
2750
|
+
/* @__PURE__ */ _(cn, {
|
|
2670
2751
|
label: m.error,
|
|
2671
2752
|
value: C,
|
|
2672
2753
|
tone: "error"
|
|
@@ -2676,7 +2757,7 @@ function cn({ name: e, state: t = "done", summary: n, input: r, output: i, error
|
|
|
2676
2757
|
})]
|
|
2677
2758
|
});
|
|
2678
2759
|
}
|
|
2679
|
-
var
|
|
2760
|
+
var un = {
|
|
2680
2761
|
approval: "ick-approval-zlJi",
|
|
2681
2762
|
head: "ick-head-CX4j",
|
|
2682
2763
|
title: "ick-title-n-wh",
|
|
@@ -2685,64 +2766,67 @@ var ln = {
|
|
|
2685
2766
|
actions: "ick-actions-t5Oz",
|
|
2686
2767
|
deny: "ick-deny-XXyG",
|
|
2687
2768
|
settled: "ick-settled-OaBX"
|
|
2688
|
-
},
|
|
2769
|
+
}, dn = [
|
|
2689
2770
|
"once",
|
|
2690
2771
|
"always",
|
|
2691
2772
|
"deny"
|
|
2692
|
-
],
|
|
2773
|
+
], fn = {
|
|
2693
2774
|
once: "allowedOnce",
|
|
2694
2775
|
always: "allowedAlways",
|
|
2695
2776
|
denied: "wasDenied"
|
|
2696
2777
|
};
|
|
2697
|
-
function
|
|
2778
|
+
function pn({ title: e, description: t, children: n, decision: r = null, onDecide: i, readOnly: a = !1, choices: o = dn, labels: s, className: c, ...u }) {
|
|
2698
2779
|
let d = H("approval", s), f = (e) => o.includes(e), p = l(), m = r !== null;
|
|
2699
2780
|
return /* @__PURE__ */ v("section", {
|
|
2700
|
-
className: [
|
|
2781
|
+
className: [un.approval, c ?? ""].filter(Boolean).join(" "),
|
|
2701
2782
|
"data-decision": r ?? void 0,
|
|
2702
2783
|
"aria-labelledby": p,
|
|
2703
2784
|
...u,
|
|
2704
2785
|
children: [
|
|
2705
2786
|
/* @__PURE__ */ v("div", {
|
|
2706
|
-
className:
|
|
2787
|
+
className: un.head,
|
|
2707
2788
|
children: [/* @__PURE__ */ _("p", {
|
|
2708
|
-
className:
|
|
2789
|
+
className: un.title,
|
|
2709
2790
|
id: p,
|
|
2710
2791
|
children: e
|
|
2711
2792
|
}), t && /* @__PURE__ */ _("p", {
|
|
2712
|
-
className:
|
|
2793
|
+
className: un.description,
|
|
2713
2794
|
children: t
|
|
2714
2795
|
})]
|
|
2715
2796
|
}),
|
|
2716
2797
|
n && /* @__PURE__ */ _("div", {
|
|
2717
|
-
className:
|
|
2798
|
+
className: un.subject,
|
|
2718
2799
|
children: n
|
|
2719
2800
|
}),
|
|
2720
2801
|
m ? /* @__PURE__ */ v("p", {
|
|
2721
|
-
className:
|
|
2802
|
+
className: un.settled,
|
|
2722
2803
|
"data-decision": r,
|
|
2723
2804
|
children: [_(r === "denied" ? we : j, {
|
|
2724
2805
|
size: 13,
|
|
2725
2806
|
"aria-hidden": !0
|
|
2726
|
-
}), d[
|
|
2807
|
+
}), d[fn[r]]]
|
|
2727
2808
|
}) : !a && /* @__PURE__ */ v("div", {
|
|
2728
|
-
className:
|
|
2809
|
+
className: un.actions,
|
|
2729
2810
|
children: [
|
|
2730
2811
|
f("deny") && /* @__PURE__ */ _(V, {
|
|
2812
|
+
"data-ick-role": "approval-deny",
|
|
2731
2813
|
variant: "ghost",
|
|
2732
2814
|
size: "m",
|
|
2733
|
-
className:
|
|
2815
|
+
className: un.deny,
|
|
2734
2816
|
onClick: () => i?.("denied"),
|
|
2735
2817
|
children: d.deny
|
|
2736
2818
|
}),
|
|
2737
2819
|
f("always") && /* @__PURE__ */ _(V, {
|
|
2738
2820
|
variant: "outline",
|
|
2739
2821
|
size: "m",
|
|
2822
|
+
"data-ick-role": "approval-always",
|
|
2740
2823
|
onClick: () => i?.("always"),
|
|
2741
2824
|
children: d.always
|
|
2742
2825
|
}),
|
|
2743
2826
|
f("once") && /* @__PURE__ */ _(V, {
|
|
2744
2827
|
variant: "primary",
|
|
2745
2828
|
size: "m",
|
|
2829
|
+
"data-ick-role": "approval-once",
|
|
2746
2830
|
onClick: () => i?.("once"),
|
|
2747
2831
|
children: d.once
|
|
2748
2832
|
})
|
|
@@ -2751,7 +2835,7 @@ function fn({ title: e, description: t, children: n, decision: r = null, onDecid
|
|
|
2751
2835
|
]
|
|
2752
2836
|
});
|
|
2753
2837
|
}
|
|
2754
|
-
var
|
|
2838
|
+
var mn = {
|
|
2755
2839
|
tasks: "ick-tasks-2ToX",
|
|
2756
2840
|
list: "ick-list-D8wS",
|
|
2757
2841
|
item: "ick-item-QsIm",
|
|
@@ -2762,33 +2846,33 @@ var pn = {
|
|
|
2762
2846
|
};
|
|
2763
2847
|
//#endregion
|
|
2764
2848
|
//#region src/TaskList/TaskList.tsx
|
|
2765
|
-
function
|
|
2766
|
-
let u = H("tasks", o), d = l(), f =
|
|
2849
|
+
function hn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2850
|
+
let u = H("tasks", o), d = l(), f = G(), p = e.filter((e) => (e.state ?? "pending") === "done").length, m = Pt({
|
|
2767
2851
|
open: r,
|
|
2768
2852
|
defaultOpen: i,
|
|
2769
2853
|
onOpenChange: a,
|
|
2770
2854
|
preferOpen: !(e.length > 0 && p === e.length)
|
|
2771
2855
|
}), h = !n || m.isOpen, g = u.progress.replace("{done}", String(p)).replace("{total}", String(e.length));
|
|
2772
2856
|
return /* @__PURE__ */ v("section", {
|
|
2773
|
-
className: [
|
|
2857
|
+
className: [mn.tasks, s ?? ""].filter(Boolean).join(" "),
|
|
2774
2858
|
...c,
|
|
2775
|
-
children: [t && /* @__PURE__ */ _(
|
|
2859
|
+
children: [t && /* @__PURE__ */ _(Lt, {
|
|
2776
2860
|
open: h,
|
|
2777
2861
|
onToggle: n ? m.toggle : void 0,
|
|
2778
2862
|
controls: d,
|
|
2779
2863
|
label: t,
|
|
2780
2864
|
meta: g
|
|
2781
|
-
}), /* @__PURE__ */ _(
|
|
2865
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2782
2866
|
id: d,
|
|
2783
2867
|
open: h,
|
|
2784
2868
|
children: /* @__PURE__ */ _("ol", {
|
|
2785
|
-
className:
|
|
2869
|
+
className: mn.list,
|
|
2786
2870
|
children: /* @__PURE__ */ _(y, {
|
|
2787
2871
|
initial: !1,
|
|
2788
2872
|
children: e.map((e) => {
|
|
2789
2873
|
let t = e.state ?? "pending";
|
|
2790
2874
|
return /* @__PURE__ */ v(C.li, {
|
|
2791
|
-
className:
|
|
2875
|
+
className: mn.item,
|
|
2792
2876
|
"data-state": t,
|
|
2793
2877
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2794
2878
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2804,19 +2888,19 @@ function mn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2804
2888
|
y: -4
|
|
2805
2889
|
},
|
|
2806
2890
|
transition: { duration: f ? .12 : .2 },
|
|
2807
|
-
children: [/* @__PURE__ */ _(
|
|
2808
|
-
className:
|
|
2891
|
+
children: [/* @__PURE__ */ _(an, { state: t }), /* @__PURE__ */ v("span", {
|
|
2892
|
+
className: mn.body,
|
|
2809
2893
|
children: [
|
|
2810
2894
|
/* @__PURE__ */ _("span", {
|
|
2811
|
-
className:
|
|
2895
|
+
className: mn.label,
|
|
2812
2896
|
children: e.label
|
|
2813
2897
|
}),
|
|
2814
2898
|
/* @__PURE__ */ _("span", {
|
|
2815
|
-
className:
|
|
2899
|
+
className: mn.srOnly,
|
|
2816
2900
|
children: u[t]
|
|
2817
2901
|
}),
|
|
2818
2902
|
e.detail && /* @__PURE__ */ _("span", {
|
|
2819
|
-
className:
|
|
2903
|
+
className: mn.detail,
|
|
2820
2904
|
children: e.detail
|
|
2821
2905
|
})
|
|
2822
2906
|
]
|
|
@@ -2828,7 +2912,7 @@ function mn({ tasks: e, title: t, collapsible: n = !1, open: r, defaultOpen: i,
|
|
|
2828
2912
|
})]
|
|
2829
2913
|
});
|
|
2830
2914
|
}
|
|
2831
|
-
var
|
|
2915
|
+
var gn = {
|
|
2832
2916
|
chain: "ick-chain-NGeh",
|
|
2833
2917
|
list: "ick-list-B2Pj",
|
|
2834
2918
|
step: "ick-step--tPX",
|
|
@@ -2839,37 +2923,37 @@ var hn = {
|
|
|
2839
2923
|
};
|
|
2840
2924
|
//#endregion
|
|
2841
2925
|
//#region src/ChainOfThought/ChainOfThought.tsx
|
|
2842
|
-
function
|
|
2843
|
-
let u = H("chain", o), d = l(), f =
|
|
2926
|
+
function _n({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i, onOpenChange: a, labels: o, className: s, ...c }) {
|
|
2927
|
+
let u = H("chain", o), d = l(), f = G(), p = t === "thinking", { isOpen: m, toggle: h } = Pt({
|
|
2844
2928
|
open: r,
|
|
2845
2929
|
defaultOpen: i,
|
|
2846
2930
|
onOpenChange: a,
|
|
2847
2931
|
preferOpen: p
|
|
2848
|
-
}), g = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" :
|
|
2932
|
+
}), g = p ? e.find((e) => (e.state ?? "done") === "running") ?? e[e.length - 1] : void 0, b = p ? "" : Bt(n ?? NaN), x = `${u.through} ${e.length} ${e.length === 1 ? u.step : u.steps}`;
|
|
2849
2933
|
return /* @__PURE__ */ v("section", {
|
|
2850
|
-
className: [
|
|
2934
|
+
className: [gn.chain, s ?? ""].filter(Boolean).join(" "),
|
|
2851
2935
|
"data-state": t,
|
|
2852
2936
|
...c,
|
|
2853
|
-
children: [/* @__PURE__ */ _(
|
|
2937
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2854
2938
|
fit: "inline",
|
|
2855
2939
|
open: m,
|
|
2856
2940
|
onToggle: h,
|
|
2857
2941
|
controls: d,
|
|
2858
|
-
glyph: /* @__PURE__ */ _(
|
|
2942
|
+
glyph: /* @__PURE__ */ _(an, { state: p ? "running" : "done" }),
|
|
2859
2943
|
label: p ? g?.label ?? u.thinking : x,
|
|
2860
2944
|
pending: p,
|
|
2861
2945
|
meta: b || void 0
|
|
2862
|
-
}), /* @__PURE__ */ _(
|
|
2946
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2863
2947
|
id: d,
|
|
2864
2948
|
open: m && e.length > 0,
|
|
2865
2949
|
children: /* @__PURE__ */ _("ol", {
|
|
2866
|
-
className:
|
|
2950
|
+
className: gn.list,
|
|
2867
2951
|
children: /* @__PURE__ */ _(y, {
|
|
2868
2952
|
initial: !1,
|
|
2869
2953
|
children: e.map((e) => {
|
|
2870
2954
|
let t = e.state ?? "done";
|
|
2871
2955
|
return /* @__PURE__ */ v(C.li, {
|
|
2872
|
-
className:
|
|
2956
|
+
className: gn.step,
|
|
2873
2957
|
"data-state": t,
|
|
2874
2958
|
"aria-current": t === "running" ? "step" : void 0,
|
|
2875
2959
|
initial: f ? { opacity: 0 } : {
|
|
@@ -2886,16 +2970,16 @@ function gn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2886
2970
|
},
|
|
2887
2971
|
transition: { duration: f ? .12 : .2 },
|
|
2888
2972
|
children: [/* @__PURE__ */ _("span", {
|
|
2889
|
-
className:
|
|
2973
|
+
className: gn.rail,
|
|
2890
2974
|
"aria-hidden": !0,
|
|
2891
|
-
children: /* @__PURE__ */ _(
|
|
2975
|
+
children: /* @__PURE__ */ _(an, { state: t })
|
|
2892
2976
|
}), /* @__PURE__ */ v("span", {
|
|
2893
|
-
className:
|
|
2977
|
+
className: gn.body,
|
|
2894
2978
|
children: [/* @__PURE__ */ _("span", {
|
|
2895
|
-
className:
|
|
2979
|
+
className: gn.stepLabel,
|
|
2896
2980
|
children: e.label
|
|
2897
2981
|
}), e.body && /* @__PURE__ */ _("span", {
|
|
2898
|
-
className:
|
|
2982
|
+
className: gn.working,
|
|
2899
2983
|
children: e.body
|
|
2900
2984
|
})]
|
|
2901
2985
|
})]
|
|
@@ -2906,7 +2990,7 @@ function gn({ steps: e, state: t = "done", duration: n, open: r, defaultOpen: i,
|
|
|
2906
2990
|
})]
|
|
2907
2991
|
});
|
|
2908
2992
|
}
|
|
2909
|
-
var
|
|
2993
|
+
var vn = {
|
|
2910
2994
|
sources: "ick-sources-w6ma",
|
|
2911
2995
|
list: "ick-list-UdKr",
|
|
2912
2996
|
item: "ick-item-zBLs",
|
|
@@ -2919,55 +3003,55 @@ var _n = {
|
|
|
2919
3003
|
};
|
|
2920
3004
|
//#endregion
|
|
2921
3005
|
//#region src/Sources/Sources.tsx
|
|
2922
|
-
function
|
|
2923
|
-
let f = H("sources", c), p = l(), m =
|
|
3006
|
+
function yn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onSelect: i, open: a, defaultOpen: o, onOpenChange: s, labels: c, className: u, ...d }) {
|
|
3007
|
+
let f = H("sources", c), p = l(), m = Pt({
|
|
2924
3008
|
open: a,
|
|
2925
3009
|
defaultOpen: o,
|
|
2926
3010
|
onOpenChange: s,
|
|
2927
3011
|
preferOpen: !0
|
|
2928
3012
|
}), h = !n || m.isOpen, y = `${e.length} ${e.length === 1 ? f.one : f.many}`;
|
|
2929
3013
|
return /* @__PURE__ */ v("section", {
|
|
2930
|
-
className: [
|
|
3014
|
+
className: [vn.sources, u ?? ""].filter(Boolean).join(" "),
|
|
2931
3015
|
...d,
|
|
2932
|
-
children: [/* @__PURE__ */ _(
|
|
3016
|
+
children: [/* @__PURE__ */ _(Lt, {
|
|
2933
3017
|
open: h,
|
|
2934
3018
|
onToggle: n ? m.toggle : void 0,
|
|
2935
3019
|
controls: p,
|
|
2936
3020
|
label: t ?? f.title,
|
|
2937
3021
|
meta: y
|
|
2938
|
-
}), /* @__PURE__ */ _(
|
|
3022
|
+
}), /* @__PURE__ */ _(zt, {
|
|
2939
3023
|
id: p,
|
|
2940
3024
|
open: h && e.length > 0,
|
|
2941
3025
|
children: /* @__PURE__ */ _("ol", {
|
|
2942
|
-
className:
|
|
3026
|
+
className: vn.list,
|
|
2943
3027
|
children: e.map((e, t) => {
|
|
2944
3028
|
let n = t + 1, a = e.id === r, o = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
2945
|
-
className:
|
|
3029
|
+
className: vn.number,
|
|
2946
3030
|
"data-active": a || void 0,
|
|
2947
3031
|
children: n
|
|
2948
3032
|
}), /* @__PURE__ */ v("span", {
|
|
2949
|
-
className:
|
|
3033
|
+
className: vn.body,
|
|
2950
3034
|
children: [
|
|
2951
3035
|
/* @__PURE__ */ _("span", {
|
|
2952
|
-
className:
|
|
3036
|
+
className: vn.name,
|
|
2953
3037
|
children: e.title
|
|
2954
3038
|
}),
|
|
2955
3039
|
e.origin && /* @__PURE__ */ _("span", {
|
|
2956
|
-
className:
|
|
3040
|
+
className: vn.origin,
|
|
2957
3041
|
children: e.origin
|
|
2958
3042
|
}),
|
|
2959
3043
|
e.quote && /* @__PURE__ */ _("span", {
|
|
2960
|
-
className:
|
|
3044
|
+
className: vn.quote,
|
|
2961
3045
|
children: e.quote
|
|
2962
3046
|
})
|
|
2963
3047
|
]
|
|
2964
3048
|
})] });
|
|
2965
3049
|
return /* @__PURE__ */ _("li", {
|
|
2966
|
-
className:
|
|
3050
|
+
className: vn.item,
|
|
2967
3051
|
"data-active": a || void 0,
|
|
2968
3052
|
id: `${p}-${e.id}`,
|
|
2969
3053
|
children: e.url ? /* @__PURE__ */ _("a", {
|
|
2970
|
-
className:
|
|
3054
|
+
className: vn.entry,
|
|
2971
3055
|
href: e.url,
|
|
2972
3056
|
target: "_blank",
|
|
2973
3057
|
rel: "noreferrer noopener",
|
|
@@ -2975,7 +3059,7 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2975
3059
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2976
3060
|
children: o
|
|
2977
3061
|
}) : /* @__PURE__ */ _("div", {
|
|
2978
|
-
className:
|
|
3062
|
+
className: vn.entry,
|
|
2979
3063
|
children: o
|
|
2980
3064
|
})
|
|
2981
3065
|
}, e.id);
|
|
@@ -2984,13 +3068,13 @@ function vn({ sources: e, title: t, collapsible: n = !1, activeId: r = null, onS
|
|
|
2984
3068
|
})]
|
|
2985
3069
|
});
|
|
2986
3070
|
}
|
|
2987
|
-
var
|
|
3071
|
+
var bn = { chip: "ick-chip-FJNL" };
|
|
2988
3072
|
//#endregion
|
|
2989
3073
|
//#region src/Chip/Chip.tsx
|
|
2990
|
-
function
|
|
2991
|
-
let n =
|
|
3074
|
+
function xn({ children: e, className: t }) {
|
|
3075
|
+
let n = G();
|
|
2992
3076
|
return /* @__PURE__ */ _(C.span, {
|
|
2993
|
-
className: [
|
|
3077
|
+
className: [bn.chip, t ?? ""].filter(Boolean).join(" "),
|
|
2994
3078
|
initial: n ? { opacity: 0 } : {
|
|
2995
3079
|
opacity: 0,
|
|
2996
3080
|
scale: .85
|
|
@@ -3035,7 +3119,7 @@ var X = {
|
|
|
3035
3119
|
fieldLabel: "ick-fieldLabel--DkK",
|
|
3036
3120
|
fieldInput: "ick-fieldInput-Er9C",
|
|
3037
3121
|
shellCard: "ick-shellCard-pBK9"
|
|
3038
|
-
},
|
|
3122
|
+
}, Sn = r(function({ children: e, selected: t, onCard: n, className: r, ...i }, a) {
|
|
3039
3123
|
return /* @__PURE__ */ _("span", {
|
|
3040
3124
|
ref: a,
|
|
3041
3125
|
className: [X.badge, r ?? ""].filter(Boolean).join(" "),
|
|
@@ -3045,8 +3129,8 @@ var X = {
|
|
|
3045
3129
|
...i,
|
|
3046
3130
|
children: e
|
|
3047
3131
|
});
|
|
3048
|
-
}),
|
|
3049
|
-
let s =
|
|
3132
|
+
}), Cn = r(function({ letter: e, title: t, description: n, selected: r = !1, className: i, ...a }, o) {
|
|
3133
|
+
let s = G();
|
|
3050
3134
|
return /* @__PURE__ */ v(C.button, {
|
|
3051
3135
|
ref: o,
|
|
3052
3136
|
type: "button",
|
|
@@ -3055,7 +3139,7 @@ var X = {
|
|
|
3055
3139
|
"aria-pressed": r,
|
|
3056
3140
|
whileTap: s ? void 0 : { scale: .99 },
|
|
3057
3141
|
...a,
|
|
3058
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3142
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3059
3143
|
selected: r,
|
|
3060
3144
|
children: e
|
|
3061
3145
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -3069,13 +3153,13 @@ var X = {
|
|
|
3069
3153
|
})]
|
|
3070
3154
|
})]
|
|
3071
3155
|
});
|
|
3072
|
-
}),
|
|
3156
|
+
}), wn = r(function({ letter: e, label: t, value: n, onChange: r, onEnter: i, className: a, id: o, onFocus: s, onBlur: c, onKeyDown: u, ...d }, f) {
|
|
3073
3157
|
let [p, h] = m(!1), g = l(), y = o ?? g;
|
|
3074
3158
|
return /* @__PURE__ */ v("label", {
|
|
3075
3159
|
className: [X.field, a ?? ""].filter(Boolean).join(" "),
|
|
3076
3160
|
"data-focused": p || void 0,
|
|
3077
3161
|
htmlFor: y,
|
|
3078
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3162
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3079
3163
|
selected: p,
|
|
3080
3164
|
children: e
|
|
3081
3165
|
}), /* @__PURE__ */ v("span", {
|
|
@@ -3103,13 +3187,13 @@ var X = {
|
|
|
3103
3187
|
})]
|
|
3104
3188
|
})]
|
|
3105
3189
|
});
|
|
3106
|
-
}),
|
|
3190
|
+
}), Tn = r(function({ letter: e, value: t, placeholder: n, onChange: r, onEnter: i, className: a, onKeyDown: o, ...s }, c) {
|
|
3107
3191
|
let l = t.trim().length > 0;
|
|
3108
3192
|
return /* @__PURE__ */ v("label", {
|
|
3109
3193
|
className: [X.option, a ?? ""].filter(Boolean).join(" "),
|
|
3110
3194
|
"data-selected": l || void 0,
|
|
3111
3195
|
"data-other": "",
|
|
3112
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3196
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3113
3197
|
selected: l,
|
|
3114
3198
|
children: e
|
|
3115
3199
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -3129,7 +3213,7 @@ var X = {
|
|
|
3129
3213
|
})
|
|
3130
3214
|
})]
|
|
3131
3215
|
});
|
|
3132
|
-
}),
|
|
3216
|
+
}), En = r(function({ number: e, title: t, subtitle: n, children: r, footer: i, card: a = !0, className: o, ...s }, c) {
|
|
3133
3217
|
return /* @__PURE__ */ v("div", {
|
|
3134
3218
|
ref: c,
|
|
3135
3219
|
className: [
|
|
@@ -3141,7 +3225,7 @@ var X = {
|
|
|
3141
3225
|
children: [
|
|
3142
3226
|
/* @__PURE__ */ v("div", {
|
|
3143
3227
|
className: X.header,
|
|
3144
|
-
children: [e !== void 0 && /* @__PURE__ */ _(
|
|
3228
|
+
children: [e !== void 0 && /* @__PURE__ */ _(Sn, {
|
|
3145
3229
|
selected: !0,
|
|
3146
3230
|
children: e
|
|
3147
3231
|
}), /* @__PURE__ */ v("div", {
|
|
@@ -3168,7 +3252,7 @@ var X = {
|
|
|
3168
3252
|
});
|
|
3169
3253
|
//#endregion
|
|
3170
3254
|
//#region src/radiusCorrection/useCorrectedRadius.ts
|
|
3171
|
-
function
|
|
3255
|
+
function Dn(e) {
|
|
3172
3256
|
let [t, n] = m(void 0);
|
|
3173
3257
|
return d(() => {
|
|
3174
3258
|
let t = e.current;
|
|
@@ -3179,12 +3263,12 @@ function En(e) {
|
|
|
3179
3263
|
}
|
|
3180
3264
|
//#endregion
|
|
3181
3265
|
//#region src/QuestionCard/QuestionCard.tsx
|
|
3182
|
-
var
|
|
3266
|
+
var On = {
|
|
3183
3267
|
type: "spring",
|
|
3184
3268
|
stiffness: 260,
|
|
3185
3269
|
damping: 30
|
|
3186
|
-
},
|
|
3187
|
-
function
|
|
3270
|
+
}, kn = (e, t) => Array.from(t)[e] ?? String(e + 1), An = 300, jn = 380;
|
|
3271
|
+
function Mn(e, t) {
|
|
3188
3272
|
if (!t) return [];
|
|
3189
3273
|
if (e.type === "inputs" && "values" in t) {
|
|
3190
3274
|
let n = e.fields.map((e) => t.values?.[e.id]).filter(Boolean);
|
|
@@ -3202,11 +3286,11 @@ function jn(e, t) {
|
|
|
3202
3286
|
}
|
|
3203
3287
|
return [];
|
|
3204
3288
|
}
|
|
3205
|
-
function
|
|
3289
|
+
function Nn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
3206
3290
|
let [a, o] = m(() => n && "values" in n ? { ...n.values } : {}), [s, l] = m(() => n && "optionIds" in n ? [...n.optionIds ?? []] : []), [u, d] = m(() => n && "optionIds" in n ? n.other ?? "" : ""), [h, g] = m(n && "optionId" in n ? n.optionId : null), y = p(null), b = f(() => e.type === "inputs" ? e.fields.map(() => ({ current: null })) : [], [e]);
|
|
3207
3291
|
c(() => {
|
|
3208
3292
|
if (e.type !== "inputs") return;
|
|
3209
|
-
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }),
|
|
3293
|
+
let t = setTimeout(() => y.current?.focus({ preventScroll: !0 }), G() ? 0 : jn);
|
|
3210
3294
|
return () => clearTimeout(t);
|
|
3211
3295
|
}, [e.type]);
|
|
3212
3296
|
let x = f(() => e.type !== "inputs" || e.fields.every((e) => e.optional || (a[e.id] ?? "").trim()), [e, a]), S = {
|
|
@@ -3217,17 +3301,18 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3217
3301
|
};
|
|
3218
3302
|
if (e.type === "inputs") {
|
|
3219
3303
|
let t = () => x && r?.({ values: a });
|
|
3220
|
-
return /* @__PURE__ */ _(
|
|
3304
|
+
return /* @__PURE__ */ _(En, {
|
|
3221
3305
|
...S,
|
|
3222
3306
|
footer: /* @__PURE__ */ _(V, {
|
|
3223
3307
|
variant: "secondary",
|
|
3224
3308
|
size: "m",
|
|
3309
|
+
"data-ick-role": "question-next",
|
|
3225
3310
|
disabled: !x,
|
|
3226
3311
|
onClick: t,
|
|
3227
3312
|
children: i.next
|
|
3228
3313
|
}),
|
|
3229
|
-
children: e.fields.map((e, n) => /* @__PURE__ */ _(
|
|
3230
|
-
letter:
|
|
3314
|
+
children: e.fields.map((e, n) => /* @__PURE__ */ _(wn, {
|
|
3315
|
+
letter: kn(n, i.letters),
|
|
3231
3316
|
label: e.label,
|
|
3232
3317
|
placeholder: e.placeholder,
|
|
3233
3318
|
value: a[e.id] ?? "",
|
|
@@ -3243,15 +3328,15 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3243
3328
|
}, e.id))
|
|
3244
3329
|
});
|
|
3245
3330
|
}
|
|
3246
|
-
if (e.type === "single") return /* @__PURE__ */ _(
|
|
3331
|
+
if (e.type === "single") return /* @__PURE__ */ _(En, {
|
|
3247
3332
|
...S,
|
|
3248
|
-
children: e.options.map((e, t) => /* @__PURE__ */ _(
|
|
3249
|
-
letter:
|
|
3333
|
+
children: e.options.map((e, t) => /* @__PURE__ */ _(Cn, {
|
|
3334
|
+
letter: kn(t, i.letters),
|
|
3250
3335
|
title: e.title,
|
|
3251
3336
|
description: e.description,
|
|
3252
3337
|
selected: h === e.id,
|
|
3253
3338
|
onClick: () => {
|
|
3254
|
-
g(e.id), setTimeout(() => r?.({ optionId: e.id }),
|
|
3339
|
+
g(e.id), setTimeout(() => r?.({ optionId: e.id }), An);
|
|
3255
3340
|
}
|
|
3256
3341
|
}, e.id))
|
|
3257
3342
|
});
|
|
@@ -3261,23 +3346,24 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3261
3346
|
...C ? { other: C } : {}
|
|
3262
3347
|
});
|
|
3263
3348
|
};
|
|
3264
|
-
return /* @__PURE__ */ v(
|
|
3349
|
+
return /* @__PURE__ */ v(En, {
|
|
3265
3350
|
...S,
|
|
3266
3351
|
footer: /* @__PURE__ */ _(V, {
|
|
3352
|
+
"data-ick-role": "question-next",
|
|
3267
3353
|
variant: "secondary",
|
|
3268
3354
|
size: "m",
|
|
3269
3355
|
disabled: !e.allowEmpty && w,
|
|
3270
3356
|
onClick: T,
|
|
3271
3357
|
children: e.allowEmpty && w ? i.none : i.next
|
|
3272
3358
|
}),
|
|
3273
|
-
children: [e.options.map((e, t) => /* @__PURE__ */ _(
|
|
3274
|
-
letter:
|
|
3359
|
+
children: [e.options.map((e, t) => /* @__PURE__ */ _(Cn, {
|
|
3360
|
+
letter: kn(t, i.letters),
|
|
3275
3361
|
title: e.title,
|
|
3276
3362
|
description: e.description,
|
|
3277
3363
|
selected: s.includes(e.id),
|
|
3278
3364
|
onClick: () => l((t) => t.includes(e.id) ? t.filter((t) => t !== e.id) : [...t, e.id])
|
|
3279
|
-
}, e.id)), e.allowOther && /* @__PURE__ */ _(
|
|
3280
|
-
letter:
|
|
3365
|
+
}, e.id)), e.allowOther && /* @__PURE__ */ _(Tn, {
|
|
3366
|
+
letter: kn(e.options.length, i.letters),
|
|
3281
3367
|
value: u,
|
|
3282
3368
|
placeholder: e.otherPlaceholder ?? i.other,
|
|
3283
3369
|
onChange: d,
|
|
@@ -3285,9 +3371,9 @@ function Mn({ question: e, number: t, answer: n, onCommit: r, labels: i }) {
|
|
|
3285
3371
|
})]
|
|
3286
3372
|
});
|
|
3287
3373
|
}
|
|
3288
|
-
function
|
|
3289
|
-
let c = H("question", s), l = n !== "upcoming", u =
|
|
3290
|
-
if (n === "active") m = /* @__PURE__ */ _(
|
|
3374
|
+
function Pn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit: a, readOnly: o = !1, labels: s }) {
|
|
3375
|
+
let c = H("question", s), l = n !== "upcoming", u = G(), d = p(null), f = Dn(d), m;
|
|
3376
|
+
if (n === "active") m = /* @__PURE__ */ _(Nn, {
|
|
3291
3377
|
question: e,
|
|
3292
3378
|
number: t,
|
|
3293
3379
|
answer: r,
|
|
@@ -3295,9 +3381,9 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3295
3381
|
labels: c
|
|
3296
3382
|
});
|
|
3297
3383
|
else if (n === "collapsed") {
|
|
3298
|
-
let n =
|
|
3384
|
+
let n = Mn(e, r), i = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("span", {
|
|
3299
3385
|
className: X.collapsedLabel,
|
|
3300
|
-
children: [/* @__PURE__ */ _(
|
|
3386
|
+
children: [/* @__PURE__ */ _(Sn, {
|
|
3301
3387
|
onCard: !0,
|
|
3302
3388
|
children: t
|
|
3303
3389
|
}), /* @__PURE__ */ _("span", {
|
|
@@ -3306,7 +3392,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3306
3392
|
})]
|
|
3307
3393
|
}), /* @__PURE__ */ v("span", {
|
|
3308
3394
|
className: X.collapsedAnswer,
|
|
3309
|
-
children: [n.map((e, t) => /* @__PURE__ */ _(
|
|
3395
|
+
children: [n.map((e, t) => /* @__PURE__ */ _(xn, { children: e }, `${e}-${t}`)), !o && /* @__PURE__ */ _(fe, {
|
|
3310
3396
|
className: X.pencil,
|
|
3311
3397
|
size: 14,
|
|
3312
3398
|
"aria-hidden": !0
|
|
@@ -3324,7 +3410,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3324
3410
|
});
|
|
3325
3411
|
} else m = /* @__PURE__ */ v("div", {
|
|
3326
3412
|
className: X.upcoming,
|
|
3327
|
-
children: [/* @__PURE__ */ _(
|
|
3413
|
+
children: [/* @__PURE__ */ _(Sn, { children: t }), /* @__PURE__ */ _("span", {
|
|
3328
3414
|
className: X.upcomingLabel,
|
|
3329
3415
|
children: e.shortTitle
|
|
3330
3416
|
})]
|
|
@@ -3335,7 +3421,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3335
3421
|
"data-active": n === "active" || void 0,
|
|
3336
3422
|
className: X.item,
|
|
3337
3423
|
"data-card": l || void 0,
|
|
3338
|
-
transition: { layout:
|
|
3424
|
+
transition: { layout: On },
|
|
3339
3425
|
style: { borderRadius: f },
|
|
3340
3426
|
children: /* @__PURE__ */ _(y, {
|
|
3341
3427
|
mode: "popLayout",
|
|
@@ -3359,7 +3445,7 @@ function Nn({ question: e, number: t, state: n, answer: r, onCommit: i, onEdit:
|
|
|
3359
3445
|
})
|
|
3360
3446
|
});
|
|
3361
3447
|
}
|
|
3362
|
-
var
|
|
3448
|
+
var Fn = {
|
|
3363
3449
|
group: "ick-group-pPcU",
|
|
3364
3450
|
body: "ick-body-lHD3",
|
|
3365
3451
|
list: "ick-list-7cp2",
|
|
@@ -3367,7 +3453,7 @@ var Pn = {
|
|
|
3367
3453
|
summary: "ick-summary-eb2t",
|
|
3368
3454
|
count: "ick-count-eHDc",
|
|
3369
3455
|
summaryList: "ick-summaryList-2sOL"
|
|
3370
|
-
},
|
|
3456
|
+
}, In = 3, Ln = {
|
|
3371
3457
|
visualDuration: .34,
|
|
3372
3458
|
bounce: .1,
|
|
3373
3459
|
rowDuration: .3,
|
|
@@ -3378,18 +3464,18 @@ var Pn = {
|
|
|
3378
3464
|
fadeOut: .08,
|
|
3379
3465
|
fadeInDelay: .08
|
|
3380
3466
|
};
|
|
3381
|
-
function
|
|
3382
|
-
let [h, g] = m(!1), [x, S] = m(!1), w = l(), T = p(null), E =
|
|
3383
|
-
...
|
|
3467
|
+
function Rn({ id: e, title: t, questions: n, answers: r, activeIndex: i = null, collapsible: a = !1, onCommit: o, onEdit: s, readOnly: c = !1, labels: u, foldMotion: d, className: f }) {
|
|
3468
|
+
let [h, g] = m(!1), [x, S] = m(!1), w = l(), T = p(null), E = Dn(T), D = H("questionGroup", u), O = G(), k = a && !h, A = n.map((e) => e.shortTitle).join(" · "), j = {
|
|
3469
|
+
...Ln,
|
|
3384
3470
|
...d
|
|
3385
3471
|
}, M = O ? { duration: 0 } : {
|
|
3386
3472
|
type: "spring",
|
|
3387
3473
|
visualDuration: j.visualDuration,
|
|
3388
3474
|
bounce: j.bounce
|
|
3389
|
-
},
|
|
3475
|
+
}, N = {
|
|
3390
3476
|
hidden: { transition: { staggerChildren: O ? 0 : j.stagger } },
|
|
3391
3477
|
shown: { transition: { staggerChildren: O ? 0 : j.stagger } }
|
|
3392
|
-
},
|
|
3478
|
+
}, ee = (e, t = 0) => O ? { duration: 0 } : {
|
|
3393
3479
|
type: "spring",
|
|
3394
3480
|
visualDuration: j.rowDuration,
|
|
3395
3481
|
bounce: j.rowBounce,
|
|
@@ -3398,19 +3484,19 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3398
3484
|
duration: e,
|
|
3399
3485
|
delay: t
|
|
3400
3486
|
}
|
|
3401
|
-
},
|
|
3487
|
+
}, te = {
|
|
3402
3488
|
hidden: {
|
|
3403
3489
|
opacity: 0,
|
|
3404
3490
|
y: O ? 0 : j.rowOffset,
|
|
3405
|
-
transition:
|
|
3491
|
+
transition: ee(j.fadeOut)
|
|
3406
3492
|
},
|
|
3407
3493
|
shown: {
|
|
3408
3494
|
opacity: 1,
|
|
3409
3495
|
y: 0,
|
|
3410
|
-
transition:
|
|
3496
|
+
transition: ee(j.fadeIn, O ? 0 : j.fadeInDelay)
|
|
3411
3497
|
}
|
|
3412
3498
|
}, P = {
|
|
3413
|
-
variants:
|
|
3499
|
+
variants: N,
|
|
3414
3500
|
initial: "hidden",
|
|
3415
3501
|
animate: "shown",
|
|
3416
3502
|
exit: "hidden",
|
|
@@ -3424,13 +3510,13 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3424
3510
|
ref: T,
|
|
3425
3511
|
layout: !O,
|
|
3426
3512
|
transition: M,
|
|
3427
|
-
className: [
|
|
3513
|
+
className: [Fn.group, f ?? ""].filter(Boolean).join(" "),
|
|
3428
3514
|
"data-moving": x || void 0,
|
|
3429
3515
|
style: { borderRadius: E },
|
|
3430
3516
|
children: [(t || a) && /* @__PURE__ */ _(C.div, {
|
|
3431
3517
|
layout: !O && "position",
|
|
3432
3518
|
transition: M,
|
|
3433
|
-
children: /* @__PURE__ */ _(
|
|
3519
|
+
children: /* @__PURE__ */ _(Lt, {
|
|
3434
3520
|
open: !k,
|
|
3435
3521
|
onToggle: a ? () => {
|
|
3436
3522
|
S(!0), g((e) => !e);
|
|
@@ -3442,34 +3528,34 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3442
3528
|
id: w,
|
|
3443
3529
|
layout: !O && "position",
|
|
3444
3530
|
transition: M,
|
|
3445
|
-
className:
|
|
3531
|
+
className: Fn.body,
|
|
3446
3532
|
children: /* @__PURE__ */ _(y, {
|
|
3447
3533
|
initial: !1,
|
|
3448
3534
|
mode: "popLayout",
|
|
3449
3535
|
children: k ? /* @__PURE__ */ _(C.div, {
|
|
3450
3536
|
...P,
|
|
3451
3537
|
children: /* @__PURE__ */ v(C.div, {
|
|
3452
|
-
variants:
|
|
3453
|
-
className:
|
|
3538
|
+
variants: te,
|
|
3539
|
+
className: Fn.summary,
|
|
3454
3540
|
children: [/* @__PURE__ */ v("span", {
|
|
3455
|
-
className:
|
|
3541
|
+
className: Fn.count,
|
|
3456
3542
|
children: [
|
|
3457
3543
|
n.length,
|
|
3458
3544
|
" ",
|
|
3459
3545
|
D.answers
|
|
3460
3546
|
]
|
|
3461
3547
|
}), /* @__PURE__ */ _("span", {
|
|
3462
|
-
className:
|
|
3548
|
+
className: Fn.summaryList,
|
|
3463
3549
|
children: A
|
|
3464
3550
|
})]
|
|
3465
3551
|
})
|
|
3466
3552
|
}, "summary") : /* @__PURE__ */ _(C.div, {
|
|
3467
|
-
className:
|
|
3553
|
+
className: Fn.list,
|
|
3468
3554
|
...P,
|
|
3469
3555
|
children: n.map((e, t) => /* @__PURE__ */ _(C.div, {
|
|
3470
|
-
variants:
|
|
3471
|
-
className:
|
|
3472
|
-
children: /* @__PURE__ */ _(
|
|
3556
|
+
variants: te,
|
|
3557
|
+
className: Fn.row,
|
|
3558
|
+
children: /* @__PURE__ */ _(Pn, {
|
|
3473
3559
|
question: e,
|
|
3474
3560
|
number: t + 1,
|
|
3475
3561
|
state: t === i ? "active" : r[e.id] ? "collapsed" : "upcoming",
|
|
@@ -3485,59 +3571,60 @@ function Ln({ id: e, title: t, questions: n, answers: r, activeIndex: i = null,
|
|
|
3485
3571
|
})
|
|
3486
3572
|
});
|
|
3487
3573
|
}
|
|
3488
|
-
var
|
|
3574
|
+
var zn = { message: "ick-message-wTar" };
|
|
3489
3575
|
//#endregion
|
|
3490
3576
|
//#region src/SystemMessage/SystemMessage.tsx
|
|
3491
|
-
function
|
|
3577
|
+
function Bn({ children: e, tone: t = "notice", className: n, ...r }) {
|
|
3492
3578
|
return /* @__PURE__ */ _("div", {
|
|
3493
|
-
className: [
|
|
3579
|
+
className: [zn.message, n ?? ""].filter(Boolean).join(" "),
|
|
3494
3580
|
"data-tone": t,
|
|
3495
3581
|
...r,
|
|
3496
3582
|
children: e
|
|
3497
3583
|
});
|
|
3498
3584
|
}
|
|
3499
|
-
var
|
|
3585
|
+
var Vn = {
|
|
3500
3586
|
artifact: "ick-artifact-rz53",
|
|
3501
3587
|
card: "ick-card-iGYJ",
|
|
3502
3588
|
head: "ick-head-XVNm",
|
|
3503
3589
|
title: "ick-title-1JVB",
|
|
3504
3590
|
"artifact-sweep": "ick-artifact-sweep-19ol",
|
|
3505
3591
|
meta: "ick-meta-vxo7",
|
|
3592
|
+
grows: "ick-grows-v7GM",
|
|
3506
3593
|
preview: "ick-preview-jRni",
|
|
3507
3594
|
text: "ick-text-uJx8",
|
|
3508
3595
|
waiting: "ick-waiting-ADQs"
|
|
3509
|
-
},
|
|
3510
|
-
function
|
|
3596
|
+
}, Hn = 8;
|
|
3597
|
+
function Un(e, t) {
|
|
3511
3598
|
let n = e.split("\n");
|
|
3512
3599
|
return {
|
|
3513
3600
|
shown: n.slice(0, t).join("\n"),
|
|
3514
3601
|
more: n.length > t
|
|
3515
3602
|
};
|
|
3516
3603
|
}
|
|
3517
|
-
function
|
|
3518
|
-
let f = o === "writing", p = a ?
|
|
3519
|
-
className:
|
|
3604
|
+
function Wn({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, state: o = "done", lines: s = Hn, onOpen: c, open: l, className: u, ...d }) {
|
|
3605
|
+
let f = o === "writing", p = a ? Un(a, s) : null, m = /* @__PURE__ */ _(Kn, { children: /* @__PURE__ */ _("div", {
|
|
3606
|
+
className: Vn.preview,
|
|
3520
3607
|
"data-more": p?.more || void 0,
|
|
3521
3608
|
"aria-hidden": !0,
|
|
3522
3609
|
children: p === null ? /* @__PURE__ */ _("div", {
|
|
3523
|
-
className:
|
|
3524
|
-
children: /* @__PURE__ */ _(
|
|
3525
|
-
}) : r === "code" ? /* @__PURE__ */ _(
|
|
3610
|
+
className: Vn.waiting,
|
|
3611
|
+
children: /* @__PURE__ */ _(Nt, {})
|
|
3612
|
+
}) : r === "code" ? /* @__PURE__ */ _(nn, {
|
|
3526
3613
|
code: p.shown,
|
|
3527
3614
|
lang: i,
|
|
3528
3615
|
label: !1,
|
|
3529
3616
|
copyable: !1
|
|
3530
3617
|
}) : /* @__PURE__ */ _("p", {
|
|
3531
|
-
className:
|
|
3618
|
+
className: Vn.text,
|
|
3532
3619
|
children: p.shown
|
|
3533
3620
|
})
|
|
3534
|
-
}), h = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
3621
|
+
}) }), h = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(Gn, {
|
|
3535
3622
|
title: t,
|
|
3536
3623
|
meta: n,
|
|
3537
3624
|
writing: f
|
|
3538
|
-
}), m] }), y = { className:
|
|
3625
|
+
}), m] }), y = { className: Vn.card };
|
|
3539
3626
|
return /* @__PURE__ */ _("div", {
|
|
3540
|
-
className: [
|
|
3627
|
+
className: [Vn.artifact, u ?? ""].filter(Boolean).join(" "),
|
|
3541
3628
|
"data-state": o,
|
|
3542
3629
|
"data-open": l || void 0,
|
|
3543
3630
|
...d,
|
|
@@ -3553,36 +3640,62 @@ function Un({ id: e, title: t, meta: n, kind: r = "code", lang: i, content: a, s
|
|
|
3553
3640
|
})
|
|
3554
3641
|
});
|
|
3555
3642
|
}
|
|
3556
|
-
function
|
|
3643
|
+
function Gn({ title: e, meta: t, writing: n }) {
|
|
3557
3644
|
return /* @__PURE__ */ v("span", {
|
|
3558
|
-
className:
|
|
3645
|
+
className: Vn.head,
|
|
3559
3646
|
children: [/* @__PURE__ */ _("span", {
|
|
3560
|
-
className:
|
|
3647
|
+
className: Vn.title,
|
|
3561
3648
|
"data-writing": n || void 0,
|
|
3562
3649
|
children: e
|
|
3563
3650
|
}), t && /* @__PURE__ */ _("span", {
|
|
3564
|
-
className:
|
|
3651
|
+
className: Vn.meta,
|
|
3565
3652
|
children: t
|
|
3566
3653
|
})]
|
|
3567
3654
|
});
|
|
3568
3655
|
}
|
|
3656
|
+
function Kn({ children: e }) {
|
|
3657
|
+
let t = p(null), [n, r] = m("auto");
|
|
3658
|
+
return d(() => {
|
|
3659
|
+
let e = t.current;
|
|
3660
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
3661
|
+
let n = new ResizeObserver(() => r(e.offsetHeight));
|
|
3662
|
+
return n.observe(e), () => n.disconnect();
|
|
3663
|
+
}, []), /* @__PURE__ */ _(C.div, {
|
|
3664
|
+
className: Vn.grows,
|
|
3665
|
+
initial: !1,
|
|
3666
|
+
animate: { height: n },
|
|
3667
|
+
transition: {
|
|
3668
|
+
duration: G() ? 0 : .22,
|
|
3669
|
+
ease: [
|
|
3670
|
+
.32,
|
|
3671
|
+
.72,
|
|
3672
|
+
0,
|
|
3673
|
+
1
|
|
3674
|
+
]
|
|
3675
|
+
},
|
|
3676
|
+
children: /* @__PURE__ */ _("div", {
|
|
3677
|
+
ref: t,
|
|
3678
|
+
children: e
|
|
3679
|
+
})
|
|
3680
|
+
});
|
|
3681
|
+
}
|
|
3569
3682
|
//#endregion
|
|
3570
3683
|
//#region src/markdown/parse.ts
|
|
3571
|
-
var
|
|
3572
|
-
function
|
|
3684
|
+
var qn = "\\`*_{}[]()#+-.!>~|", Jn = (e) => e === void 0 || /\s/.test(e);
|
|
3685
|
+
function Yn(e, t, n, r) {
|
|
3573
3686
|
let i = e[t + n];
|
|
3574
|
-
return !(
|
|
3687
|
+
return !(Jn(i) || r === "_" && /[\w]/.test(e[t - 1] ?? ""));
|
|
3575
3688
|
}
|
|
3576
|
-
function
|
|
3689
|
+
function Xn(e, t, n, r) {
|
|
3577
3690
|
let i = e[t - 1];
|
|
3578
|
-
return !(
|
|
3691
|
+
return !(Jn(i) || r === "_" && /[\w]/.test(e[t + n] ?? ""));
|
|
3579
3692
|
}
|
|
3580
|
-
function
|
|
3693
|
+
function Zn(e, t, n) {
|
|
3581
3694
|
let r = 0;
|
|
3582
3695
|
for (; e[t + r] === n;) r++;
|
|
3583
3696
|
return r;
|
|
3584
3697
|
}
|
|
3585
|
-
function
|
|
3698
|
+
function Qn(e, t) {
|
|
3586
3699
|
let n = 0;
|
|
3587
3700
|
for (let r = t; r < e.length; r++) {
|
|
3588
3701
|
let t = e[r];
|
|
@@ -3591,7 +3704,7 @@ function Xn(e, t) {
|
|
|
3591
3704
|
continue;
|
|
3592
3705
|
}
|
|
3593
3706
|
if (t === "`") {
|
|
3594
|
-
let t =
|
|
3707
|
+
let t = Zn(e, r, "`"), n = e.indexOf("`".repeat(t), r + t);
|
|
3595
3708
|
r = n === -1 ? e.length : n + t - 1;
|
|
3596
3709
|
continue;
|
|
3597
3710
|
}
|
|
@@ -3600,7 +3713,7 @@ function Xn(e, t) {
|
|
|
3600
3713
|
}
|
|
3601
3714
|
return -1;
|
|
3602
3715
|
}
|
|
3603
|
-
function
|
|
3716
|
+
function $n(e, t) {
|
|
3604
3717
|
if (e[t] !== "(") return null;
|
|
3605
3718
|
let n = 0, r = -1;
|
|
3606
3719
|
for (let i = t; i < e.length; i++) {
|
|
@@ -3622,8 +3735,8 @@ function Zn(e, t) {
|
|
|
3622
3735
|
end: r + 1
|
|
3623
3736
|
};
|
|
3624
3737
|
}
|
|
3625
|
-
var
|
|
3626
|
-
function
|
|
3738
|
+
var er = /^<\/?[A-Za-z][A-Za-z0-9-]*(\s[^<>]*?)?\/?>|^<!--[\s\S]*?-->/;
|
|
3739
|
+
function tr(e) {
|
|
3627
3740
|
let t = [], n = "", r = () => {
|
|
3628
3741
|
n && t.push({
|
|
3629
3742
|
type: "text",
|
|
@@ -3638,7 +3751,7 @@ function $n(e) {
|
|
|
3638
3751
|
r(), t.push({ type: "break" }), i += 2;
|
|
3639
3752
|
continue;
|
|
3640
3753
|
}
|
|
3641
|
-
if (o &&
|
|
3754
|
+
if (o && qn.includes(o)) {
|
|
3642
3755
|
n += o, i += 2;
|
|
3643
3756
|
continue;
|
|
3644
3757
|
}
|
|
@@ -3651,7 +3764,7 @@ function $n(e) {
|
|
|
3651
3764
|
continue;
|
|
3652
3765
|
}
|
|
3653
3766
|
if (a === "`") {
|
|
3654
|
-
let n =
|
|
3767
|
+
let n = Zn(e, i, "`"), a = e.indexOf("`".repeat(n), i + n);
|
|
3655
3768
|
if (a !== -1 && !e.slice(i + n, a).startsWith("`")) {
|
|
3656
3769
|
r();
|
|
3657
3770
|
let o = e.slice(i + n, a);
|
|
@@ -3663,7 +3776,7 @@ function $n(e) {
|
|
|
3663
3776
|
}
|
|
3664
3777
|
}
|
|
3665
3778
|
if (a === "!" && e[i + 1] === "[") {
|
|
3666
|
-
let n =
|
|
3779
|
+
let n = Qn(e, i + 1), a = n === -1 ? null : $n(e, n + 1);
|
|
3667
3780
|
if (a) {
|
|
3668
3781
|
r(), t.push({
|
|
3669
3782
|
type: "image",
|
|
@@ -3684,13 +3797,13 @@ function $n(e) {
|
|
|
3684
3797
|
}
|
|
3685
3798
|
}
|
|
3686
3799
|
if (a === "[") {
|
|
3687
|
-
let n =
|
|
3800
|
+
let n = Qn(e, i), a = n === -1 ? null : $n(e, n + 1);
|
|
3688
3801
|
if (a) {
|
|
3689
3802
|
r(), t.push({
|
|
3690
3803
|
type: "link",
|
|
3691
3804
|
url: a.url,
|
|
3692
3805
|
...a.title ? { title: a.title } : {},
|
|
3693
|
-
children:
|
|
3806
|
+
children: tr(e.slice(i + 1, n))
|
|
3694
3807
|
}), i = a.end;
|
|
3695
3808
|
continue;
|
|
3696
3809
|
}
|
|
@@ -3700,14 +3813,14 @@ function $n(e) {
|
|
|
3700
3813
|
if (n !== -1 && n > i + 2) {
|
|
3701
3814
|
r(), t.push({
|
|
3702
3815
|
type: "delete",
|
|
3703
|
-
children:
|
|
3816
|
+
children: tr(e.slice(i + 2, n))
|
|
3704
3817
|
}), i = n + 2;
|
|
3705
3818
|
continue;
|
|
3706
3819
|
}
|
|
3707
3820
|
}
|
|
3708
3821
|
if (a === "*" || a === "_") {
|
|
3709
|
-
let n = Math.min(
|
|
3710
|
-
if (
|
|
3822
|
+
let n = Math.min(Zn(e, i, a), 2);
|
|
3823
|
+
if (Yn(e, i, n, a)) {
|
|
3711
3824
|
let o = i + n, s = -1;
|
|
3712
3825
|
for (; o < e.length;) {
|
|
3713
3826
|
if (e[o] === "\\") {
|
|
@@ -3715,8 +3828,8 @@ function $n(e) {
|
|
|
3715
3828
|
continue;
|
|
3716
3829
|
}
|
|
3717
3830
|
if (e[o] === a) {
|
|
3718
|
-
let t =
|
|
3719
|
-
if (t >= n &&
|
|
3831
|
+
let t = Zn(e, o, a);
|
|
3832
|
+
if (t >= n && Xn(e, o, n, a)) {
|
|
3720
3833
|
s = o;
|
|
3721
3834
|
break;
|
|
3722
3835
|
}
|
|
@@ -3727,7 +3840,7 @@ function $n(e) {
|
|
|
3727
3840
|
}
|
|
3728
3841
|
if (s !== -1 && s > i + n) {
|
|
3729
3842
|
r();
|
|
3730
|
-
let a =
|
|
3843
|
+
let a = tr(e.slice(i + n, s));
|
|
3731
3844
|
t.push(n === 2 ? {
|
|
3732
3845
|
type: "strong",
|
|
3733
3846
|
children: a
|
|
@@ -3740,7 +3853,7 @@ function $n(e) {
|
|
|
3740
3853
|
}
|
|
3741
3854
|
}
|
|
3742
3855
|
if (a === "<") {
|
|
3743
|
-
let n = e.slice(i).match(
|
|
3856
|
+
let n = e.slice(i).match(er);
|
|
3744
3857
|
if (n) {
|
|
3745
3858
|
r(), t.push({
|
|
3746
3859
|
type: "html",
|
|
@@ -3753,8 +3866,8 @@ function $n(e) {
|
|
|
3753
3866
|
}
|
|
3754
3867
|
return r(), t;
|
|
3755
3868
|
}
|
|
3756
|
-
var
|
|
3757
|
-
function
|
|
3869
|
+
var nr = /^ {0,3}(`{3,}|~{3,})\s*([^`\s]*)[^`]*$/, rr = /^ {0,3}(#{1,6})(?:\s+(.*?))?\s*#*\s*$/, ir = /^ {0,3}(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$/, ar = /^ {0,3}>\s?/, or = /^(\s*)([-*+])(\s+)(.*)$/, sr = /^(\s*)(\d{1,9})([.)])(\s+)(.*)$/, cr = /^ {0,3}\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/, lr = /^:?-+:?$/, ur = /^\s*$/;
|
|
3870
|
+
function dr(e) {
|
|
3758
3871
|
let t = e.trim().replace(/^\|/, "").replace(/\|$/, ""), n = [], r = "";
|
|
3759
3872
|
for (let e = 0; e < t.length; e++) {
|
|
3760
3873
|
if (t[e] === "\\" && t[e + 1] === "|") {
|
|
@@ -3769,16 +3882,16 @@ function lr(e) {
|
|
|
3769
3882
|
}
|
|
3770
3883
|
return n.push(r.trim()), n;
|
|
3771
3884
|
}
|
|
3772
|
-
var
|
|
3773
|
-
function
|
|
3885
|
+
var fr = (e) => nr.test(e) || rr.test(e) || ir.test(e) || ar.test(e) || or.test(e) || sr.test(e);
|
|
3886
|
+
function pr(e) {
|
|
3774
3887
|
let t = e.replace(/\r\n?/g, "\n").split("\n"), n = [], r = 0;
|
|
3775
3888
|
for (; r < t.length;) {
|
|
3776
3889
|
let e = t[r];
|
|
3777
|
-
if (
|
|
3890
|
+
if (ur.test(e)) {
|
|
3778
3891
|
r++;
|
|
3779
3892
|
continue;
|
|
3780
3893
|
}
|
|
3781
|
-
let i = e.match(
|
|
3894
|
+
let i = e.match(nr);
|
|
3782
3895
|
if (i) {
|
|
3783
3896
|
let e = i[1][0], a = i[1].length, o = [];
|
|
3784
3897
|
for (r++; r < t.length;) {
|
|
@@ -3795,44 +3908,44 @@ function dr(e) {
|
|
|
3795
3908
|
});
|
|
3796
3909
|
continue;
|
|
3797
3910
|
}
|
|
3798
|
-
let a = e.match(
|
|
3911
|
+
let a = e.match(rr);
|
|
3799
3912
|
if (a) {
|
|
3800
3913
|
n.push({
|
|
3801
3914
|
type: "heading",
|
|
3802
3915
|
depth: a[1].length,
|
|
3803
|
-
children:
|
|
3916
|
+
children: tr(a[2] ?? "")
|
|
3804
3917
|
}), r++;
|
|
3805
3918
|
continue;
|
|
3806
3919
|
}
|
|
3807
|
-
if (
|
|
3920
|
+
if (ir.test(e)) {
|
|
3808
3921
|
n.push({ type: "thematicBreak" }), r++;
|
|
3809
3922
|
continue;
|
|
3810
3923
|
}
|
|
3811
|
-
if (
|
|
3924
|
+
if (ar.test(e)) {
|
|
3812
3925
|
let e = [];
|
|
3813
|
-
for (; r < t.length && !
|
|
3926
|
+
for (; r < t.length && !ur.test(t[r]);) e.push(t[r].replace(ar, "")), r++;
|
|
3814
3927
|
n.push({
|
|
3815
3928
|
type: "blockquote",
|
|
3816
|
-
children:
|
|
3929
|
+
children: pr(e.join("\n"))
|
|
3817
3930
|
});
|
|
3818
3931
|
continue;
|
|
3819
3932
|
}
|
|
3820
|
-
let o = e.includes("|") && r + 1 < t.length &&
|
|
3821
|
-
if (o && o.length ===
|
|
3822
|
-
let i =
|
|
3933
|
+
let o = e.includes("|") && r + 1 < t.length && cr.test(t[r + 1]) ? dr(t[r + 1]) : null;
|
|
3934
|
+
if (o && o.length === dr(e).length && o.every((e) => lr.test(e))) {
|
|
3935
|
+
let i = dr(e), a = [{
|
|
3823
3936
|
type: "tableRow",
|
|
3824
3937
|
children: i.map((e) => ({
|
|
3825
3938
|
type: "tableCell",
|
|
3826
|
-
children:
|
|
3939
|
+
children: tr(e)
|
|
3827
3940
|
}))
|
|
3828
3941
|
}];
|
|
3829
|
-
for (r += 2; r < t.length && !
|
|
3830
|
-
let e =
|
|
3942
|
+
for (r += 2; r < t.length && !ur.test(t[r]) && t[r].includes("|");) {
|
|
3943
|
+
let e = dr(t[r]);
|
|
3831
3944
|
a.push({
|
|
3832
3945
|
type: "tableRow",
|
|
3833
3946
|
children: i.map((t, n) => ({
|
|
3834
3947
|
type: "tableCell",
|
|
3835
|
-
children:
|
|
3948
|
+
children: tr(e[n] ?? "")
|
|
3836
3949
|
}))
|
|
3837
3950
|
}), r++;
|
|
3838
3951
|
}
|
|
@@ -3842,16 +3955,16 @@ function dr(e) {
|
|
|
3842
3955
|
});
|
|
3843
3956
|
continue;
|
|
3844
3957
|
}
|
|
3845
|
-
let s = e.match(
|
|
3958
|
+
let s = e.match(or), c = e.match(sr);
|
|
3846
3959
|
if (s || c) {
|
|
3847
3960
|
let e = !!c, i = c ? Number(c[2]) : void 0, a = [];
|
|
3848
3961
|
for (; r < t.length;) {
|
|
3849
|
-
let n = t[r].match(
|
|
3962
|
+
let n = t[r].match(or), i = t[r].match(sr), o = e ? i : n;
|
|
3850
3963
|
if (!o || !!i !== e) break;
|
|
3851
3964
|
let s = e ? o[1].length + o[2].length + 1 + o[4].length : o[1].length + 1 + o[3].length, c = [e ? o[5] : o[4]];
|
|
3852
3965
|
for (r++; r < t.length;) {
|
|
3853
3966
|
let e = t[r];
|
|
3854
|
-
if (
|
|
3967
|
+
if (ur.test(e)) {
|
|
3855
3968
|
let e = t[r + 1];
|
|
3856
3969
|
if (e !== void 0 && RegExp(`^ {${s},}\\S`).test(e)) {
|
|
3857
3970
|
c.push(""), r++;
|
|
@@ -3863,12 +3976,12 @@ function dr(e) {
|
|
|
3863
3976
|
c.push(e.slice(s)), r++;
|
|
3864
3977
|
continue;
|
|
3865
3978
|
}
|
|
3866
|
-
if (
|
|
3979
|
+
if (or.test(e) || sr.test(e) || fr(e)) break;
|
|
3867
3980
|
c.push(e.trim()), r++;
|
|
3868
3981
|
}
|
|
3869
3982
|
a.push({
|
|
3870
3983
|
type: "listItem",
|
|
3871
|
-
children:
|
|
3984
|
+
children: pr(c.join("\n"))
|
|
3872
3985
|
});
|
|
3873
3986
|
}
|
|
3874
3987
|
n.push({
|
|
@@ -3880,25 +3993,25 @@ function dr(e) {
|
|
|
3880
3993
|
continue;
|
|
3881
3994
|
}
|
|
3882
3995
|
let l = [];
|
|
3883
|
-
for (; r < t.length && !
|
|
3996
|
+
for (; r < t.length && !ur.test(t[r]) && !(l.length && fr(t[r]) || l.length && t[r].includes("|") && r + 1 < t.length && cr.test(t[r + 1]));) l.push(t[r]), r++;
|
|
3884
3997
|
let u = l.map((e) => e.replace(/^[ \t]+/, "")).join("\n").replace(/\s+$/, "");
|
|
3885
3998
|
n.push({
|
|
3886
3999
|
type: "paragraph",
|
|
3887
|
-
children:
|
|
4000
|
+
children: tr(u)
|
|
3888
4001
|
});
|
|
3889
4002
|
}
|
|
3890
4003
|
return n;
|
|
3891
4004
|
}
|
|
3892
4005
|
//#endregion
|
|
3893
4006
|
//#region src/markdown/parseMarkdown.ts
|
|
3894
|
-
var
|
|
4007
|
+
var mr = "\n\n", hr = [
|
|
3895
4008
|
"h1",
|
|
3896
4009
|
"h2",
|
|
3897
4010
|
"h3",
|
|
3898
4011
|
"h4",
|
|
3899
4012
|
"h5",
|
|
3900
4013
|
"h6"
|
|
3901
|
-
],
|
|
4014
|
+
], gr = class {
|
|
3902
4015
|
tokens = [];
|
|
3903
4016
|
text(e) {
|
|
3904
4017
|
let t = [];
|
|
@@ -3909,7 +4022,7 @@ var fr = "\n\n", pr = [
|
|
|
3909
4022
|
return t;
|
|
3910
4023
|
}
|
|
3911
4024
|
break() {
|
|
3912
|
-
this.tokens.push(
|
|
4025
|
+
this.tokens.push(mr);
|
|
3913
4026
|
}
|
|
3914
4027
|
}, Z = (e, t, n) => ({
|
|
3915
4028
|
type: "el",
|
|
@@ -3917,29 +4030,29 @@ var fr = "\n\n", pr = [
|
|
|
3917
4030
|
children: t,
|
|
3918
4031
|
...n ? { props: n } : {}
|
|
3919
4032
|
});
|
|
3920
|
-
function
|
|
4033
|
+
function _r(e, t, n) {
|
|
3921
4034
|
return e.map((e, r) => (r > 0 && t.break(), n(e)));
|
|
3922
4035
|
}
|
|
3923
|
-
function
|
|
4036
|
+
function vr(e, t) {
|
|
3924
4037
|
let n = [];
|
|
3925
4038
|
for (let r of e) switch (r.type) {
|
|
3926
4039
|
case "text":
|
|
3927
4040
|
n.push(...t.text(r.value));
|
|
3928
4041
|
break;
|
|
3929
4042
|
case "strong":
|
|
3930
|
-
n.push(Z("strong",
|
|
4043
|
+
n.push(Z("strong", vr(r.children, t)));
|
|
3931
4044
|
break;
|
|
3932
4045
|
case "emphasis":
|
|
3933
|
-
n.push(Z("em",
|
|
4046
|
+
n.push(Z("em", vr(r.children, t)));
|
|
3934
4047
|
break;
|
|
3935
4048
|
case "delete":
|
|
3936
|
-
n.push(Z("del",
|
|
4049
|
+
n.push(Z("del", vr(r.children, t)));
|
|
3937
4050
|
break;
|
|
3938
4051
|
case "inlineCode":
|
|
3939
4052
|
n.push(Z("code", t.text(r.value)));
|
|
3940
4053
|
break;
|
|
3941
4054
|
case "link":
|
|
3942
|
-
n.push(Z("a",
|
|
4055
|
+
n.push(Z("a", vr(r.children, t), {
|
|
3943
4056
|
href: r.url,
|
|
3944
4057
|
target: "_blank",
|
|
3945
4058
|
rel: "noopener noreferrer",
|
|
@@ -3958,25 +4071,25 @@ function gr(e, t) {
|
|
|
3958
4071
|
case "break":
|
|
3959
4072
|
n.push(Z("br", []));
|
|
3960
4073
|
break;
|
|
3961
|
-
default: "children" in r && Array.isArray(r.children) && n.push(...
|
|
4074
|
+
default: "children" in r && Array.isArray(r.children) && n.push(...vr(r.children, t));
|
|
3962
4075
|
}
|
|
3963
4076
|
return n;
|
|
3964
4077
|
}
|
|
3965
|
-
function
|
|
4078
|
+
function yr(e, t) {
|
|
3966
4079
|
let n = [];
|
|
3967
4080
|
return e.forEach((e, r) => {
|
|
3968
4081
|
switch (r > 0 && t.break(), e.type) {
|
|
3969
4082
|
case "paragraph":
|
|
3970
|
-
n.push(Z("p",
|
|
4083
|
+
n.push(Z("p", vr(e.children, t)));
|
|
3971
4084
|
break;
|
|
3972
4085
|
case "heading":
|
|
3973
|
-
n.push(Z(
|
|
4086
|
+
n.push(Z(hr[e.depth - 1] ?? "h6", vr(e.children, t)));
|
|
3974
4087
|
break;
|
|
3975
4088
|
case "list":
|
|
3976
|
-
n.push(Z(e.ordered ? "ol" : "ul",
|
|
4089
|
+
n.push(Z(e.ordered ? "ol" : "ul", _r(e.children, t, (e) => Z("li", yr(e.children, t))), e.ordered && e.start != null && e.start !== 1 ? { start: String(e.start) } : void 0));
|
|
3977
4090
|
break;
|
|
3978
4091
|
case "blockquote":
|
|
3979
|
-
n.push(Z("blockquote",
|
|
4092
|
+
n.push(Z("blockquote", yr(e.children, t)));
|
|
3980
4093
|
break;
|
|
3981
4094
|
case "code":
|
|
3982
4095
|
n.push({
|
|
@@ -3989,24 +4102,24 @@ function _r(e, t) {
|
|
|
3989
4102
|
n.push(Z("hr", []));
|
|
3990
4103
|
break;
|
|
3991
4104
|
case "table": {
|
|
3992
|
-
let [r, ...i] = e.children, a = (e, n) =>
|
|
4105
|
+
let [r, ...i] = e.children, a = (e, n) => _r(e.children, t, (e) => Z(n, vr(e.children, t))), o = r ? Z("thead", [Z("tr", a(r, "th"))]) : null;
|
|
3993
4106
|
o && i.length && t.break();
|
|
3994
|
-
let s = i.length ? Z("tbody",
|
|
4107
|
+
let s = i.length ? Z("tbody", _r(i, t, (e) => Z("tr", a(e, "td")))) : null;
|
|
3995
4108
|
n.push(Z("table", [o, s].filter((e) => e !== null)));
|
|
3996
4109
|
break;
|
|
3997
4110
|
}
|
|
3998
|
-
default: "children" in e && Array.isArray(e.children) && n.push(...
|
|
4111
|
+
default: "children" in e && Array.isArray(e.children) && n.push(...vr(e.children, t));
|
|
3999
4112
|
}
|
|
4000
4113
|
}), n;
|
|
4001
4114
|
}
|
|
4002
|
-
function
|
|
4003
|
-
let t = new
|
|
4115
|
+
function br(e) {
|
|
4116
|
+
let t = new gr(), n = yr(pr(e), t);
|
|
4004
4117
|
return {
|
|
4005
4118
|
tokens: t.tokens,
|
|
4006
4119
|
nodes: n
|
|
4007
4120
|
};
|
|
4008
4121
|
}
|
|
4009
|
-
var
|
|
4122
|
+
var xr = {
|
|
4010
4123
|
citation: "ick-citation-3Yqh",
|
|
4011
4124
|
marked: "ick-marked-MYhj",
|
|
4012
4125
|
passage: "ick-passage-QMNg",
|
|
@@ -4014,16 +4127,16 @@ var yr = {
|
|
|
4014
4127
|
};
|
|
4015
4128
|
//#endregion
|
|
4016
4129
|
//#region src/InlineCitation/InlineCitation.tsx
|
|
4017
|
-
function
|
|
4130
|
+
function Sr({ index: e, source: t, children: n, onSelect: r, labels: i, className: a, ...o }) {
|
|
4018
4131
|
let { cite: s } = H("citation", i), c = t ? `${s} ${e}: ${t.title}` : `${s} ${e}`, l = r ? /* @__PURE__ */ _("button", {
|
|
4019
4132
|
type: "button",
|
|
4020
|
-
className:
|
|
4133
|
+
className: xr.marker,
|
|
4021
4134
|
onClick: () => r(e, t),
|
|
4022
4135
|
onPointerDown: (e) => e.stopPropagation(),
|
|
4023
4136
|
"aria-label": c,
|
|
4024
4137
|
children: e
|
|
4025
4138
|
}) : /* @__PURE__ */ _("span", {
|
|
4026
|
-
className:
|
|
4139
|
+
className: xr.marker,
|
|
4027
4140
|
"data-static": "",
|
|
4028
4141
|
"aria-label": c,
|
|
4029
4142
|
role: "note",
|
|
@@ -4031,22 +4144,22 @@ function br({ index: e, source: t, children: n, onSelect: r, labels: i, classNam
|
|
|
4031
4144
|
});
|
|
4032
4145
|
return n ? /* @__PURE__ */ v("span", {
|
|
4033
4146
|
className: [
|
|
4034
|
-
|
|
4035
|
-
|
|
4147
|
+
xr.citation,
|
|
4148
|
+
xr.marked,
|
|
4036
4149
|
a ?? ""
|
|
4037
4150
|
].filter(Boolean).join(" "),
|
|
4038
4151
|
...o,
|
|
4039
4152
|
children: [/* @__PURE__ */ _("span", {
|
|
4040
|
-
className:
|
|
4153
|
+
className: xr.passage,
|
|
4041
4154
|
children: n
|
|
4042
4155
|
}), l]
|
|
4043
4156
|
}) : /* @__PURE__ */ _("span", {
|
|
4044
|
-
className: [
|
|
4157
|
+
className: [xr.citation, a ?? ""].filter(Boolean).join(" "),
|
|
4045
4158
|
...o,
|
|
4046
4159
|
children: l
|
|
4047
4160
|
});
|
|
4048
4161
|
}
|
|
4049
|
-
var
|
|
4162
|
+
var Cr = {
|
|
4050
4163
|
marker: "ick-marker-BYwC",
|
|
4051
4164
|
shimmer: "ick-shimmer-InQp",
|
|
4052
4165
|
"shimmer-sweep": "ick-shimmer-sweep-O8S3",
|
|
@@ -4057,21 +4170,21 @@ var xr = {
|
|
|
4057
4170
|
canvas: "ick-canvas-IRKL",
|
|
4058
4171
|
menu: "ick-menu-gZzr",
|
|
4059
4172
|
srOnly: "ick-srOnly-Q3GJ"
|
|
4060
|
-
},
|
|
4173
|
+
}, wr = -20, Tr = Math.tan(wr * Math.PI / 180), Er = (e) => {
|
|
4061
4174
|
if (e.length === 0) return "";
|
|
4062
4175
|
let t = e[0], n = `M ${t.x} ${t.y}`;
|
|
4063
4176
|
for (let t = 1; t < e.length; t++) n += ` L ${e[t].x} ${e[t].y}`;
|
|
4064
4177
|
return n;
|
|
4065
|
-
},
|
|
4178
|
+
}, Dr = (e) => {
|
|
4066
4179
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
4067
4180
|
return e.forEach((e) => {
|
|
4068
|
-
let i = e.x +
|
|
4181
|
+
let i = e.x + Tr * e.y;
|
|
4069
4182
|
i < t && (t = i), i > n && (n = i), e.y < r && (r = e.y);
|
|
4070
4183
|
}), {
|
|
4071
4184
|
x: (t + n) / 2,
|
|
4072
4185
|
y: r
|
|
4073
4186
|
};
|
|
4074
|
-
},
|
|
4187
|
+
}, Or = (e) => {
|
|
4075
4188
|
let t = Infinity, n = -Infinity, r = Infinity;
|
|
4076
4189
|
return e.forEach((e) => {
|
|
4077
4190
|
e.x < t && (t = e.x), e.x + e.w > n && (n = e.x + e.w), e.y < r && (r = e.y);
|
|
@@ -4079,44 +4192,44 @@ var xr = {
|
|
|
4079
4192
|
x: (t + n) / 2,
|
|
4080
4193
|
y: r
|
|
4081
4194
|
};
|
|
4082
|
-
},
|
|
4195
|
+
}, kr = (e, t) => {
|
|
4083
4196
|
if (e.size === 0) return "";
|
|
4084
4197
|
let n = [...e].sort((e, t) => e - t), r = "";
|
|
4085
4198
|
for (let e = n[0]; e <= n[n.length - 1]; e++) r += t[e];
|
|
4086
4199
|
return r.trim();
|
|
4087
|
-
},
|
|
4200
|
+
}, Ar = (e, t = 60) => e.length > t ? `${e.slice(0, t).trimEnd()}…` : e, jr = (e) => {
|
|
4088
4201
|
let t = "";
|
|
4089
4202
|
return e.forEach((e) => {
|
|
4090
|
-
let n = e.y + e.h / 2, r = e.x - n *
|
|
4203
|
+
let n = e.y + e.h / 2, r = e.x - n * Tr, i = e.x + e.w - n * Tr;
|
|
4091
4204
|
t += `M ${r} ${n} L ${i} ${n} `;
|
|
4092
4205
|
}), t.trim();
|
|
4093
4206
|
};
|
|
4094
|
-
function
|
|
4095
|
-
let h = H("highlighter"), g = p(null), [b, S] = m([]), [w, T] = m([]), [E, D] = m(null), [O, k] = m(!1), [A, j] = m(null), [M,
|
|
4096
|
-
e.viaKeyboard && (
|
|
4097
|
-
}, []),
|
|
4098
|
-
let t =
|
|
4099
|
-
|
|
4207
|
+
function Mr({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlightComplete: a, onReplyInThread: s, sources: u, onSelectSource: d }) {
|
|
4208
|
+
let h = H("highlighter"), g = p(null), [b, S] = m([]), [w, T] = m([]), [E, D] = m(null), [O, k] = m(!1), [A, j] = m(null), [M, N] = m(0), ee = p(null), te = p(null), [P, F] = m(null), [I, ne] = m(null), L = o((e) => {
|
|
4209
|
+
e.viaKeyboard && (te.current = document.activeElement), N(0), j(e);
|
|
4210
|
+
}, []), re = o((e = "none") => {
|
|
4211
|
+
let t = te.current;
|
|
4212
|
+
te.current = null, j(null), e !== "none" && (e === "restore" && t?.isConnected ? t.focus() : g.current?.focus());
|
|
4100
4213
|
}, []);
|
|
4101
4214
|
c(() => {
|
|
4102
4215
|
let e = (e) => {
|
|
4103
|
-
A && g.current && !g.current.contains(e.target) &&
|
|
4216
|
+
A && g.current && !g.current.contains(e.target) && re();
|
|
4104
4217
|
};
|
|
4105
4218
|
return window.addEventListener("pointerdown", e), () => window.removeEventListener("pointerdown", e);
|
|
4106
|
-
}, [A,
|
|
4107
|
-
let ie = f(() =>
|
|
4219
|
+
}, [A, re]);
|
|
4220
|
+
let ie = f(() => br(t), [t]), R = ie.tokens, oe = p(w), se = p(a), ce = p(A);
|
|
4108
4221
|
c(() => {
|
|
4109
4222
|
oe.current = w, se.current = a, ce.current = A;
|
|
4110
4223
|
});
|
|
4111
4224
|
let le = f(() => [...b.map((e) => ({
|
|
4112
4225
|
id: e.id,
|
|
4113
|
-
d:
|
|
4226
|
+
d: Er(e.points),
|
|
4114
4227
|
kind: "path",
|
|
4115
4228
|
item: e,
|
|
4116
|
-
text:
|
|
4229
|
+
text: kr(e.highlightedIndices, R)
|
|
4117
4230
|
})), ...w.map((e) => ({
|
|
4118
4231
|
id: e.id,
|
|
4119
|
-
d:
|
|
4232
|
+
d: jr(e.rects),
|
|
4120
4233
|
kind: "selection",
|
|
4121
4234
|
item: e,
|
|
4122
4235
|
text: e.text
|
|
@@ -4125,8 +4238,8 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4125
4238
|
w,
|
|
4126
4239
|
R
|
|
4127
4240
|
]), ue = (e, t = !1) => {
|
|
4128
|
-
let n = e.kind === "path" ?
|
|
4129
|
-
|
|
4241
|
+
let n = e.kind === "path" ? Dr(e.item.points) : Or(e.item.rects);
|
|
4242
|
+
L({
|
|
4130
4243
|
x: n.x,
|
|
4131
4244
|
y: n.y,
|
|
4132
4245
|
pathId: e.id,
|
|
@@ -4167,15 +4280,15 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4167
4280
|
text: i,
|
|
4168
4281
|
highlightedIndices: a
|
|
4169
4282
|
}]);
|
|
4170
|
-
let d =
|
|
4171
|
-
|
|
4283
|
+
let d = Or(l);
|
|
4284
|
+
L({
|
|
4172
4285
|
x: d.x,
|
|
4173
4286
|
y: d.y,
|
|
4174
4287
|
pathId: u,
|
|
4175
4288
|
kind: "selection",
|
|
4176
4289
|
viaKeyboard: n
|
|
4177
4290
|
});
|
|
4178
|
-
}, [
|
|
4291
|
+
}, [L]);
|
|
4179
4292
|
c(() => {
|
|
4180
4293
|
let e = (e) => {
|
|
4181
4294
|
if (ce.current) return;
|
|
@@ -4210,27 +4323,27 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4210
4323
|
let i = "";
|
|
4211
4324
|
for (let e = ye.from; e <= ye.to; e++) i += R[e];
|
|
4212
4325
|
de(r, i, !0), be();
|
|
4213
|
-
}, Ce = () => [...
|
|
4326
|
+
}, Ce = () => [...ee.current?.querySelectorAll("[role=\"menuitem\"]") ?? []];
|
|
4214
4327
|
c(() => {
|
|
4215
4328
|
if (!A) return;
|
|
4216
4329
|
let e = Ce();
|
|
4217
4330
|
if (e.length === 0) return;
|
|
4218
|
-
let t =
|
|
4331
|
+
let t = ee.current?.contains(document.activeElement);
|
|
4219
4332
|
(A.viaKeyboard || t) && e[Math.min(M, e.length - 1)]?.focus();
|
|
4220
4333
|
}, [A, M]);
|
|
4221
4334
|
let we = (e) => {
|
|
4222
4335
|
let t = Ce().length;
|
|
4223
4336
|
if (t === 0) return;
|
|
4224
4337
|
let n = (n) => {
|
|
4225
|
-
e.preventDefault(), e.stopPropagation(),
|
|
4338
|
+
e.preventDefault(), e.stopPropagation(), N((e) => (e + n + t) % t);
|
|
4226
4339
|
};
|
|
4227
4340
|
switch (e.key) {
|
|
4228
4341
|
case "ArrowRight":
|
|
4229
4342
|
case "ArrowDown": return n(1);
|
|
4230
4343
|
case "ArrowLeft":
|
|
4231
4344
|
case "ArrowUp": return n(-1);
|
|
4232
|
-
case "Home": return e.preventDefault(),
|
|
4233
|
-
case "End": return e.preventDefault(),
|
|
4345
|
+
case "Home": return e.preventDefault(), N(0);
|
|
4346
|
+
case "End": return e.preventDefault(), N(t - 1);
|
|
4234
4347
|
default: return;
|
|
4235
4348
|
}
|
|
4236
4349
|
}, B = (e) => {
|
|
@@ -4249,7 +4362,7 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4249
4362
|
case "End": return n(pe[pe.length - 1]);
|
|
4250
4363
|
case "Enter":
|
|
4251
4364
|
case " ": return ye ? (e.preventDefault(), xe()) : void 0;
|
|
4252
|
-
case "Escape": return !A && me === null ? void 0 : (e.preventDefault(),
|
|
4365
|
+
case "Escape": return !A && me === null ? void 0 : (e.preventDefault(), re("restore"), be());
|
|
4253
4366
|
default: return;
|
|
4254
4367
|
}
|
|
4255
4368
|
}, Te = (e, t, n) => {
|
|
@@ -4260,14 +4373,14 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4260
4373
|
}
|
|
4261
4374
|
}, Ee = (e) => {
|
|
4262
4375
|
if (A) {
|
|
4263
|
-
|
|
4376
|
+
re();
|
|
4264
4377
|
return;
|
|
4265
4378
|
}
|
|
4266
4379
|
if (i === "precise" || e.button !== 0 && e.pointerType === "mouse") return;
|
|
4267
4380
|
e.preventDefault(), k(!0);
|
|
4268
4381
|
let t = e.currentTarget;
|
|
4269
4382
|
t.setPointerCapture(e.pointerId);
|
|
4270
|
-
let n = t.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = r - a *
|
|
4383
|
+
let n = t.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = r - a * Tr, s = {
|
|
4271
4384
|
id: Date.now().toString(),
|
|
4272
4385
|
points: [{
|
|
4273
4386
|
x: o,
|
|
@@ -4275,10 +4388,10 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4275
4388
|
}],
|
|
4276
4389
|
highlightedIndices: /* @__PURE__ */ new Set()
|
|
4277
4390
|
};
|
|
4278
|
-
D(s),
|
|
4391
|
+
D(s), re(), Te(e.clientX, e.clientY, s.highlightedIndices);
|
|
4279
4392
|
}, De = (e) => {
|
|
4280
4393
|
if (i === "precise" || !E) return;
|
|
4281
|
-
let t = g.current.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, a = n - r *
|
|
4394
|
+
let t = g.current.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, a = n - r * Tr;
|
|
4282
4395
|
D((t) => {
|
|
4283
4396
|
if (!t) return t;
|
|
4284
4397
|
let n = new Set(t.highlightedIndices);
|
|
@@ -4294,24 +4407,24 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4294
4407
|
}, Oe = (e) => {
|
|
4295
4408
|
if (i !== "precise" && (k(!1), E)) {
|
|
4296
4409
|
if (e.currentTarget.releasePointerCapture(e.pointerId), S((e) => [...e, E]), E.highlightedIndices.size > 0) {
|
|
4297
|
-
let e =
|
|
4298
|
-
|
|
4410
|
+
let e = Dr(E.points);
|
|
4411
|
+
L({
|
|
4299
4412
|
x: e.x,
|
|
4300
4413
|
y: e.y,
|
|
4301
4414
|
pathId: E.id,
|
|
4302
4415
|
kind: "path"
|
|
4303
4416
|
});
|
|
4304
4417
|
}
|
|
4305
|
-
a && E.highlightedIndices.size > 0 && a(
|
|
4418
|
+
a && E.highlightedIndices.size > 0 && a(kr(E.highlightedIndices, R)), D(null);
|
|
4306
4419
|
}
|
|
4307
4420
|
}, ke = (e) => {
|
|
4308
4421
|
i !== "precise" && (k(!1), E && (e.currentTarget.releasePointerCapture(e.pointerId), D(null)));
|
|
4309
4422
|
}, Ae = (e) => {
|
|
4310
4423
|
let t = b.find((t) => t.id === e);
|
|
4311
|
-
return t ?
|
|
4424
|
+
return t ? kr(t.highlightedIndices, R) : "";
|
|
4312
4425
|
}, Me = (e) => {
|
|
4313
4426
|
let t = A?.viaKeyboard;
|
|
4314
|
-
A?.kind === "selection" ? T((t) => t.filter((t) => t.id !== e)) : S((t) => t.filter((t) => t.id !== e)),
|
|
4427
|
+
A?.kind === "selection" ? T((t) => t.filter((t) => t.id !== e)) : S((t) => t.filter((t) => t.id !== e)), re(t ? "container" : "none");
|
|
4315
4428
|
}, U = () => {
|
|
4316
4429
|
let e = A?.viaKeyboard;
|
|
4317
4430
|
if (A && s) {
|
|
@@ -4330,7 +4443,7 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4330
4443
|
t && s(e, t.getBoundingClientRect());
|
|
4331
4444
|
}
|
|
4332
4445
|
}
|
|
4333
|
-
|
|
4446
|
+
re(e ? "restore" : "none");
|
|
4334
4447
|
}, Ne = (e) => {
|
|
4335
4448
|
let t = R[e];
|
|
4336
4449
|
if (!r) return t;
|
|
@@ -4339,7 +4452,7 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4339
4452
|
let i = !1;
|
|
4340
4453
|
return P && (i = (b.find((e) => e.id === P) ?? w.find((e) => e.id === P))?.highlightedIndices?.has(e) ?? !1), /* @__PURE__ */ _("span", {
|
|
4341
4454
|
"data-index": e,
|
|
4342
|
-
className:
|
|
4455
|
+
className: Cr.token,
|
|
4343
4456
|
"data-space": !t.trim() || void 0,
|
|
4344
4457
|
"data-active": n || void 0,
|
|
4345
4458
|
"data-pressed": i || void 0,
|
|
@@ -4349,13 +4462,13 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4349
4462
|
}, e);
|
|
4350
4463
|
}, Pe = (e) => e.map((e, t) => {
|
|
4351
4464
|
if (e.type === "token") return Ne(e.index);
|
|
4352
|
-
if (e.type === "code") return /* @__PURE__ */ _(
|
|
4465
|
+
if (e.type === "code") return /* @__PURE__ */ _(nn, {
|
|
4353
4466
|
code: e.value,
|
|
4354
4467
|
lang: e.lang
|
|
4355
4468
|
}, `c${t}`);
|
|
4356
4469
|
if (e.type === "el" && e.tag === "cite") {
|
|
4357
4470
|
let n = Number(e.props?.index ?? 0);
|
|
4358
|
-
return /* @__PURE__ */ _(
|
|
4471
|
+
return /* @__PURE__ */ _(Sr, {
|
|
4359
4472
|
index: n,
|
|
4360
4473
|
source: u?.[n - 1],
|
|
4361
4474
|
onSelect: d ? (e, t) => d(e, t) : void 0
|
|
@@ -4383,7 +4496,7 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4383
4496
|
},
|
|
4384
4497
|
"data-drawing": O || void 0,
|
|
4385
4498
|
"data-menu": !!A || void 0,
|
|
4386
|
-
className:
|
|
4499
|
+
className: Cr.surface,
|
|
4387
4500
|
...r ? {
|
|
4388
4501
|
onPointerDown: Ee,
|
|
4389
4502
|
onPointerMove: De,
|
|
@@ -4397,27 +4510,27 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4397
4510
|
children: [
|
|
4398
4511
|
r && /* @__PURE__ */ _("span", {
|
|
4399
4512
|
id: ve,
|
|
4400
|
-
className:
|
|
4513
|
+
className: Cr.srOnly,
|
|
4401
4514
|
"aria-hidden": "true",
|
|
4402
4515
|
children: h.keyboardHint
|
|
4403
4516
|
}),
|
|
4404
|
-
r && /* @__PURE__ */ _("div", { className:
|
|
4517
|
+
r && /* @__PURE__ */ _("div", { className: Cr.hitbox }),
|
|
4405
4518
|
/* @__PURE__ */ _("div", {
|
|
4406
|
-
className:
|
|
4519
|
+
className: Cr.tokens,
|
|
4407
4520
|
"data-focus": !!A || void 0,
|
|
4408
4521
|
children: Pe(ie.nodes)
|
|
4409
4522
|
}),
|
|
4410
4523
|
r && /* @__PURE__ */ _("svg", {
|
|
4411
|
-
className:
|
|
4524
|
+
className: Cr.canvas,
|
|
4412
4525
|
children: /* @__PURE__ */ v("g", {
|
|
4413
|
-
transform: `skewX(${
|
|
4526
|
+
transform: `skewX(${wr})`,
|
|
4414
4527
|
children: [le.map((t) => /* @__PURE__ */ v(e.Fragment, { children: [/* @__PURE__ */ _("path", {
|
|
4415
4528
|
id: `highlight-${t.kind}-${t.id}`,
|
|
4416
|
-
className:
|
|
4529
|
+
className: Cr.marker,
|
|
4417
4530
|
d: t.d,
|
|
4418
4531
|
"data-cursor": "pointer",
|
|
4419
4532
|
"data-pressed": P === t.id || void 0,
|
|
4420
|
-
"data-active": A?.pathId === t.id ||
|
|
4533
|
+
"data-active": A?.pathId === t.id || I === t.id || void 0,
|
|
4421
4534
|
"data-dimmed": A && A.pathId !== t.id || void 0,
|
|
4422
4535
|
style: { pointerEvents: O ? "none" : "stroke" },
|
|
4423
4536
|
onPointerDown: (e) => {
|
|
@@ -4429,13 +4542,13 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4429
4542
|
onPointerLeave: () => F(null),
|
|
4430
4543
|
onPointerCancel: () => F(null)
|
|
4431
4544
|
}), /* @__PURE__ */ _("path", {
|
|
4432
|
-
className:
|
|
4545
|
+
className: Cr.shimmer,
|
|
4433
4546
|
d: t.d,
|
|
4434
4547
|
pathLength: 1,
|
|
4435
|
-
"data-active": A?.pathId === t.id ||
|
|
4548
|
+
"data-active": A?.pathId === t.id || I === t.id || void 0
|
|
4436
4549
|
})] }, t.id)), E && /* @__PURE__ */ _("path", {
|
|
4437
|
-
className:
|
|
4438
|
-
d:
|
|
4550
|
+
className: Cr.marker,
|
|
4551
|
+
d: Er(E.points)
|
|
4439
4552
|
})]
|
|
4440
4553
|
})
|
|
4441
4554
|
}),
|
|
@@ -4444,23 +4557,23 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4444
4557
|
"aria-label": je(le.length === 1 ? h.countOne : h.countMany, { count: le.length }),
|
|
4445
4558
|
children: le.map((e) => /* @__PURE__ */ _("button", {
|
|
4446
4559
|
type: "button",
|
|
4447
|
-
className:
|
|
4560
|
+
className: Cr.srOnly,
|
|
4448
4561
|
onPointerDown: (e) => e.stopPropagation(),
|
|
4449
|
-
onFocus: () =>
|
|
4450
|
-
onBlur: () =>
|
|
4562
|
+
onFocus: () => ne(e.id),
|
|
4563
|
+
onBlur: () => ne(null),
|
|
4451
4564
|
onClick: (t) => {
|
|
4452
4565
|
t.stopPropagation(), ue(e, !0);
|
|
4453
4566
|
},
|
|
4454
|
-
children: `${h.highlight} ${
|
|
4567
|
+
children: `${h.highlight} ${Ar(e.text)}`
|
|
4455
4568
|
}, e.id))
|
|
4456
4569
|
}),
|
|
4457
4570
|
/* @__PURE__ */ _(y, { children: r && A && /* @__PURE__ */ v(C.div, {
|
|
4458
|
-
ref:
|
|
4571
|
+
ref: ee,
|
|
4459
4572
|
role: "menu",
|
|
4460
4573
|
"aria-label": h.menu,
|
|
4461
4574
|
onKeyDown: we,
|
|
4462
4575
|
onBlur: (e) => {
|
|
4463
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
4576
|
+
e.currentTarget.contains(e.relatedTarget) || re();
|
|
4464
4577
|
},
|
|
4465
4578
|
initial: { opacity: 0 },
|
|
4466
4579
|
animate: {
|
|
@@ -4474,7 +4587,7 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4474
4587
|
staggerDirection: -1
|
|
4475
4588
|
}
|
|
4476
4589
|
},
|
|
4477
|
-
className:
|
|
4590
|
+
className: Cr.menu,
|
|
4478
4591
|
style: {
|
|
4479
4592
|
left: A.x,
|
|
4480
4593
|
top: A.y
|
|
@@ -4504,6 +4617,8 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4504
4617
|
children: /* @__PURE__ */ _(V, {
|
|
4505
4618
|
variant: "primary",
|
|
4506
4619
|
role: "menuitem",
|
|
4620
|
+
"data-ick-role": "highlight-action",
|
|
4621
|
+
"data-ick-action": "reply",
|
|
4507
4622
|
tabIndex: M === 0 ? 0 : -1,
|
|
4508
4623
|
icon: /* @__PURE__ */ _(ae, { size: 14 }),
|
|
4509
4624
|
onClick: (e) => {
|
|
@@ -4536,6 +4651,8 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4536
4651
|
children: /* @__PURE__ */ _(V, {
|
|
4537
4652
|
variant: "primary",
|
|
4538
4653
|
role: "menuitem",
|
|
4654
|
+
"data-ick-role": "highlight-action",
|
|
4655
|
+
"data-ick-action": "remove",
|
|
4539
4656
|
tabIndex: M === 1 ? 0 : -1,
|
|
4540
4657
|
icon: /* @__PURE__ */ _(Se, { size: 14 }),
|
|
4541
4658
|
onClick: (e) => {
|
|
@@ -4550,16 +4667,16 @@ function Ar({ text: t, marking: r = !0, selectionMode: i = "marker", onHighlight
|
|
|
4550
4667
|
})
|
|
4551
4668
|
});
|
|
4552
4669
|
}
|
|
4553
|
-
var
|
|
4670
|
+
var Nr = {
|
|
4554
4671
|
turn: "ick-turn-R-WW",
|
|
4555
4672
|
question: "ick-question-Fhqf",
|
|
4556
4673
|
body: "ick-body-wvid",
|
|
4557
4674
|
custom: "ick-custom-s7j-",
|
|
4558
4675
|
answer: "ick-answer-pZAi",
|
|
4559
4676
|
actions: "ick-actions-CWq8"
|
|
4560
|
-
},
|
|
4677
|
+
}, Pr = (e) => {
|
|
4561
4678
|
navigator.clipboard?.writeText(e);
|
|
4562
|
-
},
|
|
4679
|
+
}, Fr = (e, t) => {
|
|
4563
4680
|
let n = t.map((t, n) => ({
|
|
4564
4681
|
part: t,
|
|
4565
4682
|
order: n,
|
|
@@ -4577,28 +4694,38 @@ var jr = {
|
|
|
4577
4694
|
part: e
|
|
4578
4695
|
});
|
|
4579
4696
|
return i < e.length && a(e.length), r;
|
|
4580
|
-
},
|
|
4581
|
-
let
|
|
4582
|
-
|
|
4583
|
-
|
|
4697
|
+
}, Ir = a(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: s = null, onOpenArtifact: l, onArtifactChange: u, entranceDelay: d = 0, entrance: f = "rise", answerAfterTravel: p = !1, selectionMode: h = "marker", highlights: g = !0, questionAlign: y = "end", onDraft: b, onSubmit: x, onStop: S, busy: w, onEdit: T, onCancelEdit: E, onCopy: D = Pr, onHighlight: O, onReplyInThread: k, onRegenerate: A, onShowVersion: j, onFeedback: M, feedback: N = null, answerActions: ee = !0, onAnswerQuestion: te, onEditQuestion: P, onDecideApproval: F, renderPart: I, composerMenu: ne, labels: L, className: re, onTranscribe: ie }) {
|
|
4698
|
+
let R = G(), ae = R || f === "fade" ? 0 : -16, [oe, se] = m(!1), [ce, le] = m(e.state);
|
|
4699
|
+
ce !== e.state && (le(e.state), p && !R && e.state === "responding" && (ce === "typing" || ce === "idle") && se(!0));
|
|
4700
|
+
let ue = o(() => se(!1), []);
|
|
4701
|
+
c(() => {
|
|
4702
|
+
if (!oe) return;
|
|
4703
|
+
let e = window.setTimeout(() => se(!1), 1200);
|
|
4704
|
+
return () => window.clearTimeout(e);
|
|
4705
|
+
}, [oe]);
|
|
4706
|
+
let de = e.parts ?? [], z = de.find((e) => e.kind === "sources")?.sources, fe = Fr(e.ai, de), pe = ee && (e.state === "resting" || e.state === "responding") && fe.length > 0, me = pe && e.state === "resting", he = pe ? fe[fe.length - 1].kind === "prose" ? fe.length - 1 : fe.length : -1, ge = pe ? /* @__PURE__ */ v("div", {
|
|
4707
|
+
className: Nr.actions,
|
|
4708
|
+
"data-pending": me ? void 0 : "",
|
|
4709
|
+
style: me ? void 0 : { visibility: "hidden" },
|
|
4710
|
+
children: [/* @__PURE__ */ _(jt, {
|
|
4584
4711
|
total: e.versions?.length ?? 0,
|
|
4585
4712
|
index: e.versionIndex ?? 0,
|
|
4586
|
-
onSelect: (t) =>
|
|
4587
|
-
}), /* @__PURE__ */ _(
|
|
4713
|
+
onSelect: (t) => j?.(e.id, t)
|
|
4714
|
+
}), /* @__PURE__ */ _(kt, {
|
|
4588
4715
|
text: e.ai,
|
|
4589
|
-
onCopy:
|
|
4590
|
-
onRegenerate:
|
|
4591
|
-
onFeedback:
|
|
4592
|
-
feedback:
|
|
4716
|
+
onCopy: D,
|
|
4717
|
+
onRegenerate: A ? () => A(e.id) : void 0,
|
|
4718
|
+
onFeedback: M ? (t) => M(e.id, t) : void 0,
|
|
4719
|
+
feedback: N
|
|
4593
4720
|
})]
|
|
4594
|
-
}) : null,
|
|
4721
|
+
}) : null, _e = (t) => {
|
|
4595
4722
|
switch (t.kind) {
|
|
4596
|
-
case "reasoning": return /* @__PURE__ */ _(
|
|
4723
|
+
case "reasoning": return /* @__PURE__ */ _(Ht, {
|
|
4597
4724
|
state: t.state,
|
|
4598
4725
|
duration: t.duration,
|
|
4599
4726
|
children: t.text ?? ""
|
|
4600
4727
|
}, t.id);
|
|
4601
|
-
case "tool": return /* @__PURE__ */ _(
|
|
4728
|
+
case "tool": return /* @__PURE__ */ _(ln, {
|
|
4602
4729
|
name: t.name ?? "",
|
|
4603
4730
|
state: t.state,
|
|
4604
4731
|
summary: t.summary,
|
|
@@ -4607,35 +4734,35 @@ var jr = {
|
|
|
4607
4734
|
error: t.error,
|
|
4608
4735
|
duration: t.duration
|
|
4609
4736
|
}, t.id);
|
|
4610
|
-
case "tasks": return /* @__PURE__ */ _(
|
|
4737
|
+
case "tasks": return /* @__PURE__ */ _(hn, {
|
|
4611
4738
|
title: t.title,
|
|
4612
4739
|
tasks: t.tasks ?? [],
|
|
4613
4740
|
collapsible: t.collapsible
|
|
4614
4741
|
}, t.id);
|
|
4615
|
-
case "chain": return /* @__PURE__ */ _(
|
|
4742
|
+
case "chain": return /* @__PURE__ */ _(_n, {
|
|
4616
4743
|
steps: t.steps ?? [],
|
|
4617
4744
|
state: t.state,
|
|
4618
4745
|
duration: t.duration
|
|
4619
4746
|
}, t.id);
|
|
4620
|
-
case "sources": return /* @__PURE__ */ _(
|
|
4747
|
+
case "sources": return /* @__PURE__ */ _(yn, {
|
|
4621
4748
|
sources: t.sources ?? [],
|
|
4622
4749
|
title: t.title,
|
|
4623
4750
|
collapsible: t.collapsible
|
|
4624
4751
|
}, t.id);
|
|
4625
|
-
case "approval": return /* @__PURE__ */ _(
|
|
4752
|
+
case "approval": return /* @__PURE__ */ _(pn, {
|
|
4626
4753
|
title: t.title,
|
|
4627
4754
|
description: t.description,
|
|
4628
4755
|
decision: t.decision ?? null,
|
|
4629
4756
|
choices: t.choices,
|
|
4630
|
-
onDecide: (n) =>
|
|
4631
|
-
children: t.tool && /* @__PURE__ */ _(
|
|
4757
|
+
onDecide: (n) => F?.(e.id, t.id, n),
|
|
4758
|
+
children: t.tool && /* @__PURE__ */ _(ln, {
|
|
4632
4759
|
name: t.tool.name,
|
|
4633
4760
|
state: "pending",
|
|
4634
4761
|
input: t.tool.input,
|
|
4635
4762
|
defaultOpen: !0
|
|
4636
4763
|
})
|
|
4637
4764
|
}, t.id);
|
|
4638
|
-
case "artifact": return /* @__PURE__ */ _(
|
|
4765
|
+
case "artifact": return /* @__PURE__ */ _(Wn, {
|
|
4639
4766
|
id: t.id,
|
|
4640
4767
|
title: t.title,
|
|
4641
4768
|
meta: t.meta,
|
|
@@ -4643,14 +4770,14 @@ var jr = {
|
|
|
4643
4770
|
lang: t.lang,
|
|
4644
4771
|
content: t.content,
|
|
4645
4772
|
state: t.state,
|
|
4646
|
-
open:
|
|
4647
|
-
onOpen:
|
|
4773
|
+
open: s === t.id,
|
|
4774
|
+
onOpen: l ? (t) => l(e.id, t) : void 0
|
|
4648
4775
|
}, t.id);
|
|
4649
|
-
case "notice": return /* @__PURE__ */ _(
|
|
4776
|
+
case "notice": return /* @__PURE__ */ _(Bn, {
|
|
4650
4777
|
tone: t.tone,
|
|
4651
4778
|
children: t.text
|
|
4652
4779
|
}, t.id);
|
|
4653
|
-
case "question": return /* @__PURE__ */ _(
|
|
4780
|
+
case "question": return /* @__PURE__ */ _(Rn, {
|
|
4654
4781
|
id: t.id,
|
|
4655
4782
|
title: t.title,
|
|
4656
4783
|
questions: t.questions ?? [],
|
|
@@ -4659,31 +4786,31 @@ var jr = {
|
|
|
4659
4786
|
collapsible: t.collapsible,
|
|
4660
4787
|
readOnly: t.readOnly,
|
|
4661
4788
|
foldMotion: a,
|
|
4662
|
-
onCommit: (n, r) =>
|
|
4663
|
-
onEdit: (n) =>
|
|
4789
|
+
onCommit: (n, r) => te?.(e.id, t.id, n, r),
|
|
4790
|
+
onEdit: (n) => P?.(e.id, t.id, n)
|
|
4664
4791
|
}, t.id);
|
|
4665
4792
|
case "custom": {
|
|
4666
|
-
let n =
|
|
4793
|
+
let n = I?.(t, {
|
|
4667
4794
|
turnId: e.id,
|
|
4668
|
-
openArtifact: (t) =>
|
|
4669
|
-
closeArtifact: () =>
|
|
4795
|
+
openArtifact: (t) => u ? u(t) : l?.(e.id, t),
|
|
4796
|
+
closeArtifact: () => u?.(null)
|
|
4670
4797
|
});
|
|
4671
4798
|
return n == null || n === !1 ? null : /* @__PURE__ */ _("div", {
|
|
4672
|
-
className:
|
|
4799
|
+
className: Nr.custom,
|
|
4673
4800
|
"data-part": "custom",
|
|
4674
4801
|
"data-part-type": t.type,
|
|
4675
4802
|
children: n
|
|
4676
4803
|
}, t.id);
|
|
4677
4804
|
}
|
|
4678
4805
|
}
|
|
4679
|
-
},
|
|
4806
|
+
}, ve = /* @__PURE__ */ v(C.article, {
|
|
4680
4807
|
id: `turn-${e.id}`,
|
|
4681
|
-
className: [
|
|
4808
|
+
className: [Nr.turn, re ?? ""].filter(Boolean).join(" "),
|
|
4682
4809
|
"data-active-input": t || void 0,
|
|
4683
4810
|
"aria-busy": e.state === "responding" || void 0,
|
|
4684
4811
|
initial: {
|
|
4685
4812
|
opacity: 0,
|
|
4686
|
-
y:
|
|
4813
|
+
y: ae
|
|
4687
4814
|
},
|
|
4688
4815
|
animate: {
|
|
4689
4816
|
opacity: 1,
|
|
@@ -4691,70 +4818,73 @@ var jr = {
|
|
|
4691
4818
|
},
|
|
4692
4819
|
exit: {
|
|
4693
4820
|
opacity: 0,
|
|
4694
|
-
y:
|
|
4821
|
+
y: ae
|
|
4695
4822
|
},
|
|
4696
4823
|
transition: {
|
|
4697
|
-
duration:
|
|
4824
|
+
duration: R ? .15 : .4,
|
|
4698
4825
|
ease: [
|
|
4699
4826
|
.22,
|
|
4700
4827
|
1,
|
|
4701
4828
|
.36,
|
|
4702
4829
|
1
|
|
4703
4830
|
],
|
|
4704
|
-
delay:
|
|
4831
|
+
delay: d
|
|
4705
4832
|
},
|
|
4706
4833
|
children: [/* @__PURE__ */ _("div", {
|
|
4707
|
-
className:
|
|
4708
|
-
"data-align":
|
|
4709
|
-
children: /* @__PURE__ */ _(
|
|
4834
|
+
className: Nr.question,
|
|
4835
|
+
"data-align": y,
|
|
4836
|
+
children: /* @__PURE__ */ _(st, {
|
|
4710
4837
|
ref: n,
|
|
4711
|
-
style:
|
|
4838
|
+
style: y === "stretch" ? { width: "100%" } : void 0,
|
|
4712
4839
|
state: e.state,
|
|
4713
4840
|
value: e.user,
|
|
4714
|
-
onChange: (t) =>
|
|
4715
|
-
onSubmit: (t, n) =>
|
|
4841
|
+
onChange: (t) => b?.(e.id, t),
|
|
4842
|
+
onSubmit: (t, n) => x?.(e.id, t, n),
|
|
4716
4843
|
attachments: e.attachments,
|
|
4717
|
-
onStop:
|
|
4718
|
-
busy:
|
|
4719
|
-
onTranscribe:
|
|
4720
|
-
onCopy:
|
|
4721
|
-
onEdit: () =>
|
|
4722
|
-
onCancelEdit: () =>
|
|
4844
|
+
onStop: S,
|
|
4845
|
+
busy: w,
|
|
4846
|
+
onTranscribe: ie,
|
|
4847
|
+
onCopy: D,
|
|
4848
|
+
onEdit: () => T?.(e.id),
|
|
4849
|
+
onCancelEdit: () => E?.(e.id),
|
|
4723
4850
|
isEditing: e.ai.length > 0 && e.state === "typing",
|
|
4851
|
+
onLanded: oe ? ue : void 0,
|
|
4724
4852
|
animationConfig: i,
|
|
4725
4853
|
placeholder: r,
|
|
4726
|
-
menu:
|
|
4854
|
+
menu: ne
|
|
4727
4855
|
})
|
|
4728
4856
|
}), /* @__PURE__ */ v("div", {
|
|
4729
|
-
className:
|
|
4857
|
+
className: Nr.body,
|
|
4858
|
+
"data-held": oe || void 0,
|
|
4859
|
+
"aria-hidden": oe || void 0,
|
|
4730
4860
|
children: [
|
|
4731
|
-
|
|
4732
|
-
className:
|
|
4733
|
-
children: [/* @__PURE__ */ _(
|
|
4861
|
+
fe.map((t, n) => t.kind === "part" ? _e(t.part) : /* @__PURE__ */ v("div", {
|
|
4862
|
+
className: Nr.answer,
|
|
4863
|
+
children: [/* @__PURE__ */ _(Mr, {
|
|
4734
4864
|
text: t.text,
|
|
4735
|
-
marking:
|
|
4736
|
-
selectionMode:
|
|
4737
|
-
sources:
|
|
4738
|
-
onHighlightComplete:
|
|
4739
|
-
onReplyInThread:
|
|
4740
|
-
}),
|
|
4865
|
+
marking: g,
|
|
4866
|
+
selectionMode: h,
|
|
4867
|
+
sources: z,
|
|
4868
|
+
onHighlightComplete: g ? (t) => O?.(e.id, t) : void 0,
|
|
4869
|
+
onReplyInThread: g ? k : void 0
|
|
4870
|
+
}), he === n && ge]
|
|
4741
4871
|
}, `prose-${t.from}`)),
|
|
4742
|
-
e.state === "responding" && !e.ai &&
|
|
4743
|
-
className:
|
|
4744
|
-
children: /* @__PURE__ */ _(
|
|
4872
|
+
e.state === "responding" && !e.ai && de.length === 0 && /* @__PURE__ */ _("div", {
|
|
4873
|
+
className: Nr.answer,
|
|
4874
|
+
children: /* @__PURE__ */ _(Nt, {})
|
|
4745
4875
|
}),
|
|
4746
|
-
|
|
4747
|
-
className:
|
|
4876
|
+
he === fe.length && /* @__PURE__ */ _("div", {
|
|
4877
|
+
className: Nr.answer,
|
|
4748
4878
|
"data-actions-only": "",
|
|
4749
|
-
children:
|
|
4879
|
+
children: ge
|
|
4750
4880
|
})
|
|
4751
4881
|
]
|
|
4752
4882
|
})]
|
|
4753
4883
|
});
|
|
4754
|
-
return
|
|
4755
|
-
labels:
|
|
4756
|
-
children:
|
|
4757
|
-
}) :
|
|
4884
|
+
return L ? /* @__PURE__ */ _(Ae, {
|
|
4885
|
+
labels: L,
|
|
4886
|
+
children: ve
|
|
4887
|
+
}) : ve;
|
|
4758
4888
|
}, (e, t) => {
|
|
4759
4889
|
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
4760
4890
|
for (let r of n) {
|
|
@@ -4766,7 +4896,7 @@ var jr = {
|
|
|
4766
4896
|
if (!Object.is(e[r], t[r])) return !1;
|
|
4767
4897
|
}
|
|
4768
4898
|
return !0;
|
|
4769
|
-
}),
|
|
4899
|
+
}), Lr = {
|
|
4770
4900
|
context: "ick-context-ZOiv",
|
|
4771
4901
|
ring: "ick-ring-uVUc",
|
|
4772
4902
|
track: "ick-track---kg",
|
|
@@ -4775,7 +4905,7 @@ var jr = {
|
|
|
4775
4905
|
};
|
|
4776
4906
|
//#endregion
|
|
4777
4907
|
//#region src/Context/Context.tsx
|
|
4778
|
-
function
|
|
4908
|
+
function Rr(e) {
|
|
4779
4909
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
4780
4910
|
if (e >= 1e6) {
|
|
4781
4911
|
let t = e / 1e6;
|
|
@@ -4787,11 +4917,11 @@ function Ir(e) {
|
|
|
4787
4917
|
}
|
|
4788
4918
|
return String(Math.round(e));
|
|
4789
4919
|
}
|
|
4790
|
-
var
|
|
4791
|
-
function
|
|
4792
|
-
let s = H("context", i), c = t > 0 ? Math.min(1, Math.max(0, e / t)) : 0, l = Math.round(c * 100), u = c >= n, d = r === !1 ? null : r ?? `${l}%`, f = `${s.name}: ${l}%, ${
|
|
4920
|
+
var zr = 6, Br = 2 * Math.PI * zr;
|
|
4921
|
+
function Vr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className: a, ...o }) {
|
|
4922
|
+
let s = H("context", i), c = t > 0 ? Math.min(1, Math.max(0, e / t)) : 0, l = Math.round(c * 100), u = c >= n, d = r === !1 ? null : r ?? `${l}%`, f = `${s.name}: ${l}%, ${Rr(e)} ${s.of} ${Rr(t)} ${s.tokens}${u ? `. ${s.nearlyFull}` : ""}`;
|
|
4793
4923
|
return /* @__PURE__ */ v("div", {
|
|
4794
|
-
className: [
|
|
4924
|
+
className: [Lr.context, a ?? ""].filter(Boolean).join(" "),
|
|
4795
4925
|
"data-warn": u || void 0,
|
|
4796
4926
|
role: "meter",
|
|
4797
4927
|
"aria-valuenow": l,
|
|
@@ -4801,31 +4931,31 @@ function zr({ used: e, total: t, warnAt: n = .8, label: r, labels: i, className:
|
|
|
4801
4931
|
title: f,
|
|
4802
4932
|
...o,
|
|
4803
4933
|
children: [/* @__PURE__ */ v("svg", {
|
|
4804
|
-
className:
|
|
4934
|
+
className: Lr.ring,
|
|
4805
4935
|
viewBox: "0 0 16 16",
|
|
4806
4936
|
"aria-hidden": !0,
|
|
4807
4937
|
focusable: "false",
|
|
4808
4938
|
children: [/* @__PURE__ */ _("circle", {
|
|
4809
|
-
className:
|
|
4939
|
+
className: Lr.track,
|
|
4810
4940
|
cx: "8",
|
|
4811
4941
|
cy: "8",
|
|
4812
|
-
r:
|
|
4942
|
+
r: zr
|
|
4813
4943
|
}), /* @__PURE__ */ _("circle", {
|
|
4814
|
-
className:
|
|
4944
|
+
className: Lr.fill,
|
|
4815
4945
|
cx: "8",
|
|
4816
4946
|
cy: "8",
|
|
4817
|
-
r:
|
|
4818
|
-
strokeDasharray:
|
|
4819
|
-
strokeDashoffset:
|
|
4947
|
+
r: zr,
|
|
4948
|
+
strokeDasharray: Br,
|
|
4949
|
+
strokeDashoffset: Br * (1 - c),
|
|
4820
4950
|
transform: "rotate(-90 8 8)"
|
|
4821
4951
|
})]
|
|
4822
4952
|
}), d !== null && /* @__PURE__ */ _("span", {
|
|
4823
|
-
className:
|
|
4953
|
+
className: Lr.label,
|
|
4824
4954
|
children: d
|
|
4825
4955
|
})]
|
|
4826
4956
|
});
|
|
4827
4957
|
}
|
|
4828
|
-
var
|
|
4958
|
+
var Hr = {
|
|
4829
4959
|
pane: "ick-pane-Yv8Y",
|
|
4830
4960
|
grabber: "ick-grabber-OhMd",
|
|
4831
4961
|
head: "ick-head-p2-j",
|
|
@@ -4839,7 +4969,7 @@ var Br = {
|
|
|
4839
4969
|
};
|
|
4840
4970
|
//#endregion
|
|
4841
4971
|
//#region src/Artifact/ArtifactPane.tsx
|
|
4842
|
-
function
|
|
4972
|
+
function Ur({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expanded: a = !1, onToggleExpanded: o, closeLabel: s, expandLabel: u, collapseLabel: d, className: f, ...m }) {
|
|
4843
4973
|
let h = H("pane"), g = s ?? h.close, y = u ?? h.expand, b = d ?? h.collapse, x = l(), S = p(null), C = p(null);
|
|
4844
4974
|
return c(() => {
|
|
4845
4975
|
C.current?.focus({ preventScroll: !0 });
|
|
@@ -4858,34 +4988,35 @@ function Vr({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4858
4988
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
4859
4989
|
}, [i]), /* @__PURE__ */ v("div", {
|
|
4860
4990
|
ref: S,
|
|
4861
|
-
className: [
|
|
4991
|
+
className: [Hr.pane, f ?? ""].filter(Boolean).join(" "),
|
|
4862
4992
|
"aria-labelledby": x,
|
|
4863
4993
|
"aria-modal": i || void 0,
|
|
4864
4994
|
role: i ? "dialog" : "complementary",
|
|
4865
4995
|
...m,
|
|
4866
4996
|
children: [
|
|
4867
4997
|
i && /* @__PURE__ */ _("span", {
|
|
4868
|
-
className:
|
|
4998
|
+
className: Hr.grabber,
|
|
4869
4999
|
"aria-hidden": !0
|
|
4870
5000
|
}),
|
|
4871
5001
|
/* @__PURE__ */ v("div", {
|
|
4872
|
-
className:
|
|
5002
|
+
className: Hr.head,
|
|
4873
5003
|
children: [
|
|
4874
5004
|
/* @__PURE__ */ v("div", {
|
|
4875
|
-
className:
|
|
5005
|
+
className: Hr.headText,
|
|
4876
5006
|
children: [/* @__PURE__ */ _("h2", {
|
|
4877
|
-
className:
|
|
5007
|
+
className: Hr.title,
|
|
4878
5008
|
id: x,
|
|
4879
5009
|
ref: C,
|
|
4880
5010
|
tabIndex: -1,
|
|
4881
5011
|
children: e
|
|
4882
5012
|
}), t && /* @__PURE__ */ _("p", {
|
|
4883
|
-
className:
|
|
5013
|
+
className: Hr.meta,
|
|
4884
5014
|
children: t
|
|
4885
5015
|
})]
|
|
4886
5016
|
}),
|
|
4887
5017
|
o && !i && /* @__PURE__ */ _(V, {
|
|
4888
5018
|
variant: "ghost",
|
|
5019
|
+
"data-ick-role": "pane-expand",
|
|
4889
5020
|
size: "s",
|
|
4890
5021
|
icon: _(a ? se : R, {
|
|
4891
5022
|
size: 15,
|
|
@@ -4897,6 +5028,7 @@ function Vr({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4897
5028
|
}),
|
|
4898
5029
|
r && /* @__PURE__ */ _(V, {
|
|
4899
5030
|
variant: "ghost",
|
|
5031
|
+
"data-ick-role": "pane-close",
|
|
4900
5032
|
size: "s",
|
|
4901
5033
|
icon: /* @__PURE__ */ _(we, {
|
|
4902
5034
|
size: 15,
|
|
@@ -4908,15 +5040,15 @@ function Vr({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
|
|
|
4908
5040
|
]
|
|
4909
5041
|
}),
|
|
4910
5042
|
/* @__PURE__ */ _("div", {
|
|
4911
|
-
className:
|
|
4912
|
-
children: n ?? /* @__PURE__ */ _(
|
|
5043
|
+
className: Hr.body,
|
|
5044
|
+
children: n ?? /* @__PURE__ */ _(Wr, {})
|
|
4913
5045
|
})
|
|
4914
5046
|
]
|
|
4915
5047
|
});
|
|
4916
5048
|
}
|
|
4917
|
-
function
|
|
5049
|
+
function Wr() {
|
|
4918
5050
|
return /* @__PURE__ */ _("div", {
|
|
4919
|
-
className:
|
|
5051
|
+
className: Hr.skeleton,
|
|
4920
5052
|
"aria-hidden": !0,
|
|
4921
5053
|
children: [
|
|
4922
5054
|
68,
|
|
@@ -4927,18 +5059,18 @@ function Hr() {
|
|
|
4927
5059
|
100,
|
|
4928
5060
|
84
|
|
4929
5061
|
].map((e, t) => /* @__PURE__ */ _("span", {
|
|
4930
|
-
className:
|
|
5062
|
+
className: Hr.line,
|
|
4931
5063
|
style: { width: `${e}%` }
|
|
4932
5064
|
}, t))
|
|
4933
5065
|
});
|
|
4934
5066
|
}
|
|
4935
|
-
var
|
|
5067
|
+
var Gr = {
|
|
4936
5068
|
layout: "ick-layout-nC6G",
|
|
4937
5069
|
chat: "ick-chat-OTXm",
|
|
4938
5070
|
card: "ick-card-Iddg",
|
|
4939
5071
|
slot: "ick-slot-O--R",
|
|
4940
5072
|
scrim: "ick-scrim-11Pp"
|
|
4941
|
-
},
|
|
5073
|
+
}, Kr = 760, qr = {
|
|
4942
5074
|
closed: {
|
|
4943
5075
|
width: 0,
|
|
4944
5076
|
transition: {
|
|
@@ -4956,7 +5088,7 @@ var Ur = {
|
|
|
4956
5088
|
bounce: 0
|
|
4957
5089
|
}
|
|
4958
5090
|
}
|
|
4959
|
-
},
|
|
5091
|
+
}, Jr = {
|
|
4960
5092
|
closed: {
|
|
4961
5093
|
opacity: 0,
|
|
4962
5094
|
x: 24,
|
|
@@ -4975,7 +5107,7 @@ var Ur = {
|
|
|
4975
5107
|
delay: .06
|
|
4976
5108
|
}
|
|
4977
5109
|
}
|
|
4978
|
-
},
|
|
5110
|
+
}, Yr = {
|
|
4979
5111
|
closed: {
|
|
4980
5112
|
y: "100%",
|
|
4981
5113
|
transition: {
|
|
@@ -4992,7 +5124,7 @@ var Ur = {
|
|
|
4992
5124
|
bounce: .18
|
|
4993
5125
|
}
|
|
4994
5126
|
}
|
|
4995
|
-
},
|
|
5127
|
+
}, Xr = {
|
|
4996
5128
|
closed: {
|
|
4997
5129
|
opacity: 0,
|
|
4998
5130
|
transition: { duration: .18 }
|
|
@@ -5001,34 +5133,34 @@ var Ur = {
|
|
|
5001
5133
|
opacity: 1,
|
|
5002
5134
|
transition: { duration: .26 }
|
|
5003
5135
|
}
|
|
5004
|
-
},
|
|
5136
|
+
}, Zr = { transition: { duration: 0 } }, Qr = (e) => ({
|
|
5005
5137
|
closed: {
|
|
5006
5138
|
...e.closed,
|
|
5007
|
-
...
|
|
5139
|
+
...Zr
|
|
5008
5140
|
},
|
|
5009
5141
|
open: {
|
|
5010
5142
|
...e.open,
|
|
5011
|
-
...
|
|
5143
|
+
...Zr
|
|
5012
5144
|
}
|
|
5013
5145
|
});
|
|
5014
|
-
function
|
|
5146
|
+
function $r({ children: e, pane: t, onDismiss: n, surface: r = "flush", className: i, ...a }) {
|
|
5015
5147
|
let s = p(null), [l, u] = m(!1), [d, h] = m(!1), g = o(() => h((e) => !e), []), b = E(), [x, S, w] = f(() => {
|
|
5016
|
-
let e = l ?
|
|
5148
|
+
let e = l ? Yr : qr, t = l ? void 0 : Jr;
|
|
5017
5149
|
return b ? [
|
|
5018
|
-
|
|
5019
|
-
t &&
|
|
5020
|
-
Xr
|
|
5150
|
+
Qr(e),
|
|
5151
|
+
t && Qr(t),
|
|
5152
|
+
Qr(Xr)
|
|
5021
5153
|
] : [
|
|
5022
5154
|
e,
|
|
5023
5155
|
t,
|
|
5024
|
-
|
|
5156
|
+
Xr
|
|
5025
5157
|
];
|
|
5026
5158
|
}, [b, l]);
|
|
5027
5159
|
c(() => {
|
|
5028
5160
|
let e = s.current;
|
|
5029
5161
|
if (!e || typeof ResizeObserver > "u") return;
|
|
5030
5162
|
let t = new ResizeObserver(([e]) => {
|
|
5031
|
-
u(e.contentRect.width <=
|
|
5163
|
+
u(e.contentRect.width <= Kr);
|
|
5032
5164
|
});
|
|
5033
5165
|
return t.observe(e), () => t.disconnect();
|
|
5034
5166
|
}, []);
|
|
@@ -5039,17 +5171,17 @@ function Zr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5039
5171
|
});
|
|
5040
5172
|
return /* @__PURE__ */ v("div", {
|
|
5041
5173
|
ref: s,
|
|
5042
|
-
className: [
|
|
5174
|
+
className: [Gr.layout, i ?? ""].filter(Boolean).join(" "),
|
|
5043
5175
|
"data-pane": T ? "" : void 0,
|
|
5044
5176
|
"data-surface": r === "panes" ? "panes" : void 0,
|
|
5045
5177
|
...a,
|
|
5046
5178
|
children: [/* @__PURE__ */ _("div", {
|
|
5047
|
-
className:
|
|
5179
|
+
className: Gr.chat,
|
|
5048
5180
|
children: e
|
|
5049
5181
|
}), /* @__PURE__ */ v(y, {
|
|
5050
5182
|
initial: !1,
|
|
5051
5183
|
children: [T && l && n && /* @__PURE__ */ _(C.div, {
|
|
5052
|
-
className:
|
|
5184
|
+
className: Gr.scrim,
|
|
5053
5185
|
variants: w,
|
|
5054
5186
|
initial: "closed",
|
|
5055
5187
|
animate: "open",
|
|
@@ -5057,13 +5189,13 @@ function Zr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5057
5189
|
"aria-hidden": !0,
|
|
5058
5190
|
onClick: n
|
|
5059
5191
|
}, "scrim"), T && /* @__PURE__ */ _(C.div, {
|
|
5060
|
-
className:
|
|
5192
|
+
className: Gr.slot,
|
|
5061
5193
|
variants: x,
|
|
5062
5194
|
initial: "closed",
|
|
5063
5195
|
animate: "open",
|
|
5064
5196
|
exit: "closed",
|
|
5065
5197
|
children: /* @__PURE__ */ _(C.div, {
|
|
5066
|
-
className:
|
|
5198
|
+
className: Gr.card,
|
|
5067
5199
|
"data-expanded": d && !l || void 0,
|
|
5068
5200
|
variants: S,
|
|
5069
5201
|
...l && n ? {
|
|
@@ -5089,7 +5221,7 @@ function Zr({ children: e, pane: t, onDismiss: n, surface: r = "flush", classNam
|
|
|
5089
5221
|
}
|
|
5090
5222
|
//#endregion
|
|
5091
5223
|
//#region src/Artifact/useArtifacts.ts
|
|
5092
|
-
function
|
|
5224
|
+
function ei(e = null) {
|
|
5093
5225
|
let [t, n] = m(e);
|
|
5094
5226
|
return {
|
|
5095
5227
|
openId: t,
|
|
@@ -5098,14 +5230,14 @@ function Qr(e = null) {
|
|
|
5098
5230
|
toggle: o((e) => n((t) => t === e ? null : e), [])
|
|
5099
5231
|
};
|
|
5100
5232
|
}
|
|
5101
|
-
var
|
|
5233
|
+
var ti = {
|
|
5102
5234
|
root: "ick-root-JrOP",
|
|
5103
5235
|
viewport: "ick-viewport-C3hz",
|
|
5104
5236
|
content: "ick-content-33lN",
|
|
5105
5237
|
jump: "ick-jump-nd6O"
|
|
5106
|
-
},
|
|
5238
|
+
}, ni = 64, ri = 500, ii = .2, ai = 120, oi = 50, si = 4, ci = (e, t) => e.offsetTop - t.offsetTop, li = (e, t) => t ? e.querySelector(`[id="${CSS.escape(t)}"]`) : null, ui = (e) => (e.lastElementChild?.offsetHeight ?? 0) + (parseFloat(getComputedStyle(e).rowGap) || 0), di = (e, t, n) => {
|
|
5107
5239
|
n !== t.current && (t.current = n, e.style.setProperty("--ick-conversation-tail", `${Math.round(n)}px`));
|
|
5108
|
-
},
|
|
5240
|
+
}, fi = r(function({ children: e, anchorId: t, anchorOffset: n = 0, endOffset: r = 0, tail: i = "auto", threshold: a = ni, scrollButton: s = !0, scrollButtonLabel: l, follow: f = !0, dock: h = !1, className: g, viewportClassName: y, onScroll: b, ...x }, S) {
|
|
5109
5241
|
let C = H("conversation").jump, w = l ?? C, T = p(null);
|
|
5110
5242
|
u(S, () => T.current, []);
|
|
5111
5243
|
let E = p(null), O = p(null), [k, A] = m(!0);
|
|
@@ -5121,98 +5253,140 @@ var $r = {
|
|
|
5121
5253
|
r.disconnect(), t.style.removeProperty("--ick-dock-height");
|
|
5122
5254
|
};
|
|
5123
5255
|
}, [h]);
|
|
5124
|
-
let j = p(-1), M = p(null), ee = p(!1), te = o(() => {
|
|
5256
|
+
let j = p(-1), M = p(-1), N = p(null), ee = p(!1), te = o(() => {
|
|
5125
5257
|
let e = T.current, t = E.current;
|
|
5126
5258
|
if (!e || !t) return 0;
|
|
5127
5259
|
if (i === "auto" && ee.current) return Math.max(0, e.scrollHeight - e.clientHeight);
|
|
5128
|
-
let n = h ? null : t.lastElementChild, a = n ?
|
|
5260
|
+
let n = h ? null : t.lastElementChild, a = n ? ci(n, e) + n.offsetHeight : ci(t, e) + t.offsetHeight - (h ? 0 : j.current);
|
|
5129
5261
|
return Math.max(0, a + r - e.clientHeight);
|
|
5130
5262
|
}, [
|
|
5131
5263
|
h,
|
|
5132
5264
|
r,
|
|
5133
5265
|
i
|
|
5134
|
-
]),
|
|
5266
|
+
]), P = o(() => {
|
|
5135
5267
|
let e = T.current, a = E.current;
|
|
5136
5268
|
if (!e || !a) return;
|
|
5137
|
-
if (i !== "auto") return
|
|
5138
|
-
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l =
|
|
5139
|
-
if (ee.current = !!c && !!l, !ee.current || !c || !l) return
|
|
5140
|
-
|
|
5141
|
-
|
|
5269
|
+
if (i !== "auto") return di(a, j, Math.max(0, i));
|
|
5270
|
+
let o = parseFloat(getComputedStyle(e).paddingBottom) || 0, s = Math.max(0, r - o), c = a.lastElementChild, l = li(e, N.current);
|
|
5271
|
+
if (ee.current = !!c && !!l, !ee.current || !c || !l) return di(a, j, s);
|
|
5272
|
+
if (h) {
|
|
5273
|
+
let t = Math.max(0, e.clientHeight - n - o - ui(a));
|
|
5274
|
+
return t !== M.current && (M.current = t, a.style.setProperty("--ick-conversation-room", `${Math.round(t)}px`)), di(a, j, s);
|
|
5275
|
+
}
|
|
5276
|
+
let u = ci(c, e) + c.offsetHeight - ci(l, e), d = Math.max(s, e.clientHeight - n - u - o);
|
|
5277
|
+
di(a, j, t ? Math.max(d, j.current) : d);
|
|
5142
5278
|
}, [
|
|
5143
5279
|
i,
|
|
5144
5280
|
n,
|
|
5145
5281
|
r,
|
|
5146
5282
|
t,
|
|
5147
5283
|
h
|
|
5148
|
-
]),
|
|
5284
|
+
]), F = o(() => {
|
|
5149
5285
|
let e = T.current;
|
|
5150
5286
|
if (!e) return 0;
|
|
5151
5287
|
if (t) {
|
|
5152
5288
|
let r = e.querySelector(`[id="${CSS.escape(t)}"]`);
|
|
5153
5289
|
if (r) {
|
|
5154
|
-
let t = Math.max(0, e.scrollHeight - e.clientHeight), i =
|
|
5155
|
-
return Math.max(0, Math.min(Math.max(a,
|
|
5290
|
+
let t = Math.max(0, e.scrollHeight - e.clientHeight), i = ci(r, e), a = i - n, o = h && E.current ? ui(E.current) : 0, s = i + r.offsetHeight + o - e.clientHeight;
|
|
5291
|
+
return Math.max(0, Math.min(Math.max(a, s), t));
|
|
5156
5292
|
}
|
|
5157
5293
|
}
|
|
5158
5294
|
return te();
|
|
5159
5295
|
}, [
|
|
5160
5296
|
t,
|
|
5161
5297
|
n,
|
|
5162
|
-
te
|
|
5163
|
-
|
|
5298
|
+
te,
|
|
5299
|
+
h
|
|
5300
|
+
]), I = p(0), ne = p(null), L = o((e) => {
|
|
5164
5301
|
let t = T.current;
|
|
5165
5302
|
if (!t) return;
|
|
5166
|
-
let n = e && !
|
|
5167
|
-
|
|
5168
|
-
top:
|
|
5303
|
+
let n = e && !G();
|
|
5304
|
+
I.current = n ? performance.now() + ri : 0, t.scrollTo({
|
|
5305
|
+
top: F(),
|
|
5169
5306
|
behavior: n ? "smooth" : "auto"
|
|
5170
5307
|
}), A(!0);
|
|
5171
|
-
}, [
|
|
5308
|
+
}, [F]);
|
|
5172
5309
|
d(() => {
|
|
5173
|
-
t && (
|
|
5310
|
+
t && (N.current = t);
|
|
5174
5311
|
let e = T.current, n = E.current;
|
|
5175
|
-
if (
|
|
5176
|
-
let r = new ResizeObserver(
|
|
5312
|
+
if (P(), !e || !n || typeof ResizeObserver > "u") return;
|
|
5313
|
+
let r = new ResizeObserver(P);
|
|
5177
5314
|
return r.observe(n), r.observe(e), () => r.disconnect();
|
|
5178
|
-
}, [t,
|
|
5315
|
+
}, [t, P]), d(() => {
|
|
5179
5316
|
if (!f || !k && !t) return;
|
|
5180
5317
|
let e = T.current, n = E.current;
|
|
5181
5318
|
if (!e || !n || typeof ResizeObserver > "u") return;
|
|
5182
|
-
let r = () => {
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5319
|
+
let r = 0, i = () => {
|
|
5320
|
+
I.current = 0;
|
|
5321
|
+
let t = F();
|
|
5322
|
+
if (Math.abs(t - e.scrollTop) > a && !G()) {
|
|
5323
|
+
I.current = performance.now() + ri, e.scrollTo({
|
|
5324
|
+
top: t,
|
|
5325
|
+
behavior: "smooth"
|
|
5326
|
+
}), r = window.setTimeout(i, 550);
|
|
5327
|
+
return;
|
|
5187
5328
|
}
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5329
|
+
e.scrollTop = t;
|
|
5330
|
+
}, o = () => {
|
|
5331
|
+
let n = F();
|
|
5332
|
+
if (I.current) {
|
|
5333
|
+
let t = I.current - performance.now();
|
|
5334
|
+
if (t > 0 && Math.abs(e.scrollTop - n) > 1) {
|
|
5335
|
+
window.clearTimeout(r), r = window.setTimeout(i, t + oi);
|
|
5336
|
+
return;
|
|
5337
|
+
}
|
|
5338
|
+
I.current = 0;
|
|
5339
|
+
}
|
|
5340
|
+
let o = n - e.scrollTop;
|
|
5341
|
+
if (N.current && !t && !G() && h) {
|
|
5342
|
+
!s && Math.abs(o) > si && (window.clearTimeout(c), c = window.setTimeout(l, ai));
|
|
5343
|
+
return;
|
|
5344
|
+
}
|
|
5345
|
+
if (N.current && !t && Math.abs(o) > a && !G()) {
|
|
5346
|
+
I.current = performance.now() + ri, e.scrollTo({
|
|
5191
5347
|
top: n,
|
|
5192
5348
|
behavior: "smooth"
|
|
5193
5349
|
});
|
|
5194
5350
|
return;
|
|
5195
5351
|
}
|
|
5196
5352
|
e.scrollTop = n;
|
|
5197
|
-
},
|
|
5198
|
-
|
|
5199
|
-
|
|
5353
|
+
}, s = 0, c = 0, l = () => {
|
|
5354
|
+
if (s) return;
|
|
5355
|
+
if (typeof requestAnimationFrame > "u") {
|
|
5356
|
+
e.scrollTop = F();
|
|
5357
|
+
return;
|
|
5358
|
+
}
|
|
5359
|
+
let t = () => {
|
|
5360
|
+
let n = F(), r = n - e.scrollTop;
|
|
5361
|
+
if (Math.abs(r) <= 1) {
|
|
5362
|
+
e.scrollTop = n, s = 0;
|
|
5363
|
+
return;
|
|
5364
|
+
}
|
|
5365
|
+
e.scrollTop += Math.sign(r) * Math.max(1, Math.abs(r) * ii), s = requestAnimationFrame(t);
|
|
5366
|
+
};
|
|
5367
|
+
s = requestAnimationFrame(t);
|
|
5368
|
+
}, u = t != null && t !== ne.current;
|
|
5369
|
+
t && (ne.current = t), u && !G() && Math.abs(e.scrollTop - F()) > a ? (I.current = performance.now() + ri, e.scrollTo({
|
|
5370
|
+
top: F(),
|
|
5200
5371
|
behavior: "smooth"
|
|
5201
|
-
})) :
|
|
5202
|
-
let
|
|
5203
|
-
return
|
|
5372
|
+
})) : o();
|
|
5373
|
+
let d = new ResizeObserver(o);
|
|
5374
|
+
return d.observe(n), () => {
|
|
5375
|
+
d.disconnect(), window.clearTimeout(r), s && cancelAnimationFrame(s), window.clearTimeout(c);
|
|
5376
|
+
};
|
|
5204
5377
|
}, [
|
|
5205
5378
|
f,
|
|
5206
5379
|
k,
|
|
5207
|
-
|
|
5380
|
+
F,
|
|
5208
5381
|
t,
|
|
5209
|
-
a
|
|
5382
|
+
a,
|
|
5383
|
+
h
|
|
5210
5384
|
]), c(() => {
|
|
5211
5385
|
if (!f) return;
|
|
5212
5386
|
let e = T.current;
|
|
5213
5387
|
if (!e) return;
|
|
5214
5388
|
let n = () => {
|
|
5215
|
-
|
|
5389
|
+
I.current = 0, Math.abs(e.scrollTop - F()) > a && A(!1);
|
|
5216
5390
|
}, r = (e) => {
|
|
5217
5391
|
t ? n() : e.deltaY < 0 && A(!1);
|
|
5218
5392
|
}, i = (e) => {
|
|
@@ -5238,40 +5412,40 @@ var $r = {
|
|
|
5238
5412
|
}, [
|
|
5239
5413
|
f,
|
|
5240
5414
|
a,
|
|
5241
|
-
|
|
5415
|
+
F,
|
|
5242
5416
|
t
|
|
5243
5417
|
]);
|
|
5244
5418
|
let re = o((e) => {
|
|
5245
5419
|
if (b?.(e), !f) return;
|
|
5246
5420
|
let t = T.current;
|
|
5247
|
-
t && Math.abs(t.scrollTop -
|
|
5421
|
+
t && Math.abs(t.scrollTop - F()) <= si && (I.current = 0, A(!0));
|
|
5248
5422
|
}, [
|
|
5249
5423
|
f,
|
|
5250
5424
|
b,
|
|
5251
|
-
|
|
5252
|
-
]),
|
|
5425
|
+
F
|
|
5426
|
+
]), ie = f && !k;
|
|
5253
5427
|
return /* @__PURE__ */ v("div", {
|
|
5254
5428
|
ref: O,
|
|
5255
|
-
className: [
|
|
5429
|
+
className: [ti.root, g ?? ""].filter(Boolean).join(" "),
|
|
5256
5430
|
"data-dock": h || void 0,
|
|
5257
5431
|
children: [/* @__PURE__ */ _("div", {
|
|
5258
5432
|
ref: T,
|
|
5259
|
-
className: [
|
|
5433
|
+
className: [ti.viewport, y ?? ""].filter(Boolean).join(" "),
|
|
5260
5434
|
onScroll: re,
|
|
5261
5435
|
...x,
|
|
5262
5436
|
children: /* @__PURE__ */ _("div", {
|
|
5263
5437
|
ref: E,
|
|
5264
|
-
className:
|
|
5438
|
+
className: ti.content,
|
|
5265
5439
|
"data-dock": h || void 0,
|
|
5266
5440
|
children: e
|
|
5267
5441
|
})
|
|
5268
5442
|
}), s && /* @__PURE__ */ _("button", {
|
|
5269
5443
|
type: "button",
|
|
5270
|
-
className:
|
|
5271
|
-
"data-shown":
|
|
5272
|
-
tabIndex:
|
|
5273
|
-
"aria-hidden": !
|
|
5274
|
-
onClick: () =>
|
|
5444
|
+
className: ti.jump,
|
|
5445
|
+
"data-shown": ie || void 0,
|
|
5446
|
+
tabIndex: ie ? 0 : -1,
|
|
5447
|
+
"aria-hidden": !ie || void 0,
|
|
5448
|
+
onClick: () => L(!0),
|
|
5275
5449
|
"aria-label": w,
|
|
5276
5450
|
children: /* @__PURE__ */ _(D, {
|
|
5277
5451
|
size: 15,
|
|
@@ -5279,7 +5453,7 @@ var $r = {
|
|
|
5279
5453
|
})
|
|
5280
5454
|
})]
|
|
5281
5455
|
});
|
|
5282
|
-
}),
|
|
5456
|
+
}), pi = {
|
|
5283
5457
|
empty: "ick-empty-BP6G",
|
|
5284
5458
|
icon: "ick-icon-rZWd",
|
|
5285
5459
|
title: "ick-title-AoPi",
|
|
@@ -5288,31 +5462,32 @@ var $r = {
|
|
|
5288
5462
|
};
|
|
5289
5463
|
//#endregion
|
|
5290
5464
|
//#region src/EmptyState/EmptyState.tsx
|
|
5291
|
-
function
|
|
5465
|
+
function mi({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i, suggestionsLabel: a, children: o, className: s, ...c }) {
|
|
5292
5466
|
let l = H("emptyState").suggestions, u = a ?? l, d = i ? r ?? [] : [];
|
|
5293
5467
|
return /* @__PURE__ */ v("div", {
|
|
5294
|
-
className: [
|
|
5468
|
+
className: [pi.empty, s ?? ""].filter(Boolean).join(" "),
|
|
5295
5469
|
...c,
|
|
5296
5470
|
children: [
|
|
5297
5471
|
e && /* @__PURE__ */ _("div", {
|
|
5298
|
-
className:
|
|
5472
|
+
className: pi.icon,
|
|
5299
5473
|
children: e
|
|
5300
5474
|
}),
|
|
5301
5475
|
t && /* @__PURE__ */ _("div", {
|
|
5302
|
-
className:
|
|
5476
|
+
className: pi.title,
|
|
5303
5477
|
children: t
|
|
5304
5478
|
}),
|
|
5305
5479
|
n && /* @__PURE__ */ _("p", {
|
|
5306
|
-
className:
|
|
5480
|
+
className: pi.description,
|
|
5307
5481
|
children: n
|
|
5308
5482
|
}),
|
|
5309
5483
|
d.length > 0 && /* @__PURE__ */ _("div", {
|
|
5310
|
-
className:
|
|
5484
|
+
className: pi.suggestions,
|
|
5311
5485
|
role: "group",
|
|
5312
5486
|
"aria-label": u,
|
|
5313
5487
|
children: d.map((e) => /* @__PURE__ */ _(V, {
|
|
5314
5488
|
variant: "primary",
|
|
5315
5489
|
size: "m",
|
|
5490
|
+
"data-ick-role": "suggestion",
|
|
5316
5491
|
onClick: () => i?.(e),
|
|
5317
5492
|
children: e
|
|
5318
5493
|
}, e))
|
|
@@ -5323,14 +5498,14 @@ function ci({ icon: e, title: t, description: n, suggestions: r, onSuggestion: i
|
|
|
5323
5498
|
}
|
|
5324
5499
|
//#endregion
|
|
5325
5500
|
//#region src/ReplyThreadPopup/placePanel.ts
|
|
5326
|
-
var
|
|
5327
|
-
function
|
|
5328
|
-
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width +
|
|
5501
|
+
var hi = 24, gi = 480, _i = 80, vi = 260;
|
|
5502
|
+
function yi(e, t, n = Infinity) {
|
|
5503
|
+
let r = Math.max(t - 48, 0), i = Math.min(Math.max(e.width + _i, gi), r), a = e.left + e.width / 2 - i / 2, o = Math.min(Math.max(a, hi), t - hi - i), s = Math.max(hi, n - hi - vi), c = Math.min(Math.max(e.top - hi, Math.min(hi, n)), Number.isFinite(s) ? s : Infinity);
|
|
5329
5504
|
return {
|
|
5330
5505
|
x: o,
|
|
5331
5506
|
y: c,
|
|
5332
5507
|
width: i,
|
|
5333
|
-
maxHeight: Number.isFinite(n) ? Math.max(
|
|
5508
|
+
maxHeight: Number.isFinite(n) ? Math.max(vi, n - c - hi) : Infinity
|
|
5334
5509
|
};
|
|
5335
5510
|
}
|
|
5336
5511
|
var Q = {
|
|
@@ -5354,7 +5529,7 @@ var Q = {
|
|
|
5354
5529
|
turn: "ick-turn-ogjU",
|
|
5355
5530
|
turnRow: "ick-turnRow-0OuP",
|
|
5356
5531
|
srOnly: "ick-srOnly-LwE1"
|
|
5357
|
-
},
|
|
5532
|
+
}, bi = 760, xi = {
|
|
5358
5533
|
closed: {
|
|
5359
5534
|
y: "100%",
|
|
5360
5535
|
opacity: 1,
|
|
@@ -5373,16 +5548,16 @@ var Q = {
|
|
|
5373
5548
|
bounce: .18
|
|
5374
5549
|
}
|
|
5375
5550
|
}
|
|
5376
|
-
},
|
|
5377
|
-
function
|
|
5378
|
-
let i = H("thread"), { responding: a } = H("experience"), [o, s] = m("none"), u = p(null), d = p(null), f = p(null), [h] = m(() => typeof document > "u" ? null : document.activeElement), g = l(), y = l(), b = rt, [S, w] = m(() => typeof window > "u" ? !1 : window.matchMedia?.(`(max-width: ${
|
|
5551
|
+
}, Si = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])";
|
|
5552
|
+
function Ci({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
5553
|
+
let i = H("thread"), { responding: a } = H("experience"), [o, s] = m("none"), u = p(null), d = p(null), f = p(null), [h] = m(() => typeof document > "u" ? null : document.activeElement), g = l(), y = l(), b = rt, [S, w] = m(() => typeof window > "u" ? !1 : window.matchMedia?.(`(max-width: ${bi}px)`)?.matches ?? !1);
|
|
5379
5554
|
c(() => {
|
|
5380
|
-
let e = window.matchMedia?.(`(max-width: ${
|
|
5555
|
+
let e = window.matchMedia?.(`(max-width: ${bi}px)`);
|
|
5381
5556
|
if (!e?.addEventListener) return;
|
|
5382
5557
|
let t = () => w(e.matches);
|
|
5383
5558
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5384
5559
|
}, []);
|
|
5385
|
-
let T = e.text, { turns: E, setDraft: D, submit: O, stop: k, beginEdit: A } =
|
|
5560
|
+
let T = e.text, { turns: E, setDraft: D, submit: O, stop: k, beginEdit: A } = gt({
|
|
5386
5561
|
onSend: (e, t) => r(e, T, t),
|
|
5387
5562
|
announcements: { responding: a }
|
|
5388
5563
|
});
|
|
@@ -5396,7 +5571,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5396
5571
|
return;
|
|
5397
5572
|
}
|
|
5398
5573
|
if (e.key !== "Tab") return;
|
|
5399
|
-
let n = [...f.current?.querySelectorAll(
|
|
5574
|
+
let n = [...f.current?.querySelectorAll(Si) ?? []];
|
|
5400
5575
|
if (n.length === 0) return;
|
|
5401
5576
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
5402
5577
|
e.shiftKey && a === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
|
|
@@ -5428,12 +5603,12 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5428
5603
|
behavior: "smooth"
|
|
5429
5604
|
});
|
|
5430
5605
|
}, [E]);
|
|
5431
|
-
let { x:
|
|
5606
|
+
let { x: N, y: ee, width: te, maxHeight: P } = typeof window > "u" ? {
|
|
5432
5607
|
x: 0,
|
|
5433
5608
|
y: 0,
|
|
5434
5609
|
width: 480,
|
|
5435
5610
|
maxHeight: Infinity
|
|
5436
|
-
} :
|
|
5611
|
+
} : yi(e.rect, window.innerWidth, window.innerHeight);
|
|
5437
5612
|
return /* @__PURE__ */ _(x, {
|
|
5438
5613
|
reducedMotion: "user",
|
|
5439
5614
|
children: /* @__PURE__ */ _("div", {
|
|
@@ -5456,9 +5631,9 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5456
5631
|
opacity: 0
|
|
5457
5632
|
},
|
|
5458
5633
|
animate: S ? "open" : {
|
|
5459
|
-
left:
|
|
5460
|
-
top:
|
|
5461
|
-
width:
|
|
5634
|
+
left: N,
|
|
5635
|
+
top: ee,
|
|
5636
|
+
width: te,
|
|
5462
5637
|
borderRadius: 28,
|
|
5463
5638
|
opacity: 1
|
|
5464
5639
|
},
|
|
@@ -5467,7 +5642,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5467
5642
|
scale: .95,
|
|
5468
5643
|
filter: "blur(4px)"
|
|
5469
5644
|
},
|
|
5470
|
-
variants: S ?
|
|
5645
|
+
variants: S ? xi : void 0,
|
|
5471
5646
|
transition: S ? void 0 : {
|
|
5472
5647
|
type: "spring",
|
|
5473
5648
|
bounce: 0,
|
|
@@ -5517,11 +5692,13 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5517
5692
|
className: Q.headerActions,
|
|
5518
5693
|
children: [/* @__PURE__ */ _(V, {
|
|
5519
5694
|
variant: "primary",
|
|
5695
|
+
"data-ick-role": "thread-save",
|
|
5520
5696
|
icon: /* @__PURE__ */ _(he, { size: 16 }),
|
|
5521
5697
|
onClick: n,
|
|
5522
5698
|
children: i.save
|
|
5523
5699
|
}), /* @__PURE__ */ _(V, {
|
|
5524
5700
|
variant: "secondary",
|
|
5701
|
+
"data-ick-role": "thread-close",
|
|
5525
5702
|
icon: /* @__PURE__ */ _(we, { size: 16 }),
|
|
5526
5703
|
onClick: t,
|
|
5527
5704
|
"aria-label": i.close
|
|
@@ -5580,7 +5757,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5580
5757
|
children: [/* @__PURE__ */ _("div", {
|
|
5581
5758
|
className: Q.turnRow,
|
|
5582
5759
|
"data-editing": r || void 0,
|
|
5583
|
-
children: /* @__PURE__ */ _(
|
|
5760
|
+
children: /* @__PURE__ */ _(st, {
|
|
5584
5761
|
ref: n ? u : null,
|
|
5585
5762
|
state: e.state,
|
|
5586
5763
|
value: e.user,
|
|
@@ -5611,7 +5788,7 @@ function _i({ activeReply: e, onClose: t, onSave: n, onSendMessage: r }) {
|
|
|
5611
5788
|
}
|
|
5612
5789
|
//#endregion
|
|
5613
5790
|
//#region src/CustomCursor/CustomCursor.tsx
|
|
5614
|
-
function
|
|
5791
|
+
function wi() {
|
|
5615
5792
|
let e = T(-100), t = T(-100), [n, r] = m("default"), [i, a] = m(!1), [o, s] = m(!1);
|
|
5616
5793
|
return c(() => {
|
|
5617
5794
|
let n = (n) => {
|
|
@@ -5769,7 +5946,7 @@ function vi() {
|
|
|
5769
5946
|
}
|
|
5770
5947
|
//#endregion
|
|
5771
5948
|
//#region src/theme/useThemeAttribute.ts
|
|
5772
|
-
function
|
|
5949
|
+
function Ti(e) {
|
|
5773
5950
|
c(() => {
|
|
5774
5951
|
e !== void 0 && (e ? document.documentElement.setAttribute("data-theme", e) : document.documentElement.removeAttribute("data-theme"));
|
|
5775
5952
|
}, [e]);
|
|
@@ -5796,87 +5973,87 @@ var $ = {
|
|
|
5796
5973
|
groupTitle: "ick-groupTitle-jiBB",
|
|
5797
5974
|
marks: "ick-marks-gwsN",
|
|
5798
5975
|
mark: "ick-mark-QkpW"
|
|
5799
|
-
},
|
|
5976
|
+
}, Ei = () => "", Di = {
|
|
5800
5977
|
stiffness: 170,
|
|
5801
5978
|
damping: 24,
|
|
5802
5979
|
mass: 1
|
|
5803
5980
|
};
|
|
5804
|
-
function
|
|
5805
|
-
let z = H("experience", r?.experience), fe = u ?? z.title, [pe, me] = m([]), [he, _e] = m(!1), [be, xe] = m(null), [Se, Ce] = m("marker"), we = p(null), B =
|
|
5981
|
+
function Oi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !0, composerMenu: a, onTranscribe: s, onThreadReply: l, title: u, backHref: d, backLabel: h, actions: b, placeholder: x, empty: S, contextTotal: w, contextBase: T = 0, artifact: E, openArtifactId: D, onOpenArtifactChange: O, pane: A = "inline", surface: j = "flush", composer: M = "inline", fill: N = "window", theme: ee, onThemeChange: te, cursor: P = !1, selectionToggle: F = !1, highlights: I = !0, bookmarks: ne = !0, anchorOffset: re = 100, endOffset: ie = 120, animationConfig: R, foldMotion: ae, feedDelay: oe = 0, onAnswerQuestion: se, onEditQuestion: le, onDecideApproval: ue, className: de }) {
|
|
5982
|
+
let z = H("experience", r?.experience), fe = u ?? z.title, [pe, me] = m([]), [he, _e] = m(!1), [be, xe] = m(null), [Se, Ce] = m("marker"), we = p(null), B = ee !== void 0, [Te, Ee] = m(null), V = B ? ee : Te, [De, Oe] = m(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
|
|
5806
5983
|
c(() => {
|
|
5807
5984
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => Oe(e.matches);
|
|
5808
5985
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5809
5986
|
}, []);
|
|
5810
5987
|
let ke = V ?? (De ? "dark" : "light");
|
|
5811
|
-
|
|
5988
|
+
Ti(V);
|
|
5812
5989
|
let Me = o((e) => {
|
|
5813
|
-
B || Ee(e),
|
|
5814
|
-
}, [B,
|
|
5990
|
+
B || Ee(e), te?.(e);
|
|
5991
|
+
}, [B, te]), U = M === "docked", Ne = f(() => U ? {
|
|
5815
5992
|
...rt,
|
|
5816
5993
|
...R,
|
|
5817
|
-
bubble: R?.bubble ??
|
|
5818
|
-
} : R, [U, R]), Pe =
|
|
5819
|
-
onSend: e ??
|
|
5994
|
+
bubble: R?.bubble ?? Di
|
|
5995
|
+
} : R, [U, R]), Pe = gt({
|
|
5996
|
+
onSend: e ?? Ei,
|
|
5820
5997
|
announcements: { responding: z.responding },
|
|
5821
5998
|
nextTurn: U ? "at-send" : "after-answer"
|
|
5822
5999
|
}), { turns: Fe, setDraft: Ie, submit: Le, showVersion: W, stop: Re, beginEdit: ze, cancelEdit: Be, updatePart: Ve, isStreaming: He } = t ?? Pe, [Ue, We] = m(null), Ge = o((e, t, n) => {
|
|
5823
6000
|
We(e), Le(e, t, n);
|
|
5824
|
-
}, [Le]),
|
|
6001
|
+
}, [Le]), qe = Ue ? Fe.find((e) => e.id === Ue) ?? null : null, Je = (qe?.versions?.length ?? 0) > 0, G = qe && Je && qe.state !== "resting" ? Ue : null, [K, q] = m(0), Ye = N === "window";
|
|
5825
6002
|
c(() => {
|
|
5826
|
-
if (!U || !
|
|
6003
|
+
if (!U || !Ye) return;
|
|
5827
6004
|
let e = window.visualViewport;
|
|
5828
6005
|
if (!e) return;
|
|
5829
|
-
let t = () =>
|
|
6006
|
+
let t = () => q(Math.max(0, Math.round(window.innerHeight - e.height)));
|
|
5830
6007
|
return t(), e.addEventListener("resize", t), () => e.removeEventListener("resize", t);
|
|
5831
|
-
}, [U,
|
|
5832
|
-
let
|
|
6008
|
+
}, [U, Ye]);
|
|
6009
|
+
let Xe = o((e) => {
|
|
5833
6010
|
We(e), Le(e);
|
|
5834
|
-
}, [Le]),
|
|
6011
|
+
}, [Le]), Ze = Fe.length === 1 && !Fe[0].user && !Fe[0].ai, Qe = T + Math.round(Fe.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), $e = w !== void 0 && Qe >= w, et = p(!1);
|
|
5835
6012
|
c(() => {
|
|
5836
|
-
if (
|
|
5837
|
-
|
|
6013
|
+
if (!$e) {
|
|
6014
|
+
et.current = !1;
|
|
5838
6015
|
return;
|
|
5839
6016
|
}
|
|
5840
|
-
|
|
5841
|
-
}, [
|
|
5842
|
-
let
|
|
5843
|
-
openArtifactId:
|
|
5844
|
-
artifactHeld:
|
|
6017
|
+
et.current || (et.current = !0, Ke(z.windowFull));
|
|
6018
|
+
}, [$e, z.windowFull]);
|
|
6019
|
+
let tt = ei(), nt = D !== void 0, it = nt ? D : tt.openId, at = p({
|
|
6020
|
+
openArtifactId: it,
|
|
6021
|
+
artifactHeld: nt,
|
|
5845
6022
|
onOpenArtifactChange: O
|
|
5846
6023
|
});
|
|
5847
6024
|
c(() => {
|
|
5848
|
-
|
|
5849
|
-
openArtifactId:
|
|
5850
|
-
artifactHeld:
|
|
6025
|
+
at.current = {
|
|
6026
|
+
openArtifactId: it,
|
|
6027
|
+
artifactHeld: nt,
|
|
5851
6028
|
onOpenArtifactChange: O
|
|
5852
6029
|
};
|
|
5853
6030
|
});
|
|
5854
|
-
let
|
|
5855
|
-
let { artifactHeld: t, onOpenArtifactChange: n } =
|
|
5856
|
-
t || (e === null ?
|
|
5857
|
-
}, [
|
|
5858
|
-
|
|
6031
|
+
let ot = tt.open, st = tt.close, ct = o((e) => {
|
|
6032
|
+
let { artifactHeld: t, onOpenArtifactChange: n } = at.current;
|
|
6033
|
+
t || (e === null ? st() : ot(e)), n?.(e);
|
|
6034
|
+
}, [ot, st]), lt = o(() => ct(null), [ct]), [ut, dt] = m({}), ft = o((e, t) => {
|
|
6035
|
+
dt((n) => ({
|
|
5859
6036
|
...n,
|
|
5860
6037
|
[e]: t
|
|
5861
6038
|
}));
|
|
5862
|
-
}, []),
|
|
5863
|
-
|
|
6039
|
+
}, []), pt = Fe.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? fe, mt = o((e, t) => {
|
|
6040
|
+
ne && t.trim().length > 0 && me((n) => [...n, {
|
|
5864
6041
|
turnId: e,
|
|
5865
6042
|
text: t.trim()
|
|
5866
6043
|
}]);
|
|
5867
|
-
}, [
|
|
6044
|
+
}, [ne]), J = o((e, t) => ct(at.current.openArtifactId === t ? null : t), [ct]), ht = o((e, t) => {
|
|
5868
6045
|
xe({
|
|
5869
6046
|
text: e,
|
|
5870
6047
|
rect: t
|
|
5871
6048
|
});
|
|
5872
|
-
}, []), Y = f(() => se ? (e, t, n, r) => se(Ve, e, t, n, r) : void 0, [se, Ve]),
|
|
6049
|
+
}, []), Y = f(() => se ? (e, t, n, r) => se(Ve, e, t, n, r) : void 0, [se, Ve]), _t = f(() => le ? (e, t, n) => le(Ve, e, t, n) : void 0, [le, Ve]), vt = f(() => ue ? (e, t, n) => ue(Ve, e, t, n) : void 0, [ue, Ve]), [yt, bt] = m(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
|
|
5873
6050
|
c(() => {
|
|
5874
6051
|
if (!P) return;
|
|
5875
|
-
let e = window.matchMedia("(pointer: fine)"), t = () =>
|
|
6052
|
+
let e = window.matchMedia("(pointer: fine)"), t = () => bt(e.matches);
|
|
5876
6053
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
5877
6054
|
}, [P]);
|
|
5878
|
-
let
|
|
5879
|
-
...
|
|
6055
|
+
let xt = (e) => i === !0 || Array.isArray(i) && i.includes(e), St = [
|
|
6056
|
+
...I && ne && pe.length > 0 ? [{
|
|
5880
6057
|
id: "bookmarks",
|
|
5881
6058
|
label: z.savedHighlights,
|
|
5882
6059
|
icon: /* @__PURE__ */ _(k, {
|
|
@@ -5887,7 +6064,7 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5887
6064
|
pinned: !0,
|
|
5888
6065
|
onClick: () => _e(!0)
|
|
5889
6066
|
}] : [],
|
|
5890
|
-
...
|
|
6067
|
+
...xt("theme") ? [{
|
|
5891
6068
|
id: "theme",
|
|
5892
6069
|
label: ke === "dark" ? z.themeToLight : z.themeToDark,
|
|
5893
6070
|
icon: _(ke === "dark" ? ve : ce, {
|
|
@@ -5897,7 +6074,7 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5897
6074
|
active: ke === "dark",
|
|
5898
6075
|
onClick: () => Me(ke === "dark" ? "light" : "dark")
|
|
5899
6076
|
}] : [],
|
|
5900
|
-
...
|
|
6077
|
+
...xt("share") ? [{
|
|
5901
6078
|
id: "share",
|
|
5902
6079
|
label: z.share,
|
|
5903
6080
|
icon: /* @__PURE__ */ _(ge, {
|
|
@@ -5905,19 +6082,19 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5905
6082
|
"aria-hidden": !0
|
|
5906
6083
|
}),
|
|
5907
6084
|
onClick: () => navigator.share?.({
|
|
5908
|
-
title:
|
|
6085
|
+
title: pt,
|
|
5909
6086
|
url: window.location.href
|
|
5910
6087
|
})
|
|
5911
6088
|
}] : [],
|
|
5912
6089
|
...b ?? []
|
|
5913
|
-
],
|
|
6090
|
+
], Ct = A === "inline" && it ? E?.(it) : null, Tt = /* @__PURE__ */ v(C.div, {
|
|
5914
6091
|
className: [
|
|
5915
6092
|
$.page,
|
|
5916
|
-
j === "panes" || !
|
|
6093
|
+
j === "panes" || !Ye ? $.fitted : "",
|
|
5917
6094
|
"ick-chat-page",
|
|
5918
6095
|
de
|
|
5919
6096
|
].filter(Boolean).join(" "),
|
|
5920
|
-
style: { "--ick-experience-anchor": `${
|
|
6097
|
+
style: { "--ick-experience-anchor": `${re}px` },
|
|
5921
6098
|
"data-composer": U ? "docked" : void 0,
|
|
5922
6099
|
initial: { opacity: 0 },
|
|
5923
6100
|
animate: {
|
|
@@ -5936,19 +6113,19 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5936
6113
|
},
|
|
5937
6114
|
children: [
|
|
5938
6115
|
/* @__PURE__ */ _("div", { className: $.topBlur }),
|
|
5939
|
-
/* @__PURE__ */ v(
|
|
6116
|
+
/* @__PURE__ */ v(wt, {
|
|
5940
6117
|
className: `${$.header} ick-chat-header`,
|
|
5941
|
-
title:
|
|
6118
|
+
title: pt,
|
|
5942
6119
|
backHref: d,
|
|
5943
6120
|
backLabel: h,
|
|
5944
6121
|
elevateOnScroll: !1,
|
|
5945
6122
|
collapseActionsAt: 480,
|
|
5946
|
-
actions:
|
|
5947
|
-
children: [w !== void 0 && /* @__PURE__ */ _(
|
|
6123
|
+
actions: St,
|
|
6124
|
+
children: [w !== void 0 && /* @__PURE__ */ _(Vr, {
|
|
5948
6125
|
className: $.context,
|
|
5949
|
-
used:
|
|
6126
|
+
used: Qe,
|
|
5950
6127
|
total: w
|
|
5951
|
-
}), F &&
|
|
6128
|
+
}), F && I && /* @__PURE__ */ v("div", {
|
|
5952
6129
|
className: $.selectMode,
|
|
5953
6130
|
role: "group",
|
|
5954
6131
|
"aria-label": z.selectionMode,
|
|
@@ -5958,7 +6135,7 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5958
6135
|
onClick: () => Ce("marker"),
|
|
5959
6136
|
"aria-label": z.marker,
|
|
5960
6137
|
title: z.marker,
|
|
5961
|
-
children: /* @__PURE__ */ _(
|
|
6138
|
+
children: /* @__PURE__ */ _(L, { size: 16 })
|
|
5962
6139
|
}), /* @__PURE__ */ _("button", {
|
|
5963
6140
|
type: "button",
|
|
5964
6141
|
"data-active": Se === "precise",
|
|
@@ -5969,14 +6146,14 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5969
6146
|
})]
|
|
5970
6147
|
})]
|
|
5971
6148
|
}),
|
|
5972
|
-
/* @__PURE__ */ v(
|
|
6149
|
+
/* @__PURE__ */ v(fi, {
|
|
5973
6150
|
viewportClassName: `${$.feed} ick-chat-feed`,
|
|
5974
|
-
anchorId:
|
|
6151
|
+
anchorId: G ? `turn-${G}` : void 0,
|
|
5975
6152
|
dock: U,
|
|
5976
|
-
anchorOffset:
|
|
6153
|
+
anchorOffset: re,
|
|
5977
6154
|
endOffset: U ? 0 : ie,
|
|
5978
6155
|
children: [
|
|
5979
|
-
|
|
6156
|
+
Ze && S && /* @__PURE__ */ _(mi, {
|
|
5980
6157
|
className: U ? `${$.opening} ${$.centred}` : $.opening,
|
|
5981
6158
|
title: S.title,
|
|
5982
6159
|
description: S.description,
|
|
@@ -5985,42 +6162,44 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
5985
6162
|
}),
|
|
5986
6163
|
/* @__PURE__ */ _(y, { children: Fe.map((e, t) => {
|
|
5987
6164
|
let r = t === Fe.length - 1 && (e.state === "idle" || e.state === "typing");
|
|
5988
|
-
return /* @__PURE__ */ _(
|
|
6165
|
+
return /* @__PURE__ */ _(Ir, {
|
|
5989
6166
|
turn: e,
|
|
5990
|
-
questionAlign: U && r ||
|
|
5991
|
-
className: U && r ? $.dock :
|
|
6167
|
+
questionAlign: U && r || Ze && t === 0 ? "stretch" : "end",
|
|
6168
|
+
className: U && r ? $.dock : Ze && t === 0 ? $.opening : void 0,
|
|
5992
6169
|
onTranscribe: s,
|
|
5993
6170
|
isActiveInput: r,
|
|
5994
6171
|
inputRef: r ? we : null,
|
|
5995
6172
|
entranceDelay: t === 0 ? oe : 0,
|
|
6173
|
+
entrance: U && r ? "fade" : "rise",
|
|
6174
|
+
answerAfterTravel: U,
|
|
5996
6175
|
selectionMode: Se,
|
|
5997
|
-
highlights:
|
|
6176
|
+
highlights: I,
|
|
5998
6177
|
animationConfig: Ne,
|
|
5999
6178
|
foldMotion: ae,
|
|
6000
|
-
openArtifactId:
|
|
6001
|
-
onOpenArtifact:
|
|
6002
|
-
onArtifactChange:
|
|
6179
|
+
openArtifactId: it,
|
|
6180
|
+
onOpenArtifact: J,
|
|
6181
|
+
onArtifactChange: ct,
|
|
6003
6182
|
placeholder: x,
|
|
6004
6183
|
onDraft: Ie,
|
|
6005
6184
|
onSubmit: Ge,
|
|
6006
|
-
onRegenerate:
|
|
6185
|
+
onRegenerate: Xe,
|
|
6007
6186
|
onShowVersion: W,
|
|
6008
|
-
onFeedback:
|
|
6009
|
-
feedback:
|
|
6187
|
+
onFeedback: ft,
|
|
6188
|
+
feedback: ut[e.id] ?? null,
|
|
6010
6189
|
onStop: !U || r ? Re : void 0,
|
|
6011
6190
|
busy: U && r ? He : void 0,
|
|
6012
6191
|
onEdit: ze,
|
|
6013
6192
|
onCancelEdit: Be,
|
|
6014
|
-
onHighlight:
|
|
6015
|
-
onReplyInThread: l ?
|
|
6193
|
+
onHighlight: mt,
|
|
6194
|
+
onReplyInThread: l ? ht : void 0,
|
|
6016
6195
|
onAnswerQuestion: Y,
|
|
6017
|
-
onEditQuestion:
|
|
6018
|
-
onDecideApproval:
|
|
6196
|
+
onEditQuestion: _t,
|
|
6197
|
+
onDecideApproval: vt,
|
|
6019
6198
|
renderPart: n,
|
|
6020
6199
|
composerMenu: a
|
|
6021
6200
|
}, e.id);
|
|
6022
6201
|
}) }),
|
|
6023
|
-
|
|
6202
|
+
$e && /* @__PURE__ */ _(Bn, { children: z.windowFull })
|
|
6024
6203
|
]
|
|
6025
6204
|
}),
|
|
6026
6205
|
/* @__PURE__ */ _("div", { className: $.bottomBlur })
|
|
@@ -6029,23 +6208,23 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6029
6208
|
return /* @__PURE__ */ v(Ae, {
|
|
6030
6209
|
labels: r,
|
|
6031
6210
|
children: [
|
|
6032
|
-
P && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }),
|
|
6033
|
-
/* @__PURE__ */ _(
|
|
6211
|
+
P && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), yt && /* @__PURE__ */ _(wi, {})] }),
|
|
6212
|
+
/* @__PURE__ */ _($r, {
|
|
6034
6213
|
className: $.workspace,
|
|
6035
6214
|
surface: j,
|
|
6036
|
-
"data-fill":
|
|
6037
|
-
style:
|
|
6038
|
-
onDismiss:
|
|
6039
|
-
pane: ({ narrow: e, expanded: t, toggleExpanded: n }) =>
|
|
6040
|
-
title:
|
|
6041
|
-
meta:
|
|
6215
|
+
"data-fill": Ye ? void 0 : "container",
|
|
6216
|
+
style: Ye && K > 0 ? { "--ick-keyboard": `${K}px` } : void 0,
|
|
6217
|
+
onDismiss: lt,
|
|
6218
|
+
pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => Ct ? /* @__PURE__ */ _(Ur, {
|
|
6219
|
+
title: Ct.title,
|
|
6220
|
+
meta: Ct.meta,
|
|
6042
6221
|
modal: e,
|
|
6043
6222
|
expanded: t,
|
|
6044
6223
|
onToggleExpanded: n,
|
|
6045
|
-
onClose:
|
|
6046
|
-
children:
|
|
6224
|
+
onClose: lt,
|
|
6225
|
+
children: Ct.children
|
|
6047
6226
|
}) : null,
|
|
6048
|
-
children:
|
|
6227
|
+
children: Tt
|
|
6049
6228
|
}),
|
|
6050
6229
|
/* @__PURE__ */ _(y, { children: he && /* @__PURE__ */ _(C.div, {
|
|
6051
6230
|
className: $.scrim,
|
|
@@ -6111,7 +6290,7 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6111
6290
|
}, e))]
|
|
6112
6291
|
})
|
|
6113
6292
|
}) }),
|
|
6114
|
-
/* @__PURE__ */ _(y, { children: be && l && /* @__PURE__ */ _(
|
|
6293
|
+
/* @__PURE__ */ _(y, { children: be && l && /* @__PURE__ */ _(Ci, {
|
|
6115
6294
|
activeReply: be,
|
|
6116
6295
|
onClose: () => xe(null),
|
|
6117
6296
|
onSendMessage: l
|
|
@@ -6120,6 +6299,6 @@ function Si({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
|
|
|
6120
6299
|
});
|
|
6121
6300
|
}
|
|
6122
6301
|
//#endregion
|
|
6123
|
-
export { Oe as $,
|
|
6302
|
+
export { Oe as $, pn as A, vt as B, Cn as C, yn as D, xn as E, Ht as F, Qe as G, ct as H, Nt as I, Re as J, Ke as K, jt as L, nn as M, Jt as N, _n as O, $t as P, Ae as Q, kt as R, wn as S, En as T, st as U, gt as V, rt as W, Fe as X, Le as Y, Me as Z, Rn as _, mi as a, Mn as b, $r as c, Ir as d, V as et, Mr as f, In as g, Bn as h, Ci as i, ln as j, hn as k, Ur as l, Wn as m, Ti as n, fi as o, Sr as p, Be as q, wi as r, ei as s, Oi as t, Vr as u, Ln as v, Tn as w, Sn as x, Pn as y, wt as z };
|
|
6124
6303
|
|
|
6125
|
-
//# sourceMappingURL=ChatExperience-
|
|
6304
|
+
//# sourceMappingURL=ChatExperience-BBd-p0wh.js.map
|