@memori.ai/memori-react 9.0.0-alpha.16 → 9.0.0-alpha.17

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 (164) hide show
  1. package/CHANGELOG.md +3 -6945
  2. package/dist/components/Chat/Chat.css +11 -15
  3. package/dist/components/Chat/Chat.js +11 -3
  4. package/dist/components/Chat/Chat.js.map +1 -1
  5. package/dist/components/ChatInputs/ChatInputs.css +59 -147
  6. package/dist/components/ChatInputs/ChatInputs.js +3 -4
  7. package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
  8. package/dist/components/Header/ChatConsumptionDropdown.js +2 -1
  9. package/dist/components/Header/ChatConsumptionDropdown.js.map +1 -1
  10. package/dist/components/Header/Header.css +192 -22
  11. package/dist/components/Header/Header.d.ts +1 -0
  12. package/dist/components/Header/Header.js +26 -24
  13. package/dist/components/Header/Header.js.map +1 -1
  14. package/dist/components/IconButton/IconButton.css +144 -0
  15. package/dist/components/IconButton/IconButton.d.ts +9 -0
  16. package/dist/components/IconButton/IconButton.js +36 -0
  17. package/dist/components/IconButton/IconButton.js.map +1 -0
  18. package/dist/components/KnownFacts/KnownFacts.css +19 -10
  19. package/dist/components/KnownFacts/KnownFacts.js +13 -3
  20. package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
  21. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +29 -44
  22. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +3 -2
  23. package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  24. package/dist/components/MemoriWidget/MemoriWidget.css +2 -1
  25. package/dist/components/MemoriWidget/MemoriWidget.js +24 -28
  26. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  27. package/dist/components/MicrophoneButton/MicrophoneButton.css +2 -183
  28. package/dist/components/MicrophoneButton/MicrophoneButton.js +3 -1
  29. package/dist/components/MicrophoneButton/MicrophoneButton.js.map +1 -1
  30. package/dist/components/MobileSessionPanel/MobileSessionPanel.css +22 -7
  31. package/dist/components/MobileSessionPanel/MobileSessionPanel.d.ts +1 -0
  32. package/dist/components/MobileSessionPanel/MobileSessionPanel.js +5 -3
  33. package/dist/components/MobileSessionPanel/MobileSessionPanel.js.map +1 -1
  34. package/dist/components/PositionPopover/PositionPopover.d.ts +2 -0
  35. package/dist/components/PositionPopover/PositionPopover.js +18 -4
  36. package/dist/components/PositionPopover/PositionPopover.js.map +1 -1
  37. package/dist/components/ShareButton/ShareButton.css +3 -2
  38. package/dist/components/ShareButton/ShareButton.js +3 -2
  39. package/dist/components/ShareButton/ShareButton.js.map +1 -1
  40. package/dist/components/UploadButton/UploadButton.css +2 -20
  41. package/dist/components/UploadButton/UploadButton.js +2 -1
  42. package/dist/components/UploadButton/UploadButton.js.map +1 -1
  43. package/dist/components/layouts/Chat.js +73 -55
  44. package/dist/components/layouts/Chat.js.map +1 -1
  45. package/dist/components/layouts/FullPage.js +53 -34
  46. package/dist/components/layouts/FullPage.js.map +1 -1
  47. package/dist/components/layouts/HiddenChat.js +3 -3
  48. package/dist/components/layouts/HiddenChat.js.map +1 -1
  49. package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js +3 -3
  50. package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
  51. package/dist/components/layouts/WebsiteAssistant/website-assistant.css +28 -15
  52. package/dist/components/layouts/ZoomedFullBody.js +53 -34
  53. package/dist/components/layouts/ZoomedFullBody.js.map +1 -1
  54. package/dist/components/layouts/chat.css +52 -22
  55. package/dist/components/layouts/hidden-chat.css +33 -68
  56. package/dist/components/layouts/zoomed-full-body.css +5 -4
  57. package/dist/styles.css +1 -1
  58. package/dist/version.d.ts +1 -1
  59. package/dist/version.js +1 -1
  60. package/esm/components/Chat/Chat.css +11 -15
  61. package/esm/components/Chat/Chat.js +11 -3
  62. package/esm/components/Chat/Chat.js.map +1 -1
  63. package/esm/components/ChatInputs/ChatInputs.css +59 -147
  64. package/esm/components/ChatInputs/ChatInputs.js +3 -4
  65. package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
  66. package/esm/components/Header/ChatConsumptionDropdown.js +3 -2
  67. package/esm/components/Header/ChatConsumptionDropdown.js.map +1 -1
  68. package/esm/components/Header/Header.css +192 -22
  69. package/esm/components/Header/Header.d.ts +1 -0
  70. package/esm/components/Header/Header.js +26 -24
  71. package/esm/components/Header/Header.js.map +1 -1
  72. package/esm/components/IconButton/IconButton.css +144 -0
  73. package/esm/components/IconButton/IconButton.d.ts +9 -0
  74. package/esm/components/IconButton/IconButton.js +33 -0
  75. package/esm/components/IconButton/IconButton.js.map +1 -0
  76. package/esm/components/KnownFacts/KnownFacts.css +19 -10
  77. package/esm/components/KnownFacts/KnownFacts.js +13 -3
  78. package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
  79. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +29 -44
  80. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +3 -2
  81. package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
  82. package/esm/components/MemoriWidget/MemoriWidget.css +2 -1
  83. package/esm/components/MemoriWidget/MemoriWidget.js +24 -28
  84. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  85. package/esm/components/MicrophoneButton/MicrophoneButton.css +2 -183
  86. package/esm/components/MicrophoneButton/MicrophoneButton.js +3 -2
  87. package/esm/components/MicrophoneButton/MicrophoneButton.js.map +1 -1
  88. package/esm/components/MobileSessionPanel/MobileSessionPanel.css +22 -7
  89. package/esm/components/MobileSessionPanel/MobileSessionPanel.d.ts +1 -0
  90. package/esm/components/MobileSessionPanel/MobileSessionPanel.js +5 -3
  91. package/esm/components/MobileSessionPanel/MobileSessionPanel.js.map +1 -1
  92. package/esm/components/PositionPopover/PositionPopover.d.ts +2 -0
  93. package/esm/components/PositionPopover/PositionPopover.js +18 -4
  94. package/esm/components/PositionPopover/PositionPopover.js.map +1 -1
  95. package/esm/components/ShareButton/ShareButton.css +3 -2
  96. package/esm/components/ShareButton/ShareButton.js +4 -3
  97. package/esm/components/ShareButton/ShareButton.js.map +1 -1
  98. package/esm/components/UploadButton/UploadButton.css +2 -20
  99. package/esm/components/UploadButton/UploadButton.js +2 -1
  100. package/esm/components/UploadButton/UploadButton.js.map +1 -1
  101. package/esm/components/layouts/Chat.js +74 -56
  102. package/esm/components/layouts/Chat.js.map +1 -1
  103. package/esm/components/layouts/FullPage.js +54 -35
  104. package/esm/components/layouts/FullPage.js.map +1 -1
  105. package/esm/components/layouts/HiddenChat.js +3 -3
  106. package/esm/components/layouts/HiddenChat.js.map +1 -1
  107. package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js +3 -3
  108. package/esm/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -1
  109. package/esm/components/layouts/WebsiteAssistant/website-assistant.css +28 -15
  110. package/esm/components/layouts/ZoomedFullBody.js +54 -35
  111. package/esm/components/layouts/ZoomedFullBody.js.map +1 -1
  112. package/esm/components/layouts/chat.css +52 -22
  113. package/esm/components/layouts/hidden-chat.css +33 -68
  114. package/esm/components/layouts/zoomed-full-body.css +5 -4
  115. package/esm/styles.css +1 -1
  116. package/esm/version.d.ts +1 -1
  117. package/esm/version.js +1 -1
  118. package/package.json +1 -1
  119. package/src/components/Chat/Chat.css +11 -15
  120. package/src/components/Chat/Chat.tsx +11 -2
  121. package/src/components/ChatInputs/ChatInputs.css +59 -147
  122. package/src/components/ChatInputs/ChatInputs.tsx +7 -7
  123. package/src/components/Header/ChatConsumptionDropdown.tsx +3 -2
  124. package/src/components/Header/Header.css +192 -22
  125. package/src/components/Header/Header.tsx +62 -55
  126. package/src/components/Header/__snapshots__/Header.test.tsx.snap +90 -57
  127. package/src/components/IconButton/IconButton.css +144 -0
  128. package/src/components/IconButton/IconButton.tsx +89 -0
  129. package/src/components/KnownFacts/KnownFacts.css +19 -10
  130. package/src/components/KnownFacts/KnownFacts.tsx +13 -2
  131. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +29 -44
  132. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +11 -20
  133. package/src/components/MemoriWidget/MemoriWidget.css +2 -1
  134. package/src/components/MemoriWidget/MemoriWidget.tsx +30 -29
  135. package/src/components/MicrophoneButton/MicrophoneButton.css +2 -183
  136. package/src/components/MicrophoneButton/MicrophoneButton.tsx +5 -5
  137. package/src/components/MobileSessionPanel/MobileSessionPanel.css +22 -7
  138. package/src/components/MobileSessionPanel/MobileSessionPanel.tsx +8 -3
  139. package/src/components/PositionPopover/PositionPopover.tsx +30 -4
  140. package/src/components/ShareButton/ShareButton.css +3 -2
  141. package/src/components/ShareButton/ShareButton.tsx +8 -9
  142. package/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap +9 -9
  143. package/src/components/StartPanel/StartPanel.stories.tsx +1 -1
  144. package/src/components/UploadButton/UploadButton.css +2 -20
  145. package/src/components/UploadButton/UploadButton.tsx +3 -5
  146. package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +29 -25
  147. package/src/components/layouts/Chat.tsx +224 -208
  148. package/src/components/layouts/FullPage.tsx +61 -40
  149. package/src/components/layouts/HiddenChat.tsx +5 -6
  150. package/src/components/layouts/WebsiteAssistant/WebsiteAssistant.tsx +2 -2
  151. package/src/components/layouts/WebsiteAssistant/__snapshots__/WebsiteAssistant.test.tsx.snap +2 -0
  152. package/src/components/layouts/WebsiteAssistant/website-assistant.css +28 -15
  153. package/src/components/layouts/ZoomedFullBody.tsx +61 -40
  154. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +145 -143
  155. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +22 -18
  156. package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +10 -145
  157. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +12 -10
  158. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +11 -9
  159. package/src/components/layouts/chat.css +52 -22
  160. package/src/components/layouts/hidden-chat.css +33 -68
  161. package/src/components/layouts/layouts.stories.tsx +1 -1
  162. package/src/components/layouts/zoomed-full-body.css +5 -4
  163. package/src/styles.css +1 -0
  164. package/src/version.ts +1 -1
