@viswa-test/test-citation 0.0.239 → 0.0.240

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),i=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("./ScrollLockToggle.js"),d=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(o),p=u.default.memo(function(o){var c,p,x,g=o.section,f=o.idx,v=s.useCompareContext(),h=v.maintainRelativeOrder;v.existingSections;var m=v.proposedSections,b=v.connectedSections,S=v.expandedSections,B=v.displayConfig,j=v.treeData;v.deviationNumberRegistry;var _=v.getSectionCompareStyle;v.getBadgeRef;var y=v.getSectionRowRef,R=v.sectionRightRefs,I=v.rhsBadgeRefs,w=v.openMoreFunctionsPopup,C=v.handleOpenSummaryPopup,N=v.handleCloseSummaryPopup,k=v.toggleSection;v.showDeviationBadges,v.renderSubSectionAccordion,v.isProposingFix,v.proposingFixNodeId,v.isRedlineFlow;var q=v.isSideBySide,T=v.activeSideBySideSection,P=v.scrollSyncLocked,D=v.toggleScrollSyncLocked,z=v.summaryPopupAnchorEl;v.deviationNodeIdToView,v.deviationTargetParentId;var F=v.showDeviationNavigation;v.showOpenNodeRef,v.resolvedMarkdownStyles;var L=v.unifiedNumbering,M=g,O=!1,A=null,E=-1;if(h){E=m.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(M.selfIndex))&&e.selfIndex>=0});var V=m.findIndex(function(e,n){var o;return b.has(n)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(M.selfIndex))});(O=-1!==V)&&(A=_(V,"left"))}else(O=b.has(f))&&(A=_(f,"right"));var W=h&&-1!==E?_(E,"left"):_(f,"right"),K=h?-1!==E||!(null===(c=M.refIndexes)||void 0===c?void 0:c.length)&&m.some(function(e){return e.id&&e.id===M.id}):Boolean(m[f]),X=h?M.selfIndex<0||!K:!m[f],Y=u.default.useMemo(function(){var e=L.rightNums.get(M.id);return h&&M.id?d.getRhsMappedSectionNumber({section:M,proposedSections:m,leftNums:L.leftNums,fallbackNumber:e}):e},[h,m,M.id,M.selfIndex,L]),G=null===(p=I.current[f])||void 0===p?void 0:p.current,H=O||q&&(T===f||T===E)||!!z&&z===G;return n.jsx(i.Box,e.__assign({ref:y(f),sx:{mb:1,width:"100%"}},{children:n.jsx(i.Box,e.__assign({ref:R.current[f],sx:e.__assign({width:"100%",display:"flex"},O&&A&&{borderRadius:"6px",outline:"2px solid ".concat(A.badgeBorder),outlineOffset:"1px"})},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(r.default,{section:g,idx:f,columnKey:"right",colRef:y("right-accordion-".concat(f)),mb:0,parentNodeId:(null===(x=null==j?void 0:j.input_index_map)||void 0===x?void 0:x[1])||"",isExpanded:h?!!S["right-".concat(f)]:!!S[String(f)],onToggle:function(){N(),k(f,"right")},navigation:g.id?F[g.id]:null}),h&&W&&n.jsx(i.Box,e.__assign({ref:I.current[f],"data-section-id":M.id,onClick:function(e){var n,o,i;if(X){var t=B.enableDeviationSchemaBackwardCompatibility?null!==(n=M.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=M.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;C(e,String(f),X,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:X?"4px":"0px",fontSize:"11px",bgcolor:W.badgeBg,color:W.badgeText,border:"1px solid ".concat(W.badgeBorder),borderRadius:X?"12px":"10px",px:X?1.2:1,py:.3,fontWeight:X?600:700,cursor:X?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:X?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:X?n.jsxs(n.Fragment,{children:[n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){var n,o,i;e.stopPropagation();var t=B.enableDeviationSchemaBackwardCompatibility?null!==(n=M.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=M.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;C(e,String(f),X,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(W.badgeBorder),"&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[null!=Y&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(W.badgeBorder)}},{children:Y})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!B.isLoading||null!=M.evaluationResult&&void 0!==M.evaluationResult?W.label?"".concat(W.label):"100% Deviation":n.jsx(a.default,{color:W.badgeText})}))]})),n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var n=h?m.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(M.selfIndex)})||{title:"",content:""}:m[f]||{title:"",content:""};w(e,n,X,M,f,W)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[n.jsx(t.EllipsisVertical,{size:11,color:W.badgeText}),H&&n.jsx(l.default,{locked:P,onToggle:D,color:W.badgeText,borderColor:W.badgeBorder,size:11})]}))]}):n.jsx(n.Fragment,{children:n.jsx(i.Box,e.__assign({component:"span",sx:{px:.2}},{children:null!=Y?Y:""}))})}))]}))}))}),"right-row-".concat(f))});exports.default=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),o=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),l=require("./ThreeDotsLoader.js"),a=require("./ScrollLockToggle.js"),d=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(i),x=u.default.memo(function(i){var c,x,p,g=i.section,f=i.idx,v=s.useCompareContext(),h=v.maintainRelativeOrder;v.existingSections;var m=v.proposedSections,b=v.connectedSections,S=v.expandedSections,_=v.displayConfig,I=v.treeData;v.deviationNumberRegistry;var j=v.getSectionCompareStyle;v.getBadgeRef;var y=v.getSectionRowRef,B=v.sectionRightRefs,R=v.rhsBadgeRefs,w=v.openMoreFunctionsPopup,C=v.handleOpenSummaryPopup,N=v.handleCloseSummaryPopup,T=v.toggleSection;v.showDeviationBadges,v.renderSubSectionAccordion,v.isProposingFix,v.proposingFixNodeId,v.isRedlineFlow;var k=v.isSideBySide,q=v.activeSideBySideSection,P=v.scrollSyncLocked,M=v.toggleScrollSyncLocked,z=v.summaryPopupAnchorEl;v.deviationNodeIdToView,v.deviationTargetParentId;var A=v.showDeviationNavigation;v.showOpenNodeRef,v.resolvedMarkdownStyles;var D=v.unifiedNumbering,F=g,L=!1,O=null,E=-1,U=-1;h?(U=m.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(F.selfIndex))&&e.selfIndex>=0}),E=m.findIndex(function(e,n){var i;return b.has(n)&&(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(F.selfIndex))}),(L=-1!==E)&&(O=j(E,"left"))):(L=b.has(f))&&(O=j(f,"right"));var V=h&&-1!==U?j(U,"left"):j(f,"right"),W=O||V,H=h?-1!==U||!(null===(c=F.refIndexes)||void 0===c?void 0:c.length)&&m.some(function(e){return e.id&&e.id===F.id}):Boolean(m[f]),K=h?F.selfIndex<0||!H:!m[f],X=u.default.useMemo(function(){var e=D.rightNums.get(F.id);return h&&F.id?d.getRhsMappedSectionNumber({section:F,proposedSections:m,leftNums:D.leftNums,fallbackNumber:e}):e},[h,m,F.id,F.selfIndex,D]),Y=u.default.useMemo(function(){if(!h||null==F.selfIndex)return null!=X?[{label:String(X),title:F.title||"Untitled Section",lhsIdx:-1}]:[];var n=m.map(function(e,n){var i=Array.isArray(null==e?void 0:e.refIndexes)?e.refIndexes:[],o=i.findIndex(function(e){return e===F.selfIndex});if(-1===o)return null;var t=(null==e?void 0:e.id)?D.leftNums.get(e.id):void 0;return null==t?null:{label:i.length>1?"".concat(t).concat(d.getAlphabeticSuffix(o)):String(t),title:(null==e?void 0:e.title)||"Untitled Section",lhsIdx:n}}).filter(Boolean);return-1===E?n:e.__spreadArray([],n,!0).sort(function(e,n){return e.lhsIdx===E?-1:n.lhsIdx===E?1:0})},[h,m,F.selfIndex,F.title,X,D.leftNums,E]),G=u.default.useMemo(function(){var e,n=null===(e=Y[0])||void 0===e?void 0:e.label;if(!n)return null!=X?String(X):"";var i=Y.length-1;return i>0?"".concat(n," +").concat(i):n},[Y,X]),J=u.default.useMemo(function(){return 0===Y.length?"":Y.map(function(e){return"".concat(e.label,": ").concat(e.title)}).join("\n")},[Y]),Q=null===(x=R.current[f])||void 0===x?void 0:x.current,Z=L||k&&(q===f||q===U)||!!z&&z===Q;return n.jsx(o.Box,e.__assign({ref:y(f),sx:{mb:1,width:"100%"}},{children:n.jsx(o.Box,e.__assign({ref:B.current[f],sx:e.__assign({width:"100%",display:"flex"},L&&O&&{borderRadius:"6px",outline:"2px solid ".concat(O.badgeBorder),outlineOffset:"1px"})},{children:n.jsxs(o.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(r.default,{section:g,idx:f,columnKey:"right",colRef:y("right-accordion-".concat(f)),mb:0,parentNodeId:(null===(p=null==I?void 0:I.input_index_map)||void 0===p?void 0:p[1])||"",isExpanded:h?!!S["right-".concat(f)]:!!S[String(f)],onToggle:function(){N(),T(f,"right")},navigation:g.id?A[g.id]:null}),h&&W&&n.jsx(o.Tooltip,e.__assign({title:J?n.jsx(o.Box,e.__assign({sx:{whiteSpace:"pre-line"}},{children:n.jsx(o.Typography,e.__assign({component:"span",sx:{fontSize:"11px",lineHeight:1.5}},{children:J}))})):"",placement:"top",arrow:!0},{children:n.jsx(o.Box,e.__assign({ref:R.current[f],"data-section-id":F.id,onClick:function(e){var n,i,o;if(K){var t=_.enableDeviationSchemaBackwardCompatibility?null!==(n=F.evaluationResult)&&void 0!==n?n:null:null!==(o=null===(i=F.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==o?o:null;C(e,String(f),K,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:K?"4px":"0px",fontSize:"11px",bgcolor:W.badgeBg,color:W.badgeText,border:"1px solid ".concat(W.badgeBorder),borderRadius:K?"12px":"10px",px:K?1.2:1,py:.3,fontWeight:K?600:700,cursor:K?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:K?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:K?n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,e.__assign({component:"span",onClick:function(e){var n,i,o;e.stopPropagation();var t=_.enableDeviationSchemaBackwardCompatibility?null!==(n=F.evaluationResult)&&void 0!==n?n:null:null!==(o=null===(i=F.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==o?o:null;C(e,String(f),K,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(W.badgeBorder),"&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[null!=X&&n.jsx(o.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(W.badgeBorder)}},{children:X})),n.jsx(o.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!_.isLoading||null!=F.evaluationResult&&void 0!==F.evaluationResult?W.label?"".concat(W.label):"100% Deviation":n.jsx(l.default,{color:W.badgeText})}))]})),n.jsxs(o.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var n=h?m.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(F.selfIndex)})||{title:"",content:""}:m[f]||{title:"",content:""};w(e,n,K,F,f,W)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[n.jsx(t.EllipsisVertical,{size:11,color:W.badgeText}),Z&&n.jsx(a.default,{locked:P,onToggle:M,color:W.badgeText,borderColor:W.badgeBorder,size:11})]}))]}):n.jsx(n.Fragment,{children:n.jsx(o.Box,e.__assign({component:"span",sx:{px:.2}},{children:G}))})}))}))]}))}))}),"right-row-".concat(f))});exports.default=x;
2
2
  //# sourceMappingURL=RHSSectionRow.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as o,jsxs as n,Fragment as i}from"react/jsx-runtime";import t from"react";import{Box as r}from"@mui/material";import{EllipsisVertical as l}from"lucide-react";import a from"./SectionAccordion.js";import d from"./ThreeDotsLoader.js";import c from"./ScrollLockToggle.js";import{getRhsMappedSectionNumber as s}from"../CognitiveComparehelpers.js";import{useCompareContext as p}from"../CompareContext.js";var u=t.memo(function(u){var g,f,x,v=u.section,m=u.idx,h=p(),b=h.maintainRelativeOrder;h.existingSections;var S=h.proposedSections,R=h.connectedSections,y=h.expandedSections,I=h.displayConfig,w=h.treeData;h.deviationNumberRegistry;var B=h.getSectionCompareStyle;h.getBadgeRef;var C=h.getSectionRowRef,k=h.sectionRightRefs,N=h.rhsBadgeRefs,T=h.openMoreFunctionsPopup,P=h.handleOpenSummaryPopup,j=h.handleCloseSummaryPopup,D=h.toggleSection;h.showDeviationBadges,h.renderSubSectionAccordion,h.isProposingFix,h.proposingFixNodeId,h.isRedlineFlow;var z=h.isSideBySide,L=h.activeSideBySideSection,F=h.scrollSyncLocked,O=h.toggleScrollSyncLocked,A=h.summaryPopupAnchorEl;h.deviationNodeIdToView,h.deviationTargetParentId;var M=h.showDeviationNavigation;h.showOpenNodeRef,h.resolvedMarkdownStyles;var E=h.unifiedNumbering,W=v,_=!1,K=null,V=-1;if(b){V=S.findIndex(function(e){var o;return(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(W.selfIndex))&&e.selfIndex>=0});var X=S.findIndex(function(e,o){var n;return R.has(o)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(W.selfIndex))});(_=-1!==X)&&(K=B(X,"left"))}else(_=R.has(m))&&(K=B(m,"right"));var Y=b&&-1!==V?B(V,"left"):B(m,"right"),q=b?-1!==V||!(null===(g=W.refIndexes)||void 0===g?void 0:g.length)&&S.some(function(e){return e.id&&e.id===W.id}):Boolean(S[m]),G=b?W.selfIndex<0||!q:!S[m],H=t.useMemo(function(){var e=E.rightNums.get(W.id);return b&&W.id?s({section:W,proposedSections:S,leftNums:E.leftNums,fallbackNumber:e}):e},[b,S,W.id,W.selfIndex,E]),J=null===(f=N.current[m])||void 0===f?void 0:f.current,Q=_||z&&(L===m||L===V)||!!A&&A===J;return o(r,e({ref:C(m),sx:{mb:1,width:"100%"}},{children:o(r,e({ref:k.current[m],sx:e({width:"100%",display:"flex"},_&&K&&{borderRadius:"6px",outline:"2px solid ".concat(K.badgeBorder),outlineOffset:"1px"})},{children:n(r,e({sx:{position:"relative",width:"100%"}},{children:[o(a,{section:v,idx:m,columnKey:"right",colRef:C("right-accordion-".concat(m)),mb:0,parentNodeId:(null===(x=null==w?void 0:w.input_index_map)||void 0===x?void 0:x[1])||"",isExpanded:b?!!y["right-".concat(m)]:!!y[String(m)],onToggle:function(){j(),D(m,"right")},navigation:v.id?M[v.id]:null}),b&&Y&&o(r,e({ref:N.current[m],"data-section-id":W.id,onClick:function(e){var o,n,i;if(G){var t=I.enableDeviationSchemaBackwardCompatibility?null!==(o=W.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=W.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;P(e,String(m),G,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:G?"4px":"0px",fontSize:"11px",bgcolor:Y.badgeBg,color:Y.badgeText,border:"1px solid ".concat(Y.badgeBorder),borderRadius:G?"12px":"10px",px:G?1.2:1,py:.3,fontWeight:G?600:700,cursor:G?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:G?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:G?n(i,{children:[n(r,e({component:"span",onClick:function(e){var o,n,i;e.stopPropagation();var t=I.enableDeviationSchemaBackwardCompatibility?null!==(o=W.evaluationResult)&&void 0!==o?o:null:null!==(i=null===(n=W.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==i?i:null;P(e,String(m),G,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(Y.badgeBorder),"&:hover":{bgcolor:"".concat(Y.badgeBorder,"22")}}},{children:[null!=H&&o(r,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(Y.badgeBorder)}},{children:H})),o(r,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!I.isLoading||null!=W.evaluationResult&&void 0!==W.evaluationResult?Y.label?"".concat(Y.label):"100% Deviation":o(d,{color:Y.badgeText})}))]})),n(r,e({component:"span",onClick:function(e){e.stopPropagation();var o=b?S.find(function(e){var o;return null===(o=e.refIndexes)||void 0===o?void 0:o.includes(W.selfIndex)})||{title:"",content:""}:S[m]||{title:"",content:""};T(e,o,G,W,m,Y)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(Y.badgeBorder,"22")}}},{children:[o(l,{size:11,color:Y.badgeText}),Q&&o(c,{locked:F,onToggle:O,color:Y.badgeText,borderColor:Y.badgeBorder,size:11})]}))]}):o(i,{children:o(r,e({component:"span",sx:{px:.2}},{children:null!=H?H:""}))})}))]}))}))}),"right-row-".concat(m))});export{u as default};
