@e-llm-studio/citation 0.0.251 → 0.0.252

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 (231) hide show
  1. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js.map +1 -1
  3. package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
  4. package/dist/cjs/features/CognitiveCompare/CitationRenderer.js.map +1 -1
  5. package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js +2 -0
  6. package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
  7. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  8. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js.map +1 -1
  9. package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
  10. package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js.map +1 -1
  11. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  12. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js.map +1 -1
  13. package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
  14. package/dist/cjs/features/CognitiveCompare/CognitivePopup.js.map +1 -1
  15. package/dist/cjs/features/CognitiveCompare/CompareContext.js +1 -1
  16. package/dist/cjs/features/CognitiveCompare/CompareContext.js.map +1 -1
  17. package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
  18. package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
  19. package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
  20. package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -1
  21. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
  22. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -1
  23. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js +2 -0
  24. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js.map +1 -0
  25. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js +2 -0
  26. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js.map +1 -0
  27. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  28. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js.map +1 -1
  29. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js +2 -0
  30. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js.map +1 -0
  31. package/dist/cjs/features/CognitiveCompare/components/GuidelineSkeletonLoader.js +2 -0
  32. package/dist/cjs/features/CognitiveCompare/components/GuidelineSkeletonLoader.js.map +1 -0
  33. package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js +1 -1
  34. package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js.map +1 -1
  35. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  36. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js.map +1 -1
  37. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  38. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js.map +1 -1
  39. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  40. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js.map +1 -1
  41. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  42. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js.map +1 -1
  43. package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  44. package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js.map +1 -1
  45. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  46. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js.map +1 -1
  47. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  48. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js.map +1 -1
  49. package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
  50. package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
  51. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  52. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js.map +1 -1
  53. package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
  54. package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
  55. package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
  56. package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
  57. package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js +2 -0
  58. package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
  59. package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
  60. package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
  61. package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js +2 -0
  62. package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
  63. package/dist/cjs/features/CognitiveCompare/utils/normalizeCompactedGfmTables.js +2 -0
  64. package/dist/cjs/features/CognitiveCompare/utils/normalizeCompactedGfmTables.js.map +1 -0
  65. package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
  66. package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
  67. package/dist/cjs/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js +2 -0
  68. package/dist/cjs/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js.map +1 -0
  69. package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js +1 -1
  70. package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js.map +1 -1
  71. package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
  72. package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js.map +1 -1
  73. package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
  74. package/dist/features/CognitiveCompare/CitationAnchor.js.map +1 -1
  75. package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
  76. package/dist/features/CognitiveCompare/CitationRenderer.js.map +1 -1
  77. package/dist/features/CognitiveCompare/CitationRendererInner.js +2 -0
  78. package/dist/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
  79. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  80. package/dist/features/CognitiveCompare/CognitiveCompare.js.map +1 -1
  81. package/dist/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
  82. package/dist/features/CognitiveCompare/CognitiveCompareConstants.js.map +1 -1
  83. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  84. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js.map +1 -1
  85. package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
  86. package/dist/features/CognitiveCompare/CognitivePopup.js.map +1 -1
  87. package/dist/features/CognitiveCompare/CompareContext.js +1 -1
  88. package/dist/features/CognitiveCompare/CompareContext.js.map +1 -1
  89. package/dist/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
  90. package/dist/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
  91. package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
  92. package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -1
  93. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
  94. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -1
  95. package/dist/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js +2 -0
  96. package/dist/features/CognitiveCompare/Guidelines/utils/guidelineTargets.js.map +1 -0
  97. package/dist/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js +2 -0
  98. package/dist/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js.map +1 -0
  99. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  100. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js.map +1 -1
  101. package/dist/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js +2 -0
  102. package/dist/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.js.map +1 -0
  103. package/dist/features/CognitiveCompare/components/GuidelineSkeletonLoader.js +2 -0
  104. package/dist/features/CognitiveCompare/components/GuidelineSkeletonLoader.js.map +1 -0
  105. package/dist/features/CognitiveCompare/components/LHSSectionRow.js +1 -1
  106. package/dist/features/CognitiveCompare/components/LHSSectionRow.js.map +1 -1
  107. package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  108. package/dist/features/CognitiveCompare/components/RHSSectionRow.js.map +1 -1
  109. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  110. package/dist/features/CognitiveCompare/components/SectionAccordion.js.map +1 -1
  111. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  112. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js.map +1 -1
  113. package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  114. package/dist/features/CognitiveCompare/components/SvgConnectors.js.map +1 -1
  115. package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  116. package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js.map +1 -1
  117. package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  118. package/dist/features/CognitiveCompare/hooks/useCompareData.js.map +1 -1
  119. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  120. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js.map +1 -1
  121. package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
  122. package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
  123. package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  124. package/dist/features/CognitiveCompare/hooks/useSideBySide.js.map +1 -1
  125. package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
  126. package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
  127. package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
  128. package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
  129. package/dist/features/CognitiveCompare/onDemandCitations/href.js +2 -0
  130. package/dist/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
  131. package/dist/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
  132. package/dist/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
  133. package/dist/features/CognitiveCompare/onDemandCitations/response.js +2 -0
  134. package/dist/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
  135. package/dist/features/CognitiveCompare/utils/normalizeCompactedGfmTables.js +2 -0
  136. package/dist/features/CognitiveCompare/utils/normalizeCompactedGfmTables.js.map +1 -0
  137. package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
  138. package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
  139. package/dist/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js +2 -0
  140. package/dist/features/CognitiveCompare/utils/normalizeRedlineMarkdown.js.map +1 -0
  141. package/dist/features/SegmentReviewComponents/BoundaryCard.js +1 -1
  142. package/dist/features/SegmentReviewComponents/BoundaryCard.js.map +1 -1
  143. package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
  144. package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js.map +1 -1
  145. package/dist/types/features/CognitiveCompare/CitationAnchor.d.ts +2 -0
  146. package/dist/types/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
  147. package/dist/types/features/CognitiveCompare/CitationRenderer.d.ts +8 -1
  148. package/dist/types/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
  149. package/dist/types/features/CognitiveCompare/CitationRendererInner.d.ts +13 -0
  150. package/dist/types/features/CognitiveCompare/CitationRendererInner.d.ts.map +1 -0
  151. package/dist/types/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
  152. package/dist/types/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  153. package/dist/types/features/CognitiveCompare/CognitiveCompareConstants.d.ts +1 -1
  154. package/dist/types/features/CognitiveCompare/CognitiveCompareConstants.d.ts.map +1 -1
  155. package/dist/types/features/CognitiveCompare/CognitiveCompareTypes.d.ts +14 -1
  156. package/dist/types/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  157. package/dist/types/features/CognitiveCompare/CognitiveComparehelpers.d.ts +12 -0
  158. package/dist/types/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
  159. package/dist/types/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
  160. package/dist/types/features/CognitiveCompare/CompareContext.d.ts +10 -1
  161. package/dist/types/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
  162. package/dist/types/features/CognitiveCompare/GptWebCitationPanel.d.ts +7 -0
  163. package/dist/types/features/CognitiveCompare/GptWebCitationPanel.d.ts.map +1 -0
  164. package/dist/types/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -1
  165. package/dist/types/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -1
  166. package/dist/types/features/CognitiveCompare/Guidelines/utils/guidelineTargets.d.ts +3 -0
  167. package/dist/types/features/CognitiveCompare/Guidelines/utils/guidelineTargets.d.ts.map +1 -0
  168. package/dist/types/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.d.ts +3 -0
  169. package/dist/types/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.d.ts.map +1 -0
  170. package/dist/types/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +14 -1
  171. package/dist/types/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
  172. package/dist/types/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.d.ts +19 -0
  173. package/dist/types/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.d.ts.map +1 -0
  174. package/dist/types/features/CognitiveCompare/components/GuidelineSkeletonLoader.d.ts +8 -0
  175. package/dist/types/features/CognitiveCompare/components/GuidelineSkeletonLoader.d.ts.map +1 -0
  176. package/dist/types/features/CognitiveCompare/components/LHSSectionRow.d.ts.map +1 -1
  177. package/dist/types/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
  178. package/dist/types/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  179. package/dist/types/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
  180. package/dist/types/features/CognitiveCompare/components/SvgConnectors.d.ts +3 -2
  181. package/dist/types/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
  182. package/dist/types/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts +2 -1
  183. package/dist/types/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
  184. package/dist/types/features/CognitiveCompare/hooks/useCompareData.d.ts +1 -1
  185. package/dist/types/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
  186. package/dist/types/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
  187. package/dist/types/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts +10 -0
  188. package/dist/types/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts.map +1 -0
  189. package/dist/types/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
  190. package/dist/types/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts +3 -0
  191. package/dist/types/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts.map +1 -0
  192. package/dist/types/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts +16 -0
  193. package/dist/types/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts.map +1 -0
  194. package/dist/types/features/CognitiveCompare/onDemandCitations/href.d.ts +6 -0
  195. package/dist/types/features/CognitiveCompare/onDemandCitations/href.d.ts.map +1 -0
  196. package/dist/types/features/CognitiveCompare/onDemandCitations/index.d.ts +7 -0
  197. package/dist/types/features/CognitiveCompare/onDemandCitations/index.d.ts.map +1 -0
  198. package/dist/types/features/CognitiveCompare/onDemandCitations/payload.d.ts +4 -0
  199. package/dist/types/features/CognitiveCompare/onDemandCitations/payload.d.ts.map +1 -0
  200. package/dist/types/features/CognitiveCompare/onDemandCitations/response.d.ts +3 -0
  201. package/dist/types/features/CognitiveCompare/onDemandCitations/response.d.ts.map +1 -0
  202. package/dist/types/features/CognitiveCompare/onDemandCitations/types.d.ts +134 -0
  203. package/dist/types/features/CognitiveCompare/onDemandCitations/types.d.ts.map +1 -0
  204. package/dist/types/features/CognitiveCompare/utils/normalizeCompactedGfmTables.d.ts +7 -0
  205. package/dist/types/features/CognitiveCompare/utils/normalizeCompactedGfmTables.d.ts.map +1 -0
  206. package/dist/types/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts +6 -0
  207. package/dist/types/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts.map +1 -0
  208. package/dist/types/features/CognitiveCompare/utils/normalizeRedlineMarkdown.d.ts +6 -0
  209. package/dist/types/features/CognitiveCompare/utils/normalizeRedlineMarkdown.d.ts.map +1 -0
  210. package/dist/types/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -1
  211. package/dist/types/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts +3 -1
  212. package/dist/types/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
  213. package/package.json +1 -1
  214. package/dist/cjs/features/Bookemon/BookemonStyles.js +0 -2
  215. package/dist/cjs/features/Bookemon/BookemonStyles.js.map +0 -1
  216. package/dist/cjs/lib/ui/icons.js +0 -2
  217. package/dist/cjs/lib/ui/icons.js.map +0 -1
  218. package/dist/cjs/lib/ui/materialCompat.js +0 -2
  219. package/dist/cjs/lib/ui/materialCompat.js.map +0 -1
  220. package/dist/features/Bookemon/BookemonStyles.js +0 -2
  221. package/dist/features/Bookemon/BookemonStyles.js.map +0 -1
  222. package/dist/lib/ui/icons.js +0 -2
  223. package/dist/lib/ui/icons.js.map +0 -1
  224. package/dist/lib/ui/materialCompat.js +0 -2
  225. package/dist/lib/ui/materialCompat.js.map +0 -1
  226. package/dist/types/features/Bookemon/BookemonStyles.d.ts +0 -6
  227. package/dist/types/features/Bookemon/BookemonStyles.d.ts.map +0 -1
  228. package/dist/types/lib/ui/icons.d.ts +0 -46
  229. package/dist/types/lib/ui/icons.d.ts.map +0 -1
  230. package/dist/types/lib/ui/materialCompat.d.ts +0 -117
  231. package/dist/types/lib/ui/materialCompat.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{ChevronDown as e,ChevronUp as a,Maximize2 as o,X as i,ExternalLink as n}from"lucide-react";import{useMemo as r,useRef as c,useState as s,useEffect as p}from"react";import u from"../GptWebCitation/GptWebCitation.js";import{CitationType as d}from"../GptWebCitation/types.js";import{useCompareContext as l}from"./CompareContext.js";const x="https://dev-proposals-ai.techo.camp/utility/ca-workflow-composer-agent/get_citation",m="sai.siddhartha@techolution.com",h="672e32f7a0e8fe2e8e50bcba",b="TNV Sai Siddhartha",f=t=>(t?.extraMetaData||t)?.aiReasoningCitation?.gpt_citation?.[0]||null,C=()=>"function"==typeof globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.floor(16*Math.random());return("x"===t?e:e%4+8).toString(16)}),g=(t,e)=>{const a=(t=>t?.payloadCitationId||t?.extraMetaData?.payloadCitationId||"")(t)||e||C();return((t,e)=>{t&&"object"==typeof t&&(t.payloadCitationId=e,t.extraMetaData&&"object"==typeof t.extraMetaData&&(t.extraMetaData.payloadCitationId=e))})(t,a),a},y=({metaData:y,isFullscreen:I=!1})=>{const{gptWebCitationConfig:w}=l(),D=r(()=>(t=>({endpoint:t?.endpoint||x,userEmail:t?.userEmail||m,userId:t?.userId||h,userName:t?.userName||b,headers:t?.headers}))(w),[w]),N=y?.webGpt,T=c(null);T.current||(T.current=C());const M=r(()=>((t,e,a)=>{const o=f(t),i=o?.customMetaData||{},n=i?.value||{},r=t?.webSearchAnswer||{},c=t?.extraMetaData||t||{};return{userEmail:t?.userEmail||r?.userEmail||e?.userEmail||"",userId:t?.userId||r?.userId||e?.userId||"",userName:t?.userName||r?.userName||e?.userName||"",citationId:g(t,a),citationUrl:n?.citationUrl||r?.citationUrl||"",content:c?.Reasoning||r?.enhanced_content||"",citationType:n?.citationType||"web",citatioNumber:i?.citation_number??o?.citation_number??Number(t?.reasoningId||0)}})(N,D,T.current||void 0),[N,D]),U=r(()=>f(N),[N]),E=U?.customMetaData?.value||{},j=N?.extraMetaData||N||{},[G,S]=s(),[W,_]=s("pending"),[v,P]=s(!0);p(()=>{let t=!0;return(async()=>{if(D.endpoint&&M?.citationUrl&&M?.content){_("pending");try{const e=await fetch(D.endpoint,{method:"POST",headers:{"actor-id":M.userEmail,Accept:"application/json, text/plain, */*","Content-Type":"application/json",...D.headers||{}},body:JSON.stringify(M)});if(!e.ok)throw new Error(`Failed to fetch GPT web citation (${e.status})`);const a=await e.json();if(!t)return;S(a?.responseData||a?.result||a?.data||a),_("success")}catch(e){if(!t)return;console.error("Failed to load GPT web citation",e),_("error")}}else _("error")})(),()=>{t=!1}},[M,D]);const F=r(()=>({item:{confidence_score:Number(j?.Confidence_score||0),text:E?.paraphrase||"Web citation reasoning",dataSource:E?.text||j?.Reasoning||"",paraphrase:E?.paraphrase||""},headerTitle:"GPT Web Citation",index:Number(M?.citatioNumber||1)-1,iconsConfig:{ChevronDownIcon:e,ChevronUpIcon:a,MaximizeIcon:o,CloseIcon:i}}),[E,M?.citatioNumber,j]),k=r(()=>({...F,...I?{bodyHeight:"calc(90vh - 120px)"}:{}}),[F,I]);return t(u,{gptCitation:k,defaultCitationUrl:M?.citationUrl||"",citationType:d.GPT_WEB,webCitationData:G,webCitationStatus:W,showWebCitation:v,onToggleCitationView:()=>P(t=>!t),iconsConfig:{MaximizeIcon:o,ExternalLinkIcon:n},isFixedHeight:!0})};export{y as default};