@@ -186,10 +186,16 @@
186
186
  opacity: 0.6;
187
187
  }
188
188
 
189
- /* Logout action */
190
- .memori-dropdown--action-button.memori-dropdown--action-button--logout {
189
+ /* Logout action — full-width labeled control inside user menu */
190
+ .memori-dropdown--action-button.memori-dropdown--action-button--logout,
191
+ .memori-widget
192
+ .memori-icon-button.memori-icon-button--labeled.memori-dropdown--action-button--logout.memori-button {
191
193
  display: flex;
192
194
  width: 100%;
195
+ min-width: 0;
196
+ max-width: none;
197
+ height: auto;
198
+ min-height: var(--memori-icon-button-size, 36px);
193
199
  box-sizing: border-box;
194
200
  align-items: center;
195
201
  justify-content: center;
@@ -240,8 +246,8 @@
240
246
  }
241
247
 
242
248
  .memori-header--button svg {
243
- width: 1em;
244
- height: 1em;
249
+ width: 1.25em;
250
+ height: 1.25em;
245
251
  font-size: 1em;
246
252
  line-height: 1;
247
253
  }
@@ -250,6 +256,19 @@
250
256
  fill: currentColor;
251
257
  }
252
258
 
259
+ /* Accedi / login CTA — ~1.8:1 horizontal:vertical padding, height aligned to icon tools */
260
+ .memori-header .memori-header--button-login.memori-button {
261
+ height: var(--memori-icon-button-size, 40px);
262
+ min-height: var(--memori-icon-button-size, 40px);
263
+ padding: 0.5rem 0.9rem;
264
+ gap: 0.4rem;
265
+ }
266
+
267
+ .memori-header .memori-header--button-login.memori-button svg {
268
+ width: var(--memori-icon-button-icon-size, 20px);
269
+ height: var(--memori-icon-button-icon-size, 20px);
270
+ }
271
+
253
272
  .memori-header--position {
254
273
  display: inline-flex;
255
274
  align-items: center;
@@ -302,10 +321,175 @@
302
321
  pointer-events: none;
303
322
  }
304
323
 
305
- .memori-header .memori-button.memori-button--active:not(:disabled):not(.memori-button--disabled),
324
+ .memori-header .memori-icon-button.memori-button.memori-icon-button--active:not(:disabled):not(.memori-button--disabled),
306
325
  .memori-header