1
+ import{__spreadArray as e,__assign as n}from"tslib";import{jsx as o,jsxs as i,Fragment as t}from"react/jsx-runtime";import r from"react";import{Box as l,Tooltip as d,Typography as a}from"@mui/material";import{EllipsisVertical as c}from"lucide-react";import s from"./SectionAccordion.js";import u from"./ThreeDotsLoader.js";import p from"./ScrollLockToggle.js";import{getRhsMappedSectionNumber as f,getAlphabeticSuffix as x}from"../CognitiveComparehelpers.js";import{useCompareContext as g}from"../CompareContext.js";var v=r.memo(function(v){var m,h,b,S=v.section,I=v.idx,y=g(),R=y.maintainRelativeOrder;y.existingSections;var w=y.proposedSections,B=y.connectedSections,C=y.expandedSections,N=y.displayConfig,k=y.treeData;y.deviationNumberRegistry;var T=y.getSectionCompareStyle;y.getBadgeRef;var j=y.getSectionRowRef,P=y.sectionRightRefs,z=y.rhsBadgeRefs,D=y.openMoreFunctionsPopup,M=y.handleOpenSummaryPopup,A=y.handleCloseSummaryPopup,L=y.toggleSection;y.showDeviationBadges,y.renderSubSectionAccordion,y.isProposingFix,y.proposingFixNodeId,y.isRedlineFlow;var F=y.isSideBySide,O=y.activeSideBySideSection,E=y.scrollSyncLocked,U=y.toggleScrollSyncLocked,W=y.summaryPopupAnchorEl;y.deviationNodeIdToView,y.deviationTargetParentId;var _=y.showDeviationNavigation;y.showOpenNodeRef,y.resolvedMarkdownStyles;var H=y.unifiedNumbering,K=S,V=!1,X=null,Y=-1,q=-1;R?(q=w.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(K.selfIndex))&&e.selfIndex>=0}),Y=w.findIndex(function(e,n){var o;return B.has(n)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(K.selfIndex))}),(V=-1!==Y)&&(X=T(Y,"left"))):(V=B.has(I))&&(X=T(I,"right"));var G=R&&-1!==q?T(q,"left"):T(I,"right"),J=X||G,Q=R?-1!==q||!(null===(m=K.refIndexes)||void 0===m?void 0:m.length)&&w.some(function(e){return e.id&&e.id===K.id}):Boolean(w[I]),Z=R?K.selfIndex<0||!Q:!w[I],$=r.useMemo(function(){var e=H.rightNums.get(K.id);return R&&K.id?f({section:K,proposedSections:w,leftNums:H.leftNums,fallbackNumber:e}):e},[R,w,K.id,K.selfIndex,H]),ee=r.useMemo(function(){if(!R||null==K.selfIndex)return null!=$?[{label:String($),title:K.title||"Untitled Section",lhsIdx:-1}]:[];var n=w.map(function(e,n){var o=Array.isArray(null==e?void 0:e.refIndexes)?e.refIndexes:[],i=o.findIndex(function(e){return e===K.selfIndex});if(-1===i)return null;var t=(null==e?void 0:e.id)?H.leftNums.get(e.id):void 0;return null==t?null:{label:o.length>1?"".concat(t).concat(x(i)):String(t),title:(null==e?void 0:e.title)||"Untitled Section",lhsIdx:n}}).filter(Boolean);return-1===Y?n:e([],n,!0).sort(function(e,n){return e.lhsIdx===Y?-1:n.lhsIdx===Y?1:0})},[R,w,K.selfIndex,K.title,$,H.leftNums,Y]),ne=r.useMemo(function(){var e,n=null===(e=ee[0])||void 0===e?void 0:e.label;if(!n)return null!=$?String($):"";var o=ee.length-1;return o>0?"".concat(n," +").concat(o):n},[ee,$]),oe=r.useMemo(function(){return 0===ee.length?"":ee.map(function(e){return"".concat(e.label,": ").concat(e.title)}).join("\n")},[ee]),ie=null===(h=z.current[I])||void 0===h?void 0:h.current,te=V||F&&(O===I||O===q)||!!W&&W===ie;return o(l,n({ref:j(I),sx:{mb:1,width:"100%"}},{children:o(l,n({ref:P.current[I],sx:n({width:"100%",display:"flex"},V&&X&&{borderRadius:"6px",outline:"2px solid ".concat(X.badgeBorder),outlineOffset:"1px"})},{children:i(l,n({sx:{position:"relative",width:"100%"}},{children:[o(s,{section:S,idx:I,columnKey:"right",colRef:j("right-accordion-".concat(I)),mb:0,parentNodeId:(null===(b=null==k?void 0:k.input_index_map)||void 0===b?void 0:b[1])||"",isExpanded:R?!!C["right-".concat(I)]:!!C[String(I)],onToggle:function(){A(),L(I,"right")},navigation:S.id?_[S.id]:null}),R&&J&&o(d,n({title:oe?o(l,n({sx:{whiteSpace:"pre-line"}},{children:o(a,n({component:"span",sx:{fontSize:"11px",lineHeight:1.5}},{children:oe}))})):"",placement:"top",arrow:!0},{children:o(l,n({ref:z.current[I],"data-section-id":K.id,onClick:function(e){var n,o,i;if(Z){var t=N.enableDeviationSchemaBackwardCompatibility?null!==(n=K.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=K.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;M(e,String(I),Z,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Z?"4px":"0px",fontSize:"11px",bgcolor:J.badgeBg,color:J.badgeText,border:"1px solid ".concat(J.badgeBorder),borderRadius:Z?"12px":"10px",px:Z?1.2:1,py:.3,fontWeight:Z?600:700,cursor:Z?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:Z?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:Z?i(t,{children:[i(l,n({component:"span",onClick:function(e){var n,o,i;e.stopPropagation();var t=N.enableDeviationSchemaBackwardCompatibility?null!==(n=K.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=K.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;M(e,String(I),Z,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(J.badgeBorder),"&:hover":{bgcolor:"".concat(J.badgeBorder,"22")}}},{children:[null!=$&&o(l,n({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(J.badgeBorder)}},{children:$})),o(l,n({component:"span",sx:{fontSize:"11px",px:.25}},{children:!N.isLoading||null!=K.evaluationResult&&void 0!==K.evaluationResult?J.label?"".concat(J.label):"100% Deviation":o(u,{color:J.badgeText})}))]})),i(l,n({component:"span",onClick:function(e){e.stopPropagation();var n=R?w.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(K.selfIndex)})||{title:"",content:""}:w[I]||{title:"",content:""};D(e,n,Z,K,I,J)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(J.badgeBorder,"22")}}},{children:[o(c,{size:11,color:J.badgeText}),te&&o(p,{locked:E,onToggle:U,color:J.badgeText,borderColor:J.badgeBorder,size:11})]}))]}):o(t,{children:o(l,n({component:"span",sx:{px:.2}},{children:ne}))})}))}))]}))}))}),"right-row-".concat(I))});export{v as default};
2
2
  //# sourceMappingURL=RHSSectionRow.js.map