@viswa-test/test-citation 0.0.253 → 0.0.255

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
  3. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  4. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  5. package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
  7. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
  8. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
  9. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  10. package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
  11. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  12. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  13. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  14. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  15. package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
  16. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  17. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  18. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  19. package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  20. package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  21. package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  22. package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  23. package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.module.css.js +1 -1
  24. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  25. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  26. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  27. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  28. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  29. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  30. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  31. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
  32. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  33. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  34. package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  35. package/dist/cjs/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  36. package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
  37. package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  38. package/dist/cjs/features/RequirementAI/components/segment/segment.module.css.js +1 -1
  39. package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  40. package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.module.css.js +1 -1
  41. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  42. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  43. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  44. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  45. package/dist/cjs/service/redlineService.js +1 -1
  46. package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
  47. package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
  48. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  49. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  50. package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
  51. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
  52. package/dist/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
  53. package/dist/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
  54. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  55. package/dist/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
  56. package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  57. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  58. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  59. package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  60. package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
  61. package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  62. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  63. package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  64. package/dist/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  65. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  66. package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  67. package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
  68. package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.module.css.js +1 -1
  69. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  70. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  71. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  72. package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
  73. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  74. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  75. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  76. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
  77. package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  78. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  79. package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
  80. package/dist/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
  81. package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
  82. package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  83. package/dist/features/RequirementAI/components/segment/segment.module.css.js +1 -1
  84. package/dist/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
  85. package/dist/features/RequirementAI/components/story-screen/CompletionPanel.module.css.js +1 -1
  86. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  87. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  88. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  89. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  90. package/dist/service/redlineService.js +1 -1
  91. package/dist/types/src/CitationAccordionTest.d.ts +1 -0
  92. package/dist/types/src/CitationAccordionTest.d.ts.map +1 -0
  93. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
  94. package/dist/types/src/DeviationSummaryTest.d.ts.map +1 -1
  95. package/dist/types/src/MockDeviationSummary.d.ts +1 -0
  96. package/dist/types/src/MockDeviationSummary.d.ts.map +1 -0
  97. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  98. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  99. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +3 -0
  100. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
  101. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +3 -1
  102. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
  103. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
  104. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  105. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +19 -0
  106. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  107. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +21 -3
  108. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
  109. package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
  110. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +5 -1
  111. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
  112. package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts +6 -1
  113. package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -1
  114. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +1680 -1842
  115. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
  116. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/new-guidelines.mockData.d.ts +33 -0
  117. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/new-guidelines.mockData.d.ts.map +1 -0
  118. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts +11 -0
  119. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts.map +1 -0
  120. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
  121. package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts +2 -0
  122. package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts.map +1 -1
  123. package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
  124. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  125. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts +1 -0
  126. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
  127. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts +2 -1
  128. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
  129. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts +1 -0
  130. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
  131. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +2 -1
  132. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
  133. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +0 -1
  134. package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
  135. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts +1 -1
  136. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
  137. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts +1 -1
  138. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
  139. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +7 -23
  140. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  141. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  142. package/dist/types/src/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.d.ts.map +1 -1
  143. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts +0 -8
  144. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
  145. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +1 -7
  146. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  147. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  148. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts +13 -17
  149. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
  150. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
  151. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +3 -15
  152. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  153. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +2 -21
  154. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  155. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
  156. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts +1 -3
  157. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
  158. package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts +2 -3
  159. package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts.map +1 -1
  160. package/dist/types/src/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.d.ts +0 -1
  161. package/dist/types/src/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.d.ts.map +1 -1
  162. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +1 -8
  163. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
  164. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +1 -5
  165. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
  166. package/dist/types/src/features/RequirementAI/components/story-screen/CompletionPanel.d.ts +1 -3
  167. package/dist/types/src/features/RequirementAI/components/story-screen/CompletionPanel.d.ts.map +1 -1
  168. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +1 -3
  169. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  170. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +1 -2
  171. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  172. package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts +1 -18
  173. package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts.map +1 -1
  174. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +1 -32
  175. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
  176. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +0 -8
  177. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
  178. package/dist/types/src/service/redlineService.d.ts +0 -6
  179. package/dist/types/src/service/redlineService.d.ts.map +1 -1
  180. package/package.json +2 -2
  181. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
  182. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
  183. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +0 -2
  184. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js.map +0 -1
  185. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +0 -2
  186. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +0 -1
  187. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +0 -2
  188. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +0 -1
  189. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +0 -2
  190. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +0 -1
  191. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +0 -2
  192. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +0 -1
  193. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +0 -2
  194. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +0 -1
  195. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +0 -2
  196. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +0 -1
  197. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +0 -2
  198. package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +0 -1
  199. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js +0 -2
  200. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js.map +0 -1
  201. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +0 -2
  202. package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +0 -1
  203. package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +0 -2
  204. package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js.map +0 -1
  205. package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js +0 -2
  206. package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js.map +0 -1
  207. package/dist/cjs/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js +0 -2
  208. package/dist/cjs/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js.map +0 -1
  209. package/dist/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
  210. package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
  211. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +0 -2
  212. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js.map +0 -1
  213. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +0 -2
  214. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +0 -1
  215. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +0 -2
  216. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +0 -1
  217. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +0 -2
  218. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +0 -1
  219. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +0 -2
  220. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +0 -1
  221. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +0 -2
  222. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +0 -1
  223. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +0 -2
  224. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +0 -1
  225. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +0 -2
  226. package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +0 -1
  227. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js +0 -2
  228. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js.map +0 -1
  229. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +0 -2
  230. package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +0 -1
  231. package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +0 -2
  232. package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js.map +0 -1
  233. package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js +0 -2
  234. package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js.map +0 -1
  235. package/dist/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js +0 -2
  236. package/dist/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js.map +0 -1
  237. package/dist/types/src/RedlineApprovalCardTest.d.ts +0 -1
  238. package/dist/types/src/RedlineApprovalCardTest.d.ts.map +0 -1
  239. package/dist/types/src/RedlineEditorTest2.d.ts +0 -3
  240. package/dist/types/src/RedlineEditorTest2.d.ts.map +0 -1
  241. package/dist/types/src/commonConstants.d.ts +0 -31103
  242. package/dist/types/src/commonConstants.d.ts.map +0 -1
  243. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +0 -128
  244. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +0 -1
  245. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +0 -13
  246. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +0 -1
  247. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +0 -5445
  248. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +0 -1
  249. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts +0 -13
  250. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts.map +0 -1
  251. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts +0 -10
  252. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts.map +0 -1
  253. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +0 -14
  254. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +0 -1
  255. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts +0 -10
  256. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +0 -1
  257. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +0 -30
  258. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +0 -1
  259. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts +0 -4
  260. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts.map +0 -1
  261. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +0 -2
  262. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +0 -1
  263. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.d.ts +0 -11
  264. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.d.ts.map +0 -1
  265. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.d.ts +0 -25
  266. package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.d.ts.map +0 -1
  267. package/dist/types/src/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.d.ts +0 -31
  268. package/dist/types/src/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.d.ts.map +0 -1
  269. package/dist/types/src/features/RequirementAI/components/segment/DeleteSegmentsDialog.d.ts +0 -13
  270. package/dist/types/src/features/RequirementAI/components/segment/DeleteSegmentsDialog.d.ts.map +0 -1
  271. package/dist/types/src/features/RequirementAI/components/segment/EditSegmentDialog.d.ts +0 -12
  272. package/dist/types/src/features/RequirementAI/components/segment/EditSegmentDialog.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("lucide-react"),a=require("./ClinicalTrialSection.module.css.js");exports.default=({title:s,note:n="This content is provided by the scientific team and not generated from uploaded documents.",fields:t,value:i,readonly:d=!0,isSaving:r=!1,styles:u,onChange:o,onSave:c,onCancel:m})=>{const v=(e,l)=>{d||null==o||o({...i,[e]:l})},y=t.find(e=>"summary"===e.key),x=t.filter(e=>"summary"!==e.key),f=t.some(e=>{var l;return(null!==(l=i[e.key])&&void 0!==l?l:"").trim().length>0});return e.jsxs("div",{className:a.default.container,style:null==u?void 0:u.container,children:[e.jsxs("div",{className:a.default.noteContainer,style:null==u?void 0:u.noteContainer,children:[e.jsx(l.Info,{size:18,className:a.default.noteIcon,style:null==u?void 0:u.noteIcon}),e.jsxs("span",{className:a.default.noteText,style:null==u?void 0:u.noteText,children:[e.jsx("strong",{children:"Note:"})," ",n]})]}),d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default.fieldsRow,style:null==u?void 0:u.fieldsRow,children:x.map(l=>e.jsxs("div",{className:a.default.field,style:null==u?void 0:u.field,children:[e.jsx("label",{className:a.default.label,style:null==u?void 0:u.label,children:l.label}),e.jsx("div",{className:a.default.readonlyValue,style:null==u?void 0:u.readonlyValue,children:i[l.key]||"-"})]},l.key))}),y&&e.jsxs("div",{className:a.default.field,style:null==u?void 0:u.field,children:[e.jsx("label",{className:a.default.label,style:null==u?void 0:u.label,children:y.label}),e.jsx("div",{className:a.default.readonlySummary,style:null==u?void 0:u.readonlySummary,children:i.summary||"-"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default.fieldsRow,style:null==u?void 0:u.fieldsRow,children:x.map(l=>{var s;return e.jsxs("div",{className:a.default.field,style:null==u?void 0:u.field,children:[e.jsx("label",{className:a.default.label,style:null==u?void 0:u.label,children:l.label}),"select"===l.type?e.jsxs("select",{className:a.default.input,style:null==u?void 0:u.input,value:i[l.key]||"",onChange:e=>v(l.key,e.target.value),children:[e.jsxs("option",{value:"",children:["Select ",l.label]}),null===(s=l.options)||void 0===s?void 0:s.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))]}):e.jsx("input",{className:a.default.input,style:null==u?void 0:u.input,placeholder:l.placeholder,value:i[l.key]||"",onChange:e=>v(l.key,e.target.value)})]},l.key)})}),y&&e.jsx("div",{className:a.default.summaryContainer,style:null==u?void 0:u.summaryContainer,children:e.jsx("textarea",{className:a.default.summaryTextarea,style:null==u?void 0:u.summaryTextarea,placeholder:(null==y?void 0:y.placeholder)||"Add section summary here",value:i.summary||"",onChange:e=>v("summary",e.target.value)})}),e.jsxs("div",{className:a.default.actionBar,style:null==u?void 0:u.actionBar,children:[e.jsxs("button",{type:"button",className:a.default.cancelButton,style:null==u?void 0:u.cancelButton,onClick:m,children:[e.jsx(l.X,{size:18}),e.jsx("span",{children:"Cancel"})]}),e.jsx("button",{type:"button",className:a.default.saveButton,style:null==u?void 0:u.saveButton,onClick:c,disabled:r||!f,children:r?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:18,className:a.default.spinner,style:null==u?void 0:u.spinner}),e.jsx("span",{children:"Saving..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Save,{size:18}),e.jsx("span",{children:"Save"})]})})]})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("lucide-react"),a=require("./ClinicalTrialSection.module.css.js");exports.default=({title:s,note:n="This content is provided by the scientific team and not generated from uploaded documents.",fields:t,value:i,readonly:d=!0,isSaving:u=!1,styles:r,onChange:o,onSave:c,onCancel:m})=>{const v=(e,l)=>{d||null==o||o({...i,[e]:l})},y=t.find(e=>"summary"===e.key),x=t.filter(e=>"summary"!==e.key);return e.jsxs("div",{className:a.default.container,style:null==r?void 0:r.container,children:[e.jsxs("div",{className:a.default.noteContainer,style:null==r?void 0:r.noteContainer,children:[e.jsx(l.Info,{size:18,className:a.default.noteIcon,style:null==r?void 0:r.noteIcon}),e.jsxs("span",{className:a.default.noteText,style:null==r?void 0:r.noteText,children:[e.jsx("strong",{children:"Note:"})," ",n]})]}),d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default.fieldsRow,style:null==r?void 0:r.fieldsRow,children:x.map(l=>e.jsxs("div",{className:a.default.field,style:null==r?void 0:r.field,children:[e.jsx("label",{className:a.default.label,style:null==r?void 0:r.label,children:l.label}),e.jsx("div",{className:a.default.readonlyValue,style:null==r?void 0:r.readonlyValue,children:i[l.key]||"-"})]},l.key))}),y&&e.jsxs("div",{className:a.default.field,style:null==r?void 0:r.field,children:[e.jsx("label",{className:a.default.label,style:null==r?void 0:r.label,children:y.label}),e.jsx("div",{className:a.default.readonlySummary,style:null==r?void 0:r.readonlySummary,children:i.summary||"-"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default.fieldsRow,style:null==r?void 0:r.fieldsRow,children:x.map(l=>{var s;return e.jsxs("div",{className:a.default.field,style:null==r?void 0:r.field,children:[e.jsx("label",{className:a.default.label,style:null==r?void 0:r.label,children:l.label}),"select"===l.type?e.jsxs("select",{className:a.default.input,style:null==r?void 0:r.input,value:i[l.key]||"",onChange:e=>v(l.key,e.target.value),children:[e.jsxs("option",{value:"",children:["Select ",l.label]}),null===(s=l.options)||void 0===s?void 0:s.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))]}):e.jsx("input",{className:a.default.input,style:null==r?void 0:r.input,placeholder:l.placeholder,value:i[l.key]||"",onChange:e=>v(l.key,e.target.value)})]},l.key)})}),y&&e.jsx("div",{className:a.default.summaryContainer,style:null==r?void 0:r.summaryContainer,children:e.jsx("textarea",{className:a.default.summaryTextarea,style:null==r?void 0:r.summaryTextarea,placeholder:(null==y?void 0:y.placeholder)||"Add section summary here",value:i.summary||"",onChange:e=>v("summary",e.target.value)})}),e.jsxs("div",{className:a.default.actionBar,style:null==r?void 0:r.actionBar,children:[e.jsxs("button",{type:"button",className:a.default.cancelButton,style:null==r?void 0:r.cancelButton,onClick:m,children:[e.jsx(l.X,{size:18}),e.jsx("span",{children:"Cancel"})]}),e.jsx("button",{type:"button",className:a.default.saveButton,style:null==r?void 0:r.saveButton,onClick:c,disabled:u,children:u?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:18,className:a.default.spinner,style:null==r?void 0:r.spinner}),e.jsx("span",{children:"Saving..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Save,{size:18}),e.jsx("span",{children:"Save"})]})})]})]})]})};
