@djangocfg/ui-tools 2.1.385 → 2.1.389

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +25 -11
  2. package/dist/ChatRoot-EFNXQXXN.cjs +15 -0
  3. package/dist/{ChatRoot-JVR3M3H2.mjs.map → ChatRoot-EFNXQXXN.cjs.map} +1 -1
  4. package/dist/ChatRoot-FITF5RVP.mjs +6 -0
  5. package/dist/{ChatRoot-LXIUBOXF.cjs.map → ChatRoot-FITF5RVP.mjs.map} +1 -1
  6. package/dist/{DocsLayout-2P3ONDWJ.mjs → DocsLayout-EKASBSP7.mjs} +3 -3
  7. package/dist/{DocsLayout-2P3ONDWJ.mjs.map → DocsLayout-EKASBSP7.mjs.map} +1 -1
  8. package/dist/{DocsLayout-2YZNS5VK.cjs → DocsLayout-OURFYWQE.cjs} +8 -8
  9. package/dist/{DocsLayout-2YZNS5VK.cjs.map → DocsLayout-OURFYWQE.cjs.map} +1 -1
  10. package/dist/MapContainer-AKIPABJK.mjs +4 -0
  11. package/dist/MapContainer-AKIPABJK.mjs.map +1 -0
  12. package/dist/MapContainer-STVDMC36.cjs +17 -0
  13. package/dist/MapContainer-STVDMC36.cjs.map +1 -0
  14. package/dist/{chunk-HIK6BPL7.mjs → chunk-2NG4SXEP.mjs} +6 -5
  15. package/dist/chunk-2NG4SXEP.mjs.map +1 -0
  16. package/dist/chunk-4LFB7I5K.cjs +1387 -0
  17. package/dist/chunk-4LFB7I5K.cjs.map +1 -0
  18. package/dist/{MapContainer-76YL2JXL.cjs → chunk-5D2OCOPQ.cjs} +3 -2
  19. package/dist/chunk-5D2OCOPQ.cjs.map +1 -0
  20. package/dist/chunk-6ZX2G25W.mjs +1361 -0
  21. package/dist/chunk-6ZX2G25W.mjs.map +1 -0
  22. package/dist/{MapContainer-7HXBI3OH.mjs → chunk-7CWGZPO3.mjs} +3 -3
  23. package/dist/chunk-7CWGZPO3.mjs.map +1 -0
  24. package/dist/{chunk-FIRK5CEH.cjs → chunk-7IYXZUJO.cjs} +8 -4
  25. package/dist/chunk-7IYXZUJO.cjs.map +1 -0
  26. package/dist/{chunk-PEKBT75W.mjs → chunk-DMX7W4XZ.mjs} +53 -1387
  27. package/dist/chunk-DMX7W4XZ.mjs.map +1 -0
  28. package/dist/chunk-NTVBIIUD.mjs +1439 -0
  29. package/dist/chunk-NTVBIIUD.mjs.map +1 -0
  30. package/dist/{chunk-HPK3EWBF.cjs → chunk-TBSHZO5R.cjs} +50 -1409
  31. package/dist/chunk-TBSHZO5R.cjs.map +1 -0
  32. package/dist/chunk-W75B7Y6C.cjs +1478 -0
  33. package/dist/chunk-W75B7Y6C.cjs.map +1 -0
  34. package/dist/index.cjs +1269 -1790
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +660 -623
  37. package/dist/index.d.ts +660 -623
  38. package/dist/index.mjs +856 -1427
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/launcher-5Y42OBSN.mjs +6 -0
  41. package/dist/launcher-5Y42OBSN.mjs.map +1 -0
  42. package/dist/launcher-PMW2YB24.cjs +59 -0
  43. package/dist/launcher-PMW2YB24.cjs.map +1 -0
  44. package/package.json +23 -18
  45. package/src/components/index.ts +2 -2
  46. package/src/index.ts +20 -2
  47. package/src/tools/AudioPlayer/lazy.tsx +100 -0
  48. package/src/tools/Chat/README.md +85 -1
  49. package/src/tools/Chat/components/MessageBubble.tsx +1 -1
  50. package/src/tools/Chat/context/ChatProvider.tsx +42 -0
  51. package/src/tools/Chat/index.ts +1 -1
  52. package/src/tools/Chat/lazy.tsx +300 -1
  53. package/src/tools/CodeEditor/lazy.tsx +70 -0
  54. package/src/tools/Map/lazy.tsx +38 -1
  55. package/src/tools/MarkdownEditor/lazy.tsx +42 -0
  56. package/src/{components/markdown → tools}/MarkdownMessage/CodeBlock.tsx +1 -1
  57. package/src/{components/markdown → tools}/MarkdownMessage/CollapseToggle.tsx +1 -1
  58. package/src/{components/markdown → tools}/MarkdownMessage/MarkdownMessage.tsx +1 -1
  59. package/src/{components/markdown → tools}/MarkdownMessage/components.tsx +2 -2
  60. package/src/tools/OpenapiViewer/components/DocsLayout/ApiIntroSection.tsx +1 -1
  61. package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/index.tsx +1 -1
  62. package/src/tools/SpeechRecognition/README.md +48 -0
  63. package/dist/ChatRoot-JVR3M3H2.mjs +0 -5
  64. package/dist/ChatRoot-LXIUBOXF.cjs +0 -14
  65. package/dist/MapContainer-76YL2JXL.cjs.map +0 -1
  66. package/dist/MapContainer-7HXBI3OH.mjs.map +0 -1
  67. package/dist/chunk-FIRK5CEH.cjs.map +0 -1
  68. package/dist/chunk-HIK6BPL7.mjs.map +0 -1
  69. package/dist/chunk-HPK3EWBF.cjs.map +0 -1
  70. package/dist/chunk-PEKBT75W.mjs.map +0 -1
  71. package/src/components/markdown/index.ts +0 -19
  72. /package/src/{components/markdown → hooks}/useCollapsibleContent.ts +0 -0
  73. /package/src/{components/markdown → tools}/MarkdownMessage/ActionRow.tsx +0 -0
  74. /package/src/{components/markdown → tools}/MarkdownMessage/ChatMessageRow.tsx +0 -0
  75. /package/src/{components/markdown → tools}/MarkdownMessage/README.md +0 -0
  76. /package/src/{components/markdown → tools}/MarkdownMessage/index.ts +0 -0
  77. /package/src/{components/markdown → tools}/MarkdownMessage/linkRules.ts +0 -0
  78. /package/src/{components/markdown → tools}/MarkdownMessage/plainText.ts +0 -0
  79. /package/src/{components/markdown → tools}/MarkdownMessage/sanitize.ts +0 -0
  80. /package/src/{components/markdown → tools}/MarkdownMessage/types.ts +0 -0
package/dist/index.mjs CHANGED
@@ -1,4 +1,8 @@
1
- import { getSpeechLogger, useSpeechPrefs, useResolvedLanguage } from './chunk-UNCS5V5F.mjs';
1
+ import { createLazyComponent, MapLoadingFallback, CardLoadingFallback, LoadingFallback } from './chunk-NTVBIIUD.mjs';
2
+ export { CardLoadingFallback, ChatDock, ChatFAB, ChatGreeting, ChatHeader, ChatHeaderActionButton, ChatHeaderAudioToggle, ChatHeaderLanguageButton, ChatHeaderModeToggle, ChatHeaderResetButton, ChatLauncher, ChatUnreadPreview, LazyWrapper, LoadingFallback, MapLoadingFallback, Spinner, createLazyComponent, useChatPresence, useChatReset } from './chunk-NTVBIIUD.mjs';
3
+ export { Attachments, AttachmentsGrid, AttachmentsList, ChatRoot, Composer, EmptyState, ErrorBanner, JumpToLatest, MessageActions, MessageBubble, MessageList, Sources, StreamingIndicator, ToolCalls, deriveInitials, isSubmittableDraft, resolvePersona, sanitizeDraft, useAutoFocusOnStreamEnd, useChatBubbleStyles, useChatComposer, useChatDestructiveStyles, useChatRoleStyles, useFocusOnEmptyClick, useRegisterComposer } from './chunk-6ZX2G25W.mjs';
4
+ import { LIMITS, createId, useChatContext, useChatContextOptional } from './chunk-DMX7W4XZ.mjs';
5
+ export { CHAT_EVENT_NAME, CSS_VARS, ChatProvider, DEFAULT_CHAT_SOUNDS, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, HOTKEYS, LIMITS, STORAGE_KEYS, createId, createTokenBuffer, getChatLogger, initialState, reducer, useChat, useChatAudio, useChatContext, useChatContextOptional, useChatLayout } from './chunk-DMX7W4XZ.mjs';
2
6
  export { ArrayFieldItemTemplate, ArrayFieldTemplate, BaseInputTemplate, CheckboxWidget, ColorWidget, ErrorListTemplate, FieldTemplate, JsonSchemaForm, NumberWidget, ObjectFieldTemplate, SelectWidget, SliderWidget, SwitchWidget, TextWidget, evaluateDisabledWhen, getRequiredFields, hasRequiredFields, mergeDefaults, normalizeFormData, safeJsonParse, safeJsonStringify, validateRequiredFields, validateSchema } from './chunk-GYIO7W7M.mjs';
3
7
  export { useLottie } from './chunk-ODO4GMW7.mjs';
4
8
  export { Player as AudioPlayer } from './chunk-VWQ5WOIL.mjs';
@@ -6,23 +10,23 @@ export { NativeProvider, StreamProvider, VideoControls, VideoErrorFallback, Vide
6
10
  export { ImageViewer } from './chunk-OBRSGM64.mjs';
7
11
  export { generateContentKey, useAudioCache, useBlobUrlCleanup, useImageCache, useMediaCacheStore, useVideoCache, useVideoPlayerSettings } from './chunk-C6GXVH5J.mjs';
8
12
  export { CronSchedulerProvider, CustomInput, DayChips, MonthDayGrid, SchedulePreview, ScheduleTypeSelector, TimeSelector, buildCron, humanizeCron, isValidCron, parseCron, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays } from './chunk-PVAX67JG.mjs';
9
- import { LIMITS, createId, useChatContext, useChatContextOptional } from './chunk-PEKBT75W.mjs';
10
- export { Attachments, AttachmentsGrid, AttachmentsList, CHAT_EVENT_NAME, CSS_VARS, ChatProvider, ChatRoot, Composer, DEFAULT_CHAT_SOUNDS, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, EmptyState, ErrorBanner, HOTKEYS, JumpToLatest, LIMITS, MessageActions, MessageBubble, MessageList, STORAGE_KEYS, Sources, StreamingIndicator, ToolCalls, createId, createTokenBuffer, deriveInitials, getChatLogger, initialState, isSubmittableDraft, reducer, resolvePersona, sanitizeDraft, useAutoFocusOnStreamEnd, useChat, useChatAudio, useChatBubbleStyles, useChatComposer, useChatContext, useChatContextOptional, useChatDestructiveStyles, useChatLayout, useChatRoleStyles, useFocusOnEmptyClick, useRegisterComposer } from './chunk-PEKBT75W.mjs';
13
+ import './chunk-UNCS5V5F.mjs';
11
14
  export { TreeError, TreeSkeleton, createDemoTree } from './chunk-B6IR5KSC.mjs';
12
15
  export { DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, TreeRoot as Tree, TreeChevron, TreeContent, TreeEmpty, TreeIcon, TreeIndentGuides, TreeLabel, TreeProvider, TreeRoot, TreeRow, TreeSearchInput, appearanceToStyle, clearTreeState, createChildCache, flattenTree, loadTreeState, resolveAppearance, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './chunk-ZL7FH4NW.mjs';
16
+ import { useMapContext } from './chunk-7CWGZPO3.mjs';
13
17
  import { PlaygroundProvider } from './chunk-Y6UTOBF6.mjs';
14
- export { ANCHOR, BUBBLE_SURFACE, DESTRUCTIVE_SURFACE, MarkdownMessage, Mermaid_default as Mermaid, PrettyCode_default as PrettyCode, TOGGLE, TOOL_CALL, extractTextFromChildren, useCollapsibleContent } from './chunk-HIK6BPL7.mjs';
18
+ export { ANCHOR, ActionRow, BUBBLE_SURFACE, ChatMessageRow, DESTRUCTIVE_SURFACE, MarkdownMessage, MarkdownMessage_default as MarkdownMessageDefault, Mermaid_default as Mermaid, PrettyCode_default as PrettyCode, TOGGLE, TOOL_CALL, extractTextFromChildren, useCollapsibleContent } from './chunk-2NG4SXEP.mjs';
15
19
  export { JsonTree_default as JsonTree } from './chunk-ECONRHIG.mjs';
16
20
  import './chunk-KNEQRUBA.mjs';
17
21
  import { __name, __publicField } from './chunk-N2XQF2OL.mjs';
18
- import * as React from 'react';
19
- import { forwardRef, createContext, lazy, useRef, useState, useCallback, useImperativeHandle, useEffect, useMemo, Suspense, useContext } from 'react';
20
- import { cn } from '@djangocfg/ui-core/lib';
21
- import { useAppT } from '@djangocfg/i18n';
22
+ import { Marker, Popup, useMap, Source, Layer, useControl } from 'react-map-gl/maplibre';
22
23
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
23
- import { Bold, Italic, Strikethrough, Code, Heading1, Heading2, Heading3, List, ListOrdered, Quote, Minus, Bot, X, PanelRightClose, PanelRightOpen, VolumeX, Volume2, RotateCcw, Globe } from 'lucide-react';
24
- import { createAudioPrefsStore, useIsPhone, useIsTabletOrBelow, useIsMobile, useHotkey, useLocalStorage, useResolvedTheme } from '@djangocfg/ui-core/hooks';
25
- import { Button, Portal, Combobox, Flag, Avatar, AvatarImage, AvatarFallback } from '@djangocfg/ui-core/components';
24
+ import { memo, useCallback, useState, useEffect, lazy, forwardRef, useRef, useImperativeHandle, createContext, useMemo, Suspense, useContext } from 'react';
25
+ import { createPortal } from 'react-dom';
26
+ import { createAudioPrefsStore, useLocalStorage, useResolvedTheme } from '@djangocfg/ui-core/hooks';
27
+ import { Bold, Italic, Strikethrough, Code, Heading1, Heading2, Heading3, List, ListOrdered, Quote, Minus, VolumeX, Volume2 } from 'lucide-react';
28
+ import { Button } from '@djangocfg/ui-core/components';
29
+ import { cn } from '@djangocfg/ui-core/lib';
26
30
  import { useEditor as useEditor$1, EditorContent, ReactRenderer } from '@tiptap/react';
27
31
  import StarterKit from '@tiptap/starter-kit';
28
32
  import Placeholder from '@tiptap/extension-placeholder';
@@ -31,178 +35,856 @@ import { Markdown } from '@tiptap/markdown';
31
35
  import { autoUpdate, computePosition, offset, flip, shift } from '@floating-ui/dom';
32
36
  import { Extension } from '@tiptap/core';
33
37
 
34
- function Spinner({ className }) {
35
- const t = useAppT();
36
- const loadingLabel = t("ui.states.loading");
37
- return /* @__PURE__ */ jsx(
38
- "div",
39
- {
40
- className: cn(
41
- "inline-block h-8 w-8 animate-spin rounded-full",
42
- "border-4 border-solid border-current border-r-transparent",
43
- "align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
44
- className
45
- ),
46
- role: "status",
47
- "aria-label": loadingLabel
48
- }
49
- );
50
- }
51
- __name(Spinner, "Spinner");
52
- function LoadingFallback({
53
- minHeight = 200,
54
- showText = true,
55
- text,
56
- className
57
- }) {
58
- const t = useAppT();
59
- const loadingText = text ?? t("ui.form.loading");
60
- const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
61
- return /* @__PURE__ */ jsx(
62
- "div",
63
- {
64
- className: cn(
65
- "flex items-center justify-center bg-muted/30 rounded-lg",
66
- className
67
- ),
68
- style: { minHeight: height },
69
- children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
70
- /* @__PURE__ */ jsx(Spinner, { className: "text-primary" }),
71
- showText && /* @__PURE__ */ jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
72
- ] })
73
- }
74
- );
75
- }
76
- __name(LoadingFallback, "LoadingFallback");
77
- function CardLoadingFallback({
78
- title,
79
- description,
80
- minHeight = 200,
81
- className
38
+ var DefaultPin = memo(/* @__PURE__ */ __name(function DefaultPin2({
39
+ size = 24,
40
+ color = "#ef4444"
82
41
  }) {
83
- const t = useAppT();
84
- const cardTitle = title ?? t("ui.states.loading");
85
- const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
86
42
  return /* @__PURE__ */ jsxs(
87
- "div",
43
+ "svg",
88
44
  {
89
- className: cn(
90
- "relative bg-card rounded-lg border border-border overflow-hidden",
91
- className
92
- ),
45
+ width: size,
46
+ height: size,
47
+ viewBox: "0 0 24 24",
48
+ fill: "none",
49
+ style: { cursor: "pointer" },
93
50
  children: [
94
- /* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-border bg-muted/50", children: [
95
- /* @__PURE__ */ jsx("h6", { className: "text-sm font-semibold text-foreground", children: cardTitle }),
96
- description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: description })
97
- ] }),
98
- /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsx(
99
- "div",
51
+ /* @__PURE__ */ jsx(
52
+ "path",
100
53
  {
101
- className: "flex justify-center items-center",
102
- style: { minHeight: height },
103
- children: /* @__PURE__ */ jsx(Spinner, { className: "text-primary" })
54
+ 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",
55
+ fill: color,
56
+ stroke: "#fff",
57
+ strokeWidth: "1.5"
104
58
  }
105
- ) })
59
+ ),
60
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "9", r: "2.5", fill: "#fff" })
106
61
  ]
