@uipath/apollo-react 4.41.1 → 4.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/canvas/components/Edges/SequenceEdge.cjs +3 -2
  2. package/dist/canvas/components/Edges/SequenceEdge.d.ts.map +1 -1
  3. package/dist/canvas/components/Edges/SequenceEdge.js +3 -2
  4. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  5. package/dist/core/tokens/css/theme-variables.css +318 -4
  6. package/dist/core/tokens/css/variables.css +372 -0
  7. package/dist/core/tokens/jss/palette.cjs +1184 -0
  8. package/dist/core/tokens/jss/palette.d.ts +12 -1
  9. package/dist/core/tokens/jss/palette.js +1 -1
  10. package/dist/core/tokens/less/_variables.less +372 -0
  11. package/dist/core/tokens/scss/_variables.scss +895 -119
  12. package/dist/core/tokens/scss/base-host.scss +302 -0
  13. package/dist/core/tokens/scss/theme-variables.scss +310 -4
  14. package/dist/core/tokens/scss/theme.scss +307 -1
  15. package/dist/material/stories/chat-story-support.cjs +2437 -0
  16. package/dist/material/stories/chat-story-support.d.ts +11 -0
  17. package/dist/material/stories/chat-story-support.d.ts.map +1 -0
  18. package/dist/material/stories/chat-story-support.js +2381 -0
  19. package/dist/material/stories/storybook-helpers.cjs +166 -0
  20. package/dist/material/stories/storybook-helpers.d.ts +21 -0
  21. package/dist/material/stories/storybook-helpers.d.ts.map +1 -0
  22. package/dist/material/stories/storybook-helpers.js +109 -0
  23. package/dist/material/theme/index.cjs +27 -1
  24. package/dist/material/theme/index.d.ts +3 -1
  25. package/dist/material/theme/index.d.ts.map +1 -1
  26. package/dist/material/theme/index.js +23 -3
  27. package/dist/material/theme/overrides/MuiButton.cjs +4 -4
  28. package/dist/material/theme/overrides/MuiButton.js +4 -4
  29. package/dist/material/theme/overrides/MuiDatepicker.cjs +2 -2
  30. package/dist/material/theme/overrides/MuiDatepicker.js +2 -2
  31. package/dist/material/theme/overrides/MuiFab.cjs +3 -3
  32. package/dist/material/theme/overrides/MuiFab.js +3 -3
  33. package/dist/material/theme/overrides/index.cjs +8 -0
  34. package/dist/material/theme/overrides/index.d.ts +2 -0
  35. package/dist/material/theme/overrides/index.d.ts.map +1 -1
  36. package/dist/material/theme/overrides/index.js +4 -2
  37. package/package.json +5 -4