2
+ //# sourceMappingURL=GptWebCitationPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GptWebCitationPanel.js","sources":["../../../src/features/CognitiveCompare/GptWebCitationPanel.tsx"],"sourcesContent":["import { ChevronDown, ChevronUp, ExternalLink, Maximize2, X } from \"lucide-react\";\nimport React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport GptWebCitation from \"../GptWebCitation/GptWebCitation\";\nimport { CitationType, GptWebCitationStatus, IWebCitationApiResponse } from \"../GptWebCitation/types\";\nimport { useCompareContext } from \"./CompareContext\";\nimport type { GptWebCitationConfig } from \"./CognitiveCompareTypes\";\n\nconst CITATION_FULLSCREEN_DIALOG_HEIGHT = \"90vh\";\nconst CITATION_FULLSCREEN_GPT_BODY_HEIGHT = `calc(${CITATION_FULLSCREEN_DIALOG_HEIGHT} - 120px)`;\n\nconst DEFAULT_GPT_WEB_CITATION_CONFIG: GptWebCitationConfig = {\n endpoint: \"https://dev-proposals-ai.techo.camp/utility/ca-workflow-composer-agent/get_citation\",\n userEmail: \"sai.siddhartha@techolution.com\",\n userId: \"672e32f7a0e8fe2e8e50bcba\",\n userName: \"TNV Sai Siddhartha\",\n};\n\nconst getFirstGptCitation = (webGptMeta: any) =>\n (webGptMeta?.extraMetaData || webGptMeta)?.aiReasoningCitation?.gpt_citation?.[0] || null;\n\nconst resolveGptWebCitationConfig = (\n gptWebCitationConfig?: GptWebCitationConfig,\n): GptWebCitationConfig => ({\n endpoint: gptWebCitationConfig?.endpoint || DEFAULT_GPT_WEB_CITATION_CONFIG.endpoint,\n userEmail: gptWebCitationConfig?.userEmail || DEFAULT_GPT_WEB_CITATION_CONFIG.userEmail,\n userId: gptWebCitationConfig?.userId || DEFAULT_GPT_WEB_CITATION_CONFIG.userId,\n userName: gptWebCitationConfig?.userName || DEFAULT_GPT_WEB_CITATION_CONFIG.userName,\n headers: gptWebCitationConfig?.headers,\n});\n\nconst createCitationUuid = () => {\n if (typeof globalThis.crypto?.randomUUID === \"function\") {\n return globalThis.crypto.randomUUID();\n }\n\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (char) => {\n const random = Math.floor(Math.random() * 16);\n const value = char === \"x\" ? random : (random % 4) + 8;\n return value.toString(16);\n });\n};\n\nconst getStoredPayloadCitationId = (webGptMeta: any) =>\n webGptMeta?.payloadCitationId ||\n webGptMeta?.extraMetaData?.payloadCitationId ||\n \"\";\n\nconst attachPayloadCitationId = (webGptMeta: any, payloadCitationId: string) => {\n if (!webGptMeta || typeof webGptMeta !== \"object\") return;\n\n webGptMeta.payloadCitationId = payloadCitationId;\n\n if (webGptMeta.extraMetaData && typeof webGptMeta.extraMetaData === \"object\") {\n webGptMeta.extraMetaData.payloadCitationId = payloadCitationId;\n }\n};\n\nconst getOrCreatePayloadCitationId = (webGptMeta: any, generatedCitationId?: string) => {\n const payloadCitationId =\n getStoredPayloadCitationId(webGptMeta) ||\n generatedCitationId ||\n createCitationUuid();\n\n attachPayloadCitationId(webGptMeta, payloadCitationId);\n return payloadCitationId;\n};\n\nconst buildGptWebCitationPayload = (\n webGptMeta: any,\n gptWebCitationConfig?: GptWebCitationConfig,\n generatedCitationId?: string,\n) => {\n const gptCitation = getFirstGptCitation(webGptMeta);\n const customMetaData = gptCitation?.customMetaData || {};\n const citationValue = customMetaData?.value || {};\n const webSearchAnswer = webGptMeta?.webSearchAnswer || {};\n const extraMetaData = webGptMeta?.extraMetaData || webGptMeta || {};\n\n return {\n userEmail:\n webGptMeta?.userEmail ||\n webSearchAnswer?.userEmail ||\n gptWebCitationConfig?.userEmail ||\n \"\",\n userId:\n webGptMeta?.userId ||\n webSearchAnswer?.userId ||\n gptWebCitationConfig?.userId ||\n \"\",\n userName:\n webGptMeta?.userName ||\n webSearchAnswer?.userName ||\n gptWebCitationConfig?.userName ||\n \"\",\n citationId:\n getOrCreatePayloadCitationId(webGptMeta, generatedCitationId),\n citationUrl: citationValue?.citationUrl || webSearchAnswer?.citationUrl || \"\",\n content: extraMetaData?.Reasoning || webSearchAnswer?.enhanced_content || \"\",\n citationType: citationValue?.citationType || \"web\",\n citatioNumber:\n customMetaData?.citation_number ??\n gptCitation?.citation_number ??\n Number(webGptMeta?.reasoningId || 0),\n };\n};\n\nconst GptWebCitationPanel = ({\n metaData,\n isFullscreen = false,\n}: {\n metaData: any;\n isFullscreen?: boolean;\n}) => {\n const { gptWebCitationConfig } = useCompareContext();\n const resolvedGptWebCitationConfig = useMemo(\n () => resolveGptWebCitationConfig(gptWebCitationConfig),\n [gptWebCitationConfig],\n );\n const webGptMeta = metaData?.webGpt;\n const generatedCitationIdRef = useRef<string | null>(null);\n if (!generatedCitationIdRef.current) {\n generatedCitationIdRef.current = createCitationUuid();\n }\n\n const payload = useMemo(\n () => buildGptWebCitationPayload(\n webGptMeta,\n resolvedGptWebCitationConfig,\n generatedCitationIdRef.current || undefined,\n ),\n [webGptMeta, resolvedGptWebCitationConfig],\n );\n const firstGptCitation = useMemo(() => getFirstGptCitation(webGptMeta), [webGptMeta]);\n const citationValue = firstGptCitation?.customMetaData?.value || {};\n const extraMetaData = webGptMeta?.extraMetaData || webGptMeta || {};\n const [webCitationData, setWebCitationData] = useState<IWebCitationApiResponse | undefined>();\n const [webCitationStatus, setWebCitationStatus] = useState<GptWebCitationStatus>(\"pending\");\n const [showWebCitation, setShowWebCitation] = useState(true);\n\n useEffect(() => {\n let isMounted = true;\n\n const fetchGptWebCitation = async () => {\n if (!resolvedGptWebCitationConfig.endpoint || !payload?.citationUrl || !payload?.content) {\n setWebCitationStatus(\"error\");\n return;\n }\n\n setWebCitationStatus(\"pending\");\n\n try {\n const response = await fetch(resolvedGptWebCitationConfig.endpoint, {\n method: \"POST\",\n headers: {\n \"actor-id\": payload.userEmail,\n \"Accept\": \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n ...(resolvedGptWebCitationConfig.headers || {}),\n },\n body: JSON.stringify(payload),\n });\n\n if (!response.ok) {\n throw new Error(`Failed to fetch GPT web citation (${response.status})`);\n }\n\n const rawData = await response.json();\n const data =\n rawData?.responseData ||\n rawData?.result ||\n rawData?.data ||\n rawData;\n if (!isMounted) return;\n\n setWebCitationData(data);\n setWebCitationStatus(\"success\");\n } catch (error) {\n if (!isMounted) return;\n console.error(\"Failed to load GPT web citation\", error);\n setWebCitationStatus(\"error\");\n }\n };\n\n fetchGptWebCitation();\n\n return () => {\n isMounted = false;\n };\n }, [payload, resolvedGptWebCitationConfig]);\n\n const gptCitation = useMemo(\n () => ({\n item: {\n confidence_score: Number(extraMetaData?.Confidence_score || 0),\n text: citationValue?.paraphrase || \"Web citation reasoning\",\n dataSource: citationValue?.text || extraMetaData?.Reasoning || \"\",\n paraphrase: citationValue?.paraphrase || \"\",\n },\n headerTitle: \"GPT Web Citation\",\n index: Number(payload?.citatioNumber || 1) - 1,\n iconsConfig: {\n ChevronDownIcon: ChevronDown,\n ChevronUpIcon: ChevronUp,\n MaximizeIcon: Maximize2,\n CloseIcon: X,\n },\n }),\n [citationValue, payload?.citatioNumber, extraMetaData],\n );\n\n const resolvedGptCitation = useMemo(\n () => ({\n ...gptCitation,\n ...(isFullscreen ? { bodyHeight: CITATION_FULLSCREEN_GPT_BODY_HEIGHT } : {}),\n }),\n [gptCitation, isFullscreen],\n );\n\n return (\n <GptWebCitation\n gptCitation={resolvedGptCitation}\n defaultCitationUrl={payload?.citationUrl || \"\"}\n citationType={CitationType.GPT_WEB}\n webCitationData={webCitationData}\n webCitationStatus={webCitationStatus}\n showWebCitation={showWebCitation}\n onToggleCitationView={() => setShowWebCitation((current) => !current)}\n iconsConfig={{\n MaximizeIcon: Maximize2,\n ExternalLinkIcon: ExternalLink,\n }}\n isFixedHeight\n />\n );\n};\n\nexport default GptWebCitationPanel;\n"],"names":["DEFAULT_GPT_WEB_CITATION_CONFIG","getFirstGptCitation","webGptMeta","extraMetaData","aiReasoningCitation","gpt_citation","createCitationUuid","globalThis","crypto","randomUUID","replace","char","random","Math","floor","toString","getOrCreatePayloadCitationId","generatedCitationId","payloadCitationId","getStoredPayloadCitationId","attachPayloadCitationId","GptWebCitationPanel","metaData","isFullscreen","gptWebCitationConfig","useCompareContext","resolvedGptWebCitationConfig","useMemo","endpoint","userEmail","userId","userName","headers","resolveGptWebCitationConfig","webGpt","generatedCitationIdRef","useRef","current","payload","gptCitation","customMetaData","citationValue","value","webSearchAnswer","citationId","citationUrl","content","Reasoning","enhanced_content","citationType","citatioNumber","citation_number","Number","reasoningId","buildGptWebCitationPayload","firstGptCitation","webCitationData","setWebCitationData","useState","webCitationStatus","setWebCitationStatus","showWebCitation","setShowWebCitation","useEffect","isMounted","async","response","fetch","method","Accept","body","JSON","stringify","ok","Error","status","rawData","json","responseData","result","data","error","console","fetchGptWebCitation","item","confidence_score","Confidence_score","text","paraphrase","dataSource","headerTitle","index","iconsConfig","ChevronDownIcon","ChevronDown","ChevronUpIcon","ChevronUp","MaximizeIcon","Maximize2","CloseIcon","X","resolvedGptCitation","bodyHeight","jsx","GptWebCitation","defaultCitationUrl","CitationType","GPT_WEB","onToggleCitationView","ExternalLinkIcon","ExternalLink","isFixedHeight"],"mappings":"wXAOA,MAGMA,EACQ,sFADRA,EAES,iCAFTA,EAGM,2BAHNA,EAIQ,qBAGRC,EAAuBC,IACxBA,GAAYC,eAAiBD,IAAaE,qBAAqBC,eAAe,IAAM,KAYnFC,EA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KACSnB,GAAA,IAEjB,CAAC1B,EAASZ,IAEb,MAAMa,EAAcZ,EAChB,KAAO,CACHyD,KAAM,CACFC,iBAAkBjC,OAAOjD,GAAemF,kBAAoB,GAC5DC,KAAM9C,GAAe+C,YAAc,yBACnCC,WAAYhD,GAAe8C,MAAQpF,GAAe4C,WAAa,GAC/DyC,WAAY/C,GAAe+C,YAAc,IAE7CE,YAAa,mBACbC,MAAOvC,OAAOd,GAASY,eAAiB,GAAK,EAC7C0C,YAAa,CACTC,gBAAiBC,EACjBC,cAAeC,EACfC,aAAcC,EACdC,UAAWC,KAGnB,CAAC3D,EAAeH,GAASY,cAAe/C,IAGtCkG,EAAsB1E,EACxB,KAAO,IACAY,KACChB,EAAe,CAAE+E,WA7MW,sBA6MyC,CAAC,IAE9E,CAAC/D,EAAahB,IAId,OAAAgF,EAACC,EAAA,CACGjE,YAAa8D,EACbI,mBAAoBnE,GAASO,aAAe,GAC5CI,aAAcyD,EAAaC,QAC3BnD,kBACAG,oBACAE,kBACA+C,qBAAsB,IAAM9C,EAAoBzB,IAAaA,GAC7DuD,YAAa,CACTK,aAAcC,EACdW,iBAAkBC,GAEtBC,eAAa"}
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{Box as o}from"@mui/material";import r from"react-markdown";import i from"rehype-raw";import{SHARED_MARKDOWN_STYLES as l}from"../../CognitiveCompareConfig.js";import{DEVIATION_BADGE_SEPARATOR as a,generateColorPalette as s}from"../../CognitiveComparehelpers.js";import{processGuidelinesMarkdown as n}from"../utils/processGuidelinesMarkdown.js";const g=({guidelinesData:g,deviationData:u,connectedSections:p,proposedSections:m})=>{const d=Array.from(p)[0],{targetHighlights:h,labelColor:c}=t(()=>{if(null==d||!u)return{targetHighlights:[],labelColor:""};let e="";"number"==typeof d?e=m[d]?.nodeId||"":"string"==typeof d&&(e=d.includes(a)?d.split(a)[0]:d.split("::")[0].split(":")[0]);const t=u[e];if(!t)return{targetHighlights:[],labelColor:""};let o=[];const r=t.evaluation_result||{};let i="";return Object.values(r).forEach(e=>{e?.deviation_highlights?.rulebook_guidelines&&(o=[...o,...e.deviation_highlights.rulebook_guidelines],i=e.evaluation_outputs?.metadata?.label_color?s(e.evaluation_outputs?.metadata?.label_color).bg:"")}),{targetHighlights:o.filter(Boolean),labelColor:i}},[d,u,m]),f=t(()=>n({guidelinesData:g,targetHighlights:h,labelColor:c||"#FEF08A"}),[g,h,c]);return e(o,{sx:{padding:"0px 12px",backgroundColor:"#FFFFFF",borderRadius:"8px",...l,overflow:"visible"},children:e(r,{rehypePlugins:[i],children:f})})};export{g as default};
1
+ import{jsx as r}from"react/jsx-runtime";import{useMemo as o}from"react";import{Box as e}from"@mui/material";import i from"react-markdown";import t from"rehype-raw";import{SHARED_MARKDOWN_STYLES as l}from"../../CognitiveCompareConfig.js";import{generateColorPalette as a}from"../../CognitiveComparehelpers.js";import{processGuidelinesMarkdown as n}from"../utils/processGuidelinesMarkdown.js";import{resolveGuidelineSelection as s}from"../utils/resolveGuidelineSelection.js";const m=({guidelinesData:m,deviationData:p,connectedSections:g,proposedSections:d})=>{const c=Array.from(g)[0],{targetHighlights:u,labelColor:f}=o(()=>{if(null==c||!p)return{targetHighlights:[],labelColor:""};const r=s({activeIdentifier:c,deviationData:p,proposedSections:d}),o=r.labelColor?a(r.labelColor):null;return{targetHighlights:r.targetHighlights,labelColor:o?.bg||""}},[c,p,d]),h=o(()=>n({guidelinesData:m,targetHighlights:u,labelColor:f||"#FEF08A"}),[m,u,f]);return r(e,{sx:{padding:"0px 12px",marginTop:"12px",backgroundColor:"#FFFFFF",borderRadius:"8px",...l,overflow:"visible"},children:r(i,{rehypePlugins:[t],children:h})})};export{m as default};
2
2
  //# sourceMappingURL=GuidelinePanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GuidelinePanel.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Box } from '@mui/material';\nimport ReactMarkdown from 'react-markdown';\nimport rehypeRaw from 'rehype-raw';\nimport { SHARED_MARKDOWN_STYLES } from '../../CognitiveCompareConfig';\nimport { DEVIATION_BADGE_SEPARATOR, generateColorPalette } from '../../CognitiveComparehelpers';\nimport { processGuidelinesMarkdown } from '../utils/processGuidelinesMarkdown';\n// import { SHARED_MARKDOWN_STYLES } from '../CognitiveCompareConfig';\n// import { DEVIATION_BADGE_SEPARATOR } from '../CognitiveComparehelpers';\n\nconst GuidelinePanel = ({ guidelinesData, deviationData, connectedSections, proposedSections }: any) => {\n const activeNodeIdFull = Array.from(connectedSections)[0];\n\n const {targetHighlights, labelColor} = useMemo(() => {\n if (activeNodeIdFull == null || !deviationData) return { targetHighlights: [], labelColor: \"\" };\n\n let baseNodeId = \"\";\n\n // 1. Resolve the actual Node ID whether the input is an array index or a composite string\n if (typeof activeNodeIdFull === 'number') {\n baseNodeId = proposedSections[activeNodeIdFull]?.nodeId || \"\";\n } else if (typeof activeNodeIdFull === 'string') {\n if (activeNodeIdFull.includes(DEVIATION_BADGE_SEPARATOR)) {\n baseNodeId = activeNodeIdFull.split(DEVIATION_BADGE_SEPARATOR)[0];\n } else {\n baseNodeId = activeNodeIdFull.split('::')[0].split(':')[0];\n }\n }\n\n // 2. Extract rulebook guidelines from deviation data\n const nodeDevData = deviationData[baseNodeId];\n if (!nodeDevData) return { targetHighlights: [], labelColor: \"\" };\n\n let guidelines: string[] = [];\n const evalResults = nodeDevData.evaluation_result || {};\n let labelColor: string = \"\"\n \n Object.values(evalResults).forEach((evalNode: any) => {\n if (evalNode?.deviation_highlights?.rulebook_guidelines) {\n guidelines = [...guidelines, ...evalNode.deviation_highlights.rulebook_guidelines];\n labelColor = evalNode.evaluation_outputs?.metadata?.label_color ? generateColorPalette(evalNode.evaluation_outputs?.metadata?.label_color).bg : \"\";\n }\n });\n\n return { targetHighlights: guidelines.filter(Boolean), labelColor }; // Filter out empty strings\n }, [activeNodeIdFull, deviationData, proposedSections]);\n\n const processedMarkdown = useMemo(\n () =>\n processGuidelinesMarkdown({\n guidelinesData,\n targetHighlights,\n labelColor: labelColor || \"#FEF08A\",\n }),\n [guidelinesData, targetHighlights, labelColor]\n );\n\n return (\n <Box sx={{ \n padding: '0px 12px', \n backgroundColor: '#FFFFFF', \n borderRadius: '8px', \n ...SHARED_MARKDOWN_STYLES,\n overflow: 'visible' \n }}>\n <ReactMarkdown rehypePlugins={[rehypeRaw as any]}>\n {processedMarkdown}\n </ReactMarkdown>\n </Box>\n );\n};\n\nexport default GuidelinePanel;"],"names":["GuidelinePanel","guidelinesData","deviationData","connectedSections","proposedSections","activeNodeIdFull","Array","from","targetHighlights","labelColor","useMemo","baseNodeId","nodeId","includes","DEVIATION_BADGE_SEPARATOR","split","nodeDevData","guidelines","evalResults","evaluation_result","Object","values","forEach","evalNode","deviation_highlights","rulebook_guidelines","evaluation_outputs","metadata","label_color","generateColorPalette","bg","filter","Boolean","processedMarkdown","processGuidelinesMarkdown","jsx","Box","sx","padding","backgroundColor","borderRadius","SHARED_MARKDOWN_STYLES","overflow","children","ReactMarkdown","rehypePlugins","rehypeRaw"],"mappings":"saAUA,MAAMA,EAAiB,EAAGC,iBAAgBC,gBAAeC,oBAAmBC,uBAC1E,MAAMC,EAAmBC,MAAMC,KAAKJ,GAAmB,IAEjDK,iBAACA,EAAAC,WAAkBA,GAAcC,EAAQ,KACzC,GAAoB,MAApBL,IAA6BH,EAAe,MAAO,CAAEM,iBAAkB,GAAIC,WAAY,IAE3F,IAAIE,EAAa,GAGe,iBAArBN,EACIM,EAAAP,EAAiBC,IAAmBO,QAAU,GACtB,iBAArBP,IAEdM,EADEN,EAAiBQ,SAASC,GACfT,EAAiBU,MAAMD,GAA2B,GAElDT,EAAiBU,MAAM,MAAM,GAAGA,MAAM,KAAK,IAKtD,MAAAC,EAAcd,EAAcS,GAC9B,IAACK,EAAoB,MAAA,CAAER,iBAAkB,GAAIC,WAAY,IAE7D,IAAIQ,EAAuB,GACrB,MAAAC,EAAcF,EAAYG,mBAAqB,GACrD,IAAIV,EAAqB,GASzB,OAPAW,OAAOC,OAAOH,GAAaI,QAASC,IAC9BA,GAAUC,sBAAsBC,sBAClCR,EAAa,IAAIA,KAAeM,EAASC,qBAAqBC,qBAC9DhB,EAAac,EAASG,oBAAoBC,UAAUC,YAAcC,EAAqBN,EAASG,oBAAoBC,UAAUC,aAAaE,GAAK,MAI7I,CAAEtB,iBAAkBS,EAAWc,OAAOC,SAAUvB,WAAAA,IACtD,CAACJ,EAAkBH,EAAeE,IAE/B6B,EAAoBvB,EACxB,IACEwB,EAA0B,CACxBjC,iBACAO,mBACAC,WAAYA,GAAc,YAE9B,CAACR,EAAgBO,EAAkBC,IAInC,OAAA0B,EAACC,GAAIC,GAAI,CACPC,QAAS,WACTC,gBAAiB,UACjBC,aAAc,SACXC,EACHC,SAAU,WAEVC,WAACC,EAAc,CAAAC,cAAe,CAACC,GAC5BH"}
