@viswa-test/test-citation 0.0.26 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/LoaderComponent.js +2 -0
- package/dist/cjs/features/CognitiveCompare/LoaderComponent.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/OverlayComponent.js +2 -0
- package/dist/cjs/features/CognitiveCompare/OverlayComponent.js.map +1 -0
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CitationRenderer.js +2 -0
- package/dist/features/CognitiveCompare/CitationRenderer.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/LoaderComponent.js +2 -0
- package/dist/features/CognitiveCompare/LoaderComponent.js.map +1 -0
- package/dist/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
- package/dist/features/CognitiveCompare/OverlayComponent.js +2 -0
- package/dist/features/CognitiveCompare/OverlayComponent.js.map +1 -0
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +176 -0
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +11 -0
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +16 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/LoaderComponent.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/LoaderComponent.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/OverlayComponent.d.ts +5 -0
- package/dist/types/src/features/CognitiveCompare/OverlayComponent.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),n=require("react/jsx-runtime"),e=require("lucide-react"),l=require("react"),t=require("./ResizableSplitPane.js"),o=require("../PdfViewer/PdfViewer.js");exports.default=function(r){var a,u,d,s=r.href,c=r.children,g=r.metaData,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),n=require("react/jsx-runtime"),e=require("lucide-react"),l=require("react"),t=require("./ResizableSplitPane.js"),o=require("../PdfViewer/PdfViewer.js");exports.default=function(r){var a,u,d,s=r.href,c=r.children,g=r.metaData,v=r.chevronUpComponent,h=void 0===v?null:v,p=r.chevronDownComponent,f=void 0===p?null:p,m=r.customStyle,_=void 0===m?{}:m,x=r.defaultState,j=void 0!==x&&x,y=l.useState(j),C=y[0],P=y[1],b="string"==typeof c&&(null===(a=null==c?void 0:c.split("\n"))||void 0===a?void 0:a.length)>1?c.split("\n").join(" "):c,w="string"==typeof c?c:c[0],D=null!=h?h:function(i){var l,t;return n.jsx(e.ChevronUp,{size:null!==(l=null==i?void 0:i.fontSize)&&void 0!==l?l:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(u=null==_?void 0:_.arrow)&&void 0!==u?u:{}),S=null!=f?f:function(i){var l,t;return n.jsx(e.ChevronDown,{size:null!==(l=null==i?void 0:i.fontSize)&&void 0!==l?l:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(d=null==_?void 0:_.arrow)&&void 0!==d?d:{}),q=["contract","clause"];return n.jsxs("span",i.__assign({style:i.__assign({display:"inline"},_.relativeWrapper||{})},{children:[n.jsx("div",i.__assign({style:i.__assign({display:"inline",marginTop:0},_.citationButtonWrapper||{})},{children:n.jsxs("button",i.__assign({type:"button",onClick:function(){return P(function(i){return!i})},style:i.__assign({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},_.citationButton||{})},{children:[n.jsx("span",{children:b}),n.jsx("span",i.__assign({style:{display:"flex",alignItems:"center"}},{children:C?D:S}))]}))})),C&&n.jsx(n.Fragment,{children:n.jsx(function(){var i,e,l,r,a,u,d;console.log("citation details ->","href ->",s,"children ->",c,"metaData ->",g,"citationDisplayTitle ->",b);var v=function(i){try{return new URL(i,window.location.origin).searchParams.get("citationNumber")}catch(i){return null}}(s);if(!v)return null;var h=(null===(i=null==g?void 0:g.citations)||void 0===i?void 0:i[v])||{},p=(null===(e=null==g?void 0:g.docData)||void 0===e?void 0:e.documents)||{},f=(null===(l=null==g?void 0:g.docData)||void 0===l?void 0:l.input_index_map)||{},m=null==f?void 0:f[0],_=null==f?void 0:f[1],x=m?p[m]:null,j=_?p[_]:null,y=m?h[m]:null,C=_?h[_]:null;if(q.includes(w)){console.log("leftDocument",x,"rightDocument",j),console.log("leftCitation",y,"rightCitation",C);var P=y?n.jsx(o.default,{defaultScale:"PageWidth",showHighlightsAction:!1,pdfName:x.title,pdfUrl:x.signed_url,highlightText:[null!==(r=null==y?void 0:y.highlighted_text)&&void 0!==r?r:""],highlightPages:{1:null===(a=null==y?void 0:y.custom_metadata)||void 0===a?void 0:a.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,D=C?n.jsx(o.default,{defaultScale:"PageWidth",showHighlightsAction:!1,pdfName:j.title,pdfUrl:j.signed_url,jumpToPageValue:1,highlightText:[null!==(u=null==C?void 0:C.highlighted_text)&&void 0!==u?u:""],highlightPages:{1:null===(d=null==C?void 0:C.custom_metadata)||void 0===d?void 0:d.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null;return y||C?n.jsx("div",{children:n.jsx(t.default,{leftComponent:P,rightComponent:D})}):n.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return n.jsx("div",{children:"No Citation Found. Please try again later"})},{})})]}))};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),o=require("@mui/material"),t=require("react-markdown"),n=require("./CitationAnchor.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=s(t);exports.default=function(t){var s=t.content,d=void 0===s?"":s,c=t.title,l=void 0===c?"":c,x=t.citations,u=void 0===x?{}:x,p=t.styles,f=void 0===p?{}:p,_=t.docData,h=void 0===_?{}:_,g=t.open,j=r.useMemo(function(){return{a:function(e){var r=e.href,o=void 0===r?"":r,t=e.children;return i.jsx(n.default,{href:o,children:t,metaData:{citations:u,docData:h}})}}},[g,u,h]);return i.jsxs(o.Box,e.__assign({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD"}},{children:[i.jsx(o.Box,e.__assign({sx:{px:1.5,py:.75,borderBottom:"1px solid #EAECF0"}},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:"15px",fontWeight:600,color:"#344054",lineHeight:1.25}},{children:l}))})),i.jsx(o.Box,e.__assign({sx:{px:1.5,py:1.1,display:"flex",flexDirection:"column",gap:.95}},{children:i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column"}},{children:i.jsx(o.Typography,e.__assign({component:"div",sx:e.__assign({},f)},{children:i.jsx(a.default,e.__assign({components:j},{children:d}))}))}))}))]}))};
|
|
2
|
+
//# sourceMappingURL=CitationRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationRenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@mui/material"),r=require("lucide-react"),o=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("react-markdown"),s=require("./CognitiveComparehelpers.js"),a=require("./CognitiveCompareConfig.js"),c=require("./CognitivePopup.js"),u=require("./MoreFunctionsPopup.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=d(t),x=d(l),h={id:"",title:""},p={open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null};exports.SHARED_MARKDOWN_STYLES=a.SHARED_MARKDOWN_STYLES,exports.default=function(l){var d,v,g,_,m,y,b,S,F=l.componentHeaderText,w=void 0===F?"Learning Comparison":F,E=l.treeData,I=l.comparisonConfig,j=l.leftColumnTitleText,C=l.rightColumnTitleText,R=l.markdownStyles,B=l.maintainRelativeOrder,T=void 0!==B&&B,A=l.popupConfig,D=t.useState(T),k=D[0],O=D[1],M=t.useState(null),N=M[0],L=M[1],z=t.useState(!1),H=z[0],W=z[1],q=t.useState(!1),P=q[0],U=q[1],V=t.useRef(!1),G=t.useMemo(function(){return(null==E?void 0:E.cognitive_decisioning)||{}},[E]),Y=t.useState(null),X=Y[0],K=Y[1],J=t.useRef(null),Q=t.useState({width:0,height:0}),Z=Q[0],$=Q[1],ee=t.useMemo(function(){return e.__assign(e.__assign({},a.SHARED_MARKDOWN_STYLES),R)},[R]),ne=t.useState({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null}),te=ne[0],ie=ne[1],re=t.useState({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null}),oe=re[0],le=re[1],se=t.useRef(null),ae=t.useRef(null),ce=t.useRef(null),ue=t.useRef(null),de=t.useRef(null),fe=t.useRef(!1),xe=t.useRef(null);t.useEffect(function(){xe.current=null},[te.sectionIdx,te.open]);var he=t.useCallback(function(){K(null),ie(p)},[]),pe=t.useCallback(function(){le(p)},[]),ve=t.useCallback(function(){var e;if(te.anchorEl&&te.refSectionTitle){var n=te.anchorEl.getBoundingClientRect(),t=(null===(e=null==J?void 0:J.current)||void 0===e?void 0:e.offsetHeight)||0,i=Math.min(680,window.innerWidth-24),r=window.innerHeight-n.bottom-12-12,o=n.top-12-12,l=r<t&&o>r;null!==xe.current?!0===xe.current&&(l=o>=t||o>=r):l=!(r>=t||r>=o),xe.current=l;var s=l?o:r,a=Math.min(t||9999,s),c=l?n.top-12-a:n.bottom+12,u=n.left+n.width/2,d=u-i/2,f=Math.max(12,Math.min(d,window.innerWidth-i-12)),x=Math.max(14,Math.min(u-f,i-10-4));K({top:c,left:f,arrowLeft:x,openAbove:l,maxHeight:s})}},[te.anchorEl,te.refSectionTitle]);t.useEffect(function(){if(te.open){window.addEventListener("resize",ve);var e=requestAnimationFrame(ve),n=null;return J.current&&(n=new ResizeObserver(function(){cancelAnimationFrame(e),e=requestAnimationFrame(ve)})).observe(J.current),function(){cancelAnimationFrame(e),window.removeEventListener("resize",ve),n&&n.disconnect()}}},[te.open,ve]),t.useEffect(function(){var e=se.current;if(e&&te.open){var n=function(e){J.current&&J.current.contains(e.target)||(K(null),he())};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[te.open,he]),t.useEffect(function(){var e=se.current;if(e&&oe.open){var n=function(){pe()};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[oe.open,pe]);var ge=t.useMemo(function(){var n,t,i,r,o,l,s,c,u,d,f,x;return{fields:null!==(n=null==I?void 0:I.fields)&&void 0!==n?n:a.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(t=null==I?void 0:I.thresholds)||void 0===t?void 0:t.high)&&void 0!==i?i:a.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(r=null==I?void 0:I.thresholds)||void 0===r?void 0:r.medium)&&void 0!==o?o:a.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(s=null===(l=null==I?void 0:I.thresholds)||void 0===l?void 0:l.exact)&&void 0!==s?s:a.DEFAULT_COMPARISON_CONFIG.thresholds.exact},relationStyles:{noContent:e.__assign(e.__assign({},a.DEFAULT_COMPARISON_CONFIG.relationStyles.noContent),(null===(c=null==I?void 0:I.relationStyles)||void 0===c?void 0:c.noContent)||{}),high:e.__assign(e.__assign({},a.DEFAULT_COMPARISON_CONFIG.relationStyles.high),(null===(u=null==I?void 0:I.relationStyles)||void 0===u?void 0:u.high)||{}),exact:e.__assign(e.__assign({},a.DEFAULT_COMPARISON_CONFIG.relationStyles.exact),(null===(d=null==I?void 0:I.relationStyles)||void 0===d?void 0:d.exact)||{}),medium:e.__assign(e.__assign({},a.DEFAULT_COMPARISON_CONFIG.relationStyles.medium),(null===(f=null==I?void 0:I.relationStyles)||void 0===f?void 0:f.medium)||{}),low:e.__assign(e.__assign({},a.DEFAULT_COMPARISON_CONFIG.relationStyles.low),(null===(x=null==I?void 0:I.relationStyles)||void 0===x?void 0:x.low)||{})}}},[I]),_e=t.useMemo(function(){if(E&&Object.keys(E).length>0)try{var n=function(n,t){var i,r,o,l,a,c,u,d;void 0===t&&(t=!1);var f=[],x=[],h=n.base_root_id,p=n.input_index_map||{0:"left",1:"right"},v=n[h];if(!v||!1===v.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[]};var g=function(t,i){var r=n[t];if(!r)return null;var o=s.getSideData(r,i,p),l=!!o.title.trim(),a=!!o.content.trim(),c=s.getRationale(r),u=[];r.next&&Object.values(r.next).forEach(function(e){if(n[e]){var t=g(e,i);t&&u.push(t)}});var d=!(!l&&!a);return e.__assign({id:t,title:l?o.title:"",content:a?o.content:"",subsections:u},d?c:{score:void 0,relation:"not_defined"})};if(t){var _={},m={},y=-1,b=-1;for(var S in n)if(!["base_root_id","documents","input_index_map",h].includes(S)){var F=n[S];if(F&&!1!==F.display_node){var w=s.getRationale(F),E=s.getSideData(F,"0",p),I=s.getSideData(F,"1",p),j=E.title.trim()||E.content.trim(),C=I.title.trim()||I.content.trim(),R=Number(null!==(r=null===(i=E.attributes)||void 0===i?void 0:i.display_index)&&void 0!==r?r:y--),B=Number(null!==(l=null===(o=I.attributes)||void 0===o?void 0:o.display_index)&&void 0!==l?l:b--),T=m[B]||e.__assign(e.__assign({id:S,title:C?I.title:"",content:C?I.content:"",subsections:[]},C?w:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:B}),A=_[R]||e.__assign(e.__assign({id:S,title:j?E.title:"",content:j?E.content:"",subsections:[]},j?w:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:R});Number(B)>=0&&Number(R)>=0&&(T.refIndexes.includes(Number(R))||T.refIndexes.push(Number(R)),A.refIndexes.includes(Number(B))||A.refIndexes.push(Number(B))),m[B]=T,_[R]=A}}x=Object.values(m).map(function(e){return e}),f=Object.values(_).map(function(e){return e}),x.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex}),f.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex})}else v.next&&Object.values(v.next).forEach(function(e){var t=n[e];t&&!1!==t.display_node&&(f.push(g(e,"0")||{id:e,title:"",content:"",subsections:[]}),x.push(g(e,"1")||{id:e,title:"",content:"",subsections:[]}))});return{activeProposed:{title:(null===(c=null===(a=v.comparison_inputs)||void 0===a?void 0:a[p[0]])||void 0===c?void 0:c.title)||"Uploaded Contract",description:v.decision_scope_description||"",sections:f},activeVariants:[{id:"tree-variant-1",title:(null===(d=null===(u=v.comparison_inputs)||void 0===u?void 0:u[p[1]])||void 0===d?void 0:d.title)||"Reference Template",similarity:0,sections:x,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:v.decision_scope_description||""},fields:{}}}}]}}(E,k);return e.__assign(e.__assign({},n),{parseError:null})}catch(e){return console.error("Data Transformation Error: ",e),{activeProposed:{},activeVariants:[],parseError:e instanceof Error?e.message:"Unknown Parsing Error"}}return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"}},[E,k]),me=_e.activeProposed,ye=_e.activeVariants,be=_e.parseError;t.useEffect(function(){be&&L("Failed to load comparison: ".concat(be))},[be]);var Se=t.useState(null),Fe=Se[0];Se[1];var we=t.useState({}),Ee=we[0],Ie=we[1],je=t.useState({}),Ce=je[0],Re=je[1],Be=(null==ye?void 0:ye[0])||h,Te=null===(g=null===(d=null==E?void 0:E.documents)||void 0===d?void 0:d[null===(v=null==E?void 0:E.input_index_map)||void 0===v?void 0:v[0]])||void 0===g?void 0:g.title,Ae=null===(y=null===(_=null==E?void 0:E.documents)||void 0===_?void 0:_[null===(m=null==E?void 0:E.input_index_map)||void 0===m?void 0:m[1]])||void 0===y?void 0:y.title,De=s.safeStringify(j||Te||"Uploaded Contract"),ke=s.safeStringify(C||Ae||"Reference Template"),Oe=t.useMemo(function(){return(null==me?void 0:me.sections)||[]},[null==me?void 0:me.sections]),Me=t.useMemo(function(){return Be.sections||[]},[Be.sections]),Ne=Oe.length>0||Me.length>0,Le=Be.analysis,ze=s.safeStringify(null===(S=null===(b=null==Le?void 0:Le.rule_difference_comparison)||void 0===b?void 0:b.summary)||void 0===S?void 0:S.overall_summary),He=!!ze.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),We=t.useRef({}),qe=function(e){return We.current[e]||(We.current[e]=f.default.createRef()),We.current[e]},Pe=t.useCallback(function(){W(!1),nn(null),U(!1),ue.current&&(ue.current.style.height="0px"),de.current&&(de.current.style.height="0px")},[]),Ue=t.useCallback(function(e,n,t,i,r){var o,l,a=s.safeStringify(n.id)||s.safeStringify(t.id)||"",c=(a?G[a]:null)||n.cognitiveData||t.cognitiveData||{section_id:a,decisioning:[],gap:[],relevance_score:0},u=null!==(l=null===(o=We.current[i])||void 0===o?void 0:o.current)&&void 0!==l?l:null;return{open:!0,sectionTitle:n.title||"N/A",refSectionTitle:t.title||"NA",cognitiveData:c,anchorEl:e,sectionAnchorEl:u,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==E?void 0:E.documents,input_index_map:null==E?void 0:E.input_index_map}}},[G]),Ve=t.useCallback(function(e){pe(),K(null),ie(e)},[pe]),Ge=t.useCallback(function(){null!==oe.sectionIdx&&oe.anchorEl?Ve(e.__assign(e.__assign({},oe),{open:!0})):pe()},[oe,pe,Ve]);t.useCallback(function(e){pe(),L("".concat(e," is coming soon."))},[pe]);var Ye=t.useRef(null),Xe=t.useRef(null),Ke=t.useRef(null),Je=t.useState([]),Qe=Je[0],Ze=Je[1],$e=t.useState(null),en=$e[0],nn=$e[1],tn=t.useRef(null),rn=t.useState(null),on=rn[0],ln=rn[1],sn=t.useMemo(function(){return ge.fields.filter(function(e){var n=e.key;return(!Ne||"description"!==n)&&(s.hasValue(null==me?void 0:me[n])||s.hasValue(Be[n]))})},[me,Be,Ne,ge.fields]),an=t.useRef({}),cn=t.useRef({}),un=t.useRef({}),dn=t.useRef({}),fn=t.useRef({}),xn=t.useRef({}),hn=t.useRef({});sn.forEach(function(e){for(var n=e.key,t=0;t<Math.max(Oe.length,Me.length);t+=1)un.current[t]||(un.current[t]=f.default.createRef()),dn.current[t]||(dn.current[t]=f.default.createRef()),fn.current[t]||(fn.current[t]=f.default.createRef()),xn.current[t]||(xn.current[t]=f.default.createRef()),hn.current[t]||(hn.current[t]=f.default.createRef());an.current[n]||(an.current[n]=f.default.createRef()),cn.current[n]||(cn.current[n]=f.default.createRef())});for(var pn=0;pn<Math.max(Oe.length,Me.length);pn+=1)un.current[pn]||(un.current[pn]=f.default.createRef()),dn.current[pn]||(dn.current[pn]=f.default.createRef()),fn.current[pn]||(fn.current[pn]=f.default.createRef()),xn.current[pn]||(xn.current[pn]=f.default.createRef()),hn.current[pn]||(hn.current[pn]=f.default.createRef());t.useEffect(function(){if(Fe){var e=ge.fields.find(function(e){return e.analysisKey===Fe||e.key===Fe});if(e){var n=an.current[e.key]||cn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Fe,ge.fields]);var vn=t.useCallback(function(e){var n,t,i,r,o,l,s,a,c,u=null===(n=null==Le?void 0:Le.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!u||!u[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=u[e],f=(null==d?void 0:d.relation)||(null===(i=null===(t=null==d?void 0:d.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(o=null===(r=null==d?void 0:d.highlights)||void 0===r?void 0:r.ruleB_spans)||void 0===o?void 0:o.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var x=d.mappings[0]||{};return{score:d.score,relation:x.relation||"",highlightsA:(null===(l=x.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(s=x.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!f}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(a=d.highlights)||void 0===a?void 0:a.ruleA_spans)||[],highlightsB:(null===(c=d.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!f}},[Le]),gn=t.useCallback(function(n){var t,i,r,o,l=Oe[n],a=Me[n],c=(null==l?void 0:l.relation)&&"not_defined"!==l.relation,u=(null==a?void 0:a.relation)&&"not_defined"!==a.relation,d=s.safeStringify(null==l?void 0:l.id)||s.safeStringify(null==a?void 0:a.id)||"",f=!(!(null==l?void 0:l.cognitiveData)&&!(null==a?void 0:a.cognitiveData));if(!c&&!u&&!f)return e.__assign(e.__assign({},ge.relationStyles.noContent),{label:"Not Defined"});var x=vn("description");if(null!=(null!==(i=null!==(t=null==l?void 0:l.cognitiveRelevanceScore)&&void 0!==t?t:null==a?void 0:a.cognitiveRelevanceScore)&&void 0!==i?i:d?null===(r=G[d])||void 0===r?void 0:r.relevance_score:void 0)){var h=s.cognitiveScoreToRelation(),p=h.score,v=h.relation;return s.getStyleForRelation(p,v,!0,ge)}var g=c?l.relation:u?a.relation:x.relation,_=null!==(o=null==l?void 0:l.score)&&void 0!==o?o:null==a?void 0:a.score,m="number"==typeof _?_:x.score;return s.getStyleForRelation(m,g,!0,ge)},[Oe,Me,G,ge,vn]),_n=t.useCallback(function(){var e,n,t,i,r,o,l,a,c,u,d;if(!fe.current){fe.current=!0;try{if(!Ye.current)return;var f=Ye.current.getBoundingClientRect();$({width:f.width,height:f.height});var x=[];if(sn.forEach(function(e){var n,t,i=e.key,r=null===(n=an.current[i])||void 0===n?void 0:n.current,o=null===(t=cn.current[i])||void 0===t?void 0:t.current;r&&o&&(r.style.height="auto",o.style.height="auto",r.style.minHeight="0px",o.style.minHeight="0px")}),!k)for(var h=0;h<Math.min(Oe.length,Me.length);h++){var p=null===(e=un.current[h])||void 0===e?void 0:e.current,v=null===(n=dn.current[h])||void 0===n?void 0:n.current;p&&v&&(p.style.height="auto",v.style.height="auto",p.style.minHeight="0px",v.style.minHeight="0px")}var g={};sn.forEach(function(e){var n,t,i=e.key,r=null===(n=an.current[i])||void 0===n?void 0:n.current,o=null===(t=cn.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=r.getBoundingClientRect(),s=o.getBoundingClientRect();g[i]=Math.max(l.height,s.height)}});var _=[];if(!k)for(h=0;h<Math.min(Oe.length,Me.length);h++){p=null===(t=un.current[h])||void 0===t?void 0:t.current,v=null===(i=dn.current[h])||void 0===i?void 0:i.current;if(p&&v){var m=p.getBoundingClientRect(),y=v.getBoundingClientRect();_[h]=Math.max(m.height,y.height)}}if(sn.forEach(function(e){var n,t,i=e.key,r=null===(n=an.current[i])||void 0===n?void 0:n.current,o=null===(t=cn.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=g[i];r.style.minHeight="".concat(l,"px"),o.style.minHeight="".concat(l,"px")}}),!k)for(h=0;h<_.length;h++){p=null===(r=un.current[h])||void 0===r?void 0:r.current,v=null===(o=dn.current[h])||void 0===o?void 0:o.current;if(p&&v){var b=_[h];p.style.minHeight="".concat(b,"px"),v.style.minHeight="".concat(b,"px")}}if(sn.forEach(function(e){var n,t,i=e.key,r=e.analysisKey,o=null===(n=an.current[i])||void 0===n?void 0:n.current,l=null===(t=cn.current[i])||void 0===t?void 0:t.current;if(o&&l){var a=o.getBoundingClientRect(),c=l.getBoundingClientRect(),u=vn(r),d=s.getStyleForRelation(u.score,u.relation,u.hasContent,ge);if(!d)return;var h=a.top+a.height/2-f.top;x.push({id:"field-".concat(i),x1:a.right-f.left,y1:h,x2:c.left-f.left,y2:h,style:d})}}),k)Oe.forEach(function(e,n){var t;(null===(t=un.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,r=Me.findIndex(function(n){return n.selfIndex===e});if(-1!==r){var o=null===(t=fn.current[n])||void 0===t?void 0:t.current,l=null===(i=xn.current[r])||void 0===i?void 0:i.current;if(o&&l){var s=o.getBoundingClientRect(),a=l.getBoundingClientRect(),c=s.right-f.left,u=a.left-f.left,d=s.top+s.height/2-f.top,h=a.top+a.height/2-f.top;H&&en===n&&(h=d);var p=gn(n);p&&x.push({id:"line-".concat(n,"-").concat(r),x1:c,y1:d,x2:u,y2:h,style:p,sectionIdx:n,targetRightIdx:r})}}})});else for(h=0;h<Math.min(Oe.length,Me.length);h++){var S=null===(l=un.current[h])||void 0===l?void 0:l.current,F=null===(a=dn.current[h])||void 0===a?void 0:a.current;if(S&&F){var w=S.querySelector(".MuiAccordionSummary-root"),E=F.querySelector(".MuiAccordionSummary-root");if(w&&E){var I=w.getBoundingClientRect(),j=E.getBoundingClientRect(),C=(I.top+I.height/2-f.top+j.top+j.height/2-f.top)/2,R=(null===(c=Me[h])||void 0===c?void 0:c.id)||"sec-".concat(h),B=gn(h);B&&x.push({id:R,x1:I.right-f.left,y1:C,x2:j.left-f.left,y2:C,style:B,sectionIdx:h,hasCognitive:!!((null===(u=Oe[h])||void 0===u?void 0:u.cognitiveData)||(null===(d=Me[h])||void 0===d?void 0:d.cognitiveData)||R&&G[R])})}}}if(Ze(x),Xe.current&&Ke.current){var T=Xe.current.getBoundingClientRect(),A=Ke.current.getBoundingClientRect(),D=(T.top+T.height/2-f.top+A.top+A.height/2-f.top)/2;ln({x1:T.right-f.left,x2:A.left-f.left,y:D})}else ln(null)}catch(e){console.error("Line render safe fail: ",e)}finally{fe.current=!1}}},[sn,Oe,Me,G,ge,vn,gn,k,H,en]),mn=t.useRef(_n);t.useEffect(function(){mn.current=_n},[_n]);var yn=t.useCallback(function(){null!==tn.current&&window.cancelAnimationFrame(tn.current),tn.current=window.requestAnimationFrame(function(){mn.current(),tn.current=null})},[]),bn=t.useCallback(function(){var e=oe.sectionIdx;pe(),null!==e&&(H&&en===e?Pe():(V.current=!0,nn(e),W(!0),U(!1),ue.current&&(ue.current.style.height="0px"),de.current&&(de.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i=null===(n=We.current[e])||void 0===n?void 0:n.current,r=Oe[e],o=(null==r?void 0:r.refIndexes)||[],l=null;if(o.length>0){var s=o[0],a=Me.findIndex(function(e){return e.selfIndex===s});l=null===(t=hn.current[a])||void 0===t?void 0:t.current}var c=null==i?void 0:i.parentElement,u=ce.current;if(i&&c){var d=i.offsetTop-c.scrollTop,f=null;if(l&&u){var x=l.offsetTop-d;if(x<0)ue.current&&(ue.current.style.height="".concat(Math.abs(x),"px")),f=0;else{var h=u.scrollHeight-u.clientHeight;x>h?(de.current&&(de.current.style.height="".concat(x-h+150,"px")),f=x):f=x}}u&&null!==f?function(e,n,t,i){void 0===t&&(t=300);var r=e.style.scrollBehavior;e.style.scrollBehavior="auto";var o=e.scrollTop,l=n-o,s=null,a=function(c){null===s&&(s=c);var u,d=c-s;d<t?(e.scrollTop=(u=d,u/=t,l*(--u*u*u+1)+o),requestAnimationFrame(a)):(e.scrollTop=n,e.style.scrollBehavior=r,i&&i())};requestAnimationFrame(a)}(u,f,300,function(){U(!0),yn(),setTimeout(function(){V.current=!1},50)}):setTimeout(function(){U(!0),yn(),V.current=!1},350)}})))},[pe,oe.sectionIdx,H,en,Oe,Me,yn,Pe]),Sn=t.useCallback(function(){V.current||(yn(),H&&!V.current&&(W(!1),nn(null),U(!1),ue.current&&(ue.current.style.height="0px"),de.current&&(de.current.style.height="0px")))},[yn,H]);t.useEffect(function(){var e=setTimeout(yn,250);window.addEventListener("resize",yn);var n=null,t=null;return se.current&&(n=new ResizeObserver(yn)).observe(se.current),Ye.current&&(t=new ResizeObserver(yn)).observe(Ye.current),function(){clearTimeout(e),window.removeEventListener("resize",yn),null==n||n.disconnect(),null==t||t.disconnect()}},[me,Be,Le,sn,Ee,Ce,Oe,Me,ge,yn,H,en,P]);var Fn=function(t,o,l,a,c){void 0===c&&(c=1);var u,d=k?!!Ee["".concat(l,"-").concat(o)]:!!Ee[String(o)],h=s.hasValue(t.title),p=s.hasValue(t.content),v=!h&&!p,g=t.title;return h||(g=p?"No Title Found":"No Matching Section Found"),n.jsx(i.Box,e.__assign({ref:a,sx:e.__assign(e.__assign({mb:c},k?{height:"fit-content"}:{minHeight:0}),{display:"flex",flexDirection:"column",position:"relative"})},{children:n.jsxs(i.Accordion,e.__assign({disableGutters:!0,expanded:!v&&d,onChange:function(){return!v&&function(n,t){Ie(function(i){var r=e.__assign({},i);if(!k){var o=!!i[String(n)];return r[String(n)]=!o,r}var l="".concat(t,"-").concat(n),s=!i[l];if(r[l]=s,"left"===t)((null==(a=Oe[n])?void 0:a.refIndexes)||[]).forEach(function(e){var n=Me.findIndex(function(n){return n.selfIndex===e});-1!==n&&(r["right-".concat(n)]=s)});else{var a,c=null==(a=Me[n])?void 0:a.selfIndex;Oe.forEach(function(e,n){var t;(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(c))&&(r["left-".concat(n)]=s)})}return r})}(o,l)},sx:{boxShadow:"none",border:v?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:v?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flex:1,display:"flex",flexDirection:"column","&:before":{display:"none"}}},{children:[n.jsx(i.AccordionSummary,e.__assign({expandIcon:v?null:n.jsx(r.ChevronDown,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:v?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"flex",alignItems:"center",overflow:"hidden"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:n.jsx(i.Tooltip,e.__assign({title:g,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"12px",color:v?"#94A3B8":"#19213D",fontWeight:v?400:700,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:(u=g,u?s.safeStringify(u).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,t){return e.startsWith("**")&&e.endsWith("**")?n.jsx("strong",{children:e.slice(2,-2)},t):n.jsx(f.default.Fragment,{children:e},t)}):null)}))}))})),!v&&n.jsxs(i.AccordionDetails,e.__assign({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column"}},{children:[n.jsx(i.Typography,e.__assign({component:"div",sx:ee},{children:n.jsx(x.default,{children:s.safeStringify(t.content).replace(/\\n/g,"\n")})})),(t.subsections||[]).map(function(e,n){return wn(e,"".concat(o,"-").concat(n),0)})]}))]}))}),"".concat(l,"-sec-").concat(o))},wn=function(t,o,l){void 0===l&&(l=0);var a=s.hasValue(t.title),c=s.hasValue(t.content),u=!a&&!c,d=a?t.title:c?"No Title Found":"No Matching Section Found",f=!!Ce[o];return t.title?n.jsxs(i.Accordion,e.__assign({disableGutters:!0,expanded:!u&&f,onChange:function(){return!u&&Re(function(n){var t;return e.__assign(e.__assign({},n),((t={})[o]=!n[o],t))})},sx:{mt:1,boxShadow:"none",border:u?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF","&:before":{display:"none"}}},{children:[n.jsx(i.AccordionSummary,e.__assign({expandIcon:u?null:n.jsx(r.ChevronDown,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5}}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"11px",fontWeight:600,color:u?"#94A3B8":"#19213D"}},{children:d||"Untitled Subsection"}))})),!u&&n.jsxs(i.AccordionDetails,e.__assign({sx:{pt:0,pb:1}},{children:[c&&n.jsx(i.Typography,e.__assign({component:"div",sx:ee},{children:n.jsx(x.default,{children:s.safeStringify(t.content).replace(/\\n/g,"\n")})})),(t.subsections||[]).map(function(e,n){return wn(e,"".concat(o,"-").concat(n),l+1)})]}))]}),o):n.jsx(i.Box,e.__assign({sx:{mt:0===l?1:.75}},{children:!u&&n.jsxs("div",{children:[c&&n.jsx(i.Typography,e.__assign({component:"div",sx:ee},{children:n.jsx(x.default,{children:s.safeStringify(t.content).replace(/\\n/g,"\n")})})),(t.subsections||[]).map(function(e,n){return wn(e,"".concat(o,"-").concat(n),l+1)})]})}),o)};return n.jsxs(i.Box,e.__assign({ref:ae,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},k?{}:{overflow:"visible"}),{position:"relative"})},{children:[k&&n.jsx(u.default,{open:oe.open,anchorEl:oe.anchorEl,sectionTitle:oe.sectionTitle,referenceSectionTitle:oe.refSectionTitle,onClose:pe,onOpenCognitiveCompare:Ge,onOpenSideBySide:bn}),te.open&&n.jsx(c.default,{open:te.open,popupRef:J,position:X,popupConfig:A,onClose:function(){K(null),ie(function(n){return e.__assign(e.__assign({},n),{open:!1})})},markdownStyles:R,sectionTitle:te.sectionTitle,referenceSectionTitle:te.refSectionTitle,cognitiveData:te.cognitiveData,anchorEl:te.anchorEl,sectionAnchorEl:te.sectionAnchorEl,scrollContainerEl:se.current,badgeStyle:te.badgeStyle,docData:te.docData}),n.jsx(i.Snackbar,e.__assign({open:!!N,autoHideDuration:8e3,onClose:function(){return L(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(i.Alert,e.__assign({onClose:function(){return L(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:N}))})),n.jsxs(i.Box,e.__assign({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[n.jsx(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:w}))})),n.jsx(i.Box,e.__assign({sx:{display:"flex",alignItems:"center"}},{children:n.jsx(i.FormControlLabel,{control:n.jsx(i.Switch,{checked:k,onChange:function(e){return O(e.target.checked)},color:"primary",size:"small"}),label:n.jsx(i.Typography,e.__assign({sx:{fontSize:"13px",fontWeight:500,color:"#64748B"}},{children:"Relative Order"})),labelPlacement:"start",sx:{m:0,gap:1}})}))]})),n.jsx(i.Box,e.__assign({ref:se,onScroll:Sn,sx:{flex:1,minHeight:0,pt:1.5,pb:8,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:k?"hidden":"auto",borderTop:ze&&He?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},k?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:Ye,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},k?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({style:{position:"absolute",top:0,left:0,width:Z.width||"100%",height:Z.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible"}},{children:[on&&n.jsxs("g",{children:[n.jsx("line",{x1:on.x1,y1:on.y,x2:Math.max(on.x1,(on.x1+on.x2)/2-70),y2:on.y,stroke:"#BBF7D0",strokeWidth:"1.5"}),n.jsx("line",{x1:Math.min(on.x2,(on.x1+on.x2)/2+70),y1:on.y,x2:on.x2,y2:on.y,stroke:"#BBF7D0",strokeWidth:"1.5"})]}),Qe.map(function(t){var l,s=(t.x1+t.x2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;if(!k)return n.jsxs("g",{children:[n.jsx("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:s-100,y:t.y1-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsxs(i.Box,e.__assign({onClick:function(e){var n=Oe[t.sectionIdx]||{title:"",content:""},i=Me[t.sectionIdx]||{title:"",content:""};Ve(Ue(e.currentTarget,n,i,t.sectionIdx,t.style))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:t.style.badgeBg,color:t.style.badgeText,border:"1px solid ".concat(t.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:500,textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"}},{children:[t.style.label,n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(o.ButtonCognitiveIcon,{})})),n.jsx(r.ChevronDown,{size:11})]}))}))}))]},t.id);var a=Oe[t.sectionIdx];return!(null===(l=null==a?void 0:a.refIndexes)||void 0===l?void 0:l.length)||(null==a?void 0:a.selfIndex)<0?null:H&&en===t.sectionIdx&&P?n.jsxs("g",e.__assign({style:{transition:"opacity 0.2s"}},{children:[n.jsx("defs",{children:n.jsx("marker",e.__assign({id:"arr-".concat(t.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 7 2.5, 0 5",fill:t.style.badgeBorder||"#6366F1"})}))}),n.jsx("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(t.id,")")})]}),t.id):null})]})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},k?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({ref:Xe,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"40px",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(i.Tooltip,e.__assign({title:De,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:De}))}))})),n.jsx(i.Box,e.__assign({onScroll:Sn,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},k?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:Ne&&Oe.map(function(t,o){var l;if(!k)return n.jsx(i.Box,e.__assign({ref:qe(o)},{children:Fn(t,o,"left",un.current[o])}),"left-row-".concat(o));var s=t,a=gn(o),c=!(null===(l=s.refIndexes)||void 0===l?void 0:l.length)||s.selfIndex<0,u="number"==typeof s.selfIndex&&s.selfIndex>=0?s.selfIndex+1:null;return n.jsx(i.Box,e.__assign({ref:qe(o),sx:{mb:1}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:un.current[o],sx:{width:"100%"}},{children:Fn(t,o,"left",f.default.createRef(),0)})),a&&n.jsxs(i.Box,e.__assign({ref:fn.current[o],onClick:function(e){var n=Me.find(function(e){var n;return null===(n=s.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""};!function(e,n,t,i,r){e.stopPropagation(),oe.open&&oe.sectionIdx===i?pe():(he(),le(Ue(e.currentTarget,n,t,i,r)))}(e,t,n,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==u&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:u})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:c?"No Deviation Found":0==a.deviationLabel||void 0===a.deviationLabel?"Same":"".concat(a.deviationLabel,"% Deviation")})),n.jsx(r.EllipsisVertical,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))})}))]})),n.jsx(i.Box,e.__assign({sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"6px",gap:0}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(i.Box,e.__assign({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",borderRadius:"20px",bgcolor:"#ECFDF3",border:"1px solid #A7F3D0",color:"#15803D",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1}},{children:[n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(o.ButtonCognitiveIcon,{})})),0,"% Similarity",n.jsx(r.ChevronDown,{size:11})]}))}))})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},k?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[n.jsx(i.Box,e.__assign({ref:Ke,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(i.Tooltip,e.__assign({title:ke,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:ke}))}))})),n.jsxs(i.Box,e.__assign({ref:ce,onScroll:Sn,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},k?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-160px",pl:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:ue,style:{width:"100%",height:"0px",flexShrink:0}}),Ne&&Me.map(function(t,r){if(!k)return Fn(t,r,"right",dn.current[r]);var o=t,l=Oe.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(o.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1});return n.jsx(i.Box,e.__assign({ref:hn.current[r],sx:{mb:1}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:dn.current[r],sx:{width:"100%"}},{children:Fn(t,r,"right",f.default.createRef(),0)})),n.jsx(i.Box,e.__assign({ref:xn.current[r],sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:"#EEF2FF",color:"#3730A3",border:"1px solid #C7D2FE",borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:l.length>0?l.join(", "):"-"}))]}))}),"right-row-".concat(r))}),n.jsx("div",{ref:de,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@mui/material"),r=require("lucide-react"),o=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),s=require("react-markdown"),a=require("./CognitiveComparehelpers.js"),c=require("./CognitiveCompareConfig.js"),u=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),f=require("./LoaderComponent.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=v(t),h=v(s),p=x.default.memo(function(t){var r=t.content,o=t.sxStyles;return n.jsx(i.Typography,e.__assign({component:"div",sx:o},{children:n.jsx(h.default,{children:a.safeStringify(r).replace(/\\n/g,"\n")})}))}),g=function(e,n,t,i,r){void 0===r&&(r=14);var o=(e+t)/2,l=i-n;if(Math.abs(l)<3)return"M ".concat(e," ").concat(n," H ").concat(t);var s=l>0?1:-1,a=Math.min(r,Math.abs(l)/2,Math.abs(o-e)/2,Math.abs(t-o)/2);return["M ".concat(e," ").concat(n),"H ".concat(o-a),"Q ".concat(o," ").concat(n," ").concat(o," ").concat(n+s*a),"V ".concat(i-s*a),"Q ".concat(o," ").concat(i," ").concat(o+a," ").concat(i),"H ".concat(t)].join(" ")},m={id:"",title:""},_={open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null},y=function(e,n,t,i,r){void 0===t&&(t=300);var o=e.style.scrollBehavior;e.style.scrollBehavior="auto";var l=e.scrollTop,s=n-l,a=null,c=function(u){null===a&&(a=u);var d,f=u-a;f<t?(e.scrollTop=(d=f,d/=t,s*(--d*d*d+1)+l),r&&r(),requestAnimationFrame(c)):(e.scrollTop=n,e.style.scrollBehavior=o,r&&r(),i&&i())};requestAnimationFrame(c)};exports.SHARED_MARKDOWN_STYLES=c.SHARED_MARKDOWN_STYLES,exports.default=function(s){var v,b,S,I,F,R,w,C,j=s.componentHeaderText,E=void 0===j?"Contract Comparison":j,B=s.treeData,T=s.comparisonConfig,A=s.leftColumnTitleText,D=s.rightColumnTitleText,M=s.markdownStyles,k=s.maintainRelativeOrder,O=void 0!==k&&k,H=s.popupConfig,L=s.deviationData,N=void 0===L?{}:L,z=t.useState(O),W=z[0],q=z[1],P=t.useState(!1),Y=P[0],V=P[1],U=t.useState(!1),G=U[0],X=U[1],K=t.useState(null),J=K[0],Q=K[1],Z=t.useState(!1),$=Z[0],ee=Z[1],ne=t.useState(!1),te=ne[0],ie=ne[1],re=t.useRef(!1),oe=t.useState(new Set),le=oe[0],se=oe[1],ae=t.useState([]),ce=ae[0],ue=ae[1],de=t.useRef(null),fe=t.useRef(!1),ve=t.useRef(null),xe=t.useRef({}),he=t.useRef([]),pe=t.useRef(!1),ge=t.useRef(!1),me=t.useRef(null),_e=t.useMemo(function(){return(null==B?void 0:B.cognitive_decisioning)||{}},[B]),ye=t.useState(null),be=ye[0],Se=ye[1],Ie=t.useRef(null),Fe=t.useState({width:0,height:0}),Re=Fe[0],we=Fe[1],Ce=t.useMemo(function(){return e.__assign(e.__assign({},c.SHARED_MARKDOWN_STYLES),M)},[M]),je=t.useState({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),Ee=je[0],Be=je[1],Te=t.useState({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),Ae=Te[0],De=Te[1],Me=t.useRef(null),ke=t.useRef(null),Oe=t.useRef(null),He=t.useRef(null),Le=t.useRef(null),Ne=t.useRef(null),ze=t.useRef(!1),We=t.useRef(null);t.useEffect(function(){We.current=null},[Ee.sectionIdx,Ee.open]);var qe=t.useCallback(function(){Se(null),Be(_)},[]),Pe=t.useCallback(function(){De(_)},[]),Ye=t.useCallback(function(){var e;if(Ee.anchorEl&&Ee.refSectionTitle){var n=Ee.anchorEl.getBoundingClientRect(),t=(null===(e=null==Ie?void 0:Ie.current)||void 0===e?void 0:e.offsetHeight)||0,i=Math.min(680,window.innerWidth-24),r=window.innerHeight-n.bottom-12-12,o=n.top-12-12,l=r<t&&o>r;null!==We.current?!0===We.current&&(l=o>=t||o>=r):l=!(r>=t||r>=o),We.current=l;var s=l?o:r,a=Math.min(t||9999,s),c=l?n.top-12-a:n.bottom+12,u=n.left+n.width/2,d=u-i/2,f=Math.max(12,Math.min(d,window.innerWidth-i-12)),v=Math.max(14,Math.min(u-f,i-10-4));Se({top:c,left:f,arrowLeft:v,openAbove:l,maxHeight:s})}},[Ee.anchorEl,Ee.refSectionTitle]);t.useEffect(function(){if(Ee.open){window.addEventListener("resize",Ye);var e=requestAnimationFrame(Ye),n=null;return Ie.current&&(n=new ResizeObserver(function(){cancelAnimationFrame(e),e=requestAnimationFrame(Ye)})).observe(Ie.current),function(){cancelAnimationFrame(e),window.removeEventListener("resize",Ye),n&&n.disconnect()}}},[Ee.open,Ye]),t.useEffect(function(){var e=Me.current;if(e&&Ee.open){var n=function(e){Ie.current&&Ie.current.contains(e.target)||(Se(null),qe())};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[Ee.open,qe]),t.useEffect(function(){var e=Me.current;if(e&&Ae.open){var n=function(){Pe()};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[Ae.open,Pe]);var Ve=t.useMemo(function(){var n,t,i,r,o,l,s,a,u,d,f,v;return{fields:null!==(n=null==T?void 0:T.fields)&&void 0!==n?n:c.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(t=null==T?void 0:T.thresholds)||void 0===t?void 0:t.high)&&void 0!==i?i:c.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(r=null==T?void 0:T.thresholds)||void 0===r?void 0:r.medium)&&void 0!==o?o:c.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(s=null===(l=null==T?void 0:T.thresholds)||void 0===l?void 0:l.exact)&&void 0!==s?s:c.DEFAULT_COMPARISON_CONFIG.thresholds.exact},relationStyles:{noContent:e.__assign(e.__assign({},c.DEFAULT_COMPARISON_CONFIG.relationStyles.noContent),(null===(a=null==T?void 0:T.relationStyles)||void 0===a?void 0:a.noContent)||{}),high:e.__assign(e.__assign({},c.DEFAULT_COMPARISON_CONFIG.relationStyles.high),(null===(u=null==T?void 0:T.relationStyles)||void 0===u?void 0:u.high)||{}),exact:e.__assign(e.__assign({},c.DEFAULT_COMPARISON_CONFIG.relationStyles.exact),(null===(d=null==T?void 0:T.relationStyles)||void 0===d?void 0:d.exact)||{}),medium:e.__assign(e.__assign({},c.DEFAULT_COMPARISON_CONFIG.relationStyles.medium),(null===(f=null==T?void 0:T.relationStyles)||void 0===f?void 0:f.medium)||{}),low:e.__assign(e.__assign({},c.DEFAULT_COMPARISON_CONFIG.relationStyles.low),(null===(v=null==T?void 0:T.relationStyles)||void 0===v?void 0:v.low)||{})}}},[T]),Ue=t.useMemo(function(){if(B&&Object.keys(B).length>0)try{var n=function(n,t,i){var r,o,l,s,c,u,d,f,v;void 0===t&&(t=!1),void 0===i&&(i=null);var x=[],h=[],p=n.base_root_id,g=n.input_index_map||{0:"left",1:"right"},m=n[p];if(!m||!1===m.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[]};var _=function(t,r){var o,l=n[t];if(!l||!1===l.display_node)return null;var s=a.getSideData(l,r,g),c=!!s.title.trim(),u=!!s.content.trim(),d=a.getRationale(l),f=(null===(o=null==i?void 0:i[t])||void 0===o?void 0:o.evaluation_result)||l.evaluation_result||null,v=[];l.next&&Object.values(l.next).forEach(function(e){var t=n[e];if(t&&!1!==t.display_node){var i=_(e,r);i&&v.push(i)}});var x=!(!c&&!u);return e.__assign(e.__assign({id:t,title:c?s.title:"",content:u?s.content:"",subsections:v},x?d:{score:void 0,relation:"not_defined"}),{evaluationResult:f})};if(t){var y={},b={},S=-1,I=-1;for(var F in n)if(!["base_root_id","documents","input_index_map",p].includes(F)){var R=n[F];if(R&&!1!==R.display_node){var w=a.getRationale(R),C=a.getSideData(R,"0",g),j=a.getSideData(R,"1",g),E=C.title.trim()||C.content.trim(),B=j.title.trim()||j.content.trim(),T=(null===(r=null==i?void 0:i[F])||void 0===r?void 0:r.evaluation_result)||R.evaluation_result||null,A=Number(null!==(l=null===(o=C.attributes)||void 0===o?void 0:o.display_index)&&void 0!==l?l:S--),D=Number(null!==(c=null===(s=j.attributes)||void 0===s?void 0:s.display_index)&&void 0!==c?c:I--),M=b[D]||e.__assign(e.__assign({id:F,title:B?j.title:"",content:B?j.content:"",subsections:[]},B?w:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:D,evaluationResult:T}),k=y[A]||e.__assign(e.__assign({id:F,title:E?C.title:"",content:E?C.content:"",subsections:[]},E?w:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:A,evaluationResult:T});Number(D)>=0&&Number(A)>=0&&(M.refIndexes.includes(Number(A))||M.refIndexes.push(Number(A)),k.refIndexes.includes(Number(D))||k.refIndexes.push(Number(D))),b[D]=M,y[A]=k}}h=Object.values(b).map(function(e){return e}),x=Object.values(y).map(function(e){return e}),h.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex}),x.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex})}else m.next&&Object.values(m.next).forEach(function(e){var t=n[e];t&&!1!==t.display_node&&(x.push(_(e,"0")||{id:e,title:"",content:"",subsections:[]}),h.push(_(e,"1")||{id:e,title:"",content:"",subsections:[]}))});return{activeProposed:{title:(null===(d=null===(u=m.comparison_inputs)||void 0===u?void 0:u[g[0]])||void 0===d?void 0:d.title)||"Uploaded Contract",description:m.decision_scope_description||"",sections:x},activeVariants:[{id:"tree-variant-1",title:(null===(v=null===(f=m.comparison_inputs)||void 0===f?void 0:f[g[1]])||void 0===v?void 0:v.title)||"Reference Template",similarity:0,sections:h,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:m.decision_scope_description||""},fields:{}}}}]}}(B,W,N);return e.__assign(e.__assign({},n),{parseError:null})}catch(e){return console.error("Data Transformation Error: ",e),{activeProposed:{},activeVariants:[],parseError:e instanceof Error?e.message:"Unknown Parsing Error"}}return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"}},[JSON.stringify(B),W,JSON.stringify(N)]),Ge=Ue.activeProposed,Xe=Ue.activeVariants,Ke=Ue.parseError;t.useEffect(function(){Ke&&Q("Failed to load comparison: ".concat(Ke))},[Ke]);var Je=t.useState(null),Qe=Je[0];Je[1];var Ze=t.useState({}),$e=Ze[0],en=Ze[1],nn=t.useState({}),tn=nn[0],rn=nn[1],on=(null==Xe?void 0:Xe[0])||m,ln=null===(S=null===(v=null==B?void 0:B.documents)||void 0===v?void 0:v[null===(b=null==B?void 0:B.input_index_map)||void 0===b?void 0:b[0]])||void 0===S?void 0:S.title,sn=null===(R=null===(I=null==B?void 0:B.documents)||void 0===I?void 0:I[null===(F=null==B?void 0:B.input_index_map)||void 0===F?void 0:F[1]])||void 0===R?void 0:R.title,an=a.safeStringify(A||ln||"Uploaded Contract"),cn=a.safeStringify(D||sn||"Reference Template"),un=t.useMemo(function(){return(null==Ge?void 0:Ge.sections)||[]},[null==Ge?void 0:Ge.sections]),dn=t.useMemo(function(){return on.sections||[]},[on.sections]),fn=un.length>0||dn.length>0,vn=on.analysis,xn=a.safeStringify(null===(C=null===(w=null==vn?void 0:vn.rule_difference_comparison)||void 0===w?void 0:w.summary)||void 0===C?void 0:C.overall_summary),hn=!!xn.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),pn=t.useRef({}),gn=function(e){return pn.current[e]||(pn.current[e]=x.default.createRef()),pn.current[e]},mn=t.useCallback(function(){ee(!1),ge.current=!1,Dn(null),me.current=null,Fn.current=null,ie(!1),X(!1),He.current&&(He.current.style.height="0px"),Le.current&&(Le.current.style.height="0px")},[]),_n=t.useCallback(function(e,n,t,i,r){var o,l,s=a.safeStringify(n.id)||a.safeStringify(t.id)||"",c=(s?_e[s]:null)||n.cognitiveData||t.cognitiveData||{section_id:s,decisioning:[],gap:[],relevance_score:0},u=null!==(l=null===(o=pn.current[i])||void 0===o?void 0:o.current)&&void 0!==l?l:null;return{open:!0,sectionTitle:n.title||"N/A",refSectionTitle:t.title||"NA",cognitiveData:c,anchorEl:e,sectionAnchorEl:u,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==B?void 0:B.documents,input_index_map:null==B?void 0:B.input_index_map},deviationData:n.evaluationResult||t.evaluationResult||null}},[_e,B]),yn=t.useCallback(function(e){Pe(),Se(null),Be(e)},[Pe]),bn=t.useCallback(function(){null!==Ae.sectionIdx&&Ae.anchorEl?yn(e.__assign(e.__assign({},Ae),{open:!0})):Pe()},[Ae,Pe,yn]);t.useCallback(function(e){Pe(),Q("".concat(e," is coming soon."))},[Pe]);var Sn=t.useCallback(function(){var e=Ae.sectionIdx;Pe(),null!==e&&(ge.current&&mn(),se(function(n){return n.has(e)?new Set:new Set([e])}))},[Ae.sectionIdx,Pe,mn]),In=t.useRef(null),Fn=t.useRef(null),Rn=t.useRef(null),wn=t.useRef(null),Cn=t.useRef(null),jn=t.useState([]),En=jn[0],Bn=jn[1],Tn=t.useState(null),An=Tn[0],Dn=Tn[1];t.useRef(null);var Mn=t.useState(null),kn=Mn[0],On=Mn[1],Hn=t.useMemo(function(){return Ve.fields.filter(function(e){var n=e.key;return(!fn||"description"!==n)&&(a.hasValue(null==Ge?void 0:Ge[n])||a.hasValue(on[n]))})},[Ge,on,fn,Ve.fields]),Ln=t.useRef({}),Nn=t.useRef({}),zn=t.useRef({}),Wn=t.useRef({}),qn=t.useRef({}),Pn=t.useRef({}),Yn=t.useRef({});Hn.forEach(function(e){for(var n=e.key,t=0;t<Math.max(un.length,dn.length);t+=1)zn.current[t]||(zn.current[t]=x.default.createRef()),Wn.current[t]||(Wn.current[t]=x.default.createRef()),qn.current[t]||(qn.current[t]=x.default.createRef()),Pn.current[t]||(Pn.current[t]=x.default.createRef()),Yn.current[t]||(Yn.current[t]=x.default.createRef());Ln.current[n]||(Ln.current[n]=x.default.createRef()),Nn.current[n]||(Nn.current[n]=x.default.createRef())});for(var Vn=0;Vn<Math.max(un.length,dn.length);Vn+=1)zn.current[Vn]||(zn.current[Vn]=x.default.createRef()),Wn.current[Vn]||(Wn.current[Vn]=x.default.createRef()),qn.current[Vn]||(qn.current[Vn]=x.default.createRef()),Pn.current[Vn]||(Pn.current[Vn]=x.default.createRef()),Yn.current[Vn]||(Yn.current[Vn]=x.default.createRef());t.useEffect(function(){if(Qe){var e=Ve.fields.find(function(e){return e.analysisKey===Qe||e.key===Qe});if(e){var n=Ln.current[e.key]||Nn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Qe,Ve.fields]);var Un=t.useCallback(function(e){var n,t,i,r,o,l,s,a,c,u=null===(n=null==vn?void 0:vn.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!u||!u[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=u[e],f=(null==d?void 0:d.relation)||(null===(i=null===(t=null==d?void 0:d.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(o=null===(r=null==d?void 0:d.highlights)||void 0===r?void 0:r.ruleB_spans)||void 0===o?void 0:o.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var v=d.mappings[0]||{};return{score:d.score,relation:v.relation||"",highlightsA:(null===(l=v.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(s=v.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!f}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(a=d.highlights)||void 0===a?void 0:a.ruleA_spans)||[],highlightsB:(null===(c=d.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!f}},[vn]),Gn=t.useCallback(function(n){var t,i,r,o,l=un[n],s=dn[n],c=(null==l?void 0:l.relation)&&"not_defined"!==l.relation,u=(null==s?void 0:s.relation)&&"not_defined"!==s.relation,d=a.safeStringify(null==l?void 0:l.id)||a.safeStringify(null==s?void 0:s.id)||"",f=!(!(null==l?void 0:l.cognitiveData)&&!(null==s?void 0:s.cognitiveData));if(!c&&!u&&!f)return e.__assign(e.__assign({},Ve.relationStyles.noContent),{label:"Not Defined"});var v=Un("description");if(null!=(null!==(i=null!==(t=null==l?void 0:l.cognitiveRelevanceScore)&&void 0!==t?t:null==s?void 0:s.cognitiveRelevanceScore)&&void 0!==i?i:d?null===(r=_e[d])||void 0===r?void 0:r.relevance_score:void 0)){var x=a.cognitiveScoreToRelation(),h=x.score,p=x.relation;return a.getStyleForRelation(h,p,!0,Ve)}var g=c?l.relation:u?s.relation:v.relation,m=null!==(o=null==l?void 0:l.score)&&void 0!==o?o:null==s?void 0:s.score,_="number"==typeof m?m:v.score;return a.getStyleForRelation(_,g,!0,Ve)},[un,dn,_e,Ve,Un]),Xn=t.useCallback(function(){var e,n,t,i,r,o,l,s,c,u,d;if(!ze.current&&!fe.current){ze.current=!0;try{if(!In.current)return;var f=In.current.getBoundingClientRect();we({width:f.width,height:f.height});var v=[];if(Hn.forEach(function(e){var n,t,i=e.key,r=null===(n=Ln.current[i])||void 0===n?void 0:n.current,o=null===(t=Nn.current[i])||void 0===t?void 0:t.current;r&&o&&(r.style.height="auto",o.style.height="auto",r.style.minHeight="0px",o.style.minHeight="0px")}),!W&&!fe.current)for(var x=0;x<Math.min(un.length,dn.length);x++){var h=null===(e=zn.current[x])||void 0===e?void 0:e.current,p=null===(n=Wn.current[x])||void 0===n?void 0:n.current;h&&p&&(h.style.height="auto",p.style.height="auto",h.style.minHeight="0px",p.style.minHeight="0px")}var m={};Hn.forEach(function(e){var n,t,i=e.key,r=null===(n=Ln.current[i])||void 0===n?void 0:n.current,o=null===(t=Nn.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=r.getBoundingClientRect(),s=o.getBoundingClientRect();m[i]=Math.max(l.height,s.height)}});var _=[];if(!W&&!fe.current)for(x=0;x<Math.min(un.length,dn.length);x++){h=null===(t=zn.current[x])||void 0===t?void 0:t.current,p=null===(i=Wn.current[x])||void 0===i?void 0:i.current;var y=!!$e[String(x)];if(h&&p&&y){var b=h.getBoundingClientRect(),S=p.getBoundingClientRect();_[x]=Math.max(b.height,S.height)}}if(Hn.forEach(function(e){var n,t,i=e.key,r=null===(n=Ln.current[i])||void 0===n?void 0:n.current,o=null===(t=Nn.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=m[i];r.style.minHeight="".concat(l,"px"),o.style.minHeight="".concat(l,"px")}}),!W&&!fe.current)for(x=0;x<_.length;x++){h=null===(r=zn.current[x])||void 0===r?void 0:r.current,p=null===(o=Wn.current[x])||void 0===o?void 0:o.current;if(h&&p&&_[x]){var I=_[x];h.style.minHeight="".concat(I,"px"),p.style.minHeight="".concat(I,"px")}}if(Hn.forEach(function(e){var n,t,i=e.key,r=e.analysisKey,o=null===(n=Ln.current[i])||void 0===n?void 0:n.current,l=null===(t=Nn.current[i])||void 0===t?void 0:t.current;if(o&&l){var s=o.getBoundingClientRect(),c=l.getBoundingClientRect(),u=Un(r),d=a.getStyleForRelation(u.score,u.relation,u.hasContent,Ve);if(!d)return;var x=s.top+s.height/2-f.top;v.push({id:"field-".concat(i),x1:s.right-f.left,y1:x,x2:c.left-f.left,y2:x,style:d})}}),W)un.forEach(function(e,n){var t;(null===(t=zn.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,r,o,l,s,a,c,u,d,x=dn.findIndex(function(n){return n.selfIndex===e});if(-1!==x){var h=null===(t=qn.current[n])||void 0===t?void 0:t.current,p=null===(i=Pn.current[x])||void 0===i?void 0:i.current;if(h&&p){var g=h.getBoundingClientRect(),m=p.getBoundingClientRect(),_=g.right-f.left,y=m.left-f.left,b=g.top+g.height/2-f.top,S=m.top+m.height/2-f.top;if($&&An===n){var I=null!==(o=null===(r=Ne.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==o?o:0,F=null!==(s=null===(l=Oe.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==s?s:0,R=I+(null!==(c=null===(a=Ne.current)||void 0===a?void 0:a.clientHeight)&&void 0!==c?c:1/0),w=F+(null!==(d=null===(u=Oe.current)||void 0===u?void 0:u.clientHeight)&&void 0!==d?d:1/0),C=g.top+g.height/2,j=function(e,n,t){return Math.max(n,Math.min(t,e))};b=j(C,I,R)-f.top,S=j(C,F,w)-f.top}var E=Gn(n);E&&v.push({id:"line-".concat(n,"-").concat(x),x1:_,y1:b,x2:y,y2:S,style:E,sectionIdx:n,targetRightIdx:x})}}})});else for(x=0;x<Math.min(un.length,dn.length);x++){var F=null===(l=zn.current[x])||void 0===l?void 0:l.current,R=null===(s=Wn.current[x])||void 0===s?void 0:s.current;if(F&&R){var w=F.getBoundingClientRect(),C=R.getBoundingClientRect(),j=(w.top+18-f.top+C.top+18-f.top)/2,E=(null===(c=dn[x])||void 0===c?void 0:c.id)||"sec-".concat(x),B=Gn(x);B&&v.push({id:E,x1:w.right-f.left,y1:j,x2:C.left-f.left,y2:j,style:B,sectionIdx:x,hasCognitive:!!((null===(u=un[x])||void 0===u?void 0:u.cognitiveData)||(null===(d=dn[x])||void 0===d?void 0:d.cognitiveData)||E&&_e[E])})}}if(Bn(v),wn.current&&Cn.current){var T=wn.current.getBoundingClientRect(),A=Cn.current.getBoundingClientRect(),D=(T.top+T.height/2-f.top+A.top+A.height/2-f.top)/2;On({x1:T.right-f.left,x2:A.left-f.left,y:D})}else On(null);if(W&&le.size>0){var M=[],k=Ne.current,O=Oe.current;if(k&&O){var H=[],L=k.getBoundingClientRect().top,N=O.getBoundingClientRect().top,z=L+k.clientHeight,q=N+O.clientHeight,P=k.scrollTop,Y=O.scrollTop,V=f.top,U=function(e,n,t){return Math.max(n,Math.min(t,e))};le.forEach(function(e){var n,t=un[e];(null===(n=null==t?void 0:t.refIndexes)||void 0===n?void 0:n.length)&&t.refIndexes.forEach(function(n){var t,i,r=dn.findIndex(function(e){return e.selfIndex===n});if(-1!==r){var o=null===(t=qn.current[e])||void 0===t?void 0:t.current,l=null===(i=Pn.current[r])||void 0===i?void 0:i.current;if(o&&l){var s=o.getBoundingClientRect(),a=l.getBoundingClientRect(),c=Gn(e),u=s.right-f.left,d=a.left-f.left,v=(u+d)/2,x=s.top+s.height/2,h=a.top+a.height/2,p=x-L+P,m=h-N+Y,_="conn-".concat(e,"-").concat(r);H.push({lhsScrollY:p,rhsScrollY:m,x1:u,x2:d,containerTop:V,leftIdx:e,rhsArrayIdx:r,styleColor:(null==c?void 0:c.badgeBorder)||"#6366F1",styleId:_});var y=U(x,L,z),b=U(h,N,q),S=y-V,I=b-V,F=x>=L-4&&x<=z+4,R=h>=N-4&&h<=q+4,w="";w=F&&R?g(u,S,d,I):F&&!R?"M ".concat(u,",").concat(S," L ").concat(v,",").concat(S," L ").concat(v,",").concat(I):!F&&R?"M ".concat(v,",").concat(S," L ").concat(v,",").concat(I," L ").concat(d,",").concat(I):"M ".concat(v,",").concat(S," L ").concat(v,",").concat(I),M.push({id:_,pathD:w,style:c,leftIdx:e,rhsArrayIdx:r})}}})}),he.current=H}ue(M)}else ue([]),he.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{ze.current=!1}}},[Hn,un,dn,_e,Ve,Un,Gn,W,$,An,le,$e]),Kn=t.useCallback(function(){var e,n,t,i,r,o,l,s,a,c,u,d,f,v,x=he.current;if(x.length&&!fe.current){var h=null!==(n=null===(e=Ne.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,p=null!==(i=null===(t=Oe.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,m=null!==(o=null===(r=Ne.current)||void 0===r?void 0:r.clientHeight)&&void 0!==o?o:1/0,_=null!==(s=null===(l=Oe.current)||void 0===l?void 0:l.clientHeight)&&void 0!==s?s:1/0,y=null!==(c=null===(a=Ne.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==c?c:0,b=null!==(d=null===(u=Oe.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==d?d:0,S=y+m,I=b+_,F=null!==(v=null===(f=In.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==v?v:0,R=function(e,n,t){return Math.max(n,Math.min(t,e))};x.forEach(function(e){var n=e.lhsScrollY-h+y,t=e.rhsScrollY-p+b,i=xe.current[e.styleId+"-stroke"],r=xe.current[e.styleId+"-bg"];if(i||r){var o,l=R(n,y,S),s=R(t,b,I),a=l-F,c=s-F,u=n>=y-4&&n<=S+4,d=t>=b-4&&t<=I+4,f=(e.x1+e.x2)/2;o=u&&d?g(e.x1,a,e.x2,c):u&&!d?"M ".concat(e.x1,",").concat(a," L ").concat(f,",").concat(a," L ").concat(f,",").concat(c):!u&&d?"M ".concat(f,",").concat(a," L ").concat(f,",").concat(c," L ").concat(e.x2,",").concat(c):"M ".concat(f,",").concat(a," L ").concat(f,",").concat(c),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",o)),r&&(r.setAttribute("visibility","visible"),r.setAttribute("d",o))}})}},[]),Jn=t.useRef(Xn);t.useEffect(function(){Jn.current=Xn},[Xn]);var Qn=t.useRef(null),Zn=t.useCallback(function(){null!==Qn.current&&clearTimeout(Qn.current),Qn.current=setTimeout(function(){Jn.current(),Qn.current=null},50)},[]),$n=t.useCallback(function(e){var n,t,i,r,o;if(!re.current){if(ge.current){var l=me.current,s=Fn.current,a=Ne.current,c=Oe.current;if(null!==l&&null!==s&&a&&c){var u=null===(n=pn.current[l])||void 0===n?void 0:n.current,d=null===(t=Yn.current[s])||void 0===t?void 0:t.current;if(u&&d){if(e.currentTarget===a){var f=u.offsetTop-a.scrollTop,v=Math.max(0,d.offsetTop-f);Math.abs(c.scrollTop-v)>1&&(c.scrollTop=v)}else if(e.currentTarget===c){var x=d.offsetTop-c.scrollTop,h=Math.max(0,u.offsetTop-x);Math.abs(a.scrollTop-h)>1&&(a.scrollTop=h)}if(Rn.current){var p=null===(i=qn.current[l])||void 0===i?void 0:i.current,g=null!==(o=null===(r=In.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==o?o:0,m=a.getBoundingClientRect().top,_=m+a.clientHeight,y=c.getBoundingClientRect().top,b=y+c.clientHeight,S=function(e,n,t){return Math.max(n,Math.min(t,e))};if(p){var I=p.getBoundingClientRect(),F=I.top+I.height/2,R=S(F,m,_),w=S(F,y,b);Rn.current.setAttribute("y1",(R-g).toString()),Rn.current.setAttribute("y2",(w-g).toString());var C=F>=m-4&&F<=_+4;Rn.current.setAttribute("visibility",C?"visible":"hidden")}}}}}he.current.length>0&&!pe.current&&(pe.current=!0,requestAnimationFrame(function(){Kn(),pe.current=!1}))}},[Kn]);t.useEffect(function(){var e=setTimeout(Zn,250);window.addEventListener("resize",Zn);var n=null,t=null;return Me.current&&(n=new ResizeObserver(Zn)).observe(Me.current),In.current&&(t=new ResizeObserver(Zn)).observe(In.current),function(){clearTimeout(e),window.removeEventListener("resize",Zn),null==n||n.disconnect(),null==t||t.disconnect()}},[Ge,on,vn,Hn,$e,tn,un,dn,Ve,Zn,$,An,te,le]),t.useEffect(function(){ge.current=$},[$]),t.useEffect(function(){me.current=An},[An]);var et=t.useCallback(function(){var e=Ae.sectionIdx;Pe(),null!==e&&($&&An===e?mn():(se(new Set),ue([]),he.current=[],X(!0),re.current=!0,Dn(e),me.current=e,ee(!0),ge.current=!0,ie(!1),He.current&&(He.current.style.height="0px"),Le.current&&(Le.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i=null===(n=pn.current[e])||void 0===n?void 0:n.current,r=un[e],o=(null==r?void 0:r.refIndexes)||[],l=null,s=-1;if(o.length>0){var a=o[0];s=dn.findIndex(function(e){return e.selfIndex===a}),l=null===(t=Yn.current[s])||void 0===t?void 0:t.current}Fn.current=-1!==s?s:null;var c=Ne.current,u=Oe.current;if(!i||!c)return re.current=!1,void X(!1);var d=i.offsetTop-c.scrollTop;if(!l||!u)return ie(!0),Jn.current(),re.current=!1,void X(!1);var f=l.offsetTop-d;f<0&&He.current&&(He.current.style.height="".concat(Math.abs(f),"px"));requestAnimationFrame(function(){var e,n=u.scrollHeight-u.clientHeight;if(f<0)e=0;else{if(f>n){var t=f-n;return Le.current&&(Le.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){y(u,f,200,function(){ie(!0),Jn.current(),re.current=!1,X(!1)})})}e=f}y(u,e,200,function(){ie(!0),Jn.current(),re.current=!1,X(!1)})})})))},[Pe,Ae.sectionIdx,$,An,un,dn,Zn,mn]),nt=null!==Ae.sectionIdx&&le.has(Ae.sectionIdx),tt=function(t,o,l,s,c){void 0===c&&(c=1);var u,d=W?!!$e["".concat(l,"-").concat(o)]:!!$e[String(o)],f=a.hasValue(t.title),v=a.hasValue(t.content),h=!f&&!v,g=t.title;return f||(g=v?"No Title Found":"No Matching Section Found"),n.jsx(i.Box,e.__assign({ref:s,sx:e.__assign(e.__assign({mb:c},W?{height:"fit-content"}:{minHeight:0}),{display:"flex",flexDirection:"column",position:"relative"})},{children:n.jsxs(i.Accordion,e.__assign({disableGutters:!0,expanded:!h&&d,onChange:function(){return!h&&function(n,t){var i,r;if(fe.current=!0,ve.current&&clearTimeout(ve.current),de.current&&(de.current.style.opacity="0"),!W){var o=null===(i=zn.current[n])||void 0===i?void 0:i.current,l=null===(r=Wn.current[n])||void 0===r?void 0:r.current;o&&l&&(o.style.minHeight="0px",l.style.minHeight="0px")}ve.current=setTimeout(function(){fe.current=!1,Jn.current(),de.current&&(de.current.style.opacity="1")},350),en(function(i){var r=e.__assign({},i);if(!W){var o=!!i[String(n)];return r[String(n)]=!o,r}var l="".concat(t,"-").concat(n),s=!i[l];if(r[l]=s,"left"===t)((null==(a=un[n])?void 0:a.refIndexes)||[]).forEach(function(e){var n=dn.findIndex(function(n){return n.selfIndex===e});-1!==n&&(r["right-".concat(n)]=s)});else{var a,c=null==(a=dn[n])?void 0:a.selfIndex;un.forEach(function(e,n){var t;(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(c))&&(r["left-".concat(n)]=s)})}return r})}(o,l)},sx:{boxShadow:"none",border:h?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:h?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flex:1,display:"flex",flexDirection:"column","&:before":{display:"none"}}},{children:[n.jsx(i.AccordionSummary,e.__assign({expandIcon:h?null:n.jsx(r.ChevronDown,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:h?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"flex",alignItems:"center",overflow:"hidden"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:n.jsx(i.Tooltip,e.__assign({title:g,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"12px",color:h?"#94A3B8":"#19213D",fontWeight:h?400:700,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:(u=g,u?a.safeStringify(u).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,t){return e.startsWith("**")&&e.endsWith("**")?n.jsx("strong",{children:e.slice(2,-2)},t):n.jsx(x.default.Fragment,{children:e},t)}):null)}))}))})),!h&&n.jsxs(i.AccordionDetails,e.__assign({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column"}},{children:[n.jsx(p,{content:t.content,sxStyles:Ce}),(t.subsections||[]).map(function(e,n){return it(e,"".concat(o,"-").concat(n),0)})]}))]}))}),"".concat(l,"-sec-").concat(o))},it=function(t,o,l){void 0===l&&(l=0);var s=a.hasValue(t.title),c=a.hasValue(t.content),u=!s&&!c,d=s?t.title:c?"No Title Found":"No Matching Section Found",f=!!tn[o];return t.title?n.jsxs(i.Accordion,e.__assign({disableGutters:!0,expanded:!u&&f,onChange:function(){return!u&&rn(function(n){var t;return e.__assign(e.__assign({},n),((t={})[o]=!n[o],t))})},sx:{mt:1,boxShadow:"none",border:u?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF","&:before":{display:"none"}}},{children:[n.jsx(i.AccordionSummary,e.__assign({expandIcon:u?null:n.jsx(r.ChevronDown,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5}}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"11px",fontWeight:600,color:u?"#94A3B8":"#19213D"}},{children:d||"Untitled Subsection"}))})),!u&&n.jsxs(i.AccordionDetails,e.__assign({sx:{pt:0,pb:1}},{children:[c&&n.jsx(i.Typography,e.__assign({component:"div",sx:Ce},{children:n.jsx(h.default,{children:a.safeStringify(t.content).replace(/\\n/g,"\n")})})),(t.subsections||[]).map(function(e,n){return it(e,"".concat(o,"-").concat(n),l+1)})]}))]}),o):n.jsx(i.Box,e.__assign({sx:{mt:0===l?1:.75}},{children:!u&&n.jsxs("div",{children:[c&&n.jsx(i.Typography,e.__assign({component:"div",sx:Ce},{children:n.jsx(h.default,{children:a.safeStringify(t.content).replace(/\\n/g,"\n")})})),(t.subsections||[]).map(function(e,n){return it(e,"".concat(o,"-").concat(n),l+1)})]})}),o)};return n.jsxs(i.Box,e.__assign({ref:ke,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},W?{}:{overflow:"visible"}),{position:"relative"})},{children:[Y&&n.jsx(i.Box,e.__assign({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n.jsx(f.default,{})})),W&&n.jsx(d.default,{open:Ae.open,anchorEl:Ae.anchorEl,sectionTitle:Ae.sectionTitle,referenceSectionTitle:Ae.refSectionTitle,onClose:Pe,onOpenCognitiveCompare:bn,onOpenSideBySide:et,onConnect:Sn,isConnected:nt}),Ee.open&&n.jsx(u.default,{open:Ee.open,popupRef:Ie,position:be,popupConfig:H,onClose:function(){Se(null),Be(function(n){return e.__assign(e.__assign({},n),{open:!1})})},markdownStyles:M,sectionTitle:Ee.sectionTitle,referenceSectionTitle:Ee.refSectionTitle,cognitiveData:Ee.cognitiveData,anchorEl:Ee.anchorEl,sectionAnchorEl:Ee.sectionAnchorEl,scrollContainerEl:Me.current,badgeStyle:Ee.badgeStyle,docData:Ee.docData,deviationData:Ee.deviationData}),n.jsx(i.Snackbar,e.__assign({open:!!J,autoHideDuration:8e3,onClose:function(){return Q(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(i.Alert,e.__assign({onClose:function(){return Q(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:J}))})),n.jsxs(i.Box,e.__assign({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[n.jsx(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:E}))})),n.jsx(i.Box,e.__assign({sx:{display:"flex",alignItems:"center"}},{children:n.jsx(i.FormControlLabel,{control:n.jsx(i.Switch,{checked:W,onChange:function(e){var n=e.target.checked;V(!0),setTimeout(function(){q(n),mn(),se(new Set),ue([]),he.current=[],setTimeout(function(){V(!1)},400)},50)},color:"primary",size:"small",sx:{width:100,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"3px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(75px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:"#1976d2",opacity:1,border:0,"&::before":{content:'"Relative Order"',position:"absolute",left:"7px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px"}}}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:20,height:20},"& .MuiSwitch-track":{borderRadius:13,backgroundColor:"#9e9e9e",opacity:1,position:"relative","&::after":{content:'"Default View"',position:"absolute",right:"13px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px",opacity:1,transition:"opacity 0.2s"}},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{"&::after":{opacity:0}}}}),label:"",labelPlacement:"start",sx:{m:0,gap:1}})}))]})),n.jsx(i.Box,e.__assign({ref:Me,onScroll:$n,sx:{flex:1,minHeight:0,pt:1.5,pb:8,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:W?"hidden":"auto",borderTop:xn&&hn?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},W?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:In,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},W?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({ref:de,style:{position:"absolute",top:0,left:0,width:Re.width||"100%",height:Re.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[kn&&n.jsxs("g",{children:[n.jsx("line",{x1:kn.x1,y1:kn.y,x2:Math.max(kn.x1,(kn.x1+kn.x2)/2-70),y2:kn.y,stroke:"#BBF7D0",strokeWidth:"1.5"}),n.jsx("line",{x1:Math.min(kn.x2,(kn.x1+kn.x2)/2+70),y1:kn.y,x2:kn.x2,y2:kn.y,stroke:"#BBF7D0",strokeWidth:"1.5"})]}),En.map(function(t){var l,s=(t.x1+t.x2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;if(!W)return n.jsxs("g",{children:[n.jsx("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:s-100,y:t.y1-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsxs(i.Box,e.__assign({onClick:function(e){if(e.stopPropagation(),Ee.open&&Ee.sectionIdx===t.sectionIdx)qe();else{var n=un[t.sectionIdx]||{title:"",content:""},i=dn[t.sectionIdx]||{title:"",content:""};yn(_n(e.currentTarget,n,i,t.sectionIdx,t.style))}},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:t.style.badgeBg,color:t.style.badgeText,border:"1px solid ".concat(t.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:500,textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"}},{children:[t.style.label,n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(o.ButtonCognitiveIcon,{})})),n.jsx(r.ChevronDown,{size:11,style:{transform:Ee.open&&Ee.sectionIdx===t.sectionIdx?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id);var a=un[t.sectionIdx];return!(null===(l=null==a?void 0:a.refIndexes)||void 0===l?void 0:l.length)||(null==a?void 0:a.selfIndex)<0?null:$&&An===t.sectionIdx&&te?n.jsxs("g",e.__assign({style:{transition:"opacity 0.2s"}},{children:[n.jsx("defs",{children:n.jsx("marker",e.__assign({id:"arr-".concat(t.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 7 2.5, 0 5",fill:t.style.badgeBorder||"#6366F1"})}))}),n.jsx("line",{ref:Rn,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(t.id,")")})]}),t.id):null}),ce.map(function(t){var i,r=t.pathD,o=(null===(i=t.style)||void 0===i?void 0:i.badgeBorder)||"#6366F1",l="conn-marker-".concat(t.id),s="".concat(t.id,"-bg"),a="".concat(t.id,"-stroke");return n.jsxs("g",{children:[n.jsx("defs",{children:n.jsx("clipPath",e.__assign({id:"connections-clip"},{children:n.jsx("marker",e.__assign({id:l,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:o})}))}))}),n.jsx("path",{ref:function(e){xe.current[s]=e},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n.jsx("path",{ref:function(e){xe.current[a]=e},d:r,fill:"none",stroke:o,strokeWidth:"1.75",markerEnd:"url(#".concat(l,")")})]},t.id)})]})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},W?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({ref:wn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"40px",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(i.Tooltip,e.__assign({title:an,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:an}))}))})),n.jsx(i.Box,e.__assign({ref:Ne,onScroll:$n,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},W?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:fn&&un.map(function(t,o){var l;if(!W)return n.jsx(i.Box,e.__assign({ref:gn(o)},{children:tt(t,o,"left",zn.current[o])}),"left-row-".concat(o));var s=t,a=Gn(o),c=!(null===(l=s.refIndexes)||void 0===l?void 0:l.length)||s.selfIndex<0,u="number"==typeof s.selfIndex&&s.selfIndex>=0?s.selfIndex+1:null,d=le.has(o);return n.jsx(i.Box,e.__assign({ref:gn(o),sx:{mb:1}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:zn.current[o],sx:e.__assign({width:"100%"},d&&{borderRadius:"6px",outline:"2px solid ".concat((null==a?void 0:a.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:tt(t,o,"left",x.default.createRef(),0)})),a&&n.jsxs(i.Box,e.__assign({ref:qn.current[o],onClick:function(e){var n=dn.find(function(e){var n;return null===(n=s.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""};!function(e,n,t,i,r){e.stopPropagation(),Ae.open&&Ae.sectionIdx===i?Pe():(qe(),De(_n(e.currentTarget,n,t,i,r)))}(e,t,n,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==u&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:u})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:c?"No Deviation Found":0==a.deviationLabel||void 0===a.deviationLabel?"Same":"".concat(a.deviationLabel,"% Deviation")})),n.jsx(r.EllipsisVertical,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))})}))]})),n.jsx(i.Box,e.__assign({sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(i.Box,e.__assign({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",borderRadius:"20px",bgcolor:"#ECFDF3",border:"1px solid #A7F3D0",color:"#15803D",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1}},{children:[n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(o.ButtonCognitiveIcon,{})})),0,"% Similarity",n.jsx(r.ChevronDown,{size:11})]}))}))})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},W?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[G&&n.jsx(l.default,{sections:11}),n.jsx(i.Box,e.__assign({ref:Cn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(i.Tooltip,e.__assign({title:cn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:cn}))}))})),n.jsxs(i.Box,e.__assign({ref:Oe,onScroll:$n,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},W?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-160px",pl:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:He,style:{width:"100%",height:"0px",flexShrink:0}}),fn&&dn.map(function(t,r){if(!W)return tt(t,r,"right",Wn.current[r]);var o=t,l=un.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(o.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),s=un.some(function(e,n){var t;return le.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(o.selfIndex))}),a=un.findIndex(function(e,n){var t;return le.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(o.selfIndex))}),c=-1!==a?Gn(a):null;return n.jsx(i.Box,e.__assign({ref:Yn.current[r],sx:{mb:1}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:Wn.current[r],sx:e.__assign({width:"100%"},s&&c&&{borderRadius:"6px",outline:"2px solid ".concat(c.badgeBorder),outlineOffset:"1px"})},{children:tt(t,r,"right",x.default.createRef(),0)})),!G&&n.jsx(i.Box,e.__assign({ref:Pn.current[r],sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:"#EEF2FF",color:"#3730A3",border:"1px solid #C7D2FE",borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:l.length>0?l.join(", "):"-"}))]}))}),"right-row-".concat(r))}),n.jsx("div",{ref:Le,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),o=require("react/jsx-runtime"),e=require("react"),n=require("@mui/material"),t=require("lucide-react"),s=require("react-dom"),a=require("../../assests/svg/SparkleIcon.js"),r=require("./CognitiveCompareConfig.js"),l=require("./CitationRenderer.js");function c(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var d=c(s),x=10;exports.default=function(s){var c,p,g,u,v,h,b,f,_,m,y,F,j,w,k,B,S,C,D,E,T,I=s.open,R=s.onClose,A=s.sectionTitle,P=s.referenceSectionTitle,z=s.cognitiveData,L=s.relevanceScore,O=s.anchorEl,W=s.badgeStyle,q=s.popupRef,U=s.position,H=s.markdownStyles,M=s.docData,N=s.popupConfig,G=s.deviationData,Y=i.__assign(i.__assign({},r.SHARED_MARKDOWN_STYLES),H),K=e.useMemo(function(){var o,e;return i.__assign(i.__assign(i.__assign({},r.DEFAULT_POPUP_CONFIG),N),{tabs:{deviation:i.__assign(i.__assign({},r.DEFAULT_POPUP_CONFIG.tabs.deviation),null===(o=null==N?void 0:N.tabs)||void 0===o?void 0:o.deviation),association:i.__assign(i.__assign({},r.DEFAULT_POPUP_CONFIG.tabs.association),null===(e=null==N?void 0:N.tabs)||void 0===e?void 0:e.association)},sectionTitles:i.__assign(i.__assign({},r.DEFAULT_POPUP_CONFIG.sectionTitles),null==N?void 0:N.sectionTitles)})},[N]),X=null==z?void 0:z.isMissingRationale,J=e.useState(X?K.tabs.deviation.key:K.tabs.association.key),Q=J[0],V=J[1];e.useEffect(function(){I&&V(X?K.tabs.deviation.key:K.tabs.association.key)},[I,X,K.tabs.deviation.key,K.tabs.association.key]);var Z=e.useMemo(function(){if(!W)return{border:K.accentColor,shadow:"".concat(K.accentColor,"2E")};var i=W.badgeText;return"#9F1239"===i||"#B42318"===i?{border:"#E11D48",shadow:"rgba(225,29,72,0.15)"}:"#1D4ED8"===i?{border:"#3B82F6",shadow:"rgba(59,130,246,0.15)"}:"#A16207"===i?{border:"#F59E0B",shadow:"rgba(245,158,11,0.15)"}:{border:K.accentColor,shadow:"".concat(K.accentColor,"2E")}},[W,K.accentColor]);if(e.useEffect(function(){if(I){var i=function(i){var o;(null===(o=q.current)||void 0===o?void 0:o.contains(i.target))||(null==O?void 0:O.contains(i.target))||R()};return document.addEventListener("mousedown",i),function(){return document.removeEventListener("mousedown",i)}}},[I,R,O,q]),!I||!z)return null;var $=null!==(p=null!==(c=z.relevance_score)&&void 0!==c?c:L)&&void 0!==p?p:0,ii=z.decisioning,oi=Array.isArray(ii)?ii:"string"==typeof ii&&ii.trim()?[ii]:[],ei=z.gap,ni=Array.isArray(ei)?ei:"string"==typeof ei&&ei.trim()?[ei]:[],ti=null!==(g=null==U?void 0:U.arrowLeft)&&void 0!==g?g:60,si=o.jsxs(n.Box,i.__assign({ref:q,sx:{position:"fixed",top:null!==(u=null==U?void 0:U.top)&&void 0!==u?u:-9999,left:null!==(v=null==U?void 0:U.left)&&void 0!==v?v:-9999,zIndex:9999,width:"100%",maxWidth:"min(".concat(880,"px, calc(100vw - ").concat(null!==(h=null==U?void 0:U.left)&&void 0!==h?h:0,"px - ").concat(12,"px))"),bgcolor:"#FFFFFF",borderRadius:"14px",border:"1.5px solid ".concat(Z.border),boxShadow:"0px 8px 32px ".concat(Z.shadow,", 0px 0px 0px 3px ").concat(Z.shadow),overflow:"visible",display:"flex",flexDirection:"column",maxHeight:(null==U?void 0:U.maxHeight)?"min(60vh, ".concat(U.maxHeight,"px)"):"60vh",visibility:U?"visible":"hidden"}},{children:[U&&(U.openAbove?o.jsxs(o.Fragment,{children:[o.jsx(n.Box,{sx:{position:"absolute",bottom:-11,left:ti-x,width:0,height:0,borderLeft:"".concat(x,"px solid transparent"),borderRight:"".concat(x,"px solid transparent"),borderTop:"".concat(11,"px solid ").concat(Z.border),zIndex:1}}),o.jsx(n.Box,{sx:{position:"absolute",bottom:-9,left:ti-x+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderTop:"".concat(x,"px solid #FFFFFF"),zIndex:2}})]}):o.jsxs(o.Fragment,{children:[o.jsx(n.Box,{sx:{position:"absolute",top:-11,left:ti-x,width:0,height:0,borderLeft:"".concat(x,"px solid transparent"),borderRight:"".concat(x,"px solid transparent"),borderBottom:"".concat(11,"px solid ").concat(Z.border),zIndex:1}}),o.jsx(n.Box,{sx:{position:"absolute",top:-9,left:ti-x+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderBottom:"".concat(x,"px solid #FFFFFF"),zIndex:2}})]})),o.jsxs(n.Box,i.__assign({sx:{px:2.5,pt:2,pb:1.5,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2,flexShrink:0}},{children:[o.jsxs(n.Box,i.__assign({sx:{flex:1,minWidth:0}},{children:[o.jsxs(n.Typography,i.__assign({sx:{fontSize:"16px",fontWeight:600,color:"#101828",lineHeight:1.3,display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap",overflow:"hidden",width:"100%"}},{children:[o.jsx(n.Box,i.__assign({component:"span",title:A,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"0 1 auto",maxWidth:"calc(50% - 16px)",minWidth:0}},{children:A})),o.jsx(n.Box,i.__assign({component:"span",sx:{color:"#667085",fontWeight:400,flexShrink:0,mx:.5}},{children:"↔"})),o.jsx(n.Box,i.__assign({component:"span",title:P||"Reference Section",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0}},{children:P||"Reference Section"}))]})),o.jsx(n.Box,i.__assign({sx:{mt:.75,display:"inline-flex",alignItems:"center",gap:.75}},{children:o.jsx(n.Typography,i.__assign({sx:{fontSize:"13px",fontWeight:400,color:"#5928ED",lineHeight:1}},{children:null===(b=Object.values(K.tabs).find(function(i){return i.key===Q}))||void 0===b?void 0:b.subtitle}))}))]})),o.jsxs(n.Box,i.__assign({sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0}},{children:[o.jsxs(n.Box,i.__assign({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:.5,borderRadius:"20px",bgcolor:"#FFFFFF",border:"1px solid #5928ED",fontSize:"12px",fontWeight:600,color:"#5928ED"}},{children:[o.jsx(a.default,{}),K.decisionStrengthLabel," ",$,"%"]})),o.jsx(n.IconButton,i.__assign({onClick:R,size:"small",sx:{color:"#667085",width:24,height:24,"&:hover":{bgcolor:"transparent",color:"#101828"}}},{children:o.jsx(t.X,{size:22})}))]}))]})),o.jsx(n.Box,i.__assign({sx:{display:"flex",borderBottom:"1px solid #E4E7EC",px:2.5,flexShrink:0}},{children:(X?[K.tabs.deviation]:[K.tabs.deviation,K.tabs.association]).map(function(e){var t=Q===e.key;return o.jsx(n.Box,i.__assign({onClick:function(){return V(e.key)},sx:{pb:"10px",pt:"4px",mr:3,px:2,cursor:"pointer",fontSize:"14px",fontWeight:t?600:400,color:t?K.accentColor:"#667085",backgroundColor:t?"".concat(K.accentColor,"14"):"transparent",borderBottom:t?"2px solid ".concat(K.accentColor):"2px solid transparent",transition:"all 0.15s",userSelect:"none"}},{children:e.label}),e.key)})})),o.jsx(n.Box,i.__assign({sx:{flex:1,minHeight:0,overflowY:"auto",px:2.5,py:2,display:"flex",flexDirection:"column",gap:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"".concat(Z.border,"55"),borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:Z.border},scrollbarWidth:"thin",scrollbarColor:"".concat(Z.border,"55 transparent")}},{children:Q===K.tabs.deviation.key?G?o.jsxs(o.Fragment,{children:[(null===(_=(null===(f=null==G?void 0:G.cognitive_decisioning)||void 0===f?void 0:f.decisioning_factors)||[])||void 0===_?void 0:_.length)>0&&o.jsx(l.default,{title:"Decision Making Factors",content:null===(y=null===(m=null==G?void 0:G.cognitive_decisioning)||void 0===m?void 0:m.decisioning_factors)||void 0===y?void 0:y.join("\n\n"),citations:null===(F=null==G?void 0:G.cognitive_decisioning)||void 0===F?void 0:F.citations,styles:Y,docData:M,open:I}),(null===(w=(null===(j=null==G?void 0:G.cognitive_decisioning)||void 0===j?void 0:j.gaps_in_decision)||[])||void 0===w?void 0:w.length)>0&&o.jsx(l.default,{title:"Gaps in Decision",content:null===(B=null===(k=null==G?void 0:G.cognitive_decisioning)||void 0===k?void 0:k.gaps_in_decision)||void 0===B?void 0:B.join("\n\n"),citations:null===(S=null==G?void 0:G.cognitive_decisioning)||void 0===S?void 0:S.citations,styles:Y,docData:M,open:I}),0===(null===(D=(null===(C=null==G?void 0:G.cognitive_decisioning)||void 0===C?void 0:C.decisioning_factors)||[])||void 0===D?void 0:D.length)&&0===(null===(T=(null===(E=null==G?void 0:G.cognitive_decisioning)||void 0===E?void 0:E.gaps_in_decision)||[])||void 0===T?void 0:T.length)&&o.jsx(n.Box,i.__assign({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:o.jsx(n.Typography,i.__assign({sx:{fontSize:"13px",color:"#64748B"}},{children:"No cognitive decisioning data available for this section."}))}))]}):o.jsx(l.default,{title:"Deviation Analysis",content:"Deviation analysis content will appear here. This tab shows\n structural and semantic deviations identified between the two\n sections being compared.",citations:{},styles:Y,docData:M,open:I}):o.jsxs(o.Fragment,{children:[oi.length>0&&o.jsx(l.default,{title:K.sectionTitles.decisioningFactors,content:oi.join("\n\n"),citations:z.citations,styles:Y,open:I,docData:M}),ni.length>0&&o.jsx(l.default,{title:K.sectionTitles.gaps,content:ni.join("\n\n"),citations:z.citations,styles:Y,open:I,docData:M}),0===oi.length&&0===ni.length&&o.jsx(n.Box,i.__assign({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:o.jsx(n.Typography,i.__assign({sx:{fontSize:"13px",color:"#64748B"}},{children:K.emptyStateMessage}))}))]})}))]}));return d.default.createPortal(si,document.body)};
|
|
2
2
|
//# sourceMappingURL=CognitivePopup.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("@mui/material");exports.default=function(){return t.jsxs(a.Box,e.__assign({sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center","@keyframes bounce":{"0%":{transform:"translateY(0) scale(1)",opacity:.6},"100%":{transform:"translateY(-12px) scale(1.15)",opacity:1}},"@keyframes glowPulse":{"0%, 100%":{textShadow:"0 0 6px rgba(89,40,237,0.2)"},"50%":{textShadow:"0 0 14px rgba(89,40,237,0.45)"}}}},{children:[t.jsx(a.Typography,e.__assign({sx:{mb:2,fontSize:"20px",fontWeight:600,fontFamily:"sans-serif",color:"#5928ED",letterSpacing:"0.8px",animation:"glowPulse 2s ease-in-out infinite"}},{children:"Switching views..."})),t.jsx(a.Box,e.__assign({sx:{display:"flex",gap:"8px"}},{children:[0,1,2].map(function(e){return t.jsx(a.Box,{sx:{width:"12px",height:"12px",borderRadius:"50%",background:"linear-gradient(145deg, #7c5cff, #5928ED)",boxShadow:"0 4px 12px rgba(89,40,237,0.5), 0 0 8px rgba(89,40,237,0.3)",animation:"bounce 0.6s infinite alternate",animationDelay:"".concat(.15*e,"s")}},e)})}))]}))};
|
|
2
|
+
//# sourceMappingURL=LoaderComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("@mui/material"),t=require("../../assests/svg/ButtonCognitiveIcon.js"),o=[{key:"connect",title:"Connect",icon:i.jsx("svg",e.__assign({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M14.8237 3.89331C14.547 5.57188 13.0559 6.77501 11.3572 6.69242C9.65857 6.60983 8.2925 5.26384 8.18312 3.56742C4.75678 3.67456 3.54027 4.4759 3.73893 6.10536C3.81259 6.71474 4.18089 7.04063 4.85723 7.19911C5.26794 7.2951 5.7233 7.30849 6.13625 7.27054C6.17419 7.26608 6.21437 7.26385 6.25232 7.25938C6.50455 7.19911 6.76125 7.14777 7.01794 7.1076C7.77911 6.9826 8.55366 6.9201 9.29027 6.96027C11.3617 7.07188 12.7724 7.98483 12.8438 9.92233C12.913 11.7996 11.6229 13.1299 9.5425 14.0205C8.87509 14.3063 8.1675 14.5272 7.45991 14.6946C7.14071 14.7705 6.87286 14.8219 6.67419 14.8554C6.49786 16.5496 5.07821 17.842 3.37509 17.8554C1.67196 17.8688 0.229997 16.6031 0.0246403 14.9112C-0.180717 13.2192 0.917498 11.6455 2.57375 11.2527C4.23 10.8598 5.91973 11.7728 6.49562 13.3755C6.70544 13.3375 6.91303 13.2951 7.12062 13.246C7.75009 13.0987 8.37955 12.9022 8.95991 12.6522C10.538 11.9781 11.3996 11.0875 11.3595 9.9759C11.3237 8.98036 10.6095 8.52054 9.21214 8.44465C8.5983 8.41117 7.92643 8.46474 7.26348 8.57411C7.07821 8.60536 6.90857 8.63661 6.75902 8.6701C6.67196 8.68795 6.61169 8.70358 6.58491 8.71027L6.51571 8.72367C6.4666 8.73036 6.38402 8.74152 6.27687 8.75268C5.71884 8.80402 5.11393 8.78617 4.52464 8.65001C3.2925 8.36206 2.42866 7.59643 2.26794 6.2884C1.9175 3.47143 4.02241 2.16563 8.42866 2.07188C9.07821 0.500452 10.8037 -0.336602 12.4376 0.129916C14.0737 0.596434 15.1005 2.21474 14.8237 3.89331V3.89331ZM3.34161 12.6478C3.09741 12.6478 2.85562 12.6959 2.63002 12.7894C2.40442 12.8828 2.19944 13.0198 2.02678 13.1925C1.85412 13.3652 1.71717 13.5702 1.62373 13.7958C1.5303 14.0214 1.48222 14.2632 1.48223 14.5074C1.48224 14.7516 1.53036 14.9934 1.62382 15.219C1.71728 15.4446 1.85426 15.6495 2.02694 15.8222C2.19962 15.9949 2.40462 16.1318 2.63022 16.2252C2.85583 16.3187 3.09764 16.3668 3.34183 16.3667C3.83499 16.3667 4.30795 16.1708 4.65665 15.822C5.00535 15.4733 5.20123 15.0003 5.2012 14.5071C5.20117 14.014 5.00524 13.541 4.65649 13.1923C4.30775 12.8436 3.83477 12.6477 3.34161 12.6478ZM11.5224 1.49152C11.2782 1.49154 11.0364 1.53965 10.8108 1.63311C10.5852 1.72657 10.3802 1.86355 10.2076 2.03623C10.0349 2.20891 9.89797 2.41391 9.80454 2.63952C9.7111 2.86513 9.66302 3.10693 9.66303 3.35112C9.66305 3.59531 9.71116 3.83711 9.80462 4.06271C9.89808 4.28831 10.0351 4.49329 10.2077 4.66594C10.3804 4.8386 10.5854 4.97556 10.811 5.06899C11.0366 5.16243 11.2784 5.21051 11.5226 5.2105C12.0158 5.21047 12.4888 5.01453 12.8375 4.66579C13.1862 4.31704 13.382 3.84406 13.382 3.3509C13.382 2.85773 13.186 2.38478 12.8373 2.03608C12.4886 1.68738 12.0156 1.49149 11.5224 1.49152V1.49152Z",fill:"#1D2939",
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("@mui/material"),t=require("../../assests/svg/ButtonCognitiveIcon.js"),o=function(){return i.jsx("svg",e.__assign({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M2 6.5L5 9.5L11 3.5",stroke:"#15803D",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}))},s=[{key:"connect",title:"Connect",icon:i.jsx("svg",e.__assign({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M14.8237 3.89331C14.547 5.57188 13.0559 6.77501 11.3572 6.69242C9.65857 6.60983 8.2925 5.26384 8.18312 3.56742C4.75678 3.67456 3.54027 4.4759 3.73893 6.10536C3.81259 6.71474 4.18089 7.04063 4.85723 7.19911C5.26794 7.2951 5.7233 7.30849 6.13625 7.27054C6.17419 7.26608 6.21437 7.26385 6.25232 7.25938C6.50455 7.19911 6.76125 7.14777 7.01794 7.1076C7.77911 6.9826 8.55366 6.9201 9.29027 6.96027C11.3617 7.07188 12.7724 7.98483 12.8438 9.92233C12.913 11.7996 11.6229 13.1299 9.5425 14.0205C8.87509 14.3063 8.1675 14.5272 7.45991 14.6946C7.14071 14.7705 6.87286 14.8219 6.67419 14.8554C6.49786 16.5496 5.07821 17.842 3.37509 17.8554C1.67196 17.8688 0.229997 16.6031 0.0246403 14.9112C-0.180717 13.2192 0.917498 11.6455 2.57375 11.2527C4.23 10.8598 5.91973 11.7728 6.49562 13.3755C6.70544 13.3375 6.91303 13.2951 7.12062 13.246C7.75009 13.0987 8.37955 12.9022 8.95991 12.6522C10.538 11.9781 11.3996 11.0875 11.3595 9.9759C11.3237 8.98036 10.6095 8.52054 9.21214 8.44465C8.5983 8.41117 7.92643 8.46474 7.26348 8.57411C7.07821 8.60536 6.90857 8.63661 6.75902 8.6701C6.67196 8.68795 6.61169 8.70358 6.58491 8.71027L6.51571 8.72367C6.4666 8.73036 6.38402 8.74152 6.27687 8.75268C5.71884 8.80402 5.11393 8.78617 4.52464 8.65001C3.2925 8.36206 2.42866 7.59643 2.26794 6.2884C1.9175 3.47143 4.02241 2.16563 8.42866 2.07188C9.07821 0.500452 10.8037 -0.336602 12.4376 0.129916C14.0737 0.596434 15.1005 2.21474 14.8237 3.89331V3.89331ZM3.34161 12.6478C3.09741 12.6478 2.85562 12.6959 2.63002 12.7894C2.40442 12.8828 2.19944 13.0198 2.02678 13.1925C1.85412 13.3652 1.71717 13.5702 1.62373 13.7958C1.5303 14.0214 1.48222 14.2632 1.48223 14.5074C1.48224 14.7516 1.53036 14.9934 1.62382 15.219C1.71728 15.4446 1.85426 15.6495 2.02694 15.8222C2.19962 15.9949 2.40462 16.1318 2.63022 16.2252C2.85583 16.3187 3.09764 16.3668 3.34183 16.3667C3.83499 16.3667 4.30795 16.1708 4.65665 15.822C5.00535 15.4733 5.20123 15.0003 5.2012 14.5071C5.20117 14.014 5.00524 13.541 4.65649 13.1923C4.30775 12.8436 3.83477 12.6477 3.34161 12.6478ZM11.5224 1.49152C11.2782 1.49154 11.0364 1.53965 10.8108 1.63311C10.5852 1.72657 10.3802 1.86355 10.2076 2.03623C10.0349 2.20891 9.89797 2.41391 9.80454 2.63952C9.7111 2.86513 9.66302 3.10693 9.66303 3.35112C9.66305 3.59531 9.71116 3.83711 9.80462 4.06271C9.89808 4.28831 10.0351 4.49329 10.2077 4.66594C10.3804 4.8386 10.5854 4.97556 10.811 5.06899C11.0366 5.16243 11.2784 5.21051 11.5226 5.2105C12.0158 5.21047 12.4888 5.01453 12.8375 4.66579C13.1862 4.31704 13.382 3.84406 13.382 3.3509C13.382 2.85773 13.186 2.38478 12.8373 2.03608C12.4886 1.68738 12.0156 1.49149 11.5224 1.49152V1.49152Z",fill:"#1D2939",fillOpacity:"0.85"})}))},{key:"side-by-side",title:"Side by Side",icon:i.jsx("svg",e.__assign({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M3.19922 8.19922H13.1992M3.19922 8.19922L4.86589 10.6992M3.19922 8.19922L4.86589 5.69922M13.1992 8.19922L11.5326 10.6992M13.1992 8.19922L11.5326 5.69922M15.6992 0.699219V15.6992M0.699219 0.699219V15.6992",stroke:"#3F4957",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}))},{key:"cognitive-decisioning",title:"Cognitive Decisioning",icon:i.jsx(t.ButtonCognitiveIcon,{})}];exports.default=function(t){var r=t.open,l=t.anchorEl;t.sectionTitle,t.referenceSectionTitle;var C=t.onClose,c=t.onOpenCognitiveCompare,a=t.onOpenSideBySide,d=t.onConnect,g=t.isConnected,x=void 0!==g&&g;return i.jsx(n.Menu,e.__assign({open:r,anchorEl:l,onClose:C,disableScrollLock:!0,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},PaperProps:{sx:{ml:.75,minWidth:190,maxWidth:220,borderRadius:"12px",border:"1px solid #E4E7EC",boxShadow:"0px 12px 28px rgba(16, 24, 40, 0.12)",overflow:"hidden"}},MenuListProps:{sx:{p:.5,bgcolor:"#FFFFFF"}}},{children:s.map(function(t){var s="connect"===t.key,r=s&&x;return i.jsxs(n.MenuItem,e.__assign({onClick:function(){var e;"connect"!==(e=t.key)?"side-by-side"!==e?c():a():d()},sx:{px:1.25,py:1,minHeight:40,borderRadius:"10px",display:"flex",alignItems:"center",gap:1,bgcolor:r?"#F0FDF4":"transparent","&:hover":{bgcolor:r?"#DCFCE7":"#F9FAFB"}}},{children:[i.jsx(n.Box,e.__assign({sx:e.__assign({width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& svg":{display:"block"}},r&&{"& svg path":{fill:"#15803D",fillOpacity:1}})},{children:t.icon})),i.jsx(n.Box,e.__assign({sx:{minWidth:0,display:"flex",alignItems:"center",flex:1}},{children:i.jsx(n.Typography,e.__assign({sx:{fontSize:"12px",fontWeight:500,color:r?"#15803D":"#101828",lineHeight:1.2,whiteSpace:"nowrap"}},{children:s?x?"Disconnect":"Connect":t.title}))})),r&&i.jsx(n.Box,e.__assign({sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:"auto"}},{children:i.jsx(o,{})}))]}),t.key)})}))};
|
|
2
2
|
//# sourceMappingURL=MoreFunctionsPopup.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("@mui/material");exports.default=function(n){var s=n.sections,a=void 0===s?8:s;return r.jsxs(t.Box,e.__assign({sx:{position:"absolute",inset:0,zIndex:50,backdropFilter:"blur(6px)",backgroundColor:"rgba(255,255,255,0.7)",borderRadius:"8px",overflow:"hidden"}},{children:[r.jsx(t.Box,e.__assign({sx:{p:2,display:"flex",flexDirection:"column",gap:2,willChange:"transform",animation:"wander 20s ease-in-out infinite alternate","@keyframes wander":{"0%":{transform:"translate3d(0, 0px, 0)"},"20%":{transform:"translate3d(0, -15%, 0)"},"40%":{transform:"translate3d(0, -5%, 0)"},"60%":{transform:"translate3d(0, -30%, 0)"},"80%":{transform:"translate3d(0, -10%, 0)"},"100%":{transform:"translate3d(0, -40%, 0)"}}}},{children:Array.from({length:a}).map(function(n,s){return r.jsxs(t.Box,e.__assign({sx:{border:"1px solid #E3E6EA",borderRadius:"6px",p:1.5,bgcolor:"#fff",opacity:.6}},{children:[r.jsx(t.Skeleton,{variant:"text",width:"40%",height:24}),r.jsx(t.Skeleton,{variant:"text",width:"80%"}),r.jsx(t.Skeleton,{variant:"text",width:"70%"}),r.jsx(t.Skeleton,{variant:"rectangular",height:40,sx:{mt:1}})]}),s)})})),r.jsxs(t.Box,e.__assign({sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"#FFFFFF",p:3,borderRadius:"8px",boxShadow:"0px 8px 24px rgba(0, 0, 0, 0.12)",textAlign:"center",width:"80%",maxWidth:"340px",zIndex:10}},{children:[r.jsx(t.Typography,e.__assign({sx:{fontWeight:600,fontSize:"16px",color:"#0F172A",mb:1}},{children:"Aligning sections..."})),r.jsx(t.Typography,e.__assign({sx:{fontSize:"13px",color:"#64748B",lineHeight:1.5}},{children:"Placing corresponding clauses side by side for comparison."}))]}))]}))};
|
|
2
|
+
//# sourceMappingURL=OverlayComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as n,jsx as l,Fragment as t}from"react/jsx-runtime";import{ChevronUp as o,ChevronDown as e}from"lucide-react";import{useState as r}from"react";import a from"./ResizableSplitPane.js";import d from"../PdfViewer/PdfViewer.js";var u=function(u){var c,s,h
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as n,jsx as l,Fragment as t}from"react/jsx-runtime";import{ChevronUp as o,ChevronDown as e}from"lucide-react";import{useState as r}from"react";import a from"./ResizableSplitPane.js";import d from"../PdfViewer/PdfViewer.js";var u=function(u){var c,s,g,h=u.href,v=u.children,p=u.metaData,f=u.chevronUpComponent,m=void 0===f?null:f,y=u.chevronDownComponent,P=void 0===y?null:y,b=u.customStyle,C=void 0===b?{}:b,_=u.defaultState,w=r(void 0!==_&&_),x=w[0],D=w[1],S="string"==typeof v&&(null===(c=null==v?void 0:v.split("\n"))||void 0===c?void 0:c.length)>1?v.split("\n").join(" "):v,j="string"==typeof v?v:v[0],z=null!=m?m:function(i){var n,t;return l(o,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(s=null==C?void 0:C.arrow)&&void 0!==s?s:{}),T=null!=P?P:function(i){var n,t;return l(e,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(g=null==C?void 0:C.arrow)&&void 0!==g?g:{}),W=["contract","clause"];return n("span",i({style:i({display:"inline"},C.relativeWrapper||{})},{children:[l("div",i({style:i({display:"inline",marginTop:0},C.citationButtonWrapper||{})},{children:n("button",i({type:"button",onClick:function(){return D(function(i){return!i})},style:i({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},C.citationButton||{})},{children:[l("span",{children:S}),l("span",i({style:{display:"flex",alignItems:"center"}},{children:x?z:T}))]}))})),x&&l(t,{children:l(function(){var i,n,t,o,e,r,u;console.log("citation details ->","href ->",h,"children ->",v,"metaData ->",p,"citationDisplayTitle ->",S);var c=function(i){try{return new URL(i,window.location.origin).searchParams.get("citationNumber")}catch(i){return null}}(h);if(!c)return null;var s=(null===(i=null==p?void 0:p.citations)||void 0===i?void 0:i[c])||{},g=(null===(n=null==p?void 0:p.docData)||void 0===n?void 0:n.documents)||{},f=(null===(t=null==p?void 0:p.docData)||void 0===t?void 0:t.input_index_map)||{},m=null==f?void 0:f[0],y=null==f?void 0:f[1],P=m?g[m]:null,b=y?g[y]:null,C=m?s[m]:null,_=y?s[y]:null;if(W.includes(j)){console.log("leftDocument",P,"rightDocument",b),console.log("leftCitation",C,"rightCitation",_);var w=C?l(d,{defaultScale:"PageWidth",showHighlightsAction:!1,pdfName:P.title,pdfUrl:P.signed_url,highlightText:[null!==(o=null==C?void 0:C.highlighted_text)&&void 0!==o?o:""],highlightPages:{1:null===(e=null==C?void 0:C.custom_metadata)||void 0===e?void 0:e.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,x=_?l(d,{defaultScale:"PageWidth",showHighlightsAction:!1,pdfName:b.title,pdfUrl:b.signed_url,jumpToPageValue:1,highlightText:[null!==(r=null==_?void 0:_.highlighted_text)&&void 0!==r?r:""],highlightPages:{1:null===(u=null==_?void 0:_.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null;return l("div",C||_?{children:l(a,{leftComponent:w,rightComponent:x})}:{children:"Missing PDF Citation. Please try again later"})}return l("div",{children:"No Citation Found. Please try again later"})},{})})]}))};export{u as default};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as i,jsxs as r}from"react/jsx-runtime";import{useMemo as t}from"react";import{Box as e,Typography as n}from"@mui/material";import c from"react-markdown";import d from"./CitationAnchor.js";function l(l){var a=l.content,m=void 0===a?"":a,p=l.title,s=void 0===p?"":p,f=l.citations,x=void 0===f?{}:f,h=l.styles,u=void 0===h?{}:h,v=l.docData,D=void 0===v?{}:v,b=l.open,y=t(function(){return{a:function(o){var r=o.href,t=void 0===r?"":r,e=o.children;return i(d,{href:t,children:e,metaData:{citations:x,docData:D}})}}},[b,x,D]);return r(e,o({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD"}},{children:[i(e,o({sx:{px:1.5,py:.75,borderBottom:"1px solid #EAECF0"}},{children:i(n,o({sx:{fontSize:"15px",fontWeight:600,color:"#344054",lineHeight:1.25}},{children:s}))})),i(e,o({sx:{px:1.5,py:1.1,display:"flex",flexDirection:"column",gap:.95}},{children:i(e,o({sx:{display:"flex",flexDirection:"column"}},{children:i(n,o({component:"div",sx:o({},u)},{children:i(c,o({components:y},{children:m}))}))}))}))]}))}export{l as default};
|
|
2
|
+
//# sourceMappingURL=CitationRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationRenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import i,{useState as r,useRef as o,useMemo as l,useEffect as c,useCallback as a}from"react";import{Box as d,Snackbar as u,Alert as s,Typography as f,FormControlLabel as h,Switch as v,Tooltip as p,Accordion as x,AccordionSummary as g,AccordionDetails as m}from"@mui/material";import{ChevronDown as y,EllipsisVertical as b}from"lucide-react";import{ButtonCognitiveIcon as w}from"../../assests/svg/ButtonCognitiveIcon.js";import F from"react-markdown";import{safeStringify as I,hasValue as E,getStyleForRelation as S,getRationale as C,getSideData as R,cognitiveScoreToRelation as _}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as T,DEFAULT_FIELD_CONFIG as D,DEFAULT_COMPARISON_CONFIG as A}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import B from"./CognitivePopup.js";import k from"./MoreFunctionsPopup.js";var z={id:"",title:""},H={open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null},W=function(W){var M,L,j,N,O,P,q,X,Y=W.componentHeaderText,V=void 0===Y?"Learning Comparison":Y,U=W.treeData,K=W.comparisonConfig,G=W.leftColumnTitleText,J=W.rightColumnTitleText,Q=W.markdownStyles,Z=W.maintainRelativeOrder,$=void 0!==Z&&Z,ee=W.popupConfig,ne=r($),te=ne[0],ie=ne[1],re=r(null),oe=re[0],le=re[1],ce=r(!1),ae=ce[0],de=ce[1],ue=r(!1),se=ue[0],fe=ue[1],he=o(!1),ve=l(function(){return(null==U?void 0:U.cognitive_decisioning)||{}},[U]),pe=r(null),xe=pe[0],ge=pe[1],me=o(null),ye=r({width:0,height:0}),be=ye[0],we=ye[1],Fe=l(function(){return e(e({},T),Q)},[Q]),Ie=r({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null}),Ee=Ie[0],Se=Ie[1],Ce=r({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null}),Re=Ce[0],_e=Ce[1],Te=o(null),De=o(null),Ae=o(null),Be=o(null),ke=o(null),ze=o(!1),He=o(null);c(function(){He.current=null},[Ee.sectionIdx,Ee.open]);var We=a(function(){ge(null),Se(H)},[]),Me=a(function(){_e(H)},[]),Le=a(function(){var e;if(Ee.anchorEl&&Ee.refSectionTitle){var n=Ee.anchorEl.getBoundingClientRect(),t=(null===(e=null==me?void 0:me.current)||void 0===e?void 0:e.offsetHeight)||0,i=Math.min(680,window.innerWidth-24),r=window.innerHeight-n.bottom-12-12,o=n.top-12-12,l=r<t&&o>r;null!==He.current?!0===He.current&&(l=o>=t||o>=r):l=!(r>=t||r>=o),He.current=l;var c=l?o:r,a=Math.min(t||9999,c),d=l?n.top-12-a:n.bottom+12,u=n.left+n.width/2,s=u-i/2,f=Math.max(12,Math.min(s,window.innerWidth-i-12)),h=Math.max(14,Math.min(u-f,i-10-4));ge({top:d,left:f,arrowLeft:h,openAbove:l,maxHeight:c})}},[Ee.anchorEl,Ee.refSectionTitle]);c(function(){if(Ee.open){window.addEventListener("resize",Le);var e=requestAnimationFrame(Le),n=null;return me.current&&(n=new ResizeObserver(function(){cancelAnimationFrame(e),e=requestAnimationFrame(Le)})).observe(me.current),function(){cancelAnimationFrame(e),window.removeEventListener("resize",Le),n&&n.disconnect()}}},[Ee.open,Le]),c(function(){var e=Te.current;if(e&&Ee.open){var n=function(e){me.current&&me.current.contains(e.target)||(ge(null),We())};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[Ee.open,We]),c(function(){var e=Te.current;if(e&&Re.open){var n=function(){Me()};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[Re.open,Me]);var je=l(function(){var n,t,i,r,o,l,c,a,d,u,s,f;return{fields:null!==(n=null==K?void 0:K.fields)&&void 0!==n?n:D,thresholds:{high:null!==(i=null===(t=null==K?void 0:K.thresholds)||void 0===t?void 0:t.high)&&void 0!==i?i:A.thresholds.high,medium:null!==(o=null===(r=null==K?void 0:K.thresholds)||void 0===r?void 0:r.medium)&&void 0!==o?o:A.thresholds.medium,exact:null!==(c=null===(l=null==K?void 0:K.thresholds)||void 0===l?void 0:l.exact)&&void 0!==c?c:A.thresholds.exact},relationStyles:{noContent:e(e({},A.relationStyles.noContent),(null===(a=null==K?void 0:K.relationStyles)||void 0===a?void 0:a.noContent)||{}),high:e(e({},A.relationStyles.high),(null===(d=null==K?void 0:K.relationStyles)||void 0===d?void 0:d.high)||{}),exact:e(e({},A.relationStyles.exact),(null===(u=null==K?void 0:K.relationStyles)||void 0===u?void 0:u.exact)||{}),medium:e(e({},A.relationStyles.medium),(null===(s=null==K?void 0:K.relationStyles)||void 0===s?void 0:s.medium)||{}),low:e(e({},A.relationStyles.low),(null===(f=null==K?void 0:K.relationStyles)||void 0===f?void 0:f.low)||{})}}},[K]),Ne=l(function(){if(U&&Object.keys(U).length>0)try{var n=function(n,t){var i,r,o,l,c,a,d,u;void 0===t&&(t=!1);var s=[],f=[],h=n.base_root_id,v=n.input_index_map||{0:"left",1:"right"},p=n[h];if(!p||!1===p.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[]};var x=function(t,i){var r=n[t];if(!r)return null;var o=R(r,i,v),l=!!o.title.trim(),c=!!o.content.trim(),a=C(r),d=[];r.next&&Object.values(r.next).forEach(function(e){if(n[e]){var t=x(e,i);t&&d.push(t)}});var u=!(!l&&!c);return e({id:t,title:l?o.title:"",content:c?o.content:"",subsections:d},u?a:{score:void 0,relation:"not_defined"})};if(t){var g={},m={},y=-1,b=-1;for(var w in n)if(!["base_root_id","documents","input_index_map",h].includes(w)){var F=n[w];if(F&&!1!==F.display_node){var I=C(F),E=R(F,"0",v),S=R(F,"1",v),_=E.title.trim()||E.content.trim(),T=S.title.trim()||S.content.trim(),D=Number(null!==(r=null===(i=E.attributes)||void 0===i?void 0:i.display_index)&&void 0!==r?r:y--),A=Number(null!==(l=null===(o=S.attributes)||void 0===o?void 0:o.display_index)&&void 0!==l?l:b--),B=m[A]||e(e({id:w,title:T?S.title:"",content:T?S.content:"",subsections:[]},T?I:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:A}),k=g[D]||e(e({id:w,title:_?E.title:"",content:_?E.content:"",subsections:[]},_?I:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:D});Number(A)>=0&&Number(D)>=0&&(B.refIndexes.includes(Number(D))||B.refIndexes.push(Number(D)),k.refIndexes.includes(Number(A))||k.refIndexes.push(Number(A))),m[A]=B,g[D]=k}}f=Object.values(m).map(function(e){return e}),s=Object.values(g).map(function(e){return e}),f.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex}),s.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex})}else p.next&&Object.values(p.next).forEach(function(e){var t=n[e];t&&!1!==t.display_node&&(s.push(x(e,"0")||{id:e,title:"",content:"",subsections:[]}),f.push(x(e,"1")||{id:e,title:"",content:"",subsections:[]}))});return{activeProposed:{title:(null===(a=null===(c=p.comparison_inputs)||void 0===c?void 0:c[v[0]])||void 0===a?void 0:a.title)||"Uploaded Contract",description:p.decision_scope_description||"",sections:s},activeVariants:[{id:"tree-variant-1",title:(null===(u=null===(d=p.comparison_inputs)||void 0===d?void 0:d[v[1]])||void 0===u?void 0:u.title)||"Reference Template",similarity:0,sections:f,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:p.decision_scope_description||""},fields:{}}}}]}}(U,te);return e(e({},n),{parseError:null})}catch(e){return console.error("Data Transformation Error: ",e),{activeProposed:{},activeVariants:[],parseError:e instanceof Error?e.message:"Unknown Parsing Error"}}return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"}},[U,te]),Oe=Ne.activeProposed,Pe=Ne.activeVariants,qe=Ne.parseError;c(function(){qe&&le("Failed to load comparison: ".concat(qe))},[qe]);var Xe=r(null),Ye=Xe[0];Xe[1];var Ve=r({}),Ue=Ve[0],Ke=Ve[1],Ge=r({}),Je=Ge[0],Qe=Ge[1],Ze=(null==Pe?void 0:Pe[0])||z,$e=null===(j=null===(M=null==U?void 0:U.documents)||void 0===M?void 0:M[null===(L=null==U?void 0:U.input_index_map)||void 0===L?void 0:L[0]])||void 0===j?void 0:j.title,en=null===(P=null===(N=null==U?void 0:U.documents)||void 0===N?void 0:N[null===(O=null==U?void 0:U.input_index_map)||void 0===O?void 0:O[1]])||void 0===P?void 0:P.title,nn=I(G||$e||"Uploaded Contract"),tn=I(J||en||"Reference Template"),rn=l(function(){return(null==Oe?void 0:Oe.sections)||[]},[null==Oe?void 0:Oe.sections]),on=l(function(){return Ze.sections||[]},[Ze.sections]),ln=rn.length>0||on.length>0,cn=Ze.analysis,an=I(null===(X=null===(q=null==cn?void 0:cn.rule_difference_comparison)||void 0===q?void 0:q.summary)||void 0===X?void 0:X.overall_summary),dn=!!an.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),un=o({}),sn=function(e){return un.current[e]||(un.current[e]=i.createRef()),un.current[e]},fn=a(function(){de(!1),En(null),fe(!1),Be.current&&(Be.current.style.height="0px"),ke.current&&(ke.current.style.height="0px")},[]),hn=a(function(e,n,t,i,r){var o,l,c=I(n.id)||I(t.id)||"",a=(c?ve[c]:null)||n.cognitiveData||t.cognitiveData||{section_id:c,decisioning:[],gap:[],relevance_score:0},d=null!==(l=null===(o=un.current[i])||void 0===o?void 0:o.current)&&void 0!==l?l:null;return{open:!0,sectionTitle:n.title||"N/A",refSectionTitle:t.title||"NA",cognitiveData:a,anchorEl:e,sectionAnchorEl:d,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==U?void 0:U.documents,input_index_map:null==U?void 0:U.input_index_map}}},[ve]),vn=a(function(e){Me(),ge(null),Se(e)},[Me]),pn=a(function(){null!==Re.sectionIdx&&Re.anchorEl?vn(e(e({},Re),{open:!0})):Me()},[Re,Me,vn]);a(function(e){Me(),le("".concat(e," is coming soon."))},[Me]);var xn=o(null),gn=o(null),mn=o(null),yn=r([]),bn=yn[0],wn=yn[1],Fn=r(null),In=Fn[0],En=Fn[1],Sn=o(null),Cn=r(null),Rn=Cn[0],_n=Cn[1],Tn=l(function(){return je.fields.filter(function(e){var n=e.key;return(!ln||"description"!==n)&&(E(null==Oe?void 0:Oe[n])||E(Ze[n]))})},[Oe,Ze,ln,je.fields]),Dn=o({}),An=o({}),Bn=o({}),kn=o({}),zn=o({}),Hn=o({}),Wn=o({});Tn.forEach(function(e){for(var n=e.key,t=0;t<Math.max(rn.length,on.length);t+=1)Bn.current[t]||(Bn.current[t]=i.createRef()),kn.current[t]||(kn.current[t]=i.createRef()),zn.current[t]||(zn.current[t]=i.createRef()),Hn.current[t]||(Hn.current[t]=i.createRef()),Wn.current[t]||(Wn.current[t]=i.createRef());Dn.current[n]||(Dn.current[n]=i.createRef()),An.current[n]||(An.current[n]=i.createRef())});for(var Mn=0;Mn<Math.max(rn.length,on.length);Mn+=1)Bn.current[Mn]||(Bn.current[Mn]=i.createRef()),kn.current[Mn]||(kn.current[Mn]=i.createRef()),zn.current[Mn]||(zn.current[Mn]=i.createRef()),Hn.current[Mn]||(Hn.current[Mn]=i.createRef()),Wn.current[Mn]||(Wn.current[Mn]=i.createRef());c(function(){if(Ye){var e=je.fields.find(function(e){return e.analysisKey===Ye||e.key===Ye});if(e){var n=Dn.current[e.key]||An.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Ye,je.fields]);var Ln=a(function(e){var n,t,i,r,o,l,c,a,d,u=null===(n=null==cn?void 0:cn.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!u||!u[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=u[e],f=(null==s?void 0:s.relation)||(null===(i=null===(t=null==s?void 0:s.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(o=null===(r=null==s?void 0:s.highlights)||void 0===r?void 0:r.ruleB_spans)||void 0===o?void 0:o.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var h=s.mappings[0]||{};return{score:s.score,relation:h.relation||"",highlightsA:(null===(l=h.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=h.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!f}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(a=s.highlights)||void 0===a?void 0:a.ruleA_spans)||[],highlightsB:(null===(d=s.highlights)||void 0===d?void 0:d.ruleB_spans)||[],hasContent:!!f}},[cn]),jn=a(function(n){var t,i,r,o,l=rn[n],c=on[n],a=(null==l?void 0:l.relation)&&"not_defined"!==l.relation,d=(null==c?void 0:c.relation)&&"not_defined"!==c.relation,u=I(null==l?void 0:l.id)||I(null==c?void 0:c.id)||"",s=!(!(null==l?void 0:l.cognitiveData)&&!(null==c?void 0:c.cognitiveData));if(!a&&!d&&!s)return e(e({},je.relationStyles.noContent),{label:"Not Defined"});var f=Ln("description");if(null!=(null!==(i=null!==(t=null==l?void 0:l.cognitiveRelevanceScore)&&void 0!==t?t:null==c?void 0:c.cognitiveRelevanceScore)&&void 0!==i?i:u?null===(r=ve[u])||void 0===r?void 0:r.relevance_score:void 0)){var h=_(),v=h.score,p=h.relation;return S(v,p,!0,je)}var x=a?l.relation:d?c.relation:f.relation,g=null!==(o=null==l?void 0:l.score)&&void 0!==o?o:null==c?void 0:c.score,m="number"==typeof g?g:f.score;return S(m,x,!0,je)},[rn,on,ve,je,Ln]),Nn=a(function(){var e,n,t,i,r,o,l,c,a,d,u;if(!ze.current){ze.current=!0;try{if(!xn.current)return;var s=xn.current.getBoundingClientRect();we({width:s.width,height:s.height});var f=[];if(Tn.forEach(function(e){var n,t,i=e.key,r=null===(n=Dn.current[i])||void 0===n?void 0:n.current,o=null===(t=An.current[i])||void 0===t?void 0:t.current;r&&o&&(r.style.height="auto",o.style.height="auto",r.style.minHeight="0px",o.style.minHeight="0px")}),!te)for(var h=0;h<Math.min(rn.length,on.length);h++){var v=null===(e=Bn.current[h])||void 0===e?void 0:e.current,p=null===(n=kn.current[h])||void 0===n?void 0:n.current;v&&p&&(v.style.height="auto",p.style.height="auto",v.style.minHeight="0px",p.style.minHeight="0px")}var x={};Tn.forEach(function(e){var n,t,i=e.key,r=null===(n=Dn.current[i])||void 0===n?void 0:n.current,o=null===(t=An.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=r.getBoundingClientRect(),c=o.getBoundingClientRect();x[i]=Math.max(l.height,c.height)}});var g=[];if(!te)for(h=0;h<Math.min(rn.length,on.length);h++){v=null===(t=Bn.current[h])||void 0===t?void 0:t.current,p=null===(i=kn.current[h])||void 0===i?void 0:i.current;if(v&&p){var m=v.getBoundingClientRect(),y=p.getBoundingClientRect();g[h]=Math.max(m.height,y.height)}}if(Tn.forEach(function(e){var n,t,i=e.key,r=null===(n=Dn.current[i])||void 0===n?void 0:n.current,o=null===(t=An.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=x[i];r.style.minHeight="".concat(l,"px"),o.style.minHeight="".concat(l,"px")}}),!te)for(h=0;h<g.length;h++){v=null===(r=Bn.current[h])||void 0===r?void 0:r.current,p=null===(o=kn.current[h])||void 0===o?void 0:o.current;if(v&&p){var b=g[h];v.style.minHeight="".concat(b,"px"),p.style.minHeight="".concat(b,"px")}}if(Tn.forEach(function(e){var n,t,i=e.key,r=e.analysisKey,o=null===(n=Dn.current[i])||void 0===n?void 0:n.current,l=null===(t=An.current[i])||void 0===t?void 0:t.current;if(o&&l){var c=o.getBoundingClientRect(),a=l.getBoundingClientRect(),d=Ln(r),u=S(d.score,d.relation,d.hasContent,je);if(!u)return;var h=c.top+c.height/2-s.top;f.push({id:"field-".concat(i),x1:c.right-s.left,y1:h,x2:a.left-s.left,y2:h,style:u})}}),te)rn.forEach(function(e,n){var t;(null===(t=Bn.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,r=on.findIndex(function(n){return n.selfIndex===e});if(-1!==r){var o=null===(t=zn.current[n])||void 0===t?void 0:t.current,l=null===(i=Hn.current[r])||void 0===i?void 0:i.current;if(o&&l){var c=o.getBoundingClientRect(),a=l.getBoundingClientRect(),d=c.right-s.left,u=a.left-s.left,h=c.top+c.height/2-s.top,v=a.top+a.height/2-s.top;ae&&In===n&&(v=h);var p=jn(n);p&&f.push({id:"line-".concat(n,"-").concat(r),x1:d,y1:h,x2:u,y2:v,style:p,sectionIdx:n,targetRightIdx:r})}}})});else for(h=0;h<Math.min(rn.length,on.length);h++){var w=null===(l=Bn.current[h])||void 0===l?void 0:l.current,F=null===(c=kn.current[h])||void 0===c?void 0:c.current;if(w&&F){var I=w.querySelector(".MuiAccordionSummary-root"),E=F.querySelector(".MuiAccordionSummary-root");if(I&&E){var C=I.getBoundingClientRect(),R=E.getBoundingClientRect(),_=(C.top+C.height/2-s.top+R.top+R.height/2-s.top)/2,T=(null===(a=on[h])||void 0===a?void 0:a.id)||"sec-".concat(h),D=jn(h);D&&f.push({id:T,x1:C.right-s.left,y1:_,x2:R.left-s.left,y2:_,style:D,sectionIdx:h,hasCognitive:!!((null===(d=rn[h])||void 0===d?void 0:d.cognitiveData)||(null===(u=on[h])||void 0===u?void 0:u.cognitiveData)||T&&ve[T])})}}}if(wn(f),gn.current&&mn.current){var A=gn.current.getBoundingClientRect(),B=mn.current.getBoundingClientRect(),k=(A.top+A.height/2-s.top+B.top+B.height/2-s.top)/2;_n({x1:A.right-s.left,x2:B.left-s.left,y:k})}else _n(null)}catch(e){console.error("Line render safe fail: ",e)}finally{ze.current=!1}}},[Tn,rn,on,ve,je,Ln,jn,te,ae,In]),On=o(Nn);c(function(){On.current=Nn},[Nn]);var Pn=a(function(){null!==Sn.current&&window.cancelAnimationFrame(Sn.current),Sn.current=window.requestAnimationFrame(function(){On.current(),Sn.current=null})},[]),qn=a(function(){var e=Re.sectionIdx;Me(),null!==e&&(ae&&In===e?fn():(he.current=!0,En(e),de(!0),fe(!1),Be.current&&(Be.current.style.height="0px"),ke.current&&(ke.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i=null===(n=un.current[e])||void 0===n?void 0:n.current,r=rn[e],o=(null==r?void 0:r.refIndexes)||[],l=null;if(o.length>0){var c=o[0],a=on.findIndex(function(e){return e.selfIndex===c});l=null===(t=Wn.current[a])||void 0===t?void 0:t.current}var d=null==i?void 0:i.parentElement,u=Ae.current;if(i&&d){var s=i.offsetTop-d.scrollTop,f=null;if(l&&u){var h=l.offsetTop-s;if(h<0)Be.current&&(Be.current.style.height="".concat(Math.abs(h),"px")),f=0;else{var v=u.scrollHeight-u.clientHeight;h>v?(ke.current&&(ke.current.style.height="".concat(h-v+150,"px")),f=h):f=h}}u&&null!==f?function(e,n,t,i){void 0===t&&(t=300);var r=e.style.scrollBehavior;e.style.scrollBehavior="auto";var o=e.scrollTop,l=n-o,c=null,a=function(d){null===c&&(c=d);var u,s=d-c;s<t?(e.scrollTop=(u=s,u/=t,l*(--u*u*u+1)+o),requestAnimationFrame(a)):(e.scrollTop=n,e.style.scrollBehavior=r,i&&i())};requestAnimationFrame(a)}(u,f,300,function(){fe(!0),Pn(),setTimeout(function(){he.current=!1},50)}):setTimeout(function(){fe(!0),Pn(),he.current=!1},350)}})))},[Me,Re.sectionIdx,ae,In,rn,on,Pn,fn]),Xn=a(function(){he.current||(Pn(),ae&&!he.current&&(de(!1),En(null),fe(!1),Be.current&&(Be.current.style.height="0px"),ke.current&&(ke.current.style.height="0px")))},[Pn,ae]);c(function(){var e=setTimeout(Pn,250);window.addEventListener("resize",Pn);var n=null,t=null;return Te.current&&(n=new ResizeObserver(Pn)).observe(Te.current),xn.current&&(t=new ResizeObserver(Pn)).observe(xn.current),function(){clearTimeout(e),window.removeEventListener("resize",Pn),null==n||n.disconnect(),null==t||t.disconnect()}},[Oe,Ze,cn,Tn,Ue,Je,rn,on,je,Pn,ae,In,se]);var Yn=function(r,o,l,c,a){void 0===a&&(a=1);var u,s=te?!!Ue["".concat(l,"-").concat(o)]:!!Ue[String(o)],h=E(r.title),v=E(r.content),b=!h&&!v,w=r.title;return h||(w=v?"No Title Found":"No Matching Section Found"),t(d,e({ref:c,sx:e(e({mb:a},te?{height:"fit-content"}:{minHeight:0}),{display:"flex",flexDirection:"column",position:"relative"})},{children:n(x,e({disableGutters:!0,expanded:!b&&s,onChange:function(){return!b&&function(n,t){Ke(function(i){var r=e({},i);if(!te){var o=!!i[String(n)];return r[String(n)]=!o,r}var l="".concat(t,"-").concat(n),c=!i[l];if(r[l]=c,"left"===t)((null==(a=rn[n])?void 0:a.refIndexes)||[]).forEach(function(e){var n=on.findIndex(function(n){return n.selfIndex===e});-1!==n&&(r["right-".concat(n)]=c)});else{var a,d=null==(a=on[n])?void 0:a.selfIndex;rn.forEach(function(e,n){var t;(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(d))&&(r["left-".concat(n)]=c)})}return r})}(o,l)},sx:{boxShadow:"none",border:b?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:b?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flex:1,display:"flex",flexDirection:"column","&:before":{display:"none"}}},{children:[t(g,e({expandIcon:b?null:t(y,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:b?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"flex",alignItems:"center",overflow:"hidden"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:t(p,e({title:w,placement:"top"},{children:t(f,e({sx:{fontSize:"12px",color:b?"#94A3B8":"#19213D",fontWeight:b?400:700,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:(u=w,u?I(u).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,n){return e.startsWith("**")&&e.endsWith("**")?t("strong",{children:e.slice(2,-2)},n):t(i.Fragment,{children:e},n)}):null)}))}))})),!b&&n(m,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column"}},{children:[t(f,e({component:"div",sx:Fe},{children:t(F,{children:I(r.content).replace(/\\n/g,"\n")})})),(r.subsections||[]).map(function(e,n){return Vn(e,"".concat(o,"-").concat(n),0)})]}))]}))}),"".concat(l,"-sec-").concat(o))},Vn=function(i,r,o){void 0===o&&(o=0);var l=E(i.title),c=E(i.content),a=!l&&!c,u=l?i.title:c?"No Title Found":"No Matching Section Found",s=!!Je[r];return i.title?n(x,e({disableGutters:!0,expanded:!a&&s,onChange:function(){return!a&&Qe(function(n){var t;return e(e({},n),((t={})[r]=!n[r],t))})},sx:{mt:1,boxShadow:"none",border:a?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF","&:before":{display:"none"}}},{children:[t(g,e({expandIcon:a?null:t(y,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5}}},{children:t(f,e({sx:{fontSize:"11px",fontWeight:600,color:a?"#94A3B8":"#19213D"}},{children:u||"Untitled Subsection"}))})),!a&&n(m,e({sx:{pt:0,pb:1}},{children:[c&&t(f,e({component:"div",sx:Fe},{children:t(F,{children:I(i.content).replace(/\\n/g,"\n")})})),(i.subsections||[]).map(function(e,n){return Vn(e,"".concat(r,"-").concat(n),o+1)})]}))]}),r):t(d,e({sx:{mt:0===o?1:.75}},{children:!a&&n("div",{children:[c&&t(f,e({component:"div",sx:Fe},{children:t(F,{children:I(i.content).replace(/\\n/g,"\n")})})),(i.subsections||[]).map(function(e,n){return Vn(e,"".concat(r,"-").concat(n),o+1)})]})}),r)};return n(d,e({ref:De,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},te?{}:{overflow:"visible"}),{position:"relative"})},{children:[te&&t(k,{open:Re.open,anchorEl:Re.anchorEl,sectionTitle:Re.sectionTitle,referenceSectionTitle:Re.refSectionTitle,onClose:Me,onOpenCognitiveCompare:pn,onOpenSideBySide:qn}),Ee.open&&t(B,{open:Ee.open,popupRef:me,position:xe,popupConfig:ee,onClose:function(){ge(null),Se(function(n){return e(e({},n),{open:!1})})},markdownStyles:Q,sectionTitle:Ee.sectionTitle,referenceSectionTitle:Ee.refSectionTitle,cognitiveData:Ee.cognitiveData,anchorEl:Ee.anchorEl,sectionAnchorEl:Ee.sectionAnchorEl,scrollContainerEl:Te.current,badgeStyle:Ee.badgeStyle,docData:Ee.docData}),t(u,e({open:!!oe,autoHideDuration:8e3,onClose:function(){return le(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:t(s,e({onClose:function(){return le(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:oe}))})),n(d,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[t(d,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:t(f,e({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:V}))})),t(d,e({sx:{display:"flex",alignItems:"center"}},{children:t(h,{control:t(v,{checked:te,onChange:function(e){return ie(e.target.checked)},color:"primary",size:"small"}),label:t(f,e({sx:{fontSize:"13px",fontWeight:500,color:"#64748B"}},{children:"Relative Order"})),labelPlacement:"start",sx:{m:0,gap:1}})}))]})),t(d,e({ref:Te,onScroll:Xn,sx:{flex:1,minHeight:0,pt:1.5,pb:8,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:te?"hidden":"auto",borderTop:an&&dn?"none":"1.5px solid #EEF0F4"}},{children:t(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},te?{flex:1,minHeight:0}:{})},{children:n(d,e({ref:xn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},te?{flex:1,overflow:"visible"}:{})},{children:[n("svg",e({style:{position:"absolute",top:0,left:0,width:be.width||"100%",height:be.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible"}},{children:[Rn&&n("g",{children:[t("line",{x1:Rn.x1,y1:Rn.y,x2:Math.max(Rn.x1,(Rn.x1+Rn.x2)/2-70),y2:Rn.y,stroke:"#BBF7D0",strokeWidth:"1.5"}),t("line",{x1:Math.min(Rn.x2,(Rn.x1+Rn.x2)/2+70),y1:Rn.y,x2:Rn.x2,y2:Rn.y,stroke:"#BBF7D0",strokeWidth:"1.5"})]}),bn.map(function(i){var r,o=(i.x1+i.x2)/2;if("Not Defined"===i.style.label&&!i.hasCognitive)return null;if(!te)return n("g",{children:[t("line",{x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,stroke:i.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),t("foreignObject",e({x:o-100,y:i.y1-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:t(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n(d,e({onClick:function(e){var n=rn[i.sectionIdx]||{title:"",content:""},t=on[i.sectionIdx]||{title:"",content:""};vn(hn(e.currentTarget,n,t,i.sectionIdx,i.style))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:i.style.badgeBg,color:i.style.badgeText,border:"1px solid ".concat(i.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:500,textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"}},{children:[i.style.label,t(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:t(w,{})})),t(y,{size:11})]}))}))}))]},i.id);var l=rn[i.sectionIdx];return!(null===(r=null==l?void 0:l.refIndexes)||void 0===r?void 0:r.length)||(null==l?void 0:l.selfIndex)<0?null:ae&&In===i.sectionIdx&&se?n("g",e({style:{transition:"opacity 0.2s"}},{children:[t("defs",{children:t("marker",e({id:"arr-".concat(i.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:t("polygon",{points:"0 0, 7 2.5, 0 5",fill:i.style.badgeBorder||"#6366F1"})}))}),t("line",{x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,stroke:i.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(i.id,")")})]}),i.id):null})]})),n(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},te?{flex:1,overflow:"visible"}:{})},{children:[t(d,e({ref:gn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"40px",alignItems:"center",overflowX:"hidden"}},{children:t(p,e({title:nn,placement:"top"},{children:t(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:nn}))}))})),t(d,e({onScroll:Xn,sx:e({p:"12px",display:"flex",flexDirection:"column"},te?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:ln&&rn.map(function(r,o){var l;if(!te)return t(d,e({ref:sn(o)},{children:Yn(r,o,"left",Bn.current[o])}),"left-row-".concat(o));var c=r,a=jn(o),u=!(null===(l=c.refIndexes)||void 0===l?void 0:l.length)||c.selfIndex<0,s="number"==typeof c.selfIndex&&c.selfIndex>=0?c.selfIndex+1:null;return t(d,e({ref:sn(o),sx:{mb:1}},{children:n(d,e({sx:{position:"relative",width:"100%"}},{children:[t(d,e({ref:Bn.current[o],sx:{width:"100%"}},{children:Yn(r,o,"left",i.createRef(),0)})),a&&n(d,e({ref:zn.current[o],onClick:function(e){var n=on.find(function(e){var n;return null===(n=c.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""};!function(e,n,t,i,r){e.stopPropagation(),Re.open&&Re.sectionIdx===i?Me():(We(),_e(hn(e.currentTarget,n,t,i,r)))}(e,r,n,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==s&&t(d,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:s})),t(d,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:u?"No Deviation Found":0==a.deviationLabel||void 0===a.deviationLabel?"Same":"".concat(a.deviationLabel,"% Deviation")})),t(b,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))})}))]})),t(d,e({sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"6px",gap:0}},{children:t(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n(d,e({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",borderRadius:"20px",bgcolor:"#ECFDF3",border:"1px solid #A7F3D0",color:"#15803D",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1}},{children:[t(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:t(w,{})})),0,"% Similarity",t(y,{size:11})]}))}))})),n(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},te?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[t(d,e({ref:mn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:t(p,e({title:tn,placement:"top"},{children:t(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:tn}))}))})),n(d,e({ref:Ae,onScroll:Xn,sx:e({p:"12px",display:"flex",flexDirection:"column"},te?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-160px",pl:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[t("div",{ref:Be,style:{width:"100%",height:"0px",flexShrink:0}}),ln&&on.map(function(r,o){if(!te)return Yn(r,o,"right",kn.current[o]);var l=r,c=rn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1});return t(d,e({ref:Wn.current[o],sx:{mb:1}},{children:n(d,e({sx:{position:"relative",width:"100%"}},{children:[t(d,e({ref:kn.current[o],sx:{width:"100%"}},{children:Yn(r,o,"right",i.createRef(),0)})),t(d,e({ref:Hn.current[o],sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:"#EEF2FF",color:"#3730A3",border:"1px solid #C7D2FE",borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:c.length>0?c.join(", "):"-"}))]}))}),"right-row-".concat(o))}),t("div",{ref:ke,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{W as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import i,{useState as r,useRef as o,useMemo as l,useEffect as c,useCallback as a}from"react";import{Typography as u,Box as d,Snackbar as s,Alert as f,FormControlLabel as v,Switch as p,Tooltip as h,Accordion as x,AccordionSummary as g,AccordionDetails as m}from"@mui/material";import{ChevronDown as y,EllipsisVertical as b}from"lucide-react";import{ButtonCognitiveIcon as w}from"../../assests/svg/ButtonCognitiveIcon.js";import I from"./OverlayComponent.js";import F from"react-markdown";import{safeStringify as S,hasValue as E,getStyleForRelation as C,getRationale as R,getSideData as T,cognitiveScoreToRelation as B}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as _,DEFAULT_FIELD_CONFIG as D,DEFAULT_COMPARISON_CONFIG as M}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import k from"./CognitivePopup.js";import A from"./MoreFunctionsPopup.js";import H from"./LoaderComponent.js";var z=i.memo(function(t){var i=t.content,r=t.sxStyles;return n(u,e({component:"div",sx:r},{children:n(F,{children:S(i).replace(/\\n/g,"\n")})}))}),W=function(e,n,t,i,r){void 0===r&&(r=14);var o=(e+t)/2,l=i-n;if(Math.abs(l)<3)return"M ".concat(e," ").concat(n," H ").concat(t);var c=l>0?1:-1,a=Math.min(r,Math.abs(l)/2,Math.abs(o-e)/2,Math.abs(t-o)/2);return["M ".concat(e," ").concat(n),"H ".concat(o-a),"Q ".concat(o," ").concat(n," ").concat(o," ").concat(n+c*a),"V ".concat(i-c*a),"Q ".concat(o," ").concat(i," ").concat(o+a," ").concat(i),"H ".concat(t)].join(" ")},L={id:"",title:""},O={open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null},j=function(e,n,t,i,r){void 0===t&&(t=300);var o=e.style.scrollBehavior;e.style.scrollBehavior="auto";var l=e.scrollTop,c=n-l,a=null,u=function(d){null===a&&(a=d);var s,f=d-a;f<t?(e.scrollTop=(s=f,s/=t,c*(--s*s*s+1)+l),r&&r(),requestAnimationFrame(u)):(e.scrollTop=n,e.style.scrollBehavior=o,r&&r(),i&&i())};requestAnimationFrame(u)},N=function(N){var Y,P,q,X,V,U,J,K,G=N.componentHeaderText,Q=void 0===G?"Contract Comparison":G,Z=N.treeData,$=N.comparisonConfig,ee=N.leftColumnTitleText,ne=N.rightColumnTitleText,te=N.markdownStyles,ie=N.maintainRelativeOrder,re=void 0!==ie&&ie,oe=N.popupConfig,le=N.deviationData,ce=void 0===le?{}:le,ae=r(re),ue=ae[0],de=ae[1],se=r(!1),fe=se[0],ve=se[1],pe=r(!1),he=pe[0],xe=pe[1],ge=r(null),me=ge[0],ye=ge[1],be=r(!1),we=be[0],Ie=be[1],Fe=r(!1),Se=Fe[0],Ee=Fe[1],Ce=o(!1),Re=r(new Set),Te=Re[0],Be=Re[1],_e=r([]),De=_e[0],Me=_e[1],ke=o(null),Ae=o(!1),He=o(null),ze=o({}),We=o([]),Le=o(!1),Oe=o(!1),je=o(null),Ne=l(function(){return(null==Z?void 0:Z.cognitive_decisioning)||{}},[Z]),Ye=r(null),Pe=Ye[0],qe=Ye[1],Xe=o(null),Ve=r({width:0,height:0}),Ue=Ve[0],Je=Ve[1],Ke=l(function(){return e(e({},_),te)},[te]),Ge=r({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),Qe=Ge[0],Ze=Ge[1],$e=r({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionIdx:null,docData:null,deviationData:null}),en=$e[0],nn=$e[1],tn=o(null),rn=o(null),on=o(null),ln=o(null),cn=o(null),an=o(null),un=o(!1),dn=o(null);c(function(){dn.current=null},[Qe.sectionIdx,Qe.open]);var sn=a(function(){qe(null),Ze(O)},[]),fn=a(function(){nn(O)},[]),vn=a(function(){var e;if(Qe.anchorEl&&Qe.refSectionTitle){var n=Qe.anchorEl.getBoundingClientRect(),t=(null===(e=null==Xe?void 0:Xe.current)||void 0===e?void 0:e.offsetHeight)||0,i=Math.min(680,window.innerWidth-24),r=window.innerHeight-n.bottom-12-12,o=n.top-12-12,l=r<t&&o>r;null!==dn.current?!0===dn.current&&(l=o>=t||o>=r):l=!(r>=t||r>=o),dn.current=l;var c=l?o:r,a=Math.min(t||9999,c),u=l?n.top-12-a:n.bottom+12,d=n.left+n.width/2,s=d-i/2,f=Math.max(12,Math.min(s,window.innerWidth-i-12)),v=Math.max(14,Math.min(d-f,i-10-4));qe({top:u,left:f,arrowLeft:v,openAbove:l,maxHeight:c})}},[Qe.anchorEl,Qe.refSectionTitle]);c(function(){if(Qe.open){window.addEventListener("resize",vn);var e=requestAnimationFrame(vn),n=null;return Xe.current&&(n=new ResizeObserver(function(){cancelAnimationFrame(e),e=requestAnimationFrame(vn)})).observe(Xe.current),function(){cancelAnimationFrame(e),window.removeEventListener("resize",vn),n&&n.disconnect()}}},[Qe.open,vn]),c(function(){var e=tn.current;if(e&&Qe.open){var n=function(e){Xe.current&&Xe.current.contains(e.target)||(qe(null),sn())};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[Qe.open,sn]),c(function(){var e=tn.current;if(e&&en.open){var n=function(){fn()};return e.addEventListener("scroll",n,{capture:!0}),window.addEventListener("scroll",n,{capture:!0}),function(){e.removeEventListener("scroll",n,{capture:!0}),window.removeEventListener("scroll",n,{capture:!0})}}},[en.open,fn]);var pn=l(function(){var n,t,i,r,o,l,c,a,u,d,s,f;return{fields:null!==(n=null==$?void 0:$.fields)&&void 0!==n?n:D,thresholds:{high:null!==(i=null===(t=null==$?void 0:$.thresholds)||void 0===t?void 0:t.high)&&void 0!==i?i:M.thresholds.high,medium:null!==(o=null===(r=null==$?void 0:$.thresholds)||void 0===r?void 0:r.medium)&&void 0!==o?o:M.thresholds.medium,exact:null!==(c=null===(l=null==$?void 0:$.thresholds)||void 0===l?void 0:l.exact)&&void 0!==c?c:M.thresholds.exact},relationStyles:{noContent:e(e({},M.relationStyles.noContent),(null===(a=null==$?void 0:$.relationStyles)||void 0===a?void 0:a.noContent)||{}),high:e(e({},M.relationStyles.high),(null===(u=null==$?void 0:$.relationStyles)||void 0===u?void 0:u.high)||{}),exact:e(e({},M.relationStyles.exact),(null===(d=null==$?void 0:$.relationStyles)||void 0===d?void 0:d.exact)||{}),medium:e(e({},M.relationStyles.medium),(null===(s=null==$?void 0:$.relationStyles)||void 0===s?void 0:s.medium)||{}),low:e(e({},M.relationStyles.low),(null===(f=null==$?void 0:$.relationStyles)||void 0===f?void 0:f.low)||{})}}},[$]),hn=l(function(){if(Z&&Object.keys(Z).length>0)try{var n=function(n,t,i){var r,o,l,c,a,u,d,s,f;void 0===t&&(t=!1),void 0===i&&(i=null);var v=[],p=[],h=n.base_root_id,x=n.input_index_map||{0:"left",1:"right"},g=n[h];if(!g||!1===g.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[]};var m=function(t,r){var o,l=n[t];if(!l||!1===l.display_node)return null;var c=T(l,r,x),a=!!c.title.trim(),u=!!c.content.trim(),d=R(l),s=(null===(o=null==i?void 0:i[t])||void 0===o?void 0:o.evaluation_result)||l.evaluation_result||null,f=[];l.next&&Object.values(l.next).forEach(function(e){var t=n[e];if(t&&!1!==t.display_node){var i=m(e,r);i&&f.push(i)}});var v=!(!a&&!u);return e(e({id:t,title:a?c.title:"",content:u?c.content:"",subsections:f},v?d:{score:void 0,relation:"not_defined"}),{evaluationResult:s})};if(t){var y={},b={},w=-1,I=-1;for(var F in n)if(!["base_root_id","documents","input_index_map",h].includes(F)){var S=n[F];if(S&&!1!==S.display_node){var E=R(S),C=T(S,"0",x),B=T(S,"1",x),_=C.title.trim()||C.content.trim(),D=B.title.trim()||B.content.trim(),M=(null===(r=null==i?void 0:i[F])||void 0===r?void 0:r.evaluation_result)||S.evaluation_result||null,k=Number(null!==(l=null===(o=C.attributes)||void 0===o?void 0:o.display_index)&&void 0!==l?l:w--),A=Number(null!==(a=null===(c=B.attributes)||void 0===c?void 0:c.display_index)&&void 0!==a?a:I--),H=b[A]||e(e({id:F,title:D?B.title:"",content:D?B.content:"",subsections:[]},D?E:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:A,evaluationResult:M}),z=y[k]||e(e({id:F,title:_?C.title:"",content:_?C.content:"",subsections:[]},_?E:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:k,evaluationResult:M});Number(A)>=0&&Number(k)>=0&&(H.refIndexes.includes(Number(k))||H.refIndexes.push(Number(k)),z.refIndexes.includes(Number(A))||z.refIndexes.push(Number(A))),b[A]=H,y[k]=z}}p=Object.values(b).map(function(e){return e}),v=Object.values(y).map(function(e){return e}),p.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex}),v.sort(function(e,n){return e.selfIndex<0&&n.selfIndex>=0?1:e.selfIndex>=0&&n.selfIndex<0?-1:e.selfIndex-n.selfIndex})}else g.next&&Object.values(g.next).forEach(function(e){var t=n[e];t&&!1!==t.display_node&&(v.push(m(e,"0")||{id:e,title:"",content:"",subsections:[]}),p.push(m(e,"1")||{id:e,title:"",content:"",subsections:[]}))});return{activeProposed:{title:(null===(d=null===(u=g.comparison_inputs)||void 0===u?void 0:u[x[0]])||void 0===d?void 0:d.title)||"Uploaded Contract",description:g.decision_scope_description||"",sections:v},activeVariants:[{id:"tree-variant-1",title:(null===(f=null===(s=g.comparison_inputs)||void 0===s?void 0:s[x[1]])||void 0===f?void 0:f.title)||"Reference Template",similarity:0,sections:p,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:g.decision_scope_description||""},fields:{}}}}]}}(Z,ue,ce);return e(e({},n),{parseError:null})}catch(e){return console.error("Data Transformation Error: ",e),{activeProposed:{},activeVariants:[],parseError:e instanceof Error?e.message:"Unknown Parsing Error"}}return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"}},[JSON.stringify(Z),ue,JSON.stringify(ce)]),xn=hn.activeProposed,gn=hn.activeVariants,mn=hn.parseError;c(function(){mn&&ye("Failed to load comparison: ".concat(mn))},[mn]);var yn=r(null),bn=yn[0];yn[1];var wn=r({}),In=wn[0],Fn=wn[1],Sn=r({}),En=Sn[0],Cn=Sn[1],Rn=(null==gn?void 0:gn[0])||L,Tn=null===(q=null===(Y=null==Z?void 0:Z.documents)||void 0===Y?void 0:Y[null===(P=null==Z?void 0:Z.input_index_map)||void 0===P?void 0:P[0]])||void 0===q?void 0:q.title,Bn=null===(U=null===(X=null==Z?void 0:Z.documents)||void 0===X?void 0:X[null===(V=null==Z?void 0:Z.input_index_map)||void 0===V?void 0:V[1]])||void 0===U?void 0:U.title,_n=S(ee||Tn||"Uploaded Contract"),Dn=S(ne||Bn||"Reference Template"),Mn=l(function(){return(null==xn?void 0:xn.sections)||[]},[null==xn?void 0:xn.sections]),kn=l(function(){return Rn.sections||[]},[Rn.sections]),An=Mn.length>0||kn.length>0,Hn=Rn.analysis,zn=S(null===(K=null===(J=null==Hn?void 0:Hn.rule_difference_comparison)||void 0===J?void 0:J.summary)||void 0===K?void 0:K.overall_summary),Wn=!!zn.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Ln=o({}),On=function(e){return Ln.current[e]||(Ln.current[e]=i.createRef()),Ln.current[e]},jn=a(function(){Ie(!1),Oe.current=!1,nt(null),je.current=null,Vn.current=null,Ee(!1),xe(!1),ln.current&&(ln.current.style.height="0px"),cn.current&&(cn.current.style.height="0px")},[]),Nn=a(function(e,n,t,i,r){var o,l,c=S(n.id)||S(t.id)||"",a=(c?Ne[c]:null)||n.cognitiveData||t.cognitiveData||{section_id:c,decisioning:[],gap:[],relevance_score:0},u=null!==(l=null===(o=Ln.current[i])||void 0===o?void 0:o.current)&&void 0!==l?l:null;return{open:!0,sectionTitle:n.title||"N/A",refSectionTitle:t.title||"NA",cognitiveData:a,anchorEl:e,sectionAnchorEl:u,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==Z?void 0:Z.documents,input_index_map:null==Z?void 0:Z.input_index_map},deviationData:n.evaluationResult||t.evaluationResult||null}},[Ne,Z]),Yn=a(function(e){fn(),qe(null),Ze(e)},[fn]),Pn=a(function(){null!==en.sectionIdx&&en.anchorEl?Yn(e(e({},en),{open:!0})):fn()},[en,fn,Yn]);a(function(e){fn(),ye("".concat(e," is coming soon."))},[fn]);var qn=a(function(){var e=en.sectionIdx;fn(),null!==e&&(Oe.current&&jn(),Be(function(n){return n.has(e)?new Set:new Set([e])}))},[en.sectionIdx,fn,jn]),Xn=o(null),Vn=o(null),Un=o(null),Jn=o(null),Kn=o(null),Gn=r([]),Qn=Gn[0],Zn=Gn[1],$n=r(null),et=$n[0],nt=$n[1];o(null);var tt=r(null),it=tt[0],rt=tt[1],ot=l(function(){return pn.fields.filter(function(e){var n=e.key;return(!An||"description"!==n)&&(E(null==xn?void 0:xn[n])||E(Rn[n]))})},[xn,Rn,An,pn.fields]),lt=o({}),ct=o({}),at=o({}),ut=o({}),dt=o({}),st=o({}),ft=o({});ot.forEach(function(e){for(var n=e.key,t=0;t<Math.max(Mn.length,kn.length);t+=1)at.current[t]||(at.current[t]=i.createRef()),ut.current[t]||(ut.current[t]=i.createRef()),dt.current[t]||(dt.current[t]=i.createRef()),st.current[t]||(st.current[t]=i.createRef()),ft.current[t]||(ft.current[t]=i.createRef());lt.current[n]||(lt.current[n]=i.createRef()),ct.current[n]||(ct.current[n]=i.createRef())});for(var vt=0;vt<Math.max(Mn.length,kn.length);vt+=1)at.current[vt]||(at.current[vt]=i.createRef()),ut.current[vt]||(ut.current[vt]=i.createRef()),dt.current[vt]||(dt.current[vt]=i.createRef()),st.current[vt]||(st.current[vt]=i.createRef()),ft.current[vt]||(ft.current[vt]=i.createRef());c(function(){if(bn){var e=pn.fields.find(function(e){return e.analysisKey===bn||e.key===bn});if(e){var n=lt.current[e.key]||ct.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[bn,pn.fields]);var pt=a(function(e){var n,t,i,r,o,l,c,a,u,d=null===(n=null==Hn?void 0:Hn.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!d||!d[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=d[e],f=(null==s?void 0:s.relation)||(null===(i=null===(t=null==s?void 0:s.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(o=null===(r=null==s?void 0:s.highlights)||void 0===r?void 0:r.ruleB_spans)||void 0===o?void 0:o.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var v=s.mappings[0]||{};return{score:s.score,relation:v.relation||"",highlightsA:(null===(l=v.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=v.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!f}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(a=s.highlights)||void 0===a?void 0:a.ruleA_spans)||[],highlightsB:(null===(u=s.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!f}},[Hn]),ht=a(function(n){var t,i,r,o,l=Mn[n],c=kn[n],a=(null==l?void 0:l.relation)&&"not_defined"!==l.relation,u=(null==c?void 0:c.relation)&&"not_defined"!==c.relation,d=S(null==l?void 0:l.id)||S(null==c?void 0:c.id)||"",s=!(!(null==l?void 0:l.cognitiveData)&&!(null==c?void 0:c.cognitiveData));if(!a&&!u&&!s)return e(e({},pn.relationStyles.noContent),{label:"Not Defined"});var f=pt("description");if(null!=(null!==(i=null!==(t=null==l?void 0:l.cognitiveRelevanceScore)&&void 0!==t?t:null==c?void 0:c.cognitiveRelevanceScore)&&void 0!==i?i:d?null===(r=Ne[d])||void 0===r?void 0:r.relevance_score:void 0)){var v=B(),p=v.score,h=v.relation;return C(p,h,!0,pn)}var x=a?l.relation:u?c.relation:f.relation,g=null!==(o=null==l?void 0:l.score)&&void 0!==o?o:null==c?void 0:c.score,m="number"==typeof g?g:f.score;return C(m,x,!0,pn)},[Mn,kn,Ne,pn,pt]),xt=a(function(){var e,n,t,i,r,o,l,c,a,u,d;if(!un.current&&!Ae.current){un.current=!0;try{if(!Xn.current)return;var s=Xn.current.getBoundingClientRect();Je({width:s.width,height:s.height});var f=[];if(ot.forEach(function(e){var n,t,i=e.key,r=null===(n=lt.current[i])||void 0===n?void 0:n.current,o=null===(t=ct.current[i])||void 0===t?void 0:t.current;r&&o&&(r.style.height="auto",o.style.height="auto",r.style.minHeight="0px",o.style.minHeight="0px")}),!ue&&!Ae.current)for(var v=0;v<Math.min(Mn.length,kn.length);v++){var p=null===(e=at.current[v])||void 0===e?void 0:e.current,h=null===(n=ut.current[v])||void 0===n?void 0:n.current;p&&h&&(p.style.height="auto",h.style.height="auto",p.style.minHeight="0px",h.style.minHeight="0px")}var x={};ot.forEach(function(e){var n,t,i=e.key,r=null===(n=lt.current[i])||void 0===n?void 0:n.current,o=null===(t=ct.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=r.getBoundingClientRect(),c=o.getBoundingClientRect();x[i]=Math.max(l.height,c.height)}});var g=[];if(!ue&&!Ae.current)for(v=0;v<Math.min(Mn.length,kn.length);v++){p=null===(t=at.current[v])||void 0===t?void 0:t.current,h=null===(i=ut.current[v])||void 0===i?void 0:i.current;var m=!!In[String(v)];if(p&&h&&m){var y=p.getBoundingClientRect(),b=h.getBoundingClientRect();g[v]=Math.max(y.height,b.height)}}if(ot.forEach(function(e){var n,t,i=e.key,r=null===(n=lt.current[i])||void 0===n?void 0:n.current,o=null===(t=ct.current[i])||void 0===t?void 0:t.current;if(r&&o){var l=x[i];r.style.minHeight="".concat(l,"px"),o.style.minHeight="".concat(l,"px")}}),!ue&&!Ae.current)for(v=0;v<g.length;v++){p=null===(r=at.current[v])||void 0===r?void 0:r.current,h=null===(o=ut.current[v])||void 0===o?void 0:o.current;if(p&&h&&g[v]){var w=g[v];p.style.minHeight="".concat(w,"px"),h.style.minHeight="".concat(w,"px")}}if(ot.forEach(function(e){var n,t,i=e.key,r=e.analysisKey,o=null===(n=lt.current[i])||void 0===n?void 0:n.current,l=null===(t=ct.current[i])||void 0===t?void 0:t.current;if(o&&l){var c=o.getBoundingClientRect(),a=l.getBoundingClientRect(),u=pt(r),d=C(u.score,u.relation,u.hasContent,pn);if(!d)return;var v=c.top+c.height/2-s.top;f.push({id:"field-".concat(i),x1:c.right-s.left,y1:v,x2:a.left-s.left,y2:v,style:d})}}),ue)Mn.forEach(function(e,n){var t;(null===(t=at.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,r,o,l,c,a,u,d,v,p=kn.findIndex(function(n){return n.selfIndex===e});if(-1!==p){var h=null===(t=dt.current[n])||void 0===t?void 0:t.current,x=null===(i=st.current[p])||void 0===i?void 0:i.current;if(h&&x){var g=h.getBoundingClientRect(),m=x.getBoundingClientRect(),y=g.right-s.left,b=m.left-s.left,w=g.top+g.height/2-s.top,I=m.top+m.height/2-s.top;if(we&&et===n){var F=null!==(o=null===(r=an.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==o?o:0,S=null!==(c=null===(l=on.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,E=F+(null!==(u=null===(a=an.current)||void 0===a?void 0:a.clientHeight)&&void 0!==u?u:1/0),C=S+(null!==(v=null===(d=on.current)||void 0===d?void 0:d.clientHeight)&&void 0!==v?v:1/0),R=g.top+g.height/2,T=function(e,n,t){return Math.max(n,Math.min(t,e))};w=T(R,F,E)-s.top,I=T(R,S,C)-s.top}var B=ht(n);B&&f.push({id:"line-".concat(n,"-").concat(p),x1:y,y1:w,x2:b,y2:I,style:B,sectionIdx:n,targetRightIdx:p})}}})});else for(v=0;v<Math.min(Mn.length,kn.length);v++){var I=null===(l=at.current[v])||void 0===l?void 0:l.current,F=null===(c=ut.current[v])||void 0===c?void 0:c.current;if(I&&F){var S=I.getBoundingClientRect(),E=F.getBoundingClientRect(),R=(S.top+18-s.top+E.top+18-s.top)/2,T=(null===(a=kn[v])||void 0===a?void 0:a.id)||"sec-".concat(v),B=ht(v);B&&f.push({id:T,x1:S.right-s.left,y1:R,x2:E.left-s.left,y2:R,style:B,sectionIdx:v,hasCognitive:!!((null===(u=Mn[v])||void 0===u?void 0:u.cognitiveData)||(null===(d=kn[v])||void 0===d?void 0:d.cognitiveData)||T&&Ne[T])})}}if(Zn(f),Jn.current&&Kn.current){var _=Jn.current.getBoundingClientRect(),D=Kn.current.getBoundingClientRect(),M=(_.top+_.height/2-s.top+D.top+D.height/2-s.top)/2;rt({x1:_.right-s.left,x2:D.left-s.left,y:M})}else rt(null);if(ue&&Te.size>0){var k=[],A=an.current,H=on.current;if(A&&H){var z=[],L=A.getBoundingClientRect().top,O=H.getBoundingClientRect().top,j=L+A.clientHeight,N=O+H.clientHeight,Y=A.scrollTop,P=H.scrollTop,q=s.top,X=function(e,n,t){return Math.max(n,Math.min(t,e))};Te.forEach(function(e){var n,t=Mn[e];(null===(n=null==t?void 0:t.refIndexes)||void 0===n?void 0:n.length)&&t.refIndexes.forEach(function(n){var t,i,r=kn.findIndex(function(e){return e.selfIndex===n});if(-1!==r){var o=null===(t=dt.current[e])||void 0===t?void 0:t.current,l=null===(i=st.current[r])||void 0===i?void 0:i.current;if(o&&l){var c=o.getBoundingClientRect(),a=l.getBoundingClientRect(),u=ht(e),d=c.right-s.left,f=a.left-s.left,v=(d+f)/2,p=c.top+c.height/2,h=a.top+a.height/2,x=p-L+Y,g=h-O+P,m="conn-".concat(e,"-").concat(r);z.push({lhsScrollY:x,rhsScrollY:g,x1:d,x2:f,containerTop:q,leftIdx:e,rhsArrayIdx:r,styleColor:(null==u?void 0:u.badgeBorder)||"#6366F1",styleId:m});var y=X(p,L,j),b=X(h,O,N),w=y-q,I=b-q,F=p>=L-4&&p<=j+4,S=h>=O-4&&h<=N+4,E="";E=F&&S?W(d,w,f,I):F&&!S?"M ".concat(d,",").concat(w," L ").concat(v,",").concat(w," L ").concat(v,",").concat(I):!F&&S?"M ".concat(v,",").concat(w," L ").concat(v,",").concat(I," L ").concat(f,",").concat(I):"M ".concat(v,",").concat(w," L ").concat(v,",").concat(I),k.push({id:m,pathD:E,style:u,leftIdx:e,rhsArrayIdx:r})}}})}),We.current=z}Me(k)}else Me([]),We.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{un.current=!1}}},[ot,Mn,kn,Ne,pn,pt,ht,ue,we,et,Te,In]),gt=a(function(){var e,n,t,i,r,o,l,c,a,u,d,s,f,v,p=We.current;if(p.length&&!Ae.current){var h=null!==(n=null===(e=an.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,x=null!==(i=null===(t=on.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,g=null!==(o=null===(r=an.current)||void 0===r?void 0:r.clientHeight)&&void 0!==o?o:1/0,m=null!==(c=null===(l=on.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(u=null===(a=an.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==u?u:0,b=null!==(s=null===(d=on.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,w=y+g,I=b+m,F=null!==(v=null===(f=Xn.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==v?v:0,S=function(e,n,t){return Math.max(n,Math.min(t,e))};p.forEach(function(e){var n=e.lhsScrollY-h+y,t=e.rhsScrollY-x+b,i=ze.current[e.styleId+"-stroke"],r=ze.current[e.styleId+"-bg"];if(i||r){var o,l=S(n,y,w),c=S(t,b,I),a=l-F,u=c-F,d=n>=y-4&&n<=w+4,s=t>=b-4&&t<=I+4,f=(e.x1+e.x2)/2;o=d&&s?W(e.x1,a,e.x2,u):d&&!s?"M ".concat(e.x1,",").concat(a," L ").concat(f,",").concat(a," L ").concat(f,",").concat(u):!d&&s?"M ".concat(f,",").concat(a," L ").concat(f,",").concat(u," L ").concat(e.x2,",").concat(u):"M ".concat(f,",").concat(a," L ").concat(f,",").concat(u),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",o)),r&&(r.setAttribute("visibility","visible"),r.setAttribute("d",o))}})}},[]),mt=o(xt);c(function(){mt.current=xt},[xt]);var yt=o(null),bt=a(function(){null!==yt.current&&clearTimeout(yt.current),yt.current=setTimeout(function(){mt.current(),yt.current=null},50)},[]),wt=a(function(e){var n,t,i,r,o;if(!Ce.current){if(Oe.current){var l=je.current,c=Vn.current,a=an.current,u=on.current;if(null!==l&&null!==c&&a&&u){var d=null===(n=Ln.current[l])||void 0===n?void 0:n.current,s=null===(t=ft.current[c])||void 0===t?void 0:t.current;if(d&&s){if(e.currentTarget===a){var f=d.offsetTop-a.scrollTop,v=Math.max(0,s.offsetTop-f);Math.abs(u.scrollTop-v)>1&&(u.scrollTop=v)}else if(e.currentTarget===u){var p=s.offsetTop-u.scrollTop,h=Math.max(0,d.offsetTop-p);Math.abs(a.scrollTop-h)>1&&(a.scrollTop=h)}if(Un.current){var x=null===(i=dt.current[l])||void 0===i?void 0:i.current,g=null!==(o=null===(r=Xn.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==o?o:0,m=a.getBoundingClientRect().top,y=m+a.clientHeight,b=u.getBoundingClientRect().top,w=b+u.clientHeight,I=function(e,n,t){return Math.max(n,Math.min(t,e))};if(x){var F=x.getBoundingClientRect(),S=F.top+F.height/2,E=I(S,m,y),C=I(S,b,w);Un.current.setAttribute("y1",(E-g).toString()),Un.current.setAttribute("y2",(C-g).toString());var R=S>=m-4&&S<=y+4;Un.current.setAttribute("visibility",R?"visible":"hidden")}}}}}We.current.length>0&&!Le.current&&(Le.current=!0,requestAnimationFrame(function(){gt(),Le.current=!1}))}},[gt]);c(function(){var e=setTimeout(bt,250);window.addEventListener("resize",bt);var n=null,t=null;return tn.current&&(n=new ResizeObserver(bt)).observe(tn.current),Xn.current&&(t=new ResizeObserver(bt)).observe(Xn.current),function(){clearTimeout(e),window.removeEventListener("resize",bt),null==n||n.disconnect(),null==t||t.disconnect()}},[xn,Rn,Hn,ot,In,En,Mn,kn,pn,bt,we,et,Se,Te]),c(function(){Oe.current=we},[we]),c(function(){je.current=et},[et]);var It=a(function(){var e=en.sectionIdx;fn(),null!==e&&(we&&et===e?jn():(Be(new Set),Me([]),We.current=[],xe(!0),Ce.current=!0,nt(e),je.current=e,Ie(!0),Oe.current=!0,Ee(!1),ln.current&&(ln.current.style.height="0px"),cn.current&&(cn.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i=null===(n=Ln.current[e])||void 0===n?void 0:n.current,r=Mn[e],o=(null==r?void 0:r.refIndexes)||[],l=null,c=-1;if(o.length>0){var a=o[0];c=kn.findIndex(function(e){return e.selfIndex===a}),l=null===(t=ft.current[c])||void 0===t?void 0:t.current}Vn.current=-1!==c?c:null;var u=an.current,d=on.current;if(!i||!u)return Ce.current=!1,void xe(!1);var s=i.offsetTop-u.scrollTop;if(!l||!d)return Ee(!0),mt.current(),Ce.current=!1,void xe(!1);var f=l.offsetTop-s;f<0&&ln.current&&(ln.current.style.height="".concat(Math.abs(f),"px"));requestAnimationFrame(function(){var e,n=d.scrollHeight-d.clientHeight;if(f<0)e=0;else{if(f>n){var t=f-n;return cn.current&&(cn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){j(d,f,200,function(){Ee(!0),mt.current(),Ce.current=!1,xe(!1)})})}e=f}j(d,e,200,function(){Ee(!0),mt.current(),Ce.current=!1,xe(!1)})})})))},[fn,en.sectionIdx,we,et,Mn,kn,bt,jn]),Ft=null!==en.sectionIdx&&Te.has(en.sectionIdx),St=function(r,o,l,c,a){void 0===a&&(a=1);var s,f=ue?!!In["".concat(l,"-").concat(o)]:!!In[String(o)],v=E(r.title),p=E(r.content),b=!v&&!p,w=r.title;return v||(w=p?"No Title Found":"No Matching Section Found"),n(d,e({ref:c,sx:e(e({mb:a},ue?{height:"fit-content"}:{minHeight:0}),{display:"flex",flexDirection:"column",position:"relative"})},{children:t(x,e({disableGutters:!0,expanded:!b&&f,onChange:function(){return!b&&function(n,t){var i,r;if(Ae.current=!0,He.current&&clearTimeout(He.current),ke.current&&(ke.current.style.opacity="0"),!ue){var o=null===(i=at.current[n])||void 0===i?void 0:i.current,l=null===(r=ut.current[n])||void 0===r?void 0:r.current;o&&l&&(o.style.minHeight="0px",l.style.minHeight="0px")}He.current=setTimeout(function(){Ae.current=!1,mt.current(),ke.current&&(ke.current.style.opacity="1")},350),Fn(function(i){var r=e({},i);if(!ue){var o=!!i[String(n)];return r[String(n)]=!o,r}var l="".concat(t,"-").concat(n),c=!i[l];if(r[l]=c,"left"===t)((null==(a=Mn[n])?void 0:a.refIndexes)||[]).forEach(function(e){var n=kn.findIndex(function(n){return n.selfIndex===e});-1!==n&&(r["right-".concat(n)]=c)});else{var a,u=null==(a=kn[n])?void 0:a.selfIndex;Mn.forEach(function(e,n){var t;(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(u))&&(r["left-".concat(n)]=c)})}return r})}(o,l)},sx:{boxShadow:"none",border:b?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:b?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flex:1,display:"flex",flexDirection:"column","&:before":{display:"none"}}},{children:[n(g,e({expandIcon:b?null:n(y,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:b?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"flex",alignItems:"center",overflow:"hidden"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:n(h,e({title:w,placement:"top"},{children:n(u,e({sx:{fontSize:"12px",color:b?"#94A3B8":"#19213D",fontWeight:b?400:700,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:(s=w,s?S(s).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,t){return e.startsWith("**")&&e.endsWith("**")?n("strong",{children:e.slice(2,-2)},t):n(i.Fragment,{children:e},t)}):null)}))}))})),!b&&t(m,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column"}},{children:[n(z,{content:r.content,sxStyles:Ke}),(r.subsections||[]).map(function(e,n){return Et(e,"".concat(o,"-").concat(n),0)})]}))]}))}),"".concat(l,"-sec-").concat(o))},Et=function(i,r,o){void 0===o&&(o=0);var l=E(i.title),c=E(i.content),a=!l&&!c,s=l?i.title:c?"No Title Found":"No Matching Section Found",f=!!En[r];return i.title?t(x,e({disableGutters:!0,expanded:!a&&f,onChange:function(){return!a&&Cn(function(n){var t;return e(e({},n),((t={})[r]=!n[r],t))})},sx:{mt:1,boxShadow:"none",border:a?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF","&:before":{display:"none"}}},{children:[n(g,e({expandIcon:a?null:n(y,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5}}},{children:n(u,e({sx:{fontSize:"11px",fontWeight:600,color:a?"#94A3B8":"#19213D"}},{children:s||"Untitled Subsection"}))})),!a&&t(m,e({sx:{pt:0,pb:1}},{children:[c&&n(u,e({component:"div",sx:Ke},{children:n(F,{children:S(i.content).replace(/\\n/g,"\n")})})),(i.subsections||[]).map(function(e,n){return Et(e,"".concat(r,"-").concat(n),o+1)})]}))]}),r):n(d,e({sx:{mt:0===o?1:.75}},{children:!a&&t("div",{children:[c&&n(u,e({component:"div",sx:Ke},{children:n(F,{children:S(i.content).replace(/\\n/g,"\n")})})),(i.subsections||[]).map(function(e,n){return Et(e,"".concat(r,"-").concat(n),o+1)})]})}),r)};return t(d,e({ref:rn,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ue?{}:{overflow:"visible"}),{position:"relative"})},{children:[fe&&n(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n(H,{})})),ue&&n(A,{open:en.open,anchorEl:en.anchorEl,sectionTitle:en.sectionTitle,referenceSectionTitle:en.refSectionTitle,onClose:fn,onOpenCognitiveCompare:Pn,onOpenSideBySide:It,onConnect:qn,isConnected:Ft}),Qe.open&&n(k,{open:Qe.open,popupRef:Xe,position:Pe,popupConfig:oe,onClose:function(){qe(null),Ze(function(n){return e(e({},n),{open:!1})})},markdownStyles:te,sectionTitle:Qe.sectionTitle,referenceSectionTitle:Qe.refSectionTitle,cognitiveData:Qe.cognitiveData,anchorEl:Qe.anchorEl,sectionAnchorEl:Qe.sectionAnchorEl,scrollContainerEl:tn.current,badgeStyle:Qe.badgeStyle,docData:Qe.docData,deviationData:Qe.deviationData}),n(s,e({open:!!me,autoHideDuration:8e3,onClose:function(){return ye(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n(f,e({onClose:function(){return ye(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:me}))})),t(d,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[n(d,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:n(u,e({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:Q}))})),n(d,e({sx:{display:"flex",alignItems:"center"}},{children:n(v,{control:n(p,{checked:ue,onChange:function(e){var n=e.target.checked;ve(!0),setTimeout(function(){de(n),jn(),Be(new Set),Me([]),We.current=[],setTimeout(function(){ve(!1)},400)},50)},color:"primary",size:"small",sx:{width:100,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"3px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(75px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:"#1976d2",opacity:1,border:0,"&::before":{content:'"Relative Order"',position:"absolute",left:"7px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px"}}}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:20,height:20},"& .MuiSwitch-track":{borderRadius:13,backgroundColor:"#9e9e9e",opacity:1,position:"relative","&::after":{content:'"Default View"',position:"absolute",right:"13px",top:"50%",transform:"translateY(-50%)",fontSize:"9px",fontWeight:700,color:"#fff",letterSpacing:"0.3px",opacity:1,transition:"opacity 0.2s"}},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{"&::after":{opacity:0}}}}),label:"",labelPlacement:"start",sx:{m:0,gap:1}})}))]})),n(d,e({ref:tn,onScroll:wt,sx:{flex:1,minHeight:0,pt:1.5,pb:8,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ue?"hidden":"auto",borderTop:zn&&Wn?"none":"1.5px solid #EEF0F4"}},{children:n(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ue?{flex:1,minHeight:0}:{})},{children:t(d,e({ref:Xn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ue?{flex:1,overflow:"visible"}:{})},{children:[t("svg",e({ref:ke,style:{position:"absolute",top:0,left:0,width:Ue.width||"100%",height:Ue.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[it&&t("g",{children:[n("line",{x1:it.x1,y1:it.y,x2:Math.max(it.x1,(it.x1+it.x2)/2-70),y2:it.y,stroke:"#BBF7D0",strokeWidth:"1.5"}),n("line",{x1:Math.min(it.x2,(it.x1+it.x2)/2+70),y1:it.y,x2:it.x2,y2:it.y,stroke:"#BBF7D0",strokeWidth:"1.5"})]}),Qn.map(function(i){var r,o=(i.x1+i.x2)/2;if("Not Defined"===i.style.label&&!i.hasCognitive)return null;if(!ue)return t("g",{children:[n("line",{x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,stroke:i.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),n("foreignObject",e({x:o-100,y:i.y1-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(d,e({onClick:function(e){if(e.stopPropagation(),Qe.open&&Qe.sectionIdx===i.sectionIdx)sn();else{var n=Mn[i.sectionIdx]||{title:"",content:""},t=kn[i.sectionIdx]||{title:"",content:""};Yn(Nn(e.currentTarget,n,t,i.sectionIdx,i.style))}},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:i.style.badgeBg,color:i.style.badgeText,border:"1px solid ".concat(i.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:500,textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"}},{children:[i.style.label,n(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n(w,{})})),n(y,{size:11,style:{transform:Qe.open&&Qe.sectionIdx===i.sectionIdx?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},i.id);var l=Mn[i.sectionIdx];return!(null===(r=null==l?void 0:l.refIndexes)||void 0===r?void 0:r.length)||(null==l?void 0:l.selfIndex)<0?null:we&&et===i.sectionIdx&&Se?t("g",e({style:{transition:"opacity 0.2s"}},{children:[n("defs",{children:n("marker",e({id:"arr-".concat(i.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:n("polygon",{points:"0 0, 7 2.5, 0 5",fill:i.style.badgeBorder||"#6366F1"})}))}),n("line",{ref:Un,x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,stroke:i.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(i.id,")")})]}),i.id):null}),De.map(function(i){var r,o=i.pathD,l=(null===(r=i.style)||void 0===r?void 0:r.badgeBorder)||"#6366F1",c="conn-marker-".concat(i.id),a="".concat(i.id,"-bg"),u="".concat(i.id,"-stroke");return t("g",{children:[n("defs",{children:n("clipPath",e({id:"connections-clip"},{children:n("marker",e({id:c,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:n("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),n("path",{ref:function(e){ze.current[a]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n("path",{ref:function(e){ze.current[u]=e},d:o,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(c,")")})]},i.id)})]})),t(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ue?{flex:1,overflow:"visible"}:{})},{children:[n(d,e({ref:Jn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"40px",alignItems:"center",overflowX:"hidden"}},{children:n(h,e({title:_n,placement:"top"},{children:n(u,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:_n}))}))})),n(d,e({ref:an,onScroll:wt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ue?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:An&&Mn.map(function(r,o){var l;if(!ue)return n(d,e({ref:On(o)},{children:St(r,o,"left",at.current[o])}),"left-row-".concat(o));var c=r,a=ht(o),u=!(null===(l=c.refIndexes)||void 0===l?void 0:l.length)||c.selfIndex<0,s="number"==typeof c.selfIndex&&c.selfIndex>=0?c.selfIndex+1:null,f=Te.has(o);return n(d,e({ref:On(o),sx:{mb:1}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[n(d,e({ref:at.current[o],sx:e({width:"100%"},f&&{borderRadius:"6px",outline:"2px solid ".concat((null==a?void 0:a.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:St(r,o,"left",i.createRef(),0)})),a&&t(d,e({ref:dt.current[o],onClick:function(e){var n=kn.find(function(e){var n;return null===(n=c.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""};!function(e,n,t,i,r){e.stopPropagation(),en.open&&en.sectionIdx===i?fn():(sn(),nn(Nn(e.currentTarget,n,t,i,r)))}(e,r,n,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==s&&n(d,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:s})),n(d,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:u?"No Deviation Found":0==a.deviationLabel||void 0===a.deviationLabel?"Same":"".concat(a.deviationLabel,"% Deviation")})),n(b,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))})}))]})),n(d,e({sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0}},{children:n(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(d,e({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",borderRadius:"20px",bgcolor:"#ECFDF3",border:"1px solid #A7F3D0",color:"#15803D",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1}},{children:[n(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n(w,{})})),0,"% Similarity",n(y,{size:11})]}))}))})),t(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ue?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[he&&n(I,{sections:11}),n(d,e({ref:Kn,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n(h,e({title:Dn,placement:"top"},{children:n(u,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",height:"40px"}},{children:Dn}))}))})),t(d,e({ref:on,onScroll:wt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ue?{maxHeight:"500px",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-160px",pl:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n("div",{ref:ln,style:{width:"100%",height:"0px",flexShrink:0}}),An&&kn.map(function(r,o){if(!ue)return St(r,o,"right",ut.current[o]);var l=r,c=Mn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),a=Mn.some(function(e,n){var t;return Te.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))}),u=Mn.findIndex(function(e,n){var t;return Te.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))}),s=-1!==u?ht(u):null;return n(d,e({ref:ft.current[o],sx:{mb:1}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[n(d,e({ref:ut.current[o],sx:e({width:"100%"},a&&s&&{borderRadius:"6px",outline:"2px solid ".concat(s.badgeBorder),outlineOffset:"1px"})},{children:St(r,o,"right",i.createRef(),0)})),!he&&n(d,e({ref:st.current[o],sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:"#EEF2FF",color:"#3730A3",border:"1px solid #C7D2FE",borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:c.length>0?c.join(", "):"-"}))]}))}),"right-row-".concat(o))}),n("div",{ref:cn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{N as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as i,Fragment as n,jsx as t}from"react/jsx-runtime";import{useMemo as e,useState as r,useEffect as l}from"react";import{Box as a,Typography as s,IconButton as c}from"@mui/material";import{X as d}from"lucide-react";import p from"react-dom";import v from"../../assests/svg/SparkleIcon.js";import{SHARED_MARKDOWN_STYLES as x,DEFAULT_POPUP_CONFIG as h}from"./CognitiveCompareConfig.js";import u from"./CitationRenderer.js";var b=10,g=function(g){var f,m,w,y,F,k,S,C,D,E,_,R,z,W,I,T,j,A,B,L,H,M=g.open,O=g.onClose,G=g.sectionTitle,N=g.referenceSectionTitle,P=g.cognitiveData,Y=g.relevanceScore,q=g.anchorEl,J=g.badgeStyle,K=g.popupRef,Q=g.position,U=g.markdownStyles,V=g.docData,X=g.popupConfig,Z=g.deviationData,$=o(o({},x),U),oo=e(function(){var i,n;return o(o(o({},h),X),{tabs:{deviation:o(o({},h.tabs.deviation),null===(i=null==X?void 0:X.tabs)||void 0===i?void 0:i.deviation),association:o(o({},h.tabs.association),null===(n=null==X?void 0:X.tabs)||void 0===n?void 0:n.association)},sectionTitles:o(o({},h.sectionTitles),null==X?void 0:X.sectionTitles)})},[X]),io=null==P?void 0:P.isMissingRationale,no=r(io?oo.tabs.deviation.key:oo.tabs.association.key),to=no[0],eo=no[1];l(function(){M&&eo(io?oo.tabs.deviation.key:oo.tabs.association.key)},[M,io,oo.tabs.deviation.key,oo.tabs.association.key]);var ro=e(function(){if(!J)return{border:oo.accentColor,shadow:"".concat(oo.accentColor,"2E")};var o=J.badgeText;return"#9F1239"===o||"#B42318"===o?{border:"#E11D48",shadow:"rgba(225,29,72,0.15)"}:"#1D4ED8"===o?{border:"#3B82F6",shadow:"rgba(59,130,246,0.15)"}:"#A16207"===o?{border:"#F59E0B",shadow:"rgba(245,158,11,0.15)"}:{border:oo.accentColor,shadow:"".concat(oo.accentColor,"2E")}},[J,oo.accentColor]);if(l(function(){if(M){var o=function(o){var i;(null===(i=K.current)||void 0===i?void 0:i.contains(o.target))||(null==q?void 0:q.contains(o.target))||O()};return document.addEventListener("mousedown",o),function(){return document.removeEventListener("mousedown",o)}}},[M,O,q,K]),!M||!P)return null;var lo=null!==(m=null!==(f=P.relevance_score)&&void 0!==f?f:Y)&&void 0!==m?m:0,ao=P.decisioning,so=Array.isArray(ao)?ao:"string"==typeof ao&&ao.trim()?[ao]:[],co=P.gap,po=Array.isArray(co)?co:"string"==typeof co&&co.trim()?[co]:[],vo=null!==(w=null==Q?void 0:Q.arrowLeft)&&void 0!==w?w:60,xo=i(a,o({ref:K,sx:{position:"fixed",top:null!==(y=null==Q?void 0:Q.top)&&void 0!==y?y:-9999,left:null!==(F=null==Q?void 0:Q.left)&&void 0!==F?F:-9999,zIndex:9999,width:"100%",maxWidth:"min(".concat(880,"px, calc(100vw - ").concat(null!==(k=null==Q?void 0:Q.left)&&void 0!==k?k:0,"px - ").concat(12,"px))"),bgcolor:"#FFFFFF",borderRadius:"14px",border:"1.5px solid ".concat(ro.border),boxShadow:"0px 8px 32px ".concat(ro.shadow,", 0px 0px 0px 3px ").concat(ro.shadow),overflow:"visible",display:"flex",flexDirection:"column",maxHeight:(null==Q?void 0:Q.maxHeight)?"min(60vh, ".concat(Q.maxHeight,"px)"):"60vh",visibility:Q?"visible":"hidden"}},{children:[Q&&(Q.openAbove?i(n,{children:[t(a,{sx:{position:"absolute",bottom:-11,left:vo-b,width:0,height:0,borderLeft:"".concat(b,"px solid transparent"),borderRight:"".concat(b,"px solid transparent"),borderTop:"".concat(11,"px solid ").concat(ro.border),zIndex:1}}),t(a,{sx:{position:"absolute",bottom:-9,left:vo-b+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderTop:"".concat(b,"px solid #FFFFFF"),zIndex:2}})]}):i(n,{children:[t(a,{sx:{position:"absolute",top:-11,left:vo-b,width:0,height:0,borderLeft:"".concat(b,"px solid transparent"),borderRight:"".concat(b,"px solid transparent"),borderBottom:"".concat(11,"px solid ").concat(ro.border),zIndex:1}}),t(a,{sx:{position:"absolute",top:-9,left:vo-b+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderBottom:"".concat(b,"px solid #FFFFFF"),zIndex:2}})]})),i(a,o({sx:{px:2.5,pt:2,pb:1.5,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2,flexShrink:0}},{children:[i(a,o({sx:{flex:1,minWidth:0}},{children:[i(s,o({sx:{fontSize:"16px",fontWeight:600,color:"#101828",lineHeight:1.3,display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap",overflow:"hidden",width:"100%"}},{children:[t(a,o({component:"span",title:G,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"0 1 auto",maxWidth:"calc(50% - 16px)",minWidth:0}},{children:G})),t(a,o({component:"span",sx:{color:"#667085",fontWeight:400,flexShrink:0,mx:.5}},{children:"↔"})),t(a,o({component:"span",title:N||"Reference Section",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0}},{children:N||"Reference Section"}))]})),t(a,o({sx:{mt:.75,display:"inline-flex",alignItems:"center",gap:.75}},{children:t(s,o({sx:{fontSize:"13px",fontWeight:400,color:"#5928ED",lineHeight:1}},{children:null===(S=Object.values(oo.tabs).find(function(o){return o.key===to}))||void 0===S?void 0:S.subtitle}))}))]})),i(a,o({sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0}},{children:[i(a,o({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:.5,borderRadius:"20px",bgcolor:"#FFFFFF",border:"1px solid #5928ED",fontSize:"12px",fontWeight:600,color:"#5928ED"}},{children:[t(v,{}),oo.decisionStrengthLabel," ",lo,"%"]})),t(c,o({onClick:O,size:"small",sx:{color:"#667085",width:24,height:24,"&:hover":{bgcolor:"transparent",color:"#101828"}}},{children:t(d,{size:22})}))]}))]})),t(a,o({sx:{display:"flex",borderBottom:"1px solid #E4E7EC",px:2.5,flexShrink:0}},{children:(io?[oo.tabs.deviation]:[oo.tabs.deviation,oo.tabs.association]).map(function(i){var n=to===i.key;return t(a,o({onClick:function(){return eo(i.key)},sx:{pb:"10px",pt:"4px",mr:3,px:2,cursor:"pointer",fontSize:"14px",fontWeight:n?600:400,color:n?oo.accentColor:"#667085",backgroundColor:n?"".concat(oo.accentColor,"14"):"transparent",borderBottom:n?"2px solid ".concat(oo.accentColor):"2px solid transparent",transition:"all 0.15s",userSelect:"none"}},{children:i.label}),i.key)})})),t(a,o({sx:{flex:1,minHeight:0,overflowY:"auto",px:2.5,py:2,display:"flex",flexDirection:"column",gap:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"".concat(ro.border,"55"),borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:ro.border},scrollbarWidth:"thin",scrollbarColor:"".concat(ro.border,"55 transparent")}},{children:to===oo.tabs.deviation.key?Z?i(n,{children:[(null===(D=(null===(C=null==Z?void 0:Z.cognitive_decisioning)||void 0===C?void 0:C.decisioning_factors)||[])||void 0===D?void 0:D.length)>0&&t(u,{title:"Decision Making Factors",content:null===(_=null===(E=null==Z?void 0:Z.cognitive_decisioning)||void 0===E?void 0:E.decisioning_factors)||void 0===_?void 0:_.join("\n\n"),citations:null===(R=null==Z?void 0:Z.cognitive_decisioning)||void 0===R?void 0:R.citations,styles:$,docData:V,open:M}),(null===(W=(null===(z=null==Z?void 0:Z.cognitive_decisioning)||void 0===z?void 0:z.gaps_in_decision)||[])||void 0===W?void 0:W.length)>0&&t(u,{title:"Gaps in Decision",content:null===(T=null===(I=null==Z?void 0:Z.cognitive_decisioning)||void 0===I?void 0:I.gaps_in_decision)||void 0===T?void 0:T.join("\n\n"),citations:null===(j=null==Z?void 0:Z.cognitive_decisioning)||void 0===j?void 0:j.citations,styles:$,docData:V,open:M}),0===(null===(B=(null===(A=null==Z?void 0:Z.cognitive_decisioning)||void 0===A?void 0:A.decisioning_factors)||[])||void 0===B?void 0:B.length)&&0===(null===(H=(null===(L=null==Z?void 0:Z.cognitive_decisioning)||void 0===L?void 0:L.gaps_in_decision)||[])||void 0===H?void 0:H.length)&&t(a,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:t(s,o({sx:{fontSize:"13px",color:"#64748B"}},{children:"No cognitive decisioning data available for this section."}))}))]}):t(u,{title:"Deviation Analysis",content:"Deviation analysis content will appear here. This tab shows\n structural and semantic deviations identified between the two\n sections being compared.",citations:{},styles:$,docData:V,open:M}):i(n,{children:[so.length>0&&t(u,{title:oo.sectionTitles.decisioningFactors,content:so.join("\n\n"),citations:P.citations,styles:$,open:M,docData:V}),po.length>0&&t(u,{title:oo.sectionTitles.gaps,content:po.join("\n\n"),citations:P.citations,styles:$,open:M,docData:V}),0===so.length&&0===po.length&&t(a,o({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:t(s,o({sx:{fontSize:"13px",color:"#64748B"}},{children:oo.emptyStateMessage}))}))]})}))]}));return p.createPortal(xo,document.body)};export{g as default};
|
|
2
2
|
//# sourceMappingURL=CognitivePopup.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as a}from"react/jsx-runtime";import{Box as i,Typography as n}from"@mui/material";var r=function(){return t(i,e({sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center","@keyframes bounce":{"0%":{transform:"translateY(0) scale(1)",opacity:.6},"100%":{transform:"translateY(-12px) scale(1.15)",opacity:1}},"@keyframes glowPulse":{"0%, 100%":{textShadow:"0 0 6px rgba(89,40,237,0.2)"},"50%":{textShadow:"0 0 14px rgba(89,40,237,0.45)"}}}},{children:[a(n,e({sx:{mb:2,fontSize:"20px",fontWeight:600,fontFamily:"sans-serif",color:"#5928ED",letterSpacing:"0.8px",animation:"glowPulse 2s ease-in-out infinite"}},{children:"Switching views..."})),a(i,e({sx:{display:"flex",gap:"8px"}},{children:[0,1,2].map(function(e){return a(i,{sx:{width:"12px",height:"12px",borderRadius:"50%",background:"linear-gradient(145deg, #7c5cff, #5928ED)",boxShadow:"0 4px 12px rgba(89,40,237,0.5), 0 0 8px rgba(89,40,237,0.3)",animation:"bounce 0.6s infinite alternate",animationDelay:"".concat(.15*e,"s")}},e)})}))]}))};export{r as default};
|
|
2
|
+
//# sourceMappingURL=LoaderComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import{Menu as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import{Menu as t,MenuItem as o,Box as r,Typography as l}from"@mui/material";import{ButtonCognitiveIcon as C}from"../../assests/svg/ButtonCognitiveIcon.js";var s=function(){return i("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{d:"M2 6.5L5 9.5L11 3.5",stroke:"#15803D",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}))},c=[{key:"connect",title:"Connect",icon:i("svg",e({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{d:"M14.8237 3.89331C14.547 5.57188 13.0559 6.77501 11.3572 6.69242C9.65857 6.60983 8.2925 5.26384 8.18312 3.56742C4.75678 3.67456 3.54027 4.4759 3.73893 6.10536C3.81259 6.71474 4.18089 7.04063 4.85723 7.19911C5.26794 7.2951 5.7233 7.30849 6.13625 7.27054C6.17419 7.26608 6.21437 7.26385 6.25232 7.25938C6.50455 7.19911 6.76125 7.14777 7.01794 7.1076C7.77911 6.9826 8.55366 6.9201 9.29027 6.96027C11.3617 7.07188 12.7724 7.98483 12.8438 9.92233C12.913 11.7996 11.6229 13.1299 9.5425 14.0205C8.87509 14.3063 8.1675 14.5272 7.45991 14.6946C7.14071 14.7705 6.87286 14.8219 6.67419 14.8554C6.49786 16.5496 5.07821 17.842 3.37509 17.8554C1.67196 17.8688 0.229997 16.6031 0.0246403 14.9112C-0.180717 13.2192 0.917498 11.6455 2.57375 11.2527C4.23 10.8598 5.91973 11.7728 6.49562 13.3755C6.70544 13.3375 6.91303 13.2951 7.12062 13.246C7.75009 13.0987 8.37955 12.9022 8.95991 12.6522C10.538 11.9781 11.3996 11.0875 11.3595 9.9759C11.3237 8.98036 10.6095 8.52054 9.21214 8.44465C8.5983 8.41117 7.92643 8.46474 7.26348 8.57411C7.07821 8.60536 6.90857 8.63661 6.75902 8.6701C6.67196 8.68795 6.61169 8.70358 6.58491 8.71027L6.51571 8.72367C6.4666 8.73036 6.38402 8.74152 6.27687 8.75268C5.71884 8.80402 5.11393 8.78617 4.52464 8.65001C3.2925 8.36206 2.42866 7.59643 2.26794 6.2884C1.9175 3.47143 4.02241 2.16563 8.42866 2.07188C9.07821 0.500452 10.8037 -0.336602 12.4376 0.129916C14.0737 0.596434 15.1005 2.21474 14.8237 3.89331V3.89331ZM3.34161 12.6478C3.09741 12.6478 2.85562 12.6959 2.63002 12.7894C2.40442 12.8828 2.19944 13.0198 2.02678 13.1925C1.85412 13.3652 1.71717 13.5702 1.62373 13.7958C1.5303 14.0214 1.48222 14.2632 1.48223 14.5074C1.48224 14.7516 1.53036 14.9934 1.62382 15.219C1.71728 15.4446 1.85426 15.6495 2.02694 15.8222C2.19962 15.9949 2.40462 16.1318 2.63022 16.2252C2.85583 16.3187 3.09764 16.3668 3.34183 16.3667C3.83499 16.3667 4.30795 16.1708 4.65665 15.822C5.00535 15.4733 5.20123 15.0003 5.2012 14.5071C5.20117 14.014 5.00524 13.541 4.65649 13.1923C4.30775 12.8436 3.83477 12.6477 3.34161 12.6478ZM11.5224 1.49152C11.2782 1.49154 11.0364 1.53965 10.8108 1.63311C10.5852 1.72657 10.3802 1.86355 10.2076 2.03623C10.0349 2.20891 9.89797 2.41391 9.80454 2.63952C9.7111 2.86513 9.66302 3.10693 9.66303 3.35112C9.66305 3.59531 9.71116 3.83711 9.80462 4.06271C9.89808 4.28831 10.0351 4.49329 10.2077 4.66594C10.3804 4.8386 10.5854 4.97556 10.811 5.06899C11.0366 5.16243 11.2784 5.21051 11.5226 5.2105C12.0158 5.21047 12.4888 5.01453 12.8375 4.66579C13.1862 4.31704 13.382 3.84406 13.382 3.3509C13.382 2.85773 13.186 2.38478 12.8373 2.03608C12.4886 1.68738 12.0156 1.49149 11.5224 1.49152V1.49152Z",fill:"#1D2939",fillOpacity:"0.85"})}))},{key:"side-by-side",title:"Side by Side",icon:i("svg",e({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{d:"M3.19922 8.19922H13.1992M3.19922 8.19922L4.86589 10.6992M3.19922 8.19922L4.86589 5.69922M13.1992 8.19922L11.5326 10.6992M13.1992 8.19922L11.5326 5.69922M15.6992 0.699219V15.6992M0.699219 0.699219V15.6992",stroke:"#3F4957",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}))},{key:"cognitive-decisioning",title:"Cognitive Decisioning",icon:i(C,{})}],d=function(C){var d=C.open,a=C.anchorEl;C.sectionTitle,C.referenceSectionTitle;var h=C.onClose,p=C.onOpenCognitiveCompare,g=C.onOpenSideBySide,x=C.onConnect,f=C.isConnected,m=void 0!==f&&f;return i(t,e({open:d,anchorEl:a,onClose:h,disableScrollLock:!0,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},PaperProps:{sx:{ml:.75,minWidth:190,maxWidth:220,borderRadius:"12px",border:"1px solid #E4E7EC",boxShadow:"0px 12px 28px rgba(16, 24, 40, 0.12)",overflow:"hidden"}},MenuListProps:{sx:{p:.5,bgcolor:"#FFFFFF"}}},{children:c.map(function(t){var C="connect"===t.key,c=C&&m;return n(o,e({onClick:function(){var e;"connect"!==(e=t.key)?"side-by-side"!==e?p():g():x()},sx:{px:1.25,py:1,minHeight:40,borderRadius:"10px",display:"flex",alignItems:"center",gap:1,bgcolor:c?"#F0FDF4":"transparent","&:hover":{bgcolor:c?"#DCFCE7":"#F9FAFB"}}},{children:[i(r,e({sx:e({width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& svg":{display:"block"}},c&&{"& svg path":{fill:"#15803D",fillOpacity:1}})},{children:t.icon})),i(r,e({sx:{minWidth:0,display:"flex",alignItems:"center",flex:1}},{children:i(l,e({sx:{fontSize:"12px",fontWeight:500,color:c?"#15803D":"#101828",lineHeight:1.2,whiteSpace:"nowrap"}},{children:C?m?"Disconnect":"Connect":t.title}))})),c&&i(r,e({sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:"auto"}},{children:i(s,{})}))]}),t.key)})}))};export{d as default};
|
|
2
2
|
//# sourceMappingURL=MoreFunctionsPopup.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as r}from"tslib";import{jsxs as t,jsx as a}from"react/jsx-runtime";import{Box as e,Skeleton as n,Typography as i}from"@mui/material";var o=function(o){var s=o.sections,l=void 0===s?8:s;return t(e,r({sx:{position:"absolute",inset:0,zIndex:50,backdropFilter:"blur(6px)",backgroundColor:"rgba(255,255,255,0.7)",borderRadius:"8px",overflow:"hidden"}},{children:[a(e,r({sx:{p:2,display:"flex",flexDirection:"column",gap:2,willChange:"transform",animation:"wander 20s ease-in-out infinite alternate","@keyframes wander":{"0%":{transform:"translate3d(0, 0px, 0)"},"20%":{transform:"translate3d(0, -15%, 0)"},"40%":{transform:"translate3d(0, -5%, 0)"},"60%":{transform:"translate3d(0, -30%, 0)"},"80%":{transform:"translate3d(0, -10%, 0)"},"100%":{transform:"translate3d(0, -40%, 0)"}}}},{children:Array.from({length:l}).map(function(i,o){return t(e,r({sx:{border:"1px solid #E3E6EA",borderRadius:"6px",p:1.5,bgcolor:"#fff",opacity:.6}},{children:[a(n,{variant:"text",width:"40%",height:24}),a(n,{variant:"text",width:"80%"}),a(n,{variant:"text",width:"70%"}),a(n,{variant:"rectangular",height:40,sx:{mt:1}})]}),o)})})),t(e,r({sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"#FFFFFF",p:3,borderRadius:"8px",boxShadow:"0px 8px 24px rgba(0, 0, 0, 0.12)",textAlign:"center",width:"80%",maxWidth:"340px",zIndex:10}},{children:[a(i,r({sx:{fontWeight:600,fontSize:"16px",color:"#0F172A",mb:1}},{children:"Aligning sections..."})),a(i,r({sx:{fontSize:"13px",color:"#64748B",lineHeight:1.5}},{children:"Placing corresponding clauses side by side for comparison."}))]}))]}))};export{o as default};
|
|
2
|
+
//# sourceMappingURL=OverlayComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,oBAAoB,+
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,oBAAoB,+CAgBzB,CAAA;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -3,4 +3,180 @@ export declare const BIGTEXT: ButtonVariant;
|
|
|
3
3
|
export declare const SMALLTEXT: ButtonVariant;
|
|
4
4
|
export declare const RESOURCE_TABLE_SCENARIO_VALUE = "resourcesOfSelectedDataSetCollection";
|
|
5
5
|
export declare const DEFAULT_TREE_DATA: any;
|
|
6
|
+
export declare const DEVIATION_DATA: {
|
|
7
|
+
"1d10f1fa-7ed5-45ba-8870-54f512f7617c": {
|
|
8
|
+
evaluation_result: {
|
|
9
|
+
deviation_title: string;
|
|
10
|
+
deviation_explanation: string[];
|
|
11
|
+
evaluation_outputs: {
|
|
12
|
+
name: string;
|
|
13
|
+
output_value: string;
|
|
14
|
+
};
|
|
15
|
+
cognitive_decisioning: {
|
|
16
|
+
decisioning_factors: string[];
|
|
17
|
+
gaps_in_decision: string[];
|
|
18
|
+
citations: {
|
|
19
|
+
"1": {
|
|
20
|
+
"base-contract-uuid-a": {
|
|
21
|
+
highlighted_text: string;
|
|
22
|
+
custom_metadata: {
|
|
23
|
+
pdf_start_page_number: string;
|
|
24
|
+
pdf_end_page_number: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
"reference-contract-uuid-b": {
|
|
28
|
+
highlighted_text: string;
|
|
29
|
+
custom_metadata: {
|
|
30
|
+
pdf_start_page_number: string;
|
|
31
|
+
pdf_end_page_number: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
"2": {
|
|
36
|
+
"base-contract-uuid-a": {
|
|
37
|
+
highlighted_text: string;
|
|
38
|
+
custom_metadata: {
|
|
39
|
+
pdf_start_page_number: string;
|
|
40
|
+
pdf_end_page_number: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
"reference-contract-uuid-b": {
|
|
44
|
+
highlighted_text: string;
|
|
45
|
+
custom_metadata: {
|
|
46
|
+
pdf_start_page_number: string;
|
|
47
|
+
pdf_end_page_number: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
deviations: {
|
|
54
|
+
"0": {
|
|
55
|
+
entity_1: string;
|
|
56
|
+
entity_2: string;
|
|
57
|
+
};
|
|
58
|
+
"1": {
|
|
59
|
+
entity_1: string;
|
|
60
|
+
entity_2: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
"7151a1a1-535c-4994-8fb1-240b8732ce9d": {
|
|
66
|
+
evaluation_result: {
|
|
67
|
+
deviation_title: string;
|
|
68
|
+
deviation_explanation: string[];
|
|
69
|
+
evaluation_outputs: {
|
|
70
|
+
name: string;
|
|
71
|
+
output_value: string;
|
|
72
|
+
};
|
|
73
|
+
cognitive_decisioning: {
|
|
74
|
+
decisioning_factors: string[];
|
|
75
|
+
gaps_in_decision: string[];
|
|
76
|
+
citations: {
|
|
77
|
+
"1": {
|
|
78
|
+
"base-contract-uuid-a": {
|
|
79
|
+
highlighted_text: string;
|
|
80
|
+
custom_metadata: {
|
|
81
|
+
pdf_start_page_number: string;
|
|
82
|
+
pdf_end_page_number: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
"reference-contract-uuid-b": {
|
|
86
|
+
highlighted_text: string;
|
|
87
|
+
custom_metadata: {
|
|
88
|
+
pdf_start_page_number: string;
|
|
89
|
+
pdf_end_page_number: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
"2": {
|
|
94
|
+
"base-contract-uuid-a": {
|
|
95
|
+
highlighted_text: string;
|
|
96
|
+
custom_metadata: {
|
|
97
|
+
pdf_start_page_number: string;
|
|
98
|
+
pdf_end_page_number: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
"reference-contract-uuid-b": {
|
|
102
|
+
highlighted_text: string;
|
|
103
|
+
custom_metadata: {
|
|
104
|
+
pdf_start_page_number: string;
|
|
105
|
+
pdf_end_page_number: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
deviations: {
|
|
112
|
+
"0": {
|
|
113
|
+
entity_1: string;
|
|
114
|
+
entity_2: string;
|
|
115
|
+
};
|
|
116
|
+
"1": {
|
|
117
|
+
entity_1: string;
|
|
118
|
+
entity_2: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
"cead49a1-02f3-44e2-b7e5-1b6be88a35cf": {
|
|
124
|
+
evaluation_result: {
|
|
125
|
+
deviation_title: string;
|
|
126
|
+
deviation_explanation: string[];
|
|
127
|
+
evaluation_outputs: {
|
|
128
|
+
name: string;
|
|
129
|
+
output_value: string;
|
|
130
|
+
};
|
|
131
|
+
cognitive_decisioning: {
|
|
132
|
+
decisioning_factors: string[];
|
|
133
|
+
gaps_in_decision: string[];
|
|
134
|
+
citations: {
|
|
135
|
+
"1": {
|
|
136
|
+
"base-contract-uuid-a": {
|
|
137
|
+
highlighted_text: string;
|
|
138
|
+
custom_metadata: {
|
|
139
|
+
pdf_start_page_number: string;
|
|
140
|
+
pdf_end_page_number: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
"reference-contract-uuid-b": {
|
|
144
|
+
highlighted_text: string;
|
|
145
|
+
custom_metadata: {
|
|
146
|
+
pdf_start_page_number: string;
|
|
147
|
+
pdf_end_page_number: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
"2": {
|
|
152
|
+
"base-contract-uuid-a": {
|
|
153
|
+
highlighted_text: string;
|
|
154
|
+
custom_metadata: {
|
|
155
|
+
pdf_start_page_number: string;
|
|
156
|
+
pdf_end_page_number: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
"reference-contract-uuid-b": {
|
|
160
|
+
highlighted_text: string;
|
|
161
|
+
custom_metadata: {
|
|
162
|
+
pdf_start_page_number: string;
|
|
163
|
+
pdf_end_page_number: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
deviations: {
|
|
170
|
+
"0": {
|
|
171
|
+
entity_1: string;
|
|
172
|
+
entity_2: string;
|
|
173
|
+
};
|
|
174
|
+
"1": {
|
|
175
|
+
entity_1: string;
|
|
176
|
+
entity_2: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
6
182
|
//# sourceMappingURL=CommonConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA;AAEnF,eAAO,MAAM,iBAAiB,EAAE,GAswN/B,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiM1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAIf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAIf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8MjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
title?: string;
|
|
3
|
+
content?: string;
|
|
4
|
+
citations?: Record<string, any>;
|
|
5
|
+
styles?: Record<string, any>;
|
|
6
|
+
docData?: Record<string, any> | null;
|
|
7
|
+
open: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function CitationRenderer({ content, title, citations, styles, docData, open }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default CitationRenderer;
|
|
11
|
+
//# sourceMappingURL=CitationRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationRenderer.tsx"],"names":[],"mappings":"AAKA,KAAK,KAAK,GAAG;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACrC,IAAI,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,iBAAS,gBAAgB,CAAC,EACtB,OAAY,EACZ,KAAU,EACV,SAAc,EACd,MAAW,EACX,OAAY,EACZ,IAAI,EACP,EAAE,KAAK,2CA2DP;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CognitiveCompareProps } from "./CognitiveCompareTypes";
|
|
2
2
|
import { SHARED_MARKDOWN_STYLES } from "./CognitiveCompareConfig";
|
|
3
|
-
declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, maintainRelativeOrder: initialMaintainRelativeOrder, popupConfig, }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, maintainRelativeOrder: initialMaintainRelativeOrder, popupConfig, deviationData, }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { SHARED_MARKDOWN_STYLES };
|
|
5
5
|
export default CognitiveCompare;
|
|
6
6
|
//# sourceMappingURL=CognitiveCompare.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAIL,qBAAqB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAyTlC,QAAA,MAAM,gBAAgB,qMAUnB,qBAAqB,4CAk6EvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
|
|
@@ -21,6 +21,17 @@ export interface ComparisonAnalysis {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
+
export interface DeviationDataEntry {
|
|
25
|
+
deviation_title?: string;
|
|
26
|
+
deviation_explanation?: string[];
|
|
27
|
+
evaluation_outputs?: Record<string, string>;
|
|
28
|
+
cognitive_decisioning?: {
|
|
29
|
+
decisioning_factors?: string[];
|
|
30
|
+
gaps_in_decision?: string[];
|
|
31
|
+
citations?: Record<string, any>;
|
|
32
|
+
};
|
|
33
|
+
deviations?: Record<string, any>;
|
|
34
|
+
}
|
|
24
35
|
export interface CognitiveDecisioningEntry {
|
|
25
36
|
section_id: string;
|
|
26
37
|
decisioning?: string | string[];
|
|
@@ -29,7 +40,7 @@ export interface CognitiveDecisioningEntry {
|
|
|
29
40
|
metadata?: unknown;
|
|
30
41
|
decisioning_metadata?: unknown;
|
|
31
42
|
gap_metadata?: unknown;
|
|
32
|
-
citations?:
|
|
43
|
+
citations?: Record<string, any>;
|
|
33
44
|
}
|
|
34
45
|
export interface RuleData {
|
|
35
46
|
id: string;
|
|
@@ -78,6 +89,7 @@ export interface CognitiveCompareProps {
|
|
|
78
89
|
markdownStyles?: React.CSSProperties & Record<string, any>;
|
|
79
90
|
maintainRelativeOrder?: boolean;
|
|
80
91
|
popupConfig?: CognitivePopupConfig;
|
|
92
|
+
deviationData?: Record<string, any>;
|
|
81
93
|
}
|
|
82
94
|
export type StyleVariant = {
|
|
83
95
|
bg: string;
|
|
@@ -133,6 +145,7 @@ export interface CognitivePopupProps {
|
|
|
133
145
|
position: PopupPosition | null;
|
|
134
146
|
markdownStyles?: React.CSSProperties & Record<string, any>;
|
|
135
147
|
docData?: Record<string, any> | null;
|
|
148
|
+
deviationData?: DeviationDataEntry | null;
|
|
136
149
|
}
|
|
137
150
|
export type SectionBlock = {
|
|
138
151
|
id?: string;
|
|
@@ -145,6 +158,7 @@ export type SectionBlock = {
|
|
|
145
158
|
cognitiveData?: CognitiveDecisioningEntry;
|
|
146
159
|
selfIndex?: number;
|
|
147
160
|
refIndexes?: number[];
|
|
161
|
+
evaluationResult?: DeviationDataEntry;
|
|
148
162
|
};
|
|
149
163
|
export type SectionPopupState = {
|
|
150
164
|
open: boolean;
|
|
@@ -156,6 +170,7 @@ export type SectionPopupState = {
|
|
|
156
170
|
badgeStyle: StyleVariant | null;
|
|
157
171
|
sectionIdx: number | null;
|
|
158
172
|
docData: Record<string, any> | null;
|
|
173
|
+
deviationData?: DeviationDataEntry | null;
|
|
159
174
|
};
|
|
160
175
|
export type Row = {
|
|
161
176
|
left?: SectionBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,0BAA0B,EAAE;QAC1B,OAAO,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GACV,uBAAuB,GACvB;gBAAE,KAAK,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;aAAE,CAAC;SAC1D,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,0BAA0B,EAAE;QAC1B,OAAO,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GACV,uBAAuB,GACvB;gBAAE,KAAK,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;aAAE,CAAC;SAC1D,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,qBAAqB,CAAC,EAAE;QACtB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC,CAAA;IACD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE;QACT,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;QAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,aAAa,CAAC,EAAE,yBAAyB,CAAC;KAC3C,EAAE,CAAC;CACL;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3D,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,cAAc,EAAE;QACd,SAAS,EAAE,kBAAkB,CAAC;QAC9B,IAAI,EAAE,kBAAkB,CAAC;QACzB,KAAK,EAAE,kBAAkB,CAAC;QAC1B,MAAM,EAAE,kBAAkB,CAAC;QAC3B,GAAG,EAAE,kBAAkB,CAAC;KACzB,CAAC;CACH,CAAC;AAGF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,iBAAiB,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;CACvC,CAAC;AAEJ,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAChD,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG;IAChB,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB,CAAA;AAID,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE;YACV,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE;QACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitivePopup.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitivePopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAO5D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CognitivePopup.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitivePopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAO5D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAUjC,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAC5B,mBAAmB,GAAG;IAAE,WAAW,CAAC,EAAE,oBAAoB,CAAA;CAAE,CAmd7D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderComponent.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/LoaderComponent.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,kBAAkB,+CA8DvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -7,6 +7,8 @@ type MoreFunctionsPopupProps = {
|
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
onOpenCognitiveCompare: () => void;
|
|
9
9
|
onOpenSideBySide: () => void;
|
|
10
|
+
onConnect: () => void;
|
|
11
|
+
isConnected?: boolean;
|
|
10
12
|
};
|
|
11
13
|
declare const MoreFunctionsPopup: React.FC<MoreFunctionsPopupProps>;
|
|
12
14
|
export default MoreFunctionsPopup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreFunctionsPopup.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/MoreFunctionsPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,uBAAuB,GAAG;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,gBAAgB,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"MoreFunctionsPopup.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/MoreFunctionsPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,uBAAuB,GAAG;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAkCF,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA8HzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayComponent.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/OverlayComponent.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,aAAa;;6CAwFlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|