307
- .memori-dropdown--user-trigger-button.memori-button--active:not(:disabled):not(.memori-button--disabled) {
308
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--memori-primary, #3b82f6) 40%, transparent);
326
+ .memori-dropdown--user-trigger-button.memori-icon-button.memori-button--active:not(:disabled):not(.memori-button--disabled) {
327
+ /* Soft active owned by IconButton.css — do not use CTA ring/fill here */
328
+ box-shadow: none;
329
+ }
330
+
331
+ /* Header (+ mobile overflow) icon tools: primary icon on hover (not logout / recording) */
332
+ .memori-widget
333
+ .memori-header
334
+ .memori-icon-button.memori-button:hover:not(
335
+ :disabled,
336
+ .memori-button--disabled,
337
+ .memori-icon-button--recording,
338
+ .memori-dropdown--action-button--logout
339
+ ),
340
+ .memori-widget
341
+ .memori-fullpage-header-row
342
+ .memori-icon-button.memori-button:hover:not(
343
+ :disabled,
344
+ .memori-button--disabled,
345
+ .memori-icon-button--recording
346
+ ),
347
+ .memori-widget
348
+ .memori-chat-layout--header
349
+ .memori-icon-button.memori-button:hover:not(
350
+ :disabled,
351
+ .memori-button--disabled,
352
+ .memori-icon-button--recording
353
+ ),
354
+ .memori-widget
355
+ .memori-chat-layout--overflow-trigger.memori-icon-button.memori-button:hover:not(
356
+ :disabled,
357
+ .memori-button--disabled
358
+ ) {
359
+ color: var(--memori-primary);
360
+ }
361
+
362
+ .memori-widget
363
+ .memori-header
364
+ .memori-icon-button.memori-button:hover:not(
365
+ :disabled,
366
+ .memori-button--disabled,
367
+ .memori-icon-button--recording,
368
+ .memori-dropdown--action-button--logout
369
+ )
370
+ svg,
371
+ .memori-widget
372
+ .memori-fullpage-header-row
373
+ .memori-icon-button.memori-button:hover:not(
374
+ :disabled,
375
+ .memori-button--disabled,
376
+ .memori-icon-button--recording
377
+ )
378
+ svg,
379
+ .memori-widget
380
+ .memori-chat-layout--header
381
+ .memori-icon-button.memori-button:hover:not(
382
+ :disabled,
383
+ .memori-button--disabled,
384
+ .memori-icon-button--recording
385
+ )
386
+ svg,
387
+ .memori-widget
388
+ .memori-chat-layout--overflow-trigger.memori-icon-button.memori-button:hover:not(
389
+ :disabled,
390
+ .memori-button--disabled
391
+ )
392
+ svg {
393
+ color: var(--memori-primary);
394
+ }
395
+
396
+ /* Dark: keep white at rest, but still use primary on hover for icon tools */
397
+ .memori-widget[data-theme='dark']
398
+ .memori-header
399
+ .memori-icon-button.memori-button:hover:not(
400
+ :disabled,
401
+ .memori-button--disabled,
402
+ .memori-icon-button--recording,
403
+ .memori-dropdown--action-button--logout
404
+ ),
405
+ [data-theme='dark']
406
+ .memori-widget
407
+ .memori-header
408
+ .memori-icon-button.memori-button:hover:not(
409
+ :disabled,
410
+ .memori-button--disabled,
411
+ .memori-icon-button--recording,
412
+ .memori-dropdown--action-button--logout
413
+ ),
414
+ .memori-widget[data-theme='dark']
415
+ .memori-fullpage-header-row
416
+ .memori-icon-button.memori-button:hover:not(
417
+ :disabled,
418
+ .memori-button--disabled,
419
+ .memori-icon-button--recording
420
+ ),
421
+ [data-theme='dark']
422
+ .memori-widget
423
+ .memori-fullpage-header-row
424
+ .memori-icon-button.memori-button:hover:not(
425
+ :disabled,
426
+ .memori-button--disabled,
427
+ .memori-icon-button--recording
428
+ ),
429
+ .memori-widget[data-theme='dark']
430
+ .memori-chat-layout--overflow-trigger.memori-icon-button.memori-button:hover:not(
431
+ :disabled,
432
+ .memori-button--disabled
433
+ ),
434
+ [data-theme='dark']
435
+ .memori-widget
436
+ .memori-chat-layout--overflow-trigger.memori-icon-button.memori-button:hover:not(
437
+ :disabled,
438
+ .memori-button--disabled
439
+ ) {
440
+ color: var(--memori-primary);
441
+ }
442
+
443
+ .memori-widget[data-theme='dark']
444
+ .memori-header
445
+ .memori-icon-button.memori-button:hover:not(
446
+ :disabled,
447
+ .memori-button--disabled,
448
+ .memori-icon-button--recording,
449
+ .memori-dropdown--action-button--logout
450
+ )
451
+ svg,
452
+ [data-theme='dark']
453
+ .memori-widget
454
+ .memori-header
455
+ .memori-icon-button.memori-button:hover:not(
456
+ :disabled,
457
+ .memori-button--disabled,
458
+ .memori-icon-button--recording,
459
+ .memori-dropdown--action-button--logout
460
+ )
461
+ svg,
462
+ .memori-widget[data-theme='dark']
463
+ .memori-fullpage-header-row
464
+ .memori-icon-button.memori-button:hover:not(
465
+ :disabled,
466
+ .memori-button--disabled,
467
+ .memori-icon-button--recording
468
+ )
469
+ svg,
470
+ [data-theme='dark']
471
+ .memori-widget
472
+ .memori-fullpage-header-row
473
+ .memori-icon-button.memori-button:hover:not(
474
+ :disabled,
475
+ .memori-button--disabled,
476
+ .memori-icon-button--recording
477
+ )
478
+ svg,
479
+ .memori-widget[data-theme='dark']
480
+ .memori-chat-layout--overflow-trigger.memori-icon-button.memori-button:hover:not(
481
+ :disabled,
482
+ .memori-button--disabled
483
+ )
484
+ svg,
485
+ [data-theme='dark']
486
+ .memori-widget
487
+ .memori-chat-layout--overflow-trigger.memori-icon-button.memori-button:hover:not(
488
+ :disabled,
489
+ .memori-button--disabled
490
+ )
491
+ svg {
492
+ color: var(--memori-primary);
309
493
  }
310
494
 
311
495
  .memori-dropdown--avatar-input {
@@ -576,19 +760,9 @@
576
760
  gap: 0.5rem;
577
761
  }
578
762
 
579
- .memori-header--auth-icon-button {
580
- width: 38px;
581
- min-width: 38px;
582
- height: 38px;
583
- min-height: 38px;
584
- padding: 8px;
585
- border: 1px solid color-mix(in srgb, var(--memori-text-color, #111827) 16%, transparent);
586
- background: transparent;
587
- }
588
-
589
763
  .memori-header--auth-icon-button:has(.memori-header--action-label) {
590
764
  width: auto;
591
- min-width: 38px;
765
+ min-width: var(--memori-icon-button-size, 36px);
592
766
  gap: 0.35rem;
593
767
  padding-inline: 10px;
594
768
  }
@@ -600,10 +774,6 @@
600
774
  white-space: nowrap;
601
775
  }
602
776
 
603
- .memori-header--auth-icon-button:hover {
604
- background: color-mix(in srgb, var(--memori-text-color, #111827) 8%, transparent);
605
- }
606
-
607
777
  .memori-dropdown--auth-menu {
608
778
  min-width: 320px;
609
779
  padding: 0.45rem;
@@ -13,6 +13,7 @@ export interface Props {
13
13
  setVenue: (venue?: Venue) => void;
14
14
  positionPopoverOpen: boolean;
15
15
  setPositionPopoverOpen: (open: boolean) => void;
16
+ autoStartPositionGeolocation?: boolean;
16
17
  setShowSettingsDrawer: (show: boolean) => void;
17
18
  setShowChatHistoryDrawer: (show: boolean) => void;
18
19
  setShowKnownFactsDrawer: (show: boolean) => void;
@@ -12,9 +12,10 @@ const PositionPopover_1 = tslib_1.__importDefault(require("../PositionPopover/Po
12
12
  const GasStation_1 = tslib_1.__importDefault(require("../icons/GasStation"));
13
13
  const error_1 = require("../../helpers/error");
14
14
  const ChatConsumptionDropdown_1 = tslib_1.__importDefault(require("./ChatConsumptionDropdown"));
15
+ const IconButton_1 = tslib_1.__importDefault(require("../IconButton/IconButton"));
15
16
  const utils_1 = require("../../helpers/utils");
16
17
  const media_1 = require("../../helpers/media");
17
- const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, position, setVenue, positionPopoverOpen, setPositionPopoverOpen, setShowSettingsDrawer, setShowChatHistoryDrawer, setShowKnownFactsDrawer, setShowExpertsDrawer, enableAudio = true, speakerMuted, setSpeakerMuted, hasUserActivatedSpeak = false, showShare = true, showSettings = true, showReload = false, showClear = false, showLogin = true, setShowLoginDrawer, clearHistory, loginToken, user, sessionID, showChatHistory = true, fullScreenHandler, baseUrl, onLogout, apiClient, layout, additionalSettings, showMessageConsumption = false, showFullscreen = true, extraActions, }) => {
18
+ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, position, setVenue, positionPopoverOpen, setPositionPopoverOpen, autoStartPositionGeolocation = false, setShowSettingsDrawer, setShowChatHistoryDrawer, setShowKnownFactsDrawer, setShowExpertsDrawer, enableAudio = true, speakerMuted, setSpeakerMuted, hasUserActivatedSpeak = false, showShare = true, showSettings = true, showReload = false, showClear = false, showLogin = true, setShowLoginDrawer, clearHistory, loginToken, user, sessionID, showChatHistory = true, fullScreenHandler, baseUrl, onLogout, apiClient, layout, additionalSettings, showMessageConsumption = false, showFullscreen = true, extraActions, }) => {
18
19
  var _a;
19
20
  const { t, i18n } = (0, react_i18next_1.useTranslation)();
20
21
  const { add } = (0, ui_1.useAlertManager)();
@@ -227,7 +228,7 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
227
228
  const fullscreenLabel = fullScreen
228
229
  ? t('fullscreenExit') || 'Exit fullscreen'
229
230
  : t('fullscreenEnter') || 'Full screen';
230
- const isAuthenticated = !!loginToken && !!user;
231
+ const isAuthenticated = !!loginToken && !!(user === null || user === void 0 ? void 0 : user.userID);
231
232
  const isConversationStarted = Boolean(sessionID && hasUserActivatedSpeak);
232
233
  const brandTitle = ((_a = memori === null || memori === void 0 ? void 0 : memori.name) === null || _a === void 0 ? void 0 : _a.trim()) || '';
233
234
  const brandRole = (0, react_1.useMemo)(() => {
@@ -275,8 +276,8 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
275
276
  enableAudio ||
276
277
  !!(showSettings && hasSettingsContent(layout, additionalSettings)) ||
277
278
  showShare;
278
- const chatHistoryNode = showChatHistory && !!loginToken && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('write_and_speak.chatHistory') || 'Chat history', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, className: "memori-header--chat-history-button", disabled: !loginToken, "aria-label": t('write_and_speak.chatHistory') || 'Chat history', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.MessageCircle, {}), onClick: () => setShowChatHistoryDrawer(true), children: chatHistoryButtonLabel }) }) }));
279
- const loginNode = showLogin && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loginToken && user ? ((0, jsx_runtime_1.jsx)(ui_1.Popover, { className: "memori-header--dropdown", open: userPopoverOpen, onOpenChange: open => {
279
+ const chatHistoryNode = showChatHistory && !!loginToken && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('write_and_speak.chatHistory') || 'Chat history', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, className: "memori-header--chat-history-button", disabled: !loginToken, "aria-label": t('write_and_speak.chatHistory') || 'Chat history', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.MessageCircle, {}), onClick: () => setShowChatHistoryDrawer(true), children: chatHistoryButtonLabel ? ((0, jsx_runtime_1.jsx)("span", { className: "memori-header--action-label", children: chatHistoryButtonLabel })) : null }) }) }));
280
+ const loginNode = showLogin && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loginToken && (user === null || user === void 0 ? void 0 : user.userID) ? ((0, jsx_runtime_1.jsx)(ui_1.Popover, { className: "memori-header--dropdown", open: userPopoverOpen, onOpenChange: open => {
280
281
  setUserPopoverOpen(open);
281
282
  if (open) {
282
283
  setInfoPopoverOpen(false);
@@ -285,7 +286,7 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
285
286
  }, placement: "bottom-end", sideOffset: 8, closable: false, contentClassName: "memori-dropdown--menu", slotProps: {
286
287
  trigger: {
287
288
  className: (0, classnames_1.default)('memori-dropdown--user-trigger', isFullPageChrome && 'memori-dropdown--user-trigger--fullpage'),
288
- render: (props) => ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('login.user') || 'User', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { ...props, variant: buttonVariant, className: (0, classnames_1.default)('memori-dropdown--user-trigger-button', userPopoverOpen && 'memori-button--active'), "aria-label": t('login.user') || 'User', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, {}) }) }) })),
289
+ render: (props) => ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('login.user') || 'User', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { ...props, active: userPopoverOpen, variant: buttonVariant, className: "memori-dropdown--user-trigger-button", "aria-label": t('login.user') || 'User', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, {}) }) }) })),
289
290
  },