107
62
  }
108
63
  );
109
- }
110
- __name(CardLoadingFallback, "CardLoadingFallback");
111
- function MapLoadingFallback({
112
- minHeight = 400,
113
- className
64
+ }, "DefaultPin"));
65
+ memo(/* @__PURE__ */ __name(function MapMarker2({
66
+ marker,
67
+ onClick,
68
+ children,
69
+ anchor = "bottom",
70
+ draggable = false,
71
+ onDragStart,
72
+ onDrag,
73
+ onDragEnd,
74
+ color,
75
+ size
114
76
  }) {
115
- const t = useAppT();
116
- const loadingText = t("ui.form.loading");
117
- const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
77
+ const handleClick = useCallback(
78
+ (e) => {
79
+ e.originalEvent.stopPropagation();
80
+ onClick?.(marker);
81
+ },
82
+ [onClick, marker]
83
+ );
84
+ const handleDragStart = useCallback(
85
+ (e) => {
86
+ onDragStart?.(marker);
87
+ },
88
+ [onDragStart, marker]
89
+ );
90
+ const handleDrag = useCallback(
91
+ (e) => {
92
+ onDrag?.(marker, e.lngLat);
93
+ },
94
+ [onDrag, marker]
95
+ );
96
+ const handleDragEnd = useCallback(
97
+ (e) => {
98
+ onDragEnd?.(marker, e.lngLat);
99
+ },
100
+ [onDragEnd, marker]
101
+ );
118
102
  return /* @__PURE__ */ jsx(
119
- "div",
103
+ Marker,
120
104
  {
121
- className: cn(
122
- "relative bg-muted/50 rounded-lg overflow-hidden",
123
- "flex items-center justify-center",
124
- className
125
- ),
126
- style: { minHeight: height },
127
- children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
128
- /* @__PURE__ */ jsxs("div", { className: "relative", children: [
129
- /* @__PURE__ */ jsx(Spinner, { className: "text-primary h-10 w-10" }),
130
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxs(
131
- "svg",
132
- {
133
- className: "h-5 w-5 text-muted-foreground",
134
- fill: "none",
135
- viewBox: "0 0 24 24",
136
- stroke: "currentColor",
137
- children: [
138
- /* @__PURE__ */ jsx(
139
- "path",
140
- {
141
- strokeLinecap: "round",
142
- strokeLinejoin: "round",
143
- strokeWidth: 2,
144
- 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"
145
- }
146
- ),
147
- /* @__PURE__ */ jsx(
148
- "path",
149
- {
150
- strokeLinecap: "round",
151
- strokeLinejoin: "round",
152
- strokeWidth: 2,
153
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
154
- }
155
- )
156
- ]
157
- }
158
- ) })
159
- ] }),
160
- /* @__PURE__ */ jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
161
- ] })
105
+ longitude: marker.longitude,
106
+ latitude: marker.latitude,
107
+ anchor,
108
+ draggable,
109
+ onClick: handleClick,
110
+ onDragStart: handleDragStart,
111
+ onDrag: handleDrag,
112
+ onDragEnd: handleDragEnd,
113
+ children: children ?? /* @__PURE__ */ jsx(DefaultPin, { color, size })
162
114
  }
163
115
  );
164
- }
165
- __name(MapLoadingFallback, "MapLoadingFallback");
166
- function LazyWrapper({
116
+ }, "MapMarker"));
117
+ memo(/* @__PURE__ */ __name(function MapPopup2({
118
+ longitude,
119
+ latitude,
120
+ onClose,
167
121
  children,
168
- fallback,
169
- card = false,
170
- cardTitle,
171
- cardDescription,
172
- minHeight = 200,
173
- className
122
+ anchor = "bottom",
123
+ closeOnClick = true,
124
+ closeButton = true,
125
+ className,
126
+ maxWidth = "300px",
127
+ offset: offset2 = 15
174
128
  }) {
175
- const defaultFallback = card ? /* @__PURE__ */ jsx(
176
- CardLoadingFallback,
129
+ return /* @__PURE__ */ jsx(
130
+ Popup,
177
131
  {
178
- title: cardTitle,
179
- description: cardDescription,
180
- minHeight,
181
- className
132
+ longitude,
133
+ latitude,
134
+ anchor,
135
+ onClose,
136
+ closeOnClick,
137
+ closeButton,
138
+ className,
139
+ maxWidth,
140
+ offset: offset2,
141
+ children
142
+ }
143
+ );
144
+ }, "MapPopup"));
145
+
146
+ // src/tools/Map/layers/cluster.ts
147
+ var DEFAULT_COLORS = ["#51bbd6", "#f1f075", "#f28cb1"];
148
+ var DEFAULT_RADII = [20, 30, 40];
149
+ var DEFAULT_THRESHOLDS = [100, 750];
150
+ var DEFAULT_HOVER_COLOR = "#3b82f6";
151
+ function createClusterLayers(options) {
152
+ const {
153
+ sourceId,
154
+ colors = DEFAULT_COLORS,
155
+ radii = DEFAULT_RADII,
156
+ thresholds = DEFAULT_THRESHOLDS,
157
+ hoverColor = DEFAULT_HOVER_COLOR
158
+ } = options;
159
+ const cluster = {
160
+ id: `${sourceId}-clusters`,
161
+ type: "circle",
162
+ source: sourceId,
163
+ filter: ["has", "point_count"],
164
+ paint: {
165
+ "circle-color": [
166
+ "case",
167
+ ["boolean", ["feature-state", "hover"], false],
168
+ hoverColor,
169
+ [
170
+ "step",
171
+ ["get", "point_count"],
172
+ colors[0],
173
+ thresholds[0],
174
+ colors[1],
175
+ thresholds[1],
176
+ colors[2]
177
+ ]
178
+ ],
179
+ "circle-radius": [
180
+ "step",
181
+ ["get", "point_count"],
182
+ radii[0],
183
+ thresholds[0],
184
+ radii[1],
185
+ thresholds[1],
186
+ radii[2]
187
+ ],
188
+ "circle-stroke-width": 2,
189
+ "circle-stroke-color": "#fff"
190
+ }
191
+ };
192
+ const clusterCount = {
193
+ id: `${sourceId}-cluster-count`,
194
+ type: "symbol",
195
+ source: sourceId,
196
+ filter: ["has", "point_count"],
197
+ layout: {
198
+ "text-field": ["get", "point_count_abbreviated"],
199
+ "text-size": 12
200
+ },
201
+ paint: {
202
+ "text-color": "#000"
203
+ }
204
+ };
205
+ const unclusteredPoint = {
206
+ id: `${sourceId}-unclustered-point`,
207
+ type: "circle",
208
+ source: sourceId,
209
+ filter: ["!", ["has", "point_count"]],
210
+ paint: {
211
+ "circle-color": [
212
+ "case",
213
+ ["boolean", ["feature-state", "hover"], false],
214
+ hoverColor,
215
+ colors[0]
216
+ ],
217
+ "circle-radius": [
218
+ "case",
219
+ ["boolean", ["feature-state", "hover"], false],
220
+ 10,
221
+ 8
222
+ ],
223
+ "circle-stroke-width": 2,
224
+ "circle-stroke-color": "#fff"
225
+ }
226
+ };
227
+ return { cluster, clusterCount, unclusteredPoint };
228
+ }
229
+ __name(createClusterLayers, "createClusterLayers");
230
+ var POPUP_STYLE_ID = "map-cluster-popup-styles";
231
+ function injectPopupStyles() {
232
+ if (typeof document === "undefined") return;
233
+ if (document.getElementById(POPUP_STYLE_ID)) return;
234
+ const style = document.createElement("style");
235
+ style.id = POPUP_STYLE_ID;
236
+ style.textContent = `
237
+ .maplibregl-popup.map-popup-clean .maplibregl-popup-content {
238
+ padding: 0 !important;
239
+ background: transparent !important;
240
+ box-shadow: none !important;
241
+ border-radius: 0 !important;
242
+ }
243
+ .maplibregl-popup.map-popup-clean .maplibregl-popup-tip {
244
+ display: none !important;
182
245
  }
183
- ) : /* @__PURE__ */ jsx(LoadingFallback, { minHeight, className });
184
- return /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? defaultFallback, children });
246
+ `;
247
+ document.head.appendChild(style);
248
+ }
249
+ __name(injectPopupStyles, "injectPopupStyles");
250
+ memo(/* @__PURE__ */ __name(function MapCluster2({
251
+ sourceId,
252
+ data,
253
+ clusterRadius = 50,
254
+ clusterMaxZoom = 14,
255
+ onClusterClick,
256
+ onPointClick,
257
+ renderPopup,
258
+ popupAnchor = "bottom",
259
+ popupOffset = 15,
260
+ panOffsetX = 0,
261
+ panOffsetY = 150,
262
+ colors,
263
+ radii,
264
+ thresholds,
265
+ hoverColor
266
+ }) {
267
+ const { current: map } = useMap();
268
+ const [selectedFeature, setSelectedFeature] = useState(null);
269
+ const [popupCoords, setPopupCoords] = useState(null);
270
+ useEffect(() => {
271
+ injectPopupStyles();
272
+ }, []);
273
+ const layerOptions = {
274
+ sourceId,
275
+ colors,
276
+ radii,
277
+ thresholds,
278
+ hoverColor
279
+ };
280
+ const { cluster, clusterCount, unclusteredPoint } = createClusterLayers(layerOptions);
281
+ const handleClosePopup = useCallback(() => {
282
+ setSelectedFeature(null);
283
+ setPopupCoords(null);
284
+ }, []);
285
+ const handleClick = useCallback(
286
+ async (event) => {
287
+ if (!map) return;
288
+ const features = map.queryRenderedFeatures(event.point, {
289
+ layers: [cluster.id, unclusteredPoint.id]
290
+ });
291
+ if (!features || features.length === 0) return;
292
+ const feature = features[0];
293
+ const geometry = feature.geometry;
294
+ if (geometry.type !== "Point") return;
295
+ const coordinates = geometry.coordinates;
296
+ const clusterId = feature.properties?.cluster_id;
297
+ if (clusterId) {
298
+ const source = map.getSource(sourceId);
299
+ if (!source) return;
300
+ try {
301
+ const zoom = await source.getClusterExpansionZoom(clusterId);
302
+ map.easeTo({
303
+ center: coordinates,
304
+ zoom,
305
+ duration: 500
306
+ });
307
+ onClusterClick?.(clusterId, coordinates);
308
+ } catch (error) {
309
+ console.error("Error expanding cluster:", error);
310
+ }
311
+ } else {
312
+ onPointClick?.(feature);
313
+ if (renderPopup) {
314
+ map.easeTo({
315
+ center: coordinates,
316
+ duration: 300,
317
+ offset: [panOffsetX, panOffsetY]
318
+ });
319
+ setSelectedFeature(feature);
320
+ setPopupCoords(coordinates);
321
+ }
322
+ }
323
+ },
324
+ [map, sourceId, cluster.id, unclusteredPoint.id, onClusterClick, onPointClick, renderPopup, panOffsetX, panOffsetY]
325
+ );
326
+ const handleMapClick = useCallback(
327
+ (event) => {
328
+ if (!map) return;
329
+ const features = map.queryRenderedFeatures(event.point, {
330
+ layers: [cluster.id, unclusteredPoint.id]
331
+ });
332
+ if (!features || features.length === 0) {
333
+ handleClosePopup();
334
+ }
335
+ },
336
+ [map, cluster.id, unclusteredPoint.id, handleClosePopup]
337
+ );
338
+ useEffect(() => {
339
+ if (!map) return;
340
+ const clusterLayerId = cluster.id;
341
+ const pointLayerId = unclusteredPoint.id;
342
+ let currentHoveredId = null;
343
+ const clearHoverState = /* @__PURE__ */ __name(() => {
344
+ if (currentHoveredId !== null) {
345
+ map.setFeatureState(
346
+ { source: sourceId, id: currentHoveredId },
347
+ { hover: false }
348
+ );
349
+ currentHoveredId = null;
350
+ }
351
+ }, "clearHoverState");
352
+ const handleMouseMove = /* @__PURE__ */ __name((e) => {
353
+ const features = map.queryRenderedFeatures(e.point, {
354
+ layers: [clusterLayerId, pointLayerId]
355
+ });
356
+ if (features.length > 0) {
357
+ map.getCanvas().style.cursor = "pointer";
358
+ const feature = features[0];
359
+ const featureId = feature.id;
360
+ if (featureId !== void 0 && featureId !== currentHoveredId) {
361
+ clearHoverState();
362
+ currentHoveredId = featureId;
363
+ map.setFeatureState(
364
+ { source: sourceId, id: featureId },
365
+ { hover: true }
366
+ );
367
+ }
368
+ } else {
369
+ map.getCanvas().style.cursor = "";
370
+ clearHoverState();
371
+ }
372
+ }, "handleMouseMove");
373
+ const handleMouseLeave = /* @__PURE__ */ __name(() => {
374
+ map.getCanvas().style.cursor = "";
375
+ clearHoverState();
376
+ }, "handleMouseLeave");
377
+ map.on("click", clusterLayerId, handleClick);
378
+ map.on("click", pointLayerId, handleClick);
379
+ map.on("click", handleMapClick);
380
+ map.on("mousemove", clusterLayerId, handleMouseMove);
381
+ map.on("mousemove", pointLayerId, handleMouseMove);
382
+ map.on("mouseleave", clusterLayerId, handleMouseLeave);
383
+ map.on("mouseleave", pointLayerId, handleMouseLeave);
384
+ return () => {
385
+ clearHoverState();
386
+ map.off("click", clusterLayerId, handleClick);
387
+ map.off("click", pointLayerId, handleClick);
388
+ map.off("click", handleMapClick);
389
+ map.off("mousemove", clusterLayerId, handleMouseMove);
390
+ map.off("mousemove", pointLayerId, handleMouseMove);
391
+ map.off("mouseleave", clusterLayerId, handleMouseLeave);
392
+ map.off("mouseleave", pointLayerId, handleMouseLeave);
393
+ };
394
+ }, [map, sourceId, cluster.id, unclusteredPoint.id, handleClick, handleMapClick]);
395
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
396
+ /* @__PURE__ */ jsxs(
397
+ Source,
398
+ {
399
+ id: sourceId,
400
+ type: "geojson",
401
+ data,
402
+ cluster: true,
403
+ clusterMaxZoom,
404
+ clusterRadius,
405
+ generateId: true,
406
+ children: [
407
+ /* @__PURE__ */ jsx(Layer, { ...cluster }),
408
+ /* @__PURE__ */ jsx(Layer, { ...clusterCount }),
409
+ /* @__PURE__ */ jsx(Layer, { ...unclusteredPoint })
410
+ ]
411
+ }
412
+ ),
413
+ renderPopup && selectedFeature && popupCoords && /* @__PURE__ */ jsx(
414
+ Popup,
415
+ {
416
+ longitude: popupCoords[0],
417
+ latitude: popupCoords[1],
418
+ anchor: popupAnchor,
419
+ onClose: handleClosePopup,
420
+ closeOnClick: false,
421
+ closeButton: false,
422
+ offset: popupOffset,
423
+ maxWidth: "none",
424
+ className: "map-popup-clean",
425
+ children: renderPopup(selectedFeature, handleClosePopup)
426
+ }
427
+ )
428
+ ] });
429
+ }, "MapCluster"));
430
+ memo(/* @__PURE__ */ __name(function MapSource2({
431
+ id,
432
+ data,
433
+ type = "geojson",
434
+ children
435
+ }) {
436
+ return /* @__PURE__ */ jsx(Source, { id, type, data, children });
437
+ }, "MapSource"));
438
+ memo(/* @__PURE__ */ __name(function MapLayer2(props) {
439
+ return /* @__PURE__ */ jsx(Layer, { ...props });
440
+ }, "MapLayer"));
441
+ var _OverlayControl = class _OverlayControl {
442
+ constructor(redraw) {
443
+ __publicField(this, "_map", null);
444
+ __publicField(this, "_container", null);
445
+ __publicField(this, "_redraw");
446
+ this._redraw = redraw;
447
+ }
448
+ onAdd(map) {
449
+ this._map = map;
450
+ map.on("move", this._redraw);
451
+ this._container = document.createElement("div");
452
+ this._redraw();
453
+ return this._container;
454
+ }
455
+ onRemove() {
456
+ this._container?.remove();
457
+ this._map?.off("move", this._redraw);
458
+ this._map = null;
459
+ }
460
+ getElement() {
461
+ return this._container;
462
+ }
463
+ };
464
+ __name(_OverlayControl, "OverlayControl");
465
+ var OverlayControl = _OverlayControl;
466
+ function CustomOverlayComponent({ children }) {
467
+ const [, setVersion] = useState(0);
468
+ const ctrl = useControl(() => {
469
+ const forceUpdate = /* @__PURE__ */ __name(() => setVersion((v) => v + 1), "forceUpdate");
470
+ return new OverlayControl(forceUpdate);
471
+ });
472
+ const element = ctrl.getElement();
473
+ if (!element) return null;
474
+ return createPortal(children, element);
475
+ }
476
+ __name(CustomOverlayComponent, "CustomOverlayComponent");
477
+ memo(CustomOverlayComponent);
478
+ var positionStyles = {
479
+ "top-left": { top: 10, left: 10 },
480
+ "top-right": { top: 10, right: 10 },
481
+ "bottom-left": { bottom: 10, left: 10 },
482
+ "bottom-right": { bottom: 10, right: 10 }
483
+ };
484
+ function LegendIcon({
485
+ type,
486
+ color
487
+ }) {
488
+ const fill = color || "#888";
489
+ switch (type) {
490
+ case "circle":
491
+ return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6", fill }) });
492
+ case "line":
493
+ return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
494
+ "line",
495
+ {
496
+ x1: "0",
497
+ y1: "8",
498
+ x2: "16",
499
+ y2: "8",
500
+ stroke: fill,
501
+ strokeWidth: "3",
502
+ strokeLinecap: "round"
503
+ }
504
+ ) });
505
+ case "fill":
506
+ return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx("rect", { x: "1", y: "1", width: "14", height: "14", fill, rx: "2" }) });
507
+ case "symbol":
508
+ default:
509
+ return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
510
+ "path",
511
+ {
512
+ 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",
513
+ fill
514
+ }
515
+ ) });
516
+ }
185
517
  }