1
+ {"version":3,"file":"GuidelinePanel.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Box } from '@mui/material';\nimport ReactMarkdown from 'react-markdown';\nimport rehypeRaw from 'rehype-raw';\nimport { SHARED_MARKDOWN_STYLES } from '../../CognitiveCompareConfig';\nimport { generateColorPalette } from '../../CognitiveComparehelpers';\nimport { processGuidelinesMarkdown } from '../utils/processGuidelinesMarkdown';\nimport { resolveGuidelineSelection } from '../utils/resolveGuidelineSelection';\n\nconst GuidelinePanel = ({ guidelinesData, deviationData, connectedSections, proposedSections }: any) => {\n const activeNodeIdFull = Array.from(connectedSections)[0];\n\n const { targetHighlights, labelColor } = useMemo(() => {\n if (activeNodeIdFull == null || !deviationData) {\n return { targetHighlights: [], labelColor: \"\" };\n }\n\n const selection = resolveGuidelineSelection({\n activeIdentifier: activeNodeIdFull,\n deviationData,\n proposedSections,\n });\n const palette = selection.labelColor\n ? generateColorPalette(selection.labelColor)\n : null;\n\n return {\n targetHighlights: selection.targetHighlights,\n labelColor: palette?.bg || \"\",\n };\n }, [activeNodeIdFull, deviationData, proposedSections]);\n\n const processedMarkdown = useMemo(\n () =>\n processGuidelinesMarkdown({\n guidelinesData,\n targetHighlights,\n labelColor: labelColor || \"#FEF08A\",\n }),\n [guidelinesData, targetHighlights, labelColor]\n );\n\n return (\n <Box sx={{ \n padding: '0px 12px',\n marginTop: '12px', \n backgroundColor: '#FFFFFF', \n borderRadius: '8px', \n ...SHARED_MARKDOWN_STYLES,\n overflow: 'visible' \n }}>\n <ReactMarkdown rehypePlugins={[rehypeRaw as any]}>\n {processedMarkdown}\n </ReactMarkdown>\n </Box>\n );\n};\n\nexport default GuidelinePanel;\n"],"names":["GuidelinePanel","guidelinesData","deviationData","connectedSections","proposedSections","activeNodeIdFull","Array","from","targetHighlights","labelColor","useMemo","selection","resolveGuidelineSelection","activeIdentifier","palette","generateColorPalette","bg","processedMarkdown","processGuidelinesMarkdown","jsx","Box","sx","padding","marginTop","backgroundColor","borderRadius","SHARED_MARKDOWN_STYLES","overflow","children","ReactMarkdown","rehypePlugins","rehypeRaw"],"mappings":"ydASA,MAAMA,EAAiB,EAAGC,iBAAgBC,gBAAeC,oBAAmBC,uBAC1E,MAAMC,EAAmBC,MAAMC,KAAKJ,GAAmB,IAEjDK,iBAAEA,EAAAC,WAAkBA,GAAeC,EAAQ,KAC3C,GAAoB,MAApBL,IAA6BH,EAC/B,MAAO,CAAEM,iBAAkB,GAAIC,WAAY,IAG7C,MAAME,EAAYC,EAA0B,CAC1CC,iBAAkBR,EAClBH,gBACAE,qBAEIU,EAAUH,EAAUF,WACtBM,EAAqBJ,EAAUF,YAC/B,KAEG,MAAA,CACLD,iBAAkBG,EAAUH,iBAC5BC,WAAYK,GAASE,IAAM,KAE5B,CAACX,EAAkBH,EAAeE,IAE/Ba,EAAoBP,EACxB,IACEQ,EAA0B,CACxBjB,iBACAO,mBACAC,WAAYA,GAAc,YAE9B,CAACR,EAAgBO,EAAkBC,IAInC,OAAAU,EAACC,GAAIC,GAAI,CACPC,QAAS,WACTC,UAAW,OACXC,gBAAiB,UACjBC,aAAc,SACXC,EACHC,SAAU,WAEVC,WAACC,EAAc,CAAAC,cAAe,CAACC,GAC5BH"}
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as r}from"react";import{Box as a,Typography as t}from"@mui/material";import o from"react-markdown";import n from"rehype-raw";import{SHARED_MARKDOWN_STYLES as i}from"../../CognitiveCompareConfig.js";import{DEVIATION_BADGE_SEPARATOR as d,generateColorPalette as l}from"../../CognitiveComparehelpers.js";import s from"../../CitationAnchor.js";const c=({evalNode:e})=>!1===e?.evaluation_outputs?.guideline_flag?.rulebook_used,p=(e,r,a)=>`${e}::${r}::${a}`,u=(e,r)=>`${e}::${r}`,w={relativeWrapper:{verticalAlign:"baseline"},arrow:{color:"#6D28D9"}},b=({deviationData:b,connectedSections:m,proposedSections:y})=>{const v=Array.from(m||[])[0],f=r(()=>((e,r)=>"number"==typeof e?r[e]?.nodeId||"":e&&"string"==typeof e&&e.trim()?e.includes(d)?e.split(d)[0]:e.split("::")[0].split(":")[0]:"")(v,y||[]),[v,y]),g=r(()=>{if(!b||"object"!=typeof b)return[];return Object.entries(b).flatMap(([e,r])=>(e=>{const r=e&&"object"==typeof e?e.evaluation_result:null;return!r||"object"!=typeof r&&!Array.isArray(r)?[]:Array.isArray(r)?r.map((e,r)=>({evalNode:e,evaluationKey:String(r)})):"object"==typeof r?Object.entries(r).map(([e,r])=>({evalNode:r,evaluationKey:e})):[]})(r).filter(c).map(({evalNode:r,evaluationKey:a})=>({nodeId:e,evaluationKey:a,answerKey:u(e,a),evaluation:r,webSearchAnswer:r.web_search_answer,colorPalette:l(r?.evaluation_outputs?.metadata?.label_color||"")??{border:w.arrow.color}})).filter(({webSearchAnswer:e})=>!!e?.enhanced_content)).map((e,r)=>({...e,answerOrder:r}))},[b]),h=r(()=>g.reduce((e,r)=>{const a=r.webSearchAnswer?.extraMetaData||{};return Object.entries(a).forEach(([a,t])=>{const o=p(r.nodeId,r.evaluationKey,a);e[o]={nodeId:r.nodeId,evaluationKey:r.evaluationKey,answerKey:r.answerKey,answerOrder:r.answerOrder,reasoningId:a,evaluation:r.evaluation,webSearchAnswer:r.webSearchAnswer,extraMetaData:t}}),e},{}),[g]),x=r(()=>g.reduce((r,a)=>(r[a.answerKey]={a:({href:r="",children:t,type:o,reason:n,...i})=>{const d=i?.["data-cognitive-reasoning"],l=d?p(a.nodeId,a.evaluationKey,String(d)):"",c=l?h[l]:null;return e(s,{href:r,children:t,citationType:o,citationReason:n,metaData:{webGpt:c,webGptMetaKey:l},customStyle:w})}},r),{}),[g,h]);return e(a,{sx:{padding:"12px 12px 12px 0px",backgroundColor:"#FFFFFF",borderRadius:"8px",...i,overflow:"visible"},children:g.length>0?g.map((r,t)=>e(a,{id:r.nodeId===f?"guideline-target-0":void 0,"data-web-gpt-node-id":r.nodeId,"data-web-gpt-evaluation-key":r.evaluationKey,"data-web-gpt-answer-order":r.answerOrder,"data-web-gpt-active":r.nodeId===f?"true":"false",sx:{mb:1.5,border:r.nodeId===f?`2px solid ${r.colorPalette.border}`:"1px solid #d3d3d3",borderRadius:"6px",padding:"8px",backgroundColor:"#FFFFFF"},children:e(o,{rehypePlugins:[n],components:x[r.answerKey],children:r.webSearchAnswer.enhanced_content})},r.answerKey)):e(t,{sx:{color:"#64748B",fontSize:"14px",py:1},children:"No web GPT data available."})})};export{b as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useMemo as a}from"react";import{Box as r,Typography as o}from"@mui/material";import t from"react-markdown";import n from"rehype-raw";import{SHARED_MARKDOWN_STYLES as i}from"../../CognitiveCompareConfig.js";import{generateColorPalette as d}from"../../CognitiveComparehelpers.js";import l from"../../CitationAnchor.js";import{resolveGuidelineSelection as s}from"../utils/resolveGuidelineSelection.js";const c=({evalNode:e})=>!1===e?.evaluation_outputs?.guideline_flag?.rulebook_used,p=(e,a,r)=>`${e}::${a}::${r}`,u=(e,a)=>`${e}::${a}`,v={relativeWrapper:{verticalAlign:"baseline"},arrow:{color:"#6D28D9"}},w=({deviationData:w,connectedSections:y,proposedSections:b})=>{const m=Array.from(y||[])[0],f=a(()=>s({activeIdentifier:m,deviationData:w,proposedSections:b||[]}),[m,w,b]),g=a(()=>{if(!w||"object"!=typeof w)return[];return Object.entries(w).flatMap(([e,a])=>(e=>{const a=e&&"object"==typeof e?e.evaluation_result:null;return!a||"object"!=typeof a&&!Array.isArray(a)?[]:Array.isArray(a)?a.map((e,a)=>({evalNode:e,evaluationKey:String(a)})):"object"==typeof a?Object.entries(a).map(([e,a])=>({evalNode:a,evaluationKey:e})):[]})(a).filter(c).map(({evalNode:a,evaluationKey:r})=>({nodeId:e,evaluationKey:r,answerKey:u(e,r),evaluation:a,webSearchAnswer:a.web_search_answer,colorPalette:d(a?.evaluation_outputs?.metadata?.label_color||"")??{border:v.arrow.color}})).filter(({webSearchAnswer:e})=>!!e?.enhanced_content)).map((e,a)=>({...e,answerOrder:a}))},[w]),h=a(()=>{const e=null==f.evaluationKey?void 0:g.find(e=>e.nodeId===f.baseNodeId&&e.evaluationKey===f.evaluationKey);return(e||g.find(e=>e.nodeId===f.baseNodeId))?.answerKey},[f.baseNodeId,f.evaluationKey,g]),K=a(()=>g.reduce((e,a)=>{const r=a.webSearchAnswer?.extraMetaData||{};return Object.entries(r).forEach(([r,o])=>{const t=p(a.nodeId,a.evaluationKey,r);e[t]={nodeId:a.nodeId,evaluationKey:a.evaluationKey,answerKey:a.answerKey,answerOrder:a.answerOrder,reasoningId:r,evaluation:a.evaluation,webSearchAnswer:a.webSearchAnswer,extraMetaData:o}}),e},{}),[g]),x=a(()=>g.reduce((a,r)=>(a[r.answerKey]={a:({href:a="",children:o,type:t,reason:n,...i})=>{const d=i?.["data-cognitive-reasoning"],s=d?p(r.nodeId,r.evaluationKey,String(d)):"",c=s?K[s]:null;return e(l,{href:a,children:o,citationType:t,citationReason:n,metaData:{webGpt:c,webGptMetaKey:s},customStyle:v})}},a),{}),[g,K]);return e(r,{sx:{padding:"12px 12px 12px 0px",backgroundColor:"#FFFFFF",borderRadius:"8px",...i,overflow:"visible"},children:g.length>0?g.map(a=>{const o=a.answerKey===h;return e(r,{id:o?"guideline-target-0":void 0,"data-web-gpt-node-id":a.nodeId,"data-web-gpt-evaluation-key":a.evaluationKey,"data-web-gpt-answer-order":a.answerOrder,"data-web-gpt-active":o?"true":"false",sx:{mb:1.5,border:o?`2px solid ${a.colorPalette.border}`:"1px solid #d3d3d3",borderRadius:"6px",padding:"8px",backgroundColor:"#FFFFFF"},children:e(t,{rehypePlugins:[n],components:x[a.answerKey],children:a.webSearchAnswer.enhanced_content})},a.answerKey)}):e(o,{sx:{color:"#64748B",fontSize:"14px",py:1},children:"No web GPT data available."})})};export{w as default};
2
2
  //# sourceMappingURL=WebGptPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebGptPanel.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/components/WebGptPanel.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Box, Typography } from '@mui/material';\nimport ReactMarkdown from 'react-markdown';\nimport rehypeRaw from 'rehype-raw';\nimport { SHARED_MARKDOWN_STYLES } from '../../CognitiveCompareConfig';\nimport { DEVIATION_BADGE_SEPARATOR, generateColorPalette } from '../../CognitiveComparehelpers';\nimport CitationAnchor from '../../CitationAnchor';\n\nconst getBaseNodeId = (activeNodeIdFull: unknown, proposedSections: Record<string, unknown>[]) => {\n if (typeof activeNodeIdFull === 'number') {\n return proposedSections[activeNodeIdFull]?.nodeId || \"\";\n }\n\n if (activeNodeIdFull && typeof activeNodeIdFull === 'string' && activeNodeIdFull.trim()) {\n if (activeNodeIdFull.includes(DEVIATION_BADGE_SEPARATOR)) {\n return activeNodeIdFull.split(DEVIATION_BADGE_SEPARATOR)[0];\n }\n\n return activeNodeIdFull.split('::')[0].split(':')[0];\n }\n\n return \"\";\n};\n\nconst getEvaluationNodes = (nodeDevData: Record<string, unknown>) => {\n const evalResults = (nodeDevData && typeof nodeDevData === 'object') ? nodeDevData.evaluation_result : null;\n if (!evalResults || (typeof evalResults !== 'object' && !Array.isArray(evalResults))) return [];\n if (Array.isArray(evalResults)) {\n return evalResults.map((evalNode, index) => ({ evalNode, evaluationKey: String(index) }));\n }\n if (typeof evalResults === \"object\") {\n return Object.entries(evalResults).map(([evaluationKey, evalNode]) => ({ evalNode, evaluationKey }));\n }\n return [];\n};\n\nconst isWebGptEvaluation = ({ evalNode }: { evalNode: Record<string, any> }) =>\n evalNode?.evaluation_outputs?.guideline_flag?.rulebook_used === false;\n\nconst buildWebGptMetaKey = (nodeId: string, evaluationKey: string, reasoningId: string) =>\n `${nodeId}::${evaluationKey}::${reasoningId}`;\n\nconst buildWebGptAnswerKey = (nodeId: string, evaluationKey: string) =>\n `${nodeId}::${evaluationKey}`;\n\nconst WEB_GPT_CITATION_STYLE = {\n relativeWrapper: {\n verticalAlign: \"baseline\",\n },\n arrow: {\n color: \"#6D28D9\"\n }\n};\n\ninterface WebGptPanelProps {\n deviationData: Record<string, unknown>;\n connectedSections: Iterable<unknown>;\n proposedSections: Record<string, unknown>[];\n}\n\nconst WebGptPanel = ({ deviationData, connectedSections, proposedSections }: WebGptPanelProps) => {\n const activeNodeIdFull = Array.from(connectedSections || [])[0];\n const activeBaseNodeId = useMemo(\n () => getBaseNodeId(activeNodeIdFull, proposedSections || []),\n [activeNodeIdFull, proposedSections],\n );\n\n const webSearchAnswers = useMemo(() => {\n if (!deviationData || typeof deviationData !== \"object\") return [];\n\n const collectFromNode = ([nodeId, nodeDevData]: [string, any]) =>\n getEvaluationNodes(nodeDevData)\n .filter(isWebGptEvaluation)\n .map(({ evalNode, evaluationKey }: any) => ({\n nodeId,\n evaluationKey,\n answerKey: buildWebGptAnswerKey(nodeId, evaluationKey),\n evaluation: evalNode,\n webSearchAnswer: evalNode.web_search_answer,\n colorPalette : generateColorPalette(evalNode?.evaluation_outputs?.metadata?.label_color || \"\") ?? {border: WEB_GPT_CITATION_STYLE.arrow.color},\n }))\n .filter(({ webSearchAnswer }: any) => !!webSearchAnswer?.enhanced_content);\n\n return Object.entries(deviationData)\n .flatMap(collectFromNode as any)\n .map((answer: any, answerOrder: number) => ({\n ...answer,\n answerOrder,\n }));\n }, [deviationData]);\n\n const webGptExtraMetaByKey = useMemo(() => {\n return webSearchAnswers.reduce((acc: Record<string, any>, answer: any) => {\n const extraMetaData = answer.webSearchAnswer?.extraMetaData || {};\n\n Object.entries(extraMetaData).forEach(([reasoningId, extraMetaDataForReasoning]) => {\n const metaKey = buildWebGptMetaKey(answer.nodeId, answer.evaluationKey, reasoningId);\n acc[metaKey] = {\n nodeId: answer.nodeId,\n evaluationKey: answer.evaluationKey,\n answerKey: answer.answerKey,\n answerOrder: answer.answerOrder,\n reasoningId,\n evaluation: answer.evaluation,\n webSearchAnswer: answer.webSearchAnswer,\n extraMetaData: extraMetaDataForReasoning,\n };\n });\n\n return acc;\n }, {});\n }, [webSearchAnswers]);\n\n const componentsByAnswerKey = useMemo(() => {\n return webSearchAnswers.reduce((acc: Record<string, any>, answer: any) => {\n acc[answer.answerKey] = {\n a: ({ href = \"\", children, type, reason, ...props }: any) => {\n const reasoningId = props?.[\"data-cognitive-reasoning\"];\n const metaKey = reasoningId\n ? buildWebGptMetaKey(answer.nodeId, answer.evaluationKey, String(reasoningId))\n : \"\";\n const matchedExtraMetaData = metaKey ? webGptExtraMetaByKey[metaKey] : null;\n\n return (\n <CitationAnchor\n href={href}\n children={children}\n citationType={type}\n citationReason={reason}\n metaData={{\n webGpt: matchedExtraMetaData,\n webGptMetaKey: metaKey,\n }}\n customStyle={WEB_GPT_CITATION_STYLE}\n />\n );\n },\n };\n\n return acc;\n }, {});\n }, [webSearchAnswers, webGptExtraMetaByKey]);\n\n return (\n <Box sx={{ \n padding: '12px 12px 12px 0px', \n backgroundColor: '#FFFFFF', \n borderRadius: '8px', \n ...SHARED_MARKDOWN_STYLES,\n overflow: 'visible' \n }}>\n {webSearchAnswers.length > 0 ? (\n webSearchAnswers.map((answer: any, index: number) => (\n <Box\n key={answer.answerKey}\n // ── MAGIC FIX: This ID tells alignStraightLines & the SVG drawer exactly where to connect! ──\n id={answer.nodeId === activeBaseNodeId ? \"guideline-target-0\" : undefined}\n data-web-gpt-node-id={answer.nodeId}\n data-web-gpt-evaluation-key={answer.evaluationKey}\n data-web-gpt-answer-order={answer.answerOrder}\n data-web-gpt-active={answer.nodeId === activeBaseNodeId ? \"true\" : \"false\"}\n sx={{ mb: 1.5,\n border: (answer.nodeId === activeBaseNodeId) ? `2px solid ${answer.colorPalette.border}` : \"1px solid #d3d3d3\",\n borderRadius: \"6px\",\n padding: \"8px\",\n backgroundColor: \"#FFFFFF\",\n }}\n >\n <ReactMarkdown\n rehypePlugins={[rehypeRaw as any]}\n components={componentsByAnswerKey[answer.answerKey]}\n >\n {answer.webSearchAnswer.enhanced_content}\n </ReactMarkdown>\n </Box>\n ))\n ) : (\n <Typography sx={{ color: \"#64748B\", fontSize: \"14px\", py: 1 }}>\n No web GPT data available.\n </Typography>\n )}\n </Box>\n );\n};\n\nexport default WebGptPanel;\n"],"names":["isWebGptEvaluation","evalNode","evaluation_outputs","guideline_flag","rulebook_used","buildWebGptMetaKey","nodeId","evaluationKey","reasoningId","buildWebGptAnswerKey","WEB_GPT_CITATION_STYLE","relativeWrapper","verticalAlign","arrow","color","WebGptPanel","deviationData","connectedSections","proposedSections","activeNodeIdFull","Array","from","activeBaseNodeId","useMemo","trim","includes","DEVIATION_BADGE_SEPARATOR","split","getBaseNodeId","webSearchAnswers","Object","entries","flatMap","nodeDevData","evalResults","evaluation_result","isArray","map","index","String","getEvaluationNodes","filter","answerKey","evaluation","webSearchAnswer","web_search_answer","colorPalette","generateColorPalette","metadata","label_color","border","enhanced_content","answer","answerOrder","webGptExtraMetaByKey","reduce","acc","extraMetaData","forEach","extraMetaDataForReasoning","metaKey","componentsByAnswerKey","a","href","children","type","reason","props","matchedExtraMetaData","jsx","CitationAnchor","citationType","citationReason","metaData","webGpt","webGptMetaKey","customStyle","Box","sx","padding","backgroundColor","borderRadius","SHARED_MARKDOWN_STYLES","overflow","length","id","mb","ReactMarkdown","rehypePlugins","rehypeRaw","components","Typography","fontSize","py"],"mappings":"2YAQA,MA4BMA,EAAqB,EAAGC,eACoC,IAAhEA,GAAUC,oBAAoBC,gBAAgBC,cAE1CC,EAAqB,CAACC,EAAgBC,EAAuBC,IACjE,GAAGF,MAAWC,MAAkBC,IAE5BC,EAAuB,CAACH,EAAgBC,IAC5C,GAAGD,MAAWC,IAEVG,EAAyB,CAC7BC,gBAAiB,CACfC,cAAe,YAEjBC,MAAO,CACLC,MAAO,YAULC,EAAc,EAAGC,gBAAeC,oBAAmBC,uBACvD,MAAMC,EAAmBC,MAAMC,KAAKJ,GAAqB,IAAI,GACvDK,EAAmBC,EACvB,IAvDkB,EAACJ,EAA2BD,IAChB,iBAArBC,EACFD,EAAiBC,IAAmBb,QAAU,GAGnDa,GAAgD,iBAArBA,GAAiCA,EAAiBK,OAC3EL,EAAiBM,SAASC,GACrBP,EAAiBQ,MAAMD,GAA2B,GAGpDP,EAAiBQ,MAAM,MAAM,GAAGA,MAAM,KAAK,GAG7C,GA0CCC,CAAcT,EAAkBD,GAAoB,IAC1D,CAACC,EAAkBD,IAGfW,EAAmBN,EAAQ,KAC/B,IAAKP,GAA0C,iBAAlBA,QAAmC,GAezD,OAAAc,OAAOC,QAAQf,GACnBgB,QAdqB,EAAE1B,EAAQ2B,KA9CX,CAACA,IAC1B,MAAMC,EAAeD,GAAsC,iBAAhBA,EAA4BA,EAAYE,kBAAoB,KACnG,OAACD,GAAuC,iBAAhBA,IAA6Bd,MAAMgB,QAAQF,GAAsB,GACzFd,MAAMgB,QAAQF,GACTA,EAAYG,IAAI,CAACpC,EAAUqC,KAAW,CAAErC,WAAUM,cAAegC,OAAOD,MAEtD,iBAAhBJ,EACFJ,OAAOC,QAAQG,GAAaG,IAAI,EAAE9B,EAAeN,M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ACRC,OAAQN,EACRO,cAAef,GAEjBgB,YAAalE,MAMd8C,GACN,CAAE,GACJ,CAAC3B,EAAkByB,IAGpB,OAAAe,EAACQ,GAAIC,GAAI,CACPC,QAAS,qBACTC,gBAAiB,UACjBC,aAAc,SACXC,EACHC,SAAU,WAETnB,WAAiBoB,OAAS,EACzBvD,EAAiBQ,IAAI,CAACe,EAAad,IACjC+B,EAACQ,EAAA,CAGCQ,GAAIjC,EAAO9C,SAAWgB,EAAmB,0BAAuB,EAChE,uBAAsB8B,EAAO9C,OAC7B,8BAA6B8C,EAAO7C,cACpC,4BAA2B6C,EAAOC,YAClC,sBAAqBD,EAAO9C,SAAWgB,EAAmB,OAAS,QACnEwD,GAAI,CAAEQ,GAAI,IACRpC,OAASE,EAAO9C,SAAWgB,EAAoB,aAAa8B,EAAON,aAAaI,SAAW,oBAC3F+B,aAAc,MACdF,QAAS,MACTC,gBAAiB,WAGnBhB,SAAAK,EAACkB,EAAA,CACCC,cAAe,CAACC,GAChBC,WAAY7B,EAAsBT,EAAOV,WAExCsB,WAAOpB,gBAAgBO,oBAlBrBC,EAAOV,YAuBf2B,EAAAsB,EAAA,CAAWb,GAAI,CAAEhE,MAAO,UAAW8E,SAAU,OAAQC,GAAI,GAAK7B"}