290
291
  }, content: (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--content", children: [(0, jsx_runtime_1.jsx)("div", { className: "memori-dropdown--user-item", children: (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--user-info", children: [(0, jsx_runtime_1.jsx)("div", { className: "memori-dropdown--avatar-wrap", children: user.avatarURL ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: user.avatarURL, alt: user.userName || user.eMail, className: "memori-dropdown--avatar" }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--avatar-overlay", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Camera, { size: 20, strokeWidth: 2 }) }), (0, jsx_runtime_1.jsx)("label", { htmlFor: "avatar", className: "sr-only", children: t('login.avatarChange') }), (0, jsx_runtime_1.jsx)("input", { type: "file", name: "avatar", id: "avatar", className: "memori-dropdown--avatar-input", onChange: e => {
291
292
  var _a, _b;
@@ -297,8 +298,8 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
297
298
  return updateAvatar((_b = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null);
298
299
  }, accept: utils_1.imgMimeTypes.join(', ') })] }) })) }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--user-details", children: [(0, jsx_runtime_1.jsx)("h3", { className: "memori-dropdown--user-name", children: user.userName || t('login.welcomeUser') }), (0, jsx_runtime_1.jsx)("p", { className: "memori-dropdown--user-email", children: user.eMail }), (0, jsx_runtime_1.jsx)("div", { className: "memori-dropdown--user-badge", children: user.birthDate