186
- __name(LazyWrapper, "LazyWrapper");
187
- function createLazyComponent(loader, options = {}) {
188
- const LazyComponent = React.lazy(loader);
189
- const WrappedComponent = /* @__PURE__ */ __name((props) => {
190
- const fallback = typeof options.fallback === "function" ? options.fallback(props) : options.fallback ?? /* @__PURE__ */ jsx(LoadingFallback, {});
191
- return /* @__PURE__ */ jsx(Suspense, { fallback, children: /* @__PURE__ */ jsx(LazyComponent, { ...props }) });
192
- }, "WrappedComponent");
193
- WrappedComponent.displayName = options.displayName ?? "LazyComponent";
194
- return WrappedComponent;
518
+ __name(LegendIcon, "LegendIcon");
519
+ function MapLegendComponent({
520
+ items,
521
+ position = "bottom-right",
522
+ title,
523
+ collapsible = false,
524
+ defaultCollapsed = false,
525
+ className = "",
526
+ style,
527
+ onItemClick
528
+ }) {
529
+ const [collapsed, setCollapsed] = useState(defaultCollapsed);
530
+ const containerStyle = useMemo(
531
+ () => ({
532
+ position: "absolute",
533
+ ...positionStyles[position],
534
+ backgroundColor: "white",
535
+ borderRadius: 8,
536
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
537
+ padding: collapsed ? 8 : 12,
538
+ minWidth: collapsed ? "auto" : 120,
539
+ zIndex: 1,
540
+ ...style
541
+ }),
542
+ [position, collapsed, style]
543
+ );
544
+ const headerStyle = useMemo(
545
+ () => ({
546
+ display: "flex",
547
+ alignItems: "center",
548
+ justifyContent: "space-between",
549
+ gap: 8,
550
+ cursor: collapsible ? "pointer" : "default",
551
+ fontWeight: 600,
552
+ fontSize: 12,
553
+ color: "#333",
554
+ marginBottom: collapsed ? 0 : 8
555
+ }),
556
+ [collapsible, collapsed]
557
+ );
558
+ const itemStyle = useMemo(
559
+ () => ({
560
+ display: "flex",
561
+ alignItems: "center",
562
+ gap: 8,
563
+ padding: "4px 0",
564
+ fontSize: 12,
565
+ color: "#666",
566
+ cursor: onItemClick ? "pointer" : "default"
567
+ }),
568
+ [onItemClick]
569
+ );
570
+ const handleHeaderClick = collapsible ? () => setCollapsed(!collapsed) : void 0;
571
+ return /* @__PURE__ */ jsxs("div", { className, style: containerStyle, children: [
572
+ (title || collapsible) && /* @__PURE__ */ jsxs("div", { style: headerStyle, onClick: handleHeaderClick, children: [
573
+ title && /* @__PURE__ */ jsx("span", { children: title }),
574
+ collapsible && /* @__PURE__ */ jsx(
575
+ "svg",
576
+ {
577
+ width: "12",
578
+ height: "12",
579
+ viewBox: "0 0 12 12",
580
+ style: {
581
+ transform: collapsed ? "rotate(-90deg)" : "rotate(0deg)",
582
+ transition: "transform 0.2s"
583
+ },
584
+ children: /* @__PURE__ */ jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "#666", fill: "none" })
585
+ }
586
+ )
587
+ ] }),
588
+ !collapsed && /* @__PURE__ */ jsx("div", { children: items.map((item) => /* @__PURE__ */ jsxs(
589
+ "div",
590
+ {
591
+ style: {
592
+ ...itemStyle,
593
+ opacity: item.visible === false ? 0.5 : 1
594
+ },
595
+ onClick: onItemClick ? () => onItemClick(item) : void 0,
596
+ children: [
597
+ item.icon || /* @__PURE__ */ jsx(LegendIcon, { type: item.type, color: item.color }),
598
+ /* @__PURE__ */ jsx("span", { children: item.label })
599
+ ]
600
+ },
601
+ item.id
602
+ )) })
603
+ ] });
604
+ }
605
+ __name(MapLegendComponent, "MapLegendComponent");
606
+ memo(MapLegendComponent);
607
+ function useMapLayers() {
608
+ const { mapRef, isLoaded } = useMapContext();
609
+ const addLayer = useCallback(
610
+ (layer, beforeId) => {
611
+ const map = mapRef.current?.getMap();
612
+ if (!map || !isLoaded) return;
613
+ if (layer.id && map.getLayer(layer.id)) {
614
+ map.removeLayer(layer.id);
615
+ }
616
+ map.addLayer(layer, beforeId);
617
+ },
618
+ [mapRef, isLoaded]
619
+ );
620
+ const removeLayer = useCallback(
621
+ (id) => {
622
+ const map = mapRef.current?.getMap();
623
+ if (!map || !isLoaded) return;
624
+ if (map.getLayer(id)) {
625
+ map.removeLayer(id);
626
+ }
627
+ },
628
+ [mapRef, isLoaded]
629
+ );
630
+ const setLayerVisibility = useCallback(
631
+ (id, visible) => {
632
+ const map = mapRef.current?.getMap();
633
+ if (!map || !isLoaded) return;
634
+ if (map.getLayer(id)) {
635
+ map.setLayoutProperty(id, "visibility", visible ? "visible" : "none");
636
+ }
637
+ },
638
+ [mapRef, isLoaded]
639
+ );
640
+ const setLayerFilter = useCallback(
641
+ (id, filter) => {
642
+ const map = mapRef.current?.getMap();
643
+ if (!map || !isLoaded) return;
644
+ if (map.getLayer(id)) {
645
+ map.setFilter(id, filter);
646
+ }
647
+ },
648
+ [mapRef, isLoaded]
649
+ );
650
+ const setLayerPaint = useCallback(
651
+ (id, property, value) => {
652
+ const map = mapRef.current?.getMap();
653
+ if (!map || !isLoaded) return;
654
+ if (map.getLayer(id)) {
655
+ map.setPaintProperty(id, property, value);
656
+ }
657
+ },
658
+ [mapRef, isLoaded]
659
+ );
660
+ return {
661
+ addLayer,
662
+ removeLayer,
663
+ setLayerVisibility,
664
+ setLayerFilter,
665
+ setLayerPaint
666
+ };
195
667
  }