1
+ {"version":3,"file":"WebGptPanel.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/components/WebGptPanel.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Box, Typography } from '@mui/material';\nimport ReactMarkdown from 'react-markdown';\nimport rehypeRaw from 'rehype-raw';\nimport { SHARED_MARKDOWN_STYLES } from '../../CognitiveCompareConfig';\nimport { generateColorPalette } from '../../CognitiveComparehelpers';\nimport CitationAnchor from '../../CitationAnchor';\nimport { resolveGuidelineSelection } from '../utils/resolveGuidelineSelection';\n\nconst getEvaluationNodes = (nodeDevData: Record<string, unknown>) => {\n const evalResults = (nodeDevData && typeof nodeDevData === 'object') ? nodeDevData.evaluation_result : null;\n if (!evalResults || (typeof evalResults !== 'object' && !Array.isArray(evalResults))) return [];\n if (Array.isArray(evalResults)) {\n return evalResults.map((evalNode, index) => ({ evalNode, evaluationKey: String(index) }));\n }\n if (typeof evalResults === \"object\") {\n return Object.entries(evalResults).map(([evaluationKey, evalNode]) => ({ evalNode, evaluationKey }));\n }\n return [];\n};\n\nconst isWebGptEvaluation = ({ evalNode }: { evalNode: Record<string, any> }) =>\n evalNode?.evaluation_outputs?.guideline_flag?.rulebook_used === false;\n\nconst buildWebGptMetaKey = (nodeId: string, evaluationKey: string, reasoningId: string) =>\n `${nodeId}::${evaluationKey}::${reasoningId}`;\n\nconst buildWebGptAnswerKey = (nodeId: string, evaluationKey: string) =>\n `${nodeId}::${evaluationKey}`;\n\nconst WEB_GPT_CITATION_STYLE = {\n relativeWrapper: {\n verticalAlign: \"baseline\",\n },\n arrow: {\n color: \"#6D28D9\"\n }\n};\n\ninterface WebGptPanelProps {\n deviationData: Record<string, unknown>;\n connectedSections: Iterable<unknown>;\n proposedSections: Record<string, unknown>[];\n}\n\nconst WebGptPanel = ({ deviationData, connectedSections, proposedSections }: WebGptPanelProps) => {\n const activeNodeIdFull = Array.from(connectedSections || [])[0];\n const activeSelection = useMemo(\n () => resolveGuidelineSelection({\n activeIdentifier: activeNodeIdFull,\n deviationData,\n proposedSections: proposedSections || [],\n }),\n [activeNodeIdFull, deviationData, proposedSections],\n );\n\n const webSearchAnswers = useMemo(() => {\n if (!deviationData || typeof deviationData !== \"object\") return [];\n\n const collectFromNode = ([nodeId, nodeDevData]: [string, any]) =>\n getEvaluationNodes(nodeDevData)\n .filter(isWebGptEvaluation)\n .map(({ evalNode, evaluationKey }: any) => ({\n nodeId,\n evaluationKey,\n answerKey: buildWebGptAnswerKey(nodeId, evaluationKey),\n evaluation: evalNode,\n webSearchAnswer: evalNode.web_search_answer,\n colorPalette : generateColorPalette(evalNode?.evaluation_outputs?.metadata?.label_color || \"\") ?? {border: WEB_GPT_CITATION_STYLE.arrow.color},\n }))\n .filter(({ webSearchAnswer }: any) => !!webSearchAnswer?.enhanced_content);\n\n return Object.entries(deviationData)\n .flatMap(collectFromNode as any)\n .map((answer: any, answerOrder: number) => ({\n ...answer,\n answerOrder,\n }));\n }, [deviationData]);\n\n const activeAnswerKey = useMemo(() => {\n const exactMatch = activeSelection.evaluationKey == null\n ? undefined\n : webSearchAnswers.find(\n (answer: any) =>\n answer.nodeId === activeSelection.baseNodeId &&\n answer.evaluationKey === activeSelection.evaluationKey,\n );\n\n return (\n exactMatch ||\n webSearchAnswers.find(\n (answer: any) => answer.nodeId === activeSelection.baseNodeId,\n )\n )?.answerKey;\n }, [activeSelection.baseNodeId, activeSelection.evaluationKey, webSearchAnswers]);\n\n const webGptExtraMetaByKey = useMemo(() => {\n return webSearchAnswers.reduce((acc: Record<string, any>, answer: any) => {\n const extraMetaData = answer.webSearchAnswer?.extraMetaData || {};\n\n Object.entries(extraMetaData).forEach(([reasoningId, extraMetaDataForReasoning]) => {\n const metaKey = buildWebGptMetaKey(answer.nodeId, answer.evaluationKey, reasoningId);\n acc[metaKey] = {\n nodeId: answer.nodeId,\n evaluationKey: answer.evaluationKey,\n answerKey: answer.answerKey,\n answerOrder: answer.answerOrder,\n reasoningId,\n evaluation: answer.evaluation,\n webSearchAnswer: answer.webSearchAnswer,\n extraMetaData: extraMetaDataForReasoning,\n };\n });\n\n return acc;\n }, {});\n }, [webSearchAnswers]);\n\n const componentsByAnswerKey = useMemo(() => {\n return webSearchAnswers.reduce((acc: Record<string, any>, answer: any) => {\n acc[answer.answerKey] = {\n a: ({ href = \"\", children, type, reason, ...props }: any) => {\n const reasoningId = props?.[\"data-cognitive-reasoning\"];\n const metaKey = reasoningId\n ? buildWebGptMetaKey(answer.nodeId, answer.evaluationKey, String(reasoningId))\n : \"\";\n const matchedExtraMetaData = metaKey ? webGptExtraMetaByKey[metaKey] : null;\n\n return (\n <CitationAnchor\n href={href}\n children={children}\n citationType={type}\n citationReason={reason}\n metaData={{\n webGpt: matchedExtraMetaData,\n webGptMetaKey: metaKey,\n }}\n customStyle={WEB_GPT_CITATION_STYLE}\n />\n );\n },\n };\n\n return acc;\n }, {});\n }, [webSearchAnswers, webGptExtraMetaByKey]);\n\n return (\n <Box sx={{ \n padding: '12px 12px 12px 0px', \n backgroundColor: '#FFFFFF', \n borderRadius: '8px', \n ...SHARED_MARKDOWN_STYLES,\n overflow: 'visible' \n }}>\n {webSearchAnswers.length > 0 ? (\n webSearchAnswers.map((answer: any) => {\n const isActive = answer.answerKey === activeAnswerKey;\n\n return (\n <Box\n key={answer.answerKey}\n id={isActive ? \"guideline-target-0\" : undefined}\n data-web-gpt-node-id={answer.nodeId}\n data-web-gpt-evaluation-key={answer.evaluationKey}\n data-web-gpt-answer-order={answer.answerOrder}\n data-web-gpt-active={isActive ? \"true\" : \"false\"}\n sx={{ mb: 1.5,\n border: isActive ? `2px solid ${answer.colorPalette.border}` : \"1px solid #d3d3d3\",\n borderRadius: \"6px\",\n padding: \"8px\",\n backgroundColor: \"#FFFFFF\",\n }}\n >\n <ReactMarkdown\n rehypePlugins={[rehypeRaw as any]}\n components={componentsByAnswerKey[answer.answerKey]}\n >\n {answer.webSearchAnswer.enhanced_content}\n </ReactMarkdown>\n </Box>\n );\n })\n ) : (\n <Typography sx={{ color: \"#64748B\", fontSize: \"14px\", py: 1 }}>\n No web GPT data available.\n </Typography>\n )}\n </Box>\n );\n};\n\nexport default WebGptPanel;\n"],"names":["isWebGptEvaluation","evalNode","evaluation_outputs","guideline_flag","rulebook_used","buildWebGptMetaKey","nodeId","evaluationKey","reasoningId","buildWebGptAnswerKey","WEB_GPT_CITATION_STYLE","relativeWrapper","verticalAlign","arrow","color","WebGptPanel","deviationData","connectedSections","proposedSections","activeNodeIdFull","Array","from","activeSelection","useMemo","resolveGuidelineSelection","activeIdentifier","webSearchAnswers","Object","entries","flatMap","nodeDevData","evalResults","evaluation_result","isArray","map","index","String","getEvaluationNodes","filter","answerKey","evaluation","webSearchAnswer","web_search_answer","colorPalette","generateColorPalette","metadata","label_color","border","enhanced_content","answer","answerOrder","activeAnswerKey","exactMatch","find","baseNodeId","webGptExtraMetaByKey","reduce","acc","extraMetaData","forEach","extraMetaDataForReasoning","metaKey","componentsByAnswerKey","a","href","children","type","reason","props","matchedExtraMetaData","jsx","CitationAnchor","citationType","citationReason","metaData","webGpt","webGptMetaKey","customStyle","Box","sx","padding","backgroundColor","borderRadius","SHARED_MARKDOWN_STYLES","overflow","length","isActive","id","mb","ReactMarkdown","rehypePlugins","rehypeRaw","components","Typography","fontSize","py"],"mappings":"8bASA,MAYMA,EAAqB,EAAGC,eACoC,IAAhEA,GAAUC,oBAAoBC,gBAAgBC,cAE1CC,EAAqB,CAACC,EAAgBC,EAAuBC,IACjE,GAAGF,MAAWC,MAAkBC,IAE5BC,EAAuB,CAACH,EAAgBC,IAC5C,GAAGD,MAAWC,IAEVG,EAAyB,CAC7BC,gBAAiB,CACfC,cAAe,YAEjBC,MAAO,CACLC,MAAO,YAULC,EAAc,EAAGC,gBAAeC,oBAAmBC,uBACvD,MAAMC,EAAmBC,MAAMC,KAAKJ,GAAqB,IAAI,GACvDK,EAAkBC,EACtB,IAAMC,EAA0B,CAC9BC,iBAAkBN,EAClBH,gBACAE,iBAAkBA,GAAoB,KAExC,CAACC,EAAkBH,EAAeE,IAG9BQ,EAAmBH,EAAQ,KAC/B,IAAKP,GAA0C,iBAAlBA,QAAmC,GAezD,OAAAW,OAAOC,QAAQZ,GACnBa,QAdqB,EAAEvB,EAAQwB,KAlDX,CAACA,IAC1B,MAAMC,EAAeD,GAAsC,iBAAhBA,EAA4BA,EAAYE,kBAAoB,KACnG,OAACD,GAAuC,iBAAhBA,IAA6BX,MAAMa,QAAQF,GAAsB,GACzFX,MAAMa,QAAQF,GACTA,EAAYG,IAAI,CAACjC,EAAUkC,KAAW,CAAElC,WAAUM,cAAe6B,OAAOD,MAEtD,iBAAhBJ,EACFJ,OAAOC,QAAQG,GAAaG,IAAI,EAAE3B,EAAeN,MAAQ,CAASA,WA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G,EAAGC,OAAO,GAAIC,WAAUC,OAAMC,YAAWC,MACpC,MAAA5D,EAAc4D,IAAQ,4BACtBP,EAAUrD,EACZH,EAAmB4C,EAAO3C,OAAQ2C,EAAO1C,cAAe6B,OAAO5B,IAC/D,GACE6D,EAAuBR,EAAUN,EAAqBM,GAAW,KAGrE,OAAAS,EAACC,EAAA,CACCP,OACAC,WACAO,aAAcN,EACdO,eAAgBN,EAChBO,SAAU,CACRC,OAAQN,EACRO,cAAef,GAEjBgB,YAAanE,MAMd+C,GACN,CAAE,GACJ,CAAC/B,EAAkB6B,IAGpB,OAAAe,EAACQ,GAAIC,GAAI,CACPC,QAAS,qBACTC,gBAAiB,UACjBC,aAAc,SACXC,EACHC,SAAU,WAETnB,SAAiBvC,EAAA2D,OAAS,EACzB3D,EAAiBQ,IAAKe,IACd,MAAAqC,EAAWrC,EAAOV,YAAcY,EAGpC,OAAAmB,EAACQ,EAAA,CAECS,GAAID,EAAW,0BAAuB,EACtC,uBAAsBrC,EAAO3C,OAC7B,8BAA6B2C,EAAO1C,cACpC,4BAA2B0C,EAAOC,YAClC,sBAAqBoC,EAAW,OAAS,QACzCP,GAAI,CAAES,GAAI,IACRzC,OAAQuC,EAAW,aAAarC,EAAON,aAAaI,SAAW,oBAC/DmC,aAAc,MACdF,QAAS,MACTC,gBAAiB,WAGnBhB,SAAAK,EAACmB,EAAA,CACCC,cAAe,CAACC,GAChBC,WAAY9B,EAAsBb,EAAOV,WAExC0B,WAAOxB,gBAAgBO,oBAjBrBC,EAAOV,aAuBjB+B,EAAAuB,EAAA,CAAWd,GAAI,CAAEjE,MAAO,UAAWgF,SAAU,OAAQC,GAAI,GAAK9B"}
@@ -0,0 +1,2 @@
1
+ const t='[id^="guideline-target-"], [data-web-gpt-active="true"]',e=e=>e?Array.from(e.querySelectorAll(t)).filter(t=>{const e=t.getBoundingClientRect();return e.width>0&&e.height>0}):[];export{t as GUIDELINE_TARGET_SELECTOR,e as getVisibleGuidelineTargets};
2
+ //# sourceMappingURL=guidelineTargets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guidelineTargets.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/utils/guidelineTargets.ts"],"sourcesContent":["export const GUIDELINE_TARGET_SELECTOR =\n '[id^=\"guideline-target-\"], [data-web-gpt-active=\"true\"]';\n\nexport const getVisibleGuidelineTargets = (\n container: HTMLElement | null | undefined,\n): HTMLElement[] => {\n if (!container) return [];\n\n return Array.from(\n container.querySelectorAll<HTMLElement>(GUIDELINE_TARGET_SELECTOR),\n ).filter((element) => {\n const rect = element.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n });\n};\n"],"names":["GUIDELINE_TARGET_SELECTOR","getVisibleGuidelineTargets","container","Array","from","querySelectorAll","filter","element","rect","getBoundingClientRect","width","height"],"mappings":"AAAO,MAAMA,EACX,0DAEWC,EACXC,GAEKA,EAEEC,MAAMC,KACXF,EAAUG,iBAA8BL,IACxCM,OAAQC,IACF,MAAAC,EAAOD,EAAQE,wBACrB,OAAOD,EAAKE,MAAQ,GAAKF,EAAKG,OAAS,IANlB"}
@@ -0,0 +1,2 @@
1
+ const r=r=>null!==r&&"object"==typeof r&&!Array.isArray(r),t=e=>{if(Array.isArray(e))return e.some(t);if(!r(e))return!1;const o=e.gpt_citation;return!(!Array.isArray(o)||!o.some(t=>r(t)))||Object.values(e).some(t)};export{t as hasGptCitationObjects};
2
+ //# sourceMappingURL=hasGptCitationObjects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasGptCitationObjects.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.ts"],"sourcesContent":["const isObject = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === \"object\" && !Array.isArray(value);\n\n/** Returns true when the supplied data contains at least one GPT citation object. */\nexport const hasGptCitationObjects = (value: unknown): boolean => {\n if (Array.isArray(value)) {\n return value.some(hasGptCitationObjects);\n }\n\n if (!isObject(value)) return false;\n\n const gptCitations = value.gpt_citation;\n if (\n Array.isArray(gptCitations) &&\n gptCitations.some((citation) => isObject(citation))\n ) {\n return true;\n }\n\n return Object.values(value).some(hasGptCitationObjects);\n};\n"],"names":["isObject","value","Array","isArray","hasGptCitationObjects","some","gptCitations","gpt_citation","citation","Object","values"],"mappings":"AAAA,MAAMA,EAAYC,GACN,OAAVA,GAAmC,iBAAVA,IAAuBC,MAAMC,QAAQF,GAGnDG,EAAyBH,IAChC,GAAAC,MAAMC,QAAQF,GACT,OAAAA,EAAMI,KAAKD,GAGpB,IAAKJ,EAASC,GAAe,OAAA,EAE7B,MAAMK,EAAeL,EAAMM,aAEzB,SAAAL,MAAMC,QAAQG,KACdA,EAAaD,KAAMG,GAAaR,EAASQ,MAKpCC,OAAOC,OAAOT,GAAOI,KAAKD"}
@@ -1,2 +1,2 @@
1
- const t=({guidelinesData:t,targetHighlights:e=[],labelColor:a="#FEF08A"})=>{let n="";if(t?.learnings_data&&Object.keys(t.learnings_data).length>0){const e=Object.keys(t.learnings_data)[0],a=t.learnings_data[e];a?.instruction_prompt&&(n=a.instruction_prompt)}else{(t?.data?.artifactData?.userStorySnapshot||[]).forEach(t=>{t.title&&(n+=`### ${t.title}\n\n`),t.value&&(n+=`${t.value}\n\n`),t.sub_features?.forEach(t=>{t.title&&(n+=`#### ${t.title}\n\n`),t.value&&(n+=`${t.value}\n\n`)})})}return e.forEach((t,e)=>{const r=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),l=new RegExp(`(${r})`,"g");n=n.replace(l,`<mark id="guideline-target-${e}" style="background-color: ${a}; border-radius: 3px; padding: 2px;">$1</mark>`)}),n};export{t as processGuidelinesMarkdown};
1
+ const t=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e=t=>t.trim().replace(/\s+/g," "),r=({guidelinesData:r,targetHighlights:n=[],labelColor:a="#FEF08A"})=>{let i="";return i="string"==typeof r?r:r?.learnings_data&&"object"==typeof r.learnings_data?(t=>{const r=new Set;return Object.values(t).map(t=>{const n="string"==typeof t?.title?t.title.trim():"",a="string"==typeof t?.instruction_prompt?t.instruction_prompt.trim():"";if(!a)return"";const i=`${e(n)}\n${e(a)}`;return r.has(i)?"":(r.add(i),n?`# ${n}\n\n${a}`:a)}).filter(Boolean).join("\n\n")})(r.learnings_data):(t=>{const e=t?.data?.artifactData?.userStorySnapshot;if(!Array.isArray(e))return"";let r="";return e.forEach(t=>{t?.title&&(r+=`### ${t.title}\n\n`),t?.value&&(r+=`${t.value}\n\n`),Array.isArray(t?.sub_features)&&t.sub_features.forEach(t=>{t?.title&&(r+=`#### ${t.title}\n\n`),t?.value&&(r+=`${t.value}\n\n`)})}),r.trim()})(r),((r,n,a)=>{let i=r;const s=new Set;let o=0;return n.forEach(r=>{if("string"!=typeof r)return;const n=r.trim(),l=e(n).toLocaleLowerCase();if(!l||s.has(l))return;s.add(l);const c=n.split(/\s+/).map(t).join("\\s+"),u=new RegExp(c,"i").exec(i);if(console.log("LOG: Printing match",u,n,c,i),!u)return;const g=`<mark id="guideline-target-${o}" style="background-color: ${a}; border-radius: 3px; padding: 2px;">${u[0]}</mark>`;i=`${i.slice(0,u.index)}${g}${i.slice(u.index+u[0].length)}`,o+=1}),i})(i,Array.isArray(n)?n:[],a||"#FEF08A")};export{r as processGuidelinesMarkdown};
2
2
  //# sourceMappingURL=processGuidelinesMarkdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"processGuidelinesMarkdown.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.ts"],"sourcesContent":["export const processGuidelinesMarkdown = ({\n guidelinesData,\n targetHighlights = [],\n labelColor = \"#FEF08A\",\n}: {\n guidelinesData: any;\n targetHighlights?: string[];\n labelColor?: string;\n}) => {\n let combinedMarkdown = \"\";\n\n // ── NEW STRUCTURE: Check for learnings_data and use instruction_prompt from the first entry ──\n if (guidelinesData?.learnings_data && Object.keys(guidelinesData.learnings_data).length > 0) {\n const firstLearningKey = Object.keys(guidelinesData.learnings_data)[0];\n const firstLearning = guidelinesData.learnings_data[firstLearningKey];\n \n if (firstLearning?.instruction_prompt) {\n combinedMarkdown = firstLearning.instruction_prompt;\n }\n } \n // ── OLD STRUCTURE FALLBACK (Prevents breaking existing functionality) ──\n else {\n const snapshots = guidelinesData?.data?.artifactData?.userStorySnapshot || [];\n snapshots.forEach((story: any) => {\n if (story.title) combinedMarkdown += `### ${story.title}\\n\\n`;\n if (story.value) combinedMarkdown += `${story.value}\\n\\n`;\n\n story.sub_features?.forEach((sub: any) => {\n if (sub.title) combinedMarkdown += `#### ${sub.title}\\n\\n`;\n if (sub.value) combinedMarkdown += `${sub.value}\\n\\n`;\n });\n });\n }\n\n targetHighlights.forEach((targetText, index) => {\n const escapedText = targetText.replace(\n /[-\\/\\\\^$*+?.()|[\\]{}]/g,\n \"\\\\$&\"\n );\n\n const regex = new RegExp(`(${escapedText})`, \"g\");\n\n combinedMarkdown = combinedMarkdown.replace(\n regex,\n `<mark id=\"guideline-target-${index}\" style=\"background-color: ${labelColor}; border-radius: 3px; padding: 2px;\">$1</mark>`\n );\n });\n\n return combinedMarkdown;\n};"],"names":["processGuidelinesMarkdown","guidelinesData","targetHighlights","labelColor","combinedMarkdown","learnings_data","Object","keys","length","firstLearningKey","firstLearning","instruction_prompt","data","artifactData","userStorySnapshot","forEach","story","title","value","sub_features","sub","targetText","index","escapedText","replace","regex","RegExp"],"mappings":"AAAO,MAAMA,EAA4B,EACvCC,iBACAC,mBAAmB,GACnBC,aAAa,cAMb,IAAIC,EAAmB,GAGnB,GAAAH,GAAgBI,gBAAkBC,OAAOC,KAAKN,EAAeI,gBAAgBG,OAAS,EAAG,CAC3F,MAAMC,EAAmBH,OAAOC,KAAKN,EAAeI,gBAAgB,GAC9DK,EAAgBT,EAAeI,eAAeI,GAEhDC,GAAeC,qBACjBP,EAAmBM,EAAcC,mBACnC,KAGG,EACeV,GAAgBW,MAAMC,cAAcC,mBAAqB,IACjEC,QAASC,IACbA,EAAMC,QAA2Bb,GAAA,OAAOY,EAAMC,aAC9CD,EAAME,QAA2Bd,GAAA,GAAGY,EAAME,aAExCF,EAAAG,cAAcJ,QAASK,IACvBA,EAAIH,QAA2Bb,GAAA,QAAQgB,EAAIH,aAC3CG,EAAIF,QAA2Bd,GAAA,GAAGgB,EAAIF,gBAGhD,CAgBO,OAdUhB,EAAAa,QAAQ,CAACM,EAAYC,KACpC,MAAMC,EAAcF,EAAWG,QAC7B,yBACA,QAGIC,EAAQ,IAAIC,OAAO,IAAIH,KAAgB,KAE7CnB,EAAmBA,EAAiBoB,QAClCC,EACA,8BAA8BH,+BAAmCnB,qDAI9DC"}