299
300
  ? new Date(user.birthDate).toLocaleDateString()
300
- : t('login.notSet') })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "memori-dropdown--separator" }), (0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: buttonVariant, onClick: onLogout, className: "memori-dropdown--action-button memori-dropdown--action-button--logout", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { size: 18, strokeWidth: 2, "aria-hidden": true }), children: t('login.logout') || 'Logout' })] }), children: null })) : ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('login.login') || 'Login', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: isFullPageChrome ? 'primary' : buttonVariant, className: "memori-header--button memori-header--button-login", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, {}), title: t('login.login') || 'Login', "aria-label": t('login.login') || 'Login', onClick: () => setShowLoginDrawer(true), children: isFullPageChrome ? fullpageHeaderLoginLabel : null }) }) })) }));
301
- const headerActionsBeforeChatHistory = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [memori.needsPosition && ((0, jsx_runtime_1.jsx)("div", { className: "memori-header--position", children: (0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.position') || 'Position', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(PositionPopover_1.default, { venue: position, setVenue: setVenue, open: positionPopoverOpen, onOpenChange: open => {
301
+ : t('login.notSet') })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "memori-dropdown--separator" }), (0, jsx_runtime_1.jsx)(IconButton_1.default, { type: "button", variant: buttonVariant, onClick: onLogout, className: "memori-dropdown--action-button memori-dropdown--action-button--logout", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { size: 18, strokeWidth: 2, "aria-hidden": true }), children: (0, jsx_runtime_1.jsx)("span", { className: "memori-header--action-label", children: t('login.logout') || 'Logout' }) })] }), children: null })) : ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('login.login') || 'Login', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: isFullPageChrome ? 'primary' : buttonVariant, className: "memori-header--button memori-header--button-login", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, {}), title: t('login.login') || 'Login', "aria-label": t('login.login') || 'Login', onClick: () => setShowLoginDrawer(true), children: isFullPageChrome ? fullpageHeaderLoginLabel : null }) }) })) }));
302
+ const headerActionsBeforeChatHistory = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [memori.needsPosition && ((0, jsx_runtime_1.jsx)("div", { className: "memori-header--position", children: (0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.position') || 'Position', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(PositionPopover_1.default, { venue: position, setVenue: setVenue, open: positionPopoverOpen, autoStartGeolocation: autoStartPositionGeolocation, onOpenChange: open => {
302
303
  setPositionPopoverOpen(open);
303
304
  if (open) {
304
305
  setInfoPopoverOpen(false);
@@ -306,16 +307,16 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
306
307
  }
307
308
  }, triggerButtonVariant: buttonVariant, triggerAriaLabel: t('widget.position') || 'Position', positionerClassName: layout === 'WEBSITE_ASSISTANT'
308
309
  ? 'memori-position-popover__positioner--website-assistant'
309
- : undefined }) }) }) })), showReload && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('reload') || 'Reload', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, "aria-label": t('reload') || 'Reload', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, {}), onClick: () => {
310
+ : undefined }) }) }) })), showReload && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('reload') || 'Reload', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, "aria-label": t('reload') || 'Reload', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, {}), onClick: () => {
310
311
  window.location.reload();
311
- } }) }) })), showClear && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('clearHistory') || 'Clear chat', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, "aria-label": t('clearHistory') || 'Clear chat', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Trash2, {}), onClick: () => {
312
+ } }) }) })), showClear && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('clearHistory') || 'Clear chat', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, "aria-label": t('clearHistory') || 'Clear chat', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Trash2, {}), onClick: () => {
312
313
  clearHistory();
313
314
  add((0, ui_1.createAlertOptions)({
314
315
  description: t('clearHistoryDone'),
315
316
  severity: 'success',
316
317
  }));
317
318
  } }) }) }))] }));