2
2
  //# sourceMappingURL=ClinicalTrialSection.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode(".ClinicalTrialSection-module_container__oXyDo{display:flex;flex-direction:column;gap:20px;padding:20px;width:100%}.ClinicalTrialSection-module_noteContainer__fjKfZ{align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;display:flex;gap:8px;padding:12px 16px}.ClinicalTrialSection-module_noteIcon__uO955{color:#6b7280;flex-shrink:0}.ClinicalTrialSection-module_noteText__ZNtmw{color:#4b5563;font-size:14px;line-height:20px}.ClinicalTrialSection-module_fieldsRow__S5DzE{display:flex;gap:24px;width:100%}.ClinicalTrialSection-module_field__KuTr6{display:flex;flex:1;flex-direction:column}.ClinicalTrialSection-module_label__xPB0g{color:#111827;font-size:14px;font-weight:600;line-height:20px;margin-bottom:8px}.ClinicalTrialSection-module_input__nGvpX{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;height:48px;outline:none;padding:0 16px;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_input__nGvpX::placeholder{color:#9ca3af}.ClinicalTrialSection-module_input__nGvpX:focus{border-color:#3b82f6}.ClinicalTrialSection-module_summaryContainer__kdXAi{width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;line-height:20px;min-height:150px;outline:none;padding:16px;resize:vertical;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd::placeholder{color:#9ca3af}.ClinicalTrialSection-module_summaryTextarea__QbEXd:focus{border-color:#3b82f6}.ClinicalTrialSection-module_actionBar__V8LoA{align-items:center;display:flex;gap:24px;justify-content:flex-end;margin-top:20px}.ClinicalTrialSection-module_cancelButton__GsyN4{align-items:center;background:#0000;border:none;color:#ef4444;cursor:pointer;display:flex;font-size:16px;font-weight:500;gap:6px}.ClinicalTrialSection-module_cancelButton__GsyN4:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo{align-items:center;background:#0000;border:none;color:#4f46e5;cursor:pointer;display:flex;font-size:16px;font-weight:600;gap:6px}.ClinicalTrialSection-module_saveButton__P5AIo:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo:disabled{color:#9ca3af;cursor:not-allowed;opacity:.6;pointer-events:none}.ClinicalTrialSection-module_saveButton__P5AIo:disabled:hover{opacity:.6}.ClinicalTrialSection-module_readonlyValue__31toE{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;display:flex;font-size:14px;line-height:20px;min-height:48px;padding:0 16px}.ClinicalTrialSection-module_readonlySummary__WF5q6{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;font-size:14px;line-height:22px;min-height:150px;padding:16px;white-space:pre-wrap;word-break:break-word}.ClinicalTrialSection-module_spinner__AL39r{animation:ClinicalTrialSection-module_spin__kH9hF 1s linear infinite}@keyframes ClinicalTrialSection-module_spin__kH9hF{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"ClinicalTrialSection-module_container__oXyDo",noteContainer:"ClinicalTrialSection-module_noteContainer__fjKfZ",noteIcon:"ClinicalTrialSection-module_noteIcon__uO955",noteText:"ClinicalTrialSection-module_noteText__ZNtmw",fieldsRow:"ClinicalTrialSection-module_fieldsRow__S5DzE",field:"ClinicalTrialSection-module_field__KuTr6",label:"ClinicalTrialSection-module_label__xPB0g",input:"ClinicalTrialSection-module_input__nGvpX",summaryContainer:"ClinicalTrialSection-module_summaryContainer__kdXAi",summaryTextarea:"ClinicalTrialSection-module_summaryTextarea__QbEXd",actionBar:"ClinicalTrialSection-module_actionBar__V8LoA",cancelButton:"ClinicalTrialSection-module_cancelButton__GsyN4",saveButton:"ClinicalTrialSection-module_saveButton__P5AIo",readonlyValue:"ClinicalTrialSection-module_readonlyValue__31toE",readonlySummary:"ClinicalTrialSection-module_readonlySummary__WF5q6",spinner:"ClinicalTrialSection-module_spinner__AL39r",spin:"ClinicalTrialSection-module_spin__kH9hF"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode(".ClinicalTrialSection-module_container__oXyDo{display:flex;flex-direction:column;gap:20px;padding:20px;width:100%}.ClinicalTrialSection-module_noteContainer__fjKfZ{align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;display:flex;gap:8px;padding:12px 16px}.ClinicalTrialSection-module_noteIcon__uO955{color:#6b7280;flex-shrink:0}.ClinicalTrialSection-module_noteText__ZNtmw{color:#4b5563;font-size:14px;line-height:20px}.ClinicalTrialSection-module_fieldsRow__S5DzE{display:flex;gap:24px;width:100%}.ClinicalTrialSection-module_field__KuTr6{display:flex;flex:1;flex-direction:column}.ClinicalTrialSection-module_label__xPB0g{color:#111827;font-size:14px;font-weight:600;line-height:20px;margin-bottom:8px}.ClinicalTrialSection-module_input__nGvpX{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;height:48px;outline:none;padding:0 16px;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_input__nGvpX::placeholder{color:#9ca3af}.ClinicalTrialSection-module_input__nGvpX:focus{border-color:#3b82f6}.ClinicalTrialSection-module_summaryContainer__kdXAi{width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;line-height:20px;min-height:150px;outline:none;padding:16px;resize:vertical;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd::placeholder{color:#9ca3af}.ClinicalTrialSection-module_summaryTextarea__QbEXd:focus{border-color:#3b82f6}.ClinicalTrialSection-module_actionBar__V8LoA{align-items:center;display:flex;gap:24px;justify-content:flex-end;margin-top:20px}.ClinicalTrialSection-module_cancelButton__GsyN4{align-items:center;background:#0000;border:none;color:#ef4444;cursor:pointer;display:flex;font-size:16px;font-weight:500;gap:6px}.ClinicalTrialSection-module_cancelButton__GsyN4:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo{align-items:center;background:#0000;border:none;color:#4f46e5;cursor:pointer;display:flex;font-size:16px;font-weight:600;gap:6px}.ClinicalTrialSection-module_saveButton__P5AIo:hover{opacity:.8}.ClinicalTrialSection-module_readonlyValue__31toE{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;display:flex;font-size:14px;line-height:20px;min-height:48px;padding:0 16px}.ClinicalTrialSection-module_readonlySummary__WF5q6{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;font-size:14px;line-height:22px;min-height:150px;padding:16px;white-space:pre-wrap;word-break:break-word}.ClinicalTrialSection-module_spinner__AL39r{animation:ClinicalTrialSection-module_spin__kH9hF 1s linear infinite}@keyframes ClinicalTrialSection-module_spin__kH9hF{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"ClinicalTrialSection-module_container__oXyDo",noteContainer:"ClinicalTrialSection-module_noteContainer__fjKfZ",noteIcon:"ClinicalTrialSection-module_noteIcon__uO955",noteText:"ClinicalTrialSection-module_noteText__ZNtmw",fieldsRow:"ClinicalTrialSection-module_fieldsRow__S5DzE",field:"ClinicalTrialSection-module_field__KuTr6",label:"ClinicalTrialSection-module_label__xPB0g",input:"ClinicalTrialSection-module_input__nGvpX",summaryContainer:"ClinicalTrialSection-module_summaryContainer__kdXAi",summaryTextarea:"ClinicalTrialSection-module_summaryTextarea__QbEXd",actionBar:"ClinicalTrialSection-module_actionBar__V8LoA",cancelButton:"ClinicalTrialSection-module_cancelButton__GsyN4",saveButton:"ClinicalTrialSection-module_saveButton__P5AIo",readonlyValue:"ClinicalTrialSection-module_readonlyValue__31toE",readonlySummary:"ClinicalTrialSection-module_readonlySummary__WF5q6",spinner:"ClinicalTrialSection-module_spinner__AL39r",spin:"ClinicalTrialSection-module_spin__kH9hF"};