1
+ {"version":3,"file":"processGuidelinesMarkdown.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.ts"],"sourcesContent":["type LearningGuideline = {\n title?: unknown;\n instruction_prompt?: unknown;\n};\n\nexport type GuidelinesData =\n | string\n | {\n learnings_data?: Record<string, LearningGuideline>;\n data?: {\n artifactData?: {\n userStorySnapshot?: unknown[];\n };\n };\n }\n | null\n | undefined;\n\nconst escapeRegExp = (value: string) =>\n value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\nconst normalizeWhitespace = (value: string) =>\n value.trim().replace(/\\s+/g, \" \");\n\nconst buildLearningGuidelinesMarkdown = (\n learningsData: Record<string, LearningGuideline>,\n) => {\n const seen = new Set<string>();\n\n return Object.values(learningsData)\n .map((learning) => {\n const title =\n typeof learning?.title === \"string\" ? learning.title.trim() : \"\";\n const prompt =\n typeof learning?.instruction_prompt === \"string\"\n ? learning.instruction_prompt.trim()\n : \"\";\n\n if (!prompt) return \"\";\n const identity = `${normalizeWhitespace(title)}\\n${normalizeWhitespace(prompt)}`;\n if (seen.has(identity)) return \"\";\n seen.add(identity);\n\n return title ? `# ${title}\\n\\n${prompt}` : prompt;\n })\n .filter(Boolean)\n .join(\"\\n\\n\");\n};\n\nconst buildLegacyGuidelinesMarkdown = (\n guidelinesData: Exclude<GuidelinesData, string>,\n) => {\n const snapshots = guidelinesData?.data?.artifactData?.userStorySnapshot;\n if (!Array.isArray(snapshots)) return \"\";\n\n let markdown = \"\";\n snapshots.forEach((story: any) => {\n if (story?.title) markdown += `### ${story.title}\\n\\n`;\n if (story?.value) markdown += `${story.value}\\n\\n`;\n\n if (Array.isArray(story?.sub_features)) {\n story.sub_features.forEach((sub: any) => {\n if (sub?.title) markdown += `#### ${sub.title}\\n\\n`;\n if (sub?.value) markdown += `${sub.value}\\n\\n`;\n });\n }\n });\n\n return markdown.trim();\n};\n\nconst addGuidelineHighlights = (\n markdown: string,\n targetHighlights: string[],\n labelColor: string,\n) => {\n let result = markdown;\n const seen = new Set<string>();\n let matchedTargetCount = 0;\n\n targetHighlights.forEach((rawTarget) => {\n if (typeof rawTarget !== \"string\") return;\n\n const target = rawTarget.trim();\n const normalizedTarget = normalizeWhitespace(target).toLocaleLowerCase();\n if (!normalizedTarget || seen.has(normalizedTarget)) return;\n seen.add(normalizedTarget);\n\n // Guideline text from evaluation results can differ from the assembled\n // markdown only by wrapping, spacing, or casing. Preserve the source text\n // while matching those equivalent forms.\n const flexibleTarget = target\n .split(/\\s+/)\n .map(escapeRegExp)\n .join(\"\\\\s+\");\n const match = new RegExp(flexibleTarget, \"i\").exec(result);\n console.log(\"LOG: Printing match\", match, target, flexibleTarget, result);\n if (!match) return;\n\n const marked = `<mark id=\"guideline-target-${matchedTargetCount}\" style=\"background-color: ${labelColor}; border-radius: 3px; padding: 2px;\">${match[0]}</mark>`;\n result = `${result.slice(0, match.index)}${marked}${result.slice(\n match.index + match[0].length,\n )}`;\n matchedTargetCount += 1;\n });\n\n return result;\n};\n\nexport const processGuidelinesMarkdown = ({\n guidelinesData,\n targetHighlights = [],\n labelColor = \"#FEF08A\",\n}: {\n guidelinesData: GuidelinesData;\n targetHighlights?: string[];\n labelColor?: string;\n}) => {\n let combinedMarkdown = \"\";\n\n if (typeof guidelinesData === \"string\") {\n combinedMarkdown = guidelinesData;\n } else if (\n guidelinesData?.learnings_data &&\n typeof guidelinesData.learnings_data === \"object\"\n ) {\n combinedMarkdown = buildLearningGuidelinesMarkdown(\n guidelinesData.learnings_data,\n );\n } else {\n combinedMarkdown = buildLegacyGuidelinesMarkdown(guidelinesData);\n }\n\n return addGuidelineHighlights(\n combinedMarkdown,\n Array.isArray(targetHighlights) ? targetHighlights : [],\n labelColor || \"#FEF08A\",\n );\n};\n"],"names":["escapeRegExp","value","replace","normalizeWhitespace","trim","processGuidelinesMarkdown","guidelinesData","targetHighlights","labelColor","combinedMarkdown","learnings_data","learningsData","seen","Set","Object","values","map","learning","title","prompt","instruction_prompt","identity","has","add","filter","Boolean","join","buildLearningGuidelinesMarkdown","snapshots","data","artifactData","userStorySnapshot","Array","isArray","markdown","forEach","story","sub_features","sub","buildLegacyGuidelinesMarkdown","result","matchedTargetCount","rawTarget","target","normalizedTarget","toLocaleLowerCase","flexibleTarget","split","match","RegExp","exec","console","log","marked","slice","index","length","addGuidelineHighlights"],"mappings":"AAkBA,MAAMA,EAAgBC,GACpBA,EAAMC,QAAQ,sBAAuB,QAEjCC,EAAuBF,GAC3BA,EAAMG,OAAOF,QAAQ,OAAQ,KAuFlBG,EAA4B,EACvCC,iBACAC,mBAAmB,GACnBC,aAAa,cAMb,IAAIC,EAAmB,GAehB,OAZcA,EADS,iBAAnBH,EACUA,EAEnBA,GAAgBI,gBACyB,iBAAlCJ,EAAeI,eApGc,CACtCC,IAEM,MAAAC,MAAWC,IAEjB,OAAOC,OAAOC,OAAOJ,GAClBK,IAAKC,IACE,MAAAC,EACuB,iBAApBD,GAAUC,MAAqBD,EAASC,MAAMd,OAAS,GAC1De,EACoC,iBAAjCF,GAAUG,mBACbH,EAASG,mBAAmBhB,OAC5B,GAEF,IAACe,EAAe,MAAA,GACpB,MAAME,EAAW,GAAGlB,EAAoBe,OAAWf,EAAoBgB,KACvE,OAAIP,EAAKU,IAAID,GAAkB,IAC/BT,EAAKW,IAAIF,GAEFH,EAAQ,KAAKA,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DC,GAAc"}
@@ -0,0 +1,2 @@
1
+ import{DEVIATION_BADGE_SEPARATOR as e}from"../../CognitiveComparehelpers.js";const t=({activeIdentifier:t,deviationData:o,proposedSections:i})=>{let r="",n=null;if("number"==typeof t){const e=i[t],o=e?.nodeId||e?.id;r="string"==typeof o?o:""}else if("string"==typeof t){const o=t.split(e);r=o[0]||"",n=o.length>1&&""!==o[1]?o[1]:null}const l=o?.[r]?.evaluation_result;if(!l||"object"!=typeof l)return{baseNodeId:r,evaluationKey:n,evaluationNodes:[],targetHighlights:[],labelColor:""};const a=null==n?void 0:((e,t)=>{if(Array.isArray(e)){const o=Number(t);return Number.isInteger(o)?e[o]:void 0}return e?.[t]})(l,n),s=null==n?Object.values(l):a?[a]:[],u=new Set,g=[];let c="";return s.forEach(e=>{const t=e?.deviation_highlights?.rulebook_guidelines;if(Array.isArray(t)&&(t.forEach(e=>{if("string"!=typeof e||!e.trim())return;const t=e.trim().replace(/\s+/g," ").toLocaleLowerCase();u.has(t)||(u.add(t),g.push(e))}),console.log("LOG: Printing highlights",t,g,u)),!c){const t=e?.evaluation_outputs?.metadata?.label_color;"string"==typeof t&&(c=t)}}),{baseNodeId:r,evaluationKey:n,evaluationNodes:s,targetHighlights:g,labelColor:c}};export{t as resolveGuidelineSelection};
2
+ //# sourceMappingURL=resolveGuidelineSelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveGuidelineSelection.js","sources":["../../../../../src/features/CognitiveCompare/Guidelines/utils/resolveGuidelineSelection.ts"],"sourcesContent":["import { DEVIATION_BADGE_SEPARATOR } from \"../../CognitiveComparehelpers\";\n\ntype ProposedSection = {\n id?: unknown;\n nodeId?: unknown;\n};\n\ntype ResolveGuidelineSelectionArgs = {\n activeIdentifier: unknown;\n deviationData: Record<string, any> | null | undefined;\n proposedSections: ProposedSection[];\n};\n\nexport type GuidelineSelection = {\n baseNodeId: string;\n evaluationKey: string | null;\n evaluationNodes: any[];\n targetHighlights: string[];\n labelColor: string;\n};\n\nconst getEvaluationNode = (evaluationResults: any, evaluationKey: string) => {\n if (Array.isArray(evaluationResults)) {\n const index = Number(evaluationKey);\n return Number.isInteger(index) ? evaluationResults[index] : undefined;\n }\n\n return evaluationResults?.[evaluationKey];\n};\n\nexport const resolveGuidelineSelection = ({\n activeIdentifier,\n deviationData,\n proposedSections,\n}: ResolveGuidelineSelectionArgs): GuidelineSelection => {\n let baseNodeId = \"\";\n let evaluationKey: string | null = null;\n\n if (typeof activeIdentifier === \"number\") {\n const section = proposedSections[activeIdentifier];\n const sectionNodeId = section?.nodeId || section?.id;\n baseNodeId = typeof sectionNodeId === \"string\" ? sectionNodeId : \"\";\n } else if (typeof activeIdentifier === \"string\") {\n const parts = activeIdentifier.split(DEVIATION_BADGE_SEPARATOR);\n baseNodeId = parts[0] || \"\";\n evaluationKey = parts.length > 1 && parts[1] !== \"\" ? parts[1] : null;\n }\n\n const evaluationResults = deviationData?.[baseNodeId]?.evaluation_result;\n if (!evaluationResults || typeof evaluationResults !== \"object\") {\n return {\n baseNodeId,\n evaluationKey,\n evaluationNodes: [],\n targetHighlights: [],\n labelColor: \"\",\n };\n }\n\n const selectedEvaluation = evaluationKey == null\n ? undefined\n : getEvaluationNode(evaluationResults, evaluationKey);\n const evaluationNodes = evaluationKey == null\n ? Object.values(evaluationResults)\n : selectedEvaluation\n ? [selectedEvaluation]\n : [];\n\n const seenHighlights = new Set<string>();\n const targetHighlights: string[] = [];\n let labelColor = \"\";\n\n evaluationNodes.forEach((evaluationNode: any) => {\n const highlights = evaluationNode?.deviation_highlights?.rulebook_guidelines;\n if (Array.isArray(highlights)) {\n highlights.forEach((highlight) => {\n if (typeof highlight !== \"string\" || !highlight.trim()) return;\n const identity = highlight.trim().replace(/\\s+/g, \" \").toLocaleLowerCase();\n if (seenHighlights.has(identity)) return;\n seenHighlights.add(identity);\n targetHighlights.push(highlight);\n });\n console.log(\"LOG: Printing highlights\", highlights, targetHighlights, seenHighlights);\n }\n\n if (!labelColor) {\n const color = evaluationNode?.evaluation_outputs?.metadata?.label_color;\n if (typeof color === \"string\") labelColor = color;\n }\n });\n\n return {\n baseNodeId,\n evaluationKey,\n evaluationNodes,\n targetHighlights,\n labelColor,\n };\n};\n"],"names":["resolveGuidelineSelection","activeIdentifier","deviationData","proposedSections","baseNodeId","evaluationKey","section","sectionNodeId","nodeId","id","parts","split","DEVIATION_BADGE_SEPARATOR","length","evaluationResults","evaluation_result","evaluationNodes","targetHighlights","labelColor","selectedEvaluation","Array","isArray","index","Number","isInteger","getEvaluationNode","Object","values","seenHighlights","Set","forEach","evaluationNode","highlights","deviation_highlights","rulebook_guidelines","highlight","trim","identity","replace","toLocaleLowerCase","has","add","push","console","log","color","evaluation_outputs","metadata","label_color"],"mappings":"6EAqBA,MASaA,EAA4B,EACvCC,mBACAC,gBACAC,uBAEA,IAAIC,EAAa,GACbC,EAA+B,KAE/B,GAA4B,iBAArBJ,EAA+B,CAClC,MAAAK,EAAUH,EAAiBF,GAC3BM,EAAgBD,GAASE,QAAUF,GAASG,GACrCL,EAAyB,iBAAlBG,EAA6BA,EAAgB,EAAA,MACnE,GAAuC,iBAArBN,EAA+B,CACzC,MAAAS,EAAQT,EAAiBU,MAAMC,GACxBR,EAAAM,EAAM,IAAM,GACTL,EAAAK,EAAMG,OAAS,GAAkB,KAAbH,EAAM,GAAYA,EAAM,GAAK,IACnE,CAEM,MAAAI,EAAoBZ,IAAgBE,IAAaW,kBACvD,IAAKD,GAAkD,iBAAtBA,EACxB,MAAA,CACLV,aACAC,gBACAW,gBAAiB,GACjBC,iBAAkB,GAClBC,WAAY,IAIhB,MAAMC,EAAsC,MAAjBd,OAEvB,EAxCoB,EAACS,EAAwBT,KAC7C,GAAAe,MAAMC,QAAQP,GAAoB,CAC9B,MAAAQ,EAAQC,OAAOlB,GACrB,OAAOkB,OAAOC,UAAUF,GAASR,EAAkBQ,QAAS,CAC9D,CAEA,OAAOR,IAAoBT,IAkCvBoB,CAAkBX,EAAmBT,GACnCW,EAAmC,MAAjBX,EACpBqB,OAAOC,OAAOb,GACdK,EACE,CAACA,GACD,GAEAS,MAAqBC,IACrBZ,EAA6B,GACnC,IAAIC,EAAa,GAqBV,OAnBSF,EAAAc,QAASC,IACjB,MAAAC,EAAaD,GAAgBE,sBAAsBC,oBAYzD,GAXId,MAAMC,QAAQW,KACLA,EAAAF,QAASK,IAClB,GAAyB,iBAAdA,IAA2BA,EAAUC,OAAQ,OAClD,MAAAC,EAAWF,EAAUC,OAAOE,QAAQ,OAAQ,KAAKC,oBACnDX,EAAeY,IAAIH,KACvBT,EAAea,IAAIJ,GACnBpB,EAAiByB,KAAKP,MAExBQ,QAAQC,IAAI,2BAA4BZ,EAAYf,EAAkBW,KAGnEV,EAAY,CACT,MAAA2B,EAAQd,GAAgBe,oBAAoBC,UAAUC,YACvC,iBAAVH,IAAiC3B,EAAA2B,EAC9C,IAGK,CACLzC,aACAC,gBACAW,kBACAC,mBACAC"}
@@ -0,0 +1,2 @@
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import i from"react";import{Box as t,Divider as n,Stack as o,Skeleton as a}from"@mui/material";const m=["96%","88%","92%","72%","60%"],l=({index:i,lineCount:n})=>e(t,{children:[r(o,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:r(a,{variant:"text",width:50+13*i%30+"%",height:22,sx:{borderRadius:1}})}),r(o,{spacing:.75,children:Array.from({length:n}).map((e,t)=>r(a,{variant:"text",width:m[(i+t)%m.length],height:16,sx:{borderRadius:.5}},t))})]}),d=({sectionCount:o=3})=>r(t,{sx:{p:2,display:"flex",flexDirection:"column",gap:2},children:Array.from({length:o}).map((t,a)=>e(i.Fragment,{children:[r(l,{index:a,lineCount:3+a%3}),a<o-1&&r(n,{sx:{my:.5,borderColor:"#EEF0F4"}})]},a))});export{d as GuidelineSkeleton};
2
+ //# sourceMappingURL=GuidelineSkeletonLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidelineSkeletonLoader.js","sources":["../../../../src/features/CognitiveCompare/components/GuidelineSkeletonLoader.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, Skeleton, Divider, Stack } from '@mui/material';\n\ninterface GuidelineSkeletonProps {\n /** Number of guideline blocks to render */\n sectionCount?: number;\n}\n\nconst LINE_WIDTHS = ['96%', '88%', '92%', '72%', '60%'];\n\nconst GuidelineSectionSkeleton: React.FC<{\n index: number;\n lineCount: number;\n}> = ({ index, lineCount }) => (\n <Box>\n {/* Header row: badge chip + title */}\n <Stack direction=\"row\" alignItems=\"center\" spacing={1} sx={{ mb: 1.25 }}>\n {/* <Skeleton\n variant=\"rounded\"\n width={46}\n height={20}\n sx={{ borderRadius: '20px', bgcolor: 'rgba(89, 40, 237, 0.10)' }}\n /> */}\n <Skeleton\n variant=\"text\"\n width={`${50 + ((index * 13) % 30)}%`}\n height={22}\n sx={{ borderRadius: 1 }}\n />\n </Stack>\n\n {/* Body lines */}\n <Stack spacing={0.75}>\n {Array.from({ length: lineCount }).map((_, i) => (\n <Skeleton\n key={i}\n variant=\"text\"\n width={LINE_WIDTHS[(index + i) % LINE_WIDTHS.length]}\n height={16}\n sx={{ borderRadius: 0.5 }}\n />\n ))}\n </Stack>\n </Box>\n);\n\nexport const GuidelineSkeleton: React.FC<GuidelineSkeletonProps> = ({\n sectionCount = 3,\n}) => {\n return (\n <Box sx={{ p: 2, display: 'flex', flexDirection: 'column', gap: 2 }}>\n {Array.from({ length: sectionCount }).map((_, idx) => (\n <React.Fragment key={idx}>\n <GuidelineSectionSkeleton\n index={idx}\n lineCount={3 + (idx % 3)}\n />\n {idx < sectionCount - 1 && (\n <Divider sx={{ my: 0.5, borderColor: '#EEF0F4' }} />\n )}\n </React.Fragment>\n ))}\n </Box>\n );\n};"],"names":["LINE_WIDTHS","GuidelineSectionSkeleton","index","lineCount","Box","children","jsx","Stack","direction","alignItems","spacing","sx","mb","Skeleton","variant","width","height","borderRadius","from","length","map","_","i","GuidelineSkeleton","sectionCount","p","display","flexDirection","gap","Array","idx","jsxs","React","Fragment","Divider","my","borderColor"],"mappings":"iJAQA,MAAMA,EAAc,CAAC,MAAO,MAAO,MAAO,MAAO,OAE3CC,EAGD,EAAGC,QAAOC,iBACZC,EAEC,CAAAC,SAAA,CAACC,EAAAC,EAAA,CAAMC,UAAU,MAAMC,WAAW,SAASC,QAAS,EAAGC,GAAI,CAAEC,GAAI,MAO/DP,SAAAC,EAACO,EAAA,CACCC,QAAQ,OACRC,MAAU,GAAe,GAARb,EAAc,GAAxB,IACPc,OAAQ,GACRL,GAAI,CAAEM,aAAc,OAKvBX,EAAAC,EAAA,CAAMG,QAAS,IACbL,eAAMa,KAAK,CAAEC,OAAQhB,IAAaiB,IAAI,CAACC,EAAGC,IACzChB,EAACO,EAAA,CAECC,QAAQ,OACRC,MAAOf,GAAaE,EAAQoB,GAAKtB,EAAYmB,QAC7CH,OAAQ,GACRL,GAAI,CAAEM,aAAc,KAJfK,SAWFC,EAAsD,EACjEC,eAAe,KAGblB,EAACF,EAAI,CAAAO,GAAI,CAAEc,EAAG,EAAGC,QAAS,OAAQC,cAAe,SAAUC,IAAK,GAC7DvB,SAAMwB,MAAAX,KAAK,CAAEC,OAAQK,IAAgBJ,IAAI,CAACC,EAAGS,IAC5CC,EAACC,EAAMC,SAAN,CACC5B,SAAA,CAAAC,EAACL,EAAA,CACCC,MAAO4B,EACP3B,UAAW,EAAK2B,EAAM,IAEvBA,EAAMN,EAAe,GACnBlB,EAAA4B,EAAA,CAAQvB,GAAI,CAAEwB,GAAI,GAAKC,YAAa,eANpBN"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import i from"react";import{Box as t}from"@mui/material";import{EllipsisVertical as n}from"lucide-react";import r from"./SectionAccordion.js";import l from"./ThreeDotsLoader.js";import{extractDeviationScore as a}from"../CognitiveComparehelpers.js";import{useCompareContext as d}from"../CompareContext.js";const s=i.memo(({section:i,idx:s})=>{const{maintainRelativeOrder:c,existingSections:p,proposedSections:u,connectedSections:g,expandedSections:m,displayConfig:x,treeData:f,deviationNumberRegistry:h,getSectionCompareStyle:S,getBadgeRef:b,getSectionRowRef:v,sectionLeftRefs:R,lhsBadgeRefs:y,openMoreFunctionsPopup:w,handleOpenSummaryPopup:B,handleCloseSummaryPopup:C,toggleSection:I,showDeviationBadges:N=!1,renderSubSectionAccordion:$,isProposingFix:k,proposingFixNodeId:P,isRedlineFlow:D,isSideBySide:T,activeSideBySideSection:A,scrollSyncLocked:L,toggleScrollSyncLocked:j,summaryPopupAnchorEl:z,deviationNodeIdToView:F,deviationTargetParentId:O,showDeviationNavigation:W,showOpenNodeRef:E,resolvedMarkdownStyles:M,unifiedNumbering:_}=d(),K=!i.title&&!i.content;if(c&&K)return null;const V=i,X=S(s,"left"),Y=c?!V.refIndexes?.length||V.selfIndex<0:!p[s],q=g.has(s);y.current[s];const G=a(V.evaluationResult,X?.deviationLabel),H=_.leftNums.get(V.id);return e(t,{ref:v(s),sx:{mb:1,width:"100%"},children:e(t,{ref:R.current[s],sx:{width:"100%",display:"flex",flexDirection:"column",minWidth:0,...q&&{borderRadius:"6px",outline:`2px solid ${X?.badgeBorder||"#6366F1"}`,outlineOffset:"1px"}},children:o(t,{sx:{position:"relative",width:"100%"},children:[e(r,{section:i,idx:s,columnKey:"left",colRef:v(`left-accordion-${s}`),mb:0,parentNodeId:f?.input_index_map?.[0]||"",isExpanded:c?!!m[`left-${s}`]:!!m[String(s)],onToggle:()=>{C(),I(s,"left")},navigation:i.id?W[i.id]:null}),c&&X&&o(t,{ref:y.current[s],onClick:e=>{const o=x.enableDeviationSchemaBackwardCompatibility?V.evaluationResult??null:V.evaluationResult?.[0]??null;B(e,String(s),Y,o)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:X.badgeBg,color:X.badgeText,border:`1px solid ${X.badgeBorder}`,borderRadius:"12px",px:1.2,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"},children:[o(t,{component:"span",onClick:e=>{e.stopPropagation();const o=x.enableDeviationSchemaBackwardCompatibility?V.evaluationResult??null:V.evaluationResult?.[0]??null;B(e,String(s),Y,o)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:Y?"default":"pointer",borderRight:`1px solid ${X.badgeBorder}`,"&:hover":Y?{}:{bgColor:`${X.badgeBorder}22`}},children:[null!=H&&e(t,{component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:`1px solid ${X.badgeBorder}`},children:H}),e(t,{component:"span",sx:{fontSize:"11px",px:.25},children:!x.isLoading||null!=V.evaluationResult&&void 0!==V.evaluationResult?"N/A"===G||"NA"===G?"N/A":0==G||null==G?"Same":`${G}`:e(l,{color:X.badgeText})})]}),e(t,{component:"span",onClick:e=>{e.stopPropagation();const o=c?p.find(e=>V.refIndexes?.includes(e.selfIndex))||{title:"",content:""}:p[s]||{title:"",content:""};w(e,i,Y,o,s,X)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:`${X.badgeBorder}22`}},children:e(n,{size:11,color:X.badgeText})})]})]})})},`left-row-${s}`)});export{s as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import i from"react";import{Box as n,Tooltip as t}from"@mui/material";import{EllipsisVertical as r}from"lucide-react";import a from"./SectionAccordion.js";import l from"./ThreeDotsLoader.js";import{extractDeviationScore as d}from"../CognitiveComparehelpers.js";import{useCompareContext as s}from"../CompareContext.js";const p=i.memo(({section:i,idx:p})=>{const{maintainRelativeOrder:c,existingSections:g,proposedSections:u,connectedSections:m,expandedSections:x,displayConfig:f,deviationAnalysisStatus:h,treeData:S,deviationNumberRegistry:b,getSectionCompareStyle:v,getBadgeRef:y,getSectionRowRef:R,sectionLeftRefs:w,lhsBadgeRefs:B,openMoreFunctionsPopup:C,handleOpenSummaryPopup:I,handleCloseSummaryPopup:N,toggleSection:$,showDeviationBadges:k=!1,renderSubSectionAccordion:D,isProposingFix:P,proposingFixNodeId:A,isRedlineFlow:T,isSideBySide:j,activeSideBySideSection:z,scrollSyncLocked:F,toggleScrollSyncLocked:L,summaryPopupAnchorEl:O,deviationNodeIdToView:_,deviationTargetParentId:W,showDeviationNavigation:E,showOpenNodeRef:M,resolvedMarkdownStyles:K,unifiedNumbering:V}=s(),X=!i.title&&!i.content;if(c&&X)return null;const Y=i,q=v(p,"left"),G=c?!Y.refIndexes?.length||Y.selfIndex<0:!g[p],H=m.has(p);B.current[p];const J=d(Y.evaluationResult,q?.deviationLabel),Q=V.leftNums.get(Y.id),U=("mapping_ready"===h||"deviations_streaming"===h)&&(null==Y.evaluationResult||void 0===Y.evaluationResult);return e(n,{ref:R(p),sx:{mb:1,width:"100%"},children:e(n,{ref:w.current[p],sx:{width:"100%",display:"flex",flexDirection:"column",minWidth:0,...H&&{borderRadius:"6px",outline:`2px solid ${q?.badgeBorder||"#6366F1"}`,outlineOffset:"1px"}},children:o(n,{sx:{position:"relative",width:"100%"},children:[e(a,{section:i,idx:p,columnKey:"left",colRef:R(`left-accordion-${p}`),mb:0,parentNodeId:S?.input_index_map?.[0]||"",isExpanded:c?!!x[`left-${p}`]:!!x[String(p)],onToggle:()=>{N(),$(p,"left")},navigation:i.id?E[i.id]:null}),c&&q&&o(n,{ref:B.current[p],onClick:e=>{const o=f.enableDeviationSchemaBackwardCompatibility?Y.evaluationResult??null:Y.evaluationResult?.[0]??null;I(e,String(p),G,o)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:q.badgeBg,color:q.badgeText,border:`1px solid ${q.badgeBorder}`,borderRadius:"12px",px:1.2,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"},children:[o(n,{component:"span",onClick:e=>{e.stopPropagation();const o=f.enableDeviationSchemaBackwardCompatibility?Y.evaluationResult??null:Y.evaluationResult?.[0]??null;I(e,String(p),G,o)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:G?"default":"pointer",borderRight:`1px solid ${q.badgeBorder}`,"&:hover":G?{}:{bgColor:`${q.badgeBorder}22`}},children:[null!=Q&&e(n,{component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:`1px solid ${q.badgeBorder}`},children:Q}),e(n,{component:"span",sx:{fontSize:"11px",px:.25},children:U?e(t,{title:"Deviation data generation in progress",placement:"top",arrow:!0,children:e(n,{component:"span",sx:{display:"inline-flex",alignItems:"center"},children:e(l,{color:q.badgeText})})}):"N/A"===J||"NA"===J?"N/A":0==J||null==J?"Same":`${J}`})]}),e(n,{component:"span",onClick:e=>{e.stopPropagation();const o=c?g.find(e=>Y.refIndexes?.includes(e.selfIndex))||{title:"",content:""}:g[p]||{title:"",content:""};C(e,i,G,o,p,q)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:`${q.badgeBorder}22`}},children:e(r,{size:11,color:q.badgeText})})]})]})})},`left-row-${p}`)});export{p as default};
2
2
  //# sourceMappingURL=LHSSectionRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LHSSectionRow.js","sources":["../../../../src/features/CognitiveCompare/components/LHSSectionRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box } from \"@mui/material\";\nimport { EllipsisVertical } from \"lucide-react\";\n\nimport SectionAccordion from \"./SectionAccordion\";\nimport ThreeDotsLoader from \"./ThreeDotsLoader\";\nimport ScrollLockToggle from \"./ScrollLockToggle\";\nimport { extractDeviationScore } from \"../CognitiveComparehelpers\";\nimport { SectionBlock, StyleVariant } from \"../CognitiveCompareTypes\";\nimport { useCompareContext } from \"../CompareContext\";\n\ntype UnifiedNumbering = {\n leftNums: Map<string, number>;\n rightNums: Map<string, string>;\n};\n\ntype LHSSectionRowProps = {\n section: SectionBlock;\n idx: number;\n};\n\nconst LHSSectionRow = React.memo(\n ({\n section,\n idx,\n }: LHSSectionRowProps) => {\n const {\n maintainRelativeOrder,\n existingSections,\n proposedSections,\n connectedSections,\n expandedSections,\n displayConfig,\n treeData,\n deviationNumberRegistry,\n getSectionCompareStyle,\n getBadgeRef,\n getSectionRowRef,\n sectionLeftRefs,\n lhsBadgeRefs,\n openMoreFunctionsPopup,\n handleOpenSummaryPopup,\n handleCloseSummaryPopup,\n toggleSection,\n showDeviationBadges = false,\n renderSubSectionAccordion,\n isProposingFix,\n proposingFixNodeId,\n isRedlineFlow,\n isSideBySide,\n activeSideBySideSection,\n scrollSyncLocked,\n toggleScrollSyncLocked,\n summaryPopupAnchorEl,\n deviationNodeIdToView,\n deviationTargetParentId,\n showDeviationNavigation,\n showOpenNodeRef,\n resolvedMarkdownStyles,\n unifiedNumbering,\n } = useCompareContext();\n const isEmpty = !section.title && !section.content;\n if (maintainRelativeOrder && isEmpty) return null;\n\n const sec = section as any;\n const style = getSectionCompareStyle(idx, \"left\");\n const isOrphan = maintainRelativeOrder\n ? (!sec.refIndexes?.length || sec.selfIndex < 0)\n : !existingSections[idx];\n const isConnected = connectedSections.has(idx);\n const badgeEl = lhsBadgeRefs.current[idx]?.current;\n const showScrollLockToggle =\n isConnected ||\n (isSideBySide && activeSideBySideSection === idx) ||\n (!!summaryPopupAnchorEl && summaryPopupAnchorEl === badgeEl);\n const rawScore = extractDeviationScore(sec.evaluationResult, (style as any)?.deviationLabel);\n const displayNum = unifiedNumbering.leftNums.get(sec.id);\n\n return (\n <Box key={`left-row-${idx}`} ref={getSectionRowRef(idx)} sx={{ mb: 1, width: \"100%\" }}>\n <Box\n ref={sectionLeftRefs.current[idx]}\n sx={{\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n minWidth: 0,\n ...(isConnected && {\n borderRadius: \"6px\",\n outline: `2px solid ${style?.badgeBorder || \"#6366F1\"}`,\n outlineOffset: \"1px\",\n }),\n }}\n >\n <Box sx={{ position: \"relative\", width: \"100%\" }}>\n <SectionAccordion\n section={section}\n idx={idx}\n columnKey=\"left\"\n colRef={getSectionRowRef(`left-accordion-${idx}`)}\n mb={0}\n parentNodeId={treeData?.input_index_map?.[\"0\"] || \"\"}\n isExpanded={\n maintainRelativeOrder\n ? !!expandedSections[`left-${idx}`]\n : !!expandedSections[String(idx)]\n }\n onToggle={() => {\n handleCloseSummaryPopup();\n toggleSection(idx, \"left\");\n }}\n navigation={section.id ? showDeviationNavigation[section.id] : null}\n />\n\n {maintainRelativeOrder && style && (\n <Box\n ref={lhsBadgeRefs.current[idx]}\n onClick={(e) => {\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphan, evaluationResult);\n }}\n sx={{\n position: \"absolute\",\n top: \"18px\",\n right: 0,\n transform: \"translateY(-50%) translateX(calc(100% + 8px))\",\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n fontSize: \"11px\",\n bgcolor: style.badgeBg,\n color: style.badgeText,\n border: `1px solid ${style.badgeBorder}`,\n borderRadius: \"12px\",\n px: 1.2,\n py: 0.3,\n fontWeight: 600,\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n zIndex: 20,\n boxShadow: \"0 1px 3px rgba(0,0,0,0.07)\",\n }}\n >\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphan, evaluationResult);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n px: 0.2,\n cursor: isOrphan ? \"default\" : \"pointer\",\n borderRight: `1px solid ${style.badgeBorder}`,\n \"&:hover\": !isOrphan ? { bgColor: `${style.badgeBorder}22` } : {},\n }}\n >\n {displayNum != null && (\n <Box\n component=\"span\"\n sx={{\n fontSize: \"11px\",\n fontWeight: 700,\n pr: 0.5,\n borderRight: `1px solid ${style.badgeBorder}`,\n }}\n >\n {displayNum}\n </Box>\n )}\n\n <Box component=\"span\" sx={{ fontSize: \"11px\", px: 0.25 }}>\n {displayConfig.isLoading && (sec.evaluationResult == null || sec.evaluationResult === undefined)\n ? <ThreeDotsLoader color={style.badgeText} />\n : (rawScore === \"N/A\" || rawScore === \"NA\")\n ? \"N/A\"\n : (rawScore == 0 || rawScore == null)\n ? \"Same\"\n : `${rawScore}`}\n </Box>\n </Box>\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const refSec = maintainRelativeOrder\n ? (existingSections.find((s: any) => sec.refIndexes?.includes(s.selfIndex)) || { title: \"\", content: \"\" }) as SectionBlock\n : (existingSections[idx] || { title: \"\", content: \"\" }) as SectionBlock;\n\n openMoreFunctionsPopup(e, section, isOrphan, refSec, idx, style);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n px: 0.2,\n cursor: \"pointer\",\n \"&:hover\": { bgcolor: `${style.badgeBorder}22` },\n }}\n >\n <EllipsisVertical size={11} color={style.badgeText} />\n </Box>\n {/* {showScrollLockToggle && (\n <ScrollLockToggle\n locked={scrollSyncLocked}\n onToggle={toggleScrollSyncLocked}\n color={style.badgeText}\n borderColor={style.badgeBorder}\n size={11}\n />\n )} */}\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n );\n },\n);\n\nexport default LHSSectionRow;\n"],"names":["LHSSectionRow","React","memo","section","idx","maintainRelativeOrder","existingSections","proposedSections","connectedSections","expandedSections","displayConfig","treeData","deviationNumberRegistry","getSectionCompareStyle","getBadgeRef","getSectionRowRef","sectionLeftRefs","lhsBadgeRefs","openMoreFunctionsPopup","handleOpenSummaryPopup","handleCloseSummaryPopup","toggleSection","showDeviationBadges","renderSubSectionAccordion","isProposingFix","proposingFixNodeId","isRedlineFlow","isSideBySide","activeSideBySideSection","scrollSyncLocked","toggleScrollSyncLocked","summaryPopupAnchorEl","deviationNodeIdToView","deviationTargetParentId","showDeviationNavigation","showOpenNodeRef","resolvedMarkdownStyles","unifiedNumbering","useCompareContext","isEmpty","title","content","sec","style","isOrphan","refIndexes","length","selfIndex","isConnected","has","current","rawScore","extractDeviationScore","evaluationResult","deviationLabel","displayNum","leftNums","get","id","jsx","Box","ref","sx","mb","width","children","display","flexDirection","minWidth","borderRadius","outline","badgeBorder","outlineOffset","jsxs","position","SectionAccordion","columnKey","colRef","parentNodeId","input_index_map","isExpanded","String","onToggle","navigation","onClick","e","enableDeviationSchemaBackwardCompatibility","top","right","transform","alignItems","gap","fontSize","bgcolor","badgeBg","color","badgeText","border","px","py","fontWeight","cursor","whiteSpace","zIndex","boxShadow","component","stopPropagation","borderRight","bgColor","pr","isLoading","ThreeDotsLoader","refSec","find","s","includes","EllipsisVertical","size"],"mappings":"mWAqBA,MAAMA,EAAgBC,EAAMC,KAC1B,EACEC,UACAC,UAEM,MAAAC,sBACJA,EAAAC,iBACAA,EAAAC,iBACAA,EAAAC,kBACAA,EAAAC,iBACAA,EAAAC,cACAA,EAAAC,SACAA,EAAAC,wBACAA,EAAAC,uBACAA,EAAAC,YACAA,EAAAC,iBACAA,EAAAC,gBACAA,EAAAC,aACAA,EAAAC,uBACAA,EAAAC,uBACAA,EAAAC,wBACAA,EAAAC,cACAA,EAAAC,oBACAA,GAAsB,EAAAC,0BACtBA,EAAAC,eACAA,EAAAC,mBACAA,EAAAC,cACAA,EAAAC,aACAA,EAAAC,wBACAA,EAAAC,iBACAA,EAAAC,uBACAA,EAAAC,qBACAA,EAAAC,sBACAA,EAAAC,wBACAA,EAAAC,wBACAA,EAAAC,gBACAA,EAAAC,uBACAA,EAAAC,iBACAA,GACEC,IACEC,GAAWpC,EAAQqC,QAAUrC,EAAQsC,QACvC,GAAApC,GAAyBkC,EAAgB,OAAA,KAE7C,MAAMG,EAAMvC,EACNwC,EAAQ9B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EoC,MAAO,GAAIC,QAAS,IAEpDvB,EAAuBmE,EAAGlF,EAASyC,EAAUoE,EAAQ5G,EAAKuC,IAE5DmB,GAAI,CACFI,QAAS,cACTwB,WAAY,SACZQ,GAAI,GACJG,OAAQ,UACR,UAAW,CAAER,QAAS,GAAGlD,EAAM4B,kBAGjCN,WAACmD,EAAiB,CAAAC,KAAM,GAAItB,MAAOpD,EAAMqD,uBA/HzC,YAAY5F"}