318
- const headerActionsAfterChatHistory = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showMessageConsumption && ((0, jsx_runtime_1.jsx)(ChatConsumptionDropdown_1.default, { history: history, triggerVariant: buttonVariant })), showFullscreen && fullScreenAvailable && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: fullscreenLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, title: fullscreenLabel, "aria-label": fullscreenLabel, icon: fullScreen ? (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Minimize, {}), onClick: fullScreenHandler ||
319
+ const headerActionsAfterChatHistory = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showMessageConsumption && ((0, jsx_runtime_1.jsx)(ChatConsumptionDropdown_1.default, { history: history, triggerVariant: buttonVariant })), showFullscreen && fullScreenAvailable && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: fullscreenLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, title: fullscreenLabel, "aria-label": fullscreenLabel, icon: fullScreen ? (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Minimize, {}), onClick: fullScreenHandler ||
319
320
  (() => {
320
321
  var _a;
321
322
  if (!document.fullscreenElement) {
@@ -362,7 +363,7 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
362
363
  !!loginToken &&
363
364
  (user === null || user === void 0 ? void 0 : user.pAndCUAccepted) &&
364
365
  hasUserActivatedSpeak &&
365
- !!sessionID && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('knownFacts.title') || 'Known facts', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Brain, {}), "aria-label": t('knownFacts.title') || 'Known facts', onClick: () => setShowKnownFactsDrawer(true) }) }) })), memori.enableBoardOfExperts && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.showExpertsInTheBoard') || 'Experts in this board', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Users, {}), disabled: !hasUserActivatedSpeak || !sessionID, "aria-label": t('widget.showExpertsInTheBoard') || 'Experts in this board', onClick: () => setShowExpertsDrawer(true) }) }) })), enableAudio && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: soundLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, icon: speakerMuted ? (0, jsx_runtime_1.jsx)(lucide_react_1.VolumeX, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Volume2, {}), title: soundLabel, "aria-label": soundLabel, onClick: () => setSpeakerMuted(!speakerMuted) }) }) })), showSettings && hasSettingsContent(layout, additionalSettings) && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.settings') || 'Settings', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Settings, {}), "aria-label": t('widget.settings') || 'Settings', onClick: () => setShowSettingsDrawer(true) }) }) })), showShare && ((0, jsx_runtime_1.jsx)(ShareButton_1.default, { title: memori.name, memori: memori, sessionID: sessionID, tenant: tenant, showQrCode: true, align: "left", baseUrl: baseUrl, history: history, triggerVariant: buttonVariant }))] }));
366
+ !!sessionID && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('knownFacts.title') || 'Known facts', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Brain, {}), "aria-label": t('knownFacts.title') || 'Known facts', onClick: () => setShowKnownFactsDrawer(true) }) }) })), memori.enableBoardOfExperts && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.showExpertsInTheBoard') || 'Experts in this board', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Users, {}), disabled: !hasUserActivatedSpeak || !sessionID, "aria-label": t('widget.showExpertsInTheBoard') || 'Experts in this board', onClick: () => setShowExpertsDrawer(true) }) }) })), enableAudio && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: soundLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, icon: speakerMuted ? (0, jsx_runtime_1.jsx)(lucide_react_1.VolumeX, { size: 20, strokeWidth: 2.35, "aria-hidden": true }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Volume2, { size: 20, strokeWidth: 2, "aria-hidden": true }), title: soundLabel, "aria-label": soundLabel, onClick: () => setSpeakerMuted(!speakerMuted) }) }) })), showSettings && hasSettingsContent(layout, additionalSettings) && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.settings') || 'Settings', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Settings, {}), "aria-label": t('widget.settings') || 'Settings', onClick: () => setShowSettingsDrawer(true) }) }) })), showShare && ((0, jsx_runtime_1.jsx)(ShareButton_1.default, { title: memori.name, memori: memori, sessionID: sessionID, tenant: tenant, showQrCode: true, align: "left", baseUrl: baseUrl, history: history, triggerVariant: buttonVariant }))] }));
366
367
  const sessionInfoConsumptionSubtitle = hasSustainabilityData
367
368
  ? `${formatImpactInReadableUnit(sustainabilityTotals.energy, 'energy', currentLocale)} • ${formatImpactInReadableUnit(sustainabilityTotals.gwp, 'co2', currentLocale)}`
368
369
  : t('widget.noData', { defaultValue: 'Nessun dato disponibile' });
@@ -374,12 +375,12 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
374
375
  }
375
376
  }, placement: "bottom-end", sideOffset: 8, closable: false, contentClassName: "memori-dropdown--menu memori-dropdown--auth-menu", slotProps: {
376
377
  trigger: {
377
- render: (props) => ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: "Info sessione", placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { ...props, variant: buttonVariant, className: (0, classnames_1.default)('memori-header--auth-icon-button', infoPopoverOpen && 'memori-button--active'), "aria-label": "Info sessione", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.MoreVertical, {}) }) }) })),
378
+ render: (props) => ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: "Info sessione", placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { ...props, active: infoPopoverOpen, variant: buttonVariant, className: "memori-header--auth-icon-button", "aria-label": "Info sessione", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.MoreVertical, {}) }) }) })),
378
379
  },
379
380
  }, content: (0, jsx_runtime_1.jsxs)("div", { className: "memori-dropdown--auth-content", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", className: "memori-dropdown--auth-row memori-dropdown--auth-row--navigable", onClick: () => {
380
381
  setShowKnownFactsDrawer(true);
381
382
  setInfoPopoverOpen(false);
382
- }, children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-icon-wrap", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Brain, { size: 16 }) }), (0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--auth-copy", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-title", children: t('knownFacts.title') || 'Known facts' }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-subtitle", children: t('widget.knownFactsHint') || 'What I remember about you' })] })] }), hasChatConsumptionData ? ((0, jsx_runtime_1.jsx)(ChatConsumptionDropdown_1.default, { history: history, triggerVariant: buttonVariant, menuAlign: "start", trigger: (triggerProps, { open }) => ((0, jsx_runtime_1.jsxs)("button", { ...triggerProps, type: "button", className: (0, classnames_1.default)('memori-dropdown--auth-row', 'memori-dropdown--auth-row--navigable', open && 'memori-dropdown--auth-row--active', triggerProps.className), children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-icon-wrap", children: (0, jsx_runtime_1.jsx)(GasStation_1.default, {}) }), (0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--auth-copy", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-title", children: t('widget.aiConsumption') || 'AI usage' }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-subtitle", children: sessionInfoConsumptionSubtitle })] }), open ? ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 16, "aria-hidden": true })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 16, "aria-hidden": true }))] })) })) : ((0, jsx_runtime_1.jsxs)("button", { type: "button", disabled: true, className: "memori-dropdown--auth-row memori-dropdown--auth-row--navigable memori-dropdown--auth-row--disabled", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-icon-wrap", children: (0, jsx_runtime_1.jsx)(GasStation_1.default, {}) }), (0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--auth-copy", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-title", children: t('widget.aiConsumption') || 'AI usage' }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-subtitle", children: sessionInfoConsumptionSubtitle })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 16, "aria-hidden": true })] }))] }), children: null })), showFullscreen && fullScreenAvailable && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: fullscreenLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, className: "memori-header--auth-icon-button", title: fullscreenLabel, "aria-label": fullscreenLabel, icon: fullScreen ? (0, jsx_runtime_1.jsx)(lucide_react_1.Minimize, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize, {}), onClick: fullScreenHandler ||
383
+ }, children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-icon-wrap", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Brain, { size: 16 }) }), (0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--auth-copy", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-title", children: t('knownFacts.title') || 'Known facts' }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-subtitle", children: t('widget.knownFactsHint') || 'What I remember about you' })] })] }), hasChatConsumptionData ? ((0, jsx_runtime_1.jsx)(ChatConsumptionDropdown_1.default, { history: history, triggerVariant: buttonVariant, menuAlign: "start", trigger: (triggerProps, { open }) => ((0, jsx_runtime_1.jsxs)("button", { ...triggerProps, type: "button", className: (0, classnames_1.default)('memori-dropdown--auth-row', 'memori-dropdown--auth-row--navigable', open && 'memori-dropdown--auth-row--active', triggerProps.className), children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-icon-wrap", children: (0, jsx_runtime_1.jsx)(GasStation_1.default, {}) }), (0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--auth-copy", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-title", children: t('widget.aiConsumption') || 'AI usage' }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-subtitle", children: sessionInfoConsumptionSubtitle })] }), open ? ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 16, "aria-hidden": true })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 16, "aria-hidden": true }))] })) })) : ((0, jsx_runtime_1.jsxs)("button", { type: "button", disabled: true, className: "memori-dropdown--auth-row memori-dropdown--auth-row--navigable memori-dropdown--auth-row--disabled", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-icon-wrap", children: (0, jsx_runtime_1.jsx)(GasStation_1.default, {}) }), (0, jsx_runtime_1.jsxs)("span", { className: "memori-dropdown--auth-copy", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-title", children: t('widget.aiConsumption') || 'AI usage' }), (0, jsx_runtime_1.jsx)("span", { className: "memori-dropdown--auth-subtitle", children: sessionInfoConsumptionSubtitle })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 16, "aria-hidden": true })] }))] }), children: null })), showFullscreen && fullScreenAvailable && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: fullscreenLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, className: "memori-header--auth-icon-button", title: fullscreenLabel, "aria-label": fullscreenLabel, icon: fullScreen ? (0, jsx_runtime_1.jsx)(lucide_react_1.Minimize, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize, {}), onClick: fullScreenHandler ||
383
384
  (() => {
384
385
  var _a;
385
386
  if (!document.fullscreenElement) {
@@ -419,7 +420,7 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
419
420
  console.warn('Error attempting to exit fullscreen:', err);
420
421
  });
421
422
  }
