@memberjunction/ng-conversations 5.43.0 → 5.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +0 -1
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js +56 -52
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +3 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +52 -52
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.js +10 -14
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.d.ts +3 -1
- package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.js +56 -56
- package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts +3 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.js +10 -7
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts +3 -1
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +29 -41
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +4 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +134 -166
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.d.ts +103 -0
- package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -0
- package/dist/lib/components/composer/ai-composer.component.js +263 -0
- package/dist/lib/components/composer/ai-composer.component.js.map +1 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +76 -12
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +522 -158
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.js +6 -9
- package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/library/library-full-view.component.js +20 -24
- package/dist/lib/components/library/library-full-view.component.js.map +1 -1
- package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
- package/dist/lib/components/members/members-modal.component.js +10 -11
- package/dist/lib/components/members/members-modal.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +87 -23
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +245 -158
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +11 -3
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +73 -21
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.js +6 -9
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +4 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +9 -4
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +45 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +10 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +46 -0
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/channels/client-context-channel.js +174 -0
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.d.ts +123 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.js +397 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.js.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-state.d.ts +103 -0
- package/dist/lib/components/realtime/media/media-channel-state.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-state.js +143 -0
- package/dist/lib/components/realtime/media/media-channel-state.js.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-tools.d.ts +24 -0
- package/dist/lib/components/realtime/media/media-channel-tools.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-tools.js +107 -0
- package/dist/lib/components/realtime/media/media-channel-tools.js.map +1 -0
- package/dist/lib/components/realtime/media/media-channel.d.ts +89 -0
- package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/media-channel.js +253 -0
- package/dist/lib/components/realtime/media/media-channel.js.map +1 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts +141 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.js +574 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +59 -14
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.js +277 -74
- package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +28 -27
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js +144 -143
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +12 -0
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +105 -43
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-audio-visuals.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +41 -7
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +216 -102
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +0 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +67 -71
- package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +364 -44
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +839 -153
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.d.ts +5 -5
- package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts +70 -0
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tab-style.js +115 -0
- package/dist/lib/components/realtime/realtime-surface-tab-style.js.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +55 -57
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js +165 -143
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +80 -71
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +83 -113
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.d.ts +270 -0
- package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-ui-config.js +212 -0
- package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -0
- package/dist/lib/components/search/search-panel.component.d.ts +2 -0
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
- package/dist/lib/components/search/search-panel.component.js +92 -101
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/share/share-modal.component.js +10 -11
- package/dist/lib/components/share/share-modal.component.js.map +1 -1
- package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
- package/dist/lib/components/shared/user-picker.component.js +12 -15
- package/dist/lib/components/shared/user-picker.component.js.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +11 -3
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +34 -10
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts +73 -0
- package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -0
- package/dist/lib/components/sidebar/routines-section.component.js +211 -0
- package/dist/lib/components/sidebar/routines-section.component.js.map +1 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +12 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js +37 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +16 -5
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +51 -31
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/composer-plugins/agent-mention.provider.d.ts +16 -0
- package/dist/lib/composer-plugins/agent-mention.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/agent-mention.provider.js +28 -0
- package/dist/lib/composer-plugins/agent-mention.provider.js.map +1 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +20 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js +32 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -0
- package/dist/lib/composer-plugins/load-composer-plugins.d.ts +9 -0
- package/dist/lib/composer-plugins/load-composer-plugins.d.ts.map +1 -0
- package/dist/lib/composer-plugins/load-composer-plugins.js +17 -0
- package/dist/lib/composer-plugins/load-composer-plugins.js.map +1 -0
- package/dist/lib/composer-plugins/record-mention.provider.d.ts +14 -0
- package/dist/lib/composer-plugins/record-mention.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/record-mention.provider.js +26 -0
- package/dist/lib/composer-plugins/record-mention.provider.js.map +1 -0
- package/dist/lib/composer-plugins/skill-command.provider.d.ts +15 -0
- package/dist/lib/composer-plugins/skill-command.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/skill-command.provider.js +27 -0
- package/dist/lib/composer-plugins/skill-command.provider.js.map +1 -0
- package/dist/lib/conversations.module.d.ts +68 -64
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +69 -18
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/models/conversation-state.model.d.ts +6 -3
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
- package/dist/lib/models/conversation-state.model.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +9 -2
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +26 -2
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-attachment.service.js.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.d.ts +42 -19
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +113 -18
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.d.ts +143 -0
- package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -0
- package/dist/lib/services/realtime-audio-recorder.js +379 -0
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -0
- package/dist/lib/services/realtime-pcm-wav.d.ts +75 -0
- package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -0
- package/dist/lib/services/realtime-pcm-wav.js +205 -0
- package/dist/lib/services/realtime-pcm-wav.js.map +1 -0
- package/dist/lib/services/realtime-session-review.service.d.ts +28 -1
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +12 -3
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +210 -20
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +452 -21
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/realtime-sessions-adapter.js +1 -1
- package/dist/lib/services/realtime-sessions-adapter.js.map +1 -1
- package/dist/lib/services/ui-command-handler.service.d.ts +7 -2
- package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
- package/dist/lib/services/ui-command-handler.service.js +6 -2
- package/dist/lib/services/ui-command-handler.service.js.map +1 -1
- package/dist/lib/utils/plan-mode-preference.d.ts +62 -0
- package/dist/lib/utils/plan-mode-preference.d.ts.map +1 -0
- package/dist/lib/utils/plan-mode-preference.js +130 -0
- package/dist/lib/utils/plan-mode-preference.js.map +1 -0
- package/dist/public-api.d.ts +29 -3
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +46 -3
- package/dist/public-api.js.map +1 -1
- package/package.json +30 -26
- package/dist/__tests__/attachment-badge.test.d.ts +0 -2
- package/dist/__tests__/attachment-badge.test.d.ts.map +0 -1
- package/dist/__tests__/attachment-badge.test.js +0 -66
- package/dist/__tests__/attachment-badge.test.js.map +0 -1
- package/dist/__tests__/channel-optional-surface.test.d.ts +0 -2
- package/dist/__tests__/channel-optional-surface.test.d.ts.map +0 -1
- package/dist/__tests__/channel-optional-surface.test.js +0 -53
- package/dist/__tests__/channel-optional-surface.test.js.map +0 -1
- package/dist/__tests__/chat-events.test.d.ts +0 -14
- package/dist/__tests__/chat-events.test.d.ts.map +0 -1
- package/dist/__tests__/chat-events.test.js +0 -109
- package/dist/__tests__/chat-events.test.js.map +0 -1
- package/dist/__tests__/collections-full-view.test.d.ts +0 -2
- package/dist/__tests__/collections-full-view.test.d.ts.map +0 -1
- package/dist/__tests__/collections-full-view.test.js +0 -225
- package/dist/__tests__/collections-full-view.test.js.map +0 -1
- package/dist/__tests__/conversation-cache.test.d.ts +0 -2
- package/dist/__tests__/conversation-cache.test.d.ts.map +0 -1
- package/dist/__tests__/conversation-cache.test.js +0 -233
- package/dist/__tests__/conversation-cache.test.js.map +0 -1
- package/dist/__tests__/conversation-naming.test.d.ts +0 -2
- package/dist/__tests__/conversation-naming.test.d.ts.map +0 -1
- package/dist/__tests__/conversation-naming.test.js +0 -110
- package/dist/__tests__/conversation-naming.test.js.map +0 -1
- package/dist/__tests__/delegation-result-parser.test.d.ts +0 -2
- package/dist/__tests__/delegation-result-parser.test.d.ts.map +0 -1
- package/dist/__tests__/delegation-result-parser.test.js +0 -107
- package/dist/__tests__/delegation-result-parser.test.js.map +0 -1
- package/dist/__tests__/distinct-artifacts.test.d.ts +0 -2
- package/dist/__tests__/distinct-artifacts.test.d.ts.map +0 -1
- package/dist/__tests__/distinct-artifacts.test.js +0 -56
- package/dist/__tests__/distinct-artifacts.test.js.map +0 -1
- package/dist/__tests__/event-wiring.test.d.ts +0 -15
- package/dist/__tests__/event-wiring.test.d.ts.map +0 -1
- package/dist/__tests__/event-wiring.test.js +0 -100
- package/dist/__tests__/event-wiring.test.js.map +0 -1
- package/dist/__tests__/index.test.d.ts +0 -2
- package/dist/__tests__/index.test.d.ts.map +0 -1
- package/dist/__tests__/index.test.js +0 -7
- package/dist/__tests__/index.test.js.map +0 -1
- package/dist/__tests__/narration-template.test.d.ts +0 -2
- package/dist/__tests__/narration-template.test.d.ts.map +0 -1
- package/dist/__tests__/narration-template.test.js +0 -76
- package/dist/__tests__/narration-template.test.js.map +0 -1
- package/dist/__tests__/notification-model.test.d.ts +0 -2
- package/dist/__tests__/notification-model.test.d.ts.map +0 -1
- package/dist/__tests__/notification-model.test.js +0 -68
- package/dist/__tests__/notification-model.test.js.map +0 -1
- package/dist/__tests__/realtime-agent-picker-models.test.d.ts +0 -2
- package/dist/__tests__/realtime-agent-picker-models.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-agent-picker-models.test.js +0 -49
- package/dist/__tests__/realtime-agent-picker-models.test.js.map +0 -1
- package/dist/__tests__/realtime-audio-visuals.test.d.ts +0 -2
- package/dist/__tests__/realtime-audio-visuals.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-audio-visuals.test.js +0 -123
- package/dist/__tests__/realtime-audio-visuals.test.js.map +0 -1
- package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts +0 -2
- package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-delegation-card-cancel.test.js +0 -48
- package/dist/__tests__/realtime-delegation-card-cancel.test.js.map +0 -1
- package/dist/__tests__/realtime-disclosure.test.d.ts +0 -2
- package/dist/__tests__/realtime-disclosure.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-disclosure.test.js +0 -164
- package/dist/__tests__/realtime-disclosure.test.js.map +0 -1
- package/dist/__tests__/realtime-pairing.test.d.ts +0 -2
- package/dist/__tests__/realtime-pairing.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-pairing.test.js +0 -207
- package/dist/__tests__/realtime-pairing.test.js.map +0 -1
- package/dist/__tests__/realtime-review-lifecycle.test.d.ts +0 -2
- package/dist/__tests__/realtime-review-lifecycle.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-review-lifecycle.test.js +0 -154
- package/dist/__tests__/realtime-review-lifecycle.test.js.map +0 -1
- package/dist/__tests__/realtime-session-cancel-usage.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-cancel-usage.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-cancel-usage.test.js +0 -230
- package/dist/__tests__/realtime-session-cancel-usage.test.js.map +0 -1
- package/dist/__tests__/realtime-session-channels.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-channels.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-channels.test.js +0 -252
- package/dist/__tests__/realtime-session-channels.test.js.map +0 -1
- package/dist/__tests__/realtime-session-client-tools.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-client-tools.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-client-tools.test.js +0 -103
- package/dist/__tests__/realtime-session-client-tools.test.js.map +0 -1
- package/dist/__tests__/realtime-session-minimized.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-minimized.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-minimized.test.js +0 -32
- package/dist/__tests__/realtime-session-minimized.test.js.map +0 -1
- package/dist/__tests__/realtime-session-mint.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-mint.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-mint.test.js +0 -69
- package/dist/__tests__/realtime-session-mint.test.js.map +0 -1
- package/dist/__tests__/realtime-session-policy.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-policy.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-policy.test.js +0 -303
- package/dist/__tests__/realtime-session-policy.test.js.map +0 -1
- package/dist/__tests__/realtime-session-review.service.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-review.service.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-review.service.test.js +0 -743
- package/dist/__tests__/realtime-session-review.service.test.js.map +0 -1
- package/dist/__tests__/realtime-session-state.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-state.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-state.test.js +0 -83
- package/dist/__tests__/realtime-session-state.test.js.map +0 -1
- package/dist/__tests__/realtime-session-timeline-card.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-timeline-card.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-timeline-card.test.js +0 -106
- package/dist/__tests__/realtime-session-timeline-card.test.js.map +0 -1
- package/dist/__tests__/realtime-session-timeline.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-timeline.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-timeline.test.js +0 -142
- package/dist/__tests__/realtime-session-timeline.test.js.map +0 -1
- package/dist/__tests__/realtime-sessions-adapter.test.d.ts +0 -19
- package/dist/__tests__/realtime-sessions-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-sessions-adapter.test.js +0 -188
- package/dist/__tests__/realtime-sessions-adapter.test.js.map +0 -1
- package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts +0 -2
- package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-surface-panel-prefs.test.js +0 -100
- package/dist/__tests__/realtime-surface-panel-prefs.test.js.map +0 -1
- package/dist/__tests__/realtime-surface-tabs-model.test.d.ts +0 -2
- package/dist/__tests__/realtime-surface-tabs-model.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-surface-tabs-model.test.js +0 -193
- package/dist/__tests__/realtime-surface-tabs-model.test.js.map +0 -1
- package/dist/__tests__/remote-browser-audio-player.test.d.ts +0 -2
- package/dist/__tests__/remote-browser-audio-player.test.d.ts.map +0 -1
- package/dist/__tests__/remote-browser-audio-player.test.js +0 -137
- package/dist/__tests__/remote-browser-audio-player.test.js.map +0 -1
- package/dist/__tests__/remote-browser-channel.test.d.ts +0 -2
- package/dist/__tests__/remote-browser-channel.test.d.ts.map +0 -1
- package/dist/__tests__/remote-browser-channel.test.js +0 -585
- package/dist/__tests__/remote-browser-channel.test.js.map +0 -1
- package/dist/__tests__/search-service.test.d.ts +0 -2
- package/dist/__tests__/search-service.test.d.ts.map +0 -1
- package/dist/__tests__/search-service.test.js +0 -114
- package/dist/__tests__/search-service.test.js.map +0 -1
- package/dist/__tests__/slot-defaults.test.d.ts +0 -24
- package/dist/__tests__/slot-defaults.test.d.ts.map +0 -1
- package/dist/__tests__/slot-defaults.test.js +0 -63
- package/dist/__tests__/slot-defaults.test.js.map +0 -1
- package/dist/__tests__/toast-service.test.d.ts +0 -2
- package/dist/__tests__/toast-service.test.d.ts.map +0 -1
- package/dist/__tests__/toast-service.test.js +0 -143
- package/dist/__tests__/toast-service.test.js.map +0 -1
- package/dist/__tests__/user-authorization.test.d.ts +0 -2
- package/dist/__tests__/user-authorization.test.d.ts.map +0 -1
- package/dist/__tests__/user-authorization.test.js +0 -97
- package/dist/__tests__/user-authorization.test.js.map +0 -1
- package/dist/__tests__/voice-session-narration.test.d.ts +0 -2
- package/dist/__tests__/voice-session-narration.test.d.ts.map +0 -1
- package/dist/__tests__/voice-session-narration.test.js +0 -609
- package/dist/__tests__/voice-session-narration.test.js.map +0 -1
- package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts +0 -2
- package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts.map +0 -1
- package/dist/__tests__/whiteboard-artifact-viewer.test.js +0 -101
- package/dist/__tests__/whiteboard-artifact-viewer.test.js.map +0 -1
- package/dist/__tests__/whiteboard-channel.test.d.ts +0 -2
- package/dist/__tests__/whiteboard-channel.test.d.ts.map +0 -1
- package/dist/__tests__/whiteboard-channel.test.js +0 -260
- package/dist/__tests__/whiteboard-channel.test.js.map +0 -1
- package/dist/__tests__/whiteboard-restore-state.test.d.ts +0 -2
- package/dist/__tests__/whiteboard-restore-state.test.d.ts.map +0 -1
- package/dist/__tests__/whiteboard-restore-state.test.js +0 -108
- package/dist/__tests__/whiteboard-restore-state.test.js.map +0 -1
- package/dist/lib/components/mention/mention-dropdown.component.d.ts +0 -53
- package/dist/lib/components/mention/mention-dropdown.component.d.ts.map +0 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +0 -276
- package/dist/lib/components/mention/mention-dropdown.component.js.map +0 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts +0 -256
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +0 -1
- package/dist/lib/components/mention/mention-editor.component.js +0 -1233
- package/dist/lib/components/mention/mention-editor.component.js.map +0 -1
- package/dist/lib/components/message/message-input-box.component.d.ts +0 -137
- package/dist/lib/components/message/message-input-box.component.d.ts.map +0 -1
- package/dist/lib/components/message/message-input-box.component.js +0 -321
- package/dist/lib/components/message/message-input-box.component.js.map +0 -1
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
8
|
+
import { BaseRealtimeChannelClient } from '../channels/base-realtime-channel-client';
|
|
9
|
+
import { MEDIA_TOOL_DEFINITIONS, MEDIA_TOOL_NAMES, MEDIA_TOOL_PREFIX } from './media-channel-tools';
|
|
10
|
+
import { MediaChannelState } from './media-channel-state';
|
|
11
|
+
import { RealtimeMediaSurfaceComponent } from './realtime-media-surface.component';
|
|
12
|
+
/** Coerces a parsed arg to a non-empty string, or `undefined` when absent / wrong-typed. */
|
|
13
|
+
function asString(value) {
|
|
14
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
15
|
+
}
|
|
16
|
+
/** Coerces a parsed arg to a finite number, or `undefined` when absent / wrong-typed. */
|
|
17
|
+
function asNumber(value) {
|
|
18
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
19
|
+
}
|
|
20
|
+
/** The media types `Media_ShowMedia` accepts (validated before mutating state). */
|
|
21
|
+
const VALID_MEDIA_TYPES = ['image', 'video', 'audio', 'pdf', 'web'];
|
|
22
|
+
/**
|
|
23
|
+
* The shared MEDIA SURFACE as a pluggable interactive channel — a {@link BaseRealtimeChannelClient}
|
|
24
|
+
* resolved from the `MJ: AI Agent Channels` registry row whose `ClientPluginClass` is
|
|
25
|
+
* `'RealtimeMediaChannel'`. One instance per session (created via ClassFactory at session start).
|
|
26
|
+
*
|
|
27
|
+
* It owns a {@link MediaChannelState} engine and contributes the channel's full contract:
|
|
28
|
+
*
|
|
29
|
+
* - **Action**: the `Media_*` client-executed tool set ({@link MEDIA_TOOL_DEFINITIONS});
|
|
30
|
+
* {@link ApplyAgentTool} parses the args, mutates the state engine, returns a short JSON result
|
|
31
|
+
* string, and sends the model a `[media]` background context note (so it stays aware of what's
|
|
32
|
+
* on screen). Works with NO surface bound — the tools mutate the state engine directly.
|
|
33
|
+
* - **Surface**: {@link RealtimeMediaSurfaceComponent}, created dynamically by the overlay's
|
|
34
|
+
* channel tab; {@link BindSurface} hands it the shared state engine + agent name.
|
|
35
|
+
* - **State of record**: every mutation requests a debounced save of {@link MediaChannelState.ToJSON}
|
|
36
|
+
* under channel name `'Media'`; a prior session's media is rehydrated via {@link RestoreState}.
|
|
37
|
+
*
|
|
38
|
+
* Modeled directly on `RealtimeWhiteboardChannel`.
|
|
39
|
+
*/
|
|
40
|
+
let RealtimeMediaChannel = class RealtimeMediaChannel extends BaseRealtimeChannelClient {
|
|
41
|
+
/** The media state of record — created fresh with the plugin (one per session). */
|
|
42
|
+
State = new MediaChannelState();
|
|
43
|
+
/** The live bound surface, when the channel tab's pane is instantiated. */
|
|
44
|
+
surface = null;
|
|
45
|
+
/** Media-mutation subscription driving the debounced state-of-record save. */
|
|
46
|
+
stateChangedSub = null;
|
|
47
|
+
get ChannelName() {
|
|
48
|
+
return 'Media';
|
|
49
|
+
}
|
|
50
|
+
get ToolNamePrefix() {
|
|
51
|
+
return MEDIA_TOOL_PREFIX;
|
|
52
|
+
}
|
|
53
|
+
get TabTitle() {
|
|
54
|
+
return 'Media';
|
|
55
|
+
}
|
|
56
|
+
get TabIcon() {
|
|
57
|
+
return 'fa-solid fa-images';
|
|
58
|
+
}
|
|
59
|
+
GetToolDefinitions() {
|
|
60
|
+
return MEDIA_TOOL_DEFINITIONS;
|
|
61
|
+
}
|
|
62
|
+
GetSurfaceComponent() {
|
|
63
|
+
return RealtimeMediaSurfaceComponent;
|
|
64
|
+
}
|
|
65
|
+
/** First-run intro shown the first time the user opens the Media tab (once per user). */
|
|
66
|
+
GetOnboardingDetails() {
|
|
67
|
+
return {
|
|
68
|
+
Heading: 'Media',
|
|
69
|
+
Description: 'A shared surface where the agent can show you visuals during the call — images, videos, ' +
|
|
70
|
+
'audio clips, PDFs and web pages. Each item opens in its own tab; the agent can switch ' +
|
|
71
|
+
'between them and highlight regions to point at exactly what it means.',
|
|
72
|
+
Tips: [
|
|
73
|
+
'Switch between shared items using the tabs along the top.',
|
|
74
|
+
'The agent can highlight part of an image or page to draw your eye to it.',
|
|
75
|
+
'Open any item in a new browser tab or download it from the toolbar.',
|
|
76
|
+
],
|
|
77
|
+
IconClass: 'fa-solid fa-images',
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** Persist the media surface (host-debounced) on EVERY mutation — agent tools and tab changes. */
|
|
81
|
+
OnInitialize() {
|
|
82
|
+
this.stateChangedSub = this.State.Changed$.subscribe(() => {
|
|
83
|
+
this.Context?.RequestSave(this.State.ToJSON());
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Wires the dynamically-created media surface (before first CD): shared state engine + agent name,
|
|
88
|
+
* plus the live session's MJ provider so FileID-backed items stream securely (mj-storage-media-player
|
|
89
|
+
* + CreateMediaAccessToken) under the SAME authenticated, multi-provider-safe provider.
|
|
90
|
+
*/
|
|
91
|
+
BindSurface(instance) {
|
|
92
|
+
this.surface = instance;
|
|
93
|
+
instance.State = this.State;
|
|
94
|
+
instance.AgentName = this.Context?.AgentName ?? 'The agent';
|
|
95
|
+
instance.Provider = this.Context?.Provider ?? null;
|
|
96
|
+
}
|
|
97
|
+
UnbindSurface() {
|
|
98
|
+
this.surface = null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Executes one `Media_*` tool call LOCALLY: parse args, mutate the state engine, push a `[media]`
|
|
102
|
+
* background context note so the agent stays aware of the surface, and return a short JSON result
|
|
103
|
+
* string for the model. Never throws — malformed args resolve to a `{ success: false, error }`
|
|
104
|
+
* payload the model can narrate. Works with or without a bound surface (it mutates the state engine,
|
|
105
|
+
* which the surface observes).
|
|
106
|
+
*/
|
|
107
|
+
ApplyAgentTool(toolName, argsJson) {
|
|
108
|
+
let args = {};
|
|
109
|
+
try {
|
|
110
|
+
const parsed = argsJson ? JSON.parse(argsJson) : {};
|
|
111
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
112
|
+
args = parsed;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return this.fail(`Could not parse arguments for ${toolName}.`);
|
|
117
|
+
}
|
|
118
|
+
switch (toolName) {
|
|
119
|
+
case MEDIA_TOOL_NAMES.ShowMedia:
|
|
120
|
+
return this.applyShowMedia(args);
|
|
121
|
+
case MEDIA_TOOL_NAMES.CloseMedia:
|
|
122
|
+
return this.applyCloseMedia(args);
|
|
123
|
+
case MEDIA_TOOL_NAMES.PlayMedia:
|
|
124
|
+
return this.applyPlayMedia(args);
|
|
125
|
+
case MEDIA_TOOL_NAMES.Highlight:
|
|
126
|
+
return this.applyHighlight(args);
|
|
127
|
+
case MEDIA_TOOL_NAMES.ClearAll:
|
|
128
|
+
return this.applyClearAll();
|
|
129
|
+
default:
|
|
130
|
+
return this.fail(`Unknown Media tool "${toolName}".`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/** Adds a media item and makes it active. Source is a public `url` OR an MJStorage `fileId` (>=1 required). */
|
|
134
|
+
applyShowMedia(args) {
|
|
135
|
+
const mediaType = asString(args['mediaType']);
|
|
136
|
+
const url = asString(args['url']);
|
|
137
|
+
const fileId = asString(args['fileId']);
|
|
138
|
+
const displayName = asString(args['displayName']);
|
|
139
|
+
if (!mediaType || !VALID_MEDIA_TYPES.includes(mediaType)) {
|
|
140
|
+
return this.fail('Media_ShowMedia requires a "mediaType" of image | video | audio | pdf | web.');
|
|
141
|
+
}
|
|
142
|
+
if (!url && !fileId) {
|
|
143
|
+
return this.fail('Media_ShowMedia requires a source — provide a "url" (external/public) OR a "fileId" (an MJ: Files id).');
|
|
144
|
+
}
|
|
145
|
+
if (!displayName) {
|
|
146
|
+
return this.fail('Media_ShowMedia requires a "displayName".');
|
|
147
|
+
}
|
|
148
|
+
const item = this.State.AddItem({
|
|
149
|
+
Type: mediaType,
|
|
150
|
+
Url: url,
|
|
151
|
+
FileID: fileId,
|
|
152
|
+
DisplayName: displayName,
|
|
153
|
+
Caption: asString(args['caption']),
|
|
154
|
+
});
|
|
155
|
+
this.note(`now showing ${mediaType} "${displayName}"`);
|
|
156
|
+
return JSON.stringify({ success: true, id: item.Id, active: true });
|
|
157
|
+
}
|
|
158
|
+
/** Closes a media item. */
|
|
159
|
+
applyCloseMedia(args) {
|
|
160
|
+
const id = asString(args['id']);
|
|
161
|
+
if (!id) {
|
|
162
|
+
return this.fail('Media_CloseMedia requires an "id".');
|
|
163
|
+
}
|
|
164
|
+
const removed = this.State.RemoveItem(id);
|
|
165
|
+
if (!removed) {
|
|
166
|
+
return this.fail(`No media item with id "${id}".`);
|
|
167
|
+
}
|
|
168
|
+
this.note(`closed media item "${id}"`);
|
|
169
|
+
return JSON.stringify({ success: true, id });
|
|
170
|
+
}
|
|
171
|
+
/** Activates + requests playback of a media item. */
|
|
172
|
+
applyPlayMedia(args) {
|
|
173
|
+
const id = asString(args['id']);
|
|
174
|
+
if (!id) {
|
|
175
|
+
return this.fail('Media_PlayMedia requires an "id".');
|
|
176
|
+
}
|
|
177
|
+
const ok = this.State.RequestPlay(id);
|
|
178
|
+
if (!ok) {
|
|
179
|
+
return this.fail(`No media item with id "${id}".`);
|
|
180
|
+
}
|
|
181
|
+
this.note(`playing media item "${id}"`);
|
|
182
|
+
return JSON.stringify({ success: true, id });
|
|
183
|
+
}
|
|
184
|
+
/** Draws (or, with absent dims, clears) a fractional highlight on a media item. */
|
|
185
|
+
applyHighlight(args) {
|
|
186
|
+
const id = asString(args['id']);
|
|
187
|
+
if (!id) {
|
|
188
|
+
return this.fail('Media_Highlight requires an "id".');
|
|
189
|
+
}
|
|
190
|
+
const x = asNumber(args['x']);
|
|
191
|
+
const y = asNumber(args['y']);
|
|
192
|
+
const w = asNumber(args['w']);
|
|
193
|
+
const h = asNumber(args['h']);
|
|
194
|
+
if (x === undefined || y === undefined || w === undefined || h === undefined) {
|
|
195
|
+
return this.fail('Media_Highlight requires numeric fractional x, y, w, h (0..1).');
|
|
196
|
+
}
|
|
197
|
+
const highlight = { X: x, Y: y, W: w, H: h, Label: asString(args['label']) };
|
|
198
|
+
const ok = this.State.Highlight(id, highlight);
|
|
199
|
+
if (!ok) {
|
|
200
|
+
return this.fail(`No media item with id "${id}".`);
|
|
201
|
+
}
|
|
202
|
+
this.note(`highlighted a region of media item "${id}"`);
|
|
203
|
+
return JSON.stringify({ success: true, id });
|
|
204
|
+
}
|
|
205
|
+
/** Clears all media. */
|
|
206
|
+
applyClearAll() {
|
|
207
|
+
this.State.Clear();
|
|
208
|
+
this.note('cleared all media');
|
|
209
|
+
return JSON.stringify({ success: true });
|
|
210
|
+
}
|
|
211
|
+
/** The Media channel's serialized state of record (persisted under {@link ChannelName}). */
|
|
212
|
+
SerializeState() {
|
|
213
|
+
return this.State.ToJSON();
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Rehydrates a prior session's saved media into THIS session's state engine (in place — the
|
|
217
|
+
* {@link State} instance and its subscriptions are preserved). Tolerant: malformed JSON returns
|
|
218
|
+
* `false` and the surface stays empty.
|
|
219
|
+
*/
|
|
220
|
+
RestoreState(stateJson) {
|
|
221
|
+
return this.State.LoadFromJSON(stateJson);
|
|
222
|
+
}
|
|
223
|
+
Dispose() {
|
|
224
|
+
this.stateChangedSub?.unsubscribe();
|
|
225
|
+
this.stateChangedSub = null;
|
|
226
|
+
this.surface = null;
|
|
227
|
+
super.Dispose();
|
|
228
|
+
}
|
|
229
|
+
/** Builds a model-readable failure payload (never thrown — returned to the model). */
|
|
230
|
+
fail(error) {
|
|
231
|
+
return JSON.stringify({ success: false, error });
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Pushes a background context note so the agent stays aware of the surface state. Framed as
|
|
235
|
+
* background (like the whiteboard's scene-delta notes) so the model doesn't narrate every change.
|
|
236
|
+
*/
|
|
237
|
+
note(summary) {
|
|
238
|
+
this.Context?.SendContextNote(`[media] ${summary} (background context — do NOT narrate routine changes; mention only if relevant).`);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
RealtimeMediaChannel = __decorate([
|
|
242
|
+
RegisterClass(BaseRealtimeChannelClient, 'RealtimeMediaChannel')
|
|
243
|
+
], RealtimeMediaChannel);
|
|
244
|
+
export { RealtimeMediaChannel };
|
|
245
|
+
/**
|
|
246
|
+
* Tree-shaking prevention: the Media channel is resolved dynamically through the ClassFactory (by the
|
|
247
|
+
* registry row's `ClientPluginClass` key), so this static call keeps its `@RegisterClass` side effect
|
|
248
|
+
* from being eliminated by the bundler. Called alongside `LoadRealtimeWhiteboardChannel()`.
|
|
249
|
+
*/
|
|
250
|
+
export function LoadRealtimeMediaChannel() {
|
|
251
|
+
// intentional no-op — the import side effect performs the registration
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=media-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-channel.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/media/media-channel.ts"],"names":[],"mappings":";;;;;;AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,yBAAyB,EAA4B,MAAM,0CAA0C,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAiC,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAKnF,4FAA4F;AAC5F,SAAS,QAAQ,CAAC,KAA+B;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MA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hC,aAAa,CAAC,yBAAyB,EAAE,sBAAsB,CAAC;GACpD,oBAAoB,CAiOhC;;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB;IACtC,uEAAuE;AACzE,CAAC","sourcesContent":["import type { Type } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { RegisterClass } from '@memberjunction/global';\nimport { RealtimeToolDefinition } from '@memberjunction/ai';\nimport { BaseRealtimeChannelClient, ChannelOnboardingDetails } from '../channels/base-realtime-channel-client';\nimport { MEDIA_TOOL_DEFINITIONS, MEDIA_TOOL_NAMES, MEDIA_TOOL_PREFIX } from './media-channel-tools';\nimport { MediaChannelState, MediaHighlight, MediaItemType } from './media-channel-state';\nimport { RealtimeMediaSurfaceComponent } from './realtime-media-surface.component';\n\n/** A JSON-serializable value (the building block of a parsed tool-args object). */\ntype ToolArgValue = string | number | boolean | null | ToolArgValue[] | { [key: string]: ToolArgValue };\n\n/** Coerces a parsed arg to a non-empty string, or `undefined` when absent / wrong-typed. */\nfunction asString(value: ToolArgValue | undefined): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\n/** Coerces a parsed arg to a finite number, or `undefined` when absent / wrong-typed. */\nfunction asNumber(value: ToolArgValue | undefined): number | undefined {\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n}\n\n/** The media types `Media_ShowMedia` accepts (validated before mutating state). */\nconst VALID_MEDIA_TYPES: MediaItemType[] = ['image', 'video', 'audio', 'pdf', 'web'];\n\n/**\n * The shared MEDIA SURFACE as a pluggable interactive channel — a {@link BaseRealtimeChannelClient}\n * resolved from the `MJ: AI Agent Channels` registry row whose `ClientPluginClass` is\n * `'RealtimeMediaChannel'`. One instance per session (created via ClassFactory at session start).\n *\n * It owns a {@link MediaChannelState} engine and contributes the channel's full contract:\n *\n * - **Action**: the `Media_*` client-executed tool set ({@link MEDIA_TOOL_DEFINITIONS});\n * {@link ApplyAgentTool} parses the args, mutates the state engine, returns a short JSON result\n * string, and sends the model a `[media]` background context note (so it stays aware of what's\n * on screen). Works with NO surface bound — the tools mutate the state engine directly.\n * - **Surface**: {@link RealtimeMediaSurfaceComponent}, created dynamically by the overlay's\n * channel tab; {@link BindSurface} hands it the shared state engine + agent name.\n * - **State of record**: every mutation requests a debounced save of {@link MediaChannelState.ToJSON}\n * under channel name `'Media'`; a prior session's media is rehydrated via {@link RestoreState}.\n *\n * Modeled directly on `RealtimeWhiteboardChannel`.\n */\n@RegisterClass(BaseRealtimeChannelClient, 'RealtimeMediaChannel')\nexport class RealtimeMediaChannel extends BaseRealtimeChannelClient<RealtimeMediaSurfaceComponent> {\n /** The media state of record — created fresh with the plugin (one per session). */\n public readonly State = new MediaChannelState();\n\n /** The live bound surface, when the channel tab's pane is instantiated. */\n private surface: RealtimeMediaSurfaceComponent | null = null;\n /** Media-mutation subscription driving the debounced state-of-record save. */\n private stateChangedSub: Subscription | null = null;\n\n public get ChannelName(): string {\n return 'Media';\n }\n\n public get ToolNamePrefix(): string {\n return MEDIA_TOOL_PREFIX;\n }\n\n public get TabTitle(): string {\n return 'Media';\n }\n\n public get TabIcon(): string {\n return 'fa-solid fa-images';\n }\n\n public GetToolDefinitions(): RealtimeToolDefinition[] {\n return MEDIA_TOOL_DEFINITIONS;\n }\n\n public override GetSurfaceComponent(): Type<RealtimeMediaSurfaceComponent> {\n return RealtimeMediaSurfaceComponent;\n }\n\n /** First-run intro shown the first time the user opens the Media tab (once per user). */\n public override GetOnboardingDetails(): ChannelOnboardingDetails {\n return {\n Heading: 'Media',\n Description:\n 'A shared surface where the agent can show you visuals during the call — images, videos, ' +\n 'audio clips, PDFs and web pages. Each item opens in its own tab; the agent can switch ' +\n 'between them and highlight regions to point at exactly what it means.',\n Tips: [\n 'Switch between shared items using the tabs along the top.',\n 'The agent can highlight part of an image or page to draw your eye to it.',\n 'Open any item in a new browser tab or download it from the toolbar.',\n ],\n IconClass: 'fa-solid fa-images',\n };\n }\n\n /** Persist the media surface (host-debounced) on EVERY mutation — agent tools and tab changes. */\n protected override OnInitialize(): void {\n this.stateChangedSub = this.State.Changed$.subscribe(() => {\n this.Context?.RequestSave(this.State.ToJSON());\n });\n }\n\n /**\n * Wires the dynamically-created media surface (before first CD): shared state engine + agent name,\n * plus the live session's MJ provider so FileID-backed items stream securely (mj-storage-media-player\n * + CreateMediaAccessToken) under the SAME authenticated, multi-provider-safe provider.\n */\n public BindSurface(instance: RealtimeMediaSurfaceComponent): void {\n this.surface = instance;\n instance.State = this.State;\n instance.AgentName = this.Context?.AgentName ?? 'The agent';\n instance.Provider = this.Context?.Provider ?? null;\n }\n\n public override UnbindSurface(): void {\n this.surface = null;\n }\n\n /**\n * Executes one `Media_*` tool call LOCALLY: parse args, mutate the state engine, push a `[media]`\n * background context note so the agent stays aware of the surface, and return a short JSON result\n * string for the model. Never throws — malformed args resolve to a `{ success: false, error }`\n * payload the model can narrate. Works with or without a bound surface (it mutates the state engine,\n * which the surface observes).\n */\n public ApplyAgentTool(toolName: string, argsJson: string): string {\n let args: Record<string, ToolArgValue> = {};\n try {\n const parsed = argsJson ? (JSON.parse(argsJson) as unknown) : {};\n if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {\n args = parsed as Record<string, ToolArgValue>;\n }\n } catch {\n return this.fail(`Could not parse arguments for ${toolName}.`);\n }\n\n switch (toolName) {\n case MEDIA_TOOL_NAMES.ShowMedia:\n return this.applyShowMedia(args);\n case MEDIA_TOOL_NAMES.CloseMedia:\n return this.applyCloseMedia(args);\n case MEDIA_TOOL_NAMES.PlayMedia:\n return this.applyPlayMedia(args);\n case MEDIA_TOOL_NAMES.Highlight:\n return this.applyHighlight(args);\n case MEDIA_TOOL_NAMES.ClearAll:\n return this.applyClearAll();\n default:\n return this.fail(`Unknown Media tool \"${toolName}\".`);\n }\n }\n\n /** Adds a media item and makes it active. Source is a public `url` OR an MJStorage `fileId` (>=1 required). */\n private applyShowMedia(args: Record<string, ToolArgValue>): string {\n const mediaType = asString(args['mediaType']);\n const url = asString(args['url']);\n const fileId = asString(args['fileId']);\n const displayName = asString(args['displayName']);\n if (!mediaType || !VALID_MEDIA_TYPES.includes(mediaType as MediaItemType)) {\n return this.fail('Media_ShowMedia requires a \"mediaType\" of image | video | audio | pdf | web.');\n }\n if (!url && !fileId) {\n return this.fail('Media_ShowMedia requires a source — provide a \"url\" (external/public) OR a \"fileId\" (an MJ: Files id).');\n }\n if (!displayName) {\n return this.fail('Media_ShowMedia requires a \"displayName\".');\n }\n const item = this.State.AddItem({\n Type: mediaType as MediaItemType,\n Url: url,\n FileID: fileId,\n DisplayName: displayName,\n Caption: asString(args['caption']),\n });\n this.note(`now showing ${mediaType} \"${displayName}\"`);\n return JSON.stringify({ success: true, id: item.Id, active: true });\n }\n\n /** Closes a media item. */\n private applyCloseMedia(args: Record<string, ToolArgValue>): string {\n const id = asString(args['id']);\n if (!id) {\n return this.fail('Media_CloseMedia requires an \"id\".');\n }\n const removed = this.State.RemoveItem(id);\n if (!removed) {\n return this.fail(`No media item with id \"${id}\".`);\n }\n this.note(`closed media item \"${id}\"`);\n return JSON.stringify({ success: true, id });\n }\n\n /** Activates + requests playback of a media item. */\n private applyPlayMedia(args: Record<string, ToolArgValue>): string {\n const id = asString(args['id']);\n if (!id) {\n return this.fail('Media_PlayMedia requires an \"id\".');\n }\n const ok = this.State.RequestPlay(id);\n if (!ok) {\n return this.fail(`No media item with id \"${id}\".`);\n }\n this.note(`playing media item \"${id}\"`);\n return JSON.stringify({ success: true, id });\n }\n\n /** Draws (or, with absent dims, clears) a fractional highlight on a media item. */\n private applyHighlight(args: Record<string, ToolArgValue>): string {\n const id = asString(args['id']);\n if (!id) {\n return this.fail('Media_Highlight requires an \"id\".');\n }\n const x = asNumber(args['x']);\n const y = asNumber(args['y']);\n const w = asNumber(args['w']);\n const h = asNumber(args['h']);\n if (x === undefined || y === undefined || w === undefined || h === undefined) {\n return this.fail('Media_Highlight requires numeric fractional x, y, w, h (0..1).');\n }\n const highlight: MediaHighlight = { X: x, Y: y, W: w, H: h, Label: asString(args['label']) };\n const ok = this.State.Highlight(id, highlight);\n if (!ok) {\n return this.fail(`No media item with id \"${id}\".`);\n }\n this.note(`highlighted a region of media item \"${id}\"`);\n return JSON.stringify({ success: true, id });\n }\n\n /** Clears all media. */\n private applyClearAll(): string {\n this.State.Clear();\n this.note('cleared all media');\n return JSON.stringify({ success: true });\n }\n\n /** The Media channel's serialized state of record (persisted under {@link ChannelName}). */\n public override SerializeState(): string | null {\n return this.State.ToJSON();\n }\n\n /**\n * Rehydrates a prior session's saved media into THIS session's state engine (in place — the\n * {@link State} instance and its subscriptions are preserved). Tolerant: malformed JSON returns\n * `false` and the surface stays empty.\n */\n public override RestoreState(stateJson: string): boolean {\n return this.State.LoadFromJSON(stateJson);\n }\n\n public override Dispose(): void {\n this.stateChangedSub?.unsubscribe();\n this.stateChangedSub = null;\n this.surface = null;\n super.Dispose();\n }\n\n /** Builds a model-readable failure payload (never thrown — returned to the model). */\n private fail(error: string): string {\n return JSON.stringify({ success: false, error });\n }\n\n /**\n * Pushes a background context note so the agent stays aware of the surface state. Framed as\n * background (like the whiteboard's scene-delta notes) so the model doesn't narrate every change.\n */\n private note(summary: string): void {\n this.Context?.SendContextNote(\n `[media] ${summary} (background context — do NOT narrate routine changes; mention only if relevant).`,\n );\n }\n}\n\n/**\n * Tree-shaking prevention: the Media channel is resolved dynamically through the ClassFactory (by the\n * registry row's `ClientPluginClass` key), so this static call keeps its `@RegisterClass` side effect\n * from being eliminated by the bundler. Called alongside `LoadRealtimeWhiteboardChannel()`.\n */\nexport function LoadRealtimeMediaChannel(): void {\n // intentional no-op — the import side effect performs the registration\n}\n"]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { SafeResourceUrl } from '@angular/platform-browser';
|
|
3
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
4
|
+
import { MediaTrack } from '@memberjunction/ng-media-player';
|
|
5
|
+
import { MediaChannelState, MediaItem } from './media-channel-state';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/** The per-item resolution status for FileID-backed image/pdf/web panes (audio/video resolve in the player). */
|
|
8
|
+
export type FileResolveState = {
|
|
9
|
+
Status: 'loading';
|
|
10
|
+
} | {
|
|
11
|
+
Status: 'ready';
|
|
12
|
+
Url: string;
|
|
13
|
+
} | {
|
|
14
|
+
Status: 'error';
|
|
15
|
+
Message: string;
|
|
16
|
+
};
|
|
17
|
+
/** The render route chosen for a {@link MediaItem} (pure function of its source + type). */
|
|
18
|
+
export type MediaRenderRoute = 'storage-player' | 'url-player' | 'iframe-or-img' | 'none';
|
|
19
|
+
/** Whether an item is rendered by the real media player (audio/video) vs. an img/iframe pane. */
|
|
20
|
+
export declare function IsPlayerMediaType(item: MediaItem): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Decides which render path an item uses based ONLY on its source + type — the single source of truth
|
|
23
|
+
* the surface methods delegate to (kept pure so it's unit-testable without an Angular context):
|
|
24
|
+
* - audio/video + FileID → `'storage-player'` (`mj-storage-media-player`, secure streaming)
|
|
25
|
+
* - audio/video + Url → `'url-player'` (`mj-media-player`, public URL)
|
|
26
|
+
* - image/pdf/web → `'iframe-or-img'` (img/iframe; FileID resolves a streaming URL first)
|
|
27
|
+
* - no usable source → `'none'`
|
|
28
|
+
*/
|
|
29
|
+
export declare function RouteForMediaItem(item: MediaItem): MediaRenderRoute;
|
|
30
|
+
/**
|
|
31
|
+
* LIVE MEDIA surface (`mj-realtime-media-surface`) — the Media channel tab's pane, rendered with a
|
|
32
|
+
* TABS layout: a horizontal tab bar (one tab per {@link MediaItem}, type icon + name) over a single
|
|
33
|
+
* media pane that swaps as you switch tabs. Pure PERCEPTION of the channel's {@link MediaChannelState}:
|
|
34
|
+
* the agent's `Media_*` tools mutate the state through the channel plugin and this surface re-renders.
|
|
35
|
+
*
|
|
36
|
+
* SOURCE-AWARE rendering. Each item is backed by EITHER an external/public {@link MediaItem.Url} or an
|
|
37
|
+
* MemberJunction {@link MediaItem.FileID} (an `MJ: Files` id, streamed securely + permission-gated):
|
|
38
|
+
* - **audio/video + FileID** → `<mj-storage-media-player [FileID] [Provider]>` (real transport/waveform,
|
|
39
|
+
* streams over HTTP Range under the session's authenticated provider).
|
|
40
|
+
* - **audio/video + Url** → `<mj-media-player [Tracks]>` (the same real player, fed the public URL).
|
|
41
|
+
* - **image/pdf/web + FileID** → a streaming URL is resolved via `CreateMediaAccessToken` (through the
|
|
42
|
+
* channel's provider) and rendered in the existing img/iframe path; graceful no-access state on failure.
|
|
43
|
+
* - **image/pdf/web + Url** → the public URL, rendered unchanged.
|
|
44
|
+
*
|
|
45
|
+
* Multi-provider safe: the channel plugin threads the live session's `IMetadataProvider` in via the
|
|
46
|
+
* `Provider` input ({@link BaseAngularComponent}), and both the storage player and the token mutation
|
|
47
|
+
* use it ({@link ProviderToUse}) rather than the global default.
|
|
48
|
+
*/
|
|
49
|
+
export declare class RealtimeMediaSurfaceComponent extends BaseAngularComponent implements OnInit, OnDestroy {
|
|
50
|
+
/** The shared media state engine (set by the channel's BindSurface before first CD). */
|
|
51
|
+
set State(value: MediaChannelState | null);
|
|
52
|
+
get State(): MediaChannelState | null;
|
|
53
|
+
private _state;
|
|
54
|
+
/** Display name of the agent fronting the session — used in the empty-state copy. */
|
|
55
|
+
AgentName: string;
|
|
56
|
+
/** The current image zoom multiplier (cycled by the zoom button; image panes only). */
|
|
57
|
+
ImageZoom: number;
|
|
58
|
+
/** Sanitized URL cache for `web` / `pdf` iframes (Angular blocks raw resource URLs in `[src]`). */
|
|
59
|
+
private safeUrlCache;
|
|
60
|
+
/** The id of the item whose play we last actioned, so a re-render doesn't replay it. */
|
|
61
|
+
private lastPlayedStamp;
|
|
62
|
+
/**
|
|
63
|
+
* Resolution status for FileID-backed image/pdf/web items, keyed by item id. Audio/video FileID items
|
|
64
|
+
* resolve inside `mj-storage-media-player` and never enter this map.
|
|
65
|
+
*/
|
|
66
|
+
private fileResolveByItem;
|
|
67
|
+
private mediaPane?;
|
|
68
|
+
private readonly cdr;
|
|
69
|
+
private readonly sanitizer;
|
|
70
|
+
private stateSub;
|
|
71
|
+
ngOnInit(): void;
|
|
72
|
+
ngOnDestroy(): void;
|
|
73
|
+
/** The items currently on the surface (empty when no state is bound). */
|
|
74
|
+
get Items(): MediaItem[];
|
|
75
|
+
/** The active item, or `null` when the surface is empty. */
|
|
76
|
+
get ActiveItem(): MediaItem | null;
|
|
77
|
+
/** Whether the active id matches `item` (drives the active tab + pane). */
|
|
78
|
+
IsActive(item: MediaItem): boolean;
|
|
79
|
+
/** Whether `item` is rendered by the real media player (audio/video). */
|
|
80
|
+
IsPlayerItem(item: MediaItem): boolean;
|
|
81
|
+
/** Whether `item` is an audio/video item backed by an MJStorage FileID → `mj-storage-media-player`. */
|
|
82
|
+
UsesStoragePlayer(item: MediaItem): boolean;
|
|
83
|
+
/** Whether `item` is an audio/video item backed by a public URL → `mj-media-player`. */
|
|
84
|
+
UsesUrlPlayer(item: MediaItem): boolean;
|
|
85
|
+
/** The single-track payload for the URL-backed `mj-media-player` (audio/video). */
|
|
86
|
+
TracksFor(item: MediaItem): MediaTrack[];
|
|
87
|
+
/**
|
|
88
|
+
* The render URL for an IMG/IFRAME (image/pdf/web) item: its public {@link MediaItem.Url}, or — for a
|
|
89
|
+
* FileID-backed item — the resolved streaming URL once minted (`null` while loading / on no-access).
|
|
90
|
+
*/
|
|
91
|
+
RenderUrl(item: MediaItem): string | null;
|
|
92
|
+
/** Whether a FileID-backed image/pdf/web item is still resolving its streaming URL. */
|
|
93
|
+
IsResolving(item: MediaItem): boolean;
|
|
94
|
+
/** The no-access / load-failure message for a FileID-backed image/pdf/web item, or `null`. */
|
|
95
|
+
ResolveError(item: MediaItem): string | null;
|
|
96
|
+
/** Switches the active tab to `item`. */
|
|
97
|
+
SelectTab(item: MediaItem): void;
|
|
98
|
+
/** Keyboard handler for the tab buttons — Enter/Space activate, arrows move between tabs. */
|
|
99
|
+
OnTabKeydown(event: KeyboardEvent, index: number): void;
|
|
100
|
+
/** Closes one media item (removes its tab + pane). */
|
|
101
|
+
CloseItem(event: Event, item: MediaItem): void;
|
|
102
|
+
/** Whether the open-in-tab / download toolbar buttons are available for `item` (need a usable URL). */
|
|
103
|
+
CanOpenOrDownload(item: MediaItem): boolean;
|
|
104
|
+
/** Opens the active media in a new browser tab (its public or resolved streaming URL). */
|
|
105
|
+
OpenInNew(item: MediaItem): void;
|
|
106
|
+
/** Triggers a browser download of the active media via a transient anchor (public or resolved URL). */
|
|
107
|
+
Download(item: MediaItem): void;
|
|
108
|
+
/** Cycles the image zoom multiplier through {@link IMAGE_ZOOM_LEVELS}. */
|
|
109
|
+
CycleZoom(): void;
|
|
110
|
+
/** The Font Awesome icon class for a media type's tab. */
|
|
111
|
+
IconFor(type: MediaItem['Type']): string;
|
|
112
|
+
/** A memoized sanitized resource URL for iframe-rendered media (web / pdf). */
|
|
113
|
+
SafeUrl(url: string): SafeResourceUrl;
|
|
114
|
+
/** Inline style for the fractional highlight rectangle (percentages of the pane box). */
|
|
115
|
+
HighlightStyle(item: MediaItem): Record<string, string> | null;
|
|
116
|
+
/** Stable `@for` track for tab/pane diffing. */
|
|
117
|
+
TrackById(_index: number, item: MediaItem): string;
|
|
118
|
+
/** Re-subscribes the state's Changed$ stream (called on state input change + ngOnInit). */
|
|
119
|
+
private resubscribe;
|
|
120
|
+
/**
|
|
121
|
+
* Mints streaming URLs for any FileID-backed image/pdf/web items not yet resolved (audio/video FileID
|
|
122
|
+
* items resolve inside the storage player, so they're skipped). Idempotent — each item is resolved
|
|
123
|
+
* once; a `loading`/`ready`/`error` entry guards against re-firing on every state change.
|
|
124
|
+
*/
|
|
125
|
+
private resolvePendingFileUrls;
|
|
126
|
+
/** Resolves one file id to a secure streaming URL via the channel's provider, then re-renders. */
|
|
127
|
+
private resolveFileUrl;
|
|
128
|
+
/** Mints an authenticated streaming-URL token for one file id via the active provider. */
|
|
129
|
+
private mintAccessToken;
|
|
130
|
+
/**
|
|
131
|
+
* Honors a pending {@link MediaItem.PlayRequestedAt} stamp on the active video/audio element by
|
|
132
|
+
* calling `.play()` once per new stamp (so a routine re-render never replays the media). Only applies
|
|
133
|
+
* to the URL-backed `<mj-media-player>` / raw-element panes; the storage player owns its own autoplay.
|
|
134
|
+
*/
|
|
135
|
+
private applyPendingPlay;
|
|
136
|
+
/** Moves keyboard focus to the tab button at `index` (arrow-key navigation). */
|
|
137
|
+
private focusTabButton;
|
|
138
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RealtimeMediaSurfaceComponent, never>;
|
|
139
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RealtimeMediaSurfaceComponent, "mj-realtime-media-surface", never, { "State": { "alias": "State"; "required": false; }; "AgentName": { "alias": "AgentName"; "required": false; }; }, {}, never, never, true, never>;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=realtime-media-surface.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime-media-surface.component.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/media/realtime-media-surface.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACqE,SAAS,EAAE,MAAM,EAE5F,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAgB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAyD,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACpH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;;AA0BrE,gHAAgH;AAChH,MAAM,MAAM,gBAAgB,GACxB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE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