@viswa-test/test-citation 0.0.244 → 0.0.246

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 (85) hide show
  1. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
  3. package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  4. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
  5. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
  6. package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  7. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  8. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  9. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  10. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  11. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  12. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  13. package/dist/cjs/service/redlineService.js +1 -1
  14. package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  15. package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
  16. package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  17. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
  18. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
  19. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  20. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  21. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  22. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  23. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  24. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  25. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  26. package/dist/service/redlineService.js +1 -1
  27. package/dist/types/src/RedlineApprovalCardTest.d.ts +1 -0
  28. package/dist/types/src/RedlineApprovalCardTest.d.ts.map +1 -0
  29. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  30. package/dist/types/src/commonConstants.d.ts +31103 -0
  31. package/dist/types/src/commonConstants.d.ts.map +1 -0
  32. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +1256 -553
  33. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
  34. package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
  35. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
  36. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +1 -10
  37. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  38. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  39. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  40. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts.map +1 -1
  41. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
  42. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
  43. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  44. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  45. package/dist/types/src/service/redlineService.d.ts +0 -6
  46. package/dist/types/src/service/redlineService.d.ts.map +1 -1
  47. package/package.json +3 -3
  48. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +0 -2
  49. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +0 -1
  50. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +0 -2
  51. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +0 -1
  52. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +0 -2
  53. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +0 -1
  54. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +0 -2
  55. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +0 -1
  56. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +0 -2
  57. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +0 -1
  58. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +0 -2
  59. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +0 -1
  60. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +0 -2
  61. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +0 -1
  62. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +0 -2
  63. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +0 -1
  64. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +0 -2
  65. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +0 -1
  66. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +0 -2
  67. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +0 -1
  68. package/dist/types/src/constants/deviationData.d.ts +0 -887
  69. package/dist/types/src/constants/deviationData.d.ts.map +0 -1
  70. package/dist/types/src/constants/treeData.d.ts +0 -732
  71. package/dist/types/src/constants/treeData.d.ts.map +0 -1
  72. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts +0 -8
  73. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts.map +0 -1
  74. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts +0 -9
  75. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts.map +0 -1
  76. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +0 -14
  77. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +0 -1
  78. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts +0 -10
  79. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +0 -1
  80. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +0 -30
  81. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +0 -1
  82. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts +0 -4
  83. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts.map +0 -1
  84. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +0 -2
  85. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),i=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("./ScrollLockToggle.js"),d=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(o),p=u.default.memo(function(o){var c,p,x,g=o.section,f=o.idx,v=s.useCompareContext(),h=v.maintainRelativeOrder;v.existingSections;var m=v.proposedSections,b=v.connectedSections,S=v.expandedSections,B=v.displayConfig,j=v.treeData;v.deviationNumberRegistry;var _=v.getSectionCompareStyle;v.getBadgeRef;var y=v.getSectionRowRef,R=v.sectionRightRefs,I=v.rhsBadgeRefs,w=v.openMoreFunctionsPopup,C=v.handleOpenSummaryPopup,N=v.handleCloseSummaryPopup,k=v.toggleSection;v.showDeviationBadges,v.renderSubSectionAccordion,v.isProposingFix,v.proposingFixNodeId,v.isRedlineFlow;var q=v.isSideBySide,T=v.activeSideBySideSection,P=v.scrollSyncLocked,D=v.toggleScrollSyncLocked,z=v.summaryPopupAnchorEl;v.deviationNodeIdToView,v.deviationTargetParentId;var F=v.showDeviationNavigation;v.showOpenNodeRef,v.resolvedMarkdownStyles;var L=v.unifiedNumbering,M=g,O=!1,A=null,E=-1;if(h){E=m.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(M.selfIndex))&&e.selfIndex>=0});var V=m.findIndex(function(e,n){var o;return b.has(n)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(M.selfIndex))});(O=-1!==V)&&(A=_(V,"left"))}else(O=b.has(f))&&(A=_(f,"right"));var W=h&&-1!==E?_(E,"left"):_(f,"right"),K=h?-1!==E||!(null===(c=M.refIndexes)||void 0===c?void 0:c.length)&&m.some(function(e){return e.id&&e.id===M.id}):Boolean(m[f]),X=h?M.selfIndex<0||!K:!m[f],Y=u.default.useMemo(function(){var e=L.rightNums.get(M.id);return h&&M.id?d.getRhsMappedSectionNumber({section:M,proposedSections:m,leftNums:L.leftNums,fallbackNumber:e}):e},[h,m,M.id,M.selfIndex,L]),G=null===(p=I.current[f])||void 0===p?void 0:p.current,H=O||q&&(T===f||T===E)||!!z&&z===G;return n.jsx(i.Box,e.__assign({ref:y(f),sx:{mb:1,width:"100%"}},{children:n.jsx(i.Box,e.__assign({ref:R.current[f],sx:e.__assign({width:"100%",display:"flex"},O&&A&&{borderRadius:"6px",outline:"2px solid ".concat(A.badgeBorder),outlineOffset:"1px"})},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(r.default,{section:g,idx:f,columnKey:"right",colRef:y("right-accordion-".concat(f)),mb:0,parentNodeId:(null===(x=null==j?void 0:j.input_index_map)||void 0===x?void 0:x[1])||"",isExpanded:h?!!S["right-".concat(f)]:!!S[String(f)],onToggle:function(){N(),k(f,"right")},navigation:g.id?F[g.id]:null}),h&&W&&n.jsx(i.Box,e.__assign({ref:I.current[f],"data-section-id":M.id,onClick:function(e){var n,o,i;if(X){var t=B.enableDeviationSchemaBackwardCompatibility?null!==(n=M.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=M.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;C(e,String(f),X,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:X?"4px":"0px",fontSize:"11px",bgcolor:W.badgeBg,color:W.badgeText,border:"1px solid ".concat(W.badgeBorder),borderRadius:X?"12px":"10px",px:X?1.2:1,py:.3,fontWeight:X?600:700,cursor:X?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:X?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:X?n.jsxs(n.Fragment,{children:[n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){var n,o,i;e.stopPropagation();var t=B.enableDeviationSchemaBackwardCompatibility?null!==(n=M.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=M.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;C(e,String(f),X,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(W.badgeBorder),"&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[null!=Y&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(W.badgeBorder)}},{children:Y})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!B.isLoading||null!=M.evaluationResult&&void 0!==M.evaluationResult?W.label?"".concat(W.label):"100% Deviation":n.jsx(a.default,{color:W.badgeText})}))]})),n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var n=h?m.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(M.selfIndex)})||{title:"",content:""}:m[f]||{title:"",content:""};w(e,n,X,M,f,W)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[n.jsx(t.EllipsisVertical,{size:11,color:W.badgeText}),H&&n.jsx(l.default,{locked:P,onToggle:D,color:W.badgeText,borderColor:W.badgeBorder,size:11})]}))]}):n.jsx(n.Fragment,{children:n.jsx(i.Box,e.__assign({component:"span",sx:{px:.2}},{children:null!=Y?Y:""}))})}))]}))}))}),"right-row-".concat(f))});exports.default=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("./SectionAccordion.js"),l=require("./ThreeDotsLoader.js"),a=require("./ScrollLockToggle.js"),s=require("../CognitiveComparehelpers.js"),d=require("../CompareContext.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(i),x=u.default.memo(function(i){var c,x,p=i.section,g=i.idx,f=d.useCompareContext(),v=f.maintainRelativeOrder;f.existingSections;var h=f.proposedSections,m=f.connectedSections,S=f.expandedSections,b=f.displayConfig,_=f.treeData;f.deviationNumberRegistry;var I=f.getSectionCompareStyle;f.getBadgeRef;var j=f.getSectionRowRef,B=f.sectionRightRefs,y=f.rhsBadgeRefs,R=f.openMoreFunctionsPopup,w=f.handleOpenSummaryPopup,C=f.handleCloseSummaryPopup,N=f.toggleSection;f.showDeviationBadges,f.renderSubSectionAccordion,f.isProposingFix,f.proposingFixNodeId,f.isRedlineFlow;var T=f.isSideBySide,k=f.activeSideBySideSection,q=f.scrollSyncLocked,M=f.toggleScrollSyncLocked;f.deviationNodeIdToView,f.deviationTargetParentId;var P=f.showDeviationNavigation;f.showOpenNodeRef,f.resolvedMarkdownStyles;var z=f.unifiedNumbering,D=p,A=!1,F=null,L=-1,O=function(e,n){return String(null!=e?e:"")===String(n)},E=-1;v?(E=h.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(D.selfIndex))&&e.selfIndex>=0}),L=h.findIndex(function(e,n){var i;return function(e){return m.has(e)||m.has(String(e))||null!=k&&!String(k).includes("::")&&O(k,e)}(n)&&(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(D.selfIndex))}),(A=-1!==L)&&(F=I(L,"left"))):(A=m.has(g)||m.has(String(g))||O(k,g))&&(F=I(g,"right"));var U=v&&-1!==E?I(E,"left"):I(g,"right"),V=F||U,W=v?-1!==E||!(null===(c=D.refIndexes)||void 0===c?void 0:c.length)&&h.some(function(e){return e.id&&e.id===D.id}):Boolean(h[g]),H=v?D.selfIndex<0||!W:!h[g],K=u.default.useMemo(function(){var e=z.rightNums.get(D.id);return v&&D.id?s.getRhsMappedSectionNumber({section:D,proposedSections:h,leftNums:z.leftNums,fallbackNumber:e}):e},[v,h,D.id,D.selfIndex,z]),X=u.default.useMemo(function(){if(!v||null==D.selfIndex)return null!=K?[{label:String(K),title:D.title||"Untitled Section",lhsIdx:-1}]:[];var n=h.map(function(e,n){var i=Array.isArray(null==e?void 0:e.refIndexes)?e.refIndexes:[],t=i.findIndex(function(e){return e===D.selfIndex});if(-1===t)return null;var o=(null==e?void 0:e.id)?z.leftNums.get(e.id):void 0;return null==o?null:{label:i.length>1?"".concat(o).concat(s.getAlphabeticSuffix(t)):String(o),title:(null==e?void 0:e.title)||"Untitled Section",lhsIdx:n}}).filter(Boolean);return-1===L?n:e.__spreadArray([],n,!0).sort(function(e,n){return e.lhsIdx===L?-1:n.lhsIdx===L?1:0})},[v,h,D.selfIndex,D.title,K,z.leftNums,L]),Y=u.default.useMemo(function(){var e,n=null===(e=X[0])||void 0===e?void 0:e.label;if(!n)return null!=K?String(K):"";var i=X.length-1;return i>0?"".concat(n," + ").concat(i):n},[X,K]),G=u.default.useMemo(function(){return 0===X.length?"":X.map(function(e){return"".concat(e.label,": ").concat(e.title)}).join("\n")},[X]),J=A||T&&(O(k,g)||-1!==E&&O(k,E));return n.jsx(t.Box,e.__assign({ref:j(g),sx:{mb:1,width:"100%"}},{children:n.jsx(t.Box,e.__assign({ref:B.current[g],sx:e.__assign({width:"100%",display:"flex"},A&&F&&{borderRadius:"6px",outline:"2px solid ".concat(F.badgeBorder),outlineOffset:"1px"})},{children:n.jsxs(t.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(r.default,{section:p,idx:g,columnKey:"right",colRef:j("right-accordion-".concat(g)),mb:0,parentNodeId:(null===(x=null==_?void 0:_.input_index_map)||void 0===x?void 0:x[1])||"",isExpanded:v?!!S["right-".concat(g)]:!!S[String(g)],onToggle:function(){C(),N(g,"right")},navigation:p.id?P[p.id]:null}),v&&V&&n.jsx(t.Tooltip,e.__assign({title:G?n.jsx(t.Box,e.__assign({sx:{whiteSpace:"pre-line"}},{children:n.jsx(t.Typography,e.__assign({component:"span",sx:{fontSize:"11px",lineHeight:1.5}},{children:G}))})):"",placement:"top",arrow:!0},{children:n.jsx(t.Box,e.__assign({ref:y.current[g],"data-section-id":D.id,onClick:function(e){var n,i,t;if(H){var o=b.enableDeviationSchemaBackwardCompatibility?null!==(n=D.evaluationResult)&&void 0!==n?n:null:null!==(t=null===(i=D.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==t?t:null;w(e,String(g),H,o)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:H?"4px":"0px",fontSize:"11px",bgcolor:V.badgeBg,color:V.badgeText,border:"1px solid ".concat(V.badgeBorder),borderRadius:H?"12px":"10px",px:H?1.2:1,py:.3,fontWeight:H?600:700,cursor:H?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:H?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:H?n.jsxs(n.Fragment,{children:[n.jsxs(t.Box,e.__assign({component:"span",onClick:function(e){var n,i,t;e.stopPropagation();var o=b.enableDeviationSchemaBackwardCompatibility?null!==(n=D.evaluationResult)&&void 0!==n?n:null:null!==(t=null===(i=D.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==t?t:null;w(e,String(g),H,o)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(V.badgeBorder),"&:hover":{bgcolor:"".concat(V.badgeBorder,"22")}}},{children:[null!=K&&n.jsx(t.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(V.badgeBorder)}},{children:K})),n.jsx(t.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!b.isLoading||null!=D.evaluationResult&&void 0!==D.evaluationResult?V.label?"".concat(V.label):"100% Deviation":n.jsx(l.default,{color:V.badgeText})}))]})),n.jsxs(t.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var n=v?h.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(D.selfIndex)})||{title:"",content:""}:h[g]||{title:"",content:""};R(e,n,H,D,g,V)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(V.badgeBorder,"22")}}},{children:[n.jsx(o.EllipsisVertical,{size:11,color:V.badgeText}),J&&n.jsx(a.default,{locked:q,onToggle:M,color:V.badgeText,borderColor:V.badgeBorder,size:11})]}))]}):n.jsx(n.Fragment,{children:n.jsx(t.Box,e.__assign({component:"span",sx:{px:.2}},{children:Y}))})}))}))]}))}))}),"right-row-".concat(g))});exports.default=x;
2
2
  //# sourceMappingURL=RHSSectionRow.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("@mui/material"),n=require("./ScrollLockToggle.js"),r=require("../CompareContext.js");exports.default=function(o){var s=o.connectedLines,l=o.pathRefs,d=o.maintainRelativeOrder,a=r.useCompareContext(),c=a.scrollSyncLocked,u=a.toggleScrollSyncLocked,x=a.isGuidelineMode;return t.jsxs(t.Fragment,{children:[s.map(function(r){var o,s,a,f,g=r.pathD,h=(null===(o=r.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",p="conn-marker-".concat(r.id),y="".concat(r.id,"-bg"),F="".concat(r.id,"-stroke"),j="".concat(r.id,"-btn"),b="".concat(r.id,"-number"),m=void 0!==r.x1?r.x1+40:0,v=void 0!==r.y1?r.y1:0;return t.jsxs("g",{children:[t.jsx("defs",{children:t.jsx("clipPath",e.__assign({id:"connections-clip"},{children:t.jsx("marker",e.__assign({id:p,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:t.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:h})}))}))}),t.jsx("path",{ref:function(e){l.current[y]=e},d:g,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),t.jsx("path",{ref:function(e){l.current[F]=e},d:g,fill:"none",stroke:h,strokeWidth:"1.75",markerEnd:"url(#".concat(p,")")}),x&&r.matchLabel&&t.jsxs("g",e.__assign({ref:function(e){l.current[b]=e},transform:"translate(".concat(r.x2-42,", ").concat(r.y2,")"),style:{pointerEvents:"none",transition:"visibility 0ms"}},{children:[t.jsx("rect",{x:"-22",y:"-8",width:"44",height:"16",rx:"4",fill:"#FFFFFF"}),t.jsx("rect",{x:"-21",y:"-7",width:"42",height:"14",rx:"3",fill:(null===(s=r.style)||void 0===s?void 0:s.badgeBg)||"#FEF08A",stroke:h,strokeWidth:"1"}),t.jsx("text",e.__assign({x:"0",y:"3.5",fontSize:"9px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',fill:(null===(a=r.style)||void 0===a?void 0:a.badgeText)||h,textAnchor:"middle"},{children:r.matchLabel}))]})),d&&void 0!==r.x1&&!x&&t.jsx("foreignObject",e.__assign({ref:function(e){l.current[j]=e},x:m-12,y:v-12,width:"24",height:"24",style:{pointerEvents:"auto",overflow:"visible"}},{children:t.jsx(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),u&&u(e)},sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",bgcolor:"#FFFFFF",borderRadius:"50%",border:"1px solid ".concat(h),cursor:"pointer",transition:"transform 0.2s ease","&:hover":{transform:"scale(1.05)",boxShadow:"0px 2px 4px rgba(0,0,0,0.1)"}}},{children:t.jsx(n.default,{locked:c,onToggle:u,color:(null===(f=r.style)||void 0===f?void 0:f.badgeText)||h,borderColor:"transparent",size:12})}))}))]},r.id)}),t.jsxs("g",{children:[t.jsxs("g",e.__assign({style:{transition:"visibility 0ms"}},{children:[t.jsx("path",{ref:function(e){return l.current["guideline-up-stroke"]=e},fill:"none",strokeWidth:"1.75",visibility:"hidden"}),t.jsxs("g",e.__assign({ref:function(e){return l.current["guideline-up-badge"]=e},visibility:"hidden"},{children:[t.jsx("polygon",{ref:function(e){return l.current["guideline-up-arrow"]=e},points:"-4,0 0,-6 4,0"}),t.jsx("rect",{ref:function(e){return l.current["guideline-up-badge-rect"]=e},x:"-12",y:"3",width:"24",height:"15",rx:"4",fill:"#FFFFFF",strokeWidth:"1"}),t.jsx("text",{ref:function(e){return l.current["guideline-up-text"]=e},x:"0",y:"14",fontSize:"10px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',textAnchor:"middle"})]}))]})),t.jsxs("g",e.__assign({style:{transition:"visibility 0ms"}},{children:[t.jsx("path",{ref:function(e){return l.current["guideline-down-stroke"]=e},fill:"none",strokeWidth:"1.75",visibility:"hidden"}),t.jsxs("g",e.__assign({ref:function(e){return l.current["guideline-down-badge"]=e},visibility:"hidden"},{children:[t.jsx("polygon",{ref:function(e){return l.current["guideline-down-arrow"]=e},points:"-4,0 0,6 4,0"}),t.jsx("rect",{ref:function(e){return l.current["guideline-down-badge-rect"]=e},x:"-12",y:"-18",width:"24",height:"15",rx:"4",fill:"#FFFFFF",strokeWidth:"1"}),t.jsx("text",{ref:function(e){return l.current["guideline-down-text"]=e},x:"0",y:"-7",fontSize:"10px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',textAnchor:"middle"})]}))]}))]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("@mui/material"),n=require("./ScrollLockToggle.js"),r=require("../CompareContext.js");exports.default=function(o){var s=o.connectedLines,l=o.pathRefs,d=o.maintainRelativeOrder,a=r.useCompareContext(),c=a.scrollSyncLocked,u=a.toggleScrollSyncLocked,f=a.isGuidelineMode;return t.jsxs(t.Fragment,{children:[s.map(function(i){var n,r,o,s=i.pathD,d=(null===(n=i.style)||void 0===n?void 0:n.badgeBorder)||"#6366F1",a="conn-marker-".concat(i.id),c="".concat(i.id,"-bg"),u="".concat(i.id,"-stroke"),x="".concat(i.id,"-number");return t.jsxs("g",{children:[t.jsx("defs",{children:t.jsx("clipPath",e.__assign({id:"connections-clip"},{children:t.jsx("marker",e.__assign({id:a,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:t.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:d})}))}))}),t.jsx("path",{ref:function(e){l.current[c]=e},d:s,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),t.jsx("path",{ref:function(e){l.current[u]=e},d:s,fill:"none",stroke:d,strokeWidth:"1.75",markerEnd:"url(#".concat(a,")")}),f&&i.matchLabel&&t.jsxs("g",e.__assign({ref:function(e){l.current[x]=e},transform:"translate(".concat(i.x2-42,", ").concat(i.y2,")"),style:{pointerEvents:"none",transition:"visibility 0ms"}},{children:[t.jsx("rect",{x:"-22",y:"-8",width:"44",height:"16",rx:"4",fill:"#FFFFFF"}),t.jsx("rect",{x:"-21",y:"-7",width:"42",height:"14",rx:"3",fill:(null===(r=i.style)||void 0===r?void 0:r.badgeBg)||"#FEF08A",stroke:d,strokeWidth:"1"}),t.jsx("text",e.__assign({x:"0",y:"3.5",fontSize:"9px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',fill:(null===(o=i.style)||void 0===o?void 0:o.badgeText)||d,textAnchor:"middle"},{children:i.matchLabel}))]}))]},i.id)}),t.jsxs("g",{children:[t.jsxs("g",e.__assign({style:{transition:"visibility 0ms"}},{children:[t.jsx("path",{ref:function(e){return l.current["guideline-up-stroke"]=e},fill:"none",strokeWidth:"1.75",visibility:"hidden"}),t.jsxs("g",e.__assign({ref:function(e){return l.current["guideline-up-badge"]=e},visibility:"hidden"},{children:[t.jsx("polygon",{ref:function(e){return l.current["guideline-up-arrow"]=e},points:"-4,0 0,-6 4,0"}),t.jsx("rect",{ref:function(e){return l.current["guideline-up-badge-rect"]=e},x:"-12",y:"3",width:"24",height:"15",rx:"4",fill:"#FFFFFF",strokeWidth:"1"}),t.jsx("text",{ref:function(e){return l.current["guideline-up-text"]=e},x:"0",y:"14",fontSize:"10px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',textAnchor:"middle"})]}))]})),t.jsxs("g",e.__assign({style:{transition:"visibility 0ms"}},{children:[t.jsx("path",{ref:function(e){return l.current["guideline-down-stroke"]=e},fill:"none",strokeWidth:"1.75",visibility:"hidden"}),t.jsxs("g",e.__assign({ref:function(e){return l.current["guideline-down-badge"]=e},visibility:"hidden"},{children:[t.jsx("polygon",{ref:function(e){return l.current["guideline-down-arrow"]=e},points:"-4,0 0,6 4,0"}),t.jsx("rect",{ref:function(e){return l.current["guideline-down-badge-rect"]=e},x:"-12",y:"-18",width:"24",height:"15",rx:"4",fill:"#FFFFFF",strokeWidth:"1"}),t.jsx("text",{ref:function(e){return l.current["guideline-down-text"]=e},x:"0",y:"-7",fontSize:"10px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',textAnchor:"middle"})]}))]}))]}),d&&!f&&s.map(function(r){var o,s;if(void 0===r.x1)return null;var d=(null===(o=r.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",a="".concat(r.id,"-btn"),f=r.x1+40,x=void 0!==r.y1?r.y1:0;return t.jsx("foreignObject",e.__assign({ref:function(e){l.current[a]=e},x:f-12,y:x-12,width:"24",height:"24",style:{pointerEvents:"auto",overflow:"visible"}},{children:t.jsx(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),u&&u(e)},sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",bgcolor:"#FFFFFF",borderRadius:"50%",border:"1px solid ".concat(d),cursor:"pointer",transition:"transform 0.2s ease","&:hover":{transform:"scale(1.05)",boxShadow:"0px 2px 4px rgba(0,0,0,0.1)"}}},{children:t.jsx(n.default,{locked:c,onToggle:u,color:(null===(s=r.style)||void 0===s?void 0:s.badgeText)||d,borderColor:"transparent",size:12})}))}),"".concat(r.id,"-lock"))})]})};
2
2
  //# sourceMappingURL=connectedLines.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("react"),i=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw");function c(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var d,u=c(r),g=c(a),h=[(d=c(l).default,"function"==typeof d?d:(null==d?void 0:d.default)||d)],p=u.default.memo(function(a){var l=a.content,c=a.overlayContent,d=a.sxStyles,p=a.deviationBadges,f=void 0===p?[]:p,v=a.highlights,x=void 0===v?[]:v;a.maintainRelativeOrder;var m=a.highlightBg,_=a.suppressHighlightBg,b=void 0!==_&&_,y=a.collisionKey,B=r.useRef(null),E=!!c,j=r.useMemo(function(){return f.reduce(function(e,t){var r;return n.__assign(n.__assign({},e),((r={})[t.id]=t,r))},{})},[f]),C=r.useRef({badgeMap:j,highlightBg:m,hideHighlightBg:E,suppressHighlightBg:b});C.current={badgeMap:j,highlightBg:m,hideHighlightBg:E,suppressHighlightBg:b};var S=function(e,t){return u.default.Children.map(e,function(e){var r;if(!u.default.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?S(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:i}));return t(o)})},k=r.useMemo(function(){return{mark:function(t){var r,i,o,a,s=t.children,l=n.__rest(t,["children"]),c=C.current,d=c.badgeMap,u=c.highlightBg,g=c.hideHighlightBg,h=c.suppressHighlightBg,p=l["data-badge-id"],f=p?d[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(i=null!=v?v:null===(r=null==f?void 0:f.style)||void 0===r?void 0:r.highlightBg)&&void 0!==i?i:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||h;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),g?{color:"transparent"}:{})},{children:s}))},span:function(r){var a,s,l,c,d,u,g=r.children,h=n.__rest(r,["children"]),p=C.current.badgeMap,f=h["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},h,{children:g}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},h,{children:g}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||i.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),g]}))},table:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:i}))},thead:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:i}))},tbody:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:i}))},tr:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:i}))},th:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:i}))},td:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:i}))},code:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},o,{children:i}))},ol:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},o,{children:i}))},li:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},o,{children:i}))}}},[]),F=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g,"    ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},w=function(n){return n.replace(/[\.,;:]/g," ")},M=r.useMemo(function(){return f.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[f]),A=r.useMemo(function(){var e=F(l||""),t=b?w(e):e,r=(f||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:F((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||m}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(r=a[1])&&void 0!==r?r:"",l=null!==(i=a[2])&&void 0!==i?i:"",c=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+l+"</mark>"+c:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var s="",l="";r.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return"​"+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&b){var c=w(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,u=1;u<i.length;u++)d=s.mixHexColors(d,i[u].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var c=new Set(Object.keys(i));(x||[]).forEach(function(n){if(n){var r=F(n);if(r&&!c.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&b){var s=w(r);-1!==(i=t.indexOf(s))&&(o=!0)}if(-1!==i){var l=e.slice(0,i);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:m||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var d=[],u={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=d;i<o.length;i++){var a=o[i],s=a.start,l=a.end,c=t<l&&r>l&&t>=s,g=t<s&&r>s&&r<=l;if(t>=s&&r<=l){n.orphaned=!0,u[e]=a.matchIdx;break}c&&(t=l),g&&(r=s)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&d.push({start:t,end:r,matchIdx:e})});var g={};Object.entries(u).forEach(function(n){var e=n[0],t=n[1],r=Number(e);g[t]||(g[t]=[]),g[t].push(r)});var h=a.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return h.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),u=Math.max(d,t.end-e);if(!(d>=u)){var g=s.mixHexColors(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,u),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",g,t.badges||[]),c=u}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,g[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[l,f,x,m,b]),T=r.useMemo(function(){return c?F(c||""):""},[c]),z=!!c,O={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},q=n.__assign(n.__assign(n.__assign(n.__assign({},d),O),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),z?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),I=n.__assign(n.__assign(n.__assign({},d),O),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return r.useLayoutEffect(function(){if(B.current){var n=function(){var n=Array.from(B.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=B.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,s=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(B.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[A,y,M]),e.jsxs(t.Box,n.__assign({ref:B,sx:{position:"relative",display:"grid"}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},q),{padding:"3px"})},{children:e.jsx(g.default,n.__assign({components:k,rehypePlugins:h},{children:A.replace(/#{3}/g,"")}))})),z&&e.jsx(t.Typography,n.__assign({component:"div",sx:I},{children:e.jsx(g.default,n.__assign({components:k,rehypePlugins:h},{children:T}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("react"),i=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw"),c=require("remark-gfm");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=d(r),g=d(a),h=d(l),p=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},f=[p(d(c).default)],v=[p(h.default)],x=u.default.memo(function(a){var l=a.content,c=a.overlayContent,d=a.sxStyles,h=a.deviationBadges,p=void 0===h?[]:h,x=a.highlights,m=void 0===x?[]:x;a.maintainRelativeOrder;var _=a.highlightBg,b=a.suppressHighlightBg,y=void 0!==b&&b,B=a.collisionKey,E=r.useRef(null),j=!!c,C=r.useMemo(function(){return p.reduce(function(e,t){var r;return n.__assign(n.__assign({},e),((r={})[t.id]=t,r))},{})},[p]),k=r.useRef({badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y});k.current={badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y};var S=function(e,t){return u.default.Children.map(e,function(e){var r;if(!u.default.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?S(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:i}));return t(o)})},F=r.useMemo(function(){return{mark:function(t){var r,i,o,a,s=t.children,l=n.__rest(t,["children"]),c=k.current,d=c.badgeMap,u=c.highlightBg,g=c.hideHighlightBg,h=c.suppressHighlightBg,p=l["data-badge-id"],f=p?d[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(i=null!=v?v:null===(r=null==f?void 0:f.style)||void 0===r?void 0:r.highlightBg)&&void 0!==i?i:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||h;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),g?{color:"transparent"}:{})},{children:s}))},span:function(r){var a,s,l,c,d,u,g=r.children,h=n.__rest(r,["children"]),p=k.current.badgeMap,f=h["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},h,{children:g}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},h,{children:g}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||i.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),g]}))},table:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:i}))},thead:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:i}))},tbody:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:i}))},tr:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:i}))},th:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:i}))},td:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:i}))},code:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},o,{children:i}))},ol:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},o,{children:i}))},li:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},o,{children:i}))}}},[]),w=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g,"    ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},M=function(n){return n.replace(/[\.,;:]/g," ")},A=r.useMemo(function(){return p.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[p]),T=r.useMemo(function(){var e=w(l||""),t=y?M(e):e,r=(p||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:w((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||_}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(r=a[1])&&void 0!==r?r:"",l=null!==(i=a[2])&&void 0!==i?i:"",c=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+l+"</mark>"+c:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var s="",l="";r.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return"​"+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&y){var c=M(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,u=1;u<i.length;u++)d=s.mixHexColors(d,i[u].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var c=new Set(Object.keys(i));(m||[]).forEach(function(n){if(n){var r=w(n);if(r&&!c.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&y){var s=M(r);-1!==(i=t.indexOf(s))&&(o=!0)}if(-1!==i){var l=e.slice(0,i);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:_||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var d=[],u={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=d;i<o.length;i++){var a=o[i],s=a.start,l=a.end,c=t<l&&r>l&&t>=s,g=t<s&&r>s&&r<=l;if(t>=s&&r<=l){n.orphaned=!0,u[e]=a.matchIdx;break}c&&(t=l),g&&(r=s)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&d.push({start:t,end:r,matchIdx:e})});var g={};Object.entries(u).forEach(function(n){var e=n[0],t=n[1],r=Number(e);g[t]||(g[t]=[]),g[t].push(r)});var h=a.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return h.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),u=Math.max(d,t.end-e);if(!(d>=u)){var g=s.mixHexColors(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,u),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",g,t.badges||[]),c=u}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,g[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[l,p,m,_,y]),z=r.useMemo(function(){return c?w(c||""):""},[c]),O=!!c,q={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},I=n.__assign(n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),O?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),P=n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return r.useLayoutEffect(function(){if(E.current){var n=function(){var n=Array.from(E.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=E.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,s=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(E.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[T,B,A]),e.jsxs(t.Box,n.__assign({ref:E,sx:{position:"relative",display:"grid"}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},I),{padding:"3px"})},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:T.replace(/#{3}/g,"")}))})),O&&e.jsx(t.Typography,n.__assign({component:"div",sx:P},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:z}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=x;
2
2
  //# sourceMappingURL=memoizedMarkdown.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),n=require("react"),t=require("react-markdown"),i=require("rehype-raw"),l=require("./utils/citationData.utils.js"),c=require("./GptWebCitation.module.css.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(t),u=a(i);exports.default=function(t){var i=t.content,a=t.activeHighlightIndex,o=t.onHighlightCountChange,h=n.useRef(null),d=n.useMemo(function(){var e,r=i.match(/id=["']highlighted-\d+["']/g);if(null==r?void 0:r.length)return r.length;var n=i.match(/<a\b[^>]*>/gi);return null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0},[i]),f=n.useMemo(function(){return/id=["']highlighted-\d+["']/.test(i)},[i]);n.useEffect(function(){null==o||o(d)},[d,o]),n.useEffect(function(){var e;if(h.current){var r=h.current.querySelector("#highlighted-".concat(a));if(r)r.scrollIntoView({behavior:"smooth",block:"center"});else null===(e=h.current.querySelectorAll("a[href]")[a])||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[a,i]);var g=n.useMemo(function(){var n=-1;return{span:function(n){n.node;var t=e.__rest(n,["node"]),i=t.id;if(null==i?void 0:i.startsWith("highlighted-")){var l=Number(i.replace("highlighted-",""))===a;return r.jsx("span",e.__assign({},t,{id:i,className:"".concat(c.default.highlight).concat(l?" ".concat(c.default.highlightActive):"")}))}return r.jsx("span",e.__assign({},t))},a:function(t){var i,s=t.children,u=t.href,o=t.title,h=t.className;if(!u)return r.jsx(r.Fragment,{children:s});n+=1;var d=!f&&n===a,g=null!==(i=l.sanitizeExternalUrl(u))&&void 0!==i?i:"#";return r.jsx("a",e.__assign({href:g,title:o,target:"_blank",rel:"noreferrer",className:"".concat(c.default.citationLink).concat(d?" ".concat(c.default.citationLinkActive):"").concat(h?" ".concat(h):"")},{children:s}))},code:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("code",e.__assign({},i,{children:t}))},ol:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("ol",e.__assign({},i,{children:t}))},ul:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("ul",e.__assign({},i,{children:t}))},li:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("li",e.__assign({},i,{children:t}))},p:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("p",e.__assign({},i,{children:t}))}}},[a,f,i]);return r.jsx("div",e.__assign({ref:h,className:c.default.markdownBody},{children:r.jsx(s.default,e.__assign({rehypePlugins:[u.default],components:g},{children:i}))}))};
2
+ //# sourceMappingURL=GptWebCitationMarkdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GptWebCitationMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../store/ref.context.js");require("../UserStoryCard/cws/CwsEvent.js");var i,o=require("../UserStoryCard/cws/CwsEventProvider.js"),r=require("react-hot-toast");exports.SectionStatus=void 0,(i=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",i.IN_PROGRESS="in_progress",i.GENERATED="generated",i.FAILED="failed",i.GENERATE="generate",i.APPROVED="approved";const s=t.createContext(null),a="user-story-lib";exports.ToasterId=a,exports.default=({children:i,userStory:u,setUserStory:l,aiReasoning:d,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:p,customIcons:h,searchQueryList:v,searchQueryReasoningIdList:m,citationConfig:S,chatHistory:I,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,inlineUpdateComponentConfig:b,segmentComponentConfig:j,onEditBlocked:w,inlineManualComponentConfig:P,redlineConfig:q,sectionStatusConfig:D,customSectionConfig:U,updateRedlineDataParent:N,redlineCollaborativeConfig:T})=>{const[_,k]=t.useState(0),[F,L]=t.useState(""),M=t.useMemo(()=>{if(0===u.length||0===d.length)return Array(u.length).fill(0);const e=Array.from({length:u.length},()=>[]);return d.forEach(t=>{const n=Number(t.relevance_score);if(isNaN(n)||n<=0)return;const i=`ai_reasoning$${t.id}`,o=u.findIndex(e=>{var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(n)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,t)=>e+t,0)/e.length))},[u,d]),O=t.useCallback(e=>{var t;const n=u.findIndex(t=>t.artifactId===e);return-1===n?0:null!==(t=M[n])&&void 0!==t?t:0},[u,M]);return e.jsxs(s.Provider,{value:{chatHistory:I,userStory:u,setUserStory:l,aiReasoning:d,setAiReasoning:c,citations:g,setCitations:C,apiCachingConfig:f,customStyles:p,customIcons:h,searchQueryList:v,searchQueryReasoningIdList:m,citationConfig:S,getAvgScoreForStory:O,chatCitationConfigs:R,gptCitationConfigs:x,diffEditConfig:y,aiReasoningAccordionOpenStates:E,persistedDataFiles:A,currentHighlightIndex:_,setCurrentHighlightIndex:k,inlineUpdateComponentConfig:b,segmentComponentConfig:j,onEditBlocked:w,inlineManualComponentConfig:P,redlineConfig:q,redlineDcoumentId:F,setRedlineDocumentId:L,sectionStatusConfig:D,customSectionConfig:U,updateRedlineDataParent:N,redlineCollaborativeConfig:T},children:[e.jsx(r.Toaster,{position:"top-right",toasterId:a}),(null==T?void 0:T.initiateCollaborativeFlow)?e.jsx(o.default,{applicationId:null==T?void 0:T.modeId,baseUrl:null==T?void 0:T.cwsBaseUrl,authToken:null==T?void 0:T.authToken,children:e.jsx(n.RefProvider,{children:i})}):e.jsx(n.RefProvider,{children:i})]})},exports.useRequirementAI=()=>{const e=t.useContext(s);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),n=require("react"),i=require("../../store/ref.context.js");exports.SectionStatus=void 0,(e=exports.SectionStatus||(exports.SectionStatus={})).WAITING="waiting",e.IN_PROGRESS="in_progress",e.GENERATED="generated",e.FAILED="failed",e.GENERATE="generate",e.APPROVED="approved";const o=n.createContext(null);exports.default=({children:e,userStory:r,setUserStory:s,aiReasoning:a,setAiReasoning:u,citations:c,setCitations:d,apiCachingConfig:g,customStyles:l,customIcons:f,searchQueryList:C,searchQueryReasoningIdList:p,citationConfig:h,chatHistory:m,chatCitationConfigs:S,gptCitationConfigs:R,diffEditConfig:I,aiReasoningAccordionOpenStates:v,persistedDataFiles:x,inlineUpdateComponentConfig:y,segmentComponentConfig:A,onEditBlocked:E,inlineManualComponentConfig:D,redlineConfig:P,sectionStatusConfig:N,customSectionConfig:_,updateRedlineDataParent:q})=>{const[b,j]=n.useState(0),[L,M]=n.useState(""),O=n.useMemo(()=>{if(0===r.length||0===a.length)return Array(r.length).fill(0);const e=Array.from({length:r.length},()=>[]);return a.forEach(t=>{const n=Number(t.relevance_score);if(isNaN(n)||n<=0)return;const i=`ai_reasoning$${t.id}`,o=r.findIndex(e=>{var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(n)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,t)=>e+t,0)/e.length))},[r,a]),w=n.useCallback(e=>{var t;const n=r.findIndex(t=>t.artifactId===e);return-1===n?0:null!==(t=O[n])&&void 0!==t?t:0},[r,O]);return t.jsx(o.Provider,{value:{chatHistory:m,userStory:r,setUserStory:s,aiReasoning:a,setAiReasoning:u,citations:c,setCitations:d,apiCachingConfig:g,customStyles:l,customIcons:f,searchQueryList:C,searchQueryReasoningIdList:p,citationConfig:h,getAvgScoreForStory:w,chatCitationConfigs:S,gptCitationConfigs:R,diffEditConfig:I,aiReasoningAccordionOpenStates:v,persistedDataFiles:x,currentHighlightIndex:b,setCurrentHighlightIndex:j,inlineUpdateComponentConfig:y,segmentComponentConfig:A,onEditBlocked:E,inlineManualComponentConfig:D,redlineConfig:P,redlineDcoumentId:L,setRedlineDocumentId:M,sectionStatusConfig:N,customSectionConfig:_,updateRedlineDataParent:q},children:t.jsx(i.RefProvider,{children:e})})},exports.useRequirementAI=()=>{const e=n.useContext(o);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
2
2
  //# sourceMappingURL=RequirementAIWrapper.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),i=require("../Popups/PopupDefaults.js"),t=require("react-markdown"),c=require("rehype-raw"),n=require("./CitationComponent.module.css.js"),l=require("lucide-react"),s=require("../icons/cognitiveBrain.svg.js"),d=require("../icons/aiMagic.svg.js"),r=require("./CitationAnchor.js"),o=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),u=require("../../../../../service/redlineService.js"),m=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),x=require("../cws/CwsEvent.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=p(a),v=p(t),j=p(c);const h=({text:a,item:i})=>e.jsx(v.default,{rehypePlugins:[j.default],components:{ol:({children:a})=>e.jsx("ol",{className:n.default["md-ol"],children:a}),ul:({children:a})=>e.jsx("ul",{className:n.default["md-ul"],children:a}),li:({children:a})=>e.jsx("li",{className:n.default["md-li"],children:a}),a:({node:a,href:t,children:c})=>e.jsx(r.default,{href:t,children:c,metaData:{citations:i.citations,docData:i.docData}})},children:a.replace(/<br\s*\/?>/gi,"\n")}),_=({text:a,markdownStyles:i,citationStyles:t,customIcons:c})=>e.jsx(o.AiReasonMarkdownWrapper,{message:a.replace(/<br\s*\/?>/gi,"\n"),customStyles:i,citationStyles:t,customIcons:c});var N=a.memo(function({item:t,title:c="Cognitive Decisioning AI",relevanceScore:r=0,showRelevanceScore:o=!0,reason:p="No reasoning provided.",impact:v="No Impact provided.",explaination:j="No explaination provided.",gap:N="None",onClose:y=()=>{},onActionTrigger:b,showResolveBtns:g=!1,sections:I,leftIcon:C,scoreIcon:k,className:A,customStyles:S={},markdownStyles:R,citationStyles:q,customIcons:w,actions:B,disableAllActions:D=!1,actionBtnDisabledStyle:H={},onBackClick:$,isImpactNeeded:T=!0,cognitiveTitle:M="Cognitive Integrity",labels:L={},chatHistory:P,openInFullscreenOnClick:E=!1,redlineId:F,aiReasonId:U}){const W=a.useMemo(()=>{const e=Number(r);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[r]),G=a.useMemo(()=>{const e=L&&L.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a})(N)?e:N},[N]),O=L&&L.impact||"Impact",z=L&&L.explanation||"Explaination",J=L&&L.decisionFactors||"Decision Making Factors",K=L&&L.gaps||"Gaps in Decision",Q=L&&L.accept||"Accept",V=L&&L.reject||"Reject",X=L&&L.backAriaLabel||"Go back",{redlineDcoumentId:Y,redlineConfig:Z,updateRedlineDataParent:ee}=m.useRequirementAI(),ae=async e=>{var a,i,t,c,n,l;null==b||b({status:"loading",action:e,metadata:{redlineId:F,aiReasonId:U}});try{const{updated_reqai:s}=await u.resolveRedline({documentId:Y,userEmail:null==Z?void 0:Z.userEmail,userName:null==Z?void 0:Z.userName,redlineId:null!=F?F:"",action:e,baseApiUrl:null==Z?void 0:Z.baseApiUrl,redlineConfigId:null!==(a=null==Z?void 0:Z.redlineConfigId)&&void 0!==a?a:""},null!==(i=null==Z?void 0:Z.token)&&void 0!==i?i:"");await(null==ee?void 0:ee(s)),null===(t=x.default.emit)||void 0===t||t.call(x.default,`redline-edit:${Y}:${null===(l=null===(n=null===(c=null==s?void 0:s.artifactData)||void 0===c?void 0:c.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===l?void 0:l.artifactId}`,{updatedBy:null==Z?void 0:Z.userName}),null==b||b({status:"success",action:e,metadata:{redlineId:F,aiReasonId:U}})}catch(a){null==b||b({status:"failed",action:e,metadata:{redlineId:F,aiReasonId:U}})}},ie=B||[{id:"reject",label:V,onClick:()=>ae("reject"),className:n.default["btn-reject"]},{id:"accept",label:Q,onClick:()=>ae("accept"),className:n.default["btn-accept"]}],te=P&&P.length>0;return e.jsxs("div",{className:`${n.default["cite-acc"]} ${A||""}`,style:{...i.default.CitationAccordionDefaults.container,...null==S?void 0:S.container},children:[$&&e.jsxs("div",{className:n.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:n.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),$&&$()},"aria-label":X,children:"‹"}),e.jsx("span",{className:n.default["cite-acc__backTitle"],children:M})]}),e.jsx("div",{className:n.default["cite-body"],children:I&&I.length>0?I.map(a=>!1===a.show?null:e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],style:{...i.default.CitationAccordionDefaults.innerHeader,...null==S?void 0:S.innerHeader},children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:a.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),y&&y()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...i.default.CitationAccordionDefaults.innerBody,...null==S?void 0:S.innerBody},children:"string"==typeof a.content?e.jsx(h,{text:a.content,item:a.item||t||{}}):a.content})]},a.id||a.title)):e.jsxs(e.Fragment,{children:[T&&e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:O})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),y&&y()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(h,{text:v||"",item:t||{}})})]}),j&&"No explaination provided."!==j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:z})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(h,{text:j||"",item:{}})})]}),e.jsx("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),g&&e.jsx("div",{className:n.default["cite-acc__btn-container"],children:ie.map(a=>{const i=D||a.disabled;return e.jsx("button",{className:a.className,onClick:i?void 0:a.onClick,disabled:i,style:{...a.style,...i?{opacity:.5,cursor:"not-allowed",...H,...a.disabledStyle}:{}},children:a.label},a.id)})})]}),e.jsxs("div",{className:n.default["cite-acc__header"],children:[e.jsxs("div",{className:n.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:n.default["cite-acc__titleIcon"],children:C?"function"==typeof C?f.default.createElement(C):C:e.jsx(s.ReactComponent,{})}),e.jsx("div",{className:n.default["cite-acc__title"],children:c})]}),e.jsx("div",{className:n.default["cite-acc__headerRight"],children:o&&e.jsxs("span",{className:n.default["cite-acc__scoreBadge"],children:[k?"function"==typeof k?f.default.createElement(k):k:e.jsx(d.ReactComponent,{}),e.jsxs("span",{className:n.default["cite-acc__scoreText"],children:[W,"%"]})]})})]}),e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:J})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:te?e.jsx(_,{text:p||"",markdownStyles:R,citationStyles:q,customIcons:w}):e.jsx(h,{text:p||"",item:t||{}})})]}),e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${n.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:K})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:te?e.jsx(_,{text:G||"",markdownStyles:R,citationStyles:q,customIcons:w}):e.jsx(h,{text:G||"",item:t||{}})})]})]})})]})},(e,a)=>e.disableAllActions===a.disableAllActions&&(e.redlineId===a.redlineId&&(e.aiReasonId===a.aiReasonId&&(e.relevanceScore===a.relevanceScore&&(e.reason===a.reason&&(e.impact===a.impact&&(e.explaination===a.explaination&&e.gap===a.gap)))))));exports.default=N;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),i=require("../Popups/PopupDefaults.js"),t=require("react-markdown"),c=require("rehype-raw"),n=require("./CitationComponent.module.css.js"),s=require("lucide-react"),l=require("../icons/cognitiveBrain.svg.js"),d=require("../icons/aiMagic.svg.js"),r=require("./CitationAnchor.js"),o=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),u=require("../../../../../service/redlineService.js"),m=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=x(a),f=x(t),j=x(c);const h=({text:a,item:i})=>e.jsx(f.default,{rehypePlugins:[j.default],components:{ol:({children:a})=>e.jsx("ol",{className:n.default["md-ol"],children:a}),ul:({children:a})=>e.jsx("ul",{className:n.default["md-ul"],children:a}),li:({children:a})=>e.jsx("li",{className:n.default["md-li"],children:a}),a:({node:a,href:t,children:c})=>e.jsx(r.default,{href:t,children:c,metaData:{citations:i.citations,docData:i.docData}})},children:a.replace(/<br\s*\/?>/gi,"\n")}),_=({text:a,markdownStyles:i,citationStyles:t,customIcons:c})=>e.jsx(o.AiReasonMarkdownWrapper,{message:a.replace(/<br\s*\/?>/gi,"\n"),customStyles:i,citationStyles:t,customIcons:c});var v=a.memo(function({item:t,title:c="Cognitive Decisioning AI",relevanceScore:r=0,showRelevanceScore:o=!0,reason:x="No reasoning provided.",impact:f="No Impact provided.",explaination:j="No explaination provided.",gap:v="None",onClose:N=()=>{},onActionTrigger:y,showResolveBtns:b=!1,sections:g,leftIcon:I,scoreIcon:C,className:k,customStyles:A={},markdownStyles:R,citationStyles:S,customIcons:q,actions:w,disableAllActions:H=!1,actionBtnDisabledStyle:B={},onBackClick:D,isImpactNeeded:T=!0,cognitiveTitle:$="Cognitive Integrity",labels:M={},chatHistory:L,openInFullscreenOnClick:P=!1,redlineId:E,aiReasonId:F}){const U=a.useMemo(()=>{const e=Number(r);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[r]),W=a.useMemo(()=>{const e=M&&M.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a})(v)?e:v},[v]),G=M&&M.impact||"Impact",O=M&&M.explanation||"Explaination",z=M&&M.decisionFactors||"Decision Making Factors",J=M&&M.gaps||"Gaps in Decision",K=M&&M.accept||"Accept",Q=M&&M.reject||"Reject",V=M&&M.backAriaLabel||"Go back",{redlineDcoumentId:X,redlineConfig:Y,updateRedlineDataParent:Z}=m.useRequirementAI(),ee=async e=>{var a,i;null==y||y({status:"loading",action:e,metadata:{redlineId:E,aiReasonId:F}});try{const{updated_reqai:t}=await u.resolveRedline({documentId:X,userEmail:null==Y?void 0:Y.userEmail,userName:null==Y?void 0:Y.userName,redlineId:null!=E?E:"",action:e,baseApiUrl:null==Y?void 0:Y.baseApiUrl,redlineConfigId:null!==(a=null==Y?void 0:Y.redlineConfigId)&&void 0!==a?a:""},null!==(i=null==Y?void 0:Y.token)&&void 0!==i?i:"");await(null==Z?void 0:Z(t)),null==y||y({status:"success",action:e,metadata:{redlineId:E,aiReasonId:F}})}catch(a){null==y||y({status:"failed",action:e,metadata:{redlineId:E,aiReasonId:F}})}},ae=w||[{id:"reject",label:Q,onClick:()=>ee("reject"),className:n.default["btn-reject"]},{id:"accept",label:K,onClick:()=>ee("accept"),className:n.default["btn-accept"]}],ie=L&&L.length>0;return e.jsxs("div",{className:`${n.default["cite-acc"]} ${k||""}`,style:{...i.default.CitationAccordionDefaults.container,...null==A?void 0:A.container},children:[D&&e.jsxs("div",{className:n.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:n.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),D&&D()},"aria-label":V,children:"‹"}),e.jsx("span",{className:n.default["cite-acc__backTitle"],children:$})]}),e.jsx("div",{className:n.default["cite-body"],children:g&&g.length>0?g.map(a=>!1===a.show?null:e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],style:{...i.default.CitationAccordionDefaults.innerHeader,...null==A?void 0:A.innerHeader},children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:a.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),N&&N()},children:e.jsx(s.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...i.default.CitationAccordionDefaults.innerBody,...null==A?void 0:A.innerBody},children:"string"==typeof a.content?e.jsx(h,{text:a.content,item:a.item||t||{}}):a.content})]},a.id||a.title)):e.jsxs(e.Fragment,{children:[T&&e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:G})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),N&&N()},children:e.jsx(s.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(h,{text:f||"",item:t||{}})})]}),j&&"No explaination provided."!==j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:O})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(h,{text:j||"",item:{}})})]}),e.jsx("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),b&&e.jsx("div",{className:n.default["cite-acc__btn-container"],children:ae.map(a=>{const i=H||a.disabled;return e.jsx("button",{className:a.className,onClick:i?void 0:a.onClick,disabled:i,style:{...a.style,...i?{opacity:.5,cursor:"not-allowed",...B,...a.disabledStyle}:{}},children:a.label},a.id)})})]}),e.jsxs("div",{className:n.default["cite-acc__header"],children:[e.jsxs("div",{className:n.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:n.default["cite-acc__titleIcon"],children:I?"function"==typeof I?p.default.createElement(I):I:e.jsx(l.ReactComponent,{})}),e.jsx("div",{className:n.default["cite-acc__title"],children:c})]}),e.jsx("div",{className:n.default["cite-acc__headerRight"],children:o&&e.jsxs("span",{className:n.default["cite-acc__scoreBadge"],children:[C?"function"==typeof C?p.default.createElement(C):C:e.jsx(d.ReactComponent,{}),e.jsxs("span",{className:n.default["cite-acc__scoreText"],children:[U,"%"]})]})})]}),e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:z})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:ie?e.jsx(_,{text:x||"",markdownStyles:R,citationStyles:S,customIcons:q}):e.jsx(h,{text:x||"",item:t||{}})})]}),e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${n.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:J})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:ie?e.jsx(_,{text:W||"",markdownStyles:R,citationStyles:S,customIcons:q}):e.jsx(h,{text:W||"",item:t||{}})})]})]})})]})},(e,a)=>e.disableAllActions===a.disableAllActions&&(e.redlineId===a.redlineId&&(e.aiReasonId===a.aiReasonId&&(e.relevanceScore===a.relevanceScore&&(e.reason===a.reason&&(e.impact===a.impact&&(e.explaination===a.explaination&&e.gap===a.gap)))))));exports.default=v;
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("react"),n=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var o=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),r=require("@mui/material"),s=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../../../../../service/redlineService.js"),a=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),c=require("../cws/CwsEvent.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=p(t);const g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],u=({toneIndex:i,configs:t=g})=>{const n=Math.min(i,t.length-1),{color:o,angle:l,arcD:r}=t[n]||t[1]||t[0],s=(l-90)*Math.PI/180,d=11+9*Math.cos(s),a=13+9*Math.sin(s);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:r,stroke:o,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:d,y2:a,stroke:o,strokeWidth:"2",strokeLinecap:"round"})]})},v=({type:i,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[i]||n.Medium;return e.jsx("div",{style:o,children:i})},h=["Lenient","Balanced","Aggressive"],m={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},y={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},f={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},j={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},w={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},b={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},C={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},I={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},T={display:"flex",gap:8,marginBottom:18},B={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},A={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},E={borderTop:"0.5px solid #eee",padding:"14px 0px"},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},D={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},F={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},z={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},L={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},M={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},_={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},q=t.memo(function({onAssignClick:i,onOpenCognitive:t,cognitiveIconSmall:n,cognitiveTootipTitle:o,historyIconSmall:l,onHistoryClick:r,historyTootipTitle:s}){const d="20px";return e.jsxs("div",{style:{..._,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),t&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>t(e),children:[n&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:n}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),r&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>r(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})]})}),O=t.memo(function({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d}){const[a,c]=t.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!a),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),a&&e.jsx(q,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d})]})}),N=t.memo(function({users:i,onClick:t}){const n=i.length;return e.jsxs("div",{onClick:t,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),n>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",n-1]})]})}),P=t.memo(function({steps:i}){if(!(null==i?void 0:i.length))return null;const t=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:t?"6px 8px":"8px 10px",background:"#F8FAFC",gap:t?4:8,overflow:"hidden"},children:i.map((n,o)=>{const l=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(o),r=o===i.length-1;return e.jsxs(x.default.Fragment,{children:[e.jsxs("div",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:t?4:6,overflow:"hidden"},children:[(s=n.status,"approved"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:t?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:t?20:22,height:t?20:22,minWidth:t?20:22,borderRadius:"50%",background:l.bg,color:l.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!r&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"18",height:t?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:t?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var s})})})});var $=t.memo(function({onClose:p,aiReason:x,onActionTrigger:_,onIterate:q,initialTone:$,onRegenerate:V,labels:U={},toneLevelsConfig:G=h,toneColorsConfig:K=m,dialConfigs:X=g,actions:J,disableAllActions:Q=!1,customStyles:Y={},severityChipStyles:Z={},customIcons:ee={},onOpenCognitive:ie,onHistoryClick:te,historyIconSmall:ne,historyTootipTitle:oe,showTone:le=!0,cognitiveSectionStyle:re={},cognitiveScoreBadgeStyle:se={},cognitiveScoreTextStyle:de={},cognitiveStyles:ae={},cognitiveClassNames:ce={},cognitiveTitle:pe="Cognitive Integrity",cognitiveTootipTitle:xe="Cognitive Decisioning",cognitiveLeftIcon:ge,cognitiveIconSmall:ue,showCognitiveRightArrow:ve=!0,isStreaming:he,onAssignClick:me,assignedUsers:ye,onReviewUsersClick:fe,redlineId:je,aiReasonId:we,displayVariant:Se="default",reviewTitle:be,reviewSubtitle:Ce,reviewStatusIcon:ke=e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:Ie=[],showReviewProgress:Te=!1,showOriginalText:Be=!1,originalText:Ae,originalTextHeader:Ee="Original text",hideSummaryText:Re=!1,hideSeverityChip:We=!1}){var De,Fe,ze,Le,Me,He,_e,qe,Oe,Ne,Pe,$e,Ve,Ue,Ge,Ke,Xe,Je,Qe,Ye;let Ze=G.findIndex(e=>e===$);-1===Ze&&(Ze=1);const[ei,ii]=t.useState(!0),[ti,ni]=t.useState(!1),[oi,li]=t.useState(!1),[ri,si]=t.useState(Ze),[di]=t.useState(Ze),[ai,ci]=t.useState(!0),pi="review"===Se,xi=G[ri],gi=K[xi]||"#BA7517",ui=ri!==di,vi=[{id:"iterate",icon:ee.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:U.btnIterate||"Iterate",color:"#64748B",onClick:q},{id:"accept",icon:ee.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:U.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:ee.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:U.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:hi,redlineConfig:mi,updateRedlineDataParent:yi}=s.useRequirementAI(),fi=J||vi;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...y,...null===(De=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===De?void 0:De.root},children:[e.jsxs("div",{style:{...f,...null===(Fe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Fe?void 0:Fe.header,marginBottom:pi?14:oi?"16px":"12px",...pi&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[pi?e.jsxs("div",{style:{minWidth:0,flex:"1 1 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:ke||ee.summaryIcon||"⏳"}),e.jsx("span",{children:be||"Redline In Review"})]}),e.jsx("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ce||(null===(ze=null==x?void 0:x.redlining_details)||void 0===ze?void 0:ze.redline_title)})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:ee.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...j,...null===(Le=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Le?void 0:Le.title},children:U.summaryHeader||"Summary"})]}),ye&&ye.length>0&&e.jsx(N,{users:ye,onClick:e=>{e.stopPropagation(),null==fe||fe()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(me||ie||te)&&e.jsx(O,{onAssignClick:me,onOpenCognitive:ie,cognitiveIconSmall:ue,cognitiveTootipTitle:xe,historyIconSmall:ne,onHistoryClick:te,historyTootipTitle:oe}),e.jsx("button",{onClick:p,style:{...A,...null===(Me=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Me?void 0:Me.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),pi&&Te&&Ie.length>0&&e.jsx(P,{steps:Ie}),!Re&&!pi&&e.jsx(e.Fragment,{children:e.jsx(r.Tooltip,{title:null===(He=null==x?void 0:x.redlining_details)||void 0===He?void 0:He.redline_title,children:e.jsx("p",{style:{...w,...null===(_e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===_e?void 0:_e.bodyText},children:null===(qe=null==x?void 0:x.redlining_details)||void 0===qe?void 0:qe.redline_title})})}),e.jsx("p",{style:{...S,...null===(Oe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.summary},children:null===(Ne=null==x?void 0:x.redlining_details)||void 0===Ne?void 0:Ne.redline_summary}),e.jsxs("div",{style:{...b,...null===(Pe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>ii(!ei),style:{...k,...null===($e=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===$e?void 0:$e.impactToggle},children:[e.jsx("span",{style:{...I,...null===(Ve=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.impactToggleLabel},children:U.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ei?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(v,{type:(null==x?void 0:x.severity)||"Medium",customStyles:Z})]}),ei&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...C,...null===(Ue=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ue?void 0:Ue.impactText},children:e.jsx(a.AiReasonMarkdownWrapper,{message:`${null!==(Ke=null===(Ge=null==x?void 0:x.redlining_details)||void 0===Ge?void 0:Ge.redline_impact)&&void 0!==Ke?Ke:U.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Xe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.impactMarkdown})})})]}),pi&&Be&&e.jsxs("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e.jsxs("button",{onClick:()=>ci(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[e.jsx("span",{children:Ee}),e.jsx(i.ChevronDown,{size:18,color:"#1E293B",style:{transform:ai?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),ai&&e.jsxs("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Ae||"","”"]})]}),e.jsx("div",{style:{...T,...null===(Je=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Je?void 0:Je.actionContainer},children:fi.map(i=>{var t,n;const o=Q||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...B,...null===(n=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{var e,t;if(i.useLabel)try{await(null===(e=i.onClick)||void 0===e?void 0:e.call(i))}finally{await(async e=>{var i,t,n,o,l,r;null==_||_({status:"loading",action:e,metadata:{redlineId:je,aiReasonId:we}});try{const{updated_reqai:s}=await d.resolveRedline({documentId:hi,userEmail:null==mi?void 0:mi.userEmail,userName:null==mi?void 0:mi.userName,redlineId:null!==(i=null==x?void 0:x.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==mi?void 0:mi.baseApiUrl,redlineConfigId:null!==(t=null==mi?void 0:mi.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==mi?void 0:mi.token)&&void 0!==n?n:"");await(null==yi?void 0:yi(s)),c.default.emit(`redline-edit:${hi}:${null===(r=null===(l=null===(o=null==s?void 0:s.artifactData)||void 0===o?void 0:o.userStorySnapshot)||void 0===l?void 0:l[0])||void 0===r?void 0:r.artifactId}`,{updatedBy:null==mi?void 0:mi.userName}),null==_||_({status:"success",action:e,metadata:{redlineId:je,aiReasonId:we}})}catch(i){null==_||_({status:"failed",action:e,metadata:{redlineId:je,aiReasonId:we}})}})(i.id.toLowerCase())}else await(null===(t=i.onClick)||void 0===t?void 0:t.call(i))},disabled:o,children:[i.icon,i.label]},i.id)})}),le&&e.jsxs("div",{style:{...E,...null===(Qe=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.toneContainer},children:[e.jsxs("button",{onClick:()=>ni(!ti),style:{...R,...null===(Ye=null==Y?void 0:Y.DeviationSummaryStyles)||void 0===Ye?void 0:Ye.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(u,{toneIndex:ri,configs:X}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:U.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ti?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),ti&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:U.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(n.ToneToggle,{isDirty:ui,onToneChange:e=>{si(e)},toneColor:gi,toneIndex:ri,onClickRegenerate:()=>null==V?void 0:V(xi),toneLabels:G,isStreaming:he,aiReason:x})]})]}),ie&&e.jsxs("div",{className:null==ce?void 0:ce.section,onClick:e=>{e.stopPropagation(),ie&&ie(e)},style:{...W,...null==ae?void 0:ae.section,...re},children:[e.jsxs("div",{className:null==ce?void 0:ce.headerLeft,style:{...D,...null==ae?void 0:ae.headerLeft},children:[e.jsx("span",{className:null==ce?void 0:ce.titleIcon,style:{...F,...null==ae?void 0:ae.titleIcon},children:null!=ge?ge:e.jsx(o.ReactComponent,{})}),e.jsx("div",{className:null==ce?void 0:ce.cognitiveTitle,style:{...z,...null==ae?void 0:ae.cognitiveTitle},children:pe})]}),e.jsxs("div",{className:null==ce?void 0:ce.headerRight,style:{...L,...null==ae?void 0:ae.headerRight},children:[void 0!==(null==x?void 0:x.relevance_score)&&null!==(null==x?void 0:x.relevance_score)?e.jsxs("span",{className:null==ce?void 0:ce.scoreBadge,style:{...M,...null==ae?void 0:ae.scoreBadge,...se},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ce?void 0:ce.scoreText,style:{...H,...null==ae?void 0:ae.scoreText,...de},children:[Math.round(Number(x.relevance_score)),"%"]})]}):null,ve&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});exports.AssignMenu=q,exports.DisplayUsers=N,exports.KebabMenu=O,exports.default=$;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("react"),n=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var o=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),r=require("@mui/material"),s=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../../../../../service/redlineService.js"),a=require("../../ai-reasoning/AiReasonMarkdownWrapper.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=c(t);const x=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],g=({toneIndex:i,configs:t=x})=>{const n=Math.min(i,t.length-1),{color:o,angle:l,arcD:r}=t[n]||t[1]||t[0],s=(l-90)*Math.PI/180,d=11+9*Math.cos(s),a=13+9*Math.sin(s);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:r,stroke:o,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:d,y2:a,stroke:o,strokeWidth:"2",strokeLinecap:"round"})]})},u=({type:i,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[i]||n.Medium;return e.jsx("div",{style:o,children:i})},h=["Lenient","Balanced","Aggressive"],v={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},m={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},y={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},f={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},j={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},w={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},S={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},b={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},C={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},k={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},I={display:"flex",gap:8,marginBottom:18},T={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},B={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},A={borderTop:"0.5px solid #eee",padding:"14px 0px"},E={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},R={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},W={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},D={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},F={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},z={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},L={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},M={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},H={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},_=t.memo(function({onAssignClick:i,onOpenCognitive:t,cognitiveIconSmall:n,cognitiveTootipTitle:o,historyIconSmall:l,onHistoryClick:r,historyTootipTitle:s}){const d="20px";return e.jsxs("div",{style:{...H,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),t&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>t(e),children:[n&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:n}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),r&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>r(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})]})}),O=t.memo(function({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d}){const[a,c]=t.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!a),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),a&&e.jsx(_,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d})]})}),q=t.memo(function({users:i,onClick:t}){const n=i.length;return e.jsxs("div",{onClick:t,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),n>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",n-1]})]})}),P=t.memo(function({steps:i}){if(!(null==i?void 0:i.length))return null;const t=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:t?"6px 8px":"8px 10px",background:"#F8FAFC",gap:t?4:8,overflow:"hidden"},children:i.map((n,o)=>{const l=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(o),r=o===i.length-1;return e.jsxs(p.default.Fragment,{children:[e.jsxs("div",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:t?4:6,overflow:"hidden"},children:[(s=n.status,"approved"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:t?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:t?20:22,height:t?20:22,minWidth:t?20:22,borderRadius:"50%",background:l.bg,color:l.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!r&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"18",height:t?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:t?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var s})})})});var N=t.memo(function({onClose:c,aiReason:p,onActionTrigger:H,onIterate:_,initialTone:N,onRegenerate:$,labels:V={},toneLevelsConfig:U=h,toneColorsConfig:G=v,dialConfigs:K=x,actions:X,disableAllActions:J=!1,customStyles:Q={},severityChipStyles:Y={},customIcons:Z={},onOpenCognitive:ee,onHistoryClick:ie,historyIconSmall:te,historyTootipTitle:ne,showTone:oe=!0,cognitiveSectionStyle:le={},cognitiveScoreBadgeStyle:re={},cognitiveScoreTextStyle:se={},cognitiveStyles:de={},cognitiveClassNames:ae={},cognitiveTitle:ce="Cognitive Integrity",cognitiveTootipTitle:pe="Cognitive Decisioning",cognitiveLeftIcon:xe,cognitiveIconSmall:ge,showCognitiveRightArrow:ue=!0,isStreaming:he,onAssignClick:ve,assignedUsers:me,onReviewUsersClick:ye,redlineId:fe,aiReasonId:je,displayVariant:we="default",reviewTitle:Se,reviewSubtitle:be,reviewStatusIcon:Ce=e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:ke=[],showReviewProgress:Ie=!1,showOriginalText:Te=!1,originalText:Be,originalTextHeader:Ae="Original text",hideSummaryText:Ee=!1,hideSeverityChip:Re=!1}){var We,De,Fe,ze,Le,Me,He,_e,Oe,qe,Pe,Ne,$e,Ve,Ue,Ge,Ke,Xe,Je,Qe;let Ye=U.findIndex(e=>e===N);-1===Ye&&(Ye=1);const[Ze,ei]=t.useState(!0),[ii,ti]=t.useState(!1),[ni,oi]=t.useState(!1),[li,ri]=t.useState(Ye),[si]=t.useState(Ye),[di,ai]=t.useState(!0),ci="review"===we,pi=U[li],xi=G[pi]||"#BA7517",gi=li!==si,ui=[{id:"iterate",icon:Z.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:V.btnIterate||"Iterate",color:"#64748B",onClick:_},{id:"accept",icon:Z.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:V.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:Z.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:V.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:hi,redlineConfig:vi,updateRedlineDataParent:mi}=s.useRequirementAI(),yi=X||ui;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...m,...null===(We=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===We?void 0:We.root},children:[e.jsxs("div",{style:{...y,...null===(De=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===De?void 0:De.header,marginBottom:ci?14:ni?"16px":"12px",...ci&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[ci?e.jsxs("div",{style:{minWidth:0,flex:"1 1 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:Ce||Z.summaryIcon||"⏳"}),e.jsx("span",{children:Se||"Redline In Review"})]}),e.jsx("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:be||(null===(Fe=null==p?void 0:p.redlining_details)||void 0===Fe?void 0:Fe.redline_title)})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:Z.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...f,...null===(ze=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===ze?void 0:ze.title},children:V.summaryHeader||"Summary"})]}),me&&me.length>0&&e.jsx(q,{users:me,onClick:e=>{e.stopPropagation(),null==ye||ye()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(ve||ee||ie)&&e.jsx(O,{onAssignClick:ve,onOpenCognitive:ee,cognitiveIconSmall:ge,cognitiveTootipTitle:pe,historyIconSmall:te,onHistoryClick:ie,historyTootipTitle:ne}),e.jsx("button",{onClick:c,style:{...B,...null===(Le=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Le?void 0:Le.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),ci&&Ie&&ke.length>0&&e.jsx(P,{steps:ke}),!Ee&&!ci&&e.jsx(e.Fragment,{children:e.jsx(r.Tooltip,{title:null===(Me=null==p?void 0:p.redlining_details)||void 0===Me?void 0:Me.redline_title,children:e.jsx("p",{style:{...j,...null===(He=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===He?void 0:He.bodyText},children:null===(_e=null==p?void 0:p.redlining_details)||void 0===_e?void 0:_e.redline_title})})}),e.jsx("p",{style:{...w,...null===(Oe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.summary},children:null===(qe=null==p?void 0:p.redlining_details)||void 0===qe?void 0:qe.redline_summary}),e.jsxs("div",{style:{...S,...null===(Pe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>ei(!Ze),style:{...C,...null===(Ne=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ne?void 0:Ne.impactToggle},children:[e.jsx("span",{style:{...k,...null===($e=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===$e?void 0:$e.impactToggleLabel},children:V.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ze?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(u,{type:(null==p?void 0:p.severity)||"Medium",customStyles:Y})]}),Ze&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...b,...null===(Ve=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.impactText},children:e.jsx(a.AiReasonMarkdownWrapper,{message:`${null!==(Ge=null===(Ue=null==p?void 0:p.redlining_details)||void 0===Ue?void 0:Ue.redline_impact)&&void 0!==Ge?Ge:V.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Ke=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ke?void 0:Ke.impactMarkdown})})})]}),ci&&Te&&e.jsxs("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e.jsxs("button",{onClick:()=>ai(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[e.jsx("span",{children:Ae}),e.jsx(i.ChevronDown,{size:18,color:"#1E293B",style:{transform:di?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),di&&e.jsxs("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Be||"","”"]})]}),e.jsx("div",{style:{...I,...null===(Xe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.actionContainer},children:yi.map(i=>{var t,n;const o=J||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...T,...null===(n=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{var e,t;if(i.useLabel)try{await(null===(e=i.onClick)||void 0===e?void 0:e.call(i))}finally{await(async e=>{var i,t,n;null==H||H({status:"loading",action:e,metadata:{redlineId:fe,aiReasonId:je}});try{const{updated_reqai:o}=await d.resolveRedline({documentId:hi,userEmail:null==vi?void 0:vi.userEmail,userName:null==vi?void 0:vi.userName,redlineId:null!==(i=null==p?void 0:p.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==vi?void 0:vi.baseApiUrl,redlineConfigId:null!==(t=null==vi?void 0:vi.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==vi?void 0:vi.token)&&void 0!==n?n:"");await(null==mi?void 0:mi(o)),null==H||H({status:"success",action:e,metadata:{redlineId:fe,aiReasonId:je}})}catch(i){null==H||H({status:"failed",action:e,metadata:{redlineId:fe,aiReasonId:je}})}})(i.id.toLowerCase())}else await(null===(t=i.onClick)||void 0===t?void 0:t.call(i))},disabled:o,children:[i.icon,i.label]},i.id)})}),oe&&e.jsxs("div",{style:{...A,...null===(Je=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Je?void 0:Je.toneContainer},children:[e.jsxs("button",{onClick:()=>ti(!ii),style:{...E,...null===(Qe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(g,{toneIndex:li,configs:K}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:V.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ii?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),ii&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:V.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(n.ToneToggle,{isDirty:gi,onToneChange:e=>{ri(e)},toneColor:xi,toneIndex:li,onClickRegenerate:()=>null==$?void 0:$(pi),toneLabels:U,isStreaming:he,aiReason:p})]})]}),ee&&e.jsxs("div",{className:null==ae?void 0:ae.section,onClick:e=>{e.stopPropagation(),ee&&ee(e)},style:{...R,...null==de?void 0:de.section,...le},children:[e.jsxs("div",{className:null==ae?void 0:ae.headerLeft,style:{...W,...null==de?void 0:de.headerLeft},children:[e.jsx("span",{className:null==ae?void 0:ae.titleIcon,style:{...D,...null==de?void 0:de.titleIcon},children:null!=xe?xe:e.jsx(o.ReactComponent,{})}),e.jsx("div",{className:null==ae?void 0:ae.cognitiveTitle,style:{...F,...null==de?void 0:de.cognitiveTitle},children:ce})]}),e.jsxs("div",{className:null==ae?void 0:ae.headerRight,style:{...z,...null==de?void 0:de.headerRight},children:[void 0!==(null==p?void 0:p.relevance_score)&&null!==(null==p?void 0:p.relevance_score)?e.jsxs("span",{className:null==ae?void 0:ae.scoreBadge,style:{...L,...null==de?void 0:de.scoreBadge,...re},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ae?void 0:ae.scoreText,style:{...M,...null==de?void 0:de.scoreText,...se},children:[Math.round(Number(p.relevance_score)),"%"]})]}):null,ue&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});exports.AssignMenu=_,exports.DisplayUsers=q,exports.KebabMenu=O,exports.default=N;
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./IterateComponent.js");exports.default=function({onBack:o,onApply:n,historicalClausesData:i=[],isLoadingHistory:s,headerTitle:l="Historical Recommendations",customStyles:a={}}){const d={...r.styles,...a},c=({clause:r,index:o})=>{const[i,s]=t.useState(!1),[l,a]=t.useState(!1),[c,p]=t.useState(!1),x=t.useRef(null),[u,f]=t.useState(!1),h=r.title||r.filename,g=r.content||r.excerpt||"",b=((e=0)=>e>=80?{bg:"#dcfce7",text:"#166534",border:"#bbf7d0"}:e>=50?{bg:"#fef9c3",text:"#854d0e",border:"#fef08a"}:{bg:"#fee2e2",text:"#991b1b",border:"#fecaca"})(r.relevance_score),y=c&&h,v=0===o;return t.useEffect(()=>{const e=x.current;if(!e)return;const t=()=>{i||f(e.scrollHeight>e.clientHeight)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[g,i]),e.jsxs("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{...d.clauseCard,display:"flex",flexDirection:"column",gap:6,textAlign:"left",backgroundColor:l?"#f8fafc":"#fff",borderColor:l?"#cbd5e1":"#dde5f0",transition:"all 0.2s ease"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"8px"},children:[e.jsxs("div",{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{position:"relative",flex:1,minWidth:0},children:[e.jsx("p",{style:{...d.clauseFilename,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",cursor:"default"},children:h}),y&&e.jsx("div",{style:{position:"absolute",top:v?"100%":"auto",bottom:v?"auto":"100%",marginTop:v?"6px":"0px",marginBottom:v?"0px":"6px",left:0,backgroundColor:"#1E293B",color:"#fff",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:400,zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"normal",wordBreak:"break-word",width:"max-content",maxWidth:"220px",pointerEvents:"none",lineHeight:1.4},children:h})]}),void 0!==r.relevance_score&&e.jsxs("div",{style:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:12,border:`1px solid ${b.border}`,backgroundColor:b.bg,color:b.text,whiteSpace:"nowrap",flexShrink:0},children:[r.relevance_score,"% Match"]})]}),e.jsxs("div",{ref:x,onClick:e=>e.stopPropagation(),style:{...d.clauseExcerpt,margin:0,display:i?"block":"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:i?"unset":3,overflowY:i?"auto":"hidden",overflowX:"hidden",maxHeight:i?"100px":"none",paddingRight:i?"4px":"0px",cursor:"auto"},children:['"',g,'"']}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginTop:"4px"},children:[e.jsx("div",{children:(u||i)&&e.jsx("span",{onClick:e=>{e.stopPropagation(),i&&x.current&&(x.current.scrollTop=0),s(!i)},style:{fontSize:12,color:"#2563EB",fontWeight:500,cursor:"pointer"},children:i?"View Less":"...View More"})}),e.jsx("button",{onClick:()=>null==n?void 0:n({type:"history",value:r}),style:{backgroundColor:"#F8FAFC",color:"#0F172A",border:"1px solid #CBD5E1",borderRadius:"6px",padding:"4px 12px",fontSize:"12px",fontWeight:500,cursor:"pointer",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#F1F5F9",e.currentTarget.style.borderColor="#94A3B8"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#F8FAFC",e.currentTarget.style.borderColor="#CBD5E1"},children:"Proceed"})]})]})};return e.jsxs("div",{style:d.card,children:[e.jsxs("div",{style:d.header,children:[e.jsx("button",{onClick:o,style:d.backBtn,"aria-label":"Go back",children:"‹"}),e.jsx("span",{style:d.headerTitle,children:l})]}),e.jsx("div",{style:{...d.body,paddingTop:12,paddingBottom:16},children:s?e.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",color:"#64748B",fontSize:13},children:[e.jsx("style",{children:"\n @keyframes iterateSpinner {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "}),e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"iterateSpinner 1s linear infinite"},children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),"Fetching recommendations..."]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,maxHeight:"40vh",overflowY:"auto",paddingRight:"4px"},children:[null==i?void 0:i.map((t,r)=>e.jsx(c,{clause:t,index:r},t.id)),(!i||0===i.length)&&e.jsx("p",{style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"},children:"No clauses found"})]})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./IterateComponent.js");exports.default=function({onBack:o,onApply:n,historicalClausesData:i=[],isLoadingHistory:s,headerTitle:l="Historical Recommendations",customStyles:a={}}){const d={...r.styles,...a},c=({clause:r})=>{const[o,i]=t.useState(!1),[s,l]=t.useState(!1),[a,c]=t.useState(!1),p=r.title||r.filename,x=r.content||r.excerpt||"",u=((e=0)=>e>=80?{bg:"#dcfce7",text:"#166534",border:"#bbf7d0"}:e>=50?{bg:"#fef9c3",text:"#854d0e",border:"#fef08a"}:{bg:"#fee2e2",text:"#991b1b",border:"#fecaca"})(r.relevance_score),h=x.length>120,f=a&&p;return e.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{...d.clauseCard,display:"flex",flexDirection:"column",gap:6,textAlign:"left",backgroundColor:s?"#f8fafc":"#fff",borderColor:s?"#cbd5e1":"#dde5f0",transition:"all 0.2s ease"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"8px"},children:[e.jsxs("div",{onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{position:"relative",flex:1,minWidth:0},children:[e.jsx("p",{style:{...d.clauseFilename,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:p}),f&&e.jsx("div",{style:{position:"absolute",top:"100%",left:0,marginTop:"4px",backgroundColor:"#1E293B",color:"#fff",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:400,zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"normal",wordBreak:"break-word",width:"max-content",maxWidth:"220px",pointerEvents:"none",lineHeight:1.4},children:p})]}),void 0!==r.relevance_score&&e.jsxs("div",{style:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:12,border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,whiteSpace:"nowrap",flexShrink:0},children:[r.relevance_score,"% Match"]})]}),e.jsxs("div",{onClick:e=>e.stopPropagation(),style:{...d.clauseExcerpt,margin:0,display:o?"block":"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o?"unset":3,overflowY:o?"auto":"hidden",overflowX:"hidden",maxHeight:o?"150px":"none",paddingRight:o?"4px":"0px",cursor:"auto"},children:['"',x,'"']}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginTop:"4px"},children:[e.jsx("div",{children:h&&e.jsx("span",{onClick:e=>i(!o),style:{fontSize:12,color:"#2563EB",fontWeight:500,cursor:"pointer"},children:o?"View Less":"...View More"})}),e.jsx("button",{onClick:()=>null==n?void 0:n({type:"history",value:r}),style:{backgroundColor:"#F8FAFC",color:"#0F172A",border:"1px solid #E2E8F0",borderRadius:"6px",padding:"4px 12px",fontSize:"12px",fontWeight:400,cursor:"pointer",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#F1F5F9",e.currentTarget.style.borderColor="#CBD5E1"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#F8FAFC",e.currentTarget.style.borderColor="#E2E8F0"},children:"Proceed"})]})]})};return e.jsxs("div",{style:d.card,children:[e.jsxs("div",{style:d.header,children:[e.jsx("button",{onClick:o,style:d.backBtn,"aria-label":"Go back",children:"‹"}),e.jsx("span",{style:d.headerTitle,children:l})]}),e.jsx("div",{style:{...d.body,paddingTop:12,paddingBottom:16},children:s?e.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",color:"#64748B",fontSize:13},children:[e.jsx("style",{children:"\n @keyframes iterateSpinner {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "}),e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"iterateSpinner 1s linear infinite"},children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),"Fetching recommendations..."]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,maxHeight:"40vh",overflowY:"auto",paddingRight:"4px"},children:[null==i?void 0:i.map(t=>e.jsx(c,{clause:t},t.id)),(!i||0===i.length)&&e.jsx("p",{style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"},children:"No clauses found"})]})})]})};
2
2
  //# sourceMappingURL=HistoryMenu.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../../../../service/redlineService.js"),d=require("../cws/CwsEvent.js");require("react");const t={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:o,editorInfo:r,headerText:a,btnsConfig:s,labelText:c,onActionTrigger:u,aiReason:v=null}){var p,f;const{redlineDcoumentId:x,redlineConfig:b,updateRedlineDataParent:g}=l.useRequirementAI(),y=async e=>{var i,l,t,o,r,a,s;null==u||u({status:"loading",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}});try{const{updated_reqai:c}=await n.resolveRedline({documentId:x,userEmail:null==b?void 0:b.userEmail,userName:null==b?void 0:b.userName,redlineId:null!==(i=null==v?void 0:v.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==b?void 0:b.baseApiUrl,redlineConfigId:null!==(l=null==b?void 0:b.redlineConfigId)&&void 0!==l?l:""},null!==(t=null==b?void 0:b.token)&&void 0!==t?t:"");await(null==g?void 0:g(c)),null===(o=d.default.emit)||void 0===o||o.call(d.default,`redline-edit:${x}:${null===(s=null===(a=null===(r=null==c?void 0:c.artifactData)||void 0===r?void 0:r.userStorySnapshot)||void 0===a?void 0:a[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==b?void 0:b.userName}),null==u||u({status:"success",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}catch(i){null==u||u({status:"failed",action:e,metadata:{redlineId:null==v?void 0:v.redline_id,aiReasonId:null==v?void 0:v.id}})}};return e.jsxs("div",{style:t.popup,children:[e.jsxs("div",{style:t.header,children:[e.jsx("span",{style:t.title,children:a||"Manually Edited"}),e.jsx("button",{onClick:o,style:t.closeButton,"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{style:t.content,children:[e.jsxs("div",{style:t.labelRow,children:[e.jsx(i.UserPen,{}),e.jsx("span",{style:t.label,children:c||"Edited By"})]}),e.jsx("div",{style:t.editorInfo,children:r}),e.jsx("div",{style:t.divider}),e.jsxs("div",{style:t.actions,children:[null==s?void 0:s.map(i=>e.jsxs("button",{style:{...t.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==v?void 0:v.redline_id,id:null==v?void 0:v.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(p=null==v?void 0:v.redlining_details)||void 0===p?void 0:p.status)||"rejected"===(null===(f=null==v?void 0:v.redlining_details)||void 0===f?void 0:f.status))&&e.jsxs("div",{style:t.resolveActions,children:[e.jsxs("button",{style:{...t.actionBtn,...(null==v?void 0:v.resolving)?t.actionBtnDisabled:{}},disabled:null==v?void 0:v.resolving,onClick:()=>y("accept"),children:[e.jsx(i.CheckCircle,{size:16,color:"#10B981"})," ","Adopt"]}),e.jsxs("button",{style:{...t.actionBtn,...(null==v?void 0:v.resolving)?t.actionBtnDisabled:{}},onClick:()=>y("reject"),disabled:null==v?void 0:v.resolving,children:[e.jsx(i.XCircle,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),n=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),l=require("../../../../../service/redlineService.js");const t={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:d,editorInfo:o,headerText:r,btnsConfig:s,labelText:a,onActionTrigger:c,aiReason:u=null}){var v,p;const{redlineDcoumentId:x,redlineConfig:f,updateRedlineDataParent:b}=n.useRequirementAI(),g=async e=>{var i,n,t;null==c||c({status:"loading",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}});try{const{updated_reqai:d}=await l.resolveRedline({documentId:x,userEmail:null==f?void 0:f.userEmail,userName:null==f?void 0:f.userName,redlineId:null!==(i=null==u?void 0:u.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==f?void 0:f.baseApiUrl,redlineConfigId:null!==(n=null==f?void 0:f.redlineConfigId)&&void 0!==n?n:""},null!==(t=null==f?void 0:f.token)&&void 0!==t?t:"");await(null==b?void 0:b(d)),null==c||c({status:"success",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}})}catch(i){null==c||c({status:"failed",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}})}};return e.jsxs("div",{style:t.popup,children:[e.jsxs("div",{style:t.header,children:[e.jsx("span",{style:t.title,children:r||"Manually Edited"}),e.jsx("button",{onClick:d,style:t.closeButton,"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{style:t.content,children:[e.jsxs("div",{style:t.labelRow,children:[e.jsx(i.UserPen,{}),e.jsx("span",{style:t.label,children:a||"Edited By"})]}),e.jsx("div",{style:t.editorInfo,children:o}),e.jsx("div",{style:t.divider}),e.jsxs("div",{style:t.actions,children:[null==s?void 0:s.map(i=>e.jsxs("button",{style:{...t.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==u?void 0:u.redline_id,id:null==u?void 0:u.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(v=null==u?void 0:u.redlining_details)||void 0===v?void 0:v.status)||"rejected"===(null===(p=null==u?void 0:u.redlining_details)||void 0===p?void 0:p.status))&&e.jsxs("div",{style:t.resolveActions,children:[e.jsxs("button",{style:{...t.actionBtn,...(null==u?void 0:u.resolving)?t.actionBtnDisabled:{}},disabled:null==u?void 0:u.resolving,onClick:()=>g("accept"),children:[e.jsx(i.CheckCircle,{size:16,color:"#10B981"})," ","Adopt"]}),e.jsxs("button",{style:{...t.actionBtn,...(null==u?void 0:u.resolving)?t.actionBtnDisabled:{}},onClick:()=>g("reject"),disabled:null==u?void 0:u.resolving,children:[e.jsx(i.XCircle,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})};
2
2
  //# sourceMappingURL=ManualEditPopup.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),n=require("@mui/material"),r=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../cws/CwsEvent.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=c(i);function h(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),p=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),f=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),g=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),j=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),v=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),b=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function m({title:t,open:i,onToggle:o,children:n}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(v,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:n})})]})}function w({icon:t,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?s:{}};return e.jsxs("button",{onClick:r?void 0:o,disabled:r,style:l,onMouseEnter:e=>{r||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}function C({steps:i}){if(!(null==i?void 0:i.length))return null;const o=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:o?"6px 8px":"8px 10px",background:"#F8FAFC",gap:o?4:8,overflow:"hidden"},children:i.map((n,r)=>{const s=(e=>{const t=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return t[e%t.length]})(r),l=r===i.length-1;return e.jsxs(x.default.Fragment,{children:[e.jsxs("span",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:o?4:6,overflow:"hidden"},children:[(a=n.status,"approved"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsx(t.Hourglass,{size:o?14:16,color:"#F59E0B",style:{flexShrink:0}})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:o?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:o?20:22,height:o?20:22,minWidth:o?20:22,borderRadius:"50%",background:s.bg,color:s.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:o?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!l&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"18",height:o?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:o?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var a})})})}exports.ApprovedIcon=u,exports.ChevronIcon=v,exports.CloseIcon=f,exports.HistoryIcon=b,exports.IterateIcon=y,exports.RedlineCard=function({status:c,onClose:x,impactText:v,secondText:I,actionTakenByName:B,actionTakenAtTime:S="NA",onHistory:R,onIterate:L,onActionTrigger:T,disableAllActions:W=!1,impactTitle:A="Impact",customConfigs:M={},customStyles:D={},secondaryTitle:F,onAssignClick:E,onReviewUsersClick:z,assignedUsers:H,redlineId:U,aiReasonId:q,cognitiveIconSmall:N,cognitiveTootipTitle:O="Cognitive Decisioning",historyIconSmall:P,onHistoryClick:$,historyTootipTitle:_,onOpenCognitive:V,displayVariant:K="default",reviewTitle:Y,reviewSubtitle:G,reviewStatusIcon:J=e.jsx(t.Hourglass,{size:18}),reviewSteps:Q=[],showReviewProgress:X=!1,showOriginalText:Z=!1,originalText:ee,originalTextHeader:te="Original text",hideMeta:ie=!1}){const[oe,ne]=i.useState(!0),[re,se]=i.useState(!0),[le,ae]=i.useState(!1);i.useState(!1);const[de,ce]=i.useState(!0),xe="review"===K||"review"===c,{redlineDcoumentId:he,redlineConfig:ue,updateRedlineDataParent:pe}=a.useRequirementAI(),fe={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No original text available"},ge={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(j,{}),StatusIcon:e.jsx(p,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(b,{color:"#3b82f6"}),label:"History",onClick:R},{icon:e.jsx(k,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No rejected recommendation available"},je={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No reverted redline available"},ve={headerBg:"#F8FAFC",headerBorder:"#E2E8F0",titleColor:"#1E293B",label:Y||"Redline In Review",metaLabel:"Current Status",UserIcon:e.jsx(t.Hourglass,{size:16,color:"#94A3B8"}),StatusIcon:J,secondTitle:te,secondBg:"#F8FAFC",secondBorder:"#CBD5E1",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:R},{icon:e.jsx(u,{}),label:"Approve",action:"accept",useLabel:!0},{icon:e.jsx(p,{}),label:"Reject",action:"reject",useLabel:!0},{icon:e.jsx(y,{}),label:"Iterate",onClick:L}],fallbackText:"No original text available"};let be;be=xe?ve:"accepted"===c?fe:"rejected"===c?ge:je;const ke={...be,...M[c]||{}},ye=xe&&G||F;return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:le?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...D.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:ke.headerBg,borderBottom:`1.5px solid ${ke.headerBorder}`,...D.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:ke.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:ke.titleColor,letterSpacing:"-0.01em"},children:ke.label}),e.jsx(n.Tooltip,{title:ye,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:ye})})]}),H&&H.length>0&&e.jsx(s.DisplayUsers,{users:H,onClick:e=>{e.stopPropagation(),null==z||z()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(E||V||$)&&e.jsx(s.KebabMenu,{onAssignClick:E,onOpenCognitive:V,cognitiveIconSmall:N,cognitiveTootipTitle:O,historyIconSmall:P,onHistoryClick:$,historyTootipTitle:_}),e.jsx("button",{onClick:()=>{ae(!0),x()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(f,{})})]})]}),xe&&X&&Q.length>0&&e.jsx("div",{style:{padding:"10px 14px 0"},children:e.jsx(C,{steps:Q})}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...D.body},children:[!xe&&!ie&&e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...D.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[ke.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:ke.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(n.Tooltip,{title:B,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:B})}),e.jsx("span",{children:h(S)})]})]}),!xe&&!ie&&e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...D.divider}}),e.jsx(m,{title:A,open:oe,onToggle:()=>ne(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...D.impactText},children:e.jsx(r.AiReasonMarkdownWrapper,{message:`${v||""} [View chat](chat_citation$all)`,customStyles:D.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...D.divider}}),e.jsx(m,{title:xe&&Z?te:ke.secondTitle,open:xe&&Z?de:re,onToggle:()=>{xe&&Z?ce(e=>!e):se(e=>!e)},children:(xe&&Z?ee:I)?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:ke.secondBg,border:`1.5px solid ${ke.secondBorder}`,...D.secondSection},children:xe&&Z?ee:I}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...D.fallbackSectionStyle},children:[ke.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...D.actionsContainer},children:ke.actions.map(t=>e.jsx(w,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i,o,n,r,s;null==T||T({status:"loading",action:e,metadata:{redlineId:U,aiReasonId:q}});try{const{updated_reqai:a}=await l.resolveRedline({documentId:he,userEmail:null==ue?void 0:ue.userEmail,userName:null==ue?void 0:ue.userName,redlineId:null!=U?U:"",action:e,baseApiUrl:null==ue?void 0:ue.baseApiUrl,redlineConfigId:null!==(t=null==ue?void 0:ue.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==ue?void 0:ue.token)&&void 0!==i?i:"");await(null==pe?void 0:pe(a)),null===(o=d.default.emit)||void 0===o||o.call(d.default,`redline-edit:${he}:${null===(s=null===(r=null===(n=null==a?void 0:a.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===r?void 0:r[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==ue?void 0:ue.userName}),null==T||T({status:"success",action:e,metadata:{redlineId:U,aiReasonId:q}})}catch(t){null==T||T({status:"failed",action:e,metadata:{redlineId:U,aiReasonId:q}})}})((t.action||t.label).toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...D.actionBtn},disabled:W||t.disabled,disabledStyle:D.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=k,exports.RejectedIcon=p,exports.UserApprovedIcon=g,exports.UserRejectedIcon=j,exports.formatDate=h;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),n=require("@mui/material"),r=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(i);function x(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const h=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),p=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),g=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),f=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),j=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),b=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),v=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function y({title:t,open:i,onToggle:o,children:n}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(j,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:n})})]})}function m({icon:t,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?s:{}};return e.jsxs("button",{onClick:r?void 0:o,disabled:r,style:l,onMouseEnter:e=>{r||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}function w({steps:i}){if(!(null==i?void 0:i.length))return null;const o=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:o?"6px 8px":"8px 10px",background:"#F8FAFC",gap:o?4:8,overflow:"hidden"},children:i.map((n,r)=>{const s=(e=>{const t=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return t[e%t.length]})(r),l=r===i.length-1;return e.jsxs(c.default.Fragment,{children:[e.jsxs("span",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:o?4:6,overflow:"hidden"},children:[(a=n.status,"approved"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===a?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsx(t.Hourglass,{size:o?14:16,color:"#F59E0B",style:{flexShrink:0}})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:o?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:o?20:22,height:o?20:22,minWidth:o?20:22,borderRadius:"50%",background:s.bg,color:s.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:o?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!l&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"18",height:o?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:o?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var a})})})}exports.ApprovedIcon=h,exports.ChevronIcon=j,exports.CloseIcon=p,exports.HistoryIcon=b,exports.IterateIcon=v,exports.RedlineCard=function({status:d,onClose:c,impactText:j,secondText:C,actionTakenByName:I,actionTakenAtTime:B="NA",onHistory:S,onIterate:R,onActionTrigger:L,disableAllActions:T=!1,impactTitle:W="Impact",customConfigs:A={},customStyles:M={},secondaryTitle:D,onAssignClick:F,onReviewUsersClick:E,assignedUsers:z,redlineId:H,aiReasonId:U,cognitiveIconSmall:q,cognitiveTootipTitle:N="Cognitive Decisioning",historyIconSmall:O,onHistoryClick:P,historyTootipTitle:$,onOpenCognitive:_,displayVariant:V="default",reviewTitle:K,reviewSubtitle:Y,reviewStatusIcon:G=e.jsx(t.Hourglass,{size:18}),reviewSteps:J=[],showReviewProgress:Q=!1,showOriginalText:X=!1,originalText:Z,originalTextHeader:ee="Original text",hideMeta:te=!1}){const[ie,oe]=i.useState(!0),[ne,re]=i.useState(!0),[se,le]=i.useState(!1);i.useState(!1);const[ae,de]=i.useState(!0),ce="review"===V||"review"===d,{redlineDcoumentId:xe,redlineConfig:he,updateRedlineDataParent:ue}=a.useRequirementAI(),pe={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(h,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:S},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No original text available"},ge={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(f,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(b,{color:"#3b82f6"}),label:"History",onClick:S},{icon:e.jsx(k,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No rejected recommendation available"},fe={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(g,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(b,{}),label:"History",onClick:S},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No reverted redline available"},je={headerBg:"#F8FAFC",headerBorder:"#E2E8F0",titleColor:"#1E293B",label:K||"Redline In Review",metaLabel:"Current Status",UserIcon:e.jsx(t.Hourglass,{size:16,color:"#94A3B8"}),StatusIcon:G,secondTitle:ee,secondBg:"#F8FAFC",secondBorder:"#CBD5E1",impactBox:!0,actions:[{icon:e.jsx(b,{}),label:"History",onClick:S},{icon:e.jsx(h,{}),label:"Approve",action:"accept",useLabel:!0},{icon:e.jsx(u,{}),label:"Reject",action:"reject",useLabel:!0},{icon:e.jsx(v,{}),label:"Iterate",onClick:R}],fallbackText:"No original text available"};let be;be=ce?je:"accepted"===d?pe:"rejected"===d?ge:fe;const ke={...be,...A[d]||{}},ve=ce&&Y||D;return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:se?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...M.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:ke.headerBg,borderBottom:`1.5px solid ${ke.headerBorder}`,...M.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:ke.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:ke.titleColor,letterSpacing:"-0.01em"},children:ke.label}),e.jsx(n.Tooltip,{title:ve,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:ve})})]}),z&&z.length>0&&e.jsx(s.DisplayUsers,{users:z,onClick:e=>{e.stopPropagation(),null==E||E()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(F||_||P)&&e.jsx(s.KebabMenu,{onAssignClick:F,onOpenCognitive:_,cognitiveIconSmall:q,cognitiveTootipTitle:N,historyIconSmall:O,onHistoryClick:P,historyTootipTitle:$}),e.jsx("button",{onClick:()=>{le(!0),c()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(p,{})})]})]}),ce&&Q&&J.length>0&&e.jsx("div",{style:{padding:"10px 14px 0"},children:e.jsx(w,{steps:J})}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...M.body},children:[!ce&&!te&&e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...M.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[ke.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:ke.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(n.Tooltip,{title:I,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:I})}),e.jsx("span",{children:x(B)})]})]}),!ce&&!te&&e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(y,{title:W,open:ie,onToggle:()=>oe(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...M.impactText},children:e.jsx(r.AiReasonMarkdownWrapper,{message:`${j||""} [View chat](chat_citation$all)`,customStyles:M.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(y,{title:ce&&X?ee:ke.secondTitle,open:ce&&X?ae:ne,onToggle:()=>{ce&&X?de(e=>!e):re(e=>!e)},children:(ce&&X?Z:C)?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:ke.secondBg,border:`1.5px solid ${ke.secondBorder}`,...M.secondSection},children:ce&&X?Z:C}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...M.fallbackSectionStyle},children:[ke.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...M.actionsContainer},children:ke.actions.map(t=>e.jsx(m,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==L||L({status:"loading",action:e,metadata:{redlineId:H,aiReasonId:U}});try{const{updated_reqai:o}=await l.resolveRedline({documentId:xe,userEmail:null==he?void 0:he.userEmail,userName:null==he?void 0:he.userName,redlineId:null!=H?H:"",action:e,baseApiUrl:null==he?void 0:he.baseApiUrl,redlineConfigId:null!==(t=null==he?void 0:he.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==he?void 0:he.token)&&void 0!==i?i:"");await(null==ue?void 0:ue(o)),null==L||L({status:"success",action:e,metadata:{redlineId:H,aiReasonId:U}})}catch(t){null==L||L({status:"failed",action:e,metadata:{redlineId:H,aiReasonId:U}})}})((t.action||t.label).toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...M.actionBtn},disabled:T||t.disabled,disabledStyle:M.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=k,exports.RejectedIcon=u,exports.UserApprovedIcon=g,exports.UserRejectedIcon=f,exports.formatDate=x;
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map