@opencx/widget-react 4.0.62 → 5.0.0-beta.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/Chart.impl-BnzKZLOH.js +153 -0
- package/dist/Chart.impl-BnzKZLOH.js.map +1 -0
- package/dist/Chart.impl-DOSb1NJk.cjs +2 -0
- package/dist/Chart.impl-DOSb1NJk.cjs.map +1 -0
- package/dist/index-BCiFOCVT.js +11548 -0
- package/dist/index-BCiFOCVT.js.map +1 -0
- package/dist/index-CqbztkwP.cjs +234 -0
- package/dist/index-CqbztkwP.cjs.map +1 -0
- package/dist/index.cjs +1 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -3391
- package/dist/index.js.map +1 -1
- package/dist/package.json.d.ts +82 -0
- package/dist/src/WidgetImperativeHandler.d.ts +1 -0
- package/dist/src/WidgetImperativeHandler.d.ts.map +1 -1
- package/dist/src/WidgetPopoverContent.d.ts.map +1 -1
- package/dist/src/WidgetPopoverTrigger.d.ts.map +1 -1
- package/dist/src/__tests__/motion-contract.spec.d.ts +2 -0
- package/dist/src/__tests__/motion-contract.spec.d.ts.map +1 -0
- package/dist/src/companion/CompanionContent.d.ts +30 -0
- package/dist/src/companion/CompanionContent.d.ts.map +1 -0
- package/dist/src/companion/CompanionFaceIcon.d.ts +15 -0
- package/dist/src/companion/CompanionFaceIcon.d.ts.map +1 -0
- package/dist/src/companion/CompanionFrame.d.ts +19 -0
- package/dist/src/companion/CompanionFrame.d.ts.map +1 -0
- package/dist/src/companion/FrameIconButton.d.ts +15 -0
- package/dist/src/companion/FrameIconButton.d.ts.map +1 -0
- package/dist/src/companion/LayoutPicker.d.ts +7 -0
- package/dist/src/companion/LayoutPicker.d.ts.map +1 -0
- package/dist/src/companion/PanelControls.d.ts +15 -0
- package/dist/src/companion/PanelControls.d.ts.map +1 -0
- package/dist/src/companion/RestingPill.d.ts +14 -0
- package/dist/src/companion/RestingPill.d.ts.map +1 -0
- package/dist/src/companion/SidebarSubmenu.d.ts +21 -0
- package/dist/src/companion/SidebarSubmenu.d.ts.map +1 -0
- package/dist/src/companion/WidgetCompanion.d.ts +3 -0
- package/dist/src/companion/WidgetCompanion.d.ts.map +1 -0
- package/dist/src/companion/__tests__/app-frame.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/app-frame.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/companion-dismissal.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/companion-dismissal.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/companion-focus.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/companion-focus.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/companion-frame.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/companion-frame.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/companion-geometry.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/companion-geometry.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/companion-keyboard.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/companion-keyboard.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/host-scroll-lock.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/host-scroll-lock.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/layout-picker.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/layout-picker.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/message-styles.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/message-styles.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/use-companion-host-effects.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/use-companion-host-effects.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/use-companion-measurements.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/use-companion-measurements.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/use-host-portal.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/use-host-portal.spec.d.ts.map +1 -0
- package/dist/src/companion/__tests__/use-persisted-pill-drag.spec.d.ts +2 -0
- package/dist/src/companion/__tests__/use-persisted-pill-drag.spec.d.ts.map +1 -0
- package/dist/src/companion/app-frame.d.ts +13 -0
- package/dist/src/companion/app-frame.d.ts.map +1 -0
- package/dist/src/companion/companion-dismissal.d.ts +21 -0
- package/dist/src/companion/companion-dismissal.d.ts.map +1 -0
- package/dist/src/companion/companion-geometry.d.ts +101 -0
- package/dist/src/companion/companion-geometry.d.ts.map +1 -0
- package/dist/src/companion/companion-keyboard.d.ts +43 -0
- package/dist/src/companion/companion-keyboard.d.ts.map +1 -0
- package/dist/src/companion/host-scroll-lock.d.ts +5 -0
- package/dist/src/companion/host-scroll-lock.d.ts.map +1 -0
- package/dist/src/companion/layout-glyphs.d.ts +14 -0
- package/dist/src/companion/layout-glyphs.d.ts.map +1 -0
- package/dist/src/companion/message-styles.d.ts +2 -0
- package/dist/src/companion/message-styles.d.ts.map +1 -0
- package/dist/src/companion/types.d.ts +3 -0
- package/dist/src/companion/types.d.ts.map +1 -0
- package/dist/src/companion/useCompanionHostEffects.d.ts +46 -0
- package/dist/src/companion/useCompanionHostEffects.d.ts.map +1 -0
- package/dist/src/companion/useCompanionMeasurements.d.ts +12 -0
- package/dist/src/companion/useCompanionMeasurements.d.ts.map +1 -0
- package/dist/src/companion/useHostPortal.d.ts +22 -0
- package/dist/src/companion/useHostPortal.d.ts.map +1 -0
- package/dist/src/companion/usePersistedPillDrag.d.ts +29 -0
- package/dist/src/companion/usePersistedPillDrag.d.ts.map +1 -0
- package/dist/src/components/AgentAvatar.d.ts.map +1 -1
- package/dist/src/components/AgentMessageGroup.d.ts +6 -1
- package/dist/src/components/AgentMessageGroup.d.ts.map +1 -1
- package/dist/src/components/ClarificationQuestions.d.ts +17 -0
- package/dist/src/components/ClarificationQuestions.d.ts.map +1 -0
- package/dist/src/components/Dialoger.d.ts.map +1 -1
- package/dist/src/components/FrameDocument.d.ts +31 -0
- package/dist/src/components/FrameDocument.d.ts.map +1 -0
- package/dist/src/components/GroupTimestamp.d.ts.map +1 -1
- package/dist/src/components/Header.d.ts +7 -0
- package/dist/src/components/Header.d.ts.map +1 -1
- package/dist/src/components/MessageActions.d.ts +21 -0
- package/dist/src/components/MessageActions.d.ts.map +1 -0
- package/dist/src/components/RichText.d.ts.map +1 -1
- package/dist/src/components/StepsGroup.d.ts +10 -0
- package/dist/src/components/StepsGroup.d.ts.map +1 -0
- package/dist/src/components/StreamingTurn.d.ts +33 -0
- package/dist/src/components/StreamingTurn.d.ts.map +1 -0
- package/dist/src/components/UserMessage.d.ts.map +1 -1
- package/dist/src/components/ZoomableImage.d.ts +1 -1
- package/dist/src/components/ZoomableImage.d.ts.map +1 -1
- package/dist/src/components/__tests__/clarification-questions.spec.d.ts +2 -0
- package/dist/src/components/__tests__/clarification-questions.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/dialoger-escape.spec.d.ts +2 -0
- package/dist/src/components/__tests__/dialoger-escape.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/header-title.spec.d.ts +2 -0
- package/dist/src/components/__tests__/header-title.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/message-actions.spec.d.ts +2 -0
- package/dist/src/components/__tests__/message-actions.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/rich-text-sanitize.spec.d.ts +2 -0
- package/dist/src/components/__tests__/rich-text-sanitize.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/steps-group-collapse.spec.d.ts +2 -0
- package/dist/src/components/__tests__/steps-group-collapse.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/steps-reasoning-markdown.spec.d.ts +2 -0
- package/dist/src/components/__tests__/steps-reasoning-markdown.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/steps-tool-io.spec.d.ts +2 -0
- package/dist/src/components/__tests__/steps-tool-io.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/streaming-turn-customization.spec.d.ts +2 -0
- package/dist/src/components/__tests__/streaming-turn-customization.spec.d.ts.map +1 -0
- package/dist/src/components/__tests__/streaming-turn-working.spec.d.ts +2 -0
- package/dist/src/components/__tests__/streaming-turn-working.spec.d.ts.map +1 -0
- package/dist/src/components/custom-components/AgentMessageDefaultComponent.d.ts.map +1 -1
- package/dist/src/components/custom-components/__tests__/agent-message-spec-history.spec.d.ts +2 -0
- package/dist/src/components/custom-components/__tests__/agent-message-spec-history.spec.d.ts.map +1 -0
- package/dist/src/components/lib/BrailleSpinner.d.ts +10 -0
- package/dist/src/components/lib/BrailleSpinner.d.ts.map +1 -0
- package/dist/src/components/lib/DynamicIcon.d.ts.map +1 -1
- package/dist/src/components/lib/MotionDiv.d.ts.map +1 -1
- package/dist/src/components/lib/MotionDiv__VerticalReveal.d.ts.map +1 -1
- package/dist/src/components/lib/badge.d.ts +1 -1
- package/dist/src/components/lib/button.d.ts +2 -2
- package/dist/src/components/lib/input.d.ts.map +1 -1
- package/dist/src/components/lib/tooltip.d.ts +18 -2
- package/dist/src/components/lib/tooltip.d.ts.map +1 -1
- package/dist/src/hooks/useCanHover.d.ts +8 -0
- package/dist/src/hooks/useCanHover.d.ts.map +1 -0
- package/dist/src/hooks/useTheme.d.ts +17 -2
- package/dist/src/hooks/useTheme.d.ts.map +1 -1
- package/dist/src/hooks/useTranslation.d.ts +3 -2
- package/dist/src/hooks/useTranslation.d.ts.map +1 -1
- package/dist/src/hooks/useTriggerLabel.d.ts +6 -0
- package/dist/src/hooks/useTriggerLabel.d.ts.map +1 -0
- package/dist/src/index.d.ts +12 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/json-render/Chart.d.ts +4 -0
- package/dist/src/json-render/Chart.d.ts.map +1 -0
- package/dist/src/json-render/Chart.impl.d.ts +4 -0
- package/dist/src/json-render/Chart.impl.d.ts.map +1 -0
- package/dist/src/json-render/JsonRenderErrorBoundary.d.ts +27 -0
- package/dist/src/json-render/JsonRenderErrorBoundary.d.ts.map +1 -0
- package/dist/src/json-render/SpecRenderer.d.ts +28 -0
- package/dist/src/json-render/SpecRenderer.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/catalog.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/catalog.spec.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/chart.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/chart.spec.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/json-render-error-boundary.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/json-render-error-boundary.spec.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/normalize-spec.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/normalize-spec.spec.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/phone-agent-card.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/phone-agent-card.spec.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/props.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/props.spec.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/segment-content.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/segment-content.spec.d.ts.map +1 -0
- package/dist/src/json-render/__tests__/spec-renderer.spec.d.ts +2 -0
- package/dist/src/json-render/__tests__/spec-renderer.spec.d.ts.map +1 -0
- package/dist/src/json-render/catalog.d.ts +260 -0
- package/dist/src/json-render/catalog.d.ts.map +1 -0
- package/dist/src/json-render/host.d.ts +27 -0
- package/dist/src/json-render/host.d.ts.map +1 -0
- package/dist/src/json-render/index.d.ts +12 -0
- package/dist/src/json-render/index.d.ts.map +1 -0
- package/dist/src/json-render/normalize-spec.d.ts +22 -0
- package/dist/src/json-render/normalize-spec.d.ts.map +1 -0
- package/dist/src/json-render/props.d.ts +207 -0
- package/dist/src/json-render/props.d.ts.map +1 -0
- package/dist/src/json-render/registry.d.ts +5 -0
- package/dist/src/json-render/registry.d.ts.map +1 -0
- package/dist/src/json-render/segment-content.d.ts +25 -0
- package/dist/src/json-render/segment-content.d.ts.map +1 -0
- package/dist/src/json-render/ui-prompt.d.ts +22 -0
- package/dist/src/json-render/ui-prompt.d.ts.map +1 -0
- package/dist/src/motion.d.ts +55 -0
- package/dist/src/motion.d.ts.map +1 -0
- package/dist/src/page-context/PageContextPill.d.ts +17 -0
- package/dist/src/page-context/PageContextPill.d.ts.map +1 -0
- package/dist/src/page-context/usePageEntity.d.ts +15 -0
- package/dist/src/page-context/usePageEntity.d.ts.map +1 -0
- package/dist/src/page-marks/MarkThumbnail.d.ts +19 -0
- package/dist/src/page-marks/MarkThumbnail.d.ts.map +1 -0
- package/dist/src/page-marks/PageMarkOverlay.d.ts +23 -0
- package/dist/src/page-marks/PageMarkOverlay.d.ts.map +1 -0
- package/dist/src/page-marks/PageMarkPill.d.ts +16 -0
- package/dist/src/page-marks/PageMarkPill.d.ts.map +1 -0
- package/dist/src/page-marks/PageMarksProvider.d.ts +21 -0
- package/dist/src/page-marks/PageMarksProvider.d.ts.map +1 -0
- package/dist/src/page-marks/SentMarkChip.d.ts +15 -0
- package/dist/src/page-marks/SentMarkChip.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/agent-mark.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/agent-mark.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/mark-snapshot-upload.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/mark-snapshot-upload.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/page-element-name.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/page-element-name.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/page-element.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/page-element.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/page-mark-pill.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/page-mark-pill.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/page-mark-theme.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/page-mark-theme.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/page-mark-tile.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/page-mark-tile.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/page-marks-provider.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/page-marks-provider.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/picked-elements.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/picked-elements.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/sent-mark-chip.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/sent-mark-chip.spec.d.ts.map +1 -0
- package/dist/src/page-marks/__tests__/use-page-marking.spec.d.ts +2 -0
- package/dist/src/page-marks/__tests__/use-page-marking.spec.d.ts.map +1 -0
- package/dist/src/page-marks/agent-mark.d.ts +37 -0
- package/dist/src/page-marks/agent-mark.d.ts.map +1 -0
- package/dist/src/page-marks/mark-thumbnail.d.ts +25 -0
- package/dist/src/page-marks/mark-thumbnail.d.ts.map +1 -0
- package/dist/src/page-marks/page-element.d.ts +89 -0
- package/dist/src/page-marks/page-element.d.ts.map +1 -0
- package/dist/src/page-marks/page-mark-theme.d.ts +30 -0
- package/dist/src/page-marks/page-mark-theme.d.ts.map +1 -0
- package/dist/src/page-marks/page-mark.d.ts +103 -0
- package/dist/src/page-marks/page-mark.d.ts.map +1 -0
- package/dist/src/page-marks/useMarkThumbnail.d.ts +8 -0
- package/dist/src/page-marks/useMarkThumbnail.d.ts.map +1 -0
- package/dist/src/page-marks/usePageMarking.d.ts +53 -0
- package/dist/src/page-marks/usePageMarking.d.ts.map +1 -0
- package/dist/src/screens/chat/ChatCanvas.d.ts.map +1 -1
- package/dist/src/screens/chat/ChatFooter.d.ts.map +1 -1
- package/dist/src/screens/chat/ChatFooterItems.d.ts.map +1 -1
- package/dist/src/screens/chat/ChatInput.d.ts +27 -0
- package/dist/src/screens/chat/ChatInput.d.ts.map +1 -0
- package/dist/src/screens/chat/ChatMain.d.ts.map +1 -1
- package/dist/src/screens/chat/DictationMicButton.d.ts +18 -0
- package/dist/src/screens/chat/DictationMicButton.d.ts.map +1 -0
- package/dist/src/screens/chat/InitialMessages.d.ts +7 -1
- package/dist/src/screens/chat/InitialMessages.d.ts.map +1 -1
- package/dist/src/screens/chat/MentionPicker.d.ts +39 -0
- package/dist/src/screens/chat/MentionPicker.d.ts.map +1 -0
- package/dist/src/screens/chat/MentionText.d.ts +16 -0
- package/dist/src/screens/chat/MentionText.d.ts.map +1 -0
- package/dist/src/screens/chat/MessageGroups.d.ts +12 -0
- package/dist/src/screens/chat/MessageGroups.d.ts.map +1 -0
- package/dist/src/screens/chat/UploadPreview.d.ts +23 -0
- package/dist/src/screens/chat/UploadPreview.d.ts.map +1 -0
- package/dist/src/screens/chat/__tests__/chat-input-clarification.spec.d.ts +2 -0
- package/dist/src/screens/chat/__tests__/chat-input-clarification.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/__tests__/chatInput.spec.d.ts +2 -0
- package/dist/src/screens/chat/__tests__/chatInput.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/__tests__/use-mentions.spec.d.ts +2 -0
- package/dist/src/screens/chat/__tests__/use-mentions.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/__tests__/useSentTextRecall.spec.d.ts +2 -0
- package/dist/src/screens/chat/__tests__/useSentTextRecall.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/AgentChatMain.d.ts +16 -0
- package/dist/src/screens/chat/agent/AgentChatMain.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/AgentChatPageEffects.d.ts +9 -0
- package/dist/src/screens/chat/agent/AgentChatPageEffects.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/QueuedSendsPill.d.ts +18 -0
- package/dist/src/screens/chat/agent/QueuedSendsPill.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/__tests__/agent-chat-main.promotion.spec.d.ts +2 -0
- package/dist/src/screens/chat/agent/__tests__/agent-chat-main.promotion.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/__tests__/agent-chat-page-effects.spec.d.ts +2 -0
- package/dist/src/screens/chat/agent/__tests__/agent-chat-page-effects.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/__tests__/scroll-follow.utils.spec.d.ts +2 -0
- package/dist/src/screens/chat/agent/__tests__/scroll-follow.utils.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/__tests__/useStreamFollow.spec.d.ts +2 -0
- package/dist/src/screens/chat/agent/__tests__/useStreamFollow.spec.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/scroll-follow.utils.d.ts +17 -0
- package/dist/src/screens/chat/agent/scroll-follow.utils.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/useStreamFollow.d.ts +23 -0
- package/dist/src/screens/chat/agent/useStreamFollow.d.ts.map +1 -0
- package/dist/src/screens/chat/caret-position.d.ts +19 -0
- package/dist/src/screens/chat/caret-position.d.ts.map +1 -0
- package/dist/src/screens/chat/composer-styles.d.ts +21 -0
- package/dist/src/screens/chat/composer-styles.d.ts.map +1 -0
- package/dist/src/screens/chat/index.d.ts.map +1 -1
- package/dist/src/screens/chat/useMentions.d.ts +60 -0
- package/dist/src/screens/chat/useMentions.d.ts.map +1 -0
- package/dist/src/screens/chat/usePageMarkComposer.d.ts +25 -0
- package/dist/src/screens/chat/usePageMarkComposer.d.ts.map +1 -0
- package/dist/src/screens/chat/useSentTextRecall.d.ts +29 -0
- package/dist/src/screens/chat/useSentTextRecall.d.ts.map +1 -0
- package/dist/src/screens/sessions/index.d.ts.map +1 -1
- package/dist/src/utils/__tests__/keybindings.spec.d.ts +2 -0
- package/dist/src/utils/__tests__/keybindings.spec.d.ts.map +1 -0
- package/dist/src/utils/__tests__/strip-citation-refs.spec.d.ts +2 -0
- package/dist/src/utils/__tests__/strip-citation-refs.spec.d.ts.map +1 -0
- package/dist/src/utils/__tests__/strip-inline-markdown.spec.d.ts +2 -0
- package/dist/src/utils/__tests__/strip-inline-markdown.spec.d.ts.map +1 -0
- package/dist/src/utils/group-messages-by-type.d.ts +1 -2
- package/dist/src/utils/group-messages-by-type.d.ts.map +1 -1
- package/dist/src/utils/keybindings.d.ts +24 -0
- package/dist/src/utils/keybindings.d.ts.map +1 -0
- package/dist/src/utils/render-custom-trigger.d.ts +11 -0
- package/dist/src/utils/render-custom-trigger.d.ts.map +1 -0
- package/dist/src/utils/strip-citation-refs.d.ts +10 -0
- package/dist/src/utils/strip-citation-refs.d.ts.map +1 -0
- package/dist/src/utils/strip-inline-markdown.d.ts +14 -0
- package/dist/src/utils/strip-inline-markdown.d.ts.map +1 -0
- package/package.json +18 -8
- package/dist/src/components/lib/dropdown-menu.d.ts +0 -28
- package/dist/src/components/lib/dropdown-menu.d.ts.map +0 -1
- package/dist/src/components/lib/popover.d.ts +0 -9
- package/dist/src/components/lib/popover.d.ts.map +0 -1
- package/dist/src/components/lib/switch.d.ts +0 -5
- package/dist/src/components/lib/switch.d.ts.map +0 -1
- package/dist/src/screens/chat/AdvancedInitialMessages.d.ts +0 -3
- package/dist/src/screens/chat/AdvancedInitialMessages.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3394 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { clsx as Yr } from "clsx";
|
|
8
|
-
import { twMerge as Xr } from "tailwind-merge";
|
|
9
|
-
import { motion as re, AnimatePresence as _ } from "framer-motion";
|
|
10
|
-
import { Slot as qr } from "@radix-ui/react-slot";
|
|
11
|
-
import { cva as Wt } from "class-variance-authority";
|
|
12
|
-
import Lt from "remark-gfm";
|
|
13
|
-
import Vr from "react-markdown";
|
|
14
|
-
import $t from "rehype-raw";
|
|
15
|
-
import { isExhaustive as F, isSupportedLanguage as Gr, getTranslation as Zr } from "@opencx/widget-core";
|
|
16
|
-
import * as te from "@radix-ui/react-avatar";
|
|
17
|
-
import Bt from "@uiw/react-iframe";
|
|
18
|
-
import * as ae from "@radix-ui/react-tooltip";
|
|
19
|
-
import ft from "tinycolor2";
|
|
20
|
-
import { useDropzone as Kr } from "react-dropzone";
|
|
21
|
-
import Qr from "react-use/lib/useAsyncFn";
|
|
22
|
-
import { z as fe } from "zod";
|
|
23
|
-
function x(e) {
|
|
24
|
-
return { "data-component": e };
|
|
25
|
-
}
|
|
26
|
-
const ve = [
|
|
27
|
-
{
|
|
28
|
-
kind: "csv",
|
|
29
|
-
label: "CSV",
|
|
30
|
-
mimes: ["text/csv", "application/csv"],
|
|
31
|
-
extensions: ["csv"]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
kind: "excel",
|
|
35
|
-
label: "Excel",
|
|
36
|
-
mimes: [
|
|
37
|
-
"application/vnd.ms-excel",
|
|
38
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
39
|
-
],
|
|
40
|
-
extensions: ["xls", "xlsx"]
|
|
41
|
-
}
|
|
42
|
-
], xt = Object.fromEntries(
|
|
43
|
-
ve.flatMap(
|
|
44
|
-
(e) => e.mimes.map((o) => [o, e.extensions.map((t) => `.${t}`)])
|
|
45
|
-
)
|
|
46
|
-
), vt = {
|
|
47
|
-
"video/mp4": [".mp4"],
|
|
48
|
-
"video/webm": [".webm"],
|
|
49
|
-
"video/quicktime": [".mov"]
|
|
50
|
-
};
|
|
51
|
-
function Ut({
|
|
52
|
-
type: e,
|
|
53
|
-
name: o
|
|
54
|
-
}) {
|
|
55
|
-
var s, i;
|
|
56
|
-
const t = ((s = o.split(".").pop()) == null ? void 0 : s.toLowerCase()) ?? "", n = ((i = e.toLowerCase().split(";")[0]) == null ? void 0 : i.trim()) ?? "";
|
|
57
|
-
return ve.find((a) => t && a.extensions.includes(t)) ?? ve.find((a) => n && a.mimes.includes(n)) ?? null;
|
|
58
|
-
}
|
|
59
|
-
function p(...e) {
|
|
60
|
-
return Xr(Yr(e));
|
|
61
|
-
}
|
|
62
|
-
const Q = {
|
|
63
|
-
x: 2,
|
|
64
|
-
y: 2
|
|
65
|
-
}, Y = cr(
|
|
66
|
-
Tt(
|
|
67
|
-
({ children: e, className: o, scale: t = 1.02, off: n = !1 }, s) => {
|
|
68
|
-
const [i, a] = P(!1), [l, c] = P({ x: 0, y: 0 });
|
|
69
|
-
if (n || /translate/.test(
|
|
70
|
-
e.props.className || ""
|
|
71
|
-
)) return e;
|
|
72
|
-
const h = (v) => {
|
|
73
|
-
var R, g;
|
|
74
|
-
const { clientX: C, clientY: M } = v, b = v.currentTarget.getBoundingClientRect(), S = C - (b.left + b.width / 2), I = M - (b.top + b.height / 2), E = Math.max(
|
|
75
|
-
-1,
|
|
76
|
-
Math.min(1, S / (b.width / 2))
|
|
77
|
-
), f = Math.max(
|
|
78
|
-
-1,
|
|
79
|
-
Math.min(1, I / (b.height / 2))
|
|
80
|
-
), D = E * Q.x, j = f * Q.y;
|
|
81
|
-
c({ x: D, y: j }), (g = (R = e.props).onMouseMove) == null || g.call(R, v);
|
|
82
|
-
}, k = () => {
|
|
83
|
-
var v, C;
|
|
84
|
-
a(!0), (C = (v = e.props).onMouseEnter) == null || C.call(v);
|
|
85
|
-
}, w = () => {
|
|
86
|
-
var v, C;
|
|
87
|
-
a(!1), c({ x: 0, y: 0 }), (C = (v = e.props).onMouseLeave) == null || C.call(v);
|
|
88
|
-
}, u = {
|
|
89
|
-
"--wobble-x": i ? `${l.x}px` : "0px",
|
|
90
|
-
"--wobble-y": i ? `${l.y}px` : "0px",
|
|
91
|
-
"--scale": 1 - (t - 1)
|
|
92
|
-
};
|
|
93
|
-
return Mt(e, {
|
|
94
|
-
ref: s,
|
|
95
|
-
onMouseMove: h,
|
|
96
|
-
onMouseEnter: k,
|
|
97
|
-
onMouseLeave: w,
|
|
98
|
-
style: {
|
|
99
|
-
...u,
|
|
100
|
-
...e.props.style
|
|
101
|
-
},
|
|
102
|
-
className: p(
|
|
103
|
-
"translate-x-[var(--wobble-x)]",
|
|
104
|
-
"translate-y-[var(--wobble-y)]",
|
|
105
|
-
"hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",
|
|
106
|
-
o,
|
|
107
|
-
e.props.className,
|
|
108
|
-
"transition-all ease-out"
|
|
109
|
-
)
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
)
|
|
113
|
-
);
|
|
114
|
-
Y.displayName = "Wobble";
|
|
115
|
-
const Jr = 10, eo = (e, o, t) => ({
|
|
116
|
-
initial: { opacity: 0, x: -e, ...o.initial },
|
|
117
|
-
animate: { opacity: 1, x: 0, ...o.animate, transition: { delay: t } },
|
|
118
|
-
exit: { opacity: 0, x: e, ...o.exit }
|
|
119
|
-
}), to = (e, o, t) => ({
|
|
120
|
-
initial: { opacity: 0, x: e, ...o.initial },
|
|
121
|
-
animate: { opacity: 1, x: 0, ...o.animate, transition: { delay: t } },
|
|
122
|
-
exit: { opacity: 0, x: -e, ...o.exit }
|
|
123
|
-
}), ro = (e, o, t) => ({
|
|
124
|
-
initial: { opacity: 0, y: e, ...o.initial },
|
|
125
|
-
animate: { opacity: 1, y: 0, ...o.animate, transition: { delay: t } },
|
|
126
|
-
exit: { opacity: 0, y: -e, ...o.exit }
|
|
127
|
-
}), oo = (e, o, t) => ({
|
|
128
|
-
initial: { opacity: 0, y: -e, ...o.initial },
|
|
129
|
-
animate: { opacity: 1, y: 0, ...o.animate, transition: { delay: t } },
|
|
130
|
-
exit: { opacity: 0, y: e, ...o.exit }
|
|
131
|
-
}), no = {
|
|
132
|
-
right: eo,
|
|
133
|
-
left: to,
|
|
134
|
-
up: ro,
|
|
135
|
-
down: oo
|
|
136
|
-
}, y = Tt(
|
|
137
|
-
({
|
|
138
|
-
fadeIn: e = "down",
|
|
139
|
-
distance: o = Jr,
|
|
140
|
-
children: t,
|
|
141
|
-
snapExit: n = !1,
|
|
142
|
-
overrides: s = {},
|
|
143
|
-
delay: i = 0,
|
|
144
|
-
...a
|
|
145
|
-
}, l) => {
|
|
146
|
-
const c = e ? no[e](o, s, i) : {};
|
|
147
|
-
return n && c.exit && typeof c.exit == "object" && !Array.isArray(c.exit) && (c.exit.transition = { duration: 0 }), /* @__PURE__ */ r(re.div, { ref: l, ...a, ...c, children: t });
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
y.displayName = "MotionDiv";
|
|
151
|
-
const so = Wt(
|
|
152
|
-
p(
|
|
153
|
-
"inline-flex shrink-0 items-center justify-center gap-2",
|
|
154
|
-
"text-sm font-medium whitespace-nowrap",
|
|
155
|
-
"ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
156
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
157
|
-
"active:scale-95 hover:active:scale-95",
|
|
158
|
-
"rounded-xl",
|
|
159
|
-
"transition"
|
|
160
|
-
),
|
|
161
|
-
{
|
|
162
|
-
variants: {
|
|
163
|
-
variant: {
|
|
164
|
-
default: "bg-primary text-primary-foreground",
|
|
165
|
-
destructive: "bg-destructive text-destructive-foreground",
|
|
166
|
-
outline: "bg-background border",
|
|
167
|
-
secondary: "bg-secondary text-secondary-foreground",
|
|
168
|
-
ghost: "hover:bg-secondary",
|
|
169
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
170
|
-
},
|
|
171
|
-
size: {
|
|
172
|
-
default: "h-10 px-4 py-2",
|
|
173
|
-
sm: "py-2 px-3.5 text-xs",
|
|
174
|
-
/**
|
|
175
|
-
* This size is useful for top level buttons that needs to sit nicely inside the iframe's border radius.
|
|
176
|
-
* Having the minimum height higher than usual (the `default` variant) will make the border radius look just right.
|
|
177
|
-
*/
|
|
178
|
-
lg: "min-h-12 px-4 rounded-[20px]",
|
|
179
|
-
icon: "h-10 w-10",
|
|
180
|
-
fit: "size-fit p-2",
|
|
181
|
-
free: "p-2",
|
|
182
|
-
selfless: "p-0"
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
defaultVariants: {
|
|
186
|
-
variant: "default",
|
|
187
|
-
size: "default"
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
), N = ee.forwardRef(
|
|
191
|
-
({ className: e, variant: o = "default", size: t, asChild: n = !1, ...s }, i) => /* @__PURE__ */ r(Y, { ref: i, children: /* @__PURE__ */ r(
|
|
192
|
-
n ? qr : "button",
|
|
193
|
-
{
|
|
194
|
-
...x("ui_lib/btn"),
|
|
195
|
-
"data-variant": o,
|
|
196
|
-
className: p(so({ variant: o, size: t, className: e })),
|
|
197
|
-
...s
|
|
198
|
-
}
|
|
199
|
-
) })
|
|
200
|
-
);
|
|
201
|
-
N.displayName = "Button";
|
|
202
|
-
const Yt = dr(null);
|
|
203
|
-
function ao({ children: e }) {
|
|
204
|
-
const [o, t] = P(!1), [n, s] = P(null), i = (l) => {
|
|
205
|
-
s(l), t(!0);
|
|
206
|
-
}, a = () => {
|
|
207
|
-
t(!1), setTimeout(() => {
|
|
208
|
-
s(null);
|
|
209
|
-
}, 200);
|
|
210
|
-
};
|
|
211
|
-
return /* @__PURE__ */ d(
|
|
212
|
-
Yt.Provider,
|
|
213
|
-
{
|
|
214
|
-
value: { open: i, close: a, isOpen: o, content: n },
|
|
215
|
-
children: [
|
|
216
|
-
/* @__PURE__ */ r(io, {}),
|
|
217
|
-
e
|
|
218
|
-
]
|
|
219
|
-
}
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
function he() {
|
|
223
|
-
const e = pr(Yt);
|
|
224
|
-
return e || (console.error("useDialoger must be used within a DialogerProvider"), {
|
|
225
|
-
open: () => {
|
|
226
|
-
},
|
|
227
|
-
close: () => {
|
|
228
|
-
},
|
|
229
|
-
isOpen: !1,
|
|
230
|
-
content: null
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
function io() {
|
|
234
|
-
const { contentIframeRef: e } = O(), { isOpen: o, content: t, close: n } = he();
|
|
235
|
-
return se(() => {
|
|
236
|
-
var i, a;
|
|
237
|
-
const s = (l) => {
|
|
238
|
-
l.key === "Escape" && n();
|
|
239
|
-
};
|
|
240
|
-
return (a = (i = e == null ? void 0 : e.current) == null ? void 0 : i.contentWindow) == null || a.document.addEventListener(
|
|
241
|
-
"keydown",
|
|
242
|
-
s
|
|
243
|
-
), () => {
|
|
244
|
-
var l, c;
|
|
245
|
-
return (c = (l = e == null ? void 0 : e.current) == null ? void 0 : l.contentWindow) == null ? void 0 : c.document.removeEventListener(
|
|
246
|
-
"keydown",
|
|
247
|
-
s
|
|
248
|
-
);
|
|
249
|
-
};
|
|
250
|
-
}, []), /* @__PURE__ */ r(_, { mode: "wait", children: o && t && /* @__PURE__ */ r(
|
|
251
|
-
y,
|
|
252
|
-
{
|
|
253
|
-
overrides: {
|
|
254
|
-
initial: { y: 0 },
|
|
255
|
-
exit: { y: 0 }
|
|
256
|
-
},
|
|
257
|
-
className: "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",
|
|
258
|
-
tabIndex: -1,
|
|
259
|
-
onClick: n,
|
|
260
|
-
children: t
|
|
261
|
-
},
|
|
262
|
-
"dialog-content"
|
|
263
|
-
) });
|
|
264
|
-
}
|
|
265
|
-
function ue({
|
|
266
|
-
children: e,
|
|
267
|
-
className: o,
|
|
268
|
-
withClose: t = !1
|
|
269
|
-
}) {
|
|
270
|
-
const { close: n } = he();
|
|
271
|
-
return /* @__PURE__ */ d(
|
|
272
|
-
"div",
|
|
273
|
-
{
|
|
274
|
-
className: p(
|
|
275
|
-
"fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 rounded-3xl",
|
|
276
|
-
o
|
|
277
|
-
),
|
|
278
|
-
onClick: (s) => s.stopPropagation(),
|
|
279
|
-
children: [
|
|
280
|
-
e,
|
|
281
|
-
t && /* @__PURE__ */ d(
|
|
282
|
-
N,
|
|
283
|
-
{
|
|
284
|
-
size: "fit",
|
|
285
|
-
className: "rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",
|
|
286
|
-
onClick: n,
|
|
287
|
-
children: [
|
|
288
|
-
/* @__PURE__ */ r(gr, { className: "h-4 w-4" }),
|
|
289
|
-
/* @__PURE__ */ r("span", { className: "sr-only", children: "Close" })
|
|
290
|
-
]
|
|
291
|
-
}
|
|
292
|
-
)
|
|
293
|
-
]
|
|
294
|
-
}
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
const Se = ({
|
|
298
|
-
className: e,
|
|
299
|
-
...o
|
|
300
|
-
}) => /* @__PURE__ */ r(
|
|
301
|
-
"div",
|
|
302
|
-
{
|
|
303
|
-
className: p("flex flex-col gap-2 text-center pt-2", e),
|
|
304
|
-
...o
|
|
305
|
-
}
|
|
306
|
-
);
|
|
307
|
-
Se.displayName = "DialogerHeader";
|
|
308
|
-
const _e = ({
|
|
309
|
-
className: e,
|
|
310
|
-
...o
|
|
311
|
-
}) => /* @__PURE__ */ r(
|
|
312
|
-
"div",
|
|
313
|
-
{
|
|
314
|
-
className: p("flex flex-col gap-2 text-center", e),
|
|
315
|
-
...o
|
|
316
|
-
}
|
|
317
|
-
);
|
|
318
|
-
_e.displayName = "DialogerBody";
|
|
319
|
-
const Xt = ({
|
|
320
|
-
className: e,
|
|
321
|
-
...o
|
|
322
|
-
}) => /* @__PURE__ */ r("div", { className: p("flex flex-col gap-2", e), ...o });
|
|
323
|
-
Xt.displayName = "DialogerFooter";
|
|
324
|
-
const Ie = L.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
|
|
325
|
-
"p",
|
|
326
|
-
{
|
|
327
|
-
ref: t,
|
|
328
|
-
className: p(
|
|
329
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
330
|
-
e
|
|
331
|
-
),
|
|
332
|
-
...o
|
|
333
|
-
}
|
|
334
|
-
));
|
|
335
|
-
Ie.displayName = "DialogerTitle";
|
|
336
|
-
const Te = L.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
|
|
337
|
-
"p",
|
|
338
|
-
{
|
|
339
|
-
ref: t,
|
|
340
|
-
className: p("text-sm text-muted-foreground", e),
|
|
341
|
-
...o
|
|
342
|
-
}
|
|
343
|
-
));
|
|
344
|
-
Te.displayName = "DialogerDescription";
|
|
345
|
-
function ge({
|
|
346
|
-
children: e,
|
|
347
|
-
trigger: o
|
|
348
|
-
}) {
|
|
349
|
-
const { open: t } = he();
|
|
350
|
-
return Mt(o, {
|
|
351
|
-
onClick: () => {
|
|
352
|
-
var s, i;
|
|
353
|
-
t(e), (i = (s = o.props).onClick) == null || i.call(s);
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
const bt = 1, yt = 5, le = 0.5, lo = 2.5;
|
|
358
|
-
function co(e, o, t, n) {
|
|
359
|
-
if (!t || !n || o <= 1) return { x: 0, y: 0 };
|
|
360
|
-
const s = t.getBoundingClientRect(), i = n.offsetWidth, a = n.offsetHeight, l = Math.max(0, (i * o - s.width) / (2 * o)), c = Math.max(
|
|
361
|
-
0,
|
|
362
|
-
(a * o - s.height) / (2 * o)
|
|
363
|
-
);
|
|
364
|
-
return {
|
|
365
|
-
x: Math.min(l, Math.max(-l, e.x)),
|
|
366
|
-
y: Math.min(c, Math.max(-c, e.y))
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
function qt({
|
|
370
|
-
src: e,
|
|
371
|
-
alt: o
|
|
372
|
-
}) {
|
|
373
|
-
const [t, n] = P(1), [s, i] = P({ x: 0, y: 0 }), [a, l] = P(!1), c = U({ x: 0, y: 0 }), m = U({ x: 0, y: 0 }), h = U(null), k = U(null), w = U(!1), u = (f) => Math.min(yt, Math.max(bt, f)), v = Z(() => {
|
|
374
|
-
n(1), i({ x: 0, y: 0 });
|
|
375
|
-
}, []), C = Z(() => {
|
|
376
|
-
n((f) => u(f + le));
|
|
377
|
-
}, []), M = Z(() => {
|
|
378
|
-
n((f) => {
|
|
379
|
-
const D = u(f - le);
|
|
380
|
-
return D <= 1 && i({ x: 0, y: 0 }), D;
|
|
381
|
-
});
|
|
382
|
-
}, []);
|
|
383
|
-
Z((f) => {
|
|
384
|
-
f.preventDefault(), f.stopPropagation();
|
|
385
|
-
const D = f.deltaY > 0 ? -le : le;
|
|
386
|
-
n((j) => {
|
|
387
|
-
const R = u(j + D);
|
|
388
|
-
return R <= 1 && i({ x: 0, y: 0 }), R;
|
|
389
|
-
});
|
|
390
|
-
}, []);
|
|
391
|
-
const b = Z(
|
|
392
|
-
(f) => {
|
|
393
|
-
f.preventDefault(), w.current = !1, l(!0), c.current = { x: f.clientX, y: f.clientY }, m.current = { ...s }, f.target.setPointerCapture(f.pointerId);
|
|
394
|
-
},
|
|
395
|
-
[s]
|
|
396
|
-
), S = Z(
|
|
397
|
-
(f) => {
|
|
398
|
-
if (!a) return;
|
|
399
|
-
const D = f.clientX - c.current.x, j = f.clientY - c.current.y;
|
|
400
|
-
if ((Math.abs(D) > 3 || Math.abs(j) > 3) && (w.current = !0), t <= 1) return;
|
|
401
|
-
const R = {
|
|
402
|
-
x: m.current.x + D / t,
|
|
403
|
-
y: m.current.y + j / t
|
|
404
|
-
};
|
|
405
|
-
i(
|
|
406
|
-
co(R, t, h.current, k.current)
|
|
407
|
-
);
|
|
408
|
-
},
|
|
409
|
-
[a, t]
|
|
410
|
-
), I = Z(() => {
|
|
411
|
-
const f = w.current;
|
|
412
|
-
l(!1), !f && n((D) => D > 1 ? (i({ x: 0, y: 0 }), 1) : lo);
|
|
413
|
-
}, []), E = t > 1;
|
|
414
|
-
return /* @__PURE__ */ d(
|
|
415
|
-
"div",
|
|
416
|
-
{
|
|
417
|
-
className: "relative size-full flex items-center justify-center select-none",
|
|
418
|
-
onClick: (f) => f.stopPropagation(),
|
|
419
|
-
children: [
|
|
420
|
-
/* @__PURE__ */ r(
|
|
421
|
-
"div",
|
|
422
|
-
{
|
|
423
|
-
ref: h,
|
|
424
|
-
className: p(
|
|
425
|
-
"overflow-hidden max-h-full max-w-full rounded-2xl flex items-center justify-center",
|
|
426
|
-
E && "size-full"
|
|
427
|
-
),
|
|
428
|
-
onPointerDown: b,
|
|
429
|
-
onPointerMove: S,
|
|
430
|
-
onPointerUp: I,
|
|
431
|
-
onPointerCancel: I,
|
|
432
|
-
style: {
|
|
433
|
-
cursor: a ? "grabbing" : E ? "grab" : "zoom-in",
|
|
434
|
-
touchAction: "none"
|
|
435
|
-
},
|
|
436
|
-
children: /* @__PURE__ */ r(
|
|
437
|
-
"img",
|
|
438
|
-
{
|
|
439
|
-
ref: k,
|
|
440
|
-
src: e,
|
|
441
|
-
alt: o,
|
|
442
|
-
className: "block max-w-full object-contain pointer-events-none",
|
|
443
|
-
draggable: !1,
|
|
444
|
-
style: {
|
|
445
|
-
maxHeight: "100vh",
|
|
446
|
-
transform: `scale(${t}) translate(${s.x}px, ${s.y}px)`,
|
|
447
|
-
transformOrigin: "center center"
|
|
448
|
-
// transition: isDragging ? 'none' : 'all 0.2s ease-out',
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
)
|
|
452
|
-
}
|
|
453
|
-
),
|
|
454
|
-
/* @__PURE__ */ d("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-black/60 backdrop-blur-sm rounded-full px-1.5 py-1 transition opacity-50 hover:opacity-100", children: [
|
|
455
|
-
/* @__PURE__ */ r(xe, { onClick: M, label: "Zoom out", disabled: t <= bt, children: /* @__PURE__ */ r(wr, { className: "size-3.5" }) }),
|
|
456
|
-
/* @__PURE__ */ d("span", { className: "text-white text-xs font-medium min-w-[3ch] text-center tabular-nums", children: [
|
|
457
|
-
Math.round(t * 100),
|
|
458
|
-
"%"
|
|
459
|
-
] }),
|
|
460
|
-
/* @__PURE__ */ r(xe, { onClick: C, label: "Zoom in", disabled: t >= yt, children: /* @__PURE__ */ r(fr, { className: "size-3.5" }) }),
|
|
461
|
-
E && /* @__PURE__ */ d(J, { children: [
|
|
462
|
-
/* @__PURE__ */ r("div", { className: "w-px h-4 bg-white/30 mx-0.5" }),
|
|
463
|
-
/* @__PURE__ */ r(xe, { onClick: v, label: "Reset zoom", children: /* @__PURE__ */ r(xr, { className: "size-3.5" }) })
|
|
464
|
-
] })
|
|
465
|
-
] })
|
|
466
|
-
]
|
|
467
|
-
}
|
|
468
|
-
);
|
|
469
|
-
}
|
|
470
|
-
function xe({
|
|
471
|
-
onClick: e,
|
|
472
|
-
label: o,
|
|
473
|
-
children: t,
|
|
474
|
-
disabled: n
|
|
475
|
-
}) {
|
|
476
|
-
return /* @__PURE__ */ r(
|
|
477
|
-
"button",
|
|
478
|
-
{
|
|
479
|
-
onClick: e,
|
|
480
|
-
"aria-label": o,
|
|
481
|
-
disabled: n,
|
|
482
|
-
className: "text-white/80 hover:text-white disabled:text-white/30 disabled:hover:bg-transparent p-1.5 rounded-full hover:bg-white/15 transition-colors",
|
|
483
|
-
children: t
|
|
484
|
-
}
|
|
485
|
-
);
|
|
486
|
-
}
|
|
487
|
-
function kt({
|
|
488
|
-
url: e,
|
|
489
|
-
name: o,
|
|
490
|
-
size: t,
|
|
491
|
-
icon: n,
|
|
492
|
-
label: s
|
|
493
|
-
}) {
|
|
494
|
-
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(
|
|
495
|
-
"a",
|
|
496
|
-
{
|
|
497
|
-
href: e,
|
|
498
|
-
target: "_blank",
|
|
499
|
-
rel: "noopener noreferrer",
|
|
500
|
-
className: p(
|
|
501
|
-
"block size-fit max-w-[min(100%,16rem)] shrink-0 rounded-2xl border",
|
|
502
|
-
"bg-background/80 transition-colors hover:bg-accent/60",
|
|
503
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
504
|
-
),
|
|
505
|
-
children: /* @__PURE__ */ d("div", { className: "flex items-center gap-3 p-3 min-w-0", children: [
|
|
506
|
-
/* @__PURE__ */ r(
|
|
507
|
-
"div",
|
|
508
|
-
{
|
|
509
|
-
className: p(
|
|
510
|
-
"flex size-10 shrink-0 items-center justify-center rounded-xl",
|
|
511
|
-
"bg-secondary text-muted-foreground"
|
|
512
|
-
),
|
|
513
|
-
"aria-hidden": !0,
|
|
514
|
-
children: n
|
|
515
|
-
}
|
|
516
|
-
),
|
|
517
|
-
/* @__PURE__ */ d("div", { className: "min-w-0 flex-1 flex flex-col gap-0.5 text-left", children: [
|
|
518
|
-
/* @__PURE__ */ r(
|
|
519
|
-
"span",
|
|
520
|
-
{
|
|
521
|
-
className: p(
|
|
522
|
-
"text-xs font-medium text-foreground line-clamp-1",
|
|
523
|
-
"break-words [word-break:break-word]"
|
|
524
|
-
// `[word-break:break-word]` is deprecated but works in the browser, while `break-words` which is `[overflow-wrap: break-word]` does not work
|
|
525
|
-
),
|
|
526
|
-
children: o
|
|
527
|
-
}
|
|
528
|
-
),
|
|
529
|
-
/* @__PURE__ */ d("span", { className: "text-xs text-muted-foreground tabular-nums", children: [
|
|
530
|
-
(t / 1024).toFixed(2),
|
|
531
|
-
" KB · ",
|
|
532
|
-
s
|
|
533
|
-
] })
|
|
534
|
-
] })
|
|
535
|
-
] })
|
|
536
|
-
}
|
|
537
|
-
) });
|
|
538
|
-
}
|
|
539
|
-
function Vt({ attachment: e }) {
|
|
540
|
-
const { name: o, size: t, type: n, url: s } = e, i = n.startsWith("image/"), a = n.startsWith("video/"), l = n.startsWith("audio/"), c = n === "application/pdf";
|
|
541
|
-
if (l)
|
|
542
|
-
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "w-full shrink-0 overflow-hidden", children: /* @__PURE__ */ d("audio", { controls: !0, className: "w-full", children: [
|
|
543
|
-
/* @__PURE__ */ r("source", { src: s, type: n }),
|
|
544
|
-
"Your browser does not support the audio tag."
|
|
545
|
-
] }) }) });
|
|
546
|
-
if (a)
|
|
547
|
-
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "w-full border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ d("video", { controls: !0, children: [
|
|
548
|
-
/* @__PURE__ */ r("source", { src: s, type: n }),
|
|
549
|
-
"Your browser does not support the video tag."
|
|
550
|
-
] }) }) });
|
|
551
|
-
if (i)
|
|
552
|
-
return /* @__PURE__ */ r(
|
|
553
|
-
ge,
|
|
554
|
-
{
|
|
555
|
-
trigger: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ r("img", { src: s, className: "object-cover size-16", alt: o }) }) }) }),
|
|
556
|
-
children: /* @__PURE__ */ r(
|
|
557
|
-
ue,
|
|
558
|
-
{
|
|
559
|
-
className: "size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",
|
|
560
|
-
withClose: !0,
|
|
561
|
-
children: /* @__PURE__ */ r(qt, { src: s, alt: o })
|
|
562
|
-
}
|
|
563
|
-
)
|
|
564
|
-
}
|
|
565
|
-
);
|
|
566
|
-
if (c)
|
|
567
|
-
return /* @__PURE__ */ r(
|
|
568
|
-
kt,
|
|
569
|
-
{
|
|
570
|
-
url: s,
|
|
571
|
-
name: o,
|
|
572
|
-
size: t,
|
|
573
|
-
icon: /* @__PURE__ */ r(Ot, { className: "size-5", strokeWidth: 1.75 }),
|
|
574
|
-
label: "PDF"
|
|
575
|
-
}
|
|
576
|
-
);
|
|
577
|
-
const m = Ut({ type: n, name: o });
|
|
578
|
-
return m ? /* @__PURE__ */ r(
|
|
579
|
-
kt,
|
|
580
|
-
{
|
|
581
|
-
url: s,
|
|
582
|
-
name: o,
|
|
583
|
-
size: t,
|
|
584
|
-
icon: /* @__PURE__ */ r(At, { className: "size-5", strokeWidth: 1.75 }),
|
|
585
|
-
label: m.label
|
|
586
|
-
}
|
|
587
|
-
) : /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ d("div", { className: "flex items-end gap-2 p-2", children: [
|
|
588
|
-
/* @__PURE__ */ r(
|
|
589
|
-
"a",
|
|
590
|
-
{
|
|
591
|
-
href: s,
|
|
592
|
-
target: "_blank",
|
|
593
|
-
rel: "noopener noreferrer",
|
|
594
|
-
className: p(
|
|
595
|
-
"text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600",
|
|
596
|
-
"break-words [word-break:break-word]"
|
|
597
|
-
// `[word-break:break-word]` is deprecated but works in the browser, while `break-words` which is `[overflow-wrap: break-word]` does not work
|
|
598
|
-
),
|
|
599
|
-
children: o
|
|
600
|
-
}
|
|
601
|
-
),
|
|
602
|
-
/* @__PURE__ */ d("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
|
|
603
|
-
(t / 1024).toFixed(2),
|
|
604
|
-
" KB"
|
|
605
|
-
] })
|
|
606
|
-
] }) }) });
|
|
607
|
-
}
|
|
608
|
-
const Gt = L.memo(
|
|
609
|
-
Vr,
|
|
610
|
-
(e, o) => e.children === o.children && e.className === o.className
|
|
611
|
-
);
|
|
612
|
-
function Me({
|
|
613
|
-
children: e,
|
|
614
|
-
messageType: o,
|
|
615
|
-
messageId: t
|
|
616
|
-
}) {
|
|
617
|
-
const { anchorTarget: n } = z();
|
|
618
|
-
return /* @__PURE__ */ r(
|
|
619
|
-
Gt,
|
|
620
|
-
{
|
|
621
|
-
"data-type": o,
|
|
622
|
-
"data-id": t,
|
|
623
|
-
remarkPlugins: [Lt],
|
|
624
|
-
rehypePlugins: [$t],
|
|
625
|
-
components: {
|
|
626
|
-
a: ({ children: s, ...i }) => /* @__PURE__ */ r("a", { target: i.target || n || "_top", ...i, children: s }),
|
|
627
|
-
img: ({ src: s, alt: i, ...a }) => s ? /* @__PURE__ */ r(
|
|
628
|
-
ge,
|
|
629
|
-
{
|
|
630
|
-
trigger: /* @__PURE__ */ r(
|
|
631
|
-
"img",
|
|
632
|
-
{
|
|
633
|
-
src: s,
|
|
634
|
-
alt: i,
|
|
635
|
-
...a,
|
|
636
|
-
className: "cursor-pointer rounded-xl"
|
|
637
|
-
}
|
|
638
|
-
),
|
|
639
|
-
children: /* @__PURE__ */ r(
|
|
640
|
-
ue,
|
|
641
|
-
{
|
|
642
|
-
className: "size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",
|
|
643
|
-
withClose: !0,
|
|
644
|
-
children: /* @__PURE__ */ r(qt, { src: s, alt: i })
|
|
645
|
-
}
|
|
646
|
-
)
|
|
647
|
-
}
|
|
648
|
-
) : /* @__PURE__ */ r("img", { src: s, alt: i, ...a })
|
|
649
|
-
},
|
|
650
|
-
children: e
|
|
651
|
-
}
|
|
652
|
-
);
|
|
653
|
-
}
|
|
654
|
-
function X() {
|
|
655
|
-
const {
|
|
656
|
-
widgetCtx: { org: e }
|
|
657
|
-
} = O(), {
|
|
658
|
-
sessionState: { session: o }
|
|
659
|
-
} = $(), t = z(), {
|
|
660
|
-
messagesState: { messages: n }
|
|
661
|
-
} = A(), {
|
|
662
|
-
routerState: { screen: s }
|
|
663
|
-
} = H();
|
|
664
|
-
return {
|
|
665
|
-
react: L,
|
|
666
|
-
org: e,
|
|
667
|
-
session: o,
|
|
668
|
-
config: t,
|
|
669
|
-
messages: n,
|
|
670
|
-
currentScreen: s
|
|
671
|
-
};
|
|
672
|
-
}
|
|
673
|
-
function po({
|
|
674
|
-
currentMessage: e
|
|
675
|
-
}) {
|
|
676
|
-
var n;
|
|
677
|
-
const o = X(), t = (n = o.config.customComponents) == null ? void 0 : n["message::after"];
|
|
678
|
-
return t ? /* @__PURE__ */ r(t, { ...o, currentMessage: e }) : null;
|
|
679
|
-
}
|
|
680
|
-
function be(e) {
|
|
681
|
-
const {
|
|
682
|
-
data: o,
|
|
683
|
-
id: t,
|
|
684
|
-
type: n,
|
|
685
|
-
attachments: s,
|
|
686
|
-
isFirstInGroup: i,
|
|
687
|
-
isLastInGroup: a,
|
|
688
|
-
isAloneInGroup: l,
|
|
689
|
-
dataComponentNames: c,
|
|
690
|
-
classNames: m
|
|
691
|
-
} = e;
|
|
692
|
-
if (n !== "AI" && n !== "AGENT") return null;
|
|
693
|
-
const { message: h, variant: k = "default" } = o;
|
|
694
|
-
return /* @__PURE__ */ d(
|
|
695
|
-
"div",
|
|
696
|
-
{
|
|
697
|
-
...x((c == null ? void 0 : c.messageContainer) ?? "chat/agent_msg/root"),
|
|
698
|
-
className: p(
|
|
699
|
-
"w-5/6 flex flex-col items-start gap-1",
|
|
700
|
-
m == null ? void 0 : m.messageContainer
|
|
701
|
-
),
|
|
702
|
-
children: [
|
|
703
|
-
s && s.length > 0 && /* @__PURE__ */ r("div", { className: "w-full gap-1 flex flex-row flex-wrap items-center justify-start", children: s == null ? void 0 : s.map((w) => /* @__PURE__ */ r(Vt, { attachment: w }, w.id)) }),
|
|
704
|
-
h.length > 0 && /* @__PURE__ */ d("div", { className: "flex flex-row gap-2", children: [
|
|
705
|
-
/* @__PURE__ */ r(
|
|
706
|
-
"div",
|
|
707
|
-
{
|
|
708
|
-
...x((c == null ? void 0 : c.message) ?? "chat/agent_msg/msg"),
|
|
709
|
-
"data-first": i,
|
|
710
|
-
"data-last": a,
|
|
711
|
-
"data-alone": l,
|
|
712
|
-
"data-variant": k,
|
|
713
|
-
className: p(
|
|
714
|
-
"transition-all",
|
|
715
|
-
"w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground",
|
|
716
|
-
"leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline",
|
|
717
|
-
"break-words [word-break:break-word]",
|
|
718
|
-
// `[word-break:break-word]` is deprecated but works in the browser, while `break-words` which is `[overflow-wrap: break-word]` does not work
|
|
719
|
-
// No need to add "whitespace-pre-wrap" in the agent or bot message because it is markup and content appear on separate lines as expected
|
|
720
|
-
// Adding "whitespace-pre-wrap" will result in unnecessarily huge line breaks
|
|
721
|
-
k === "error" && "bg-destructive/15 text-destructive",
|
|
722
|
-
// We're using the booleans directly here, not the data attributes, to make any external styling more specific than this
|
|
723
|
-
i && !l && "rounded-bl-md",
|
|
724
|
-
a && !l && "rounded-tl-md",
|
|
725
|
-
!i && !a && !l && "rounded-l-md",
|
|
726
|
-
m == null ? void 0 : m.message
|
|
727
|
-
),
|
|
728
|
-
children: /* @__PURE__ */ r(Me, { messageType: n, messageId: t, children: h })
|
|
729
|
-
}
|
|
730
|
-
),
|
|
731
|
-
/* @__PURE__ */ r(po, { currentMessage: e })
|
|
732
|
-
] })
|
|
733
|
-
]
|
|
734
|
-
}
|
|
735
|
-
);
|
|
736
|
-
}
|
|
737
|
-
function mo(e) {
|
|
738
|
-
return /* @__PURE__ */ r("div", { className: "w-full max-w-full overflow-auto shrink-0", children: /* @__PURE__ */ r("pre", { className: "text-xs leading-tight whitespace-pre-wrap break-word", children: JSON.stringify(e, null, 1) }) });
|
|
739
|
-
}
|
|
740
|
-
const De = ee.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
|
|
741
|
-
te.Root,
|
|
742
|
-
{
|
|
743
|
-
ref: t,
|
|
744
|
-
className: p(
|
|
745
|
-
"relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",
|
|
746
|
-
// 'border',
|
|
747
|
-
e
|
|
748
|
-
),
|
|
749
|
-
...o
|
|
750
|
-
}
|
|
751
|
-
));
|
|
752
|
-
De.displayName = te.Root.displayName;
|
|
753
|
-
const Ee = ee.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
|
|
754
|
-
te.Image,
|
|
755
|
-
{
|
|
756
|
-
ref: t,
|
|
757
|
-
className: p("aspect-square h-full w-full", e),
|
|
758
|
-
...o
|
|
759
|
-
}
|
|
760
|
-
));
|
|
761
|
-
Ee.displayName = te.Image.displayName;
|
|
762
|
-
const Re = ee.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
|
|
763
|
-
te.Fallback,
|
|
764
|
-
{
|
|
765
|
-
ref: t,
|
|
766
|
-
className: p(
|
|
767
|
-
"flex size-full text-xs items-center justify-center rounded-lg",
|
|
768
|
-
e
|
|
769
|
-
),
|
|
770
|
-
...o
|
|
771
|
-
}
|
|
772
|
-
));
|
|
773
|
-
Re.displayName = te.Fallback.displayName;
|
|
774
|
-
function ye({
|
|
775
|
-
agent: e,
|
|
776
|
-
...o
|
|
777
|
-
}) {
|
|
778
|
-
var t, n;
|
|
779
|
-
return /* @__PURE__ */ d(De, { ...o, children: [
|
|
780
|
-
/* @__PURE__ */ r(Ee, { src: (e == null ? void 0 : e.avatarUrl) || (e == null ? void 0 : e.avatar) || "", alt: "Agent Icon" }),
|
|
781
|
-
(e == null ? void 0 : e.name) && /* @__PURE__ */ r(Re, { children: (n = (t = e == null ? void 0 : e.name) == null ? void 0 : t.slice(0, 1)) == null ? void 0 : n.toUpperCase() })
|
|
782
|
-
] });
|
|
783
|
-
}
|
|
784
|
-
function ho({ agent: e }) {
|
|
785
|
-
return /* @__PURE__ */ r(_, { children: /* @__PURE__ */ d(
|
|
786
|
-
y,
|
|
787
|
-
{
|
|
788
|
-
...x("chat/bot_loading/root"),
|
|
789
|
-
className: "flex flex-row items-end w-full gap-2 animate-pulse",
|
|
790
|
-
children: [
|
|
791
|
-
/* @__PURE__ */ r(ye, { agent: e }),
|
|
792
|
-
/* @__PURE__ */ d(
|
|
793
|
-
"div",
|
|
794
|
-
{
|
|
795
|
-
...x("chat/bot_loading/bouncing_dots_container"),
|
|
796
|
-
className: p(
|
|
797
|
-
"flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"
|
|
798
|
-
// 'border',
|
|
799
|
-
),
|
|
800
|
-
children: [
|
|
801
|
-
/* @__PURE__ */ r(re.span, { className: "rounded-full animate-bounce [animation-delay:-0.3s]" }),
|
|
802
|
-
/* @__PURE__ */ r(re.span, { className: "rounded-full animate-bounce [animation-delay:-0.15s]" }),
|
|
803
|
-
/* @__PURE__ */ r(re.span, { className: "rounded-full animate-bounce" })
|
|
804
|
-
]
|
|
805
|
-
}
|
|
806
|
-
)
|
|
807
|
-
]
|
|
808
|
-
}
|
|
809
|
-
) });
|
|
810
|
-
}
|
|
811
|
-
const Zt = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{-ms-overflow-style:none;scrollbar-width:none}*::-webkit-scrollbar{display:none}*{border-color:hsl(var(--opencx-border))}.\\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.end-6{inset-inline-end:1.5rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-\\[50\\%\\]{left:50%}.right-4{right:1rem}.top-2{top:.5rem}.top-4{top:1rem}.top-6{top:1.5rem}.top-\\[50\\%\\]{top:50%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-10{z-index:10}.z-50{z-index:50}.m-2{margin:.5rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ms-auto{margin-inline-start:auto}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-0{width:0px;height:0px}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-8{width:2rem;height:2rem}.size-fit{width:fit-content;height:fit-content}.size-full{width:100%;height:100%}.h-0{height:0px}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-16{max-height:4rem}.max-h-40{max-height:10rem}.max-h-full{max-height:100%}.min-h-12{min-height:3rem}.w-0{width:0px}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\\/5{width:40%}.w-3\\.5{width:.875rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5\\/6{width:83.333333%}.w-60{width:15rem}.w-9{width:2.25rem}.w-auto{width:auto}.w-dvw{width:100dvw}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-80{min-width:20rem}.min-w-\\[3ch\\]{min-width:3ch}.min-w-\\[8rem\\]{min-width:8rem}.max-w-96{max-width:24rem}.max-w-\\[61\\.8\\%\\]{max-width:61.8%}.max-w-\\[min\\(100\\%\\,16rem\\)\\]{max-width:min(100%,16rem)}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-\\[2\\]{flex:2}.shrink-0{flex-shrink:0}.-translate-x-1\\/2,.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[var\\(--wobble-x\\)\\]{--tw-translate-x: var(--wobble-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[var\\(--wobble-y\\)\\]{--tw-translate-y: var(--wobble-y);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\\[1px\\]{gap:1px}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[20px\\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-transparent{border-color:transparent}.bg-\\[white\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--opencx-background))}.bg-background\\/80{background-color:hsl(var(--opencx-background) / .8)}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--opencx-destructive))}.bg-destructive\\/15{background-color:hsl(var(--opencx-destructive) / .15)}.bg-muted{background-color:hsl(var(--opencx-muted))}.bg-primary{background-color:hsl(var(--opencx-primary))}.bg-secondary{background-color:hsl(var(--opencx-secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/30{background-color:#ffffff4d}.bg-\\[radial-gradient\\(ellipse_at_top_left\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\,radial-gradient\\(ellipse_at_top_right\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\]{background-image:radial-gradient(ellipse at top left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse at top right,hsl(var(--opencx-primary)),transparent)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pe-2{padding-inline-end:.5rem}.pe-4{padding-inline-end:1rem}.ps-2{padding-inline-start:.5rem}.ps-4{padding-inline-start:1rem}.ps-8{padding-inline-start:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\[1\\.75rem\\]{font-size:1.75rem}.text-\\[10px\\]{font-size:10px}.text-\\[16px\\]{font-size:16px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--opencx-destructive))}.text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--opencx-foreground))}.text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}.text-muted-foreground\\/70{color:hsl(var(--opencx-muted-foreground) / .7)}.text-muted-foreground\\/75{color:hsl(var(--opencx-muted-foreground) / .75)}.text-primary{color:hsl(var(--opencx-primary))}.text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}.text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-8{outline-width:8px}.outline-background{outline-color:hsl(var(--opencx-background))}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--opencx-background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[height\\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-95{--tw-enter-scale: .95}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[field-sizing\\:content\\;\\],.\\[field-sizing\\:content\\]{field-sizing:content}.\\[word-break\\:break-word\\]{word-break:break-word}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}.placeholder\\:text-muted-foreground\\/75::placeholder{color:hsl(var(--opencx-muted-foreground) / .75)}.focus-within\\:border-primary:focus-within{border-color:hsl(var(--opencx-primary))}.hover\\:scale-\\[var\\(--scale\\)\\]:hover{--tw-scale-x: var(--scale);--tw-scale-y: var(--scale);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:border-primary:hover{border-color:hsl(var(--opencx-primary))}.hover\\:bg-accent\\/60:hover{background-color:hsl(var(--opencx-accent) / .6)}.hover\\:bg-secondary:hover{background-color:hsl(var(--opencx-secondary))}.hover\\:bg-white\\/15:hover{background-color:#ffffff26}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--opencx-accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--opencx-accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--opencx-ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--opencx-background))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:hover\\:scale-\\[calc\\(var\\(--scale\\)-0\\.02\\)\\]:hover:active{--tw-scale-x: calc(var(--scale) - .02);--tw-scale-y: calc(var(--scale) - .02);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:active\\:scale-95:active:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-white\\/30:disabled{color:#ffffff4d}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:hover\\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\\:opacity-100{opacity:1}.group:hover .group-hover\\:active\\:scale-90:active,.group:active .group-active\\:scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--opencx-primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--opencx-accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--opencx-input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}.rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}.\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:1rem;height:1rem}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\]\\:text-muted-foreground\\/70 svg{color:hsl(var(--opencx-muted-foreground) / .7)}.\\[\\&_svg\\]\\:hover\\:text-primary:hover svg{color:hsl(var(--opencx-primary))}', uo = ae.Provider, go = ae.Root, wo = ae.Trigger, Kt = ee.forwardRef(({ className: e, sideOffset: o = 4, ...t }, n) => /* @__PURE__ */ r(
|
|
812
|
-
ae.Content,
|
|
813
|
-
{
|
|
814
|
-
ref: n,
|
|
815
|
-
sideOffset: o,
|
|
816
|
-
className: p(
|
|
817
|
-
"z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
818
|
-
e
|
|
819
|
-
),
|
|
820
|
-
...t
|
|
821
|
-
}
|
|
822
|
-
));
|
|
823
|
-
Kt.displayName = ae.Content.displayName;
|
|
824
|
-
function oe({
|
|
825
|
-
children: e,
|
|
826
|
-
content: o,
|
|
827
|
-
side: t,
|
|
828
|
-
align: n
|
|
829
|
-
}) {
|
|
830
|
-
const { disableTooltips: s } = z();
|
|
831
|
-
return !o || s ? e : /* @__PURE__ */ d(go, { children: [
|
|
832
|
-
/* @__PURE__ */ r(wo, { asChild: !0, children: e }),
|
|
833
|
-
/* @__PURE__ */ r(
|
|
834
|
-
Kt,
|
|
835
|
-
{
|
|
836
|
-
side: t,
|
|
837
|
-
align: n,
|
|
838
|
-
collisionPadding: 8,
|
|
839
|
-
avoidCollisions: !0,
|
|
840
|
-
children: o
|
|
841
|
-
}
|
|
842
|
-
)
|
|
843
|
-
] });
|
|
844
|
-
}
|
|
845
|
-
function fo(e, o) {
|
|
846
|
-
const t = typeof (e == null ? void 0 : e.right) == "number", n = typeof (e == null ? void 0 : e.left) == "number";
|
|
847
|
-
return t && !n ? "right" : n && !t || o === "rtl" ? "left" : "right";
|
|
848
|
-
}
|
|
849
|
-
const Ct = 450;
|
|
850
|
-
function B() {
|
|
851
|
-
const [e, o] = L.useState(() => (window.top || window).innerWidth < Ct);
|
|
852
|
-
return L.useEffect(() => {
|
|
853
|
-
const t = window.top || window, n = () => {
|
|
854
|
-
o(t.innerWidth < Ct);
|
|
855
|
-
};
|
|
856
|
-
return n(), t.addEventListener("resize", n), () => {
|
|
857
|
-
t.removeEventListener("resize", n);
|
|
858
|
-
};
|
|
859
|
-
}, []), { isSmallScreen: e };
|
|
860
|
-
}
|
|
861
|
-
const ce = {
|
|
862
|
-
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
863
|
-
transitionDuration: "1000ms"
|
|
864
|
-
};
|
|
865
|
-
function V() {
|
|
866
|
-
var w, u, v, C, M, b, S, I, E, f, D, j, R, g, T, ie, Ae, Fe, He, We, Le, $e, Be, Ue, Ye, Xe, qe, Ve, Ge, Ze, Ke, Qe, Je, et, tt, rt, ot, nt, st, at, it, lt, ct, dt, pt, mt, ht, ut;
|
|
867
|
-
const { dir: e } = ze(), { isSmallScreen: o } = B(), { theme: t, inline: n } = z(), s = (q) => n ? "100%" : q, i = (q, we) => o ? `100dv${q}` : we, a = (q, we) => s(i(q, we)), l = fo((w = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : w.offset, e), c = {
|
|
868
|
-
zIndex: ((u = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : u.zIndex) ?? 1e7,
|
|
869
|
-
offset: {
|
|
870
|
-
bottom: ((C = (v = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : v.offset) == null ? void 0 : C.bottom) ?? 20,
|
|
871
|
-
right: ((b = (M = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : M.offset) == null ? void 0 : b.right) ?? (l === "right" ? 20 : "initial"),
|
|
872
|
-
left: ((I = (S = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : S.offset) == null ? void 0 : I.left) ?? (l === "left" ? 20 : "initial")
|
|
873
|
-
},
|
|
874
|
-
size: {
|
|
875
|
-
button: ((f = (E = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : E.size) == null ? void 0 : f.button) ?? 48,
|
|
876
|
-
icon: ((j = (D = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : D.size) == null ? void 0 : j.icon) ?? 24
|
|
877
|
-
}
|
|
878
|
-
}, m = (() => {
|
|
879
|
-
const q = l === "right" ? c.offset.right : c.offset.left;
|
|
880
|
-
return typeof q != "number" ? 0 : q;
|
|
881
|
-
})(), h = {
|
|
882
|
-
palette: (t == null ? void 0 : t.palette) ?? "neutral",
|
|
883
|
-
primaryColor: (t == null ? void 0 : t.primaryColor) ?? "hsl(0 0% 9%)",
|
|
884
|
-
widgetTrigger: c,
|
|
885
|
-
widgetContentContainer: {
|
|
886
|
-
borderRadius: o ? "0px" : ((R = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : R.borderRadius) ?? "32px",
|
|
887
|
-
zIndex: ((g = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : g.zIndex) ?? c.zIndex + 1,
|
|
888
|
-
outline: ((T = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : T.outline) ?? "none",
|
|
889
|
-
// was: '1px solid'
|
|
890
|
-
outlineColor: ((ie = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : ie.outlineColor) ?? "hsl(0 0% 50% / .5)",
|
|
891
|
-
boxShadow: ((Ae = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Ae.boxShadow) ?? "0 0px 100px 0px rgb(0 0 0 / 0.25)",
|
|
892
|
-
transitionProperty: ((Fe = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Fe.transitionProperty) ?? "all",
|
|
893
|
-
transitionTimingFunction: ((He = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : He.transitionTimingFunction) ?? ce.transitionTimingFunction,
|
|
894
|
-
transitionDuration: ((We = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : We.transitionDuration) ?? ce.transitionDuration,
|
|
895
|
-
offset: {
|
|
896
|
-
side: o ? 0 : c.offset.bottom + c.size.button + Q.y * 2 + ((($e = (Le = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Le.offset) == null ? void 0 : $e.side) ?? 10),
|
|
897
|
-
align: o ? 0 : m + (((Ue = (Be = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Be.offset) == null ? void 0 : Ue.align) ?? 0)
|
|
898
|
-
}
|
|
899
|
-
},
|
|
900
|
-
screens: {
|
|
901
|
-
welcome: {
|
|
902
|
-
width: a("w", ((Xe = (Ye = t == null ? void 0 : t.screens) == null ? void 0 : Ye.welcome) == null ? void 0 : Xe.width) ?? "400px"),
|
|
903
|
-
// By setting minHeight to 1px, a nice animation will play from 1px to the dynamic height of the content of the screen
|
|
904
|
-
minHeight: a(
|
|
905
|
-
"h",
|
|
906
|
-
((Ve = (qe = t == null ? void 0 : t.screens) == null ? void 0 : qe.welcome) == null ? void 0 : Ve.minHeight) ?? "1px"
|
|
907
|
-
)
|
|
908
|
-
},
|
|
909
|
-
sessions: {
|
|
910
|
-
width: a("w", ((Ze = (Ge = t == null ? void 0 : t.screens) == null ? void 0 : Ge.sessions) == null ? void 0 : Ze.width) ?? "450px"),
|
|
911
|
-
height: a("h", ((Qe = (Ke = t == null ? void 0 : t.screens) == null ? void 0 : Ke.sessions) == null ? void 0 : Qe.height) ?? "600px")
|
|
912
|
-
},
|
|
913
|
-
chat: {
|
|
914
|
-
width: a("w", ((et = (Je = t == null ? void 0 : t.screens) == null ? void 0 : Je.chat) == null ? void 0 : et.width) ?? "525px"),
|
|
915
|
-
height: a("h", ((rt = (tt = t == null ? void 0 : t.screens) == null ? void 0 : tt.chat) == null ? void 0 : rt.height) ?? "700px"),
|
|
916
|
-
withCanvas: {
|
|
917
|
-
width: a(
|
|
918
|
-
"w",
|
|
919
|
-
((st = (nt = (ot = t == null ? void 0 : t.screens) == null ? void 0 : ot.chat) == null ? void 0 : nt.withCanvas) == null ? void 0 : st.width) ?? "min(1050px, 100vw)"
|
|
920
|
-
),
|
|
921
|
-
height: a(
|
|
922
|
-
"h",
|
|
923
|
-
((lt = (it = (at = t == null ? void 0 : t.screens) == null ? void 0 : at.chat) == null ? void 0 : it.withCanvas) == null ? void 0 : lt.height) ?? "min(800px, 100vh)"
|
|
924
|
-
),
|
|
925
|
-
transitionTimingFunction: ((pt = (dt = (ct = t == null ? void 0 : t.screens) == null ? void 0 : ct.chat) == null ? void 0 : dt.withCanvas) == null ? void 0 : pt.transitionTimingFunction) ?? ce.transitionTimingFunction,
|
|
926
|
-
transitionDuration: ((ut = (ht = (mt = t == null ? void 0 : t.screens) == null ? void 0 : mt.chat) == null ? void 0 : ht.withCanvas) == null ? void 0 : ut.transitionDuration) ?? ce.transitionDuration
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
}, k = {
|
|
931
|
-
// Subtract the offset.bottom twice so that it adds a bit of padding to the top
|
|
932
|
-
// Subtract the distance between the trigger and the widget content container
|
|
933
|
-
// Subtract the invisible padding of the trigger (for the wobble effect)
|
|
934
|
-
maxHeight: a(
|
|
935
|
-
"h",
|
|
936
|
-
`calc(
|
|
937
|
-
100vh
|
|
938
|
-
- ${h.widgetTrigger.offset.bottom}px
|
|
939
|
-
- ${h.widgetContentContainer.offset.side}px
|
|
940
|
-
- ${Q.y * 2}px
|
|
941
|
-
)`
|
|
942
|
-
),
|
|
943
|
-
// Subtract the offset.right twice so that it adds a bit of padding to the left
|
|
944
|
-
maxWidth: a(
|
|
945
|
-
"w",
|
|
946
|
-
`calc(
|
|
947
|
-
100vw
|
|
948
|
-
- ${m * 2}px
|
|
949
|
-
)`
|
|
950
|
-
),
|
|
951
|
-
minHeight: a(
|
|
952
|
-
"h",
|
|
953
|
-
`min(
|
|
954
|
-
${h.screens.welcome.minHeight},
|
|
955
|
-
${h.screens.sessions.height},
|
|
956
|
-
${h.screens.chat.height}
|
|
957
|
-
)`
|
|
958
|
-
),
|
|
959
|
-
minWidth: a(
|
|
960
|
-
"w",
|
|
961
|
-
`min(
|
|
962
|
-
${h.screens.welcome.width},
|
|
963
|
-
${h.screens.sessions.width},
|
|
964
|
-
${h.screens.chat.width}
|
|
965
|
-
)`
|
|
966
|
-
)
|
|
967
|
-
};
|
|
968
|
-
return {
|
|
969
|
-
theme: h,
|
|
970
|
-
triggerSide: l,
|
|
971
|
-
computed: k,
|
|
972
|
-
cssVars: xo({
|
|
973
|
-
palette: h.palette,
|
|
974
|
-
primary: h.primaryColor
|
|
975
|
-
})
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
function xo({
|
|
979
|
-
palette: e,
|
|
980
|
-
primary: o
|
|
981
|
-
}) {
|
|
982
|
-
const t = Qt(e), n = ft(o).toHsl(), s = ft(o).isLight() ? t[950] : t[50];
|
|
983
|
-
return {
|
|
984
|
-
"--opencx-primary": `${n.h} ${n.s * 100}% ${n.l * 100}%`,
|
|
985
|
-
"--opencx-primary-foreground": s,
|
|
986
|
-
"--opencx-background": t[100],
|
|
987
|
-
"--opencx-foreground": t[950],
|
|
988
|
-
"--opencx-destructive": "0 72.2% 50.6%",
|
|
989
|
-
"--opencx-destructive-foreground": t[50],
|
|
990
|
-
"--opencx-accent": t[200],
|
|
991
|
-
"--opencx-accent-foreground": "var(--opencx-foreground)",
|
|
992
|
-
"--opencx-secondary": t[200],
|
|
993
|
-
"--opencx-secondary-foreground": "var(--opencx-foreground)",
|
|
994
|
-
"--opencx-muted": t[200],
|
|
995
|
-
"--opencx-muted-foreground": t[500],
|
|
996
|
-
"--opencx-input": t[300],
|
|
997
|
-
"--opencx-border": t[300],
|
|
998
|
-
"--opencx-ring": "var(--opencx-foreground)"
|
|
999
|
-
};
|
|
1000
|
-
}
|
|
1001
|
-
function Qt(e) {
|
|
1002
|
-
const o = {
|
|
1003
|
-
50: "0 0% 98%",
|
|
1004
|
-
100: "0 0% 96.1%",
|
|
1005
|
-
200: "0 0% 89.8%",
|
|
1006
|
-
300: "0 0% 83.1%",
|
|
1007
|
-
400: "0 0% 63.9%",
|
|
1008
|
-
500: "0 0% 45.1%",
|
|
1009
|
-
600: "0 0% 32.2%",
|
|
1010
|
-
700: "0 0% 25.1%",
|
|
1011
|
-
800: "0 0% 14.9%",
|
|
1012
|
-
900: "0 0% 9%",
|
|
1013
|
-
950: "0 0% 3.9%"
|
|
1014
|
-
}, t = {
|
|
1015
|
-
50: "60 9.1% 97.8%",
|
|
1016
|
-
100: "60 4.8% 95.9%",
|
|
1017
|
-
200: "20 5.9% 90%",
|
|
1018
|
-
300: "24 5.7% 82.9%",
|
|
1019
|
-
400: "24 5.4% 63.9%",
|
|
1020
|
-
500: "25 5.3% 44.7%",
|
|
1021
|
-
600: "33.3 5.5% 32.4%",
|
|
1022
|
-
700: "30 6.3% 25.1%",
|
|
1023
|
-
800: "12 6.5% 15.1%",
|
|
1024
|
-
900: "24 9.8% 10%",
|
|
1025
|
-
950: "20 14.3% 4.1%"
|
|
1026
|
-
}, n = {
|
|
1027
|
-
50: "0 0% 98%",
|
|
1028
|
-
100: "240 4.8% 95.9%",
|
|
1029
|
-
200: "240 5.9% 90%",
|
|
1030
|
-
300: "240 4.9% 83.9%",
|
|
1031
|
-
400: "240 5% 64.9%",
|
|
1032
|
-
500: "240 3.8% 46.1%",
|
|
1033
|
-
600: "240 5.2% 33.9%",
|
|
1034
|
-
700: "240 5.3% 26.1%",
|
|
1035
|
-
800: "240 3.7% 15.9%",
|
|
1036
|
-
900: "240 5.9% 10%",
|
|
1037
|
-
950: "240 10% 3.9%"
|
|
1038
|
-
}, s = {
|
|
1039
|
-
50: "210 40% 98%",
|
|
1040
|
-
100: "210 40% 96.1%",
|
|
1041
|
-
200: "214.3 31.8% 91.4%",
|
|
1042
|
-
300: "212.7 26.8% 83.9%",
|
|
1043
|
-
400: "215 20.2% 65.1%",
|
|
1044
|
-
500: "215.4 16.3% 46.9%",
|
|
1045
|
-
600: "215.3 19.3% 34.5%",
|
|
1046
|
-
700: "215.3 25% 26.7%",
|
|
1047
|
-
800: "217.2 32.6% 17.5%",
|
|
1048
|
-
900: "222.2 47.4% 11.2%",
|
|
1049
|
-
950: "222.2 84% 4.9%"
|
|
1050
|
-
};
|
|
1051
|
-
switch (e) {
|
|
1052
|
-
case "neutral":
|
|
1053
|
-
return o;
|
|
1054
|
-
case "stone":
|
|
1055
|
-
return t;
|
|
1056
|
-
case "zinc":
|
|
1057
|
-
return n;
|
|
1058
|
-
case "slate":
|
|
1059
|
-
return s;
|
|
1060
|
-
default:
|
|
1061
|
-
return F(e, Qt.name), o;
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
function Jt() {
|
|
1065
|
-
const { contentIframeRef: e } = O(), { inline: o } = z();
|
|
1066
|
-
return {
|
|
1067
|
-
setWidth: (t) => {
|
|
1068
|
-
var n;
|
|
1069
|
-
(n = e == null ? void 0 : e.current) == null || n.style.setProperty(
|
|
1070
|
-
"--opencx-widget-width",
|
|
1071
|
-
o ? "100%" : t
|
|
1072
|
-
);
|
|
1073
|
-
},
|
|
1074
|
-
setHeight: (t) => {
|
|
1075
|
-
var n;
|
|
1076
|
-
(n = e == null ? void 0 : e.current) == null || n.style.setProperty(
|
|
1077
|
-
"--opencx-widget-height",
|
|
1078
|
-
o ? "100%" : t
|
|
1079
|
-
);
|
|
1080
|
-
}
|
|
1081
|
-
};
|
|
1082
|
-
}
|
|
1083
|
-
function Pe({
|
|
1084
|
-
width: e,
|
|
1085
|
-
height: o
|
|
1086
|
-
}) {
|
|
1087
|
-
const { isSmallScreen: t } = B(), { setWidth: n, setHeight: s } = Jt();
|
|
1088
|
-
se(() => {
|
|
1089
|
-
e && n(e), o && s(o);
|
|
1090
|
-
}, [t, o, e, n, s]);
|
|
1091
|
-
}
|
|
1092
|
-
const zt = vr;
|
|
1093
|
-
function ne({
|
|
1094
|
-
name: e,
|
|
1095
|
-
className: o
|
|
1096
|
-
}) {
|
|
1097
|
-
const t = (() => {
|
|
1098
|
-
switch (e) {
|
|
1099
|
-
case "Check":
|
|
1100
|
-
return Er;
|
|
1101
|
-
case "CheckCheck":
|
|
1102
|
-
return Dr;
|
|
1103
|
-
case "CircleCheck":
|
|
1104
|
-
return Ft;
|
|
1105
|
-
case "CircleCheckBig":
|
|
1106
|
-
return Mr;
|
|
1107
|
-
case "CircleX":
|
|
1108
|
-
return Tr;
|
|
1109
|
-
case "Expand":
|
|
1110
|
-
return Ir;
|
|
1111
|
-
case "Maximize":
|
|
1112
|
-
return _r;
|
|
1113
|
-
case "Maximize2":
|
|
1114
|
-
return Sr;
|
|
1115
|
-
case "Minimize":
|
|
1116
|
-
return Nr;
|
|
1117
|
-
case "Minimize2":
|
|
1118
|
-
return zr;
|
|
1119
|
-
case "Shrink":
|
|
1120
|
-
return Cr;
|
|
1121
|
-
case "SquareCheck":
|
|
1122
|
-
return kr;
|
|
1123
|
-
case "SquareCheckBig":
|
|
1124
|
-
return yr;
|
|
1125
|
-
case "SquareX":
|
|
1126
|
-
return br;
|
|
1127
|
-
case "X":
|
|
1128
|
-
return Ne;
|
|
1129
|
-
case void 0:
|
|
1130
|
-
return zt;
|
|
1131
|
-
default:
|
|
1132
|
-
return F(e, ne.name), zt;
|
|
1133
|
-
}
|
|
1134
|
-
})();
|
|
1135
|
-
return /* @__PURE__ */ r(t, { className: p("size-4", o) });
|
|
1136
|
-
}
|
|
1137
|
-
function vo() {
|
|
1138
|
-
var t;
|
|
1139
|
-
const e = X(), o = (t = e.config.customComponents) == null ? void 0 : t.headerBottom;
|
|
1140
|
-
return o ? /* @__PURE__ */ r(o, { ...e }) : null;
|
|
1141
|
-
}
|
|
1142
|
-
function bo({ fallback: e }) {
|
|
1143
|
-
var n;
|
|
1144
|
-
const o = X(), t = (n = o.config.customComponents) == null ? void 0 : n.headerTitle;
|
|
1145
|
-
return t ? /* @__PURE__ */ r(t, { ...o }) : e;
|
|
1146
|
-
}
|
|
1147
|
-
function je() {
|
|
1148
|
-
const {
|
|
1149
|
-
widgetCtx: { org: e }
|
|
1150
|
-
} = O(), {
|
|
1151
|
-
routerState: { screen: o }
|
|
1152
|
-
} = H(), { textContent: t } = z();
|
|
1153
|
-
return (() => {
|
|
1154
|
-
var s, i;
|
|
1155
|
-
switch (o) {
|
|
1156
|
-
case "chat":
|
|
1157
|
-
return (s = t == null ? void 0 : t.chatScreen) == null ? void 0 : s.headerTitle;
|
|
1158
|
-
case "sessions":
|
|
1159
|
-
return (i = t == null ? void 0 : t.sessionsScreen) == null ? void 0 : i.headerTitle;
|
|
1160
|
-
case "welcome":
|
|
1161
|
-
return;
|
|
1162
|
-
default:
|
|
1163
|
-
F(o, je.name);
|
|
1164
|
-
return;
|
|
1165
|
-
}
|
|
1166
|
-
})() ?? e.name ?? "Chat";
|
|
1167
|
-
}
|
|
1168
|
-
function yo(e) {
|
|
1169
|
-
switch (e) {
|
|
1170
|
-
case "chat":
|
|
1171
|
-
return x("chat/header");
|
|
1172
|
-
case "sessions":
|
|
1173
|
-
return x("sessions/header");
|
|
1174
|
-
case "welcome":
|
|
1175
|
-
return;
|
|
1176
|
-
default:
|
|
1177
|
-
F(e, je.name);
|
|
1178
|
-
return;
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
function ko() {
|
|
1182
|
-
const { router: e } = z(), {
|
|
1183
|
-
routerState: { screen: o },
|
|
1184
|
-
toSessionsScreen: t
|
|
1185
|
-
} = H();
|
|
1186
|
-
return o !== "chat" || e != null && e.chatScreenOnly ? null : /* @__PURE__ */ r(
|
|
1187
|
-
N,
|
|
1188
|
-
{
|
|
1189
|
-
variant: "ghost",
|
|
1190
|
-
size: "fit",
|
|
1191
|
-
className: "rounded-full",
|
|
1192
|
-
onClick: t,
|
|
1193
|
-
children: /* @__PURE__ */ r(Rr, { className: "size-4 rtl:-scale-100" })
|
|
1194
|
-
}
|
|
1195
|
-
);
|
|
1196
|
-
}
|
|
1197
|
-
function Co({
|
|
1198
|
-
button: e
|
|
1199
|
-
}) {
|
|
1200
|
-
const { setIsOpen: o } = K(), { isSmallScreen: t } = B(), n = X();
|
|
1201
|
-
return t && e.hideOnSmallScreen || !t && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
|
|
1202
|
-
N,
|
|
1203
|
-
{
|
|
1204
|
-
variant: "ghost",
|
|
1205
|
-
size: "fit",
|
|
1206
|
-
className: "rounded-full",
|
|
1207
|
-
onClick: () => {
|
|
1208
|
-
var i;
|
|
1209
|
-
e.handleClick ? e.handleClick() : o(!1), (i = e.onClicked) == null || i.call(e, n);
|
|
1210
|
-
},
|
|
1211
|
-
children: /* @__PURE__ */ r(ne, { name: e.icon })
|
|
1212
|
-
}
|
|
1213
|
-
);
|
|
1214
|
-
}
|
|
1215
|
-
function ke({
|
|
1216
|
-
button: e
|
|
1217
|
-
}) {
|
|
1218
|
-
const [o, t] = P(!1), {
|
|
1219
|
-
routerState: { screen: n }
|
|
1220
|
-
} = H(), { isSmallScreen: s } = B(), { theme: i } = V(), { setWidth: a, setHeight: l } = Jt(), c = X();
|
|
1221
|
-
if (n !== "chat" && n !== "sessions") return null;
|
|
1222
|
-
const m = (() => {
|
|
1223
|
-
switch (n) {
|
|
1224
|
-
case "chat":
|
|
1225
|
-
return i.screens.chat.height;
|
|
1226
|
-
case "sessions":
|
|
1227
|
-
return i.screens.sessions.height;
|
|
1228
|
-
default:
|
|
1229
|
-
return F(n, ke.name), i.screens.chat.height;
|
|
1230
|
-
}
|
|
1231
|
-
})(), h = (() => {
|
|
1232
|
-
switch (n) {
|
|
1233
|
-
case "chat":
|
|
1234
|
-
return i.screens.chat.width;
|
|
1235
|
-
case "sessions":
|
|
1236
|
-
return i.screens.sessions.width;
|
|
1237
|
-
default:
|
|
1238
|
-
return F(n, ke.name), i.screens.chat.width;
|
|
1239
|
-
}
|
|
1240
|
-
})(), k = () => {
|
|
1241
|
-
var w;
|
|
1242
|
-
t((u) => {
|
|
1243
|
-
const v = !u;
|
|
1244
|
-
return l(v ? "100vh" : m), a(v ? `max(40vw, ${h})` : h), v;
|
|
1245
|
-
}), (w = e.onClicked) == null || w.call(e, c);
|
|
1246
|
-
};
|
|
1247
|
-
return s && e.hideOnSmallScreen || !s && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
|
|
1248
|
-
N,
|
|
1249
|
-
{
|
|
1250
|
-
variant: "ghost",
|
|
1251
|
-
size: "fit",
|
|
1252
|
-
className: "rounded-full",
|
|
1253
|
-
onClick: k,
|
|
1254
|
-
children: /* @__PURE__ */ r(
|
|
1255
|
-
ne,
|
|
1256
|
-
{
|
|
1257
|
-
name: e.icon || (o ? e.shrinkIcon : e.expandIcon)
|
|
1258
|
-
}
|
|
1259
|
-
)
|
|
1260
|
-
}
|
|
1261
|
-
);
|
|
1262
|
-
}
|
|
1263
|
-
function er({
|
|
1264
|
-
button: e
|
|
1265
|
-
}) {
|
|
1266
|
-
var M, b;
|
|
1267
|
-
const { close: o } = he(), { widgetCtx: t } = O(), { setIsOpen: n } = K(), { resolveSession: s, sessionState: i } = $(), { isSmallScreen: a } = B(), l = X(), c = !i.session, m = ((M = i.session) == null ? void 0 : M.isOpened) === !1, h = e.onResolved || "stay-in-chat", k = e.behaviorBeforeSessionCreation || "disabled", w = e.behaviorIfSessionIsResolved || "disabled", u = !!(i.isResolvingSession || c && k === "disabled" || m && w === "disabled"), v = async () => {
|
|
1268
|
-
const { success: S, error: I } = await s();
|
|
1269
|
-
if (o(), !S)
|
|
1270
|
-
return console.error(I), !1;
|
|
1271
|
-
switch (h) {
|
|
1272
|
-
case "stay-in-chat":
|
|
1273
|
-
break;
|
|
1274
|
-
case "close-widget":
|
|
1275
|
-
n(!1);
|
|
1276
|
-
break;
|
|
1277
|
-
case "reset-chat":
|
|
1278
|
-
t.resetChat();
|
|
1279
|
-
break;
|
|
1280
|
-
case "reset-chat-and-close-widget":
|
|
1281
|
-
n(!1), t.resetChat();
|
|
1282
|
-
break;
|
|
1283
|
-
default:
|
|
1284
|
-
F(h, er.name);
|
|
1285
|
-
break;
|
|
1286
|
-
}
|
|
1287
|
-
return !0;
|
|
1288
|
-
}, C = () => {
|
|
1289
|
-
if (c)
|
|
1290
|
-
switch (k) {
|
|
1291
|
-
case "disabled":
|
|
1292
|
-
return;
|
|
1293
|
-
case "close-widget":
|
|
1294
|
-
n(!1);
|
|
1295
|
-
break;
|
|
1296
|
-
default:
|
|
1297
|
-
F(
|
|
1298
|
-
k,
|
|
1299
|
-
C.name
|
|
1300
|
-
);
|
|
1301
|
-
}
|
|
1302
|
-
if (m)
|
|
1303
|
-
switch (w) {
|
|
1304
|
-
case "disabled":
|
|
1305
|
-
return;
|
|
1306
|
-
case "close-widget":
|
|
1307
|
-
n(!1);
|
|
1308
|
-
break;
|
|
1309
|
-
case "reset-chat":
|
|
1310
|
-
t.resetChat();
|
|
1311
|
-
break;
|
|
1312
|
-
case "reset-chat-and-close-widget":
|
|
1313
|
-
n(!1), setTimeout(() => {
|
|
1314
|
-
t.resetChat();
|
|
1315
|
-
}, 200);
|
|
1316
|
-
break;
|
|
1317
|
-
default:
|
|
1318
|
-
F(
|
|
1319
|
-
w,
|
|
1320
|
-
C.name
|
|
1321
|
-
);
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
return a && e.hideOnSmallScreen || !a && e.hideOnLargeScreen ? null : ((b = e.confirmation) == null ? void 0 : b.type) === "modal" && !m && !c ? /* @__PURE__ */ r(
|
|
1325
|
-
ge,
|
|
1326
|
-
{
|
|
1327
|
-
trigger: /* @__PURE__ */ r(
|
|
1328
|
-
N,
|
|
1329
|
-
{
|
|
1330
|
-
variant: "ghost",
|
|
1331
|
-
size: "fit",
|
|
1332
|
-
className: "rounded-full",
|
|
1333
|
-
disabled: u,
|
|
1334
|
-
onClick: () => {
|
|
1335
|
-
var S;
|
|
1336
|
-
return (S = e.onClicked) == null ? void 0 : S.call(e, l);
|
|
1337
|
-
},
|
|
1338
|
-
children: /* @__PURE__ */ r(ne, { name: e.icon })
|
|
1339
|
-
}
|
|
1340
|
-
),
|
|
1341
|
-
children: /* @__PURE__ */ d(ue, { children: [
|
|
1342
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(Ie, { children: e.confirmation.title || "Close conversation" }) }),
|
|
1343
|
-
/* @__PURE__ */ r(_e, { children: /* @__PURE__ */ r(Te, { children: e.confirmation.description || "Are you sure you want to close this conversation?" }) }),
|
|
1344
|
-
/* @__PURE__ */ d(Xt, { children: [
|
|
1345
|
-
/* @__PURE__ */ r(
|
|
1346
|
-
N,
|
|
1347
|
-
{
|
|
1348
|
-
variant: "secondary",
|
|
1349
|
-
onClick: o,
|
|
1350
|
-
disabled: i.isResolvingSession,
|
|
1351
|
-
children: e.confirmation.cancelButtonText || "No"
|
|
1352
|
-
}
|
|
1353
|
-
),
|
|
1354
|
-
/* @__PURE__ */ r(
|
|
1355
|
-
N,
|
|
1356
|
-
{
|
|
1357
|
-
variant: "destructive",
|
|
1358
|
-
onClick: async () => {
|
|
1359
|
-
var I, E;
|
|
1360
|
-
await v() && ((E = (I = e.confirmation) == null ? void 0 : I.onResolved) == null || E.call(I, l));
|
|
1361
|
-
},
|
|
1362
|
-
disabled: i.isResolvingSession,
|
|
1363
|
-
children: e.confirmation.confirmButtonText || "Yes"
|
|
1364
|
-
}
|
|
1365
|
-
)
|
|
1366
|
-
] })
|
|
1367
|
-
] })
|
|
1368
|
-
}
|
|
1369
|
-
) : /* @__PURE__ */ r(
|
|
1370
|
-
N,
|
|
1371
|
-
{
|
|
1372
|
-
variant: "ghost",
|
|
1373
|
-
size: "fit",
|
|
1374
|
-
className: "rounded-full",
|
|
1375
|
-
onClick: () => {
|
|
1376
|
-
var S;
|
|
1377
|
-
m || c ? C() : v(), (S = e.onClicked) == null || S.call(e, l);
|
|
1378
|
-
},
|
|
1379
|
-
disabled: u,
|
|
1380
|
-
children: /* @__PURE__ */ r(ne, { name: e.icon })
|
|
1381
|
-
}
|
|
1382
|
-
);
|
|
1383
|
-
}
|
|
1384
|
-
function Ce({ button: e }) {
|
|
1385
|
-
switch (e.functionality) {
|
|
1386
|
-
case "close-widget":
|
|
1387
|
-
return /* @__PURE__ */ r(Co, { button: e });
|
|
1388
|
-
case "expand-shrink":
|
|
1389
|
-
return /* @__PURE__ */ r(ke, { button: e });
|
|
1390
|
-
case "resolve-session":
|
|
1391
|
-
return /* @__PURE__ */ r(er, { button: e });
|
|
1392
|
-
default:
|
|
1393
|
-
return F(e, Ce.name), null;
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
const zo = {
|
|
1397
|
-
functionality: "close-widget",
|
|
1398
|
-
hideOnLargeScreen: !0,
|
|
1399
|
-
icon: "X"
|
|
1400
|
-
};
|
|
1401
|
-
function No() {
|
|
1402
|
-
const {
|
|
1403
|
-
routerState: { screen: e }
|
|
1404
|
-
} = H(), { headerButtons: o } = z(), t = e === "chat" ? o == null ? void 0 : o.chatScreen : e === "sessions" ? o == null ? void 0 : o.sessionsScreen : [];
|
|
1405
|
-
return !t || t.length === 0 ? /* @__PURE__ */ r(Ce, { button: zo }) : /* @__PURE__ */ r(J, { children: t.map((n) => /* @__PURE__ */ r(
|
|
1406
|
-
Ce,
|
|
1407
|
-
{
|
|
1408
|
-
button: n
|
|
1409
|
-
},
|
|
1410
|
-
`${n.functionality}-${n.icon}`
|
|
1411
|
-
)) });
|
|
1412
|
-
}
|
|
1413
|
-
function tr() {
|
|
1414
|
-
const {
|
|
1415
|
-
routerState: { screen: e }
|
|
1416
|
-
} = H(), o = yo(e), t = je();
|
|
1417
|
-
return /* @__PURE__ */ d("header", { ...o, className: "py-2 px-4 shrink-0", children: [
|
|
1418
|
-
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
1419
|
-
/* @__PURE__ */ r(ko, {}),
|
|
1420
|
-
/* @__PURE__ */ r(
|
|
1421
|
-
"div",
|
|
1422
|
-
{
|
|
1423
|
-
className: p(
|
|
1424
|
-
"flex-1 h-8 flex items-center",
|
|
1425
|
-
e === "sessions" && "ps-2"
|
|
1426
|
-
),
|
|
1427
|
-
children: /* @__PURE__ */ r(
|
|
1428
|
-
bo,
|
|
1429
|
-
{
|
|
1430
|
-
fallback: /* @__PURE__ */ r("h2", { className: "font-semibold", children: t })
|
|
1431
|
-
}
|
|
1432
|
-
)
|
|
1433
|
-
}
|
|
1434
|
-
),
|
|
1435
|
-
/* @__PURE__ */ r(No, {})
|
|
1436
|
-
] }),
|
|
1437
|
-
/* @__PURE__ */ r(vo, {})
|
|
1438
|
-
] });
|
|
1439
|
-
}
|
|
1440
|
-
function rr({ className: e }) {
|
|
1441
|
-
return /* @__PURE__ */ r(Pr, { className: p("size-4 animate-spin", e) });
|
|
1442
|
-
}
|
|
1443
|
-
function So() {
|
|
1444
|
-
const {
|
|
1445
|
-
messagesState: { isInitialFetchLoading: e }
|
|
1446
|
-
} = A(), { isSmallScreen: o } = B(), { activeMode: t, Component: n } = Et();
|
|
1447
|
-
return {
|
|
1448
|
-
isCanvasOpen: !e && !o && !!t && !!n
|
|
1449
|
-
};
|
|
1450
|
-
}
|
|
1451
|
-
function _o() {
|
|
1452
|
-
const e = X(), { activeMode: o, Component: t } = Et(), { sendMessage: n } = A(), { createStateCheckpoint: s } = $(), [i, a] = P(!1), l = async (c) => {
|
|
1453
|
-
try {
|
|
1454
|
-
a(!0), await n(c);
|
|
1455
|
-
} catch (m) {
|
|
1456
|
-
console.error(m);
|
|
1457
|
-
} finally {
|
|
1458
|
-
a(!1);
|
|
1459
|
-
}
|
|
1460
|
-
};
|
|
1461
|
-
return !o || !t ? null : /* @__PURE__ */ r(
|
|
1462
|
-
t,
|
|
1463
|
-
{
|
|
1464
|
-
...e,
|
|
1465
|
-
mode: o,
|
|
1466
|
-
createStateCheckpoint: s,
|
|
1467
|
-
sendMessage: l,
|
|
1468
|
-
isSendingMessage: i
|
|
1469
|
-
}
|
|
1470
|
-
);
|
|
1471
|
-
}
|
|
1472
|
-
function G() {
|
|
1473
|
-
const { dir: e } = ze(), o = z();
|
|
1474
|
-
return Dt(() => {
|
|
1475
|
-
const t = Gr(o.language) ? o.language : "en";
|
|
1476
|
-
return {
|
|
1477
|
-
t: (n) => Zr(n, t, o.translationOverrides),
|
|
1478
|
-
language: t,
|
|
1479
|
-
dir: t === "ar" ? "rtl" : "ltr",
|
|
1480
|
-
hostDocumentDir: e
|
|
1481
|
-
};
|
|
1482
|
-
}, [o.language, e]);
|
|
1483
|
-
}
|
|
1484
|
-
const W = L.forwardRef(
|
|
1485
|
-
(e, o) => {
|
|
1486
|
-
var t, n, s;
|
|
1487
|
-
return /* @__PURE__ */ r(
|
|
1488
|
-
y,
|
|
1489
|
-
{
|
|
1490
|
-
...e,
|
|
1491
|
-
ref: o,
|
|
1492
|
-
className: p("overflow-hidden", e.className),
|
|
1493
|
-
overrides: {
|
|
1494
|
-
initial: { height: 0, opacity: 0, ...(t = e.overrides) == null ? void 0 : t.initial },
|
|
1495
|
-
animate: { height: "auto", opacity: 1, ...(n = e.overrides) == null ? void 0 : n.animate },
|
|
1496
|
-
exit: { height: 0, opacity: 0, ...(s = e.overrides) == null ? void 0 : s.exit }
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
);
|
|
1500
|
-
}
|
|
1501
|
-
);
|
|
1502
|
-
W.displayName = "MotionDiv__VerticalReveal";
|
|
1503
|
-
const Io = [
|
|
1504
|
-
{
|
|
1505
|
-
label: "Terrible",
|
|
1506
|
-
value: 1,
|
|
1507
|
-
emoji: "😡"
|
|
1508
|
-
},
|
|
1509
|
-
{
|
|
1510
|
-
label: "Poor",
|
|
1511
|
-
value: 2,
|
|
1512
|
-
emoji: "😞"
|
|
1513
|
-
},
|
|
1514
|
-
{
|
|
1515
|
-
label: "Okay",
|
|
1516
|
-
value: 3,
|
|
1517
|
-
emoji: "😐"
|
|
1518
|
-
},
|
|
1519
|
-
{
|
|
1520
|
-
label: "Good",
|
|
1521
|
-
value: 4,
|
|
1522
|
-
emoji: "😊"
|
|
1523
|
-
},
|
|
1524
|
-
{
|
|
1525
|
-
label: "Great",
|
|
1526
|
-
value: 5,
|
|
1527
|
-
emoji: "😍"
|
|
1528
|
-
}
|
|
1529
|
-
];
|
|
1530
|
-
function To() {
|
|
1531
|
-
const { isSmallScreen: e } = B(), { t: o } = G(), {
|
|
1532
|
-
submitCsat: t,
|
|
1533
|
-
isCsatRequested: n,
|
|
1534
|
-
isCsatSubmitted: s,
|
|
1535
|
-
submittedScore: i,
|
|
1536
|
-
submittedFeedback: a
|
|
1537
|
-
} = Rt(), [l, c] = P(null), [m, h] = P(null), k = (u) => {
|
|
1538
|
-
c((v) => v === u ? null : u);
|
|
1539
|
-
}, w = () => {
|
|
1540
|
-
l && t({
|
|
1541
|
-
score: l,
|
|
1542
|
-
feedback: m || void 0
|
|
1543
|
-
});
|
|
1544
|
-
};
|
|
1545
|
-
return !n && !s ? null : /* @__PURE__ */ d("div", { className: "w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden", children: [
|
|
1546
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: n && !l ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: o("csat_title") }) }, "csat-requested-title") : s ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: o("csat_submitted_title") }) }, "csat-submitted-title") : null }),
|
|
1547
|
-
/* @__PURE__ */ r(
|
|
1548
|
-
"div",
|
|
1549
|
-
{
|
|
1550
|
-
dir: "ltr",
|
|
1551
|
-
className: p(
|
|
1552
|
-
"flex gap-4 justify-between pt-2 px-2 pb-2",
|
|
1553
|
-
"transition-all",
|
|
1554
|
-
s && "gap-0 justify-center"
|
|
1555
|
-
),
|
|
1556
|
-
children: Io.map((u) => /* @__PURE__ */ r(
|
|
1557
|
-
N,
|
|
1558
|
-
{
|
|
1559
|
-
variant: u.value === l ? "secondary" : "ghost",
|
|
1560
|
-
size: "selfless",
|
|
1561
|
-
className: p(
|
|
1562
|
-
"transition-all overflow-hidden",
|
|
1563
|
-
"text-2xl size-8 rounded-full",
|
|
1564
|
-
"opacity-35",
|
|
1565
|
-
"hover:opacity-100",
|
|
1566
|
-
!l && "opacity-100",
|
|
1567
|
-
u.value === l && "opacity-100",
|
|
1568
|
-
s && u.value !== i && "opacity-0 size-0",
|
|
1569
|
-
s && u.value === i && "opacity-100 size-fit text-4xl"
|
|
1570
|
-
),
|
|
1571
|
-
onClick: n ? () => k(u.value) : void 0,
|
|
1572
|
-
children: u.emoji
|
|
1573
|
-
},
|
|
1574
|
-
u.value
|
|
1575
|
-
))
|
|
1576
|
-
}
|
|
1577
|
-
),
|
|
1578
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: (l || i) && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ d("div", { className: "pb-2 px-2 flex items-end", children: [
|
|
1579
|
-
/* @__PURE__ */ r(
|
|
1580
|
-
"textarea",
|
|
1581
|
-
{
|
|
1582
|
-
rows: 3,
|
|
1583
|
-
className: p(
|
|
1584
|
-
"transition-all",
|
|
1585
|
-
"max-h-40 [field-sizing:content]",
|
|
1586
|
-
"w-full resize-none",
|
|
1587
|
-
"bg-transparent outline-none",
|
|
1588
|
-
"placeholder:text-muted-foreground",
|
|
1589
|
-
// 16px on mobiles prevents auto-zoom on the input when focused
|
|
1590
|
-
e ? "text-[16px]" : "text-sm",
|
|
1591
|
-
s && "text-center"
|
|
1592
|
-
),
|
|
1593
|
-
value: s ? a || "" : m || "",
|
|
1594
|
-
onChange: n ? (u) => h(u.target.value) : void 0,
|
|
1595
|
-
readOnly: s,
|
|
1596
|
-
placeholder: n ? o("csat_feedback_placeholder") : void 0
|
|
1597
|
-
}
|
|
1598
|
-
),
|
|
1599
|
-
/* @__PURE__ */ r(
|
|
1600
|
-
N,
|
|
1601
|
-
{
|
|
1602
|
-
size: "fit",
|
|
1603
|
-
onClick: w,
|
|
1604
|
-
disabled: !l,
|
|
1605
|
-
className: p(
|
|
1606
|
-
"transition-all overflow-hidden",
|
|
1607
|
-
"rounded-full size-8 flex items-center justify-center p-0",
|
|
1608
|
-
s && "opacity-0 size-0"
|
|
1609
|
-
),
|
|
1610
|
-
children: /* @__PURE__ */ r(Ht, { className: "size-4" })
|
|
1611
|
-
}
|
|
1612
|
-
)
|
|
1613
|
-
] }) }, "feedback-box") }),
|
|
1614
|
-
/* @__PURE__ */ r(
|
|
1615
|
-
"div",
|
|
1616
|
-
{
|
|
1617
|
-
className: p("h-0 transition-[height]", s && "h-4")
|
|
1618
|
-
}
|
|
1619
|
-
)
|
|
1620
|
-
] });
|
|
1621
|
-
}
|
|
1622
|
-
function Oe({
|
|
1623
|
-
suggestion: e,
|
|
1624
|
-
className: o,
|
|
1625
|
-
...t
|
|
1626
|
-
}) {
|
|
1627
|
-
const { sendMessage: n } = A(), s = () => {
|
|
1628
|
-
const i = e.trim();
|
|
1629
|
-
i && n({ content: i });
|
|
1630
|
-
};
|
|
1631
|
-
return /* @__PURE__ */ r(
|
|
1632
|
-
N,
|
|
1633
|
-
{
|
|
1634
|
-
...x("chat/suggested_reply_btn"),
|
|
1635
|
-
size: "sm",
|
|
1636
|
-
className: p("rounded-xl w-fit", o),
|
|
1637
|
-
...t,
|
|
1638
|
-
onClick: s,
|
|
1639
|
-
children: e
|
|
1640
|
-
}
|
|
1641
|
-
);
|
|
1642
|
-
}
|
|
1643
|
-
function Mo() {
|
|
1644
|
-
const { t: e } = G(), o = [e("i_need_more_help"), e("this_was_helpful")];
|
|
1645
|
-
return /* @__PURE__ */ r(
|
|
1646
|
-
"div",
|
|
1647
|
-
{
|
|
1648
|
-
...x("chat/might_solve_user_issue_suggested_replies_container"),
|
|
1649
|
-
className: "flex items-center gap-2 p-2 pb-0 flex-wrap",
|
|
1650
|
-
children: o.map((t) => /* @__PURE__ */ r(
|
|
1651
|
-
Oe,
|
|
1652
|
-
{
|
|
1653
|
-
suggestion: t,
|
|
1654
|
-
className: "flex-1"
|
|
1655
|
-
},
|
|
1656
|
-
t
|
|
1657
|
-
))
|
|
1658
|
-
}
|
|
1659
|
-
);
|
|
1660
|
-
}
|
|
1661
|
-
function Nt() {
|
|
1662
|
-
const { sessionState: e } = $(), { chatFooterItems: o } = z(), t = !!e.session && !e.session.isOpened, n = !t;
|
|
1663
|
-
return /* @__PURE__ */ r(_, { mode: "wait", children: o == null ? void 0 : o.map((s, i) => s.showWhenSessionIsOpen === !1 && n || s.showWhenSessionIsResolved === !1 && t ? null : /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("div", { className: "pb-2 text-center text-xs", children: /* @__PURE__ */ r(Me, { children: s.message }) }) }, `${s.message}-${i}`)) });
|
|
1664
|
-
}
|
|
1665
|
-
function Do({
|
|
1666
|
-
file: { status: e, file: o, error: t },
|
|
1667
|
-
onCancel: n
|
|
1668
|
-
}) {
|
|
1669
|
-
const [s, i] = P(
|
|
1670
|
-
null
|
|
1671
|
-
);
|
|
1672
|
-
se(() => {
|
|
1673
|
-
if (!o.type.startsWith("image/")) return;
|
|
1674
|
-
const c = new FileReader();
|
|
1675
|
-
return c.onload = () => i(c.result), c.onerror = () => console.error("Error reading file"), c.readAsDataURL(o), () => c.abort();
|
|
1676
|
-
}, [o]);
|
|
1677
|
-
const a = () => {
|
|
1678
|
-
switch (e) {
|
|
1679
|
-
case "uploading":
|
|
1680
|
-
return /* @__PURE__ */ r(Ar, { className: "size-4 animate-spin" });
|
|
1681
|
-
case "error":
|
|
1682
|
-
return /* @__PURE__ */ r(Or, { className: "size-4 text-destructive" });
|
|
1683
|
-
default:
|
|
1684
|
-
return null;
|
|
1685
|
-
}
|
|
1686
|
-
}, l = () => {
|
|
1687
|
-
const c = o.type.split("/")[0];
|
|
1688
|
-
return c === "image" && s ? /* @__PURE__ */ r(
|
|
1689
|
-
"img",
|
|
1690
|
-
{
|
|
1691
|
-
src: typeof s == "string" ? s : "",
|
|
1692
|
-
className: "object-cover bg-secondary size-full",
|
|
1693
|
-
alt: o.name
|
|
1694
|
-
}
|
|
1695
|
-
) : c === "audio" ? /* @__PURE__ */ r(Fr, { className: "size-4 text-muted-foreground" }) : c === "video" ? /* @__PURE__ */ r(Hr, { className: "size-4 text-muted-foreground" }) : o.type === "application/pdf" ? /* @__PURE__ */ r(Ot, { className: "size-4 text-muted-foreground" }) : Ut({ type: o.type, name: o.name }) ? /* @__PURE__ */ r(At, { className: "size-4 text-muted-foreground" }) : /* @__PURE__ */ r(Wr, { className: "size-4 text-muted-foreground" });
|
|
1696
|
-
};
|
|
1697
|
-
return /* @__PURE__ */ r(
|
|
1698
|
-
oe,
|
|
1699
|
-
{
|
|
1700
|
-
side: "bottom",
|
|
1701
|
-
content: e === "error" ? /* @__PURE__ */ d("span", { className: "text-destructive", children: [
|
|
1702
|
-
"Failed to upload: ",
|
|
1703
|
-
t
|
|
1704
|
-
] }) : o.name,
|
|
1705
|
-
children: /* @__PURE__ */ d(
|
|
1706
|
-
"div",
|
|
1707
|
-
{
|
|
1708
|
-
className: p(
|
|
1709
|
-
e === "uploading" && "opacity-50",
|
|
1710
|
-
"group",
|
|
1711
|
-
"size-12 border rounded-2xl overflow-hidden relative",
|
|
1712
|
-
"flex items-center justify-center shrink-0"
|
|
1713
|
-
),
|
|
1714
|
-
children: [
|
|
1715
|
-
/* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center", children: a() }),
|
|
1716
|
-
/* @__PURE__ */ r(
|
|
1717
|
-
"button",
|
|
1718
|
-
{
|
|
1719
|
-
type: "button",
|
|
1720
|
-
className: p(
|
|
1721
|
-
"absolute bg-black/50 inset-0 size-full z-10 opacity-0",
|
|
1722
|
-
"flex items-center justify-center",
|
|
1723
|
-
"opacity-0 group-hover:opacity-100 transition"
|
|
1724
|
-
),
|
|
1725
|
-
onClick: n,
|
|
1726
|
-
children: /* @__PURE__ */ r(Ne, { className: "size-4 text-primary-foreground" })
|
|
1727
|
-
}
|
|
1728
|
-
),
|
|
1729
|
-
/* @__PURE__ */ r(l, {})
|
|
1730
|
-
]
|
|
1731
|
-
}
|
|
1732
|
-
)
|
|
1733
|
-
}
|
|
1734
|
-
);
|
|
1735
|
-
}
|
|
1736
|
-
const Eo = 25 * 1024 * 1024;
|
|
1737
|
-
function Ro() {
|
|
1738
|
-
var R;
|
|
1739
|
-
const { isSmallScreen: e } = B(), o = U(null), { sendMessage: t } = A(), { sessionState: n } = $(), { disableSendingWhenAwaitingAIReply: s } = z(), { t: i } = G(), [a, l] = P(""), {
|
|
1740
|
-
allFiles: c,
|
|
1741
|
-
emptyTheFiles: m,
|
|
1742
|
-
handleCancelUpload: h,
|
|
1743
|
-
appendFiles: k,
|
|
1744
|
-
isUploading: w,
|
|
1745
|
-
successFiles: u
|
|
1746
|
-
} = mr(), v = !!((R = n.session) != null && R.isHandedOff), { isAwaitingBotReply: C } = Pt(), M = s !== !1 && C, b = (g) => {
|
|
1747
|
-
k(g);
|
|
1748
|
-
}, S = !a.trim() && u.length === 0, I = async () => {
|
|
1749
|
-
if (M || S) return;
|
|
1750
|
-
w && console.info("please wait for the file(s) to upload");
|
|
1751
|
-
const g = a.trim();
|
|
1752
|
-
t({
|
|
1753
|
-
content: g,
|
|
1754
|
-
attachments: u.flatMap(
|
|
1755
|
-
(T) => T.fileUrl ? [
|
|
1756
|
-
{
|
|
1757
|
-
url: T.fileUrl,
|
|
1758
|
-
type: T.file.type,
|
|
1759
|
-
name: T.file.name,
|
|
1760
|
-
id: T.id,
|
|
1761
|
-
size: T.file.size
|
|
1762
|
-
}
|
|
1763
|
-
] : []
|
|
1764
|
-
)
|
|
1765
|
-
}), l(""), m();
|
|
1766
|
-
}, {
|
|
1767
|
-
getRootProps: E,
|
|
1768
|
-
getInputProps: f,
|
|
1769
|
-
open: D
|
|
1770
|
-
} = Kr({
|
|
1771
|
-
onDrop: b,
|
|
1772
|
-
noClick: !0,
|
|
1773
|
-
onDropRejected() {
|
|
1774
|
-
console.error("unsupported file type, or the file is too large");
|
|
1775
|
-
},
|
|
1776
|
-
maxSize: Eo,
|
|
1777
|
-
accept: v ? {
|
|
1778
|
-
"text/*": [".txt"],
|
|
1779
|
-
"image/*": [".png", ".jpg", ".jpeg", ".gif"],
|
|
1780
|
-
"application/pdf": [".pdf"],
|
|
1781
|
-
...xt,
|
|
1782
|
-
...vt
|
|
1783
|
-
} : {
|
|
1784
|
-
"image/png": [".png"],
|
|
1785
|
-
"image/jpeg": [".jpg", ".jpeg"],
|
|
1786
|
-
"image/gif": [".gif"],
|
|
1787
|
-
"image/webp": [".webp"],
|
|
1788
|
-
"application/pdf": [".pdf"],
|
|
1789
|
-
...xt,
|
|
1790
|
-
...vt
|
|
1791
|
-
}
|
|
1792
|
-
}), j = (g) => {
|
|
1793
|
-
const T = g.clipboardData;
|
|
1794
|
-
T && T.files.length > 0 && b(Array.from(T.files));
|
|
1795
|
-
};
|
|
1796
|
-
return /* @__PURE__ */ d(
|
|
1797
|
-
"div",
|
|
1798
|
-
{
|
|
1799
|
-
...x("chat/input_box/root"),
|
|
1800
|
-
className: "p-2 relative space-y-1",
|
|
1801
|
-
...E(),
|
|
1802
|
-
children: [
|
|
1803
|
-
/* @__PURE__ */ r("input", { ...f() }),
|
|
1804
|
-
/* @__PURE__ */ d(
|
|
1805
|
-
"div",
|
|
1806
|
-
{
|
|
1807
|
-
...x("chat/input_box/inner_root"),
|
|
1808
|
-
className: p(
|
|
1809
|
-
"transition-all",
|
|
1810
|
-
"bg-white",
|
|
1811
|
-
// 'border',
|
|
1812
|
-
"relative rounded-3xl flex flex-col gap-2 p-2",
|
|
1813
|
-
"hover:border-primary focus-within:border-primary"
|
|
1814
|
-
),
|
|
1815
|
-
children: [
|
|
1816
|
-
/* @__PURE__ */ d(
|
|
1817
|
-
"div",
|
|
1818
|
-
{
|
|
1819
|
-
...x("chat/input_box/textarea_and_attachments_container"),
|
|
1820
|
-
className: "flex flex-col gap-2",
|
|
1821
|
-
children: [
|
|
1822
|
-
c.length > 0 && /* @__PURE__ */ r(
|
|
1823
|
-
"div",
|
|
1824
|
-
{
|
|
1825
|
-
...x("chat/input_box/attachments_container"),
|
|
1826
|
-
className: "flex items-center gap-1",
|
|
1827
|
-
children: /* @__PURE__ */ r(_, { mode: "popLayout", children: c.map((g) => /* @__PURE__ */ r(y, { snapExit: !0, children: /* @__PURE__ */ r(
|
|
1828
|
-
Do,
|
|
1829
|
-
{
|
|
1830
|
-
onCancel: () => h(g.id),
|
|
1831
|
-
file: g
|
|
1832
|
-
}
|
|
1833
|
-
) }, g.id)) })
|
|
1834
|
-
}
|
|
1835
|
-
),
|
|
1836
|
-
/* @__PURE__ */ r(
|
|
1837
|
-
"textarea",
|
|
1838
|
-
{
|
|
1839
|
-
...x("chat/input_box/textarea"),
|
|
1840
|
-
onPaste: j,
|
|
1841
|
-
ref: o,
|
|
1842
|
-
id: "chat-input",
|
|
1843
|
-
value: a,
|
|
1844
|
-
rows: 3,
|
|
1845
|
-
className: p(
|
|
1846
|
-
/** Match the border radius of the container */
|
|
1847
|
-
// INPUT_CONTAINER_B_RADIUS,
|
|
1848
|
-
"max-h-16 [field-sizing:content]",
|
|
1849
|
-
"w-full resize-none px-2",
|
|
1850
|
-
c.length === 0 && "pt-1",
|
|
1851
|
-
"bg-transparent outline-none",
|
|
1852
|
-
"placeholder:text-muted-foreground",
|
|
1853
|
-
// 16px on mobiles prevents auto-zoom on the input when focused
|
|
1854
|
-
e ? "text-[16px]" : "text-sm"
|
|
1855
|
-
),
|
|
1856
|
-
onChange: (g) => l(g.target.value),
|
|
1857
|
-
onKeyDown: async (g) => {
|
|
1858
|
-
g.key === "Enter" && !g.shiftKey && (g.preventDefault(), I());
|
|
1859
|
-
},
|
|
1860
|
-
placeholder: i("write_a_message_placeholder")
|
|
1861
|
-
}
|
|
1862
|
-
)
|
|
1863
|
-
]
|
|
1864
|
-
}
|
|
1865
|
-
),
|
|
1866
|
-
/* @__PURE__ */ d("div", { className: "gap-2 flex justify-between", children: [
|
|
1867
|
-
/* @__PURE__ */ r(
|
|
1868
|
-
oe,
|
|
1869
|
-
{
|
|
1870
|
-
side: "top",
|
|
1871
|
-
align: "start",
|
|
1872
|
-
content: "attach images, videos, PDFs, or spreadsheets (maximum size 25mb)",
|
|
1873
|
-
children: /* @__PURE__ */ r(
|
|
1874
|
-
N,
|
|
1875
|
-
{
|
|
1876
|
-
onClick: D,
|
|
1877
|
-
size: "fit",
|
|
1878
|
-
variant: "ghost",
|
|
1879
|
-
className: p(
|
|
1880
|
-
"rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"
|
|
1881
|
-
),
|
|
1882
|
-
children: /* @__PURE__ */ r(_, { mode: "wait", children: M ? /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(wt, { className: "size-4 opacity-50" }) }, "paper-clip-disabled") : /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(wt, { className: "size-4" }) }, "paper-clip") })
|
|
1883
|
-
}
|
|
1884
|
-
)
|
|
1885
|
-
}
|
|
1886
|
-
),
|
|
1887
|
-
/* @__PURE__ */ r(oe, { content: "send message", side: "top", align: "end", children: /* @__PURE__ */ r(
|
|
1888
|
-
N,
|
|
1889
|
-
{
|
|
1890
|
-
size: "fit",
|
|
1891
|
-
onClick: I,
|
|
1892
|
-
disabled: M || w || S,
|
|
1893
|
-
className: "rounded-full size-8 flex items-center justify-center p-0",
|
|
1894
|
-
children: /* @__PURE__ */ r(_, { mode: "wait", children: M || w ? /* @__PURE__ */ r(y, { snapExit: !0, children: /* @__PURE__ */ r(jr, { className: "size-4 animate-spin animate-iteration-infinite" }) }, "loading") : /* @__PURE__ */ r(y, { snapExit: !0, children: /* @__PURE__ */ r(Ht, { className: "size-4" }) }, "send") })
|
|
1895
|
-
}
|
|
1896
|
-
) })
|
|
1897
|
-
] })
|
|
1898
|
-
]
|
|
1899
|
-
}
|
|
1900
|
-
)
|
|
1901
|
-
]
|
|
1902
|
-
}
|
|
1903
|
-
);
|
|
1904
|
-
}
|
|
1905
|
-
function St() {
|
|
1906
|
-
const { widgetCtx: e } = O(), { router: o } = z(), { canCreateNewSession: t } = $(), { toSessionsScreen: n } = H(), { t: s } = G();
|
|
1907
|
-
return /* @__PURE__ */ r(J, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(N, { onClick: e.resetChat, className: "rounded-2xl w-full", children: s("new_conversation") }) : /* @__PURE__ */ r(N, { onClick: n, className: "rounded-2xl w-full", children: s("back_to_conversations") }) });
|
|
1908
|
-
}
|
|
1909
|
-
function Po() {
|
|
1910
|
-
const { t: e } = G(), { isCsatRequested: o, isCsatSubmitted: t } = Rt();
|
|
1911
|
-
return /* @__PURE__ */ r("div", { className: "p-2", children: /* @__PURE__ */ r("div", { className: "p-2 bg-muted rounded-3xl", children: /* @__PURE__ */ r(_, { mode: "wait", children: o || t ? /* @__PURE__ */ d(W, { children: [
|
|
1912
|
-
/* @__PURE__ */ r(To, {}),
|
|
1913
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: t && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(St, {}) }, "new-conv-or-back-to-convs-button") })
|
|
1914
|
-
] }, "csat") : /* @__PURE__ */ d(W, { children: [
|
|
1915
|
-
/* @__PURE__ */ d("div", { className: "ps-2 flex items-center gap-1 pb-2", children: [
|
|
1916
|
-
/* @__PURE__ */ r(Ft, { className: "size-4 text-emerald-600" }),
|
|
1917
|
-
/* @__PURE__ */ r("h2", { className: "text-sm font-medium", children: e("your_issue_has_been_resolved") })
|
|
1918
|
-
] }),
|
|
1919
|
-
/* @__PURE__ */ r(St, {})
|
|
1920
|
-
] }, "session-closed") }) }) });
|
|
1921
|
-
}
|
|
1922
|
-
function jo() {
|
|
1923
|
-
var a;
|
|
1924
|
-
const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = z(), { sessionState: n } = $(), { messagesState: s } = A(), i = s.messages.length === 0;
|
|
1925
|
-
return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(_, { mode: "wait", children: n.session && !((a = n.session) != null && a.isOpened) ? /* @__PURE__ */ d(W, { children: [
|
|
1926
|
-
/* @__PURE__ */ r(Po, {}),
|
|
1927
|
-
/* @__PURE__ */ r(Nt, {})
|
|
1928
|
-
] }, "session-closed") : /* @__PURE__ */ d(W, { children: [
|
|
1929
|
-
s.lastAIResMightSolveUserIssue && (t == null ? void 0 : t.enabled) !== !1 && /* @__PURE__ */ r(Mo, {}),
|
|
1930
|
-
i && e && o !== "below-initial-messages" && /* @__PURE__ */ r("div", { className: "flex items-center flex-row justify-end gap-2 flex-wrap px-2", children: e == null ? void 0 : e.map((l, c) => /* @__PURE__ */ r(
|
|
1931
|
-
Oe,
|
|
1932
|
-
{
|
|
1933
|
-
suggestion: l
|
|
1934
|
-
},
|
|
1935
|
-
`${l}-${c}`
|
|
1936
|
-
)) }),
|
|
1937
|
-
/* @__PURE__ */ r(Ro, {}),
|
|
1938
|
-
/* @__PURE__ */ r(Nt, {})
|
|
1939
|
-
] }, "chat-input") }) });
|
|
1940
|
-
}
|
|
1941
|
-
function Oo({
|
|
1942
|
-
isFirstInGroup: e,
|
|
1943
|
-
isLastInGroup: o,
|
|
1944
|
-
isAloneInGroup: t,
|
|
1945
|
-
...n
|
|
1946
|
-
}) {
|
|
1947
|
-
const { componentStore: s } = O();
|
|
1948
|
-
if (n.type !== "AGENT" && n.type !== "AI") return null;
|
|
1949
|
-
if (n.data.action) {
|
|
1950
|
-
const a = s.getComponent(n.data.action.name);
|
|
1951
|
-
if (a)
|
|
1952
|
-
return /* @__PURE__ */ r(
|
|
1953
|
-
a,
|
|
1954
|
-
{
|
|
1955
|
-
...n,
|
|
1956
|
-
id: n.id,
|
|
1957
|
-
isFirstInGroup: e,
|
|
1958
|
-
isLastInGroup: o,
|
|
1959
|
-
isAloneInGroup: t
|
|
1960
|
-
}
|
|
1961
|
-
);
|
|
1962
|
-
}
|
|
1963
|
-
const i = s.getComponent(n.component);
|
|
1964
|
-
return i ? /* @__PURE__ */ r(
|
|
1965
|
-
i,
|
|
1966
|
-
{
|
|
1967
|
-
...n,
|
|
1968
|
-
id: n.id,
|
|
1969
|
-
isFirstInGroup: e,
|
|
1970
|
-
isLastInGroup: o,
|
|
1971
|
-
isAloneInGroup: t
|
|
1972
|
-
}
|
|
1973
|
-
) : /* @__PURE__ */ r(
|
|
1974
|
-
be,
|
|
1975
|
-
{
|
|
1976
|
-
...n,
|
|
1977
|
-
isFirstInGroup: e,
|
|
1978
|
-
isLastInGroup: o,
|
|
1979
|
-
isAloneInGroup: t
|
|
1980
|
-
}
|
|
1981
|
-
);
|
|
1982
|
-
}
|
|
1983
|
-
function or({
|
|
1984
|
-
messages: e,
|
|
1985
|
-
className: o,
|
|
1986
|
-
containerClassName: t
|
|
1987
|
-
}) {
|
|
1988
|
-
var a, l;
|
|
1989
|
-
const { timestamps: n } = z();
|
|
1990
|
-
if (!((a = n == null ? void 0 : n.perMessageGroup) != null && a.enabled))
|
|
1991
|
-
return null;
|
|
1992
|
-
const s = (l = e[e.length - 1]) == null ? void 0 : l.timestamp;
|
|
1993
|
-
if (!s) return null;
|
|
1994
|
-
const i = (() => {
|
|
1995
|
-
try {
|
|
1996
|
-
return new Date(s).toLocaleTimeString([], {
|
|
1997
|
-
hour: "2-digit",
|
|
1998
|
-
minute: "2-digit",
|
|
1999
|
-
hour12: !0
|
|
2000
|
-
});
|
|
2001
|
-
} catch (c) {
|
|
2002
|
-
return console.error(c), null;
|
|
2003
|
-
}
|
|
2004
|
-
})();
|
|
2005
|
-
return i ? /* @__PURE__ */ r("div", { className: t, children: /* @__PURE__ */ r("span", { className: p("text-xs text-muted-foreground", o), children: i }) }) : null;
|
|
2006
|
-
}
|
|
2007
|
-
function pe({
|
|
2008
|
-
messages: e,
|
|
2009
|
-
agent: o,
|
|
2010
|
-
suggestedReplies: t
|
|
2011
|
-
}) {
|
|
2012
|
-
return /* @__PURE__ */ d(
|
|
2013
|
-
"div",
|
|
2014
|
-
{
|
|
2015
|
-
...x("chat/agent_msg_group/root"),
|
|
2016
|
-
className: p("flex items-end gap-2"),
|
|
2017
|
-
children: [
|
|
2018
|
-
/* @__PURE__ */ r(oe, { content: o == null ? void 0 : o.name, side: "right", align: "end", children: /* @__PURE__ */ r(
|
|
2019
|
-
ye,
|
|
2020
|
-
{
|
|
2021
|
-
...x("chat/agent_msg_group/root/avatar"),
|
|
2022
|
-
agent: o,
|
|
2023
|
-
className: "hidden"
|
|
2024
|
-
}
|
|
2025
|
-
) }),
|
|
2026
|
-
/* @__PURE__ */ d("div", { className: p("flex-1 flex flex-col gap-1"), children: [
|
|
2027
|
-
/* @__PURE__ */ d(
|
|
2028
|
-
"div",
|
|
2029
|
-
{
|
|
2030
|
-
...x("chat/agent_msg_group/avatar_and_msgs/root"),
|
|
2031
|
-
className: p("flex items-end gap-2"),
|
|
2032
|
-
children: [
|
|
2033
|
-
/* @__PURE__ */ r(oe, { content: o == null ? void 0 : o.name, side: "right", align: "end", children: /* @__PURE__ */ r(
|
|
2034
|
-
ye,
|
|
2035
|
-
{
|
|
2036
|
-
...x("chat/agent_msg_group/avatar_and_msgs/avatar"),
|
|
2037
|
-
agent: o
|
|
2038
|
-
}
|
|
2039
|
-
) }),
|
|
2040
|
-
/* @__PURE__ */ d(
|
|
2041
|
-
"div",
|
|
2042
|
-
{
|
|
2043
|
-
...x("chat/agent_msg_group/avatar_and_msgs/msgs"),
|
|
2044
|
-
className: p("flex-1 flex flex-col gap-1"),
|
|
2045
|
-
children: [
|
|
2046
|
-
e.map((n, s, i) => /* @__PURE__ */ r(
|
|
2047
|
-
Oo,
|
|
2048
|
-
{
|
|
2049
|
-
isFirstInGroup: s === 0,
|
|
2050
|
-
isLastInGroup: s === i.length - 1,
|
|
2051
|
-
isAloneInGroup: i.length === 1,
|
|
2052
|
-
...n
|
|
2053
|
-
},
|
|
2054
|
-
n.id
|
|
2055
|
-
)),
|
|
2056
|
-
/* @__PURE__ */ r(or, { messages: e })
|
|
2057
|
-
]
|
|
2058
|
-
}
|
|
2059
|
-
)
|
|
2060
|
-
]
|
|
2061
|
-
}
|
|
2062
|
-
),
|
|
2063
|
-
t && t.length > 0 && /* @__PURE__ */ r(
|
|
2064
|
-
"div",
|
|
2065
|
-
{
|
|
2066
|
-
...x("chat/agent_msg_group/suggestions"),
|
|
2067
|
-
className: p("flex flex-col gap-1 ps-8"),
|
|
2068
|
-
children: t == null ? void 0 : t.map((n, s) => /* @__PURE__ */ r(
|
|
2069
|
-
Oe,
|
|
2070
|
-
{
|
|
2071
|
-
suggestion: n
|
|
2072
|
-
},
|
|
2073
|
-
`${n}-${s}`
|
|
2074
|
-
))
|
|
2075
|
-
}
|
|
2076
|
-
)
|
|
2077
|
-
] })
|
|
2078
|
-
]
|
|
2079
|
-
}
|
|
2080
|
-
);
|
|
2081
|
-
}
|
|
2082
|
-
function Ao() {
|
|
2083
|
-
var t, n;
|
|
2084
|
-
const e = X();
|
|
2085
|
-
if ((t = e.session) != null && t.isOpened || !e.session) return null;
|
|
2086
|
-
const o = (n = e.config.customComponents) == null ? void 0 : n.onSessionResolved;
|
|
2087
|
-
return o ? /* @__PURE__ */ r(o, { ...e }) : null;
|
|
2088
|
-
}
|
|
2089
|
-
function Fo({
|
|
2090
|
-
message: e,
|
|
2091
|
-
isFirstInGroup: o,
|
|
2092
|
-
isLastInGroup: t,
|
|
2093
|
-
isAloneInGroup: n
|
|
2094
|
-
}) {
|
|
2095
|
-
var s;
|
|
2096
|
-
return /* @__PURE__ */ d(
|
|
2097
|
-
"div",
|
|
2098
|
-
{
|
|
2099
|
-
...x("chat/user_msg/root"),
|
|
2100
|
-
className: "w-5/6 flex flex-col items-end gap-1",
|
|
2101
|
-
children: [
|
|
2102
|
-
e.attachments && e.attachments.length > 0 && /* @__PURE__ */ r("div", { className: "w-full flex gap-1 flex-wrap justify-end", children: (s = e.attachments) == null ? void 0 : s.map((i) => /* @__PURE__ */ r(Vt, { attachment: i }, i.id)) }),
|
|
2103
|
-
e.content.length > 0 && /* @__PURE__ */ r(
|
|
2104
|
-
"div",
|
|
2105
|
-
{
|
|
2106
|
-
...x("chat/user_msg/msg"),
|
|
2107
|
-
"data-first": o,
|
|
2108
|
-
"data-last": t,
|
|
2109
|
-
"data-alone": n,
|
|
2110
|
-
className: p(
|
|
2111
|
-
"transition-all",
|
|
2112
|
-
"w-fit py-3 px-4 rounded-3xl text-sm",
|
|
2113
|
-
"bg-primary text-primary-foreground",
|
|
2114
|
-
"break-words [word-break:break-word]",
|
|
2115
|
-
// `[word-break:break-word]` is deprecated but works in the browser, while `break-words` which is `[overflow-wrap: break-word]` does not work
|
|
2116
|
-
"whitespace-pre-wrap",
|
|
2117
|
-
// We're using the booleans directly here, not the data attributes, to make any external styling more specific than this
|
|
2118
|
-
o && !n && "rounded-br-md",
|
|
2119
|
-
t && !n && "rounded-tr-md",
|
|
2120
|
-
!o && !t && !n && "rounded-r-md"
|
|
2121
|
-
),
|
|
2122
|
-
children: e.content
|
|
2123
|
-
}
|
|
2124
|
-
)
|
|
2125
|
-
]
|
|
2126
|
-
}
|
|
2127
|
-
);
|
|
2128
|
-
}
|
|
2129
|
-
function Ho({
|
|
2130
|
-
messages: e
|
|
2131
|
-
}) {
|
|
2132
|
-
return /* @__PURE__ */ d(
|
|
2133
|
-
"div",
|
|
2134
|
-
{
|
|
2135
|
-
...x("chat/user_msg_group/root"),
|
|
2136
|
-
className: p("group", "flex flex-col gap-1 justify-end items-end"),
|
|
2137
|
-
children: [
|
|
2138
|
-
e.map((o, t, n) => /* @__PURE__ */ r(
|
|
2139
|
-
Fo,
|
|
2140
|
-
{
|
|
2141
|
-
message: o,
|
|
2142
|
-
isFirstInGroup: t === 0,
|
|
2143
|
-
isLastInGroup: t === n.length - 1,
|
|
2144
|
-
isAloneInGroup: n.length === 1
|
|
2145
|
-
},
|
|
2146
|
-
o.id
|
|
2147
|
-
)),
|
|
2148
|
-
/* @__PURE__ */ r(or, { messages: e, containerClassName: "ms-auto" })
|
|
2149
|
-
]
|
|
2150
|
-
}
|
|
2151
|
-
);
|
|
2152
|
-
}
|
|
2153
|
-
function Wo(e) {
|
|
2154
|
-
const o = [];
|
|
2155
|
-
let t = null;
|
|
2156
|
-
return e.forEach((n) => {
|
|
2157
|
-
var s, i, a, l, c, m;
|
|
2158
|
-
// Start a new group if the type changes
|
|
2159
|
-
(((s = t == null ? void 0 : t[0]) == null ? void 0 : s.type) !== n.type || // Start a new group if the agent changes
|
|
2160
|
-
((i = t[0]) == null ? void 0 : i.type) === "AGENT" && n.type === "AGENT" && (((a = n.agent) == null ? void 0 : a.id) !== ((l = t[0].agent) == null ? void 0 : l.id) || ((c = n.agent) == null ? void 0 : c.name) !== ((m = t[0].agent) == null ? void 0 : m.name))) && (t = [], o.push(t)), t.push(n);
|
|
2161
|
-
}), o;
|
|
2162
|
-
}
|
|
2163
|
-
function Lo(e) {
|
|
2164
|
-
var o;
|
|
2165
|
-
return ((o = e == null ? void 0 : e[0]) == null ? void 0 : o.type) === "USER";
|
|
2166
|
-
}
|
|
2167
|
-
function $o(e) {
|
|
2168
|
-
var o;
|
|
2169
|
-
return ((o = e == null ? void 0 : e[0]) == null ? void 0 : o.type) === "AI";
|
|
2170
|
-
}
|
|
2171
|
-
function Bo(e) {
|
|
2172
|
-
var o;
|
|
2173
|
-
return ((o = e == null ? void 0 : e[0]) == null ? void 0 : o.type) === "AGENT";
|
|
2174
|
-
}
|
|
2175
|
-
function Uo() {
|
|
2176
|
-
const {
|
|
2177
|
-
messagesState: { messages: e }
|
|
2178
|
-
} = A(), {
|
|
2179
|
-
advancedInitialMessages: o = [],
|
|
2180
|
-
initialQuestionsPosition: t,
|
|
2181
|
-
initialQuestions: n,
|
|
2182
|
-
bot: s
|
|
2183
|
-
} = z();
|
|
2184
|
-
return /* @__PURE__ */ r(J, { children: e.length === 0 && o.length > 0 && /* @__PURE__ */ r(
|
|
2185
|
-
pe,
|
|
2186
|
-
{
|
|
2187
|
-
messages: o.map(
|
|
2188
|
-
({ message: i }, a) => ({
|
|
2189
|
-
component: "bot_message",
|
|
2190
|
-
data: { message: i },
|
|
2191
|
-
id: `${a}-${i}`,
|
|
2192
|
-
type: "AI",
|
|
2193
|
-
timestamp: null
|
|
2194
|
-
})
|
|
2195
|
-
),
|
|
2196
|
-
suggestedReplies: e.length === 0 && t === "below-initial-messages" ? n : void 0,
|
|
2197
|
-
agent: s ? { ...s, isAi: !0, id: null } : void 0
|
|
2198
|
-
}
|
|
2199
|
-
) });
|
|
2200
|
-
}
|
|
2201
|
-
function Yo() {
|
|
2202
|
-
const {
|
|
2203
|
-
messagesState: { messages: e }
|
|
2204
|
-
} = A(), { chatBannerItems: o } = z();
|
|
2205
|
-
return !(o != null && o.length) || e.length > 0 && o.every((t) => !t.persistent) ? null : /* @__PURE__ */ r("div", { className: "w-full text-center text-xs", children: o.map(
|
|
2206
|
-
({ message: t, persistent: n }, s) => e.length > 0 && !n ? null : /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Me, { children: t }) }, `${t}-${s}`)
|
|
2207
|
-
) });
|
|
2208
|
-
}
|
|
2209
|
-
const Xo = 10 * 1024, _t = /* @__PURE__ */ new Map();
|
|
2210
|
-
function qo(e) {
|
|
2211
|
-
const o = _t.get(e);
|
|
2212
|
-
if (o !== void 0) return o;
|
|
2213
|
-
const t = Vo(e);
|
|
2214
|
-
return _t.set(e, t), t;
|
|
2215
|
-
}
|
|
2216
|
-
function Vo(e) {
|
|
2217
|
-
const o = e.trim();
|
|
2218
|
-
if (!o || o.length > Xo || typeof DOMParser > "u") return null;
|
|
2219
|
-
const t = new DOMParser().parseFromString(o, "image/svg+xml"), n = t.documentElement;
|
|
2220
|
-
return n.localName !== "svg" || n.namespaceURI !== "http://www.w3.org/2000/svg" || t.getElementsByTagName("parsererror").length > 0 ? null : `data:image/svg+xml,${encodeURIComponent(o)}`;
|
|
2221
|
-
}
|
|
2222
|
-
const Go = Wt(
|
|
2223
|
-
"inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium transition-colors",
|
|
2224
|
-
{
|
|
2225
|
-
variants: {
|
|
2226
|
-
variant: {
|
|
2227
|
-
default: "bg-primary text-primary-foreground",
|
|
2228
|
-
secondary: "bg-secondary text-secondary-foreground",
|
|
2229
|
-
outline: "border text-foreground"
|
|
2230
|
-
}
|
|
2231
|
-
},
|
|
2232
|
-
defaultVariants: {
|
|
2233
|
-
variant: "default"
|
|
2234
|
-
}
|
|
2235
|
-
}
|
|
2236
|
-
);
|
|
2237
|
-
function Zo({ className: e, variant: o, ...t }) {
|
|
2238
|
-
return /* @__PURE__ */ r("div", { className: p(Go({ variant: o }), e), ...t });
|
|
2239
|
-
}
|
|
2240
|
-
function nr({
|
|
2241
|
-
customStatus: e,
|
|
2242
|
-
className: o,
|
|
2243
|
-
dotClassName: t
|
|
2244
|
-
}) {
|
|
2245
|
-
const n = e.icon ? qo(e.icon) : null, s = e.color || "currentColor";
|
|
2246
|
-
return n ? /* @__PURE__ */ r(
|
|
2247
|
-
"span",
|
|
2248
|
-
{
|
|
2249
|
-
"aria-hidden": !0,
|
|
2250
|
-
className: p("size-3.5 shrink-0", o),
|
|
2251
|
-
style: {
|
|
2252
|
-
backgroundColor: s,
|
|
2253
|
-
// Sized by this element's box, not by the svg's own dimensions
|
|
2254
|
-
maskImage: `url("${n}")`,
|
|
2255
|
-
maskSize: "contain",
|
|
2256
|
-
maskRepeat: "no-repeat",
|
|
2257
|
-
maskPosition: "center",
|
|
2258
|
-
WebkitMaskImage: `url("${n}")`,
|
|
2259
|
-
WebkitMaskSize: "contain",
|
|
2260
|
-
WebkitMaskRepeat: "no-repeat",
|
|
2261
|
-
WebkitMaskPosition: "center"
|
|
2262
|
-
}
|
|
2263
|
-
}
|
|
2264
|
-
) : /* @__PURE__ */ r(
|
|
2265
|
-
"span",
|
|
2266
|
-
{
|
|
2267
|
-
"aria-hidden": !0,
|
|
2268
|
-
className: p("size-2 shrink-0 rounded-full", t),
|
|
2269
|
-
style: { backgroundColor: s }
|
|
2270
|
-
}
|
|
2271
|
-
);
|
|
2272
|
-
}
|
|
2273
|
-
function sr({
|
|
2274
|
-
customStatus: e,
|
|
2275
|
-
className: o
|
|
2276
|
-
}) {
|
|
2277
|
-
return /* @__PURE__ */ d(
|
|
2278
|
-
Zo,
|
|
2279
|
-
{
|
|
2280
|
-
variant: "secondary",
|
|
2281
|
-
className: p(
|
|
2282
|
-
"relative isolate overflow-hidden max-w-full text-primary",
|
|
2283
|
-
o
|
|
2284
|
-
),
|
|
2285
|
-
title: e.description || void 0,
|
|
2286
|
-
style: e.color ? {
|
|
2287
|
-
// A stronger shade of the status color: darker on light themes,
|
|
2288
|
-
// lighter on dark themes. Unsupported browsers fall back to text-primary.
|
|
2289
|
-
color: `color-mix(in srgb, ${e.color} 55%, hsl(var(--opencx-foreground)))`
|
|
2290
|
-
} : void 0,
|
|
2291
|
-
children: [
|
|
2292
|
-
e.color && // A soft uniform wash of the status color over the badge background
|
|
2293
|
-
/* @__PURE__ */ r(
|
|
2294
|
-
"span",
|
|
2295
|
-
{
|
|
2296
|
-
"aria-hidden": !0,
|
|
2297
|
-
className: "absolute inset-0 -z-10 opacity-20",
|
|
2298
|
-
style: { backgroundColor: e.color }
|
|
2299
|
-
}
|
|
2300
|
-
),
|
|
2301
|
-
/* @__PURE__ */ r(nr, { customStatus: e }),
|
|
2302
|
-
/* @__PURE__ */ r("span", { className: "truncate", children: e.name })
|
|
2303
|
-
]
|
|
2304
|
-
}
|
|
2305
|
-
);
|
|
2306
|
-
}
|
|
2307
|
-
function Ko() {
|
|
2308
|
-
const {
|
|
2309
|
-
sessionState: { session: e }
|
|
2310
|
-
} = $(), o = e == null ? void 0 : e.customStatus;
|
|
2311
|
-
return /* @__PURE__ */ r(_, { mode: "wait", children: o && /* @__PURE__ */ r(
|
|
2312
|
-
y,
|
|
2313
|
-
{
|
|
2314
|
-
className: "sticky top-2 z-10 self-center max-w-full",
|
|
2315
|
-
snapExit: !0,
|
|
2316
|
-
children: /* @__PURE__ */ r(
|
|
2317
|
-
ge,
|
|
2318
|
-
{
|
|
2319
|
-
trigger: /* @__PURE__ */ r(N, { variant: "ghost", size: "selfless", className: "rounded-full", children: /* @__PURE__ */ r(sr, { customStatus: o }) }),
|
|
2320
|
-
children: /* @__PURE__ */ d(ue, { withClose: !0, children: [
|
|
2321
|
-
/* @__PURE__ */ d(Se, { children: [
|
|
2322
|
-
/* @__PURE__ */ r(
|
|
2323
|
-
nr,
|
|
2324
|
-
{
|
|
2325
|
-
customStatus: o,
|
|
2326
|
-
className: "size-8 mx-auto",
|
|
2327
|
-
dotClassName: "size-3 mx-auto"
|
|
2328
|
-
}
|
|
2329
|
-
),
|
|
2330
|
-
/* @__PURE__ */ r(Ie, { children: o.name })
|
|
2331
|
-
] }),
|
|
2332
|
-
o.description && /* @__PURE__ */ r(_e, { children: /* @__PURE__ */ r(Te, { children: o.description }) })
|
|
2333
|
-
] })
|
|
2334
|
-
}
|
|
2335
|
-
)
|
|
2336
|
-
},
|
|
2337
|
-
o.id
|
|
2338
|
-
) });
|
|
2339
|
-
}
|
|
2340
|
-
function Qo() {
|
|
2341
|
-
const {
|
|
2342
|
-
messagesState: { messages: e }
|
|
2343
|
-
} = A(), o = z(), {
|
|
2344
|
-
advancedInitialMessages: t = [],
|
|
2345
|
-
initialQuestions: n,
|
|
2346
|
-
initialQuestionsPosition: s
|
|
2347
|
-
} = o, i = (() => {
|
|
2348
|
-
var a;
|
|
2349
|
-
return t.length ? [] : e.length ? [] : (a = o.initialMessages) != null && a.length ? o.initialMessages : ["Hello, how can I help you?"];
|
|
2350
|
-
})();
|
|
2351
|
-
return /* @__PURE__ */ r(J, { children: e.length === 0 && i.length > 0 && /* @__PURE__ */ r(
|
|
2352
|
-
pe,
|
|
2353
|
-
{
|
|
2354
|
-
messages: i.map(
|
|
2355
|
-
(a, l) => ({
|
|
2356
|
-
component: "bot_message",
|
|
2357
|
-
data: { message: a },
|
|
2358
|
-
id: `${l}-${a}`,
|
|
2359
|
-
type: "AI",
|
|
2360
|
-
timestamp: null
|
|
2361
|
-
})
|
|
2362
|
-
),
|
|
2363
|
-
suggestedReplies: s === "below-initial-messages" ? n : void 0,
|
|
2364
|
-
agent: o.bot ? { ...o.bot, isAi: !0, id: null } : void 0
|
|
2365
|
-
}
|
|
2366
|
-
) });
|
|
2367
|
-
}
|
|
2368
|
-
function Jo() {
|
|
2369
|
-
var t;
|
|
2370
|
-
const e = X(), o = (t = e.config.customComponents) == null ? void 0 : t.chatBottomComponents;
|
|
2371
|
-
return o ? /* @__PURE__ */ r("div", { children: o.map(({ key: n, component: s }) => /* @__PURE__ */ r(s, { ...e }, n)) }) : null;
|
|
2372
|
-
}
|
|
2373
|
-
function en() {
|
|
2374
|
-
const {
|
|
2375
|
-
messagesState: { messages: e }
|
|
2376
|
-
} = A(), { isAwaitingBotReply: o } = Pt(), { componentStore: t } = O(), { bot: n, humanAgent: s } = z(), i = Dt(
|
|
2377
|
-
() => Wo(e),
|
|
2378
|
-
[e]
|
|
2379
|
-
), a = t.getComponent(
|
|
2380
|
-
"loading"
|
|
2381
|
-
), l = U(null);
|
|
2382
|
-
function c() {
|
|
2383
|
-
setTimeout(() => {
|
|
2384
|
-
const m = l.current;
|
|
2385
|
-
m && (m.scrollTop = m.scrollHeight);
|
|
2386
|
-
}, 0);
|
|
2387
|
-
}
|
|
2388
|
-
return se(() => {
|
|
2389
|
-
c();
|
|
2390
|
-
}, [e]), /* @__PURE__ */ d(
|
|
2391
|
-
"div",
|
|
2392
|
-
{
|
|
2393
|
-
...x("chat/msgs/root"),
|
|
2394
|
-
ref: l,
|
|
2395
|
-
className: "max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",
|
|
2396
|
-
children: [
|
|
2397
|
-
/* @__PURE__ */ r(Ko, {}),
|
|
2398
|
-
/* @__PURE__ */ r(Yo, {}),
|
|
2399
|
-
/* @__PURE__ */ r(Uo, {}),
|
|
2400
|
-
/* @__PURE__ */ r(Qo, {}),
|
|
2401
|
-
i.map((m, h) => {
|
|
2402
|
-
var u, v, C, M;
|
|
2403
|
-
const k = (u = m == null ? void 0 : m[0]) == null ? void 0 : u.type, w = (v = m[0]) == null ? void 0 : v.id;
|
|
2404
|
-
if (!k || !w) return null;
|
|
2405
|
-
if (Lo(m))
|
|
2406
|
-
return /* @__PURE__ */ r(Ho, { messages: m }, w);
|
|
2407
|
-
if ($o(m)) {
|
|
2408
|
-
const b = h === i.length - 1;
|
|
2409
|
-
return o && b ? null : ((C = m[0]) == null || C.agent, /* @__PURE__ */ r(
|
|
2410
|
-
pe,
|
|
2411
|
-
{
|
|
2412
|
-
messages: m,
|
|
2413
|
-
agent: n ? { ...n, isAi: !0, id: null } : void 0
|
|
2414
|
-
},
|
|
2415
|
-
w
|
|
2416
|
-
));
|
|
2417
|
-
}
|
|
2418
|
-
if (Bo(m)) {
|
|
2419
|
-
const b = (M = m[0]) == null ? void 0 : M.agent;
|
|
2420
|
-
return /* @__PURE__ */ r(
|
|
2421
|
-
pe,
|
|
2422
|
-
{
|
|
2423
|
-
messages: m,
|
|
2424
|
-
agent: b ? {
|
|
2425
|
-
...b,
|
|
2426
|
-
name: (s == null ? void 0 : s.name) || b.name || "",
|
|
2427
|
-
avatarUrl: (s == null ? void 0 : s.avatarUrl) || b.avatarUrl || null
|
|
2428
|
-
} : s ? {
|
|
2429
|
-
isAi: !1,
|
|
2430
|
-
id: null,
|
|
2431
|
-
name: s.name || "",
|
|
2432
|
-
avatarUrl: s.avatarUrl || null
|
|
2433
|
-
} : void 0
|
|
2434
|
-
},
|
|
2435
|
-
w
|
|
2436
|
-
);
|
|
2437
|
-
}
|
|
2438
|
-
return null;
|
|
2439
|
-
}),
|
|
2440
|
-
o && a && /* @__PURE__ */ r(a, { agent: n }),
|
|
2441
|
-
/* @__PURE__ */ r(Jo, {}),
|
|
2442
|
-
/* @__PURE__ */ r(Ao, {})
|
|
2443
|
-
]
|
|
2444
|
-
}
|
|
2445
|
-
);
|
|
2446
|
-
}
|
|
2447
|
-
function tn() {
|
|
2448
|
-
const {
|
|
2449
|
-
messagesState: { isInitialFetchLoading: e }
|
|
2450
|
-
} = A(), {
|
|
2451
|
-
sessionState: { session: o }
|
|
2452
|
-
} = $(), { isCanvasOpen: t } = So(), { theme: n } = V();
|
|
2453
|
-
Pe({
|
|
2454
|
-
width: t ? n.screens.chat.withCanvas.width : n.screens.chat.width,
|
|
2455
|
-
height: t ? n.screens.chat.withCanvas.height : n.screens.chat.height
|
|
2456
|
-
});
|
|
2457
|
-
const s = U((o == null ? void 0 : o.id) || "chat").current;
|
|
2458
|
-
return /* @__PURE__ */ r(
|
|
2459
|
-
"div",
|
|
2460
|
-
{
|
|
2461
|
-
...x("chat/root"),
|
|
2462
|
-
className: p("flex flex-col overflow-hidden"),
|
|
2463
|
-
style: {
|
|
2464
|
-
width: "100vw",
|
|
2465
|
-
// Relative to the iframe
|
|
2466
|
-
maxWidth: "100vw",
|
|
2467
|
-
// Relative to the iframe
|
|
2468
|
-
height: "100vh",
|
|
2469
|
-
// Relative to the iframe
|
|
2470
|
-
maxHeight: "100vh"
|
|
2471
|
-
// Relative to the iframe
|
|
2472
|
-
},
|
|
2473
|
-
children: /* @__PURE__ */ d("div", { className: "size-full justify-between flex flex-col", children: [
|
|
2474
|
-
/* @__PURE__ */ r(tr, {}),
|
|
2475
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: e ? /* @__PURE__ */ r(
|
|
2476
|
-
y,
|
|
2477
|
-
{
|
|
2478
|
-
className: "flex flex-col items-center justify-center w-full flex-1",
|
|
2479
|
-
children: /* @__PURE__ */ r(rr, {})
|
|
2480
|
-
},
|
|
2481
|
-
"loading"
|
|
2482
|
-
) : /* @__PURE__ */ d(
|
|
2483
|
-
y,
|
|
2484
|
-
{
|
|
2485
|
-
className: "flex items-start h-full flex-1 overflow-auto",
|
|
2486
|
-
snapExit: !0,
|
|
2487
|
-
children: [
|
|
2488
|
-
/* @__PURE__ */ d(
|
|
2489
|
-
"div",
|
|
2490
|
-
{
|
|
2491
|
-
...x("chat/main/root"),
|
|
2492
|
-
className: p(
|
|
2493
|
-
"flex flex-col h-full overflow-auto transition-all",
|
|
2494
|
-
t ? "w-2/5" : "w-full"
|
|
2495
|
-
),
|
|
2496
|
-
style: {
|
|
2497
|
-
transitionTimingFunction: n.screens.chat.withCanvas.transitionTimingFunction,
|
|
2498
|
-
transitionDuration: n.screens.chat.withCanvas.transitionDuration
|
|
2499
|
-
},
|
|
2500
|
-
children: [
|
|
2501
|
-
/* @__PURE__ */ r(en, {}),
|
|
2502
|
-
/* @__PURE__ */ r(jo, {})
|
|
2503
|
-
]
|
|
2504
|
-
}
|
|
2505
|
-
),
|
|
2506
|
-
/* @__PURE__ */ r(
|
|
2507
|
-
"div",
|
|
2508
|
-
{
|
|
2509
|
-
...x("chat/canvas/root"),
|
|
2510
|
-
className: p(
|
|
2511
|
-
"h-full overflow-auto transition-all",
|
|
2512
|
-
t ? "w-3/5" : "w-0"
|
|
2513
|
-
),
|
|
2514
|
-
style: {
|
|
2515
|
-
transitionTimingFunction: n.screens.chat.withCanvas.transitionTimingFunction,
|
|
2516
|
-
transitionDuration: n.screens.chat.withCanvas.transitionDuration
|
|
2517
|
-
},
|
|
2518
|
-
children: /* @__PURE__ */ r(_o, {})
|
|
2519
|
-
}
|
|
2520
|
-
)
|
|
2521
|
-
]
|
|
2522
|
-
},
|
|
2523
|
-
s
|
|
2524
|
-
) })
|
|
2525
|
-
] })
|
|
2526
|
-
}
|
|
2527
|
-
);
|
|
2528
|
-
}
|
|
2529
|
-
function rn({
|
|
2530
|
-
className: e,
|
|
2531
|
-
...o
|
|
2532
|
-
}) {
|
|
2533
|
-
return /* @__PURE__ */ r(
|
|
2534
|
-
"div",
|
|
2535
|
-
{
|
|
2536
|
-
className: p("animate-pulse rounded-md bg-secondary", e),
|
|
2537
|
-
...o
|
|
2538
|
-
}
|
|
2539
|
-
);
|
|
2540
|
-
}
|
|
2541
|
-
function on({ className: e }) {
|
|
2542
|
-
return /* @__PURE__ */ r(
|
|
2543
|
-
"svg",
|
|
2544
|
-
{
|
|
2545
|
-
width: "26",
|
|
2546
|
-
height: "32",
|
|
2547
|
-
viewBox: "0 0 26 32",
|
|
2548
|
-
fill: "none",
|
|
2549
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2550
|
-
className: p("text-primary-foreground", e),
|
|
2551
|
-
children: /* @__PURE__ */ r(
|
|
2552
|
-
"path",
|
|
2553
|
-
{
|
|
2554
|
-
d: "M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",
|
|
2555
|
-
fill: "currentColor"
|
|
2556
|
-
}
|
|
2557
|
-
)
|
|
2558
|
-
}
|
|
2559
|
-
);
|
|
2560
|
-
}
|
|
2561
|
-
function ar({ className: e }) {
|
|
2562
|
-
const { token: o } = z();
|
|
2563
|
-
return /* @__PURE__ */ r(
|
|
2564
|
-
"div",
|
|
2565
|
-
{
|
|
2566
|
-
className: p(
|
|
2567
|
-
"flex items-center justify-center gap-2 p-2 pt-0",
|
|
2568
|
-
e
|
|
2569
|
-
),
|
|
2570
|
-
children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ d(
|
|
2571
|
-
"a",
|
|
2572
|
-
{
|
|
2573
|
-
href: `https://open.cx/?ref=${o}`,
|
|
2574
|
-
target: "_blank",
|
|
2575
|
-
rel: "noreferrer",
|
|
2576
|
-
className: p(
|
|
2577
|
-
"text-[10px] flex items-center",
|
|
2578
|
-
"text-muted-foreground/70 [&_svg]:text-muted-foreground/70",
|
|
2579
|
-
"hover:text-primary [&_svg]:hover:text-primary"
|
|
2580
|
-
),
|
|
2581
|
-
children: [
|
|
2582
|
-
/* @__PURE__ */ r("span", { children: "Powered by" }),
|
|
2583
|
-
/* @__PURE__ */ r("span", { children: " " }),
|
|
2584
|
-
/* @__PURE__ */ d("span", { className: "flex items-center gap-[1px]", children: [
|
|
2585
|
-
/* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(on, { className: "size-3 inline-block" }) }),
|
|
2586
|
-
/* @__PURE__ */ r("span", { className: "font-semibold", children: "open" })
|
|
2587
|
-
] })
|
|
2588
|
-
]
|
|
2589
|
-
}
|
|
2590
|
-
) })
|
|
2591
|
-
}
|
|
2592
|
-
);
|
|
2593
|
-
}
|
|
2594
|
-
function nn({ children: e }) {
|
|
2595
|
-
return /* @__PURE__ */ r("p", { className: "ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight", children: e });
|
|
2596
|
-
}
|
|
2597
|
-
function It({
|
|
2598
|
-
session: e,
|
|
2599
|
-
className: o
|
|
2600
|
-
}) {
|
|
2601
|
-
const { bot: t, humanAgent: n } = z(), { toChatScreen: s } = H(), i = e.assignee.kind === "human" ? (n == null ? void 0 : n.name) || e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", a = e.assignee.kind === "human" ? (n == null ? void 0 : n.avatarUrl) || e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatarUrl) || (t == null ? void 0 : t.avatar) || "";
|
|
2602
|
-
return /* @__PURE__ */ d(
|
|
2603
|
-
N,
|
|
2604
|
-
{
|
|
2605
|
-
variant: "ghost",
|
|
2606
|
-
size: "lg",
|
|
2607
|
-
className: p(
|
|
2608
|
-
"rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",
|
|
2609
|
-
o
|
|
2610
|
-
),
|
|
2611
|
-
onClick: () => s(e.id),
|
|
2612
|
-
children: [
|
|
2613
|
-
/* @__PURE__ */ d("div", { className: "flex-1 flex gap-2 items-center", children: [
|
|
2614
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: /* @__PURE__ */ r(y, { snapExit: !0, children: /* @__PURE__ */ d(De, { className: "size-10", children: [
|
|
2615
|
-
/* @__PURE__ */ r(Ee, { src: a, alt: "Agent Icon" }),
|
|
2616
|
-
/* @__PURE__ */ r(Re, { children: /* @__PURE__ */ r(Lr, { className: "size-4" }) })
|
|
2617
|
-
] }) }) }),
|
|
2618
|
-
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
2619
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: /* @__PURE__ */ r(y, { snapExit: !0, children: i }, i) }),
|
|
2620
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: e.lastMessage ? /* @__PURE__ */ r(y, { snapExit: !0, children: /* @__PURE__ */ r(
|
|
2621
|
-
Gt,
|
|
2622
|
-
{
|
|
2623
|
-
remarkPlugins: [Lt],
|
|
2624
|
-
rehypePlugins: [$t],
|
|
2625
|
-
className: "line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",
|
|
2626
|
-
children: e.lastMessage
|
|
2627
|
-
}
|
|
2628
|
-
) }, e.lastMessage || "content") : /* @__PURE__ */ r(y, { className: "w-1/2", snapExit: !0, children: /* @__PURE__ */ r(rn, { className: "h-4 w-full" }) }, "skeleton") }),
|
|
2629
|
-
/* @__PURE__ */ r(_, { mode: "wait", children: e.customStatus && /* @__PURE__ */ r(
|
|
2630
|
-
y,
|
|
2631
|
-
{
|
|
2632
|
-
className: "mt-1",
|
|
2633
|
-
snapExit: !0,
|
|
2634
|
-
children: /* @__PURE__ */ r(sr, { customStatus: e.customStatus })
|
|
2635
|
-
},
|
|
2636
|
-
e.customStatus.id
|
|
2637
|
-
) })
|
|
2638
|
-
] })
|
|
2639
|
-
] }),
|
|
2640
|
-
/* @__PURE__ */ r($r, { className: "size-4 text-muted-foreground shrink-0 rtl:-scale-100" })
|
|
2641
|
-
]
|
|
2642
|
-
}
|
|
2643
|
-
);
|
|
2644
|
-
}
|
|
2645
|
-
function sn() {
|
|
2646
|
-
const { t: e } = G(), { toChatScreen: o } = H(), {
|
|
2647
|
-
sessionsState: { data: t, isInitialFetchLoading: n },
|
|
2648
|
-
openSessions: s,
|
|
2649
|
-
closedSessions: i,
|
|
2650
|
-
canCreateNewSession: a
|
|
2651
|
-
} = $();
|
|
2652
|
-
return /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col overflow-scroll py-2 px-2", children: /* @__PURE__ */ r(_, { mode: "wait", children: n ? /* @__PURE__ */ r(
|
|
2653
|
-
y,
|
|
2654
|
-
{
|
|
2655
|
-
className: "flex-1 flex items-center justify-center",
|
|
2656
|
-
children: /* @__PURE__ */ r(rr, {})
|
|
2657
|
-
},
|
|
2658
|
-
"loading"
|
|
2659
|
-
) : /* @__PURE__ */ r(
|
|
2660
|
-
y,
|
|
2661
|
-
{
|
|
2662
|
-
className: "flex-1 flex flex-col gap-2 relative",
|
|
2663
|
-
children: t.length ? /* @__PURE__ */ d(J, { children: [
|
|
2664
|
-
/* @__PURE__ */ d(_, { children: [
|
|
2665
|
-
s.length > 0 && /* @__PURE__ */ r(
|
|
2666
|
-
y,
|
|
2667
|
-
{
|
|
2668
|
-
fadeIn: "up",
|
|
2669
|
-
delay: 0.2,
|
|
2670
|
-
className: "space-y-2",
|
|
2671
|
-
snapExit: !0,
|
|
2672
|
-
children: s.map((l) => /* @__PURE__ */ r(It, { session: l }, l.id))
|
|
2673
|
-
},
|
|
2674
|
-
"open-sessions"
|
|
2675
|
-
),
|
|
2676
|
-
i.length > 0 && /* @__PURE__ */ d(
|
|
2677
|
-
y,
|
|
2678
|
-
{
|
|
2679
|
-
className: "space-y-2",
|
|
2680
|
-
delay: 0.2,
|
|
2681
|
-
snapExit: !0,
|
|
2682
|
-
children: [
|
|
2683
|
-
/* @__PURE__ */ r(nn, { children: e("closed_conversations") }),
|
|
2684
|
-
i.map((l) => /* @__PURE__ */ r(
|
|
2685
|
-
It,
|
|
2686
|
-
{
|
|
2687
|
-
session: l,
|
|
2688
|
-
className: "opacity-50 hover:opacity-100"
|
|
2689
|
-
},
|
|
2690
|
-
l.id
|
|
2691
|
-
))
|
|
2692
|
-
]
|
|
2693
|
-
},
|
|
2694
|
-
"closed-sessions"
|
|
2695
|
-
)
|
|
2696
|
-
] }),
|
|
2697
|
-
a && /* @__PURE__ */ r("div", { className: "mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background", children: /* @__PURE__ */ gt(
|
|
2698
|
-
N,
|
|
2699
|
-
{
|
|
2700
|
-
...x("sessions/new_conversation_btn"),
|
|
2701
|
-
size: "lg",
|
|
2702
|
-
key: "new-session",
|
|
2703
|
-
className: "w-full",
|
|
2704
|
-
onClick: () => o()
|
|
2705
|
-
},
|
|
2706
|
-
e("new_conversation")
|
|
2707
|
-
) })
|
|
2708
|
-
] }) : /* @__PURE__ */ d("div", { className: "flex-1 flex flex-col gap-2 items-center", children: [
|
|
2709
|
-
/* @__PURE__ */ r("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ r("p", { className: "text-muted-foreground", children: e("no_conversations_yet") }) }),
|
|
2710
|
-
/* @__PURE__ */ gt(
|
|
2711
|
-
N,
|
|
2712
|
-
{
|
|
2713
|
-
...x("sessions/new_conversation_btn"),
|
|
2714
|
-
size: "lg",
|
|
2715
|
-
key: "new-session",
|
|
2716
|
-
className: "w-full",
|
|
2717
|
-
onClick: () => o()
|
|
2718
|
-
},
|
|
2719
|
-
e("new_conversation")
|
|
2720
|
-
)
|
|
2721
|
-
] })
|
|
2722
|
-
},
|
|
2723
|
-
"sessions"
|
|
2724
|
-
) }) });
|
|
2725
|
-
}
|
|
2726
|
-
function an() {
|
|
2727
|
-
const { theme: e } = V();
|
|
2728
|
-
return Pe({
|
|
2729
|
-
width: e.screens.sessions.width,
|
|
2730
|
-
height: e.screens.sessions.height
|
|
2731
|
-
}), /* @__PURE__ */ r(
|
|
2732
|
-
"div",
|
|
2733
|
-
{
|
|
2734
|
-
...x("sessions/root"),
|
|
2735
|
-
className: p("flex flex-col overflow-hidden bg-background"),
|
|
2736
|
-
style: {
|
|
2737
|
-
width: "100vw",
|
|
2738
|
-
// Relative to the iframe
|
|
2739
|
-
maxWidth: "100vw",
|
|
2740
|
-
// Relative to the iframe
|
|
2741
|
-
height: "100vh",
|
|
2742
|
-
// Relative to the iframe
|
|
2743
|
-
maxHeight: "100vh"
|
|
2744
|
-
// Relative to the iframe
|
|
2745
|
-
},
|
|
2746
|
-
children: /* @__PURE__ */ d("div", { className: "size-full flex flex-col", children: [
|
|
2747
|
-
/* @__PURE__ */ r(tr, {}),
|
|
2748
|
-
/* @__PURE__ */ r(sn, {}),
|
|
2749
|
-
/* @__PURE__ */ r(ar, {})
|
|
2750
|
-
] })
|
|
2751
|
-
}
|
|
2752
|
-
);
|
|
2753
|
-
}
|
|
2754
|
-
const de = ee.forwardRef(
|
|
2755
|
-
({ className: e, type: o, ...t }, n) => {
|
|
2756
|
-
const { isSmallScreen: s } = B();
|
|
2757
|
-
return /* @__PURE__ */ r(
|
|
2758
|
-
"input",
|
|
2759
|
-
{
|
|
2760
|
-
ref: n,
|
|
2761
|
-
type: o,
|
|
2762
|
-
className: p(
|
|
2763
|
-
// 16px on mobiles prevents auto-zoom on the input when focused
|
|
2764
|
-
s ? "text-[16px]" : "text-sm",
|
|
2765
|
-
"flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition",
|
|
2766
|
-
"rounded-2xl px-4",
|
|
2767
|
-
"border shadow-sm",
|
|
2768
|
-
e
|
|
2769
|
-
),
|
|
2770
|
-
...t
|
|
2771
|
-
}
|
|
2772
|
-
);
|
|
2773
|
-
}
|
|
2774
|
-
);
|
|
2775
|
-
de.displayName = "Input";
|
|
2776
|
-
function ln() {
|
|
2777
|
-
const { contentIframeRef: e } = O(), { inline: o } = z(), t = U(null);
|
|
2778
|
-
return se(() => {
|
|
2779
|
-
const n = e == null ? void 0 : e.current;
|
|
2780
|
-
if (n && t.current) {
|
|
2781
|
-
const s = t.current;
|
|
2782
|
-
let i;
|
|
2783
|
-
const a = new ResizeObserver(() => {
|
|
2784
|
-
i = requestAnimationFrame(() => {
|
|
2785
|
-
const l = s.offsetHeight;
|
|
2786
|
-
n.style.setProperty(
|
|
2787
|
-
"--opencx-widget-height",
|
|
2788
|
-
o ? "100%" : `${l.toFixed(1)}px`
|
|
2789
|
-
);
|
|
2790
|
-
});
|
|
2791
|
-
});
|
|
2792
|
-
return a.observe(s), () => {
|
|
2793
|
-
cancelAnimationFrame(i), a.unobserve(s);
|
|
2794
|
-
};
|
|
2795
|
-
}
|
|
2796
|
-
}, [e, o]), { observedElementRef: t };
|
|
2797
|
-
}
|
|
2798
|
-
const cn = fe.object({
|
|
2799
|
-
name: fe.string().min(2),
|
|
2800
|
-
email: fe.string().email()
|
|
2801
|
-
});
|
|
2802
|
-
function dn() {
|
|
2803
|
-
var b, S, I, E, f, D, j, R;
|
|
2804
|
-
const {
|
|
2805
|
-
widgetCtx: { org: e }
|
|
2806
|
-
} = O(), { setIsOpen: o } = K(), { createUnverifiedContact: t } = jt(), { isSmallScreen: n } = B(), s = z(), { theme: i } = V(), { t: a } = G(), { observedElementRef: l } = ln();
|
|
2807
|
-
Pe({
|
|
2808
|
-
height: void 0,
|
|
2809
|
-
width: i.screens.welcome.width
|
|
2810
|
-
});
|
|
2811
|
-
const [c, m] = P(((b = s.prefillUserData) == null ? void 0 : b.name) || ""), [h, k] = P(((S = s.prefillUserData) == null ? void 0 : S.email) || ""), w = (s.extraDataCollectionFields || []).filter(
|
|
2812
|
-
(g) => g !== "name" && g !== "email" && !!g
|
|
2813
|
-
), [u, v] = P({}), [C, M] = Qr(
|
|
2814
|
-
async (g) => {
|
|
2815
|
-
g.preventDefault();
|
|
2816
|
-
const T = cn.safeParse({ name: c, email: h });
|
|
2817
|
-
T.success && await t(
|
|
2818
|
-
{
|
|
2819
|
-
email: T.data.email,
|
|
2820
|
-
non_verified_name: T.data.name
|
|
2821
|
-
},
|
|
2822
|
-
// Only pass extra data if there is any
|
|
2823
|
-
Object.values(u).filter(Boolean).length ? u : void 0
|
|
2824
|
-
);
|
|
2825
|
-
},
|
|
2826
|
-
[c, h, u]
|
|
2827
|
-
);
|
|
2828
|
-
return /* @__PURE__ */ r(
|
|
2829
|
-
"div",
|
|
2830
|
-
{
|
|
2831
|
-
style: {
|
|
2832
|
-
width: "100vw",
|
|
2833
|
-
// Relative to the iframe
|
|
2834
|
-
maxWidth: "100vw",
|
|
2835
|
-
// Relative to the iframe
|
|
2836
|
-
minHeight: i.screens.welcome.minHeight,
|
|
2837
|
-
height: "100vh",
|
|
2838
|
-
// Relative to the iframe
|
|
2839
|
-
maxHeight: "100vh",
|
|
2840
|
-
// Relative to the iframe
|
|
2841
|
-
overflowY: "auto"
|
|
2842
|
-
},
|
|
2843
|
-
children: /* @__PURE__ */ d(
|
|
2844
|
-
"div",
|
|
2845
|
-
{
|
|
2846
|
-
ref: l,
|
|
2847
|
-
className: p(
|
|
2848
|
-
"flex flex-col",
|
|
2849
|
-
n && "h-full",
|
|
2850
|
-
"bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"
|
|
2851
|
-
),
|
|
2852
|
-
children: [
|
|
2853
|
-
/* @__PURE__ */ d(
|
|
2854
|
-
"div",
|
|
2855
|
-
{
|
|
2856
|
-
className: p(
|
|
2857
|
-
"flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10",
|
|
2858
|
-
"text-primary-foreground"
|
|
2859
|
-
),
|
|
2860
|
-
children: [
|
|
2861
|
-
n && /* @__PURE__ */ r(y, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(N, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(Ne, { className: "size-4" }) }) }),
|
|
2862
|
-
/* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (I = s.assets) != null && I.organizationLogo ? /* @__PURE__ */ r(
|
|
2863
|
-
"img",
|
|
2864
|
-
{
|
|
2865
|
-
src: (E = s.assets) == null ? void 0 : E.organizationLogo,
|
|
2866
|
-
alt: "Company Logo",
|
|
2867
|
-
className: "h-8 w-auto object-contain"
|
|
2868
|
-
}
|
|
2869
|
-
) : /* @__PURE__ */ r("h2", { className: "font-bold text-sm", children: e.name }) }),
|
|
2870
|
-
/* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
2871
|
-
/* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((D = (f = s.textContent) == null ? void 0 : f.welcomeScreen) == null ? void 0 : D.title) || a("welcome_screen_title") }),
|
|
2872
|
-
/* @__PURE__ */ r("p", { className: "text-sm", children: ((R = (j = s.textContent) == null ? void 0 : j.welcomeScreen) == null ? void 0 : R.description) || a("welcome_screen_description") })
|
|
2873
|
-
] })
|
|
2874
|
-
]
|
|
2875
|
-
}
|
|
2876
|
-
),
|
|
2877
|
-
/* @__PURE__ */ d(
|
|
2878
|
-
"div",
|
|
2879
|
-
{
|
|
2880
|
-
className: p(
|
|
2881
|
-
"z-10 m-2 px-2 pt-2 bp-0 space-y-2",
|
|
2882
|
-
"bg-[white]",
|
|
2883
|
-
"border shadow",
|
|
2884
|
-
"rounded-3xl"
|
|
2885
|
-
),
|
|
2886
|
-
children: [
|
|
2887
|
-
/* @__PURE__ */ d("form", { onSubmit: M, className: "space-y-2", children: [
|
|
2888
|
-
/* @__PURE__ */ r(
|
|
2889
|
-
de,
|
|
2890
|
-
{
|
|
2891
|
-
value: c,
|
|
2892
|
-
onChange: (g) => m(g.target.value),
|
|
2893
|
-
required: !0,
|
|
2894
|
-
placeholder: a("your_name_placeholder"),
|
|
2895
|
-
name: "name"
|
|
2896
|
-
}
|
|
2897
|
-
),
|
|
2898
|
-
/* @__PURE__ */ r(
|
|
2899
|
-
de,
|
|
2900
|
-
{
|
|
2901
|
-
required: !0,
|
|
2902
|
-
value: h,
|
|
2903
|
-
onChange: (g) => k(g.target.value),
|
|
2904
|
-
type: "email",
|
|
2905
|
-
placeholder: a("your_email_placeholder"),
|
|
2906
|
-
name: "email"
|
|
2907
|
-
}
|
|
2908
|
-
),
|
|
2909
|
-
w.map((g) => /* @__PURE__ */ r(
|
|
2910
|
-
de,
|
|
2911
|
-
{
|
|
2912
|
-
value: u[g],
|
|
2913
|
-
onChange: (T) => v((ie) => ({
|
|
2914
|
-
...ie,
|
|
2915
|
-
[g]: T.target.value
|
|
2916
|
-
})),
|
|
2917
|
-
placeholder: `${g} (${a("optional")})`
|
|
2918
|
-
},
|
|
2919
|
-
g
|
|
2920
|
-
)),
|
|
2921
|
-
/* @__PURE__ */ d(
|
|
2922
|
-
N,
|
|
2923
|
-
{
|
|
2924
|
-
disabled: C.loading,
|
|
2925
|
-
className: "w-full",
|
|
2926
|
-
size: "lg",
|
|
2927
|
-
children: [
|
|
2928
|
-
C.loading ? a("start_chat_button_loading") : a("start_chat_button"),
|
|
2929
|
-
/* @__PURE__ */ r(Br, { className: "size-4 rtl:-scale-100" })
|
|
2930
|
-
]
|
|
2931
|
-
}
|
|
2932
|
-
)
|
|
2933
|
-
] }),
|
|
2934
|
-
/* @__PURE__ */ r(ar, {})
|
|
2935
|
-
]
|
|
2936
|
-
}
|
|
2937
|
-
)
|
|
2938
|
-
]
|
|
2939
|
-
}
|
|
2940
|
-
)
|
|
2941
|
-
}
|
|
2942
|
-
);
|
|
2943
|
-
}
|
|
2944
|
-
function ir() {
|
|
2945
|
-
const {
|
|
2946
|
-
routerState: { screen: e }
|
|
2947
|
-
} = H();
|
|
2948
|
-
return /* @__PURE__ */ r("div", { className: "relative bg-background size-full", children: /* @__PURE__ */ r(_, { mode: "wait", children: (() => {
|
|
2949
|
-
switch (e) {
|
|
2950
|
-
case "welcome":
|
|
2951
|
-
return /* @__PURE__ */ r(
|
|
2952
|
-
y,
|
|
2953
|
-
{
|
|
2954
|
-
fadeIn: "right",
|
|
2955
|
-
className: "size-full",
|
|
2956
|
-
snapExit: !0,
|
|
2957
|
-
children: /* @__PURE__ */ r(dn, {})
|
|
2958
|
-
},
|
|
2959
|
-
e
|
|
2960
|
-
);
|
|
2961
|
-
case "sessions":
|
|
2962
|
-
return /* @__PURE__ */ r(
|
|
2963
|
-
y,
|
|
2964
|
-
{
|
|
2965
|
-
fadeIn: "right",
|
|
2966
|
-
className: "size-full",
|
|
2967
|
-
snapExit: !0,
|
|
2968
|
-
children: /* @__PURE__ */ r(an, {})
|
|
2969
|
-
},
|
|
2970
|
-
e
|
|
2971
|
-
);
|
|
2972
|
-
case "chat":
|
|
2973
|
-
return /* @__PURE__ */ r(
|
|
2974
|
-
y,
|
|
2975
|
-
{
|
|
2976
|
-
fadeIn: "right",
|
|
2977
|
-
className: "size-full",
|
|
2978
|
-
snapExit: !0,
|
|
2979
|
-
children: /* @__PURE__ */ r(tn, {})
|
|
2980
|
-
},
|
|
2981
|
-
e
|
|
2982
|
-
);
|
|
2983
|
-
default:
|
|
2984
|
-
return F(e, ir.name), null;
|
|
2985
|
-
}
|
|
2986
|
-
})() }) });
|
|
2987
|
-
}
|
|
2988
|
-
const pn = "4.0.62", mn = `<!DOCTYPE html>
|
|
2989
|
-
<html>
|
|
2990
|
-
<head>
|
|
2991
|
-
<style>
|
|
2992
|
-
${Zt}
|
|
2993
|
-
html, body {
|
|
2994
|
-
height: 100%;
|
|
2995
|
-
width: 100%;
|
|
2996
|
-
margin: 0;
|
|
2997
|
-
padding: 0;
|
|
2998
|
-
font-size: 16px;
|
|
2999
|
-
}
|
|
3000
|
-
</style>
|
|
3001
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, interactive-widget=resizes-content">
|
|
3002
|
-
</head>
|
|
3003
|
-
<body>
|
|
3004
|
-
</body>
|
|
3005
|
-
</html>`;
|
|
3006
|
-
function lr() {
|
|
3007
|
-
const { isOpen: e } = K(), { contentIframeRef: o } = O(), { cssOverrides: t, inline: n } = z(), { theme: s, cssVars: i, computed: a } = V(), { dir: l } = G();
|
|
3008
|
-
return /* @__PURE__ */ r(
|
|
3009
|
-
re.div,
|
|
3010
|
-
{
|
|
3011
|
-
animate: e ? "visible" : "hidden",
|
|
3012
|
-
initial: "hidden",
|
|
3013
|
-
variants: {
|
|
3014
|
-
hidden: {
|
|
3015
|
-
opacity: 0,
|
|
3016
|
-
y: 8,
|
|
3017
|
-
transitionEnd: { display: "none" },
|
|
3018
|
-
transition: { duration: 0.15 }
|
|
3019
|
-
},
|
|
3020
|
-
visible: {
|
|
3021
|
-
opacity: 1,
|
|
3022
|
-
y: 0,
|
|
3023
|
-
display: "block",
|
|
3024
|
-
height: n ? "100%" : void 0
|
|
3025
|
-
}
|
|
3026
|
-
},
|
|
3027
|
-
children: /* @__PURE__ */ d(
|
|
3028
|
-
Bt,
|
|
3029
|
-
{
|
|
3030
|
-
ref: o,
|
|
3031
|
-
initialContent: mn,
|
|
3032
|
-
allowFullScreen: !0,
|
|
3033
|
-
title: "OpenCX Live Chat",
|
|
3034
|
-
style: {
|
|
3035
|
-
// @ts-expect-error this is a valid css variable
|
|
3036
|
-
"--opencx-widget-width": a.minWidth,
|
|
3037
|
-
"--opencx-widget-height": a.minHeight,
|
|
3038
|
-
minWidth: a.minWidth,
|
|
3039
|
-
width: "var(--opencx-widget-width)",
|
|
3040
|
-
maxWidth: a.maxWidth,
|
|
3041
|
-
// Relative to the viewport
|
|
3042
|
-
minHeight: a.minHeight,
|
|
3043
|
-
height: "var(--opencx-widget-height)",
|
|
3044
|
-
maxHeight: a.maxHeight,
|
|
3045
|
-
// Relative to the viewport
|
|
3046
|
-
overflow: "hidden",
|
|
3047
|
-
/** outline is better than border because of box sizing; the outline wouldn't affect the content inside... the border will mess up how the children's border radius sits with the parent */
|
|
3048
|
-
outline: s.widgetContentContainer.outline,
|
|
3049
|
-
outlineColor: s.widgetContentContainer.outlineColor,
|
|
3050
|
-
borderRadius: s.widgetContentContainer.borderRadius,
|
|
3051
|
-
boxShadow: s.widgetContentContainer.boxShadow,
|
|
3052
|
-
transitionProperty: s.widgetContentContainer.transitionProperty,
|
|
3053
|
-
transitionTimingFunction: s.widgetContentContainer.transitionTimingFunction,
|
|
3054
|
-
transitionDuration: s.widgetContentContainer.transitionDuration,
|
|
3055
|
-
// reset iframe defaults
|
|
3056
|
-
boxSizing: "border-box",
|
|
3057
|
-
borderWidth: "0px"
|
|
3058
|
-
},
|
|
3059
|
-
children: [
|
|
3060
|
-
t && /* @__PURE__ */ r("style", { children: t }),
|
|
3061
|
-
/* @__PURE__ */ r(
|
|
3062
|
-
"div",
|
|
3063
|
-
{
|
|
3064
|
-
style: {
|
|
3065
|
-
...i,
|
|
3066
|
-
zIndex: s.widgetContentContainer.zIndex
|
|
3067
|
-
},
|
|
3068
|
-
"data-version": pn,
|
|
3069
|
-
className: p(
|
|
3070
|
-
"antialiased font-sans size-full overflow-hidden relative text-secondary-foreground isolate"
|
|
3071
|
-
),
|
|
3072
|
-
dir: l,
|
|
3073
|
-
children: /* @__PURE__ */ r(
|
|
3074
|
-
uo,
|
|
3075
|
-
{
|
|
3076
|
-
delayDuration: 200,
|
|
3077
|
-
disableHoverableContent: !0,
|
|
3078
|
-
children: /* @__PURE__ */ r(ao, { children: /* @__PURE__ */ r(ir, {}) })
|
|
3079
|
-
}
|
|
3080
|
-
)
|
|
3081
|
-
}
|
|
3082
|
-
)
|
|
3083
|
-
]
|
|
3084
|
-
}
|
|
3085
|
-
)
|
|
3086
|
-
}
|
|
3087
|
-
);
|
|
3088
|
-
}
|
|
3089
|
-
function hn() {
|
|
3090
|
-
const { theme: e, triggerSide: o } = V(), { dir: t } = ze(), n = (t === "rtl" ? o === "left" : o === "right") ? "end" : "start";
|
|
3091
|
-
return /* @__PURE__ */ r(
|
|
3092
|
-
me.Content,
|
|
3093
|
-
{
|
|
3094
|
-
onInteractOutside: (s) => s.preventDefault(),
|
|
3095
|
-
forceMount: !0,
|
|
3096
|
-
style: {
|
|
3097
|
-
zIndex: e.widgetContentContainer.zIndex,
|
|
3098
|
-
fontSize: "16px"
|
|
3099
|
-
},
|
|
3100
|
-
side: "top",
|
|
3101
|
-
align: n,
|
|
3102
|
-
"aria-modal": "false",
|
|
3103
|
-
"aria-label": "Support chat",
|
|
3104
|
-
sideOffset: e.widgetContentContainer.offset.side,
|
|
3105
|
-
alignOffset: e.widgetContentContainer.offset.align,
|
|
3106
|
-
avoidCollisions: !1,
|
|
3107
|
-
children: /* @__PURE__ */ r(lr, {})
|
|
3108
|
-
}
|
|
3109
|
-
);
|
|
3110
|
-
}
|
|
3111
|
-
function un({
|
|
3112
|
-
className: e,
|
|
3113
|
-
style: o
|
|
3114
|
-
}) {
|
|
3115
|
-
return /* @__PURE__ */ d(
|
|
3116
|
-
"svg",
|
|
3117
|
-
{
|
|
3118
|
-
width: "32",
|
|
3119
|
-
height: "30",
|
|
3120
|
-
viewBox: "0 0 32 30",
|
|
3121
|
-
fill: "none",
|
|
3122
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3123
|
-
className: p("text-primary-foreground", e),
|
|
3124
|
-
style: o,
|
|
3125
|
-
children: [
|
|
3126
|
-
/* @__PURE__ */ r(
|
|
3127
|
-
"path",
|
|
3128
|
-
{
|
|
3129
|
-
d: "M0 6.94263C0 3.62892 2.68629 0.942627 6 0.942627H26C29.3137 0.942627 32 3.62892 32 6.94263V17.9426C32 21.2563 29.3137 23.9426 26 23.9426H6C2.68629 23.9426 0 21.2563 0 17.9426V6.94263Z",
|
|
3130
|
-
fill: "currentColor"
|
|
3131
|
-
}
|
|
3132
|
-
),
|
|
3133
|
-
/* @__PURE__ */ r(
|
|
3134
|
-
"path",
|
|
3135
|
-
{
|
|
3136
|
-
fillRule: "evenodd",
|
|
3137
|
-
clipRule: "evenodd",
|
|
3138
|
-
d: "M19.9945 23.8935L26.237 23.8934C26.1982 24.3557 26.1712 25.2778 26.1704 26.2318C26.1688 28.2839 26.1376 28.7041 25.974 28.868C25.583 29.2598 25.2686 29.0967 24.0616 27.8754C23.4162 27.2222 22.1141 25.9522 21.1682 25.0531L19.9945 23.8935Z",
|
|
3139
|
-
fill: "currentColor"
|
|
3140
|
-
}
|
|
3141
|
-
)
|
|
3142
|
-
]
|
|
3143
|
-
}
|
|
3144
|
-
);
|
|
3145
|
-
}
|
|
3146
|
-
const gn = `<!DOCTYPE html>
|
|
3147
|
-
<html>
|
|
3148
|
-
<head>
|
|
3149
|
-
<style>
|
|
3150
|
-
${Zt}
|
|
3151
|
-
html, body {
|
|
3152
|
-
height: 100%;
|
|
3153
|
-
width: 100%;
|
|
3154
|
-
margin: 0;
|
|
3155
|
-
padding: 0;
|
|
3156
|
-
font-size: 16px;
|
|
3157
|
-
}
|
|
3158
|
-
</style>
|
|
3159
|
-
</head>
|
|
3160
|
-
<body>
|
|
3161
|
-
</body>
|
|
3162
|
-
</html>`;
|
|
3163
|
-
function wn() {
|
|
3164
|
-
var m, h, k;
|
|
3165
|
-
const { isOpen: e, setIsOpen: o } = K(), { cssOverrides: t, assets: n, customComponents: s, accessibility: i } = z(), { theme: a, cssVars: l } = V(), c = ((m = i == null ? void 0 : i.widgetTriggerButton) == null ? void 0 : m.label) ?? "Chat with us";
|
|
3166
|
-
return s != null && s.widgetTrigger ? s.widgetTrigger({
|
|
3167
|
-
react: L,
|
|
3168
|
-
isOpen: e,
|
|
3169
|
-
setIsOpen: (w) => o(w)
|
|
3170
|
-
}) : /* @__PURE__ */ d(
|
|
3171
|
-
Bt,
|
|
3172
|
-
{
|
|
3173
|
-
initialContent: gn,
|
|
3174
|
-
title: "OpenCX Live Chat Trigger",
|
|
3175
|
-
style: {
|
|
3176
|
-
height: `calc(${a.widgetTrigger.size.button}px + ${Q.x * 2}px)`,
|
|
3177
|
-
width: `calc(${a.widgetTrigger.size.button}px + ${Q.y * 2}px)`,
|
|
3178
|
-
fontSize: "16px",
|
|
3179
|
-
position: "fixed",
|
|
3180
|
-
zIndex: a.widgetTrigger.zIndex,
|
|
3181
|
-
right: a.widgetTrigger.offset.right,
|
|
3182
|
-
bottom: a.widgetTrigger.offset.bottom,
|
|
3183
|
-
left: a.widgetTrigger.offset.left,
|
|
3184
|
-
// reset iframe defaults
|
|
3185
|
-
boxSizing: "border-box",
|
|
3186
|
-
borderWidth: "0px",
|
|
3187
|
-
// A quick fix for the white square background of the iframe when the hosting website switches to dark mode
|
|
3188
|
-
borderRadius: "100%"
|
|
3189
|
-
},
|
|
3190
|
-
children: [
|
|
3191
|
-
t && /* @__PURE__ */ r("style", { children: t }),
|
|
3192
|
-
/* @__PURE__ */ r(
|
|
3193
|
-
"div",
|
|
3194
|
-
{
|
|
3195
|
-
style: {
|
|
3196
|
-
...l,
|
|
3197
|
-
width: "100%",
|
|
3198
|
-
height: "100%",
|
|
3199
|
-
display: "flex",
|
|
3200
|
-
alignItems: "center",
|
|
3201
|
-
justifyContent: "center"
|
|
3202
|
-
},
|
|
3203
|
-
children: /* @__PURE__ */ r(
|
|
3204
|
-
me.PopoverTrigger,
|
|
3205
|
-
{
|
|
3206
|
-
"aria-label": c,
|
|
3207
|
-
title: c,
|
|
3208
|
-
className: p(
|
|
3209
|
-
"font-sans flex items-center justify-center rounded-full"
|
|
3210
|
-
),
|
|
3211
|
-
style: {
|
|
3212
|
-
height: a.widgetTrigger.size.button,
|
|
3213
|
-
width: a.widgetTrigger.size.button
|
|
3214
|
-
},
|
|
3215
|
-
children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(
|
|
3216
|
-
"div",
|
|
3217
|
-
{
|
|
3218
|
-
...x("trigger/btn"),
|
|
3219
|
-
className: p(
|
|
3220
|
-
"relative size-full rounded-full",
|
|
3221
|
-
"flex items-center justify-center",
|
|
3222
|
-
"overflow-hidden",
|
|
3223
|
-
"transition-all",
|
|
3224
|
-
"bg-primary",
|
|
3225
|
-
"text-primary-foreground"
|
|
3226
|
-
),
|
|
3227
|
-
children: /* @__PURE__ */ r(_, { mode: "wait", children: e ? /* @__PURE__ */ r(
|
|
3228
|
-
y,
|
|
3229
|
-
{
|
|
3230
|
-
snapExit: !0,
|
|
3231
|
-
fadeIn: "up",
|
|
3232
|
-
overrides: {
|
|
3233
|
-
initial: { rotate: 45 },
|
|
3234
|
-
animate: { rotate: 0 }
|
|
3235
|
-
},
|
|
3236
|
-
children: (h = n == null ? void 0 : n.widgetTrigger) != null && h.closeIcon ? /* @__PURE__ */ r(
|
|
3237
|
-
"img",
|
|
3238
|
-
{
|
|
3239
|
-
src: n.widgetTrigger.closeIcon,
|
|
3240
|
-
alt: "Widget trigger close icon",
|
|
3241
|
-
style: {
|
|
3242
|
-
width: a.widgetTrigger.size.icon,
|
|
3243
|
-
height: a.widgetTrigger.size.icon
|
|
3244
|
-
}
|
|
3245
|
-
}
|
|
3246
|
-
) : /* @__PURE__ */ r(
|
|
3247
|
-
Ur,
|
|
3248
|
-
{
|
|
3249
|
-
style: {
|
|
3250
|
-
width: a.widgetTrigger.size.icon,
|
|
3251
|
-
height: a.widgetTrigger.size.icon
|
|
3252
|
-
}
|
|
3253
|
-
}
|
|
3254
|
-
)
|
|
3255
|
-
},
|
|
3256
|
-
"x-icon"
|
|
3257
|
-
) : /* @__PURE__ */ r(
|
|
3258
|
-
y,
|
|
3259
|
-
{
|
|
3260
|
-
snapExit: !0,
|
|
3261
|
-
overrides: {
|
|
3262
|
-
initial: { rotate: 45 },
|
|
3263
|
-
animate: { rotate: 0 }
|
|
3264
|
-
},
|
|
3265
|
-
children: (k = n == null ? void 0 : n.widgetTrigger) != null && k.openIcon ? /* @__PURE__ */ r(
|
|
3266
|
-
"img",
|
|
3267
|
-
{
|
|
3268
|
-
src: n.widgetTrigger.openIcon,
|
|
3269
|
-
alt: "Widget trigger open icon",
|
|
3270
|
-
style: {
|
|
3271
|
-
width: a.widgetTrigger.size.icon,
|
|
3272
|
-
height: a.widgetTrigger.size.icon
|
|
3273
|
-
}
|
|
3274
|
-
}
|
|
3275
|
-
) : /* @__PURE__ */ r(
|
|
3276
|
-
un,
|
|
3277
|
-
{
|
|
3278
|
-
style: {
|
|
3279
|
-
width: a.widgetTrigger.size.icon,
|
|
3280
|
-
height: a.widgetTrigger.size.icon
|
|
3281
|
-
},
|
|
3282
|
-
className: "mt-0.5 opacity-95"
|
|
3283
|
-
}
|
|
3284
|
-
)
|
|
3285
|
-
},
|
|
3286
|
-
"message-icon"
|
|
3287
|
-
) })
|
|
3288
|
-
}
|
|
3289
|
-
) })
|
|
3290
|
-
}
|
|
3291
|
-
)
|
|
3292
|
-
}
|
|
3293
|
-
)
|
|
3294
|
-
]
|
|
3295
|
-
}
|
|
3296
|
-
);
|
|
3297
|
-
}
|
|
3298
|
-
function fn() {
|
|
3299
|
-
const { triggerSide: e } = V();
|
|
3300
|
-
return /* @__PURE__ */ r(
|
|
3301
|
-
me.Anchor,
|
|
3302
|
-
{
|
|
3303
|
-
style: {
|
|
3304
|
-
position: "fixed",
|
|
3305
|
-
bottom: 0,
|
|
3306
|
-
right: e === "right" ? 0 : void 0,
|
|
3307
|
-
left: e === "left" ? 0 : void 0
|
|
3308
|
-
}
|
|
3309
|
-
}
|
|
3310
|
-
);
|
|
3311
|
-
}
|
|
3312
|
-
function xn({
|
|
3313
|
-
widgetRef: e
|
|
3314
|
-
}) {
|
|
3315
|
-
const { widgetCtx: o } = O(), { contactState: t } = jt(), { setIsOpen: n, isOpen: s } = K(), {
|
|
3316
|
-
toChatScreen: i,
|
|
3317
|
-
routerState: { screen: a }
|
|
3318
|
-
} = H(), { sendMessage: l } = A();
|
|
3319
|
-
return L.useImperativeHandle(
|
|
3320
|
-
e,
|
|
3321
|
-
() => ({
|
|
3322
|
-
newChat: async (c) => {
|
|
3323
|
-
var m;
|
|
3324
|
-
if (!((m = t.contact) != null && m.token)) {
|
|
3325
|
-
console.warn("Cannot start a new chat: contact not yet initialized.");
|
|
3326
|
-
return;
|
|
3327
|
-
}
|
|
3328
|
-
console.log({ isOpen: s }), s || n(!0), a === "chat" && o.resetChat(), i(), c != null && c.message && l({ content: c.message });
|
|
3329
|
-
}
|
|
3330
|
-
}),
|
|
3331
|
-
[
|
|
3332
|
-
o,
|
|
3333
|
-
t,
|
|
3334
|
-
n,
|
|
3335
|
-
s,
|
|
3336
|
-
a,
|
|
3337
|
-
i,
|
|
3338
|
-
l
|
|
3339
|
-
]
|
|
3340
|
-
), null;
|
|
3341
|
-
}
|
|
3342
|
-
function vn() {
|
|
3343
|
-
const { isOpen: e, setIsOpen: o } = K();
|
|
3344
|
-
return /* @__PURE__ */ d(me.Root, { open: e, onOpenChange: o, children: [
|
|
3345
|
-
/* @__PURE__ */ r(fn, {}),
|
|
3346
|
-
/* @__PURE__ */ r(wn, {}),
|
|
3347
|
-
/* @__PURE__ */ r(hn, {})
|
|
3348
|
-
] });
|
|
3349
|
-
}
|
|
3350
|
-
const bn = [
|
|
3351
|
-
{
|
|
3352
|
-
key: "loading",
|
|
3353
|
-
component: ho
|
|
3354
|
-
},
|
|
3355
|
-
{
|
|
3356
|
-
key: "fallback",
|
|
3357
|
-
component: mo
|
|
3358
|
-
},
|
|
3359
|
-
{
|
|
3360
|
-
key: "bot_message",
|
|
3361
|
-
component: be
|
|
3362
|
-
},
|
|
3363
|
-
{
|
|
3364
|
-
key: "agent_message",
|
|
3365
|
-
component: be
|
|
3366
|
-
}
|
|
3367
|
-
], yn = {
|
|
3368
|
-
get: async (e) => localStorage.getItem(e),
|
|
3369
|
-
set: async (e, o) => {
|
|
3370
|
-
localStorage.setItem(e, o);
|
|
3371
|
-
},
|
|
3372
|
-
remove: async (e) => {
|
|
3373
|
-
localStorage.removeItem(e);
|
|
3374
|
-
}
|
|
3375
|
-
}, kn = L.forwardRef(function({ options: o, components: t = [], loadingComponent: n }, s) {
|
|
3376
|
-
return /* @__PURE__ */ r(
|
|
3377
|
-
hr,
|
|
3378
|
-
{
|
|
3379
|
-
components: [...bn, ...t],
|
|
3380
|
-
options: o,
|
|
3381
|
-
storage: yn,
|
|
3382
|
-
loadingComponent: n,
|
|
3383
|
-
children: /* @__PURE__ */ d(ur, { children: [
|
|
3384
|
-
/* @__PURE__ */ r(xn, { widgetRef: s }),
|
|
3385
|
-
o.inline ? /* @__PURE__ */ r(lr, {}) : /* @__PURE__ */ r(vn, {})
|
|
3386
|
-
] })
|
|
3387
|
-
}
|
|
3388
|
-
);
|
|
3389
|
-
});
|
|
3390
|
-
kn.displayName = "Widget";
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "@radix-ui/react-popover";
|
|
3
|
+
import "framer-motion";
|
|
4
|
+
import "react";
|
|
5
|
+
import "@opencx/widget-react-headless";
|
|
6
|
+
import { H as s, W as n, s as a } from "./index-BCiFOCVT.js";
|
|
3391
7
|
export {
|
|
3392
|
-
|
|
8
|
+
s as HostedSpecRenderer,
|
|
9
|
+
n as Widget,
|
|
10
|
+
a as segmentContent
|
|
3393
11
|
};
|
|
3394
12
|
//# sourceMappingURL=index.js.map
|