196
- __name(createLazyComponent, "createLazyComponent");
668
+ __name(useMapLayers, "useMapLayers");
669
+ var positionStyles2 = {
670
+ "top-left": { top: 10, left: 10 },
671
+ "top-right": { top: 10, right: 10 },
672
+ "bottom-left": { bottom: 10, left: 10 },
673
+ "bottom-right": { bottom: 10, right: 10 }
674
+ };
675
+ function LayerSwitcherComponent({
676
+ layers,
677
+ position = "top-right",
678
+ title = "Layers",
679
+ collapsible = true,
680
+ defaultCollapsed = false,
681
+ showToggleAll = false,
682
+ className = "",
683
+ style,
684
+ onChange
685
+ }) {
686
+ const { setLayerVisibility } = useMapLayers();
687
+ const [collapsed, setCollapsed] = useState(defaultCollapsed);
688
+ const initialVisibility = useMemo(() => {
689
+ const initial = {};
690
+ layers.forEach((layer) => {
691
+ initial[layer.id] = layer.defaultVisible !== false;
692
+ });
693
+ return initial;
694
+ }, [layers]);
695
+ const [visibility, setVisibility] = useState(initialVisibility);
696
+ const handleToggle = useCallback(
697
+ (layerId) => {
698
+ const newVisible = !visibility[layerId];
699
+ setVisibility((prev) => ({ ...prev, [layerId]: newVisible }));
700
+ setLayerVisibility(layerId, newVisible);
701
+ onChange?.(layerId, newVisible);
702
+ },
703
+ [visibility, setLayerVisibility, onChange]
704
+ );
705
+ const handleToggleAll = useCallback(
706
+ (visible) => {
707
+ const newVisibility = {};
708
+ layers.forEach((layer) => {
709
+ newVisibility[layer.id] = visible;
710
+ setLayerVisibility(layer.id, visible);
711
+ onChange?.(layer.id, visible);
712
+ });
713
+ setVisibility(newVisibility);
714
+ },
715
+ [layers, setLayerVisibility, onChange]
716
+ );
717
+ const allVisible = useMemo(() => Object.values(visibility).every(Boolean), [visibility]);
718
+ const noneVisible = useMemo(() => Object.values(visibility).every((v) => !v), [visibility]);
719
+ const containerStyle = useMemo(
720
+ () => ({
721
+ position: "absolute",
722
+ ...positionStyles2[position],
723
+ backgroundColor: "white",
724
+ borderRadius: 8,
725
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
726
+ padding: collapsed ? 8 : 12,
727
+ minWidth: collapsed ? "auto" : 150,
728
+ zIndex: 1,
729
+ ...style
730
+ }),
731
+ [position, collapsed, style]
732
+ );
733
+ const headerStyle = useMemo(
734
+ () => ({
735
+ display: "flex",
736
+ alignItems: "center",
737
+ justifyContent: "space-between",
738
+ gap: 8,
739
+ cursor: collapsible ? "pointer" : "default",
740
+ fontWeight: 600,
741
+ fontSize: 12,
742
+ color: "#333",
743
+ marginBottom: collapsed ? 0 : 8
744
+ }),
745
+ [collapsible, collapsed]
746
+ );
747
+ const itemStyle = useMemo(
748
+ () => ({
749
+ display: "flex",
750
+ alignItems: "center",
751
+ gap: 8,
752
+ padding: "4px 0",
753
+ fontSize: 12,
754
+ color: "#666",
755
+ cursor: "pointer"
756
+ }),
757
+ []
758
+ );
759
+ const checkboxStyle = useMemo(
760
+ () => ({
761
+ width: 14,
762
+ height: 14,
763
+ cursor: "pointer"
764
+ }),
765
+ []
766
+ );
767
+ const groups = useMemo(() => {
768
+ return layers.reduce(
769
+ (acc, layer) => {
770
+ const group = layer.group || "";
771
+ if (!acc[group]) acc[group] = [];
772
+ acc[group].push(layer);
773
+ return acc;
774
+ },
775
+ {}
776
+ );
777
+ }, [layers]);
778
+ const handleHeaderClick = collapsible ? () => setCollapsed(!collapsed) : void 0;
779
+ return /* @__PURE__ */ jsxs("div", { className, style: containerStyle, children: [
780
+ /* @__PURE__ */ jsxs("div", { style: headerStyle, onClick: handleHeaderClick, children: [
781
+ /* @__PURE__ */ jsx("span", { children: title }),
782
+ collapsible && /* @__PURE__ */ jsx(
783
+ "svg",
784
+ {
785
+ width: "12",
786
+ height: "12",
787
+ viewBox: "0 0 12 12",
788
+ style: {
789
+ transform: collapsed ? "rotate(-90deg)" : "rotate(0deg)",
790
+ transition: "transform 0.2s"
791
+ },
792
+ children: /* @__PURE__ */ jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "#666", fill: "none" })
793
+ }
794
+ )
795
+ ] }),
796
+ !collapsed && /* @__PURE__ */ jsxs("div", { children: [
797
+ showToggleAll && /* @__PURE__ */ jsxs(
798
+ "div",
799
+ {
800
+ style: {
801
+ ...itemStyle,
802
+ borderBottom: "1px solid #eee",
803
+ marginBottom: 4,
804
+ paddingBottom: 8
805
+ },
806
+ children: [
807
+ /* @__PURE__ */ jsx(
808
+ "button",
809
+ {
810
+ onClick: () => handleToggleAll(true),
811
+ disabled: allVisible,
812
+ style: {
813
+ fontSize: 10,
814
+ padding: "2px 6px",
815
+ cursor: allVisible ? "default" : "pointer",
816
+ opacity: allVisible ? 0.5 : 1
817
+ },
818
+ children: "All"
819
+ }
820
+ ),
821
+ /* @__PURE__ */ jsx(
822
+ "button",
823
+ {
824
+ onClick: () => handleToggleAll(false),
825
+ disabled: noneVisible,
826
+ style: {
827
+ fontSize: 10,
828
+ padding: "2px 6px",
829
+ cursor: noneVisible ? "default" : "pointer",
830
+ opacity: noneVisible ? 0.5 : 1
831
+ },
832
+ children: "None"
833
+ }
834
+ )
835
+ ]
836
+ }
837
+ ),
838
+ Object.entries(groups).map(([group, groupLayers]) => /* @__PURE__ */ jsxs("div", { children: [
839
+ group && /* @__PURE__ */ jsx(
840
+ "div",
841
+ {
842
+ style: {
843
+ fontSize: 10,
844
+ fontWeight: 600,
845
+ color: "#999",
846
+ marginTop: 8,
847
+ marginBottom: 4,
848
+ textTransform: "uppercase"
849
+ },
850
+ children: group
851
+ }
852
+ ),
853
+ groupLayers.map((layer) => /* @__PURE__ */ jsxs(
854
+ "div",
855
+ {
856
+ style: itemStyle,
857
+ onClick: () => handleToggle(layer.id),
858
+ children: [
859
+ /* @__PURE__ */ jsx(
860
+ "input",
861
+ {
862
+ type: "checkbox",
863
+ checked: visibility[layer.id],
864
+ onChange: () => handleToggle(layer.id),
865
+ style: checkboxStyle
866
+ }
867
+ ),
868
+ /* @__PURE__ */ jsx("span", { children: layer.label })
869
+ ]
870
+ },
871
+ layer.id
872
+ ))
873
+ ] }, group || "default"))
874
+ ] })
875
+ ] });
876
+ }
877
+ __name(LayerSwitcherComponent, "LayerSwitcherComponent");
878
+ memo(LayerSwitcherComponent);
197
879
  var LazyMapContainer = createLazyComponent(
198
- () => import('./MapContainer-7HXBI3OH.mjs').then((mod) => ({ default: mod.MapContainer })),
880
+ () => import('./MapContainer-AKIPABJK.mjs').then((mod) => ({ default: mod.MapContainer })),
199
881
  {
200
882
  displayName: "LazyMapContainer",
201
883
  fallback: /* @__PURE__ */ jsx(MapLoadingFallback, { minHeight: 400 })
202
884
  }
203
885
  );
