@djangocfg/ui-tools 2.1.384 → 2.1.387
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/README.md +25 -11
- package/dist/ChatRoot-4KM2JMGA.mjs +6 -0
- package/dist/{ChatRoot-JVR3M3H2.mjs.map → ChatRoot-4KM2JMGA.mjs.map} +1 -1
- package/dist/ChatRoot-OILWMMZ6.cjs +15 -0
- package/dist/{ChatRoot-LXIUBOXF.cjs.map → ChatRoot-OILWMMZ6.cjs.map} +1 -1
- package/dist/DictationField-AS2F33WI.cjs +13 -0
- package/dist/{DictationField-U25MEYAL.mjs.map → DictationField-AS2F33WI.cjs.map} +1 -1
- package/dist/DictationField-WPONUCYE.mjs +4 -0
- package/dist/{DictationField-XWR5VOID.cjs.map → DictationField-WPONUCYE.mjs.map} +1 -1
- package/dist/MapContainer-AKIPABJK.mjs +4 -0
- package/dist/MapContainer-AKIPABJK.mjs.map +1 -0
- package/dist/MapContainer-STVDMC36.cjs +17 -0
- package/dist/MapContainer-STVDMC36.cjs.map +1 -0
- package/dist/{MapContainer-76YL2JXL.cjs → chunk-5D2OCOPQ.cjs} +3 -2
- package/dist/chunk-5D2OCOPQ.cjs.map +1 -0
- package/dist/{MapContainer-7HXBI3OH.mjs → chunk-7CWGZPO3.mjs} +3 -3
- package/dist/chunk-7CWGZPO3.mjs.map +1 -0
- package/dist/{chunk-4PFW7MIJ.cjs → chunk-ADEN3UA4.cjs} +60 -5
- package/dist/chunk-ADEN3UA4.cjs.map +1 -0
- package/dist/chunk-BVESQTBM.mjs +1439 -0
- package/dist/chunk-BVESQTBM.mjs.map +1 -0
- package/dist/{chunk-PEKBT75W.mjs → chunk-DMX7W4XZ.mjs} +53 -1387
- package/dist/chunk-DMX7W4XZ.mjs.map +1 -0
- package/dist/chunk-HNIMIIFR.mjs +1361 -0
- package/dist/chunk-HNIMIIFR.mjs.map +1 -0
- package/dist/chunk-L25HA3TM.cjs +1478 -0
- package/dist/chunk-L25HA3TM.cjs.map +1 -0
- package/dist/{chunk-HPK3EWBF.cjs → chunk-TBSHZO5R.cjs} +50 -1409
- package/dist/chunk-TBSHZO5R.cjs.map +1 -0
- package/dist/chunk-TSNRU3UO.cjs +1387 -0
- package/dist/chunk-TSNRU3UO.cjs.map +1 -0
- package/dist/{chunk-C2YN6WEO.mjs → chunk-UNCS5V5F.mjs} +61 -7
- package/dist/chunk-UNCS5V5F.mjs.map +1 -0
- package/dist/index.cjs +1236 -1768
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +780 -780
- package/dist/index.d.ts +780 -780
- package/dist/index.mjs +853 -1423
- package/dist/index.mjs.map +1 -1
- package/dist/launcher-5WYPDPEP.mjs +7 -0
- package/dist/launcher-5WYPDPEP.mjs.map +1 -0
- package/dist/launcher-FCI3LTDY.css +7 -0
- package/dist/launcher-FCI3LTDY.css.map +1 -0
- package/dist/launcher-QAOG2NUI.cjs +60 -0
- package/dist/launcher-QAOG2NUI.cjs.map +1 -0
- package/package.json +23 -18
- package/src/tools/AudioPlayer/lazy.tsx +100 -0
- package/src/tools/Chat/README.md +85 -1
- package/src/tools/Chat/context/ChatProvider.tsx +42 -0
- package/src/tools/Chat/lazy.tsx +213 -1
- package/src/tools/CodeEditor/lazy.tsx +70 -0
- package/src/tools/Map/lazy.tsx +38 -1
- package/src/tools/MarkdownEditor/lazy.tsx +42 -0
- package/src/tools/SpeechRecognition/README.md +48 -0
- package/src/tools/SpeechRecognition/core/index.ts +6 -1
- package/src/tools/SpeechRecognition/core/logger.ts +107 -1
- package/src/tools/SpeechRecognition/hooks/useSpeechRecognition.ts +15 -4
- package/src/tools/SpeechRecognition/index.ts +9 -0
- package/src/tools/SpeechRecognition/widgets/VoiceComposerSlot.tsx +37 -2
- package/dist/ChatRoot-JVR3M3H2.mjs +0 -5
- package/dist/ChatRoot-LXIUBOXF.cjs +0 -14
- package/dist/DictationField-U25MEYAL.mjs +0 -4
- package/dist/DictationField-XWR5VOID.cjs +0 -13
- package/dist/MapContainer-76YL2JXL.cjs.map +0 -1
- package/dist/MapContainer-7HXBI3OH.mjs.map +0 -1
- package/dist/chunk-4PFW7MIJ.cjs.map +0 -1
- package/dist/chunk-C2YN6WEO.mjs.map +0 -1
- package/dist/chunk-HPK3EWBF.cjs.map +0 -1
- package/dist/chunk-PEKBT75W.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL25HA3TM_cjs = require('./chunk-L25HA3TM.cjs');
|
|
4
|
+
require('./chunk-ADEN3UA4.cjs');
|
|
4
5
|
var chunkFEN5S772_cjs = require('./chunk-FEN5S772.cjs');
|
|
5
6
|
var chunkQJ6GTUCO_cjs = require('./chunk-QJ6GTUCO.cjs');
|
|
6
7
|
var chunkYDPDTOSP_cjs = require('./chunk-YDPDTOSP.cjs');
|
|
@@ -8,22 +9,25 @@ var chunkKNDLV4PI_cjs = require('./chunk-KNDLV4PI.cjs');
|
|
|
8
9
|
var chunk5I5QNGUG_cjs = require('./chunk-5I5QNGUG.cjs');
|
|
9
10
|
var chunkYW5IVWHQ_cjs = require('./chunk-YW5IVWHQ.cjs');
|
|
10
11
|
var chunk76NNDZH6_cjs = require('./chunk-76NNDZH6.cjs');
|
|
11
|
-
var
|
|
12
|
+
var chunkTSNRU3UO_cjs = require('./chunk-TSNRU3UO.cjs');
|
|
13
|
+
var chunkTBSHZO5R_cjs = require('./chunk-TBSHZO5R.cjs');
|
|
12
14
|
var chunkYXZ6GU7H_cjs = require('./chunk-YXZ6GU7H.cjs');
|
|
13
15
|
var chunkFVVF7VCD_cjs = require('./chunk-FVVF7VCD.cjs');
|
|
16
|
+
var chunk5D2OCOPQ_cjs = require('./chunk-5D2OCOPQ.cjs');
|
|
14
17
|
var chunk7EYHNP3E_cjs = require('./chunk-7EYHNP3E.cjs');
|
|
15
18
|
var chunkFIRK5CEH_cjs = require('./chunk-FIRK5CEH.cjs');
|
|
16
19
|
var chunkT3MWM23F_cjs = require('./chunk-T3MWM23F.cjs');
|
|
17
20
|
require('./chunk-FP2RLYQZ.cjs');
|
|
18
21
|
var chunkOLISEQHS_cjs = require('./chunk-OLISEQHS.cjs');
|
|
19
|
-
var
|
|
20
|
-
var lib = require('@djangocfg/ui-core/lib');
|
|
21
|
-
var i18n = require('@djangocfg/i18n');
|
|
22
|
+
var maplibre = require('react-map-gl/maplibre');
|
|
22
23
|
var jsxRuntime = require('react/jsx-runtime');
|
|
23
|
-
var
|
|
24
|
+
var react = require('react');
|
|
25
|
+
var reactDom = require('react-dom');
|
|
24
26
|
var hooks = require('@djangocfg/ui-core/hooks');
|
|
27
|
+
var lucideReact = require('lucide-react');
|
|
25
28
|
var components = require('@djangocfg/ui-core/components');
|
|
26
|
-
var
|
|
29
|
+
var lib = require('@djangocfg/ui-core/lib');
|
|
30
|
+
var react$1 = require('@tiptap/react');
|
|
27
31
|
var StarterKit = require('@tiptap/starter-kit');
|
|
28
32
|
var Placeholder = require('@tiptap/extension-placeholder');
|
|
29
33
|
var Mention = require('@tiptap/extension-mention');
|
|
@@ -33,212 +37,871 @@ var core = require('@tiptap/core');
|
|
|
33
37
|
|
|
34
38
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
35
39
|
|
|
36
|
-
function _interopNamespace(e) {
|
|
37
|
-
if (e && e.__esModule) return e;
|
|
38
|
-
var n = Object.create(null);
|
|
39
|
-
if (e) {
|
|
40
|
-
Object.keys(e).forEach(function (k) {
|
|
41
|
-
if (k !== 'default') {
|
|
42
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
43
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () { return e[k]; }
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
n.default = e;
|
|
51
|
-
return Object.freeze(n);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
55
40
|
var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
|
|
56
41
|
var Placeholder__default = /*#__PURE__*/_interopDefault(Placeholder);
|
|
57
42
|
var Mention__default = /*#__PURE__*/_interopDefault(Mention);
|
|
58
43
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: lib.cn(
|
|
66
|
-
"inline-block h-8 w-8 animate-spin rounded-full",
|
|
67
|
-
"border-4 border-solid border-current border-r-transparent",
|
|
68
|
-
"align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
|
|
69
|
-
className
|
|
70
|
-
),
|
|
71
|
-
role: "status",
|
|
72
|
-
"aria-label": loadingLabel
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
chunkOLISEQHS_cjs.__name(Spinner, "Spinner");
|
|
77
|
-
function LoadingFallback({
|
|
78
|
-
minHeight = 200,
|
|
79
|
-
showText = true,
|
|
80
|
-
text,
|
|
81
|
-
className
|
|
82
|
-
}) {
|
|
83
|
-
const t = i18n.useAppT();
|
|
84
|
-
const loadingText = text ?? t("ui.form.loading");
|
|
85
|
-
const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
|
|
86
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
-
"div",
|
|
88
|
-
{
|
|
89
|
-
className: lib.cn(
|
|
90
|
-
"flex items-center justify-center bg-muted/30 rounded-lg",
|
|
91
|
-
className
|
|
92
|
-
),
|
|
93
|
-
style: { minHeight: height },
|
|
94
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
95
|
-
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "text-primary" }),
|
|
96
|
-
showText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
|
|
97
|
-
] })
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
chunkOLISEQHS_cjs.__name(LoadingFallback, "LoadingFallback");
|
|
102
|
-
function CardLoadingFallback({
|
|
103
|
-
title,
|
|
104
|
-
description,
|
|
105
|
-
minHeight = 200,
|
|
106
|
-
className
|
|
44
|
+
var DefaultPin = react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function DefaultPin2({
|
|
45
|
+
size = 24,
|
|
46
|
+
color = "#ef4444"
|
|
107
47
|
}) {
|
|
108
|
-
const t = i18n.useAppT();
|
|
109
|
-
const cardTitle = title ?? t("ui.states.loading");
|
|
110
|
-
const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
|
|
111
48
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
112
|
-
"
|
|
49
|
+
"svg",
|
|
113
50
|
{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
51
|
+
width: size,
|
|
52
|
+
height: size,
|
|
53
|
+
viewBox: "0 0 24 24",
|
|
54
|
+
fill: "none",
|
|
55
|
+
style: { cursor: "pointer" },
|
|
118
56
|
children: [
|
|
119
|
-
/* @__PURE__ */ jsxRuntime.
|
|
120
|
-
|
|
121
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: description })
|
|
122
|
-
] }),
|
|
123
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
|
-
"div",
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
"path",
|
|
125
59
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
60
|
+
d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z",
|
|
61
|
+
fill: color,
|
|
62
|
+
stroke: "#fff",
|
|
63
|
+
strokeWidth: "1.5"
|
|
129
64
|
}
|
|
130
|
-
)
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "9", r: "2.5", fill: "#fff" })
|
|
131
67
|
]
|
|
132
68
|
}
|
|
133
69
|
);
|
|
134
|
-
}
|
|
135
|
-
chunkOLISEQHS_cjs.__name(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
70
|
+
}, "DefaultPin"));
|
|
71
|
+
react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapMarker2({
|
|
72
|
+
marker,
|
|
73
|
+
onClick,
|
|
74
|
+
children,
|
|
75
|
+
anchor = "bottom",
|
|
76
|
+
draggable = false,
|
|
77
|
+
onDragStart,
|
|
78
|
+
onDrag,
|
|
79
|
+
onDragEnd,
|
|
80
|
+
color,
|
|
81
|
+
size
|
|
139
82
|
}) {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
83
|
+
const handleClick = react.useCallback(
|
|
84
|
+
(e) => {
|
|
85
|
+
e.originalEvent.stopPropagation();
|
|
86
|
+
onClick?.(marker);
|
|
87
|
+
},
|
|
88
|
+
[onClick, marker]
|
|
89
|
+
);
|
|
90
|
+
const handleDragStart = react.useCallback(
|
|
91
|
+
(e) => {
|
|
92
|
+
onDragStart?.(marker);
|
|
93
|
+
},
|
|
94
|
+
[onDragStart, marker]
|
|
95
|
+
);
|
|
96
|
+
const handleDrag = react.useCallback(
|
|
97
|
+
(e) => {
|
|
98
|
+
onDrag?.(marker, e.lngLat);
|
|
99
|
+
},
|
|
100
|
+
[onDrag, marker]
|
|
101
|
+
);
|
|
102
|
+
const handleDragEnd = react.useCallback(
|
|
103
|
+
(e) => {
|
|
104
|
+
onDragEnd?.(marker, e.lngLat);
|
|
105
|
+
},
|
|
106
|
+
[onDragEnd, marker]
|
|
107
|
+
);
|
|
143
108
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
144
|
-
|
|
109
|
+
maplibre.Marker,
|
|
145
110
|
{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
156
|
-
"svg",
|
|
157
|
-
{
|
|
158
|
-
className: "h-5 w-5 text-muted-foreground",
|
|
159
|
-
fill: "none",
|
|
160
|
-
viewBox: "0 0 24 24",
|
|
161
|
-
stroke: "currentColor",
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
164
|
-
"path",
|
|
165
|
-
{
|
|
166
|
-
strokeLinecap: "round",
|
|
167
|
-
strokeLinejoin: "round",
|
|
168
|
-
strokeWidth: 2,
|
|
169
|
-
d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
|
|
170
|
-
}
|
|
171
|
-
),
|
|
172
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
173
|
-
"path",
|
|
174
|
-
{
|
|
175
|
-
strokeLinecap: "round",
|
|
176
|
-
strokeLinejoin: "round",
|
|
177
|
-
strokeWidth: 2,
|
|
178
|
-
d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
) })
|
|
184
|
-
] }),
|
|
185
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
|
|
186
|
-
] })
|
|
111
|
+
longitude: marker.longitude,
|
|
112
|
+
latitude: marker.latitude,
|
|
113
|
+
anchor,
|
|
114
|
+
draggable,
|
|
115
|
+
onClick: handleClick,
|
|
116
|
+
onDragStart: handleDragStart,
|
|
117
|
+
onDrag: handleDrag,
|
|
118
|
+
onDragEnd: handleDragEnd,
|
|
119
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultPin, { color, size })
|
|
187
120
|
}
|
|
188
121
|
);
|
|
189
|
-
}
|
|
190
|
-
chunkOLISEQHS_cjs.__name(
|
|
191
|
-
|
|
122
|
+
}, "MapMarker"));
|
|
123
|
+
react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapPopup2({
|
|
124
|
+
longitude,
|
|
125
|
+
latitude,
|
|
126
|
+
onClose,
|
|
192
127
|
children,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
128
|
+
anchor = "bottom",
|
|
129
|
+
closeOnClick = true,
|
|
130
|
+
closeButton = true,
|
|
131
|
+
className,
|
|
132
|
+
maxWidth = "300px",
|
|
133
|
+
offset: offset2 = 15
|
|
199
134
|
}) {
|
|
200
|
-
|
|
201
|
-
|
|
135
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
136
|
+
maplibre.Popup,
|
|
202
137
|
{
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
138
|
+
longitude,
|
|
139
|
+
latitude,
|
|
140
|
+
anchor,
|
|
141
|
+
onClose,
|
|
142
|
+
closeOnClick,
|
|
143
|
+
closeButton,
|
|
144
|
+
className,
|
|
145
|
+
maxWidth,
|
|
146
|
+
offset: offset2,
|
|
147
|
+
children
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}, "MapPopup"));
|
|
151
|
+
|
|
152
|
+
// src/tools/Map/layers/cluster.ts
|
|
153
|
+
var DEFAULT_COLORS = ["#51bbd6", "#f1f075", "#f28cb1"];
|
|
154
|
+
var DEFAULT_RADII = [20, 30, 40];
|
|
155
|
+
var DEFAULT_THRESHOLDS = [100, 750];
|
|
156
|
+
var DEFAULT_HOVER_COLOR = "#3b82f6";
|
|
157
|
+
function createClusterLayers(options) {
|
|
158
|
+
const {
|
|
159
|
+
sourceId,
|
|
160
|
+
colors = DEFAULT_COLORS,
|
|
161
|
+
radii = DEFAULT_RADII,
|
|
162
|
+
thresholds = DEFAULT_THRESHOLDS,
|
|
163
|
+
hoverColor = DEFAULT_HOVER_COLOR
|
|
164
|
+
} = options;
|
|
165
|
+
const cluster = {
|
|
166
|
+
id: `${sourceId}-clusters`,
|
|
167
|
+
type: "circle",
|
|
168
|
+
source: sourceId,
|
|
169
|
+
filter: ["has", "point_count"],
|
|
170
|
+
paint: {
|
|
171
|
+
"circle-color": [
|
|
172
|
+
"case",
|
|
173
|
+
["boolean", ["feature-state", "hover"], false],
|
|
174
|
+
hoverColor,
|
|
175
|
+
[
|
|
176
|
+
"step",
|
|
177
|
+
["get", "point_count"],
|
|
178
|
+
colors[0],
|
|
179
|
+
thresholds[0],
|
|
180
|
+
colors[1],
|
|
181
|
+
thresholds[1],
|
|
182
|
+
colors[2]
|
|
183
|
+
]
|
|
184
|
+
],
|
|
185
|
+
"circle-radius": [
|
|
186
|
+
"step",
|
|
187
|
+
["get", "point_count"],
|
|
188
|
+
radii[0],
|
|
189
|
+
thresholds[0],
|
|
190
|
+
radii[1],
|
|
191
|
+
thresholds[1],
|
|
192
|
+
radii[2]
|
|
193
|
+
],
|
|
194
|
+
"circle-stroke-width": 2,
|
|
195
|
+
"circle-stroke-color": "#fff"
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const clusterCount = {
|
|
199
|
+
id: `${sourceId}-cluster-count`,
|
|
200
|
+
type: "symbol",
|
|
201
|
+
source: sourceId,
|
|
202
|
+
filter: ["has", "point_count"],
|
|
203
|
+
layout: {
|
|
204
|
+
"text-field": ["get", "point_count_abbreviated"],
|
|
205
|
+
"text-size": 12
|
|
206
|
+
},
|
|
207
|
+
paint: {
|
|
208
|
+
"text-color": "#000"
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const unclusteredPoint = {
|
|
212
|
+
id: `${sourceId}-unclustered-point`,
|
|
213
|
+
type: "circle",
|
|
214
|
+
source: sourceId,
|
|
215
|
+
filter: ["!", ["has", "point_count"]],
|
|
216
|
+
paint: {
|
|
217
|
+
"circle-color": [
|
|
218
|
+
"case",
|
|
219
|
+
["boolean", ["feature-state", "hover"], false],
|
|
220
|
+
hoverColor,
|
|
221
|
+
colors[0]
|
|
222
|
+
],
|
|
223
|
+
"circle-radius": [
|
|
224
|
+
"case",
|
|
225
|
+
["boolean", ["feature-state", "hover"], false],
|
|
226
|
+
10,
|
|
227
|
+
8
|
|
228
|
+
],
|
|
229
|
+
"circle-stroke-width": 2,
|
|
230
|
+
"circle-stroke-color": "#fff"
|
|
207
231
|
}
|
|
208
|
-
|
|
209
|
-
return
|
|
232
|
+
};
|
|
233
|
+
return { cluster, clusterCount, unclusteredPoint };
|
|
234
|
+
}
|
|
235
|
+
chunkOLISEQHS_cjs.__name(createClusterLayers, "createClusterLayers");
|
|
236
|
+
var POPUP_STYLE_ID = "map-cluster-popup-styles";
|
|
237
|
+
function injectPopupStyles() {
|
|
238
|
+
if (typeof document === "undefined") return;
|
|
239
|
+
if (document.getElementById(POPUP_STYLE_ID)) return;
|
|
240
|
+
const style = document.createElement("style");
|
|
241
|
+
style.id = POPUP_STYLE_ID;
|
|
242
|
+
style.textContent = `
|
|
243
|
+
.maplibregl-popup.map-popup-clean .maplibregl-popup-content {
|
|
244
|
+
padding: 0 !important;
|
|
245
|
+
background: transparent !important;
|
|
246
|
+
box-shadow: none !important;
|
|
247
|
+
border-radius: 0 !important;
|
|
248
|
+
}
|
|
249
|
+
.maplibregl-popup.map-popup-clean .maplibregl-popup-tip {
|
|
250
|
+
display: none !important;
|
|
251
|
+
}
|
|
252
|
+
`;
|
|
253
|
+
document.head.appendChild(style);
|
|
254
|
+
}
|
|
255
|
+
chunkOLISEQHS_cjs.__name(injectPopupStyles, "injectPopupStyles");
|
|
256
|
+
react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapCluster2({
|
|
257
|
+
sourceId,
|
|
258
|
+
data,
|
|
259
|
+
clusterRadius = 50,
|
|
260
|
+
clusterMaxZoom = 14,
|
|
261
|
+
onClusterClick,
|
|
262
|
+
onPointClick,
|
|
263
|
+
renderPopup,
|
|
264
|
+
popupAnchor = "bottom",
|
|
265
|
+
popupOffset = 15,
|
|
266
|
+
panOffsetX = 0,
|
|
267
|
+
panOffsetY = 150,
|
|
268
|
+
colors,
|
|
269
|
+
radii,
|
|
270
|
+
thresholds,
|
|
271
|
+
hoverColor
|
|
272
|
+
}) {
|
|
273
|
+
const { current: map } = maplibre.useMap();
|
|
274
|
+
const [selectedFeature, setSelectedFeature] = react.useState(null);
|
|
275
|
+
const [popupCoords, setPopupCoords] = react.useState(null);
|
|
276
|
+
react.useEffect(() => {
|
|
277
|
+
injectPopupStyles();
|
|
278
|
+
}, []);
|
|
279
|
+
const layerOptions = {
|
|
280
|
+
sourceId,
|
|
281
|
+
colors,
|
|
282
|
+
radii,
|
|
283
|
+
thresholds,
|
|
284
|
+
hoverColor
|
|
285
|
+
};
|
|
286
|
+
const { cluster, clusterCount, unclusteredPoint } = createClusterLayers(layerOptions);
|
|
287
|
+
const handleClosePopup = react.useCallback(() => {
|
|
288
|
+
setSelectedFeature(null);
|
|
289
|
+
setPopupCoords(null);
|
|
290
|
+
}, []);
|
|
291
|
+
const handleClick = react.useCallback(
|
|
292
|
+
async (event) => {
|
|
293
|
+
if (!map) return;
|
|
294
|
+
const features = map.queryRenderedFeatures(event.point, {
|
|
295
|
+
layers: [cluster.id, unclusteredPoint.id]
|
|
296
|
+
});
|
|
297
|
+
if (!features || features.length === 0) return;
|
|
298
|
+
const feature = features[0];
|
|
299
|
+
const geometry = feature.geometry;
|
|
300
|
+
if (geometry.type !== "Point") return;
|
|
301
|
+
const coordinates = geometry.coordinates;
|
|
302
|
+
const clusterId = feature.properties?.cluster_id;
|
|
303
|
+
if (clusterId) {
|
|
304
|
+
const source = map.getSource(sourceId);
|
|
305
|
+
if (!source) return;
|
|
306
|
+
try {
|
|
307
|
+
const zoom = await source.getClusterExpansionZoom(clusterId);
|
|
308
|
+
map.easeTo({
|
|
309
|
+
center: coordinates,
|
|
310
|
+
zoom,
|
|
311
|
+
duration: 500
|
|
312
|
+
});
|
|
313
|
+
onClusterClick?.(clusterId, coordinates);
|
|
314
|
+
} catch (error) {
|
|
315
|
+
console.error("Error expanding cluster:", error);
|
|
316
|
+
}
|
|
317
|
+
} else {
|
|
318
|
+
onPointClick?.(feature);
|
|
319
|
+
if (renderPopup) {
|
|
320
|
+
map.easeTo({
|
|
321
|
+
center: coordinates,
|
|
322
|
+
duration: 300,
|
|
323
|
+
offset: [panOffsetX, panOffsetY]
|
|
324
|
+
});
|
|
325
|
+
setSelectedFeature(feature);
|
|
326
|
+
setPopupCoords(coordinates);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
[map, sourceId, cluster.id, unclusteredPoint.id, onClusterClick, onPointClick, renderPopup, panOffsetX, panOffsetY]
|
|
331
|
+
);
|
|
332
|
+
const handleMapClick = react.useCallback(
|
|
333
|
+
(event) => {
|
|
334
|
+
if (!map) return;
|
|
335
|
+
const features = map.queryRenderedFeatures(event.point, {
|
|
336
|
+
layers: [cluster.id, unclusteredPoint.id]
|
|
337
|
+
});
|
|
338
|
+
if (!features || features.length === 0) {
|
|
339
|
+
handleClosePopup();
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
[map, cluster.id, unclusteredPoint.id, handleClosePopup]
|
|
343
|
+
);
|
|
344
|
+
react.useEffect(() => {
|
|
345
|
+
if (!map) return;
|
|
346
|
+
const clusterLayerId = cluster.id;
|
|
347
|
+
const pointLayerId = unclusteredPoint.id;
|
|
348
|
+
let currentHoveredId = null;
|
|
349
|
+
const clearHoverState = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
350
|
+
if (currentHoveredId !== null) {
|
|
351
|
+
map.setFeatureState(
|
|
352
|
+
{ source: sourceId, id: currentHoveredId },
|
|
353
|
+
{ hover: false }
|
|
354
|
+
);
|
|
355
|
+
currentHoveredId = null;
|
|
356
|
+
}
|
|
357
|
+
}, "clearHoverState");
|
|
358
|
+
const handleMouseMove = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((e) => {
|
|
359
|
+
const features = map.queryRenderedFeatures(e.point, {
|
|
360
|
+
layers: [clusterLayerId, pointLayerId]
|
|
361
|
+
});
|
|
362
|
+
if (features.length > 0) {
|
|
363
|
+
map.getCanvas().style.cursor = "pointer";
|
|
364
|
+
const feature = features[0];
|
|
365
|
+
const featureId = feature.id;
|
|
366
|
+
if (featureId !== void 0 && featureId !== currentHoveredId) {
|
|
367
|
+
clearHoverState();
|
|
368
|
+
currentHoveredId = featureId;
|
|
369
|
+
map.setFeatureState(
|
|
370
|
+
{ source: sourceId, id: featureId },
|
|
371
|
+
{ hover: true }
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
} else {
|
|
375
|
+
map.getCanvas().style.cursor = "";
|
|
376
|
+
clearHoverState();
|
|
377
|
+
}
|
|
378
|
+
}, "handleMouseMove");
|
|
379
|
+
const handleMouseLeave = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
380
|
+
map.getCanvas().style.cursor = "";
|
|
381
|
+
clearHoverState();
|
|
382
|
+
}, "handleMouseLeave");
|
|
383
|
+
map.on("click", clusterLayerId, handleClick);
|
|
384
|
+
map.on("click", pointLayerId, handleClick);
|
|
385
|
+
map.on("click", handleMapClick);
|
|
386
|
+
map.on("mousemove", clusterLayerId, handleMouseMove);
|
|
387
|
+
map.on("mousemove", pointLayerId, handleMouseMove);
|
|
388
|
+
map.on("mouseleave", clusterLayerId, handleMouseLeave);
|
|
389
|
+
map.on("mouseleave", pointLayerId, handleMouseLeave);
|
|
390
|
+
return () => {
|
|
391
|
+
clearHoverState();
|
|
392
|
+
map.off("click", clusterLayerId, handleClick);
|
|
393
|
+
map.off("click", pointLayerId, handleClick);
|
|
394
|
+
map.off("click", handleMapClick);
|
|
395
|
+
map.off("mousemove", clusterLayerId, handleMouseMove);
|
|
396
|
+
map.off("mousemove", pointLayerId, handleMouseMove);
|
|
397
|
+
map.off("mouseleave", clusterLayerId, handleMouseLeave);
|
|
398
|
+
map.off("mouseleave", pointLayerId, handleMouseLeave);
|
|
399
|
+
};
|
|
400
|
+
}, [map, sourceId, cluster.id, unclusteredPoint.id, handleClick, handleMapClick]);
|
|
401
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
402
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
403
|
+
maplibre.Source,
|
|
404
|
+
{
|
|
405
|
+
id: sourceId,
|
|
406
|
+
type: "geojson",
|
|
407
|
+
data,
|
|
408
|
+
cluster: true,
|
|
409
|
+
clusterMaxZoom,
|
|
410
|
+
clusterRadius,
|
|
411
|
+
generateId: true,
|
|
412
|
+
children: [
|
|
413
|
+
/* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...cluster }),
|
|
414
|
+
/* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...clusterCount }),
|
|
415
|
+
/* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...unclusteredPoint })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
renderPopup && selectedFeature && popupCoords && /* @__PURE__ */ jsxRuntime.jsx(
|
|
420
|
+
maplibre.Popup,
|
|
421
|
+
{
|
|
422
|
+
longitude: popupCoords[0],
|
|
423
|
+
latitude: popupCoords[1],
|
|
424
|
+
anchor: popupAnchor,
|
|
425
|
+
onClose: handleClosePopup,
|
|
426
|
+
closeOnClick: false,
|
|
427
|
+
closeButton: false,
|
|
428
|
+
offset: popupOffset,
|
|
429
|
+
maxWidth: "none",
|
|
430
|
+
className: "map-popup-clean",
|
|
431
|
+
children: renderPopup(selectedFeature, handleClosePopup)
|
|
432
|
+
}
|
|
433
|
+
)
|
|
434
|
+
] });
|
|
435
|
+
}, "MapCluster"));
|
|
436
|
+
react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapSource2({
|
|
437
|
+
id,
|
|
438
|
+
data,
|
|
439
|
+
type = "geojson",
|
|
440
|
+
children
|
|
441
|
+
}) {
|
|
442
|
+
return /* @__PURE__ */ jsxRuntime.jsx(maplibre.Source, { id, type, data, children });
|
|
443
|
+
}, "MapSource"));
|
|
444
|
+
react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapLayer2(props) {
|
|
445
|
+
return /* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...props });
|
|
446
|
+
}, "MapLayer"));
|
|
447
|
+
var _OverlayControl = class _OverlayControl {
|
|
448
|
+
constructor(redraw) {
|
|
449
|
+
chunkOLISEQHS_cjs.__publicField(this, "_map", null);
|
|
450
|
+
chunkOLISEQHS_cjs.__publicField(this, "_container", null);
|
|
451
|
+
chunkOLISEQHS_cjs.__publicField(this, "_redraw");
|
|
452
|
+
this._redraw = redraw;
|
|
453
|
+
}
|
|
454
|
+
onAdd(map) {
|
|
455
|
+
this._map = map;
|
|
456
|
+
map.on("move", this._redraw);
|
|
457
|
+
this._container = document.createElement("div");
|
|
458
|
+
this._redraw();
|
|
459
|
+
return this._container;
|
|
460
|
+
}
|
|
461
|
+
onRemove() {
|
|
462
|
+
this._container?.remove();
|
|
463
|
+
this._map?.off("move", this._redraw);
|
|
464
|
+
this._map = null;
|
|
465
|
+
}
|
|
466
|
+
getElement() {
|
|
467
|
+
return this._container;
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
chunkOLISEQHS_cjs.__name(_OverlayControl, "OverlayControl");
|
|
471
|
+
var OverlayControl = _OverlayControl;
|
|
472
|
+
function CustomOverlayComponent({ children }) {
|
|
473
|
+
const [, setVersion] = react.useState(0);
|
|
474
|
+
const ctrl = maplibre.useControl(() => {
|
|
475
|
+
const forceUpdate = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => setVersion((v) => v + 1), "forceUpdate");
|
|
476
|
+
return new OverlayControl(forceUpdate);
|
|
477
|
+
});
|
|
478
|
+
const element = ctrl.getElement();
|
|
479
|
+
if (!element) return null;
|
|
480
|
+
return reactDom.createPortal(children, element);
|
|
481
|
+
}
|
|
482
|
+
chunkOLISEQHS_cjs.__name(CustomOverlayComponent, "CustomOverlayComponent");
|
|
483
|
+
react.memo(CustomOverlayComponent);
|
|
484
|
+
var positionStyles = {
|
|
485
|
+
"top-left": { top: 10, left: 10 },
|
|
486
|
+
"top-right": { top: 10, right: 10 },
|
|
487
|
+
"bottom-left": { bottom: 10, left: 10 },
|
|
488
|
+
"bottom-right": { bottom: 10, right: 10 }
|
|
489
|
+
};
|
|
490
|
+
function LegendIcon({
|
|
491
|
+
type,
|
|
492
|
+
color
|
|
493
|
+
}) {
|
|
494
|
+
const fill = color || "#888";
|
|
495
|
+
switch (type) {
|
|
496
|
+
case "circle":
|
|
497
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "6", fill }) });
|
|
498
|
+
case "line":
|
|
499
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
500
|
+
"line",
|
|
501
|
+
{
|
|
502
|
+
x1: "0",
|
|
503
|
+
y1: "8",
|
|
504
|
+
x2: "16",
|
|
505
|
+
y2: "8",
|
|
506
|
+
stroke: fill,
|
|
507
|
+
strokeWidth: "3",
|
|
508
|
+
strokeLinecap: "round"
|
|
509
|
+
}
|
|
510
|
+
) });
|
|
511
|
+
case "fill":
|
|
512
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "1", width: "14", height: "14", fill, rx: "2" }) });
|
|
513
|
+
case "symbol":
|
|
514
|
+
default:
|
|
515
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
516
|
+
"path",
|
|
517
|
+
{
|
|
518
|
+
d: "M8 1l2.5 5 5.5.8-4 3.9.9 5.3L8 13.5l-4.9 2.5.9-5.3-4-3.9 5.5-.8z",
|
|
519
|
+
fill
|
|
520
|
+
}
|
|
521
|
+
) });
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
chunkOLISEQHS_cjs.__name(LegendIcon, "LegendIcon");
|
|
525
|
+
function MapLegendComponent({
|
|
526
|
+
items,
|
|
527
|
+
position = "bottom-right",
|
|
528
|
+
title,
|
|
529
|
+
collapsible = false,
|
|
530
|
+
defaultCollapsed = false,
|
|
531
|
+
className = "",
|
|
532
|
+
style,
|
|
533
|
+
onItemClick
|
|
534
|
+
}) {
|
|
535
|
+
const [collapsed, setCollapsed] = react.useState(defaultCollapsed);
|
|
536
|
+
const containerStyle = react.useMemo(
|
|
537
|
+
() => ({
|
|
538
|
+
position: "absolute",
|
|
539
|
+
...positionStyles[position],
|
|
540
|
+
backgroundColor: "white",
|
|
541
|
+
borderRadius: 8,
|
|
542
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
543
|
+
padding: collapsed ? 8 : 12,
|
|
544
|
+
minWidth: collapsed ? "auto" : 120,
|
|
545
|
+
zIndex: 1,
|
|
546
|
+
...style
|
|
547
|
+
}),
|
|
548
|
+
[position, collapsed, style]
|
|
549
|
+
);
|
|
550
|
+
const headerStyle = react.useMemo(
|
|
551
|
+
() => ({
|
|
552
|
+
display: "flex",
|
|
553
|
+
alignItems: "center",
|
|
554
|
+
justifyContent: "space-between",
|
|
555
|
+
gap: 8,
|
|
556
|
+
cursor: collapsible ? "pointer" : "default",
|
|
557
|
+
fontWeight: 600,
|
|
558
|
+
fontSize: 12,
|
|
559
|
+
color: "#333",
|
|
560
|
+
marginBottom: collapsed ? 0 : 8
|
|
561
|
+
}),
|
|
562
|
+
[collapsible, collapsed]
|
|
563
|
+
);
|
|
564
|
+
const itemStyle = react.useMemo(
|
|
565
|
+
() => ({
|
|
566
|
+
display: "flex",
|
|
567
|
+
alignItems: "center",
|
|
568
|
+
gap: 8,
|
|
569
|
+
padding: "4px 0",
|
|
570
|
+
fontSize: 12,
|
|
571
|
+
color: "#666",
|
|
572
|
+
cursor: onItemClick ? "pointer" : "default"
|
|
573
|
+
}),
|
|
574
|
+
[onItemClick]
|
|
575
|
+
);
|
|
576
|
+
const handleHeaderClick = collapsible ? () => setCollapsed(!collapsed) : void 0;
|
|
577
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: containerStyle, children: [
|
|
578
|
+
(title || collapsible) && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, onClick: handleHeaderClick, children: [
|
|
579
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
|
|
580
|
+
collapsible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
581
|
+
"svg",
|
|
582
|
+
{
|
|
583
|
+
width: "12",
|
|
584
|
+
height: "12",
|
|
585
|
+
viewBox: "0 0 12 12",
|
|
586
|
+
style: {
|
|
587
|
+
transform: collapsed ? "rotate(-90deg)" : "rotate(0deg)",
|
|
588
|
+
transition: "transform 0.2s"
|
|
589
|
+
},
|
|
590
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "#666", fill: "none" })
|
|
591
|
+
}
|
|
592
|
+
)
|
|
593
|
+
] }),
|
|
594
|
+
!collapsed && /* @__PURE__ */ jsxRuntime.jsx("div", { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
595
|
+
"div",
|
|
596
|
+
{
|
|
597
|
+
style: {
|
|
598
|
+
...itemStyle,
|
|
599
|
+
opacity: item.visible === false ? 0.5 : 1
|
|
600
|
+
},
|
|
601
|
+
onClick: onItemClick ? () => onItemClick(item) : void 0,
|
|
602
|
+
children: [
|
|
603
|
+
item.icon || /* @__PURE__ */ jsxRuntime.jsx(LegendIcon, { type: item.type, color: item.color }),
|
|
604
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
605
|
+
]
|
|
606
|
+
},
|
|
607
|
+
item.id
|
|
608
|
+
)) })
|
|
609
|
+
] });
|
|
610
|
+
}
|
|
611
|
+
chunkOLISEQHS_cjs.__name(MapLegendComponent, "MapLegendComponent");
|
|
612
|
+
react.memo(MapLegendComponent);
|
|
613
|
+
function useMapLayers() {
|
|
614
|
+
const { mapRef, isLoaded } = chunk5D2OCOPQ_cjs.useMapContext();
|
|
615
|
+
const addLayer = react.useCallback(
|
|
616
|
+
(layer, beforeId) => {
|
|
617
|
+
const map = mapRef.current?.getMap();
|
|
618
|
+
if (!map || !isLoaded) return;
|
|
619
|
+
if (layer.id && map.getLayer(layer.id)) {
|
|
620
|
+
map.removeLayer(layer.id);
|
|
621
|
+
}
|
|
622
|
+
map.addLayer(layer, beforeId);
|
|
623
|
+
},
|
|
624
|
+
[mapRef, isLoaded]
|
|
625
|
+
);
|
|
626
|
+
const removeLayer = react.useCallback(
|
|
627
|
+
(id) => {
|
|
628
|
+
const map = mapRef.current?.getMap();
|
|
629
|
+
if (!map || !isLoaded) return;
|
|
630
|
+
if (map.getLayer(id)) {
|
|
631
|
+
map.removeLayer(id);
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
[mapRef, isLoaded]
|
|
635
|
+
);
|
|
636
|
+
const setLayerVisibility = react.useCallback(
|
|
637
|
+
(id, visible) => {
|
|
638
|
+
const map = mapRef.current?.getMap();
|
|
639
|
+
if (!map || !isLoaded) return;
|
|
640
|
+
if (map.getLayer(id)) {
|
|
641
|
+
map.setLayoutProperty(id, "visibility", visible ? "visible" : "none");
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
[mapRef, isLoaded]
|
|
645
|
+
);
|
|
646
|
+
const setLayerFilter = react.useCallback(
|
|
647
|
+
(id, filter) => {
|
|
648
|
+
const map = mapRef.current?.getMap();
|
|
649
|
+
if (!map || !isLoaded) return;
|
|
650
|
+
if (map.getLayer(id)) {
|
|
651
|
+
map.setFilter(id, filter);
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
[mapRef, isLoaded]
|
|
655
|
+
);
|
|
656
|
+
const setLayerPaint = react.useCallback(
|
|
657
|
+
(id, property, value) => {
|
|
658
|
+
const map = mapRef.current?.getMap();
|
|
659
|
+
if (!map || !isLoaded) return;
|
|
660
|
+
if (map.getLayer(id)) {
|
|
661
|
+
map.setPaintProperty(id, property, value);
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
[mapRef, isLoaded]
|
|
665
|
+
);
|
|
666
|
+
return {
|
|
667
|
+
addLayer,
|
|
668
|
+
removeLayer,
|
|
669
|
+
setLayerVisibility,
|
|
670
|
+
setLayerFilter,
|
|
671
|
+
setLayerPaint
|
|
672
|
+
};
|
|
210
673
|
}
|
|
211
|
-
chunkOLISEQHS_cjs.__name(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
674
|
+
chunkOLISEQHS_cjs.__name(useMapLayers, "useMapLayers");
|
|
675
|
+
var positionStyles2 = {
|
|
676
|
+
"top-left": { top: 10, left: 10 },
|
|
677
|
+
"top-right": { top: 10, right: 10 },
|
|
678
|
+
"bottom-left": { bottom: 10, left: 10 },
|
|
679
|
+
"bottom-right": { bottom: 10, right: 10 }
|
|
680
|
+
};
|
|
681
|
+
function LayerSwitcherComponent({
|
|
682
|
+
layers,
|
|
683
|
+
position = "top-right",
|
|
684
|
+
title = "Layers",
|
|
685
|
+
collapsible = true,
|
|
686
|
+
defaultCollapsed = false,
|
|
687
|
+
showToggleAll = false,
|
|
688
|
+
className = "",
|
|
689
|
+
style,
|
|
690
|
+
onChange
|
|
691
|
+
}) {
|
|
692
|
+
const { setLayerVisibility } = useMapLayers();
|
|
693
|
+
const [collapsed, setCollapsed] = react.useState(defaultCollapsed);
|
|
694
|
+
const initialVisibility = react.useMemo(() => {
|
|
695
|
+
const initial = {};
|
|
696
|
+
layers.forEach((layer) => {
|
|
697
|
+
initial[layer.id] = layer.defaultVisible !== false;
|
|
698
|
+
});
|
|
699
|
+
return initial;
|
|
700
|
+
}, [layers]);
|
|
701
|
+
const [visibility, setVisibility] = react.useState(initialVisibility);
|
|
702
|
+
const handleToggle = react.useCallback(
|
|
703
|
+
(layerId) => {
|
|
704
|
+
const newVisible = !visibility[layerId];
|
|
705
|
+
setVisibility((prev) => ({ ...prev, [layerId]: newVisible }));
|
|
706
|
+
setLayerVisibility(layerId, newVisible);
|
|
707
|
+
onChange?.(layerId, newVisible);
|
|
708
|
+
},
|
|
709
|
+
[visibility, setLayerVisibility, onChange]
|
|
710
|
+
);
|
|
711
|
+
const handleToggleAll = react.useCallback(
|
|
712
|
+
(visible) => {
|
|
713
|
+
const newVisibility = {};
|
|
714
|
+
layers.forEach((layer) => {
|
|
715
|
+
newVisibility[layer.id] = visible;
|
|
716
|
+
setLayerVisibility(layer.id, visible);
|
|
717
|
+
onChange?.(layer.id, visible);
|
|
718
|
+
});
|
|
719
|
+
setVisibility(newVisibility);
|
|
720
|
+
},
|
|
721
|
+
[layers, setLayerVisibility, onChange]
|
|
722
|
+
);
|
|
723
|
+
const allVisible = react.useMemo(() => Object.values(visibility).every(Boolean), [visibility]);
|
|
724
|
+
const noneVisible = react.useMemo(() => Object.values(visibility).every((v) => !v), [visibility]);
|
|
725
|
+
const containerStyle = react.useMemo(
|
|
726
|
+
() => ({
|
|
727
|
+
position: "absolute",
|
|
728
|
+
...positionStyles2[position],
|
|
729
|
+
backgroundColor: "white",
|
|
730
|
+
borderRadius: 8,
|
|
731
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
732
|
+
padding: collapsed ? 8 : 12,
|
|
733
|
+
minWidth: collapsed ? "auto" : 150,
|
|
734
|
+
zIndex: 1,
|
|
735
|
+
...style
|
|
736
|
+
}),
|
|
737
|
+
[position, collapsed, style]
|
|
738
|
+
);
|
|
739
|
+
const headerStyle = react.useMemo(
|
|
740
|
+
() => ({
|
|
741
|
+
display: "flex",
|
|
742
|
+
alignItems: "center",
|
|
743
|
+
justifyContent: "space-between",
|
|
744
|
+
gap: 8,
|
|
745
|
+
cursor: collapsible ? "pointer" : "default",
|
|
746
|
+
fontWeight: 600,
|
|
747
|
+
fontSize: 12,
|
|
748
|
+
color: "#333",
|
|
749
|
+
marginBottom: collapsed ? 0 : 8
|
|
750
|
+
}),
|
|
751
|
+
[collapsible, collapsed]
|
|
752
|
+
);
|
|
753
|
+
const itemStyle = react.useMemo(
|
|
754
|
+
() => ({
|
|
755
|
+
display: "flex",
|
|
756
|
+
alignItems: "center",
|
|
757
|
+
gap: 8,
|
|
758
|
+
padding: "4px 0",
|
|
759
|
+
fontSize: 12,
|
|
760
|
+
color: "#666",
|
|
761
|
+
cursor: "pointer"
|
|
762
|
+
}),
|
|
763
|
+
[]
|
|
764
|
+
);
|
|
765
|
+
const checkboxStyle = react.useMemo(
|
|
766
|
+
() => ({
|
|
767
|
+
width: 14,
|
|
768
|
+
height: 14,
|
|
769
|
+
cursor: "pointer"
|
|
770
|
+
}),
|
|
771
|
+
[]
|
|
772
|
+
);
|
|
773
|
+
const groups = react.useMemo(() => {
|
|
774
|
+
return layers.reduce(
|
|
775
|
+
(acc, layer) => {
|
|
776
|
+
const group = layer.group || "";
|
|
777
|
+
if (!acc[group]) acc[group] = [];
|
|
778
|
+
acc[group].push(layer);
|
|
779
|
+
return acc;
|
|
780
|
+
},
|
|
781
|
+
{}
|
|
782
|
+
);
|
|
783
|
+
}, [layers]);
|
|
784
|
+
const handleHeaderClick = collapsible ? () => setCollapsed(!collapsed) : void 0;
|
|
785
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: containerStyle, children: [
|
|
786
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, onClick: handleHeaderClick, children: [
|
|
787
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
|
|
788
|
+
collapsible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
789
|
+
"svg",
|
|
790
|
+
{
|
|
791
|
+
width: "12",
|
|
792
|
+
height: "12",
|
|
793
|
+
viewBox: "0 0 12 12",
|
|
794
|
+
style: {
|
|
795
|
+
transform: collapsed ? "rotate(-90deg)" : "rotate(0deg)",
|
|
796
|
+
transition: "transform 0.2s"
|
|
797
|
+
},
|
|
798
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "#666", fill: "none" })
|
|
799
|
+
}
|
|
800
|
+
)
|
|
801
|
+
] }),
|
|
802
|
+
!collapsed && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
803
|
+
showToggleAll && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
804
|
+
"div",
|
|
805
|
+
{
|
|
806
|
+
style: {
|
|
807
|
+
...itemStyle,
|
|
808
|
+
borderBottom: "1px solid #eee",
|
|
809
|
+
marginBottom: 4,
|
|
810
|
+
paddingBottom: 8
|
|
811
|
+
},
|
|
812
|
+
children: [
|
|
813
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
814
|
+
"button",
|
|
815
|
+
{
|
|
816
|
+
onClick: () => handleToggleAll(true),
|
|
817
|
+
disabled: allVisible,
|
|
818
|
+
style: {
|
|
819
|
+
fontSize: 10,
|
|
820
|
+
padding: "2px 6px",
|
|
821
|
+
cursor: allVisible ? "default" : "pointer",
|
|
822
|
+
opacity: allVisible ? 0.5 : 1
|
|
823
|
+
},
|
|
824
|
+
children: "All"
|
|
825
|
+
}
|
|
826
|
+
),
|
|
827
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
828
|
+
"button",
|
|
829
|
+
{
|
|
830
|
+
onClick: () => handleToggleAll(false),
|
|
831
|
+
disabled: noneVisible,
|
|
832
|
+
style: {
|
|
833
|
+
fontSize: 10,
|
|
834
|
+
padding: "2px 6px",
|
|
835
|
+
cursor: noneVisible ? "default" : "pointer",
|
|
836
|
+
opacity: noneVisible ? 0.5 : 1
|
|
837
|
+
},
|
|
838
|
+
children: "None"
|
|
839
|
+
}
|
|
840
|
+
)
|
|
841
|
+
]
|
|
842
|
+
}
|
|
843
|
+
),
|
|
844
|
+
Object.entries(groups).map(([group, groupLayers]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
845
|
+
group && /* @__PURE__ */ jsxRuntime.jsx(
|
|
846
|
+
"div",
|
|
847
|
+
{
|
|
848
|
+
style: {
|
|
849
|
+
fontSize: 10,
|
|
850
|
+
fontWeight: 600,
|
|
851
|
+
color: "#999",
|
|
852
|
+
marginTop: 8,
|
|
853
|
+
marginBottom: 4,
|
|
854
|
+
textTransform: "uppercase"
|
|
855
|
+
},
|
|
856
|
+
children: group
|
|
857
|
+
}
|
|
858
|
+
),
|
|
859
|
+
groupLayers.map((layer) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
860
|
+
"div",
|
|
861
|
+
{
|
|
862
|
+
style: itemStyle,
|
|
863
|
+
onClick: () => handleToggle(layer.id),
|
|
864
|
+
children: [
|
|
865
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
866
|
+
"input",
|
|
867
|
+
{
|
|
868
|
+
type: "checkbox",
|
|
869
|
+
checked: visibility[layer.id],
|
|
870
|
+
onChange: () => handleToggle(layer.id),
|
|
871
|
+
style: checkboxStyle
|
|
872
|
+
}
|
|
873
|
+
),
|
|
874
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: layer.label })
|
|
875
|
+
]
|
|
876
|
+
},
|
|
877
|
+
layer.id
|
|
878
|
+
))
|
|
879
|
+
] }, group || "default"))
|
|
880
|
+
] })
|
|
881
|
+
] });
|
|
220
882
|
}
|
|
221
|
-
chunkOLISEQHS_cjs.__name(
|
|
222
|
-
|
|
223
|
-
|
|
883
|
+
chunkOLISEQHS_cjs.__name(LayerSwitcherComponent, "LayerSwitcherComponent");
|
|
884
|
+
react.memo(LayerSwitcherComponent);
|
|
885
|
+
var LazyMapContainer = chunkL25HA3TM_cjs.createLazyComponent(
|
|
886
|
+
() => import('./MapContainer-STVDMC36.cjs').then((mod) => ({ default: mod.MapContainer })),
|
|
224
887
|
{
|
|
225
888
|
displayName: "LazyMapContainer",
|
|
226
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(MapLoadingFallback, { minHeight: 400 })
|
|
889
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.MapLoadingFallback, { minHeight: 400 })
|
|
227
890
|
}
|
|
228
891
|
);
|
|
229
|
-
var LazyMapView = createLazyComponent(
|
|
230
|
-
() => import('./MapContainer-
|
|
892
|
+
var LazyMapView = chunkL25HA3TM_cjs.createLazyComponent(
|
|
893
|
+
() => import('./MapContainer-STVDMC36.cjs').then((mod) => ({ default: mod.MapView })),
|
|
231
894
|
{
|
|
232
895
|
displayName: "LazyMapView",
|
|
233
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(MapLoadingFallback, { minHeight: 400 })
|
|
896
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.MapLoadingFallback, { minHeight: 400 })
|
|
234
897
|
}
|
|
235
898
|
);
|
|
236
|
-
var LazyMermaid = createLazyComponent(
|
|
899
|
+
var LazyMermaid = chunkL25HA3TM_cjs.createLazyComponent(
|
|
237
900
|
() => import('./Mermaid.client-NNTI6DFX.cjs'),
|
|
238
901
|
{
|
|
239
902
|
displayName: "LazyMermaid",
|
|
240
903
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
241
|
-
CardLoadingFallback,
|
|
904
|
+
chunkL25HA3TM_cjs.CardLoadingFallback,
|
|
242
905
|
{
|
|
243
906
|
title: "Diagram",
|
|
244
907
|
description: "Loading...",
|
|
@@ -254,7 +917,7 @@ function CodeLoadingFallback() {
|
|
|
254
917
|
] }) }) });
|
|
255
918
|
}
|
|
256
919
|
chunkOLISEQHS_cjs.__name(CodeLoadingFallback, "CodeLoadingFallback");
|
|
257
|
-
var LazyPrettyCode = createLazyComponent(
|
|
920
|
+
var LazyPrettyCode = chunkL25HA3TM_cjs.createLazyComponent(
|
|
258
921
|
() => import('./PrettyCode.client-KOHDVPPN.cjs'),
|
|
259
922
|
{
|
|
260
923
|
displayName: "LazyPrettyCode",
|
|
@@ -268,7 +931,7 @@ function OpenapiLoadingFallback() {
|
|
|
268
931
|
] }) });
|
|
269
932
|
}
|
|
270
933
|
chunkOLISEQHS_cjs.__name(OpenapiLoadingFallback, "OpenapiLoadingFallback");
|
|
271
|
-
var LazyDocsLayout = createLazyComponent(
|
|
934
|
+
var LazyDocsLayout = chunkL25HA3TM_cjs.createLazyComponent(
|
|
272
935
|
() => import('./DocsLayout-2YZNS5VK.cjs').then((mod) => ({ default: mod.DocsLayout })),
|
|
273
936
|
{
|
|
274
937
|
displayName: "LazyDocsLayout",
|
|
@@ -279,12 +942,12 @@ var LazyOpenapiViewer = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) =>
|
|
|
279
942
|
return /* @__PURE__ */ jsxRuntime.jsx(chunk7EYHNP3E_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(LazyDocsLayout, {}) });
|
|
280
943
|
}, "LazyOpenapiViewer");
|
|
281
944
|
LazyOpenapiViewer.displayName = "LazyOpenapiViewer";
|
|
282
|
-
var LazyJsonSchemaForm = createLazyComponent(
|
|
945
|
+
var LazyJsonSchemaForm = chunkL25HA3TM_cjs.createLazyComponent(
|
|
283
946
|
() => import('./JsonSchemaForm-DD7CLRIG.cjs').then((mod) => ({ default: mod.JsonSchemaForm })),
|
|
284
947
|
{
|
|
285
948
|
displayName: "LazyJsonSchemaForm",
|
|
286
949
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
287
|
-
CardLoadingFallback,
|
|
950
|
+
chunkL25HA3TM_cjs.CardLoadingFallback,
|
|
288
951
|
{
|
|
289
952
|
title: "Form",
|
|
290
953
|
description: "Loading form schema...",
|
|
@@ -300,14 +963,14 @@ function LottieLoadingFallback() {
|
|
|
300
963
|
] }) });
|
|
301
964
|
}
|
|
302
965
|
chunkOLISEQHS_cjs.__name(LottieLoadingFallback, "LottieLoadingFallback");
|
|
303
|
-
var LazyLottiePlayer = createLazyComponent(
|
|
966
|
+
var LazyLottiePlayer = chunkL25HA3TM_cjs.createLazyComponent(
|
|
304
967
|
() => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer })),
|
|
305
968
|
{
|
|
306
969
|
displayName: "LazyLottiePlayer",
|
|
307
970
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(LottieLoadingFallback, {})
|
|
308
971
|
}
|
|
309
972
|
);
|
|
310
|
-
var LazyPlayer = createLazyComponent(
|
|
973
|
+
var LazyPlayer = chunkL25HA3TM_cjs.createLazyComponent(
|
|
311
974
|
() => import('./Player-PM7F7DD7.cjs').then((mod) => ({ default: mod.Player })),
|
|
312
975
|
{
|
|
313
976
|
displayName: "LazyAudioPlayer",
|
|
@@ -332,33 +995,33 @@ function VideoLoadingFallback() {
|
|
|
332
995
|
] }) });
|
|
333
996
|
}
|
|
334
997
|
chunkOLISEQHS_cjs.__name(VideoLoadingFallback, "VideoLoadingFallback");
|
|
335
|
-
var LazyVideoPlayer = createLazyComponent(
|
|
998
|
+
var LazyVideoPlayer = chunkL25HA3TM_cjs.createLazyComponent(
|
|
336
999
|
() => import('./components-MQ6DR7TX.cjs').then((mod) => ({ default: mod.VideoPlayer })),
|
|
337
1000
|
{
|
|
338
1001
|
displayName: "LazyVideoPlayer",
|
|
339
1002
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(VideoLoadingFallback, {})
|
|
340
1003
|
}
|
|
341
1004
|
);
|
|
342
|
-
var LazyJsonTree = createLazyComponent(
|
|
1005
|
+
var LazyJsonTree = chunkL25HA3TM_cjs.createLazyComponent(
|
|
343
1006
|
() => import('./JsonTree-X6W5YEVY.cjs'),
|
|
344
1007
|
{
|
|
345
1008
|
displayName: "LazyJsonTree",
|
|
346
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 100, text: "Loading JSON viewer..." })
|
|
1009
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 100, text: "Loading JSON viewer..." })
|
|
347
1010
|
}
|
|
348
1011
|
);
|
|
349
|
-
var LazyImageViewer = createLazyComponent(
|
|
1012
|
+
var LazyImageViewer = chunkL25HA3TM_cjs.createLazyComponent(
|
|
350
1013
|
() => import('./components-EHOGXATG.cjs').then((mod) => ({ default: mod.ImageViewer })),
|
|
351
1014
|
{
|
|
352
1015
|
displayName: "LazyImageViewer",
|
|
353
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 200, text: "Loading image viewer..." })
|
|
1016
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 200, text: "Loading image viewer..." })
|
|
354
1017
|
}
|
|
355
1018
|
);
|
|
356
|
-
var LazyCronScheduler = createLazyComponent(
|
|
1019
|
+
var LazyCronScheduler = chunkL25HA3TM_cjs.createLazyComponent(
|
|
357
1020
|
() => import('./CronScheduler.client-WEJF4PWQ.cjs'),
|
|
358
1021
|
{
|
|
359
1022
|
displayName: "LazyCronScheduler",
|
|
360
1023
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
361
|
-
LoadingFallback,
|
|
1024
|
+
chunkL25HA3TM_cjs.LoadingFallback,
|
|
362
1025
|
{
|
|
363
1026
|
minHeight: 120,
|
|
364
1027
|
showText: false,
|
|
@@ -367,18 +1030,11 @@ var LazyCronScheduler = createLazyComponent(
|
|
|
367
1030
|
)
|
|
368
1031
|
}
|
|
369
1032
|
);
|
|
370
|
-
var LazyTree = createLazyComponent(
|
|
1033
|
+
var LazyTree = chunkL25HA3TM_cjs.createLazyComponent(
|
|
371
1034
|
() => import('./TreeRoot-AABP2J6Y.cjs'),
|
|
372
1035
|
{
|
|
373
1036
|
displayName: "LazyTree",
|
|
374
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
|
|
375
|
-
}
|
|
376
|
-
);
|
|
377
|
-
var LazyChat = createLazyComponent(
|
|
378
|
-
() => import('./ChatRoot-LXIUBOXF.cjs').then((m) => ({ default: m.ChatRoot })),
|
|
379
|
-
{
|
|
380
|
-
displayName: "LazyChat",
|
|
381
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
|
|
1037
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
|
|
382
1038
|
}
|
|
383
1039
|
);
|
|
384
1040
|
|
|
@@ -412,7 +1068,7 @@ async function* parseSSE(response, options = {}) {
|
|
|
412
1068
|
throw new Error("SSE response has no body");
|
|
413
1069
|
}
|
|
414
1070
|
const map = options.map ?? DEFAULT_MAP;
|
|
415
|
-
const idleMs = options.idleTimeoutMs ??
|
|
1071
|
+
const idleMs = options.idleTimeoutMs ?? chunkTBSHZO5R_cjs.LIMITS.sseIdleMs;
|
|
416
1072
|
const reader = response.body.getReader();
|
|
417
1073
|
const decoder = new TextDecoder();
|
|
418
1074
|
let buffer = "";
|
|
@@ -627,7 +1283,7 @@ function createMockTransport(opts = {}) {
|
|
|
627
1283
|
async createSession(_opts) {
|
|
628
1284
|
await sleep(latency);
|
|
629
1285
|
return {
|
|
630
|
-
sessionId:
|
|
1286
|
+
sessionId: chunkTBSHZO5R_cjs.createId("s"),
|
|
631
1287
|
messages: history.length ? [...history] : void 0,
|
|
632
1288
|
hasMore: false,
|
|
633
1289
|
cursor: null,
|
|
@@ -644,12 +1300,12 @@ function createMockTransport(opts = {}) {
|
|
|
644
1300
|
throw new Error("mock transport scripted failure");
|
|
645
1301
|
}
|
|
646
1302
|
history.push({
|
|
647
|
-
id:
|
|
1303
|
+
id: chunkTBSHZO5R_cjs.createId("u"),
|
|
648
1304
|
role: "user",
|
|
649
1305
|
content,
|
|
650
1306
|
createdAt: Date.now()
|
|
651
1307
|
});
|
|
652
|
-
const messageId =
|
|
1308
|
+
const messageId = chunkTBSHZO5R_cjs.createId("a");
|
|
653
1309
|
yield { type: "message_start", messageId, sessionId: _sid };
|
|
654
1310
|
const reply = replies[turn % replies.length];
|
|
655
1311
|
turn += 1;
|
|
@@ -678,7 +1334,7 @@ function createMockTransport(opts = {}) {
|
|
|
678
1334
|
turn += 1;
|
|
679
1335
|
const text = typeof reply === "string" ? reply : reply.filter((e) => e.type === "chunk").map((e) => e.delta).join("");
|
|
680
1336
|
return {
|
|
681
|
-
id:
|
|
1337
|
+
id: chunkTBSHZO5R_cjs.createId("a"),
|
|
682
1338
|
role: "assistant",
|
|
683
1339
|
content: text || DEFAULT_REPLY,
|
|
684
1340
|
createdAt: Date.now()
|
|
@@ -748,1381 +1404,121 @@ function createPydanticAISSEMap() {
|
|
|
748
1404
|
try {
|
|
749
1405
|
parsed = JSON.parse(raw.data);
|
|
750
1406
|
} catch {
|
|
751
|
-
return null;
|
|
752
|
-
}
|
|
753
|
-
const out = [];
|
|
754
|
-
for (const evt of mapPydanticAIEvent(parsed, toolIds)) {
|
|
755
|
-
out.push(evt);
|
|
756
|
-
}
|
|
757
|
-
if (out.length === 0) return null;
|
|
758
|
-
if (out.length === 1) return out[0];
|
|
759
|
-
return out;
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
chunkOLISEQHS_cjs.__name(createPydanticAISSEMap, "createPydanticAISSEMap");
|
|
763
|
-
|
|
764
|
-
// src/tools/Chat/core/transport/pydantic-ai-transport.ts
|
|
765
|
-
var DEFAULT_SESSION_ID = "default";
|
|
766
|
-
function mapStatusToCode2(status) {
|
|
767
|
-
if (status === 401 || status === 403) return "unauthorized";
|
|
768
|
-
if (status === 404) return "not_found";
|
|
769
|
-
if (status === 408) return "timeout";
|
|
770
|
-
if (status === 429) return "rate_limited";
|
|
771
|
-
if (status >= 500) return "server_error";
|
|
772
|
-
return "error";
|
|
773
|
-
}
|
|
774
|
-
chunkOLISEQHS_cjs.__name(mapStatusToCode2, "mapStatusToCode");
|
|
775
|
-
function createPydanticAIChatTransport(opts) {
|
|
776
|
-
const fetchImpl = opts.fetchImpl ?? fetch.bind(globalThis);
|
|
777
|
-
const streamMethod = opts.streamMethod ?? "POST";
|
|
778
|
-
async function resolvedHeaders(extra) {
|
|
779
|
-
const base = opts.buildHeaders ? await opts.buildHeaders() : {};
|
|
780
|
-
const headers = new Headers(base);
|
|
781
|
-
if (extra) {
|
|
782
|
-
for (const [k, v] of Object.entries(extra)) headers.set(k, v);
|
|
783
|
-
}
|
|
784
|
-
return headers;
|
|
785
|
-
}
|
|
786
|
-
chunkOLISEQHS_cjs.__name(resolvedHeaders, "resolvedHeaders");
|
|
787
|
-
return {
|
|
788
|
-
async createSession(createOpts) {
|
|
789
|
-
if (opts.bootstrapSession) return opts.bootstrapSession(createOpts);
|
|
790
|
-
return { sessionId: DEFAULT_SESSION_ID };
|
|
791
|
-
},
|
|
792
|
-
async loadHistory(sessionId, cursor) {
|
|
793
|
-
if (opts.loadHistory) return opts.loadHistory(sessionId, cursor);
|
|
794
|
-
return { messages: [], hasMore: false, nextCursor: null };
|
|
795
|
-
},
|
|
796
|
-
async *stream(sessionId, content, options) {
|
|
797
|
-
const url = opts.buildStreamUrl(sessionId, content);
|
|
798
|
-
const headers = await resolvedHeaders({ Accept: "text/event-stream" });
|
|
799
|
-
const init = {
|
|
800
|
-
method: streamMethod,
|
|
801
|
-
headers,
|
|
802
|
-
signal: options.signal
|
|
803
|
-
};
|
|
804
|
-
if (streamMethod === "POST") {
|
|
805
|
-
headers.set("Content-Type", "application/json");
|
|
806
|
-
init.body = JSON.stringify({
|
|
807
|
-
content,
|
|
808
|
-
attachments: options.attachments ?? [],
|
|
809
|
-
metadata: options.metadata ?? {}
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
const res = await fetchImpl(typeof url === "string" ? url : url.toString(), init);
|
|
813
|
-
if (!res.ok) {
|
|
814
|
-
const text = await res.text().catch(() => "");
|
|
815
|
-
throw new TransportError(
|
|
816
|
-
`stream failed (${res.status}): ${text || res.statusText}`,
|
|
817
|
-
mapStatusToCode2(res.status)
|
|
818
|
-
);
|
|
819
|
-
}
|
|
820
|
-
const sideChannel = opts.onPydanticEvent;
|
|
821
|
-
if (!sideChannel) {
|
|
822
|
-
yield* parseSSE(res, {
|
|
823
|
-
signal: options.signal,
|
|
824
|
-
idleTimeoutMs: opts.idleTimeoutMs,
|
|
825
|
-
map: createPydanticAISSEMap()
|
|
826
|
-
});
|
|
827
|
-
return;
|
|
828
|
-
}
|
|
829
|
-
const toolIds = createToolIdQueue();
|
|
830
|
-
yield* parseSSE(res, {
|
|
831
|
-
signal: options.signal,
|
|
832
|
-
idleTimeoutMs: opts.idleTimeoutMs,
|
|
833
|
-
map: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((raw) => {
|
|
834
|
-
if (!raw.data) return null;
|
|
835
|
-
let parsed;
|
|
836
|
-
try {
|
|
837
|
-
parsed = JSON.parse(raw.data);
|
|
838
|
-
} catch {
|
|
839
|
-
return null;
|
|
840
|
-
}
|
|
841
|
-
try {
|
|
842
|
-
sideChannel(parsed);
|
|
843
|
-
} catch {
|
|
844
|
-
}
|
|
845
|
-
const out = [];
|
|
846
|
-
for (const evt of mapPydanticAIEvent(parsed, toolIds)) out.push(evt);
|
|
847
|
-
if (out.length === 0) return null;
|
|
848
|
-
if (out.length === 1) return out[0];
|
|
849
|
-
return out;
|
|
850
|
-
}, "map")
|
|
851
|
-
});
|
|
852
|
-
},
|
|
853
|
-
async send(sessionId, content, sendOpts) {
|
|
854
|
-
if (opts.send) return opts.send(sessionId, content, sendOpts);
|
|
855
|
-
throw new TransportError(
|
|
856
|
-
"Buffered send is not supported by this transport",
|
|
857
|
-
"unsupported"
|
|
858
|
-
);
|
|
859
|
-
},
|
|
860
|
-
async closeSession(sessionId) {
|
|
861
|
-
if (opts.closeSession) await opts.closeSession(sessionId);
|
|
862
|
-
}
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
chunkOLISEQHS_cjs.__name(createPydanticAIChatTransport, "createPydanticAIChatTransport");
|
|
866
|
-
var SIZE_PX = { sm: 44, md: 56, lg: 64 };
|
|
867
|
-
var ICON_PX = { sm: 18, md: 22, lg: 26 };
|
|
868
|
-
function useEffectiveFABSize(size, inline) {
|
|
869
|
-
const isPhone = hooks.useIsPhone();
|
|
870
|
-
const isBelowDesktop = hooks.useIsTabletOrBelow();
|
|
871
|
-
if (size !== "responsive") return size;
|
|
872
|
-
if (inline) return "md";
|
|
873
|
-
if (isPhone) return "sm";
|
|
874
|
-
if (isBelowDesktop) return "md";
|
|
875
|
-
return "lg";
|
|
876
|
-
}
|
|
877
|
-
chunkOLISEQHS_cjs.__name(useEffectiveFABSize, "useEffectiveFABSize");
|
|
878
|
-
function positionStyle(position, offset2) {
|
|
879
|
-
const [vert, horiz] = position.split("-");
|
|
880
|
-
return { [vert]: offset2, [horiz]: offset2 };
|
|
881
|
-
}
|
|
882
|
-
chunkOLISEQHS_cjs.__name(positionStyle, "positionStyle");
|
|
883
|
-
function tooltipSideClasses(position) {
|
|
884
|
-
return position.endsWith("right") ? "right-full mr-3 origin-right" : "left-full ml-3 origin-left";
|
|
885
|
-
}
|
|
886
|
-
chunkOLISEQHS_cjs.__name(tooltipSideClasses, "tooltipSideClasses");
|
|
887
|
-
function Badge({ value }) {
|
|
888
|
-
const display = value > 9 ? "9+" : String(value);
|
|
889
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
890
|
-
"span",
|
|
891
|
-
{
|
|
892
|
-
"aria-hidden": "true",
|
|
893
|
-
className: lib.cn(
|
|
894
|
-
"absolute -right-1 -top-1 inline-flex min-w-[18px] h-[18px] items-center justify-center",
|
|
895
|
-
"rounded-full bg-destructive px-1 text-[10px] font-semibold leading-none text-destructive-foreground",
|
|
896
|
-
"ring-2 ring-background"
|
|
897
|
-
),
|
|
898
|
-
children: display
|
|
899
|
-
}
|
|
900
|
-
);
|
|
901
|
-
}
|
|
902
|
-
chunkOLISEQHS_cjs.__name(Badge, "Badge");
|
|
903
|
-
function PulseDot() {
|
|
904
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "absolute right-1 top-1", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex h-2.5 w-2.5", children: [
|
|
905
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-0 rounded-full bg-destructive opacity-75 animate-ping" }),
|
|
906
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative inline-flex h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background" })
|
|
907
|
-
] }) });
|
|
908
|
-
}
|
|
909
|
-
chunkOLISEQHS_cjs.__name(PulseDot, "PulseDot");
|
|
910
|
-
function Tooltip({ text, side }) {
|
|
911
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
912
|
-
"span",
|
|
913
|
-
{
|
|
914
|
-
role: "tooltip",
|
|
915
|
-
className: lib.cn(
|
|
916
|
-
"pointer-events-none absolute top-1/2 -translate-y-1/2 whitespace-nowrap",
|
|
917
|
-
"rounded-md bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground shadow-md",
|
|
918
|
-
"border border-border opacity-0 scale-95 transition-all duration-150",
|
|
919
|
-
"group-hover:opacity-100 group-hover:scale-100",
|
|
920
|
-
"group-focus-within:opacity-100 group-focus-within:scale-100",
|
|
921
|
-
side
|
|
922
|
-
),
|
|
923
|
-
children: text
|
|
924
|
-
}
|
|
925
|
-
);
|
|
926
|
-
}
|
|
927
|
-
chunkOLISEQHS_cjs.__name(Tooltip, "Tooltip");
|
|
928
|
-
function ChatFAB({
|
|
929
|
-
onClick,
|
|
930
|
-
ariaLabel = "Open chat",
|
|
931
|
-
icon,
|
|
932
|
-
variant = "simple",
|
|
933
|
-
size = "responsive",
|
|
934
|
-
position = "bottom-right",
|
|
935
|
-
offset: offset2 = 24,
|
|
936
|
-
zIndex = 9999,
|
|
937
|
-
pulse = false,
|
|
938
|
-
badge,
|
|
939
|
-
tooltip,
|
|
940
|
-
inline = false,
|
|
941
|
-
className,
|
|
942
|
-
style
|
|
943
|
-
}) {
|
|
944
|
-
const effectiveSize = useEffectiveFABSize(size, inline);
|
|
945
|
-
const px = SIZE_PX[effectiveSize];
|
|
946
|
-
const iconPx = ICON_PX[effectiveSize];
|
|
947
|
-
const renderedIcon = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { size: iconPx });
|
|
948
|
-
const baseButton = lib.cn(
|
|
949
|
-
"relative grid place-items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
950
|
-
"transition-transform hover:scale-105"
|
|
951
|
-
);
|
|
952
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
953
|
-
"div",
|
|
954
|
-
{
|
|
955
|
-
className: lib.cn("group", inline ? "relative inline-flex" : "fixed"),
|
|
956
|
-
style: inline ? void 0 : { ...positionStyle(position, offset2), zIndex },
|
|
957
|
-
children: [
|
|
958
|
-
variant === "animated" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
959
|
-
AnimatedFAB,
|
|
960
|
-
{
|
|
961
|
-
ariaLabel,
|
|
962
|
-
onClick,
|
|
963
|
-
size: px,
|
|
964
|
-
className,
|
|
965
|
-
style,
|
|
966
|
-
children: renderedIcon
|
|
967
|
-
}
|
|
968
|
-
),
|
|
969
|
-
variant === "glass" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
970
|
-
"button",
|
|
971
|
-
{
|
|
972
|
-
type: "button",
|
|
973
|
-
"aria-label": ariaLabel,
|
|
974
|
-
onClick,
|
|
975
|
-
className: lib.cn(
|
|
976
|
-
baseButton,
|
|
977
|
-
"border border-border/40 bg-background/60 text-foreground shadow-lg backdrop-blur-xl",
|
|
978
|
-
"hover:bg-background/80",
|
|
979
|
-
className
|
|
980
|
-
),
|
|
981
|
-
style: { width: px, height: px, ...style },
|
|
982
|
-
children: [
|
|
983
|
-
renderedIcon,
|
|
984
|
-
badge !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { value: badge }) : pulse ? /* @__PURE__ */ jsxRuntime.jsx(PulseDot, {}) : null
|
|
985
|
-
]
|
|
986
|
-
}
|
|
987
|
-
),
|
|
988
|
-
variant === "simple" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
989
|
-
"button",
|
|
990
|
-
{
|
|
991
|
-
type: "button",
|
|
992
|
-
"aria-label": ariaLabel,
|
|
993
|
-
onClick,
|
|
994
|
-
className: lib.cn(
|
|
995
|
-
baseButton,
|
|
996
|
-
"bg-primary text-primary-foreground hover:bg-primary/90 shadow-2xl",
|
|
997
|
-
className
|
|
998
|
-
),
|
|
999
|
-
style: { width: px, height: px, ...style },
|
|
1000
|
-
children: [
|
|
1001
|
-
renderedIcon,
|
|
1002
|
-
badge !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { value: badge }) : pulse ? /* @__PURE__ */ jsxRuntime.jsx(PulseDot, {}) : null
|
|
1003
|
-
]
|
|
1004
|
-
}
|
|
1005
|
-
),
|
|
1006
|
-
tooltip && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { text: tooltip, side: tooltipSideClasses(position) })
|
|
1007
|
-
]
|
|
1008
|
-
}
|
|
1009
|
-
);
|
|
1010
|
-
}
|
|
1011
|
-
chunkOLISEQHS_cjs.__name(ChatFAB, "ChatFAB");
|
|
1012
|
-
function AnimatedFAB({ ariaLabel, onClick, size, className, style, children }) {
|
|
1013
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1014
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children: ANIMATED_CSS }),
|
|
1015
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1016
|
-
"div",
|
|
1017
|
-
{
|
|
1018
|
-
className: lib.cn("cmdop-fab-anim", className),
|
|
1019
|
-
style: { width: size, height: size, ...style },
|
|
1020
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-glow", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cmdop-fab-anim-wrap", children: [
|
|
1021
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-grad cmdop-fab-anim-grad-1" }),
|
|
1022
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-grad cmdop-fab-anim-grad-2" }),
|
|
1023
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-inner" }),
|
|
1024
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1025
|
-
"button",
|
|
1026
|
-
{
|
|
1027
|
-
type: "button",
|
|
1028
|
-
"aria-label": ariaLabel,
|
|
1029
|
-
onClick,
|
|
1030
|
-
className: "cmdop-fab-anim-btn",
|
|
1031
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cmdop-fab-anim-icon", children })
|
|
1032
|
-
}
|
|
1033
|
-
)
|
|
1034
|
-
] }) })
|
|
1035
|
-
}
|
|
1036
|
-
)
|
|
1037
|
-
] });
|
|
1038
|
-
}
|
|
1039
|
-
chunkOLISEQHS_cjs.__name(AnimatedFAB, "AnimatedFAB");
|
|
1040
|
-
var ANIMATED_CSS = `
|
|
1041
|
-
.cmdop-fab-anim {
|
|
1042
|
-
position: relative;
|
|
1043
|
-
pointer-events: auto;
|
|
1044
|
-
}
|
|
1045
|
-
.cmdop-fab-anim-glow {
|
|
1046
|
-
width: 100%; height: 100%;
|
|
1047
|
-
border-radius: 50%;
|
|
1048
|
-
overflow: hidden;
|
|
1049
|
-
animation:
|
|
1050
|
-
cmdop-fab-entrance 0.6s cubic-bezier(0.34, 1.45, 0.64, 1) forwards,
|
|
1051
|
-
cmdop-fab-glow-shift 8s ease-in-out 0.6s infinite;
|
|
1052
|
-
}
|
|
1053
|
-
.cmdop-fab-anim-wrap {
|
|
1054
|
-
position: relative; width: 100%; height: 100%;
|
|
1055
|
-
border-radius: 50%; overflow: hidden;
|
|
1056
|
-
}
|
|
1057
|
-
.cmdop-fab-anim-grad { position: absolute; inset: 0; border-radius: 50%; }
|
|
1058
|
-
.cmdop-fab-anim-grad-1 {
|
|
1059
|
-
background: conic-gradient(
|
|
1060
|
-
from 0deg,
|
|
1061
|
-
#fbbf24 0%, rgba(251,191,36,0) 15%,
|
|
1062
|
-
rgba(168,85,247,0) 20%, #a855f7 35%, rgba(168,85,247,0) 50%,
|
|
1063
|
-
rgba(20,184,166,0) 55%, #14b8a6 70%, rgba(20,184,166,0) 85%,
|
|
1064
|
-
rgba(236,72,153,0) 88%, #ec4899 97%, #fbbf24 100%
|
|
1065
|
-
);
|
|
1066
|
-
animation: cmdop-fab-rotate 7s linear infinite;
|
|
1067
|
-
filter: blur(1px); opacity: 0.95;
|
|
1068
|
-
}
|
|
1069
|
-
.cmdop-fab-anim-grad-2 {
|
|
1070
|
-
inset: 1px;
|
|
1071
|
-
background: conic-gradient(
|
|
1072
|
-
from 180deg,
|
|
1073
|
-
#a855f7 0%, rgba(168,85,247,0) 20%,
|
|
1074
|
-
rgba(20,184,166,0) 30%, #14b8a6 50%, rgba(20,184,166,0) 70%,
|
|
1075
|
-
rgba(251,191,36,0) 75%, #fbbf24 95%, #a855f7 100%
|
|
1076
|
-
);
|
|
1077
|
-
animation: cmdop-fab-rotate-rev 9s linear infinite;
|
|
1078
|
-
filter: blur(0.75px); opacity: 0.7;
|
|
1079
|
-
}
|
|
1080
|
-
.cmdop-fab-anim-inner {
|
|
1081
|
-
position: absolute; inset: 3px; border-radius: 50%;
|
|
1082
|
-
background: rgba(10, 10, 10, 0.65);
|
|
1083
|
-
backdrop-filter: blur(12px) saturate(1.8);
|
|
1084
|
-
-webkit-backdrop-filter: blur(12px) saturate(1.8);
|
|
1085
|
-
animation: cmdop-fab-inner-glow 5s ease-in-out infinite;
|
|
1086
|
-
}
|
|
1087
|
-
.cmdop-fab-anim-btn {
|
|
1088
|
-
position: absolute; inset: 2px;
|
|
1089
|
-
border-radius: 50%; border: none; background: transparent;
|
|
1090
|
-
cursor: pointer; display: flex; align-items: center; justify-content: center;
|
|
1091
|
-
transition: transform 0.2s;
|
|
1092
|
-
}
|
|
1093
|
-
.cmdop-fab-anim-btn:hover { transform: scale(1.06); }
|
|
1094
|
-
.cmdop-fab-anim-icon {
|
|
1095
|
-
color: #fbbf24; display: flex;
|
|
1096
|
-
filter: drop-shadow(0 0 6px rgba(251,191,36,0.8));
|
|
1097
|
-
animation: cmdop-fab-icon-pulse 2.5s ease-in-out infinite;
|
|
1098
|
-
}
|
|
1099
|
-
@keyframes cmdop-fab-rotate { to { transform: rotate(360deg); } }
|
|
1100
|
-
@keyframes cmdop-fab-rotate-rev { to { transform: rotate(-360deg); } }
|
|
1101
|
-
@keyframes cmdop-fab-entrance {
|
|
1102
|
-
0% { transform: scale(0); }
|
|
1103
|
-
50% { transform: scale(1.08); }
|
|
1104
|
-
70% { transform: scale(0.98); }
|
|
1105
|
-
100% { transform: scale(1); }
|
|
1106
|
-
}
|
|
1107
|
-
@keyframes cmdop-fab-glow-shift {
|
|
1108
|
-
0%, 100% { box-shadow: 0 0 20px rgba(251,191,36,0.5), 0 0 40px rgba(168,85,247,0.3); }
|
|
1109
|
-
33% { box-shadow: 0 0 20px rgba(168,85,247,0.5), 0 0 40px rgba(20,184,166,0.3); }
|
|
1110
|
-
66% { box-shadow: 0 0 20px rgba(20,184,166,0.5), 0 0 40px rgba(236,72,153,0.3); }
|
|
1111
|
-
}
|
|
1112
|
-
@keyframes cmdop-fab-icon-pulse {
|
|
1113
|
-
0%, 100% { opacity: 1; transform: scale(1); }
|
|
1114
|
-
50% { opacity: 0.85; transform: scale(1.15); }
|
|
1115
|
-
}
|
|
1116
|
-
@keyframes cmdop-fab-inner-glow {
|
|
1117
|
-
0%, 100% { box-shadow: inset 0 0 20px rgba(251,191,36,0.25), inset 0 0 40px rgba(168,85,247,0.15); }
|
|
1118
|
-
50% { box-shadow: inset 0 0 25px rgba(168,85,247,0.3), inset 0 0 45px rgba(20,184,166,0.2); }
|
|
1119
|
-
}
|
|
1120
|
-
`;
|
|
1121
|
-
function ChatHeader({
|
|
1122
|
-
title,
|
|
1123
|
-
icon,
|
|
1124
|
-
actions,
|
|
1125
|
-
showClose = true,
|
|
1126
|
-
onClose,
|
|
1127
|
-
closeLabel = "Close",
|
|
1128
|
-
closeSlot,
|
|
1129
|
-
className
|
|
1130
|
-
}) {
|
|
1131
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1132
|
-
"header",
|
|
1133
|
-
{
|
|
1134
|
-
className: lib.cn(
|
|
1135
|
-
"border-border bg-muted/30 flex shrink-0 items-center justify-between border-b px-4 py-2.5",
|
|
1136
|
-
className
|
|
1137
|
-
),
|
|
1138
|
-
children: [
|
|
1139
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2 text-sm font-semibold", children: [
|
|
1140
|
-
icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "text-primary h-4 w-4 shrink-0" }),
|
|
1141
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title })
|
|
1142
|
-
] }),
|
|
1143
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
|
|
1144
|
-
actions,
|
|
1145
|
-
closeSlot ?? (showClose && onClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1146
|
-
components.Button,
|
|
1147
|
-
{
|
|
1148
|
-
variant: "ghost",
|
|
1149
|
-
size: "sm",
|
|
1150
|
-
onClick: onClose,
|
|
1151
|
-
"aria-label": closeLabel,
|
|
1152
|
-
className: "-mr-1 h-7 w-7 p-0",
|
|
1153
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
1154
|
-
}
|
|
1155
|
-
))
|
|
1156
|
-
] })
|
|
1157
|
-
]
|
|
1158
|
-
}
|
|
1159
|
-
);
|
|
1160
|
-
}
|
|
1161
|
-
chunkOLISEQHS_cjs.__name(ChatHeader, "ChatHeader");
|
|
1162
|
-
function useChatPresence(open, exitDurationMs = 200) {
|
|
1163
|
-
const [phase, setPhase] = React.useState("hidden");
|
|
1164
|
-
const timerRef = React.useRef(null);
|
|
1165
|
-
React.useEffect(() => {
|
|
1166
|
-
if (timerRef.current) clearTimeout(timerRef.current);
|
|
1167
|
-
if (open) {
|
|
1168
|
-
setPhase("entering");
|
|
1169
|
-
timerRef.current = setTimeout(() => setPhase("visible"), 16);
|
|
1170
|
-
} else {
|
|
1171
|
-
setPhase("leaving");
|
|
1172
|
-
timerRef.current = setTimeout(() => setPhase("hidden"), exitDurationMs);
|
|
1173
|
-
}
|
|
1174
|
-
return () => {
|
|
1175
|
-
if (timerRef.current) clearTimeout(timerRef.current);
|
|
1176
|
-
};
|
|
1177
|
-
}, [open, exitDurationMs]);
|
|
1178
|
-
return phase;
|
|
1179
|
-
}
|
|
1180
|
-
chunkOLISEQHS_cjs.__name(useChatPresence, "useChatPresence");
|
|
1181
|
-
function dockPositionStyle(position, horizontal, vertical) {
|
|
1182
|
-
const [vert, horiz] = position.split("-");
|
|
1183
|
-
return { [vert]: vertical, [horiz]: horizontal };
|
|
1184
|
-
}
|
|
1185
|
-
chunkOLISEQHS_cjs.__name(dockPositionStyle, "dockPositionStyle");
|
|
1186
|
-
function ChatDock({
|
|
1187
|
-
open,
|
|
1188
|
-
onClose,
|
|
1189
|
-
children,
|
|
1190
|
-
mode = "popover",
|
|
1191
|
-
side = "right",
|
|
1192
|
-
title = "Chat",
|
|
1193
|
-
icon,
|
|
1194
|
-
headerActions,
|
|
1195
|
-
hideHeader = false,
|
|
1196
|
-
closeLabel,
|
|
1197
|
-
width,
|
|
1198
|
-
height = 720,
|
|
1199
|
-
position = "bottom-right",
|
|
1200
|
-
offset: offset2,
|
|
1201
|
-
exitDurationMs = 200,
|
|
1202
|
-
zIndex = 1e4,
|
|
1203
|
-
ariaLabel,
|
|
1204
|
-
className,
|
|
1205
|
-
mobileFullscreen = true,
|
|
1206
|
-
disablePortal = false,
|
|
1207
|
-
inline = false,
|
|
1208
|
-
reserveBodySpace
|
|
1209
|
-
}) {
|
|
1210
|
-
const phase = useChatPresence(open, exitDurationMs);
|
|
1211
|
-
const isMobile = hooks.useIsMobile();
|
|
1212
|
-
const isBelowDesktop = hooks.useIsTabletOrBelow();
|
|
1213
|
-
const effectiveMode = mode === "side" && !isBelowDesktop ? "side" : "popover";
|
|
1214
|
-
const fullscreen = mobileFullscreen && isMobile;
|
|
1215
|
-
const wantsReserve = !inline && !fullscreen && effectiveMode === "side" && (reserveBodySpace ?? true);
|
|
1216
|
-
const resolvedSideWidth = width ?? 420;
|
|
1217
|
-
React.useEffect(() => {
|
|
1218
|
-
if (!wantsReserve || phase === "hidden") return;
|
|
1219
|
-
const body = document.body;
|
|
1220
|
-
if (!body) return;
|
|
1221
|
-
const cssVar = `${resolvedSideWidth}px`;
|
|
1222
|
-
const padKey = side === "right" ? "paddingRight" : "paddingLeft";
|
|
1223
|
-
const prevPad = body.style[padKey];
|
|
1224
|
-
const prevVar = body.style.getPropertyValue("--chat-dock-reserve");
|
|
1225
|
-
body.style[padKey] = cssVar;
|
|
1226
|
-
body.style.setProperty("--chat-dock-reserve", cssVar);
|
|
1227
|
-
return () => {
|
|
1228
|
-
body.style[padKey] = prevPad;
|
|
1229
|
-
if (prevVar) body.style.setProperty("--chat-dock-reserve", prevVar);
|
|
1230
|
-
else body.style.removeProperty("--chat-dock-reserve");
|
|
1231
|
-
};
|
|
1232
|
-
}, [wantsReserve, phase, side, resolvedSideWidth]);
|
|
1233
|
-
if (phase === "hidden") return null;
|
|
1234
|
-
const animating = phase === "entering" || phase === "leaving";
|
|
1235
|
-
const horizontal = offset2?.horizontal ?? 24;
|
|
1236
|
-
const vertical = offset2?.vertical ?? 96;
|
|
1237
|
-
const resolvedWidth = width ?? (effectiveMode === "side" ? resolvedSideWidth : 480);
|
|
1238
|
-
let containerStyle;
|
|
1239
|
-
let cornerClass;
|
|
1240
|
-
const dynVH = "100dvh";
|
|
1241
|
-
if (inline) {
|
|
1242
|
-
containerStyle = {
|
|
1243
|
-
position: "relative",
|
|
1244
|
-
width: resolvedWidth,
|
|
1245
|
-
height,
|
|
1246
|
-
maxHeight: `calc(${dynVH} - 16px)`,
|
|
1247
|
-
pointerEvents: phase === "visible" ? "auto" : "none"
|
|
1248
|
-
};
|
|
1249
|
-
cornerClass = "rounded-xl border";
|
|
1250
|
-
} else if (fullscreen) {
|
|
1251
|
-
containerStyle = {
|
|
1252
|
-
position: "fixed",
|
|
1253
|
-
top: 0,
|
|
1254
|
-
[side === "left" ? "left" : "right"]: 0,
|
|
1255
|
-
width: "100vw",
|
|
1256
|
-
height: dynVH,
|
|
1257
|
-
zIndex,
|
|
1258
|
-
pointerEvents: phase === "visible" ? "auto" : "none"
|
|
1259
|
-
};
|
|
1260
|
-
cornerClass = "rounded-none border-0";
|
|
1261
|
-
} else if (effectiveMode === "side") {
|
|
1262
|
-
containerStyle = {
|
|
1263
|
-
position: "fixed",
|
|
1264
|
-
top: 0,
|
|
1265
|
-
[side]: 0,
|
|
1266
|
-
height: dynVH,
|
|
1267
|
-
zIndex,
|
|
1268
|
-
width: `min(${resolvedWidth}px, 100vw)`,
|
|
1269
|
-
pointerEvents: phase === "visible" ? "auto" : "none"
|
|
1270
|
-
};
|
|
1271
|
-
cornerClass = side === "right" ? "rounded-none border-l" : "rounded-none border-r";
|
|
1272
|
-
} else {
|
|
1273
|
-
const heightCap = `calc(${dynVH} - ${vertical + 24}px)`;
|
|
1274
|
-
containerStyle = {
|
|
1275
|
-
position: "fixed",
|
|
1276
|
-
...dockPositionStyle(position, horizontal, vertical),
|
|
1277
|
-
zIndex,
|
|
1278
|
-
width: `min(${resolvedWidth}px, calc(100vw - 32px))`,
|
|
1279
|
-
height: `min(${height}px, ${heightCap})`,
|
|
1280
|
-
minHeight: `min(320px, ${heightCap})`,
|
|
1281
|
-
pointerEvents: phase === "visible" ? "auto" : "none"
|
|
1282
|
-
};
|
|
1283
|
-
cornerClass = "rounded-xl border";
|
|
1284
|
-
}
|
|
1285
|
-
const enterClass = (() => {
|
|
1286
|
-
if (fullscreen) return "opacity-0";
|
|
1287
|
-
if (effectiveMode === "side") {
|
|
1288
|
-
return side === "right" ? "opacity-0 translate-x-4" : "opacity-0 -translate-x-4";
|
|
1289
|
-
}
|
|
1290
|
-
return "opacity-0 scale-95 translate-y-2";
|
|
1291
|
-
})();
|
|
1292
|
-
const visibleClass = "opacity-100 scale-100 translate-y-0 translate-x-0";
|
|
1293
|
-
return /* @__PURE__ */ jsxRuntime.jsx(components.Portal, { disablePortal: disablePortal || inline, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1294
|
-
"div",
|
|
1295
|
-
{
|
|
1296
|
-
role: "dialog",
|
|
1297
|
-
"aria-label": ariaLabel ?? (typeof title === "string" ? title : "Chat"),
|
|
1298
|
-
"aria-hidden": phase === "leaving",
|
|
1299
|
-
className: lib.cn(
|
|
1300
|
-
"bg-popover text-popover-foreground border-border",
|
|
1301
|
-
"flex flex-col overflow-hidden shadow-2xl",
|
|
1302
|
-
cornerClass,
|
|
1303
|
-
"transition-all duration-200 ease-out",
|
|
1304
|
-
animating ? enterClass : visibleClass,
|
|
1305
|
-
className
|
|
1306
|
-
),
|
|
1307
|
-
style: containerStyle,
|
|
1308
|
-
children: [
|
|
1309
|
-
!hideHeader && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1310
|
-
ChatHeader,
|
|
1311
|
-
{
|
|
1312
|
-
title,
|
|
1313
|
-
icon,
|
|
1314
|
-
actions: headerActions,
|
|
1315
|
-
onClose,
|
|
1316
|
-
closeLabel
|
|
1317
|
-
}
|
|
1318
|
-
),
|
|
1319
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 min-w-0 flex-1 overflow-hidden", children })
|
|
1320
|
-
]
|
|
1321
|
-
}
|
|
1322
|
-
) });
|
|
1323
|
-
}
|
|
1324
|
-
chunkOLISEQHS_cjs.__name(ChatDock, "ChatDock");
|
|
1325
|
-
var ChatHeaderActionButton = React.forwardRef(
|
|
1326
|
-
/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function ChatHeaderActionButton2({ icon, ariaLabel, badge, destructive, loading, disabled, className, ...rest }, ref) {
|
|
1327
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1328
|
-
"button",
|
|
1329
|
-
{
|
|
1330
|
-
ref,
|
|
1331
|
-
type: "button",
|
|
1332
|
-
"aria-label": ariaLabel,
|
|
1333
|
-
title: ariaLabel,
|
|
1334
|
-
disabled: disabled || loading,
|
|
1335
|
-
className: lib.cn(
|
|
1336
|
-
"relative inline-flex h-7 w-7 items-center justify-center rounded-md",
|
|
1337
|
-
"text-muted-foreground transition-colors",
|
|
1338
|
-
"hover:bg-accent hover:text-foreground",
|
|
1339
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1340
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1341
|
-
destructive && "hover:bg-destructive/15 hover:text-destructive",
|
|
1342
|
-
loading && "animate-pulse",
|
|
1343
|
-
className
|
|
1344
|
-
),
|
|
1345
|
-
...rest,
|
|
1346
|
-
children: [
|
|
1347
|
-
icon,
|
|
1348
|
-
badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1349
|
-
"span",
|
|
1350
|
-
{
|
|
1351
|
-
"aria-hidden": "true",
|
|
1352
|
-
className: "absolute -right-0.5 -top-0.5 inline-flex min-w-[14px] h-[14px] items-center justify-center rounded-full bg-destructive px-1 text-[9px] font-semibold leading-none text-destructive-foreground ring-2 ring-background",
|
|
1353
|
-
children: badge > 9 ? "9+" : badge
|
|
1354
|
-
}
|
|
1355
|
-
)
|
|
1356
|
-
]
|
|
1357
|
-
}
|
|
1358
|
-
);
|
|
1359
|
-
}, "ChatHeaderActionButton")
|
|
1360
|
-
);
|
|
1361
|
-
function ChatHeaderModeToggle({
|
|
1362
|
-
mode,
|
|
1363
|
-
onToggle,
|
|
1364
|
-
expandLabel = "Dock to side",
|
|
1365
|
-
collapseLabel = "Back to popover",
|
|
1366
|
-
forceVisible = false
|
|
1367
|
-
}) {
|
|
1368
|
-
const isBelowDesktop = hooks.useIsTabletOrBelow();
|
|
1369
|
-
if (isBelowDesktop && !forceVisible) return null;
|
|
1370
|
-
const isSide = mode === "side";
|
|
1371
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1372
|
-
ChatHeaderActionButton,
|
|
1373
|
-
{
|
|
1374
|
-
icon: isSide ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelRightClose, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelRightOpen, { className: "h-3.5 w-3.5" }),
|
|
1375
|
-
ariaLabel: isSide ? collapseLabel : expandLabel,
|
|
1376
|
-
onClick: onToggle
|
|
1377
|
-
}
|
|
1378
|
-
);
|
|
1379
|
-
}
|
|
1380
|
-
chunkOLISEQHS_cjs.__name(ChatHeaderModeToggle, "ChatHeaderModeToggle");
|
|
1381
|
-
function ChatHeaderAudioToggle({
|
|
1382
|
-
muted,
|
|
1383
|
-
onToggle,
|
|
1384
|
-
unmuteLabel = "Unmute notifications",
|
|
1385
|
-
muteLabel = "Mute notifications"
|
|
1386
|
-
}) {
|
|
1387
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1388
|
-
ChatHeaderActionButton,
|
|
1389
|
-
{
|
|
1390
|
-
icon: muted ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.VolumeX, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Volume2, { className: "h-3.5 w-3.5" }),
|
|
1391
|
-
ariaLabel: muted ? unmuteLabel : muteLabel,
|
|
1392
|
-
onClick: onToggle
|
|
1393
|
-
}
|
|
1394
|
-
);
|
|
1395
|
-
}
|
|
1396
|
-
chunkOLISEQHS_cjs.__name(ChatHeaderAudioToggle, "ChatHeaderAudioToggle");
|
|
1397
|
-
function useChatReset(opts) {
|
|
1398
|
-
const { onReset, onSuccess, onError } = opts;
|
|
1399
|
-
const [isResetting, setIsResetting] = React.useState(false);
|
|
1400
|
-
const reset = React.useCallback(async () => {
|
|
1401
|
-
if (isResetting) return false;
|
|
1402
|
-
setIsResetting(true);
|
|
1403
|
-
try {
|
|
1404
|
-
const ok = await onReset();
|
|
1405
|
-
if (ok) onSuccess?.();
|
|
1406
|
-
else onError?.();
|
|
1407
|
-
return ok;
|
|
1408
|
-
} catch (err) {
|
|
1409
|
-
onError?.(err);
|
|
1410
|
-
return false;
|
|
1411
|
-
} finally {
|
|
1412
|
-
setIsResetting(false);
|
|
1413
|
-
}
|
|
1414
|
-
}, [isResetting, onReset, onSuccess, onError]);
|
|
1415
|
-
return { reset, isResetting };
|
|
1416
|
-
}
|
|
1417
|
-
chunkOLISEQHS_cjs.__name(useChatReset, "useChatReset");
|
|
1418
|
-
var DEFAULT_TITLE = "Clear conversation?";
|
|
1419
|
-
var DEFAULT_MESSAGE = "The assistant will forget this session and start a new one. This cannot be undone.";
|
|
1420
|
-
var DEFAULT_LABEL = "Clear conversation";
|
|
1421
|
-
function ChatHeaderResetButton({
|
|
1422
|
-
onReset,
|
|
1423
|
-
onSuccess,
|
|
1424
|
-
onError,
|
|
1425
|
-
confirm = true,
|
|
1426
|
-
confirmTitle = DEFAULT_TITLE,
|
|
1427
|
-
confirmMessage = DEFAULT_MESSAGE,
|
|
1428
|
-
ariaLabel = DEFAULT_LABEL
|
|
1429
|
-
}) {
|
|
1430
|
-
const { reset, isResetting } = useChatReset({ onReset, onSuccess, onError });
|
|
1431
|
-
const handleClick = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(async () => {
|
|
1432
|
-
if (confirm) {
|
|
1433
|
-
const api = typeof window !== "undefined" ? window.dialog : void 0;
|
|
1434
|
-
if (api?.confirm) {
|
|
1435
|
-
const ok = await api.confirm({
|
|
1436
|
-
title: confirmTitle,
|
|
1437
|
-
message: confirmMessage,
|
|
1438
|
-
variant: "destructive",
|
|
1439
|
-
confirmText: "Clear",
|
|
1440
|
-
cancelText: "Cancel"
|
|
1441
|
-
});
|
|
1442
|
-
if (!ok) return;
|
|
1443
|
-
} else if (typeof window !== "undefined" && typeof window.confirm === "function") {
|
|
1444
|
-
const ok = window.confirm(`${confirmTitle}
|
|
1445
|
-
|
|
1446
|
-
${confirmMessage}`);
|
|
1447
|
-
if (!ok) return;
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
await reset();
|
|
1451
|
-
}, "handleClick");
|
|
1452
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1453
|
-
ChatHeaderActionButton,
|
|
1454
|
-
{
|
|
1455
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "h-3.5 w-3.5" }),
|
|
1456
|
-
ariaLabel,
|
|
1457
|
-
onClick: handleClick,
|
|
1458
|
-
loading: isResetting,
|
|
1459
|
-
destructive: true
|
|
1460
|
-
}
|
|
1461
|
-
);
|
|
1462
|
-
}
|
|
1463
|
-
chunkOLISEQHS_cjs.__name(ChatHeaderResetButton, "ChatHeaderResetButton");
|
|
1464
|
-
|
|
1465
|
-
// src/tools/SpeechRecognition/core/languages-catalog.ts
|
|
1466
|
-
var WEB_SPEECH_LANGUAGES = [
|
|
1467
|
-
{ name: "Afrikaans", iso: "af", englishName: "afrikaans", dialects: [{ code: "af-ZA", region: "South Africa" }] },
|
|
1468
|
-
{ name: "\u12A0\u121B\u122D\u129B", iso: "am", englishName: "amharic", dialects: [{ code: "am-ET", region: "Ethiopia" }] },
|
|
1469
|
-
{ name: "Az\u0259rbaycanca", iso: "az", englishName: "azerbaijani", dialects: [{ code: "az-AZ", region: "Azerbaijan" }] },
|
|
1470
|
-
{
|
|
1471
|
-
name: "\u09AC\u09BE\u0982\u09B2\u09BE",
|
|
1472
|
-
iso: "bn",
|
|
1473
|
-
englishName: "bengali",
|
|
1474
|
-
dialects: [
|
|
1475
|
-
{ code: "bn-BD", region: "Bangladesh" },
|
|
1476
|
-
{ code: "bn-IN", region: "India" }
|
|
1477
|
-
]
|
|
1478
|
-
},
|
|
1479
|
-
{ name: "Bahasa Indonesia", iso: "id", englishName: "indonesian", dialects: [{ code: "id-ID", region: "Indonesia" }] },
|
|
1480
|
-
{ name: "Bahasa Melayu", iso: "ms", englishName: "malay", dialects: [{ code: "ms-MY", region: "Malaysia" }] },
|
|
1481
|
-
{ name: "Catal\xE0", iso: "ca", englishName: "catalan", dialects: [{ code: "ca-ES", region: "Spain" }] },
|
|
1482
|
-
{ name: "\u010Ce\u0161tina", iso: "cs", englishName: "czech", dialects: [{ code: "cs-CZ", region: "Czechia" }] },
|
|
1483
|
-
{ name: "Dansk", iso: "da", englishName: "danish", dialects: [{ code: "da-DK", region: "Denmark" }] },
|
|
1484
|
-
{ name: "Deutsch", iso: "de", englishName: "german", dialects: [{ code: "de-DE", region: "Germany" }] },
|
|
1485
|
-
{
|
|
1486
|
-
name: "English",
|
|
1487
|
-
iso: "en",
|
|
1488
|
-
englishName: "english",
|
|
1489
|
-
dialects: [
|
|
1490
|
-
{ code: "en-US", region: "United States" },
|
|
1491
|
-
{ code: "en-GB", region: "United Kingdom" },
|
|
1492
|
-
{ code: "en-AU", region: "Australia" },
|
|
1493
|
-
{ code: "en-CA", region: "Canada" },
|
|
1494
|
-
{ code: "en-IN", region: "India" },
|
|
1495
|
-
{ code: "en-NZ", region: "New Zealand" },
|
|
1496
|
-
{ code: "en-PH", region: "Philippines" },
|
|
1497
|
-
{ code: "en-ZA", region: "South Africa" },
|
|
1498
|
-
{ code: "en-NG", region: "Nigeria" },
|
|
1499
|
-
{ code: "en-GH", region: "Ghana" },
|
|
1500
|
-
{ code: "en-KE", region: "Kenya" },
|
|
1501
|
-
{ code: "en-TZ", region: "Tanzania" }
|
|
1502
|
-
]
|
|
1503
|
-
},
|
|
1504
|
-
{
|
|
1505
|
-
name: "Espa\xF1ol",
|
|
1506
|
-
iso: "es",
|
|
1507
|
-
englishName: "spanish",
|
|
1508
|
-
dialects: [
|
|
1509
|
-
{ code: "es-ES", region: "Espa\xF1a" },
|
|
1510
|
-
{ code: "es-MX", region: "M\xE9xico" },
|
|
1511
|
-
{ code: "es-US", region: "Estados Unidos" },
|
|
1512
|
-
{ code: "es-AR", region: "Argentina" },
|
|
1513
|
-
{ code: "es-CL", region: "Chile" },
|
|
1514
|
-
{ code: "es-CO", region: "Colombia" },
|
|
1515
|
-
{ code: "es-PE", region: "Per\xFA" },
|
|
1516
|
-
{ code: "es-VE", region: "Venezuela" },
|
|
1517
|
-
{ code: "es-EC", region: "Ecuador" },
|
|
1518
|
-
{ code: "es-GT", region: "Guatemala" },
|
|
1519
|
-
{ code: "es-CR", region: "Costa Rica" },
|
|
1520
|
-
{ code: "es-PA", region: "Panam\xE1" },
|
|
1521
|
-
{ code: "es-DO", region: "Rep. Dominicana" },
|
|
1522
|
-
{ code: "es-UY", region: "Uruguay" },
|
|
1523
|
-
{ code: "es-PY", region: "Paraguay" },
|
|
1524
|
-
{ code: "es-BO", region: "Bolivia" },
|
|
1525
|
-
{ code: "es-SV", region: "El Salvador" },
|
|
1526
|
-
{ code: "es-HN", region: "Honduras" },
|
|
1527
|
-
{ code: "es-NI", region: "Nicaragua" },
|
|
1528
|
-
{ code: "es-PR", region: "Puerto Rico" }
|
|
1529
|
-
]
|
|
1530
|
-
},
|
|
1531
|
-
{ name: "Euskara", iso: "eu", englishName: "basque", dialects: [{ code: "eu-ES", region: "Spain" }] },
|
|
1532
|
-
{ name: "Filipino", iso: "fil", englishName: "filipino tagalog", dialects: [{ code: "fil-PH", region: "Philippines" }] },
|
|
1533
|
-
{ name: "Fran\xE7ais", iso: "fr", englishName: "french", dialects: [{ code: "fr-FR", region: "France" }] },
|
|
1534
|
-
{ name: "Basa Jawa", iso: "jv", englishName: "javanese", dialects: [{ code: "jv-ID", region: "Indonesia" }] },
|
|
1535
|
-
{ name: "Galego", iso: "gl", englishName: "galician", dialects: [{ code: "gl-ES", region: "Spain" }] },
|
|
1536
|
-
{ name: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0", iso: "gu", englishName: "gujarati", dialects: [{ code: "gu-IN", region: "India" }] },
|
|
1537
|
-
{ name: "Hrvatski", iso: "hr", englishName: "croatian", dialects: [{ code: "hr-HR", region: "Croatia" }] },
|
|
1538
|
-
{ name: "IsiZulu", iso: "zu", englishName: "zulu", dialects: [{ code: "zu-ZA", region: "South Africa" }] },
|
|
1539
|
-
{ name: "\xCDslenska", iso: "is", englishName: "icelandic", dialects: [{ code: "is-IS", region: "Iceland" }] },
|
|
1540
|
-
{
|
|
1541
|
-
name: "Italiano",
|
|
1542
|
-
iso: "it",
|
|
1543
|
-
englishName: "italian",
|
|
1544
|
-
dialects: [
|
|
1545
|
-
{ code: "it-IT", region: "Italia" },
|
|
1546
|
-
{ code: "it-CH", region: "Svizzera" }
|
|
1547
|
-
]
|
|
1548
|
-
},
|
|
1549
|
-
{ name: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1", iso: "kn", englishName: "kannada", dialects: [{ code: "kn-IN", region: "India" }] },
|
|
1550
|
-
{ name: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A", iso: "km", englishName: "khmer cambodian", dialects: [{ code: "km-KH", region: "Cambodia" }] },
|
|
1551
|
-
{ name: "Latvie\u0161u", iso: "lv", englishName: "latvian", dialects: [{ code: "lv-LV", region: "Latvia" }] },
|
|
1552
|
-
{ name: "Lietuvi\u0173", iso: "lt", englishName: "lithuanian", dialects: [{ code: "lt-LT", region: "Lithuania" }] },
|
|
1553
|
-
{ name: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02", iso: "ml", englishName: "malayalam", dialects: [{ code: "ml-IN", region: "India" }] },
|
|
1554
|
-
{ name: "\u092E\u0930\u093E\u0920\u0940", iso: "mr", englishName: "marathi", dialects: [{ code: "mr-IN", region: "India" }] },
|
|
1555
|
-
{ name: "Magyar", iso: "hu", englishName: "hungarian", dialects: [{ code: "hu-HU", region: "Hungary" }] },
|
|
1556
|
-
{ name: "\u0EA5\u0EB2\u0EA7", iso: "lo", englishName: "lao laotian", dialects: [{ code: "lo-LA", region: "Laos" }] },
|
|
1557
|
-
{ name: "Nederlands", iso: "nl", englishName: "dutch", dialects: [{ code: "nl-NL", region: "Netherlands" }] },
|
|
1558
|
-
{ name: "\u0928\u0947\u092A\u093E\u0932\u0940 \u092D\u093E\u0937\u093E", iso: "ne", englishName: "nepali", dialects: [{ code: "ne-NP", region: "Nepal" }] },
|
|
1559
|
-
{ name: "Norsk bokm\xE5l", iso: "nb", englishName: "norwegian bokmal", dialects: [{ code: "nb-NO", region: "Norway" }] },
|
|
1560
|
-
{ name: "Polski", iso: "pl", englishName: "polish", dialects: [{ code: "pl-PL", region: "Poland" }] },
|
|
1561
|
-
{
|
|
1562
|
-
name: "Portugu\xEAs",
|
|
1563
|
-
iso: "pt",
|
|
1564
|
-
englishName: "portuguese",
|
|
1565
|
-
dialects: [
|
|
1566
|
-
{ code: "pt-BR", region: "Brasil" },
|
|
1567
|
-
{ code: "pt-PT", region: "Portugal" }
|
|
1568
|
-
]
|
|
1569
|
-
},
|
|
1570
|
-
{ name: "Rom\xE2n\u0103", iso: "ro", englishName: "romanian", dialects: [{ code: "ro-RO", region: "Romania" }] },
|
|
1571
|
-
{ name: "\u0DC3\u0DD2\u0D82\u0DC4\u0DBD", iso: "si", englishName: "sinhala sinhalese", dialects: [{ code: "si-LK", region: "Sri Lanka" }] },
|
|
1572
|
-
{ name: "Sloven\u0161\u010Dina", iso: "sl", englishName: "slovenian", dialects: [{ code: "sl-SI", region: "Slovenia" }] },
|
|
1573
|
-
{ name: "Basa Sunda", iso: "su", englishName: "sundanese", dialects: [{ code: "su-ID", region: "Indonesia" }] },
|
|
1574
|
-
{ name: "Sloven\u010Dina", iso: "sk", englishName: "slovak", dialects: [{ code: "sk-SK", region: "Slovakia" }] },
|
|
1575
|
-
{ name: "Suomi", iso: "fi", englishName: "finnish", dialects: [{ code: "fi-FI", region: "Finland" }] },
|
|
1576
|
-
{ name: "Svenska", iso: "sv", englishName: "swedish", dialects: [{ code: "sv-SE", region: "Sweden" }] },
|
|
1577
|
-
{
|
|
1578
|
-
name: "Kiswahili",
|
|
1579
|
-
iso: "sw",
|
|
1580
|
-
englishName: "swahili",
|
|
1581
|
-
dialects: [
|
|
1582
|
-
{ code: "sw-TZ", region: "Tanzania" },
|
|
1583
|
-
{ code: "sw-KE", region: "Kenya" }
|
|
1584
|
-
]
|
|
1585
|
-
},
|
|
1586
|
-
{ name: "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8", iso: "ka", englishName: "georgian", dialects: [{ code: "ka-GE", region: "Georgia" }] },
|
|
1587
|
-
{ name: "\u0540\u0561\u0575\u0565\u0580\u0565\u0576", iso: "hy", englishName: "armenian", dialects: [{ code: "hy-AM", region: "Armenia" }] },
|
|
1588
|
-
{
|
|
1589
|
-
name: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",
|
|
1590
|
-
iso: "ta",
|
|
1591
|
-
englishName: "tamil",
|
|
1592
|
-
dialects: [
|
|
1593
|
-
{ code: "ta-IN", region: "\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE" },
|
|
1594
|
-
{ code: "ta-SG", region: "\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD" },
|
|
1595
|
-
{ code: "ta-LK", region: "\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8" },
|
|
1596
|
-
{ code: "ta-MY", region: "\u0BAE\u0BB2\u0BC7\u0B9A\u0BBF\u0BAF\u0BBE" }
|
|
1597
|
-
]
|
|
1598
|
-
},
|
|
1599
|
-
{ name: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41", iso: "te", englishName: "telugu", dialects: [{ code: "te-IN", region: "India" }] },
|
|
1600
|
-
{ name: "Ti\u1EBFng Vi\u1EC7t", iso: "vi", englishName: "vietnamese", dialects: [{ code: "vi-VN", region: "Vietnam" }] },
|
|
1601
|
-
{ name: "T\xFCrk\xE7e", iso: "tr", englishName: "turkish", dialects: [{ code: "tr-TR", region: "T\xFCrkiye" }] },
|
|
1602
|
-
{
|
|
1603
|
-
name: "\u0627\u064F\u0631\u062F\u064F\u0648",
|
|
1604
|
-
iso: "ur",
|
|
1605
|
-
englishName: "urdu",
|
|
1606
|
-
dialects: [
|
|
1607
|
-
{ code: "ur-PK", region: "\u067E\u0627\u06A9\u0633\u062A\u0627\u0646" },
|
|
1608
|
-
{ code: "ur-IN", region: "\u0628\u06BE\u0627\u0631\u062A" }
|
|
1609
|
-
]
|
|
1610
|
-
},
|
|
1611
|
-
{ name: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", iso: "el", englishName: "greek", dialects: [{ code: "el-GR", region: "Greece" }] },
|
|
1612
|
-
{ name: "\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", iso: "bg", englishName: "bulgarian", dialects: [{ code: "bg-BG", region: "Bulgaria" }] },
|
|
1613
|
-
{ name: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", iso: "ru", englishName: "russian", dialects: [{ code: "ru-RU", region: "Russia" }] },
|
|
1614
|
-
{ name: "\u0421\u0440\u043F\u0441\u043A\u0438", iso: "sr", englishName: "serbian", dialects: [{ code: "sr-RS", region: "Serbia" }] },
|
|
1615
|
-
{ name: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", iso: "uk", englishName: "ukrainian", dialects: [{ code: "uk-UA", region: "Ukraine" }] },
|
|
1616
|
-
{ name: "\uD55C\uAD6D\uC5B4", iso: "ko", englishName: "korean", dialects: [{ code: "ko-KR", region: "Korea" }] },
|
|
1617
|
-
{
|
|
1618
|
-
name: "\u4E2D\u6587",
|
|
1619
|
-
iso: "cmn",
|
|
1620
|
-
englishName: "chinese mandarin cantonese",
|
|
1621
|
-
dialects: [
|
|
1622
|
-
{ code: "cmn-Hans-CN", region: "\u666E\u901A\u8BDD (\u4E2D\u56FD\u5927\u9646)" },
|
|
1623
|
-
{ code: "cmn-Hans-HK", region: "\u666E\u901A\u8BDD (\u9999\u6E2F)" },
|
|
1624
|
-
{ code: "cmn-Hant-TW", region: "\u4E2D\u6587 (\u53F0\u7063)" },
|
|
1625
|
-
{ code: "yue-Hant-HK", region: "\u7CB5\u8A9E (\u9999\u6E2F)" }
|
|
1626
|
-
]
|
|
1627
|
-
},
|
|
1628
|
-
{ name: "\u65E5\u672C\u8A9E", iso: "ja", englishName: "japanese", dialects: [{ code: "ja-JP", region: "Japan" }] },
|
|
1629
|
-
{ name: "\u0939\u093F\u0928\u094D\u0926\u0940", iso: "hi", englishName: "hindi", dialects: [{ code: "hi-IN", region: "India" }] },
|
|
1630
|
-
{ name: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22", iso: "th", englishName: "thai", dialects: [{ code: "th-TH", region: "Thailand" }] }
|
|
1631
|
-
];
|
|
1632
|
-
WEB_SPEECH_LANGUAGES.flatMap(
|
|
1633
|
-
(l) => l.dialects.map((d) => d.code)
|
|
1634
|
-
);
|
|
1635
|
-
function findSpeechLanguage(tag) {
|
|
1636
|
-
if (!tag) return null;
|
|
1637
|
-
const lower = tag.toLowerCase();
|
|
1638
|
-
for (const language of WEB_SPEECH_LANGUAGES) {
|
|
1639
|
-
for (const dialect of language.dialects) {
|
|
1640
|
-
if (dialect.code.toLowerCase() === lower) return { language, dialect };
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
return null;
|
|
1644
|
-
}
|
|
1645
|
-
chunkOLISEQHS_cjs.__name(findSpeechLanguage, "findSpeechLanguage");
|
|
1646
|
-
function countryFromTag(tag) {
|
|
1647
|
-
if (!tag) return null;
|
|
1648
|
-
const parts = tag.split("-");
|
|
1649
|
-
for (let i = parts.length - 1; i >= 0; i -= 1) {
|
|
1650
|
-
const p = parts[i];
|
|
1651
|
-
if (p.length === 2 && /^[A-Za-z]{2}$/.test(p)) return p.toUpperCase();
|
|
1652
|
-
}
|
|
1653
|
-
return null;
|
|
1654
|
-
}
|
|
1655
|
-
chunkOLISEQHS_cjs.__name(countryFromTag, "countryFromTag");
|
|
1656
|
-
React.createContext(null);
|
|
1657
|
-
createLazyComponent(
|
|
1658
|
-
() => import('./DictationField-XWR5VOID.cjs').then((mod) => ({
|
|
1659
|
-
default: mod.DictationField
|
|
1660
|
-
})),
|
|
1661
|
-
{
|
|
1662
|
-
displayName: "LazyDictationField",
|
|
1663
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border/60 bg-card px-3 py-2 text-xs text-muted-foreground", children: "Loading dictation\u2026" })
|
|
1664
|
-
}
|
|
1665
|
-
);
|
|
1666
|
-
function ChatHeaderLanguageButton({
|
|
1667
|
-
ariaLabel = "Speech language",
|
|
1668
|
-
allowedTags,
|
|
1669
|
-
hideFallbackIcon,
|
|
1670
|
-
className
|
|
1671
|
-
}) {
|
|
1672
|
-
const prefs = chunk4PFW7MIJ_cjs.useSpeechPrefs();
|
|
1673
|
-
const active = chunk4PFW7MIJ_cjs.useResolvedLanguage();
|
|
1674
|
-
const options = React.useMemo(() => {
|
|
1675
|
-
const allow = allowedTags ? new Set(allowedTags) : null;
|
|
1676
|
-
const out = [];
|
|
1677
|
-
for (const lang of WEB_SPEECH_LANGUAGES) {
|
|
1678
|
-
for (const d of lang.dialects) {
|
|
1679
|
-
if (allow && !allow.has(d.code)) continue;
|
|
1680
|
-
out.push({
|
|
1681
|
-
value: d.code,
|
|
1682
|
-
// "Русский" / "Español — Argentina" / "English — United States"
|
|
1683
|
-
label: lang.dialects.length === 1 ? lang.name : `${lang.name} \u2014 ${d.region}`,
|
|
1684
|
-
// Search-only index: English name, BCP-47 tag, ISO, region.
|
|
1685
|
-
// Lets users type "russian" / "ru-RU" / "ru" / "argentina"
|
|
1686
|
-
// and still find the row regardless of native script.
|
|
1687
|
-
description: `${lang.englishName} ${d.code} ${lang.iso} ${d.region}`.toLowerCase()
|
|
1688
|
-
});
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
return out;
|
|
1692
|
-
}, [allowedTags]);
|
|
1693
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1694
|
-
components.Combobox,
|
|
1695
|
-
{
|
|
1696
|
-
options,
|
|
1697
|
-
value: prefs.language ?? active,
|
|
1698
|
-
onValueChange: (v) => prefs.setLanguage(v || null),
|
|
1699
|
-
placeholder: ariaLabel,
|
|
1700
|
-
searchPlaceholder: "Search language\u2026",
|
|
1701
|
-
filterFunction: (opt, search) => {
|
|
1702
|
-
const s = search.toLowerCase();
|
|
1703
|
-
return opt.label.toLowerCase().includes(s) || opt.value.toLowerCase().includes(s) || (opt.description?.includes(s) ?? false);
|
|
1704
|
-
},
|
|
1705
|
-
contentClassName: "w-[280px]",
|
|
1706
|
-
contentStyle: { zIndex: 10001 },
|
|
1707
|
-
renderOption: (option) => {
|
|
1708
|
-
const country = countryFromTag(option.value);
|
|
1709
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
1710
|
-
country ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1711
|
-
components.Flag,
|
|
1712
|
-
{
|
|
1713
|
-
countryCode: country,
|
|
1714
|
-
className: "h-4 w-5 shrink-0 overflow-hidden rounded-[2px] border border-border/60 ring-1 ring-black/5"
|
|
1715
|
-
}
|
|
1716
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
|
|
1717
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm", children: option.label })
|
|
1718
|
-
] });
|
|
1719
|
-
},
|
|
1720
|
-
renderTrigger: (selected, open) => {
|
|
1721
|
-
const tag = selected?.value ?? active;
|
|
1722
|
-
const country = countryFromTag(tag);
|
|
1723
|
-
const found = findSpeechLanguage(tag);
|
|
1724
|
-
const tooltipLabel = found ? `${found.language.name}${found.language.dialects.length > 1 ? ` \u2014 ${found.dialect.region}` : ""} \xB7 ${tag}` : tag;
|
|
1725
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1726
|
-
"button",
|
|
1727
|
-
{
|
|
1728
|
-
type: "button",
|
|
1729
|
-
"aria-label": `${ariaLabel}: ${tooltipLabel}`,
|
|
1730
|
-
"aria-expanded": open,
|
|
1731
|
-
title: tooltipLabel,
|
|
1732
|
-
className: lib.cn(
|
|
1733
|
-
"inline-flex h-7 w-7 items-center justify-center rounded-md",
|
|
1734
|
-
"text-muted-foreground transition-colors",
|
|
1735
|
-
"hover:bg-accent hover:text-foreground",
|
|
1736
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1737
|
-
className
|
|
1738
|
-
),
|
|
1739
|
-
children: country ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1740
|
-
components.Flag,
|
|
1741
|
-
{
|
|
1742
|
-
countryCode: country,
|
|
1743
|
-
className: "h-4 w-5 overflow-hidden rounded-[2px] border border-border/60 ring-1 ring-black/5"
|
|
1744
|
-
}
|
|
1745
|
-
) : hideFallbackIcon ? null : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "h-3.5 w-3.5", "aria-hidden": true })
|
|
1746
|
-
}
|
|
1747
|
-
);
|
|
1748
|
-
}
|
|
1749
|
-
}
|
|
1750
|
-
);
|
|
1751
|
-
}
|
|
1752
|
-
chunkOLISEQHS_cjs.__name(ChatHeaderLanguageButton, "ChatHeaderLanguageButton");
|
|
1753
|
-
function anchorStyle(position, fabOffset, fabClearance) {
|
|
1754
|
-
const [vert, horiz] = position.split("-");
|
|
1755
|
-
return { [vert]: fabClearance, [horiz]: fabOffset };
|
|
1756
|
-
}
|
|
1757
|
-
chunkOLISEQHS_cjs.__name(anchorStyle, "anchorStyle");
|
|
1758
|
-
function originClass(position) {
|
|
1759
|
-
if (position === "bottom-right") return "origin-bottom-right";
|
|
1760
|
-
if (position === "bottom-left") return "origin-bottom-left";
|
|
1761
|
-
if (position === "top-right") return "origin-top-right";
|
|
1762
|
-
return "origin-top-left";
|
|
1763
|
-
}
|
|
1764
|
-
chunkOLISEQHS_cjs.__name(originClass, "originClass");
|
|
1765
|
-
function ChatGreeting({
|
|
1766
|
-
open,
|
|
1767
|
-
children,
|
|
1768
|
-
onClick,
|
|
1769
|
-
onDismiss,
|
|
1770
|
-
position = "bottom-right",
|
|
1771
|
-
fabOffset = 24,
|
|
1772
|
-
fabClearance = 96,
|
|
1773
|
-
delayMs = 1500,
|
|
1774
|
-
zIndex = 9998,
|
|
1775
|
-
className,
|
|
1776
|
-
style,
|
|
1777
|
-
avatar,
|
|
1778
|
-
senderName,
|
|
1779
|
-
dismissLabel = "Dismiss",
|
|
1780
|
-
inline = false
|
|
1781
|
-
}) {
|
|
1782
|
-
const [delayed, setDelayed] = React.useState(delayMs <= 0);
|
|
1783
|
-
React.useEffect(() => {
|
|
1784
|
-
if (!open || delayMs <= 0) return;
|
|
1785
|
-
const t = setTimeout(() => setDelayed(true), delayMs);
|
|
1786
|
-
return () => clearTimeout(t);
|
|
1787
|
-
}, [open, delayMs]);
|
|
1788
|
-
const shouldShow = open && delayed;
|
|
1789
|
-
const phase = useChatPresence(shouldShow, 220);
|
|
1790
|
-
if (phase === "hidden") return null;
|
|
1791
|
-
const animating = phase === "entering" || phase === "leaving";
|
|
1792
|
-
const clickable = !!onClick;
|
|
1793
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1794
|
-
"div",
|
|
1795
|
-
{
|
|
1796
|
-
role: clickable ? "button" : "status",
|
|
1797
|
-
"aria-live": "polite",
|
|
1798
|
-
tabIndex: clickable ? 0 : -1,
|
|
1799
|
-
onClick: clickable ? onClick : void 0,
|
|
1800
|
-
onKeyDown: clickable ? (e) => {
|
|
1801
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1802
|
-
e.preventDefault();
|
|
1803
|
-
onClick?.();
|
|
1804
|
-
}
|
|
1805
|
-
} : void 0,
|
|
1806
|
-
className: lib.cn(
|
|
1807
|
-
inline ? "relative inline-flex" : "fixed",
|
|
1808
|
-
"flex items-start gap-2.5 max-w-[280px]",
|
|
1809
|
-
"rounded-2xl border border-border bg-popover text-popover-foreground",
|
|
1810
|
-
"px-3.5 py-2.5 shadow-2xl transition-all duration-200 ease-out",
|
|
1811
|
-
clickable && "cursor-pointer hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1812
|
-
originClass(position),
|
|
1813
|
-
animating ? "opacity-0 scale-95 translate-y-1" : "opacity-100 scale-100 translate-y-0",
|
|
1814
|
-
className
|
|
1815
|
-
),
|
|
1816
|
-
style: {
|
|
1817
|
-
...inline ? {} : anchorStyle(position, fabOffset, fabClearance),
|
|
1818
|
-
...inline ? {} : { zIndex },
|
|
1819
|
-
pointerEvents: phase === "visible" ? "auto" : "none",
|
|
1820
|
-
...style
|
|
1821
|
-
},
|
|
1822
|
-
children: [
|
|
1823
|
-
avatar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 shrink-0", children: avatar }),
|
|
1824
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 text-sm leading-snug", children: [
|
|
1825
|
-
senderName && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-0.5 text-[11px] font-medium text-muted-foreground", children: senderName }),
|
|
1826
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground", children })
|
|
1827
|
-
] }),
|
|
1828
|
-
onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1829
|
-
"button",
|
|
1830
|
-
{
|
|
1831
|
-
type: "button",
|
|
1832
|
-
"aria-label": dismissLabel,
|
|
1833
|
-
onClick: (e) => {
|
|
1834
|
-
e.stopPropagation();
|
|
1835
|
-
onDismiss();
|
|
1836
|
-
},
|
|
1837
|
-
className: lib.cn(
|
|
1838
|
-
"-mr-1 -mt-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
|
|
1839
|
-
"text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
1840
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
1841
|
-
),
|
|
1842
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3.5 w-3.5" })
|
|
1843
|
-
}
|
|
1844
|
-
)
|
|
1845
|
-
]
|
|
1846
|
-
}
|
|
1847
|
-
);
|
|
1848
|
-
}
|
|
1849
|
-
chunkOLISEQHS_cjs.__name(ChatGreeting, "ChatGreeting");
|
|
1850
|
-
var TIME_FORMAT = new Intl.DateTimeFormat(void 0, {
|
|
1851
|
-
hour: "2-digit",
|
|
1852
|
-
minute: "2-digit"
|
|
1853
|
-
});
|
|
1854
|
-
function anchorStyle2(position, fabOffset, fabClearance) {
|
|
1855
|
-
const [vert, horiz] = position.split("-");
|
|
1856
|
-
return { [vert]: fabClearance, [horiz]: fabOffset };
|
|
1857
|
-
}
|
|
1858
|
-
chunkOLISEQHS_cjs.__name(anchorStyle2, "anchorStyle");
|
|
1859
|
-
function originClass2(position) {
|
|
1860
|
-
if (position === "bottom-right") return "origin-bottom-right";
|
|
1861
|
-
if (position === "bottom-left") return "origin-bottom-left";
|
|
1862
|
-
if (position === "top-right") return "origin-top-right";
|
|
1863
|
-
return "origin-top-left";
|
|
1864
|
-
}
|
|
1865
|
-
chunkOLISEQHS_cjs.__name(originClass2, "originClass");
|
|
1866
|
-
function deriveAvatar(persona, name) {
|
|
1867
|
-
const initials = persona?.initials ?? (name ?? persona?.name ?? "?").split(/\s+/).map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1868
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(components.Avatar, { className: "h-9 w-9", children: [
|
|
1869
|
-
persona?.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(components.AvatarImage, { src: persona.avatarUrl }) : null,
|
|
1870
|
-
/* @__PURE__ */ jsxRuntime.jsx(components.AvatarFallback, { children: initials || "?" })
|
|
1871
|
-
] });
|
|
1872
|
-
}
|
|
1873
|
-
chunkOLISEQHS_cjs.__name(deriveAvatar, "deriveAvatar");
|
|
1874
|
-
function ChatUnreadPreview({
|
|
1875
|
-
open,
|
|
1876
|
-
message,
|
|
1877
|
-
onClick,
|
|
1878
|
-
onDismiss,
|
|
1879
|
-
position = "bottom-right",
|
|
1880
|
-
fabOffset = 24,
|
|
1881
|
-
fabClearance = 96,
|
|
1882
|
-
truncate = 2,
|
|
1883
|
-
zIndex = 9998,
|
|
1884
|
-
inline = false,
|
|
1885
|
-
className,
|
|
1886
|
-
style,
|
|
1887
|
-
dismissLabel = "Mark as read",
|
|
1888
|
-
avatar,
|
|
1889
|
-
senderName
|
|
1890
|
-
}) {
|
|
1891
|
-
const shouldShow = open && !!message;
|
|
1892
|
-
const phase = useChatPresence(shouldShow, 200);
|
|
1893
|
-
if (phase === "hidden" || !message) return null;
|
|
1894
|
-
const animating = phase === "entering" || phase === "leaving";
|
|
1895
|
-
const clickable = !!onClick;
|
|
1896
|
-
const displayName = senderName ?? message.sender?.name ?? "New message";
|
|
1897
|
-
const stamp = TIME_FORMAT.format(new Date(message.createdAt));
|
|
1898
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1899
|
-
"div",
|
|
1900
|
-
{
|
|
1901
|
-
role: clickable ? "button" : "status",
|
|
1902
|
-
"aria-live": "polite",
|
|
1903
|
-
tabIndex: clickable ? 0 : -1,
|
|
1904
|
-
onClick: clickable ? onClick : void 0,
|
|
1905
|
-
onKeyDown: clickable ? (e) => {
|
|
1906
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1907
|
-
e.preventDefault();
|
|
1908
|
-
onClick?.();
|
|
1909
|
-
}
|
|
1910
|
-
} : void 0,
|
|
1911
|
-
className: lib.cn(
|
|
1912
|
-
inline ? "relative inline-flex" : "fixed",
|
|
1913
|
-
"flex items-start gap-2.5 max-w-[300px]",
|
|
1914
|
-
"rounded-2xl border border-border bg-popover text-popover-foreground",
|
|
1915
|
-
"px-3.5 py-2.5 shadow-2xl transition-all duration-200 ease-out",
|
|
1916
|
-
clickable && "cursor-pointer hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1917
|
-
originClass2(position),
|
|
1918
|
-
animating ? "opacity-0 scale-95 translate-y-1" : "opacity-100 scale-100 translate-y-0",
|
|
1919
|
-
className
|
|
1920
|
-
),
|
|
1921
|
-
style: {
|
|
1922
|
-
...inline ? {} : anchorStyle2(position, fabOffset, fabClearance),
|
|
1923
|
-
...inline ? {} : { zIndex },
|
|
1924
|
-
pointerEvents: phase === "visible" ? "auto" : "none",
|
|
1925
|
-
...style
|
|
1926
|
-
},
|
|
1927
|
-
children: [
|
|
1928
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 shrink-0", children: avatar ?? deriveAvatar(message.sender, displayName) }),
|
|
1929
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 text-sm leading-snug", children: [
|
|
1930
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
1931
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[12px] font-semibold text-foreground", children: displayName }),
|
|
1932
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 text-[10px] text-muted-foreground", children: stamp })
|
|
1933
|
-
] }),
|
|
1934
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1935
|
-
"div",
|
|
1936
|
-
{
|
|
1937
|
-
className: "text-foreground/90 mt-0.5 break-words",
|
|
1938
|
-
style: {
|
|
1939
|
-
display: "-webkit-box",
|
|
1940
|
-
WebkitLineClamp: truncate,
|
|
1941
|
-
WebkitBoxOrient: "vertical",
|
|
1942
|
-
overflow: "hidden"
|
|
1943
|
-
},
|
|
1944
|
-
children: message.content
|
|
1945
|
-
}
|
|
1946
|
-
)
|
|
1947
|
-
] }),
|
|
1948
|
-
onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1949
|
-
"button",
|
|
1950
|
-
{
|
|
1951
|
-
type: "button",
|
|
1952
|
-
"aria-label": dismissLabel,
|
|
1953
|
-
onClick: (e) => {
|
|
1954
|
-
e.stopPropagation();
|
|
1955
|
-
onDismiss();
|
|
1956
|
-
},
|
|
1957
|
-
className: lib.cn(
|
|
1958
|
-
"-mr-1 -mt-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
|
|
1959
|
-
"text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
1960
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
1961
|
-
),
|
|
1962
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3.5 w-3.5" })
|
|
1963
|
-
}
|
|
1964
|
-
) : null
|
|
1965
|
-
]
|
|
1407
|
+
return null;
|
|
1966
1408
|
}
|
|
1967
|
-
|
|
1409
|
+
const out = [];
|
|
1410
|
+
for (const evt of mapPydanticAIEvent(parsed, toolIds)) {
|
|
1411
|
+
out.push(evt);
|
|
1412
|
+
}
|
|
1413
|
+
if (out.length === 0) return null;
|
|
1414
|
+
if (out.length === 1) return out[0];
|
|
1415
|
+
return out;
|
|
1416
|
+
};
|
|
1968
1417
|
}
|
|
1969
|
-
chunkOLISEQHS_cjs.__name(
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1418
|
+
chunkOLISEQHS_cjs.__name(createPydanticAISSEMap, "createPydanticAISSEMap");
|
|
1419
|
+
|
|
1420
|
+
// src/tools/Chat/core/transport/pydantic-ai-transport.ts
|
|
1421
|
+
var DEFAULT_SESSION_ID = "default";
|
|
1422
|
+
function mapStatusToCode2(status) {
|
|
1423
|
+
if (status === 401 || status === 403) return "unauthorized";
|
|
1424
|
+
if (status === 404) return "not_found";
|
|
1425
|
+
if (status === 408) return "timeout";
|
|
1426
|
+
if (status === 429) return "rate_limited";
|
|
1427
|
+
if (status >= 500) return "server_error";
|
|
1428
|
+
return "error";
|
|
1978
1429
|
}
|
|
1979
|
-
chunkOLISEQHS_cjs.__name(
|
|
1980
|
-
function
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1430
|
+
chunkOLISEQHS_cjs.__name(mapStatusToCode2, "mapStatusToCode");
|
|
1431
|
+
function createPydanticAIChatTransport(opts) {
|
|
1432
|
+
const fetchImpl = opts.fetchImpl ?? fetch.bind(globalThis);
|
|
1433
|
+
const streamMethod = opts.streamMethod ?? "POST";
|
|
1434
|
+
async function resolvedHeaders(extra) {
|
|
1435
|
+
const base = opts.buildHeaders ? await opts.buildHeaders() : {};
|
|
1436
|
+
const headers = new Headers(base);
|
|
1437
|
+
if (extra) {
|
|
1438
|
+
for (const [k, v] of Object.entries(extra)) headers.set(k, v);
|
|
1439
|
+
}
|
|
1440
|
+
return headers;
|
|
1986
1441
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
dock,
|
|
1993
|
-
greeting,
|
|
1994
|
-
hotkey,
|
|
1995
|
-
defaultOpen = false,
|
|
1996
|
-
open: controlledOpen,
|
|
1997
|
-
onOpenChange,
|
|
1998
|
-
autoFocusComposerOnOpen = true,
|
|
1999
|
-
closeOnEscape = true,
|
|
2000
|
-
unreadMessage,
|
|
2001
|
-
onMarkRead,
|
|
2002
|
-
unreadPreview,
|
|
2003
|
-
audio,
|
|
2004
|
-
hideAudioToggle = false
|
|
2005
|
-
}) {
|
|
2006
|
-
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
2007
|
-
const isControlled = controlledOpen !== void 0;
|
|
2008
|
-
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
2009
|
-
const dockContentRef = React.useRef(null);
|
|
2010
|
-
React.useEffect(() => {
|
|
2011
|
-
if (!autoFocusComposerOnOpen || !open) return;
|
|
2012
|
-
const t = setTimeout(() => {
|
|
2013
|
-
const root = dockContentRef.current;
|
|
2014
|
-
if (!root) return;
|
|
2015
|
-
const target = root.querySelector(
|
|
2016
|
-
'textarea:not([disabled]):not([readonly]), input[type="text"]:not([disabled]):not([readonly])'
|
|
2017
|
-
);
|
|
2018
|
-
target?.focus();
|
|
2019
|
-
}, 120);
|
|
2020
|
-
return () => clearTimeout(t);
|
|
2021
|
-
}, [open, autoFocusComposerOnOpen]);
|
|
2022
|
-
const setOpen = React.useCallback(
|
|
2023
|
-
(next) => {
|
|
2024
|
-
if (!isControlled) setUncontrolledOpen(next);
|
|
2025
|
-
onOpenChange?.(next);
|
|
1442
|
+
chunkOLISEQHS_cjs.__name(resolvedHeaders, "resolvedHeaders");
|
|
1443
|
+
return {
|
|
1444
|
+
async createSession(createOpts) {
|
|
1445
|
+
if (opts.bootstrapSession) return opts.bootstrapSession(createOpts);
|
|
1446
|
+
return { sessionId: DEFAULT_SESSION_ID };
|
|
2026
1447
|
},
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
hooks.useHotkey(
|
|
2031
|
-
"escape",
|
|
2032
|
-
(e) => {
|
|
2033
|
-
const target = e?.target ?? null;
|
|
2034
|
-
const inEditable = !!target && (target.matches?.('input, textarea, [contenteditable="true"]') ?? false);
|
|
2035
|
-
if (inEditable) {
|
|
2036
|
-
target.blur();
|
|
2037
|
-
return;
|
|
2038
|
-
}
|
|
2039
|
-
setOpen(false);
|
|
1448
|
+
async loadHistory(sessionId, cursor) {
|
|
1449
|
+
if (opts.loadHistory) return opts.loadHistory(sessionId, cursor);
|
|
1450
|
+
return { messages: [], hasMore: false, nextCursor: null };
|
|
2040
1451
|
},
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
setOpen(!open);
|
|
2057
|
-
}, "handler");
|
|
2058
|
-
window.addEventListener("keydown", handler);
|
|
2059
|
-
return () => window.removeEventListener("keydown", handler);
|
|
2060
|
-
}, [hotkey?.key, hotkey?.meta, hotkey?.shift, hotkey?.alt, open, setOpen, hotkey]);
|
|
2061
|
-
const greetingOpen = !!greetingConfig && !dismissed && (greetingConfig.hideOnOpen === false || !open);
|
|
2062
|
-
const fabPosition = fab?.position ?? "bottom-right";
|
|
2063
|
-
const fabOffset = fab?.offset ?? 24;
|
|
2064
|
-
const handleGreetingDismiss = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
2065
|
-
setDismissed(true);
|
|
2066
|
-
writeDismissed(greetingConfig?.dismissStorageKey);
|
|
2067
|
-
}, "handleGreetingDismiss");
|
|
2068
|
-
const handleGreetingClick = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
2069
|
-
setOpen(true);
|
|
2070
|
-
setDismissed(true);
|
|
2071
|
-
writeDismissed(greetingConfig?.dismissStorageKey);
|
|
2072
|
-
}, "handleGreetingClick");
|
|
2073
|
-
React.useEffect(() => {
|
|
2074
|
-
if (open && unreadMessage) onMarkRead?.();
|
|
2075
|
-
}, [open, unreadMessage, onMarkRead]);
|
|
2076
|
-
const unreadOpen = !open && !!unreadMessage;
|
|
2077
|
-
const handleUnreadClick = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
2078
|
-
setOpen(true);
|
|
2079
|
-
onMarkRead?.();
|
|
2080
|
-
}, "handleUnreadClick");
|
|
2081
|
-
const handleUnreadDismiss = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
2082
|
-
onMarkRead?.();
|
|
2083
|
-
}, "handleUnreadDismiss");
|
|
2084
|
-
const resolvedFab = unreadMessage && fab?.badge === void 0 ? { ...fab, badge: 1 } : fab;
|
|
2085
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2086
|
-
/* @__PURE__ */ jsxRuntime.jsx(ChatFAB, { ...resolvedFab, onClick: toggleOpen }),
|
|
2087
|
-
unreadMessage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2088
|
-
ChatUnreadPreview,
|
|
2089
|
-
{
|
|
2090
|
-
...unreadPreview,
|
|
2091
|
-
open: unreadOpen,
|
|
2092
|
-
message: unreadMessage,
|
|
2093
|
-
onClick: handleUnreadClick,
|
|
2094
|
-
onDismiss: handleUnreadDismiss,
|
|
2095
|
-
position: fabPosition,
|
|
2096
|
-
fabOffset
|
|
1452
|
+
async *stream(sessionId, content, options) {
|
|
1453
|
+
const url = opts.buildStreamUrl(sessionId, content);
|
|
1454
|
+
const headers = await resolvedHeaders({ Accept: "text/event-stream" });
|
|
1455
|
+
const init = {
|
|
1456
|
+
method: streamMethod,
|
|
1457
|
+
headers,
|
|
1458
|
+
signal: options.signal
|
|
1459
|
+
};
|
|
1460
|
+
if (streamMethod === "POST") {
|
|
1461
|
+
headers.set("Content-Type", "application/json");
|
|
1462
|
+
init.body = JSON.stringify({
|
|
1463
|
+
content,
|
|
1464
|
+
attachments: options.attachments ?? [],
|
|
1465
|
+
metadata: options.metadata ?? {}
|
|
1466
|
+
});
|
|
2097
1467
|
}
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
position: fabPosition,
|
|
2106
|
-
fabOffset,
|
|
2107
|
-
children: greetingConfig.content
|
|
1468
|
+
const res = await fetchImpl(typeof url === "string" ? url : url.toString(), init);
|
|
1469
|
+
if (!res.ok) {
|
|
1470
|
+
const text = await res.text().catch(() => "");
|
|
1471
|
+
throw new TransportError(
|
|
1472
|
+
`stream failed (${res.status}): ${text || res.statusText}`,
|
|
1473
|
+
mapStatusToCode2(res.status)
|
|
1474
|
+
);
|
|
2108
1475
|
}
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
dock?.headerActions,
|
|
2118
|
-
audio && !audio.isSilent && !hideAudioToggle ? /* @__PURE__ */ jsxRuntime.jsx(ChatHeaderAudioToggle, { muted: audio.muted, onToggle: audio.toggleMute }) : null
|
|
2119
|
-
] }) : void 0,
|
|
2120
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: dockContentRef, className: "flex h-full min-h-0 min-w-0 flex-col", children })
|
|
1476
|
+
const sideChannel = opts.onPydanticEvent;
|
|
1477
|
+
if (!sideChannel) {
|
|
1478
|
+
yield* parseSSE(res, {
|
|
1479
|
+
signal: options.signal,
|
|
1480
|
+
idleTimeoutMs: opts.idleTimeoutMs,
|
|
1481
|
+
map: createPydanticAISSEMap()
|
|
1482
|
+
});
|
|
1483
|
+
return;
|
|
2121
1484
|
}
|
|
2122
|
-
|
|
2123
|
-
|
|
1485
|
+
const toolIds = createToolIdQueue();
|
|
1486
|
+
yield* parseSSE(res, {
|
|
1487
|
+
signal: options.signal,
|
|
1488
|
+
idleTimeoutMs: opts.idleTimeoutMs,
|
|
1489
|
+
map: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((raw) => {
|
|
1490
|
+
if (!raw.data) return null;
|
|
1491
|
+
let parsed;
|
|
1492
|
+
try {
|
|
1493
|
+
parsed = JSON.parse(raw.data);
|
|
1494
|
+
} catch {
|
|
1495
|
+
return null;
|
|
1496
|
+
}
|
|
1497
|
+
try {
|
|
1498
|
+
sideChannel(parsed);
|
|
1499
|
+
} catch {
|
|
1500
|
+
}
|
|
1501
|
+
const out = [];
|
|
1502
|
+
for (const evt of mapPydanticAIEvent(parsed, toolIds)) out.push(evt);
|
|
1503
|
+
if (out.length === 0) return null;
|
|
1504
|
+
if (out.length === 1) return out[0];
|
|
1505
|
+
return out;
|
|
1506
|
+
}, "map")
|
|
1507
|
+
});
|
|
1508
|
+
},
|
|
1509
|
+
async send(sessionId, content, sendOpts) {
|
|
1510
|
+
if (opts.send) return opts.send(sessionId, content, sendOpts);
|
|
1511
|
+
throw new TransportError(
|
|
1512
|
+
"Buffered send is not supported by this transport",
|
|
1513
|
+
"unsupported"
|
|
1514
|
+
);
|
|
1515
|
+
},
|
|
1516
|
+
async closeSession(sessionId) {
|
|
1517
|
+
if (opts.closeSession) await opts.closeSession(sessionId);
|
|
1518
|
+
}
|
|
1519
|
+
};
|
|
2124
1520
|
}
|
|
2125
|
-
chunkOLISEQHS_cjs.__name(
|
|
1521
|
+
chunkOLISEQHS_cjs.__name(createPydanticAIChatTransport, "createPydanticAIChatTransport");
|
|
2126
1522
|
function useChatScroll(options) {
|
|
2127
1523
|
const {
|
|
2128
1524
|
containerRef,
|
|
@@ -2131,12 +1527,12 @@ function useChatScroll(options) {
|
|
|
2131
1527
|
bottomThresholdPx = 80,
|
|
2132
1528
|
messagesCount = 0
|
|
2133
1529
|
} = options;
|
|
2134
|
-
const [isAtBottom, setIsAtBottom] =
|
|
2135
|
-
const [unreadCount, setUnreadCount] =
|
|
2136
|
-
const lastCountRef =
|
|
2137
|
-
const stickyRef =
|
|
2138
|
-
const wasStreamingRef =
|
|
2139
|
-
const scrollToBottom =
|
|
1530
|
+
const [isAtBottom, setIsAtBottom] = react.useState(true);
|
|
1531
|
+
const [unreadCount, setUnreadCount] = react.useState(0);
|
|
1532
|
+
const lastCountRef = react.useRef(messagesCount);
|
|
1533
|
+
const stickyRef = react.useRef(true);
|
|
1534
|
+
const wasStreamingRef = react.useRef(isStreaming);
|
|
1535
|
+
const scrollToBottom = react.useCallback(
|
|
2140
1536
|
(smooth = false) => {
|
|
2141
1537
|
const el = containerRef.current;
|
|
2142
1538
|
if (!el) return;
|
|
@@ -2150,8 +1546,8 @@ function useChatScroll(options) {
|
|
|
2150
1546
|
},
|
|
2151
1547
|
[containerRef]
|
|
2152
1548
|
);
|
|
2153
|
-
const resetUnread =
|
|
2154
|
-
|
|
1549
|
+
const resetUnread = react.useCallback(() => setUnreadCount(0), []);
|
|
1550
|
+
react.useEffect(() => {
|
|
2155
1551
|
const el = containerRef.current;
|
|
2156
1552
|
if (!el) return;
|
|
2157
1553
|
const onScroll = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
@@ -2167,7 +1563,7 @@ function useChatScroll(options) {
|
|
|
2167
1563
|
el.removeEventListener("scroll", onScroll);
|
|
2168
1564
|
};
|
|
2169
1565
|
}, [containerRef, bottomThresholdPx]);
|
|
2170
|
-
|
|
1566
|
+
react.useEffect(() => {
|
|
2171
1567
|
const el = containerRef.current;
|
|
2172
1568
|
if (!el) return;
|
|
2173
1569
|
if (isStreaming) {
|
|
@@ -2200,7 +1596,7 @@ function useChatScroll(options) {
|
|
|
2200
1596
|
wasStreamingRef.current = false;
|
|
2201
1597
|
return;
|
|
2202
1598
|
}, [containerRef, isStreaming]);
|
|
2203
|
-
|
|
1599
|
+
react.useEffect(() => {
|
|
2204
1600
|
if (messagesCount > lastCountRef.current) {
|
|
2205
1601
|
if (stickyRef.current) {
|
|
2206
1602
|
const el = containerRef.current;
|
|
@@ -2211,15 +1607,15 @@ function useChatScroll(options) {
|
|
|
2211
1607
|
}
|
|
2212
1608
|
lastCountRef.current = messagesCount;
|
|
2213
1609
|
}, [containerRef, messagesCount]);
|
|
2214
|
-
|
|
1610
|
+
react.useEffect(() => {
|
|
2215
1611
|
}, [bottomRef]);
|
|
2216
1612
|
return { isAtBottom, unreadCount, scrollToBottom, resetUnread };
|
|
2217
1613
|
}
|
|
2218
1614
|
chunkOLISEQHS_cjs.__name(useChatScroll, "useChatScroll");
|
|
2219
1615
|
function useChatHistory(options) {
|
|
2220
1616
|
const { enabled = true, containerRef, topSentinelRef, hasMore, isLoadingMore, loadMore } = options;
|
|
2221
|
-
const heightBeforeRef =
|
|
2222
|
-
|
|
1617
|
+
const heightBeforeRef = react.useRef(null);
|
|
1618
|
+
react.useEffect(() => {
|
|
2223
1619
|
if (heightBeforeRef.current == null) return;
|
|
2224
1620
|
const el = containerRef.current;
|
|
2225
1621
|
if (!el) {
|
|
@@ -2234,7 +1630,7 @@ function useChatHistory(options) {
|
|
|
2234
1630
|
heightBeforeRef.current = null;
|
|
2235
1631
|
}
|
|
2236
1632
|
}, [containerRef, isLoadingMore]);
|
|
2237
|
-
|
|
1633
|
+
react.useEffect(() => {
|
|
2238
1634
|
if (!enabled || !hasMore) return;
|
|
2239
1635
|
const sentinel = topSentinelRef.current;
|
|
2240
1636
|
const root = containerRef.current;
|
|
@@ -2256,13 +1652,13 @@ function useChatHistory(options) {
|
|
|
2256
1652
|
}
|
|
2257
1653
|
chunkOLISEQHS_cjs.__name(useChatHistory, "useChatHistory");
|
|
2258
1654
|
function useChatLightbox() {
|
|
2259
|
-
const [state, setState] =
|
|
2260
|
-
const open =
|
|
1655
|
+
const [state, setState] = react.useState(null);
|
|
1656
|
+
const open = react.useCallback((att, gallery) => {
|
|
2261
1657
|
const list = gallery && gallery.length ? gallery : [att];
|
|
2262
1658
|
const idx = list.findIndex((a) => a.id === att.id);
|
|
2263
1659
|
setState({ gallery: list, index: idx === -1 ? 0 : idx });
|
|
2264
1660
|
}, []);
|
|
2265
|
-
const close =
|
|
1661
|
+
const close = react.useCallback(() => setState(null), []);
|
|
2266
1662
|
return { state, open, close };
|
|
2267
1663
|
}
|
|
2268
1664
|
chunkOLISEQHS_cjs.__name(useChatLightbox, "useChatLightbox");
|
|
@@ -2276,8 +1672,8 @@ function generate() {
|
|
|
2276
1672
|
chunkOLISEQHS_cjs.__name(generate, "generate");
|
|
2277
1673
|
function useVisitorFingerprint(opts = {}) {
|
|
2278
1674
|
const storageKey = opts.storageKey ?? DEFAULT_STORAGE_KEY;
|
|
2279
|
-
const [fp, setFp] =
|
|
2280
|
-
|
|
1675
|
+
const [fp, setFp] = react.useState(null);
|
|
1676
|
+
react.useEffect(() => {
|
|
2281
1677
|
let value = null;
|
|
2282
1678
|
try {
|
|
2283
1679
|
value = window.localStorage.getItem(storageKey);
|
|
@@ -2303,34 +1699,34 @@ function useChatDockPrefs(opts = {}) {
|
|
|
2303
1699
|
const key = opts.storageKey ?? DEFAULT_KEY;
|
|
2304
1700
|
const initial = { ...DEFAULT_DOCK_PREFS, ...opts.defaults };
|
|
2305
1701
|
const [prefs, setStored] = hooks.useLocalStorage(key, initial);
|
|
2306
|
-
const setPrefs =
|
|
1702
|
+
const setPrefs = react.useCallback(
|
|
2307
1703
|
(patch) => {
|
|
2308
1704
|
setStored((prev) => ({ ...prev, ...patch }));
|
|
2309
1705
|
},
|
|
2310
1706
|
[setStored]
|
|
2311
1707
|
);
|
|
2312
|
-
const toggleMode =
|
|
1708
|
+
const toggleMode = react.useCallback(() => {
|
|
2313
1709
|
setStored((prev) => ({ ...prev, mode: prev.mode === "side" ? "popover" : "side" }));
|
|
2314
1710
|
}, [setStored]);
|
|
2315
|
-
const toggleSide =
|
|
1711
|
+
const toggleSide = react.useCallback(() => {
|
|
2316
1712
|
setStored((prev) => ({ ...prev, side: prev.side === "right" ? "left" : "right" }));
|
|
2317
1713
|
}, [setStored]);
|
|
2318
|
-
const reset =
|
|
1714
|
+
const reset = react.useCallback(() => setStored(initial), [setStored, initial]);
|
|
2319
1715
|
return { ...prefs, setPrefs, toggleMode, toggleSide, reset };
|
|
2320
1716
|
}
|
|
2321
1717
|
chunkOLISEQHS_cjs.__name(useChatDockPrefs, "useChatDockPrefs");
|
|
2322
1718
|
function useChatUnread(opts = {}) {
|
|
2323
1719
|
const { open = false, countRoles = ["assistant"] } = opts;
|
|
2324
|
-
const ctx =
|
|
2325
|
-
const [lastSeenId, setLastSeenId] =
|
|
2326
|
-
const initialized =
|
|
2327
|
-
|
|
1720
|
+
const ctx = chunkTBSHZO5R_cjs.useChatContext();
|
|
1721
|
+
const [lastSeenId, setLastSeenId] = react.useState(null);
|
|
1722
|
+
const initialized = react.useRef(false);
|
|
1723
|
+
react.useEffect(() => {
|
|
2328
1724
|
if (initialized.current) return;
|
|
2329
1725
|
initialized.current = true;
|
|
2330
1726
|
const tail = ctx.messages[ctx.messages.length - 1];
|
|
2331
1727
|
setLastSeenId(tail?.id ?? null);
|
|
2332
1728
|
}, [ctx.messages]);
|
|
2333
|
-
|
|
1729
|
+
react.useEffect(() => {
|
|
2334
1730
|
if (!open) return;
|
|
2335
1731
|
const tail = ctx.messages[ctx.messages.length - 1];
|
|
2336
1732
|
setLastSeenId(tail?.id ?? null);
|
|
@@ -2339,7 +1735,7 @@ function useChatUnread(opts = {}) {
|
|
|
2339
1735
|
const after = seenIdx === -1 ? ctx.messages : ctx.messages.slice(seenIdx + 1);
|
|
2340
1736
|
const inbound = after.filter((m) => countRoles.includes(m.role));
|
|
2341
1737
|
const unread = inbound.length > 0 ? inbound[inbound.length - 1] : null;
|
|
2342
|
-
const markRead =
|
|
1738
|
+
const markRead = react.useCallback(() => {
|
|
2343
1739
|
const tail = ctx.messages[ctx.messages.length - 1];
|
|
2344
1740
|
setLastSeenId(tail?.id ?? null);
|
|
2345
1741
|
}, [ctx.messages]);
|
|
@@ -2388,6 +1784,21 @@ function collectImageAttachments(messages) {
|
|
|
2388
1784
|
return out;
|
|
2389
1785
|
}
|
|
2390
1786
|
chunkOLISEQHS_cjs.__name(collectImageAttachments, "collectImageAttachments");
|
|
1787
|
+
var LazyChat = chunkL25HA3TM_cjs.createLazyComponent(
|
|
1788
|
+
() => import('./ChatRoot-OILWMMZ6.cjs').then((m) => ({ default: m.ChatRoot })),
|
|
1789
|
+
{
|
|
1790
|
+
displayName: "LazyChat",
|
|
1791
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
|
|
1792
|
+
}
|
|
1793
|
+
);
|
|
1794
|
+
chunkL25HA3TM_cjs.createLazyComponent(
|
|
1795
|
+
() => import('./launcher-QAOG2NUI.cjs').then((m) => ({ default: m.ChatLauncher })),
|
|
1796
|
+
{
|
|
1797
|
+
displayName: "LazyChatLauncher",
|
|
1798
|
+
// Launcher renders a floating FAB by default — no inline placeholder.
|
|
1799
|
+
fallback: null
|
|
1800
|
+
}
|
|
1801
|
+
);
|
|
2391
1802
|
function AudioToggle({
|
|
2392
1803
|
size = "icon",
|
|
2393
1804
|
variant = "ghost",
|
|
@@ -2396,7 +1807,7 @@ function AudioToggle({
|
|
|
2396
1807
|
}) {
|
|
2397
1808
|
const muted = useChatAudioPrefs((s) => s.muted);
|
|
2398
1809
|
const setMuted = useChatAudioPrefs((s) => s.setMuted);
|
|
2399
|
-
const ctx =
|
|
1810
|
+
const ctx = chunkTBSHZO5R_cjs.useChatContextOptional();
|
|
2400
1811
|
if (ctx && !ctx.hasAudio && !alwaysShow) return null;
|
|
2401
1812
|
const Icon = muted ? lucideReact.VolumeX : lucideReact.Volume2;
|
|
2402
1813
|
const label = muted ? "Unmute chat sounds" : "Mute chat sounds";
|
|
@@ -2416,7 +1827,7 @@ function AudioToggle({
|
|
|
2416
1827
|
);
|
|
2417
1828
|
}
|
|
2418
1829
|
chunkOLISEQHS_cjs.__name(AudioToggle, "AudioToggle");
|
|
2419
|
-
var LottiePlayerClient =
|
|
1830
|
+
var LottiePlayerClient = react.lazy(
|
|
2420
1831
|
() => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer }))
|
|
2421
1832
|
);
|
|
2422
1833
|
var LoadingFallback5 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
@@ -2424,25 +1835,25 @@ var LoadingFallback5 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE
|
|
|
2424
1835
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: "Loading player..." })
|
|
2425
1836
|
] }) }), "LoadingFallback");
|
|
2426
1837
|
function LottiePlayer(props) {
|
|
2427
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1838
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback5, {}), children: /* @__PURE__ */ jsxRuntime.jsx(LottiePlayerClient, { ...props }) });
|
|
2428
1839
|
}
|
|
2429
1840
|
chunkOLISEQHS_cjs.__name(LottiePlayer, "LottiePlayer");
|
|
2430
|
-
var DocsLayout =
|
|
1841
|
+
var DocsLayout = react.lazy(
|
|
2431
1842
|
() => import('./DocsLayout-2YZNS5VK.cjs').then((mod) => ({ default: mod.DocsLayout }))
|
|
2432
1843
|
);
|
|
2433
1844
|
var LoadingFallback6 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground", children: "Loading API Playground..." }) }), "LoadingFallback");
|
|
2434
1845
|
var Playground = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) => {
|
|
2435
|
-
return /* @__PURE__ */ jsxRuntime.jsx(chunk7EYHNP3E_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1846
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk7EYHNP3E_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback6, {}), children: /* @__PURE__ */ jsxRuntime.jsx(DocsLayout, {}) }) });
|
|
2436
1847
|
}, "Playground");
|
|
2437
1848
|
var OpenapiViewer_default = Playground;
|
|
2438
|
-
var CronSchedulerClient =
|
|
1849
|
+
var CronSchedulerClient = react.lazy(() => import('./CronScheduler.client-WEJF4PWQ.cjs'));
|
|
2439
1850
|
function CronScheduler(props) {
|
|
2440
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1851
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerFallback, {}), children: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerClient, { ...props }) });
|
|
2441
1852
|
}
|
|
2442
1853
|
chunkOLISEQHS_cjs.__name(CronScheduler, "CronScheduler");
|
|
2443
1854
|
function CronSchedulerFallback() {
|
|
2444
1855
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
|
-
LoadingFallback,
|
|
1856
|
+
chunkL25HA3TM_cjs.LoadingFallback,
|
|
2446
1857
|
{
|
|
2447
1858
|
minHeight: 120,
|
|
2448
1859
|
showText: false,
|
|
@@ -2467,10 +1878,10 @@ chunkOLISEQHS_cjs.__name(setupMonacoWorkers, "setupMonacoWorkers");
|
|
|
2467
1878
|
|
|
2468
1879
|
// src/tools/CodeEditor/hooks/useMonaco.ts
|
|
2469
1880
|
function useMonaco() {
|
|
2470
|
-
const [monaco, setMonaco] =
|
|
2471
|
-
const [isLoading, setIsLoading] =
|
|
2472
|
-
const [error, setError] =
|
|
2473
|
-
|
|
1881
|
+
const [monaco, setMonaco] = react.useState(null);
|
|
1882
|
+
const [isLoading, setIsLoading] = react.useState(true);
|
|
1883
|
+
const [error, setError] = react.useState(null);
|
|
1884
|
+
react.useEffect(() => {
|
|
2474
1885
|
let mounted = true;
|
|
2475
1886
|
async function loadMonaco() {
|
|
2476
1887
|
try {
|
|
@@ -2498,8 +1909,8 @@ function useMonaco() {
|
|
|
2498
1909
|
chunkOLISEQHS_cjs.__name(useMonaco, "useMonaco");
|
|
2499
1910
|
function useEditorTheme(monaco, themeOverride) {
|
|
2500
1911
|
const appTheme = hooks.useResolvedTheme();
|
|
2501
|
-
const registered =
|
|
2502
|
-
|
|
1912
|
+
const registered = react.useRef(false);
|
|
1913
|
+
react.useEffect(() => {
|
|
2503
1914
|
if (!monaco || registered.current) return;
|
|
2504
1915
|
try {
|
|
2505
1916
|
const colors = _readCSSColors();
|
|
@@ -2614,7 +2025,7 @@ function _adjustBrightness(hex, amount) {
|
|
|
2614
2025
|
return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}`;
|
|
2615
2026
|
}
|
|
2616
2027
|
chunkOLISEQHS_cjs.__name(_adjustBrightness, "_adjustBrightness");
|
|
2617
|
-
var Editor =
|
|
2028
|
+
var Editor = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function Editor2({
|
|
2618
2029
|
value = "",
|
|
2619
2030
|
language = "plaintext",
|
|
2620
2031
|
onChange,
|
|
@@ -2627,24 +2038,24 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
|
|
|
2627
2038
|
minHeight = 100,
|
|
2628
2039
|
maxHeight = 600
|
|
2629
2040
|
}, ref) {
|
|
2630
|
-
const containerRef =
|
|
2631
|
-
const editorRef =
|
|
2041
|
+
const containerRef = react.useRef(null);
|
|
2042
|
+
const editorRef = react.useRef(null);
|
|
2632
2043
|
const { monaco, isLoading } = useMonaco();
|
|
2633
2044
|
const resolvedTheme = useEditorTheme(monaco, options.theme);
|
|
2634
|
-
const [contentHeight, setContentHeight] =
|
|
2635
|
-
const updateContentHeight =
|
|
2045
|
+
const [contentHeight, setContentHeight] = react.useState(null);
|
|
2046
|
+
const updateContentHeight = react.useCallback((editor) => {
|
|
2636
2047
|
if (!autoHeight) return;
|
|
2637
2048
|
const h = editor.getContentHeight();
|
|
2638
2049
|
setContentHeight(Math.min(Math.max(h, minHeight), maxHeight));
|
|
2639
2050
|
}, [autoHeight, minHeight, maxHeight]);
|
|
2640
|
-
const isInternalChangeRef =
|
|
2641
|
-
|
|
2051
|
+
const isInternalChangeRef = react.useRef(false);
|
|
2052
|
+
react.useImperativeHandle(ref, () => ({
|
|
2642
2053
|
getEditor: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current, "getEditor"),
|
|
2643
2054
|
getValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.getValue() || "", "getValue"),
|
|
2644
2055
|
setValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((val) => editorRef.current?.setValue(val), "setValue"),
|
|
2645
2056
|
focus: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.focus(), "focus")
|
|
2646
2057
|
}));
|
|
2647
|
-
|
|
2058
|
+
react.useEffect(() => {
|
|
2648
2059
|
if (!monaco || !containerRef.current || editorRef.current) return;
|
|
2649
2060
|
const editor = monaco.editor.create(containerRef.current, {
|
|
2650
2061
|
value,
|
|
@@ -2690,7 +2101,7 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
|
|
|
2690
2101
|
editorRef.current = null;
|
|
2691
2102
|
};
|
|
2692
2103
|
}, [monaco]);
|
|
2693
|
-
|
|
2104
|
+
react.useEffect(() => {
|
|
2694
2105
|
const editor = editorRef.current;
|
|
2695
2106
|
if (!editor) return;
|
|
2696
2107
|
if (isInternalChangeRef.current) {
|
|
@@ -2710,7 +2121,7 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
|
|
|
2710
2121
|
}
|
|
2711
2122
|
}
|
|
2712
2123
|
}, [value]);
|
|
2713
|
-
|
|
2124
|
+
react.useEffect(() => {
|
|
2714
2125
|
const editor = editorRef.current;
|
|
2715
2126
|
if (!editor || !monaco) return;
|
|
2716
2127
|
const model = editor.getModel();
|
|
@@ -2718,7 +2129,7 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
|
|
|
2718
2129
|
monaco.editor.setModelLanguage(model, language);
|
|
2719
2130
|
}
|
|
2720
2131
|
}, [language, monaco]);
|
|
2721
|
-
|
|
2132
|
+
react.useEffect(() => {
|
|
2722
2133
|
const editor = editorRef.current;
|
|
2723
2134
|
if (!editor) return;
|
|
2724
2135
|
editor.updateOptions({
|
|
@@ -2770,11 +2181,11 @@ function DiffEditor({
|
|
|
2770
2181
|
className = "",
|
|
2771
2182
|
height = "100%"
|
|
2772
2183
|
}) {
|
|
2773
|
-
const containerRef =
|
|
2774
|
-
const editorRef =
|
|
2184
|
+
const containerRef = react.useRef(null);
|
|
2185
|
+
const editorRef = react.useRef(null);
|
|
2775
2186
|
const { monaco, isLoading } = useMonaco();
|
|
2776
2187
|
const resolvedTheme = useEditorTheme(monaco, options.theme);
|
|
2777
|
-
|
|
2188
|
+
react.useEffect(() => {
|
|
2778
2189
|
if (!monaco || !containerRef.current || editorRef.current) return;
|
|
2779
2190
|
const editor = monaco.editor.createDiffEditor(containerRef.current, {
|
|
2780
2191
|
theme: resolvedTheme,
|
|
@@ -2800,7 +2211,7 @@ function DiffEditor({
|
|
|
2800
2211
|
editorRef.current = null;
|
|
2801
2212
|
};
|
|
2802
2213
|
}, [monaco]);
|
|
2803
|
-
|
|
2214
|
+
react.useEffect(() => {
|
|
2804
2215
|
const editor = editorRef.current;
|
|
2805
2216
|
if (!editor || !monaco) return;
|
|
2806
2217
|
const model = editor.getModel();
|
|
@@ -2809,7 +2220,7 @@ function DiffEditor({
|
|
|
2809
2220
|
model.modified.setValue(modified);
|
|
2810
2221
|
}
|
|
2811
2222
|
}, [original, modified, monaco]);
|
|
2812
|
-
|
|
2223
|
+
react.useEffect(() => {
|
|
2813
2224
|
const editor = editorRef.current;
|
|
2814
2225
|
if (!editor || !monaco) return;
|
|
2815
2226
|
const model = editor.getModel();
|
|
@@ -3036,9 +2447,9 @@ function getLanguageByFilename(filename) {
|
|
|
3036
2447
|
return LANGUAGE_MAP[extension] || "plaintext";
|
|
3037
2448
|
}
|
|
3038
2449
|
chunkOLISEQHS_cjs.__name(getLanguageByFilename, "getLanguageByFilename");
|
|
3039
|
-
var EditorContext =
|
|
2450
|
+
var EditorContext = react.createContext(null);
|
|
3040
2451
|
function useEditorContext() {
|
|
3041
|
-
const context =
|
|
2452
|
+
const context = react.useContext(EditorContext);
|
|
3042
2453
|
if (!context) {
|
|
3043
2454
|
throw new Error("useEditorContext must be used within EditorProvider");
|
|
3044
2455
|
}
|
|
@@ -3047,14 +2458,14 @@ function useEditorContext() {
|
|
|
3047
2458
|
chunkOLISEQHS_cjs.__name(useEditorContext, "useEditorContext");
|
|
3048
2459
|
function EditorProvider({ children, onSave }) {
|
|
3049
2460
|
const { monaco } = useMonaco();
|
|
3050
|
-
const [editor, setEditor] =
|
|
3051
|
-
const [openFiles, setOpenFiles] =
|
|
3052
|
-
const [activeFilePath, setActiveFilePath] =
|
|
3053
|
-
const activeFile =
|
|
2461
|
+
const [editor, setEditor] = react.useState(null);
|
|
2462
|
+
const [openFiles, setOpenFiles] = react.useState([]);
|
|
2463
|
+
const [activeFilePath, setActiveFilePath] = react.useState(null);
|
|
2464
|
+
const activeFile = react.useMemo(
|
|
3054
2465
|
() => openFiles.find((f) => f.path === activeFilePath) || null,
|
|
3055
2466
|
[openFiles, activeFilePath]
|
|
3056
2467
|
);
|
|
3057
|
-
const openFile =
|
|
2468
|
+
const openFile = react.useCallback(
|
|
3058
2469
|
(path, content, language) => {
|
|
3059
2470
|
setOpenFiles((files) => {
|
|
3060
2471
|
const existing = files.find((f) => f.path === path);
|
|
@@ -3075,7 +2486,7 @@ function EditorProvider({ children, onSave }) {
|
|
|
3075
2486
|
},
|
|
3076
2487
|
[]
|
|
3077
2488
|
);
|
|
3078
|
-
const closeFile =
|
|
2489
|
+
const closeFile = react.useCallback(
|
|
3079
2490
|
(path) => {
|
|
3080
2491
|
setOpenFiles((files) => {
|
|
3081
2492
|
const index = files.findIndex((f) => f.path === path);
|
|
@@ -3092,17 +2503,17 @@ function EditorProvider({ children, onSave }) {
|
|
|
3092
2503
|
},
|
|
3093
2504
|
[activeFilePath]
|
|
3094
2505
|
);
|
|
3095
|
-
const setActiveFile =
|
|
2506
|
+
const setActiveFile = react.useCallback((path) => {
|
|
3096
2507
|
setActiveFilePath(path);
|
|
3097
2508
|
}, []);
|
|
3098
|
-
const updateContent =
|
|
2509
|
+
const updateContent = react.useCallback((path, content) => {
|
|
3099
2510
|
setOpenFiles(
|
|
3100
2511
|
(files) => files.map(
|
|
3101
2512
|
(f) => f.path === path ? { ...f, content, isDirty: true } : f
|
|
3102
2513
|
)
|
|
3103
2514
|
);
|
|
3104
2515
|
}, []);
|
|
3105
|
-
const saveFile =
|
|
2516
|
+
const saveFile = react.useCallback(
|
|
3106
2517
|
async (path) => {
|
|
3107
2518
|
const file = openFiles.find((f) => f.path === path);
|
|
3108
2519
|
if (!file) return;
|
|
@@ -3117,21 +2528,21 @@ function EditorProvider({ children, onSave }) {
|
|
|
3117
2528
|
},
|
|
3118
2529
|
[openFiles, onSave]
|
|
3119
2530
|
);
|
|
3120
|
-
const isDirty =
|
|
2531
|
+
const isDirty = react.useCallback(
|
|
3121
2532
|
(path) => {
|
|
3122
2533
|
const file = openFiles.find((f) => f.path === path);
|
|
3123
2534
|
return file?.isDirty || false;
|
|
3124
2535
|
},
|
|
3125
2536
|
[openFiles]
|
|
3126
2537
|
);
|
|
3127
|
-
const getContent =
|
|
2538
|
+
const getContent = react.useCallback(
|
|
3128
2539
|
(path) => {
|
|
3129
2540
|
const file = openFiles.find((f) => f.path === path);
|
|
3130
2541
|
return file?.content || null;
|
|
3131
2542
|
},
|
|
3132
2543
|
[openFiles]
|
|
3133
2544
|
);
|
|
3134
|
-
const getFile =
|
|
2545
|
+
const getFile = react.useCallback(
|
|
3135
2546
|
(path) => {
|
|
3136
2547
|
return openFiles.find((f) => f.path === path) || null;
|
|
3137
2548
|
},
|
|
@@ -3156,8 +2567,8 @@ function EditorProvider({ children, onSave }) {
|
|
|
3156
2567
|
}
|
|
3157
2568
|
chunkOLISEQHS_cjs.__name(EditorProvider, "EditorProvider");
|
|
3158
2569
|
function useEditor() {
|
|
3159
|
-
const [editor, setEditorState] =
|
|
3160
|
-
const setEditor =
|
|
2570
|
+
const [editor, setEditorState] = react.useState(null);
|
|
2571
|
+
const setEditor = react.useCallback((editorInstance) => {
|
|
3161
2572
|
setEditorState(editorInstance);
|
|
3162
2573
|
}, []);
|
|
3163
2574
|
return {
|
|
@@ -3168,25 +2579,25 @@ function useEditor() {
|
|
|
3168
2579
|
}
|
|
3169
2580
|
chunkOLISEQHS_cjs.__name(useEditor, "useEditor");
|
|
3170
2581
|
function useLanguage(filename) {
|
|
3171
|
-
return
|
|
2582
|
+
return react.useMemo(() => {
|
|
3172
2583
|
if (!filename) return "plaintext";
|
|
3173
2584
|
const basename = filename.split("/").pop() || filename;
|
|
3174
2585
|
return getLanguageByFilename(basename);
|
|
3175
2586
|
}, [filename]);
|
|
3176
2587
|
}
|
|
3177
2588
|
chunkOLISEQHS_cjs.__name(useLanguage, "useLanguage");
|
|
3178
|
-
var MentionList =
|
|
2589
|
+
var MentionList = react.forwardRef(
|
|
3179
2590
|
({ items, command }, ref) => {
|
|
3180
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3181
|
-
|
|
3182
|
-
const select =
|
|
2591
|
+
const [selectedIndex, setSelectedIndex] = react.useState(0);
|
|
2592
|
+
react.useEffect(() => setSelectedIndex(0), [items]);
|
|
2593
|
+
const select = react.useCallback(
|
|
3183
2594
|
(index) => {
|
|
3184
2595
|
const item = items[index];
|
|
3185
2596
|
if (item) command(item);
|
|
3186
2597
|
},
|
|
3187
2598
|
[items, command]
|
|
3188
2599
|
);
|
|
3189
|
-
|
|
2600
|
+
react.useImperativeHandle(ref, () => ({
|
|
3190
2601
|
onKeyDown: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((event) => {
|
|
3191
2602
|
if (event.key === "ArrowUp") {
|
|
3192
2603
|
setSelectedIndex((i) => (i + items.length - 1) % items.length);
|
|
@@ -3265,7 +2676,7 @@ function createMentionSuggestion(config) {
|
|
|
3265
2676
|
}, "teardown");
|
|
3266
2677
|
return {
|
|
3267
2678
|
onStart: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
|
|
3268
|
-
component = new react.ReactRenderer(MentionList, {
|
|
2679
|
+
component = new react$1.ReactRenderer(MentionList, {
|
|
3269
2680
|
props: {
|
|
3270
2681
|
items: props.items,
|
|
3271
2682
|
command: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((item) => {
|
|
@@ -3367,7 +2778,7 @@ function extractMentionIds(editor) {
|
|
|
3367
2778
|
return [...new Set(ids)];
|
|
3368
2779
|
}
|
|
3369
2780
|
chunkOLISEQHS_cjs.__name(extractMentionIds, "extractMentionIds");
|
|
3370
|
-
var MarkdownEditor =
|
|
2781
|
+
var MarkdownEditor = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MarkdownEditor2({
|
|
3371
2782
|
value,
|
|
3372
2783
|
onChange,
|
|
3373
2784
|
placeholder = "Write markdown...",
|
|
@@ -3379,18 +2790,18 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
|
|
|
3379
2790
|
onMentionIdsChange,
|
|
3380
2791
|
onSubmit
|
|
3381
2792
|
}, ref) {
|
|
3382
|
-
const onSubmitRef =
|
|
2793
|
+
const onSubmitRef = react.useRef(onSubmit);
|
|
3383
2794
|
onSubmitRef.current = onSubmit;
|
|
3384
|
-
const isExternalUpdate =
|
|
3385
|
-
const initialMentionsDefinedRef =
|
|
3386
|
-
const warnedRef =
|
|
2795
|
+
const isExternalUpdate = react.useRef(false);
|
|
2796
|
+
const initialMentionsDefinedRef = react.useRef(mentions !== void 0);
|
|
2797
|
+
const warnedRef = react.useRef(false);
|
|
3387
2798
|
if (process.env.NODE_ENV !== "production" && !initialMentionsDefinedRef.current && mentions !== void 0 && !warnedRef.current) {
|
|
3388
2799
|
warnedRef.current = true;
|
|
3389
2800
|
console.warn(
|
|
3390
2801
|
"[MarkdownEditor] `mentions` flipped from undefined to a config after mount. Tiptap only installs the Mention extension on first render \u2014 the @-popover will NOT work for this editor instance. Pass `{ items: [] }` from the very first render and mutate `.items` in place instead."
|
|
3391
2802
|
);
|
|
3392
2803
|
}
|
|
3393
|
-
const extensions =
|
|
2804
|
+
const extensions = react.useMemo(() => {
|
|
3394
2805
|
const exts = [
|
|
3395
2806
|
StarterKit__default.default.configure({ heading: { levels: [1, 2, 3] } }),
|
|
3396
2807
|
Placeholder__default.default.configure({ placeholder }),
|
|
@@ -3430,7 +2841,7 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
|
|
|
3430
2841
|
}
|
|
3431
2842
|
return exts;
|
|
3432
2843
|
}, [placeholder, mentions]);
|
|
3433
|
-
const editor = react.useEditor({
|
|
2844
|
+
const editor = react$1.useEditor({
|
|
3434
2845
|
immediatelyRender: false,
|
|
3435
2846
|
editable: !disabled,
|
|
3436
2847
|
extensions,
|
|
@@ -3449,7 +2860,7 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
|
|
|
3449
2860
|
}
|
|
3450
2861
|
}
|
|
3451
2862
|
});
|
|
3452
|
-
|
|
2863
|
+
react.useEffect(() => {
|
|
3453
2864
|
if (!editor) return;
|
|
3454
2865
|
const current = getMarkdown(editor);
|
|
3455
2866
|
if (current !== value) {
|
|
@@ -3458,7 +2869,7 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
|
|
|
3458
2869
|
isExternalUpdate.current = false;
|
|
3459
2870
|
}
|
|
3460
2871
|
}, [value, editor]);
|
|
3461
|
-
|
|
2872
|
+
react.useImperativeHandle(
|
|
3462
2873
|
ref,
|
|
3463
2874
|
() => ({
|
|
3464
2875
|
focus: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
|
|
@@ -3474,11 +2885,11 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
|
|
|
3474
2885
|
const wrapperClass = `markdown-editor rounded-md border border-input bg-background ${disabled ? "opacity-60" : ""} ${className}`.trim();
|
|
3475
2886
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClass, children: [
|
|
3476
2887
|
showToolbar && editor && /* @__PURE__ */ jsxRuntime.jsx(MarkdownToolbar, { editor }),
|
|
3477
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(react.EditorContent, { editor }) })
|
|
2888
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.EditorContent, { editor }) })
|
|
3478
2889
|
] });
|
|
3479
2890
|
}, "MarkdownEditor"));
|
|
3480
2891
|
function MarkdownToolbar({ editor }) {
|
|
3481
|
-
const items =
|
|
2892
|
+
const items = react.useMemo(() => [
|
|
3482
2893
|
{ icon: lucideReact.Bold, title: "Bold", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBold().run(), "action"), active: editor.isActive("bold") },
|
|
3483
2894
|
{ icon: lucideReact.Italic, title: "Italic", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleItalic().run(), "action"), active: editor.isActive("italic") },
|
|
3484
2895
|
{ icon: lucideReact.Strikethrough, title: "Strike", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleStrike().run(), "action"), active: editor.isActive("strike") },
|
|
@@ -3502,6 +2913,82 @@ function MarkdownToolbar({ editor }) {
|
|
|
3502
2913
|
}
|
|
3503
2914
|
chunkOLISEQHS_cjs.__name(MarkdownToolbar, "MarkdownToolbar");
|
|
3504
2915
|
|
|
2916
|
+
Object.defineProperty(exports, "CardLoadingFallback", {
|
|
2917
|
+
enumerable: true,
|
|
2918
|
+
get: function () { return chunkL25HA3TM_cjs.CardLoadingFallback; }
|
|
2919
|
+
});
|
|
2920
|
+
Object.defineProperty(exports, "ChatDock", {
|
|
2921
|
+
enumerable: true,
|
|
2922
|
+
get: function () { return chunkL25HA3TM_cjs.ChatDock; }
|
|
2923
|
+
});
|
|
2924
|
+
Object.defineProperty(exports, "ChatFAB", {
|
|
2925
|
+
enumerable: true,
|
|
2926
|
+
get: function () { return chunkL25HA3TM_cjs.ChatFAB; }
|
|
2927
|
+
});
|
|
2928
|
+
Object.defineProperty(exports, "ChatGreeting", {
|
|
2929
|
+
enumerable: true,
|
|
2930
|
+
get: function () { return chunkL25HA3TM_cjs.ChatGreeting; }
|
|
2931
|
+
});
|
|
2932
|
+
Object.defineProperty(exports, "ChatHeader", {
|
|
2933
|
+
enumerable: true,
|
|
2934
|
+
get: function () { return chunkL25HA3TM_cjs.ChatHeader; }
|
|
2935
|
+
});
|
|
2936
|
+
Object.defineProperty(exports, "ChatHeaderActionButton", {
|
|
2937
|
+
enumerable: true,
|
|
2938
|
+
get: function () { return chunkL25HA3TM_cjs.ChatHeaderActionButton; }
|
|
2939
|
+
});
|
|
2940
|
+
Object.defineProperty(exports, "ChatHeaderAudioToggle", {
|
|
2941
|
+
enumerable: true,
|
|
2942
|
+
get: function () { return chunkL25HA3TM_cjs.ChatHeaderAudioToggle; }
|
|
2943
|
+
});
|
|
2944
|
+
Object.defineProperty(exports, "ChatHeaderLanguageButton", {
|
|
2945
|
+
enumerable: true,
|
|
2946
|
+
get: function () { return chunkL25HA3TM_cjs.ChatHeaderLanguageButton; }
|
|
2947
|
+
});
|
|
2948
|
+
Object.defineProperty(exports, "ChatHeaderModeToggle", {
|
|
2949
|
+
enumerable: true,
|
|
2950
|
+
get: function () { return chunkL25HA3TM_cjs.ChatHeaderModeToggle; }
|
|
2951
|
+
});
|
|
2952
|
+
Object.defineProperty(exports, "ChatHeaderResetButton", {
|
|
2953
|
+
enumerable: true,
|
|
2954
|
+
get: function () { return chunkL25HA3TM_cjs.ChatHeaderResetButton; }
|
|
2955
|
+
});
|
|
2956
|
+
Object.defineProperty(exports, "ChatLauncher", {
|
|
2957
|
+
enumerable: true,
|
|
2958
|
+
get: function () { return chunkL25HA3TM_cjs.ChatLauncher; }
|
|
2959
|
+
});
|
|
2960
|
+
Object.defineProperty(exports, "ChatUnreadPreview", {
|
|
2961
|
+
enumerable: true,
|
|
2962
|
+
get: function () { return chunkL25HA3TM_cjs.ChatUnreadPreview; }
|
|
2963
|
+
});
|
|
2964
|
+
Object.defineProperty(exports, "LazyWrapper", {
|
|
2965
|
+
enumerable: true,
|
|
2966
|
+
get: function () { return chunkL25HA3TM_cjs.LazyWrapper; }
|
|
2967
|
+
});
|
|
2968
|
+
Object.defineProperty(exports, "LoadingFallback", {
|
|
2969
|
+
enumerable: true,
|
|
2970
|
+
get: function () { return chunkL25HA3TM_cjs.LoadingFallback; }
|
|
2971
|
+
});
|
|
2972
|
+
Object.defineProperty(exports, "MapLoadingFallback", {
|
|
2973
|
+
enumerable: true,
|
|
2974
|
+
get: function () { return chunkL25HA3TM_cjs.MapLoadingFallback; }
|
|
2975
|
+
});
|
|
2976
|
+
Object.defineProperty(exports, "Spinner", {
|
|
2977
|
+
enumerable: true,
|
|
2978
|
+
get: function () { return chunkL25HA3TM_cjs.Spinner; }
|
|
2979
|
+
});
|
|
2980
|
+
Object.defineProperty(exports, "createLazyComponent", {
|
|
2981
|
+
enumerable: true,
|
|
2982
|
+
get: function () { return chunkL25HA3TM_cjs.createLazyComponent; }
|
|
2983
|
+
});
|
|
2984
|
+
Object.defineProperty(exports, "useChatPresence", {
|
|
2985
|
+
enumerable: true,
|
|
2986
|
+
get: function () { return chunkL25HA3TM_cjs.useChatPresence; }
|
|
2987
|
+
});
|
|
2988
|
+
Object.defineProperty(exports, "useChatReset", {
|
|
2989
|
+
enumerable: true,
|
|
2990
|
+
get: function () { return chunkL25HA3TM_cjs.useChatReset; }
|
|
2991
|
+
});
|
|
3505
2992
|
Object.defineProperty(exports, "ArrayFieldItemTemplate", {
|
|
3506
2993
|
enumerable: true,
|
|
3507
2994
|
get: function () { return chunkFEN5S772_cjs.ArrayFieldItemTemplate; }
|
|
@@ -3764,183 +3251,183 @@ Object.defineProperty(exports, "useCronWeekDays", {
|
|
|
3764
3251
|
});
|
|
3765
3252
|
Object.defineProperty(exports, "Attachments", {
|
|
3766
3253
|
enumerable: true,
|
|
3767
|
-
get: function () { return
|
|
3254
|
+
get: function () { return chunkTSNRU3UO_cjs.Attachments; }
|
|
3768
3255
|
});
|
|
3769
3256
|
Object.defineProperty(exports, "AttachmentsGrid", {
|
|
3770
3257
|
enumerable: true,
|
|
3771
|
-
get: function () { return
|
|
3258
|
+
get: function () { return chunkTSNRU3UO_cjs.AttachmentsGrid; }
|
|
3772
3259
|
});
|
|
3773
3260
|
Object.defineProperty(exports, "AttachmentsList", {
|
|
3774
3261
|
enumerable: true,
|
|
3775
|
-
get: function () { return
|
|
3262
|
+
get: function () { return chunkTSNRU3UO_cjs.AttachmentsList; }
|
|
3776
3263
|
});
|
|
3777
|
-
Object.defineProperty(exports, "
|
|
3264
|
+
Object.defineProperty(exports, "ChatRoot", {
|
|
3778
3265
|
enumerable: true,
|
|
3779
|
-
get: function () { return
|
|
3266
|
+
get: function () { return chunkTSNRU3UO_cjs.ChatRoot; }
|
|
3780
3267
|
});
|
|
3781
|
-
Object.defineProperty(exports, "
|
|
3268
|
+
Object.defineProperty(exports, "Composer", {
|
|
3782
3269
|
enumerable: true,
|
|
3783
|
-
get: function () { return
|
|
3270
|
+
get: function () { return chunkTSNRU3UO_cjs.Composer; }
|
|
3784
3271
|
});
|
|
3785
|
-
Object.defineProperty(exports, "
|
|
3272
|
+
Object.defineProperty(exports, "EmptyState", {
|
|
3786
3273
|
enumerable: true,
|
|
3787
|
-
get: function () { return
|
|
3274
|
+
get: function () { return chunkTSNRU3UO_cjs.EmptyState; }
|
|
3788
3275
|
});
|
|
3789
|
-
Object.defineProperty(exports, "
|
|
3276
|
+
Object.defineProperty(exports, "ErrorBanner", {
|
|
3790
3277
|
enumerable: true,
|
|
3791
|
-
get: function () { return
|
|
3278
|
+
get: function () { return chunkTSNRU3UO_cjs.ErrorBanner; }
|
|
3792
3279
|
});
|
|
3793
|
-
Object.defineProperty(exports, "
|
|
3280
|
+
Object.defineProperty(exports, "JumpToLatest", {
|
|
3794
3281
|
enumerable: true,
|
|
3795
|
-
get: function () { return
|
|
3282
|
+
get: function () { return chunkTSNRU3UO_cjs.JumpToLatest; }
|
|
3796
3283
|
});
|
|
3797
|
-
Object.defineProperty(exports, "
|
|
3284
|
+
Object.defineProperty(exports, "MessageActions", {
|
|
3798
3285
|
enumerable: true,
|
|
3799
|
-
get: function () { return
|
|
3286
|
+
get: function () { return chunkTSNRU3UO_cjs.MessageActions; }
|
|
3800
3287
|
});
|
|
3801
|
-
Object.defineProperty(exports, "
|
|
3288
|
+
Object.defineProperty(exports, "MessageBubble", {
|
|
3802
3289
|
enumerable: true,
|
|
3803
|
-
get: function () { return
|
|
3290
|
+
get: function () { return chunkTSNRU3UO_cjs.MessageBubble; }
|
|
3804
3291
|
});
|
|
3805
|
-
Object.defineProperty(exports, "
|
|
3292
|
+
Object.defineProperty(exports, "MessageList", {
|
|
3806
3293
|
enumerable: true,
|
|
3807
|
-
get: function () { return
|
|
3294
|
+
get: function () { return chunkTSNRU3UO_cjs.MessageList; }
|
|
3808
3295
|
});
|
|
3809
|
-
Object.defineProperty(exports, "
|
|
3296
|
+
Object.defineProperty(exports, "Sources", {
|
|
3810
3297
|
enumerable: true,
|
|
3811
|
-
get: function () { return
|
|
3298
|
+
get: function () { return chunkTSNRU3UO_cjs.Sources; }
|
|
3812
3299
|
});
|
|
3813
|
-
Object.defineProperty(exports, "
|
|
3300
|
+
Object.defineProperty(exports, "StreamingIndicator", {
|
|
3814
3301
|
enumerable: true,
|
|
3815
|
-
get: function () { return
|
|
3302
|
+
get: function () { return chunkTSNRU3UO_cjs.StreamingIndicator; }
|
|
3816
3303
|
});
|
|
3817
|
-
Object.defineProperty(exports, "
|
|
3304
|
+
Object.defineProperty(exports, "ToolCalls", {
|
|
3818
3305
|
enumerable: true,
|
|
3819
|
-
get: function () { return
|
|
3306
|
+
get: function () { return chunkTSNRU3UO_cjs.ToolCalls; }
|
|
3820
3307
|
});
|
|
3821
|
-
Object.defineProperty(exports, "
|
|
3308
|
+
Object.defineProperty(exports, "deriveInitials", {
|
|
3822
3309
|
enumerable: true,
|
|
3823
|
-
get: function () { return
|
|
3310
|
+
get: function () { return chunkTSNRU3UO_cjs.deriveInitials; }
|
|
3824
3311
|
});
|
|
3825
|
-
Object.defineProperty(exports, "
|
|
3312
|
+
Object.defineProperty(exports, "isSubmittableDraft", {
|
|
3826
3313
|
enumerable: true,
|
|
3827
|
-
get: function () { return
|
|
3314
|
+
get: function () { return chunkTSNRU3UO_cjs.isSubmittableDraft; }
|
|
3828
3315
|
});
|
|
3829
|
-
Object.defineProperty(exports, "
|
|
3316
|
+
Object.defineProperty(exports, "resolvePersona", {
|
|
3830
3317
|
enumerable: true,
|
|
3831
|
-
get: function () { return
|
|
3318
|
+
get: function () { return chunkTSNRU3UO_cjs.resolvePersona; }
|
|
3832
3319
|
});
|
|
3833
|
-
Object.defineProperty(exports, "
|
|
3320
|
+
Object.defineProperty(exports, "sanitizeDraft", {
|
|
3834
3321
|
enumerable: true,
|
|
3835
|
-
get: function () { return
|
|
3322
|
+
get: function () { return chunkTSNRU3UO_cjs.sanitizeDraft; }
|
|
3836
3323
|
});
|
|
3837
|
-
Object.defineProperty(exports, "
|
|
3324
|
+
Object.defineProperty(exports, "useAutoFocusOnStreamEnd", {
|
|
3838
3325
|
enumerable: true,
|
|
3839
|
-
get: function () { return
|
|
3326
|
+
get: function () { return chunkTSNRU3UO_cjs.useAutoFocusOnStreamEnd; }
|
|
3840
3327
|
});
|
|
3841
|
-
Object.defineProperty(exports, "
|
|
3328
|
+
Object.defineProperty(exports, "useChatBubbleStyles", {
|
|
3842
3329
|
enumerable: true,
|
|
3843
|
-
get: function () { return
|
|
3330
|
+
get: function () { return chunkTSNRU3UO_cjs.useChatBubbleStyles; }
|
|
3844
3331
|
});
|
|
3845
|
-
Object.defineProperty(exports, "
|
|
3332
|
+
Object.defineProperty(exports, "useChatComposer", {
|
|
3846
3333
|
enumerable: true,
|
|
3847
|
-
get: function () { return
|
|
3334
|
+
get: function () { return chunkTSNRU3UO_cjs.useChatComposer; }
|
|
3848
3335
|
});
|
|
3849
|
-
Object.defineProperty(exports, "
|
|
3336
|
+
Object.defineProperty(exports, "useChatDestructiveStyles", {
|
|
3850
3337
|
enumerable: true,
|
|
3851
|
-
get: function () { return
|
|
3338
|
+
get: function () { return chunkTSNRU3UO_cjs.useChatDestructiveStyles; }
|
|
3852
3339
|
});
|
|
3853
|
-
Object.defineProperty(exports, "
|
|
3340
|
+
Object.defineProperty(exports, "useChatRoleStyles", {
|
|
3854
3341
|
enumerable: true,
|
|
3855
|
-
get: function () { return
|
|
3342
|
+
get: function () { return chunkTSNRU3UO_cjs.useChatRoleStyles; }
|
|
3856
3343
|
});
|
|
3857
|
-
Object.defineProperty(exports, "
|
|
3344
|
+
Object.defineProperty(exports, "useFocusOnEmptyClick", {
|
|
3858
3345
|
enumerable: true,
|
|
3859
|
-
get: function () { return
|
|
3346
|
+
get: function () { return chunkTSNRU3UO_cjs.useFocusOnEmptyClick; }
|
|
3860
3347
|
});
|
|
3861
|
-
Object.defineProperty(exports, "
|
|
3348
|
+
Object.defineProperty(exports, "useRegisterComposer", {
|
|
3862
3349
|
enumerable: true,
|
|
3863
|
-
get: function () { return
|
|
3350
|
+
get: function () { return chunkTSNRU3UO_cjs.useRegisterComposer; }
|
|
3864
3351
|
});
|
|
3865
|
-
Object.defineProperty(exports, "
|
|
3352
|
+
Object.defineProperty(exports, "CHAT_EVENT_NAME", {
|
|
3866
3353
|
enumerable: true,
|
|
3867
|
-
get: function () { return
|
|
3354
|
+
get: function () { return chunkTBSHZO5R_cjs.CHAT_EVENT_NAME; }
|
|
3868
3355
|
});
|
|
3869
|
-
Object.defineProperty(exports, "
|
|
3356
|
+
Object.defineProperty(exports, "CSS_VARS", {
|
|
3870
3357
|
enumerable: true,
|
|
3871
|
-
get: function () { return
|
|
3358
|
+
get: function () { return chunkTBSHZO5R_cjs.CSS_VARS; }
|
|
3872
3359
|
});
|
|
3873
|
-
Object.defineProperty(exports, "
|
|
3360
|
+
Object.defineProperty(exports, "ChatProvider", {
|
|
3874
3361
|
enumerable: true,
|
|
3875
|
-
get: function () { return
|
|
3362
|
+
get: function () { return chunkTBSHZO5R_cjs.ChatProvider; }
|
|
3876
3363
|
});
|
|
3877
|
-
Object.defineProperty(exports, "
|
|
3364
|
+
Object.defineProperty(exports, "DEFAULT_CHAT_SOUNDS", {
|
|
3878
3365
|
enumerable: true,
|
|
3879
|
-
get: function () { return
|
|
3366
|
+
get: function () { return chunkTBSHZO5R_cjs.DEFAULT_CHAT_SOUNDS; }
|
|
3880
3367
|
});
|
|
3881
|
-
Object.defineProperty(exports, "
|
|
3368
|
+
Object.defineProperty(exports, "DEFAULT_LABELS", {
|
|
3882
3369
|
enumerable: true,
|
|
3883
|
-
get: function () { return
|
|
3370
|
+
get: function () { return chunkTBSHZO5R_cjs.DEFAULT_LABELS; }
|
|
3884
3371
|
});
|
|
3885
|
-
Object.defineProperty(exports, "
|
|
3372
|
+
Object.defineProperty(exports, "DEFAULT_SIDEBAR", {
|
|
3886
3373
|
enumerable: true,
|
|
3887
|
-
get: function () { return
|
|
3374
|
+
get: function () { return chunkTBSHZO5R_cjs.DEFAULT_SIDEBAR; }
|
|
3888
3375
|
});
|
|
3889
|
-
Object.defineProperty(exports, "
|
|
3376
|
+
Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
|
|
3890
3377
|
enumerable: true,
|
|
3891
|
-
get: function () { return
|
|
3378
|
+
get: function () { return chunkTBSHZO5R_cjs.DEFAULT_Z_INDEX; }
|
|
3892
3379
|
});
|
|
3893
|
-
Object.defineProperty(exports, "
|
|
3380
|
+
Object.defineProperty(exports, "HOTKEYS", {
|
|
3894
3381
|
enumerable: true,
|
|
3895
|
-
get: function () { return
|
|
3382
|
+
get: function () { return chunkTBSHZO5R_cjs.HOTKEYS; }
|
|
3896
3383
|
});
|
|
3897
|
-
Object.defineProperty(exports, "
|
|
3384
|
+
Object.defineProperty(exports, "LIMITS", {
|
|
3898
3385
|
enumerable: true,
|
|
3899
|
-
get: function () { return
|
|
3386
|
+
get: function () { return chunkTBSHZO5R_cjs.LIMITS; }
|
|
3900
3387
|
});
|
|
3901
|
-
Object.defineProperty(exports, "
|
|
3388
|
+
Object.defineProperty(exports, "STORAGE_KEYS", {
|
|
3902
3389
|
enumerable: true,
|
|
3903
|
-
get: function () { return
|
|
3390
|
+
get: function () { return chunkTBSHZO5R_cjs.STORAGE_KEYS; }
|
|
3904
3391
|
});
|
|
3905
|
-
Object.defineProperty(exports, "
|
|
3392
|
+
Object.defineProperty(exports, "createId", {
|
|
3906
3393
|
enumerable: true,
|
|
3907
|
-
get: function () { return
|
|
3394
|
+
get: function () { return chunkTBSHZO5R_cjs.createId; }
|
|
3908
3395
|
});
|
|
3909
|
-
Object.defineProperty(exports, "
|
|
3396
|
+
Object.defineProperty(exports, "createTokenBuffer", {
|
|
3910
3397
|
enumerable: true,
|
|
3911
|
-
get: function () { return
|
|
3398
|
+
get: function () { return chunkTBSHZO5R_cjs.createTokenBuffer; }
|
|
3912
3399
|
});
|
|
3913
|
-
Object.defineProperty(exports, "
|
|
3400
|
+
Object.defineProperty(exports, "getChatLogger", {
|
|
3914
3401
|
enumerable: true,
|
|
3915
|
-
get: function () { return
|
|
3402
|
+
get: function () { return chunkTBSHZO5R_cjs.getChatLogger; }
|
|
3916
3403
|
});
|
|
3917
|
-
Object.defineProperty(exports, "
|
|
3404
|
+
Object.defineProperty(exports, "initialState", {
|
|
3918
3405
|
enumerable: true,
|
|
3919
|
-
get: function () { return
|
|
3406
|
+
get: function () { return chunkTBSHZO5R_cjs.initialState; }
|
|
3920
3407
|
});
|
|
3921
|
-
Object.defineProperty(exports, "
|
|
3408
|
+
Object.defineProperty(exports, "reducer", {
|
|
3922
3409
|
enumerable: true,
|
|
3923
|
-
get: function () { return
|
|
3410
|
+
get: function () { return chunkTBSHZO5R_cjs.reducer; }
|
|
3924
3411
|
});
|
|
3925
|
-
Object.defineProperty(exports, "
|
|
3412
|
+
Object.defineProperty(exports, "useChat", {
|
|
3926
3413
|
enumerable: true,
|
|
3927
|
-
get: function () { return
|
|
3414
|
+
get: function () { return chunkTBSHZO5R_cjs.useChat; }
|
|
3928
3415
|
});
|
|
3929
|
-
Object.defineProperty(exports, "
|
|
3416
|
+
Object.defineProperty(exports, "useChatAudio", {
|
|
3930
3417
|
enumerable: true,
|
|
3931
|
-
get: function () { return
|
|
3418
|
+
get: function () { return chunkTBSHZO5R_cjs.useChatAudio; }
|
|
3932
3419
|
});
|
|
3933
|
-
Object.defineProperty(exports, "
|
|
3420
|
+
Object.defineProperty(exports, "useChatContext", {
|
|
3934
3421
|
enumerable: true,
|
|
3935
|
-
get: function () { return
|
|
3422
|
+
get: function () { return chunkTBSHZO5R_cjs.useChatContext; }
|
|
3936
3423
|
});
|
|
3937
|
-
Object.defineProperty(exports, "
|
|
3424
|
+
Object.defineProperty(exports, "useChatContextOptional", {
|
|
3938
3425
|
enumerable: true,
|
|
3939
|
-
get: function () { return
|
|
3426
|
+
get: function () { return chunkTBSHZO5R_cjs.useChatContextOptional; }
|
|
3940
3427
|
});
|
|
3941
|
-
Object.defineProperty(exports, "
|
|
3428
|
+
Object.defineProperty(exports, "useChatLayout", {
|
|
3942
3429
|
enumerable: true,
|
|
3943
|
-
get: function () { return
|
|
3430
|
+
get: function () { return chunkTBSHZO5R_cjs.useChatLayout; }
|
|
3944
3431
|
});
|
|
3945
3432
|
Object.defineProperty(exports, "TreeError", {
|
|
3946
3433
|
enumerable: true,
|
|
@@ -4123,18 +3610,6 @@ Object.defineProperty(exports, "JsonTree", {
|
|
|
4123
3610
|
get: function () { return chunkT3MWM23F_cjs.JsonTree_default; }
|
|
4124
3611
|
});
|
|
4125
3612
|
exports.AudioToggle = AudioToggle;
|
|
4126
|
-
exports.CardLoadingFallback = CardLoadingFallback;
|
|
4127
|
-
exports.ChatDock = ChatDock;
|
|
4128
|
-
exports.ChatFAB = ChatFAB;
|
|
4129
|
-
exports.ChatGreeting = ChatGreeting;
|
|
4130
|
-
exports.ChatHeader = ChatHeader;
|
|
4131
|
-
exports.ChatHeaderActionButton = ChatHeaderActionButton;
|
|
4132
|
-
exports.ChatHeaderAudioToggle = ChatHeaderAudioToggle;
|
|
4133
|
-
exports.ChatHeaderLanguageButton = ChatHeaderLanguageButton;
|
|
4134
|
-
exports.ChatHeaderModeToggle = ChatHeaderModeToggle;
|
|
4135
|
-
exports.ChatHeaderResetButton = ChatHeaderResetButton;
|
|
4136
|
-
exports.ChatLauncher = ChatLauncher;
|
|
4137
|
-
exports.ChatUnreadPreview = ChatUnreadPreview;
|
|
4138
3613
|
exports.CronScheduler = CronScheduler;
|
|
4139
3614
|
exports.DEFAULT_DOCK_PREFS = DEFAULT_DOCK_PREFS;
|
|
4140
3615
|
exports.DiffEditor = DiffEditor;
|
|
@@ -4154,17 +3629,12 @@ exports.LazyOpenapiViewer = LazyOpenapiViewer;
|
|
|
4154
3629
|
exports.LazyPrettyCode = LazyPrettyCode;
|
|
4155
3630
|
exports.LazyTree = LazyTree;
|
|
4156
3631
|
exports.LazyVideoPlayer = LazyVideoPlayer;
|
|
4157
|
-
exports.LazyWrapper = LazyWrapper;
|
|
4158
|
-
exports.LoadingFallback = LoadingFallback;
|
|
4159
3632
|
exports.LottiePlayer = LottiePlayer;
|
|
4160
|
-
exports.MapLoadingFallback = MapLoadingFallback;
|
|
4161
3633
|
exports.MarkdownEditor = MarkdownEditor;
|
|
4162
3634
|
exports.OpenapiViewer = OpenapiViewer_default;
|
|
4163
|
-
exports.Spinner = Spinner;
|
|
4164
3635
|
exports.TransportError = TransportError;
|
|
4165
3636
|
exports.collectImageAttachments = collectImageAttachments;
|
|
4166
3637
|
exports.createHttpTransport = createHttpTransport;
|
|
4167
|
-
exports.createLazyComponent = createLazyComponent;
|
|
4168
3638
|
exports.createMockTransport = createMockTransport;
|
|
4169
3639
|
exports.createPydanticAIChatTransport = createPydanticAIChatTransport;
|
|
4170
3640
|
exports.createPydanticAISSEMap = createPydanticAISSEMap;
|
|
@@ -4181,8 +3651,6 @@ exports.useChatAudioPrefs = useChatAudioPrefs;
|
|
|
4181
3651
|
exports.useChatDockPrefs = useChatDockPrefs;
|
|
4182
3652
|
exports.useChatHistory = useChatHistory;
|
|
4183
3653
|
exports.useChatLightbox = useChatLightbox;
|
|
4184
|
-
exports.useChatPresence = useChatPresence;
|
|
4185
|
-
exports.useChatReset = useChatReset;
|
|
4186
3654
|
exports.useChatScroll = useChatScroll;
|
|
4187
3655
|
exports.useChatUnread = useChatUnread;
|
|
4188
3656
|
exports.useEditor = useEditor;
|