@@ -0,0 +1,2437 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ mapToChatLocale: ()=>mapToChatLocale,
37
+ ChatShowcaseDemo: ()=>ChatShowcaseDemo,
38
+ mapToChatTheme: ()=>mapToChatTheme
39
+ });
40
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
41
+ const Box_namespaceObject = require("@mui/material/Box");
42
+ var Box_default = /*#__PURE__*/ __webpack_require__.n(Box_namespaceObject);
43
+ const Button_namespaceObject = require("@mui/material/Button");
44
+ var Button_default = /*#__PURE__*/ __webpack_require__.n(Button_namespaceObject);
45
+ const Checkbox_namespaceObject = require("@mui/material/Checkbox");
46
+ var Checkbox_default = /*#__PURE__*/ __webpack_require__.n(Checkbox_namespaceObject);
47
+ const Divider_namespaceObject = require("@mui/material/Divider");
48
+ var Divider_default = /*#__PURE__*/ __webpack_require__.n(Divider_namespaceObject);
49
+ const FormControlLabel_namespaceObject = require("@mui/material/FormControlLabel");
50
+ var FormControlLabel_default = /*#__PURE__*/ __webpack_require__.n(FormControlLabel_namespaceObject);
51
+ const TextField_namespaceObject = require("@mui/material/TextField");
52
+ var TextField_default = /*#__PURE__*/ __webpack_require__.n(TextField_namespaceObject);
53
+ const Typography_namespaceObject = require("@mui/material/Typography");
54
+ var Typography_default = /*#__PURE__*/ __webpack_require__.n(Typography_namespaceObject);
55
+ const external_react_namespaceObject = require("react");
56
+ const index_cjs_namespaceObject = require("../../core/index.cjs");
57
+ const external_components_index_cjs_namespaceObject = require("../components/index.cjs");
58
+ const CHAT_LOCALES = [
59
+ 'en',
60
+ 'de',
61
+ 'es',
62
+ 'es-MX',
63
+ 'fr',
64
+ 'ja',
65
+ 'ko',
66
+ 'pt',
67
+ 'pt-BR',
68
+ 'ru',
69
+ 'tr',
70
+ 'zh-CN',
71
+ 'zh-TW'
72
+ ];
73
+ function mapToChatLocale(globalLocale) {
74
+ return CHAT_LOCALES.includes(globalLocale) ? globalLocale : 'en';
75
+ }
76
+ function mapToChatTheme(globalTheme) {
77
+ switch(globalTheme){
78
+ case 'light':
79
+ return 'light';
80
+ case 'light-hc':
81
+ return 'light-hc';
82
+ case 'dark':
83
+ return 'dark';
84
+ case 'dark-hc':
85
+ return 'dark-hc';
86
+ case 'future-light':
87
+ return 'light';
88
+ case 'future-dark':
89
+ return 'dark';
90
+ default:
91
+ return 'dark';
92
+ }
93
+ }
94
+ function Section({ children }) {
95
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Box_default(), {
96
+ sx: {
97
+ mb: 3,
98
+ '&:last-child': {
99
+ mb: 0,
100
+ '& > .MuiDivider-root': {
101
+ display: 'none'
102
+ }
103
+ }
104
+ },
105
+ children: [
106
+ children,
107
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Divider_default(), {
108
+ sx: {
109
+ mt: 3
110
+ }
111
+ })
112
+ ]
113
+ });
114
+ }
115
+ function SectionTitle({ children }) {
116
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_components_index_cjs_namespaceObject.ApTypography, {
117
+ variant: index_cjs_namespaceObject.FontVariantToken.fontSizeMBold,
118
+ component: "h3",
119
+ sx: {
120
+ mb: 2
121
+ },
122
+ children: children
123
+ });
124
+ }
125
+ function ButtonGroup({ children }) {
126
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
127
+ sx: {
128
+ display: 'flex',
129
+ flexWrap: 'wrap',
130
+ gap: 1,
131
+ mb: 1.5
132
+ },
133
+ children: children
134
+ });
135
+ }
136
+ function DemoButton({ primary = false, children, onClick, disabled, title }) {
137
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Button_default(), {
138
+ variant: primary ? 'contained' : 'outlined',
139
+ size: "small",
140
+ onClick: onClick,
141
+ disabled: disabled,
142
+ title: title,
143
+ sx: {
144
+ whiteSpace: 'nowrap'
145
+ },
146
+ children: children
147
+ });
148
+ }
149
+ function DemoInput({ style, type, min, max, value, onChange, placeholder, disabled }) {
150
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TextField_default(), {
151
+ size: "small",
152
+ fullWidth: true,
153
+ type: type,
154
+ value: value,
155
+ placeholder: placeholder,
156
+ disabled: disabled,
157
+ onChange: onChange,
158
+ inputProps: {
159
+ min,
160
+ max
161
+ },
162
+ sx: {
163
+ mb: 1.5
164
+ },
165
+ style: style
166
+ });
167
+ }
168
+ function DemoTextArea({ style, value, onChange, placeholder, disabled }) {
169
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TextField_default(), {
170
+ size: "small",
171
+ fullWidth: true,
172
+ multiline: true,
173
+ minRows: 3,
174
+ value: value,
175
+ placeholder: placeholder,
176
+ disabled: disabled,
177
+ onChange: onChange,
178
+ sx: {
179
+ mb: 1.5
180
+ },
181
+ style: style
182
+ });
183
+ }
184
+ function DemoSelect({ style, children, value, onChange, disabled }) {
185
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TextField_default(), {
186
+ select: true,
187
+ size: "small",
188
+ fullWidth: true,
189
+ value: value,
190
+ disabled: disabled,
191
+ onChange: onChange,
192
+ SelectProps: {
193
+ native: true
194
+ },
195
+ sx: {
196
+ mb: 1.5
197
+ },
198
+ style: style,
199
+ children: children
200
+ });
201
+ }
202
+ function InfoText({ children, style }) {
203
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Typography_default(), {
204
+ component: "p",
205
+ variant: "body2",
206
+ sx: {
207
+ color: 'text.secondary',
208
+ mt: 1
209
+ },
210
+ style: style,
211
+ children: children
212
+ });
213
+ }
214
+ function ChatShowcaseDemo({ theme, instanceName, initialMode = external_components_index_cjs_namespaceObject.AutopilotChatMode.SideBySide, locale = 'en' }) {
215
+ const embeddedContainerRef = (0, external_react_namespaceObject.useRef)(null);
216
+ const [chatService, setChatService] = (0, external_react_namespaceObject.useState)(null);
217
+ const [chatMode, setChatMode] = (0, external_react_namespaceObject.useState)(initialMode);
218
+ const [customMessage, setCustomMessage] = (0, external_react_namespaceObject.useState)('Hello, how can I help you today?');
219
+ const [errorMessage, setErrorMessage] = (0, external_react_namespaceObject.useState)('An error occurred. Please try again.');
220
+ const [streamingText, setStreamingText] = (0, external_react_namespaceObject.useState)('This is a streaming response that will appear word by word...');
221
+ const [loadingMessage, setLoadingMessage] = (0, external_react_namespaceObject.useState)('Thinking...');
222
+ const [waitForMore, setWaitForMore] = (0, external_react_namespaceObject.useState)(false);
223
+ const [autoScroll, setAutoScroll] = (0, external_react_namespaceObject.useState)(true);
224
+ const [isWaiting, setIsWaiting] = (0, external_react_namespaceObject.useState)(false);
225
+ const [isShowLoading, setIsShowLoading] = (0, external_react_namespaceObject.useState)(false);
226
+ const [features, setFeatures] = (0, external_react_namespaceObject.useState)({
227
+ history: true,
228
+ settings: true,
229
+ attachments: true,
230
+ audio: false,
231
+ audioStreaming: false,
232
+ htmlPreview: true,
233
+ headerSeparator: false,
234
+ fullHeight: true,
235
+ resize: true,
236
+ close: true,
237
+ feedback: true,
238
+ model: true,
239
+ agentMode: true,
240
+ sendOnClick: false,
241
+ paginatedMessages: false,
242
+ compactMode: false,
243
+ customScrollTheme: false,
244
+ copy: true,
245
+ attachmentsAsync: false,
246
+ readOnly: false
247
+ });
248
+ const [selectedAgentMode, setSelectedAgentMode] = (0, external_react_namespaceObject.useState)('agent');
249
+ const [selectedModel, setSelectedModel] = (0, external_react_namespaceObject.useState)('gpt-4');
250
+ const [primaryFontToken, setPrimaryFontToken] = (0, external_react_namespaceObject.useState)(index_cjs_namespaceObject.FontVariantToken.fontSizeM);
251
+ const [promptBoxMinRows, setPromptBoxMinRows] = (0, external_react_namespaceObject.useState)(2);
252
+ const [promptBoxMaxRows, setPromptBoxMaxRows] = (0, external_react_namespaceObject.useState)(12);
253
+ const [resourcePaginationEnabled, setResourcePaginationEnabled] = (0, external_react_namespaceObject.useState)(true);
254
+ const [resourcePageSize, setResourcePageSize] = (0, external_react_namespaceObject.useState)(10);
255
+ const createResourceManager = (0, external_react_namespaceObject.useCallback)(()=>{
256
+ const topLevelItems = [
257
+ {
258
+ id: 'variables',
259
+ type: 'category',
260
+ displayName: 'Variables',
261
+ icon: 'data_object',
262
+ hasNestedResources: true
263
+ },
264
+ {
265
+ id: 'files',
266
+ type: 'category',
267
+ displayName: 'This is an intentionally very very long category name',
268
+ icon: 'folder',
269
+ hasNestedResources: true
270
+ },
271
+ {
272
+ id: 'current-user',
273
+ type: 'context',
274
+ displayName: 'This is an intentionally very very long resource name',
275
+ icon: 'person',
276
+ tooltip: 'The currently logged in user context',
277
+ hasNestedResources: false
278
+ },
279
+ {
280
+ id: 'current-date',
281
+ type: 'context',
282
+ displayName: 'Current Date',
283
+ icon: 'calendar_today',
284
+ tooltip: "Today's date in ISO format",
285
+ hasNestedResources: false
286
+ }
287
+ ];
288
+ const variableIcons = [
289
+ 'text_fields',
290
+ 'mail',
291
+ 'numbers',
292
+ 'toggle_on',
293
+ 'settings',
294
+ 'person',
295
+ 'calendar_today',
296
+ 'list',
297
+ 'data_object',
298
+ 'code'
299
+ ];
300
+ const variableItems = Array.from({
301
+ length: 50
302
+ }, (_, i)=>({
303
+ id: `var-${i}`,
304
+ type: 'variable',
305
+ displayName: `variable_${i.toString().padStart(2, '0')}`,
306
+ icon: variableIcons[i % variableIcons.length],
307
+ tooltip: `Variable ${i} - This is a sample variable for testing pagination`
308
+ }));
309
+ const fileIcons = [
310
+ "description",
311
+ 'table_chart',
312
+ 'picture_as_pdf',
313
+ 'image',
314
+ 'code',
315
+ 'folder'
316
+ ];
317
+ const fileExtensions = [
318
+ '.json',
319
+ '.csv',
320
+ '.pdf',
321
+ '.png',
322
+ '.ts',
323
+ '.txt',
324
+ '.xml',
325
+ '.yaml'
326
+ ];
327
+ const fileItems = Array.from({
328
+ length: 30
329
+ }, (_, i)=>({
330
+ id: `file-${i}`,
331
+ type: 'file',
332
+ displayName: `document_${i.toString().padStart(2, '0')}${fileExtensions[i % fileExtensions.length]}`,
333
+ icon: fileIcons[i % fileIcons.length],
334
+ tooltip: `File ${i} - Sample file for testing pagination`
335
+ }));
336
+ const paginate = (items, skip, pageSize, paginationEnabled)=>{
337
+ if (!paginationEnabled) return {
338
+ paginatedItems: items,
339
+ done: true
340
+ };
341
+ const paginatedItems = items.slice(skip, skip + pageSize);
342
+ const done = skip + pageSize >= items.length;
343
+ return {
344
+ paginatedItems,
345
+ done
346
+ };
347
+ };
348
+ return {
349
+ getTopLevelResources: ()=>topLevelItems,
350
+ getNestedResources: async (resourceId, options)=>{
351
+ await new Promise((resolve)=>setTimeout(resolve, 300));
352
+ let items = [];
353
+ if ('variables' === resourceId) items = variableItems;
354
+ else if ('files' === resourceId) items = fileItems;
355
+ if (options?.searchText) {
356
+ const searchLower = options.searchText.toLowerCase();
357
+ items = items.filter((item)=>item.displayName.toLowerCase().includes(searchLower));
358
+ }
359
+ const skip = options?.skip ?? 0;
360
+ const { paginatedItems, done } = paginate(items, skip, resourcePageSize, resourcePaginationEnabled);
361
+ console.log(`[ResourceManager] getNestedResources: resourceId=${resourceId}, skip=${skip}, returned=${paginatedItems.length}, done=${done}`);
362
+ return {
363
+ items: paginatedItems,
364
+ done
365
+ };
366
+ },
367
+ globalSearch: async (options)=>{
368
+ await new Promise((resolve)=>setTimeout(resolve, 300));
369
+ let allItems = [
370
+ ...variableItems,
371
+ ...fileItems
372
+ ];
373
+ const skip = options.skip ?? 0;
374
+ if (options.searchText) {
375
+ const searchLower = options.searchText.toLowerCase();
376
+ if (0 === skip) {
377
+ const matchingTopLevel = topLevelItems.filter((item)=>item.displayName.toLowerCase().includes(searchLower));
378
+ allItems = [
379
+ ...matchingTopLevel,
380
+ ...allItems
381
+ ];
382
+ }
383
+ allItems = allItems.filter((item)=>item.displayName.toLowerCase().includes(searchLower));
384
+ }
385
+ const { paginatedItems, done } = paginate(allItems, skip, resourcePageSize, resourcePaginationEnabled);
386
+ console.log(`[ResourceManager] globalSearch: searchText="${options.searchText ?? ''}", skip=${skip}, returned=${paginatedItems.length}, done=${done}`);
387
+ return {
388
+ items: paginatedItems,
389
+ done
390
+ };
391
+ },
392
+ onResourceSelected: (item)=>{
393
+ console.log('Resource selected:', item.displayName);
394
+ }
395
+ };
396
+ }, [
397
+ resourcePaginationEnabled,
398
+ resourcePageSize
399
+ ]);
400
+ const createSettingsRenderer = (0, external_react_namespaceObject.useCallback)(()=>(container)=>{
401
+ const settingsDiv = document.createElement('div');
402
+ settingsDiv.style.padding = '24px';
403
+ settingsDiv.style.color = 'var(--color-foreground)';
404
+ settingsDiv.innerHTML = `
405
+ <h2 style="margin: 0 0 16px 0; font-size: 20px; font-weight: 600;">Chat Settings</h2>
406
+
407
+ <div style="margin-bottom: 24px;">
408
+ <h3 style="margin: 0 0 12px 0; font-size: 16px; font-weight: 500;">Appearance</h3>
409
+ <label style="display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 8px;">
410
+ <input type="checkbox" id="darkMode" style="cursor: pointer;" />
411
+ <span>Dark Mode</span>
412
+ </label>
413
+ <label style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
414
+ <input type="checkbox" id="compactMode" checked style="cursor: pointer;" />
415
+ <span>Compact Mode</span>
416
+ </label>
417
+ </div>
418
+
419
+ <div style="margin-bottom: 24px;">
420
+ <h3 style="margin: 0 0 12px 0; font-size: 16px; font-weight: 500;">Behavior</h3>
421
+ <label style="display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 8px;">
422
+ <input type="checkbox" id="autoScroll" checked style="cursor: pointer;" />
423
+ <span>Auto-scroll to new messages</span>
424
+ </label>
425
+ <label style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
426
+ <input type="checkbox" id="soundEnabled" style="cursor: pointer;" />
427
+ <span>Enable sound notifications</span>
428
+ </label>
429
+ </div>
430
+
431
+ <div style="margin-bottom: 24px;">
432
+ <h3 style="margin: 0 0 12px 0; font-size: 16px; font-weight: 500;">Advanced</h3>
433
+ <label style="display: block; margin-bottom: 8px;">
434
+ <span style="display: block; margin-bottom: 4px;">Max Messages</span>
435
+ <input type="number" id="maxMessages" value="100" min="10" max="500"
436
+ style="padding: 8px; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-background); color: var(--color-foreground); width: 100px;" />
437
+ </label>
438
+ <label style="display: block;">
439
+ <span style="display: block; margin-bottom: 4px;">Response Delay (ms)</span>
440
+ <input type="number" id="responseDelay" value="0" min="0" max="5000" step="100"
441
+ style="padding: 8px; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-background); color: var(--color-foreground); width: 100px;" />
442
+ </label>
443
+ </div>
444
+
445
+ <div style="display: flex; gap: 12px;">
446
+ <button id="saveSettings" style="padding: 8px 16px; background: var(--color-primary); color: var(--color-foreground-on-accent); border: none; border-radius: 4px; cursor: pointer; font-weight: 500;">
447
+ Save Settings
448
+ </button>
449
+ <button id="resetSettings" style="padding: 8px 16px; background: transparent; color: var(--color-foreground); border: 1px solid var(--color-border); border-radius: 4px; cursor: pointer;">
450
+ Reset to Defaults
451
+ </button>
452
+ </div>
453
+ `;
454
+ const darkModeCheckbox = settingsDiv.querySelector('#darkMode');
455
+ darkModeCheckbox?.addEventListener('change', (e)=>{
456
+ console.log('Dark mode:', e.target.checked);
457
+ });
458
+ const saveButton = settingsDiv.querySelector('#saveSettings');
459
+ saveButton?.addEventListener('click', ()=>{
460
+ console.log('Settings saved:', {
461
+ darkMode: settingsDiv.querySelector('#darkMode').checked,
462
+ compactMode: settingsDiv.querySelector('#compactMode').checked,
463
+ autoScroll: settingsDiv.querySelector('#autoScroll').checked,
464
+ soundEnabled: settingsDiv.querySelector('#soundEnabled').checked,
465
+ maxMessages: settingsDiv.querySelector('#maxMessages').value,
466
+ responseDelay: settingsDiv.querySelector('#responseDelay').value
467
+ });
468
+ console.log('Settings saved successfully!');
469
+ });
470
+ const resetButton = settingsDiv.querySelector('#resetSettings');
471
+ resetButton?.addEventListener('click', ()=>{
472
+ settingsDiv.querySelector('#darkMode').checked = false;
473
+ settingsDiv.querySelector('#compactMode').checked = true;
474
+ settingsDiv.querySelector('#autoScroll').checked = true;
475
+ settingsDiv.querySelector('#soundEnabled').checked = false;
476
+ settingsDiv.querySelector('#maxMessages').value = '100';
477
+ settingsDiv.querySelector('#responseDelay').value = '0';
478
+ console.log('Settings reset to defaults');
479
+ });
480
+ container.appendChild(settingsDiv);
481
+ }, []);
482
+ (0, external_react_namespaceObject.useEffect)(()=>{
483
+ const service = external_components_index_cjs_namespaceObject.AutopilotChatService.Instantiate({
484
+ instanceName,
485
+ config: {
486
+ mode: initialMode,
487
+ readOnly: features.readOnly,
488
+ disabledFeatures: {
489
+ history: !features.history,
490
+ settings: !features.settings,
491
+ attachments: !features.attachments,
492
+ audio: !features.audio,
493
+ audioStreaming: !features.audioStreaming,
494
+ htmlPreview: !features.htmlPreview,
495
+ headerSeparator: !features.headerSeparator,
496
+ fullHeight: !features.fullHeight,
497
+ resize: !features.resize,
498
+ close: !features.close,
499
+ feedback: !features.feedback,
500
+ copy: !features.copy
501
+ },
502
+ settingsRenderer: createSettingsRenderer()
503
+ }
504
+ });
505
+ setChatService(service);
506
+ const unsubscribes = [];
507
+ service.setModels([
508
+ {
509
+ id: 'gpt-4',
510
+ name: 'GPT-4',
511
+ description: 'Most capable model'
512
+ },
513
+ {
514
+ id: 'gpt-3.5',
515
+ name: 'GPT-3.5 Turbo',
516
+ description: 'Fast and efficient'
517
+ },
518
+ {
519
+ id: 'claude-3',
520
+ name: 'Claude 3',
521
+ description: 'Anthropic model'
522
+ }
523
+ ]);
524
+ service.setSelectedModel('gpt-4');
525
+ service.setAgentModes([
526
+ {
527
+ id: 'agent',
528
+ name: 'Agent',
529
+ description: 'AI-powered autonomous agent mode',
530
+ icon: 'smart_toy'
531
+ },
532
+ {
533
+ id: 'plan',
534
+ name: 'Plan',
535
+ description: 'Create and review execution plans',
536
+ icon: 'edit_note'
537
+ },
538
+ {
539
+ id: 'attended',
540
+ name: 'Attended',
541
+ description: 'Human assisted execution',
542
+ icon: 'play_arrow'
543
+ }
544
+ ]);
545
+ service.setAgentMode('agent');
546
+ service.setCustomHeaderActions([
547
+ {
548
+ id: 'export',
549
+ name: 'Export Chat',
550
+ icon: 'download'
551
+ },
552
+ {
553
+ id: 'share',
554
+ name: 'Share',
555
+ icon: 'share'
556
+ }
557
+ ]);
558
+ service.setSuggestions([
559
+ {
560
+ label: 'What can you do?',
561
+ prompt: 'What can you do?'
562
+ },
563
+ {
564
+ label: 'Show me an example',
565
+ prompt: 'Show me an example'
566
+ },
567
+ {
568
+ label: 'Help me with code',
569
+ prompt: 'Help me with code'
570
+ }
571
+ ]);
572
+ service.setDefaultLoadingMessages([
573
+ 'Thinking...',
574
+ 'Processing your request...',
575
+ 'Analyzing...',
576
+ 'Working on it...'
577
+ ]);
578
+ service.setResourceManager(createResourceManager());
579
+ unsubscribes.push(service.on(external_components_index_cjs_namespaceObject.AutopilotChatEvent.Request, (data)=>{
580
+ console.log('Request sent:', data);
581
+ }));
582
+ unsubscribes.push(service.on(external_components_index_cjs_namespaceObject.AutopilotChatEvent.ModeChange, (mode)=>{
583
+ console.log('Mode changed:', mode);
584
+ }));
585
+ unsubscribes.push(service.on(external_components_index_cjs_namespaceObject.AutopilotChatEvent.SetSelectedModel, (model)=>{
586
+ console.log('Model changed:', model);
587
+ setSelectedModel(model.id || model);
588
+ }));
589
+ unsubscribes.push(service.on(external_components_index_cjs_namespaceObject.AutopilotChatEvent.SetSelectedAgentMode, (mode)=>{
590
+ console.log('Agent mode changed:', mode);
591
+ setSelectedAgentMode(mode.id);
592
+ }));
593
+ unsubscribes.push(service.on(external_components_index_cjs_namespaceObject.AutopilotChatEvent.ModeChange, (mode)=>{
594
+ console.log('Chat mode changed:', mode);
595
+ setChatMode(mode);
596
+ }));
597
+ unsubscribes.push(service.on('feedback', (data)=>{
598
+ const { isPositive, message } = data;
599
+ console.log(`Feedback: ${isPositive ? 'Positive' : 'Negative'}`, message);
600
+ }));
601
+ unsubscribes.push(service.on('copy', (message)=>{
602
+ console.log('Copy event:', message);
603
+ }));
604
+ unsubscribes.push(service.on('attachments', (attachments)=>{
605
+ console.log('Attachments:', attachments);
606
+ }));
607
+ unsubscribes.push(service.on('stopResponse', ()=>{
608
+ console.log('Stop response event');
609
+ }));
610
+ const fakeSttPhrases = [
611
+ 'How do I schedule an unattended robot to run every weekday at 9 AM',
612
+ 'Show me the last ten failed jobs and group them by process name',
613
+ 'Can you walk me through setting up Document Understanding for invoices'
614
+ ];
615
+ let sttPhraseIndex = 0;
616
+ let sttDictationInterval = null;
617
+ unsubscribes.push(service.on(external_components_index_cjs_namespaceObject.AutopilotChatEvent.SpeechToTextToggle, (isActive)=>{
618
+ console.log('[STT] toggle:', isActive);
619
+ if (isActive) {
620
+ const phrase = fakeSttPhrases[sttPhraseIndex % fakeSttPhrases.length] ?? '';
621
+ sttPhraseIndex++;
622
+ const words = phrase.split(' ');
623
+ let wordIndex = 0;
624
+ let transcript = '';
625
+ sttDictationInterval = setInterval(()=>{
626
+ if (wordIndex < words.length) {
627
+ transcript += (0 === wordIndex ? '' : ' ') + words[wordIndex];
628
+ service.setPrompt(transcript);
629
+ wordIndex++;
630
+ } else if (sttDictationInterval) {
631
+ clearInterval(sttDictationInterval);
632
+ sttDictationInterval = null;
633
+ }
634
+ }, 150);
635
+ } else if (sttDictationInterval) {
636
+ clearInterval(sttDictationInterval);
637
+ sttDictationInterval = null;
638
+ }
639
+ }));
640
+ unsubscribes.push(()=>{
641
+ if (sttDictationInterval) {
642
+ clearInterval(sttDictationInterval);
643
+ sttDictationInterval = null;
644
+ }
645
+ });
646
+ const fakeVoiceUserTurns = [
647
+ 'How do I debug a workflow in UiPath Studio?',
648
+ 'Can you suggest a retry strategy for flaky selectors?',
649
+ 'What is the difference between Attended and Unattended automations?'
650
+ ];
651
+ const fakeVoiceAssistantReplies = [
652
+ 'Start by enabling **Debug mode** in UiPath Studio and setting breakpoints on the activities you want to inspect. Use **Step Into** to walk through each action, and open the **Locals** panel to watch variables change.',
653
+ 'Wrap the click/type activity in a **Retry Scope** with 3-5 attempts and a short delay (500ms-2s). Pair it with a **Check App State** condition so the retry fires only when the expected element is missing.',
654
+ "**Attended** automations run on a user's machine alongside them. **Unattended** automations run on dedicated VMs without any user present; they're scheduled or queue-driven and scale across a robot fleet."
655
+ ];
656
+ let voiceTurnIndex = 0;
657
+ let voicePendingTimeouts = [];
658
+ let voicePendingInterval = null;
659
+ let voiceActiveStreamId = null;
660
+ const clearVoicePending = ()=>{
661
+ for (const id of voicePendingTimeouts)clearTimeout(id);
662
+ voicePendingTimeouts = [];
663
+ if (voicePendingInterval) {
664
+ clearInterval(voicePendingInterval);
665
+ voicePendingInterval = null;
666
+ }
667
+ };
668
+ unsubscribes.push(service.on(external_components_index_cjs_namespaceObject.AutopilotChatEvent.InputStream, (event)=>{
669
+ const ev = event;
670
+ if (ev.activityStart) {
671
+ console.log('[voice] activityStart', ev.activityStart);
672
+ const userContent = fakeVoiceUserTurns[voiceTurnIndex % fakeVoiceUserTurns.length] ?? '';
673
+ const assistantContent = fakeVoiceAssistantReplies[voiceTurnIndex % fakeVoiceAssistantReplies.length] ?? '';
674
+ voiceTurnIndex++;
675
+ voiceActiveStreamId = `voice-stream-${voiceTurnIndex}`;
676
+ voicePendingTimeouts.push(setTimeout(()=>{
677
+ service.sendRequest({
678
+ content: userContent
679
+ });
680
+ voicePendingTimeouts.push(setTimeout(()=>{
681
+ const words = assistantContent.split(' ');
682
+ const streamId = voiceActiveStreamId ?? void 0;
683
+ let wordIndex = 0;
684
+ voicePendingInterval = setInterval(()=>{
685
+ if (wordIndex < words.length) {
686
+ service.sendResponse({
687
+ id: streamId,
688
+ content: (words[wordIndex] ?? '') + (wordIndex < words.length - 1 ? ' ' : ''),
689
+ stream: true,
690
+ created_at: new Date().toISOString(),
691
+ widget: 'apollo-markdown-renderer'
692
+ });
693
+ wordIndex++;
694
+ } else {
695
+ if (voicePendingInterval) {
696
+ clearInterval(voicePendingInterval);
697
+ voicePendingInterval = null;
698
+ }
699
+ service.sendResponse({
700
+ id: streamId,
701
+ content: '',
702
+ stream: true,
703
+ done: true,
704
+ created_at: new Date().toISOString(),
705
+ widget: 'apollo-markdown-renderer'
706
+ });
707
+ }
708
+ }, 80);
709
+ }, 400));
710
+ }, 600));
711
+ }
712
+ if (ev.mediaChunks) console.log('[voice] mediaChunks', ev.mediaChunks.length);
713
+ if (ev.activityEnd) {
714
+ console.log('[voice] activityEnd', ev.activityEnd);
715
+ const wasStreaming = null !== voicePendingInterval;
716
+ clearVoicePending();
717
+ if (wasStreaming && voiceActiveStreamId) service.sendResponse({
718
+ id: voiceActiveStreamId,
719
+ content: '',
720
+ stream: true,
721
+ done: true,
722
+ created_at: new Date().toISOString(),
723
+ widget: 'apollo-markdown-renderer'
724
+ });
725
+ voiceActiveStreamId = null;
726
+ }
727
+ }));
728
+ unsubscribes.push(()=>clearVoicePending());
729
+ unsubscribes.push(service.on('customHeaderActionClicked', (action)=>{
730
+ const actionData = action;
731
+ console.log('Custom header action clicked:', actionData);
732
+ let responseContent = '';
733
+ switch(actionData.id){
734
+ case 'export-pdf':
735
+ responseContent = '📄 **Exporting as PDF...**\n\nYour conversation has been exported to a PDF file.';
736
+ break;
737
+ case 'export-docx':
738
+ responseContent = '📝 **Exporting as DOCX...**\n\nYour conversation has been exported to a Word document.';
739
+ break;
740
+ case 'export-json':
741
+ responseContent = '💾 **Exporting as JSON...**\n\nYour conversation has been exported as JSON data.';
742
+ break;
743
+ case 'export-txt':
744
+ responseContent = '📋 **Exporting as Text...**\n\nYour conversation has been exported as plain text.';
745
+ break;
746
+ case 'share':
747
+ responseContent = '🔗 **Share Conversation**\n\nA shareable link has been generated:\n`https://example.com/chat/abc123`';
748
+ break;
749
+ case 'translate-es':
750
+ responseContent = '🇪🇸 **Traduciendo al español...**\n\nSu conversación ha sido traducida al español.';
751
+ break;
752
+ case 'translate-fr':
753
+ responseContent = '🇫🇷 **Traduction en français...**\n\nVotre conversation a été traduite en français.';
754
+ break;
755
+ case 'translate-de':
756
+ responseContent = '🇩🇪 **Übersetzung ins Deutsche...**\n\nIhre Unterhaltung wurde ins Deutsche übersetzt.';
757
+ break;
758
+ case 'translate-ja':
759
+ responseContent = '🇯🇵 **日本語に翻訳中...**\n\n会話が日本語に翻訳されました。';
760
+ break;
761
+ case 'translate-zh':
762
+ responseContent = '🇨🇳 **正在翻译成中文...**\n\n您的对话已翻译成中文。';
763
+ break;
764
+ case 'print':
765
+ responseContent = '🖨️ **Print Conversation**\n\nPreparing conversation for printing...';
766
+ break;
767
+ default:
768
+ responseContent = `✅ Action triggered: **${actionData.name}** (ID: ${actionData.id})`;
769
+ }
770
+ service.sendResponse({
771
+ content: responseContent,
772
+ groupId: `custom-action-${actionData.id}`,
773
+ created_at: '22-10-2025',
774
+ widget: 'apollo-markdown-renderer'
775
+ });
776
+ }));
777
+ return ()=>{
778
+ for (const unsubscribe of unsubscribes)unsubscribe();
779
+ service.close();
780
+ };
781
+ }, [
782
+ instanceName,
783
+ initialMode,
784
+ createResourceManager,
785
+ createSettingsRenderer,
786
+ features.attachments,
787
+ features.audio,
788
+ features.audioStreaming,
789
+ features.close,
790
+ features.copy,
791
+ features.feedback,
792
+ features.fullHeight,
793
+ features.headerSeparator,
794
+ features.history,
795
+ features.htmlPreview,
796
+ features.resize,
797
+ features.settings,
798
+ features.readOnly
799
+ ]);
800
+ (0, external_react_namespaceObject.useEffect)(()=>{
801
+ if (chatService && chatMode === external_components_index_cjs_namespaceObject.AutopilotChatMode.Embedded && embeddedContainerRef.current) chatService.patchConfig({
802
+ mode: external_components_index_cjs_namespaceObject.AutopilotChatMode.Embedded,
803
+ embeddedContainer: embeddedContainerRef.current
804
+ });
805
+ }, [
806
+ chatService,
807
+ chatMode
808
+ ]);
809
+ (0, external_react_namespaceObject.useEffect)(()=>{
810
+ if (chatService) {
811
+ chatService.initialize({
812
+ mode: chatMode,
813
+ readOnly: features.readOnly,
814
+ disabledFeatures: {
815
+ history: !features.history,
816
+ settings: !features.settings,
817
+ attachments: !features.attachments,
818
+ audio: !features.audio,
819
+ audioStreaming: !features.audioStreaming,
820
+ htmlPreview: !features.htmlPreview,
821
+ headerSeparator: !features.headerSeparator,
822
+ fullHeight: !features.fullHeight,
823
+ resize: !features.resize,
824
+ close: !features.close,
825
+ feedback: !features.feedback,
826
+ copy: !features.copy
827
+ },
828
+ settingsRenderer: createSettingsRenderer(),
829
+ ...chatMode === external_components_index_cjs_namespaceObject.AutopilotChatMode.Embedded && embeddedContainerRef.current && {
830
+ embeddedContainer: embeddedContainerRef.current
831
+ }
832
+ });
833
+ if (features.model) {
834
+ chatService.setModels([
835
+ {
836
+ id: 'gpt-4',
837
+ name: 'GPT-4',
838
+ description: 'Most capable model'
839
+ },
840
+ {
841
+ id: 'gpt-3.5',
842
+ name: 'GPT-3.5 Turbo',
843
+ description: 'Fast and efficient'
844
+ },
845
+ {
846
+ id: 'claude-3',
847
+ name: 'Claude 3',
848
+ description: 'Anthropic model'
849
+ }
850
+ ]);
851
+ chatService.setSelectedModel(selectedModel);
852
+ } else chatService.setModels([]);
853
+ if (features.agentMode) {
854
+ chatService.setAgentModes([
855
+ {
856
+ id: 'agent',
857
+ name: 'Agent',
858
+ description: 'AI-powered autonomous agent mode',
859
+ icon: 'smart_toy'
860
+ },
861
+ {
862
+ id: 'plan',
863
+ name: 'Plan',
864
+ description: 'Create and review execution plans',
865
+ icon: 'edit_note'
866
+ },
867
+ {
868
+ id: 'attended',
869
+ name: 'Attended',
870
+ description: 'Human assisted execution',
871
+ icon: 'play_arrow'
872
+ }
873
+ ]);
874
+ chatService.setAgentMode(selectedAgentMode);
875
+ } else chatService.setAgentModes([]);
876
+ chatService.patchConfig({
877
+ paginatedMessages: features.paginatedMessages,
878
+ paginatedResources: resourcePaginationEnabled,
879
+ spacing: {
880
+ compactMode: features.compactMode,
881
+ ...features.compactMode ? {} : {
882
+ primaryFontToken,
883
+ promptBox: {
884
+ minRows: promptBoxMinRows,
885
+ maxRows: promptBoxMaxRows
886
+ }
887
+ }
888
+ },
889
+ theming: {
890
+ scrollBar: features.customScrollTheme ? {
891
+ scrollThumbColor: '#000000',
892
+ scrollSize: '16px',
893
+ scrollHoverColor: '#888888',
894
+ scrollBorderRadius: '8px'
895
+ } : void 0
896
+ }
897
+ });
898
+ if (features.attachmentsAsync) chatService.on('setAttachments', (attachments)=>{
899
+ const attachmentsData = attachments;
900
+ chatService.setAttachmentsLoading([
901
+ ...attachmentsData.added.map((attachment)=>({
902
+ ...attachment,
903
+ loading: true
904
+ }))
905
+ ]);
906
+ setTimeout(()=>{
907
+ chatService.setAttachmentsLoading([
908
+ ...attachmentsData.added.map((attachment)=>({
909
+ ...attachment,
910
+ loading: false
911
+ }))
912
+ ]);
913
+ }, 2000);
914
+ });
915
+ else chatService.setAttachmentsLoading([]);
916
+ }
917
+ }, [
918
+ features,
919
+ chatService,
920
+ selectedModel,
921
+ selectedAgentMode,
922
+ createSettingsRenderer,
923
+ chatMode,
924
+ primaryFontToken,
925
+ promptBoxMinRows,
926
+ promptBoxMaxRows,
927
+ resourcePaginationEnabled
928
+ ]);
929
+ const openChat = ()=>chatService?.open();
930
+ const closeChat = ()=>chatService?.close();
931
+ const setFullScreen = ()=>{
932
+ chatService?.setChatMode(external_components_index_cjs_namespaceObject.AutopilotChatMode.FullScreen);
933
+ setChatMode(external_components_index_cjs_namespaceObject.AutopilotChatMode.FullScreen);
934
+ };
935
+ const setSideBySide = ()=>{
936
+ chatService?.setChatMode(external_components_index_cjs_namespaceObject.AutopilotChatMode.SideBySide);
937
+ setChatMode(external_components_index_cjs_namespaceObject.AutopilotChatMode.SideBySide);
938
+ };
939
+ const setEmbedded = ()=>{
940
+ setChatMode(external_components_index_cjs_namespaceObject.AutopilotChatMode.Embedded);
941
+ chatService?.setChatMode(external_components_index_cjs_namespaceObject.AutopilotChatMode.Embedded);
942
+ };
943
+ const sendSimpleRequest = ()=>{
944
+ chatService?.sendRequest({
945
+ content: customMessage
946
+ });
947
+ };
948
+ const sendSimpleResponse = ()=>{
949
+ chatService?.sendResponse({
950
+ content: customMessage,
951
+ created_at: '22-10-2025',
952
+ widget: 'apollo-markdown-renderer',
953
+ shouldWaitForMoreMessages: waitForMore
954
+ });
955
+ };
956
+ const sendResponseWithActions = ()=>{
957
+ chatService?.sendResponse({
958
+ content: 'Here is a response with custom actions. Try the buttons below!',
959
+ created_at: '22-10-2025',
960
+ widget: 'apollo-markdown-renderer',
961
+ actions: [
962
+ {
963
+ name: 'copy-action',
964
+ label: 'Copy to Clipboard',
965
+ icon: 'content_copy',
966
+ eventName: 'copy-custom'
967
+ },
968
+ {
969
+ name: 'regenerate-action',
970
+ label: 'Regenerate',
971
+ icon: 'refresh',
972
+ eventName: 'regenerate-custom'
973
+ }
974
+ ]
975
+ });
976
+ chatService?.on('copy-custom', ()=>{
977
+ navigator.clipboard.writeText('Response copied!');
978
+ console.log('Copied to clipboard!');
979
+ });
980
+ chatService?.on('regenerate-custom', ()=>{
981
+ console.log('Regenerating response...');
982
+ });
983
+ };
984
+ const sendResponseWithCitations = ()=>{
985
+ chatService?.sendResponse({
986
+ content: 'According to research, the sky is blue due to Rayleigh scattering. See references below for more information.',
987
+ widget: 'default',
988
+ contentParts: [
989
+ {
990
+ text: 'According to research, the sky is blue due to Rayleigh scattering. ',
991
+ citations: [
992
+ {
993
+ id: 1,
994
+ title: 'Why is the Sky Blue?',
995
+ url: 'https://example.com/sky'
996
+ }
997
+ ]
998
+ },
999
+ {
1000
+ text: 'See references below for more information.',
1001
+ citations: [
1002
+ {
1003
+ id: 2,
1004
+ title: 'Atmospheric Science',
1005
+ url: 'https://example.com/atmosphere'
1006
+ }
1007
+ ]
1008
+ }
1009
+ ]
1010
+ });
1011
+ };
1012
+ const sendStreamingResponse = ()=>{
1013
+ chatService?.sendResponse({
1014
+ content: streamingText,
1015
+ fakeStream: true,
1016
+ shouldWaitForMoreMessages: waitForMore
1017
+ });
1018
+ };
1019
+ const sendCodeBlock = ()=>{
1020
+ const codeContent = `\`\`\`typescript
1021
+ // This is a long comment line that should wrap properly when displayed in the code block to test the wrapping functionality
1022
+ interface UserProfile {
1023
+ id: number;
1024
+ username: string;
1025
+ email: string;
1026
+ firstName: string;
1027
+ lastName: string;
1028
+ createdAt: Date;
1029
+ updatedAt: Date;
1030
+ preferences: { theme: 'light' | 'dark'; language: string; notifications: boolean };
1031
+ }
1032
+
1033
+ function processUserData(user: UserProfile, additionalMetadata: Record<string, unknown>): string {
1034
+ const fullName = \`\${user.firstName} \${user.lastName}\`;
1035
+ const metadataString = JSON.stringify(additionalMetadata, null, 2);
1036
+
1037
+ return \`User: \${fullName} (\${user.email}) - Created: \${user.createdAt.toISOString()} - Metadata: \${metadataString}\`;
1038
+ }
1039
+
1040
+ const exampleUser: UserProfile = {
1041
+ id: 12345,
1042
+ username: 'john_doe_with_a_very_long_username_that_should_test_wrapping',
1043
+ email: 'john.doe.with.a.very.long.email.address@example-domain-name.com',
1044
+ firstName: 'John',
1045
+ lastName: 'Doe',
1046
+ createdAt: new Date(),
1047
+ updatedAt: new Date(),
1048
+ preferences: { theme: 'dark', language: 'en-US', notifications: true }
1049
+ };
1050
+
1051
+ console.log(processUserData(exampleUser, { source: 'web', ipAddress: '192.168.1.1', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' }));
1052
+ \`\`\``;
1053
+ chatService?.sendResponse({
1054
+ content: `Here's a TypeScript example with long lines to test wrapping:\n\n${codeContent}`,
1055
+ widget: 'default'
1056
+ });
1057
+ };
1058
+ const sendHTMLPreview = ()=>{
1059
+ const htmlContent = `\`\`\`html
1060
+ <!DOCTYPE html>
1061
+ <html>
1062
+ <head>
1063
+ <title>Hello World</title>
1064
+ <style>
1065
+ body { font-family: Arial; text-align: center; padding: 50px; }
1066
+ h1 { color: #fa4616; }
1067
+ </style>
1068
+ </head>
1069
+ <body>
1070
+ <h1>Hello, World!</h1>
1071
+ <p>This is an HTML preview example.</p>
1072
+ </body>
1073
+ </html>
1074
+ \`\`\``;
1075
+ chatService?.sendResponse({
1076
+ content: `Here's an HTML example with live preview:\n\n${htmlContent}`,
1077
+ widget: 'default'
1078
+ });
1079
+ };
1080
+ const showLoading = ()=>{
1081
+ chatService?.setLoadingMessage(loadingMessage);
1082
+ };
1083
+ const hideLoading = ()=>{
1084
+ chatService?.setLoadingMessage('');
1085
+ };
1086
+ const showError = ()=>{
1087
+ chatService?.setError(errorMessage);
1088
+ };
1089
+ const showWarning = ()=>{
1090
+ chatService?.setError('This is a warning message.');
1091
+ };
1092
+ const clearErrors = ()=>{
1093
+ chatService?.clearError();
1094
+ };
1095
+ const toggleHistory = ()=>{
1096
+ chatService?.toggleHistory();
1097
+ };
1098
+ const addHistoryItems = ()=>{
1099
+ chatService?.setHistory([
1100
+ {
1101
+ id: '1',
1102
+ name: 'Previous Conversation 1',
1103
+ timestamp: new Date(Date.now() - 86400000).toISOString()
1104
+ },
1105
+ {
1106
+ id: '2',
1107
+ name: 'Previous Conversation 2',
1108
+ timestamp: new Date(Date.now() - 172800000).toISOString()
1109
+ },
1110
+ {
1111
+ id: '3',
1112
+ name: 'Previous Conversation 3',
1113
+ timestamp: new Date(Date.now() - 259200000).toISOString()
1114
+ }
1115
+ ]);
1116
+ };
1117
+ const clearChat = ()=>{
1118
+ chatService?.newChat();
1119
+ };
1120
+ const toggleFeature = (feature)=>{
1121
+ setFeatures((prev)=>({
1122
+ ...prev,
1123
+ [feature]: !prev[feature]
1124
+ }));
1125
+ };
1126
+ const setPrompt = ()=>{
1127
+ chatService?.setPrompt('I need something to be done');
1128
+ };
1129
+ const resetPrompt = ()=>{
1130
+ chatService?.setPrompt('');
1131
+ };
1132
+ const stopResponse = ()=>{
1133
+ chatService?.stopResponse();
1134
+ };
1135
+ const toggleAutoScroll = ()=>{
1136
+ const newValue = !autoScroll;
1137
+ setAutoScroll(newValue);
1138
+ chatService?.toggleAutoScroll(newValue);
1139
+ };
1140
+ const setAllowedAttachments = ()=>{
1141
+ chatService?.setAllowedAttachments({
1142
+ types: {
1143
+ 'text/csv': [
1144
+ '.csv'
1145
+ ]
1146
+ },
1147
+ maxSize: 1048576,
1148
+ multiple: false
1149
+ });
1150
+ console.log('Allowed attachments set to: CSV files only, max 1MB');
1151
+ };
1152
+ const setFirstRunExperience = ()=>{
1153
+ chatService?.setFirstRunExperience({
1154
+ title: 'Welcome to UiPath Autopilot',
1155
+ description: "I'm here to help you build, understand, and troubleshoot your automation projects.",
1156
+ suggestions: [
1157
+ {
1158
+ label: 'New process',
1159
+ prompt: 'Can you provide a detailed step-by-step guide on how to create a new automation process?'
1160
+ },
1161
+ {
1162
+ label: 'Debug workflow',
1163
+ prompt: "I'm having trouble with my workflow execution. Can you explain debugging techniques?"
1164
+ },
1165
+ {
1166
+ label: 'Studio updates',
1167
+ prompt: 'What are the latest features in UiPath Studio?'
1168
+ }
1169
+ ]
1170
+ });
1171
+ };
1172
+ const setConversation = ()=>{
1173
+ chatService?.setConversation([
1174
+ {
1175
+ id: '1',
1176
+ role: external_components_index_cjs_namespaceObject.AutopilotChatRole.User,
1177
+ content: 'How do I create a workflow that extracts data from invoices?',
1178
+ created_at: '22-10-2022',
1179
+ widget: ''
1180
+ },
1181
+ {
1182
+ id: '2',
1183
+ role: external_components_index_cjs_namespaceObject.AutopilotChatRole.Assistant,
1184
+ content: 'To extract data from invoices, you can use UiPath Document Understanding. Here\'s a step-by-step approach:\n\n1. Install the Document Understanding package\n2. Create a new workflow and add the "Digitize Document" activity\n3. Configure it to use ML skills\n4. Use the "Data Extraction" activity\n5. Validate the extracted data',
1185
+ created_at: '23-10-2022',
1186
+ widget: ''
1187
+ }
1188
+ ]);
1189
+ };
1190
+ const setSuggestions = ()=>{
1191
+ chatService?.setSuggestions([
1192
+ {
1193
+ label: 'What can you do?',
1194
+ prompt: 'What can you do?'
1195
+ },
1196
+ {
1197
+ label: 'Show me an example',
1198
+ prompt: 'Show me an example'
1199
+ },
1200
+ {
1201
+ label: 'Help me with code',
1202
+ prompt: 'Help me with code'
1203
+ }
1204
+ ], true);
1205
+ };
1206
+ const sendToolCall = ()=>{
1207
+ chatService?.sendResponse({
1208
+ content: 'Tool call response',
1209
+ widget: 'apollo-agents-tool-call',
1210
+ meta: {
1211
+ input: {
1212
+ provider: 'GoogleCustomSearch',
1213
+ query: 'most interesting scientific fact discovered recently 2025',
1214
+ num: 5
1215
+ },
1216
+ output: {
1217
+ results: [
1218
+ {
1219
+ snippet: 'Breaking science news and articles...',
1220
+ title: 'ScienceDaily: Latest Research News',
1221
+ url: 'https://www.sciencedaily.com/'
1222
+ }
1223
+ ]
1224
+ },
1225
+ isError: false,
1226
+ startTime: new Date().toISOString(),
1227
+ endTime: new Date().toISOString(),
1228
+ toolName: 'Web_Search'
1229
+ }
1230
+ });
1231
+ };
1232
+ const sendResponseDisabledActions = ()=>{
1233
+ chatService?.sendResponse({
1234
+ content: 'Message with no actions',
1235
+ disableActions: true
1236
+ });
1237
+ };
1238
+ const setPreHook = ()=>{
1239
+ const actions = [
1240
+ 'new-chat',
1241
+ 'toggle-history',
1242
+ 'toggle-chat',
1243
+ 'close-chat',
1244
+ 'feedback'
1245
+ ];
1246
+ actions.forEach((action)=>{
1247
+ chatService?.setPreHook(action, async ()=>window.confirm(`${action} pre hook. Continue?`));
1248
+ });
1249
+ console.log('Pre-hooks set for all actions');
1250
+ };
1251
+ const setCustomHeaderActions = ()=>{
1252
+ chatService?.setCustomHeaderActions([
1253
+ {
1254
+ id: 'export',
1255
+ name: 'Export',
1256
+ icon: 'download',
1257
+ description: 'Export conversation in various formats',
1258
+ children: [
1259
+ {
1260
+ id: 'export-pdf',
1261
+ name: 'Export as PDF',
1262
+ icon: 'picture_as_pdf',
1263
+ description: 'Download conversation as PDF file'
1264
+ },
1265
+ {
1266
+ id: 'export-docx',
1267
+ name: 'Export as DOCX',
1268
+ icon: "description",
1269
+ description: 'Download conversation as Word document'
1270
+ },
1271
+ {
1272
+ id: 'export-json',
1273
+ name: 'Export as JSON',
1274
+ icon: 'data_object',
1275
+ description: 'Download conversation as JSON file'
1276
+ },
1277
+ {
1278
+ id: 'export-txt',
1279
+ name: 'Export as Text',
1280
+ icon: 'text_snippet',
1281
+ description: 'Download conversation as plain text'
1282
+ }
1283
+ ]
1284
+ },
1285
+ {
1286
+ id: 'share',
1287
+ name: 'Share Conversation',
1288
+ icon: 'share',
1289
+ description: 'Share this conversation with others'
1290
+ },
1291
+ {
1292
+ id: 'translate',
1293
+ name: 'Translate',
1294
+ icon: 'translate',
1295
+ description: 'Translate conversation to different languages',
1296
+ children: [
1297
+ {
1298
+ id: 'translate-es',
1299
+ name: 'Spanish',
1300
+ icon: 'language',
1301
+ description: 'Translate to Spanish'
1302
+ },
1303
+ {
1304
+ id: 'translate-fr',
1305
+ name: 'French',
1306
+ icon: 'language',
1307
+ description: 'Translate to French'
1308
+ },
1309
+ {
1310
+ id: 'translate-de',
1311
+ name: 'German',
1312
+ icon: 'language',
1313
+ description: 'Translate to German'
1314
+ },
1315
+ {
1316
+ id: 'translate-ja',
1317
+ name: 'Japanese',
1318
+ icon: 'language',
1319
+ description: 'Translate to Japanese'
1320
+ },
1321
+ {
1322
+ id: 'translate-zh',
1323
+ name: 'Chinese',
1324
+ icon: 'language',
1325
+ description: 'Translate to Chinese'
1326
+ }
1327
+ ]
1328
+ },
1329
+ {
1330
+ id: 'print',
1331
+ name: 'Print',
1332
+ icon: 'print',
1333
+ description: 'Print conversation'
1334
+ },
1335
+ {
1336
+ id: 'advanced',
1337
+ name: 'Advanced Settings',
1338
+ icon: 'tune',
1339
+ description: 'Advanced configuration options',
1340
+ disabled: true
1341
+ }
1342
+ ]);
1343
+ console.log('Custom header actions set');
1344
+ };
1345
+ const clearCustomHeaderActions = ()=>{
1346
+ chatService?.setCustomHeaderActions([]);
1347
+ console.log('Custom header actions cleared');
1348
+ };
1349
+ const setResourceManager = ()=>{
1350
+ chatService?.setResourceManager(createResourceManager());
1351
+ console.log('Resource manager set');
1352
+ };
1353
+ const clearResourceManager = ()=>{
1354
+ chatService?.setResourceManager(null);
1355
+ console.log('Resource manager cleared');
1356
+ };
1357
+ (0, external_react_namespaceObject.useEffect)(()=>{
1358
+ if (chatService) {
1359
+ chatService.setResourceManager(createResourceManager());
1360
+ console.log(`Resource manager updated: pagination=${resourcePaginationEnabled}, pageSize=${resourcePageSize}`);
1361
+ }
1362
+ }, [
1363
+ chatService,
1364
+ createResourceManager,
1365
+ resourcePaginationEnabled,
1366
+ resourcePageSize
1367
+ ]);
1368
+ const sendResponseWithVariables = ()=>{
1369
+ chatService?.sendResponse({
1370
+ content: 'I will update [[resource-token:{"id":"var-email","type":"variable","icon":"mail","displayName":"email"}]] and [[resource-token:{"id":"var-long","type":"variable","icon":"data_object","displayName":"this_is_a_very_long_variable_name_that_should_test_truncation"}]] in the system, then notify [[resource-token:{"id":"var-username","type":"variable","icon":"person","displayName":"username"}]] when complete.',
1371
+ created_at: '02-02-2026',
1372
+ widget: 'default'
1373
+ });
1374
+ console.log('Sent response with resource tokens');
1375
+ };
1376
+ const streamWithResourceTokens = ()=>{
1377
+ const messageId = `streaming-resources-${Date.now()}`;
1378
+ let chunkIndex = 0;
1379
+ const chunks = [
1380
+ 'I will update the ',
1381
+ '[[resource-token:',
1382
+ '{"id":"var-',
1383
+ 'email","type":"variable",',
1384
+ '"icon":"mail","displayName":"email"}]]',
1385
+ ' variable in the system.\n\n',
1386
+ "Then I'll notify ",
1387
+ '[[resource-token:{',
1388
+ '"id":"var-username",',
1389
+ '"type":"variable","icon":"person",',
1390
+ '"displayName":"username"}]]',
1391
+ ' when the process is complete.\n\n',
1392
+ "I'll also update ",
1393
+ '[[resource-token:{',
1394
+ '"id":"var-long","type":"variable",',
1395
+ '"icon":"data_object","displayName":',
1396
+ '"this_is_a_very_long_variable_name_that_should_test_truncation"}]]',
1397
+ ' for testing.\n\n',
1398
+ "Finally, I'll log the result to ",
1399
+ '[[resource-token:{"id":"var-log","type":"variable","icon":"description","displayName":"activity_log"}]]',
1400
+ '.'
1401
+ ];
1402
+ const streamChunk = ()=>{
1403
+ if (chunkIndex >= chunks.length) return;
1404
+ const chunk = chunks[chunkIndex] ?? '';
1405
+ const isDone = chunkIndex === chunks.length - 1;
1406
+ chatService?.sendResponse({
1407
+ id: messageId,
1408
+ content: chunk,
1409
+ stream: true,
1410
+ done: isDone,
1411
+ created_at: '02-02-2026',
1412
+ widget: 'default'
1413
+ });
1414
+ const preview = chunk.slice(0, 30);
1415
+ const suffix = chunk.length > 30 ? '...' : '';
1416
+ console.log(`[StreamWithResourceTokens] Chunk ${chunkIndex + 1}/${chunks.length}: "${preview}${suffix}" (done: ${isDone})`);
1417
+ chunkIndex++;
1418
+ if (!isDone) setTimeout(streamChunk, 150);
1419
+ };
1420
+ streamChunk();
1421
+ };
1422
+ const streamWithCitations = ()=>{
1423
+ const messageId = `streaming-citations-${Date.now()}`;
1424
+ let streamIndex = 0;
1425
+ const streamingParts = [
1426
+ {
1427
+ index: 0,
1428
+ text: 'Based on the search results'
1429
+ },
1430
+ {
1431
+ index: 0,
1432
+ text: ", I'll"
1433
+ },
1434
+ {
1435
+ index: 0,
1436
+ text: ' create a comprehensive'
1437
+ },
1438
+ {
1439
+ index: 0,
1440
+ text: ' summary about UiPath with'
1441
+ },
1442
+ {
1443
+ index: 0,
1444
+ text: ' citations:\n\n##'
1445
+ },
1446
+ {
1447
+ index: 0,
1448
+ text: ' Company Background'
1449
+ },
1450
+ {
1451
+ index: 0,
1452
+ text: '\n- '
1453
+ },
1454
+ {
1455
+ index: 1,
1456
+ text: '**UiPath Inc**'
1457
+ },
1458
+ {
1459
+ index: 1,
1460
+ text: '. is a global'
1461
+ },
1462
+ {
1463
+ index: 1,
1464
+ text: ' software company that was'
1465
+ },
1466
+ {
1467
+ index: 1,
1468
+ text: ' founded in '
1469
+ },
1470
+ {
1471
+ index: 1,
1472
+ text: '_Bucharest, Romania_'
1473
+ },
1474
+ {
1475
+ index: 1,
1476
+ text: ', by'
1477
+ },
1478
+ {
1479
+ index: 1,
1480
+ text: ' **Daniel Dines**'
1481
+ },
1482
+ {
1483
+ index: 1,
1484
+ text: '',
1485
+ citation: {
1486
+ id: 1,
1487
+ title: 'UiPath - Wikipedia',
1488
+ url: 'https://en.wikipedia.org/wiki/UiPath'
1489
+ }
1490
+ },
1491
+ {
1492
+ index: 2,
1493
+ text: '. '
1494
+ },
1495
+ {
1496
+ index: 3,
1497
+ text: 'The'
1498
+ },
1499
+ {
1500
+ index: 3,
1501
+ text: ' company starte'
1502
+ },
1503
+ {
1504
+ index: 3,
1505
+ text: 'd its journey'
1506
+ },
1507
+ {
1508
+ index: 3,
1509
+ text: ' in 2005'
1510
+ },
1511
+ {
1512
+ index: 3,
1513
+ text: ' and has'
1514
+ },
1515
+ {
1516
+ index: 3,
1517
+ text: ' grown to become a leading'
1518
+ },
1519
+ {
1520
+ index: 3,
1521
+ text: ' enterprise automation software ven'
1522
+ },
1523
+ {
1524
+ index: 3,
1525
+ text: 'dor',
1526
+ citation: {
1527
+ id: 1,
1528
+ title: 'UiPath - Wikipedia',
1529
+ url: 'https://en.wikipedia.org/wiki/UiPath'
1530
+ }
1531
+ },
1532
+ {
1533
+ index: 3,
1534
+ text: '',
1535
+ citation: {
1536
+ id: 2,
1537
+ title: 'UiPath, Inc. (PATH)',
1538
+ url: 'https://ir.uipath.com/'
1539
+ }
1540
+ },
1541
+ {
1542
+ index: 4,
1543
+ text: '. \n\n## Core'
1544
+ },
1545
+ {
1546
+ index: 4,
1547
+ text: ' Business'
1548
+ },
1549
+ {
1550
+ index: 4,
1551
+ text: '\nU'
1552
+ },
1553
+ {
1554
+ index: 4,
1555
+ text: 'iPath special'
1556
+ },
1557
+ {
1558
+ index: 4,
1559
+ text: 'izes in several'
1560
+ },
1561
+ {
1562
+ index: 4,
1563
+ text: ' key areas:\n\n1'
1564
+ },
1565
+ {
1566
+ index: 4,
1567
+ text: '. **Rob'
1568
+ },
1569
+ {
1570
+ index: 4,
1571
+ text: 'otic Process Automation'
1572
+ },
1573
+ {
1574
+ index: 4,
1575
+ text: ':**'
1576
+ },
1577
+ {
1578
+ index: 4,
1579
+ text: '\n'
1580
+ },
1581
+ {
1582
+ index: 5,
1583
+ text: 'R'
1584
+ },
1585
+ {
1586
+ index: 5,
1587
+ text: 'PA has'
1588
+ },
1589
+ {
1590
+ index: 5,
1591
+ text: ' revolutionized how work'
1592
+ },
1593
+ {
1594
+ index: 5,
1595
+ text: ' gets done globally'
1596
+ },
1597
+ {
1598
+ index: 5,
1599
+ text: ' by eliminating time'
1600
+ },
1601
+ {
1602
+ index: 5,
1603
+ text: '-consuming, repet'
1604
+ },
1605
+ {
1606
+ index: 5,
1607
+ text: 'itive tasks from employees'
1608
+ },
1609
+ {
1610
+ index: 5,
1611
+ text: "' worklo"
1612
+ },
1613
+ {
1614
+ index: 5,
1615
+ text: 'ads',
1616
+ citation: {
1617
+ id: 3,
1618
+ title: 'Discovery Phase Guide',
1619
+ download_url: 'https://ontheline.trincoll.edu/images/bookdown/sample-local-pdf.pdf',
1620
+ page_number: 2
1621
+ }
1622
+ },
1623
+ {
1624
+ index: 6,
1625
+ text: '.'
1626
+ },
1627
+ {
1628
+ index: 6,
1629
+ text: '\n\n2. **'
1630
+ },
1631
+ {
1632
+ index: 6,
1633
+ text: 'Business Automation Platform**'
1634
+ },
1635
+ {
1636
+ index: 6,
1637
+ text: '\n'
1638
+ },
1639
+ {
1640
+ index: 7,
1641
+ text: 'The platform'
1642
+ },
1643
+ {
1644
+ index: 7,
1645
+ text: ' offers en'
1646
+ },
1647
+ {
1648
+ index: 7,
1649
+ text: 'd-to-en'
1650
+ },
1651
+ {
1652
+ index: 7,
1653
+ text: 'd process transformation'
1654
+ },
1655
+ {
1656
+ index: 7,
1657
+ text: ' capabilities on'
1658
+ },
1659
+ {
1660
+ index: 7,
1661
+ text: ' a single platform,'
1662
+ },
1663
+ {
1664
+ index: 7,
1665
+ text: ' featuring fully'
1666
+ },
1667
+ {
1668
+ index: 7,
1669
+ text: ' governed agentic'
1670
+ },
1671
+ {
1672
+ index: 7,
1673
+ text: ' automation that integ'
1674
+ },
1675
+ {
1676
+ index: 7,
1677
+ text: 'rates with existing systems'
1678
+ },
1679
+ {
1680
+ index: 7,
1681
+ text: '',
1682
+ citation: {
1683
+ id: 4,
1684
+ title: 'UiPath Business Automation Platform | UiPath',
1685
+ url: 'https://www.uipath.com/product'
1686
+ }
1687
+ }
1688
+ ];
1689
+ const streamChunk = ()=>{
1690
+ if (streamIndex >= streamingParts.length) return;
1691
+ const chunk = streamingParts[streamIndex];
1692
+ if (!chunk) return;
1693
+ chatService?.sendResponse({
1694
+ id: messageId,
1695
+ contentPartChunk: {
1696
+ index: chunk.index,
1697
+ text: chunk.text,
1698
+ ...chunk.citation && {
1699
+ citation: chunk.citation
1700
+ }
1701
+ },
1702
+ stream: true,
1703
+ done: streamIndex === streamingParts.length - 1
1704
+ });
1705
+ streamIndex++;
1706
+ if (streamIndex < streamingParts.length) setTimeout(streamChunk, 100);
1707
+ };
1708
+ streamChunk();
1709
+ };
1710
+ const handleAgentModeChange = (mode)=>{
1711
+ setSelectedAgentMode(mode);
1712
+ chatService?.setAgentMode(mode);
1713
+ };
1714
+ const handleModelChange = (modelId)=>{
1715
+ setSelectedModel(modelId);
1716
+ chatService?.setSelectedModel(modelId);
1717
+ };
1718
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Box_default(), {
1719
+ sx: {
1720
+ display: 'flex',
1721
+ width: '100%'
1722
+ },
1723
+ children: [
1724
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Box_default(), {
1725
+ sx: {
1726
+ display: chatMode === external_components_index_cjs_namespaceObject.AutopilotChatMode.FullScreen ? 'none' : 'flex',
1727
+ flexDirection: 'column',
1728
+ flexGrow: 1,
1729
+ gap: 1,
1730
+ maxHeight: '100vh',
1731
+ overflowY: 'auto',
1732
+ p: '16px 0 0 16px',
1733
+ boxSizing: 'border-box'
1734
+ },
1735
+ children: [
1736
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_components_index_cjs_namespaceObject.ApTypography, {
1737
+ variant: index_cjs_namespaceObject.FontVariantToken.fontSizeH3Bold,
1738
+ component: "h2",
1739
+ sx: {
1740
+ mb: 3
1741
+ },
1742
+ children: "ApChat Showcase"
1743
+ }),
1744
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
1745
+ children: [
1746
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
1747
+ children: "Chat Mode Controls"
1748
+ }),
1749
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
1750
+ children: [
1751
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1752
+ primary: true,
1753
+ onClick: openChat,
1754
+ children: "Open Chat"
1755
+ }),
1756
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1757
+ onClick: closeChat,
1758
+ children: "Close Chat"
1759
+ })
1760
+ ]
1761
+ }),
1762
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
1763
+ children: [
1764
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1765
+ onClick: setSideBySide,
1766
+ children: "Side by Side"
1767
+ }),
1768
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1769
+ onClick: setFullScreen,
1770
+ children: "Full Screen"
1771
+ }),
1772
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1773
+ onClick: setEmbedded,
1774
+ children: "Embedded"
1775
+ })
1776
+ ]
1777
+ }),
1778
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
1779
+ children: [
1780
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1781
+ onClick: toggleAutoScroll,
1782
+ children: "Toggle Auto Scroll"
1783
+ }),
1784
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1785
+ onClick: clearChat,
1786
+ children: "Clear Chat"
1787
+ })
1788
+ ]
1789
+ })
1790
+ ]
1791
+ }),
1792
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
1793
+ children: [
1794
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
1795
+ children: "Chat Setup"
1796
+ }),
1797
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
1798
+ children: [
1799
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1800
+ onClick: setAllowedAttachments,
1801
+ children: "Set Allowed Attachments"
1802
+ }),
1803
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1804
+ onClick: setPreHook,
1805
+ children: "Set Pre Hook"
1806
+ })
1807
+ ]
1808
+ }),
1809
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ButtonGroup, {
1810
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1811
+ onClick: setFirstRunExperience,
1812
+ children: "Set First Run Experience"
1813
+ })
1814
+ })
1815
+ ]
1816
+ }),
1817
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
1818
+ children: [
1819
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
1820
+ children: "Custom Header Actions"
1821
+ }),
1822
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
1823
+ children: [
1824
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1825
+ onClick: setCustomHeaderActions,
1826
+ children: "Set Custom Header Actions"
1827
+ }),
1828
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1829
+ onClick: clearCustomHeaderActions,
1830
+ children: "Clear Custom Header Actions"
1831
+ })
1832
+ ]
1833
+ })
1834
+ ]
1835
+ }),
1836
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
1837
+ children: [
1838
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
1839
+ children: "Resource Manager"
1840
+ }),
1841
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
1842
+ children: [
1843
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1844
+ onClick: setResourceManager,
1845
+ children: "Set Resource Manager"
1846
+ }),
1847
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
1848
+ onClick: clearResourceManager,
1849
+ children: "Clear Resource Manager"
1850
+ })
1851
+ ]
1852
+ }),
1853
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
1854
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
1855
+ size: "small",
1856
+ checked: resourcePaginationEnabled,
1857
+ onChange: ()=>setResourcePaginationEnabled(!resourcePaginationEnabled)
1858
+ }),
1859
+ label: "Enable Pagination (50 vars, 30 files)"
1860
+ }),
1861
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(InfoText, {
1862
+ style: {
1863
+ marginTop: 8
1864
+ },
1865
+ children: [
1866
+ "Page Size: ",
1867
+ resourcePageSize
1868
+ ]
1869
+ }),
1870
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoInput, {
1871
+ type: "number",
1872
+ min: 1,
1873
+ max: 20,
1874
+ value: resourcePageSize,
1875
+ onChange: (e)=>setResourcePageSize(Number(e.target.value)),
1876
+ style: {
1877
+ width: 80
1878
+ }
1879
+ }),
1880
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InfoText, {
1881
+ children: "Type @ in the chat input to trigger the picker. Test keyboard navigation (↑/↓), selection (Enter/Tab), and escape behavior."
1882
+ })
1883
+ ]
1884
+ }),
1885
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
1886
+ children: [
1887
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
1888
+ children: "Model Selection"
1889
+ }),
1890
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(DemoSelect, {
1891
+ value: selectedModel,
1892
+ onChange: (e)=>handleModelChange(e.target.value),
1893
+ children: [
1894
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1895
+ value: "gpt-4",
1896
+ children: "GPT-4"
1897
+ }),
1898
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1899
+ value: "gpt-3.5",
1900
+ children: "GPT-3.5 Turbo"
1901
+ }),
1902
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1903
+ value: "claude-3",
1904
+ children: "Claude 3"
1905
+ })
1906
+ ]
1907
+ })
1908
+ ]
1909
+ }),
1910
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
1911
+ children: [
1912
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
1913
+ children: "Agent Mode"
1914
+ }),
1915
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(DemoSelect, {
1916
+ value: selectedAgentMode,
1917
+ onChange: (e)=>handleAgentModeChange(e.target.value),
1918
+ children: [
1919
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1920
+ value: "agent",
1921
+ children: "Agent"
1922
+ }),
1923
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1924
+ value: "plan",
1925
+ children: "Plan"
1926
+ }),
1927
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1928
+ value: "attended",
1929
+ children: "Attended"
1930
+ })
1931
+ ]
1932
+ })
1933
+ ]
1934
+ }),
1935
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
1936
+ children: [
1937
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
1938
+ children: "Input Styling"
1939
+ }),
1940
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InfoText, {
1941
+ children: "Primary Font Token"
1942
+ }),
1943
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(DemoSelect, {
1944
+ value: primaryFontToken,
1945
+ onChange: (e)=>setPrimaryFontToken(e.target.value),
1946
+ children: [
1947
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1948
+ value: index_cjs_namespaceObject.FontVariantToken.fontSizeXs,
1949
+ children: "XS (fontSizeXs)"
1950
+ }),
1951
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1952
+ value: index_cjs_namespaceObject.FontVariantToken.fontSizeS,
1953
+ children: "S (fontSizeS)"
1954
+ }),
1955
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1956
+ value: index_cjs_namespaceObject.FontVariantToken.fontSizeM,
1957
+ children: "M (fontSizeM)"
1958
+ }),
1959
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
1960
+ value: index_cjs_namespaceObject.FontVariantToken.fontSizeL,
1961
+ children: "L (fontSizeL)"
1962
+ })
1963
+ ]
1964
+ }),
1965
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(InfoText, {
1966
+ style: {
1967
+ marginTop: 12
1968
+ },
1969
+ children: [
1970
+ "Prompt Box Min Rows: ",
1971
+ promptBoxMinRows
1972
+ ]
1973
+ }),
1974
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoInput, {
1975
+ type: "number",
1976
+ min: 1,
1977
+ max: 10,
1978
+ value: promptBoxMinRows,
1979
+ onChange: (e)=>setPromptBoxMinRows(Number(e.target.value))
1980
+ }),
1981
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(InfoText, {
1982
+ style: {
1983
+ marginTop: 12
1984
+ },
1985
+ children: [
1986
+ "Prompt Box Max Rows: ",
1987
+ promptBoxMaxRows
1988
+ ]
1989
+ }),
1990
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoInput, {
1991
+ type: "number",
1992
+ min: 1,
1993
+ max: 20,
1994
+ value: promptBoxMaxRows,
1995
+ onChange: (e)=>setPromptBoxMaxRows(Number(e.target.value))
1996
+ })
1997
+ ]
1998
+ }),
1999
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
2000
+ children: [
2001
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
2002
+ children: "Message Controls"
2003
+ }),
2004
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2005
+ children: [
2006
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2007
+ onClick: setPrompt,
2008
+ children: "Set Prompt"
2009
+ }),
2010
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2011
+ onClick: resetPrompt,
2012
+ children: "Reset Prompt"
2013
+ })
2014
+ ]
2015
+ }),
2016
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoInput, {
2017
+ placeholder: "Custom message",
2018
+ value: customMessage,
2019
+ onChange: (e)=>setCustomMessage(e.target.value)
2020
+ }),
2021
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2022
+ children: [
2023
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2024
+ onClick: sendSimpleRequest,
2025
+ children: "Send Request"
2026
+ }),
2027
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2028
+ onClick: sendSimpleResponse,
2029
+ children: "Send Response"
2030
+ }),
2031
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2032
+ onClick: stopResponse,
2033
+ children: "Stop Response"
2034
+ })
2035
+ ]
2036
+ }),
2037
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2038
+ children: [
2039
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2040
+ onClick: sendResponseWithActions,
2041
+ children: "With Actions"
2042
+ }),
2043
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2044
+ onClick: sendResponseWithCitations,
2045
+ children: "With Citations"
2046
+ }),
2047
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2048
+ onClick: sendResponseWithVariables,
2049
+ children: "With Resource Tokens"
2050
+ })
2051
+ ]
2052
+ }),
2053
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2054
+ children: [
2055
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2056
+ onClick: sendCodeBlock,
2057
+ children: "Code Block"
2058
+ }),
2059
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2060
+ onClick: sendHTMLPreview,
2061
+ children: "HTML Preview"
2062
+ })
2063
+ ]
2064
+ }),
2065
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2066
+ children: [
2067
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2068
+ onClick: sendToolCall,
2069
+ children: "Send Tool Call"
2070
+ }),
2071
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2072
+ onClick: sendResponseDisabledActions,
2073
+ children: "Disabled Actions"
2074
+ })
2075
+ ]
2076
+ }),
2077
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2078
+ children: [
2079
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2080
+ onClick: setConversation,
2081
+ children: "Set Conversation"
2082
+ }),
2083
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2084
+ onClick: setSuggestions,
2085
+ children: "Set Suggestions"
2086
+ })
2087
+ ]
2088
+ }),
2089
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2090
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2091
+ size: "small",
2092
+ checked: waitForMore,
2093
+ onChange: ()=>setWaitForMore(!waitForMore)
2094
+ }),
2095
+ label: "Wait For More Messages"
2096
+ })
2097
+ ]
2098
+ }),
2099
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
2100
+ children: [
2101
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
2102
+ children: "Streaming"
2103
+ }),
2104
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoTextArea, {
2105
+ placeholder: "Text to stream",
2106
+ value: streamingText,
2107
+ onChange: (e)=>setStreamingText(e.target.value)
2108
+ }),
2109
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2110
+ children: [
2111
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2112
+ onClick: sendStreamingResponse,
2113
+ children: "Stream Response"
2114
+ }),
2115
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2116
+ onClick: streamWithCitations,
2117
+ children: "Stream With Citations"
2118
+ }),
2119
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2120
+ onClick: streamWithResourceTokens,
2121
+ children: "Stream Resource Tokens"
2122
+ })
2123
+ ]
2124
+ }),
2125
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InfoText, {
2126
+ children: 'Streams text progressively. "Stream Resource Tokens" demonstrates buffering of incomplete tokens to prevent flickering.'
2127
+ })
2128
+ ]
2129
+ }),
2130
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
2131
+ children: [
2132
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
2133
+ children: "Loading & Error States"
2134
+ }),
2135
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoInput, {
2136
+ placeholder: "Loading message",
2137
+ value: loadingMessage,
2138
+ onChange: (e)=>setLoadingMessage(e.target.value)
2139
+ }),
2140
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2141
+ children: [
2142
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2143
+ onClick: showLoading,
2144
+ children: "Show Loading"
2145
+ }),
2146
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2147
+ onClick: hideLoading,
2148
+ children: "Hide Loading"
2149
+ })
2150
+ ]
2151
+ }),
2152
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoInput, {
2153
+ placeholder: "Error message",
2154
+ value: errorMessage,
2155
+ onChange: (e)=>setErrorMessage(e.target.value)
2156
+ }),
2157
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2158
+ children: [
2159
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2160
+ onClick: showError,
2161
+ children: "Show Error"
2162
+ }),
2163
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2164
+ onClick: showWarning,
2165
+ children: "Show Warning"
2166
+ }),
2167
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2168
+ onClick: clearErrors,
2169
+ children: "Clear Errors"
2170
+ })
2171
+ ]
2172
+ })
2173
+ ]
2174
+ }),
2175
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
2176
+ children: [
2177
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
2178
+ children: "History"
2179
+ }),
2180
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ButtonGroup, {
2181
+ children: [
2182
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2183
+ onClick: addHistoryItems,
2184
+ children: "Add History Items"
2185
+ }),
2186
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DemoButton, {
2187
+ onClick: toggleHistory,
2188
+ children: "Toggle History Panel"
2189
+ })
2190
+ ]
2191
+ })
2192
+ ]
2193
+ }),
2194
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
2195
+ children: [
2196
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
2197
+ children: "Feature Toggles"
2198
+ }),
2199
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2200
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2201
+ size: "small",
2202
+ checked: features.history,
2203
+ onChange: ()=>toggleFeature('history')
2204
+ }),
2205
+ label: "History"
2206
+ }),
2207
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2208
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2209
+ size: "small",
2210
+ checked: features.settings,
2211
+ onChange: ()=>toggleFeature('settings')
2212
+ }),
2213
+ label: "Settings"
2214
+ }),
2215
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2216
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2217
+ size: "small",
2218
+ checked: features.attachments,
2219
+ onChange: ()=>toggleFeature('attachments')
2220
+ }),
2221
+ label: "Attachments"
2222
+ }),
2223
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2224
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2225
+ size: "small",
2226
+ checked: features.audio,
2227
+ onChange: ()=>toggleFeature('audio')
2228
+ }),
2229
+ label: "STT Dictate"
2230
+ }),
2231
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2232
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2233
+ size: "small",
2234
+ checked: features.audioStreaming,
2235
+ onChange: ()=>toggleFeature('audioStreaming')
2236
+ }),
2237
+ label: "Voice Interaction"
2238
+ }),
2239
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2240
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2241
+ size: "small",
2242
+ checked: features.htmlPreview,
2243
+ onChange: ()=>toggleFeature('htmlPreview')
2244
+ }),
2245
+ label: "HTML Preview"
2246
+ }),
2247
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2248
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2249
+ size: "small",
2250
+ checked: features.headerSeparator,
2251
+ onChange: ()=>toggleFeature('headerSeparator')
2252
+ }),
2253
+ label: "Header Separator"
2254
+ }),
2255
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2256
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2257
+ size: "small",
2258
+ checked: features.fullHeight,
2259
+ onChange: ()=>toggleFeature('fullHeight')
2260
+ }),
2261
+ label: "Full Height"
2262
+ }),
2263
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2264
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2265
+ size: "small",
2266
+ checked: features.resize,
2267
+ onChange: ()=>toggleFeature('resize')
2268
+ }),
2269
+ label: "Resize"
2270
+ }),
2271
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2272
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2273
+ size: "small",
2274
+ checked: features.close,
2275
+ onChange: ()=>toggleFeature('close')
2276
+ }),
2277
+ label: "Close"
2278
+ }),
2279
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2280
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2281
+ size: "small",
2282
+ checked: features.feedback,
2283
+ onChange: ()=>toggleFeature('feedback')
2284
+ }),
2285
+ label: "Feedback"
2286
+ }),
2287
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2288
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2289
+ size: "small",
2290
+ checked: features.model,
2291
+ onChange: ()=>toggleFeature('model')
2292
+ }),
2293
+ label: "Model"
2294
+ }),
2295
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2296
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2297
+ size: "small",
2298
+ checked: features.agentMode,
2299
+ onChange: ()=>toggleFeature('agentMode')
2300
+ }),
2301
+ label: "Agent Mode"
2302
+ }),
2303
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2304
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2305
+ size: "small",
2306
+ checked: features.sendOnClick,
2307
+ onChange: ()=>toggleFeature('sendOnClick')
2308
+ }),
2309
+ label: "Send On Click"
2310
+ }),
2311
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2312
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2313
+ size: "small",
2314
+ checked: features.paginatedMessages,
2315
+ onChange: ()=>toggleFeature('paginatedMessages')
2316
+ }),
2317
+ label: "Paginated Messages"
2318
+ }),
2319
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2320
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2321
+ size: "small",
2322
+ checked: features.compactMode,
2323
+ onChange: ()=>toggleFeature('compactMode')
2324
+ }),
2325
+ label: "Compact Mode"
2326
+ }),
2327
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2328
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2329
+ size: "small",
2330
+ checked: features.customScrollTheme,
2331
+ onChange: ()=>toggleFeature('customScrollTheme')
2332
+ }),
2333
+ label: "Custom Scroll Theme"
2334
+ }),
2335
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2336
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2337
+ size: "small",
2338
+ checked: features.copy,
2339
+ onChange: ()=>toggleFeature('copy')
2340
+ }),
2341
+ label: "Copy"
2342
+ }),
2343
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2344
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2345
+ size: "small",
2346
+ checked: features.attachmentsAsync,
2347
+ onChange: ()=>toggleFeature('attachmentsAsync')
2348
+ }),
2349
+ label: "Attachments Async"
2350
+ }),
2351
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2352
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2353
+ size: "small",
2354
+ checked: features.readOnly,
2355
+ onChange: ()=>toggleFeature('readOnly')
2356
+ }),
2357
+ label: "Read Only"
2358
+ })
2359
+ ]
2360
+ }),
2361
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Section, {
2362
+ children: [
2363
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SectionTitle, {
2364
+ children: "State Controls"
2365
+ }),
2366
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2367
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2368
+ size: "small",
2369
+ checked: isWaiting,
2370
+ onChange: ()=>{
2371
+ setIsWaiting(!isWaiting);
2372
+ chatService?.setWaiting(!isWaiting);
2373
+ }
2374
+ }),
2375
+ label: "Set Waiting"
2376
+ }),
2377
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormControlLabel_default(), {
2378
+ control: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Checkbox_default(), {
2379
+ size: "small",
2380
+ checked: isShowLoading,
2381
+ onChange: ()=>{
2382
+ setIsShowLoading(!isShowLoading);
2383
+ chatService?.setShowLoading(!isShowLoading);
2384
+ }
2385
+ }),
2386
+ label: "Set Show Loading"
2387
+ })
2388
+ ]
2389
+ })
2390
+ ]
2391
+ }),
2392
+ chatService && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
2393
+ sx: {
2394
+ justifySelf: 'flex-end',
2395
+ background: 'var(--color-background)'
2396
+ },
2397
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_components_index_cjs_namespaceObject.ApChat, {
2398
+ chatServiceInstance: chatService,
2399
+ locale: locale,
2400
+ theme: theme
2401
+ })
2402
+ }),
2403
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
2404
+ ref: embeddedContainerRef,
2405
+ sx: {
2406
+ position: 'fixed',
2407
+ bottom: 24,
2408
+ right: 24,
2409
+ width: 400,
2410
+ height: 600,
2411
+ boxShadow: 'var(--shadow-xl, 0 12px 32px rgba(0, 0, 0, 0.35))',
2412
+ borderRadius: '12px',
2413
+ overflow: 'hidden',
2414
+ zIndex: 1000,
2415
+ '& > *': {
2416
+ position: 'relative'
2417
+ }
2418
+ },
2419
+ style: {
2420
+ background: 'var(--color-background)',
2421
+ display: chatMode === external_components_index_cjs_namespaceObject.AutopilotChatMode.Embedded ? 'block' : 'none'
2422
+ }
2423
+ })
2424
+ ]
2425
+ });
2426
+ }
2427
+ exports.ChatShowcaseDemo = __webpack_exports__.ChatShowcaseDemo;
2428
+ exports.mapToChatLocale = __webpack_exports__.mapToChatLocale;
2429
+ exports.mapToChatTheme = __webpack_exports__.mapToChatTheme;
2430
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
2431
+ "ChatShowcaseDemo",
2432
+ "mapToChatLocale",
2433
+ "mapToChatTheme"
2434
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
2435
+ Object.defineProperty(exports, '__esModule', {
2436
+ value: true
2437
+ });