@viswa-test/test-citation 0.0.381 → 0.0.383
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/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CompareContext.js +1 -1
- package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
- package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
- package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
- package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/helper.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/service/redlineService.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/features/CognitiveCompare/CitationRendererInner.js +2 -0
- package/dist/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/CompareContext.js +1 -1
- package/dist/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
- package/dist/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
- package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/href.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/response.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
- package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
- package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
- package/dist/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
- package/dist/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
- package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
- package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/features/RequirementAI/utils/helpers.js +1 -1
- package/dist/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/features/SegmentReviewComponents/BoundaryCard.js +1 -1
- package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
- package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
- package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/features/SegmentReviewComponents/helper.js +1 -1
- package/dist/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
- package/dist/index.js +1 -1
- package/dist/service/redlineService.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +8 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts +13 -0
- package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +12 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +12 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +9 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +3028 -891
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +14 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts +2 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts +10 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts +16 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts +7 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts +4 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts +134 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +2 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +11 -0
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts +2 -0
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts +0 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +39 -29
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts +10 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts +17 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts +23 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts +3 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +84 -5439
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +2 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +19 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +7 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +15 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts +3 -2
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts +12 -0
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +3 -2
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +3 -0
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/proccess-stream.utils.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts +0 -6
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts +4 -2
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts +1 -3
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +1 -2
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -1
- package/dist/types/src/service/redlineService.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js +0 -2
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/infoAlert.js +0 -2
- package/dist/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
- package/dist/features/SegmentReviewComponents/reviewScore.js +0 -2
- package/dist/features/SegmentReviewComponents/reviewScore.js.map +0 -1
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts +0 -23
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts.map +0 -1
- package/dist/types/src/Background.d.ts +0 -7
- package/dist/types/src/Background.d.ts.map +0 -1
- package/dist/types/src/RedlineApprovalCardTest.d.ts +0 -1
- package/dist/types/src/RedlineApprovalCardTest.d.ts.map +0 -1
- package/dist/types/src/RedlineEditorTest2.d.ts +0 -3
- package/dist/types/src/RedlineEditorTest2.d.ts.map +0 -1
- package/dist/types/src/commonConstants.d.ts +0 -31103
- package/dist/types/src/commonConstants.d.ts.map +0 -1
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts +0 -2
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts.map +0 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +0 -128
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +0 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +0 -13
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts +0 -59
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts +0 -19
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts +0 -3
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts +0 -77
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts +0 -47
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts +0 -15
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts +0 -3
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts +0 -36
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts +0 -28
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts +0 -2
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts +0 -4
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts +0 -2
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("../CognitiveComparehelpers.js"),i=require("./href.js"),n=require("./cacheKey.js"),o=function(e){return(null==e?void 0:e.nodes)||e||{}},a=function(e,t){if(!t)return null;var i=o(e);return(null==i?void 0:i[t])||null},r=function(e){var t=e.href,n=e.popupNodeId,a=e.treeData,r=i.parseOnDemandCitationHref(t),d=o(a);return r.identifier&&(null==d?void 0:d[r.identifier])?r.identifier:r.identifierNodeId&&(null==d?void 0:d[r.identifierNodeId])?r.identifierNodeId:n||null},d=function(i){var n,o,a,r,d,u=i.treeData,c=i.node,l=i.sideIndex,s=i.role,v=i.citationEntry,f=i.preferredContentId,p=u.input_index_map||{},_=p[l];if(_){var m=function(e){var t,i=e.items,n=e.preferredContentId,o=e.treeData;if(!n)return i[0]||null;var a=i.find(function(e){return e.contentId===n});if(a)return a;var r=null===(t=null==o?void 0:o.content_mapping)||void 0===t?void 0:t[n];return r&&"object"==typeof r?{contentId:n,data:r,attributes:r.additional_attributes||{}}:i[0]||null}({items:t.resolveComparisonInputItems(c,l,p,u.content_mapping||{}),preferredContentId:f,treeData:u});if(m){var b=(null===(n=u.documents)||void 0===n?void 0:n[_])||{},I=m.attributes||{},g=I.pdf_start_page_number||(null===(o=null==v?void 0:v.custom_metadata)||void 0===o?void 0:o.pdf_start_page_number),y=I.pdf_end_page_number||(null===(a=null==v?void 0:v.custom_metadata)||void 0===a?void 0:a.pdf_end_page_number),h=t.safeStringify(b.source_uri||"");return e.__assign(e.__assign(e.__assign({contract_uuid:_,contract_role:s,source_type:"text",content:{text:t.safeStringify((null===(r=m.data)||void 0===r?void 0:r.content)||(null===(d=m.data)||void 0===d?void 0:d.change_history)||"")}},h?{gcs_source_link:h}:{}),g?{pdf_start_page_number:g}:{}),y?{pdf_end_page_number:y}:{})}}},u=function(e){var t=e.treeData,i=e.nodeId,n=e.citationNumber,o=e.citationMap,r=e.baseContentId,u=e.compareContentIds;if(t&&i){var c=a(t,i);if(c){var l=t.input_index_map||{},s=l[0],v=l[1],f=(null==o?void 0:o[n])||{},p={},_=d({treeData:t,node:c,sideIndex:"0",role:"base",citationEntry:s?f[s]:null,preferredContentId:r}),m=d({treeData:t,node:c,sideIndex:"1",role:"compare",citationEntry:v?f[v]:null,preferredContentId:null==u?void 0:u[0]});return _&&(p.base=_),m&&(p.compare=m),p.base||p.compare?p:void 0}}};exports.buildCitationSources=u,exports.buildOnDemandCitationContexts=function(e){var o=e.treeData,d=e.content,c=e.requestId,l=e.tabKey,s=void 0===l?"deviation":l,v=e.popupNodeId,f=e.deviationKey,p=e.sectionTitle,_=e.referenceSectionTitle,m=e.docData,b=e.staticCitations,I=e.deviationData,g=e.cognitiveData,y=e.baseContentId,h=e.compareContentIds,C=i.extractCitationRequestsFromMarkdown(d),D=new Map,x=t.safeStringify(null==o?void 0:o.comparison_id)||t.safeStringify(null==o?void 0:o.comparisonId)||c||t.safeStringify(null==o?void 0:o.msgRequestId);return C.forEach(function(e){var t=i.parseOnDemandCitationHref(e.href),d=r({href:e.href,popupNodeId:v,treeData:o}),c=f||t.identifierDeviationKey||void 0,l=function(e){var t,i,n,o=e.treeData,r=e.nodeId,d=e.tabKey,u=e.deviationKey,c=e.staticCitations,l=e.deviationData,s=e.cognitiveData,v=a(o,r);if("association"===d)return(null===(t=null==v?void 0:v.mapping_rationale)||void 0===t?void 0:t.citations)||(null==s?void 0:s.citations)||c||{};var f=function(e,t){var i,n;if(!e||"object"!=typeof e)return null;var o=t||"0";return(null===(i=e.deviation_entries)||void 0===i?void 0:i[o])?e.deviation_entries[o]:(null===(n=e.deviations)||void 0===n?void 0:n[o])?e.deviations[o]:e[o]?e[o]:e}(null==v?void 0:v.evaluation_result,u);return(null===(i=null==f?void 0:f.cognitive_decisioning)||void 0===i?void 0:i.citations)||(null===(n=null==l?void 0:l.cognitive_decisioning)||void 0===n?void 0:n.citations)||c||{}}({treeData:o,nodeId:d,tabKey:s,deviationKey:c,staticCitations:b,deviationData:I,cognitiveData:g}),C=u({treeData:o,nodeId:d,citationNumber:e.citationNumber,citationMap:l,baseContentId:y,compareContentIds:h}),N=function(e){var t=e.nodeId,i=e.citationNumber,n=e.deviationKey;if(t)return"".concat(t,":").concat(n||"0",":").concat(i)}({nodeId:d,citationNumber:e.citationNumber,deviationKey:c}),T=n.buildOnDemandCitationCacheKey({requestId:x,citationId:N,href:e.href,highlightType:e.highlightType||"both",citationType:e.citationType});D.has(T)||D.set(T,{requestId:x,citationNumber:e.citationNumber,citationId:N,href:e.href,citationLabel:e.citationLabel,citedText:e.citedText,highlightType:e.highlightType||"both",citationType:e.citationType,tabKey:s,sectionTitle:p,referenceSectionTitle:_,sources:C,docData:m,staticCitations:l,deviationData:I,cognitiveData:g})}),Array.from(D.values())},exports.resolveCitationNodeId=r;
|
|
2
|
+
//# sourceMappingURL=contextBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextBuilder.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),e=require("../CognitiveComparehelpers.js"),i=/\[([^\]]+)\]\(([^)]+)\)/g,n=/<a\b[^>]*href=(["'])(.*?)\1[^>]*>([\s\S]*?)<\/a>/gi,r=function(t){return e.safeStringify(t).trim().replace(/\\&/g,"&").replace(/&/g,"&")},a=function(t){return e.safeStringify(t).replace(/<[^>]*>/g,"").trim()},o=function(t,e){var i=t.lastIndexOf("\n",e),n=t.indexOf("\n",e),r=-1===i?0:i+1,a=-1===n?t.length:n;return t.slice(r,a).trim()||t.trim()},u=function(t){var e=r(t).match(/^(?:pdf_citation|deviation_summary)\$(\d+)/);return(null==e?void 0:e[1])||null},l=function(e){var i,n=function(e){var i=r(e),n=i.split("$");return t.__spreadArray([],n,!0).reverse().find(function(t){return t.startsWith("./")||t.startsWith("/")||/^https?:\/\//i.test(t)})||i}(e),a=function(t){try{return new URL(t,"http://localhost")}catch(t){return null}}(n),o=(i=a)&&decodeURIComponent(i.pathname.replace(/^\/+/,""))||null,l=(null==o?void 0:o.split(":"))||[];return{hrefForUrl:n,citationNumber:(null==a?void 0:a.searchParams.get("citationNumber"))||(null==a?void 0:a.searchParams.get("citation_number"))||null||u(e),highlightType:(null==a?void 0:a.searchParams.get("highlight_type"))||(null==a?void 0:a.searchParams.get("citationSource"))||null,citationType:(null==a?void 0:a.searchParams.get("citation_type"))||(null==a?void 0:a.searchParams.get("type"))||null,identifier:o,identifierNodeId:l[0]||null,identifierDeviationKey:l.length>1?l[1]:null}};exports.extractCitationRequestsFromMarkdown=function(t){var u=function(t){return Array.isArray(t)?t.filter(Boolean).join("\n\n"):e.safeStringify(t)}(t),c=[];return u.replace(i,function(t,e,i,n){var s=l(i);return s.citationNumber&&c.push({href:r(i),citationNumber:s.citationNumber,citationLabel:a(e),citedText:o(u,n),highlightType:s.highlightType||void 0,citationType:s.citationType||void 0,rawMatch:t,index:n}),t}),u.replace(n,function(t,e,i,n,s){var h=l(i);return h.citationNumber&&c.push({href:r(i),citationNumber:h.citationNumber,citationLabel:a(n),citedText:o(u,s),highlightType:h.highlightType||void 0,citationType:h.citationType||void 0,rawMatch:t,index:s}),t}),c.sort(function(t,e){return t.index-e.index})},exports.getOnDemandCitationLinkKey=function(t){var e=r(t);return[e,l(e).citationNumber||""].join("|")},exports.normalizeOnDemandCitationHref=r,exports.parseOnDemandCitationHref=l;
|
|
2
|
+
//# sourceMappingURL=href.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"href.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(t,e){return{name:t.identity.name,organizationName:t.identity.organizationName,prompt:"",useAgent:{agent_name:t.identity.agentName,metadata:(a=t.identity,"string"==typeof a.metadata?a.metadata:a.metadata?JSON.stringify(a.metadata):JSON.stringify({userName:a.userName,userEmailId:a.userEmailId})),arguments:{citation_type:t.citationType||"redline_citation",is_primary_agent_request:!1,ui_request_body:{request_id:e.requestId,citation_id:e.citationId,cited_text:e.citedText,highlight_type:e.highlightType||"both",sources:e.sources}}}};var a};exports.buildDefaultOnDemandCitationPayload=t,exports.buildOnDemandCitationPayload=function(e,a){var i,n,r=t(e,a);return null!==(n=null===(i=e.buildPayload)||void 0===i?void 0:i.call(e,r,a))&&void 0!==n?n:r};
|
|
2
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),n=require("../CognitiveComparehelpers.js");exports.normalizeOnDemandCitationResponse=function(t,e){var o,r,u=function(i,t){var e=function(i){var n,t,e=(null==i?void 0:i.result)||(null===(n=null==i?void 0:i.responseData)||void 0===n?void 0:n.result)||(null==i?void 0:i.responseData)||i;return[null==e?void 0:e.citations,null===(t=null==e?void 0:e.annotations)||void 0===t?void 0:t.flatMap(function(i){return(null==i?void 0:i.citations)||[]}),null==i?void 0:i.citations].flat().filter(function(i){return i&&"object"==typeof i})}(i);return e.find(function(i){return i.citation_id===t.citationId})||e.find(function(i){var e,o;return n.safeStringify(i.node_uuid)===n.safeStringify(null===(e=t.citationId)||void 0===e?void 0:e.split(":")[0])&&n.safeStringify(i.dev_index)===n.safeStringify((null===(o=t.citationId)||void 0===o?void 0:o.split(":")[1])||"0")&&n.safeStringify(i.citation_number)===n.safeStringify(t.citationNumber)})||e.find(function(i){return n.safeStringify(i.citation_number)===n.safeStringify(t.citationNumber)})||null}(t,e),a=n.safeStringify(e.citationNumber||(null==u?void 0:u.citation_number)),l=null==u?void 0:u.citations;if(!a||!l||"object"!=typeof l)return{};var d=(null===(r=e.docData)||void 0===r?void 0:r.documents)||{},s=Object.entries(l).reduce(function(n,t){var e,o,r=t[0],u=t[1],a=null==d?void 0:d[r],l=i.__assign(i.__assign({},(null==u?void 0:u.customMetaData)||{}),(null==u?void 0:u.custom_metadata)||{}),s=l.signed_url||(null==a?void 0:a.signed_url)||(null==a?void 0:a.signedUrl)||(null===(e=null==a?void 0:a.metadata)||void 0===e?void 0:e.signed_url)||(null===(o=null==a?void 0:a.metadata)||void 0===o?void 0:o.signedUrl);return n[r]=i.__assign(i.__assign({},u),{custom_metadata:i.__assign(i.__assign({},l),l.signed_url||!s?{}:{signed_url:s})}),n},{});return(o={})[a]=s,o};
|
|
2
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e){if(!e||"string"!=typeof e)return e;var r=e;return(r=(r=(r=(r=(r=(r=(r=(r=(r=r.replace(/\*\*([^*]*?)\*\*/g,"$1")).replace(/__([^_]*?)__/g,"$1")).replace(/\*([^*]*?)\*/g,"$1")).replace(/_([^_]*?)_/g,"$1")).replace(/~~([^~]*?)~~/g,"$1")).replace(/`([^`]*?)`/g,"$1")).replace(/\[([^\]]*?)\]\([^)]*?\)/g,"$1")).replace(/<[^>]*?>/g,"")).replace(/\s+/g," ")).trim()};exports.findTextRangeWithFormatting=function(r,n){if(!r||!n)return null;var t=r.indexOf(n);if(-1!==t)return{start:t,end:t+n.length};var i=e(r),a=e(n);if(!i||!a)return null;var f=i.indexOf(a);if(-1===f)return null;var l=function(e,r,n){var t=0,i=0,a=-1,f=-1;for(;t<e.length;){var l=e[t],u=l+e[t+1],g=0;if("**"===u||"__"===u||"~~"===u)g=2;else if("<["===u){if("<"===l){var s=e.indexOf(">",t);-1!==s&&(g=s-t+1)}else if("["===l){var p=e.indexOf("]",t);if(-1!==p&&"("===e[p+1]){var c=e.indexOf(")",p);if(-1!==c){for(var o=t+1;o<p;o++)if(i===r&&-1===a&&(a=t+1),++i===r+n)return f=o+1,-1!==a&&-1!==f?{start:a,end:f}:null;t=c,g=1}}}}else"*"!==l&&"_"!==l&&"`"!==l&&"<"!==l||(g=1);if(g>0)t+=g;else{if(i===r&&-1===a&&(a=t),++i===r+n){f=t+1;break}t++}}if(-1===a||-1===f)return null;return{start:a,end:f}}(r,f,a.length);return l},exports.stripMarkdownFormatting=e;
|
|
2
|
+
//# sourceMappingURL=normalizeInlineMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeInlineMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),i=require("../CognitiveComparehelpers.js"),e=/\[([^\]]+)\]\(([^)]+)\)/g,n=/<a\b[^>]*href=(["'])(.*?)\1[^>]*>([\s\S]*?)<\/a>/gi,a=function(t){return i.safeStringify(t).trim().replace(/\\&/g,"&").replace(/&/g,"&")},o=function(t){return i.safeStringify(t).replace(/<[^>]*>/g,"").trim()},r=function(t,i){var e=t.lastIndexOf("\n",i),n=t.indexOf("\n",i),a=-1===e?0:e+1,o=-1===n?t.length:n;return t.slice(a,o).trim()||t.trim()},d=function(t){var i=a(t).match(/^(?:pdf_citation|deviation_summary)\$(\d+)/);return(null==i?void 0:i[1])||null},u=function(i){var e,n=function(i){var e=a(i),n=e.split("$");return t.__spreadArray([],n,!0).reverse().find(function(t){return t.startsWith("./")||t.startsWith("/")||/^https?:\/\//i.test(t)})||e}(i),o=function(t){try{return new URL(t,"http://localhost")}catch(t){return null}}(n),r=(e=o)&&decodeURIComponent(e.pathname.replace(/^\/+/,""))||null,u=(null==r?void 0:r.split(":"))||[];return{hrefForUrl:n,citationNumber:(null==o?void 0:o.searchParams.get("citationNumber"))||(null==o?void 0:o.searchParams.get("citation_number"))||null||d(i),highlightType:(null==o?void 0:o.searchParams.get("highlight_type"))||(null==o?void 0:o.searchParams.get("citationSource"))||null,citationType:(null==o?void 0:o.searchParams.get("citation_type"))||(null==o?void 0:o.searchParams.get("type"))||null,identifier:r,identifierNodeId:u[0]||null,identifierDeviationKey:u.length>1?u[1]:null}},l=function(t){var d=function(t){return Array.isArray(t)?t.filter(Boolean).join("\n\n"):i.safeStringify(t)}(t),l=[];return d.replace(e,function(t,i,e,n){var c=u(e);return c.citationNumber&&l.push({href:a(e),citationNumber:c.citationNumber,citationLabel:o(i),citedText:r(d,n),highlightType:c.highlightType||void 0,citationType:c.citationType||void 0,rawMatch:t,index:n}),t}),d.replace(n,function(t,i,e,n,c){var s=u(e);return s.citationNumber&&l.push({href:a(e),citationNumber:s.citationNumber,citationLabel:o(n),citedText:r(d,c),highlightType:s.highlightType||void 0,citationType:s.citationType||void 0,rawMatch:t,index:c}),t}),l.sort(function(t,i){return t.index-i.index})},c=function(t){return(null==t?void 0:t.nodes)||t||{}},s=function(t,i){if(!i)return null;var e=c(t);return(null==e?void 0:e[i])||null},v=function(t){var i=t.href,e=t.popupNodeId,n=t.treeData,a=u(i),o=c(n);return a.identifier&&(null==o?void 0:o[a.identifier])?a.identifier:a.identifierNodeId&&(null==o?void 0:o[a.identifierNodeId])?a.identifierNodeId:e||null},f=function(e){var n,a,o,r,d,u=e.treeData,l=e.node,c=e.sideIndex,s=e.role,v=e.citationEntry,f=e.preferredContentId,p=u.input_index_map||{},m=p[c];if(m){var g=function(t){var i,e=t.items,n=t.preferredContentId,a=t.treeData;if(!n)return e[0]||null;var o=e.find(function(t){return t.contentId===n});if(o)return o;var r=null===(i=null==a?void 0:a.content_mapping)||void 0===i?void 0:i[n];return r&&"object"==typeof r?{contentId:n,data:r,attributes:r.additional_attributes||{}}:e[0]||null}({items:i.resolveComparisonInputItems(l,c,p,u.content_mapping||{}),preferredContentId:f,treeData:u});if(g){var _=(null===(n=u.documents)||void 0===n?void 0:n[m])||{},y=g.attributes||{},h=y.pdf_start_page_number||(null===(a=null==v?void 0:v.custom_metadata)||void 0===a?void 0:a.pdf_start_page_number),b=y.pdf_end_page_number||(null===(o=null==v?void 0:v.custom_metadata)||void 0===o?void 0:o.pdf_end_page_number),I=i.safeStringify(_.source_uri||"");return t.__assign(t.__assign(t.__assign({contract_uuid:m,contract_role:s,source_type:"text",content:{text:i.safeStringify((null===(r=g.data)||void 0===r?void 0:r.content)||(null===(d=g.data)||void 0===d?void 0:d.change_history)||"")}},I?{gcs_source_link:I}:{}),h?{pdf_start_page_number:h}:{}),b?{pdf_end_page_number:b}:{})}}},p=function(t){var i=t.treeData,e=t.nodeId,n=t.citationNumber,a=t.citationMap,o=t.baseContentId,r=t.compareContentIds;if(i&&e){var d=s(i,e);if(d){var u=i.input_index_map||{},l=u[0],c=u[1],v=(null==a?void 0:a[n])||{},p={},m=f({treeData:i,node:d,sideIndex:"0",role:"base",citationEntry:l?v[l]:null,preferredContentId:o}),g=f({treeData:i,node:d,sideIndex:"1",role:"compare",citationEntry:c?v[c]:null,preferredContentId:null==r?void 0:r[0]});return m&&(p.base=m),g&&(p.compare=g),p.base||p.compare?p:void 0}}},m=function(t,i){return{name:t.identity.name,organizationName:t.identity.organizationName,prompt:"",useAgent:{agent_name:t.identity.agentName,metadata:(e=t.identity,"string"==typeof e.metadata?e.metadata:e.metadata?JSON.stringify(e.metadata):JSON.stringify({userName:e.userName,userEmailId:e.userEmailId})),arguments:{citation_type:t.citationType||"redline_citation",is_primary_agent_request:!1,ui_request_body:{request_id:i.requestId,citation_id:i.citationId,cited_text:i.citedText,highlight_type:i.highlightType||"both",sources:i.sources}}}};var e},g=function(t){return[t.requestId||"",t.citationId||t.href,t.highlightType||"both",t.citationType||""].join("|")};exports.buildCitationSources=p,exports.buildDefaultOnDemandCitationPayload=m,exports.buildOnDemandCitationCacheKey=g,exports.buildOnDemandCitationContexts=function(t){var e=t.treeData,n=t.content,a=t.requestId,o=t.tabKey,r=void 0===o?"deviation":o,d=t.popupNodeId,c=t.deviationKey,f=t.sectionTitle,m=t.referenceSectionTitle,_=t.docData,y=t.staticCitations,h=t.deviationData,b=t.cognitiveData,I=t.baseContentId,D=t.compareContentIds,N=l(n),x=new Map,C=a||i.safeStringify(null==e?void 0:e.msgRequestId);return N.forEach(function(t){var i=u(t.href),n=v({href:t.href,popupNodeId:d,treeData:e}),a=c||i.identifierDeviationKey||void 0,o=function(t){var i,e,n,a=t.treeData,o=t.nodeId,r=t.tabKey,d=t.deviationKey,u=t.staticCitations,l=t.deviationData,c=t.cognitiveData,v=s(a,o);if("association"===r)return(null===(i=null==v?void 0:v.mapping_rationale)||void 0===i?void 0:i.citations)||(null==c?void 0:c.citations)||u||{};var f=function(t,i){var e,n;if(!t||"object"!=typeof t)return null;var a=i||"0";return(null===(e=t.deviation_entries)||void 0===e?void 0:e[a])?t.deviation_entries[a]:(null===(n=t.deviations)||void 0===n?void 0:n[a])?t.deviations[a]:t[a]?t[a]:t}(null==v?void 0:v.evaluation_result,d);return(null===(e=null==f?void 0:f.cognitive_decisioning)||void 0===e?void 0:e.citations)||(null===(n=null==l?void 0:l.cognitive_decisioning)||void 0===n?void 0:n.citations)||u||{}}({treeData:e,nodeId:n,tabKey:r,deviationKey:a,staticCitations:y,deviationData:h,cognitiveData:b}),l=p({treeData:e,nodeId:n,citationNumber:t.citationNumber,citationMap:o,baseContentId:I,compareContentIds:D}),N=function(t){var i=t.nodeId,e=t.citationNumber,n=t.deviationKey;if(i)return"".concat(i,":").concat(n||"0",":").concat(e)}({nodeId:n,citationNumber:t.citationNumber,tabKey:r,deviationKey:a}),T=g({requestId:C,citationId:N,href:t.href,highlightType:t.highlightType||"both",citationType:t.citationType});x.has(T)||x.set(T,{requestId:C,citationNumber:t.citationNumber,citationId:N,href:t.href,citationLabel:t.citationLabel,citedText:t.citedText,highlightType:t.highlightType||"both",citationType:t.citationType,tabKey:r,sectionTitle:f,referenceSectionTitle:m,sources:l,docData:_,staticCitations:o,deviationData:h,cognitiveData:b})}),Array.from(x.values())},exports.buildOnDemandCitationPayload=function(t,i){var e,n,a=m(t,i);return null!==(n=null===(e=t.buildPayload)||void 0===e?void 0:e.call(t,a,i))&&void 0!==n?n:a},exports.extractCitationRequestsFromMarkdown=l,exports.getOnDemandCitationLinkKey=function(t){var i=a(t);return[i,u(i).citationNumber||""].join("|")},exports.normalizeOnDemandCitationResponse=function(e,n){var a,o,r=function(t,e){var n=function(t){var i,e,n=(null==t?void 0:t.result)||(null===(i=null==t?void 0:t.responseData)||void 0===i?void 0:i.result)||(null==t?void 0:t.responseData)||t;return[null==n?void 0:n.citations,null===(e=null==n?void 0:n.annotations)||void 0===e?void 0:e.flatMap(function(t){return(null==t?void 0:t.citations)||[]}),null==t?void 0:t.citations].flat().filter(function(t){return t&&"object"==typeof t})}(t);return n.find(function(t){return t.citation_id===e.citationId})||n.find(function(t){var n,a;return i.safeStringify(t.node_uuid)===i.safeStringify(null===(n=e.citationId)||void 0===n?void 0:n.split(":")[0])&&i.safeStringify(t.dev_index)===i.safeStringify((null===(a=e.citationId)||void 0===a?void 0:a.split(":")[1])||"0")&&i.safeStringify(t.citation_number)===i.safeStringify(e.citationNumber)})||n.find(function(t){return i.safeStringify(t.citation_number)===i.safeStringify(e.citationNumber)})||null}(e,n),d=i.safeStringify(n.citationNumber||(null==r?void 0:r.citation_number)),u=null==r?void 0:r.citations;if(!d||!u||"object"!=typeof u)return{};var l=(null===(o=n.docData)||void 0===o?void 0:o.documents)||{},c=Object.entries(u).reduce(function(i,e){var n,a,o=e[0],r=e[1],d=null==l?void 0:l[o],u=t.__assign(t.__assign({},(null==r?void 0:r.customMetaData)||{}),(null==r?void 0:r.custom_metadata)||{}),c=u.signed_url||(null==d?void 0:d.signed_url)||(null==d?void 0:d.signedUrl)||(null===(n=null==d?void 0:d.metadata)||void 0===n?void 0:n.signed_url)||(null===(a=null==d?void 0:d.metadata)||void 0===a?void 0:a.signedUrl);return i[o]=t.__assign(t.__assign({},r),{custom_metadata:t.__assign(t.__assign({},u),u.signed_url||!c?{}:{signed_url:c})}),i},{});return(a={})[d]=c,a},exports.parseOnDemandCitationHref=u,exports.resolveCitationNodeId=v;
|
|
2
|
+
//# sourceMappingURL=onDemandCitations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onDemandCitations.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),l=require("lucide-react"),t=require("./CognitiveNonWebSearchReasoning.module.css.js"),s=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},a=function(i){return i.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(i,l){return i.startsWith("**")&&i.endsWith("**")||i.startsWith("__")&&i.endsWith("__")?e.jsx("strong",n.__assign({className:t.default.boldText},{children:i.slice(2,-2)}),l):i})};exports.default=function(o){var d=o.item,r=o.headerTitle;o.index;var u=o.iconsConfig,c=o.DocumentTitle,v=o.previewCallback,g=o.bodyHeight,h=o.disableMaximize,m=void 0!==h&&h,_=o.splitterCustomStyle,f=void 0!==_&&_,x=o.themeTokens,p=o.classNames,j=o.styles,y=d.dataSource,b=d.confidence_score,C=d.trainingDataTitle,N=null==u?void 0:u.ChevronDownIcon,I=null==u?void 0:u.ChevronUpIcon,k=null==u?void 0:u.MaximizeIcon,T=null==u?void 0:u.CloseIcon,H=i.useMemo(function(){var e=(y?y.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),i=0,l=e.map(function(n){var e=n.startsWith("<highlight>"),l={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?i:-1};return e&&i++,l}),t=l.filter(function(n){return n.isHighlight}).length,s=[],a=[];return l.forEach(function(e){var i=e.text,l=e.isHighlight,t=e.highlightIndex;i.split("\n").forEach(function(e,i){i>0&&((a.length>0||s.length>0)&&s.push(n.__spreadArray([],a,!0)),a=[]),e&&a.push({text:e,isHighlight:l,highlightIndex:t})})}),a.length>0&&s.push(n.__spreadArray([],a,!0)),{processedLines:s.map(function(n){var e=n.map(function(n){return n.text}).join(""),i=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!i,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==i?void 0:i[1])||"",content:(null==i?void 0:i[3])||e}}),totalHighlights:t}},[y]),L=H.processedLines,w=H.totalHighlights,B=i.useState(0),S=B[0],z=B[1],A=i.useRef(null),F=i.useRef(null),R=i.useRef(null),D=i.useRef([]),E=i.useRef([]);i.useEffect(function(){D.current=D.current.slice(0,w),E.current=E.current.slice(0,w)},[w]),i.useEffect(function(){if(w>0){z(0);var n=setTimeout(function(){var n;null===(n=D.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[w]);var W=function(n,e){setTimeout(function(){var i=e?E.current[n]:D.current[n];null==i||i.scrollIntoView({behavior:"smooth",block:"center"})},50)},q=function(n){if(void 0===n&&(n=!1),w){var e=S>0?S-1:w-1;z(e),W(e,n)}},M=function(n){if(void 0===n&&(n=!1),w){var e=S<w-1?S+1:0;z(e),W(e,n)}},U=function(i){var l=i?E:D,o=0;return L.map(function(i,d){i.isHeader&&(o=0),i.isListItem&&(o+=1);var r=function(){return i.segments.map(function(o,d){var r=o.isHighlight&&o.highlightIndex===S,u=o.text;return i.isListItem&&0===d&&(u=o.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),o.isHighlight?e.jsx("span",n.__assign({ref:function(n){n&&(l.current[o.highlightIndex]=n)},className:s(t.default.highlight,r?t.default.highlightActive:void 0,null==p?void 0:p.highlight,r?null==p?void 0:p.highlightActive:void 0),style:r?n.__assign(n.__assign({},null==j?void 0:j.highlight),null==j?void 0:j.highlightActive):null==j?void 0:j.highlight},{children:a(u)}),d):e.jsx("span",{children:a(u)},d)})};return i.isHeader?e.jsx("span",n.__assign({className:s(t.default.headerLine,null==p?void 0:p.headerLine),style:null==j?void 0:j.headerLine},{children:r()}),d):i.isListItem?e.jsxs("span",n.__assign({className:s(t.default.listItemLine,null==p?void 0:p.listItemLine),style:n.__assign({paddingLeft:i.indent?"1rem":"0"},null==j?void 0:j.listItemLine)},{children:[e.jsxs("span",n.__assign({className:s(t.default.listCounter,null==p?void 0:p.listCounter),style:null==j?void 0:j.listCounter},{children:[o,"."]})),e.jsx("span",{children:r()})]}),d):e.jsx("span",n.__assign({className:s(t.default.blockLine,null==p?void 0:p.blockLine),style:null==j?void 0:j.blockLine},{children:r()}),d)})},V=function(i){return w>1?e.jsxs("div",n.__assign({className:s(i?t.default.modalNavContainer:t.default.navigationContainer,i?null==p?void 0:p.modalNavContainer:null==p?void 0:p.navigationContainer),style:i?null==j?void 0:j.modalNavContainer:null==j?void 0:j.navigationContainer},{children:[I&&e.jsx("button",n.__assign({onClick:function(){return q(i)},className:s(i?t.default.modalNavButton:t.default.navButton,null==p?void 0:p.navButton),style:null==j?void 0:j.navButton},{children:e.jsx(I,{className:s(t.default.navIcon,null==p?void 0:p.navIcon),style:null==j?void 0:j.navIcon})})),e.jsxs("span",n.__assign({className:s(t.default.navCounter,null==p?void 0:p.navCounter),style:null==j?void 0:j.navCounter},{children:[S+1,"/",w]})),N&&e.jsx("button",n.__assign({onClick:function(){return M(i)},className:s(i?t.default.modalNavButton:t.default.navButton,null==p?void 0:p.navButton),style:null==j?void 0:j.navButton},{children:e.jsx(N,{className:s(t.default.navIcon,null==p?void 0:p.navIcon),style:null==j?void 0:j.navIcon})}))]})):null},$=null!=b?e.jsxs("span",n.__assign({className:s(t.default.confidenceBadge,null==p?void 0:p.confidenceBadge),style:null==j?void 0:j.confidenceBadge},{children:[e.jsx("span",n.__assign({className:t.default.confidenceStar},{children:"✦"})),e.jsxs("span",n.__assign({className:t.default.confidenceScore},{children:[b,"%"]}))]})):null,O=f?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,P=e.jsxs(e.Fragment,{children:[C&&e.jsx("div",n.__assign({className:s(t.default.footer,null==p?void 0:p.footer),style:n.__assign(n.__assign({},O),null==j?void 0:j.footer)},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==p?void 0:p.trainingTitle),style:null==j?void 0:j.trainingTitle},{children:C}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==p?void 0:p.modalFooterSource),style:n.__assign(n.__assign({},O),null==j?void 0:j.modalFooterSource)},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){return null==v?void 0:v()},className:s(t.default.trainingTitleLink,null==p?void 0:p.trainingTitleLink),style:null==j?void 0:j.trainingTitleLink},{children:[c,e.jsx(l.ExternalLink,{size:16,color:"#2563eb"})]}))}))]});return e.jsxs(e.Fragment,{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedContainer,null==p?void 0:p.expandedContainer),style:n.__assign(n.__assign(n.__assign(n.__assign({},x),g?{height:"".concat(g),display:"flex",flexDirection:"column"}:void 0),f?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==j?void 0:j.expandedContainer)},{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedHeader,null==p?void 0:p.expandedHeader),style:n.__assign(n.__assign({},f?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==j?void 0:j.expandedHeader)},{children:[e.jsx("span",n.__assign({className:s(t.default.headerTitle,null==p?void 0:p.headerTitle),style:null==j?void 0:j.headerTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.headerActions,null==p?void 0:p.headerActions),style:null==j?void 0:j.headerActions},{children:[f?w>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[S+1," / ",w]})),e.jsx("button",n.__assign({onClick:function(){return q(!0)},disabled:S<=0,style:{padding:"2px 4px",cursor:S<=0?"not-allowed":"pointer",opacity:S<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:S>=w-1,style:{padding:"2px 4px",cursor:S>=w-1?"not-allowed":"pointer",opacity:S>=w-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronDown,{size:14,color:"#64748b"})}))]}):V(!1),$,!m&&k&&e.jsx("button",n.__assign({onClick:function(){var n;return null===(n=R.current)||void 0===n?void 0:n.showModal()},className:s(t.default.maximizeButton,null==p?void 0:p.maximizeButton),style:null==j?void 0:j.maximizeButton,title:"View fullscreen"},{children:e.jsx(k,{className:t.default.maximizeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:A,className:s(t.default.contentArea,null==p?void 0:p.contentArea),style:n.__assign(n.__assign(n.__assign({},g?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),f?{padding:"1rem 1.5rem"}:void 0),null==j?void 0:j.contentArea)},{children:e.jsx("div",n.__assign({className:s(t.default.contentInner,null==p?void 0:p.contentInner),style:null==j?void 0:j.contentInner},{children:U(!1)}))})),P]})),!m&&e.jsx("dialog",n.__assign({ref:R,className:t.default.modalDialog,onClick:function(n){var e;n.target===R.current&&(null===(e=R.current)||void 0===e||e.close())}},{children:e.jsxs("div",n.__assign({className:s(t.default.modalContainer,null==p?void 0:p.modalContainer),style:null==j?void 0:j.modalContainer},{children:[e.jsxs("div",n.__assign({className:s(t.default.modalHeader,null==p?void 0:p.modalHeader),style:null==j?void 0:j.modalHeader},{children:[e.jsx("span",n.__assign({className:s(t.default.modalHeaderTitle,null==p?void 0:p.modalHeaderTitle),style:null==j?void 0:j.modalHeaderTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.modalHeaderActions,null==p?void 0:p.modalHeaderActions),style:null==j?void 0:j.modalHeaderActions},{children:[f?w>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[S+1," / ",w]})),e.jsx("button",n.__assign({onClick:function(){return q(!0)},disabled:S<=0,style:{padding:"2px 4px",cursor:S<=0?"not-allowed":"pointer",opacity:S<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:S>=w-1,style:{padding:"2px 4px",cursor:S>=w-1?"not-allowed":"pointer",opacity:S>=w-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(l.ChevronDown,{size:14,color:"#64748b"})}))]}):V(!0),$,T&&e.jsx("button",n.__assign({onClick:function(){var n;return null===(n=R.current)||void 0===n?void 0:n.close()},className:s(t.default.closeButton,null==p?void 0:p.closeButton),style:null==j?void 0:j.closeButton,title:"Close"},{children:e.jsx(T,{className:s(t.default.closeIcon,null==p?void 0:p.closeIcon),style:null==j?void 0:j.closeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:F,className:s(t.default.modalContent,null==p?void 0:p.modalContent),style:null==j?void 0:j.modalContent},{children:e.jsx("div",n.__assign({className:s(t.default.modalContentInner,null==p?void 0:p.modalContentInner),style:null==j?void 0:j.modalContentInner},{children:U(!0)}))})),C&&e.jsx("div",n.__assign({className:s(t.default.modalFooter,null==p?void 0:p.modalFooter),style:null==j?void 0:j.modalFooter},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==p?void 0:p.trainingTitle),style:null==j?void 0:j.trainingTitle},{children:C}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==p?void 0:p.modalFooterSource),style:null==j?void 0:j.modalFooterSource},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){var n;null==v||v(),null===(n=R.current)||void 0===n||n.close()},className:s(t.default.trainingTitleLink,null==p?void 0:p.trainingTitleLink),style:null==j?void 0:j.trainingTitleLink},{children:[c,e.jsx(l.ExternalLink,{size:16,color:"#2563eb"})]}))}))]}))}))]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),l=require("react"),i=require("lucide-react"),t=require("./CognitiveNonWebSearchReasoning.module.css.js"),s=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},a=function(l){return l.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(l,i){return l.startsWith("**")&&l.endsWith("**")||l.startsWith("__")&&l.endsWith("__")?e.jsx("strong",n.__assign({className:t.default.boldText},{children:l.slice(2,-2)}),i):l})};exports.default=function(o){var d=o.item,r=o.headerTitle;o.index;var u=o.iconsConfig,c=o.DocumentTitle,v=o.previewCallback,g=o.bodyHeight,h=o.disableMaximize,m=void 0!==h&&h,f=o.onFullscreenChange,_=o.splitterCustomStyle,x=void 0!==_&&_,p=o.themeTokens,j=o.classNames,y=o.styles,b=d.dataSource,C=d.confidence_score,N=d.trainingDataTitle,I=null==u?void 0:u.ChevronDownIcon,k=null==u?void 0:u.ChevronUpIcon,T=null==u?void 0:u.MaximizeIcon,H=null==u?void 0:u.CloseIcon,L=l.useMemo(function(){var e=(b?b.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),l=0,i=e.map(function(n){var e=n.startsWith("<highlight>"),i={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?l:-1};return e&&l++,i}),t=i.filter(function(n){return n.isHighlight}).length,s=[],a=[];return i.forEach(function(e){var l=e.text,i=e.isHighlight,t=e.highlightIndex;l.split("\n").forEach(function(e,l){l>0&&((a.length>0||s.length>0)&&s.push(n.__spreadArray([],a,!0)),a=[]),e&&a.push({text:e,isHighlight:i,highlightIndex:t})})}),a.length>0&&s.push(n.__spreadArray([],a,!0)),{processedLines:s.map(function(n){var e=n.map(function(n){return n.text}).join(""),l=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!l,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==l?void 0:l[1])||"",content:(null==l?void 0:l[3])||e}}),totalHighlights:t}},[b]),w=L.processedLines,B=L.totalHighlights,S=l.useState(0),z=S[0],A=S[1],F=l.useRef(null),R=l.useRef(null),D=l.useRef(null),E=l.useRef([]),W=l.useRef([]);l.useEffect(function(){E.current=E.current.slice(0,B),W.current=W.current.slice(0,B)},[B]),l.useEffect(function(){if(B>0){A(0);var n=setTimeout(function(){var n;null===(n=E.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[B]),l.useEffect(function(){return function(){var n;(null===(n=D.current)||void 0===n?void 0:n.open)&&(null==f||f(!1))}},[f]);var q=function(n,e){setTimeout(function(){var l=e?W.current[n]:E.current[n];null==l||l.scrollIntoView({behavior:"smooth",block:"center"})},50)},M=function(n){if(void 0===n&&(n=!1),B){var e=z>0?z-1:B-1;A(e),q(e,n)}},U=function(n){if(void 0===n&&(n=!1),B){var e=z<B-1?z+1:0;A(e),q(e,n)}},V=function(l){var i=l?W:E,o=0;return w.map(function(l,d){l.isHeader&&(o=0),l.isListItem&&(o+=1);var r=function(){return l.segments.map(function(o,d){var r=o.isHighlight&&o.highlightIndex===z,u=o.text;return l.isListItem&&0===d&&(u=o.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),o.isHighlight?e.jsx("span",n.__assign({ref:function(n){n&&(i.current[o.highlightIndex]=n)},className:s(t.default.highlight,r?t.default.highlightActive:void 0,null==j?void 0:j.highlight,r?null==j?void 0:j.highlightActive:void 0),style:r?n.__assign(n.__assign({},null==y?void 0:y.highlight),null==y?void 0:y.highlightActive):null==y?void 0:y.highlight},{children:a(u)}),d):e.jsx("span",{children:a(u)},d)})};return l.isHeader?e.jsx("span",n.__assign({className:s(t.default.headerLine,null==j?void 0:j.headerLine),style:null==y?void 0:y.headerLine},{children:r()}),d):l.isListItem?e.jsxs("span",n.__assign({className:s(t.default.listItemLine,null==j?void 0:j.listItemLine),style:n.__assign({paddingLeft:l.indent?"1rem":"0"},null==y?void 0:y.listItemLine)},{children:[e.jsxs("span",n.__assign({className:s(t.default.listCounter,null==j?void 0:j.listCounter),style:null==y?void 0:y.listCounter},{children:[o,"."]})),e.jsx("span",{children:r()})]}),d):e.jsx("span",n.__assign({className:s(t.default.blockLine,null==j?void 0:j.blockLine),style:null==y?void 0:y.blockLine},{children:r()}),d)})},$=function(l){return B>1?e.jsxs("div",n.__assign({className:s(l?t.default.modalNavContainer:t.default.navigationContainer,l?null==j?void 0:j.modalNavContainer:null==j?void 0:j.navigationContainer),style:l?null==y?void 0:y.modalNavContainer:null==y?void 0:y.navigationContainer},{children:[k&&e.jsx("button",n.__assign({onClick:function(){return M(l)},className:s(l?t.default.modalNavButton:t.default.navButton,null==j?void 0:j.navButton),style:null==y?void 0:y.navButton},{children:e.jsx(k,{className:s(t.default.navIcon,null==j?void 0:j.navIcon),style:null==y?void 0:y.navIcon})})),e.jsxs("span",n.__assign({className:s(t.default.navCounter,null==j?void 0:j.navCounter),style:null==y?void 0:y.navCounter},{children:[z+1,"/",B]})),I&&e.jsx("button",n.__assign({onClick:function(){return U(l)},className:s(l?t.default.modalNavButton:t.default.navButton,null==j?void 0:j.navButton),style:null==y?void 0:y.navButton},{children:e.jsx(I,{className:s(t.default.navIcon,null==j?void 0:j.navIcon),style:null==y?void 0:y.navIcon})}))]})):null},O=null!=C?e.jsxs("span",n.__assign({className:s(t.default.confidenceBadge,null==j?void 0:j.confidenceBadge),style:null==y?void 0:y.confidenceBadge},{children:[e.jsx("span",n.__assign({className:t.default.confidenceStar},{children:"✦"})),e.jsxs("span",n.__assign({className:t.default.confidenceScore},{children:[C,"%"]}))]})):null,P=x?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,Y=e.jsxs(e.Fragment,{children:[N&&e.jsx("div",n.__assign({className:s(t.default.footer,null==j?void 0:j.footer),style:n.__assign(n.__assign({},P),null==y?void 0:y.footer)},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==j?void 0:j.trainingTitle),style:null==y?void 0:y.trainingTitle},{children:N}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==j?void 0:j.modalFooterSource),style:n.__assign(n.__assign({},P),null==y?void 0:y.modalFooterSource)},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){return null==v?void 0:v()},className:s(t.default.trainingTitleLink,null==j?void 0:j.trainingTitleLink),style:null==y?void 0:y.trainingTitleLink},{children:[c,e.jsx(i.ExternalLink,{size:16,color:"#2563eb"})]}))}))]});return e.jsxs(e.Fragment,{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedContainer,null==j?void 0:j.expandedContainer),style:n.__assign(n.__assign(n.__assign(n.__assign({},p),g?{height:"".concat(g),display:"flex",flexDirection:"column"}:void 0),x?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==y?void 0:y.expandedContainer)},{children:[e.jsxs("div",n.__assign({className:s(t.default.expandedHeader,null==j?void 0:j.expandedHeader),style:n.__assign(n.__assign({},x?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==y?void 0:y.expandedHeader)},{children:[e.jsx("span",n.__assign({className:s(t.default.headerTitle,null==j?void 0:j.headerTitle),style:null==y?void 0:y.headerTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.headerActions,null==j?void 0:j.headerActions),style:null==y?void 0:y.headerActions},{children:[x?B>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[z+1," / ",B]})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:z<=0,style:{padding:"2px 4px",cursor:z<=0?"not-allowed":"pointer",opacity:z<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return U(!0)},disabled:z>=B-1,style:{padding:"2px 4px",cursor:z>=B-1?"not-allowed":"pointer",opacity:z>=B-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronDown,{size:14,color:"#64748b"})}))]}):$(!1),O,!m&&T&&e.jsx("button",n.__assign({onClick:function(){var n;null==f||f(!0),null===(n=D.current)||void 0===n||n.showModal()},className:s(t.default.maximizeButton,null==j?void 0:j.maximizeButton),style:null==y?void 0:y.maximizeButton,title:"View fullscreen"},{children:e.jsx(T,{className:t.default.maximizeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:F,className:s(t.default.contentArea,null==j?void 0:j.contentArea),style:n.__assign(n.__assign(n.__assign({},g?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),x?{padding:"1rem 1.5rem"}:void 0),null==y?void 0:y.contentArea)},{children:e.jsx("div",n.__assign({className:s(t.default.contentInner,null==j?void 0:j.contentInner),style:null==y?void 0:y.contentInner},{children:V(!1)}))})),Y]})),!m&&e.jsx("dialog",n.__assign({ref:D,className:t.default.modalDialog,onClose:function(){return null==f?void 0:f(!1)},onClick:function(n){var e;n.target===D.current&&(null===(e=D.current)||void 0===e||e.close())}},{children:e.jsxs("div",n.__assign({className:s(t.default.modalContainer,null==j?void 0:j.modalContainer),style:null==y?void 0:y.modalContainer},{children:[e.jsxs("div",n.__assign({className:s(t.default.modalHeader,null==j?void 0:j.modalHeader),style:null==y?void 0:y.modalHeader},{children:[e.jsx("span",n.__assign({className:s(t.default.modalHeaderTitle,null==j?void 0:j.modalHeaderTitle),style:null==y?void 0:y.modalHeaderTitle},{children:r})),e.jsxs("div",n.__assign({className:s(t.default.modalHeaderActions,null==j?void 0:j.modalHeaderActions),style:null==y?void 0:y.modalHeaderActions},{children:[x?B>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",n.__assign({style:{fontSize:"12px",color:"#888"}},{children:[z+1," / ",B]})),e.jsx("button",n.__assign({onClick:function(){return M(!0)},disabled:z<=0,style:{padding:"2px 4px",cursor:z<=0?"not-allowed":"pointer",opacity:z<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronUp,{size:14,color:"#64748b"})})),e.jsx("button",n.__assign({onClick:function(){return U(!0)},disabled:z>=B-1,style:{padding:"2px 4px",cursor:z>=B-1?"not-allowed":"pointer",opacity:z>=B-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:e.jsx(i.ChevronDown,{size:14,color:"#64748b"})}))]}):$(!0),O,H&&e.jsx("button",n.__assign({onClick:function(){var n;return null===(n=D.current)||void 0===n?void 0:n.close()},className:s(t.default.closeButton,null==j?void 0:j.closeButton),style:null==y?void 0:y.closeButton,title:"Close"},{children:e.jsx(H,{className:s(t.default.closeIcon,null==j?void 0:j.closeIcon),style:null==y?void 0:y.closeIcon})}))]}))]})),e.jsx("div",n.__assign({ref:R,className:s(t.default.modalContent,null==j?void 0:j.modalContent),style:null==y?void 0:y.modalContent},{children:e.jsx("div",n.__assign({className:s(t.default.modalContentInner,null==j?void 0:j.modalContentInner),style:null==y?void 0:y.modalContentInner},{children:V(!0)}))})),N&&e.jsx("div",n.__assign({className:s(t.default.modalFooter,null==j?void 0:j.modalFooter),style:null==y?void 0:y.modalFooter},{children:e.jsx("span",n.__assign({className:s(t.default.trainingTitle,null==j?void 0:j.trainingTitle),style:null==y?void 0:y.trainingTitle},{children:N}))})),c&&e.jsx("div",n.__assign({className:s(t.default.modalFooterSource,null==j?void 0:j.modalFooterSource),style:null==y?void 0:y.modalFooterSource},{children:e.jsxs("button",n.__assign({type:"button",onClick:function(){var n;null==v||v(),null===(n=D.current)||void 0===n||n.close()},className:s(t.default.trainingTitleLink,null==j?void 0:j.trainingTitleLink),style:null==y?void 0:y.trainingTitleLink},{children:[c,e.jsx(i.ExternalLink,{size:16,color:"#2563eb"})]}))}))]}))}))]})};
|
|
2
2
|
//# sourceMappingURL=CognitiveInternalgptCoreComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),o=require("../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),l=require("./GptWebCitationImageCitation.js"),a=require("./GptWebCitationSkeleton.js"),s=require("./types.js"),r=require("./utils/citationData.utils.js"),u=require("./utils/styleOverrides.utils.js"),d=require("./utils/fixedHeight.utils.js"),g=require("./GptWebCitation.module.css.js"),c=require("../../assests/svg/NeuralNetworkIcon.js"),v=function(t){var o=t.variant,l=t.disabled,a=t.onClick,s=t.title,r=t.style;return i.jsx("button",e.__assign({type:"button",className:g.default.webCitationButton,onClick:a,disabled:l,title:s,style:r},{children:"gpt"===o?i.jsxs(i.Fragment,{children:[i.jsx(c.default,{className:g.default.webCitationButtonIcon}),"View GPT Citation"]}):i.jsxs(i.Fragment,{children:[i.jsx(n.Globe,{size:24,className:g.default.webCitationButtonIcon}),"View Web Citation"]})}))};exports.default=function(c){var p,C,b,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),o=require("../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),l=require("./GptWebCitationImageCitation.js"),a=require("./GptWebCitationSkeleton.js"),s=require("./types.js"),r=require("./utils/citationData.utils.js"),u=require("./utils/styleOverrides.utils.js"),d=require("./utils/fixedHeight.utils.js"),g=require("./GptWebCitation.module.css.js"),c=require("../../assests/svg/NeuralNetworkIcon.js"),v=function(t){var o=t.variant,l=t.disabled,a=t.onClick,s=t.title,r=t.style;return i.jsx("button",e.__assign({type:"button",className:g.default.webCitationButton,onClick:a,disabled:l,title:s,style:r},{children:"gpt"===o?i.jsxs(i.Fragment,{children:[i.jsx(c.default,{className:g.default.webCitationButtonIcon}),"View GPT Citation"]}):i.jsxs(i.Fragment,{children:[i.jsx(n.Globe,{size:24,className:g.default.webCitationButtonIcon}),"View Web Citation"]})}))};exports.default=function(c){var p,_,C,b,w=c.gptCitation,f=c.defaultCitationUrl,m=c.citationType,x=c.webCitationData,h=c.topic,y=c.sourceLabel,k=c.relevanceScore,j=c.learnedFrom,F=c.webCitationStatus,S=c.onGenerateWebCitation,H=c.showWebCitation,I=c.onToggleCitationView,B=c.showExpandImageButton,L=void 0===B||B,W=c.onFullscreenChange,T=c.showGptMaximizeButton,N=c.iconsConfig,V=c.isFixedHeight,M=void 0!==V&&V,q=c.useParentHeight,E=void 0!==q&&q,G=c.styles,P=t.useMemo(function(){return function(i){var t,n,o,l,a,s,r,d,g,c,v;return{container:null==i?void 0:i.container,gptWrapper:e.__assign(e.__assign({},null===(t=null==i?void 0:i.gptCitation)||void 0===t?void 0:t.wrapper),null==i?void 0:i.gptCitationWrapper),gptFooterAction:e.__assign(e.__assign({},null===(n=null==i?void 0:i.gptCitation)||void 0===n?void 0:n.footerAction),null==i?void 0:i.footerAction),gptToggleButton:e.__assign(e.__assign({},null===(o=null==i?void 0:i.gptCitation)||void 0===o?void 0:o.toggleButton),null==i?void 0:i.webCitationButton),webPanel:e.__assign(e.__assign({},null==i?void 0:i.container),null===(l=null==i?void 0:i.webCitation)||void 0===l?void 0:l.panel),webHeader:null===(a=null==i?void 0:i.webCitation)||void 0===a?void 0:a.header,webContent:null===(s=null==i?void 0:i.webCitation)||void 0===s?void 0:s.content,webFooter:null===(r=null==i?void 0:i.webCitation)||void 0===r?void 0:r.footer,webToggleButton:e.__assign(e.__assign({},null===(d=null==i?void 0:i.webCitation)||void 0===d?void 0:d.toggleButton),null==i?void 0:i.webCitationButton),webLearnedFrom:null===(g=null==i?void 0:i.webCitation)||void 0===g?void 0:g.learnedFrom,webImage:null===(c=null==i?void 0:i.webCitation)||void 0===c?void 0:c.image,webSkeleton:null===(v=null==i?void 0:i.webCitation)||void 0===v?void 0:v.skeleton,webImageVisitLink:u.resolveWebCitationVisitLinkStyles(null==i?void 0:i.webCitation,"image"),webSkeletonVisitLink:u.resolveWebCitationVisitLinkStyles(null==i?void 0:i.webCitation,"skeleton")}}(G)},[G]),z=s.allowsGptCitationView(m),U=s.allowsWebCitationView(m),A=s.showsCitationViewToggle(m),D=M||E,O=t.useMemo(function(){return M?d.resolveFixedHeightLayout(w.bodyHeight,A):null},[M,w.bodyHeight,A]),R=t.useMemo(function(){return O?d.getFixedPanelStyle(O.panelHeight):void 0},[O]),J=t.useMemo(function(){return E?d.getParentHeightPanelStyle():void 0},[E]),K=null!=J?J:R,Q=t.useMemo(function(){var e,i;return{MaximizeIcon:null!==(e=null==N?void 0:N.MaximizeIcon)&&void 0!==e?e:null===(i=w.iconsConfig)||void 0===i?void 0:i.MaximizeIcon,ExternalLinkIcon:null==N?void 0:N.ExternalLinkIcon}},[N,null===(p=w.iconsConfig)||void 0===p?void 0:p.MaximizeIcon]),X=t.useMemo(function(){var i=E?{bodyHeight:d.getParentHeightGptBodyHeight(A)}:M&&O?{bodyHeight:O.gptBodyHeight}:{};return e.__assign(e.__assign(e.__assign(e.__assign({},w),i),{disableMaximize:void 0!==T?!T:w.disableMaximize}),A||m===s.CitationType.WEB?{DocumentTitle:void 0,previewCallback:void 0}:{})},[w,T,A,m,E,M,O]),Y=t.useState(m!==s.CitationType.GPT),Z=Y[0],$=Y[1],ee=m!==s.CitationType.GPT&&(m===s.CitationType.WEB||(null!=H?H:Z)),ie=void 0!==H,te=t.useMemo(function(){return x?r.mapCitationDataToDisplay(x):null},[x]),ne=null!==(_=null!=h?h:null==te?void 0:te.topic)&&void 0!==_?_:"Web Citation",oe=null!==(C=null!=k?k:null==te?void 0:te.relevanceScore)&&void 0!==C?C:0,le=null!=j?j:null==te?void 0:te.learnedFrom,ae=r.resolveSkeletonVisitUrl(null==te?void 0:te.highlightedUrl,null!==(b=null==te?void 0:te.citationUrl)&&void 0!==b?b:f),se=r.getWebCitationImageUrl(x),re=t.useMemo(function(){return function(e,i,t){return t?"success":e||(i?"error":"pending")}(F,x,se)},[F,x,se]),ue=t.useCallback(function(){I?I():ie||$(!1)},[I,ie]),de=t.useCallback(function(){I?I():ie||$(!0),se||"success"===re||null==S||S()},[I,ie,se,re,S]),ge=null!=y?y:"Source: Web Citation > ".concat(ne),ce=function(t){var n=!!X.DocumentTitle,l=[g.default.gptCitationWrapper,n?g.default.gptCitationWrapperWithSource:"",D?g.default.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" ");return i.jsxs("div",e.__assign({className:l,style:e.__assign(e.__assign({},P.gptWrapper),K)},{children:[i.jsx(o.default,e.__assign({},X,{splitterCustomStyle:!0,onFullscreenChange:W})),t&&(n?i.jsx("div",e.__assign({className:g.default.gptCitationFooterAction,style:P.gptFooterAction},{children:t})):i.jsx("div",e.__assign({className:[g.default.gptCitationToggleFooter,D?g.default.gptCitationToggleFooterFixedHeight:""].filter(Boolean).join(" "),style:P.gptFooterAction},{children:t})))]}))};return z&&!ee?i.jsx("div",e.__assign({className:g.default.overlay,style:e.__assign(e.__assign({},P.container),J)},{children:ce(A?i.jsx(v,{variant:"web",onClick:de,title:"View web-based citation for this source.",style:P.gptToggleButton}):void 0)})):U?i.jsxs("div",e.__assign({className:[g.default.panel,D?g.default.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:e.__assign(e.__assign({},P.webPanel),K)},{children:[i.jsxs("div",e.__assign({className:g.default.panelHeader,style:P.webHeader},{children:[i.jsx("span",e.__assign({className:g.default.panelSource},{children:ge})),i.jsx("div",e.__assign({className:g.default.panelHeaderActions},{children:oe>0&&i.jsxs("div",e.__assign({className:g.default.confidenceBadge,title:"Decision strength"},{children:[i.jsx(n.Sparkles,{size:14}),oe,"%"]}))}))]})),i.jsx("div",e.__assign({className:[g.default.panelContent,g.default.panelContentExpanded,D?g.default.panelContentFixedHeight:""].filter(Boolean).join(" "),style:e.__assign(e.__assign({},P.webContent),D?d.getFixedWebContentStyle():void 0)},{children:"pending"===re?i.jsx(a.default,{status:"pending",citationUrl:ae,ExternalLinkIcon:Q.ExternalLinkIcon,styles:P.webSkeleton,visitLinkStyles:P.webSkeletonVisitLink,isFixedHeight:D}):"success"===re&&se?i.jsx(l.default,{citationImage:se,citationUrl:ae,showExpandImageButton:L,iconsConfig:Q,styles:P.webImage,visitLinkStyles:P.webImageVisitLink,skeletonStyles:P.webSkeleton,skeletonVisitLinkStyles:P.webSkeletonVisitLink,isFixedHeight:D,onFullscreenChange:W}):i.jsx(a.default,{status:"error",citationUrl:ae,ExternalLinkIcon:Q.ExternalLinkIcon,styles:P.webSkeleton,visitLinkStyles:P.webSkeletonVisitLink,isFixedHeight:D})})),i.jsxs("div",e.__assign({className:g.default.panelFooter,style:P.webFooter},{children:[A?i.jsx(v,{variant:"gpt",onClick:ue,style:P.webToggleButton}):null,le&&i.jsxs("span",e.__assign({className:g.default.learnedFrom,style:P.webLearnedFrom},{children:["Learned From ",le]}))]}))]})):i.jsx("div",e.__assign({className:g.default.overlay,style:e.__assign(e.__assign({},P.container),J)},{children:ce()}))};
|
|
2
2
|
//# sourceMappingURL=GptWebCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),l=require("./GptWebCitationImageFullScreenView.js"),a=require("./GptWebCitationSkeleton.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),l=require("./GptWebCitationImageFullScreenView.js"),a=require("./GptWebCitationSkeleton.js"),r=require("./utils/citationData.utils.js"),s=require("./GptWebCitation.module.css.js");exports.default=function(o){var u,d,c=o.citationImage,f=o.citationUrl,g=o.skeletonVisitUrl,v=o.showExpandImageButton,x=void 0===v||v,m=o.iconsConfig,p=o.styles,j=o.visitLinkStyles,C=o.skeletonStyles,h=o.skeletonVisitLinkStyles,k=o.isFixedHeight,_=void 0!==k&&k,y=o.onFullscreenChange,b=null!==(u=null==m?void 0:m.MaximizeIcon)&&void 0!==u?u:n.Maximize2,w=null!==(d=null==m?void 0:m.ExternalLinkIcon)&&void 0!==d?d:n.ExternalLink,I=t.useState(!1),L=I[0],S=I[1],E=t.useState("loading"),N=E[0],q=E[1],B=t.useRef(!1);t.useEffect(function(){var e=!0;B.current&&(B.current=!1,null==y||y(!1)),q("loading"),S(!1);var i=new Image;return i.onload=function(){e&&q("loaded")},i.onerror=function(){e&&q("error")},i.src=c,function(){e=!1,i.onload=null,i.onerror=null}},[c,y]),t.useEffect(function(){return function(){B.current&&(B.current=!1,null==y||y(!1))}},[y]);var F="loaded"===N,H=r.sanitizeExternalUrl(f);return i.jsxs("div",e.__assign({className:[s.default.imageCitationWrapper,_?s.default.imageCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.wrapper},{children:[i.jsx("div",e.__assign({className:[s.default.imageCitationCenter,_?s.default.imageCitationCenterFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.center},{children:F?i.jsxs("div",e.__assign({className:[s.default.imageCitationViewport,_?s.default.imageCitationViewportFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.viewport},{children:[i.jsx("div",e.__assign({className:[s.default.imageCitationScrollContainer,_?s.default.imageCitationScrollContainerFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.scrollContainer},{children:i.jsx("img",{src:c,alt:"Web citation snapshot",className:[s.default.citationImage,_?s.default.citationImageContained:""].filter(Boolean).join(" "),style:null==p?void 0:p.image})})),x&&i.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),B.current=!0,null==y||y(!0),S(!0)},className:s.default.expandImageButton,style:null==p?void 0:p.expandButton,"aria-label":"View citation image in full screen",title:"Expand image"},{children:i.jsx(b,{size:16,strokeWidth:2})}))]})):i.jsx(a.default,{status:"error"===N?"error":"pending",citationUrl:null!=g?g:f,ExternalLinkIcon:null==m?void 0:m.ExternalLinkIcon,styles:C,visitLinkStyles:h,isFixedHeight:_})})),H&&F&&i.jsxs("div",e.__assign({className:s.default.visitLinkRow,style:null==j?void 0:j.row},{children:[i.jsx("span",e.__assign({className:s.default.visitLinkHint,style:null==j?void 0:j.hint},{children:"Open link in new tab to read in detail"})),i.jsxs("a",e.__assign({href:H,target:"_blank",rel:"noreferrer",className:s.default.visitLink,style:null==j?void 0:j.link},{children:["Visit Link",i.jsx(w,{size:16})]}))]})),L&&F&&i.jsx(l.default,{src:c,onClose:function(){B.current=!1,null==y||y(!1),S(!1)},styles:null==p?void 0:p.fullScreen})]}))};
|
|
2
2
|
//# sourceMappingURL=GptWebCitationImageCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="520px",t="3.25rem";exports.getFixedPanelStyle=function(e){return{height:e,minHeight:e,maxHeight:e,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"}},exports.getFixedWebContentStyle=function(){return{flex:1,minHeight:0,maxHeight:"none",overflow:"hidden",display:"flex",flexDirection:"column"}},exports.resolveFixedHeightLayout=function(n
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="520px",t="3.25rem";exports.getFixedPanelStyle=function(e){return{height:e,minHeight:e,maxHeight:e,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"}},exports.getFixedWebContentStyle=function(){return{flex:1,minHeight:0,maxHeight:"none",overflow:"hidden",display:"flex",flexDirection:"column"}},exports.getParentHeightGptBodyHeight=function(e){return void 0===e&&(e=!0),e?"calc(100% - ".concat(t,")"):"100%"},exports.getParentHeightPanelStyle=function(){return{height:"100%",minHeight:0,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"}},exports.resolveFixedHeightLayout=function(i,n){if(void 0===n&&(n=!0),!n){var o=null!=i?i:e;return{contentHeight:o,gptBodyHeight:o,panelHeight:o}}if(i)return{contentHeight:i,gptBodyHeight:i,panelHeight:"calc(".concat(i," + ").concat(t,")")};var r="calc(".concat(e," - ").concat(t,")");return{contentHeight:r,gptBodyHeight:r,panelHeight:e}};
|
|
2
2
|
//# sourceMappingURL=fixedHeight.utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("./PdfStyle.js"),o=require("../../assests/svg/PdfViewerIcons.js"),r=require("@mui/material/Tooltip"),s=require("lucide-react"),l=require("@mui/icons-material/RotateRight");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(t),c=a(r),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("./PdfStyle.js"),o=require("../../assests/svg/PdfViewerIcons.js"),r=require("@mui/material/Tooltip"),s=require("lucide-react"),l=require("@mui/icons-material/RotateRight");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(t),c=a(r),p=a(l);exports.default=function(t){t.highlightIndex;var r=t.totalHighlights,l=t.controls,a=t.currentPosition,g=t.pdfName,u=t.onClose,x=t.pdfUrl,h=t.viewerRef,f=t.customStyles,_=t.customClasses,v=t.customIcons,m=t.headerAction,y=t.isZoomEnabled,j=void 0===y||y,b=t.showHighlightsAction,w=void 0===b||b,S=t.showFullScreenAction,k=void 0===S||S,I=t.currentSegment,F=t.segmentTooltipText,C=void 0===F?"Details of current segment":F,D=t.currentPage,W=t.totalPages,E=t.onPageNavigate,R=t.onRotatePage,P=t.currentPageRotation,T=void 0===P?0:P,B=t.showRotateButton,L=void 0===B||B,z=l.ZoomInButton,q=l.ZoomOutButton,A=l.ZoomPopover,N=l.goToPrevious,M=l.goToNext,H=d.default.useState(String(D)),O=H[0],Z=H[1];d.default.useEffect(function(){Z(String(D))},[D]);var G={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},V=function(e){return String(e).padStart(2,"0")};return n.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},i.pdfStyles.header),null==f?void 0:f.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",columnGap:"16px",rowGap:"12px",minWidth:0}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flex:"1 1 180px",minWidth:0}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==f?void 0:f.pdfIconWrapper),{flexShrink:0})},{children:(null==v?void 0:v.pdfIcon)||n.jsx(o.DefaultPdfIcon,{})})),n.jsx(c.default,e.__assign({title:g||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n.jsx("span",e.__assign({style:e.__assign({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==f?void 0:f.pdfName),className:null==_?void 0:_.pdfName},{children:g}))}))}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:w?"16px":"2px",color:"#4B5563",flex:"0 1 auto",marginLeft:"auto",whiteSpace:"nowrap",minWidth:0,maxWidth:"100%",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"}},{children:[W>0&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n.jsx("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:O,onChange:function(e){var n=e.target.value.replace(/\D/g,"");Z(n)},onBlur:function(){var e=Number(O);if(!Number.isInteger(e)||e<1)Z(String(D));else{var n=W?Math.min(e,W):e;E(n),Z(String(n))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(Z(String(D)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(W)}))]})),j&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(q,{}),n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n.jsx(A,{})})),n.jsx(z,{})]})),L&&R&&W>0&&n.jsx(c.default,e.__assign({title:"Rotate page (".concat(T,"°)")},{children:n.jsx("button",e.__assign({onClick:function(){R&&"function"==typeof R&&R()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",color:0!==T?"#1976d2":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px",transition:"color 0.2s ease"},onMouseEnter:function(e){e.currentTarget&&(e.currentTarget.style.color="#1976d2")},onMouseLeave:function(e){e.currentTarget&&(e.currentTarget.style.color=0!==T?"#1976d2":"#475467")},"aria-label":"Rotate current page"},{children:n.jsx(p.default,{sx:{fontSize:"18px"}})}))})),!!r&&w&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("span",e.__assign({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[a," of ",r]})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:a<=1?"not-allowed":"pointer",padding:"2px 4px",color:a<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:N,disabled:a<=1},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:a===r?"not-allowed":"pointer",padding:"2px 4px",color:a===r?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:M,disabled:a===r},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n.jsx("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==k&&((null==m?void 0:m.icon)&&(null==m?void 0:m.onClick)?n.jsx(c.default,e.__assign({title:(null==m?void 0:m.tooltip)||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({onClick:m.onClick,style:e.__assign({display:"flex",alignItems:"center",cursor:"pointer"},G)},{children:m.icon}))})):n.jsx("button",e.__assign({onClick:function(){var e=null==h?void 0:h.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:G,title:"Full Screen"},{children:(null==v?void 0:v.fullScreenIcon)||n.jsx(o.DefaultFullScreenIcon,{})}))),x&&n.jsx("a",e.__assign({href:x,target:"_blank",rel:"noopener noreferrer",style:G,title:"Open in new tab"},{children:(null==v?void 0:v.downloadIcon)||n.jsx(o.DefaultDownloadIcon,{})})),u&&n.jsx("button",e.__assign({onClick:u,style:G,title:"Close"},{children:(null==v?void 0:v.closeIcon)||n.jsx(o.DefaultCloseIcon,{})}))]}))]}))]})),I&&n.jsxs("div",e.__assign({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n.jsx(c.default,e.__assign({title:C,arrow:!0,placement:"top"},{children:n.jsx(s.Info,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n.jsx("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:n.jsx(c.default,e.__assign({title:I.title,arrow:!0,placement:"top"},{children:n.jsxs("span",{children:["Viewing ",I.title," • Pages ",V(I.start_page),"-",V(I.end_page)]})}))}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@react-pdf-viewer/core"),r=require("./PdfContainer.js"),i=require("./PdfToolbar.js"),o=require("./PdfStyle.js"),a=require("./usePdfHighlight.js"),u=require("./rotationManager.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var l=require("react"),s=require("../ScannedDocCitation/ScannedDocCitation.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(l);exports.default=function(c){var g=c.pdfUrl,f=c.highlightText,v=c.highlightPages,h=c.highlightCordinatePages,p=c.highlightColor,m=void 0===p?"yellow":p,_=c.activeHighlightColor,y=void 0===_?"#f7dc51":_,w=c.jumpToPageValue,x=void 0===w?0:w,P=c.pdfName,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@react-pdf-viewer/core"),r=require("./PdfContainer.js"),i=require("./PdfToolbar.js"),o=require("./PdfStyle.js"),a=require("./usePdfHighlight.js"),u=require("./rotationManager.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var l=require("react"),s=require("../ScannedDocCitation/ScannedDocCitation.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(l);exports.default=function(c){var g=c.pdfUrl,f=c.highlightText,v=c.highlightPages,h=c.highlightCordinatePages,p=c.highlightColor,m=void 0===p?"yellow":p,_=c.activeHighlightColor,y=void 0===_?"#f7dc51":_,w=c.jumpToPageValue,x=void 0===w?0:w,P=c.pdfName,S=c.onClose,b=c.customStyles,T=c.customClasses,C=c.customIcons,q=c.useCoordinates,R=c.fallbackPages,A=c.activeCitationIndex,L=c.onActiveCitationChange,M=c.headerAction,j=c.isZoomEnabled,I=void 0===j||j,E=c.showHighlightsAction,H=void 0===E||E,N=c.defaultScale,F=void 0===N?n.SpecialZoomLevel.ActualSize:N,B=c.useRange,Z=void 0!==B&&B,D=c.rangeOfPages,O=void 0===D?null:D,V=c.showFullScreenAction,W=void 0===V||V,z=c.showRotateButton,U=void 0!==z&&z,k=c.segments,J=void 0===k?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:k,K=c.segmentTooltipText,G=c.onCurrentPageChange,Q=c.navigationRequest,X=c.onNavigationSettled,Y=c.disablePdfAnnotations,$=void 0!==Y&&Y,ee=c.disablePdfTextLayer,te=void 0!==ee&&ee,ne=c.renderPage,re=c.setRenderRange,ie=l.useRef(null),oe=function(e){switch(e){case"ActualSize":return n.SpecialZoomLevel.ActualSize;case"PageFit":return n.SpecialZoomLevel.PageFit;case"PageWidth":return n.SpecialZoomLevel.PageWidth;default:return null!=e?e:n.SpecialZoomLevel.PageWidth}}(F),ae=l.useState(0),ue=ae[0],le=ae[1],se=l.useState(0),ce=se[0],de=se[1],ge=l.useState(0),fe=ge[0],ve=ge[1],he=l.useRef(null),pe=l.useRef(null),me=l.useRef(0),_e=l.useRef(null),ye=l.useMemo(function(){if(!g)return"";try{return new URL(g,window.location.origin).pathname.split("/").pop()||"default"}catch(e){return"default"}},[g]);l.useEffect(function(){ye&&u.rotationManager.setPdfIdentifier(ye)},[ye]);l.useEffect(function(){return u.rotationManager.onRotationChange(function(e,t){e===ue+1&&ve(t)})},[ue]),l.useEffect(function(){var e=new MutationObserver(function(){var e,t=null===(e=ie.current)||void 0===e?void 0:e.querySelectorAll('[data-testid^="core__page-layer-"]'),n=new Set;null==t||t.forEach(function(e){var t,r=null===(t=e.getAttribute("data-testid"))||void 0===t?void 0:t.match(/core__page-layer-(\d+)/);if(r&&r.length>=2){var i=parseInt(r[1],10)+1;n.has(i)||(u.rotationManager.registerPageElement(i,e),n.add(i))}})});return ie.current&&(e.observe(ie.current,{childList:!0,subtree:!0,attributes:!1}),_e.current=e),function(){e.disconnect(),_e.current=null}},[]),l.useEffect(function(){return function(){u.rotationManager.clearAll(),_e.current&&_e.current.disconnect()}},[]),l.useEffect(function(){var e=ue+1;ve(u.rotationManager.getRotation(e))},[ue]);var we,xe=l.useMemo(function(){return $||te?function(n){var r=te?t.jsx("div",e.__assign({"aria-hidden":"true",style:{display:"none"}},{children:n.textLayer.children})):n.textLayer.children,i=e.__assign(e.__assign({},n),{annotationLayer:e.__assign(e.__assign({},n.annotationLayer),{children:$?null:n.annotationLayer.children}),textLayer:e.__assign(e.__assign({},n.textLayer),{children:r})});return ne?ne(i):t.jsxs(t.Fragment,{children:[n.canvasLayer.children,r,!$&&n.annotationLayer.children]})}:ne},[$,te,ne]),Pe=l.useMemo(function(){if(q)return new Set(h.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(v).forEach(function(t){t>0&&e.add(t-1)}),e},[h,v,q]),Se=(we=f)&&0!==we.length?we.filter(function(e){return!we.some(function(t){return t!==e&&t.includes(e)})}):we,be=a.PdfHighlightControls(Se,q?{}:v,ie,Pe,q,q?h:[],m,y),Te=be.highlightIndex,Ce=be.cursorIndex,qe=be.setCursorIndex,Re=be.orderedKeys,Ae=be.totalHighlights,Le=be.getValidPosition,Me=be.tryJump,je=be.jumpToPage,Ie=be.plugins,Ee=be.controls,He=be.hideNonTargetHighlights,Ne=be.deduplicateHighlights,Fe=Le(Ce),Be=l.useMemo(function(){var e=ue+1;return J.find(function(t){return e>=t.start_page&&e<=t.end_page})},[ue,J]);l.useEffect(function(){void 0!==A&&A!==Ce&&qe(A)},[A]);var Ze=e.__assign(e.__assign({},Ee),{goToNext:function(){Ce>=Ae-1||(Ee.goToNext(),L&&L(Ce+1))},goToPrevious:function(){Ce<=0||(Ee.goToPrevious(),L&&L(Ce-1))}}),De=d.default.useCallback(function(e,t){me.current+=1;var n=me.current;null!=pe.current&&window.clearTimeout(pe.current);var r=null,i=0,o=0,a=function(){var u,l;if(me.current===n){o+=1;var s=null===(u=ie.current)||void 0===u?void 0:u.querySelector(".rpv-core__inner-pages"),c=null===(l=ie.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(t-1,'"]'));if(!s||!c)return o>=40?(pe.current=null,void(null==X||X({pageNumber:t,requestId:e.requestId}))):void(pe.current=window.setTimeout(a,50));r===s.scrollTop?i+=1:(r=s.scrollTop,i=0);var d=s.getBoundingClientRect(),g=c.getBoundingClientRect(),f=Boolean(d&&g&&g.bottom>d.top&&g.top<d.bottom);if(i>=2&&f||o>=40)return pe.current=null,void(null==X||X({pageNumber:t,requestId:e.requestId}));pe.current=window.setTimeout(a,50)}};pe.current=window.setTimeout(a,50)},[X]);if(l.useEffect(function(){return function(){me.current+=1,null!=pe.current&&window.clearTimeout(pe.current)}},[]),l.useEffect(function(){var e;if(Q&&!(ce<=0)){var t=Math.min(Math.max(Math.trunc(Q.pageNumber),1),ce),n="".concat(null!==(e=Q.requestId)&&void 0!==e?e:t,":").concat(t);he.current!==n&&(he.current=n,le(t-1),je(t-1),De(Q,t))}},[je,Q,ce,De]),!g)return t.jsx(s.default,{pages:R,activeCitationIndex:A,onActiveCitationChange:L,headerAction:M});return t.jsxs("div",e.__assign({ref:ie,className:(null==T?void 0:T.pdfViewerWrapper)||"","data-disable-pdf-annotations":$?"true":void 0,"data-pdf-page-fit":oe===n.SpecialZoomLevel.PageFit?"true":void 0,style:e.__assign(e.__assign(e.__assign({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},o.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==b?void 0:b.pdfViewer)},{children:[t.jsx(i.default,{highlightIndex:Te,totalHighlights:Ae,controls:Ze,currentPosition:Fe,pdfName:P,onClose:S,pdfUrl:g,viewerRef:ie,customStyles:b,customClasses:T,customIcons:C,headerAction:M,isZoomEnabled:I,showHighlightsAction:H,showFullScreenAction:W,currentSegment:Be,segmentTooltipText:K,currentPage:ue+1,totalPages:ce,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),ce||e);le(t-1),je(t-1)},onRotatePage:function(){var e=ue+1;u.rotationManager.rotatePageBy90(e),ve(u.rotationManager.getRotation(e))},currentPageRotation:fe,showRotateButton:U}),t.jsx(r.default,{defaultScale:oe,pdfUrl:g,plugins:Ie,customStyles:b,onLoad:function(t){de(t.doc.numPages);var n=!q&&!Z&&x<=0;if(x>0&&!Z){var r=x-1,i=Re[r],o=v[i],a=h[r];qe(r),console.log(a,"cordinateTargetHighlight"),q&&a.pageIndex>0&&je(a.pageIndex),o>0&&(setTimeout(function(){He(Pe),Ne(o-1)},1e3),q||je(o-1))}else if(Z&&O&&2===O.length){e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,i,o;return e.__generator(this,function(e){switch(e.label){case 0:t=O[0],n=O[1],r=t,e.label=1;case 1:return r<=n?(je(i=r-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(e.sent(),He(Pe),(o=Ne(i))&&o>0)return[3,4];e.label=3;case 3:return r++,[3,1];case 4:return[2]}})})}else if(!q&&v){var u=Re.find(function(e){return v[e]>0});if(void 0!==u){var l=v[u]-1;je(l),setTimeout(function(){He(Pe),Ne(l)},1e3)}}requestAnimationFrame(function(){n&&Me(),!q&&x>0&&!Z&&function(){if(ie.current){var e=x-1,t=Re[e],n=v[t],r=n>0?n-1:0,i={};Re.forEach(function(e,t){var n=v[e];n>0&&(i[n]||(i[n]=[]),i[n].push(t))});var o=(i[n]||[]).indexOf(e),a=0,u=function(){var e,t;if(!(++a>40)){var n=null===(e=ie.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(n){var i=null===(t=ie.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(r,'"]'));if(i){var l=n.getBoundingClientRect(),s=i.getBoundingClientRect();if(s.top<l.bottom&&s.bottom>l.top){var c=i.querySelectorAll(".rpv-search__highlight")[o];if(c){var d=c.getBoundingClientRect(),g=n.scrollTop+(d.top-l.top)-n.clientHeight/2+d.height/2;n.scrollTo({top:g,behavior:"smooth"})}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}};setTimeout(u,500)}}()})},onPageChange:function(e){var t=e.currentPage;le(t),null==G||G(t+1),Pe.has(t)?(Ne(t),He(Pe)):He(Pe)},renderPage:xe,setRenderRange:re})]}))};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),n=require("@react-pdf-viewer/search"),i=require("@react-pdf-viewer/page-navigation"),o=require("@react-pdf-viewer/zoom"),a=require("@react-pdf-viewer/highlight");exports.PdfHighlightControls=function(l,u,c,h,g,s,f,p){void 0===f&&(f="yellow"),void 0===p&&(p="#F6D739");var d=r.useState(0),v=d[0],m=d[1],x=r.useRef(!1),y=r.useState(0),_=y[0],T=y[1];r.useRef([]);var M=function(e){return e.replace(/[^\S\n]+/g," ").trim()},b=function(e){return(e||"").toLowerCase().replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/-/g," ").replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},w=function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t},I=function(e){var t=b(e),r=t.replace(/\s+/g,""),n=new Set;return t&&n.add(t),r&&n.add(r),n},S=function(e){return e.replace(/\\([''])/g,"$1").replace(/\]\s*\n\s*\(/g,"](").replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/`([^`]+)`/g,"$1")},A=function(e){return e?S(e).split(/\n+/).map(w).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return M(function(e){return e.replace(/(^|\W)[*_]{1,3}([^*_]+)[*_]{1,3}(?=\W|$)/g,"$1$2")}(e))}).filter(Boolean):[]},q=Object.keys(u).map(Number).sort(function(e,t){return e-t}),E=r.useMemo(function(){return g?s.length:g?0:Object.values(u).filter(function(e){return e>0}).length},[s,u]),B=function(t){if(c.current){var r=c.current.querySelector('[data-testid="search__highlights-'.concat(t,'"]'));if(r){var n=Array.from(r.querySelectorAll(".rpv-search__highlight"));if(0!==n.length){var i=C.map(I),o=P.map(I);if(0!==i.length||0!==o.length){var a=n.map(function(t){var r=function(e){var t=e.getBoundingClientRect();if(t.height>0||t.width>0)return{top:t.top,left:t.left,right:t.right};var r=e.offsetTop,n=e.offsetLeft;return{top:r,left:n,right:n+e.offsetWidth}}(t),n=(t.textContent||"").trim(),i=(t.getAttribute("title")||"").trim(),o=n||i;return e.__assign({el:t,text:o},r)}).filter(function(e){return e.text.length>0}).sort(function(e,t){return e.top-t.top||e.left-t.left});if(0!==a.length){var u=[],h=null,g=[],s=function(){if(h){var e=g.join(" ");h.title=b(e),h.title&&u.push(h),h=null,g=[]}};if(a.forEach(function(e){if(!h)return h={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},void(g=[e.text]);var t=Math.abs(e.top-h.lastTop)<=5,r=e.left<=h.lastRight+28;t&&r?(h.elements.push(e.el),h.lastTop=e.top,h.lastRight=Math.max(h.lastRight,e.right),g.push(e.text)):(s(),h={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},g=[e.text])}),s(),0!==u.length){for(var f=function(e,t){if(!e)return!1;if(t.has(e))return!0;for(var r=e.replace(/\s+/g,""),n=0,i=Array.from(t);n<i.length;n++){var o=i[n];if(o){var a=o.replace(/\s+/g,"");if(a===r)return!0;if(o.length>=8&&e.length>=5&&o.includes(e))return!0;if(a.length>=8&&r.length>=5&&a.includes(r))return!0;if(e.length>=10&&o.length>=8&&e.includes(o))return!0;if(r.length>=10&&a.length>=8&&r.includes(a))return!0}}return!1},p=0,d=new Set,v=function(e){if(!e||e.length<8)return null;for(var t=e.replace(/\s+/g,""),r=0;r<u.length;r++)for(var n="",i="",o=new Set,a=r;a<u.length&&a<r+20;a++){var l=u[a].title;if(n=n?"".concat(n," ").concat(l):l,i=i?"".concat(i).concat(l.replace(/\s+/g,"")):l.replace(/\s+/g,""),o.add(a),n.includes(e)||i.includes(t))return o;if(n.length>=15&&(e.includes(n)||t.includes(i)))return o;if(n.length>e.length+150)break}return null},m=0,x=Array.from(new Set(e.__spreadArray(e.__spreadArray([],C,!0),P,!0).map(b).filter(function(e){return e.length>=8}))).sort(function(e,t){return t.length-e.length});m<x.length;m++){var y=v(x[m]);y&&y.size>0&&(y.forEach(function(e){return d.add(e)}),p=d.size)}if(0===p){var _=function(e){if(0===e.length)return null;for(var t=null,r=0,n=e;r<n.length;r++)for(var i=n[r],o=0,a=Array.from(i);o<a.length;o++){var l=a[o];if(l&&!(l.length<5))for(var c=l.replace(/\s+/g,""),h=0;h<u.length;h++)for(var g="",s="",f=new Set,p=h;p<u.length&&p<h+15;p++){var d=u[p].title;if(g=g?"".concat(g," ").concat(d):d,s=s?"".concat(s).concat(d.replace(/\s+/g,"")):d.replace(/\s+/g,""),f.add(p),g.includes(l)||s.includes(c)){var v=Math.max(0,g.length-l.length);(!t||v<t.extra)&&(t={blocks:new Set(f),extra:v});break}if(g.length>l.length+120)break}}return t?t.blocks:null}(i);_&&_.size>0&&(_.forEach(function(e){return d.add(e)}),p=d.size)}var T=function(e){if(e.length<2)return 40;for(var t=[],r=1;r<e.length;r++){var n=Math.abs(e[r].lastTop-e[r-1].lastTop);n>0&&t.push(n)}if(0===t.length)return 40;t.sort(function(e,t){return e-t});var i=t[Math.floor(t.length/2)],o=Math.round(2.25*i);return Math.min(60,Math.max(24,o))}(u),M=P.map(b).filter(function(e){return e.length>=8}),w=M.map(function(e){return e.split(/\s+/).filter(function(e){return e.length>=2})});if(0===p)for(var S=o,A=0;A<u.length;A++)for(var q=u[A].title,E=0;E<S.length;E++)if(f(q,S[E])){for(var B=0,j=new Set,z=E,k=A-1,R=A;R<u.length&&z<S.length;R++){if(f(u[R].title,S[z])){if(k>=0){var H=u[k].lastTop,N=u[R].lastTop;if(Math.abs(N-H)>T)break}B++,j.add(R),k=R,z++}else if(z>0&&f(u[R].title,S[z-1])){H=u[k].lastTop,N=u[R].lastTop;Math.abs(N-H)<=3&&(j.add(R),k=R)}if(R-k>6)break}B>p&&(p=B,d=j)}if(p<Math.min(3,M.length)&&M.length>0){var $=new Set;u.forEach(function(e,t){var r=e.title.split(/\s+/).filter(function(e){return e.length>=2});if(!(r.length<2))for(var n=new Set(r),i=0,o=w;i<o.length;i++){var a=o[i];if(!(a.length<2)){for(var l=0,u=0,c=a;u<c.length;u++){var h=c[u];n.has(h)&&l++}var g=l/a.length;if(l>=3||g>=.5){$.add(t);break}}}}),$.size>0&&(d=$,p=Math.max(p,$.size))}var O=new Set;if(F.forEach(function(e){var t=b(e);t&&(O.add(t),O.add(t.replace(/\s+/g,"")))}),0===p){var Z=new Set;if(u.forEach(function(e,t){var r=e.title.replace(/\s+/g,"");if(O.has(e.title)||O.has(r))Z.add(t);else for(var n=Array.from(O),i=0;i<n.length;i++){var o=n[i];if(o.length>=10&&o.includes(e.title)&&e.title.length>=5){Z.add(t);break}}}),0===Z.size)return 0;d=Z}u.forEach(function(e,t){var r=d.has(t);e.elements.forEach(function(e){r?(e.classList.add("verified-match"),e.style.display=""):(e.style.display="none",e.classList.remove("verified-match"))})});var L=[];return u.forEach(function(e,t){d.has(t)&&e.elements.forEach(function(e){return L.push(e)})}),requestAnimationFrame(function(){var e=L.map(function(e){return{el:e,rect:e.getBoundingClientRect()}}).filter(function(e){return e.rect.width>0&&e.rect.height>0}).sort(function(e,t){return t.rect.width*t.rect.height-e.rect.width*e.rect.height}),t=[];e.forEach(function(e){var r=e.el,n=e.rect;t.some(function(e){return t=e.rect,r=n,i=Math.max(0,Math.min(t.right,r.right)-Math.max(t.left,r.left))*Math.max(0,Math.min(t.bottom,r.bottom)-Math.max(t.top,r.top)),((o=Math.min(t.width*t.height,r.width*r.height))>0?i/o:0)>.5;var t,r,i,o})?(r.style.display="none",r.classList.remove("verified-match")):t.push({el:r,rect:n})})}),console.groupCollapsed("[debug: PDF ordered matching - Page ".concat(t,"]")),console.log("input->",l),console.log("processed sentences->",C),console.log("processed lines->",P),console.log("Expected sentence count:",i.length),console.log("Expected line count:",o.length),console.log("Matched sequence length:",p),console.log("blocksToKeep",d,"size",d.size),console.groupEnd(),d.size}}}}}}},j=function(e){c.current&&c.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),i=t.querySelectorAll(".rpv-search__highlight");e.has(n)||i.forEach(function(e){e.style.display="none"})})},z=l.map(function(e){return function(e){return e?S(e).split(/\n{2,}/).map(function(e){return A(e).join(" ")}).map(function(e){return M(e)}).filter(Boolean):[]}(e)}).flat(),k=l.map(function(e){return A(e)}).flat(),R=z.some(function(e){return e.length>=3})?3:1,C=z.filter(function(e){return e.length>=R}),P=k.filter(function(e){return e.length>=R}),H=P.flatMap(function(e){return function(e,t,r){void 0===t&&(t=6),void 0===r&&(r=4);var n=e.split(/\s+/).filter(Boolean);if(n.length<=t)return[];for(var i=[],o=0;o+t<=n.length;o+=r)i.push(n.slice(o,o+t).join(" "));return n.length>t&&(n.length-t)%r!==0&&i.push(n.slice(n.length-t).join(" ")),i}(e)}),F=Array.from(new Set(e.__spreadArray(e.__spreadArray(e.__spreadArray([],C,!0),P,!0),H,!0).flatMap(function(e){var t=M(e.replace(/[\u00A0\u2009\u202F]/g," ").replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'"));if(!t)return[];var r=t.replace(/[\u2013\u2014]/g,"-"),n=M(r.replace(/(\w)-\s+(\w)/g,"$1$2")),i=M(r.replace(/-/g," ")),o=M(r.replace(/-/g,"")),a=M(t.replace(/[^\w\s]/g,"")),l=new Set([t,r,n,i,o,a]);return Array.from(l).filter(Boolean)}))).filter(function(e){var t=e.split(/\s+/).filter(Boolean);return!(e.length<R)&&(t.length>=3||e.length>=12)}),N=n.searchPlugin({keyword:F}),$=i.pageNavigationPlugin(),O=o.zoomPlugin(),Z=N.jumpToMatch,L=$.jumpToPage,D=O.zoomTo,W=O.ZoomInButton,K=O.ZoomOutButton,J=O.ZoomPopover,V=r.useMemo(function(){return function(t){if(0===t.length)return[];var r=new Map;t.forEach(function(t,n){var i=null!=t.pageNumber?t.pageNumber-1:t.pageIndex;r.has(i)||r.set(i,[]),r.get(i).push(e.__assign(e.__assign({},t),{originalIndex:n}))});var n=[];return r.forEach(function(t){for(var r=e.__spreadArray([],t,!0).sort(function(e,t){return e.top!==t.top?e.top-t.top:e.left-t.left}),i=new Array(r.length).fill(!1),o=0;o<r.length;o++)if(!i[o]){var a=r[o],l=a.left,u=a.top,c=a.width,h=a.height,g=a.pageIndex,s=a.pageNumber,f=l+c,p=u+h,d=[r[o].originalIndex];i[o]=!0;for(var v=!0;v;){v=!1;for(var m=o+1;m<r.length;m++)if(!i[m]){var x=r[m],y=x.left+x.width,_=x.top+x.height,T=Math.max(0,Math.min(f,y)-Math.max(l,x.left))*Math.max(0,Math.min(p,_)-Math.max(u,x.top)),M=Math.max(c*h,1e-4),b=Math.max(x.width*x.height,1e-4),w=Math.min(M,b);(w>0?T/w:0)>=.8&&(l=Math.min(l,x.left),u=Math.min(u,x.top),c=(f=Math.max(f,y))-l,h=(p=Math.max(p,_))-u,d.push(x.originalIndex),i[m]=!0,v=!0)}}n.push({pageIndex:g,pageNumber:s,left:l,top:u,width:c,height:h,originalIndexes:d})}}),n}(s)},[s]),G=a.highlightPlugin({renderHighlights:function(e){return t.jsx(t.Fragment,{children:V.filter(function(t){return null!=t.pageNumber?t.pageNumber-1===e.pageIndex:t.pageIndex===e.pageIndex}).map(function(e){var r=e.originalIndexes.includes(_);return t.jsx("div",{style:{position:"absolute",left:"".concat(e.left,"%"),top:"".concat(e.top+.08*e.height,"%"),width:"".concat(e.width,"%"),height:"".concat(.95*e.height,"%"),background:r?p:f,opacity:r?.7:.4,transition:"background 0.2s, opacity 0.2s",border:r?"1px solid ".concat("red"):"1px solid transparent"}},e.originalIndexes.join("-"))})})}}),Q=function(){if(!x.current)try{Z(0),x.current=!0;var e=s[0];e&&g&&X(e.pageIndex,e.top)}catch(e){requestAnimationFrame(Q)}},U=function(e,t){if(c.current&&c.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var i,o,a=null===(i=c.current)||void 0===i?void 0:i.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(o=c.current)||void 0===o?void 0:o.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var u=l.querySelectorAll(".rpv-search__highlight")[t];if(u){var h=a.getBoundingClientRect(),g=u.getBoundingClientRect(),s=a.scrollTop+(g.top-h.top)-a.clientHeight/2+g.height/2;a.scrollTo({top:s,behavior:"smooth"})}}}};setTimeout(n,300)}},X=function(e,t,r){if(void 0===r&&(r=0),c.current){var n=0,i=function(){var o,a;if(!(++n>60)){var l=null===(o=c.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(l){var u=null===(a=c.current)||void 0===a?void 0:a.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(u){var h=u.getBoundingClientRect();if(0!==h.height){var g=l.getBoundingClientRect(),s=t/100*h.height,f=r/100*h.height,p=h.top-g.top+s,d=p+f;if(!(p>=80&&d<=l.clientHeight-80)){var v=p<80?l.scrollTop+p-80:l.scrollTop+d-l.clientHeight+80;l.scrollTo({top:v,behavior:"smooth"})}}else setTimeout(i,100)}else setTimeout(i,100)}else setTimeout(i,100)}};setTimeout(i,100)}},Y=r.useMemo(function(){var e={};return q.forEach(function(t,r){var n=u[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[q,u]),ee=function(e){var t=u[q[e]];return(Y[t]||[]).indexOf(e)},te=function(e,t,r){if(void 0===r&&(r=0),c.current){var n=-1,i=0,o=function(){var a,l;if(!(++i>60)){var u=null===(a=c.current)||void 0===a?void 0:a.querySelector(".rpv-core__inner-pages");if(u){if(u.scrollTop!==n)return n=u.scrollTop,void setTimeout(o,100);var h=null===(l=c.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(h){var g=h.getBoundingClientRect();if(0!==g.height){var s=u.getBoundingClientRect(),f=t/100*g.height,p=r/100*g.height,d=g.top-s.top+f,v=d+p;if(!(d>=80&&v<=u.clientHeight-80)){var m=d<80?u.scrollTop+d-80:u.scrollTop+v-u.clientHeight+80;u.scrollTo({top:m,behavior:"instant"})}}else setTimeout(o,100)}else setTimeout(o,100)}else setTimeout(o,100)}};setTimeout(o,100)}};return{setHighlightIndex:m,highlightIndex:v,cursorIndex:_,setCursorIndex:T,orderedKeys:q,totalHighlights:E,getValidPosition:function(e){if(g)return e+1;if(!u)return 0;for(var t=0,r=0;r<=e;r++)u[q[r]]>0&&t++;return t},tryJump:Q,jumpToPage:L,zoomTo:D,hideNonTargetHighlights:j,deduplicateHighlights:B,scrollToCoord:X,plugins:[g?G:N,$,O],controls:{ZoomInButton:W,ZoomOutButton:K,ZoomPopover:J,zoomTo:D,goToNext:function(){if(g&&s)for(var e=_+1;e<s.length;e++){var t=s[e],r=s[_];return T(e),void(t.pageIndex!==r.pageIndex?(L(t.pageIndex),te(t.pageIndex,t.top,t.height)):X(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=q[e];if(u[t]>0){var r=u[t]-1,n=ee(e);return T(e),L(u[t]-1),U(r,n),setTimeout(function(){B(r)},500),1===Object.keys(u).length&&j(h),{value:void 0}}};for(e=_+1;e<q.length;e++){var i=n(e);if("object"==typeof i)return i.value}}},goToPrevious:function(){if(g&&s)for(var e=_-1;e>=0;e--){var t=s[e],r=s[_];return T(e),void(t.pageIndex!==r.pageIndex?(L(t.pageIndex),te(t.pageIndex,t.top,t.height)):X(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=q[e];if(u[t]>0){var r=u[t]-1,n=ee(e);return T(e),L(u[t]-1),U(r,n),setTimeout(function(){B(r)},500),1===Object.keys(u).length&&j(h),{value:void 0}}};for(e=_-1;e>=0;e--){var i=n(e);if("object"==typeof i)return i.value}}}}}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),n=require("@react-pdf-viewer/search"),i=require("@react-pdf-viewer/page-navigation"),o=require("@react-pdf-viewer/zoom"),a=require("@react-pdf-viewer/highlight");exports.PdfHighlightControls=function(l,u,c,h,g,s,f,p){void 0===f&&(f="yellow"),void 0===p&&(p="#F6D739");var d=r.useState(0),v=d[0],m=d[1],x=r.useRef(!1),y=r.useState(0),_=y[0],T=y[1];r.useRef([]);var M=function(e){return e.replace(/[^\S\n]+/g," ").trim()},b=function(e){return(e||"").toLowerCase().replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/-/g," ").replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},w=function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t},I=function(e){var t=b(e),r=t.replace(/\s+/g,""),n=new Set;return t&&n.add(t),r&&n.add(r),n},S=function(e){return e.replace(/\\([''])/g,"$1").replace(/\]\s*\n\s*\(/g,"](").replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/`([^`]+)`/g,"$1")},A=function(e){return e?S(e).split(/\n+/).map(w).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return M(function(e){return e.replace(/(^|\W)[*_]{1,3}([^*_]+)[*_]{1,3}(?=\W|$)/g,"$1$2")}(e))}).filter(Boolean):[]},q=Object.keys(u).map(Number).sort(function(e,t){return e-t}),E=r.useMemo(function(){return g?s.length:g?0:Object.values(u).filter(function(e){return e>0}).length},[s,u]),B=function(t){if(c.current){var r=c.current.querySelector('[data-testid="search__highlights-'.concat(t,'"]'));if(r){var n=Array.from(r.querySelectorAll(".rpv-search__highlight"));if(0!==n.length){var i=C.map(I),o=P.map(I);if(0!==i.length||0!==o.length){var a=n.map(function(t){var r=function(e){var t=e.getBoundingClientRect();if(t.height>0||t.width>0)return{top:t.top,left:t.left,right:t.right};var r=e.offsetTop,n=e.offsetLeft;return{top:r,left:n,right:n+e.offsetWidth}}(t),n=(t.textContent||"").trim(),i=(t.getAttribute("title")||"").trim(),o=n||i;return e.__assign({el:t,text:o},r)}).filter(function(e){return e.text.length>0}).sort(function(e,t){return e.top-t.top||e.left-t.left});if(0!==a.length){var u=[],h=null,g=[],s=function(){if(h){var e=g.join(" ");h.title=b(e),h.title&&u.push(h),h=null,g=[]}};if(a.forEach(function(e){if(!h)return h={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},void(g=[e.text]);var t=Math.abs(e.top-h.lastTop)<=5,r=e.left<=h.lastRight+28;t&&r?(h.elements.push(e.el),h.lastTop=e.top,h.lastRight=Math.max(h.lastRight,e.right),g.push(e.text)):(s(),h={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},g=[e.text])}),s(),0!==u.length){for(var f=function(e,t){if(!e)return!1;if(t.has(e))return!0;for(var r=e.replace(/\s+/g,""),n=0,i=Array.from(t);n<i.length;n++){var o=i[n];if(o){var a=o.replace(/\s+/g,"");if(a===r)return!0;if(o.length>=8&&e.length>=5&&o.includes(e))return!0;if(a.length>=8&&r.length>=5&&a.includes(r))return!0;if(e.length>=10&&o.length>=8&&e.includes(o))return!0;if(r.length>=10&&a.length>=8&&r.includes(a))return!0}}return!1},p=0,d=new Set,v=function(e){if(!e||e.length<8)return null;for(var t=e.replace(/\s+/g,""),r=0;r<u.length;r++)for(var n="",i="",o=new Set,a=r;a<u.length&&a<r+20;a++){var l=u[a].title;if(n=n?"".concat(n," ").concat(l):l,i=i?"".concat(i).concat(l.replace(/\s+/g,"")):l.replace(/\s+/g,""),o.add(a),n.includes(e)||i.includes(t))return o;if(n.length>=15&&(e.includes(n)||t.includes(i)))return o;if(n.length>e.length+150)break}return null},m=0,x=Array.from(new Set(e.__spreadArray(e.__spreadArray([],C,!0),P,!0).map(b).filter(function(e){return e.length>=8}))).sort(function(e,t){return t.length-e.length});m<x.length;m++){var y=v(x[m]);y&&y.size>0&&(y.forEach(function(e){return d.add(e)}),p=d.size)}if(0===p){var _=function(e){if(0===e.length)return null;for(var t=null,r=0,n=e;r<n.length;r++)for(var i=n[r],o=0,a=Array.from(i);o<a.length;o++){var l=a[o];if(l&&!(l.length<5))for(var c=l.replace(/\s+/g,""),h=0;h<u.length;h++)for(var g="",s="",f=new Set,p=h;p<u.length&&p<h+15;p++){var d=u[p].title;if(g=g?"".concat(g," ").concat(d):d,s=s?"".concat(s).concat(d.replace(/\s+/g,"")):d.replace(/\s+/g,""),f.add(p),g.includes(l)||s.includes(c)){var v=Math.max(0,g.length-l.length);(!t||v<t.extra)&&(t={blocks:new Set(f),extra:v});break}if(g.length>l.length+120)break}}return t?t.blocks:null}(i);_&&_.size>0&&(_.forEach(function(e){return d.add(e)}),p=d.size)}var T=function(e){if(e.length<2)return 40;for(var t=[],r=1;r<e.length;r++){var n=Math.abs(e[r].lastTop-e[r-1].lastTop);n>0&&t.push(n)}if(0===t.length)return 40;t.sort(function(e,t){return e-t});var i=t[Math.floor(t.length/2)],o=Math.round(2.25*i);return Math.min(60,Math.max(24,o))}(u),M=P.map(b).filter(function(e){return e.length>=8}),w=M.map(function(e){return e.split(/\s+/).filter(function(e){return e.length>=2})});if(0===p)for(var S=o,A=0;A<u.length;A++)for(var q=u[A].title,E=0;E<S.length;E++)if(f(q,S[E])){for(var B=0,j=new Set,k=E,z=A-1,R=A;R<u.length&&k<S.length;R++){if(f(u[R].title,S[k])){if(z>=0){var H=u[z].lastTop,N=u[R].lastTop;if(Math.abs(N-H)>T)break}B++,j.add(R),z=R,k++}else if(k>0&&f(u[R].title,S[k-1])){H=u[z].lastTop,N=u[R].lastTop;Math.abs(N-H)<=3&&(j.add(R),z=R)}if(R-z>6)break}B>p&&(p=B,d=j)}if(p<Math.min(3,M.length)&&M.length>0){var $=new Set;u.forEach(function(e,t){var r=e.title.split(/\s+/).filter(function(e){return e.length>=2});if(!(r.length<2))for(var n=new Set(r),i=0,o=w;i<o.length;i++){var a=o[i];if(!(a.length<2)){for(var l=0,u=0,c=a;u<c.length;u++){var h=c[u];n.has(h)&&l++}var g=l/a.length;if(l>=3||g>=.5){$.add(t);break}}}}),$.size>0&&(d=$,p=Math.max(p,$.size))}var O=new Set;if(F.forEach(function(e){var t=b(e);t&&(O.add(t),O.add(t.replace(/\s+/g,"")))}),0===p){var Z=new Set;if(u.forEach(function(e,t){var r=e.title.replace(/\s+/g,"");if(O.has(e.title)||O.has(r))Z.add(t);else for(var n=Array.from(O),i=0;i<n.length;i++){var o=n[i];if(o.length>=10&&o.includes(e.title)&&e.title.length>=5){Z.add(t);break}}}),0===Z.size)return 0;d=Z}u.forEach(function(e,t){var r=d.has(t);e.elements.forEach(function(e){r?(e.classList.add("verified-match"),e.style.display=""):(e.style.display="none",e.classList.remove("verified-match"))})});var L=[];return u.forEach(function(e,t){d.has(t)&&e.elements.forEach(function(e){return L.push(e)})}),requestAnimationFrame(function(){var e=L.map(function(e){return{el:e,rect:e.getBoundingClientRect()}}).filter(function(e){return e.rect.width>0&&e.rect.height>0}).sort(function(e,t){return t.rect.width*t.rect.height-e.rect.width*e.rect.height}),t=[];e.forEach(function(e){var r=e.el,n=e.rect;t.some(function(e){return t=e.rect,r=n,i=Math.max(0,Math.min(t.right,r.right)-Math.max(t.left,r.left))*Math.max(0,Math.min(t.bottom,r.bottom)-Math.max(t.top,r.top)),((o=Math.min(t.width*t.height,r.width*r.height))>0?i/o:0)>.5;var t,r,i,o})?(r.style.display="none",r.classList.remove("verified-match")):t.push({el:r,rect:n})})}),console.groupCollapsed("[debug: PDF ordered matching - Page ".concat(t,"]")),console.log("input->",l),console.log("processed sentences->",C),console.log("processed lines->",P),console.log("Expected sentence count:",i.length),console.log("Expected line count:",o.length),console.log("Matched sequence length:",p),console.log("blocksToKeep",d,"size",d.size),console.groupEnd(),d.size}}}}}}},j=function(e){c.current&&c.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),i=t.querySelectorAll(".rpv-search__highlight");e.has(n)||i.forEach(function(e){e.style.display="none"})})},k=l.map(function(e){return function(e){return e?S(e).split(/\n{2,}/).map(function(e){return A(e).join(" ")}).map(function(e){return M(e)}).filter(Boolean):[]}(e)}).flat(),z=l.map(function(e){return A(e)}).flat(),R=k.some(function(e){return e.length>=3})?3:1,C=k.filter(function(e){return e.length>=R}),P=z.filter(function(e){return e.length>=R}),H=P.flatMap(function(e){return function(e,t,r){void 0===t&&(t=6),void 0===r&&(r=4);var n=e.split(/\s+/).filter(Boolean);if(n.length<=t)return[];for(var i=[],o=0;o+t<=n.length;o+=r)i.push(n.slice(o,o+t).join(" "));return n.length>t&&(n.length-t)%r!==0&&i.push(n.slice(n.length-t).join(" ")),i}(e)}),F=Array.from(new Set(e.__spreadArray(e.__spreadArray(e.__spreadArray([],C,!0),P,!0),H,!0).flatMap(function(e){var t=M(e.replace(/[\u00A0\u2009\u202F]/g," ").replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'"));if(!t)return[];var r=t.replace(/[\u2013\u2014]/g,"-"),n=M(r.replace(/(\w)-\s+(\w)/g,"$1$2")),i=M(r.replace(/-/g," ")),o=M(r.replace(/-/g,"")),a=M(t.replace(/[^\w\s]/g,"")),l=new Set([t,r,n,i,o,a]);return Array.from(l).filter(Boolean)}))).filter(function(e){var t=e.split(/\s+/).filter(Boolean);return!(e.length<R)&&(t.length>=3||e.length>=12)}),N=n.searchPlugin({keyword:F}),$=i.pageNavigationPlugin(),O=o.zoomPlugin(),Z=N.jumpToMatch,L=$.jumpToPage,D=O.zoomTo,W=O.ZoomInButton,K=O.ZoomOutButton,J=O.ZoomPopover,V=r.useMemo(function(){return function(t){if(0===t.length)return[];var r=new Map;t.forEach(function(t,n){var i=null!=t.pageNumber?t.pageNumber-1:t.pageIndex;r.has(i)||r.set(i,[]),r.get(i).push(e.__assign(e.__assign({},t),{originalIndex:n}))});var n=[];return r.forEach(function(t){for(var r=e.__spreadArray([],t,!0).sort(function(e,t){return e.top!==t.top?e.top-t.top:e.left-t.left}),i=new Array(r.length).fill(!1),o=0;o<r.length;o++)if(!i[o]){var a=r[o],l=a.left,u=a.top,c=a.width,h=a.height,g=a.pageIndex,s=a.pageNumber,f=l+c,p=u+h,d=[r[o].originalIndex];i[o]=!0;for(var v=!0;v;){v=!1;for(var m=o+1;m<r.length;m++)if(!i[m]){var x=r[m],y=x.left+x.width,_=x.top+x.height,T=Math.max(0,Math.min(f,y)-Math.max(l,x.left))*Math.max(0,Math.min(p,_)-Math.max(u,x.top)),M=Math.max(c*h,1e-4),b=Math.max(x.width*x.height,1e-4),w=Math.min(M,b);(w>0?T/w:0)>=.8&&(l=Math.min(l,x.left),u=Math.min(u,x.top),c=(f=Math.max(f,y))-l,h=(p=Math.max(p,_))-u,d.push(x.originalIndex),i[m]=!0,v=!0)}}n.push({pageIndex:g,pageNumber:s,left:l,top:u,width:c,height:h,originalIndexes:d})}}),n}(s)},[s]),G=a.highlightPlugin({renderHighlights:function(e){return t.jsx(t.Fragment,{children:V.filter(function(t){return null!=t.pageNumber?t.pageNumber-1===e.pageIndex:t.pageIndex===e.pageIndex}).map(function(e){var r=e.originalIndexes.includes(_);return t.jsx("div",{style:{position:"absolute",left:"".concat(e.left,"%"),top:"".concat(e.top+.08*e.height,"%"),width:"".concat(e.width,"%"),height:"".concat(.95*e.height,"%"),background:r?p:f,opacity:r?.7:.4,transition:"background 0.2s, opacity 0.2s",border:r?"1px solid ".concat("red"):"1px solid transparent"}},e.originalIndexes.join("-"))})})}}),Q=function(){if(!x.current)try{Z(0),x.current=!0;var e=s[0];e&&g&&X(e.pageIndex,e.top)}catch(e){requestAnimationFrame(Q)}},U=function(e,t){if(c.current&&c.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var i,o,a=null===(i=c.current)||void 0===i?void 0:i.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(o=c.current)||void 0===o?void 0:o.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var u=l.querySelectorAll(".rpv-search__highlight")[t];if(u){var h=a.getBoundingClientRect(),g=u.getBoundingClientRect(),s=a.scrollTop+(g.top-h.top)-a.clientHeight/2+g.height/2;a.scrollTo({top:s,behavior:"smooth"})}}}};setTimeout(n,300)}},X=function(e,t,r){if(void 0===r&&(r=0),c.current){var n=0,i=function(){var o,a;if(!(++n>60)){var l=null===(o=c.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(l){var u=null===(a=c.current)||void 0===a?void 0:a.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(u){var h=u.getBoundingClientRect();if(0!==h.height){var g=l.getBoundingClientRect(),s=t/100*h.height,f=r/100*h.height,p=h.top-g.top+s,d=p+f;if(!(p>=80&&d<=l.clientHeight-80)){var v=p<80?l.scrollTop+p-80:l.scrollTop+d-l.clientHeight+80;l.scrollTo({top:v,behavior:"smooth"})}}else setTimeout(i,100)}else setTimeout(i,100)}else setTimeout(i,100)}};setTimeout(i,100)}},Y=r.useMemo(function(){var e={};return q.forEach(function(t,r){var n=u[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[q,u]),ee=function(e){var t=u[q[e]];return(Y[t]||[]).indexOf(e)},te=function(e,t,r){if(void 0===r&&(r=0),c.current){var n=-1,i=0,o=function(){var a,l;if(!(++i>60)){var u=null===(a=c.current)||void 0===a?void 0:a.querySelector(".rpv-core__inner-pages");if(u){if(u.scrollTop!==n)return n=u.scrollTop,void setTimeout(o,100);var h=null===(l=c.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(h){var g=h.getBoundingClientRect();if(0!==g.height){var s=u.getBoundingClientRect(),f=t/100*g.height,p=r/100*g.height,d=g.top-s.top+f,v=d+p;if(!(d>=80&&v<=u.clientHeight-80)){var m=d<80?u.scrollTop+d-80:u.scrollTop+v-u.clientHeight+80;u.scrollTo({top:m,behavior:"instant"})}}else setTimeout(o,100)}else setTimeout(o,100)}else setTimeout(o,100)}};setTimeout(o,100)}};return{setHighlightIndex:m,highlightIndex:v,cursorIndex:_,setCursorIndex:T,orderedKeys:q,totalHighlights:E,getValidPosition:function(e){if(g)return e+1;if(!u)return 0;for(var t=0,r=0;r<=e;r++)u[q[r]]>0&&t++;return t},tryJump:Q,jumpToPage:L,zoomTo:D,hideNonTargetHighlights:j,deduplicateHighlights:B,scrollToCoord:X,plugins:[g?G:N,$,O],controls:{ZoomInButton:W,ZoomOutButton:K,ZoomPopover:J,goToNext:function(){if(g&&s)for(var e=_+1;e<s.length;e++){var t=s[e],r=s[_];return T(e),void(t.pageIndex!==r.pageIndex?(L(t.pageIndex),te(t.pageIndex,t.top,t.height)):X(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=q[e];if(u[t]>0){var r=u[t]-1,n=ee(e);return T(e),L(u[t]-1),U(r,n),setTimeout(function(){B(r)},500),1===Object.keys(u).length&&j(h),{value:void 0}}};for(e=_+1;e<q.length;e++){var i=n(e);if("object"==typeof i)return i.value}}},goToPrevious:function(){if(g&&s)for(var e=_-1;e>=0;e--){var t=s[e],r=s[_];return T(e),void(t.pageIndex!==r.pageIndex?(L(t.pageIndex),te(t.pageIndex,t.top,t.height)):X(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=q[e];if(u[t]>0){var r=u[t]-1,n=ee(e);return T(e),L(u[t]-1),U(r,n),setTimeout(function(){B(r)},500),1===Object.keys(u).length&&j(h),{value:void 0}}};for(e=_-1;e>=0;e--){var i=n(e);if("object"==typeof i)return i.value}}}}}};
|
|
2
2
|
//# sourceMappingURL=usePdfHighlight.js.map
|
package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../store/ref.context.js");require("../UserStoryCard/cws/CwsEvent.js");var i,o=require("../UserStoryCard/cws/CwsEventProvider.js"),r=require("react-hot-toast");exports.SectionStatus=void 0,(i=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",i.IN_PROGRESS="in_progress",i.GENERATED="generated",i.FAILED="failed",i.GENERATE="generate",i.APPROVED="approved";const s=t.createContext(null),a="user-story-lib";exports.ToasterId=a,exports.default=({children:i,userStory:u,setUserStory:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../store/ref.context.js");require("../UserStoryCard/cws/CwsEvent.js");var i,o=require("../UserStoryCard/cws/CwsEventProvider.js"),r=require("react-hot-toast");exports.SectionStatus=void 0,(i=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",i.IN_PROGRESS="in_progress",i.GENERATED="generated",i.FAILED="failed",i.GENERATE="generate",i.APPROVED="approved";const s=t.createContext(null),a="user-story-lib";exports.ToasterId=a,exports.default=({children:i,userStory:u,setUserStory:d,aiReasoning:l,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:h,customIcons:p,searchQueryList:S,searchQueryReasoningIdList:m,citationConfig:v,chatHistory:I,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,inlineUpdateComponentConfig:D,segmentComponentConfig:b,onEditBlocked:j,inlineManualComponentConfig:w,redlineConfig:P,sectionStatusConfig:q,customSectionConfig:T,updateRedlineDataParent:U,redlineCollaborativeConfig:F,onFetchOnDemandCitation:N})=>{const[O,_]=t.useState(0),[k,L]=t.useState(""),M=t.useMemo(()=>{if(0===u.length||0===l.length)return Array(u.length).fill(0);const e=Array.from({length:u.length},()=>[]);return l.forEach(t=>{const n=Number(t.relevance_score);if(isNaN(n)||n<=0)return;const i=`ai_reasoning$${t.id}`,o=u.findIndex(e=>{var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(n)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,t)=>e+t,0)/e.length))},[u,l]),G=t.useCallback(e=>{var t;const n=u.findIndex(t=>t.artifactId===e);return-1===n?0:null!==(t=M[n])&&void 0!==t?t:0},[u,M]),[H,Q]=t.useState(null);return e.jsxs(s.Provider,{value:{chatHistory:I,userStory:u,setUserStory:d,aiReasoning:l,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:h,customIcons:p,searchQueryList:S,searchQueryReasoningIdList:m,citationConfig:v,getAvgScoreForStory:G,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,currentHighlightIndex:O,setCurrentHighlightIndex:_,inlineUpdateComponentConfig:D,segmentComponentConfig:b,onEditBlocked:j,inlineManualComponentConfig:w,redlineConfig:P,redlineDcoumentId:k,setRedlineDocumentId:L,sectionStatusConfig:q,customSectionConfig:T,updateRedlineDataParent:U,redlineCollaborativeConfig:F,selectedSectionToEdit:H,setSelectedSectionToEdit:Q,onFetchOnDemandCitation:N},children:[e.jsx(r.Toaster,{position:"top-right",toasterId:a}),(null==F?void 0:F.initiateCollaborativeFlow)?e.jsx(o.default,{applicationId:null==F?void 0:F.modeId,baseUrl:null==F?void 0:F.cwsBaseUrl,authToken:null==F?void 0:F.authToken,children:e.jsx(n.RefProvider,{children:i})}):e.jsx(n.RefProvider,{children:i})]})},exports.useRequirementAI=()=>{const e=t.useContext(s);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
|
|
2
2
|
//# sourceMappingURL=RequirementAIWrapper.js.map
|
package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeTags.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`,t=new RegExp(String.raw`<updated\b(${e})>([\s\S]*?)<\/updated\s*>`,"gi"),n=new RegExp(String.raw`<upt\b(${e})>([\s\S]*?)<\/upt\s*>`,"gi"),r=new RegExp(String.raw`<(deleted|changed)\b(${e})>([\s\S]*?)<\/\1\s*>`,"gi"),i=e=>{const t=e.trim();if(!t.includes("|"))return null;const n=[];let r="";for(let e=0;e<t.length;e+=1){const i=t[e],s=e>0&&"\\"===t[e-1];"|"!==i||s?r+=i:(n.push(r.trim()),r="")}return n.push(r.trim()),t.startsWith("|")&&n.shift(),t.endsWith("|")&&n.pop(),n},s=e=>!!(null==e?void 0:e.length)&&e.every(e=>/^:?-{3,}:?$/.test(e)),d=e=>`| ${e.join(" | ")} |`,l=e=>e.replace(n,(e,t,n)=>{if(!(e=>{const t=e.split("\n");return t.some((e,n)=>{var r;return n>0&&s(i(e))&&!!(null===(r=i(t[n-1]))||void 0===r?void 0:r.length)})})(n))return e;return`<updated${t}>${n.replace(/<del\b([^>]*)>/gi,"<deleted$1>").replace(/<\/del\s*>/gi,"</deleted>").replace(/<ins\b([^>]*)>/gi,"<changed$1>").replace(/<\/ins\s*>/gi,"</changed>")}</updated>`});exports.normalizeRedlineMarkdown=n=>{if(!n)return"";let a=l(n).replace(t,(e,t,n)=>{if(!n.includes("|"))return e;if(!/\bid\s*=\s*["']ai_reasoning\$/i.test(t))return n;const r=/\bdata-main\b/i.test(t)?"":" data-main",i=((e,t)=>{const n=t.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!n)return e;const r=encodeURIComponent(n[1]);return e.replace(/<(deleted|changed)\b([^>]*)>/gi,(e,t,n)=>/\bdata-upt-id\s*=/i.test(n)?e:`<${t}${n} data-upt-id="${r}">`)})(n,t);return`<upt${t}${r}></upt>\n\n${i}`});return a=(t=>{const n=new RegExp(String.raw`(<deleted\b${e}>(?:(?!<\/deleted\s*>)[\s\S])*?\|(?:(?!<\/deleted\s*>)[\s\S])*?<\/deleted\s*>)\s*(<changed\b${e}>[^|]*?<\/changed\s*>)\s*\|`,"gi"),d=t.replace(n,(e,t,n)=>{var r;return`${(null!==(r=t.replace(/<\/deleted\s*>$/i,"").trimEnd().split("\n").at(-1))&&void 0!==r?r:"").trimEnd().endsWith("|")?t:t.replace(/<\/deleted\s*>$/i," |</deleted>")}\n${n}`}),l=new RegExp(String.raw`(<deleted\b${e}>(?:(?!<\/deleted\s*>)[\s\S])*?\|(?:(?!<\/deleted\s*>)[\s\S])*?<\/deleted\s*>)\s*(?=<changed\b${e}>)`,"gi"),a=d.replace(l,"$1\n\n");return a.replace(r,(e,t,n,r,d)=>{if(!r.includes("|"))return e;const l=a.slice(0,d),c=/(?:^|\n)[ \t]*$/.test(l);return r.split("\n").map((e,r)=>{if(!e)return e;let d=e;d.includes("|")&&!/^\s*\|/.test(d)&&(r>0||c)&&(d=`| ${d}`);const l=i(d);return s(l)?d:d.split(/(\|)/).map(e=>"|"!==e&&e.trim()?`<${t}${n}>${e}</${t}>`:e).join("")}).join("\n")})})(a),a=a.replace(/([([])\s+(?=<(?:deleted|changed)>)/gi,"$1"),(e=>{const t=e.split("\n");for(let e=1;e<t.length;e+=1){const n=i(t[e]);if(!s(n))continue;const r=i(t[e-1]);if(!(null==r?void 0:r.length))continue;for(;r.length>n.length;){const e=r.findIndex(e=>""===e);if(-1===e)break;r.splice(e,1)}const l=Math.max(r.length,n.length);let a=e+1,c=0;for(;a<t.length&&""!==t[a].trim();){const e=i(t[a]);if(!e)break;for(;e.length>l;){const t=e.findIndex(e=>""===e);if(-1===t)break;e.splice(t,1)}t[a]=d(e),c=Math.max(c,e.length),a+=1}const o=Math.max(r.length,n.length,c);for(;r.length<o;)r.push("");for(;n.length<o;)n.push("---");t[e-1]=d(r),t[e]=d(n)}return t.join("\n")})(a)};
|
|
2
|
+
//# sourceMappingURL=normalizeRedlineMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeRedlineMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),o=require("../../store/ref.context.js"),a=require("@lexical/html"),l=require("turndown"),s=require("turndown-plugin-gfm"),c=require("../UnsavedChangesPopup/UnsavedChangesPopup.js"),i=require("../../../../utils/tagHelper.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=new(u(l).default)({headingStyle:"atx",codeBlockStyle:"fenced"}),p=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");d.keep(["ins","del","mark"]),d.keep(e=>["DELETED","CHANGED"].includes(e.nodeName)),d.addRule("ai-reasoning-link-passthrough",{filter:e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r},replacement:(e,t)=>{const r=t,n=r.getAttribute("href")||"",o=r.textContent||"";return`<a href="${a=n,p(a).replace(/"/g,""")}">${p(o)}</a>`;var a}}),d.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),d.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),d.use(s.tables);const h=e=>(e||"").replace(/\r\n/g,"\n").trim(),g=t.forwardRef(({type:l,value:s,handleUpdateState:u,onBlur:p,placeholder:g,minHeight:f,height:E,mode:m,doNotShowBorderInViewMode:v,onEditBlocked:A,onSaveUnsavedChanges:y,onDiscardUnsavedChanges:S,isSavingUnsavedChanges:$=!1},x)=>{const w=t.useRef(null),[C,b]=t.useState({type:l,value:s}),[N,q]=t.useState(0),[T,R]=t.useState(!1),L=t.useRef(s),B=t.useRef(s),_=t.useRef(Boolean(s)),{contentRef:I,setContentRef:j}=o.useRefStore();t.useEffect(()=>{b(e=>({...e,value:s})),L.current=s,B.current=s,_.current=Boolean(s),R(!1)},[s]),t.useImperativeHandle(x,()=>({requestClose:()=>!("edit"===m&&h(L.current)!==h(B.current))||(R(!0),!1)}),[m]);return t.useEffect(()=>{const e=()=>{I&&I.current&&q(I.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[I]),e.jsxs("div",{style:{position:"relative",width:"100%",height:E,minHeight:f},children:[T&&e.jsx(c.UnsavedChangesPopup,{isSaving:$,onSave:async()=>{await(null==y?void 0:y()),L.current=B.current,R(!1)},onDiscard:()=>{B.current=L.current,null==S||S(),R(!1)}}),e.jsx(n.default,{minHeight:f,height:E,placeholder:g||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=a.$generateHtmlFromNodes(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&(t.includes("rgb(219, 234, 254)")||t.includes("rgb(213, 232, 255)")||t.toLowerCase().includes("#d5e8ff"))&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("span[data-review]").forEach(e=>{const t="delete"===e.getAttribute("data-review")?"deleted":"changed",n=r.createElement(t);n.append(...Array.from(e.childNodes)),e.replaceWith(n)}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code").forEach(e=>{e.textContent=e.textContent||""}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,"")),e.removeAttribute("class"),e.textContent=e.textContent||""})(e)});const n=["upt","manual","ins","del","preserved"];function o(e,t){const r=e.cloneNode(!0),a=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${a.size}%%`;a.set(n,o(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);a.forEach((e,t)=>{l=l.replace(t,e)});const s=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),c=e.tagName.toLowerCase();return s?`<${c} ${s}>${l}</${c}>`:`<${c}>${l}</${c}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const l=[];r.querySelectorAll("invisible").forEach((e,t)=>{l.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const s=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{s.push(o(e,d)),e.replaceWith(r.createTextNode(`%%REVIEW_${s.length-1}%%`))})});const c=[];r.querySelectorAll("p").forEach(e=>{if(!(""===e.textContent&&Array.from(e.childNodes).every(e=>"BR"===e.nodeName||e.nodeType===Node.TEXT_NODE&&""===e.textContent)))return;const t=`%%BLANKLINE${c.length}%%`;c.push(t),e.textContent=t});const p=[];r.querySelectorAll("table").forEach((e,t)=>{p.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let h=d.turndown(r.body.innerHTML);c.forEach(e=>{h=h.replace(new RegExp(`\\n*${e}\\n*`,"g"),"\n\n")});for(let e=s.length-1;e>=0;e--)h=h.replace(`%%REVIEW\\_${e}%%`,` ${s[e]} `);l.forEach((e,t)=>{h=h.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),p.forEach((e,t)=>{h=h.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),h=h.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),h=h.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),h=h.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),h=h.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),h=h.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>"),h=h.replace(/<code([^>]*)>\s*<span[^>]*>([\s\S]*?)<\/span>\s*<\/code>/g,"<code$1>$2</code>");["upt","manual","del","ins","preserved"].forEach(e=>{h=i.mergeTagAcrossParagraphs(h,e)}),h=i.unescapeTagIds(h,["manual","upt"]),_.current&&(L.current=h,_.current=!1),B.current=h,((e,t)=>{u(e,t)})("prompt",h)})},toolbarConfig:r.DEFAULT_TOOLBAR_CONFIG,editorRef:w,mode:m,initialString:{type:C.type,value:C.value},dynamicHeight:N,onBlur:p,doNotShowBorderInViewMode:v||!1,onEditBlocked:A})]})});g.displayName="RichTextEditor",exports.default=g;
|
|
2
2
|
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=".avatar{align-items:center;border-radius:50%;box-sizing:border-box;color:#475467;display:flex;flex-shrink:0;font-family:Inter;font-weight:600;justify-content:center;line-height:1;position:relative;user-select:none}.avatar--bordered{border:2px solid #fff}.online-dot{background:#22c55e;border:2px solid #fff;border-radius:50%;bottom:-1px;position:absolute;right:-1px}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&t.setAttribute("nonce",o),t.appendChild(document.createTextNode(e));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(t)}(),exports.default=e;
|
|
2
|
+
//# sourceMappingURL=Avatar.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("./Avatar.css.js");var a=require("./avatarUtils.js");exports.default=function({name:t,online:r=!1,size:s=56,bordered:i=!1}){return e.jsxs("div",{className:"avatar "+(i?"avatar--bordered":""),style:{width:s,height:s,background:a.getAvatarColor(t),fontSize:Math.max(12,.38*s)},children:[a.getInitials(t),r&&e.jsx("span",{className:"online-dot",style:{width:Math.max(8,.28*s),height:Math.max(8,.28*s)}})]})};
|
|
2
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=".avatar-group{align-items:center;cursor:pointer;display:inline-flex;gap:6px;position:relative;user-select:none}.avatar-stack{align-items:center;display:flex}.avatar-wrapper{margin-left:-10px;position:relative}.avatar-wrapper:first-child{margin-left:0}.avatar-more{align-items:center;background:#f2f4f7;border:2px solid #fff;border-radius:50%;box-sizing:border-box;color:#667085;display:flex;font-size:11px;font-weight:600;height:32px;justify-content:center;line-height:1;user-select:none;width:32px}.avatar-chevron{color:#667085;cursor:pointer;height:16px;transition:transform .2s ease;width:16px}.avatar-chevron.open{transform:rotate(180deg)}.avatar-group-container{display:inline-block;position:relative}.collaborators-popup-wrapper{left:-100px;position:absolute;z-index:1000}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&t.setAttribute("nonce",n),t.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(t)}(),exports.default=e;
|
|
2
|
+
//# sourceMappingURL=CollaboratorsGroup.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollaboratorsGroup.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react");require("./CollaboratorsGroup.css.js");var s=require("./Avatar.js"),a=require("./CollaboratorsPopup.js"),t=require("lucide-react");exports.default=function({users:n,owner:o,activeUsers:i,previousUsers:c=[],maxVisible:l=3}){const u=n.slice(0,l),d=n.length-u.length,[v,p]=r.useState(!1),m=r.useRef(null);return r.useEffect(()=>{function e(e){m.current&&!m.current.contains(e.target)&&p(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),e.jsxs("div",{className:"avatar-group-container",ref:m,children:[e.jsxs("div",{className:"avatar-group",onClick:()=>p(e=>!e),children:[e.jsxs("div",{className:"avatar-stack",children:[u.map((r,a)=>e.jsx("div",{className:"avatar-wrapper",style:{zIndex:a+1},children:e.jsx(s.default,{name:r.name,online:r.online,size:32,bordered:!0})},r.id)),d>0&&e.jsx("div",{className:"avatar-wrapper",style:{zIndex:u.length+1},children:e.jsxs("div",{className:"avatar-more",children:["+",d]})})]}),e.jsx(t.ChevronDown,{className:"avatar-chevron "+(v?"open":"")})]}),v&&e.jsx("div",{className:"collaborators-popup-wrapper",children:e.jsx(a.default,{owner:o,activeUsers:i,previousUsers:c})})]})};
|
|
2
|
+
//# sourceMappingURL=CollaboratorsGroup.js.map
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollaboratorsGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|