2
2
  //# sourceMappingURL=ClinicalTrialSection.module.css.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("react/jsx-runtime"),e=require("lucide-react"),n=require("react"),o=require("./ResizableSplitPane.js"),l=require("../icons/PdfViewerIcons.js"),t=require("@e-llm-studio/citation"),a=require("react-markdown"),r=require("rehype-raw"),d=require("@mui/material"),u=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function s(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var c=s(a),v=s(r);const p=i=>{if(i)try{const e=new URL(i).hostname.replace(/^www\./i,""),n=e.split(".")[0];return n?n.charAt(0).toUpperCase()+n.slice(1):e}catch(i){return}},x=(i,e)=>{const n=((i,e)=>(null==i?void 0:i.payloadCitationId)||(null==e?void 0:e.payloadCitationId)||(null==e?void 0:e.citation_uuid)||"")(i,e)||("function"==typeof(null===(o=globalThis.crypto)||void 0===o?void 0:o.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const e=Math.floor(16*Math.random());return("x"===i?e:e%4+8).toString(16)}));var o;return i&&"object"==typeof i&&(i.payloadCitationId=n),e&&"object"==typeof e&&(e.payloadCitationId=n,e.citation_uuid||(e.citation_uuid=n)),n},g=({href:l,metaData:a,citationTitle:r,isFullscreen:s,secondaryCitation:g})=>{var h,f,m,b,y,C,j,_,w,F,T,I,D,S,P,k,M,U,W,z,R;const A=n.useMemo(()=>{var i;return null===(i=(Array.isArray(null==a?void 0:a.citations)?a.citations:[]).find(i=>`pdf_citation$${i.id}`===l))||void 0===i?void 0:i.data},[l,null==a?void 0:a.citations]),q=null!==(y=null===(b=null===(m=null===(f=null===(h=null==a?void 0:a.guidelinesData)||void 0===h?void 0:h.artifactData)||void 0===f?void 0:f.userStorySnapshot)||void 0===m?void 0:m[0])||void 0===b?void 0:b.value)&&void 0!==y?y:"",E=n.useMemo(()=>{const i=null==g?void 0:g.phraseToHighlight;if(!i)return q;const e=q.toLowerCase().indexOf(i.toLowerCase());return-1===e?q:[q.slice(0,e),'<mark style="background-color: #FEF08A; padding: 0 2px;">',q.slice(e,e+i.length),"</mark>",q.slice(e+i.length)].join("")},[q,null==g?void 0:g.phraseToHighlight]),B=n.useMemo(()=>{var i;const e=Array.isArray(null==a?void 0:a.gptCitations)?a.gptCitations:[],n=((i="")=>{const e=i.match(/gpt_citation\$(\d+)/i);return(null==e?void 0:e[1])||""})(null==g?void 0:g.href);if(!n)return null;const o=e.find(i=>String(null==i?void 0:i.id)===n),l=(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.extraMetaData)||{},t=(i=>Object.keys(i||{}).sort((i,e)=>Number(i)-Number(e)))(l),r=t[Number((null==g?void 0:g.occurrenceIndex)||0)]||t[0];return r?l[r]:null},[null==a?void 0:a.gptCitations,null==g?void 0:g.href,null==g?void 0:g.occurrenceIndex]),G=(null===(w=null===(_=null===(j=null===(C=null==B?void 0:B.aiReasoningCitation)||void 0===C?void 0:C.gpt_citation)||void 0===j?void 0:j[0])||void 0===_?void 0:_.customMetaData)||void 0===w?void 0:w.value)||{},N=(null===(I=null===(T=null===(F=null==B?void 0:B.aiReasoningCitation)||void 0===F?void 0:F.gpt_citation)||void 0===T?void 0:T[0])||void 0===I?void 0:I.customMetaData)||{},L=n.useMemo(()=>x(B,G),[G,B]),[O,H]=n.useState(),[V,$]=n.useState("pending"),[X,J]=n.useState(!0),{apiCachingConfig:K,citationConfig:Q}=u.useRequirementAI(),{getGptWebCitation:Y,gptWebCitationPartialPayload:Z}=K||{},ii=(null===(D=null==Q?void 0:Q.gptWeb)||void 0===D?void 0:D.displayMode)||t.CitationType.GPT_WEB,ei=null===(S=null==g?void 0:g.href)||void 0===S?void 0:S.includes("gpt_citation"),ni=n.useMemo(()=>({...Z,citationId:L,citationUrl:null==G?void 0:G.citationUrl,content:(null==B?void 0:B.Reasoning)||(null==G?void 0:G.text),citationType:null==G?void 0:G.citationType,citatioNumber:Number((null==N?void 0:N.citation_number)||0)}),[Z,L,null==N?void 0:N.citation_number,null==G?void 0:G.citationType,null==G?void 0:G.citationUrl,null==G?void 0:G.text,null==B?void 0:B.Reasoning]),oi=n.useMemo(()=>({item:{confidence_score:Number((null==B?void 0:B.Confidence_score)||0),text:(null==G?void 0:G.paraphrase)||(null==g?void 0:g.title)||"Web citation reasoning",dataSource:(null==G?void 0:G.text)||(null==B?void 0:B.Reasoning)||"",paraphrase:(null==G?void 0:G.paraphrase)||""},headerTitle:(null==G?void 0:G.label)||"GPT Web Citation",index:Number((null==N?void 0:N.citation_number)||1)-1,iconsConfig:{ChevronDownIcon:e.ChevronDown,ChevronUpIcon:e.ChevronUp,MaximizeIcon:e.Maximize2,CloseIcon:e.X}}),[null==g?void 0:g.title,null==N?void 0:N.citation_number,null==G?void 0:G.label,null==G?void 0:G.paraphrase,null==G?void 0:G.text,null==B?void 0:B.Confidence_score,null==B?void 0:B.Reasoning]);if(n.useEffect(()=>{let i=!0;return(async()=>{var e,n;if(ei&&(null==G?void 0:G.citationUrl)&&ii!==t.CitationType.GPT&&(ii!==t.CitationType.GPT_WEB||X))if(Y){$("pending");try{const o=await Y(ni);if(!i)return;H(null!==(n=null!==(e=null==o?void 0:o.data)&&void 0!==e?e:null==o?void 0:o.responseData)&&void 0!==n?n:o),$("success")}catch(e){if(!i)return;$("error"),console.error("Failed to load GPT web citation",e)}}else $("error")})(),()=>{i=!1}},[Y,ni,ii,ei,null==G?void 0:G.citationUrl,X]),!A)return null;const li=(null===(P=null==a?void 0:a.docData)||void 0===P?void 0:P.documents)||{},ti=(null===(k=null==a?void 0:a.docData)||void 0===k?void 0:k.input_index_map)||{},ai=Object.values(ti).find(i=>{const e=null==li?void 0:li[i];return(null==A?void 0:A[i])&&("application/pdf"===(null==e?void 0:e.mime_type)||"base"===(null==e?void 0:e.role))}),ri=Object.keys(A).find(i=>{const e=null==li?void 0:li[i];return"application/pdf"===(null==e?void 0:e.mime_type)||"base"===(null==e?void 0:e.role)})||Object.keys(A)[0],di=ai||ri||(null==ti?void 0:ti[0]),ui=Object.values(ti).find(i=>i!==di),si=di?li[di]:null,ci=ui?li[ui]:null,vi=di?A[di]:null,pi=ui?A[ui]:null,xi="rulebook_citation"===((null===(M=null==g?void 0:g.type)||void 0===M?void 0:M.toLowerCase())||"")||Boolean(null==g?void 0:g.phraseToHighlight),gi=g?i.jsxs("div",{style:{height:"100%",overflow:"auto",padding:"16px",boxSizing:"border-box",backgroundColor:"#FFFFFF",color:"#101828",fontFamily:'"Inter", sans-serif',fontSize:"13px",lineHeight:1.6},children:[i.jsx("div",{style:{fontWeight:700,marginBottom:"8px"},children:xi?"Guideline Citation":"Web/GPT Citation"}),xi?i.jsx(i.Fragment,{children:i.jsx(d.Box,{sx:{padding:"0px 12px",backgroundColor:"#FFFFFF",overflow:"visible"},children:i.jsx(c.default,{rehypePlugins:[v.default],children:E})})}):ei?i.jsx(t.GptWebCitation,{gptCitation:oi,defaultCitationUrl:(null==G?void 0:G.citationUrl)||"",citationType:ii,webCitationData:O,sourceLabel:`Source: Web Citation > ${(null==G?void 0:G.paraphrase)||(null==G?void 0:G.label)||"Web Citation"}`,learnedFrom:p(null==G?void 0:G.citationUrl),showWebCitation:X,webCitationStatus:V,onGenerateWebCitation:()=>J(!0),onToggleCitationView:()=>J(i=>!i),showExpandImageButton:!0,showGptMaximizeButton:!0,iconsConfig:{MaximizeIcon:e.Maximize2,ExternalLinkIcon:e.ExternalLink},isFixedHeight:!1}):i.jsx("div",{children:"No secondary citation preview available."})]}):null;if(["Contract","clause"].includes(r)){const e=vi?i.jsx(t.PdfViewer,{pdfName:null==si?void 0:si.title,pdfUrl:null==si?void 0:si.signed_url,highlightText:[null!==(U=null==vi?void 0:vi.highlighted_text)&&void 0!==U?U:""],highlightPages:{1:null===(W=null==vi?void 0:vi.custom_metadata)||void 0===W?void 0:W.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,n=gi||(pi?i.jsx(t.PdfViewer,{pdfName:null==ci?void 0:ci.title,pdfUrl:null==ci?void 0:ci.signed_url,jumpToPageValue:1,highlightText:[null!==(z=null==pi?void 0:pi.highlighted_text)&&void 0!==z?z:""],highlightPages:{1:null===(R=null==pi?void 0:pi.custom_metadata)||void 0===R?void 0:R.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null);return vi||pi||gi?i.jsx("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:i.jsx(o.default,{leftComponent:e,rightComponent:n,isFullscreen:s})}):i.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return i.jsx("div",{children:"No Citation Found. Please try again later"})};exports.default=({href:o,children:t,metaData:a,secondaryCitation:r,chevronUpComponent:d=null,chevronDownComponent:u=null,customStyle:s={},defaultState:c=!1})=>{var v,p,x;const[h,f]=n.useState(c),[m,b]=n.useState(!1),y="string"==typeof t&&(null===(v=null==t?void 0:t.split("\n"))||void 0===v?void 0:v.length)>1?t.split("\n").join(" "):t,C="string"==typeof t?t:t[0],j=null!=d?d:(n=>{var o,l;return i.jsx(e.ChevronUp,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(l=null==n?void 0:n.color)&&void 0!==l?l:"rgb(214, 51, 132)"})})(null!==(p=null==s?void 0:s.arrow)&&void 0!==p?p:{}),_=null!=u?u:(n=>{var o,l;return i.jsx(e.ChevronDown,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(l=null==n?void 0:n.color)&&void 0!==l?l:"rgb(214, 51, 132)"})})(null!==(x=null==s?void 0:s.arrow)&&void 0!==x?x:{}),w=n.useMemo(()=>(Array.isArray(null==a?void 0:a.citations)?a.citations:[]).some(i=>`pdf_citation$${i.id}`===o),[o,null==a?void 0:a.citations]);return["contract","clause"].includes(C.toLowerCase())&&w?i.jsxs("span",{style:{display:"inline",...s.relativeWrapper||{}},children:[i.jsx("div",{style:{display:"inline",marginTop:0,...s.citationButtonWrapper||{}},children:i.jsxs("button",{type:"button",onClick:()=>f(i=>!i),style:{display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal",...s.citationButton||{}},children:[i.jsx("span",{children:y}),i.jsx("span",{style:{display:"flex",alignItems:"center"},children:h?j:_})]})}),h&&i.jsxs("div",{style:m?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"},children:[i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0},children:i.jsx("button",{onClick:()=>{b(i=>!i)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"},children:m?i.jsx(l.DefaultFullScreenCloseIcon,{}):i.jsx(l.DefaultFullScreenIcon,{})})}),i.jsx("div",{style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"},children:i.jsx(g,{href:o,children:t,metaData:a,citationTitle:C,isFullscreen:m,secondaryCitation:r})})]})]}):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("react"),n=require("./ResizableSplitPane.js"),t=require("../icons/PdfViewerIcons.js"),o=require("@e-llm-studio/citation");const r=({href:i,metaData:t,citationTitle:r,isFullscreen:d})=>{var a,s,u,c,p,h;const g=l.useMemo(()=>{var e;return null===(e=t.citations.find(e=>`pdf_citation$${e.id}`===i))||void 0===e?void 0:e.data},[i]);if(!g)return null;const v=(null===(a=null==t?void 0:t.docData)||void 0===a?void 0:a.documents)||{},x=(null===(s=null==t?void 0:t.docData)||void 0===s?void 0:s.input_index_map)||{},f=null==x?void 0:x[0],m=null==x?void 0:x[1],j=f?v[f]:null,y=m?v[m]:null,b=f?g[f]:null,C=m?g[m]:null;if(["Contract","clause"].includes(r)){const i=b?e.jsx(o.PdfViewer,{pdfName:j.title,pdfUrl:j.signed_url,highlightText:[null!==(u=null==b?void 0:b.highlighted_text)&&void 0!==u?u:""],highlightPages:{1:null===(c=null==b?void 0:b.custom_metadata)||void 0===c?void 0:c.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,l=C?e.jsx(o.PdfViewer,{pdfName:y.title,pdfUrl:y.signed_url,jumpToPageValue:1,highlightText:[null!==(p=null==C?void 0:C.highlighted_text)&&void 0!==p?p:""],highlightPages:{1:null===(h=null==C?void 0:C.custom_metadata)||void 0===h?void 0:h.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null;return b||C?e.jsx("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:e.jsx(n.default,{leftComponent:i,rightComponent:l,isFullscreen:d})}):e.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return e.jsx("div",{children:"No Citation Found. Please try again later"})};exports.default=({href:n,children:o,metaData:d,chevronUpComponent:a=null,chevronDownComponent:s=null,customStyle:u={},defaultState:c=!1})=>{var p,h,g;const[v,x]=l.useState(c),[f,m]=l.useState(!1),j="string"==typeof o&&(null===(p=null==o?void 0:o.split("\n"))||void 0===p?void 0:p.length)>1?o.split("\n").join(" "):o,y="string"==typeof o?o:o[0],b=null!=a?a:(l=>{var n,t;return e.jsx(i.ChevronUp,{size:null!==(n=null==l?void 0:l.fontSize)&&void 0!==n?n:16,color:null!==(t=null==l?void 0:l.color)&&void 0!==t?t:"rgb(214, 51, 132)"})})(null!==(h=null==u?void 0:u.arrow)&&void 0!==h?h:{}),C=null!=s?s:(l=>{var n,t;return e.jsx(i.ChevronDown,{size:null!==(n=null==l?void 0:l.fontSize)&&void 0!==n?n:16,color:null!==(t=null==l?void 0:l.color)&&void 0!==t?t:"rgb(214, 51, 132)"})})(null!==(g=null==u?void 0:u.arrow)&&void 0!==g?g:{});return e.jsxs("span",{style:{display:"inline",...u.relativeWrapper||{}},children:[e.jsx("div",{style:{display:"inline",marginTop:0,...u.citationButtonWrapper||{}},children:e.jsxs("button",{type:"button",onClick:()=>x(e=>!e),style:{display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal",...u.citationButton||{}},children:[e.jsx("span",{children:j}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:v?b:C})]})}),v&&e.jsxs("div",{style:f?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"},children:[e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0},children:e.jsx("button",{onClick:()=>{m(e=>!e)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"},children:f?e.jsx(t.DefaultFullScreenCloseIcon,{}):e.jsx(t.DefaultFullScreenIcon,{})})}),e.jsx("div",{style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"},children:e.jsx(r,{href:n,children:o,metaData:d,citationTitle:y,isFullscreen:f})})]})]})};