1
+ {"version":3,"file":"LHSSectionRow.js","sources":["../../../../src/features/CognitiveCompare/components/LHSSectionRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box, Tooltip } from \"@mui/material\";\nimport { EllipsisVertical } from \"lucide-react\";\n\nimport SectionAccordion from \"./SectionAccordion\";\nimport ThreeDotsLoader from \"./ThreeDotsLoader\";\nimport ScrollLockToggle from \"./ScrollLockToggle\";\nimport { extractDeviationScore } from \"../CognitiveComparehelpers\";\nimport { SectionBlock, StyleVariant } from \"../CognitiveCompareTypes\";\nimport { useCompareContext } from \"../CompareContext\";\n\ntype UnifiedNumbering = {\n leftNums: Map<string, number>;\n rightNums: Map<string, string>;\n};\n\ntype LHSSectionRowProps = {\n section: SectionBlock;\n idx: number;\n};\n\nconst LHSSectionRow = React.memo(\n ({\n section,\n idx,\n }: LHSSectionRowProps) => {\n const {\n maintainRelativeOrder,\n existingSections,\n proposedSections,\n connectedSections,\n expandedSections,\n displayConfig,\n deviationAnalysisStatus,\n treeData,\n deviationNumberRegistry,\n getSectionCompareStyle,\n getBadgeRef,\n getSectionRowRef,\n sectionLeftRefs,\n lhsBadgeRefs,\n openMoreFunctionsPopup,\n handleOpenSummaryPopup,\n handleCloseSummaryPopup,\n toggleSection,\n showDeviationBadges = false,\n renderSubSectionAccordion,\n isProposingFix,\n proposingFixNodeId,\n isRedlineFlow,\n isSideBySide,\n activeSideBySideSection,\n scrollSyncLocked,\n toggleScrollSyncLocked,\n summaryPopupAnchorEl,\n deviationNodeIdToView,\n deviationTargetParentId,\n showDeviationNavigation,\n showOpenNodeRef,\n resolvedMarkdownStyles,\n unifiedNumbering,\n } = useCompareContext();\n const isEmpty = !section.title && !section.content;\n if (maintainRelativeOrder && isEmpty) return null;\n\n const sec = section as any;\n const style = getSectionCompareStyle(idx, \"left\");\n const isOrphan = maintainRelativeOrder\n ? (!sec.refIndexes?.length || sec.selfIndex < 0)\n : !existingSections[idx];\n const isConnected = connectedSections.has(idx);\n const badgeEl = lhsBadgeRefs.current[idx]?.current;\n const showScrollLockToggle =\n isConnected ||\n (isSideBySide && activeSideBySideSection === idx) ||\n (!!summaryPopupAnchorEl && summaryPopupAnchorEl === badgeEl);\n const rawScore = extractDeviationScore(sec.evaluationResult, (style as any)?.deviationLabel);\n const displayNum = unifiedNumbering.leftNums.get(sec.id);\n const isDeviationGenerationInProgress =\n deviationAnalysisStatus === \"mapping_ready\" ||\n deviationAnalysisStatus === \"deviations_streaming\";\n const shouldShowDeviationLoader =\n isDeviationGenerationInProgress &&\n (sec.evaluationResult == null || sec.evaluationResult === undefined);\n\n return (\n <Box key={`left-row-${idx}`} ref={getSectionRowRef(idx)} sx={{ mb: 1, width: \"100%\" }}>\n <Box\n ref={sectionLeftRefs.current[idx]}\n sx={{\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n minWidth: 0,\n ...(isConnected && {\n borderRadius: \"6px\",\n outline: `2px solid ${style?.badgeBorder || \"#6366F1\"}`,\n outlineOffset: \"1px\",\n }),\n }}\n >\n <Box sx={{ position: \"relative\", width: \"100%\" }}>\n <SectionAccordion\n section={section}\n idx={idx}\n columnKey=\"left\"\n colRef={getSectionRowRef(`left-accordion-${idx}`)}\n mb={0}\n parentNodeId={treeData?.input_index_map?.[\"0\"] || \"\"}\n isExpanded={\n maintainRelativeOrder\n ? !!expandedSections[`left-${idx}`]\n : !!expandedSections[String(idx)]\n }\n onToggle={() => {\n handleCloseSummaryPopup();\n toggleSection(idx, \"left\");\n }}\n navigation={section.id ? showDeviationNavigation[section.id] : null}\n />\n\n {maintainRelativeOrder && style && (\n <Box\n ref={lhsBadgeRefs.current[idx]}\n onClick={(e) => {\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphan, evaluationResult);\n }}\n sx={{\n position: \"absolute\",\n top: \"18px\",\n right: 0,\n transform: \"translateY(-50%) translateX(calc(100% + 8px))\",\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n fontSize: \"11px\",\n bgcolor: style.badgeBg,\n color: style.badgeText,\n border: `1px solid ${style.badgeBorder}`,\n borderRadius: \"12px\",\n px: 1.2,\n py: 0.3,\n fontWeight: 600,\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n zIndex: 20,\n boxShadow: \"0 1px 3px rgba(0,0,0,0.07)\",\n }}\n >\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphan, evaluationResult);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n px: 0.2,\n cursor: isOrphan ? \"default\" : \"pointer\",\n borderRight: `1px solid ${style.badgeBorder}`,\n \"&:hover\": !isOrphan ? { bgColor: `${style.badgeBorder}22` } : {},\n }}\n >\n {displayNum != null && (\n <Box\n component=\"span\"\n sx={{\n fontSize: \"11px\",\n fontWeight: 700,\n pr: 0.5,\n borderRight: `1px solid ${style.badgeBorder}`,\n }}\n >\n {displayNum}\n </Box>\n )}\n\n <Box component=\"span\" sx={{ fontSize: \"11px\", px: 0.25 }}>\n {shouldShowDeviationLoader\n ? (\n <Tooltip title=\"Deviation data generation in progress\" placement=\"top\" arrow>\n <Box component=\"span\" sx={{ display: \"inline-flex\", alignItems: \"center\" }}>\n <ThreeDotsLoader color={style.badgeText} />\n </Box>\n </Tooltip>\n )\n : (rawScore === \"N/A\" || rawScore === \"NA\")\n ? \"N/A\"\n : (rawScore == 0 || rawScore == null)\n ? \"Same\"\n : `${rawScore}`}\n </Box>\n </Box>\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const refSec = maintainRelativeOrder\n ? (existingSections.find((s: any) => sec.refIndexes?.includes(s.selfIndex)) || { title: \"\", content: \"\" }) as SectionBlock\n : (existingSections[idx] || { title: \"\", content: \"\" }) as SectionBlock;\n\n openMoreFunctionsPopup(e, section, isOrphan, refSec, idx, style);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n px: 0.2,\n cursor: \"pointer\",\n \"&:hover\": { bgcolor: `${style.badgeBorder}22` },\n }}\n >\n <EllipsisVertical size={11} color={style.badgeText} />\n </Box>\n {/* {showScrollLockToggle && (\n <ScrollLockToggle\n locked={scrollSyncLocked}\n onToggle={toggleScrollSyncLocked}\n color={style.badgeText}\n borderColor={style.badgeBorder}\n size={11}\n />\n )} */}\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n );\n },\n);\n\nexport default LHSSectionRow;\n"],"names":["LHSSectionRow","React","memo","section","idx","maintainRelativeOrder","existingSections","proposedSections","connectedSections","expandedSections","displayConfig","deviationAnalysisStatus","treeData","deviationNumberRegistry","getSectionCompareStyle","getBadgeRef","getSectionRowRef","sectionLeftRefs","lhsBadgeRefs","openMoreFunctionsPopup","handleOpenSummaryPopup","handleCloseSummaryPopup","toggleSection","showDeviationBadges","renderSubSectionAccordion","isProposingFix","proposingFixNodeId","isRedlineFlow","isSideBySide","activeSideBySideSection","scrollSyncLocked","toggleScrollSyncLocked","summaryPopupAnchorEl","deviationNodeIdToView","deviationTargetParentId","showDeviationNavigation","showOpenNodeRef","resolvedMarkdownStyles","unifiedNumbering","useCompareContext","isEmpty","title","content","sec","style","isOrphan","refIndexes","length","selfIndex","isConnected","has","current","rawScore","extractDeviationScore","evaluationResult","deviationLabel","displayNum","leftNums","get","id","shouldShowDeviationLoader","jsx","Box","ref","sx","mb","width","children","display","flexDirection","minWidth","borderRadius","outline","badgeBorder","outlineOffset","jsxs","position","SectionAccordion","columnKey","colRef","parentNodeId","input_index_map","isExpanded","String","onToggle","navigation","onClick","e","enableDeviationSchemaBackwardCompatibility","top","right","transform","alignItems","gap","fontSize","bgcolor","badgeBg","color","badgeText","border","px","py","fontWeight","cursor","whiteSpace","zIndex","boxShadow","component","stopPropagation","borderRight","bgColor","pr","Tooltip","placement","arrow","ThreeDotsLoader","refSec","find","s","includes","EllipsisVertical","size"],"mappings":"gXAqBA,MAAMA,EAAgBC,EAAMC,KAC1B,EACEC,UACAC,UAEM,MAAAC,sBACJA,EAAAC,iBACAA,EAAAC,iBACAA,EAAAC,kBACAA,EAAAC,iBACAA,EAAAC,cACAA,EAAAC,wBACAA,EAAAC,SACAA,EAAAC,wBACAA,EAAAC,uBACAA,EAAAC,YACAA,EAAAC,iBACAA,EAAAC,gBACAA,EAAAC,aACAA,EAAAC,uBACAA,EAAAC,uBACAA,EAAAC,wBACAA,EAAAC,cACAA,EAAAC,oBACAA,GAAsB,EAAAC,0BACtBA,EAAAC,eACAA,EAAAC,mBACAA,EAAAC,cACAA,EAAAC,aACAA,EAAAC,wBACAA,EAAAC,iBACAA,EAAAC,uBACAA,EAAAC,qBACAA,EAAAC,sBACAA,EAAAC,wBACAA,EAAAC,wBACAA,EAAAC,gBACAA,EAAAC,uBACAA,EAAAC,iBACAA,GACEC,IACEC,GAAWrC,EAAQsC,QAAUtC,EAAQuC,QACvC,GAAArC,GAAyBmC,EAAgB,OAAA,KAE7C,MAAMG,EAAMxC,EACNyC,EAAQ9B,EAAuBV,EAAK,QACpCyC,EAAWxC,GACXsC,EAAIG,YAAYC,QAAUJ,EAAIK,UAAY,GAC3C1C,EAAiBF,GAChB6C,EAAczC,EAAkB0C,IAAI9C,GAC1Bc,EAAaiC,QAAQ/C,GAKrC,MAAMgD,EAAWC,EAAsBV,EAAIW,iBA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MAAO,GAAIC,QAAS,IAEpDvB,EAAuBoE,EAAGpF,EAAS0C,EAAUuE,EAAQhH,EAAKwC,IAE5DoB,GAAI,CACFI,QAAS,cACTwB,WAAY,SACZQ,GAAI,GACJG,OAAQ,UACR,UAAW,CAAER,QAAS,GAAGnD,EAAM6B,kBAGjCN,WAACqD,EAAiB,CAAAC,KAAM,GAAIxB,MAAOrD,EAAMsD,uBArIzC,YAAY9F"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i from"react";import{Box as o,Tooltip as r,Typography as l}from"@mui/material";import{EllipsisVertical as d}from"lucide-react";import s from"./SectionAccordion.js";import a from"./ThreeDotsLoader.js";import c from"./ScrollLockToggle.js";import{getRhsMappedSectionNumber as p,getAlphabeticSuffix as g}from"../CognitiveComparehelpers.js";import{useCompareContext as u}from"../CompareContext.js";const x=i.memo(({section:x,idx:f})=>{const{maintainRelativeOrder:m,existingSections:h,proposedSections:S,connectedSections:b,expandedSections:I,displayConfig:v,treeData:y,deviationNumberRegistry:R,getSectionCompareStyle:w,getBadgeRef:B,getSectionRowRef:$,sectionRightRefs:C,rhsBadgeRefs:N,openMoreFunctionsPopup:k,handleOpenSummaryPopup:T,handleCloseSummaryPopup:j,toggleSection:z,showDeviationBadges:D=!1,renderSubSectionAccordion:P,isProposingFix:M,proposingFixNodeId:L,isRedlineFlow:A,isSideBySide:F,activeSideBySideSection:O,scrollSyncLocked:U,toggleScrollSyncLocked:W,deviationNodeIdToView:_,deviationTargetParentId:E,showDeviationNavigation:H,showOpenNodeRef:K,resolvedMarkdownStyles:V,unifiedNumbering:X}=u(),Y=x;let q=!1,G=null,J=-1;const Q=(e,n)=>String(e??"")===String(n);let Z=-1;m?(Z=S.findIndex(e=>e.refIndexes?.includes(Y.selfIndex)&&e.selfIndex>=0),J=S.findIndex((e,n)=>(e=>b.has(e)||b.has(String(e))||null!=O&&!String(O).includes("::")&&Q(O,e))(n)&&e.refIndexes?.includes(Y.selfIndex)),q=-1!==J,q&&(G=w(J,"left"))):(q=b.has(f)||b.has(String(f))||Q(O,f),q&&(G=w(f,"right")));const ee=m&&-1!==Z?w(Z,"left"):w(f,"right"),ne=G||ee,te=m?-1!==Z||!Y.refIndexes?.length&&S.some(e=>e.id&&e.id===Y.id):Boolean(S[f]),ie=m?Y.selfIndex<0||!te:!S[f],oe=i.useMemo(()=>{const e=X.rightNums.get(Y.id);return m&&Y.id?p({section:Y,proposedSections:S,leftNums:X.leftNums,fallbackNumber:e}):e},[m,S,Y.id,Y.selfIndex,X]),re=i.useMemo(()=>{if(!m||null==Y.selfIndex)return null!=oe?[{label:String(oe),title:Y.title||"Untitled Section",lhsIdx:-1}]:[];const e=S.map((e,n)=>{const t=Array.isArray(e?.refIndexes)?e.refIndexes:[],i=t.findIndex(e=>e===Y.selfIndex);if(-1===i)return null;const o=e?.id?X.leftNums.get(e.id):void 0;if(null==o)return null;return{label:t.length>1?`${o}${g(i)}`:String(o),title:e?.title||"Untitled Section",lhsIdx:n}}).filter(Boolean);return-1===J?e:[...e].sort((e,n)=>e.lhsIdx===J?-1:n.lhsIdx===J?1:0)},[m,S,Y.selfIndex,Y.title,oe,X.leftNums,J]),le=i.useMemo(()=>{const e=re[0]?.label;if(!e)return null!=oe?String(oe):"";const n=re.length-1;return n>0?`${e} + ${n}`:e},[re,oe]),de=i.useMemo(()=>0===re.length?"":re.map(e=>`${e.label}: ${e.title}`).join("\n"),[re]),se=q||F&&(Q(O,f)||-1!==Z&&Q(O,Z));return e(o,{ref:$(f),sx:{mb:1,width:"100%"},children:e(o,{ref:C.current[f],sx:{width:"100%",display:"flex",...q&&G&&{borderRadius:"6px",outline:`2px solid ${G.badgeBorder}`,outlineOffset:"1px"}},children:n(o,{sx:{position:"relative",width:"100%"},children:[e(s,{section:x,idx:f,columnKey:"right",colRef:$(`right-accordion-${f}`),mb:0,parentNodeId:y?.input_index_map?.[1]||"",isExpanded:m?!!I[`right-${f}`]:!!I[String(f)],onToggle:()=>{j(),z(f,"right")},navigation:x.id?H[x.id]:null}),m&&ne&&e(r,{title:de?e(o,{sx:{whiteSpace:"pre-line"},children:e(l,{component:"span",sx:{fontSize:"11px",lineHeight:1.5},children:de})}):"",placement:"top",arrow:!0,children:e(o,{ref:N.current[f],"data-section-id":Y.id,onClick:e=>{if(!ie)return;const n=v.enableDeviationSchemaBackwardCompatibility?Y.evaluationResult??null:Y.evaluationResult?.[0]??null;T(e,String(f),ie,n)},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:ie?"4px":"0px",fontSize:"11px",bgcolor:ne.badgeBg,color:ne.badgeText,border:`1px solid ${ne.badgeBorder}`,borderRadius:ie?"12px":"10px",px:ie?1.2:1,py:.3,fontWeight:ie?600:700,cursor:ie?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:ie?"0 1px 3px rgba(0,0,0,0.07)":"none"},children:ie?n(t,{children:[n(o,{component:"span",onClick:e=>{e.stopPropagation();const n=v.enableDeviationSchemaBackwardCompatibility?Y.evaluationResult??null:Y.evaluationResult?.[0]??null;T(e,String(f),ie,n)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:`1px solid ${ne.badgeBorder}`,"&:hover":{bgcolor:`${ne.badgeBorder}22`}},children:[null!=oe&&e(o,{component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:`1px solid ${ne.badgeBorder}`},children:oe}),e(o,{component:"span",sx:{fontSize:"11px",px:.25},children:!v.isLoading||null!=Y.evaluationResult&&void 0!==Y.evaluationResult?ne.label?`${ne.label}`:"100% Deviation":e(a,{color:ne.badgeText})})]}),n(o,{component:"span",onClick:e=>{e.stopPropagation();const n=m?S.find(e=>e.refIndexes?.includes(Y.selfIndex))||{title:"",content:""}:S[f]||{title:"",content:""};k(e,n,ie,Y,f,ne)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:`${ne.badgeBorder}22`}},children:[e(d,{size:11,color:ne.badgeText}),se&&e(c,{locked:U,onToggle:W,color:ne.badgeText,borderColor:ne.badgeBorder,size:11})]})]}):e(t,{children:e(o,{component:"span",sx:{px:.2},children:le})})})})]})})},`right-row-${f}`)});export{x as default};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i from"react";import{Box as o,Tooltip as r,Typography as l}from"@mui/material";import{EllipsisVertical as d}from"lucide-react";import s from"./SectionAccordion.js";import a from"./ThreeDotsLoader.js";import c from"./ScrollLockToggle.js";import{getRhsMappedSectionNumber as p,getAlphabeticSuffix as g}from"../CognitiveComparehelpers.js";import{useCompareContext as u}from"../CompareContext.js";const x=i.memo(({section:x,idx:f})=>{const{maintainRelativeOrder:m,existingSections:h,proposedSections:S,connectedSections:b,expandedSections:I,displayConfig:v,deviationAnalysisStatus:y,treeData:R,deviationNumberRegistry:w,getSectionCompareStyle:B,getBadgeRef:$,getSectionRowRef:C,sectionRightRefs:N,rhsBadgeRefs:k,openMoreFunctionsPopup:T,handleOpenSummaryPopup:j,handleCloseSummaryPopup:D,toggleSection:z,showDeviationBadges:P=!1,renderSubSectionAccordion:M,isProposingFix:A,proposingFixNodeId:F,isRedlineFlow:L,isSideBySide:O,activeSideBySideSection:_,scrollSyncLocked:U,toggleScrollSyncLocked:W,deviationNodeIdToView:E,deviationTargetParentId:H,showDeviationNavigation:K,showOpenNodeRef:V,resolvedMarkdownStyles:X,unifiedNumbering:Y}=u(),q=x;let G=!1,J=null,Q=-1;const Z=(e,n)=>String(e??"")===String(n);let ee=-1;m?(ee=S.findIndex(e=>e.refIndexes?.includes(q.selfIndex)&&e.selfIndex>=0),Q=S.findIndex((e,n)=>(e=>b.has(e)||b.has(String(e))||null!=_&&!String(_).includes("::")&&Z(_,e))(n)&&e.refIndexes?.includes(q.selfIndex)),G=-1!==Q,G&&(J=B(Q,"left"))):(G=b.has(f)||b.has(String(f))||Z(_,f),G&&(J=B(f,"right")));const ne=m&&-1!==ee?B(ee,"left"):B(f,"right"),te=J||ne,ie=m?-1!==ee||!q.refIndexes?.length&&S.some(e=>e.id&&e.id===q.id):Boolean(S[f]),oe=m?q.selfIndex<0||!ie:!S[f],re=i.useMemo(()=>{const e=Y.rightNums.get(q.id);return m&&q.id?p({section:q,proposedSections:S,leftNums:Y.leftNums,fallbackNumber:e}):e},[m,S,q.id,q.selfIndex,Y]),le=i.useMemo(()=>{if(!m||null==q.selfIndex)return null!=re?[{label:String(re),title:q.title||"Untitled Section",lhsIdx:-1}]:[];const e=S.map((e,n)=>{const t=Array.isArray(e?.refIndexes)?e.refIndexes:[],i=t.findIndex(e=>e===q.selfIndex);if(-1===i)return null;const o=e?.id?Y.leftNums.get(e.id):void 0;if(null==o)return null;return{label:t.length>1?`${o}${g(i)}`:String(o),title:e?.title||"Untitled Section",lhsIdx:n}}).filter(Boolean);return-1===Q?e:[...e].sort((e,n)=>e.lhsIdx===Q?-1:n.lhsIdx===Q?1:0)},[m,S,q.selfIndex,q.title,re,Y.leftNums,Q]),de=i.useMemo(()=>{const e=le[0]?.label;if(!e)return null!=re?String(re):"";const n=le.length-1;return n>0?`${e} + ${n}`:e},[le,re]),se=i.useMemo(()=>0===le.length?"":le.map(e=>`${e.label}: ${e.title}`).join("\n"),[le]),ae=G||O&&(Z(_,f)||-1!==ee&&Z(_,ee)),ce=("mapping_ready"===y||"deviations_streaming"===y)&&(null==q.evaluationResult||void 0===q.evaluationResult);return e(o,{ref:C(f),sx:{mb:1,width:"100%"},children:e(o,{ref:N.current[f],sx:{width:"100%",display:"flex",...G&&J&&{borderRadius:"6px",outline:`2px solid ${J.badgeBorder}`,outlineOffset:"1px"}},children:n(o,{sx:{position:"relative",width:"100%"},children:[e(s,{section:x,idx:f,columnKey:"right",colRef:C(`right-accordion-${f}`),mb:0,parentNodeId:R?.input_index_map?.[1]||"",isExpanded:m?!!I[`right-${f}`]:!!I[String(f)],onToggle:()=>{D(),z(f,"right")},navigation:x.id?K[x.id]:null}),m&&te&&e(r,{title:se?e(o,{sx:{whiteSpace:"pre-line"},children:e(l,{component:"span",sx:{fontSize:"11px",lineHeight:1.5},children:se})}):"",placement:"top",arrow:!0,children:e(o,{ref:k.current[f],"data-section-id":q.id,onClick:e=>{if(!oe)return;const n=v.enableDeviationSchemaBackwardCompatibility?q.evaluationResult??null:q.evaluationResult?.[0]??null;j(e,String(f),oe,n)},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:oe?"4px":"0px",fontSize:"11px",bgcolor:te.badgeBg,color:te.badgeText,border:`1px solid ${te.badgeBorder}`,borderRadius:oe?"12px":"10px",px:oe?1.2:1,py:.3,fontWeight:oe?600:700,cursor:oe?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:oe?"0 1px 3px rgba(0,0,0,0.07)":"none"},children:oe?n(t,{children:[n(o,{component:"span",onClick:e=>{e.stopPropagation();const n=v.enableDeviationSchemaBackwardCompatibility?q.evaluationResult??null:q.evaluationResult?.[0]??null;j(e,String(f),oe,n)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:`1px solid ${te.badgeBorder}`,"&:hover":{bgcolor:`${te.badgeBorder}22`}},children:[null!=re&&e(o,{component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:`1px solid ${te.badgeBorder}`},children:re}),e(o,{component:"span",sx:{fontSize:"11px",px:.25},children:ce?e(r,{title:"Deviation data generation in progress",placement:"top",arrow:!0,children:e(o,{component:"span",sx:{display:"inline-flex",alignItems:"center"},children:e(a,{color:te.badgeText})})}):te.label?`${te.label}`:"100% Deviation"})]}),n(o,{component:"span",onClick:e=>{e.stopPropagation();const n=m?S.find(e=>e.refIndexes?.includes(q.selfIndex))||{title:"",content:""}:S[f]||{title:"",content:""};T(e,n,oe,q,f,te)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:`${te.badgeBorder}22`}},children:[e(d,{size:11,color:te.badgeText}),ae&&e(c,{locked:U,onToggle:W,color:te.badgeText,borderColor:te.badgeBorder,size:11})]})]}):e(t,{children:e(o,{component:"span",sx:{px:.2},children:de})})})})]})})},`right-row-${f}`)});export{x as default};
2
2
  //# sourceMappingURL=RHSSectionRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RHSSectionRow.js","sources":["../../../../src/features/CognitiveCompare/components/RHSSectionRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box, Tooltip, Typography } from \"@mui/material\";\nimport { EllipsisVertical } from \"lucide-react\";\n\nimport SectionAccordion from \"./SectionAccordion\";\nimport ThreeDotsLoader from \"./ThreeDotsLoader\";\nimport ScrollLockToggle from \"./ScrollLockToggle\";\nimport {\n extractDeviationScore,\n getAlphabeticSuffix,\n getRhsMappedSectionNumber,\n} from \"../CognitiveComparehelpers\";\nimport { SectionBlock, StyleVariant } from \"../CognitiveCompareTypes\";\nimport { useCompareContext } from \"../CompareContext\";\n\ntype UnifiedNumbering = {\n leftNums: Map<string, number>;\n rightNums: Map<string, string>;\n};\n\ntype RHSSectionRowProps = {\n section: SectionBlock;\n idx: number;\n};\n\nconst RHSSectionRow = React.memo(\n ({\n section,\n idx,\n }: RHSSectionRowProps) => {\n const {\n maintainRelativeOrder,\n existingSections,\n proposedSections,\n connectedSections,\n expandedSections,\n displayConfig,\n treeData,\n deviationNumberRegistry,\n getSectionCompareStyle,\n getBadgeRef,\n getSectionRowRef,\n sectionRightRefs,\n rhsBadgeRefs,\n openMoreFunctionsPopup,\n handleOpenSummaryPopup,\n handleCloseSummaryPopup,\n toggleSection,\n showDeviationBadges = false,\n renderSubSectionAccordion,\n isProposingFix,\n proposingFixNodeId,\n isRedlineFlow,\n isSideBySide,\n activeSideBySideSection,\n scrollSyncLocked,\n toggleScrollSyncLocked,\n deviationNodeIdToView,\n deviationTargetParentId,\n showDeviationNavigation,\n showOpenNodeRef,\n resolvedMarkdownStyles,\n unifiedNumbering,\n } = useCompareContext();\n const sec = section as any;\n\n let isTargetOfConnection = false;\n let connectedStyle = null;\n let connectedLhsIdx = -1;\n const isSameSectionId = (value: string | number | null | undefined, targetIdx: number) =>\n String(value ?? \"\") === String(targetIdx);\n const isSectionActive = (lhsIdx: number) =>\n connectedSections.has(lhsIdx) ||\n connectedSections.has(String(lhsIdx) as any) ||\n (\n activeSideBySideSection != null &&\n !String(activeSideBySideSection).includes(\"::\") &&\n isSameSectionId(activeSideBySideSection, lhsIdx)\n );\n\n let mappedLhsIdx = -1;\n if (maintainRelativeOrder) {\n mappedLhsIdx = (proposedSections as any[]).findIndex(\n (lhs) => lhs.refIndexes?.includes(sec.selfIndex) && lhs.selfIndex >= 0,\n );\n\n connectedLhsIdx = (proposedSections as SectionBlock[]).findIndex(\n (lhs, lhsIdx) => isSectionActive(lhsIdx) && lhs.refIndexes?.includes(sec.selfIndex),\n );\n isTargetOfConnection = connectedLhsIdx !== -1;\n if (isTargetOfConnection) {\n connectedStyle = getSectionCompareStyle(connectedLhsIdx, \"left\");\n }\n } else {\n isTargetOfConnection =\n connectedSections.has(idx) ||\n connectedSections.has(String(idx) as any) ||\n isSameSectionId(activeSideBySideSection, idx);\n if (isTargetOfConnection) {\n connectedStyle = getSectionCompareStyle(idx, \"right\");\n }\n }\n\n const style =\n maintainRelativeOrder && mappedLhsIdx !== -1\n ? getSectionCompareStyle(mappedLhsIdx, \"left\")\n : getSectionCompareStyle(idx, \"right\");\n const displayStyle = connectedStyle || style;\n\n const hasMappedLhs = maintainRelativeOrder\n ? (mappedLhsIdx !== -1 ||\n (!sec.refIndexes?.length && proposedSections.some((lhs: any) => lhs.id && lhs.id === sec.id)))\n : Boolean(proposedSections[idx]);\n const isOrphanRhs = maintainRelativeOrder\n ? sec.selfIndex < 0 || !hasMappedLhs\n : !proposedSections[idx];\n\n const displayNumRhs = React.useMemo(() => {\n const fallbackNumber = unifiedNumbering.rightNums.get(sec.id);\n\n if (!maintainRelativeOrder || !sec.id) return fallbackNumber;\n\n return getRhsMappedSectionNumber({\n section: sec,\n proposedSections: proposedSections as SectionBlock[],\n leftNums: unifiedNumbering.leftNums,\n fallbackNumber,\n });\n }, [maintainRelativeOrder, proposedSections, sec.id, sec.selfIndex, unifiedNumbering]);\n\n const rhsMappedSections = React.useMemo(() => {\n if (!maintainRelativeOrder || sec.selfIndex == null) {\n return displayNumRhs != null\n ? [{ label: String(displayNumRhs), title: sec.title || \"Untitled Section\", lhsIdx: -1 }]\n : [];\n }\n\n const mapped = (proposedSections as SectionBlock[])\n .map((lhs, lhsIdx) => {\n const refIndexes = Array.isArray(lhs?.refIndexes) ? lhs.refIndexes : [];\n const rhsPosition = refIndexes.findIndex(\n (refIndex: number) => refIndex === sec.selfIndex,\n );\n if (rhsPosition === -1) return null;\n\n const baseNumber = lhs?.id ? unifiedNumbering.leftNums.get(lhs.id) : undefined;\n if (baseNumber == null) return null;\n\n const label = refIndexes.length > 1\n ? `${baseNumber}${getAlphabeticSuffix(rhsPosition)}`\n : String(baseNumber);\n\n return {\n label,\n title: lhs?.title || \"Untitled Section\",\n lhsIdx,\n };\n })\n .filter(Boolean) as { label: string; title: string; lhsIdx: number }[];\n\n if (connectedLhsIdx === -1) return mapped;\n\n return [...mapped].sort((a, b) => {\n if (a.lhsIdx === connectedLhsIdx) return -1;\n if (b.lhsIdx === connectedLhsIdx) return 1;\n return 0;\n });\n }, [\n maintainRelativeOrder,\n proposedSections,\n sec.selfIndex,\n sec.title,\n displayNumRhs,\n unifiedNumbering.leftNums,\n connectedLhsIdx,\n ]);\n\n const rhsBadgeDisplayLabel = React.useMemo(() => {\n const firstLabel = rhsMappedSections[0]?.label;\n if (!firstLabel) return displayNumRhs != null ? String(displayNumRhs) : \"\";\n\n const remainingCount = rhsMappedSections.length - 1;\n return remainingCount > 0 ? `${firstLabel} + ${remainingCount}` : firstLabel;\n }, [rhsMappedSections, displayNumRhs]);\n\n const rhsBadgeTooltip = React.useMemo(() => {\n if (rhsMappedSections.length === 0) return \"\";\n return rhsMappedSections\n .map((mapped) => `${mapped.label}: ${mapped.title}`)\n .join(\"\\n\");\n }, [rhsMappedSections]);\n const showScrollLockToggle =\n isTargetOfConnection ||\n (isSideBySide &&\n (isSameSectionId(activeSideBySideSection, idx) ||\n (mappedLhsIdx !== -1 && isSameSectionId(activeSideBySideSection, mappedLhsIdx))));\n\n return (\n <Box key={`right-row-${idx}`} ref={getSectionRowRef(idx)} sx={{ mb: 1, width: \"100%\" }}>\n <Box\n ref={sectionRightRefs.current[idx]}\n sx={{\n width: \"100%\",\n display: \"flex\",\n ...(isTargetOfConnection && connectedStyle && {\n borderRadius: \"6px\",\n outline: `2px solid ${connectedStyle.badgeBorder}`,\n outlineOffset: \"1px\",\n }),\n }}\n >\n <Box sx={{ position: \"relative\", width: \"100%\" }}>\n <SectionAccordion\n section={section}\n idx={idx}\n columnKey=\"right\"\n colRef={getSectionRowRef(`right-accordion-${idx}`)}\n mb={0}\n parentNodeId={treeData?.input_index_map?.[\"1\"] || \"\"}\n isExpanded={\n maintainRelativeOrder\n ? !!expandedSections[`right-${idx}`]\n : !!expandedSections[String(idx)]\n }\n onToggle={() => {\n handleCloseSummaryPopup();\n toggleSection(idx, \"right\");\n }}\n navigation={section.id ? showDeviationNavigation[section.id] : null}\n />\n\n {maintainRelativeOrder && displayStyle && (\n <Tooltip\n title={\n rhsBadgeTooltip ? (\n <Box sx={{ whiteSpace: \"pre-line\" }}>\n <Typography component=\"span\" sx={{ fontSize: \"11px\", lineHeight: 1.5 }}>\n {rhsBadgeTooltip}\n </Typography>\n </Box>\n ) : \"\"\n }\n placement=\"top\"\n arrow\n >\n <Box\n ref={rhsBadgeRefs.current[idx]}\n data-section-id={sec.id}\n onClick={(e) => {\n if (!isOrphanRhs) return;\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphanRhs, evaluationResult);\n }}\n sx={{\n position: \"absolute\",\n top: \"18px\",\n left: 0,\n transform: \"translateY(-50%) translateX(calc(-100% - 8px))\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: isOrphanRhs ? \"4px\" : \"0px\",\n fontSize: \"11px\",\n bgcolor: displayStyle.badgeBg,\n color: displayStyle.badgeText,\n border: `1px solid ${displayStyle.badgeBorder}`,\n borderRadius: isOrphanRhs ? \"12px\" : \"10px\",\n px: isOrphanRhs ? 1.2 : 1,\n py: 0.3,\n fontWeight: isOrphanRhs ? 600 : 700,\n cursor: isOrphanRhs ? \"pointer\" : \"default\",\n whiteSpace: \"nowrap\",\n zIndex: 20,\n boxShadow: isOrphanRhs ? \"0 1px 3px rgba(0,0,0,0.07)\" : \"none\",\n }}\n >\n {isOrphanRhs ? (\n <>\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphanRhs, evaluationResult);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n px: 0.2,\n cursor: \"pointer\",\n borderRight: `1px solid ${displayStyle.badgeBorder}`,\n \"&:hover\": { bgcolor: `${displayStyle.badgeBorder}22` },\n }}\n >\n {displayNumRhs != null && (\n <Box\n component=\"span\"\n sx={{\n fontSize: \"11px\",\n fontWeight: 700,\n pr: 0.5,\n borderRight: `1px solid ${displayStyle.badgeBorder}`,\n }}\n >\n {displayNumRhs}\n </Box>\n )}\n\n <Box component=\"span\" sx={{ fontSize: \"11px\", px: 0.25 }}>\n {displayConfig.isLoading && (sec.evaluationResult == null || sec.evaluationResult === undefined)\n ? <ThreeDotsLoader color={displayStyle.badgeText} />\n : (displayStyle.label ? `${displayStyle.label}` : \"100% Deviation\")}\n </Box>\n </Box>\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const baseSec = maintainRelativeOrder\n ? (proposedSections.find((s: any) => s.refIndexes?.includes(sec.selfIndex)) || { title: \"\", content: \"\" }) as SectionBlock\n : (proposedSections[idx] || { title: \"\", content: \"\" }) as SectionBlock;\n\n openMoreFunctionsPopup(e, baseSec, isOrphanRhs, sec as SectionBlock, idx, displayStyle);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n px: 0.2,\n cursor: \"pointer\",\n \"&:hover\": { bgcolor: `${displayStyle.badgeBorder}22` },\n }}\n >\n <EllipsisVertical size={11} color={displayStyle.badgeText} />\n {showScrollLockToggle && (\n <ScrollLockToggle\n locked={scrollSyncLocked}\n onToggle={toggleScrollSyncLocked}\n color={displayStyle.badgeText}\n borderColor={displayStyle.badgeBorder}\n size={11}\n />\n )}\n </Box>\n </>\n ) : (\n <>\n <Box component=\"span\" sx={{ px: 0.2 }}>\n {rhsBadgeDisplayLabel}\n </Box>\n </>\n )}\n </Box>\n </Tooltip>\n )}\n </Box>\n </Box>\n </Box>\n );\n },\n);\n\nexport default RHSSectionRow;\n"],"names":["RHSSectionRow","React","memo","section","idx","maintainRelativeOrder","existingSections","proposedSections","connectedSections","expandedSections","displayConfig","treeData","deviationNumberRegistry","getSectionCompareStyle","getBadgeRef","getSectionRowRef","sectionRightRefs","rhsBadgeRefs","openMoreFunctionsPopup","handleOpenSummaryPopup","handleCloseSummaryPopup","toggleSection","showDeviationBadges","renderSubSectionAccordion","isProposingFix","proposingFixNodeId","isRedlineFlow","isSideBySide","activeSideBySideSection","scrollSyncLocked","toggleScrollSyncLocked","deviationNodeIdToView","deviationTargetParentId","showDeviationNavigation","showOpenNodeRef","resolvedMarkdownStyles","unifiedNumbering","useCompareContext","sec","isTargetOfConnection","connectedStyle","connectedLhsIdx","isSameSectionId","value","targetIdx","String","mappedLhsIdx","findIndex","lhs","refIndexes","includes","selfIndex","lhsIdx","has","isSectionActive","style","displayStyle","hasMappedLhs","length","some","id","Boolean","isOrphanRhs","displayNumRhs","useMemo","fallbackNumber","rightNums","get","getRhsMappedSectionNumber","leftNums","rhsMappedSections","label","title","mapped","map","Array","isArray","rhsPosition","refIndex","baseNumber","getAlphabeticSuffix","filter","sort","a","b","rhsBadgeDisplayLabel","firstLabel","remainingCount","rhsBadgeTooltip","join","showScrollLockToggle","jsx","Box","ref","sx","mb","width","children","current","display","borderRadius","outline","badgeBorder","outlineOffset","jsxs","position","SectionAccordion","columnKey","colRef","parentNodeId","input_index_map","isExpanded","onToggle","navigation","Tooltip","whiteSpace","Typography","component","fontSize","lineHeight","placement","arrow","onClick","e","evaluationResult","enableDeviationSchemaBackwardCompatibility","top","left","transform","alignItems","justifyContent","gap","bgcolor","badgeBg","color","badgeText","border","px","py","fontWeight","cursor","zIndex","boxShadow","Fragment","stopPropagation","borderRight","pr","isLoading","ThreeDotsLoader","baseSec","find","s","content","EllipsisVertical","size","ScrollLockToggle","locked","borderColor"],"mappings":"gdAyBA,MAAMA,EAAgBC,EAAMC,KAC1B,EACEC,UACAC,UAEM,MAAAC,sBACJA,EAAAC,iBACAA,EAAAC,iBACAA,EAAAC,kBACAA,EAAAC,iBACAA,EAAAC,cACAA,EAAAC,SACAA,EAAAC,wBACAA,EAAAC,uBACAA,EAAAC,YACAA,EAAAC,iBACAA,EAAAC,iBACAA,EAAAC,aACAA,EAAAC,uBACAA,EAAAC,uBACAA,EAAAC,wBACAA,EAAAC,cACAA,EAAAC,oBACAA,GAAsB,EAAAC,0BACtBA,EAAAC,eACAA,EAAAC,mBACAA,EAAAC,cACAA,EAAAC,aACAA,EAAAC,wBACAA,EAAAC,iBACAA,EAAAC,uBACAA,EAAAC,sBACAA,EAAAC,wBACAA,EAAAC,wBACAA,EAAAC,gBACAA,EAAAC,uBACAA,EAAAC,iBACAA,GACEC,IACEC,EAAMnC,EAEZ,IAAIoC,GAAuB,EACvBC,EAAiB,KACjBC,GAAkB,EAChB,MAAAC,EAAkB,CAACC,EAA2CC,I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A,EAAEqB,kBACI,MAAAK,EAAUhJ,EACXE,EAAiB+I,KAAMC,GAAWA,EAAEtG,YAAYC,SAASZ,EAAIa,aAAe,CAAEqB,MAAO,GAAIgF,QAAS,IAClGjJ,EAAiBH,IAAQ,CAAEoE,MAAO,GAAIgF,QAAS,IAEnDtI,EAAuByG,EAAG0B,EAASvF,GAAaxB,EAAqBlC,EAAKoD,KAE7EsC,GAAI,CACFK,QAAS,cACT8B,WAAY,SACZQ,GAAI,GACJG,OAAQ,UACR,UAAW,CAAER,QAAS,GAAG5E,GAAa8C,kBAGxCL,SAAA,CAAAN,EAAC8D,EAAiB,CAAAC,KAAM,GAAIpB,MAAO9E,GAAa+E,YAC/C7C,IACDC,EAACgE,EAAA,CACCC,OAAQ/H,EACRmF,SAAUlF,EACVwG,MAAO9E,GAAa+E,UACpBsB,YAAarG,GAAa8C,YAC1BoD,KAAM,WAMZ/D,EAAAoD,EAAA,CACE9C,SAACN,EAAAC,EAAA,CAAIyB,UAAU,OAAOvB,GAAI,CAAE2C,GAAI,IAC7BxC,SAAAZ,iBA1JL,aAAajF"}
