@viswa-test/test-citation 0.0.335 → 0.0.337
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/Guidelines/utils/guidelineTargets.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/components/GuidelineSkeletonLoader.js +2 -0
- package/dist/cjs/features/CognitiveCompare/components/GuidelineSkeletonLoader.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- 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/ChartBreakoutCircle.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/CognitiveIntegrity.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/LabelCheck.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/RevertCard.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertCard.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/service/redlineService.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js.map +1 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js.map +1 -0
- package/dist/features/CognitiveCompare/components/GuidelineSkeletonLoader.js +2 -0
- package/dist/features/CognitiveCompare/components/GuidelineSkeletonLoader.js.map +1 -0
- package/dist/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js +2 -0
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js +2 -0
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js +2 -0
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js +2 -0
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +2 -0
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/infoAlert.js +2 -0
- package/dist/features/PdfViewer/nyc-components/infoAlert.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js +2 -0
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +1 -0
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- 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/ChartBreakoutCircle.js +2 -0
- package/dist/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +1 -0
- package/dist/features/SegmentReviewComponents/CognitiveIntegrity.js +1 -1
- package/dist/features/SegmentReviewComponents/LabelCheck.js +1 -1
- package/dist/features/SegmentReviewComponents/RevertCard.js +2 -0
- package/dist/features/SegmentReviewComponents/RevertCard.js.map +1 -0
- package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +2 -0
- package/dist/features/SegmentReviewComponents/RevertSuccessCard.js.map +1 -0
- package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js +2 -0
- package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js.map +1 -0
- package/dist/features/SegmentReviewComponents/ReviewedCard.js +2 -0
- package/dist/features/SegmentReviewComponents/ReviewedCard.js.map +1 -0
- package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/index.js +1 -1
- package/dist/service/redlineService.js +1 -1
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts +23 -0
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts.map +1 -0
- package/dist/types/src/Background.d.ts +7 -0
- package/dist/types/src/Background.d.ts.map +1 -0
- package/dist/types/src/RedlineApprovalCardTest.d.ts +1 -0
- package/dist/types/src/RedlineApprovalCardTest.d.ts.map +1 -0
- package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
- package/dist/types/src/RedlineEditorTest2.d.ts +3 -0
- package/dist/types/src/RedlineEditorTest2.d.ts.map +1 -0
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/assests/icons/ChartSplitIcon.d.ts +3 -0
- package/dist/types/src/assests/icons/ChartSplitIcon.d.ts.map +1 -0
- package/dist/types/src/commonConstants.d.ts +31103 -0
- package/dist/types/src/commonConstants.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/guidelineTargets.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/guidelineTargets.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.d.ts +19 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/components/GuidelineSkeletonLoader.d.ts +8 -0
- package/dist/types/src/features/CognitiveCompare/components/GuidelineSkeletonLoader.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeRedlineMarkdown.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeRedlineMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +128 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +1 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +13 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts +59 -0
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts +19 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts +3 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts +77 -0
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts +47 -0
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts +15 -0
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts +3 -0
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts +36 -0
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +29 -39
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- 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 +5439 -84
- 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 +2 -19
- 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 +2 -7
- 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 +1 -15
- 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 +1 -2
- 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 +2 -3
- 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 +0 -1
- 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 +0 -1
- 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/lsc-reason-gap/CustomChatCrRedirection.d.ts +2 -3
- 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 +1 -3
- 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 +1 -2
- 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 +0 -1
- 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 +0 -2
- 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 +1 -2
- 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 +1 -2
- 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 +0 -2
- 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 +0 -3
- 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 +1 -2
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +0 -2
- 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 +3 -1
- package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts +3 -0
- package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts +3 -1
- package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts +37 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts +9 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts +7 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts +2 -1
- package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts +16 -2
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts +2 -0
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts +6 -2
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +34 -0
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts +2 -0
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/service/redlineService.d.ts.map +1 -1
- package/package.json +2 -7
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts +0 -10
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts +0 -17
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts +0 -23
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts +0 -3
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts +0 -12
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +0 -1
- /package/dist/cjs/features/{RequirementAI/components/RichTextEditor/Editor → CognitiveCompare}/utils/normalizeRedlineMarkdown.js.map +0 -0
- /package/dist/features/{RequirementAI/components/RichTextEditor/Editor → CognitiveCompare}/utils/normalizeRedlineMarkdown.js.map +0 -0
package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import t,{createContext as o,useRef as l,useState as r,useCallback as d,useMemo as a,useEffect as s,useContext as c}from"react";import u from"react-markdown";import p from"rehype-raw";import h from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as g}from"../../shared/useMarkdownSearch.js";import{Info as m}from"lucide-react";import{Tooltip as v}from"@mui/material";import f from"dompurify";import C from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as b}from"../RequirementAIWrapper/RequirementAIWrapper.js";import I from"../../icons/CognitiveDecision.js";import S from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as $}from"../ai-reasoning/AiReasoningCitation.js";import x from"../../icons/RelevanceScoreIcon.js";import N from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import A from"../ai-reasoning/AiReasoningCitationContent.js";import j from"./components/InlineUpdatedComponent.js";import L from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as U}from"../../store/markdown-context.js";import E from"./components/InlineManualComponent.js";import M from"./components/HighlightButtonComponent.js";import{escapeTagIds as P,splitTagAcrossParagraphs as T}from"../../../../utils/tagHelper.js";import{normalizeRedlineMarkdown as D}from"../RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js";const _=o(!1),H=o({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),W=o({rowId:""}),B=({aiReason:n,isHighConfidence:t,customStyle:o,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=c(H),{rowId:u}=c(W),p=String(n.id);u&&s.current.set(p,u);const g=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===n.id,m=t?(null==l?void 0:l.highConfidence)||e(I,{}):(null==l?void 0:l.lowConfidence)||e(S,{});return i("button",{className:h.aiReasoningButton,style:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(g?null:u,g?null:n)},children:[m,e("i",g?{className:`pi pi-angle-up ${t?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${t?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence}`})]})},F=({children:n,node:t,customStyles:o,customIcons:r})=>{var d,a;const s=l(Math.random().toString(36).slice(2)).current,{expandedInfo:u}=c(H),p=(null==u?void 0:u.rowId)===s,g=Array.isArray(null==t?void 0:t.children)?t.children.filter(e=>"element"===e.type).length:1,m=null!==(a=null===(d=null==t?void 0:t.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return i(W.Provider,{value:{rowId:s},children:[e("tr",{style:m?{cssText:m}:void 0,children:n}),p&&(null==u?void 0:u.aiReason)&&e("tr",{style:{width:"100%"},children:e("td",{colSpan:g||1,className:h.tableExpandedCell,children:e("div",{className:h.tableExpandedCellInner,children:e("div",{className:h.tableExpandedCellContent,children:e(A,{aiReason:u.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==o?void 0:o.aiReasoningContent,aiReasoningAccordion:null==o?void 0:o.aiReasoningAccordion,aiReasoningMarkdown:null==o?void 0:o.aiReasoningMarkdown,aiReasoningPill:null==o?void 0:o.aiReasoningPill,webCitation:null==o?void 0:o.webCitation,stormeeCitation:null==o?void 0:o.stormeeCitation,waveformCitation:null==o?void 0:o.waveformCitation,imageCitation:null==o?void 0:o.imageCitation,fileCitation:null==o?void 0:o.fileCitation,appModCitation:null==o?void 0:o.appModCitation,rcaCitation:null==o?void 0:o.rcaCitation,readFileCitation:null==o?void 0:o.readFileCitation,loadingCitations:null==o?void 0:o.loadingCitations,chatCitation:null==o?void 0:o.chatCitation}})})})})})]})};const O=["del","ins"];function V(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var t;const o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return`<code>${l=o,l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var l})}function q(e){return function(e,n,i){const t=n.join("|");return e.replace(new RegExp(`<(${t})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,t)=>`<${n}>${i(t)}</${n}>`)}(e,O,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:V(e)).join(""))}function z(e){let n=e.trim();n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const i=[];let t="",o=!1;for(const e of n)o?(t+=e,o=!1):"\\"!==e?"|"!==e?t+=e:(i.push(t.trim()),t=""):(t+=e,o=!0);return i.push(t.trim()),i}function G(e){return e.trim().includes("|")&&z(e).length>1}function Q(e){const n=z(e);return n.length>1&&n.every(e=>/^:?-{3,}:?$/.test(e.replace(/\s+/g,"")))}function J(e){if(!e)return;const n=e.replace(/\s+/g,"");return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":"left"}function K(e,n){return Array.from({length:n},(n,i)=>{var t;return null!==(t=e[i])&&void 0!==t?t:""})}function X(e,n,i){return`<${e}${function(e){return e?` align="${e}"`:""}(i)}>${V(n)}</${e}>`}function Y(e,n,i){const t=Math.max(e.length,n.length,...i.map(e=>e.length)),o=K(e,t),l=K(n,t).map(J);return`\n\n<table>${`<thead><tr>${o.map((e,n)=>X("th",e,l[n])).join("")}</tr></thead>`}${i.length?`<tbody>${i.map(e=>`<tr>${K(e,t).map((e,n)=>X("td",e,l[n])).join("")}</tr>`).join("")}</tbody>`:""}</table>\n\n`}const Z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ee(e,n){const i=[],o=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!t.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(o.has(d))return i.push(e),null;if(Z.has(d))return e;const a=null===(r=t.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?t.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const ne=({message:o,noMarkdownContent:I,useMarkdown:S=!0,isParent:A,scenario:W,showUserStoryDiff:O=!1,aiReasoningsForBlock:V,isCitationLoadingDisplay:J=!1,className:K,highConfidenceIcon:X,lowConfidenceIcon:Z,customStyles:ne,customIcons:ie,contextVariant:te,aiReasoningDiffView:oe,userStoryCitations:le,artifactId:re,isCraflow:de,onCraAccept:ae,onCraReject:se,craFlowConfig:ce,isDisplayHighlightControl:ue=!1,showConfidenceScore:pe=!0,CDNeededInChip:he,blockId:ge,storyId:me,showWaitingIconInChip:ve})=>{var fe;console.log("userstorywithcitation blockid ",ge);const Ce=l(null),{userStory:ye,inlineUpdateComponentConfig:we,getAvgScoreForStory:be,setUserStory:Ie,aiReasoning:Se,setAiReasoning:Re,customIcons:$e,searchQueryList:xe,searchQueryReasoningIdList:Ne,currentHighlightIndex:ke,segmentComponentConfig:Ae,inlineManualComponentConfig:je,diffEditConfig:Le,customSectionConfig:Ue}=b(),Ee=null!=ie?ie:null==$e?void 0:$e.userStoryIcons;null==ne||ne.searchHighlight;const{search:Me,clear:Pe}=g(Ce),[Te,De]=r("1"),[_e,He]=r(null),We=l(new Map),[Be,Fe]=r(new Set),Oe=d((e,n)=>{He(e&&n?{rowId:e,aiReason:n}:null)},[]),Ve=re?be(re):0,[qe,ze]=r([]),Ge=d(e=>{Fe(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Qe=d((e,n)=>{var i,t,o,l,r,d;const a=n["data-upt-id"];if("string"!=typeof a)return;let s=a;try{s=decodeURIComponent(a)}catch(e){}const c=null===(t=null===(i=s.split("$"))||void 0===i?void 0:i[1])||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),u=Se.find(e=>e.id.toString()===c);if(!u)return;e.preventDefault(),e.stopPropagation();const p=null!==(r=Array.from(null!==(l=null===(o=Ce.current)||void 0===o?void 0:o.querySelectorAll("[data-ai-reason-id]"))&&void 0!==l?l:[]).find(e=>e.dataset.aiReasonId===u.id.toString()))&&void 0!==r?r:e.currentTarget;null===(d=null==we?void 0:we.handleClickUpdatedPill)||void 0===d||d.call(we,p,u)},[Se,null==we?void 0:we.handleClickUpdatedPill]),Je=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Je).join(""):t.isValidElement(e)?Je(e.props.children):"",Ke=e=>{let n=function(e){const n=e.split("\n"),i=[];let t=!1;for(let e=0;e<n.length;e++){const o=n[e];if(/^\s*(```|~~~)/.test(o)){t=!t,i.push(o);continue}const l=n[e+1];if(!t&&void 0!==l&&G(o)&&Q(l)){const t=z(o),r=z(l),d=[];for(e+=2;e<n.length&&G(n[e])&&!Q(n[e]);)d.push(z(n[e])),e++;e--,i.push(Y(t,r,d));continue}i.push(o)}return i.join("\n")}(D(function(e){return e.replace(/\\r\\n|\\n|\\r/g,"\n")}(e)));return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,t,o)=>{const l=t.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,t,o)=>{const l=n.substring(0,o),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=t;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let t;const o=new RegExp(n.source,n.flags);for(;null!==(t=o.exec(e));){const e=t[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),o=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:t.index,endIndex:t.index+t[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==o?void 0:o[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],t=n.changedItemCount-n.deletedItemCount;if(0===t)continue;const o=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of o){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+t}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=q(n),n},Xe=a(()=>o?Ke(o):o,[o]);s(()=>{ze(V||Se)},[V,Se]);const Ye=a(()=>{const o=Boolean(null==Ue?void 0:Ue.negateList),l=(e,n)=>{let i=0;return t.Children.map(e,e=>{if(!t.isValidElement(e))return e;const o=n(i);return i+=1,t.cloneElement(e,{"data-list-marker":o})})};return{span:({node:n,children:i,...t})=>{var o,l,r,d,a;const s=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o["highlight-id"])&&void 0!==l?l:null==t?void 0:t["highlight-id"],c="string"==typeof s&&Be.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==t?void 0:t["highlight-color"];return e("span",{style:{...null!==(a=null==ne?void 0:ne.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:i,children:t,...o})=>{var l,r,d,a,s,c;const u=null!==(r=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.action)&&void 0!==r?r:null==o?void 0:o.action,p=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==o?void 0:o["highlight-id"],h=null!==(c=null===(s=null==i?void 0:i.properties)||void 0===s?void 0:s["highlight-type"])&&void 0!==c?c:null==o?void 0:o["highlight-type"];return"highlight"===u?e(M,{highlightId:p,handleHighlightSpan:Ge,icon:"web"===h?null==Ee?void 0:Ee.webCitationIcon:"doc"===h?null==Ee?void 0:Ee.fileCitationIcon:e(n,{}),customStyles:"web"===h?null==ne?void 0:ne.webButton:"doc"===h?null==ne?void 0:ne.docButton:{}}):null},upt:({node:i,children:t,...o})=>{var l,r;const d=null==o?void 0:o.id,a=d?null===(r=null===(l=d.split("$"))||void 0===l?void 0:l[1])||void 0===r?void 0:r.replaceAll("@","<").replaceAll("#",">"):null,s=Se.find(e=>e.id.toString()===a);if(!s)return t||e(n,{});const c="data-main"in o,u=o["data-status"];return e(n,{children:e(j,{aiReason:s,customStyles:null==ne?void 0:ne.inlineUpdatedComponent,handleClickCognitiveDecision:null==we?void 0:we.handleClickCognitiveDecision,handleClickUpdatedPill:null==we?void 0:we.handleClickUpdatedPill,handleClickOutputValue:null==we?void 0:we.handleClickOutputValue,customIcons:null==we?void 0:we.customIcons,CDNeededInChip:he,showWaitingIconInChip:ve,showChip:c,status:u,containerRef:Ce,children:t||e(n,{})})})},del:({node:t,children:o,...l})=>{var r;const{cleanedChildren:d,extractedNodes:a}=ee(o,["ins"]);return i(n,{children:[e("span",{className:h.deleted,style:null!==(r=null==ne?void 0:ne.deleted)&&void 0!==r?r:{},...l,onClick:()=>{l.onclick&&l.onclick()},children:d}),a]})},ins:({children:t,...o})=>{var l;const{cleanedChildren:r,extractedNodes:d}=ee(t,["del"]);return console.log("LOG: Printing ins props",o),i(n,{children:[e("span",{className:h.inserted,style:null!==(l=null==ne?void 0:ne.inserted)&&void 0!==l?l:{},...o,onClick:()=>{o.onclick&&o.onclick()},children:r}),d]})},deleted:({children:n,...i})=>e("span",{style:{textDecorationLine:"line-through",textDecorationColor:"#dc2626",cursor:"pointer"},...i,onClick:e=>Qe(e,i),children:n}),changed:({children:n,...i})=>e("span",{style:{backgroundColor:"#f3e8ff",color:"#1e3a8a",padding:"1px 2px",borderRadius:"2px",cursor:"pointer"},...i,onClick:e=>Qe(e,i),children:n}),preserved:({children:n,...i})=>e("span",{className:h.preserved,style:null==ne?void 0:ne.preserved,...i,children:n}),manual:({children:i,...t})=>{var o;const l=null===(o=null==t?void 0:t.id)||void 0===o?void 0:o.replaceAll("@","<").replaceAll("#",">"),r=Se.find(e=>e.id.toString()===l),d=t["data-status"];return r?e(E,{aiReason:r,handleClick:null==je?void 0:je.handleClick,status:d,children:i}):i||e(n,{})},invisible:({children:i,...t})=>e(n,{}),h1:({node:n,...i})=>e("h1",{className:h.heading1,style:null==ne?void 0:ne.heading1,children:i.children}),h2:({node:n,...i})=>e("h2",{className:h.heading2,style:null==ne?void 0:ne.heading2,children:i.children}),h3:({node:n,...i})=>e("h3",{className:h.heading3,style:null==ne?void 0:ne.heading3,children:i.children}),b:({node:n,...i})=>e("b",{className:h.bold,style:null==ne?void 0:ne.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e("p",{...i,className:h.paragraph,style:null==ne?void 0:ne.paragraph,children:i.children}),updated:({node:n,...i})=>e(C,{...i,showUserStoryDiff:O,currentUpdatedTagId:Te,setCurrentUpdatedTagId:De,userStory:ye,setUserStory:Ie,setAiReasoning:Re,node:n,isCraflow:de,onCraAccept:ae,onCraReject:se,diffEditConfig:Le,customStyles:null==ne?void 0:ne.updatedContent,craFlowConfig:ce}),ol:({node:n,...i})=>{var t,r,d;const a=null!==(d=null!==(r=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==i?void 0:i.start)&&void 0!==d?d:void 0,s=Number(null!=a?a:1);return o?e("div",{role:"list",className:h.negatedOrderedList,style:null==ne?void 0:ne.olist,children:l(i.children,e=>`${s+e}.`)}):e("ol",{className:h.orderedList,style:null==ne?void 0:ne.olist,...a?{start:Number(a)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>o?e("div",{role:"list",className:h.negatedUnorderedList,style:null==ne?void 0:ne.ulist,children:l(i.children,()=>"•")}):e("ul",{className:h.unorderedList,style:null==ne?void 0:ne.ulist,children:null==i?void 0:i.children}),li:({node:n,...t})=>{if(o){const e=t["data-list-marker"],{children:n,"data-list-marker":o,...l}=t;return i("div",{...l,role:"listitem",className:`${h.paragraph} ${h.negatedListItem}`,style:null==ne?void 0:ne.paragraph,children:[e&&i("span",{className:h.negatedListMarker,children:[e," "]}),n]})}return e("li",{children:null==t?void 0:t.children})},table:({children:n})=>e("div",{className:h.tableWrapper,children:e("table",{className:h.table,style:null==ne?void 0:ne.table,children:n})}),tr:({node:n,children:i})=>e(F,{node:n,children:i,customStyles:ne}),td:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e(_.Provider,{value:!0,children:e("td",{...l,style:o?{cssText:o}:void 0,children:i})})},th:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e(_.Provider,{value:!0,children:e("th",{...l,style:o?{cssText:o}:void 0,children:i})})},recommendation:({node:n,...i})=>{var t;const o=`The AI has selected this content based on: ${(null===(t=null==i?void 0:i.children)||void 0===t?void 0:t[0])||""}`;return e(N,{...i,customStyles:null==ne?void 0:ne.recommendationBlock,label:o})},a:({inline:n,children:i,node:t,...o})=>{var l;const r=c(_)||"true"===(null==o?void 0:o.table),d=`${null==o?void 0:o.href}`,[a,s]=d.split("$"),u=null==s?void 0:s.split("?")[0];if("ai_reasoning"===a){const n=(null!==(l=O?oe:Se)&&void 0!==l?l:[]).find(e=>e.id.toString()===decodeURIComponent(u)),t=Ne.includes(u);if(n){if(r)return e(B,{aiReason:n,customStyle:null==ne?void 0:ne.tableAiReasoning,customIcons:Ee,isHighConfidence:n.relevance_score>=$});const o=Je(i),l="source"!==o.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:t,inlineLabel:o,isInlineCitation:l,customIcons:Ee,customStyles:{aiReasoningContent:null==ne?void 0:ne.aiReasoningContent,aiReasoningAccordion:null==ne?void 0:ne.aiReasoningAccordion,aiReasoningMarkdown:null==ne?void 0:ne.aiReasoningMarkdown,aiReasoningPill:null==ne?void 0:ne.aiReasoningPill,webCitation:null==ne?void 0:ne.webCitation,stormeeCitation:null==ne?void 0:ne.stormeeCitation,waveformCitation:null==ne?void 0:ne.waveformCitation,imageCitation:null==ne?void 0:ne.imageCitation,fileCitation:null==ne?void 0:ne.fileCitation,appModCitation:null==ne?void 0:ne.appModCitation,rcaCitation:null==ne?void 0:ne.rcaCitation,readFileCitation:null==ne?void 0:ne.readFileCitation,loadingCitations:null==ne?void 0:ne.loadingCitations,chatCitation:null==ne?void 0:ne.chatCitation,bigEnoughCitation:null==ne?void 0:ne.bigEnoughCitation}})}}return null},code:({inline:n,children:i,className:t,node:o,...l})=>/language-(\w+)/.exec(t||"")||(null==t?void 0:t.includes("language-"))?e("div",{children:e("code",{className:h.blockCode,style:null==ne?void 0:ne.code,children:i})}):e("code",{className:h.inlineCode,style:null==ne?void 0:ne.code,children:i}),learned:({children:n})=>e(v,{title:n,placement:"top",children:e(m,{size:16,className:h.learned})}),generatedcode:({node:n,...i})=>{const t=(null==i?void 0:i.language)||"python",o=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n})(i);return e(y,{title:"Generated Code",code:o,language:t,customStyles:{pill:null==ne?void 0:ne.generatedCodePill,content:null==ne?void 0:ne.generatedCodeContent}})},updatedsegment:({node:n,children:i,...t})=>{var o,l,r,d;const a=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(t),c=e("div",s?{dangerouslySetInnerHTML:{__html:f.sanitize(s)}}:{children:i});return e(L,{id:a,node:n,children:c,props:t,segmentComponentConfig:Ae,customStyles:ne,customIcons:ie,extractText:Je,isUpdatedSegment:!0})},segment:({node:n,children:i,...t})=>{var o,l,r,d;const a=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e(L,{id:a,node:n,children:i,props:t,segmentComponentConfig:Ae,customStyles:ne,customIcons:ie,extractText:Je,blockId:ge,storyId:me})}}},[qe,ce,Se,le,Te,O,o,ie,xe,Ne,ne,Ae,Be,Ge,Qe,ge,me,null==Ue?void 0:Ue.negateList]),Ze=a(()=>{let e=P(Xe,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=T(e,n,"upt"===n)}),e},[Xe]);return s(()=>{if(!Ce.current)return;if(!xe.length)return void Pe();let e;if(0===Ne.length||ue)requestAnimationFrame(()=>{Me([xe[ke].replace(/\*/g,"")])});else{const n=Ce.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{Me([xe[ke].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[xe,Ne,ke,ue]),e(H.Provider,{value:{expandedInfo:_e,setExpanded:Oe,reasonToRow:We},children:i("div",{ref:Ce,className:`${h.container} ${"approving"!==W?h.wrapper:""} ${K||""}`,style:null==ne?void 0:ne.container,children:[S?e(U,{children:e(u,{components:Ye,rehypePlugins:[p],children:Ze})}):I,Ve>0&&pe&&e("div",{className:h.confidenceScoreContainer,style:null==ne?void 0:ne.confidenceScoreContainer,children:i("span",{className:h.confidenceScore,style:null==ne?void 0:ne.confidenceScore,children:[e(x,{size:14,color:(null==ne?void 0:ne.confidenceScoreIconColor)||"#166534"}),Ve,"%"]})}),J&&e("div",{className:h.citationLoader,style:null==ne?void 0:ne.citationLoaderContainer,children:e(w,{customStyles:{container:null==ne?void 0:ne.citationLoadingContainer,icon:null==ne?void 0:ne.citationLoadingIcon,text:null==ne?void 0:ne.citationLoadingText}})}),A&&e("div",{style:{...null===(fe=null==ne?void 0:ne.attachedContext)||void 0===fe?void 0:fe.wrapper},className:"flex mt-5",children:e(k,{customStyles:null==ne?void 0:ne.attachedContext,variant:te})})]})})};export{ne as default,ee as splitNestedDiffNodes};
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import o,{createContext as t,useRef as l,useState as r,useCallback as d,useMemo as a,useEffect as s,useContext as c}from"react";import u from"react-markdown";import p from"rehype-raw";import g from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as h}from"../../shared/useMarkdownSearch.js";import{Info as v}from"lucide-react";import{Tooltip as m}from"@mui/material";import C from"dompurify";import f from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as I}from"../RequirementAIWrapper/RequirementAIWrapper.js";import S from"../../icons/CognitiveDecision.js";import b from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as $}from"../ai-reasoning/AiReasoningCitation.js";import x from"../../icons/RelevanceScoreIcon.js";import N from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import A from"../ai-reasoning/AiReasoningCitationContent.js";import j from"./components/InlineUpdatedComponent.js";import U from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as E}from"../../store/markdown-context.js";import L from"./components/InlineManualComponent.js";import M from"./components/HighlightButtonComponent.js";import{escapeTagIds as T,splitTagAcrossParagraphs as P}from"../../../../utils/tagHelper.js";const D=t(!1),_=t({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),H=t({rowId:""}),F=({aiReason:n,isHighConfidence:o,customStyle:t,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=c(_),{rowId:u}=c(H),p=String(n.id);u&&s.current.set(p,u);const h=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===n.id,v=o?(null==l?void 0:l.highConfidence)||e(S,{}):(null==l?void 0:l.lowConfidence)||e(b,{});return i("button",{className:g.aiReasoningButton,style:t,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(h?null:u,h?null:n)},children:[v,e("i",h?{className:`pi pi-angle-up ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`})]})},B=({children:n,node:o,customStyles:t,customIcons:r})=>{var d,a;const s=l(Math.random().toString(36).slice(2)).current,{expandedInfo:u}=c(_),p=(null==u?void 0:u.rowId)===s,h=Array.isArray(null==o?void 0:o.children)?o.children.filter(e=>"element"===e.type).length:1,v=null!==(a=null===(d=null==o?void 0:o.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return i(H.Provider,{value:{rowId:s},children:[e("tr",{style:v?{cssText:v}:void 0,children:n}),p&&(null==u?void 0:u.aiReason)&&e("tr",{style:{width:"100%"},children:e("td",{colSpan:h||1,className:g.tableExpandedCell,children:e("div",{className:g.tableExpandedCellInner,children:e("div",{className:g.tableExpandedCellContent,children:e(A,{aiReason:u.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==t?void 0:t.aiReasoningContent,aiReasoningAccordion:null==t?void 0:t.aiReasoningAccordion,aiReasoningMarkdown:null==t?void 0:t.aiReasoningMarkdown,aiReasoningPill:null==t?void 0:t.aiReasoningPill,webCitation:null==t?void 0:t.webCitation,stormeeCitation:null==t?void 0:t.stormeeCitation,waveformCitation:null==t?void 0:t.waveformCitation,imageCitation:null==t?void 0:t.imageCitation,fileCitation:null==t?void 0:t.fileCitation,appModCitation:null==t?void 0:t.appModCitation,rcaCitation:null==t?void 0:t.rcaCitation,readFileCitation:null==t?void 0:t.readFileCitation,loadingCitations:null==t?void 0:t.loadingCitations,chatCitation:null==t?void 0:t.chatCitation}})})})})})]})};const W=["del","ins"];function O(e){return function(e,n,i){const o=n.join("|");return e.replace(new RegExp(`<(${o})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,o)=>`<${n}>${i(o)}</${n}>`)}(e,W,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var o;return`<code>${t=null!==(o=n[Number(i)])&&void 0!==o?o:"",t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var t})}(e)).join(""))}const V=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function q(e,n){const i=[],t=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!o.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(d))return i.push(e),null;if(V.has(d))return e;const a=null===(r=o.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?o.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const z=({message:t,noMarkdownContent:S,useMarkdown:b=!0,isParent:A,scenario:H,showUserStoryDiff:W=!1,aiReasoningsForBlock:V,isCitationLoadingDisplay:z=!1,className:G,highConfidenceIcon:Q,lowConfidenceIcon:J,customStyles:K,customIcons:X,contextVariant:Y,aiReasoningDiffView:Z,userStoryCitations:ee,artifactId:ne,isCraflow:ie,onCraAccept:oe,onCraReject:te,craFlowConfig:le,isDisplayHighlightControl:re=!1,showConfidenceScore:de=!0,CDNeededInChip:ae,blockId:se,showWaitingIconInChip:ce})=>{var ue;console.log("userstorywithcitation blockid ",se);const pe=l(null),{userStory:ge,inlineUpdateComponentConfig:he,getAvgScoreForStory:ve,setUserStory:me,aiReasoning:Ce,setAiReasoning:fe,customIcons:ye,searchQueryList:we,searchQueryReasoningIdList:Ie,currentHighlightIndex:Se,segmentComponentConfig:be,inlineManualComponentConfig:Re,diffEditConfig:$e}=I(),xe=null!=X?X:null==ye?void 0:ye.userStoryIcons;null==K||K.searchHighlight;const{search:Ne,clear:ke}=h(pe),[Ae,je]=r("1"),[Ue,Ee]=r(null),Le=l(new Map),[Me,Te]=r(new Set),Pe=d((e,n)=>{Ee(e&&n?{rowId:e,aiReason:n}:null)},[]),De=ne?ve(ne):0,[_e,He]=r([]),Fe=d(e=>{Te(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Be=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Be).join(""):o.isValidElement(e)?Be(e.props.children):"",We=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,o,t)=>{const l=o.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,o,t)=>{const l=n.substring(0,t),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=o;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let o;const t=new RegExp(n.source,n.flags);for(;null!==(o=t.exec(e));){const e=o[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),t=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:o.index,endIndex:o.index+o[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==t?void 0:t[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],o=n.changedItemCount-n.deletedItemCount;if(0===o)continue;const t=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of t){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+o}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=O(n),n},Oe=a(()=>t?We(t):t,[t]);s(()=>{He(V||Ce)},[V,Ce]);const Ve=a(()=>({span:({node:n,children:i,...o})=>{var t,l,r,d,a;const s=null!==(l=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==l?l:null==o?void 0:o["highlight-id"],c="string"==typeof s&&Me.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==o?void 0:o["highlight-color"];return e("span",{style:{...null!==(a=null==K?void 0:K.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:i,children:o,...t})=>{var l,r,d,a,s,c;const u=null!==(r=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.action)&&void 0!==r?r:null==t?void 0:t.action,p=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==t?void 0:t["highlight-id"],g=null!==(c=null===(s=null==i?void 0:i.properties)||void 0===s?void 0:s["highlight-type"])&&void 0!==c?c:null==t?void 0:t["highlight-type"];return"highlight"===u?e(M,{highlightId:p,handleHighlightSpan:Fe,icon:"web"===g?null==xe?void 0:xe.webCitationIcon:"doc"===g?null==xe?void 0:xe.fileCitationIcon:e(n,{}),customStyles:"web"===g?null==K?void 0:K.webButton:"doc"===g?null==K?void 0:K.docButton:{}}):null},upt:({node:i,children:o,...t})=>{var l,r;const d=null==t?void 0:t.id,a=d?null===(r=null===(l=d.split("$"))||void 0===l?void 0:l[1])||void 0===r?void 0:r.replaceAll("@","<").replaceAll("#",">"):null,s=Ce.find(e=>e.id.toString()===a);if(!s)return o||e(n,{});const c="data-main"in t,u=t["data-status"];return e(n,{children:e(j,{aiReason:s,customStyles:null==K?void 0:K.inlineUpdatedComponent,handleClickCognitiveDecision:null==he?void 0:he.handleClickCognitiveDecision,handleClickUpdatedPill:null==he?void 0:he.handleClickUpdatedPill,handleClickOutputValue:null==he?void 0:he.handleClickOutputValue,customIcons:null==he?void 0:he.customIcons,CDNeededInChip:ae,showWaitingIconInChip:ce,showChip:c,status:u,children:o||e(n,{})})})},del:({node:o,children:t,...l})=>{var r;const{cleanedChildren:d,extractedNodes:a}=q(t,["ins"]);return i(n,{children:[e("span",{className:g.deleted,style:null!==(r=null==K?void 0:K.deleted)&&void 0!==r?r:{},...l,onClick:()=>{l.onclick&&l.onclick()},children:d}),a]})},ins:({children:o,...t})=>{var l;const{cleanedChildren:r,extractedNodes:d}=q(o,["del"]);return i(n,{children:[e("span",{className:g.inserted,style:null!==(l=null==K?void 0:K.inserted)&&void 0!==l?l:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:r}),d]})},preserved:({children:n,...i})=>e("span",{className:g.preserved,style:null==K?void 0:K.preserved,...i,children:n}),manual:({children:i,...o})=>{var t;const l=null===(t=null==o?void 0:o.id)||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),r=Ce.find(e=>e.id.toString()===l),d=o["data-status"];return r?e(L,{aiReason:r,handleClick:null==Re?void 0:Re.handleClick,status:d,children:i}):i||e(n,{})},invisible:({children:i,...o})=>e(n,{}),h1:({node:n,...i})=>e("h1",{className:g.heading1,style:null==K?void 0:K.heading1,children:i.children}),h2:({node:n,...i})=>e("h2",{className:g.heading2,style:null==K?void 0:K.heading2,children:i.children}),h3:({node:n,...i})=>e("h3",{className:g.heading3,style:null==K?void 0:K.heading3,children:i.children}),b:({node:n,...i})=>e("b",{className:g.bold,style:null==K?void 0:K.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e("p",{...i,className:g.paragraph,style:null==K?void 0:K.paragraph,children:i.children}),updated:({node:n,...i})=>e(f,{...i,showUserStoryDiff:W,currentUpdatedTagId:Ae,setCurrentUpdatedTagId:je,userStory:ge,setUserStory:me,setAiReasoning:fe,node:n,isCraflow:ie,onCraAccept:oe,onCraReject:te,diffEditConfig:$e,customStyles:null==K?void 0:K.updatedContent,craFlowConfig:le}),ol:({node:n,...i})=>{var o,t,l;const r=null!==(l=null!==(t=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.start)&&void 0!==t?t:null==i?void 0:i.start)&&void 0!==l?l:void 0;return e("ol",{className:g.orderedList,style:null==K?void 0:K.olist,...r?{start:Number(r)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>e("ul",{className:g.unorderedList,style:null==K?void 0:K.ulist,children:null==i?void 0:i.children}),table:({children:n})=>e("div",{className:g.tableWrapper,children:e("table",{className:g.table,style:null==K?void 0:K.table,children:n})}),tr:({node:n,children:i})=>e(B,{node:n,children:i,customStyles:K}),td:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("td",{...l,style:t?{cssText:t}:void 0,children:i})})},th:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("th",{...l,style:t?{cssText:t}:void 0,children:i})})},recommendation:({node:n,...i})=>{var o;const t=`The AI has selected this content based on: ${(null===(o=null==i?void 0:i.children)||void 0===o?void 0:o[0])||""}`;return e(N,{...i,customStyles:null==K?void 0:K.recommendationBlock,label:t})},a:({inline:n,children:i,node:o,...t})=>{var l,r,d;const a=c(D)||"true"==(null==t?void 0:t.table),s=`${null==t?void 0:t.href}`,u=null===(l=s.split("$"))||void 0===l?void 0:l[0],p=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===u){const n=(null!==(d=W?Z:Ce)&&void 0!==d?d:[]).find(e=>e.id.toString()===decodeURIComponent(p)),o=Ie.includes(p);if(n){if(a)return e(F,{aiReason:n,customStyle:null==K?void 0:K.tableAiReasoning,customIcons:xe,isHighConfidence:n.relevance_score>=$});const t=Be(i),l="source"!==t.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:o,inlineLabel:t,isInlineCitation:l,customIcons:xe,customStyles:{aiReasoningContent:null==K?void 0:K.aiReasoningContent,aiReasoningAccordion:null==K?void 0:K.aiReasoningAccordion,aiReasoningMarkdown:null==K?void 0:K.aiReasoningMarkdown,aiReasoningPill:null==K?void 0:K.aiReasoningPill,webCitation:null==K?void 0:K.webCitation,stormeeCitation:null==K?void 0:K.stormeeCitation,waveformCitation:null==K?void 0:K.waveformCitation,imageCitation:null==K?void 0:K.imageCitation,fileCitation:null==K?void 0:K.fileCitation,appModCitation:null==K?void 0:K.appModCitation,rcaCitation:null==K?void 0:K.rcaCitation,readFileCitation:null==K?void 0:K.readFileCitation,loadingCitations:null==K?void 0:K.loadingCitations,chatCitation:null==K?void 0:K.chatCitation,bigEnoughCitation:null==K?void 0:K.bigEnoughCitation}})}}return null},code:({inline:n,children:i,className:o,node:t,...l})=>/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?e("div",{children:e("code",{className:g.blockCode,style:null==K?void 0:K.code,children:i})}):e("code",{className:g.inlineCode,style:null==K?void 0:K.code,children:i}),learned:({children:n})=>e(m,{title:n,placement:"top",children:e(v,{size:16,className:g.learned})}),generatedcode:({node:n,...i})=>{const o=(null==i?void 0:i.language)||"python",t=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n})(i);return e(y,{title:"Generated Code",code:t,language:o,customStyles:{pill:null==K?void 0:K.generatedCodePill,content:null==K?void 0:K.generatedCodeContent}})},updatedsegment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(o),c=e("div",s?{dangerouslySetInnerHTML:{__html:C.sanitize(s)}}:{children:i});return e(U,{id:a,node:n,children:c,props:o,segmentComponentConfig:be,customStyles:K,customIcons:X,extractText:Be,isUpdatedSegment:!0})},segment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e(U,{id:a,node:n,children:i,props:o,segmentComponentConfig:be,customStyles:K,customIcons:X,extractText:Be,blockId:se})}}),[_e,le,Ce,ee,Ae,W,t,X,we,Ie,K,be,Me,Fe,se]),qe=a(()=>{let e=T(Oe,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=P(e,n,"upt"===n)}),e},[Oe]);return s(()=>{if(!pe.current)return;if(!we.length)return void ke();let e;if(0===Ie.length||re)requestAnimationFrame(()=>{Ne([we[Se].replace(/\*/g,"")])});else{const n=pe.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{Ne([we[Se].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[we,Ie,Se,re]),e(_.Provider,{value:{expandedInfo:Ue,setExpanded:Pe,reasonToRow:Le},children:i("div",{ref:pe,className:`${g.container} ${"approving"!==H?g.wrapper:""} ${G||""}`,style:null==K?void 0:K.container,children:[b?e(E,{children:e(u,{components:Ve,rehypePlugins:[p],children:qe})}):S,De>0&&de&&e("div",{className:g.confidenceScoreContainer,style:null==K?void 0:K.confidenceScoreContainer,children:i("span",{className:g.confidenceScore,style:null==K?void 0:K.confidenceScore,children:[e(x,{size:14,color:(null==K?void 0:K.confidenceScoreIconColor)||"#166534"}),De,"%"]})}),z&&e("div",{className:g.citationLoader,style:null==K?void 0:K.citationLoaderContainer,children:e(w,{customStyles:{container:null==K?void 0:K.citationLoadingContainer,icon:null==K?void 0:K.citationLoadingIcon,text:null==K?void 0:K.citationLoadingText}})}),A&&e("div",{style:{...null===(ue=null==K?void 0:K.attachedContext)||void 0===ue?void 0:ue.wrapper},className:"flex mt-5",children:e(k,{customStyles:null==K?void 0:K.attachedContext,variant:Y})})]})})};export{z as default,q as splitNestedDiffNodes};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e={container:"UserStoryWithCitation-module_container__YRdbR",wrapper:"UserStoryWithCitation-module_wrapper__wbnqg",heading1:"UserStoryWithCitation-module_heading1__KsWUO",heading2:"UserStoryWithCitation-module_heading2__GHshw",heading3:"UserStoryWithCitation-module_heading3__Jm9Xb",bold:"UserStoryWithCitation-module_bold__HenfX",paragraph:"UserStoryWithCitation-module_paragraph__a1-pc",orderedList:"UserStoryWithCitation-module_orderedList__E5PQa",unorderedList:"UserStoryWithCitation-module_unorderedList__SFvpc",inlineCode:"UserStoryWithCitation-module_inlineCode__5014y",blockCode:"UserStoryWithCitation-module_blockCode__pmHG5",learned:"UserStoryWithCitation-module_learned__0US6d",linkText:"UserStoryWithCitation-module_linkText__5kBNv",tableWrapper:"UserStoryWithCitation-module_tableWrapper__r94Fx",table:"UserStoryWithCitation-module_table__tEyKd",scrollContainer:"UserStoryWithCitation-module_scrollContainer__S-BtW",citationLoader:"UserStoryWithCitation-module_citationLoader__Op7Sm",aiReasoningButton:"UserStoryWithCitation-module_aiReasoningButton__-tprH",aiReasoningIconHighConfidence:"UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6",aiReasoningIconLowConfidence:"UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz",confidenceScoreContainer:"UserStoryWithCitation-module_confidenceScoreContainer__zOE-E",confidenceScore:"UserStoryWithCitation-module_confidenceScore__lhT4p",inserted:"UserStoryWithCitation-module_inserted__66gBL",deleted:"UserStoryWithCitation-module_deleted__mzR4t",preserved:"UserStoryWithCitation-module_preserved__ND8uC"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode('.UserStoryWithCitation-module_container__YRdbR{box-sizing:border-box;position:relative;width:100%}.UserStoryWithCitation-module_wrapper__wbnqg{border:1px solid #d5d5d5;border-radius:16px;padding:20px}.UserStoryWithCitation-module_heading1__KsWUO{color:#000;font-family:Inter,sans-serif;font-size:1.5rem;margin:.75rem 0 .25rem;padding:0}.UserStoryWithCitation-module_heading2__GHshw{color:#000;font-family:Inter,sans-serif;font-size:1.25rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_heading3__Jm9Xb{color:#000;font-family:Inter,sans-serif;font-size:1.125rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_bold__HenfX{font-family:Inter,sans-serif;font-weight:700}.UserStoryWithCitation-module_paragraph__a1-pc{word-wrap:break-word;display:block;flex-wrap:wrap;font-family:Inter,sans-serif;font-size:1rem;line-height:1.75rem;margin:0;max-width:100%;overflow:hidden;overflow:visible;overflow-wrap:break-word;text-align:justify;white-space:normal;word-break:break-word}.UserStoryWithCitation-module_orderedList__E5PQa{font-family:Inter,sans-serif;list-style-type:decimal;margin-left:1rem}.UserStoryWithCitation-module_unorderedList__SFvpc{font-family:Inter,sans-serif;list-style-type:disc;margin-left:1rem}.UserStoryWithCitation-module_inlineCode__5014y{background-color:#d633840d;border-radius:.3rem;box-sizing:border-box;color:#d63384;font-family:Source Code Pro,monospace;font-size:.95em;overflow-wrap:break-word;padding:.2rem .5rem;white-space:pre-wrap;width:100%;word-break:break-word}.UserStoryWithCitation-module_blockCode__pmHG5{color:#d63384;display:block;overflow:hidden;white-space:pre-wrap;word-break:break-words}.UserStoryWithCitation-module_learned__0US6d{color:#3b82f6;cursor:pointer;display:inline-block;margin-left:.25rem;margin-right:.25rem}.UserStoryWithCitation-module_linkText__5kBNv:hover{color:#1d4ed8}.UserStoryWithCitation-module_tableWrapper__r94Fx{box-sizing:border-box;max-width:100%;overflow-x:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd{border-collapse:collapse;box-sizing:border-box;margin:20px 0;table-layout:fixed;width:100%}.UserStoryWithCitation-module_scrollContainer__S-BtW{overflow:hidden}.UserStoryWithCitation-module_citationLoader__Op7Sm{bottom:0;left:0;margin-top:12px}.UserStoryWithCitation-module_aiReasoningButton__-tprH{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;gap:2px;padding:2px 4px;vertical-align:middle}.UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6{color:#4b5563;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz{color:#cf4343;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_confidenceScoreContainer__zOE-E{position:absolute;right:12px;top:12px;z-index:10}.UserStoryWithCitation-module_confidenceScore__lhT4p{align-items:center;background-color:#f0fdf4;border:1px solid #bbf7d0;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#166534;display:inline-flex;font-family:Inter,sans-serif;font-size:12px;font-weight:700;gap:4px;padding:4px 8px}.UserStoryWithCitation-module_orderedList__E5PQa{counter-reset:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa>li{counter-increment:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:childItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:childItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:grandchildItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:grandchildItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) "." counter(grandchildItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_inserted__66gBL{background-color:#8cbeff}.UserStoryWithCitation-module_deleted__mzR4t{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}.UserStoryWithCitation-module_preserved__ND8uC{background-color:#fff;text-decoration:underline;text-decoration-color:#d3d3d3}[class*=_upt-]>[class*=_inserted_]{background-color:#f3e8ff}[class^=_manual-]>[class^=_inserted_]{background-color:#8cbeff}'));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l,Fragment as n}from"react/jsx-runtime";import{Divider as o,CircularProgress as i}from"@mui/material";import{hexToOpacity as t}from"../../../utils/css.utils.js";import r from"./InlineUpdatedComponent.module.css.js";import d from"../../../icons/CognitiveDecision.js";import{Check as a,X as s,Undo2 as c,Hourglass as u,ChevronDown as v}from"lucide-react";import{useRef as p,useState as m,useCallback as g,useLayoutEffect as
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as n}from"react/jsx-runtime";import{Divider as o,CircularProgress as i}from"@mui/material";import{hexToOpacity as t}from"../../../utils/css.utils.js";import r from"./InlineUpdatedComponent.module.css.js";import d from"../../../icons/CognitiveDecision.js";import{Check as a,X as s,Undo2 as c,Hourglass as u,ChevronDown as v}from"lucide-react";import{useRef as p,useState as m,useCallback as g,useLayoutEffect as h}from"react";const f=({aiReason:f,children:C,customStyles:y,handleClickCognitiveDecision:w,handleClickUpdatedPill:b,handleClickOutputValue:N,customIcons:k,CDNeededInChip:I=!0,showWaitingIconInChip:D=!1,showChip:P,status:S})=>{var _,W,$,z,j,x,A,L,R,T,E,M,O,U,B,F,H,q,V;const G=p(null),J=p(null),[K,Q]=m(null),X=g(()=>{var e;const l=J.current,n=(null===(e=G.current)||void 0===e?void 0:e.offsetParent)||(null==l?void 0:l.offsetParent);if(!(l&&n instanceof HTMLElement))return;const o=l.getBoundingClientRect(),i=n.getBoundingClientRect(),t=o.top-i.top+o.height/2;Q(e=>null!==e&&Math.abs(e-t)<.5?e:t)},[]);h(()=>{X()}),h(()=>{var e,l;if("undefined"==typeof window)return;const n=window.requestAnimationFrame(X);window.addEventListener("resize",X);const o="undefined"!=typeof ResizeObserver?new ResizeObserver(X):null;J.current&&(null==o||o.observe(J.current));const i=(null===(e=G.current)||void 0===e?void 0:e.offsetParent)||(null===(l=J.current)||void 0===l?void 0:l.offsetParent);return i instanceof HTMLElement&&(null==o||o.observe(i)),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",X),null==o||o.disconnect()}},[X]);const Y="pending"!==S?"#303030":null===($=null===(W=null===(_=f.redlining_details)||void 0===_?void 0:_.evaluation_outputs)||void 0===W?void 0:W.metadata)||void 0===$?void 0:$.label_color,Z={color:Y||"#000000",background:t(Y||"#000000",25),border:`1px solid ${t(Y||"#000000",75)}`},ee=Y||"#000000",le=t(Y||"#000000",25),ne={background:t(Y||"#000000",75),...null==y?void 0:y.dividerStyle};let oe=null;"accepted"===S?oe=null!==(z=null==k?void 0:k.accepted)&&void 0!==z?z:e(a,{color:"#16A34A"}):"rejected"===S?oe=null!==(j=null==k?void 0:k.rejected)&&void 0!==j?j:e(s,{color:"#DC2626"}):"reverted"===S&&(oe=null!==(x=null==k?void 0:k.reverted)&&void 0!==x?x:e(c,{color:"#475569"}));const ie=null===K?{}:{"--inline-update-anchor-top":`${K}px`},te=null===K?"":` ${r.anchorAligned}`;return l("span",{className:r.inlineUpdatedWrapper,children:[P&&l(n,{children:[oe&&e("span",{className:`${r.resolvedStatus}${te}`,style:{...ie,...null==y?void 0:y.resolvedIcon},children:oe}),e("span",{ref:G,id:f.id.toString(),onClick:e=>{e.stopPropagation(),null==b||b(e.currentTarget,f)},className:`${r.pillWrapper}${te}`,style:{...ie,...null==y?void 0:y.pillStyleWrapper},children:l("span",{className:r.pillComponent,style:{...Z,...null===(A=null==y?void 0:y.pillComponent)||void 0===A?void 0:A.commonStyle},children:[e("span",{children:(null===(T=null===(R=null===(L=f.redlining_details)||void 0===L?void 0:L.evaluation_outputs)||void 0===R?void 0:R.metadata)||void 0===T?void 0:T.label_text)||""}),e(o,{className:r.dividerStyle,style:ne}),D&&"pending"===S&&l(n,{children:[e("span",{className:r.waitingIconWrapper,style:{color:Y},title:"Waiting",children:e(u,{size:16})}),e(o,{className:r.dividerStyle,style:ne})]}),e("span",{className:r["output-container"],onClick:e=>{N&&(e.stopPropagation(),null==N||N(e.currentTarget,f))},children:f.resolving?e(i,{size:(null===(E=null==y?void 0:y.loader)||void 0===E?void 0:E.size)||18,"aria-label":"Loading…",sx:{color:(null===(M=null==y?void 0:y.loader)||void 0===M?void 0:M.color)||Y}}):"pending"!==S?oe:null===(U=null===(O=null==f?void 0:f.redlining_details)||void 0===O?void 0:O.evaluation_outputs)||void 0===U?void 0:U.output_value}),I&&l(n,{children:[e(o,{className:r.dividerStyle,style:ne}),e("span",{onClick:e=>{e.stopPropagation(),null==w||w(e.currentTarget,f)},className:r.cognitiveDecisionWrapper,style:null===(B=null==y?void 0:y.cognitiveDecisionIcon)||void 0===B?void 0:B.wrapper,children:e(d,{color:(null===(F=null==y?void 0:y.cognitiveDecisionIcon)||void 0===F?void 0:F.color)||ee,backgroundColor:(null===(H=null==y?void 0:y.cognitiveDecisionIcon)||void 0===H?void 0:H.backgroundColor)||le})}),e("span",{className:r.chevronWrapper,style:null===(q=null==y?void 0:y.Chevron)||void 0===q?void 0:q.wrapper,children:e(v,{color:(null===(V=null==y?void 0:y.Chevron)||void 0===V?void 0:V.color)||Y})})]})]})})]}),e("span",{ref:J,className:r[`upt-${S}`],onClick:e=>{e.preventDefault(),e.stopPropagation(),G.current&&(null==b||b(G.current,f))},children:C})]})};export{f as default};
|
|
2
2
|
//# sourceMappingURL=InlineUpdatedComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useRef as e}from"react";import{processAIReasoningFromBlocks as i}from"../utils/proccess-stream.utils.js";function t({setUserStory:t,setAiReasoning:o,setUserStoryCitations:n,onStreamingCompleted:r,isGraphQLCallInProgress:s,knowledgeBase:a,projectAnalyserSummary:u,dataSourceFiles:l,aiReasoning:c,setRedisValue:d,fetchCitationByBlock:p}){const _=e(new Set),m=e(new Set),g=e(null),b=e(null),v=e({gap_items_prompt:"",risk_items_prompt:""}),f=e(new Set);async function h(e,i,t){var a,u;let l="",c="";try{const r=await p(e,t,i);o(e=>{var i;const t=[...e];return null===(i=r.response.ai_reasonings)||void 0===i||i.forEach(e=>{const i=t.findIndex(i=>i.id===e.id);-1!==i&&e.gap.length>0&&e.reason.length>0&&(t[i]={...e})}),t}),l=(null===(a=r.response)||void 0===a?void 0:a.gap_items_prompt)||"",c=(null===(u=r.response)||void 0===u?void 0:u.risk_items_prompt)||"",(l||c)&&(v.current={gap_items_prompt:l,risk_items_prompt:c}),n(e=>{var i,t,o,n,s,a,u,l,c,d,p,_,m,g;return{...e,appmod_citations:[...null!==(i=e.appmod_citations)&&void 0!==i?i:[],...null!==(t=r.response.appmod_citations)&&void 0!==t?t:[]],audio_citations:[...null!==(o=e.audio_citations)&&void 0!==o?o:[],...null!==(n=r.response.audio_citations)&&void 0!==n?n:[]],file_citations:[...null!==(s=e.file_citations)&&void 0!==s?s:[],...null!==(a=r.response.file_citations)&&void 0!==a?a:[]],image_citations:[...null!==(u=e.image_citations)&&void 0!==u?u:[],...null!==(l=r.response.image_citations)&&void 0!==l?l:[]],rca_citations:[...null!==(c=e.rca_citations)&&void 0!==c?c:[],...null!==(d=r.response.rca_citations)&&void 0!==d?d:[]],web_citations:[...null!==(p=e.web_citations)&&void 0!==p?p:[],...null!==(_=r.response.web_citations)&&void 0!==_?_:[]],readfile_citations:[...null!==(m=e.readfile_citations)&&void 0!==m?m:[],...null!==(g=r.response.readfile_citations)&&void 0!==g?g:[]]}})}catch(i){console.error("[liblogs] processCitationsByBlock error — story:%s block:%s",e.storyNumber,e.blockNumber,i)}finally{let i=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}`;if(m.current.add(i),m.current.size===_.current.size&&!s.current){const e=l||v.current.gap_items_prompt,i=c||v.current.risk_items_prompt;await r(e,i),_.current.clear(),m.current.clear(),g.current=null,b.current=null,v.current={gap_items_prompt:"",risk_items_prompt:""},f.current.clear()}}}return{processStreamContent:function(e,r,s){try{const p=JSON.stringify(e);if(b.current===p)return;b.current=p;let m=[],v=[];e=e.map(e=>{var t;const o=`${(e={...e,subBlockNumber:null!==(t=e.subBlockNumber)&&void 0!==t?t:"1"}).storyNumber}-${e.blockNumber}-${e.subBlockNumber}`;if(f.current.has(o))return null;f.current.add(o);let{outputText:s,reasonings:a,gpt_citation:u,processedDescription:l}=i(e.value,e.blockNumber,e.storyNumber,e.description);n(e=>{var i;return u.length>0&&((null==e?void 0:e.gpt_citations)||(e.gpt_citations=[]),null===(i=e.gpt_citations)||void 0===i||i.push(...u)),{...e}}),m.push(...a),v.push([...a]);let c=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}<SUB_BLOCK>${e.subBlockNumber}`;return _.current.has(c)||(h({...e,value:s,description:l},a,r),_.current.add(c)),{...e,value:s,description:l}}).filter(Boolean),m.forEach(e=>{o(i=>(i.find(i=>i.id===e.id)||i.push(e),[...i]))}),e.length>0&&e.map(({title:e,section:i,value:o,storyNumber:n,description:r,blockNumber:p,big_enough:_,big_enough_decision_factors:m,gapValue:b,confidenceScore:f,metadata:h},N)=>{t(t=>{var y,k,S,B,R,$,w,C;const O=t.findIndex(e=>e.storyNumber===n);if("intro"===i)-1===O?t.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,description:r,storyNumber:n,sub_features:[],section:i,blockNumber:p,aiReasoning:v[N],big_enough:_,big_enough_decision_factors:m,gapValue:b,confidenceScore:f,metadata:h}):(t[O].value+=o,t[O].aiReasoning=t[O].aiReasoning||[],null===(k=null===(y=t[O])||void 0===y?void 0:y.aiReasoning)||void 0===k||k.push(...v[N]),t[O].big_enough=_,t[O].big_enough_decision_factors=m,t[O].gapValue=b,t[O].confidenceScore=f,t[O].metadata=h);else{t[O].sub_features||(t[O].sub_features=[]);const r=(null===(B=null===(S=t[O])||void 0===S?void 0:S.sub_features)||void 0===B?void 0:B.findIndex(e=>e.blockNumber===p))||-1;if(-1===r)null===($=null===(R=t[O])||void 0===R?void 0:R.sub_features)||void 0===$||$.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,storyNumber:n,blockNumber:p,section:i,aiReasoning:v[N],big_enough:_,big_enough_decision_factors:m,gapValue:b,confidenceScore:f,metadata:h});else{let e=null===(C=null===(w=null==t?void 0:t[O])||void 0===w?void 0:w.sub_features)||void 0===C?void 0:C[r];e.value=(e.value||"")+o,e.aiReasoning=e.aiReasoning||[],e.aiReasoning.push(...v[N]),e.big_enough=_,e.big_enough_decision_factors=m,e.gapValue=b,e.confidenceScore=f,e.metadata=h}}const E=JSON.stringify(t);return g.current!==E&&(d({key:`streaming-redis-key-${s}`,value:{mmvf_list:t,knowledgeBase:a,projectAnalyserSummary:u,dataSources_files:l,ai_reasonings:c}}),g.current=E),[...t]})})}catch(e){console.error("Error in processing Stream Content",e)}}}}export{t as useStreamContentHandler};
|
|
2
2
|
//# sourceMappingURL=useStreamContentHandler.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e){try{return e}catch(e){console.error("Error in formatMarkdown",e)}}function r(e){return e.includes("Acceptance Criteria")?e=null==(e=null==(e=null==(e=null==e?void 0:e.replace(/\\n/g,"\n"))?void 0:e.replace(/(\*\*.+?\*\*)\s*:/g,"\n$1:\n"))?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,(e,r)=>{const n=r.split(".");return`${" ".repeat(n.length-1)}${r}.`}))?void 0:e.replace(/([^\n])\n(?![\n\*#])/g,"$1<br>\n"):e}const n=e=>{if(!e)return"";e=(e=(e=(e=(e=e.replace(/%&&%[\s\S]*?%&&%/g,"")).replace(/<!--[\s\S]*?-->/g,"")).replace(/<crredirection[^>]*>[\s\S]*?<\/crredirection>/gi,"")).replace(/<answerExample[^>]*>[\s\S]*?<\/answerExample>/gi,"")).replace(/<a\s+data-cognitive-reasoning[^>]*>[\s\S]*?<\/a>/gi,"");return["b","strong","i","em","u","ol","ul","li","p","div","span","h1","h2","h3","h4","h5","h6","highlight","br","hr"].forEach(r=>{const n=new RegExp(`</?${r}[^>]*>`,"gi");e=e.replace(n,"")}),e=(e=(e=(e=(e=e.replace("ð","")).replace(/\*\*/g,"")).replace(/\n/g," ")).replace(/\s+/g," ")).trim()},a=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return Array.from(r.querySelectorAll('a[href^="ai_reasoning$"]')).map(e=>e.getAttribute("href").replace("ai_reasoning$",""))},t=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return r.querySelectorAll('a[href^="ai_reasoning$"]').forEach(e=>{e.remove()}),r.body.innerHTML.trim()};export{a as extractAllAiReasoningIds,e as formatMarkdown,r as indentMarkdown,t as stripAiReasoningAnchors,n as stripHtmlAndMetadata};
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=e=>{const
|
|
1
|
+
const e=e=>{const t=[];try{const n="<BLOCK_STREAM_START>",r="<BLOCK_STREAM_END>";let i=0;for(;;){const o=e.indexOf(n,i);if(-1===o)break;const s=e.indexOf(r,o+n.length);if(-1===s)break;const c=e.slice(o+n.length,s).trim();t.push(JSON.parse(c)),i=s+r.length}}catch(e){console.error("Error in extracting blocks from stream",e)}finally{return t}};function t(e,t,i,o){const s=[];let c="";const a=[];let l="";console.log("RAW INPUT",JSON.stringify(e),JSON.stringify(o));try{const u=e=>e.replace(/<a\s+(?:(table="true")\s+)?href=(\\"|")ai_reasoning\$(\d+)(\\"|")>([\s\S]*?)<\/a>/g,(e,o,c,l,u,f)=>{var d,h,g,p,_;const b=`${l}<BLOCK_NUMBER>${t}<STORY_NUMBER>${i}`,$=function(e){const t=new Map,n="<gpt_citation ",r="</gpt_citation>";let i=0;for(;;){const o=e.indexOf(n,i);if(-1===o)break;const s=e.indexOf(">",o);if(-1===s)break;const c=e.indexOf(r,s);if(-1===c)break;const a=e.slice(o,c+r.length),l=e.slice(o,s+1),u=l.indexOf("id=");if(-1!==u){let e=u+3;"\\"===l[e]&&e++,'"'!==l[e]&&"'"!==l[e]||e++;let n="";for(;e<l.length&&/\d/.test(l[e]);)n+=l[e++];n&&t.set(n,a)}i=c+r.length}return t}(f);console.log("RAW INPUT",$);const m=f.match(/<reason(?:\s+source="([^"]*)")?>([\s\S]*?)<\/reason>/),v=f.match(/<gap(?:\s+source="([^"]*)")?>([\s\S]*?)<\/gap>/),O=f.match(/<relevance_score>([\s\S]*?)<\/relevance_score>/);let T=(null===(d=null==m?void 0:m[2])||void 0===d?void 0:d.trim())||"",S=(null===(h=null==v?void 0:v[2])||void 0===h?void 0:h.trim())||"";T=n(T,b),S=n(S,b),$.forEach((e,t)=>{const n=`${b}<GPT_CITATION_ID>${t}`;a.push(r(e,n))}),s.push({id:b,reason:T,reasonSource:(null===(g=null==m?void 0:m[1])||void 0===g?void 0:g.trim())||"",gap:S,gapSource:(null===(p=null==v?void 0:v[1])||void 0===p?void 0:p.trim())||"",relevance_score:Number(null===(_=null==O?void 0:O[1])||void 0===_?void 0:_.trim())||0});return`<a ${o?'table="true"':""} href=${c}ai_reasoning$${b}${u}>Source</a>`});c=u(e),o&&(l=u(o))}catch(t){console.error("Error in extracting AI Reasoning from this block:",e)}finally{return{outputText:c,reasonings:s,gpt_citation:a,processedDescription:l}}}function n(e,t){if(!e)return e;let n="",r=0;for(;;){const i=e.indexOf("<gpt_citation_here ",r);if(-1===i){n+=e.slice(r);break}n+=e.slice(r,i);const o=e.indexOf(">",i);if(-1===o){n+=e.slice(i);break}const s=e.slice(i,o+1),c=s.indexOf("id=");let a="";if(-1!==c){let e=c+3;for("\\"===s[e]&&e++,'"'!==s[e]&&"'"!==s[e]||e++;e<s.length&&/\d/.test(s[e]);)a+=s[e++]}if(a){n+=`<a href="gpt_citation$${`${t}<GPT_CITATION_ID>${a}`}">Source</a>`}r=o+1}return n}function r(e,t){const n=t=>{const n=new RegExp(`<${t}>([\\s\\S]*?)<\\/${t}>`,"gi"),r=[];let i;for(;null!==(i=n.exec(e));)r.push(i[1].trim());return r},r=n("domain"),i=n("paraphrase");return{citation_number:t,customMetadata:{type:"gpt_citation",data_sources:n("data_sources"),training_data_title:r,paraphrase:i}}}const i=(e,t,n)=>{let r=e.includes("<h1><b>Title</b></h1>\n\n")?e:n?`<h1><b>Title</b></h1>\n\n${n} \n${e}`:e;return r=r.includes("<h1><b>Requirement Type</b></h1>\n\n")?r:t?`<h1><b>Requirement Type</b></h1>\n\n${t} \n${r}`:r,r};function o(e){try{const t=/<h2>\s*(?:<b>)?Description(?:<\/b>)?\s*<\/h2>\s*([\s\S]*?)(?=\s*<h2>|$)/i,n=e.match(t);if(n)return n[1].trim()}catch(e){}return null}export{e as extractBlockStreams,o as extractDescription,r as parseGptCitation,t as processAIReasoningFromBlocks,i as processUserStoryValue,n as replaceGptCitation};
|
|
2
2
|
//# sourceMappingURL=proccess-stream.utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as i}from"tslib";import{jsx as t,jsxs as n,Fragment as r}from"react/jsx-runtime";import{useMemo as o,useState as l}from"react";import d from"@mui/icons-material/ChevronRight";import a from"@mui/icons-material/Close";import c from"@mui/icons-material/ExpandMore";import s from"@mui/material/Box";import u from"@mui/material/Button";import m from"@mui/material/ButtonBase";import p from"@mui/material/Divider";import h from"@mui/material/IconButton";import g from"@mui/material/Paper";import f from"@mui/material/Radio";import x from"@mui/material/Stack";import b from"@mui/material/TextField";import C from"@mui/material/Typography";import E from"./CognitiveIcon.js";import v from"./CognitiveScoreBadge.js";import F from"../../assests/icons/InfoAlert.js";var y,S=function(e,t){return i([e],Array.isArray(t)?t:null==t?[]:[t],!0)},w="MERGE_ADJACENT";!function(e){e.KEEP="KEEP",e.SPLIT_HERE="SPLIT_HERE",e.MERGE_NEXT="MERGE_NEXT",e.MERGE_PREV="MERGE_PREV",e.MERGE_PREVIOUS="MERGE_PREVIOUS",e.SET_RANGE="SET_RANGE"}(y||(y={}));var R=function(e){return Object.values(y).includes(e)},A=function(e,t,n,r){if(!t||!e)return[];var o=t.additional_decisions,l=Array.isArray(o)?o:o?Object.values(o).flat():[],d=Array.from(new Set(i(i([],t.allowed_decisions,!0),l,!0)));return d.flatMap(function(i){var t=e.focus_page,o=d.find(function(e){return e.toLowerCase().includes("merge")}),l=null!=t&&null!=n&&null!=r&&t===n&&t===r,a=null!=t&&null!=n&&t===n,c=null!=t&&null!=r&&(t===r||t===r+1),s=a||c||!(null!=t&&(!(null!=n&&null!=r)||t>n&&t<r));switch(i){case y.SET_RANGE:return[];case"KEEP":return[{id:i,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:i,title:"Split to a separate document",description:s?"A valid page inside the document is required to split it.":t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary.",disabled:s}];case"MERGE_PREV":case"MERGE_NEXT":case"MERGE_PREVIOUS":return i!==o?[]:l?[{id:w,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]:a?[{id:y.MERGE_PREVIOUS,title:"Merge with previous document",description:"Combine this document with the previous document."}]:c?[{id:y.MERGE_NEXT,title:"Merge with next document",description:"Combine this document with the next document."}]:[{id:w,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]}return[]})};function M(i){var M=i.headerName,I=void 0===M?"Boundary Check":M,k=i.title,z=i.pageNo,T=i.content,W=i.cognitiveScore,_=i.config,P=i.metadata,G=i.previousSegmentTitle,N=i.nextSegmentTitle,D=i.selectedIndex,B=i.defaultSelectedIndex,H=void 0===B?null:B,j=i.defaultStartPage,O=i.defaultEndPage,V=i.onSelectionChange,U=i.onConfirm,L=i.onActionConfirm,X=i.onCognitiveClick,K=i.onAdjustManually,q=i.onClose,J=i.confirmLabel,Y=void 0===J?"Confirm":J,Q=i.manualPrompt,Z=void 0===Q?"Didn't find the right option?":Q,$=i.manualActionLabel,ee=void 0===$?"Adjust Manually":$,ie=i.cognitiveLabel,te=void 0===ie?"Cognitive Integrity":ie,ne=i.showAdjustManually,re=void 0===ne||ne,oe=i.showCognitiveIntegrity,le=void 0===oe||oe,de=i.showCloseButton,ae=void 0===de||de,ce=i.confirmDisabled,se=void 0!==ce&&ce,ue=i.width,me=void 0===ue?260:ue,pe=i.maxWidth,he=void 0===pe?260:pe,ge=i.className,fe=i.styles,xe=i.reviewAction,be=o(function(){return(null!=_?_:P?A(P,xe,j,O):[]).filter(function(e){return e.id!==y.SET_RANGE})},[_,O,j,P,xe]),Ce=l(H),Ee=Ce[0],ve=Ce[1],Fe=l(null==j?"":String(j)),ye=Fe[0],Se=Fe[1],we=l(null==O?"":String(O)),Re=we[0],Ae=we[1],Me=l(!1),Ie=Me[0],ke=Me[1],ze=l(!1),Te=ze[0],We=ze[1],_e=l(null),Pe=_e[0],Ge=_e[1],Ne=void 0===D?Ee:D,De=null==Ne?void 0:be[Ne],Be=(null==De?void 0:De.id)===w,He=null!=G,je=null!=N,Oe=function(e){return!0===e.disabled||e.id===y.MERGE_PREV&&!He||e.id===y.MERGE_PREVIOUS&&!He||e.id===y.MERGE_NEXT&&!je||e.id===w&&!He&&!je},Ve=Number(ye),Ue=Number(Re),Le=ye.trim().length>0&&Re.trim().length>0&&Number.isInteger(Ve)&&Number.isInteger(Ue)&&Ve>0&&Ue>0&&Ve<=Ue,Xe=se||!De||Oe(De)||Be&&null==Pe||!U&&!L;return t(g,e({className:ge,elevation:4,sx:S({width:me,maxWidth:he,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==fe?void 0:fe.root)},{children:n(x,e({spacing:.75,sx:{p:1}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.75,sx:null==fe?void 0:fe.header},{children:[t(F,{color:"error",height:16,width:16}),t(C,e({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:I})),ae&&t(h,e({size:"small",onClick:q,disabled:!q,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:t(a,{sx:{fontSize:17}})}))]})),n(s,{children:[t(C,e({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:k})),null!=z&&t(C,e({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:z})),t(p,{sx:{my:.625}}),null!=T&&t(C,e({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:T}))]}),n(x,e({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[be.map(function(i,r){var o=Ne===r,l=Oe(i);return n(g,e({variant:"outlined",sx:S({borderColor:o?"#1976d2":"divider",borderRadius:2,bgcolor:l?"#F8FAFC":"background.paper",overflow:"hidden"},null==fe?void 0:fe.option)},{children:[n(m,e({role:"radio","aria-checked":o,disabled:se||l,onClick:function(){return function(e,i){se||Oe(i)||(void 0===D&&ve(e),i.id!==w&&Ge(null),Ie&&(ke(!1),We(!1)),null==V||V(e,i))}(r,i)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[t(f,{checked:o,disabled:se||l,tabIndex:-1,size:"small",sx:{p:.25,mr:.5,"&.Mui-disabled":{color:"#CBD5E1"}}}),n(s,e({sx:{minWidth:0}},{children:[t(C,e({sx:{color:l?"#94A3B8":"text.primary",fontSize:12.5,fontWeight:500}},{children:i.title})),null!=i.description&&t(C,e({sx:{mt:.125,color:l?"#94A3B8":"text.secondary",fontSize:11}},{children:i.description}))]}))]})),o&&i.id===w&&t(x,e({direction:"row",spacing:.75,sx:S({px:.75,pb:.75},null==fe?void 0:fe.adjacentSelector)},{children:[{direction:"previous",title:null!=G?G:"No Previous document",caption:"← Merge into Previous",available:He},{direction:"next",title:null!=N?N:"No Next document",caption:"Merge into Next →",available:je}].map(function(i){var r=Pe===i.direction;return n(x,e({sx:{flex:1,minWidth:0}},{children:[t(m,e({disabled:se||!i.available,onClick:function(){return Ge(i.direction)},"aria-pressed":r,sx:{width:"100%",minWidth:0,minHeight:46,alignItems:"flex-start",justifyContent:"flex-start",p:.625,border:"1px solid",borderColor:r?"#7F56D9":"#D0D5DD",borderRadius:1.5,bgcolor:r?"#E0E7FF":"background.paper",color:r?"#7F56D9":i.available?"text.primary":"#98A2B3",textAlign:"left","&.Mui-disabled":{color:"#98A2B3",bgcolor:"#F8FAFC"}}},{children:t(C,e({sx:{color:"inherit",fontSize:11,fontWeight:500,lineHeight:1.25,overflowWrap:"anywhere"}},{children:i.title}))})),t(C,e({sx:{mt:.5,color:r?"#5925DC":"text.secondary",fontSize:9.5,lineHeight:1.2,whiteSpace:"nowrap",textAlign:"next"===i.direction?"right":"left"}},{children:i.caption}))]}),i.direction)})}))]}),i.id)}),Be&&null!=Pe&&n(x,e({direction:"row",alignItems:"flex-start",spacing:.625,sx:S({p:.75,border:"1px solid #FCA5A5",borderRadius:1.5,bgcolor:"#FEF2F2"},null==fe?void 0:fe.impactWarning)},{children:[t(F,{color:"error",height:14,width:14,sx:{mt:.125}}),n(C,e({sx:{color:"#DC2626",fontSize:10.5,lineHeight:1.4}},{children:["This will impact the ",Pe," document. Its content and page range will change."]}))]})),t(u,e({variant:"contained",fullWidth:!0,disabled:Xe,onClick:function(){if(!Xe&&null!=Ne&&De){var i=Be?"previous"===Pe?y.MERGE_PREVIOUS:y.MERGE_NEXT:De.id,t=Be?e(e({},De),{id:i}):De,n={selectedIndex:Ne,option:t,metadata:P};null==U||U(Ne,t,n),L&&R(i)&&L(i,n)}},sx:S({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==fe?void 0:fe.confirmButton)},{children:Y}))]})),re&&n(x,e({spacing:.625,sx:null==fe?void 0:fe.manualSection},{children:[n(m,e({disabled:se,onClick:function(){var e=!Ie;ke(e),We(!1),e&&(void 0===D&&ve(null),null==K||K())},"aria-expanded":Ie,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[n(s,{children:[t(C,e({sx:{color:"text.primary",fontSize:11}},{children:Z})),t(C,e({sx:{mt:.125,color:"text.primary",fontSize:11}},{children:ee}))]}),t(c,{sx:{color:"text.secondary",fontSize:16,transform:Ie?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),Ie&&!Te&&n(s,e({sx:{pt:.5,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[n(s,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[t(C,e({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Starts"})),t(C,e({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Ends"}))]})),n(s,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[t(b,{size:"small",type:"number",value:ye,disabled:se,onChange:function(e){return Se(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}}),t(b,{size:"small",type:"number",value:Re,disabled:se,error:ye.trim().length>0&&Re.trim().length>0&&Ve>Ue,onChange:function(e){return Ae(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}})]})),t(s,{children:t(u,e({onClick:function(){Le&&We(!0)},disabled:se||!Le,sx:{height:"30px",padding:"0 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"1px solid #8E80F3",borderRadius:"6px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"12px",fontWeight:600,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Le?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Le?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))}),t(s,{sx:{width:"100%",height:"1px",marginTop:"8px",backgroundColor:"#EEF0F2",border:"0"}})]})),Ie&&Te&&n(x,e({spacing:.75,sx:S({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==fe?void 0:fe.manualConfirmation)},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(F,{color:"warning",height:14,width:14}),t(C,e({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),n(C,e({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Ve,"-",Ue," will become part of ",k,", including pages from other documents in this range."]})),n(x,e({direction:"row",spacing:.75},{children:[t(u,e({variant:"outlined",fullWidth:!0,onClick:function(){return We(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),t(u,e({variant:"contained",fullWidth:!0,disabled:se||!U,onClick:function(){if(Le&&U){var e={id:y.SET_RANGE,title:ee};U(-1,e,{selectedIndex:-1,option:e,startPage:Ve,endPage:Ue,metadata:P})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),t(x,e({spacing:.625,sx:null==fe?void 0:fe.footer},{children:le&&n(r,{children:[t(p,{}),n(m,e({onClick:X,disabled:!X,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:X?"pointer":"not-allowed"}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:1},{children:[t(E,{sx:{color:"text.secondary"}}),t(C,e({sx:{color:"text.primary",fontSize:12}},{children:te}))]})),n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(v,{score:W}),t(d,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))}export{y as BoundaryReviewActionEnum,A as createBoundaryCardOptions,M as default,R as isBoundaryReviewAction};
|
|
1
|
+
import{__assign as e,__spreadArray as i}from"tslib";import{jsx as t,jsxs as n,Fragment as r}from"react/jsx-runtime";import{useMemo as o,useState as l}from"react";import d from"@mui/icons-material/ChevronRight";import a from"@mui/icons-material/Close";import c from"@mui/icons-material/ExpandMore";import s from"@mui/material/Box";import u from"@mui/material/Button";import m from"@mui/material/ButtonBase";import p from"@mui/material/Divider";import h from"@mui/material/IconButton";import g from"@mui/material/Paper";import f from"@mui/material/Radio";import x from"@mui/material/Stack";import b from"@mui/material/TextField";import C from"@mui/material/Typography";import E from"./RevertSummaryNotice.js";import v from"./CognitiveIcon.js";import F from"./CognitiveScoreBadge.js";import y from"../../assests/icons/InfoAlert.js";var S,w=function(e,t){return i([e],Array.isArray(t)?t:null==t?[]:[t],!0)},R="MERGE_ADJACENT";!function(e){e.KEEP="KEEP",e.SPLIT_HERE="SPLIT_HERE",e.MERGE_NEXT="MERGE_NEXT",e.MERGE_PREV="MERGE_PREV",e.MERGE_PREVIOUS="MERGE_PREVIOUS",e.SET_RANGE="SET_RANGE"}(S||(S={}));var A=function(e){return Object.values(S).includes(e)},M=function(e,t,n,r){if(!t||!e)return[];var o=t.additional_decisions,l=Array.isArray(o)?o:o?Object.values(o).flat():[],d=Array.from(new Set(i(i([],t.allowed_decisions,!0),l,!0)));return d.flatMap(function(i){var t=e.focus_page,o=d.find(function(e){return e.toLowerCase().includes("merge")}),l=null!=t&&null!=n&&null!=r&&t===n&&t===r,a=null!=t&&null!=n&&t===n,c=null!=t&&null!=r&&(t===r||t===r+1),s=a||c||!(null!=t&&(!(null!=n&&null!=r)||t>n&&t<r));switch(i){case S.SET_RANGE:return[];case"KEEP":return[{id:i,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:i,title:"Split to a separate document",description:s?"A valid page inside the document is required to split it.":t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary.",disabled:s}];case"MERGE_PREV":case"MERGE_NEXT":case"MERGE_PREVIOUS":return i!==o?[]:l?[{id:R,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]:a?[{id:S.MERGE_PREVIOUS,title:"Merge with previous document",description:"Combine this document with the previous document."}]:c?[{id:S.MERGE_NEXT,title:"Merge with next document",description:"Combine this document with the next document."}]:[{id:R,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]}return[]})};function I(i){var I=i.headerName,k=void 0===I?"Boundary Check":I,z=i.title,T=i.pageNo,W=i.content,_=i.revertSummary,P=i.cognitiveScore,N=i.config,G=i.metadata,D=i.previousSegmentTitle,B=i.nextSegmentTitle,j=i.selectedIndex,H=i.defaultSelectedIndex,O=void 0===H?null:H,V=i.defaultStartPage,U=i.defaultEndPage,L=i.onSelectionChange,X=i.onConfirm,K=i.onActionConfirm,q=i.onCognitiveClick,J=i.onAdjustManually,Y=i.onClose,Q=i.confirmLabel,Z=void 0===Q?"Confirm":Q,$=i.manualPrompt,ee=void 0===$?"Didn't find the right option?":$,ie=i.manualActionLabel,te=void 0===ie?"Adjust Manually":ie,ne=i.cognitiveLabel,re=void 0===ne?"Cognitive Integrity":ne,oe=i.showAdjustManually,le=void 0===oe||oe,de=i.showCognitiveIntegrity,ae=void 0===de||de,ce=i.showCloseButton,se=void 0===ce||ce,ue=i.confirmDisabled,me=void 0!==ue&&ue,pe=i.width,he=void 0===pe?260:pe,ge=i.maxWidth,fe=void 0===ge?260:ge,xe=i.className,be=i.styles,Ce=i.reviewAction,Ee=o(function(){return(null!=N?N:G?M(G,Ce,V,U):[]).filter(function(e){return e.id!==S.SET_RANGE})},[N,U,V,G,Ce]),ve=l(O),Fe=ve[0],ye=ve[1],Se=l(null==V?"":String(V)),we=Se[0],Re=Se[1],Ae=l(null==U?"":String(U)),Me=Ae[0],Ie=Ae[1],ke=l(!1),ze=ke[0],Te=ke[1],We=l(!1),_e=We[0],Pe=We[1],Ne=l(null),Ge=Ne[0],De=Ne[1],Be=void 0===j?Fe:j,je=null==Be?void 0:Ee[Be],He=(null==je?void 0:je.id)===R,Oe=null!=D,Ve=null!=B,Ue=function(e){return!0===e.disabled||e.id===S.MERGE_PREV&&!Oe||e.id===S.MERGE_PREVIOUS&&!Oe||e.id===S.MERGE_NEXT&&!Ve||e.id===R&&!Oe&&!Ve},Le=Number(we),Xe=Number(Me),Ke=we.trim().length>0&&Me.trim().length>0&&Number.isInteger(Le)&&Number.isInteger(Xe)&&Le>0&&Xe>0&&Le<=Xe,qe=me||!je||Ue(je)||He&&null==Ge||!X&&!K;return t(g,e({className:xe,elevation:4,sx:w({width:he,maxWidth:fe,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==be?void 0:be.root)},{children:n(x,e({spacing:.75,sx:{p:1}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.75,sx:null==be?void 0:be.header},{children:[t(y,{color:"error",height:16,width:16}),t(C,e({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:k})),se&&t(h,e({size:"small",onClick:Y,disabled:!Y,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:t(a,{sx:{fontSize:17}})}))]})),n(s,{children:[t(C,e({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:z})),null!=T&&t(C,e({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:T})),t(p,{sx:{my:.625}}),null!=_?t(E,{children:_}):null!=W&&t(C,e({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:W}))]}),n(x,e({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[Ee.map(function(i,r){var o=Be===r,l=Ue(i);return n(g,e({variant:"outlined",sx:w({borderColor:o?"#1976d2":"divider",borderRadius:2,bgcolor:l?"#F8FAFC":"background.paper",overflow:"hidden"},null==be?void 0:be.option)},{children:[n(m,e({role:"radio","aria-checked":o,disabled:me||l,onClick:function(){return function(e,i){me||Ue(i)||(void 0===j&&ye(e),i.id!==R&&De(null),ze&&(Te(!1),Pe(!1)),null==L||L(e,i))}(r,i)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[t(f,{checked:o,disabled:me||l,tabIndex:-1,size:"small",sx:{p:.25,mr:.5,"&.Mui-disabled":{color:"#CBD5E1"}}}),n(s,e({sx:{minWidth:0}},{children:[t(C,e({sx:{color:l?"#94A3B8":"text.primary",fontSize:12.5,fontWeight:500}},{children:i.title})),null!=i.description&&t(C,e({sx:{mt:.125,color:l?"#94A3B8":"text.secondary",fontSize:11}},{children:i.description}))]}))]})),o&&i.id===R&&t(x,e({direction:"row",spacing:.75,sx:w({px:.75,pb:.75},null==be?void 0:be.adjacentSelector)},{children:[{direction:"previous",title:null!=D?D:"No Previous document",caption:"← Merge into Previous",available:Oe},{direction:"next",title:null!=B?B:"No Next document",caption:"Merge into Next →",available:Ve}].map(function(i){var r=Ge===i.direction;return n(x,e({sx:{flex:1,minWidth:0}},{children:[t(m,e({disabled:me||!i.available,onClick:function(){return De(i.direction)},"aria-pressed":r,sx:{width:"100%",minWidth:0,minHeight:46,alignItems:"flex-start",justifyContent:"flex-start",p:.625,border:"1px solid",borderColor:r?"#7F56D9":"#D0D5DD",borderRadius:1.5,bgcolor:r?"#E0E7FF":"background.paper",color:r?"#7F56D9":i.available?"text.primary":"#98A2B3",textAlign:"left","&.Mui-disabled":{color:"#98A2B3",bgcolor:"#F8FAFC"}}},{children:t(C,e({sx:{color:"inherit",fontSize:11,fontWeight:500,lineHeight:1.25,overflowWrap:"anywhere"}},{children:i.title}))})),t(C,e({sx:{mt:.5,color:r?"#5925DC":"text.secondary",fontSize:9.5,lineHeight:1.2,whiteSpace:"nowrap",textAlign:"next"===i.direction?"right":"left"}},{children:i.caption}))]}),i.direction)})}))]}),i.id)}),He&&null!=Ge&&n(x,e({direction:"row",alignItems:"flex-start",spacing:.625,sx:w({p:.75,border:"1px solid #FCA5A5",borderRadius:1.5,bgcolor:"#FEF2F2"},null==be?void 0:be.impactWarning)},{children:[t(y,{color:"error",height:14,width:14,sx:{mt:.125}}),n(C,e({sx:{color:"#DC2626",fontSize:10.5,lineHeight:1.4}},{children:["This will impact the ",Ge," document. Its content and page range will change."]}))]})),t(u,e({variant:"contained",fullWidth:!0,disabled:qe,onClick:function(){if(!qe&&null!=Be&&je){var i=He?"previous"===Ge?S.MERGE_PREVIOUS:S.MERGE_NEXT:je.id,t=He?e(e({},je),{id:i}):je,n={selectedIndex:Be,option:t,metadata:G};null==X||X(Be,t,n),K&&A(i)&&K(i,n)}},sx:w({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==be?void 0:be.confirmButton)},{children:Z}))]})),le&&n(x,e({spacing:.625,sx:null==be?void 0:be.manualSection},{children:[n(m,e({disabled:me,onClick:function(){var e=!ze;Te(e),Pe(!1),e&&(void 0===j&&ye(null),null==J||J())},"aria-expanded":ze,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[n(s,{children:[t(C,e({sx:{color:"text.primary",fontSize:11}},{children:ee})),t(C,e({sx:{mt:.125,color:"text.primary",fontSize:11}},{children:te}))]}),t(c,{sx:{color:"text.secondary",fontSize:16,transform:ze?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),ze&&!_e&&n(s,e({sx:{pt:.5,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[n(s,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[t(C,e({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Starts"})),t(C,e({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Ends"}))]})),n(s,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[t(b,{size:"small",type:"number",value:we,disabled:me,onChange:function(e){return Re(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}}),t(b,{size:"small",type:"number",value:Me,disabled:me,error:we.trim().length>0&&Me.trim().length>0&&Le>Xe,onChange:function(e){return Ie(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}})]})),t(s,{children:t(u,e({onClick:function(){Ke&&Pe(!0)},disabled:me||!Ke,sx:{height:"30px",padding:"0 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"1px solid #8E80F3",borderRadius:"6px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"12px",fontWeight:600,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Ke?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Ke?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))}),t(s,{sx:{width:"100%",height:"1px",marginTop:"8px",backgroundColor:"#EEF0F2",border:"0"}})]})),ze&&_e&&n(x,e({spacing:.75,sx:w({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==be?void 0:be.manualConfirmation)},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(y,{color:"warning",height:14,width:14}),t(C,e({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),n(C,e({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Le,"-",Xe," will become part of ",z,", including pages from other documents in this range."]})),n(x,e({direction:"row",spacing:.75},{children:[t(u,e({variant:"outlined",fullWidth:!0,onClick:function(){return Pe(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),t(u,e({variant:"contained",fullWidth:!0,disabled:me||!X,onClick:function(){if(Ke&&X){var e={id:S.SET_RANGE,title:te};X(-1,e,{selectedIndex:-1,option:e,startPage:Le,endPage:Xe,metadata:G})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),t(x,e({spacing:.625,sx:null==be?void 0:be.footer},{children:ae&&n(r,{children:[t(p,{}),n(m,e({onClick:q,disabled:!q,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:q?"pointer":"not-allowed"}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:1},{children:[t(v,{sx:{color:"text.secondary"}}),t(C,e({sx:{color:"text.primary",fontSize:12}},{children:re}))]})),n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(F,{score:P}),t(d,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))}export{S as BoundaryReviewActionEnum,M as createBoundaryCardOptions,I as default,A as isBoundaryReviewAction};
|
|
2
2
|
//# sourceMappingURL=BoundaryCard.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as r}from"react/jsx-runtime";function o(o){return r("svg",t({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M8.9375 1.4375V0.5M11.3996 2.10041L12.0625 1.4375M12.0689 4.5625H13.0064M12.9691 7.375C12.6556 10.5333 9.99084 13 6.75 13C3.29822 13 0.5 10.2018 0.5 6.75C0.5 3.50916 2.96667 0.844437 6.125 0.53086M6.75 4.25H9.25V6.75M9.0123 4.25C7.54083 6.32975 5.11648 7.6875 2.375 7.6875C1.74819 7.6875 1.13795 7.61652 0.551889 7.48216",stroke:"#16A34A","stroke-linecap":"round","stroke-linejoin":"round"})}))}export{o as default};
|
|
2
|
+
//# sourceMappingURL=ChartBreakoutCircle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartBreakoutCircle.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i,__spreadArray as e}from"tslib";import{jsx as t,jsxs as n}from"react/jsx-runtime";import o from"@mui/icons-material/ChevronLeft";import r from"@mui/icons-material/Close";import l from"@mui/material/Box";import a from"@mui/material/Divider";import m from"@mui/material/IconButton";import s from"@mui/material/Paper";import c from"@mui/material/Stack";import d from"@mui/material/Typography";import h from"../CitationRenderer/MarkdownRenderer.js";import u from"./CognitiveIcon.js";import p from"./CognitiveScoreBadge.js";var g=function(i,t){return e([i],Array.isArray(t)?t:null==t?[]:[t],!0)};function f(e){var f=e.reasons,x=e.reason,v=e.gap,y=e.score,b=e.headerName,S=void 0===b?"Cognitive Integrity":b,C=e.onBack,H=e.onClose,w=e.showCloseButton,z=void 0===w||w,k=e.width,W=void 0===k?260:k,B=e.maxWidth,A=void 0===B?260:B,R=e.className,I=e.styles,j=(null!=f?f:[]).filter(function(i){return"evidence"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),T=(null!=f?f:[]).filter(function(i){return"gap"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),L=null==x?void 0:x.trim(),M=null==v?void 0:v.trim();if(0===j.length&&L&&j.push(L),0===T.length&&M&&T.push(M),0===j.length&&0===T.length)return null;var N,D=(N=null==I?void 0:I.markdown,i(i({},N),{containerWrapper:i(i({},null==N?void 0:N.containerWrapper),{display:"block",height:"auto",minHeight:0,maxHeight:"
|
|
1
|
+
import{__assign as i,__spreadArray as e}from"tslib";import{jsx as t,jsxs as n}from"react/jsx-runtime";import o from"@mui/icons-material/ChevronLeft";import r from"@mui/icons-material/Close";import l from"@mui/material/Box";import a from"@mui/material/Divider";import m from"@mui/material/IconButton";import s from"@mui/material/Paper";import c from"@mui/material/Stack";import d from"@mui/material/Typography";import h from"../CitationRenderer/MarkdownRenderer.js";import u from"./CognitiveIcon.js";import p from"./CognitiveScoreBadge.js";var g=function(i,t){return e([i],Array.isArray(t)?t:null==t?[]:[t],!0)};function f(e){var f=e.reasons,x=e.reason,v=e.gap,y=e.score,b=e.headerName,S=void 0===b?"Cognitive Integrity":b,C=e.onBack,H=e.onClose,w=e.showCloseButton,z=void 0===w||w,k=e.width,W=void 0===k?260:k,B=e.maxWidth,A=void 0===B?260:B,R=e.className,I=e.styles,j=(null!=f?f:[]).filter(function(i){return"evidence"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),T=(null!=f?f:[]).filter(function(i){return"gap"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),L=null==x?void 0:x.trim(),M=null==v?void 0:v.trim();if(0===j.length&&L&&j.push(L),0===T.length&&M&&T.push(M),0===j.length&&0===T.length)return null;var N,D=(N=null==I?void 0:I.markdown,i(i({},N),{containerWrapper:i(i({},null==N?void 0:N.containerWrapper),{display:"block",height:"auto",minHeight:0,maxHeight:"fit-content",flex:"0 0 auto"}),mainCard:i(i({},null==N?void 0:N.mainCard),{height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto",padding:0,border:"none",borderRadius:0,boxShadow:"none",backgroundColor:"transparent"}),scrollArea:i({height:"auto",minHeight:0,maxHeight:"none",overflowY:"visible",paddingRight:0,color:"#475467",fontSize:11.5,lineHeight:1.3},null==N?void 0:N.scrollArea),list:i({margin:"0",padding:"0 0 0 18px",fontSize:"11.5px",lineHeight:"1.3"},null==N?void 0:N.list)})),P=i(i({},D),{scrollArea:i(i({},D.scrollArea),{fontSize:"inherit",lineHeight:"inherit"}),summary:i(i({},D.summary),{display:"inline-flex",padding:0,fontSize:"inherit",lineHeight:"inherit"})}),F={m:0,pl:2.25,listStyleType:"decimal",listStylePosition:"outside",fontSize:11.5,lineHeight:1.3,"& > li":{pl:.25,fontSize:"inherit",lineHeight:"inherit"},"& > li::marker":{fontSize:"1em",fontWeight:"inherit"}};return t(s,i({className:R,elevation:4,sx:g({width:W,maxWidth:A,height:"fit-content",minHeight:0,alignSelf:"flex-start",flex:"0 0 auto",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==I?void 0:I.root)},{children:n(c,i({spacing:.75,sx:{p:1,height:"auto",minHeight:0}},{children:[n(c,i({direction:"row",alignItems:"center",spacing:.75,sx:null==I?void 0:I.header},{children:[C&&t(m,i({size:"small",onClick:C,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:t(o,{sx:{fontSize:17}})})),t(u,{sx:{color:"#6941C6"}}),t(d,i({sx:{flex:1,fontSize:12,fontWeight:500,alignItems:"center",display:"flex",lineHeight:1.25,textTransform:"capitalise"}},{children:S})),t(p,{score:y}),z&&t(m,i({size:"small",onClick:H,disabled:!H,"aria-label":"Close cognitive integrity",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:t(r,{sx:{fontSize:17}})}))]})),n(c,i({spacing:.75,sx:g({height:"auto",minHeight:0,flex:"0 0 auto"},null==I?void 0:I.content)},{children:[j.length>0&&n(l,i({sx:{marginTop:4}},{children:[t(d,i({sx:{mt:1,mb:.25,color:"text.primary",fontSize:12,fontWeight:500}},{children:"Decision Making Factors"})),t(a,{sx:{my:.625}}),t(l,i({component:"ol",sx:F,style:D.list},{children:j.map(function(e,n){return t(l,i({component:"li",sx:{mb:.5}},{children:t(h,{value:"<summary>".concat(e,"</summary>"),styles:P})}),"evidence-".concat(n))})}))]})),T.length>0&&n(l,i({sx:null==I?void 0:I.section},{children:[t(d,i({sx:{mb:.25,color:"text.primary",fontSize:12,fontWeight:500}},{children:"Gap"})),t(a,{sx:{my:.625}}),t(l,i({component:"ol",sx:F,style:D.list},{children:T.map(function(e,n){return t(l,i({component:"li",sx:{mb:.5}},{children:t(h,{value:"<summary>".concat(e,"</summary>"),styles:P})}),"gap-".concat(n))})}))]}))]}))]}))}))}export{f as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveIntegrity.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as i}from"tslib";import{jsx as o,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useMemo as n,useState as l}from"react";import a from"@mui/icons-material/ChevronRight";import d from"@mui/icons-material/Close";import c from"@mui/material/Box";import u from"@mui/material/Button";import s from"@mui/material/ButtonBase";import m from"@mui/material/Divider";import p from"@mui/material/IconButton";import h from"@mui/material/Paper";import f from"@mui/material/Radio";import b from"@mui/material/Stack";import x from"@mui/material/TextField";import
|
|
1
|
+
import{__assign as e,__spreadArray as i}from"tslib";import{jsx as o,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useMemo as n,useState as l}from"react";import a from"@mui/icons-material/ChevronRight";import d from"@mui/icons-material/Close";import c from"@mui/material/Box";import u from"@mui/material/Button";import s from"@mui/material/ButtonBase";import m from"@mui/material/Divider";import p from"@mui/material/IconButton";import h from"@mui/material/Paper";import f from"@mui/material/Radio";import b from"@mui/material/Stack";import x from"@mui/material/TextField";import v from"@mui/material/Typography";import g from"./RevertSummaryNotice.js";import C from"./CognitiveIcon.js";import y from"./CognitiveScoreBadge.js";import S from"../../assests/icons/InfoAlert.js";var w,I=function(e,o){return i([e],Array.isArray(o)?o:null==o?[]:[o],!0)};!function(e){e.KEEP_LABEL="KEEP_LABEL",e.SET_CUSTOM_LABEL="SET_CUSTOM_LABEL"}(w||(w={}));var A=function(e){return e.user_actions.map(function(i){switch(i){case"KEEP_LABEL":return{id:i,title:"Keep as is",description:e.current_label?'Label stays "'.concat(e.current_label,'"'):"Keep the current document label"};case"SET_CUSTOM_LABEL":return{id:i,title:"Fix a document title",description:"Correct the page title if it's not right",requiresInput:!0,inputPlaceholder:e.current_label?"e.g. ".concat(e.current_label):"Enter a document label"}}})},L=function(e){return Object.values(w).includes(e)};function E(i){var w,E=i.headerName,k=void 0===E?"Title Check":E,B=i.title,D=i.pageNo,z=i.content,M=void 0===z?"We're not fully confident about this label. Confirm it, choose a different type, or add a new one.":z,_=i.revertSummary,W=i.cognitiveScore,F=i.config,O=i.metadata,T=i.selectedIndex,j=i.defaultSelectedIndex,P=void 0===j?null:j,R=i.onSelectionChange,K=i.customLabel,H=i.defaultCustomLabel,N=i.onCustomLabelChange,q=i.onConfirm,U=i.onActionConfirm,G=i.onCognitiveClick;i.onAdjustManually;var J=i.onClose,Q=i.confirmLabel,V=void 0===Q?"Confirm":Q,X=i.customInputAriaLabel,Y=void 0===X?"Custom document label":X;i.manualPrompt,i.manualActionLabel;var Z=i.cognitiveLabel,$=void 0===Z?"Cognitive Integrity":Z;i.showAdjustManually;var ee=i.showCognitiveIntegrity,ie=void 0===ee||ee,oe=i.showCloseButton,re=void 0===oe||oe,te=i.confirmDisabled,ne=void 0!==te&&te,le=i.confirmationBlocked,ae=void 0!==le&&le,de=i.confirmationWarning,ce=i.disableAllActions,ue=void 0!==ce&&ce,se=i.width,me=void 0===se?260:se,pe=i.maxWidth,he=void 0===pe?260:pe,fe=i.className,be=i.styles,xe=n(function(){return null!=F?F:O?A(O):[]},[F,O]),ve=l(P),ge=ve[0],Ce=ve[1],ye=l(null!==(w=null!=H?H:null==O?void 0:O.custom_label)&&void 0!==w?w:""),Se=ye[0],we=ye[1],Ie=void 0===T?ge:T,Ae=void 0===K?Se:K,Le=null==Ie?void 0:xe[Ie],Ee=Boolean(null==Le?void 0:Le.requiresInput),ke=ae||ue||ne||!q&&!U||!Le||!0===Le.disabled||Ee&&0===Ae.trim().length,Be=function(){if(!ke&&null!=Ie&&Le){var e=Ee?Ae.trim():void 0;null==q||q(Ie,Le,e),U&&L(Le.id)&&U(Le.id,{selectedIndex:Ie,option:Le,customLabel:e,metadata:O})}};return o(h,e({className:fe,elevation:0,sx:I({width:me,maxWidth:he,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.2)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==be?void 0:be.root)},{children:o(c,e({sx:{overflow:"hidden"}},{children:r(b,e({spacing:.75,sx:{p:1}},{children:[r(b,e({direction:"row",alignItems:"center",spacing:.75,sx:null==be?void 0:be.header},{children:[o(S,{color:"error",height:16,width:16}),o(v,e({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:k})),re&&o(p,e({size:"small",onClick:J,disabled:!J,"aria-label":"Close label check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:o(d,{sx:{fontSize:17}})}))]})),r(c,{children:[o(v,e({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:B})),null!=D&&o(v,e({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:D})),o(m,{sx:{my:.625}}),null!=_?o(g,{children:_}):null!=M&&o(v,e({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:M}))]}),r(b,e({spacing:.625,role:"radiogroup","aria-label":"Label options"},{children:[xe.map(function(i,t){var n=Ie===t;return r(h,e({variant:"outlined",sx:I({borderColor:n?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==be?void 0:be.option)},{children:[r(s,e({role:"radio","aria-checked":n,disabled:ne||i.disabled||ae,onClick:function(){return function(e,i){ne||i.disabled||(void 0===T&&Ce(e),null==R||R(e,i))}(t,i)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left",cursor:"pointer","&.Mui-disabled":{cursor:"not-allowed"}}},{children:[o(f,{checked:n,disabled:ne||i.disabled||ae,tabIndex:-1,size:"small",sx:{p:.25,mr:.5,cursor:"pointer","&.Mui-disabled":{cursor:"not-allowed"}}}),r(c,e({sx:{minWidth:0}},{children:[o(v,e({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:i.title})),null!=i.description&&o(v,e({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:i.description}))]}))]})),n&&i.requiresInput&&o(c,e({sx:{px:1.25,pb:1}},{children:o(x,{autoFocus:!0,fullWidth:!0,size:"small",value:Ae,disabled:ne,placeholder:i.inputPlaceholder,inputProps:{"aria-label":Y},onChange:function(e){return i=e.target.value,void 0===K&&we(i),void(null==N||N(i));var i},onKeyDown:function(e){"Enter"===e.key&&Be()},variant:"outlined",InputProps:{sx:{height:36,borderRadius:2,backgroundColor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1px"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1.5px"},"& .MuiOutlinedInput-input":{height:"100%",boxSizing:"border-box",px:1.25,py:0,fontSize:12,lineHeight:1.25},"& .MuiOutlinedInput-input::placeholder":{color:"#98A2B3",opacity:1}}},sx:null==be?void 0:be.customInput})}))]}),i.id)}),null!=de&&r(b,e({direction:"row",alignItems:"flex-start",spacing:.5,role:"alert",sx:I({px:.75,py:.625,borderRadius:1,bgcolor:"#FEFCE8",color:"#CA8A04"},null==be?void 0:be.confirmationWarning)},{children:[o(S,{color:"inherit",height:15,width:15}),o(v,e({sx:{color:"inherit",fontSize:11.5,lineHeight:1.3}},{children:de}))]})),o(u,e({variant:"contained",fullWidth:!0,disabled:ke,onClick:Be,sx:I({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==be?void 0:be.confirmButton)},{children:V}))]})),o(b,e({spacing:.625,sx:null==be?void 0:be.footer},{children:ie&&r(t,{children:[o(m,{}),r(s,e({onClick:G,disabled:!G,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:G?"pointer":"not-allowed"}},{children:[r(b,e({direction:"row",alignItems:"center",spacing:1},{children:[o(C,{sx:{color:"text.secondary"}}),o(v,e({sx:{color:"text.primary",fontSize:12}},{children:$}))]})),r(b,e({direction:"row",alignItems:"center",spacing:.75},{children:[o(y,{score:W}),o(a,{sx:{color:"text.secondary",fontSize:18}})]}))]}))]})}))]}))}))}))}export{w as LabelReviewActionEnum,A as createLabelCheckOptions,E as default,L as isLabelReviewAction};
|
|
2
2
|
//# sourceMappingURL=LabelCheck.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e,__awaiter as r,__generator as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import{useState as o}from"react";import a from"@mui/material/Box";import l from"@mui/material/Button";import c from"@mui/material/ButtonBase";import d from"@mui/material/Divider";import s from"@mui/material/Stack";import h from"@mui/material/Tooltip";import m from"@mui/material/Typography";import{ChevronLeft as f}from"lucide-react";var u=function(e){var r=e.startPage,t=e.endPage;return"Pages ".concat(r,"-").concat(t)},x=function(r){var t=r.segment;return i(a,e({sx:{px:.75,py:.625,minWidth:0}},{children:[n(m,e({sx:{color:"text.secondary",fontSize:11,lineHeight:1.3,overflowWrap:"anywhere"}},{children:t.title})),n(m,e({sx:{color:"text.primary",fontSize:12,fontWeight:400,lineHeight:1.3}},{children:u(t)}))]}))};function p(u){var p=this,v=u.icon,y=u.title,C=u.pageRange,S=u.description,R=u.onRevert,w=u.onRevertComplete,W=u.onRevertError,F=u.revertData,z=u.confirmDisabled,k=void 0!==z&&z,H=u.showDocumentHeader,A=void 0===H||H,B=o(!1),E=B[0],D=B[1],T=o(!1),P=T[0],I=T[1],L=F.previousSegments.length>0,j=function(){return r(p,void 0,void 0,function(){var e,r;return t(this,function(t){switch(t.label){case 0:if(P||k)return[2];I(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,R()];case 2:return e=t.sent(),null==w||w(e),[3,5];case 3:return r=t.sent(),null==W||W(r),[3,5];case 4:return I(!1),[7];case 5:return[2]}})})};return i(s,e({spacing:.875,sx:{minWidth:0}},{children:[A&&i(a,e({sx:{minWidth:0}},{children:[n(m,e({sx:{color:"text.primary",fontSize:14,fontWeight:500,lineHeight:1.4,overflowWrap:"anywhere"}},{children:y})),n(m,e({sx:{color:"text.secondary",fontSize:12,lineHeight:1.4}},{children:C}))]})),i(s,e({direction:"row",alignItems:"flex-start",spacing:.625,sx:{px:.75,py:.625,border:"1px solid #86EFAC",borderRadius:2,bgcolor:"#FFFFFF",color:"#16A34A"}},{children:[n(a,e({"aria-hidden":"true",sx:{display:"flex",flexShrink:0,mt:"1px",fontSize:14}},{children:v})),n(m,e({sx:{minWidth:0,color:"inherit",fontSize:11,lineHeight:1.5,overflowWrap:"anywhere"}},{children:S}))]})),n(d,{sx:{borderStyle:"dashed",borderColor:"#CBD5E1"}}),E?i(s,e({spacing:.75},{children:[i(c,e({onClick:function(){return D(!1)},"aria-label":"Back from revert confirmation",sx:{width:"fit-content",borderRadius:.5,color:"text.primary",fontSize:13,fontWeight:500,lineHeight:1.3,textAlign:"left"}},{children:[n(a,e({component:"span","aria-hidden":"true",sx:{mr:.625,alignItems:"center",display:"flex"}},{children:n(f,{size:16})})),"Revert"]})),i(a,L?e({sx:{p:.75,borderRadius:1,bgcolor:"#F8FAFC"}},{children:[n(m,e({sx:{mb:.375,color:"text.secondary",fontSize:12}},{children:"Current"})),n(a,e({sx:{mb:.75,border:"1px solid #E2E8F0",borderRadius:1,bgcolor:"background.paper"}},{children:n(x,{segment:F.currentSegment})})),n(m,e({sx:{mb:.375,color:"text.secondary",fontSize:12}},{children:"After Revert"})),n(a,e({sx:{border:"1px solid #E2E8F0",borderRadius:1,bgcolor:"background.paper",overflow:"hidden"}},{children:F.previousSegments.map(function(e,r){return i(a,{children:[r>0&&n(d,{sx:{borderColor:"#E2E8F0"}}),n(x,{segment:e})]},"".concat(e.title,"-").concat(e.startPage,"-").concat(e.endPage,"-").concat(r))})})),i(s,e({direction:"row",spacing:1,sx:{mt:.875}},{children:[n(l,e({variant:"outlined",fullWidth:!0,disabled:P,onClick:function(){return D(!1)},sx:g},{children:"Cancel"})),n(h,e({title:k?"Revert data is not present, cannot revert this":"",disableHoverListener:!k,arrow:!0},{children:n("span",e({style:{flex:1}},{children:n(l,e({variant:"contained",fullWidth:!0,disabled:P||k,onClick:function(){j()},sx:b},{children:P?"Reverting…":"Confirm"}))}))}))]}))]}):e({sx:{p:.875,borderRadius:1,bgcolor:"#F8FAFC"}},{children:[n(m,e({sx:{color:"text.secondary",fontSize:12,fontWeight:500}},{children:"Revert approval?"})),n(m,e({sx:{mt:.75,color:"text.secondary",fontSize:13,lineHeight:1.45}},{children:"This document will be moved back to pending review and will need to be confirmed again."})),i(s,e({direction:"row",spacing:1,sx:{mt:1}},{children:[n(l,e({variant:"outlined",fullWidth:!0,disabled:P,onClick:function(){return D(!1)},sx:g},{children:"Cancel"})),n(h,e({title:k?"Revert data is not present, cannot revert this":"",disableHoverListener:!k,arrow:!0},{children:n("span",e({style:{flex:1}},{children:n(l,e({variant:"contained",fullWidth:!0,disabled:P||k,onClick:function(){j()},sx:b},{children:P?"Reverting…":"Confirm"}))}))}))]}))]}))]})):n(l,e({variant:"outlined",fullWidth:!0,onClick:function(){return D(!0)},sx:{minHeight:36,borderColor:"#9B8AFB",color:"#5925DC",borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none","&:hover":{borderColor:"secondary.dark",bgcolor:"rgba(79, 70, 229, 0.04)"}}},{children:"Revert"}))]}))}var g={minHeight:34,borderColor:"#94A3B8",color:"#64748B",borderRadius:"8px",fontSize:12,fontWeight:500,textTransform:"none"},b={minHeight:34,borderRadius:"8px",bgcolor:"#4F46E5",fontSize:12,fontWeight:500,textTransform:"none",boxShadow:"none","&:hover":{bgcolor:"#4338CA",boxShadow:"none"}};export{p as default};
|
|
2
|
+
//# sourceMappingURL=RevertCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RevertCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import e from"@mui/icons-material/ArrowForward";import t from"@mui/material/Box";import l from"@mui/material/Button";import n from"@mui/material/Paper";import m from"@mui/material/Stack";import a from"@mui/material/Typography";import{CheckCircleIcon as d}from"lucide-react";function c(c){var s=c.title,h=c.description,p=c.onReview,F=c.reviewLabel,f=void 0===F?"Review":F;return i(n,r({elevation:0,role:"status",sx:{width:"100%",px:1.5,py:1.5,border:"1.5px solid #86EFAC",borderRadius:2,bgcolor:"#F0FDF4",boxSizing:"border-box"}},{children:o(m,r({alignItems:"center",spacing:1.5,sx:{textAlign:"center"}},{children:[i(t,r({sx:{display:"grid",placeItems:"center",width:58,height:58,border:"8px solid rgba(255, 255, 255, 0.9)",borderRadius:"50%",bgcolor:"#DCFCE7",color:"#0A9B49"}},{children:i(d,{height:36,width:36})})),o(t,{children:[i(a,r({sx:{color:"#166534",fontSize:15,fontWeight:600,lineHeight:1.4}},{children:s})),i(a,r({sx:{mt:.75,color:"#07883F",fontSize:14,lineHeight:1.55}},{children:h}))]}),i(l,r({variant:"outlined",fullWidth:!0,onClick:p,endIcon:i(e,{}),sx:{minHeight:42,border:"1.5px solid #CBD5E1",borderRadius:2,bgcolor:"#FFFFFF",color:"#475569",fontSize:16,fontWeight:700,textTransform:"none","&:hover":{borderColor:"#94A3B8",bgcolor:"#FFFFFF"}}},{children:f}))]}))}))}export{c as default};
|
|
2
|
+
//# sourceMappingURL=RevertSuccessCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RevertSuccessCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as r}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import i from"@mui/material/Box";import t from"@mui/material/Typography";import{GitMerge as l}from"lucide-react";function a(a){var m=a.children;return o(i,r({sx:{display:"flex",alignItems:"flex-start",gap:1,px:1,py:1.125,border:"1px solid #FACC15",borderRadius:1.5,bgcolor:"#FFFBEB",color:"#D18A00"}},{children:[e(l,{size:18,strokeWidth:2.25,style:{flex:"0 0 auto",marginTop:1}}),e(t,r({component:"div",sx:{color:"inherit",fontSize:12,lineHeight:1.5,overflowWrap:"anywhere"}},{children:m}))]}))}export{a as default};
|
|
2
|
+
//# sourceMappingURL=RevertSummaryNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RevertSummaryNotice.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as i,__spreadArray as e}from"tslib";import{jsxs as o,jsx as r}from"react/jsx-runtime";import t from"@mui/icons-material/ChevronRight";import n from"@mui/icons-material/Close";import l from"@mui/material/Box";import a from"@mui/material/ButtonBase";import c from"@mui/material/Divider";import m from"@mui/material/IconButton";import s from"@mui/material/Paper";import d from"@mui/material/Stack";import h from"@mui/material/Typography";import p from"../../assests/icons/InfoAlert.js";import x from"./CognitiveIcon.js";import f from"./CognitiveScoreBadge.js";var u=function(i,o){return e([i],Array.isArray(o)?o:null==o?[]:[o],!0)};function g(e){var g=e.headerName,v=void 0===g?"Reviewed":g,w=e.headerIcon,y=e.title,b=e.pageNo,C=e.summary,W=e.cognitiveScore,S=e.onCognitiveClick,I=e.onClose,k=e.cognitiveLabel,z=void 0===k?"Cognitive Integrity":k,A=e.showCognitiveIntegrity,B=void 0===A||A,j=e.showCloseButton,N=void 0===j||j,R=e.width,D=void 0===R?260:R,F=e.maxWidth,T=void 0===F?260:F,E=e.className,H=e.styles;return o(s,i({className:E,elevation:4,sx:u({width:D,maxWidth:"min(".concat(T,"number"==typeof T?"px, 100%)":", 100%)"),minWidth:0,flexShrink:1,borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.16)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==H?void 0:H.root)},{children:[o(d,i({direction:"row",alignItems:"center",spacing:.75,sx:u({minWidth:0,px:1.25,py:1,bgcolor:"#ECFDF5",color:"#16A34A"},null==H?void 0:H.header)},{children:[null!=w?w:r(p,{color:"success",height:16,width:16}),r(h,i({sx:{flex:1,minWidth:0,color:"inherit",fontSize:13,fontWeight:500,lineHeight:1.25,textTransform:"uppercase",overflowWrap:"anywhere"}},{children:v})),N&&r(m,i({size:"small",onClick:I,disabled:!I,"aria-label":"Close reviewed card",sx:{p:0,color:"#475569","&.Mui-disabled":{color:"text.secondary"}}},{children:r(n,{sx:{fontSize:17}})}))]})),o(d,i({spacing:.875,sx:{px:1.25,pt:1.25,pb:1}},{children:[o(l,{children:[r(h,i({sx:{color:"text.primary",fontSize:14,fontWeight:500,overflowWrap:"anywhere"}},{children:y})),null!=b&&r(h,i({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:b}))]}),null!=C&&r(d,i({sx:null==H?void 0:H.content},{children:C})),B&&o(d,i({spacing:.625,sx:null==H?void 0:H.footer},{children:[r(c,{}),o(a,i({onClick:S,disabled:!S,sx:{width:"100%",minWidth:0,justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:S?"pointer":"not-allowed"}},{children:[o(d,i({direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,flex:1}},{children:[r(x,{sx:{color:"text.secondary"}}),r(h,i({sx:{minWidth:0,color:"text.primary",fontSize:12,overflowWrap:"anywhere"}},{children:z}))]})),o(d,i({direction:"row",alignItems:"center",spacing:.5,sx:{flexShrink:0}},{children:[r(f,{score:W}),r(t,{sx:{color:"text.secondary"}})]}))]}))]}))]}))]}))}export{g as default};
|
|
2
|
+
//# sourceMappingURL=ReviewedCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReviewedCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|