2
2
  //# sourceMappingURL=CitationAnchor.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),t=require("../Popups/PopupDefaults.js"),i=require("react-markdown"),n=require("rehype-raw"),c=require("./CitationComponent.module.css.js"),l=require("lucide-react"),s=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),d=require("./CitationAnchor.js"),o=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),u=require("../../../../../service/redlineService.js"),m=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),p=require("../cws/CwsEvent.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=x(a),f=x(i),v=x(n);const _=(e="")=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),g=(e,a)=>{const t=e.match(new RegExp(`${a}=(["'])(.*?)\\1`,"i"));return(null==t?void 0:t[2])||""},j=(e,a)=>{const t=[...e.matchAll(/<a\b((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/a>/gi)].map(e=>{var a;return{fullMatch:e[0],attributes:e[1],label:e[2],index:null!==(a=e.index)&&void 0!==a?a:0}}),i=t.find(e=>{return a=e.attributes,g(a,"href").startsWith("pdf_citation$");var a}),n=t.find(e=>{return a=e.attributes,g(a,"href").includes("gpt_citation")||a.includes("phrase_to_highlight=");var a});if(!i||!n)return e;const c=((e,a,t,i,n)=>{const c=g(t,"href"),l=g(t,"type")||(c.includes("gpt_citation")?"gpt_citation":""),s=g(t,"reason"),r=c.split("?")[1]||"",d=r&&new URLSearchParams(r).get("phrase_to_highlight")||"",o=c.includes("gpt_citation")&&void 0!==n?` data-secondary-occurrence-index="${n}"`:"";return`<a${e} data-dual-citation="true" data-secondary-href="${_(c)}" data-secondary-type="${_(l)}" data-secondary-title="${_(i)}" data-secondary-reason="${_(s)}" data-secondary-phrase-to-highlight="${_(d)}"${o}>${a}</a>`})(i.attributes,i.label,n.attributes,n.label,g(n.attributes,"href").includes("gpt_citation")?a():void 0),l=(n.index>i.index?e.slice(i.index+i.fullMatch.length,n.index):e.slice(n.index+n.fullMatch.length,i.index)).trim()?n.label:"";return e.replace(i.fullMatch,c).replace(n.fullMatch,l)},y=(e,a)=>{var t,i;const n=a.replace(/-([a-z])/g,(e,a)=>a.toUpperCase());return null!==(i=null!==(t=null==e?void 0:e[a])&&void 0!==t?t:null==e?void 0:e[n])&&void 0!==i?i:""},N=({text:t,item:i})=>{const n=a.useMemo(()=>(e=>{let a=0;const t=()=>a++;return e.split("\n").map(e=>j(e,t)).join("\n")})(t),[t]);return e.jsx(f.default,{rehypePlugins:[v.default],components:{ol:({children:a})=>e.jsx("ol",{className:c.default["md-ol"],children:a}),ul:({children:a})=>e.jsx("ul",{className:c.default["md-ul"],children:a}),li:({children:a})=>e.jsx("li",{className:c.default["md-li"],children:a}),a:({node:a,href:t,children:n})=>{const c=(null==a?void 0:a.properties)||{},l=y(c,"data-secondary-href");return e.jsx(d.default,{href:t,children:n,secondaryCitation:l?{href:l,title:y(c,"data-secondary-title"),type:y(c,"data-secondary-type"),reason:y(c,"data-secondary-reason"),phraseToHighlight:y(c,"data-secondary-phrase-to-highlight"),occurrenceIndex:Number(y(c,"data-secondary-occurrence-index")||0)}:void 0,metaData:{citations:i.citations,docData:i.docData,guidelinesData:i.guidelinesData,gptCitations:i.gptCitations}})}},children:n.replace(/<br\s*\/?>/gi,"\n")})},b=({text:a,markdownStyles:t,citationStyles:i,customIcons:n})=>e.jsx(o.AiReasonMarkdownWrapper,{message:a.replace(/<br\s*\/?>/gi,"\n"),customStyles:t,citationStyles:i,customIcons:n}),I=(e,a)=>e.disableAllActions===a.disableAllActions&&(e.redlineId===a.redlineId&&(e.aiReasonId===a.aiReasonId&&(e.relevanceScore===a.relevanceScore&&(e.reason===a.reason&&(e.impact===a.impact&&(e.explaination===a.explaination&&e.gap===a.gap)))))),C=a.memo(function({item:i,title:n="Cognitive Decisioning AI",relevanceScore:d=0,showRelevanceScore:o=!0,reason:u="No reasoning provided.",impact:m="No Impact provided.",explaination:p="No explaination provided.",gap:x="None",onClose:f=()=>{},showResolveBtns:v=!1,sections:_,leftIcon:g,scoreIcon:j,className:y,customStyles:I={},markdownStyles:C,citationStyles:R,customIcons:A,actions:k,disableAllActions:$=!1,actionBtnDisabledStyle:D={},onBackClick:S,isImpactNeeded:q=!0,cognitiveTitle:w="Cognitive Integrity",labels:M={},chatHistory:T,resolveRedlineAction:H}){const B=a.useMemo(()=>{const e=Number(d);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[d]),P=a.useMemo(()=>{const e=M&&M.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a})(x)?e:x},[x]),L=M&&M.impact||"Impact",E=M&&M.explanation||"Explaination",U=M&&M.decisionFactors||"Decision Making Factors",W=M&&M.gaps||"Gaps in Decision",F=M&&M.accept||"Accept",G=M&&M.reject||"Reject",z=M&&M.backAriaLabel||"Go back",O=k||[{id:"reject",label:G,onClick:()=>H("reject"),className:c.default["btn-reject"]},{id:"accept",label:F,onClick:()=>H("accept"),className:c.default["btn-accept"]}],J=T&&T.length>0;return e.jsxs("div",{className:`${c.default["cite-acc"]} ${y||""}`,style:{...t.default.CitationAccordionDefaults.container,...null==I?void 0:I.container},children:[S&&e.jsxs("div",{className:c.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:c.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),S&&S()},"aria-label":z,children:"‹"}),e.jsx("span",{className:c.default["cite-acc__backTitle"],children:w})]}),e.jsx("div",{className:c.default["cite-body"],children:_&&_.length>0?_.map(a=>!1===a.show?null:e.jsxs("div",{className:`${c.default["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e.jsxs("div",{className:c.default["cite-acc__innerHeader"],style:{...t.default.CitationAccordionDefaults.innerHeader,...null==I?void 0:I.innerHeader},children:[e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:a.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),f&&f()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...t.default.CitationAccordionDefaults.innerBody,...null==I?void 0:I.innerBody},children:"string"==typeof a.content?e.jsx(N,{text:a.content,item:a.item||i||{}}):a.content})]},a.id||a.title)):e.jsxs(e.Fragment,{children:[q&&e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:c.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:L})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),f&&f()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(N,{text:m||"",item:i||{}})})]}),p&&"No explaination provided."!==p&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:E})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(N,{text:p||"",item:{}})})]}),e.jsx("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),v&&e.jsx("div",{className:c.default["cite-acc__btn-container"],children:O.map(a=>{const t=$||a.disabled;return e.jsx("button",{className:a.className,onClick:t?void 0:a.onClick,disabled:t,style:{...a.style,...t?{opacity:.5,cursor:"not-allowed",...D,...a.disabledStyle}:{}},children:a.label},a.id)})})]}),e.jsxs("div",{className:c.default["cite-acc__header"],children:[e.jsxs("div",{className:c.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:c.default["cite-acc__titleIcon"],children:g?"function"==typeof g?h.default.createElement(g):g:e.jsx(s.ReactComponent,{})}),e.jsx("div",{className:c.default["cite-acc__title"],children:n})]}),e.jsx("div",{className:c.default["cite-acc__headerRight"],children:o&&e.jsxs("span",{className:c.default["cite-acc__scoreBadge"],children:[j?"function"==typeof j?h.default.createElement(j):j:e.jsx(r.ReactComponent,{}),e.jsxs("span",{className:c.default["cite-acc__scoreText"],children:[B,"%"]})]})})]}),e.jsxs("div",{className:c.default["cite-acc__explain-body"],children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:U})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:J?e.jsx(b,{text:u||"",markdownStyles:C,citationStyles:R,customIcons:A}):e.jsx(N,{text:u||"",item:i||{}})})]}),e.jsxs("div",{className:`${c.default["cite-acc__explain-body"]} ${c.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:c.default["cite-acc__innerHeader"],children:e.jsx("div",{className:c.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:c.default["cite-acc__innerTitle"],children:W})})})}),e.jsx("div",{className:`${c.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:J?e.jsx(b,{text:P||"",markdownStyles:C,citationStyles:R,customIcons:A}):e.jsx(N,{text:P||"",item:i||{}})})]})]})})]})},I);var R=a.memo(function(t){const{redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c}=m.useRequirementAI(),l=a.useRef({redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c}),s=a.useRef({onActionTrigger:t.onActionTrigger,redlineId:t.redlineId,aiReasonId:t.aiReasonId});l.current={redlineDcoumentId:i,redlineConfig:n,updateRedlineDataParent:c},s.current={onActionTrigger:t.onActionTrigger,redlineId:t.redlineId,aiReasonId:t.aiReasonId};const r=a.useCallback(async e=>{var a,t,i,n,c,r;const{redlineDcoumentId:d,redlineConfig:o,updateRedlineDataParent:m}=l.current,{onActionTrigger:x,redlineId:h,aiReasonId:f}=s.current;null==x||x({status:"loading",action:e,metadata:{redlineId:h,aiReasonId:f}});try{const{updated_reqai:l}=await u.resolveRedline({documentId:d,userEmail:null==o?void 0:o.userEmail,userName:null==o?void 0:o.userName,redlineId:null!=h?h:"",action:e,baseApiUrl:null==o?void 0:o.baseApiUrl,redlineConfigId:null!==(a=null==o?void 0:o.redlineConfigId)&&void 0!==a?a:""},null!==(t=null==o?void 0:o.token)&&void 0!==t?t:"");await(null==m?void 0:m(l)),null===(i=p.default.emit)||void 0===i||i.call(p.default,`redline-edit:${d}:${null===(r=null===(c=null===(n=null==l?void 0:l.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===c?void 0:c[0])||void 0===r?void 0:r.artifactId}`,{updatedBy:null==o?void 0:o.userName}),null==x||x({status:"success",action:e,metadata:{redlineId:h,aiReasonId:f}})}catch(a){null==x||x({status:"failed",action:e,metadata:{redlineId:h,aiReasonId:f}})}},[]);return e.jsx(C,{...t,resolveRedlineAction:r})},I);exports.default=R;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),i=require("../Popups/PopupDefaults.js"),t=require("react-markdown"),c=require("rehype-raw"),n=require("./CitationComponent.module.css.js"),l=require("lucide-react"),s=require("../icons/cognitiveBrain.svg.js"),d=require("../icons/aiMagic.svg.js"),r=require("./CitationAnchor.js"),o=require("../../../../../service/redlineService.js"),u=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=m(a),f=m(t),p=m(c);const _=({text:a,item:i})=>e.jsx(f.default,{rehypePlugins:[p.default],components:{ol:({children:a})=>e.jsx("ol",{className:n.default["md-ol"],children:a}),ul:({children:a})=>e.jsx("ul",{className:n.default["md-ul"],children:a}),li:({children:a})=>e.jsx("li",{className:n.default["md-li"],children:a}),a:({node:a,href:t,children:c})=>e.jsx(r.default,{href:t,children:c,metaData:{citations:i.citations,docData:i.docData}})},children:a.replace(/<br\s*\/?>/gi,"\n")});var j=a.memo(function({item:t,title:c="Cognitive Decisioning AI",relevanceScore:r=0,showRelevanceScore:m=!0,reason:f="No reasoning provided.",impact:p="No Impact provided.",explaination:j="No explaination provided.",gap:h="None",onClose:v=()=>{},onActionTrigger:N,showResolveBtns:b=!1,sections:y,leftIcon:g,scoreIcon:I,className:C,customStyles:A={},actions:k,disableAllActions:R=!1,actionBtnDisabledStyle:q={},onBackClick:B,isImpactNeeded:D=!0,cognitiveTitle:H="Cognitive Integrity",labels:$={},redlineId:T,aiReasonId:w}){const L=a.useMemo(()=>{const e=Number(r);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[r]),M=a.useMemo(()=>{const e=$&&$.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a})(h)?e:h},[h]),P=$&&$.impact||"Impact",S=$&&$.explanation||"Explaination",E=$&&$.decisionFactors||"Decision Making Factors",U=$&&$.gaps||"Gaps in Decision",F=$&&$.accept||"Accept",G=$&&$.reject||"Reject",W=$&&$.backAriaLabel||"Go back",{redlineDcoumentId:O,redlineConfig:z,updateRedlineDataParent:J}=u.useRequirementAI(),K=async e=>{var a,i;null==N||N({status:"loading",action:e,metadata:{redlineId:T,aiReasonId:w}});try{const{updated_reqai:t}=await o.resolveRedline({documentId:O,userEmail:null==z?void 0:z.userEmail,userName:null==z?void 0:z.userName,redlineId:null!=T?T:"",action:e,baseApiUrl:null==z?void 0:z.baseApiUrl,redlineConfigId:null!==(a=null==z?void 0:z.redlineConfigId)&&void 0!==a?a:""},null!==(i=null==z?void 0:z.token)&&void 0!==i?i:"");await(null==J?void 0:J(t)),null==N||N({status:"success",action:e,metadata:{redlineId:T,aiReasonId:w}})}catch(a){null==N||N({status:"failed",action:e,metadata:{redlineId:T,aiReasonId:w}})}},Q=k||[{id:"reject",label:G,onClick:()=>K("reject"),className:n.default["btn-reject"]},{id:"accept",label:F,onClick:()=>K("accept"),className:n.default["btn-accept"]}];return e.jsxs("div",{className:`${n.default["cite-acc"]} ${C||""}`,style:{...i.default.CitationAccordionDefaults.container,...null==A?void 0:A.container},children:[B&&e.jsxs("div",{className:n.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:n.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),B&&B()},"aria-label":W,children:"‹"}),e.jsx("span",{className:n.default["cite-acc__backTitle"],children:H})]}),e.jsx("div",{className:n.default["cite-body"],children:y&&y.length>0?y.map(a=>!1===a.show?null:e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],style:{...i.default.CitationAccordionDefaults.innerHeader,...null==A?void 0:A.innerHeader},children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:a.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),v&&v()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...i.default.CitationAccordionDefaults.innerBody,...null==A?void 0:A.innerBody},children:"string"==typeof a.content?e.jsx(_,{text:a.content,item:a.item||t||{}}):a.content})]},a.id||a.title)):e.jsxs(e.Fragment,{children:[D&&e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:P})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),v&&v()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:p||"",item:t||{}})})]}),e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:S})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:j||"",item:{}})})]}),b&&e.jsx("div",{className:n.default["cite-acc__btn-container"],children:Q.map(a=>{const i=R||a.disabled;return e.jsx("button",{className:a.className,onClick:i?void 0:a.onClick,disabled:i,style:{...a.style,...i?{opacity:.5,cursor:"not-allowed",...q,...a.disabledStyle}:{}},children:a.label},a.id)})}),e.jsxs("div",{className:n.default["cite-acc__header"],children:[e.jsxs("div",{className:n.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:n.default["cite-acc__titleIcon"],children:g?"function"==typeof g?x.default.createElement(g):g:e.jsx(s.ReactComponent,{})}),e.jsx("div",{className:n.default["cite-acc__title"],children:c})]}),e.jsx("div",{className:n.default["cite-acc__headerRight"],children:m&&e.jsxs("span",{className:n.default["cite-acc__scoreBadge"],children:[I?"function"==typeof I?x.default.createElement(I):I:e.jsx(d.ReactComponent,{}),e.jsxs("span",{className:n.default["cite-acc__scoreText"],children:[L,"%"]})]})})]}),e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:E})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:f||"",item:t||{}})})]}),e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${n.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:U})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:M||"",item:t||{}})})]})]})})]})},(e,a)=>e.disableAllActions===a.disableAllActions&&(e.redlineId===a.redlineId&&(e.aiReasonId===a.aiReasonId&&(e.relevanceScore===a.relevanceScore&&(e.reason===a.reason&&(e.impact===a.impact&&(e.explaination===a.explaination&&e.gap===a.gap)))))));exports.default=j;
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("react"),n=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var o=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),r=require("@mui/material"),s=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../../../../../service/redlineService.js"),a=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),c=require("../cws/CwsEvent.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=p(t);const g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],u=({toneIndex:i,configs:t=g})=>{const n=Math.min(i,t.length-1),{color:o,angle:l,arcD:r}=t[n]||t[1]||t[0],s=(l-90)*Math.PI/180,d=11+9*Math.cos(s),a=13+9*Math.sin(s);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:r,stroke:o,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:d,y2:a,stroke:o,strokeWidth:"2",strokeLinecap:"round"})]})},v=({type:i,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[i]||n.Medium;return e.jsx("div",{style:o,children:i})},h=["Lenient","Balanced","Aggressive"],m={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},y={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},f={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},j={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},w={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},b={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},C={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},I={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},T={display:"flex",gap:8,marginBottom:18},B={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},A={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},E={borderTop:"0.5px solid #eee",padding:"14px 0px"},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},D={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},F={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},z={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},L={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},M={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},_={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},q=t.memo(function({onAssignClick:i,onOpenCognitive:t,cognitiveIconSmall:n,cognitiveTootipTitle:o,historyIconSmall:l,onHistoryClick:r,historyTootipTitle:s}){const d="20px";return e.jsxs("div",{style:{..._,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),t&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>t(e),children:[n&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:n}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),r&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>r(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})]})}),O=t.memo(function({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d}){const[a,c]=t.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!a),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),a&&e.jsx(q,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d})]})}),N=t.memo(function({users:i,onClick:t}){const n=i.length;return e.jsxs("div",{onClick:t,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),n>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",n-1]})]})}),P=t.memo(function({steps:i}){if(!(null==i?void 0:i.length))return null;const t=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:t?"6px 8px":"8px 10px",background:"#F8FAFC",gap:t?4:8,overflow:"hidden"},children:i.map((n,o)=>{const l=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(o),r=o===i.length-1;return e.jsxs(x.default.Fragment,{children:[e.jsxs("div",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:t?4:6,overflow:"hidden"},children:[(s=n.status,"approved"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:t?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:t?20:22,height:t?20:22,minWidth:t?20:22,borderRadius:"50%",background:l.bg,color:l.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!r&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"18",height:t?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:t?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var s})})})});var $=t.memo(function({onClose:p,aiReason:x,onActionTrigger:_,onIterate:q,initialTone:$,onRegenerate:V,labels:U={},toneLevelsConfig:G=h,toneColorsConfig:K=m,dialConfigs:X=g,actions:J,disableAllActions:Q=!1,customStyles:Y={},severityChipStyles:Z={},customIcons:ee={},onOpenCognitive:ie,onHistoryClick:te,historyIconSmall:ne,historyTootipTitle:oe,showTone:le=!0,cognitiveSectionStyle:re={},cognitiveScoreBadgeStyle:se={},cognitiveScoreTextStyle:de={},cognitiveStyles:ae={},cognitiveClassNames:ce={},cognitiveTitle:pe="Cognitive Integrity",cognitiveTootipTitle:xe="Cognitive Decisioning",cognitiveLeftIcon:ge,cognitiveIconSmall:ue,showCognitiveRightArrow:ve=!0,isStreaming:he,onAssignClick:me,assignedUsers:ye,onReviewUsersClick:fe,redlineId:je,aiReasonId:we,displayVariant:Se="default",reviewTitle:be,reviewSubtitle:Ce,reviewStatusIcon:ke=e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:Ie=[],showReviewProgress:Te=!1,showOriginalText:Be=!1,originalText:Ae,originalTextHeader:Ee="Original text",hideSummaryText:Re=!1,hideSeverityChip:We=!1}){var De,Fe,ze,Le,Me,He,_e,qe,Oe,Ne,Pe,$e,Ve,Ue,Ge,Ke,Xe,Je,Qe,Ye;let Ze=G.findIndex(e=>e===$);-1===Ze&&(Ze=1);const[ei,ii]=t.useState(!0),[ti,ni]=t.useState(!1),[oi,li]=t.useState(!1),[ri,si]=t.useState(Ze),[di]=t.useState(Ze),[ai,ci]=t.useState(!0),pi="review"===Se,xi=G[ri],gi=K[xi]||"#BA7517",ui=ri!==di,vi=[{id:"iterate",icon:ee.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:U.btnIterate||"Iterate",color:"#64748B",onClick:q},{id:"accept",icon:ee.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:U.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:ee.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:U.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:hi,redlineConfig:mi,updateRedlineDataParent:yi}=s.useRequirementAI(),fi=J||vi;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...y,...null===(De=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===De?void 0:De.root},children:[e.jsxs("div",{style:{...f,...null===(Fe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Fe?void 0:Fe.header,marginBottom:pi?14:oi?"16px":"12px",...pi&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[pi?e.jsxs("div",{style:{minWidth:0,flex:"1 1 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:ke||ee.summaryIcon||"⏳"}),e.jsx("span",{children:be||"Redline In Review"})]}),e.jsx("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ce||(null===(ze=null==x?void 0:x.redlining_details)||void 0===ze?void 0:ze.redline_title)})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:ee.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...j,...null===(Le=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Le?void 0:Le.title},children:U.summaryHeader||"Summary"})]}),ye&&ye.length>0&&e.jsx(N,{users:ye,onClick:e=>{e.stopPropagation(),null==fe||fe()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(me||ie||te)&&e.jsx(O,{onAssignClick:me,onOpenCognitive:ie,cognitiveIconSmall:ue,cognitiveTootipTitle:xe,historyIconSmall:ne,onHistoryClick:te,historyTootipTitle:oe}),e.jsx("button",{onClick:p,style:{...A,...null===(Me=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Me?void 0:Me.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),pi&&Te&&Ie.length>0&&e.jsx(P,{steps:Ie}),!Re&&!pi&&e.jsx(e.Fragment,{children:e.jsx(r.Tooltip,{title:null===(He=null==x?void 0:x.redlining_details)||void 0===He?void 0:He.redline_title,children:e.jsx("p",{style:{...w,...null===(_e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===_e?void 0:_e.bodyText},children:null===(qe=null==x?void 0:x.redlining_details)||void 0===qe?void 0:qe.redline_title})})}),e.jsx("p",{style:{...S,...null===(Oe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.summary},children:null===(Ne=null==x?void 0:x.redlining_details)||void 0===Ne?void 0:Ne.redline_summary}),e.jsxs("div",{style:{...b,...null===(Pe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>ii(!ei),style:{...k,...null===($e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===$e?void 0:$e.impactToggle},children:[e.jsx("span",{style:{...I,...null===(Ve=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.impactToggleLabel},children:U.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ei?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(v,{type:(null==x?void 0:x.severity)||"Medium",customStyles:Z})]}),ei&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...C,...null===(Ue=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ue?void 0:Ue.impactText},children:e.jsx(a.AiReasonMarkdownWrapper,{message:`${null!==(Ke=null===(Ge=null==x?void 0:x.redlining_details)||void 0===Ge?void 0:Ge.redline_impact)&&void 0!==Ke?Ke:U.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Xe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.impactMarkdown})})})]}),pi&&Be&&e.jsxs("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e.jsxs("button",{onClick:()=>ci(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[e.jsx("span",{children:Ee}),e.jsx(i.ChevronDown,{size:18,color:"#1E293B",style:{transform:ai?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),ai&&e.jsxs("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Ae||"","”"]})]}),e.jsx("div",{style:{...T,...null===(Je=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Je?void 0:Je.actionContainer},children:fi.map(i=>{var t,n;const o=Q||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...B,...null===(n=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{var e,t;if(i.useLabel)try{await(null===(e=i.onClick)||void 0===e?void 0:e.call(i))}finally{await(async e=>{var i,t,n,o,l,r;null==_||_({status:"loading",action:e,metadata:{redlineId:je,aiReasonId:we}});try{const{updated_reqai:s}=await d.resolveRedline({documentId:hi,userEmail:null==mi?void 0:mi.userEmail,userName:null==mi?void 0:mi.userName,redlineId:null!==(i=null==x?void 0:x.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==mi?void 0:mi.baseApiUrl,redlineConfigId:null!==(t=null==mi?void 0:mi.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==mi?void 0:mi.token)&&void 0!==n?n:"");await(null==yi?void 0:yi(s)),c.default.emit(`redline-edit:${hi}:${null===(r=null===(l=null===(o=null==s?void 0:s.artifactData)||void 0===o?void 0:o.userStorySnapshot)||void 0===l?void 0:l[0])||void 0===r?void 0:r.artifactId}`,{updatedBy:null==mi?void 0:mi.userName}),null==_||_({status:"success",action:e,metadata:{redlineId:je,aiReasonId:we}})}catch(i){null==_||_({status:"failed",action:e,metadata:{redlineId:je,aiReasonId:we}})}})(i.id.toLowerCase())}else await(null===(t=i.onClick)||void 0===t?void 0:t.call(i))},disabled:o,children:[i.icon,i.label]},i.id)})}),le&&e.jsxs("div",{style:{...E,...null===(Qe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.toneContainer},children:[e.jsxs("button",{onClick:()=>ni(!ti),style:{...R,...null===(Ye=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ye?void 0:Ye.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(u,{toneIndex:ri,configs:X}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:U.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ti?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),ti&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:U.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(n.ToneToggle,{isDirty:ui,onToneChange:e=>{si(e)},toneColor:gi,toneIndex:ri,onClickRegenerate:()=>null==V?void 0:V(xi),toneLabels:G,isStreaming:he,aiReason:x})]})]}),ie&&e.jsxs("div",{className:null==ce?void 0:ce.section,onClick:e=>{e.stopPropagation(),ie&&ie(e)},style:{...W,...null==ae?void 0:ae.section,...re},children:[e.jsxs("div",{className:null==ce?void 0:ce.headerLeft,style:{...D,...null==ae?void 0:ae.headerLeft},children:[e.jsx("span",{className:null==ce?void 0:ce.titleIcon,style:{...F,...null==ae?void 0:ae.titleIcon},children:null!=ge?ge:e.jsx(o.ReactComponent,{})}),e.jsx("div",{className:null==ce?void 0:ce.cognitiveTitle,style:{...z,...null==ae?void 0:ae.cognitiveTitle},children:pe})]}),e.jsxs("div",{className:null==ce?void 0:ce.headerRight,style:{...L,...null==ae?void 0:ae.headerRight},children:[void 0!==(null==x?void 0:x.relevance_score)&&null!==(null==x?void 0:x.relevance_score)?e.jsxs("span",{className:null==ce?void 0:ce.scoreBadge,style:{...M,...null==ae?void 0:ae.scoreBadge,...se},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ce?void 0:ce.scoreText,style:{...H,...null==ae?void 0:ae.scoreText,...de},children:[Math.round(Number(x.relevance_score)),"%"]})]}):null,ve&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});exports.AssignMenu=q,exports.DisplayUsers=N,exports.KebabMenu=O,exports.default=$;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("react"),n=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var o=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),r=require("@mui/material"),s=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../../../../../service/redlineService.js"),a=require("../../ai-reasoning/AiReasonMarkdownWrapper.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=c(t);const x=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],g=({toneIndex:i,configs:t=x})=>{const n=Math.min(i,t.length-1),{color:o,angle:l,arcD:r}=t[n]||t[1]||t[0],s=(l-90)*Math.PI/180,d=11+9*Math.cos(s),a=13+9*Math.sin(s);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:r,stroke:o,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:d,y2:a,stroke:o,strokeWidth:"2",strokeLinecap:"round"})]})},u=({type:i,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[i]||n.Medium;return e.jsx("div",{style:o,children:i})},h=["Lenient","Balanced","Aggressive"],v={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},m={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},y={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},f={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},j={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},w={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},S={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},b={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},C={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},k={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},I={display:"flex",gap:8,marginBottom:18},T={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},B={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},A={borderTop:"0.5px solid #eee",padding:"14px 0px"},E={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},R={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},W={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},L={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},F={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},z={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},M={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},H={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},_=t.memo(function({onAssignClick:i,onOpenCognitive:t,cognitiveIconSmall:n,cognitiveTootipTitle:o,historyIconSmall:l,onHistoryClick:r,historyTootipTitle:s}){const d="20px";return e.jsxs("div",{style:{...H,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),t&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>t(e),children:[n&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:n}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),r&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>r(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})]})}),O=t.memo(function({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d}){const[a,c]=t.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!a),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),a&&e.jsx(_,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d})]})}),q=t.memo(function({users:i,onClick:t}){const n=i.length;return e.jsxs("div",{onClick:t,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),n>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",n-1]})]})}),P=t.memo(function({steps:i}){if(!(null==i?void 0:i.length))return null;const t=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:t?"6px 8px":"8px 10px",background:"#F8FAFC",gap:t?4:8,overflow:"hidden"},children:i.map((n,o)=>{const l=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(o),r=o===i.length-1;return e.jsxs(p.default.Fragment,{children:[e.jsxs("div",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:t?4:6,overflow:"hidden"},children:[(s=n.status,"approved"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:t?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:t?20:22,height:t?20:22,minWidth:t?20:22,borderRadius:"50%",background:l.bg,color:l.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!r&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"18",height:t?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:t?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var s})})})});var N=t.memo(function({onClose:c,aiReason:p,onActionTrigger:H,onIterate:_,initialTone:N,onRegenerate:$,labels:V={},toneLevelsConfig:U=h,toneColorsConfig:G=v,dialConfigs:K=x,actions:X,disableAllActions:J=!1,customStyles:Q={},severityChipStyles:Y={},customIcons:Z={},onOpenCognitive:ee,onHistoryClick:ie,historyIconSmall:te,historyTootipTitle:ne,showTone:oe=!0,cognitiveSectionStyle:le={},cognitiveScoreBadgeStyle:re={},cognitiveScoreTextStyle:se={},cognitiveStyles:de={},cognitiveClassNames:ae={},cognitiveTitle:ce="Cognitive Integrity",cognitiveTootipTitle:pe="Cognitive Decisioning",cognitiveLeftIcon:xe,cognitiveIconSmall:ge,showCognitiveRightArrow:ue=!0,isStreaming:he,onAssignClick:ve,assignedUsers:me,onReviewUsersClick:ye,redlineId:fe,aiReasonId:je,displayVariant:we="default",reviewTitle:Se,reviewSubtitle:be,reviewStatusIcon:Ce=e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:ke=[],showReviewProgress:Ie=!1,showOriginalText:Te=!1,originalText:Be,originalTextHeader:Ae="Original text",hideSummaryText:Ee=!1,hideSeverityChip:Re=!1}){var We,Le,De,Fe,ze,Me,He,_e,Oe,qe,Pe,Ne,$e,Ve,Ue,Ge,Ke,Xe,Je,Qe;let Ye=U.findIndex(e=>e===N);-1===Ye&&(Ye=1);const[Ze,ei]=t.useState(!0),[ii,ti]=t.useState(!1),[ni,oi]=t.useState(!1),[li,ri]=t.useState(Ye),[si]=t.useState(Ye),[di,ai]=t.useState(!0),ci="review"===we,pi=U[li],xi=G[pi]||"#BA7517",gi=li!==si,ui=[{id:"iterate",icon:Z.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:V.btnIterate||"Iterate",color:"#64748B",onClick:_},{id:"accept",icon:Z.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:V.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:Z.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:V.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:hi,redlineConfig:vi,updateRedlineDataParent:mi}=s.useRequirementAI(),yi=async e=>{var i,t,n;null==H||H({status:"loading",action:e,metadata:{redlineId:fe,aiReasonId:je}});try{const{updated_reqai:o}=await d.resolveRedline({documentId:hi,userEmail:null==vi?void 0:vi.userEmail,userName:null==vi?void 0:vi.userName,redlineId:null!==(i=null==p?void 0:p.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==vi?void 0:vi.baseApiUrl,redlineConfigId:null!==(t=null==vi?void 0:vi.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==vi?void 0:vi.token)&&void 0!==n?n:"");await(null==mi?void 0:mi(o)),null==H||H({status:"success",action:e,metadata:{redlineId:fe,aiReasonId:je}})}catch(i){null==H||H({status:"failed",action:e,metadata:{redlineId:fe,aiReasonId:je}})}},fi=X||ui;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...m,...null===(We=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===We?void 0:We.root},children:[e.jsxs("div",{style:{...y,...null===(Le=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Le?void 0:Le.header,marginBottom:ci?14:ni?"16px":"12px",...ci&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[ci?e.jsxs("div",{style:{minWidth:0,flex:"1 1 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:Ce||Z.summaryIcon||"⏳"}),e.jsx("span",{children:Se||"Redline In Review"})]}),e.jsx("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:be||(null===(De=null==p?void 0:p.redlining_details)||void 0===De?void 0:De.redline_title)})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:Z.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...f,...null===(Fe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Fe?void 0:Fe.title},children:V.summaryHeader||"Summary"})]}),me&&me.length>0&&e.jsx(q,{users:me,onClick:e=>{e.stopPropagation(),null==ye||ye()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(ve||ee||ie)&&e.jsx(O,{onAssignClick:ve,onOpenCognitive:ee,cognitiveIconSmall:ge,cognitiveTootipTitle:pe,historyIconSmall:te,onHistoryClick:ie,historyTootipTitle:ne}),e.jsx("button",{onClick:c,style:{...B,...null===(ze=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===ze?void 0:ze.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),ci&&Ie&&ke.length>0&&e.jsx(P,{steps:ke}),!Ee&&!ci&&e.jsx(e.Fragment,{children:e.jsx(r.Tooltip,{title:null===(Me=null==p?void 0:p.redlining_details)||void 0===Me?void 0:Me.redline_title,children:e.jsx("p",{style:{...j,...null===(He=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===He?void 0:He.bodyText},children:null===(_e=null==p?void 0:p.redlining_details)||void 0===_e?void 0:_e.redline_title})})}),e.jsx("p",{style:{...w,...null===(Oe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.summary},children:null===(qe=null==p?void 0:p.redlining_details)||void 0===qe?void 0:qe.redline_summary}),e.jsxs("div",{style:{...S,...null===(Pe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>ei(!Ze),style:{...C,...null===(Ne=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ne?void 0:Ne.impactToggle},children:[e.jsx("span",{style:{...k,...null===($e=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===$e?void 0:$e.impactToggleLabel},children:V.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ze?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(u,{type:(null==p?void 0:p.severity)||"Medium",customStyles:Y})]}),Ze&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...b,...null===(Ve=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.impactText},children:e.jsx(a.AiReasonMarkdownWrapper,{message:`${null!==(Ge=null===(Ue=null==p?void 0:p.redlining_details)||void 0===Ue?void 0:Ue.redline_impact)&&void 0!==Ge?Ge:V.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Ke=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ke?void 0:Ke.impactMarkdown})})})]}),ci&&Te&&e.jsxs("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e.jsxs("button",{onClick:()=>ai(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[e.jsx("span",{children:Ae}),e.jsx(i.ChevronDown,{size:18,color:"#1E293B",style:{transform:di?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),di&&e.jsxs("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Be||"","”"]})]}),e.jsx("div",{style:{...I,...null===(Xe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.actionContainer},children:fi.map(i=>{var t,n;const o=J||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...T,...null===(n=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{if(i.onClick){return void(!0===await i.onClick()&&i.useLabel&&await yi(i.id.toLowerCase()))}i.useLabel&&await yi(i.id.toLowerCase())},disabled:o,children:[i.icon,i.label]},i.id)})}),oe&&e.jsxs("div",{style:{...A,...null===(Je=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Je?void 0:Je.toneContainer},children:[e.jsxs("button",{onClick:()=>ti(!ii),style:{...E,...null===(Qe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(g,{toneIndex:li,configs:K}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:V.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ii?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),ii&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:V.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(n.ToneToggle,{isDirty:gi,onToneChange:e=>{ri(e)},toneColor:xi,toneIndex:li,onClickRegenerate:()=>null==$?void 0:$(pi),toneLabels:U,isStreaming:he,aiReason:p})]})]}),ee&&e.jsxs("div",{className:null==ae?void 0:ae.section,onClick:e=>{e.stopPropagation(),ee&&ee(e)},style:{...R,...null==de?void 0:de.section,...le},children:[e.jsxs("div",{className:null==ae?void 0:ae.headerLeft,style:{...W,...null==de?void 0:de.headerLeft},children:[e.jsx("span",{className:null==ae?void 0:ae.titleIcon,style:{...L,...null==de?void 0:de.titleIcon},children:null!=xe?xe:e.jsx(o.ReactComponent,{})}),e.jsx("div",{className:null==ae?void 0:ae.cognitiveTitle,style:{...D,...null==de?void 0:de.cognitiveTitle},children:ce})]}),e.jsxs("div",{className:null==ae?void 0:ae.headerRight,style:{...F,...null==de?void 0:de.headerRight},children:[void 0!==(null==p?void 0:p.relevance_score)&&null!==(null==p?void 0:p.relevance_score)?e.jsxs("span",{className:null==ae?void 0:ae.scoreBadge,style:{...z,...null==de?void 0:de.scoreBadge,...re},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ae?void 0:ae.scoreText,style:{...M,...null==de?void 0:de.scoreText,...se},children:[Math.round(Number(p.relevance_score)),"%"]})]}):null,ue&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});exports.AssignMenu=_,exports.DisplayUsers=q,exports.KebabMenu=O,exports.default=N;
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("./PopupDefaults.js"),o=require("../icons/History.svg.js"),i=require("../icons/message-chat-square.svg.js"),r=require("./ToneToggle.js");const a=[{id:"chat",icon:e.jsx(i.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:e.jsx(i.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:e.jsx(o.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],s=["Lenient","Balanced","Aggressive"],l={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},d=["Grounded","Innovative"];function c({chatTitle:n,chatBody:t,mergedStyles:o=f}){return e.jsx("div",{style:o.body,children:e.jsxs("div",{style:o.chatBanner,children:[e.jsx("p",{style:o.chatBannerTitle,children:n}),e.jsx("p",{style:o.chatBannerBody,children:t})]})})}function g({initialTone:t,onRiskRegenerate:o,riskMode:i,toneLevelsConfig:a=s,toneColorsConfig:c=l,riskModesConfig:g=d,mergedStyles:p=f,isStreaming:h,aiReason:x}){let u=a.findIndex(e=>e===t);-1===u&&(u=1);const[y,b]=n.useState(i||g[0]||"Grounded"),[m,k]=n.useState(u),[C]=n.useState(u),j=a[m],S=c[j]||"#BA7517",v=m!==C||i!==y;return e.jsxs("div",{style:p.body,children:[e.jsx("div",{style:{display:"flex",gap:8,marginBottom:16},children:g.map(n=>e.jsxs("button",{onClick:()=>b(n),style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid "+(y===n?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"},children:[e.jsx("span",{style:{width:16,height:16,borderRadius:"50%",border:"2px solid "+(y===n?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:y===n&&e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})}),n.charAt(0).toUpperCase()+n.slice(1)]},n))}),e.jsx(r.ToneToggle,{onToneChange:e=>k(e),toneColor:S,isDirty:v,toneIndex:m,onClickRegenerate:()=>null==o?void 0:o({tone:j,mode:y}),isStreaming:h,aiReason:x})]})}function p({type:n,onRiskRegenerate:t,initialTone:o,riskMode:i,chatTitle:r,chatBody:a,toneLevelsConfig:s,toneColorsConfig:l,riskModesConfig:d,mergedStyles:p=f,isStreaming:h,aiReason:x}){return"chat"===n?e.jsx(c,{chatTitle:r,chatBody:a,mergedStyles:p}):"risk"===n?e.jsx(g,{onRiskRegenerate:t,initialTone:o,riskMode:i,toneLevelsConfig:s,toneColorsConfig:l,riskModesConfig:d,mergedStyles:p,isStreaming:h,aiReason:x}):null}const f={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};exports.DEFAULT_RISK_MODES=d,exports.default=function({onBack:o,onChatClick:i,onRiskRegenerate:r,initialTone:c,riskMode:g,onApply:h,onTabToggle:x,menuItemsConfig:u=a,chatTitle:y="Chat mode active",chatBody:b="You are now chatting about this redline, continue the conversation in the left panel to refine or update it",headerTitle:m="How would you like to iterate?",customStyles:k={},toneLevelsConfig:C=s,toneColorsConfig:j=l,riskModesConfig:S=d,isStreaming:v,aiReason:B}){const[R,T]=n.useState(null),w={...t.default.IterateMenuDefaults.styles,...f,...k};return e.jsxs("div",{style:w.card,children:[e.jsxs("div",{style:w.header,children:[e.jsx("button",{onClick:o,style:w.backBtn,"aria-label":"Go back",children:"‹"}),e.jsx("span",{style:w.headerTitle,children:m})]}),e.jsx("div",{style:{width:"100%",maxHeight:"300px",overflow:"auto"},children:u.map((n,t)=>{const o=R===n.id;return e.jsxs("div",{style:{borderBottom:t<u.length-1?"0.5px solid #e8e7e3":"none"},children:[e.jsxs("button",{onClick:()=>{var e;"history"!==(e=n.id)?T(n=>n===e?null:("chat"===e&&(null==i||i()),x&&x(e),e)):x&&x(e)},style:w.row,children:[e.jsx("div",{style:w.rowLeft,children:e.jsxs("div",{children:[e.jsx("p",{style:w.label,children:n.label}),e.jsx("p",{style:w.desc,children:n.description})]})}),e.jsx("span",{style:{...w.chevron,transform:o?"rotate(90deg)":"rotate(0deg)"},children:"›"})]}),e.jsx("div",{style:{maxHeight:o?400:0,overflow:"auto",transition:"max-height 0.25s ease"},children:e.jsx(p,{type:n.id,onRiskRegenerate:r,initialTone:c,riskMode:g,chatTitle:y,chatBody:b,toneLevelsConfig:C,toneColorsConfig:j,riskModesConfig:S,mergedStyles:w,aiReason:B,isStreaming:v})})]},n.id)})})]})},exports.menuItems=a,exports.styles=f;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("./PopupDefaults.js"),i=require("../icons/History.svg.js"),o=require("../icons/message-chat-square.svg.js"),a=require("./ToneToggle.js");const r=[{id:"chat",icon:e.jsx(o.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:e.jsx(o.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:e.jsx(i.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],s=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],l=["Lenient","Balanced","Aggressive"],d={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},c=["Grounded","Innovative"];function g({chatTitle:t,chatBody:n,mergedStyles:i=u}){return e.jsx("div",{style:i.body,children:e.jsxs("div",{style:i.chatBanner,children:[e.jsx("p",{style:i.chatBannerTitle,children:t}),e.jsx("p",{style:i.chatBannerBody,children:n})]})})}function p({initialTone:n,onRiskRegenerate:i,riskMode:o,toneLevelsConfig:r=l,toneColorsConfig:s=d,riskModesConfig:g=c,mergedStyles:p=u,isStreaming:f,aiReason:h}){let x=r.findIndex(e=>e===n);-1===x&&(x=1);const[y,m]=t.useState(o||g[0]||"Grounded"),[b,C]=t.useState(x),[j]=t.useState(x),k=r[b],v=s[k]||"#BA7517",S=b!==j||o!==y;return e.jsxs("div",{style:p.body,children:[e.jsx("div",{style:{display:"flex",gap:8,marginBottom:16},children:g.map(t=>e.jsxs("button",{onClick:()=>m(t),style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid "+(y===t?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"},children:[e.jsx("span",{style:{width:16,height:16,borderRadius:"50%",border:"2px solid "+(y===t?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:y===t&&e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})}),t.charAt(0).toUpperCase()+t.slice(1)]},t))}),e.jsx(a.ToneToggle,{onToneChange:e=>C(e),toneColor:v,isDirty:S,toneIndex:b,onClickRegenerate:()=>null==i?void 0:i({tone:k,mode:y}),isStreaming:f,aiReason:h})]})}function f({onApply:n,historicalClausesData:i=s,toneLevelsConfig:o=l,mergedStyles:a=u}){const r=o.length>1?o[1]:o[0]||"Balanced",[d,c]=t.useState(r),g=i.filter(e=>e.tab===d);return e.jsxs("div",{style:a.body,children:[e.jsx("div",{style:a.segmentedControl,children:o.map(t=>e.jsx("button",{onClick:()=>c(t),style:{...a.segmentedBtn,...d===t?a.segmentedBtnActive:{}},children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:12},children:[g.map(t=>e.jsxs("button",{onClick:()=>null==n?void 0:n({type:"history",value:t.excerpt}),style:a.clauseCard,children:[e.jsx("p",{style:a.clauseFilename,children:t.filename}),e.jsx("p",{style:a.clauseExcerpt,children:t.excerpt})]},t.id)),0===g.length&&e.jsx("p",{style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"},children:"No clauses for this tone"})]})]})}function h({type:t,onRiskRegenerate:n,initialTone:i,riskMode:o,onApply:a,chatTitle:r,chatBody:s,historicalClausesData:l,toneLevelsConfig:d,toneColorsConfig:c,riskModesConfig:h,mergedStyles:x=u,isStreaming:y,aiReason:m}){return"chat"===t?e.jsx(g,{chatTitle:r,chatBody:s,mergedStyles:x}):"risk"===t?e.jsx(p,{onRiskRegenerate:n,initialTone:i,riskMode:o,toneLevelsConfig:d,toneColorsConfig:c,riskModesConfig:h,mergedStyles:x,isStreaming:y,aiReason:m}):"history"===t?e.jsx(f,{onApply:a,historicalClausesData:l,toneLevelsConfig:d,mergedStyles:x}):null}const u={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};exports.default=function({onBack:i,onChatClick:o,onRiskRegenerate:a,initialTone:g,riskMode:p,onApply:f,onTabToggle:x,menuItemsConfig:y=r,historicalClausesConfig:m=s,chatTitle:b="Chat mode active",chatBody:C="You are now chatting about this redline, continue the conversation in the left panel to refine or update it",headerTitle:j="How would you like to iterate?",customStyles:k={},toneLevelsConfig:v=l,toneColorsConfig:S=d,riskModesConfig:B=c,isStreaming:R,aiReason:T}){const[A,w]=t.useState(null),z={...n.default.IterateMenuDefaults.styles,...u,...k};return e.jsxs("div",{style:z.card,children:[e.jsxs("div",{style:z.header,children:[e.jsx("button",{onClick:i,style:z.backBtn,"aria-label":"Go back",children:"‹"}),e.jsx("span",{style:z.headerTitle,children:j})]}),e.jsx("div",{style:{width:"100%",maxHeight:"300px",overflow:"auto"},children:y.map((t,n)=>{const i=A===t.id;return e.jsxs("div",{style:{borderBottom:n<y.length-1?"0.5px solid #e8e7e3":"none"},children:[e.jsxs("button",{onClick:()=>{return e=t.id,w(t=>t===e?null:("chat"===e&&(null==o||o()),x&&x(e),e));var e},style:z.row,children:[e.jsx("div",{style:z.rowLeft,children:e.jsxs("div",{children:[e.jsx("p",{style:z.label,children:t.label}),e.jsx("p",{style:z.desc,children:t.description})]})}),e.jsx("span",{style:{...z.chevron,transform:i?"rotate(90deg)":"rotate(0deg)"},children:"›"})]}),e.jsx("div",{style:{maxHeight:i?400:0,overflow:"hidden",transition:"max-height 0.25s ease"},children:e.jsx(h,{type:t.id,onRiskRegenerate:a,initialTone:g,riskMode:p,onApply:f,chatTitle:b,chatBody:C,historicalClausesData:m,toneLevelsConfig:v,toneColorsConfig:S,riskModesConfig:B,mergedStyles:z,aiReason:T,isStreaming:R})})]},t.id)})})]})};
2
2
  //# sourceMappingURL=IterateComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../../../../service/redlineService.js"),d=require("../cws/CwsEvent.js");require("react");const t={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:o,editorInfo:r,headerText:a,btnsConfig:s,labelText:c,onActionTrigger:u,aiReason:v=null}){var p,f;const{redlineDcoumentId:x,redlineConfig:b,updateRedlineDataParent:g}=l.useRequirementAI(),y=async e=>{var i,l,t,o,r,a,s;null==u||u({status:"loading",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}});try{const{updated_reqai:c}=await n.resolveRedline({documentId:x,userEmail:null==b?void 0:b.userEmail,userName:null==b?void 0:b.userName,redlineId:null!==(i=null==v?void 0:v.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==b?void 0:b.baseApiUrl,redlineConfigId:null!==(l=null==b?void 0:b.redlineConfigId)&&void 0!==l?l:""},null!==(t=null==b?void 0:b.token)&&void 0!==t?t:"");await(null==g?void 0:g(c)),null===(o=d.default.emit)||void 0===o||o.call(d.default,`redline-edit:${x}:${null===(s=null===(a=null===(r=null==c?void 0:c.artifactData)||void 0===r?void 0:r.userStorySnapshot)||void 0===a?void 0:a[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==b?void 0:b.userName}),null==u||u({status:"success",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}catch(i){null==u||u({status:"failed",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}};return e.jsxs("div",{style:t.popup,children:[e.jsxs("div",{style:t.header,children:[e.jsx("span",{style:t.title,children:a||"Manually Edited"}),e.jsx("button",{onClick:o,style:t.closeButton,"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{style:t.content,children:[e.jsxs("div",{style:t.labelRow,children:[e.jsx(i.UserPen,{}),e.jsx("span",{style:t.label,children:c||"Edited By"})]}),e.jsx("div",{style:t.editorInfo,children:r}),e.jsx("div",{style:t.divider}),e.jsxs("div",{style:t.actions,children:[null==s?void 0:s.map(i=>e.jsxs("button",{style:{...t.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==v?void 0:v.redline_id,id:null==v?void 0:v.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(p=null==v?void 0:v.redlining_details)||void 0===p?void 0:p.status)||"rejected"===(null===(f=null==v?void 0:v.redlining_details)||void 0===f?void 0:f.status))&&e.jsxs("div",{style:t.resolveActions,children:[e.jsxs("button",{style:{...t.actionBtn,...(null==v?void 0:v.resolving)?t.actionBtnDisabled:{}},disabled:null==v?void 0:v.resolving,onClick:()=>y("accept"),children:[e.jsx(i.CheckCircle,{size:16,color:"#10B981"})," ","Adopt"]}),e.jsxs("button",{style:{...t.actionBtn,...(null==v?void 0:v.resolving)?t.actionBtnDisabled:{}},onClick:()=>y("reject"),disabled:null==v?void 0:v.resolving,children:[e.jsx(i.XCircle,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),n=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),l=require("../../../../../service/redlineService.js");const t={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:d,editorInfo:o,headerText:r,btnsConfig:s,labelText:a,onActionTrigger:c,aiReason:u=null}){var v,p;const{redlineDcoumentId:x,redlineConfig:f,updateRedlineDataParent:b}=n.useRequirementAI(),g=async e=>{var i,n,t;null==c||c({status:"loading",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}});try{const{updated_reqai:d}=await l.resolveRedline({documentId:x,userEmail:null==f?void 0:f.userEmail,userName:null==f?void 0:f.userName,redlineId:null!==(i=null==u?void 0:u.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==f?void 0:f.baseApiUrl,redlineConfigId:null!==(n=null==f?void 0:f.redlineConfigId)&&void 0!==n?n:""},null!==(t=null==f?void 0:f.token)&&void 0!==t?t:"");await(null==b?void 0:b(d)),null==c||c({status:"success",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}})}catch(i){null==c||c({status:"failed",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}})}};return e.jsxs("div",{style:t.popup,children:[e.jsxs("div",{style:t.header,children:[e.jsx("span",{style:t.title,children:r||"Manually Edited"}),e.jsx("button",{onClick:d,style:t.closeButton,"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{style:t.content,children:[e.jsxs("div",{style:t.labelRow,children:[e.jsx(i.UserPen,{}),e.jsx("span",{style:t.label,children:a||"Edited By"})]}),e.jsx("div",{style:t.editorInfo,children:o}),e.jsx("div",{style:t.divider}),e.jsxs("div",{style:t.actions,children:[null==s?void 0:s.map(i=>e.jsxs("button",{style:{...t.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==u?void 0:u.redline_id,id:null==u?void 0:u.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(v=null==u?void 0:u.redlining_details)||void 0===v?void 0:v.status)||"rejected"===(null===(p=null==u?void 0:u.redlining_details)||void 0===p?void 0:p.status))&&e.jsxs("div",{style:t.resolveActions,children:[e.jsxs("button",{style:{...t.actionBtn,...(null==u?void 0:u.resolving)?t.actionBtnDisabled:{}},disabled:null==u?void 0:u.resolving,onClick:()=>g("accept"),children:[e.jsx(i.CheckCircle,{size:16,color:"#10B981"})," ","Adopt"]}),e.jsxs("button",{style:{...t.actionBtn,...(null==u?void 0:u.resolving)?t.actionBtnDisabled:{}},onClick:()=>g("reject"),disabled:null==u?void 0:u.resolving,children:[e.jsx(i.XCircle,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})};
2
2
  //# sourceMappingURL=ManualEditPopup.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),n=require("@mui/material"),r=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../cws/CwsEvent.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=c(i);function h(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),p=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),f=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),g=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),j=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),v=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),b=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function m({title:t,open:i,onToggle:o,children:n}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(v,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:n})})]})}function w({icon:t,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?s:{}};return e.jsxs("button",{onClick:r?void 0:o,disabled:r,style:l,onMouseEnter:e=>{r||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}function C({steps:i}){if(!(null==i?void 0:i.length))return null;const o=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:o?"6px 8px":"8px 10px",background:"#F8FAFC",gap:o?4:8,overflow:"hidden"},children:i.map((n,r)=>{const s=(e=>{const t=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return t[e%t.length]})(r),l=r===i.length-1;return e.jsxs(x.default.Fragment,{children:[e.jsxs("span",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:o?4:6,overflow:"hidden"},children:[(a=n.status,"approved"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsx(t.Hourglass,{size:o?14:16,color:"#F59E0B",style:{flexShrink:0}})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:o?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:o?20:22,height:o?20:22,minWidth:o?20:22,borderRadius:"50%",background:s.bg,color:s.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:o?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!l&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"18",height:o?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:o?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var a})})})}exports.ApprovedIcon=u,exports.ChevronIcon=v,exports.CloseIcon=f,exports.HistoryIcon=b,exports.IterateIcon=y,exports.RedlineCard=function({status:c,onClose:x,impactText:v,secondText:I,actionTakenByName:B,actionTakenAtTime:S="NA",onHistory:R,onIterate:L,onActionTrigger:T,disableAllActions:W=!1,impactTitle:A="Impact",customConfigs:M={},customStyles:D={},secondaryTitle:F,onAssignClick:E,onReviewUsersClick:z,assignedUsers:H,redlineId:U,aiReasonId:q,cognitiveIconSmall:N,cognitiveTootipTitle:O="Cognitive Decisioning",historyIconSmall:P,onHistoryClick:$,historyTootipTitle:_,onOpenCognitive:V,displayVariant:K="default",reviewTitle:Y,reviewSubtitle:G,reviewStatusIcon:J=e.jsx(t.Hourglass,{size:18}),reviewSteps:Q=[],showReviewProgress:X=!1,showOriginalText:Z=!1,originalText:ee,originalTextHeader:te="Original text",hideMeta:ie=!1}){const[oe,ne]=i.useState(!0),[re,se]=i.useState(!0),[le,ae]=i.useState(!1);i.useState(!1);const[de,ce]=i.useState(!0),xe="review"===K||"review"===c,{redlineDcoumentId:he,redlineConfig:ue,updateRedlineDataParent:pe}=a.useRequirementAI(),fe={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No original text available"},ge={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(j,{}),StatusIcon:e.jsx(p,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(b,{color:"#3b82f6"}),label:"History",onClick:R},{icon:e.jsx(k,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No rejected recommendation available"},je={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No reverted redline available"},ve={headerBg:"#F8FAFC",headerBorder:"#E2E8F0",titleColor:"#1E293B",label:Y||"Redline In Review",metaLabel:"Current Status",UserIcon:e.jsx(t.Hourglass,{size:16,color:"#94A3B8"}),StatusIcon:J,secondTitle:te,secondBg:"#F8FAFC",secondBorder:"#CBD5E1",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(u,{}),label:"Approve",action:"accept",useLabel:!0},{icon:e.jsx(p,{}),label:"Reject",action:"reject",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No original text available"};let be;be=xe?ve:"accepted"===c?fe:"rejected"===c?ge:je;const ke={...be,...M[c]||{}},ye=xe&&G||F;return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:le?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...D.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:ke.headerBg,borderBottom:`1.5px solid ${ke.headerBorder}`,...D.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:ke.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:ke.titleColor,letterSpacing:"-0.01em"},children:ke.label}),e.jsx(n.Tooltip,{title:ye,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:ye})})]}),H&&H.length>0&&e.jsx(s.DisplayUsers,{users:H,onClick:e=>{e.stopPropagation(),null==z||z()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(E||V||$)&&e.jsx(s.KebabMenu,{onAssignClick:E,onOpenCognitive:V,cognitiveIconSmall:N,cognitiveTootipTitle:O,historyIconSmall:P,onHistoryClick:$,historyTootipTitle:_}),e.jsx("button",{onClick:()=>{ae(!0),x()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(f,{})})]})]}),xe&&X&&Q.length>0&&e.jsx("div",{style:{padding:"10px 14px 0"},children:e.jsx(C,{steps:Q})}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...D.body},children:[!xe&&!ie&&e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...D.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[ke.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:ke.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(n.Tooltip,{title:B,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:B})}),e.jsx("span",{children:h(S)})]})]}),!xe&&!ie&&e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...D.divider}}),e.jsx(m,{title:A,open:oe,onToggle:()=>ne(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...D.impactText},children:e.jsx(r.AiReasonMarkdownWrapper,{message:`${v||""} [View chat](chat_citation$all)`,customStyles:D.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...D.divider}}),e.jsx(m,{title:xe&&Z?te:ke.secondTitle,open:xe&&Z?de:re,onToggle:()=>{xe&&Z?ce(e=>!e):se(e=>!e)},children:(xe&&Z?ee:I)?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:ke.secondBg,border:`1.5px solid ${ke.secondBorder}`,...D.secondSection},children:xe&&Z?ee:I}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...D.fallbackSectionStyle},children:[ke.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...D.actionsContainer},children:ke.actions.map(t=>e.jsx(w,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i,o,n,r,s;null==T||T({status:"loading",action:e,metadata:{redlineId:U,aiReasonId:q}});try{const{updated_reqai:a}=await l.resolveRedline({documentId:he,userEmail:null==ue?void 0:ue.userEmail,userName:null==ue?void 0:ue.userName,redlineId:null!=U?U:"",action:e,baseApiUrl:null==ue?void 0:ue.baseApiUrl,redlineConfigId:null!==(t=null==ue?void 0:ue.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==ue?void 0:ue.token)&&void 0!==i?i:"");await(null==pe?void 0:pe(a)),null===(o=d.default.emit)||void 0===o||o.call(d.default,`redline-edit:${he}:${null===(s=null===(r=null===(n=null==a?void 0:a.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===r?void 0:r[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==ue?void 0:ue.userName}),null==T||T({status:"success",action:e,metadata:{redlineId:U,aiReasonId:q}})}catch(t){null==T||T({status:"failed",action:e,metadata:{redlineId:U,aiReasonId:q}})}})((t.action||t.label).toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...D.actionBtn},disabled:W||t.disabled,disabledStyle:D.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=k,exports.RejectedIcon=p,exports.UserApprovedIcon=g,exports.UserRejectedIcon=j,exports.formatDate=h;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),n=require("@mui/material"),r=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function d(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const c=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),x=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),h=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),p=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),f=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),g=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),j=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function b({title:t,open:i,onToggle:o,children:n}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(f,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:n})})]})}function v({icon:t,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?s:{}};return e.jsxs("button",{onClick:r?void 0:o,disabled:r,style:l,onMouseEnter:e=>{r||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}exports.ApprovedIcon=c,exports.ChevronIcon=f,exports.CloseIcon=x,exports.HistoryIcon=g,exports.IterateIcon=k,exports.RedlineCard=function({status:f,onClose:y,impactText:m,secondText:C,actionTakenByName:I,actionTakenAtTime:R="NA",onHistory:S,onIterate:w,onActionTrigger:B,disableAllActions:T=!1,impactTitle:L="Impact",customConfigs:W={},customStyles:M={},secondaryTitle:D,onAssignClick:A,onReviewUsersClick:U,assignedUsers:q,redlineId:z,aiReasonId:H,cognitiveIconSmall:N,cognitiveTootipTitle:O="Cognitive Decisioning",historyIconSmall:E,onHistoryClick:F,historyTootipTitle:P,onOpenCognitive:$}){const[_,K]=i.useState(!0),[V,Y]=i.useState(!0),[G,J]=i.useState(!1);i.useState(!1);const{redlineDcoumentId:Q,redlineConfig:X,updateRedlineDataParent:Z}=a.useRequirementAI(),ee={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(h,{}),StatusIcon:e.jsx(c,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(g,{}),label:"History",onClick:S},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(k,{}),label:"Iterate",onClick:w}],fallbackText:"No original text available"},te={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(p,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(g,{color:"#3b82f6"}),label:"History",onClick:S},{icon:e.jsx(j,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(k,{}),label:"Iterate",onClick:w}],fallbackText:"No rejected recommendation available"},ie={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(h,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(g,{}),label:"History",onClick:S},{icon:e.jsx(k,{}),label:"Iterate",onClick:w}],fallbackText:"No reverted redline available"};let oe;oe="accepted"===f?ee:"rejected"===f?te:ie;const ne={...oe,...W[f]||{}};return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:G?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...M.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:ne.headerBg,borderBottom:`1.5px solid ${ne.headerBorder}`,...M.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:ne.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:ne.titleColor,letterSpacing:"-0.01em"},children:ne.label}),e.jsx(n.Tooltip,{title:D,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:D})})]}),q&&q.length>0&&e.jsx(s.DisplayUsers,{users:q,onClick:e=>{e.stopPropagation(),null==U||U()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(A||$||F)&&e.jsx(s.KebabMenu,{onAssignClick:A,onOpenCognitive:$,cognitiveIconSmall:N,cognitiveTootipTitle:O,historyIconSmall:E,onHistoryClick:F,historyTootipTitle:P}),e.jsx("button",{onClick:()=>{J(!0),y()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(x,{})})]})]}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...M.body},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...M.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[ne.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:ne.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(n.Tooltip,{title:I,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:I})}),e.jsx("span",{children:d(R)})]})]}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(b,{title:L,open:_,onToggle:()=>K(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...M.impactText},children:e.jsx(r.AiReasonMarkdownWrapper,{message:`${m||""} [View chat](chat_citation$all)`,customStyles:M.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(b,{title:ne.secondTitle,open:V,onToggle:()=>Y(e=>!e),children:C?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:ne.secondBg,border:`1.5px solid ${ne.secondBorder}`,...M.secondSection},children:C}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...M.fallbackSectionStyle},children:[ne.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...M.actionsContainer},children:ne.actions.map(t=>e.jsx(v,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==B||B({status:"loading",action:e,metadata:{redlineId:z,aiReasonId:H}});try{const{updated_reqai:o}=await l.resolveRedline({documentId:Q,userEmail:null==X?void 0:X.userEmail,userName:null==X?void 0:X.userName,redlineId:null!=z?z:"",action:e,baseApiUrl:null==X?void 0:X.baseApiUrl,redlineConfigId:null!==(t=null==X?void 0:X.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==X?void 0:X.token)&&void 0!==i?i:"");await(null==Z?void 0:Z(o)),null==B||B({status:"success",action:e,metadata:{redlineId:z,aiReasonId:H}})}catch(t){null==B||B({status:"failed",action:e,metadata:{redlineId:z,aiReasonId:H}})}})(t.label.toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...M.actionBtn},disabled:T||t.disabled,disabledStyle:M.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=j,exports.RejectedIcon=u,exports.UserApprovedIcon=h,exports.UserRejectedIcon=p,exports.formatDate=d;
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map