204
886
  var LazyMapView = createLazyComponent(
205
- () => import('./MapContainer-7HXBI3OH.mjs').then((mod) => ({ default: mod.MapView })),
887
+ () => import('./MapContainer-AKIPABJK.mjs').then((mod) => ({ default: mod.MapView })),
206
888
  {
207
889
  displayName: "LazyMapView",
208
890
  fallback: /* @__PURE__ */ jsx(MapLoadingFallback, { minHeight: 400 })
@@ -244,7 +926,7 @@ function OpenapiLoadingFallback() {
244
926
  }
245
927
  __name(OpenapiLoadingFallback, "OpenapiLoadingFallback");
246
928
  var LazyDocsLayout = createLazyComponent(
247
- () => import('./DocsLayout-2P3ONDWJ.mjs').then((mod) => ({ default: mod.DocsLayout })),
929
+ () => import('./DocsLayout-EKASBSP7.mjs').then((mod) => ({ default: mod.DocsLayout })),
248
930
  {
249
931
  displayName: "LazyDocsLayout",
250
932
  fallback: /* @__PURE__ */ jsx(OpenapiLoadingFallback, {})
@@ -349,13 +1031,6 @@ var LazyTree = createLazyComponent(
349
1031
  fallback: /* @__PURE__ */ jsx(LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
350
1032
  }
351
1033
  );
352
- var LazyChat = createLazyComponent(
353
- () => import('./ChatRoot-JVR3M3H2.mjs').then((m) => ({ default: m.ChatRoot })),
354
- {
355
- displayName: "LazyChat",
356
- fallback: /* @__PURE__ */ jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
357
- }
358
- );
359
1034
 
360
1035
  // src/tools/Chat/core/transport/types.ts
361
1036
  var _TransportError = class _TransportError extends Error {
@@ -838,1267 +1513,6 @@ function createPydanticAIChatTransport(opts) {
838
1513
  };
839
1514
  }
840
1515
  __name(createPydanticAIChatTransport, "createPydanticAIChatTransport");
841
- var SIZE_PX = { sm: 44, md: 56, lg: 64 };
842
- var ICON_PX = { sm: 18, md: 22, lg: 26 };
843
- function useEffectiveFABSize(size, inline) {
844
- const isPhone = useIsPhone();
845
- const isBelowDesktop = useIsTabletOrBelow();
846
- if (size !== "responsive") return size;
847
- if (inline) return "md";
848
- if (isPhone) return "sm";
849
- if (isBelowDesktop) return "md";
850
- return "lg";
851
- }
852
- __name(useEffectiveFABSize, "useEffectiveFABSize");
853
- function positionStyle(position, offset2) {
854
- const [vert, horiz] = position.split("-");
855
- return { [vert]: offset2, [horiz]: offset2 };
856
- }
857
- __name(positionStyle, "positionStyle");
858
- function tooltipSideClasses(position) {
859
- return position.endsWith("right") ? "right-full mr-3 origin-right" : "left-full ml-3 origin-left";
860
- }
861
- __name(tooltipSideClasses, "tooltipSideClasses");
862
- function Badge({ value }) {
863
- const display = value > 9 ? "9+" : String(value);
864
- return /* @__PURE__ */ jsx(
865
- "span",
866
- {
867
- "aria-hidden": "true",
868
- className: cn(
869
- "absolute -right-1 -top-1 inline-flex min-w-[18px] h-[18px] items-center justify-center",
870
- "rounded-full bg-destructive px-1 text-[10px] font-semibold leading-none text-destructive-foreground",
871
- "ring-2 ring-background"
872
- ),
873
- children: display
874
- }
875
- );
876
- }
877
- __name(Badge, "Badge");
878
- function PulseDot() {
879
- return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "absolute right-1 top-1", children: /* @__PURE__ */ jsxs("span", { className: "relative inline-flex h-2.5 w-2.5", children: [
880
- /* @__PURE__ */ jsx("span", { className: "absolute inset-0 rounded-full bg-destructive opacity-75 animate-ping" }),
881
- /* @__PURE__ */ jsx("span", { className: "relative inline-flex h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background" })
882
- ] }) });
883
- }
884
- __name(PulseDot, "PulseDot");
885
- function Tooltip({ text, side }) {
886
- return /* @__PURE__ */ jsx(
887
- "span",
888
- {
889
- role: "tooltip",
890
- className: cn(
891
- "pointer-events-none absolute top-1/2 -translate-y-1/2 whitespace-nowrap",
892
- "rounded-md bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground shadow-md",
893
- "border border-border opacity-0 scale-95 transition-all duration-150",
894
- "group-hover:opacity-100 group-hover:scale-100",
895
- "group-focus-within:opacity-100 group-focus-within:scale-100",
896
- side
897
- ),
898
- children: text
899
- }
900
- );
901
- }
902
- __name(Tooltip, "Tooltip");
903
- function ChatFAB({
904
- onClick,
905
- ariaLabel = "Open chat",
906
- icon,
907
- variant = "simple",
908
- size = "responsive",
909
- position = "bottom-right",
910
- offset: offset2 = 24,
911
- zIndex = 9999,
912
- pulse = false,
913
- badge,
914
- tooltip,
915
- inline = false,
916
- className,
917
- style
918
- }) {
919
- const effectiveSize = useEffectiveFABSize(size, inline);
920
- const px = SIZE_PX[effectiveSize];
921
- const iconPx = ICON_PX[effectiveSize];
922
- const renderedIcon = icon ?? /* @__PURE__ */ jsx(Bot, { size: iconPx });
923
- const baseButton = cn(
924
- "relative grid place-items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
925
- "transition-transform hover:scale-105"
926
- );
927
- return /* @__PURE__ */ jsxs(
928
- "div",
929
- {
930
- className: cn("group", inline ? "relative inline-flex" : "fixed"),
931
- style: inline ? void 0 : { ...positionStyle(position, offset2), zIndex },
932
- children: [
933
- variant === "animated" && /* @__PURE__ */ jsx(
934
- AnimatedFAB,
935
- {
936
- ariaLabel,
937
- onClick,
938
- size: px,
939
- className,
940
- style,
941
- children: renderedIcon
942
- }
943
- ),
944
- variant === "glass" && /* @__PURE__ */ jsxs(
945
- "button",
946
- {
947
- type: "button",
948
- "aria-label": ariaLabel,
949
- onClick,
950
- className: cn(
951
- baseButton,
952
- "border border-border/40 bg-background/60 text-foreground shadow-lg backdrop-blur-xl",
953
- "hover:bg-background/80",
954
- className
955
- ),
956
- style: { width: px, height: px, ...style },
957
- children: [
958
- renderedIcon,
959
- badge !== void 0 ? /* @__PURE__ */ jsx(Badge, { value: badge }) : pulse ? /* @__PURE__ */ jsx(PulseDot, {}) : null
960
- ]
961
- }
962
- ),
963
- variant === "simple" && /* @__PURE__ */ jsxs(
964
- "button",
965
- {
966
- type: "button",
967
- "aria-label": ariaLabel,
968
- onClick,
969
- className: cn(
970
- baseButton,
971
- "bg-primary text-primary-foreground hover:bg-primary/90 shadow-2xl",
972
- className
973
- ),
974
- style: { width: px, height: px, ...style },
975
- children: [
976
- renderedIcon,
977
- badge !== void 0 ? /* @__PURE__ */ jsx(Badge, { value: badge }) : pulse ? /* @__PURE__ */ jsx(PulseDot, {}) : null
978
- ]
979
- }
980
- ),
981
- tooltip && /* @__PURE__ */ jsx(Tooltip, { text: tooltip, side: tooltipSideClasses(position) })
982
- ]
983
- }
984
- );
985
- }
986
- __name(ChatFAB, "ChatFAB");
987
- function AnimatedFAB({ ariaLabel, onClick, size, className, style, children }) {
988
- return /* @__PURE__ */ jsxs(Fragment, { children: [
989
- /* @__PURE__ */ jsx("style", { children: ANIMATED_CSS }),
990
- /* @__PURE__ */ jsx(
991
- "div",
992
- {
993
- className: cn("cmdop-fab-anim", className),
994
- style: { width: size, height: size, ...style },
995
- children: /* @__PURE__ */ jsx("div", { className: "cmdop-fab-anim-glow", children: /* @__PURE__ */ jsxs("div", { className: "cmdop-fab-anim-wrap", children: [
996
- /* @__PURE__ */ jsx("div", { className: "cmdop-fab-anim-grad cmdop-fab-anim-grad-1" }),
997
- /* @__PURE__ */ jsx("div", { className: "cmdop-fab-anim-grad cmdop-fab-anim-grad-2" }),
998
- /* @__PURE__ */ jsx("div", { className: "cmdop-fab-anim-inner" }),
999
- /* @__PURE__ */ jsx(
1000
- "button",
1001
- {
1002
- type: "button",
1003
- "aria-label": ariaLabel,
1004
- onClick,
1005
- className: "cmdop-fab-anim-btn",
1006
- children: /* @__PURE__ */ jsx("span", { className: "cmdop-fab-anim-icon", children })
1007
- }
1008
- )
1009
- ] }) })
1010
- }
1011
- )
1012
- ] });
1013
- }
1014
- __name(AnimatedFAB, "AnimatedFAB");
1015
- var ANIMATED_CSS = `
1016
- .cmdop-fab-anim {
1017
- position: relative;
1018
- pointer-events: auto;
1019
- }
1020
- .cmdop-fab-anim-glow {
1021
- width: 100%; height: 100%;
1022
- border-radius: 50%;
1023
- overflow: hidden;
1024
- animation:
1025
- cmdop-fab-entrance 0.6s cubic-bezier(0.34, 1.45, 0.64, 1) forwards,
1026
- cmdop-fab-glow-shift 8s ease-in-out 0.6s infinite;
1027
- }
1028
- .cmdop-fab-anim-wrap {
1029
- position: relative; width: 100%; height: 100%;
1030
- border-radius: 50%; overflow: hidden;
1031
- }
1032
- .cmdop-fab-anim-grad { position: absolute; inset: 0; border-radius: 50%; }
1033
- .cmdop-fab-anim-grad-1 {
1034
- background: conic-gradient(
1035
- from 0deg,
1036
- #fbbf24 0%, rgba(251,191,36,0) 15%,
1037
- rgba(168,85,247,0) 20%, #a855f7 35%, rgba(168,85,247,0) 50%,
1038
- rgba(20,184,166,0) 55%, #14b8a6 70%, rgba(20,184,166,0) 85%,
1039
- rgba(236,72,153,0) 88%, #ec4899 97%, #fbbf24 100%
1040
- );
1041
- animation: cmdop-fab-rotate 7s linear infinite;
1042
- filter: blur(1px); opacity: 0.95;
1043
- }
1044
- .cmdop-fab-anim-grad-2 {
1045
- inset: 1px;
1046
- background: conic-gradient(
1047
- from 180deg,
1048
- #a855f7 0%, rgba(168,85,247,0) 20%,
1049
- rgba(20,184,166,0) 30%, #14b8a6 50%, rgba(20,184,166,0) 70%,
1050
- rgba(251,191,36,0) 75%, #fbbf24 95%, #a855f7 100%
1051
- );
1052
- animation: cmdop-fab-rotate-rev 9s linear infinite;
1053
- filter: blur(0.75px); opacity: 0.7;
1054
- }
1055
- .cmdop-fab-anim-inner {
1056
- position: absolute; inset: 3px; border-radius: 50%;
1057
- background: rgba(10, 10, 10, 0.65);
1058
- backdrop-filter: blur(12px) saturate(1.8);
1059
- -webkit-backdrop-filter: blur(12px) saturate(1.8);
1060
- animation: cmdop-fab-inner-glow 5s ease-in-out infinite;
1061
- }
1062
- .cmdop-fab-anim-btn {
1063
- position: absolute; inset: 2px;
1064
- border-radius: 50%; border: none; background: transparent;
1065
- cursor: pointer; display: flex; align-items: center; justify-content: center;
1066
- transition: transform 0.2s;
1067
- }
1068
- .cmdop-fab-anim-btn:hover { transform: scale(1.06); }
1069
- .cmdop-fab-anim-icon {
1070
- color: #fbbf24; display: flex;
1071
- filter: drop-shadow(0 0 6px rgba(251,191,36,0.8));
1072
- animation: cmdop-fab-icon-pulse 2.5s ease-in-out infinite;
1073
- }
1074
- @keyframes cmdop-fab-rotate { to { transform: rotate(360deg); } }
1075
- @keyframes cmdop-fab-rotate-rev { to { transform: rotate(-360deg); } }
1076
- @keyframes cmdop-fab-entrance {
1077
- 0% { transform: scale(0); }
1078
- 50% { transform: scale(1.08); }
1079
- 70% { transform: scale(0.98); }
1080
- 100% { transform: scale(1); }
1081
- }
1082
- @keyframes cmdop-fab-glow-shift {
1083
- 0%, 100% { box-shadow: 0 0 20px rgba(251,191,36,0.5), 0 0 40px rgba(168,85,247,0.3); }
1084
- 33% { box-shadow: 0 0 20px rgba(168,85,247,0.5), 0 0 40px rgba(20,184,166,0.3); }
1085
- 66% { box-shadow: 0 0 20px rgba(20,184,166,0.5), 0 0 40px rgba(236,72,153,0.3); }
1086
- }
1087
- @keyframes cmdop-fab-icon-pulse {
1088
- 0%, 100% { opacity: 1; transform: scale(1); }
1089
- 50% { opacity: 0.85; transform: scale(1.15); }
1090
- }
1091
- @keyframes cmdop-fab-inner-glow {
1092
- 0%, 100% { box-shadow: inset 0 0 20px rgba(251,191,36,0.25), inset 0 0 40px rgba(168,85,247,0.15); }
1093
- 50% { box-shadow: inset 0 0 25px rgba(168,85,247,0.3), inset 0 0 45px rgba(20,184,166,0.2); }
1094
- }
1095
- `;
1096
- function ChatHeader({
1097
- title,
1098
- icon,
1099
- actions,
1100
- showClose = true,
1101
- onClose,
1102
- closeLabel = "Close",
1103
- closeSlot,
1104
- className
1105
- }) {
1106
- return /* @__PURE__ */ jsxs(
1107
- "header",
1108
- {
1109
- className: cn(
1110
- "border-border bg-muted/30 flex shrink-0 items-center justify-between border-b px-4 py-2.5",
1111
- className
1112
- ),
1113
- children: [
1114
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2 text-sm font-semibold", children: [
1115
- icon ?? /* @__PURE__ */ jsx(Bot, { className: "text-primary h-4 w-4 shrink-0" }),
1116
- /* @__PURE__ */ jsx("span", { className: "truncate", children: title })
1117
- ] }),
1118
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", children: [
1119
- actions,
1120
- closeSlot ?? (showClose && onClose && /* @__PURE__ */ jsx(
1121
- Button,
1122
- {
1123
- variant: "ghost",
1124
- size: "sm",
1125
- onClick: onClose,
1126
- "aria-label": closeLabel,
1127
- className: "-mr-1 h-7 w-7 p-0",
1128
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
1129
- }
1130
- ))
1131
- ] })
1132
- ]
1133
- }
1134
- );
1135
- }
1136
- __name(ChatHeader, "ChatHeader");
1137
- function useChatPresence(open, exitDurationMs = 200) {
1138
- const [phase, setPhase] = useState("hidden");
1139
- const timerRef = useRef(null);
1140
- useEffect(() => {
1141
- if (timerRef.current) clearTimeout(timerRef.current);
1142
- if (open) {
1143
- setPhase("entering");
1144
- timerRef.current = setTimeout(() => setPhase("visible"), 16);
1145
- } else {
1146
- setPhase("leaving");
1147
- timerRef.current = setTimeout(() => setPhase("hidden"), exitDurationMs);
1148
- }
1149
- return () => {
1150
- if (timerRef.current) clearTimeout(timerRef.current);
1151
- };
1152
- }, [open, exitDurationMs]);
1153
- return phase;
1154
- }
1155
- __name(useChatPresence, "useChatPresence");
1156
- function dockPositionStyle(position, horizontal, vertical) {
1157
- const [vert, horiz] = position.split("-");
1158
- return { [vert]: vertical, [horiz]: horizontal };
1159
- }
1160
- __name(dockPositionStyle, "dockPositionStyle");
1161
- function ChatDock({
1162
- open,
1163
- onClose,
1164
- children,
1165
- mode = "popover",
1166
- side = "right",
1167
- title = "Chat",
1168
- icon,
1169
- headerActions,
1170
- hideHeader = false,
1171
- closeLabel,
1172
- width,
1173
- height = 720,
1174
- position = "bottom-right",
1175
- offset: offset2,
1176
- exitDurationMs = 200,
1177
- zIndex = 1e4,
1178
- ariaLabel,
1179
- className,
1180
- mobileFullscreen = true,
1181
- disablePortal = false,
1182
- inline = false,
1183
- reserveBodySpace
1184
- }) {
1185
- const phase = useChatPresence(open, exitDurationMs);
1186
- const isMobile = useIsMobile();
1187
- const isBelowDesktop = useIsTabletOrBelow();
1188
- const effectiveMode = mode === "side" && !isBelowDesktop ? "side" : "popover";
1189
- const fullscreen = mobileFullscreen && isMobile;
1190
- const wantsReserve = !inline && !fullscreen && effectiveMode === "side" && (reserveBodySpace ?? true);
1191
- const resolvedSideWidth = width ?? 420;
1192
- useEffect(() => {
1193
- if (!wantsReserve || phase === "hidden") return;
1194
- const body = document.body;
1195
- if (!body) return;
1196
- const cssVar = `${resolvedSideWidth}px`;
1197
- const padKey = side === "right" ? "paddingRight" : "paddingLeft";
1198
- const prevPad = body.style[padKey];
1199
- const prevVar = body.style.getPropertyValue("--chat-dock-reserve");
1200
- body.style[padKey] = cssVar;
1201
- body.style.setProperty("--chat-dock-reserve", cssVar);
1202
- return () => {
1203
- body.style[padKey] = prevPad;
1204
- if (prevVar) body.style.setProperty("--chat-dock-reserve", prevVar);
1205
- else body.style.removeProperty("--chat-dock-reserve");
1206
- };
1207
- }, [wantsReserve, phase, side, resolvedSideWidth]);
1208
- if (phase === "hidden") return null;
1209
- const animating = phase === "entering" || phase === "leaving";
1210
- const horizontal = offset2?.horizontal ?? 24;
1211
- const vertical = offset2?.vertical ?? 96;
1212
- const resolvedWidth = width ?? (effectiveMode === "side" ? resolvedSideWidth : 480);
1213
- let containerStyle;
1214
- let cornerClass;
1215
- const dynVH = "100dvh";
1216
- if (inline) {
1217
- containerStyle = {
1218
- position: "relative",
1219
- width: resolvedWidth,
1220
- height,
1221
- maxHeight: `calc(${dynVH} - 16px)`,
1222
- pointerEvents: phase === "visible" ? "auto" : "none"
1223
- };
1224
- cornerClass = "rounded-xl border";
1225
- } else if (fullscreen) {
1226
- containerStyle = {
1227
- position: "fixed",
1228
- top: 0,
1229
- [side === "left" ? "left" : "right"]: 0,
1230
- width: "100vw",
1231
- height: dynVH,
1232
- zIndex,
1233
- pointerEvents: phase === "visible" ? "auto" : "none"
1234
- };
1235
- cornerClass = "rounded-none border-0";
1236
- } else if (effectiveMode === "side") {
1237
- containerStyle = {
1238
- position: "fixed",
1239
- top: 0,
1240
- [side]: 0,
1241
- height: dynVH,
1242
- zIndex,
1243
- width: `min(${resolvedWidth}px, 100vw)`,
1244
- pointerEvents: phase === "visible" ? "auto" : "none"
1245
- };
1246
- cornerClass = side === "right" ? "rounded-none border-l" : "rounded-none border-r";
1247
- } else {
1248
- const heightCap = `calc(${dynVH} - ${vertical + 24}px)`;
1249
- containerStyle = {
1250
- position: "fixed",
1251
- ...dockPositionStyle(position, horizontal, vertical),
1252
- zIndex,
1253
- width: `min(${resolvedWidth}px, calc(100vw - 32px))`,
1254
- height: `min(${height}px, ${heightCap})`,
1255
- minHeight: `min(320px, ${heightCap})`,
1256
- pointerEvents: phase === "visible" ? "auto" : "none"
1257
- };
1258
- cornerClass = "rounded-xl border";
1259
- }
1260
- const enterClass = (() => {
1261
- if (fullscreen) return "opacity-0";
1262
- if (effectiveMode === "side") {
1263
- return side === "right" ? "opacity-0 translate-x-4" : "opacity-0 -translate-x-4";
1264
- }
1265
- return "opacity-0 scale-95 translate-y-2";
1266
- })();
1267
- const visibleClass = "opacity-100 scale-100 translate-y-0 translate-x-0";
1268
- return /* @__PURE__ */ jsx(Portal, { disablePortal: disablePortal || inline, children: /* @__PURE__ */ jsxs(
1269
- "div",
1270
- {
1271
- role: "dialog",
1272
- "aria-label": ariaLabel ?? (typeof title === "string" ? title : "Chat"),
1273
- "aria-hidden": phase === "leaving",
1274
- className: cn(
1275
- "bg-popover text-popover-foreground border-border",
1276
- "flex flex-col overflow-hidden shadow-2xl",
1277
- cornerClass,
1278
- "transition-all duration-200 ease-out",
1279
- animating ? enterClass : visibleClass,
1280
- className
1281
- ),
1282
- style: containerStyle,
1283
- children: [
1284
- !hideHeader && /* @__PURE__ */ jsx(
1285
- ChatHeader,
1286
- {
1287
- title,
1288
- icon,
1289
- actions: headerActions,
1290
- onClose,
1291
- closeLabel
1292
- }
1293
- ),
1294
- /* @__PURE__ */ jsx("div", { className: "min-h-0 min-w-0 flex-1 overflow-hidden", children })
1295
- ]
1296
- }
1297
- ) });
1298
- }
1299
- __name(ChatDock, "ChatDock");
1300
- var ChatHeaderActionButton = forwardRef(
1301
- /* @__PURE__ */ __name(function ChatHeaderActionButton2({ icon, ariaLabel, badge, destructive, loading, disabled, className, ...rest }, ref) {
1302
- return /* @__PURE__ */ jsxs(
1303
- "button",
1304
- {
1305
- ref,
1306
- type: "button",
1307
- "aria-label": ariaLabel,
1308
- title: ariaLabel,
1309
- disabled: disabled || loading,
1310
- className: cn(
1311
- "relative inline-flex h-7 w-7 items-center justify-center rounded-md",
1312
- "text-muted-foreground transition-colors",
1313
- "hover:bg-accent hover:text-foreground",
1314
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1315
- "disabled:opacity-50 disabled:cursor-not-allowed",
1316
- destructive && "hover:bg-destructive/15 hover:text-destructive",
1317
- loading && "animate-pulse",
1318
- className
1319
- ),
1320
- ...rest,
1321
- children: [
1322
- icon,
1323
- badge !== void 0 && /* @__PURE__ */ jsx(
1324
- "span",
1325
- {
1326
- "aria-hidden": "true",
1327
- 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",
1328
- children: badge > 9 ? "9+" : badge
1329
- }
1330
- )
1331
- ]
1332
- }
1333
- );
1334
- }, "ChatHeaderActionButton")
1335
- );
1336
- function ChatHeaderModeToggle({
1337
- mode,
1338
- onToggle,
1339
- expandLabel = "Dock to side",
1340
- collapseLabel = "Back to popover",
1341
- forceVisible = false
1342
- }) {
1343
- const isBelowDesktop = useIsTabletOrBelow();
1344
- if (isBelowDesktop && !forceVisible) return null;
1345
- const isSide = mode === "side";
1346
- return /* @__PURE__ */ jsx(
1347
- ChatHeaderActionButton,
1348
- {
1349
- icon: isSide ? /* @__PURE__ */ jsx(PanelRightClose, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(PanelRightOpen, { className: "h-3.5 w-3.5" }),
1350
- ariaLabel: isSide ? collapseLabel : expandLabel,
1351
- onClick: onToggle
1352
- }
1353
- );
1354
- }
1355
- __name(ChatHeaderModeToggle, "ChatHeaderModeToggle");
1356
- function ChatHeaderAudioToggle({
1357
- muted,
1358
- onToggle,
1359
- unmuteLabel = "Unmute notifications",
1360
- muteLabel = "Mute notifications"
1361
- }) {
1362
- return /* @__PURE__ */ jsx(
1363
- ChatHeaderActionButton,
1364
- {
1365
- icon: muted ? /* @__PURE__ */ jsx(VolumeX, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(Volume2, { className: "h-3.5 w-3.5" }),
1366
- ariaLabel: muted ? unmuteLabel : muteLabel,
1367
- onClick: onToggle
1368
- }
1369
- );
1370
- }
1371
- __name(ChatHeaderAudioToggle, "ChatHeaderAudioToggle");
1372
- function useChatReset(opts) {
1373
- const { onReset, onSuccess, onError } = opts;
1374
- const [isResetting, setIsResetting] = useState(false);
1375
- const reset = useCallback(async () => {
1376
- if (isResetting) return false;
1377
- setIsResetting(true);
1378
- try {
1379
- const ok = await onReset();
1380
- if (ok) onSuccess?.();
1381
- else onError?.();
1382
- return ok;
1383
- } catch (err) {
1384
- onError?.(err);
1385
- return false;
1386
- } finally {
1387
- setIsResetting(false);
1388
- }
1389
- }, [isResetting, onReset, onSuccess, onError]);
1390
- return { reset, isResetting };
1391
- }
1392
- __name(useChatReset, "useChatReset");
1393
- var DEFAULT_TITLE = "Clear conversation?";
1394
- var DEFAULT_MESSAGE = "The assistant will forget this session and start a new one. This cannot be undone.";
1395
- var DEFAULT_LABEL = "Clear conversation";
1396
- function ChatHeaderResetButton({
1397
- onReset,
1398
- onSuccess,
1399
- onError,
1400
- confirm = true,
1401
- confirmTitle = DEFAULT_TITLE,
1402
- confirmMessage = DEFAULT_MESSAGE,
1403
- ariaLabel = DEFAULT_LABEL
1404
- }) {
1405
- const { reset, isResetting } = useChatReset({ onReset, onSuccess, onError });
1406
- const handleClick = /* @__PURE__ */ __name(async () => {
1407
- if (confirm) {
1408
- const api = typeof window !== "undefined" ? window.dialog : void 0;
1409
- if (api?.confirm) {
1410
- const ok = await api.confirm({
1411
- title: confirmTitle,
1412
- message: confirmMessage,
1413
- variant: "destructive",
1414
- confirmText: "Clear",
1415
- cancelText: "Cancel"
1416
- });
1417
- if (!ok) return;
1418
- } else if (typeof window !== "undefined" && typeof window.confirm === "function") {
1419
- const ok = window.confirm(`${confirmTitle}
1420
-
1421
- ${confirmMessage}`);
1422
- if (!ok) return;
1423
- }
1424
- }
1425
- await reset();
1426
- }, "handleClick");
1427
- return /* @__PURE__ */ jsx(
1428
- ChatHeaderActionButton,
1429
- {
1430
- icon: /* @__PURE__ */ jsx(RotateCcw, { className: "h-3.5 w-3.5" }),
1431
- ariaLabel,
1432
- onClick: handleClick,
1433
- loading: isResetting,
1434
- destructive: true
1435
- }
1436
- );
1437
- }
1438
- __name(ChatHeaderResetButton, "ChatHeaderResetButton");
1439
-
1440
- // src/tools/SpeechRecognition/core/languages-catalog.ts
1441
- var WEB_SPEECH_LANGUAGES = [
1442
- { name: "Afrikaans", iso: "af", englishName: "afrikaans", dialects: [{ code: "af-ZA", region: "South Africa" }] },
1443
- { name: "\u12A0\u121B\u122D\u129B", iso: "am", englishName: "amharic", dialects: [{ code: "am-ET", region: "Ethiopia" }] },
1444
- { name: "Az\u0259rbaycanca", iso: "az", englishName: "azerbaijani", dialects: [{ code: "az-AZ", region: "Azerbaijan" }] },
1445
- {
1446
- name: "\u09AC\u09BE\u0982\u09B2\u09BE",
1447
- iso: "bn",
1448
- englishName: "bengali",
1449
- dialects: [
1450
- { code: "bn-BD", region: "Bangladesh" },
1451
- { code: "bn-IN", region: "India" }
1452
- ]
1453
- },
1454
- { name: "Bahasa Indonesia", iso: "id", englishName: "indonesian", dialects: [{ code: "id-ID", region: "Indonesia" }] },
1455
- { name: "Bahasa Melayu", iso: "ms", englishName: "malay", dialects: [{ code: "ms-MY", region: "Malaysia" }] },
1456
- { name: "Catal\xE0", iso: "ca", englishName: "catalan", dialects: [{ code: "ca-ES", region: "Spain" }] },
1457
- { name: "\u010Ce\u0161tina", iso: "cs", englishName: "czech", dialects: [{ code: "cs-CZ", region: "Czechia" }] },
1458
- { name: "Dansk", iso: "da", englishName: "danish", dialects: [{ code: "da-DK", region: "Denmark" }] },
1459
- { name: "Deutsch", iso: "de", englishName: "german", dialects: [{ code: "de-DE", region: "Germany" }] },
1460
- {
1461
- name: "English",
1462
- iso: "en",
1463
- englishName: "english",
1464
- dialects: [
1465
- { code: "en-US", region: "United States" },
1466
- { code: "en-GB", region: "United Kingdom" },
1467
- { code: "en-AU", region: "Australia" },
1468
- { code: "en-CA", region: "Canada" },
1469
- { code: "en-IN", region: "India" },
1470
- { code: "en-NZ", region: "New Zealand" },
1471
- { code: "en-PH", region: "Philippines" },
1472
- { code: "en-ZA", region: "South Africa" },
1473
- { code: "en-NG", region: "Nigeria" },
1474
- { code: "en-GH", region: "Ghana" },
1475
- { code: "en-KE", region: "Kenya" },
1476
- { code: "en-TZ", region: "Tanzania" }
1477
- ]
1478
- },
1479
- {
1480
- name: "Espa\xF1ol",
1481
- iso: "es",
1482
- englishName: "spanish",
1483
- dialects: [
1484
- { code: "es-ES", region: "Espa\xF1a" },
1485
- { code: "es-MX", region: "M\xE9xico" },
1486
- { code: "es-US", region: "Estados Unidos" },
1487
- { code: "es-AR", region: "Argentina" },
1488
- { code: "es-CL", region: "Chile" },
1489
- { code: "es-CO", region: "Colombia" },
1490
- { code: "es-PE", region: "Per\xFA" },
1491
- { code: "es-VE", region: "Venezuela" },
1492
- { code: "es-EC", region: "Ecuador" },
1493
- { code: "es-GT", region: "Guatemala" },
1494
- { code: "es-CR", region: "Costa Rica" },
1495
- { code: "es-PA", region: "Panam\xE1" },
1496
- { code: "es-DO", region: "Rep. Dominicana" },
1497
- { code: "es-UY", region: "Uruguay" },
1498
- { code: "es-PY", region: "Paraguay" },
1499
- { code: "es-BO", region: "Bolivia" },
1500
- { code: "es-SV", region: "El Salvador" },
1501
- { code: "es-HN", region: "Honduras" },
1502
- { code: "es-NI", region: "Nicaragua" },
1503
- { code: "es-PR", region: "Puerto Rico" }
1504
- ]
1505
- },
1506
- { name: "Euskara", iso: "eu", englishName: "basque", dialects: [{ code: "eu-ES", region: "Spain" }] },
1507
- { name: "Filipino", iso: "fil", englishName: "filipino tagalog", dialects: [{ code: "fil-PH", region: "Philippines" }] },
1508
- { name: "Fran\xE7ais", iso: "fr", englishName: "french", dialects: [{ code: "fr-FR", region: "France" }] },
1509
- { name: "Basa Jawa", iso: "jv", englishName: "javanese", dialects: [{ code: "jv-ID", region: "Indonesia" }] },
1510
- { name: "Galego", iso: "gl", englishName: "galician", dialects: [{ code: "gl-ES", region: "Spain" }] },
1511
- { name: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0", iso: "gu", englishName: "gujarati", dialects: [{ code: "gu-IN", region: "India" }] },
1512
- { name: "Hrvatski", iso: "hr", englishName: "croatian", dialects: [{ code: "hr-HR", region: "Croatia" }] },
1513
- { name: "IsiZulu", iso: "zu", englishName: "zulu", dialects: [{ code: "zu-ZA", region: "South Africa" }] },
1514
- { name: "\xCDslenska", iso: "is", englishName: "icelandic", dialects: [{ code: "is-IS", region: "Iceland" }] },
1515
- {
1516
- name: "Italiano",
1517
- iso: "it",
1518
- englishName: "italian",
1519
- dialects: [
1520
- { code: "it-IT", region: "Italia" },
1521
- { code: "it-CH", region: "Svizzera" }
1522
- ]
1523
- },
1524
- { name: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1", iso: "kn", englishName: "kannada", dialects: [{ code: "kn-IN", region: "India" }] },
1525
- { name: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A", iso: "km", englishName: "khmer cambodian", dialects: [{ code: "km-KH", region: "Cambodia" }] },
1526
- { name: "Latvie\u0161u", iso: "lv", englishName: "latvian", dialects: [{ code: "lv-LV", region: "Latvia" }] },
1527
- { name: "Lietuvi\u0173", iso: "lt", englishName: "lithuanian", dialects: [{ code: "lt-LT", region: "Lithuania" }] },
1528
- { name: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02", iso: "ml", englishName: "malayalam", dialects: [{ code: "ml-IN", region: "India" }] },
1529
- { name: "\u092E\u0930\u093E\u0920\u0940", iso: "mr", englishName: "marathi", dialects: [{ code: "mr-IN", region: "India" }] },
1530
- { name: "Magyar", iso: "hu", englishName: "hungarian", dialects: [{ code: "hu-HU", region: "Hungary" }] },
1531
- { name: "\u0EA5\u0EB2\u0EA7", iso: "lo", englishName: "lao laotian", dialects: [{ code: "lo-LA", region: "Laos" }] },
1532
- { name: "Nederlands", iso: "nl", englishName: "dutch", dialects: [{ code: "nl-NL", region: "Netherlands" }] },
1533
- { name: "\u0928\u0947\u092A\u093E\u0932\u0940 \u092D\u093E\u0937\u093E", iso: "ne", englishName: "nepali", dialects: [{ code: "ne-NP", region: "Nepal" }] },
1534
- { name: "Norsk bokm\xE5l", iso: "nb", englishName: "norwegian bokmal", dialects: [{ code: "nb-NO", region: "Norway" }] },
1535
- { name: "Polski", iso: "pl", englishName: "polish", dialects: [{ code: "pl-PL", region: "Poland" }] },
1536
- {
1537
- name: "Portugu\xEAs",
1538
- iso: "pt",
1539
- englishName: "portuguese",
1540
- dialects: [
1541
- { code: "pt-BR", region: "Brasil" },
1542
- { code: "pt-PT", region: "Portugal" }
1543
- ]
1544
- },
1545
- { name: "Rom\xE2n\u0103", iso: "ro", englishName: "romanian", dialects: [{ code: "ro-RO", region: "Romania" }] },
1546
- { name: "\u0DC3\u0DD2\u0D82\u0DC4\u0DBD", iso: "si", englishName: "sinhala sinhalese", dialects: [{ code: "si-LK", region: "Sri Lanka" }] },
1547
- { name: "Sloven\u0161\u010Dina", iso: "sl", englishName: "slovenian", dialects: [{ code: "sl-SI", region: "Slovenia" }] },
1548
- { name: "Basa Sunda", iso: "su", englishName: "sundanese", dialects: [{ code: "su-ID", region: "Indonesia" }] },
1549
- { name: "Sloven\u010Dina", iso: "sk", englishName: "slovak", dialects: [{ code: "sk-SK", region: "Slovakia" }] },
1550
- { name: "Suomi", iso: "fi", englishName: "finnish", dialects: [{ code: "fi-FI", region: "Finland" }] },
1551
- { name: "Svenska", iso: "sv", englishName: "swedish", dialects: [{ code: "sv-SE", region: "Sweden" }] },
1552
- {
1553
- name: "Kiswahili",
1554
- iso: "sw",
1555
- englishName: "swahili",
1556
- dialects: [
1557
- { code: "sw-TZ", region: "Tanzania" },
1558
- { code: "sw-KE", region: "Kenya" }
1559
- ]
1560
- },
1561
- { name: "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8", iso: "ka", englishName: "georgian", dialects: [{ code: "ka-GE", region: "Georgia" }] },
1562
- { name: "\u0540\u0561\u0575\u0565\u0580\u0565\u0576", iso: "hy", englishName: "armenian", dialects: [{ code: "hy-AM", region: "Armenia" }] },
1563
- {
1564
- name: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",
1565
- iso: "ta",
1566
- englishName: "tamil",
1567
- dialects: [
1568
- { code: "ta-IN", region: "\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE" },
1569
- { code: "ta-SG", region: "\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD" },
1570
- { code: "ta-LK", region: "\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8" },
1571
- { code: "ta-MY", region: "\u0BAE\u0BB2\u0BC7\u0B9A\u0BBF\u0BAF\u0BBE" }
1572
- ]
1573
- },
1574
- { name: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41", iso: "te", englishName: "telugu", dialects: [{ code: "te-IN", region: "India" }] },
1575
- { name: "Ti\u1EBFng Vi\u1EC7t", iso: "vi", englishName: "vietnamese", dialects: [{ code: "vi-VN", region: "Vietnam" }] },
1576
- { name: "T\xFCrk\xE7e", iso: "tr", englishName: "turkish", dialects: [{ code: "tr-TR", region: "T\xFCrkiye" }] },
1577
- {
1578
- name: "\u0627\u064F\u0631\u062F\u064F\u0648",
1579
- iso: "ur",
1580
- englishName: "urdu",
1581
- dialects: [
1582
- { code: "ur-PK", region: "\u067E\u0627\u06A9\u0633\u062A\u0627\u0646" },
1583
- { code: "ur-IN", region: "\u0628\u06BE\u0627\u0631\u062A" }
1584
- ]
1585
- },
1586
- { name: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", iso: "el", englishName: "greek", dialects: [{ code: "el-GR", region: "Greece" }] },
1587
- { name: "\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", iso: "bg", englishName: "bulgarian", dialects: [{ code: "bg-BG", region: "Bulgaria" }] },
1588
- { name: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", iso: "ru", englishName: "russian", dialects: [{ code: "ru-RU", region: "Russia" }] },
1589
- { name: "\u0421\u0440\u043F\u0441\u043A\u0438", iso: "sr", englishName: "serbian", dialects: [{ code: "sr-RS", region: "Serbia" }] },
1590
- { name: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", iso: "uk", englishName: "ukrainian", dialects: [{ code: "uk-UA", region: "Ukraine" }] },
1591
- { name: "\uD55C\uAD6D\uC5B4", iso: "ko", englishName: "korean", dialects: [{ code: "ko-KR", region: "Korea" }] },
1592
- {
1593
- name: "\u4E2D\u6587",
1594
- iso: "cmn",
1595
- englishName: "chinese mandarin cantonese",
1596
- dialects: [
1597
- { code: "cmn-Hans-CN", region: "\u666E\u901A\u8BDD (\u4E2D\u56FD\u5927\u9646)" },
1598
- { code: "cmn-Hans-HK", region: "\u666E\u901A\u8BDD (\u9999\u6E2F)" },
1599
- { code: "cmn-Hant-TW", region: "\u4E2D\u6587 (\u53F0\u7063)" },
1600
- { code: "yue-Hant-HK", region: "\u7CB5\u8A9E (\u9999\u6E2F)" }
1601
- ]
1602
- },
1603
- { name: "\u65E5\u672C\u8A9E", iso: "ja", englishName: "japanese", dialects: [{ code: "ja-JP", region: "Japan" }] },
1604
- { name: "\u0939\u093F\u0928\u094D\u0926\u0940", iso: "hi", englishName: "hindi", dialects: [{ code: "hi-IN", region: "India" }] },
1605
- { name: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22", iso: "th", englishName: "thai", dialects: [{ code: "th-TH", region: "Thailand" }] }
1606
- ];
1607
- WEB_SPEECH_LANGUAGES.flatMap(
1608
- (l) => l.dialects.map((d) => d.code)
1609
- );
1610
- function findSpeechLanguage(tag) {
1611
- if (!tag) return null;
1612
- const lower = tag.toLowerCase();
1613
- for (const language of WEB_SPEECH_LANGUAGES) {
1614
- for (const dialect of language.dialects) {
1615
- if (dialect.code.toLowerCase() === lower) return { language, dialect };
1616
- }
1617
- }
1618
- return null;
1619
- }
1620
- __name(findSpeechLanguage, "findSpeechLanguage");
1621
- function countryFromTag(tag) {
1622
- if (!tag) return null;
1623
- const parts = tag.split("-");
1624
- for (let i = parts.length - 1; i >= 0; i -= 1) {
1625
- const p = parts[i];
1626
- if (p.length === 2 && /^[A-Za-z]{2}$/.test(p)) return p.toUpperCase();
1627
- }
1628
- return null;
1629
- }
1630
- __name(countryFromTag, "countryFromTag");
1631
- getSpeechLogger();
1632
- createContext(null);
1633
- createLazyComponent(
1634
- () => import('./DictationField-WPONUCYE.mjs').then((mod) => ({
1635
- default: mod.DictationField
1636
- })),
1637
- {
1638
- displayName: "LazyDictationField",
1639
- fallback: /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-border/60 bg-card px-3 py-2 text-xs text-muted-foreground", children: "Loading dictation\u2026" })
1640
- }
1641
- );
1642
- function ChatHeaderLanguageButton({
1643
- ariaLabel = "Speech language",
1644
- allowedTags,
1645
- hideFallbackIcon,
1646
- className
1647
- }) {
1648
- const prefs = useSpeechPrefs();
1649
- const active = useResolvedLanguage();
1650
- const options = useMemo(() => {
1651
- const allow = allowedTags ? new Set(allowedTags) : null;
1652
- const out = [];
1653
- for (const lang of WEB_SPEECH_LANGUAGES) {
1654
- for (const d of lang.dialects) {
1655
- if (allow && !allow.has(d.code)) continue;
1656
- out.push({
1657
- value: d.code,
1658
- // "Русский" / "Español — Argentina" / "English — United States"
1659
- label: lang.dialects.length === 1 ? lang.name : `${lang.name} \u2014 ${d.region}`,
1660
- // Search-only index: English name, BCP-47 tag, ISO, region.
1661
- // Lets users type "russian" / "ru-RU" / "ru" / "argentina"
1662
- // and still find the row regardless of native script.
1663
- description: `${lang.englishName} ${d.code} ${lang.iso} ${d.region}`.toLowerCase()
1664
- });
1665
- }
1666
- }
1667
- return out;
1668
- }, [allowedTags]);
1669
- return /* @__PURE__ */ jsx(
1670
- Combobox,
1671
- {
1672
- options,
1673
- value: prefs.language ?? active,
1674
- onValueChange: (v) => prefs.setLanguage(v || null),
1675
- placeholder: ariaLabel,
1676
- searchPlaceholder: "Search language\u2026",
1677
- filterFunction: (opt, search) => {
1678
- const s = search.toLowerCase();
1679
- return opt.label.toLowerCase().includes(s) || opt.value.toLowerCase().includes(s) || (opt.description?.includes(s) ?? false);
1680
- },
1681
- contentClassName: "w-[280px]",
1682
- contentStyle: { zIndex: 10001 },
1683
- renderOption: (option) => {
1684
- const country = countryFromTag(option.value);
1685
- return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
1686
- country ? /* @__PURE__ */ jsx(
1687
- Flag,
1688
- {
1689
- countryCode: country,
1690
- className: "h-4 w-5 shrink-0 overflow-hidden rounded-[2px] border border-border/60 ring-1 ring-black/5"
1691
- }
1692
- ) : /* @__PURE__ */ jsx(Globe, { className: "h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
1693
- /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: option.label })
1694
- ] });
1695
- },
1696
- renderTrigger: (selected, open) => {
1697
- const tag = selected?.value ?? active;
1698
- const country = countryFromTag(tag);
1699
- const found = findSpeechLanguage(tag);
1700
- const tooltipLabel = found ? `${found.language.name}${found.language.dialects.length > 1 ? ` \u2014 ${found.dialect.region}` : ""} \xB7 ${tag}` : tag;
1701
- return /* @__PURE__ */ jsx(
1702
- "button",
1703
- {
1704
- type: "button",
1705
- "aria-label": `${ariaLabel}: ${tooltipLabel}`,
1706
- "aria-expanded": open,
1707
- title: tooltipLabel,
1708
- className: cn(
1709
- "inline-flex h-7 w-7 items-center justify-center rounded-md",
1710
- "text-muted-foreground transition-colors",
1711
- "hover:bg-accent hover:text-foreground",
1712
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1713
- className
1714
- ),
1715
- children: country ? /* @__PURE__ */ jsx(
1716
- Flag,
1717
- {
1718
- countryCode: country,
1719
- className: "h-4 w-5 overflow-hidden rounded-[2px] border border-border/60 ring-1 ring-black/5"
1720
- }
1721
- ) : hideFallbackIcon ? null : /* @__PURE__ */ jsx(Globe, { className: "h-3.5 w-3.5", "aria-hidden": true })
1722
- }
1723
- );
1724
- }
1725
- }
1726
- );
1727
- }
1728
- __name(ChatHeaderLanguageButton, "ChatHeaderLanguageButton");
1729
- function anchorStyle(position, fabOffset, fabClearance) {
1730
- const [vert, horiz] = position.split("-");
1731
- return { [vert]: fabClearance, [horiz]: fabOffset };
1732
- }
1733
- __name(anchorStyle, "anchorStyle");
1734
- function originClass(position) {
1735
- if (position === "bottom-right") return "origin-bottom-right";
1736
- if (position === "bottom-left") return "origin-bottom-left";
1737
- if (position === "top-right") return "origin-top-right";
1738
- return "origin-top-left";
1739
- }
1740
- __name(originClass, "originClass");
1741
- function ChatGreeting({
1742
- open,
1743
- children,
1744
- onClick,
1745
- onDismiss,
1746
- position = "bottom-right",
1747
- fabOffset = 24,
1748
- fabClearance = 96,
1749
- delayMs = 1500,
1750
- zIndex = 9998,
1751
- className,
1752
- style,
1753
- avatar,
1754
- senderName,
1755
- dismissLabel = "Dismiss",
1756
- inline = false
1757
- }) {
1758
- const [delayed, setDelayed] = useState(delayMs <= 0);
1759
- useEffect(() => {
1760
- if (!open || delayMs <= 0) return;
1761
- const t = setTimeout(() => setDelayed(true), delayMs);
1762
- return () => clearTimeout(t);
1763
- }, [open, delayMs]);
1764
- const shouldShow = open && delayed;
1765
- const phase = useChatPresence(shouldShow, 220);
1766
- if (phase === "hidden") return null;
1767
- const animating = phase === "entering" || phase === "leaving";
1768
- const clickable = !!onClick;
1769
- return /* @__PURE__ */ jsxs(
1770
- "div",
1771
- {
1772
- role: clickable ? "button" : "status",
1773
- "aria-live": "polite",
1774
- tabIndex: clickable ? 0 : -1,
1775
- onClick: clickable ? onClick : void 0,
1776
- onKeyDown: clickable ? (e) => {
1777
- if (e.key === "Enter" || e.key === " ") {
1778
- e.preventDefault();
1779
- onClick?.();
1780
- }
1781
- } : void 0,
1782
- className: cn(
1783
- inline ? "relative inline-flex" : "fixed",
1784
- "flex items-start gap-2.5 max-w-[280px]",
1785
- "rounded-2xl border border-border bg-popover text-popover-foreground",
1786
- "px-3.5 py-2.5 shadow-2xl transition-all duration-200 ease-out",
1787
- clickable && "cursor-pointer hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1788
- originClass(position),
1789
- animating ? "opacity-0 scale-95 translate-y-1" : "opacity-100 scale-100 translate-y-0",
1790
- className
1791
- ),
1792
- style: {
1793
- ...inline ? {} : anchorStyle(position, fabOffset, fabClearance),
1794
- ...inline ? {} : { zIndex },
1795
- pointerEvents: phase === "visible" ? "auto" : "none",
1796
- ...style
1797
- },
1798
- children: [
1799
- avatar && /* @__PURE__ */ jsx("div", { className: "mt-0.5 shrink-0", children: avatar }),
1800
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 text-sm leading-snug", children: [
1801
- senderName && /* @__PURE__ */ jsx("div", { className: "mb-0.5 text-[11px] font-medium text-muted-foreground", children: senderName }),
1802
- /* @__PURE__ */ jsx("div", { className: "text-foreground", children })
1803
- ] }),
1804
- onDismiss && /* @__PURE__ */ jsx(
1805
- "button",
1806
- {
1807
- type: "button",
1808
- "aria-label": dismissLabel,
1809
- onClick: (e) => {
1810
- e.stopPropagation();
1811
- onDismiss();
1812
- },
1813
- className: cn(
1814
- "-mr-1 -mt-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
1815
- "text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
1816
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1817
- ),
1818
- children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
1819
- }
1820
- )
1821
- ]
1822
- }
1823
- );
1824
- }
1825
- __name(ChatGreeting, "ChatGreeting");
1826
- var TIME_FORMAT = new Intl.DateTimeFormat(void 0, {
1827
- hour: "2-digit",
1828
- minute: "2-digit"
1829
- });
1830
- function anchorStyle2(position, fabOffset, fabClearance) {
1831
- const [vert, horiz] = position.split("-");
1832
- return { [vert]: fabClearance, [horiz]: fabOffset };
1833
- }
1834
- __name(anchorStyle2, "anchorStyle");
1835
- function originClass2(position) {
1836
- if (position === "bottom-right") return "origin-bottom-right";
1837
- if (position === "bottom-left") return "origin-bottom-left";
1838
- if (position === "top-right") return "origin-top-right";
1839
- return "origin-top-left";
1840
- }
1841
- __name(originClass2, "originClass");
1842
- function deriveAvatar(persona, name) {
1843
- const initials = persona?.initials ?? (name ?? persona?.name ?? "?").split(/\s+/).map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1844
- return /* @__PURE__ */ jsxs(Avatar, { className: "h-9 w-9", children: [
1845
- persona?.avatarUrl ? /* @__PURE__ */ jsx(AvatarImage, { src: persona.avatarUrl }) : null,
1846
- /* @__PURE__ */ jsx(AvatarFallback, { children: initials || "?" })
1847
- ] });
1848
- }
1849
- __name(deriveAvatar, "deriveAvatar");
1850
- function ChatUnreadPreview({
1851
- open,
1852
- message,
1853
- onClick,
1854
- onDismiss,
1855
- position = "bottom-right",
1856
- fabOffset = 24,
1857
- fabClearance = 96,
1858
- truncate = 2,
1859
- zIndex = 9998,
1860
- inline = false,
1861
- className,
1862
- style,
1863
- dismissLabel = "Mark as read",
1864
- avatar,
1865
- senderName
1866
- }) {
1867
- const shouldShow = open && !!message;
1868
- const phase = useChatPresence(shouldShow, 200);
1869
- if (phase === "hidden" || !message) return null;
1870
- const animating = phase === "entering" || phase === "leaving";
1871
- const clickable = !!onClick;
1872
- const displayName = senderName ?? message.sender?.name ?? "New message";
1873
- const stamp = TIME_FORMAT.format(new Date(message.createdAt));
1874
- return /* @__PURE__ */ jsxs(
1875
- "div",
1876
- {
1877
- role: clickable ? "button" : "status",
1878
- "aria-live": "polite",
1879
- tabIndex: clickable ? 0 : -1,
1880
- onClick: clickable ? onClick : void 0,
1881
- onKeyDown: clickable ? (e) => {
1882
- if (e.key === "Enter" || e.key === " ") {
1883
- e.preventDefault();
1884
- onClick?.();
1885
- }
1886
- } : void 0,
1887
- className: cn(
1888
- inline ? "relative inline-flex" : "fixed",
1889
- "flex items-start gap-2.5 max-w-[300px]",
1890
- "rounded-2xl border border-border bg-popover text-popover-foreground",
1891
- "px-3.5 py-2.5 shadow-2xl transition-all duration-200 ease-out",
1892
- clickable && "cursor-pointer hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1893
- originClass2(position),
1894
- animating ? "opacity-0 scale-95 translate-y-1" : "opacity-100 scale-100 translate-y-0",
1895
- className
1896
- ),
1897
- style: {
1898
- ...inline ? {} : anchorStyle2(position, fabOffset, fabClearance),
1899
- ...inline ? {} : { zIndex },
1900
- pointerEvents: phase === "visible" ? "auto" : "none",
1901
- ...style
1902
- },
1903
- children: [
1904
- /* @__PURE__ */ jsx("div", { className: "mt-0.5 shrink-0", children: avatar ?? deriveAvatar(message.sender, displayName) }),
1905
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 text-sm leading-snug", children: [
1906
- /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
1907
- /* @__PURE__ */ jsx("div", { className: "truncate text-[12px] font-semibold text-foreground", children: displayName }),
1908
- /* @__PURE__ */ jsx("div", { className: "shrink-0 text-[10px] text-muted-foreground", children: stamp })
1909
- ] }),
1910
- /* @__PURE__ */ jsx(
1911
- "div",
1912
- {
1913
- className: "text-foreground/90 mt-0.5 break-words",
1914
- style: {
1915
- display: "-webkit-box",
1916
- WebkitLineClamp: truncate,
1917
- WebkitBoxOrient: "vertical",
1918
- overflow: "hidden"
1919
- },
1920
- children: message.content
1921
- }
1922
- )
1923
- ] }),
1924
- onDismiss ? /* @__PURE__ */ jsx(
1925
- "button",
1926
- {
1927
- type: "button",
1928
- "aria-label": dismissLabel,
1929
- onClick: (e) => {
1930
- e.stopPropagation();
1931
- onDismiss();
1932
- },
1933
- className: cn(
1934
- "-mr-1 -mt-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
1935
- "text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
1936
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1937
- ),
1938
- children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
1939
- }
1940
- ) : null
1941
- ]
1942
- }
1943
- );
1944
- }
1945
- __name(ChatUnreadPreview, "ChatUnreadPreview");
1946
- function readDismissed(storageKey) {
1947
- if (!storageKey) return false;
1948
- if (typeof window === "undefined") return false;
1949
- try {
1950
- return window.localStorage.getItem(storageKey) === "1";
1951
- } catch {
1952
- return false;
1953
- }
1954
- }
1955
- __name(readDismissed, "readDismissed");
1956
- function writeDismissed(storageKey) {
1957
- if (!storageKey) return;
1958
- if (typeof window === "undefined") return;
1959
- try {
1960
- window.localStorage.setItem(storageKey, "1");
1961
- } catch {
1962
- }
1963
- }
1964
- __name(writeDismissed, "writeDismissed");
1965
- function ChatLauncher({
1966
- children,
1967
- fab,
1968
- dock,
1969
- greeting,
1970
- hotkey,
1971
- defaultOpen = false,
1972
- open: controlledOpen,
1973
- onOpenChange,
1974
- autoFocusComposerOnOpen = true,
1975
- closeOnEscape = true,
1976
- unreadMessage,
1977
- onMarkRead,
1978
- unreadPreview,
1979
- audio,
1980
- hideAudioToggle = false
1981
- }) {
1982
- const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
1983
- const isControlled = controlledOpen !== void 0;
1984
- const open = isControlled ? controlledOpen : uncontrolledOpen;
1985
- const dockContentRef = useRef(null);
1986
- useEffect(() => {
1987
- if (!autoFocusComposerOnOpen || !open) return;
1988
- const t = setTimeout(() => {
1989
- const root = dockContentRef.current;
1990
- if (!root) return;
1991
- const target = root.querySelector(
1992
- 'textarea:not([disabled]):not([readonly]), input[type="text"]:not([disabled]):not([readonly])'
1993
- );
1994
- target?.focus();
1995
- }, 120);
1996
- return () => clearTimeout(t);
1997
- }, [open, autoFocusComposerOnOpen]);
1998
- const setOpen = useCallback(
1999
- (next) => {
2000
- if (!isControlled) setUncontrolledOpen(next);
2001
- onOpenChange?.(next);
2002
- },
2003
- [isControlled, onOpenChange]
2004
- );
2005
- const toggleOpen = useCallback(() => setOpen(!open), [open, setOpen]);
2006
- useHotkey(
2007
- "escape",
2008
- (e) => {
2009
- const target = e?.target ?? null;
2010
- const inEditable = !!target && (target.matches?.('input, textarea, [contenteditable="true"]') ?? false);
2011
- if (inEditable) {
2012
- target.blur();
2013
- return;
2014
- }
2015
- setOpen(false);
2016
- },
2017
- { enabled: closeOnEscape && open }
2018
- );
2019
- const greetingConfig = greeting === void 0 ? null : typeof greeting === "string" ? { content: greeting } : greeting;
2020
- const [dismissed, setDismissed] = useState(
2021
- () => readDismissed(greetingConfig?.dismissStorageKey)
2022
- );
2023
- useEffect(() => {
2024
- if (!hotkey) return;
2025
- const handler = /* @__PURE__ */ __name((e) => {
2026
- const metaOk = hotkey.meta ? e.metaKey || e.ctrlKey : !e.metaKey && !e.ctrlKey;
2027
- const shiftOk = hotkey.shift ? e.shiftKey : !e.shiftKey;
2028
- const altOk = hotkey.alt ? e.altKey : !e.altKey;
2029
- if (!metaOk || !shiftOk || !altOk) return;
2030
- if (e.key !== hotkey.key) return;
2031
- e.preventDefault();
2032
- setOpen(!open);
2033
- }, "handler");
2034
- window.addEventListener("keydown", handler);
2035
- return () => window.removeEventListener("keydown", handler);
2036
- }, [hotkey?.key, hotkey?.meta, hotkey?.shift, hotkey?.alt, open, setOpen, hotkey]);
2037
- const greetingOpen = !!greetingConfig && !dismissed && (greetingConfig.hideOnOpen === false || !open);
2038
- const fabPosition = fab?.position ?? "bottom-right";
2039
- const fabOffset = fab?.offset ?? 24;
2040
- const handleGreetingDismiss = /* @__PURE__ */ __name(() => {
2041
- setDismissed(true);
2042
- writeDismissed(greetingConfig?.dismissStorageKey);
2043
- }, "handleGreetingDismiss");
2044
- const handleGreetingClick = /* @__PURE__ */ __name(() => {
2045
- setOpen(true);
2046
- setDismissed(true);
2047
- writeDismissed(greetingConfig?.dismissStorageKey);
2048
- }, "handleGreetingClick");
2049
- useEffect(() => {
2050
- if (open && unreadMessage) onMarkRead?.();
2051
- }, [open, unreadMessage, onMarkRead]);
2052
- const unreadOpen = !open && !!unreadMessage;
2053
- const handleUnreadClick = /* @__PURE__ */ __name(() => {
2054
- setOpen(true);
2055
- onMarkRead?.();
2056
- }, "handleUnreadClick");
2057
- const handleUnreadDismiss = /* @__PURE__ */ __name(() => {
2058
- onMarkRead?.();
2059
- }, "handleUnreadDismiss");
2060
- const resolvedFab = unreadMessage && fab?.badge === void 0 ? { ...fab, badge: 1 } : fab;
2061
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2062
- /* @__PURE__ */ jsx(ChatFAB, { ...resolvedFab, onClick: toggleOpen }),
2063
- unreadMessage ? /* @__PURE__ */ jsx(
2064
- ChatUnreadPreview,
2065
- {
2066
- ...unreadPreview,
2067
- open: unreadOpen,
2068
- message: unreadMessage,
2069
- onClick: handleUnreadClick,
2070
- onDismiss: handleUnreadDismiss,
2071
- position: fabPosition,
2072
- fabOffset
2073
- }
2074
- ) : greetingConfig ? /* @__PURE__ */ jsx(
2075
- ChatGreeting,
2076
- {
2077
- ...greetingConfig,
2078
- open: greetingOpen,
2079
- onClick: handleGreetingClick,
2080
- onDismiss: handleGreetingDismiss,
2081
- position: fabPosition,
2082
- fabOffset,
2083
- children: greetingConfig.content
2084
- }
2085
- ) : null,
2086
- /* @__PURE__ */ jsx(
2087
- ChatDock,
2088
- {
2089
- ...dock,
2090
- open,
2091
- onClose: () => setOpen(false),
2092
- headerActions: audio && !audio.isSilent && !hideAudioToggle || dock?.headerActions ? /* @__PURE__ */ jsxs(Fragment, { children: [
2093
- dock?.headerActions,
2094
- audio && !audio.isSilent && !hideAudioToggle ? /* @__PURE__ */ jsx(ChatHeaderAudioToggle, { muted: audio.muted, onToggle: audio.toggleMute }) : null
2095
- ] }) : void 0,
2096
- children: /* @__PURE__ */ jsx("div", { ref: dockContentRef, className: "flex h-full min-h-0 min-w-0 flex-col", children })
2097
- }
2098
- )
2099
- ] });
2100
- }
2101
- __name(ChatLauncher, "ChatLauncher");
2102
1516
  function useChatScroll(options) {
2103
1517
  const {
2104
1518
  containerRef,
@@ -2392,6 +1806,21 @@ function AudioToggle({
2392
1806
  );
2393
1807
  }
2394
1808
  __name(AudioToggle, "AudioToggle");
1809
+ var LazyChat = createLazyComponent(
1810
+ () => import('./ChatRoot-FITF5RVP.mjs').then((m) => ({ default: m.ChatRoot })),
1811
+ {
1812
+ displayName: "LazyChat",
1813
+ fallback: /* @__PURE__ */ jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
1814
+ }
1815
+ );
1816
+ createLazyComponent(
1817
+ () => import('./launcher-5Y42OBSN.mjs').then((m) => ({ default: m.ChatLauncher })),
1818
+ {
1819
+ displayName: "LazyChatLauncher",
1820
+ // Launcher renders a floating FAB by default — no inline placeholder.
1821
+ fallback: null
1822
+ }
1823
+ );
2395
1824
  var LottiePlayerClient = lazy(
2396
1825
  () => import('./LottiePlayer.client-5LDSSJWS.mjs').then((mod) => ({ default: mod.LottiePlayer }))
2397
1826
  );
@@ -2404,7 +1833,7 @@ function LottiePlayer(props) {
2404
1833
  }
2405
1834
  __name(LottiePlayer, "LottiePlayer");
2406
1835
  var DocsLayout = lazy(
2407
- () => import('./DocsLayout-2P3ONDWJ.mjs').then((mod) => ({ default: mod.DocsLayout }))
1836
+ () => import('./DocsLayout-EKASBSP7.mjs').then((mod) => ({ default: mod.DocsLayout }))
2408
1837
  );
2409
1838
  var LoadingFallback6 = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: "Loading API Playground..." }) }), "LoadingFallback");