422
- }) }) }) })), enableAudio && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: soundLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, className: "memori-header--auth-icon-button", title: soundLabel, "aria-label": soundLabel, icon: speakerMuted ? (0, jsx_runtime_1.jsx)(lucide_react_1.VolumeX, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Volume2, {}), onClick: () => setSpeakerMuted(!speakerMuted) }) }) })), memori.needsPosition && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.position') || 'Position', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(PositionPopover_1.default, { venue: position, setVenue: setVenue, open: positionPopoverOpen, onOpenChange: open => {
423
+ }) }) }) })), enableAudio && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: soundLabel, placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, className: "memori-header--auth-icon-button", title: soundLabel, "aria-label": soundLabel, icon: speakerMuted ? (0, jsx_runtime_1.jsx)(lucide_react_1.VolumeX, { size: 20, strokeWidth: 2.35, "aria-hidden": true }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Volume2, { size: 20, strokeWidth: 2, "aria-hidden": true }), onClick: () => setSpeakerMuted(!speakerMuted) }) }) })), memori.needsPosition && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: t('widget.position') || 'Position', placement: "bottom", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(PositionPopover_1.default, { venue: position, setVenue: setVenue, open: positionPopoverOpen, autoStartGeolocation: autoStartPositionGeolocation, onOpenChange: open => {
423
424
  setPositionPopoverOpen(open);
424
425
  if (open) {
425
426
  setInfoPopoverOpen(false);
@@ -452,7 +453,7 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
452
453
  !!(user === null || user === void 0 ? void 0 : user.pAndCUAccepted) &&
453
454
  hasUserActivatedSpeak &&
454
455
  !!sessionID;
455
- const totemRail = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('memori-totem-rail', className), role: "toolbar", "aria-label": String(t('widget.sessionControls', { defaultValue: 'Controlli' })), "aria-orientation": "vertical", children: [(0, jsx_runtime_1.jsxs)("div", { className: "memori-totem-rail--group", children: [enableAudio && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: soundLabel, placement: "left", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, className: "memori-totem-rail--button", icon: speakerMuted ? (0, jsx_runtime_1.jsx)(lucide_react_1.VolumeX, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Volume2, {}), title: soundLabel, "aria-label": soundLabel, "aria-pressed": speakerMuted, onClick: () => setSpeakerMuted(!speakerMuted) }) }) })), showFullscreen && fullScreenAvailable && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: fullscreenLabel, placement: "left", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { variant: buttonVariant, className: "memori-totem-rail--button", icon: fullScreen ? (0, jsx_runtime_1.jsx)(lucide_react_1.Minimize, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize, {}), title: fullscreenLabel, "aria-label": fullscreenLabel, "aria-pressed": fullScreen, onClick: handleTotemFullscreen }) }) })), showShare && ((0, jsx_runtime_1.jsx)(ShareButton_1.default, { title: memori.name, memori: memori, sessionID: sessionID, tenant: tenant, showQrCode: true, align: "left", baseUrl: baseUrl, history: history, triggerVariant: buttonVariant, className: "memori-totem-rail--button" }))] }), (0, jsx_runtime_1.jsx)("div", { className: "memori-totem-rail--divider", "aria-hidden": "true" }), (0, jsx_runtime_1.jsx)("div", { className: "memori-totem-rail--group", children: (0, jsx_runtime_1.jsx)(ui_1.Popover, { className: "memori-header--dropdown", open: userPopoverOpen, onOpenChange: open => {
456
+ const totemRail = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('memori-totem-rail', className), role: "toolbar", "aria-label": String(t('widget.sessionControls', { defaultValue: 'Controlli' })), "aria-orientation": "vertical", children: [(0, jsx_runtime_1.jsxs)("div", { className: "memori-totem-rail--group", children: [enableAudio && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: soundLabel, placement: "left", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, className: "memori-totem-rail--button", icon: speakerMuted ? (0, jsx_runtime_1.jsx)(lucide_react_1.VolumeX, { size: 20, strokeWidth: 2.35, "aria-hidden": true }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Volume2, { size: 20, strokeWidth: 2, "aria-hidden": true }), title: soundLabel, "aria-label": soundLabel, "aria-pressed": speakerMuted, onClick: () => setSpeakerMuted(!speakerMuted) }) }) })), showFullscreen && fullScreenAvailable && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: fullscreenLabel, placement: "left", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { variant: buttonVariant, className: "memori-totem-rail--button", icon: fullScreen ? (0, jsx_runtime_1.jsx)(lucide_react_1.Minimize, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize, {}), title: fullscreenLabel, "aria-label": fullscreenLabel, "aria-pressed": fullScreen, onClick: handleTotemFullscreen }) }) })), showShare && ((0, jsx_runtime_1.jsx)(ShareButton_1.default, { title: memori.name, memori: memori, sessionID: sessionID, tenant: tenant, showQrCode: true, align: "left", baseUrl: baseUrl, history: history, triggerVariant: buttonVariant, className: "memori-totem-rail--button" }))] }), (0, jsx_runtime_1.jsx)("div", { className: "memori-totem-rail--divider", "aria-hidden": "true" }), (0, jsx_runtime_1.jsx)("div", { className: "memori-totem-rail--group", children: (0, jsx_runtime_1.jsx)(ui_1.Popover, { className: "memori-header--dropdown", open: userPopoverOpen, onOpenChange: open => {
456
457
  setUserPopoverOpen(open);
457
458
  if (open) {
458
459
  setInfoPopoverOpen(false);
@@ -460,9 +461,9 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
460
461
  }
461
462
  }, placement: "left-start", sideOffset: 8, closable: false, contentClassName: "memori-dropdown--menu memori-totem-rail--menu", slotProps: {
462
463
  trigger: {
463
- render: (props) => ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: totemAccountLabel, placement: "left", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(ui_1.Button, { ...props, variant: buttonVariant, className: (0, classnames_1.default)('memori-totem-rail--button', 'memori-totem-rail--account-trigger', userPopoverOpen && 'memori-button--active'), title: totemAccountLabel, "aria-label": totemAccountLabel, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, {}) }) }) })),
464
+ render: (props) => ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { title: totemAccountLabel, placement: "left", children: (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { ...props, active: userPopoverOpen, variant: buttonVariant, className: (0, classnames_1.default)('memori-totem-rail--button', 'memori-totem-rail--account-trigger'), title: totemAccountLabel, "aria-label": totemAccountLabel, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, {}) }) }) })),
464
465
  },