1
+ {"version":3,"file":"RHSSectionRow.js","sources":["../../../../src/features/CognitiveCompare/components/RHSSectionRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box, Tooltip, Typography } from \"@mui/material\";\nimport { EllipsisVertical } from \"lucide-react\";\n\nimport SectionAccordion from \"./SectionAccordion\";\nimport ThreeDotsLoader from \"./ThreeDotsLoader\";\nimport ScrollLockToggle from \"./ScrollLockToggle\";\nimport {\n extractDeviationScore,\n getAlphabeticSuffix,\n getRhsMappedSectionNumber,\n} from \"../CognitiveComparehelpers\";\nimport { SectionBlock, StyleVariant } from \"../CognitiveCompareTypes\";\nimport { useCompareContext } from \"../CompareContext\";\n\ntype UnifiedNumbering = {\n leftNums: Map<string, number>;\n rightNums: Map<string, string>;\n};\n\ntype RHSSectionRowProps = {\n section: SectionBlock;\n idx: number;\n};\n\nconst RHSSectionRow = React.memo(\n ({\n section,\n idx,\n }: RHSSectionRowProps) => {\n const {\n maintainRelativeOrder,\n existingSections,\n proposedSections,\n connectedSections,\n expandedSections,\n displayConfig,\n deviationAnalysisStatus,\n treeData,\n deviationNumberRegistry,\n getSectionCompareStyle,\n getBadgeRef,\n getSectionRowRef,\n sectionRightRefs,\n rhsBadgeRefs,\n openMoreFunctionsPopup,\n handleOpenSummaryPopup,\n handleCloseSummaryPopup,\n toggleSection,\n showDeviationBadges = false,\n renderSubSectionAccordion,\n isProposingFix,\n proposingFixNodeId,\n isRedlineFlow,\n isSideBySide,\n activeSideBySideSection,\n scrollSyncLocked,\n toggleScrollSyncLocked,\n deviationNodeIdToView,\n deviationTargetParentId,\n showDeviationNavigation,\n showOpenNodeRef,\n resolvedMarkdownStyles,\n unifiedNumbering,\n } = useCompareContext();\n const sec = section as any;\n\n let isTargetOfConnection = false;\n let connectedStyle = null;\n let connectedLhsIdx = -1;\n const isSameSectionId = (value: string | number | null | undefined, targetIdx: number) =>\n String(value ?? \"\") === String(targetIdx);\n const isSectionActive = (lhsIdx: number) =>\n connectedSections.has(lhsIdx) ||\n connectedSections.has(String(lhsIdx) as any) ||\n (\n activeSideBySideSection != null &&\n !String(activeSideBySideSection).includes(\"::\") &&\n isSameSectionId(activeSideBySideSection, lhsIdx)\n );\n\n let mappedLhsIdx = -1;\n if (maintainRelativeOrder) {\n mappedLhsIdx = (proposedSections as any[]).findIndex(\n (lhs) => lhs.refIndexes?.includes(sec.selfIndex) && lhs.selfIndex >= 0,\n );\n\n connectedLhsIdx = (proposedSections as SectionBlock[]).findIndex(\n (lhs, lhsIdx) => isSectionActive(lhsIdx) && lhs.refIndexes?.includes(sec.selfIndex),\n );\n isTargetOfConnection = connectedLhsIdx !== -1;\n if (isTargetOfConnection) {\n connectedStyle = getSectionCompareStyle(connectedLhsIdx, \"left\");\n }\n } else {\n isTargetOfConnection =\n connectedSections.has(idx) ||\n connectedSections.has(String(idx) as any) ||\n isSameSectionId(activeSideBySideSection, idx);\n if (isTargetOfConnection) {\n connectedStyle = getSectionCompareStyle(idx, \"right\");\n }\n }\n\n const style =\n maintainRelativeOrder && mappedLhsIdx !== -1\n ? getSectionCompareStyle(mappedLhsIdx, \"left\")\n : getSectionCompareStyle(idx, \"right\");\n const displayStyle = connectedStyle || style;\n\n const hasMappedLhs = maintainRelativeOrder\n ? (mappedLhsIdx !== -1 ||\n (!sec.refIndexes?.length && proposedSections.some((lhs: any) => lhs.id && lhs.id === sec.id)))\n : Boolean(proposedSections[idx]);\n const isOrphanRhs = maintainRelativeOrder\n ? sec.selfIndex < 0 || !hasMappedLhs\n : !proposedSections[idx];\n\n const displayNumRhs = React.useMemo(() => {\n const fallbackNumber = unifiedNumbering.rightNums.get(sec.id);\n\n if (!maintainRelativeOrder || !sec.id) return fallbackNumber;\n\n return getRhsMappedSectionNumber({\n section: sec,\n proposedSections: proposedSections as SectionBlock[],\n leftNums: unifiedNumbering.leftNums,\n fallbackNumber,\n });\n }, [maintainRelativeOrder, proposedSections, sec.id, sec.selfIndex, unifiedNumbering]);\n\n const rhsMappedSections = React.useMemo(() => {\n if (!maintainRelativeOrder || sec.selfIndex == null) {\n return displayNumRhs != null\n ? [{ label: String(displayNumRhs), title: sec.title || \"Untitled Section\", lhsIdx: -1 }]\n : [];\n }\n\n const mapped = (proposedSections as SectionBlock[])\n .map((lhs, lhsIdx) => {\n const refIndexes = Array.isArray(lhs?.refIndexes) ? lhs.refIndexes : [];\n const rhsPosition = refIndexes.findIndex(\n (refIndex: number) => refIndex === sec.selfIndex,\n );\n if (rhsPosition === -1) return null;\n\n const baseNumber = lhs?.id ? unifiedNumbering.leftNums.get(lhs.id) : undefined;\n if (baseNumber == null) return null;\n\n const label = refIndexes.length > 1\n ? `${baseNumber}${getAlphabeticSuffix(rhsPosition)}`\n : String(baseNumber);\n\n return {\n label,\n title: lhs?.title || \"Untitled Section\",\n lhsIdx,\n };\n })\n .filter(Boolean) as { label: string; title: string; lhsIdx: number }[];\n\n if (connectedLhsIdx === -1) return mapped;\n\n return [...mapped].sort((a, b) => {\n if (a.lhsIdx === connectedLhsIdx) return -1;\n if (b.lhsIdx === connectedLhsIdx) return 1;\n return 0;\n });\n }, [\n maintainRelativeOrder,\n proposedSections,\n sec.selfIndex,\n sec.title,\n displayNumRhs,\n unifiedNumbering.leftNums,\n connectedLhsIdx,\n ]);\n\n const rhsBadgeDisplayLabel = React.useMemo(() => {\n const firstLabel = rhsMappedSections[0]?.label;\n if (!firstLabel) return displayNumRhs != null ? String(displayNumRhs) : \"\";\n\n const remainingCount = rhsMappedSections.length - 1;\n return remainingCount > 0 ? `${firstLabel} + ${remainingCount}` : firstLabel;\n }, [rhsMappedSections, displayNumRhs]);\n\n const rhsBadgeTooltip = React.useMemo(() => {\n if (rhsMappedSections.length === 0) return \"\";\n return rhsMappedSections\n .map((mapped) => `${mapped.label}: ${mapped.title}`)\n .join(\"\\n\");\n }, [rhsMappedSections]);\n const showScrollLockToggle =\n isTargetOfConnection ||\n (isSideBySide &&\n (isSameSectionId(activeSideBySideSection, idx) ||\n (mappedLhsIdx !== -1 && isSameSectionId(activeSideBySideSection, mappedLhsIdx))));\n const isDeviationGenerationInProgress =\n deviationAnalysisStatus === \"mapping_ready\" ||\n deviationAnalysisStatus === \"deviations_streaming\";\n const shouldShowDeviationLoader =\n isDeviationGenerationInProgress &&\n (sec.evaluationResult == null || sec.evaluationResult === undefined);\n\n return (\n <Box key={`right-row-${idx}`} ref={getSectionRowRef(idx)} sx={{ mb: 1, width: \"100%\" }}>\n <Box\n ref={sectionRightRefs.current[idx]}\n sx={{\n width: \"100%\",\n display: \"flex\",\n ...(isTargetOfConnection && connectedStyle && {\n borderRadius: \"6px\",\n outline: `2px solid ${connectedStyle.badgeBorder}`,\n outlineOffset: \"1px\",\n }),\n }}\n >\n <Box sx={{ position: \"relative\", width: \"100%\" }}>\n <SectionAccordion\n section={section}\n idx={idx}\n columnKey=\"right\"\n colRef={getSectionRowRef(`right-accordion-${idx}`)}\n mb={0}\n parentNodeId={treeData?.input_index_map?.[\"1\"] || \"\"}\n isExpanded={\n maintainRelativeOrder\n ? !!expandedSections[`right-${idx}`]\n : !!expandedSections[String(idx)]\n }\n onToggle={() => {\n handleCloseSummaryPopup();\n toggleSection(idx, \"right\");\n }}\n navigation={section.id ? showDeviationNavigation[section.id] : null}\n />\n\n {maintainRelativeOrder && displayStyle && (\n <Tooltip\n title={\n rhsBadgeTooltip ? (\n <Box sx={{ whiteSpace: \"pre-line\" }}>\n <Typography component=\"span\" sx={{ fontSize: \"11px\", lineHeight: 1.5 }}>\n {rhsBadgeTooltip}\n </Typography>\n </Box>\n ) : \"\"\n }\n placement=\"top\"\n arrow\n >\n <Box\n ref={rhsBadgeRefs.current[idx]}\n data-section-id={sec.id}\n onClick={(e) => {\n if (!isOrphanRhs) return;\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphanRhs, evaluationResult);\n }}\n sx={{\n position: \"absolute\",\n top: \"18px\",\n left: 0,\n transform: \"translateY(-50%) translateX(calc(-100% - 8px))\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: isOrphanRhs ? \"4px\" : \"0px\",\n fontSize: \"11px\",\n bgcolor: displayStyle.badgeBg,\n color: displayStyle.badgeText,\n border: `1px solid ${displayStyle.badgeBorder}`,\n borderRadius: isOrphanRhs ? \"12px\" : \"10px\",\n px: isOrphanRhs ? 1.2 : 1,\n py: 0.3,\n fontWeight: isOrphanRhs ? 600 : 700,\n cursor: isOrphanRhs ? \"pointer\" : \"default\",\n whiteSpace: \"nowrap\",\n zIndex: 20,\n boxShadow: isOrphanRhs ? \"0 1px 3px rgba(0,0,0,0.07)\" : \"none\",\n }}\n >\n {isOrphanRhs ? (\n <>\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const evaluationResult = displayConfig.enableDeviationSchemaBackwardCompatibility\n ? (sec.evaluationResult ?? null)\n : (sec.evaluationResult?.[0] ?? null);\n handleOpenSummaryPopup(e, String(idx), isOrphanRhs, evaluationResult);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n px: 0.2,\n cursor: \"pointer\",\n borderRight: `1px solid ${displayStyle.badgeBorder}`,\n \"&:hover\": { bgcolor: `${displayStyle.badgeBorder}22` },\n }}\n >\n {displayNumRhs != null && (\n <Box\n component=\"span\"\n sx={{\n fontSize: \"11px\",\n fontWeight: 700,\n pr: 0.5,\n borderRight: `1px solid ${displayStyle.badgeBorder}`,\n }}\n >\n {displayNumRhs}\n </Box>\n )}\n\n <Box component=\"span\" sx={{ fontSize: \"11px\", px: 0.25 }}>\n {shouldShowDeviationLoader\n ? (\n <Tooltip title=\"Deviation data generation in progress\" placement=\"top\" arrow>\n <Box component=\"span\" sx={{ display: \"inline-flex\", alignItems: \"center\" }}>\n <ThreeDotsLoader color={displayStyle.badgeText} />\n </Box>\n </Tooltip>\n )\n : (displayStyle.label ? `${displayStyle.label}` : \"100% Deviation\")}\n </Box>\n </Box>\n <Box\n component=\"span\"\n onClick={(e) => {\n e.stopPropagation();\n const baseSec = maintainRelativeOrder\n ? (proposedSections.find((s: any) => s.refIndexes?.includes(sec.selfIndex)) || { title: \"\", content: \"\" }) as SectionBlock\n : (proposedSections[idx] || { title: \"\", content: \"\" }) as SectionBlock;\n\n openMoreFunctionsPopup(e, baseSec, isOrphanRhs, sec as SectionBlock, idx, displayStyle);\n }}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n px: 0.2,\n cursor: \"pointer\",\n \"&:hover\": { bgcolor: `${displayStyle.badgeBorder}22` },\n }}\n >\n <EllipsisVertical size={11} color={displayStyle.badgeText} />\n {showScrollLockToggle && (\n <ScrollLockToggle\n locked={scrollSyncLocked}\n onToggle={toggleScrollSyncLocked}\n color={displayStyle.badgeText}\n borderColor={displayStyle.badgeBorder}\n size={11}\n />\n )}\n </Box>\n </>\n ) : (\n <>\n <Box component=\"span\" sx={{ px: 0.2 }}>\n {rhsBadgeDisplayLabel}\n </Box>\n </>\n )}\n </Box>\n </Tooltip>\n )}\n </Box>\n </Box>\n </Box>\n );\n },\n);\n\nexport default RHSSectionRow;\n"],"names":["RHSSectionRow","React","memo","section","idx","maintainRelativeOrder","existingSections","proposedSections","connectedSections","expandedSections","displayConfig","deviationAnalysisStatus","treeData","deviationNumberRegistry","getSectionCompareStyle","getBadgeRef","getSectionRowRef","sectionRightRefs","rhsBadgeRefs","openMoreFunctionsPopup","handleOpenSummaryPopup","handleCloseSummaryPopup","toggleSection","showDeviationBadges","renderSubSectionAccordion","isProposingFix","proposingFixNodeId","isRedlineFlow","isSideBySide","activeSideBySideSection","scrollSyncLocked","toggleScrollSyncLocked","deviationNodeIdToView","deviationTargetParentId","showDeviationNavigation","showOpenNodeRef","resolvedMarkdownStyles","unifiedNumbering","useCompareContext","sec","isTargetOfConnection","connectedStyle","connectedLhsIdx","isSameSectionId","value","targetIdx","String","mappedLhsIdx","findIndex","lhs","refIndexes","includes","selfIndex","lhsIdx","has","isSectionActive","style","displayStyle","hasMappedLhs","length","some","id","Boolean","isOrphanRhs","displayNumRhs","useMemo","fallbackNumber","rightNums","get","getRhsMappedSectionNumber","leftNums","rhsMappedSections","label","title","mapped","map","Array","isArray","rhsPosition","refIndex","baseNumber","getAlphabeticSuffix","filter","sort","a","b","rhsBadgeDisplayLabel","firstLabel","remainingCount","rhsBadgeTooltip","join","showScrollLockToggle","shouldShowDeviationLoader","evaluationResult","jsx","Box","ref","sx","mb","width","children","current","display","borderRadius","outline","badgeBorder","outlineOffset","jsxs","position","SectionAccordion","columnKey","colRef","parentNodeId","input_index_map","isExpanded","onToggle","navigation","Tooltip","whiteSpace","Typography","component","fontSize","lineHeight","placement","arrow","onClick","e","enableDeviationSchemaBackwardCompatibility","top","left","transform","alignItems","justifyContent","gap","bgcolor","badgeBg","color","badgeText","border","px","py","fontWeight","cursor","zIndex","boxShadow","Fragment","stopPropagation","borderRight","pr","ThreeDotsLoader","baseSec","find","s","content","EllipsisVertical","size","ScrollLockToggle","locked","borderColor"],"mappings":"gdAyBA,MAAMA,EAAgBC,EAAMC,KAC1B,EACEC,UACAC,UAEM,MAAAC,sBACJA,EAAAC,iBACAA,EAAAC,iBACAA,EAAAC,kBACAA,EAAAC,iBACAA,EAAAC,cACAA,EAAAC,wBACAA,EAAAC,SACAA,EAAAC,wBACAA,EAAAC,uBACAA,EAAAC,YACAA,EAAAC,iBACAA,EAAAC,iBACAA,EAAAC,aACAA,EAAAC,uBACAA,EAAAC,uBACAA,EAAAC,wBACAA,EAAAC,cACAA,EAAAC,oBACAA,GAAsB,EAAAC,0BACtBA,EAAAC,eACAA,EAAAC,mBACAA,EAAAC,cACAA,EAAAC,aACAA,EAAAC,wBACAA,EAAAC,iBACAA,EAAAC,uBACAA,EAAAC,sBACAA,EAAAC,wBACAA,EAAAC,wBACAA,EAAAC,gBACAA,EAAAC,uBACAA,EAAAC,iBACAA,GACEC,IACEC,EAAMpC,EAEZ,IAAIqC,GAAuB,EACvBC,EAAiB,KACjBC,GAAkB,EAChB,MAAAC,EAAkB,CAACC,EAA2CC,IAClEC,OAAOF,GAAS,MAAQE,OAAOD,GAUjC,IAAIE,IAAe,EACf1C,GACF0C,GAAgBxC,EAA2ByC,UACxCC,GAAQA,EAAIC,YAAYC,SAASZ,EAAIa,YAAcH,EAAIG,WAAa,GAGvEV,EAAmBnC,EAAoCyC,UACrD,CAACC,EAAKI,IAhBc,CAACA,GACvB7C,EAAkB8C,IAAID,IACtB7C,EAAkB8C,IAAIR,OAAOO,KAEA,MAA3BxB,IACCiB,OAAOjB,GAAyBsB,SAAS,OAC1CR,EAAgBd,EAAyBwB,GAUxBE,CAAgBF,IAAWJ,EAAIC,YAAYC,SAASZ,EAAIa,YAE3EZ,GAA2C,IAApBE,EACnBF,IACeC,EAAA3B,EAAuB4B,EAAiB,WAG3DF,EACEhC,EAAkB8C,IAAIlD,IACt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