2410
1839
  var Playground = /* @__PURE__ */ __name(({ config }) => {
@@ -3478,6 +2907,6 @@ function MarkdownToolbar({ editor }) {
3478
2907
  }
3479
2908
  __name(MarkdownToolbar, "MarkdownToolbar");
3480
2909
 
3481
- export { AudioToggle, CardLoadingFallback, ChatDock, ChatFAB, ChatGreeting, ChatHeader, ChatHeaderActionButton, ChatHeaderAudioToggle, ChatHeaderLanguageButton, ChatHeaderModeToggle, ChatHeaderResetButton, ChatLauncher, ChatUnreadPreview, CronScheduler, DEFAULT_DOCK_PREFS, DiffEditor, Editor, EditorProvider, LazyPlayer as LazyAudioPlayer, LazyChat, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, LazyVideoPlayer, LazyWrapper, LoadingFallback, LottiePlayer, MapLoadingFallback, MarkdownEditor, OpenapiViewer_default as OpenapiViewer, Spinner, TransportError, collectImageAttachments, createHttpTransport, createLazyComponent, createMockTransport, createPydanticAIChatTransport, createPydanticAISSEMap, createToolIdQueue, dispatchToolPayload, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isStringValue, mapPydanticAIEvent, mentionPresets, parseSSE, useChatAudioPrefs, useChatDockPrefs, useChatHistory, useChatLightbox, useChatPresence, useChatReset, useChatScroll, useChatUnread, useEditor, useEditorContext, useLanguage, useMonaco, useVisitorFingerprint };
2910
+ export { AudioToggle, CronScheduler, DEFAULT_DOCK_PREFS, DiffEditor, Editor, EditorProvider, LazyPlayer as LazyAudioPlayer, LazyChat, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, LazyVideoPlayer, LottiePlayer, MarkdownEditor, OpenapiViewer_default as OpenapiViewer, TransportError, collectImageAttachments, createHttpTransport, createMockTransport, createPydanticAIChatTransport, createPydanticAISSEMap, createToolIdQueue, dispatchToolPayload, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isStringValue, mapPydanticAIEvent, mentionPresets, parseSSE, useChatAudioPrefs, useChatDockPrefs, useChatHistory, useChatLightbox, useChatScroll, useChatUnread, useEditor, useEditorContext, useLanguage, useMonaco, useVisitorFingerprint };
3482
2911
  //# sourceMappingURL=index.mjs.map
3483
2912
  //# sourceMappingURL=index.mjs.map