465
- }, content: (0, jsx_runtime_1.jsxs)("div", { className: "memori-totem-rail--menu-content", children: [isAuthenticated && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-totem-rail--menu-identity", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-totem-rail--menu-identity-name", children: (user === null || user === void 0 ? void 0 : user.userName) || t('login.welcomeUser') }), (user === null || user === void 0 ? void 0 : user.eMail) && ((0, jsx_runtime_1.jsx)("span", { className: "memori-totem-rail--menu-identity-email", children: user.eMail }))] })), showReload && ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { size: 18, "aria-hidden": true }), title: totemResetLabel, "aria-label": totemResetLabel, onClick: () => {
466
+ }, content: (0, jsx_runtime_1.jsxs)("div", { className: "memori-totem-rail--menu-content", children: [showLogin && isAuthenticated && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-totem-rail--menu-identity", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-totem-rail--menu-identity-name", children: (user === null || user === void 0 ? void 0 : user.userName) || t('login.welcomeUser') }), (user === null || user === void 0 ? void 0 : user.eMail) && ((0, jsx_runtime_1.jsx)("span", { className: "memori-totem-rail--menu-identity-email", children: user.eMail }))] })), showReload && ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { size: 18, "aria-hidden": true }), title: totemResetLabel, "aria-label": totemResetLabel, onClick: () => {
466
467
  setUserPopoverOpen(false);
467
468
  window.location.reload();
468
469
  }, children: totemResetLabel })), totemShowSettings && ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Settings, { size: 18, "aria-hidden": true }), title: totemSettingsLabel, "aria-label": totemSettingsLabel, onClick: () => {
@@ -471,13 +472,14 @@ const Header = ({ className, buttonVariant = 'ghost', memori, tenant, history, p
471
472
  }, children: totemSettingsLabel })), totemShowKnownFacts && ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Brain, { size: 18, "aria-hidden": true }), title: totemKnownFactsLabel, "aria-label": totemKnownFactsLabel, onClick: () => {
472
473
  setUserPopoverOpen(false);
473
474
  setShowKnownFactsDrawer(true);
474
- }, children: totemKnownFactsLabel })), isAuthenticated ? ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item memori-totem-rail--menu-item--logout", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { size: 18, "aria-hidden": true }), title: t('login.logout') || 'Logout', "aria-label": t('login.logout') || 'Logout', onClick: () => {
475
- setUserPopoverOpen(false);
476
- onLogout === null || onLogout === void 0 ? void 0 : onLogout();
477
- }, children: t('login.logout') || 'Logout' })) : (showLogin && ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, { size: 18, "aria-hidden": true }), title: t('login.login') || 'Login', "aria-label": t('login.login') || 'Login', onClick: () => {
478
- setUserPopoverOpen(false);
479
- setShowLoginDrawer(true);
480
- }, children: t('login.login') || 'Login' })))] }), children: null }) })] }));
475
+ }, children: totemKnownFactsLabel })), showLogin &&
476
+ (isAuthenticated ? ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item memori-totem-rail--menu-item--logout", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { size: 18, "aria-hidden": true }), title: t('login.logout') || 'Logout', "aria-label": t('login.logout') || 'Logout', onClick: () => {
477
+ setUserPopoverOpen(false);
478
+ onLogout === null || onLogout === void 0 ? void 0 : onLogout();
479
+ }, children: t('login.logout') || 'Logout' })) : ((0, jsx_runtime_1.jsx)(ui_1.Button, { type: "button", variant: "ghost", className: "memori-totem-rail--menu-item", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.User, { size: 18, "aria-hidden": true }), title: t('login.login') || 'Login', "aria-label": t('login.login') || 'Login', onClick: () => {
480
+ setUserPopoverOpen(false);
481
+ setShowLoginDrawer(true);
482
+ }, children: t('login.login') || 'Login' })))] }), children: null }) })] }));
481
483
  const headerControls = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('memori-header', className, isFullPageChrome && 'memori-header--fullpage', fullpageGuestChrome && 'memori-header--fullpage-guest'), children: [isFullPageChrome && isAuthenticated ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [fullpagePrimaryHasContent && ((0, jsx_runtime_1.jsx)("div", { className: "memori-header--fullpage-primary", children: chatHistoryNode })), fullpagePrimaryHasContent &&
482
484
  showFullpageChromeDividers &&
483
485
  !fullpageGuestChrome && ((0, jsx_runtime_1.jsx)("div", { className: "memori-header--fullpage-divider", "aria-hidden": "true" })), (0, jsx_runtime_1.jsxs)("div", { className: "memori-header--fullpage-secondary", children: [loggedInFullpageRightControls, showFullpageChromeDividers && ((0, jsx_runtime_1.jsx)("div", { className: "memori-header--fullpage-divider", "aria-hidden": "true" })), loginNode] })] })) : isFullPageChrome ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [fullpagePrimaryHasContent && ((0, jsx_runtime_1.jsx)("div", { className: "memori-header--fullpage-primary", children: chatHistoryNode })), fullpagePrimaryHasContent &&