@e-llm-studio/citation 0.0.228 → 0.0.230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +112 -0
  2. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
  3. package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
  4. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  5. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
  7. package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +2 -0
  8. package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -0
  9. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +2 -0
  10. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -0
  11. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
  12. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
  13. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +2 -0
  14. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js.map +1 -0
  15. package/dist/cjs/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
  16. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  17. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  18. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  19. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  20. package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
  21. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  22. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  23. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  24. package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  25. package/dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js +2 -0
  26. package/dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js.map +1 -0
  27. package/dist/cjs/features/PromptemonViewer/PromptemonViewer.js +2 -0
  28. package/dist/cjs/features/PromptemonViewer/PromptemonViewer.js.map +1 -0
  29. package/dist/cjs/index.js +1 -1
  30. package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
  31. package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
  32. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  33. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  34. package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
  35. package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +2 -0
  36. package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js.map +1 -0
  37. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +2 -0
  38. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js.map +1 -0
  39. package/dist/features/CognitiveCompare/Guidelines/utils/helper.js +2 -0
  40. package/dist/features/CognitiveCompare/Guidelines/utils/helper.js.map +1 -0
  41. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +2 -0
  42. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js.map +1 -0
  43. package/dist/features/CognitiveCompare/MoreFunctionsPopup.js +1 -1
  44. package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  45. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  46. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  47. package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  48. package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
  49. package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  50. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  51. package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  52. package/dist/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  53. package/dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js +2 -0
  54. package/dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js.map +1 -0
  55. package/dist/features/PromptemonViewer/PromptemonViewer.js +2 -0
  56. package/dist/features/PromptemonViewer/PromptemonViewer.js.map +1 -0
  57. package/dist/index.js +1 -1
  58. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
  59. package/dist/types/src/PromptemonBlockViewerTest.d.ts +3 -0
  60. package/dist/types/src/PromptemonBlockViewerTest.d.ts.map +1 -0
  61. package/dist/types/src/PromptemonViewerTest.d.ts +3 -0
  62. package/dist/types/src/PromptemonViewerTest.d.ts.map +1 -0
  63. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +3 -0
  64. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
  65. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +3 -1
  66. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
  67. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
  68. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  69. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +19 -0
  70. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  71. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +21 -3
  72. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
  73. package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
  74. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +5 -1
  75. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
  76. package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts +3 -0
  77. package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -0
  78. package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts +8 -0
  79. package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -0
  80. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +2001 -0
  81. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -0
  82. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts +11 -0
  83. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts.map +1 -0
  84. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +6 -0
  85. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -0
  86. package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts +2 -0
  87. package/dist/types/src/features/CognitiveCompare/MoreFunctionsPopup.d.ts.map +1 -1
  88. package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
  89. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  90. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts +1 -0
  91. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
  92. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts +2 -1
  93. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
  94. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts +1 -0
  95. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
  96. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +2 -1
  97. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
  98. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts +1 -1
  99. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
  100. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts +1 -1
  101. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
  102. package/dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts +11 -0
  103. package/dist/types/src/features/PromptemonBlockViewer/PromptemonBlockViewer.d.ts.map +1 -0
  104. package/dist/types/src/features/PromptemonBlockViewer/index.d.ts +3 -0
  105. package/dist/types/src/features/PromptemonBlockViewer/index.d.ts.map +1 -0
  106. package/dist/types/src/features/PromptemonViewer/PromptemonViewer.d.ts +43 -0
  107. package/dist/types/src/features/PromptemonViewer/PromptemonViewer.d.ts.map +1 -0
  108. package/dist/types/src/features/PromptemonViewer/index.d.ts +3 -0
  109. package/dist/types/src/features/PromptemonViewer/index.d.ts.map +1 -0
  110. package/dist/types/src/index.d.ts +4 -0
  111. package/dist/types/src/index.d.ts.map +1 -1
  112. package/package.json +12 -2
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(t){if("string"!=typeof t||""===t.trim())return null;try{var r="undefined"!=typeof window?window.location.origin:"http://localhost";return new URL(t,r)}catch(t){return null}},r=function(t,r){var e;if("string"!=typeof t||"string"!=typeof r||""===r.trim())return"";try{var n=t.match(new RegExp("\\b".concat(r,"\\s*=\\s*(['\"])(.*?)\\1"),"i"));return null!==(e=null==n?void 0:n[2])&&void 0!==e?e:""}catch(t){return""}},e=function(t){if("string"!=typeof t||""===t)return"";try{return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}catch(r){return t}},n=function(t,r,n){if("string"!=typeof t||""===t.trim())return t;if("string"!=typeof r||""===r.trim())return t;if(!n||"string"!=typeof n)return t;try{var a=e(n),i=new RegExp("\\b".concat(r,"\\s*=\\s*(['\"])(.*?)\\1"),"i");return i.test(t)?t.replace(i,function(){return"".concat(r,'="').concat(a,'"')}):t.replace(/<a\b/i,function(){return"<a ".concat(r,'="').concat(a,'"')})}catch(r){return t}};exports.mergeRulebookCitationsIntoMatchingLinks=function(a){if("string"!=typeof a||!a||!a.includes("rulebook_citation"))return a;try{var i=a;return Array.from(a.matchAll(/<a\b((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/a>/gi)).forEach(function(a){var c,o=a[0],u=a[1]||"",s=r(u,"type");if("rulebook_citation"===s){var l=r(u,"reason"),f=r(u,"href").replace(/&amp;/gi,"&"),p=t(f),h=null===(c=((null==p?void 0:p.searchParams.get("citationNumber"))||"").match(/^rb_(.+)$/))||void 0===c?void 0:c[1];if(h){var g={citation_type:(null==p?void 0:p.searchParams.get("citation_type"))||"",phrase_to_highlight:(null==p?void 0:p.searchParams.get("phrase_to_highlight"))||""};if(g.citation_type||g.phrase_to_highlight){var v=!1,y=function(r){var e=t(r.replace(/&amp;/gi,"&"));return(null==e?void 0:e.searchParams.get("citationNumber"))!==h?r:(v=!0,function(r,e){if("string"!=typeof r||""===r.trim())return r;if(!e||"object"!=typeof e)return r;try{var n=t(r);if(!n)return r;Object.entries(e).forEach(function(t){var r=t[0],e=t[1];e&&n.searchParams.set(r,e)});var a="".concat(n.pathname).concat(n.search).concat(n.hash);return r.startsWith("./")?".".concat(a):!r.startsWith("/")&&a.startsWith("/")?a.slice(1):a}catch(t){return r}}(r,g))};i=i.replace(/\[([^\]]+)\]\(([^)\n]+)\)/g,function(t,r,n){var a=y(n);return a===n?t:'<a type="'.concat(e(s),'" reason="').concat(e(l),'" href="').concat(e(a),'">').concat(r,"</a>")}),v||(i=i.replace(/<a\b((?:[^>"']|"[^"]*"|'[^']*')*)>/gi,function(t,e){if("rulebook_citation"===r(e,"type"))return t;var a=r(e,"href"),i=y(a);if(i===a)return t;var c=t.replace(/\bhref\s*=\s*(['"])(.*?)\1/i,function(t,r){return"href=".concat(r).concat(i).concat(r)});return n(n(c,"type",s),"reason",l)})),i=i.split(o).join("")}else i=i.split(o).join("")}else i=i.split(o).join("")}}),i}catch(t){return a}};
2
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.processGuidelinesMarkdown=function(e){var t,a,n=e.guidelinesData,o=e.targetHighlights,r=void 0===o?[]:o,i=e.labelColor,c=void 0===i?"#FEF08A":i,l=(null===(a=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.artifactData)||void 0===a?void 0:a.userStorySnapshot)||[],u="";return l.forEach(function(e){var t;e.title&&(u+="### ".concat(e.title,"\n\n")),e.value&&(u+="".concat(e.value,"\n\n")),null===(t=e.sub_features)||void 0===t||t.forEach(function(e){e.title&&(u+="#### ".concat(e.title,"\n\n")),e.value&&(u+="".concat(e.value,"\n\n"))})}),r.forEach(function(e,t){var a=e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),n=new RegExp("(".concat(a,")"),"g");u=u.replace(n,'<mark id="guideline-target-'.concat(t,'" style="background-color: ').concat(c,'; border-radius: 3px; padding: 2px;">$1</mark>'))}),u};
2
+ //# sourceMappingURL=processGuidelinesMarkdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processGuidelinesMarkdown.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"),s=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"})}))},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",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 a=t.onClose,c=t.onOpenCognitiveCompare,d=t.onOpenSideBySide,C=t.onConnect,x=t.isConnected,g=void 0!==x&&x,h=t.isOrphan,p=t.maintainRelativeOrder;return i.jsx(n.Menu,e.__assign({open:r,anchorEl:l,onClose:a,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:o.filter(function(e){return p||"side-by-side"!==e.key}).map(function(t){var o="connect"===t.key,r=o&&g,l=h&&("connect"===t.key||"side-by-side"===t.key),a=i.jsxs(i.Fragment,{children:[i.jsx(n.Box,e.__assign({sx:e.__assign(e.__assign({width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& svg":{display:"block"}},l&&{opacity:.15}),r&&{"& svg path":{fill:"#15803D",fillOpacity:1}})},{children:t.icon})),i.jsxs(n.Box,e.__assign({sx:{minWidth:0,display:"flex",flexDirection:"column",flex:1}},{children:[i.jsx(n.Typography,e.__assign({sx:{fontSize:"12px",fontWeight:500,color:l?"#98A2B3":r?"#15803D":"#101828",lineHeight:1.2,whiteSpace:"nowrap"}},{children:o?g?"Disconnect":"Connect":t.title})),l&&i.jsx(n.Typography,e.__assign({sx:{mt:.35,fontSize:"10px",lineHeight:1.3,color:"#98A2B3",whiteSpace:"normal"}},{children:"No counterpart exists to connect to."}))]})),r&&!l&&i.jsx(n.Box,e.__assign({sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:"auto"}},{children:i.jsx(s,{})}))]});return l?i.jsx(n.Box,e.__assign({"aria-disabled":"true",sx:{px:1.25,py:1,minHeight:22,borderRadius:"10px",display:"flex",alignItems:"flex-start",gap:1,cursor:"not-allowed",userSelect:"none"}},{children:a}),t.key):i.jsx(n.MenuItem,e.__assign({onClick:function(){return e=t.key,void(h&&("connect"===e||"side-by-side"===e)||("connect"!==e?"side-by-side"!==e?c():d():C()));var e},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:a}),t.key)})}))};
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"),s=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"})}))},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",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 a=t.onClose,c=t.onOpenCognitiveCompare,d=t.onOpenSideBySide,C=t.onConnect,x=t.isConnected,h=void 0!==x&&x,g=t.isOrphan,p=void 0!==g&&g,u=t.maintainRelativeOrder,y=t.isGuidelineMode,f=t.hasGuidelineMatches,v=y?!(void 0===f||f):p,_=y?"No highlights found in guidelines.":"No counterpart exists to connect to.";return i.jsx(n.Menu,e.__assign({open:r,anchorEl:l,onClose:a,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:o.filter(function(e){return u||"side-by-side"!==e.key}).map(function(t){var o="connect"===t.key,r=o&&h,l=("connect"===t.key||"side-by-side"===t.key)&&v,a=i.jsxs(i.Fragment,{children:[i.jsx(n.Box,e.__assign({sx:e.__assign(e.__assign({width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& svg":{display:"block"}},l&&{opacity:.15}),r&&{"& svg path":{fill:"#15803D",fillOpacity:1}})},{children:t.icon})),i.jsxs(n.Box,e.__assign({sx:{minWidth:0,display:"flex",flexDirection:"column",flex:1}},{children:[i.jsx(n.Typography,e.__assign({sx:{fontSize:"12px",fontWeight:500,color:l?"#98A2B3":r?"#15803D":"#101828",lineHeight:1.2,whiteSpace:"nowrap"}},{children:o?h?"Disconnect":"Connect":t.title})),l&&i.jsx(n.Typography,e.__assign({sx:{mt:.35,fontSize:"10px",lineHeight:1.3,color:"#98A2B3",whiteSpace:"normal"}},{children:_}))]})),r&&!l&&i.jsx(n.Box,e.__assign({sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:"auto"}},{children:i.jsx(s,{})}))]});return l?i.jsx(n.Box,e.__assign({"aria-disabled":"true",sx:{px:1.25,py:1,minHeight:22,borderRadius:"10px",display:"flex",alignItems:"flex-start",gap:1,cursor:"not-allowed",userSelect:"none"}},{children:a}),t.key):i.jsx(n.MenuItem,e.__assign({onClick:function(){var e;("connect"===(e=t.key)||"side-by-side"===e)&&v||("connect"!==e?"side-by-side"!==e?c():d():C())},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:a}),t.key)})}))};
2
2
  //# sourceMappingURL=MoreFunctionsPopup.js.map
@@ -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("../CompareContext.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(o).default.memo(function(o){var s,c,u,x=o.section,p=o.idx,g=d.useCompareContext(),v=g.maintainRelativeOrder;g.existingSections;var f=g.proposedSections,h=g.connectedSections,b=g.expandedSections,m=g.displayConfig,S=g.treeData;g.deviationNumberRegistry;var B=g.getSectionCompareStyle;g.getBadgeRef;var _=g.getSectionRowRef,j=g.sectionRightRefs,y=g.rhsBadgeRefs,R=g.openMoreFunctionsPopup,I=g.handleOpenSummaryPopup,w=g.handleCloseSummaryPopup,C=g.toggleSection;g.showDeviationBadges,g.renderSubSectionAccordion,g.isProposingFix,g.proposingFixNodeId,g.isRedlineFlow;var k=g.isSideBySide,T=g.activeSideBySideSection,q=g.scrollSyncLocked,P=g.toggleScrollSyncLocked,N=g.summaryPopupAnchorEl;g.deviationNodeIdToView,g.deviationTargetParentId;var D=g.showDeviationNavigation;g.showOpenNodeRef,g.resolvedMarkdownStyles;var z=g.unifiedNumbering,F=x,L=!1,O=null,A=-1;if(v){A=f.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(F.selfIndex))&&e.selfIndex>=0});var E=f.findIndex(function(e,n){var o;return h.has(n)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(F.selfIndex))});(L=-1!==E)&&(O=B(E,"left"))}else(L=h.has(p))&&(O=B(p,"right"));var M=v&&-1!==A?B(A,"left"):B(p,"right"),V=v?-1!==A||!(null===(s=F.refIndexes)||void 0===s?void 0:s.length)&&f.some(function(e){return e.id&&e.id===F.id}):Boolean(f[p]),W=v?F.selfIndex<0||!V:!f[p],K=z.rightNums.get(F.id),X=null===(c=y.current[p])||void 0===c?void 0:c.current,Y=L||k&&(T===p||T===A)||!!N&&N===X;return n.jsx(i.Box,e.__assign({ref:_(p),sx:{mb:1,width:"100%"}},{children:n.jsx(i.Box,e.__assign({ref:j.current[p],sx:e.__assign({width:"100%",display:"flex"},L&&O&&{borderRadius:"6px",outline:"2px solid ".concat(O.badgeBorder),outlineOffset:"1px"})},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(r.default,{section:x,idx:p,columnKey:"right",colRef:_("right-accordion-".concat(p)),mb:0,parentNodeId:(null===(u=null==S?void 0:S.input_index_map)||void 0===u?void 0:u[1])||"",isExpanded:v?!!b["right-".concat(p)]:!!b[String(p)],onToggle:function(){w(),C(p,"right")},navigation:x.id?D[x.id]:null}),v&&M&&n.jsx(i.Box,e.__assign({ref:y.current[p],"data-section-id":F.id,onClick:function(e){var n,o,i;if(W){var t=m.enableDeviationSchemaBackwardCompatibility?null!==(n=F.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=F.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;I(e,String(p),W,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:W?"4px":"0px",fontSize:"11px",bgcolor:M.badgeBg,color:M.badgeText,border:"1px solid ".concat(M.badgeBorder),borderRadius:W?"12px":"10px",px:W?1.2:1,py:.3,fontWeight:W?600:700,cursor:W?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:W?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:W?n.jsxs(n.Fragment,{children:[n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){var n,o,i;e.stopPropagation();var t=m.enableDeviationSchemaBackwardCompatibility?null!==(n=F.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=F.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;I(e,String(p),W,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(M.badgeBorder),"&:hover":{bgcolor:"".concat(M.badgeBorder,"22")}}},{children:[null!=K&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(M.badgeBorder)}},{children:K})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!m.isLoading||null!=F.evaluationResult&&void 0!==F.evaluationResult?M.label?"".concat(M.label):"100% Deviation":n.jsx(a.default,{color:M.badgeText})}))]})),n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var n=v?f.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(F.selfIndex)})||{title:"",content:""}:f[p]||{title:"",content:""};R(e,n,W,F,p,M)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(M.badgeBorder,"22")}}},{children:[n.jsx(t.EllipsisVertical,{size:11,color:M.badgeText}),Y&&n.jsx(l.default,{locked:q,onToggle:P,color:M.badgeText,borderColor:M.badgeBorder,size:11})]}))]}):n.jsx(n.Fragment,{children:n.jsx(i.Box,e.__assign({component:"span",sx:{px:.2}},{children:null!=K?K:""}))})}))]}))}))}),"right-row-".concat(p))});exports.default=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("./SectionAccordion.js"),l=require("./ThreeDotsLoader.js"),a=require("./ScrollLockToggle.js"),s=require("../CognitiveComparehelpers.js"),d=require("../CompareContext.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(i),x=u.default.memo(function(i){var c,x,p=i.section,g=i.idx,f=d.useCompareContext(),v=f.maintainRelativeOrder;f.existingSections;var h=f.proposedSections,m=f.connectedSections,S=f.expandedSections,b=f.displayConfig,_=f.treeData;f.deviationNumberRegistry;var I=f.getSectionCompareStyle;f.getBadgeRef;var j=f.getSectionRowRef,B=f.sectionRightRefs,y=f.rhsBadgeRefs,R=f.openMoreFunctionsPopup,w=f.handleOpenSummaryPopup,C=f.handleCloseSummaryPopup,N=f.toggleSection;f.showDeviationBadges,f.renderSubSectionAccordion,f.isProposingFix,f.proposingFixNodeId,f.isRedlineFlow;var T=f.isSideBySide,k=f.activeSideBySideSection,q=f.scrollSyncLocked,M=f.toggleScrollSyncLocked;f.deviationNodeIdToView,f.deviationTargetParentId;var P=f.showDeviationNavigation;f.showOpenNodeRef,f.resolvedMarkdownStyles;var z=f.unifiedNumbering,D=p,A=!1,F=null,L=-1,O=function(e,n){return String(null!=e?e:"")===String(n)},E=-1;v?(E=h.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(D.selfIndex))&&e.selfIndex>=0}),L=h.findIndex(function(e,n){var i;return function(e){return m.has(e)||m.has(String(e))||null!=k&&!String(k).includes("::")&&O(k,e)}(n)&&(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(D.selfIndex))}),(A=-1!==L)&&(F=I(L,"left"))):(A=m.has(g)||m.has(String(g))||O(k,g))&&(F=I(g,"right"));var U=v&&-1!==E?I(E,"left"):I(g,"right"),V=F||U,W=v?-1!==E||!(null===(c=D.refIndexes)||void 0===c?void 0:c.length)&&h.some(function(e){return e.id&&e.id===D.id}):Boolean(h[g]),H=v?D.selfIndex<0||!W:!h[g],K=u.default.useMemo(function(){var e=z.rightNums.get(D.id);return v&&D.id?s.getRhsMappedSectionNumber({section:D,proposedSections:h,leftNums:z.leftNums,fallbackNumber:e}):e},[v,h,D.id,D.selfIndex,z]),X=u.default.useMemo(function(){if(!v||null==D.selfIndex)return null!=K?[{label:String(K),title:D.title||"Untitled Section",lhsIdx:-1}]:[];var n=h.map(function(e,n){var i=Array.isArray(null==e?void 0:e.refIndexes)?e.refIndexes:[],t=i.findIndex(function(e){return e===D.selfIndex});if(-1===t)return null;var o=(null==e?void 0:e.id)?z.leftNums.get(e.id):void 0;return null==o?null:{label:i.length>1?"".concat(o).concat(s.getAlphabeticSuffix(t)):String(o),title:(null==e?void 0:e.title)||"Untitled Section",lhsIdx:n}}).filter(Boolean);return-1===L?n:e.__spreadArray([],n,!0).sort(function(e,n){return e.lhsIdx===L?-1:n.lhsIdx===L?1:0})},[v,h,D.selfIndex,D.title,K,z.leftNums,L]),Y=u.default.useMemo(function(){var e,n=null===(e=X[0])||void 0===e?void 0:e.label;if(!n)return null!=K?String(K):"";var i=X.length-1;return i>0?"".concat(n," + ").concat(i):n},[X,K]),G=u.default.useMemo(function(){return 0===X.length?"":X.map(function(e){return"".concat(e.label,": ").concat(e.title)}).join("\n")},[X]),J=A||T&&(O(k,g)||-1!==E&&O(k,E));return n.jsx(t.Box,e.__assign({ref:j(g),sx:{mb:1,width:"100%"}},{children:n.jsx(t.Box,e.__assign({ref:B.current[g],sx:e.__assign({width:"100%",display:"flex"},A&&F&&{borderRadius:"6px",outline:"2px solid ".concat(F.badgeBorder),outlineOffset:"1px"})},{children:n.jsxs(t.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(r.default,{section:p,idx:g,columnKey:"right",colRef:j("right-accordion-".concat(g)),mb:0,parentNodeId:(null===(x=null==_?void 0:_.input_index_map)||void 0===x?void 0:x[1])||"",isExpanded:v?!!S["right-".concat(g)]:!!S[String(g)],onToggle:function(){C(),N(g,"right")},navigation:p.id?P[p.id]:null}),v&&V&&n.jsx(t.Tooltip,e.__assign({title:G?n.jsx(t.Box,e.__assign({sx:{whiteSpace:"pre-line"}},{children:n.jsx(t.Typography,e.__assign({component:"span",sx:{fontSize:"11px",lineHeight:1.5}},{children:G}))})):"",placement:"top",arrow:!0},{children:n.jsx(t.Box,e.__assign({ref:y.current[g],"data-section-id":D.id,onClick:function(e){var n,i,t;if(H){var o=b.enableDeviationSchemaBackwardCompatibility?null!==(n=D.evaluationResult)&&void 0!==n?n:null:null!==(t=null===(i=D.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==t?t:null;w(e,String(g),H,o)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:H?"4px":"0px",fontSize:"11px",bgcolor:V.badgeBg,color:V.badgeText,border:"1px solid ".concat(V.badgeBorder),borderRadius:H?"12px":"10px",px:H?1.2:1,py:.3,fontWeight:H?600:700,cursor:H?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:H?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:H?n.jsxs(n.Fragment,{children:[n.jsxs(t.Box,e.__assign({component:"span",onClick:function(e){var n,i,t;e.stopPropagation();var o=b.enableDeviationSchemaBackwardCompatibility?null!==(n=D.evaluationResult)&&void 0!==n?n:null:null!==(t=null===(i=D.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==t?t:null;w(e,String(g),H,o)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(V.badgeBorder),"&:hover":{bgcolor:"".concat(V.badgeBorder,"22")}}},{children:[null!=K&&n.jsx(t.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(V.badgeBorder)}},{children:K})),n.jsx(t.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!b.isLoading||null!=D.evaluationResult&&void 0!==D.evaluationResult?V.label?"".concat(V.label):"100% Deviation":n.jsx(l.default,{color:V.badgeText})}))]})),n.jsxs(t.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var n=v?h.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(D.selfIndex)})||{title:"",content:""}:h[g]||{title:"",content:""};R(e,n,H,D,g,V)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(V.badgeBorder,"22")}}},{children:[n.jsx(o.EllipsisVertical,{size:11,color:V.badgeText}),J&&n.jsx(a.default,{locked:q,onToggle:M,color:V.badgeText,borderColor:V.badgeBorder,size:11})]}))]}):n.jsx(n.Fragment,{children:n.jsx(t.Box,e.__assign({component:"span",sx:{px:.2}},{children:Y}))})}))}))]}))}))}),"right-row-".concat(g))});exports.default=x;
2
2
  //# sourceMappingURL=RHSSectionRow.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),o=require("@mui/material"),t=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),r=require("../CompareContext.js"),d=require("../CognitiveComparehelpers.js"),a=require("../CognitiveCompareConstants.js");function u(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var s=u(i);exports.default=function(u){var c,v,f,p,g,x,h,m,_,I,y,b,A,S=u.section,R=u.idx,w=u.columnKey,E=u.colRef,O=u.mb,B=void 0===O?1:O,j=u.isExpanded,C=u.onToggle,T=u.navigation,D=u.parentNodeId,F=void 0===D?"":D,k=r.useCompareContext(),M=k.showOpenNodeRef,N=k.resolvedMarkdownStyles,P=k.maintainRelativeOrder,V=k.showDeviationBadges,W=void 0!==V&&V,q=k.renderSubSectionAccordion,G=k.treeData,L=k.proposedSections,K=k.existingSections,z=k.deviationNumberRegistry,H=k.deviationParentRegistry,U=k.getBadgeRef,X=k.openSummaryPopup,Y=k.getSectionCompareStyle,J=k.connectedSections,Q=k.openMoreFunctionsPopup,Z=k.isProposingFix,$=k.proposingFixNodeId,nn=k.isRedlineFlow,en=k.isSideBySide,on=k.activeSideBySideSection,tn=k.scrollSyncLocked,ln=k.unifiedNumbering,rn=k.toggleScrollSyncLocked,dn=k.summaryPopupAnchorEl,an="".concat(en?"1":"0","-").concat(String(null!=on?on:"")),un=(null===(c=S.displayTitle)||void 0===c||c)&&d.hasValue(S.title),sn=!!Z&&!!$&&"left"===w&&S.id===$,cn=d.hasMeaningfulRedlineTags(S.content),vn="boolean"==typeof nn?nn:cn,fn=cn,pn=vn&&cn,gn=pn?d.stripRedlineTags(S.content):S.content,xn=pn?S.content:void 0,hn=(null===(v=S.displayContent)||void 0===v||v||cn)&&d.hasValue(S.content),mn=!un&&!hn,_n=S.title;un||(_n=hn?"No Title Found":"No Matching Section Found");var In=S.evaluationResult;if(!In&&"right"===w)if(P){var yn=null===(f=S.refIndexes)||void 0===f?void 0:f[0],bn=L.find(function(n){return n.selfIndex===yn});In=null==bn?void 0:bn.evaluationResult}else In=null===(p=L[R])||void 0===p?void 0:p.evaluationResult;var An=null===(g=null==G?void 0:G.input_index_map)||void 0===g?void 0:g[0],Sn=null===(x=null==G?void 0:G.input_index_map)||void 0===x?void 0:x[1],Rn="left"===w?Sn:An,wn=function(n,e){var i;if(!e||!n)return null;for(var o=0,t=n;o<t.length;o++){var l=t[o];if(l.id===e)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var r=wn(l.subsections,e);if(r)return r}}return null},En="left"===w?S:wn(L,S.id),On="right"===w?S:wn(K,S.id),Bn=s.default.useMemo(function(){if(!P)return 0;var n=1/0,e=function(i,o,t,l){var r;if(i){var a=i.id;if(l&&"right"===w){var u=L.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(i.selfIndex)});u.length>0&&(a=u[0].id)}var s=i.id||(null==o?void 0:o.id)||(null==t?void 0:t.id),c=(null===(r=i.evaluationResult)||void 0===r?void 0:r.deviations)||{};Object.keys(c).forEach(function(e){var i="".concat(a).concat(d.DEVIATION_BADGE_SEPARATOR).concat(e),o=null==z?void 0:z[i];null!=o&&o<n&&(n=o);var t="".concat(s).concat(d.DEVIATION_BADGE_SEPARATOR).concat(e),l=null==z?void 0:z[t];null!=l&&l<n&&(n=l)});for(var v=i.subsections||[],f=(null==o?void 0:o.subsections)||[],p=(null==t?void 0:t.subsections)||[],g=Math.max(v.length,f.length,p.length),x=0;x<g;x++)e(v[x],f[x],p[x],!1)}};return e(S,En,On,!0),n!==1/0?n-1:0},[S,En,On,w,z,P,L]);if(P)if("left"===w){var jn=null===(h=S.refIndexes)||void 0===h?void 0:h[0],Cn=K.findIndex(function(n){return n.selfIndex===jn});On=-1!==Cn?K[Cn]:wn(K,S.id)}else{var Tn=null===(m=S.refIndexes)||void 0===m?void 0:m[0],Dn=L.findIndex(function(n){return n.selfIndex===Tn});En=-1!==Dn?L[Dn]:wn(L,S.id)}var Fn="left"===w?!On:!En,kn=In||(null==En?void 0:En.evaluationResult)||(null==On?void 0:On.evaluationResult),Mn=null!==(y=null===(I=null===(_=null==kn?void 0:kn.evaluation_outputs)||void 0===_?void 0:_.metadata)||void 0===I?void 0:I.label_color)&&void 0!==y?y:a.DEFAULT_DEVIAION_COLOR,Nn=d.generateColorPalette(Mn).highlightBg,Pn=(null==kn?void 0:kn.deviations)||{},Vn=S.id;if(P&&"left"!==w){var Wn=L.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(S.selfIndex)});Wn.length>0?Vn=Wn[0].id:(null==En?void 0:En.id)&&(Vn=En.id)}var qn=Object.keys(Pn)[0],Gn=qn?"".concat(Vn).concat(d.DEVIATION_BADGE_SEPARATOR).concat(qn):null,Ln=Gn?null==H?void 0:H[Gn]:null,Kn=R+1;if(P&&ln){var zn="left"===w?ln.leftNums.get(null==S?void 0:S.id):ln.rightNums.get(null==S?void 0:S.id);Fn&&void 0!==zn?Kn=zn:null!=Ln&&Ln>=0?Kn=Ln:void 0!==zn&&(Kn=zn)}else null!=Ln&&Ln>=0&&(Kn=Ln);var Hn=Object.entries(Pn).map(function(n){var e=n[0],i=n[1],o="".concat(Vn).concat(d.DEVIATION_BADGE_SEPARATOR).concat(e);return{deviationKey:e,deviationMap:i,refId:o,currentIndex:z[o]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});Hn.sort(function(n,e){return n.currentIndex-e.currentIndex});var Un,Xn=Hn.map(function(e){var i,o,t,l,r,a,u=e.deviationKey,s=e.deviationMap,c=e.refId,v=e.currentIndex;P&&void 0!==Bn&&(v-=Bn);var f=s[F],p=d.isMissingStr(f);if(p)f="";else if(!f)return null;var g=R,x=R;if(P)if("left"===w){var h=null===(i=S.refIndexes)||void 0===i?void 0:i[0],m=K.findIndex(function(n){return n.selfIndex===h});if(-1!==m)x=m;else{var _=K.findIndex(function(n){return n.id===S.id});x=-1!==_?_:R}}else{var I=null===(o=S.refIndexes)||void 0===o?void 0:o[0],y=L.findIndex(function(n){return n.selfIndex===I});if(-1!==y)g=y;else g=-1!==(j=L.findIndex(function(n){return n.id===S.id}))?j:R}var b="".concat(Vn).concat(d.DEVIATION_BADGE_SEPARATOR).concat(u).concat(d.DEVIATION_BADGE_SEPARATOR).concat(g).concat(d.DEVIATION_BADGE_SEPARATOR).concat(x),A=s[Rn],E=Fn||d.isMissingStr(A),O="".concat(Kn,".").concat(v),B=R;if("right"===w&&P){var j,C=null===(t=S.refIndexes)||void 0===t?void 0:t[0],T=L.findIndex(function(n){return n.selfIndex===C});if(-1!==T)B=T;else-1!==(j=L.findIndex(function(n){return n.id===S.id}))&&(B=j)}var D=Y?Y(B):null,k=(null==s?void 0:s.evaluation_outputs)||(null==kn?void 0:kn.evaluation_outputs),M=null!==(l=null==k?void 0:k.output_value)&&void 0!==l?l:null,N=null!==(a=null===(r=null==k?void 0:k.metadata)||void 0===r?void 0:r.label_color)&&void 0!==a?a:Mn,V=d.generateColorPalette(N),W=D?n.__assign(n.__assign({},D),{badgeBg:V.badgeBg,badgeBorder:V.badgeBorder,badgeText:V.badgeText}):n.__assign({},V),q=(null==s?void 0:s.deviation_summary)?{deviation_summary:s.deviation_summary,deviation_title:(null==s?void 0:s.deviation_title)||(null==kn?void 0:kn.deviation_title),deviation_impact:(null==s?void 0:s.deviation_impact)||(null==kn?void 0:kn.deviation_impact),deviation_explanation:(null==s?void 0:s.deviation_explanation)||(null==kn?void 0:kn.deviation_explanation),evaluation_outputs:k,cognitive_decisioning:(null==s?void 0:s.cognitive_decisioning)||(null==kn?void 0:kn.cognitive_decisioning)}:null,G=0,z=gn||"";if(f&&z){var H=z.split(/\n{2,}/),Z=H.findIndex(function(n){return n.includes(f)});if(-1!==Z){var $=Object.entries(Pn).filter(function(n){n[0];var e=n[1][F];return e&&H[Z].includes(e)}).sort(function(n,e){return H[Z].indexOf(n[1][F])-H[Z].indexOf(e[1][F])}),nn=$.filter(function(n){n[0];var e=n[1][F];return e&&(e.includes(f)||f.includes(e))});nn.length>1&&(G=Math.max(0,nn.findIndex(function(n){return n[0]===u})))}}var ln=U(w,c);return{id:c,actionId:b,label:O,highlight:f,side:w,style:W,stackIndex:G,score:M,isConnected:null==J?void 0:J.has(b),showScrollLockToggle:(null==J?void 0:J.has(b))||en&&on===b||!!dn&&dn===ln.current,scrollSyncLocked:tn,toggleScrollSyncLocked:rn,isOrphan:E,isMissingClause:p,badgeRef:ln,onClick:function(n){n.stopPropagation(),Q&&Q(n,En||{id:"orphan-left",title:"",content:""},E,On||{id:"orphan-right",title:"",content:""},b,W)},onSummaryClick:function(n){n.stopPropagation(),X(n,b,E,q)}}}).filter(Boolean),Yn=W||!vn&&sn?Xn:[],Jn=Xn.map(function(n){return n.highlight}).filter(Boolean),Qn=S.id&&w===(null==T?void 0:T.columnKey)?T:null,Zn=s.default.useRef(!1);return i.useEffect(function(){j||(Zn.current=!1)},[j]),e.jsxs(o.Box,n.__assign({ref:E,sx:{mb:B,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[j&&(null==Qn?void 0:Qn.showAbove)&&e.jsx("div",n.__assign({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var n,e;return null===(e=null===(n=null==Qn?void 0:Qn.showAboveRef)||void 0===n?void 0:n.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth",block:"center"})}},{children:e.jsx("div",n.__assign({style:n.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===w?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===w?{right:"-20px"}:{left:"-20px"})},{children:e.jsx(t.ChevronUp,{color:(null===(b=null==Qn?void 0:Qn.showAboveRef)||void 0===b?void 0:b.current)?window.getComputedStyle(Qn.showAboveRef.current).color:void 0})}))})),e.jsxs(o.Accordion,n.__assign({disableGutters:!0,expanded:!mn&&j,onChange:function(){mn||(C(),M.current=S.id)},sx:{boxShadow:"none",border:mn?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:mn?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flexGrow:1,width:"100%",display:"flex",flexDirection:"column",minWidth:0,"&:before":{display:"none"},"& .MuiAccordion-heading":{position:"sticky",top:-12,zIndex:10,background:"#fff"}}},{children:[e.jsx(o.AccordionSummary,n.__assign({expandIcon:mn?null:e.jsx(t.ChevronDown,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:mn?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:un&&e.jsx(o.Tooltip,n.__assign({title:_n,placement:"top"},{children:e.jsx(o.Typography,n.__assign({component:"div",sx:{fontSize:"12px",color:mn?"#94A3B8":"#19213D",fontWeight:mn?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(Un=_n,Un?d.safeStringify(Un).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(n,i){return n.startsWith("**")&&n.endsWith("**")?e.jsx("strong",{children:n.slice(2,-2)},i):e.jsx(s.default.Fragment,{children:n},i)}):null)}))}))})),!mn&&e.jsxs(o.AccordionDetails,n.__assign({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[hn&&e.jsx(l.MemoizedMarkdown,{content:gn,overlayContent:xn,sxStyles:N,highlights:Jn,maintainRelativeOrder:P,highlightBg:Nn,suppressHighlightBg:fn,deviationBadges:Yn,collisionKey:an}),(S.subsections||[]).map(function(n,e){return q({section:n,keyPath:"".concat(R,"-").concat(e),depth:0,columnKey:w,parentNodeId:F,sectionOffset:Bn})})]}))]})),j&&(null==Qn?void 0:Qn.showBelow)&&e.jsx("div",n.__assign({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var n,e;return null===(e=null===(n=null==Qn?void 0:Qn.showBelowRef)||void 0===n?void 0:n.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth",block:"center"})}},{children:e.jsx("div",n.__assign({style:n.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===w?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===w?{right:"-20px"}:{left:"-20px"})},{children:e.jsx(t.ChevronDown,{color:(null===(A=null==Qn?void 0:Qn.showBelowRef)||void 0===A?void 0:A.current)?window.getComputedStyle(Qn.showBelowRef.current).color:void 0})}))}))]}),"".concat(w,"-sec-").concat(R))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),r=require("../CompareContext.js"),d=require("../CognitiveComparehelpers.js"),a=require("../CognitiveCompareConstants.js");function s(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=s(i);exports.default=function(s){var c,v,f,g,p,h,x,I,m,_,y,b,S,A,R,E=s.section,w=s.idx,O=s.columnKey,M=s.colRef,N=s.mb,T=void 0===N?1:N,D=s.isExpanded,j=s.onToggle,B=s.navigation,C=s.parentNodeId,F=void 0===C?"":C,k=r.useCompareContext(),P=k.showOpenNodeRef,V=k.resolvedMarkdownStyles,G=k.maintainRelativeOrder,W=k.showDeviationBadges,q=void 0!==W&&W,L=k.renderSubSectionAccordion,z=k.treeData,K=k.proposedSections,X=k.existingSections,H=k.deviationNumberRegistry,U=k.deviationParentRegistry,Y=k.getBadgeRef,J=k.openSummaryPopup,Q=k.getSectionCompareStyle,Z=k.connectedSections,$=k.openMoreFunctionsPopup,nn=k.isProposingFix,en=k.proposingFixNodeId,tn=k.isRedlineFlow,on=k.isSideBySide,ln=k.activeSideBySideSection,rn=k.scrollSyncLocked,dn=k.unifiedNumbering,an=k.toggleScrollSyncLocked,sn=k.summaryPopupAnchorEl,un="".concat(on?"1":"0","-").concat(String(null!=ln?ln:"")),cn=(null===(c=E.displayTitle)||void 0===c||c)&&d.hasValue(E.title),vn=!(!nn||!en||"left"!==O||E.id!==en&&E.nodeId!==en),fn=d.hasMeaningfulRedlineTags(E.content),gn="boolean"==typeof tn?tn:fn,pn=fn,hn=gn&&fn,xn=hn?d.stripRedlineTags(E.content):E.content,In=hn?E.content:void 0,mn=(null===(v=E.displayContent)||void 0===v||v||fn)&&d.hasValue(E.content),_n=!cn&&!mn,yn=E.title;cn||(yn=mn?"No Title Found":"No Matching Section Found");var bn="left"===O&&(null!==(g=null===(f=null==E?void 0:E.refContentIds)||void 0===f?void 0:f.length)&&void 0!==g?g:1)>1,Sn="left"===O&&yn.length>29?"".concat(yn.slice(0,29).trimEnd(),"..."):yn,An=E.evaluationResult;if(!An&&"right"===O)if(G){var Rn=null===(p=E.refIndexes)||void 0===p?void 0:p[0],En=K.find(function(n){return n.selfIndex===Rn});An=null==En?void 0:En.evaluationResult}else An=null===(h=K[w])||void 0===h?void 0:h.evaluationResult;var wn=null===(x=null==z?void 0:z.input_index_map)||void 0===x?void 0:x[0],On=null===(I=null==z?void 0:z.input_index_map)||void 0===I?void 0:I[1],Mn="left"===O?On:wn,Nn=function(n,e){var i;if(!e||!n)return null;for(var t=0,o=n;t<o.length;t++){var l=o[t];if(l.id===e||l.nodeId===e||l.contentId===e)return l;if(null===(i=l.subsections)||void 0===i?void 0:i.length){var r=Nn(l.subsections,e);if(r)return r}}return null},Tn="left"===O?E:Nn(K,E.id),Dn="right"===O?E:Nn(X,E.id),jn=u.default.useMemo(function(){if(!G)return 0;var n=1/0,e=function(n){var e=d.hasMeaningfulRedlineTags(n)?d.stripRedlineTags(n):n;return d.safeStringify(e||"").replace(/\\n/g,"\n")},i=function(t,o,l,r){if(t){var a=t.nodeId||t.id;if(r&&"right"===O){var s=K.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(t.selfIndex)});s.length>0&&(a=s[0].nodeId||s[0].id)}var u=t.nodeId||t.id||(null==o?void 0:o.nodeId)||(null==o?void 0:o.id)||(null==l?void 0:l.nodeId)||(null==l?void 0:l.id),c=t.evaluationResult||(null==o?void 0:o.evaluationResult)||(null==l?void 0:l.evaluationResult),v=(null==c?void 0:c.deviations)||{};Object.keys(v).forEach(function(i){var r,s=null===(r=v[i])||void 0===r?void 0:r[F];if(function(n,i){if("string"!=typeof i||d.isMissingStr(i))return!1;var t=e(null==n?void 0:n.content),o=e(i);return!!o&&t.includes(o)}("left"===O?o||t:l||t,s)){var c="".concat(a).concat(d.DEVIATION_BADGE_SEPARATOR).concat(i),f=null==H?void 0:H[c];null!=f&&f<n&&(n=f);var g="".concat(u).concat(d.DEVIATION_BADGE_SEPARATOR).concat(i),p=null==H?void 0:H[g];null!=p&&p<n&&(n=p)}});for(var f=t.subsections||[],g=(null==o?void 0:o.subsections)||[],p=(null==l?void 0:l.subsections)||[],h=Math.max(f.length,g.length,p.length),x=0;x<h;x++)i(f[x],g[x],p[x],!1)}},t="right"===O?K.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(E.selfIndex)}):[];if(1===t.length){var o=t[0];(o.refIndexes||[]).map(function(n){return X.find(function(e){return e.selfIndex===n})}).filter(Boolean).forEach(function(n){i(n,o,n,!0)})}else i(E,Tn,Dn,!0);return n!==1/0?n-1:0},[E,Tn,Dn,O,F,H,G,K,X]);if(G)if("left"===O){var Bn=null===(m=E.refIndexes)||void 0===m?void 0:m[0],Cn=X.findIndex(function(n){return n.selfIndex===Bn});Dn=-1!==Cn?X[Cn]:Nn(X,E.id)}else{var Fn=null===(_=E.refIndexes)||void 0===_?void 0:_[0],kn=K.findIndex(function(n){return n.selfIndex===Fn});Tn=-1!==kn?K[kn]:Nn(K,E.id)}var Pn="left"===O?!Dn:!Tn,Vn=G&&"right"===O&&d.hasSingleMappedLhsSection(E,K),Gn=An||(null==Tn?void 0:Tn.evaluationResult)||(null==Dn?void 0:Dn.evaluationResult),Wn=null!==(S=null===(b=null===(y=null==Gn?void 0:Gn.evaluation_outputs)||void 0===y?void 0:y.metadata)||void 0===b?void 0:b.label_color)&&void 0!==S?S:a.DEFAULT_DEVIAION_COLOR,qn=d.generateColorPalette(Wn).highlightBg,Ln=(null==Gn?void 0:Gn.deviations)||{},zn=u.default.useMemo(function(){return G&&"right"===O?d.getLhsDeviationDisplayIndexes(K,wn,H):new Map},[G,O,K,wn,H]),Kn=E.nodeId||E.id;if(G&&"left"!==O){var Xn=K.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(E.selfIndex)});Xn.length>0?Kn=Xn[0].nodeId||Xn[0].id:(null==Tn?void 0:Tn.id)&&(Kn=Tn.nodeId||Tn.id)}var Hn=u.default.useMemo(function(){var n,e=new Map;if(!G||"right"!==O)return e;var i=1,t=K.filter(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(E.selfIndex)}),o=1===t.length&&1===(null===(n=t[0].refIndexes)||void 0===n?void 0:n.length),l=function(n){return d.safeStringify(n||"").replace(/\\n/g,"\n")},r=function(n,e){var i=e?t[0]:Nn(K,n.nodeId||n.id||n.contentId);return{lhsNode:i,evalResult:n.evaluationResult||(null==i?void 0:i.evaluationResult),registryNodeId:i?i.nodeId||i.id:n.nodeId||n.id}};if(o){var a=function(n,e){if(void 0===e&&(e=!1),n){var t=r(n,e),o=t.lhsNode,s=t.evalResult,u=t.registryNodeId,c=l(n.content);Object.entries((null==s?void 0:s.deviations)||{}).forEach(function(n){var e=n[0],t=n[1],r=t[F],a=l(r);if(!!o&&!d.isMissingStr(t[Mn])&&a&&c.includes(a)){var s="".concat(u).concat(d.DEVIATION_BADGE_SEPARATOR).concat(e),v=H[s];null!=v&&(i=Math.max(i,Math.max(1,v-(jn||0))+1))}}),(n.subsections||[]).forEach(function(n){return a(n)})}};a(E,!0)}var s=function(n,t){if(void 0===t&&(t=!1),n){var o=r(n,t),a=o.lhsNode,u=o.evalResult,c=o.registryNodeId,v=(null==u?void 0:u.deviations)||{},f=l(n.content);Object.entries(v).map(function(n){var e,i=n[0],t=n[1],o=t[F],r=!a||d.isMissingStr(t[Mn]),s=l(o),u=s?f.indexOf(s):-1,v="".concat(c).concat(d.DEVIATION_BADGE_SEPARATOR).concat(i);return{refId:v,isRenderable:r&&!!s&&!d.isMissingStr(o),position:u,registryIndex:null!==(e=H[v])&&void 0!==e?e:Number.MAX_SAFE_INTEGER}}).filter(function(n){return n.isRenderable}).sort(function(n,e){return(-1===n.position?Number.MAX_SAFE_INTEGER:n.position)-(-1===e.position?Number.MAX_SAFE_INTEGER:e.position)||n.registryIndex-e.registryIndex}).forEach(function(n){e.set(n.refId,i++)}),(n.subsections||[]).forEach(function(n){return s(n)})}};return s(E,!0),e},[G,O,E,K,F,Mn,H,jn]),Un=Object.keys(Ln)[0],Yn=Un?"".concat(Kn).concat(d.DEVIATION_BADGE_SEPARATOR).concat(Un):null,Jn=Yn?null==U?void 0:U[Yn]:null,Qn=w+1;if(G&&dn){var Zn="left"===O?dn.leftNums.get(null==E?void 0:E.id):dn.rightNums.get(null==E?void 0:E.id);Pn&&void 0!==Zn?Qn=Zn:null!=Jn&&Jn>=0?Qn=Jn:void 0!==Zn&&(Qn=Zn)}else null!=Jn&&Jn>=0&&(Qn=Jn);var $n=Object.entries(Ln).map(function(n){var e=n[0],i=n[1],t="".concat(Kn).concat(d.DEVIATION_BADGE_SEPARATOR).concat(e);return{deviationKey:e,deviationMap:i,refId:t,currentIndex:H[t]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});$n.sort(function(n,e){return n.currentIndex-e.currentIndex});var ne,ee,ie=$n.map(function(e){var i,t,o,l,r,a,s=e.deviationKey,u=e.deviationMap,c=e.refId,v=e.currentIndex,f=u[F],g=d.isMissingStr(f);if(g)f="";else if(!f)return null;var p=w,h=w;if(G)if("left"===O){var x=null===(i=E.refIndexes)||void 0===i?void 0:i[0],I=X.findIndex(function(n){return n.selfIndex===x});if(-1!==I)h=I;else{var m=X.findIndex(function(n){return n.id===E.id||n.nodeId===E.nodeId||n.contentId===E.contentId});h=-1!==m?m:w}}else{var _=null===(t=E.refIndexes)||void 0===t?void 0:t[0],y=K.findIndex(function(n){return n.selfIndex===_});if(-1!==y)p=y;else p=-1!==(j=K.findIndex(function(n){return n.id===E.id||n.nodeId===E.nodeId||n.contentId===E.contentId}))?j:w}var b="".concat(Kn).concat(d.DEVIATION_BADGE_SEPARATOR).concat(s).concat(d.DEVIATION_BADGE_SEPARATOR).concat(p).concat(d.DEVIATION_BADGE_SEPARATOR).concat(h),S=u[Mn],A=Pn||d.isMissingStr(S),R=Hn.get(c),M=zn.get(c);G&&"right"===O&&A&&void 0!==R?v=R:G&&"right"===O&&!A&&void 0!==M?v=M:G&&void 0!==jn&&("right"!==O||A||Vn)&&(v-=jn),v=Math.max(1,v);var N=G&&"right"===O&&A&&dn?d.getRhsMappedSectionNumber({section:E,proposedSections:K,leftNums:dn.leftNums,fallbackNumber:String(Qn),firstOnly:!0}):Qn,T="".concat(N,".").concat(v),D=w;if("right"===O&&G){var j,B=null===(o=E.refIndexes)||void 0===o?void 0:o[0],C=K.findIndex(function(n){return n.selfIndex===B});if(-1!==C)D=C;else-1!==(j=K.findIndex(function(n){return n.id===E.id||n.nodeId===E.nodeId||n.contentId===E.contentId}))&&(D=j)}var k=Q?Q(D):null,P=(null==u?void 0:u.evaluation_outputs)||(null==Gn?void 0:Gn.evaluation_outputs),V=null!==(l=null==P?void 0:P.output_value)&&void 0!==l?l:null,W=null!==(a=null===(r=null==P?void 0:P.metadata)||void 0===r?void 0:r.label_color)&&void 0!==a?a:Wn,q=d.generateColorPalette(W),L=k?n.__assign(n.__assign({},k),{badgeBg:q.badgeBg,badgeBorder:q.badgeBorder,badgeText:q.badgeText}):n.__assign({},q),z=(null==u?void 0:u.deviation_summary)?{deviation_summary:u.deviation_summary,deviation_title:(null==u?void 0:u.deviation_title)||(null==Gn?void 0:Gn.deviation_title),deviation_impact:(null==u?void 0:u.deviation_impact)||(null==Gn?void 0:Gn.deviation_impact),deviation_explanation:(null==u?void 0:u.deviation_explanation)||(null==Gn?void 0:Gn.deviation_explanation),evaluation_outputs:P,cognitive_decisioning:(null==u?void 0:u.cognitive_decisioning)||(null==Gn?void 0:Gn.cognitive_decisioning)}:null,H=0,U=xn||"";if(f&&U){var nn=U.split(/\n{2,}/),en=nn.findIndex(function(n){return n.includes(f)});if(-1!==en){var tn=Object.entries(Ln).filter(function(n){n[0];var e=n[1][F];return e&&nn[en].includes(e)}).sort(function(n,e){return nn[en].indexOf(n[1][F])-nn[en].indexOf(e[1][F])}),un=tn.filter(function(n){n[0];var e=n[1][F];return e&&(e.includes(f)||f.includes(e))});un.length>1&&(H=Math.max(0,un.findIndex(function(n){return n[0]===s})))}}var cn=Y(O,c);return{id:c,actionId:b,label:T,highlight:f,side:O,style:L,stackIndex:H,score:V,isConnected:null==Z?void 0:Z.has(b),showScrollLockToggle:(null==Z?void 0:Z.has(b))||on&&ln===b||!!sn&&sn===cn.current,scrollSyncLocked:rn,toggleScrollSyncLocked:an,isOrphan:A,isMissingClause:g,badgeRef:cn,onClick:function(n){n.stopPropagation(),$&&$(n,Tn||{id:"orphan-left",title:"",content:""},A,Dn||{id:"orphan-right",title:"",content:""},b,L)},onSummaryClick:function(n){n.stopPropagation(),J(n,b,A,z)}}}).filter(Boolean),te=q||!gn&&vn?ie:[],oe=ie.map(function(n){return n.highlight}).filter(Boolean),le=E.id&&O===(null==B?void 0:B.columnKey)?B:null,re=u.default.useRef(!1);return i.useEffect(function(){D||(re.current=!1)},[D]),e.jsxs(t.Box,n.__assign({ref:M,sx:{mb:T,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[D&&(null==le?void 0:le.showAbove)&&e.jsx("div",n.__assign({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var n,e;return null===(e=null===(n=null==le?void 0:le.showAboveRef)||void 0===n?void 0:n.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth",block:"center"})}},{children:e.jsx("div",n.__assign({style:n.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===O?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===O?{right:"-20px"}:{left:"-20px"})},{children:e.jsx(o.ChevronUp,{color:(null===(A=null==le?void 0:le.showAboveRef)||void 0===A?void 0:A.current)?window.getComputedStyle(le.showAboveRef.current).color:void 0})}))})),e.jsxs(t.Accordion,n.__assign({disableGutters:!0,expanded:!_n&&D,onChange:function(){_n||(j(),P.current=E.id)},sx:{boxShadow:"none",border:_n?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:_n?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flexGrow:1,width:"100%",display:"flex",flexDirection:"column",minWidth:0,"&:before":{display:"none"},"& .MuiAccordion-heading":{position:"sticky",top:-12,zIndex:10,background:"#fff"}}},{children:[e.jsx(t.AccordionSummary,n.__assign({expandIcon:_n?null:e.jsx(o.ChevronDown,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:_n?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:cn&&e.jsx(t.Tooltip,n.__assign({title:yn,placement:"top"},{children:e.jsx(t.Typography,n.__assign({component:"div",sx:{fontSize:"12px",color:_n?"#94A3B8":"#19213D",fontWeight:_n?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(ne=Sn,ee=bn,void 0===ee&&(ee=!1),ne?d.safeStringify(ne).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(i,t){return i.startsWith("**")&&i.endsWith("**")?e.jsx("strong",{children:i.slice(2,-2)},t):e.jsxs("div",n.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%"}},{children:[e.jsx("span",n.__assign({style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:i})),ee&&e.jsx("span",n.__assign({style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0px 6px",borderRadius:"9999px",background:"#F3F4F6",border:"1px solid #D1D5DB",color:"#6B7280",fontSize:"9px",fontWeight:500,whiteSpace:"nowrap",flexShrink:0,lineHeight:1.4,marginRight:"4px"}},{children:"Multiple"}))]}),t)}):null)}))}))})),!_n&&e.jsxs(t.AccordionDetails,n.__assign({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[mn&&e.jsx(l.MemoizedMarkdown,{content:xn,overlayContent:In,sxStyles:V,highlights:oe,maintainRelativeOrder:G,highlightBg:qn,suppressHighlightBg:pn,deviationBadges:te,collisionKey:un}),(E.subsections||[]).map(function(n,e){return L({section:n,keyPath:"".concat(w,"-").concat(e),depth:0,columnKey:O,parentNodeId:F,sectionOffset:jn,rhsOrphanVisualIndexes:Hn})})]}))]})),D&&(null==le?void 0:le.showBelow)&&e.jsx("div",n.__assign({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var n,e;return null===(e=null===(n=null==le?void 0:le.showBelowRef)||void 0===n?void 0:n.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth",block:"center"})}},{children:e.jsx("div",n.__assign({style:n.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===O?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===O?{right:"-20px"}:{left:"-20px"})},{children:e.jsx(o.ChevronDown,{color:(null===(R=null==le?void 0:le.showBelowRef)||void 0===R?void 0:R.current)?window.getComputedStyle(le.showBelowRef.current).color:void 0})}))}))]}),"".concat(O,"-sec-").concat(w))};
2
2
  //# sourceMappingURL=SectionAccordion.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),a=require("../CompareContext.js"),d=require("../CognitiveComparehelpers.js"),r=require("../CognitiveCompareConstants.js");function s(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=s(i).default.memo(function(s){var c,v,f,g,p,h,_,m,x,y,S=s.section,b=s.keyPath,I=s.depth,A=void 0===I?0:I,O=s.columnKey,P=void 0===O?"left":O,R=s.parentNodeId,B=void 0===R?"":R,k=s.sectionOffset,C=a.useCompareContext(),E=C.expandedSubSections,j=C.setExpandedSubSections,w=C.maintainRelativeOrder,F=C.showDeviationBadges,M=void 0!==F&&F,D=C.proposedSections,N=C.existingSections,T=C.treeData,q=C.deviationNumberRegistry,L=C.deviationParentRegistry,V=C.connectedSections,K=C.activeSideBySideSection,W=C.isSideBySide,G=C.scrollSyncLocked,z=C.toggleScrollSyncLocked,H=C.summaryPopupAnchorEl,U=C.resolvedMarkdownStyles,J=C.getSubSectionRef,Q=C.getSubSectionCompareStyle,X=C.getBadgeRef,Y=C.openMoreFunctionsPopup,Z=C.openSummaryPopup,$=C.resetSideBySide,nn=C.setConnectedSections,en=C.setConnectedLines,tn=C.cachedConnectedPositions,on=C.isProposingFix,ln=C.proposingFixNodeId,an=C.isRedlineFlow,dn=C.unifiedNumbering,rn=null!=K?K:"",sn=(null===(c=S.displayTitle)||void 0===c||c)&&d.hasValue(S.title),un=!!on&&!!ln&&"left"===P&&S.id===ln,cn=d.hasMeaningfulRedlineTags(S.content),vn="boolean"==typeof an?an:cn,fn=cn,gn=vn&&cn,pn=gn?d.stripRedlineTags(S.content):S.content,hn=gn?S.content:void 0,_n=(null===(v=S.displayContent)||void 0===v||v||cn)&&d.hasValue(S.content),mn=!sn&&!_n,xn=sn?S.title:_n?"No Title Found":"No Matching Section Found",yn=!!E[b],Sn=J(P,b),bn=b.split("-").map(Number)[0],In=D[bn],An=N[bn],On=bn,Pn=bn,Rn=!1,Bn=function(n,e,i){if(!n||!e)return null;if(n.id===e)return{section:n,keyPath:i};for(var t=(n.subsections||[]).map(function(n,e){return{section:n,keyPath:"".concat(i,"-").concat(e)}}),o=function(){var n=t.shift();return(null==n?void 0:n.section)?n.section.id===e?{value:n}:void(n.section.subsections||[]).forEach(function(e,i){t.push({section:e,keyPath:"".concat(n.keyPath,"-").concat(i)})}):"continue"};t.length>0;){var l=o();if("object"==typeof l)return l.value}return null};if(w)if("left"===P){var kn=null===(f=null==In?void 0:In.refIndexes)||void 0===f?void 0:f[0],Cn=N.findIndex(function(n){return n.selfIndex===kn});-1!==Cn?(An=N[Cn],Pn=Cn):Rn=!0}else{var En=null===(g=null==An?void 0:An.refIndexes)||void 0===g?void 0:g[0],jn=D.findIndex(function(n){return n.selfIndex===En});-1!==jn?(In=D[jn],On=jn):Rn=!0}var wn=function(n,e){if(!e||!n)return null;for(var i=0;i<n.length;i++){var t=Bn(n[i],e,String(i));if(t)return t}return null},Fn=null,Mn=null,Dn="",Nn="";if(w)"left"===P?(Fn=S,Dn=b,(Tn=Bn(An,S.id,String(Pn)))||(Tn=wn(N,S.id)),Mn=(null==Tn?void 0:Tn.section)||null,Nn=(null==Tn?void 0:Tn.keyPath)||""):(Mn=S,Nn=b,(qn=Bn(In,S.id,String(On)))||(qn=wn(D,S.id)),Fn=(null==qn?void 0:qn.section)||null,Dn=(null==qn?void 0:qn.keyPath)||"");else if("left"===P){Fn=S,Dn=b;var Tn=wn(N,S.id);Mn=(null==Tn?void 0:Tn.section)||null,Nn=(null==Tn?void 0:Tn.keyPath)||""}else{Mn=S,Nn=b;var qn=wn(D,S.id);Fn=(null==qn?void 0:qn.section)||null,Dn=(null==qn?void 0:qn.keyPath)||""}var Ln=(Dn?Q(Dn):null)||Q(b),Vn=null===(p=null==T?void 0:T.input_index_map)||void 0===p?void 0:p[0],Kn=null===(h=null==T?void 0:T.input_index_map)||void 0===h?void 0:h[1],Wn="left"===P?Kn:Vn,Gn="left"===P?!Mn:!Fn,zn=S.evaluationResult||(null==Fn?void 0:Fn.evaluationResult)||(null==Mn?void 0:Mn.evaluationResult),Hn=(null==zn?void 0:zn.deviations)||{},Un=S.id||(null==Fn?void 0:Fn.id)||(null==Mn?void 0:Mn.id);w&&"left"!==P&&(null==Fn?void 0:Fn.id)&&(Un=Fn.id);var Jn=Object.keys(Hn)[0],Qn=Jn?"".concat(Un).concat(d.DEVIATION_BADGE_SEPARATOR).concat(Jn):null,Xn=Qn?null==L?void 0:L[Qn]:null,Yn=bn+1;if(w&&dn){var Zn="left"===P?dn.leftNums.get(null==In?void 0:In.id):dn.rightNums.get(null==An?void 0:An.id);Rn&&void 0!==Zn?Yn=Zn:null!=Xn&&Xn>=0?Yn=Xn:void 0!==Zn&&(Yn=Zn)}else null!=Xn&&Xn>=0&&(Yn=Xn);var $n=null!==(x=null===(m=null===(_=null==zn?void 0:zn.evaluation_outputs)||void 0===_?void 0:_.metadata)||void 0===m?void 0:m.label_color)&&void 0!==x?x:r.DEFAULT_DEVIAION_COLOR,ne=d.generateColorPalette($n).highlightBg,ee=Object.entries(Hn).map(function(n){var e=n[0],i=n[1],t="".concat(Un).concat(d.DEVIATION_BADGE_SEPARATOR).concat(e);return{deviationKey:e,deviationMap:i,refId:t,currentIndex:q[t]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});ee.sort(function(n,e){return n.currentIndex-e.currentIndex});var ie=ee.map(function(e){var i,t,o,l=e.deviationKey,a=e.deviationMap,r=e.refId,s=e.currentIndex;w&&void 0!==k&&(s-=k);var u=a[B],c=d.isMissingStr(u);if(c)u="";else if(!u)return null;var v=a[Wn],f=Gn||d.isMissingStr(v),g="".concat(Yn,".").concat(s),p="".concat(Un).concat(d.DEVIATION_BADGE_SEPARATOR).concat(l).concat(d.DEVIATION_BADGE_SEPARATOR).concat(Dn).concat(d.DEVIATION_BADGE_SEPARATOR).concat(Nn),h=(null==a?void 0:a.evaluation_outputs)||(null==zn?void 0:zn.evaluation_outputs),_=null!==(i=null==h?void 0:h.output_value)&&void 0!==i?i:null,m=null!==(o=null===(t=null==h?void 0:h.metadata)||void 0===t?void 0:t.label_color)&&void 0!==o?o:$n,x=d.generateColorPalette(m),y=n.__assign({},x),S=(null==a?void 0:a.deviation_summary)?{deviation_summary:a.deviation_summary||(null==zn?void 0:zn.deviation_summary),deviation_title:(null==a?void 0:a.deviation_title)||(null==zn?void 0:zn.deviation_title),deviation_impact:(null==a?void 0:a.deviation_impact)||(null==zn?void 0:zn.deviation_impact),deviation_explanation:(null==a?void 0:a.deviation_explanation)||(null==zn?void 0:zn.deviation_explanation),evaluation_outputs:h,cognitive_decisioning:(null==a?void 0:a.cognitive_decisioning)||(null==zn?void 0:zn.cognitive_decisioning)}:null,b=0,I=pn||"";if(u&&I){var A=I.split(/\n{2,}/),O=A.findIndex(function(n){return n.includes(u)});if(-1!==O){var R=Object.entries(Hn).filter(function(n){n[0];var e=n[1][B];return e&&A[O].includes(e)}).sort(function(n,e){return A[O].indexOf(n[1][B])-A[O].indexOf(e[1][B])}),C=R.filter(function(n){n[0];var e=n[1][B];return e&&(e.includes(u)||u.includes(e))});C.length>1&&(b=Math.max(0,C.findIndex(function(n){return n[0]===l})))}}var E=X(P,r);return{id:r,actionId:p,label:g,highlight:u,side:P,style:y,stackIndex:b,score:_,isConnected:V.has(p),showScrollLockToggle:V.has(p)||W&&K===p||!!H&&H===E.current,scrollSyncLocked:G,toggleScrollSyncLocked:z,isOrphan:f,isMissingClause:c,badgeRef:E,onClick:function(e){e.stopPropagation();var i=Fn?n.__assign(n.__assign({},Fn),{title:(null==In?void 0:In.title)||(null==Fn?void 0:Fn.title)||""}):{id:"orphan-left",title:"",content:""},t=Mn?n.__assign(n.__assign({},Mn),{title:(null==An?void 0:An.title)||(null==Mn?void 0:Mn.title)||""}):{id:"orphan-right",title:"",content:""};Y(e,i,f,t,p,y)},onSummaryClick:function(n){n.stopPropagation(),Z(n,p,f,S)}}}).filter(Boolean).sort(function(n,e){return parseFloat(n.label)-parseFloat(e.label)}),te=i.useMemo(function(){var n=new Set;return ie.filter(function(e){return!n.has(e.id)&&(n.add(e.id),!0)})},[ie]),oe=M||!vn&&un?te:[],le=te.map(function(n){return n.highlight}).filter(Boolean),ae=ie.find(function(n){return V.has(n.actionId)}),de=!!ae;if(!(sn||_n||S.subsections&&0!==S.subsections.length))return null;var re=(null===(y=null==ae?void 0:ae.style)||void 0===y?void 0:y.badgeBorder)||(null==Ln?void 0:Ln.badgeBorder),se=de&&re?{borderRadius:"4px",outline:"2px solid ".concat(re),outlineOffset:"1px"}:{};return sn?e.jsx(t.Box,n.__assign({ref:Sn,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:e.jsx(t.Box,n.__assign({sx:n.__assign({width:"100%"},se)},{children:e.jsxs(t.Accordion,n.__assign({disableGutters:!0,expanded:!mn&&yn,onChange:function(){if(!mn){if(yn){var e=String(K||""),i=e.includes(Dn)||e.includes(Nn);i||V.forEach(function(n){(String(n).includes(Dn)||String(n).includes(Nn))&&(i=!0)}),i&&($(),nn(new Set),en([]),tn.current=[])}j(function(e){var i;return n.__assign(n.__assign({},e),((i={})[b]=!e[b],i))})}},sx:{mt:0,boxShadow:"none",border:mn?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[e.jsx(t.AccordionSummary,n.__assign({expandIcon:mn?null:e.jsx(o.ChevronDown,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:e.jsx(t.Typography,n.__assign({component:"div",sx:{fontSize:"11px",fontWeight:600,color:mn?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:xn||"Untitled Subsection"}))})),!mn&&e.jsxs(t.AccordionDetails,n.__assign({sx:{pt:0,pb:1,minWidth:0}},{children:[_n&&e.jsx(l.MemoizedMarkdown,{content:pn,overlayContent:hn,sxStyles:U,deviationBadges:oe,maintainRelativeOrder:w,highlightBg:ne,suppressHighlightBg:fn,highlights:le,collisionKey:rn}),(S.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(b,"-").concat(i),depth:A+1,columnKey:P,parentNodeId:B},"".concat(b,"-").concat(i))})]}))]}))}))})):e.jsx(t.Box,n.__assign({ref:Sn,sx:{mt:0===A?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!mn&&e.jsxs(t.Box,n.__assign({sx:n.__assign({width:"100%"},se)},{children:[_n&&e.jsx(l.MemoizedMarkdown,{content:pn,overlayContent:hn,sxStyles:U,deviationBadges:oe,maintainRelativeOrder:w,highlightBg:ne,suppressHighlightBg:fn,highlights:le,collisionKey:rn}),(S.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(b,"-").concat(i),depth:A+1,columnKey:P,parentNodeId:B,sectionOffset:k},"".concat(b,"-").concat(i))})]}))}))});exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),d=require("../CompareContext.js"),r=require("../CognitiveComparehelpers.js"),a=require("../CognitiveCompareConstants.js");function s(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=s(i).default.memo(function(s){var c,v,f,g,p,h,_,m,x,S,I=s.section,y=s.keyPath,b=s.depth,O=void 0===b?0:b,A=s.columnKey,E=void 0===A?"left":A,M=s.parentNodeId,R=void 0===M?"":M,P=s.sectionOffset,k=s.rhsOrphanVisualIndexes,B=d.useCompareContext(),C=B.expandedSubSections,N=B.setExpandedSubSections,j=B.maintainRelativeOrder,w=B.showDeviationBadges,F=void 0!==w&&w,D=B.proposedSections,T=B.existingSections,V=B.treeData,L=B.deviationNumberRegistry,q=B.deviationParentRegistry,G=B.connectedSections,K=B.activeSideBySideSection,W=B.isSideBySide,z=B.scrollSyncLocked,H=B.toggleScrollSyncLocked,U=B.summaryPopupAnchorEl,X=B.resolvedMarkdownStyles,J=B.getSubSectionRef,Q=B.getSubSectionCompareStyle,Y=B.getBadgeRef,Z=B.openMoreFunctionsPopup,$=B.openSummaryPopup,nn=B.resetSideBySide,en=B.setConnectedSections,tn=B.setConnectedLines,on=B.cachedConnectedPositions,ln=B.isProposingFix,dn=B.proposingFixNodeId,rn=B.isRedlineFlow,an=B.unifiedNumbering,sn=null!=K?K:"",un=(null===(c=I.displayTitle)||void 0===c||c)&&r.hasValue(I.title),cn=!(!ln||!dn||"left"!==E||I.id!==dn&&I.nodeId!==dn),vn=r.hasMeaningfulRedlineTags(I.content),fn="boolean"==typeof rn?rn:vn,gn=vn,pn=fn&&vn,hn=pn?r.stripRedlineTags(I.content):I.content,_n=pn?I.content:void 0,mn=(null===(v=I.displayContent)||void 0===v||v||vn)&&r.hasValue(I.content),xn=!un&&!mn,Sn=un?I.title:mn?"No Title Found":"No Matching Section Found",In=!!C[y],yn=J(E,y),bn=y.split("-").map(Number)[0],On=D[bn],An=T[bn],En=bn,Mn=bn,Rn=!1,Pn=function(n,e,i){if(!n||!e)return null;if(n.id===e||n.nodeId===e||n.contentId===e)return{section:n,keyPath:i};for(var t=(n.subsections||[]).map(function(n,e){return{section:n,keyPath:"".concat(i,"-").concat(e)}}),o=function(){var n=t.shift();return(null==n?void 0:n.section)?n.section.id===e||n.section.nodeId===e||n.section.contentId===e?{value:n}:void(n.section.subsections||[]).forEach(function(e,i){t.push({section:e,keyPath:"".concat(n.keyPath,"-").concat(i)})}):"continue"};t.length>0;){var l=o();if("object"==typeof l)return l.value}return null};if(j)if("left"===E){var kn=null===(f=null==On?void 0:On.refIndexes)||void 0===f?void 0:f[0],Bn=T.findIndex(function(n){return n.selfIndex===kn});-1!==Bn?(An=T[Bn],Mn=Bn):Rn=!0}else{var Cn=null===(g=null==An?void 0:An.refIndexes)||void 0===g?void 0:g[0],Nn=D.findIndex(function(n){return n.selfIndex===Cn});-1!==Nn?(On=D[Nn],En=Nn):Rn=!0}var jn=function(n,e){if(!e||!n)return null;for(var i=0;i<n.length;i++){var t=Pn(n[i],e,String(i));if(t)return t}return null},wn=null,Fn=null,Dn="",Tn="";if(j)"left"===E?(wn=I,Dn=y,(Vn=Pn(An,I.nodeId||I.id,String(Mn)))||(Vn=jn(T,I.nodeId||I.id)),Fn=(null==Vn?void 0:Vn.section)||null,Tn=(null==Vn?void 0:Vn.keyPath)||""):(Fn=I,Tn=y,(Ln=Pn(On,I.nodeId||I.id,String(En)))||(Ln=jn(D,I.nodeId||I.id)),wn=(null==Ln?void 0:Ln.section)||null,Dn=(null==Ln?void 0:Ln.keyPath)||"");else if("left"===E){wn=I,Dn=y;var Vn=jn(T,I.nodeId||I.id);Fn=(null==Vn?void 0:Vn.section)||null,Tn=(null==Vn?void 0:Vn.keyPath)||""}else{Fn=I,Tn=y;var Ln=jn(D,I.nodeId||I.id);wn=(null==Ln?void 0:Ln.section)||null,Dn=(null==Ln?void 0:Ln.keyPath)||""}var qn=(Dn?Q(Dn):null)||Q(y),Gn=null===(p=null==V?void 0:V.input_index_map)||void 0===p?void 0:p[0],Kn=null===(h=null==V?void 0:V.input_index_map)||void 0===h?void 0:h[1],Wn="left"===E?Kn:Gn,zn="left"===E?!Fn:!wn,Hn=j&&"right"===E&&r.hasSingleMappedLhsSection(An,D),Un=I.evaluationResult||(null==wn?void 0:wn.evaluationResult)||(null==Fn?void 0:Fn.evaluationResult),Xn=(null==Un?void 0:Un.deviations)||{},Jn=i.useMemo(function(){return j&&"right"===E?r.getLhsDeviationDisplayIndexes(D,Gn,L):new Map},[j,E,D,Gn,L]),Qn=I.nodeId||I.id||(null==wn?void 0:wn.nodeId)||(null==wn?void 0:wn.id)||(null==Fn?void 0:Fn.nodeId)||(null==Fn?void 0:Fn.id);j&&"left"!==E&&(null==wn?void 0:wn.id)&&(Qn=wn.nodeId||wn.id);var Yn=Object.keys(Xn)[0],Zn=Yn?"".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Yn):null,$n=Zn?null==q?void 0:q[Zn]:null,ne=bn+1;if(j&&an){var ee="left"===E?an.leftNums.get(null==On?void 0:On.id):an.rightNums.get(null==An?void 0:An.id);Rn&&void 0!==ee?ne=ee:null!=$n&&$n>=0?ne=$n:void 0!==ee&&(ne=ee)}else null!=$n&&$n>=0&&(ne=$n);var ie=null!==(x=null===(m=null===(_=null==Un?void 0:Un.evaluation_outputs)||void 0===_?void 0:_.metadata)||void 0===m?void 0:m.label_color)&&void 0!==x?x:a.DEFAULT_DEVIAION_COLOR,te=r.generateColorPalette(ie).highlightBg,oe=Object.entries(Xn).map(function(n){var e=n[0],i=n[1],t="".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(e);return{deviationKey:e,deviationMap:i,refId:t,currentIndex:L[t]}}).filter(function(n){return void 0!==n.currentIndex&&null!==n.currentIndex});oe.sort(function(n,e){return n.currentIndex-e.currentIndex});var le=new Map;if(!k&&j&&"right"===E){var de=r.safeStringify(hn||"").replace(/\\n/g,"\n");oe.filter(function(n){var e=n.deviationMap,i=e[R];return(zn||r.isMissingStr(e[Wn]))&&!!i&&!r.isMissingStr(i)}).map(function(e){var i=r.safeStringify(e.deviationMap[R]||"").replace(/\\n/g,"\n"),t=i?de.indexOf(i):-1;return n.__assign(n.__assign({},e),{position:t})}).sort(function(n,e){return(-1===n.position?Number.MAX_SAFE_INTEGER:n.position)-(-1===e.position?Number.MAX_SAFE_INTEGER:e.position)||n.currentIndex-e.currentIndex}).forEach(function(n,e){le.set(n.refId,e+1)})}var re=oe.map(function(e){var i,t,o,l,d=e.deviationKey,a=e.deviationMap,s=e.refId,u=e.currentIndex,c=a[R],v=r.isMissingStr(c);if(v)c="";else if(!c)return null;var f=a[Wn],g=zn||r.isMissingStr(f),p=null!==(i=null==k?void 0:k.get(s))&&void 0!==i?i:le.get(s),h=Jn.get(s);j&&"right"===E&&g&&void 0!==p?u=p:j&&"right"===E&&!g&&void 0!==h?u=h:j&&void 0!==P&&("right"!==E||g||Hn)&&(u-=P),u=Math.max(1,u);var _=j&&"right"===E&&g&&an?r.getRhsMappedSectionNumber({section:An,proposedSections:D,leftNums:an.leftNums,fallbackNumber:String(ne),firstOnly:!0}):ne,m="".concat(_,".").concat(u),x="".concat(Qn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(d).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Dn).concat(r.DEVIATION_BADGE_SEPARATOR).concat(Tn),S=(null==a?void 0:a.evaluation_outputs)||(null==Un?void 0:Un.evaluation_outputs),I=null!==(t=null==S?void 0:S.output_value)&&void 0!==t?t:null,y=null!==(l=null===(o=null==S?void 0:S.metadata)||void 0===o?void 0:o.label_color)&&void 0!==l?l:ie,b=r.generateColorPalette(y),O=n.__assign({},b),A=(null==a?void 0:a.deviation_summary)?{deviation_summary:a.deviation_summary||(null==Un?void 0:Un.deviation_summary),deviation_title:(null==a?void 0:a.deviation_title)||(null==Un?void 0:Un.deviation_title),deviation_impact:(null==a?void 0:a.deviation_impact)||(null==Un?void 0:Un.deviation_impact),deviation_explanation:(null==a?void 0:a.deviation_explanation)||(null==Un?void 0:Un.deviation_explanation),evaluation_outputs:S,cognitive_decisioning:(null==a?void 0:a.cognitive_decisioning)||(null==Un?void 0:Un.cognitive_decisioning)}:null,M=0,B=hn||"";if(c&&B){var C=B.split(/\n{2,}/),N=C.findIndex(function(n){return n.includes(c)});if(-1!==N){var w=Object.entries(Xn).filter(function(n){n[0];var e=n[1][R];return e&&C[N].includes(e)}).sort(function(n,e){return C[N].indexOf(n[1][R])-C[N].indexOf(e[1][R])}),F=w.filter(function(n){n[0];var e=n[1][R];return e&&(e.includes(c)||c.includes(e))});F.length>1&&(M=Math.max(0,F.findIndex(function(n){return n[0]===d})))}}var T=Y(E,s);return{id:s,actionId:x,label:m,highlight:c,side:E,style:O,stackIndex:M,score:I,isConnected:G.has(x),showScrollLockToggle:G.has(x)||W&&K===x||!!U&&U===T.current,scrollSyncLocked:z,toggleScrollSyncLocked:H,isOrphan:g,isMissingClause:v,badgeRef:T,onClick:function(e){e.stopPropagation();var i=wn?n.__assign(n.__assign({},wn),{title:(null==On?void 0:On.title)||(null==wn?void 0:wn.title)||""}):{id:"orphan-left",title:"",content:""},t=Fn?n.__assign(n.__assign({},Fn),{title:(null==An?void 0:An.title)||(null==Fn?void 0:Fn.title)||""}):{id:"orphan-right",title:"",content:""};Z(e,i,g,t,x,O)},onSummaryClick:function(n){n.stopPropagation(),$(n,x,g,A)}}}).filter(Boolean).sort(function(n,e){return parseFloat(n.label)-parseFloat(e.label)}),ae=i.useMemo(function(){var n=new Set;return re.filter(function(e){return!n.has(e.id)&&(n.add(e.id),!0)})},[re]),se=F||!fn&&cn?ae:[],ue=ae.map(function(n){return n.highlight}).filter(Boolean),ce=re.find(function(n){return G.has(n.actionId)}),ve=!!ce;if(!(un||mn||I.subsections&&0!==I.subsections.length))return null;var fe=(null===(S=null==ce?void 0:ce.style)||void 0===S?void 0:S.badgeBorder)||(null==qn?void 0:qn.badgeBorder),ge=ve&&fe?{borderRadius:"4px",outline:"2px solid ".concat(fe),outlineOffset:"1px"}:{};return un?e.jsx(t.Box,n.__assign({ref:yn,sx:{mt:1,width:"100%",minWidth:0,position:"relative"}},{children:e.jsx(t.Box,n.__assign({sx:n.__assign({width:"100%"},ge)},{children:e.jsxs(t.Accordion,n.__assign({disableGutters:!0,expanded:!xn&&In,onChange:function(){if(!xn){if(In){var e=String(K||""),i=e.includes(Dn)||e.includes(Tn);i||G.forEach(function(n){(String(n).includes(Dn)||String(n).includes(Tn))&&(i=!0)}),i&&(nn(),en(new Set),tn([]),on.current=[])}N(function(e){var i;return n.__assign(n.__assign({},e),((i={})[y]=!e[y],i))})}},sx:{mt:0,boxShadow:"none",border:xn?"1px dashed #E2E8F0":"1px solid #EEF2F7",borderRadius:"4px !important",bgcolor:"#FFFFFF",minWidth:0,"&:before":{display:"none"}}},{children:[e.jsx(t.AccordionSummary,n.__assign({expandIcon:xn?null:e.jsx(o.ChevronDown,{size:14}),sx:{minHeight:"32px","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"}}},{children:e.jsx(t.Typography,n.__assign({component:"div",sx:{fontSize:"11px",fontWeight:600,color:xn?"#94A3B8":"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:Sn||"Untitled Subsection"}))})),!xn&&e.jsxs(t.AccordionDetails,n.__assign({sx:{pt:0,pb:1,minWidth:0}},{children:[mn&&e.jsx(l.MemoizedMarkdown,{content:hn,overlayContent:_n,sxStyles:X,deviationBadges:se,maintainRelativeOrder:j,highlightBg:te,suppressHighlightBg:gn,highlights:ue,collisionKey:sn}),(I.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(y,"-").concat(i),depth:O+1,columnKey:E,parentNodeId:R,sectionOffset:P,rhsOrphanVisualIndexes:k},"".concat(y,"-").concat(i))})]}))]}))}))})):e.jsx(t.Box,n.__assign({ref:yn,sx:{mt:0===O?1:.75,width:"100%",minWidth:0,position:"relative"}},{children:!xn&&e.jsxs(t.Box,n.__assign({sx:n.__assign({width:"100%"},ge)},{children:[mn&&e.jsx(l.MemoizedMarkdown,{content:hn,overlayContent:_n,sxStyles:X,deviationBadges:se,maintainRelativeOrder:j,highlightBg:te,suppressHighlightBg:gn,highlights:ue,collisionKey:sn}),(I.subsections||[]).map(function(n,i){return e.jsx(u,{section:n,keyPath:"".concat(y,"-").concat(i),depth:O+1,columnKey:E,parentNodeId:R,sectionOffset:P,rhsOrphanVisualIndexes:k},"".concat(y,"-").concat(i))})]}))}))});exports.default=u;
2
2
  //# sourceMappingURL=SubSectionAccordion.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("lucide-react"),n=require("../../../assests/svg/ButtonCognitiveIcon.js"),s=require("../CognitiveComparehelpers.js"),o=require("../CognitiveCompareConstants.js"),l=require("./ThreeDotsLoader.js"),r=require("./connectedLines.js"),a=require("@mui/material");exports.default=function(d){var c=d.svgContainerRef,u=d.svgDimensions,g=d.isResizing,v=d.overallConnector,x=d.rootDeviationStyle,p=d.lines,h=d.isSideBySide,y=d.activeSideBySideSection,b=d.isArrowVisible,f=d.maintainRelativeOrder,S=d.proposedSections,_=d.existingSections,j=d.cognitivePopup,m=d.activeBadgeId,I=d.closeCognitivePopup,B=d.setActiveBadgeId,C=d.openCognitivePopupFromState,R=d.buildSectionPopupState,A=d.connectedLines,P=d.pathRefs;return t.jsxs("svg",e.__assign({ref:c,style:{position:"absolute",top:0,left:0,width:u.width||"100%",height:u.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:g?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[v&&t.jsx("g",{children:t.jsx("line",{x1:v.x1,y1:v.y,x2:v.x2,y2:v.y,stroke:x.badgeBorder,strokeWidth:"1.5"})}),p.map(function(r){var d,c,u,g,v,x,p,A=r.x1+.5*(r.x2-r.x1),P=(r.y1+r.y2)/2;if("Not Defined"===r.style.label&&!r.hasCognitive)return null;if(r.isSubSection?h&&y===r.subSectionKeyPath&&b:h&&y===r.sectionIdx&&b)return null;if(f)return null;var D=r.isSubSection?s.getBentArrowPath(r.x1,r.y1,r.x2,r.y2):"M ".concat(r.x1," ").concat(r.y1," L ").concat(r.x2," ").concat(r.y2),w=S[r.sectionIdx]||{title:"",content:""},E=_[null!==(d=r.targetRightIdx)&&void 0!==d?d:r.sectionIdx]||{title:"",content:""};if(r.isSubSection&&r.subSectionKeyPath){var O=r.subSectionKeyPath.includes(s.DEVIATION_BADGE_SEPARATOR)?r.subSectionKeyPath.split(s.DEVIATION_BADGE_SEPARATOR):[],T=O[2]||r.subSectionKeyPath,q=O[3]||T,L=T.split("-").map(Number),N=q.split("-").map(Number),k=null,K=null;L.length>0&&(k=S[L[0]]||null),N.length>0&&(K=_[N[0]]||null);for(var z=(null==k?void 0:k.title)||"",V=(null==K?void 0:K.title)||"",F=1;F<L.length;F+=1)(null==k?void 0:k.subsections)&&(k=k.subsections[L[F]]||null);for(F=1;F<N.length;F+=1)(null==K?void 0:K.subsections)&&(K=K.subsections[N[F]]||null);k&&(w=e.__assign(e.__assign({},k),{title:z||k.title})),K&&(E=e.__assign(e.__assign({},K),{title:V||K.title}))}var M=!(null===(c=w.cognitiveData)||void 0===c?void 0:c.isMissingRationale)||Boolean(null===(g=null===(u=w.cognitiveData)||void 0===u?void 0:u.decisioning)||void 0===g?void 0:g.length),W=(null===(p=null===(x=null===(v=w.evaluationResult)||void 0===v?void 0:v.cognitive_decisioning)||void 0===x?void 0:x.decisioning_factors)||void 0===p?void 0:p.length)||!1,G=M||W;return t.jsxs("g",{children:[t.jsx("path",{d:D,fill:"none",stroke:r.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),t.jsx("foreignObject",e.__assign({x:A-100,y:P-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:t.jsx(a.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t.jsxs(a.Box,e.__assign({onClick:function(e){e.stopPropagation(),G&&(j.open&&m===r.id?I():(B(r.id),C(R(e.currentTarget,w,E,r.sectionIdx,!1,r.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:r.style.badgeBg,color:r.style.badgeText,border:"1px solid ".concat(r.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:G?"pointer":"default"}},{children:[r.style.badgeText===o.DEFAULT_DEVIAION_COLOR&&null==r.style.label?t.jsx(l.default,{color:r.style.badgeText}):null==r.style.label?null:"0"===String(r.style.label)?"Same":r.style.label,t.jsx(a.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:t.jsx(n.ButtonCognitiveIcon,{})})),G&&t.jsx(i.ChevronDown,{size:11,style:{transform:j.open&&m===r.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},r.id)}),t.jsx(r.default,{maintainRelativeOrder:f,connectedLines:A,pathRefs:P})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("lucide-react"),n=require("../../../assests/svg/ButtonCognitiveIcon.js"),s=require("../CognitiveComparehelpers.js"),o=require("../CognitiveCompareConstants.js"),l=require("./ThreeDotsLoader.js"),r=require("./connectedLines.js"),a=require("@mui/material");exports.default=function(d){var c=d.svgContainerRef,u=d.svgDimensions,g=d.isResizing,v=d.overallConnector,x=d.rootDeviationStyle,p=d.lines,h=d.isSideBySide,y=d.activeSideBySideSection,b=d.isArrowVisible,f=d.maintainRelativeOrder,S=d.proposedSections,_=d.existingSections,j=d.cognitivePopup,m=d.activeBadgeId,I=d.closeCognitivePopup,B=d.setActiveBadgeId,C=d.openCognitivePopupFromState,R=d.buildSectionPopupState,A=d.connectedLines,P=d.pathRefs,D=d.isGuidelineMode;return i.jsxs("svg",e.__assign({ref:c,style:{position:"absolute",top:0,left:0,width:u.width||"100%",height:u.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",opacity:g?0:1,transition:"opacity 0.15s ease-in-out"}},{children:[v&&i.jsx("g",{children:i.jsx("line",{x1:v.x1,y1:v.y,x2:v.x2,y2:v.y,stroke:x.badgeBorder,strokeWidth:"1.5"})}),p.map(function(r){var d,c,u,g,v,x,p,A=r.x1+.5*(r.x2-r.x1),P=(r.y1+r.y2)/2;if("Not Defined"===r.style.label&&!r.hasCognitive)return null;if(r.isSubSection?h&&y===r.subSectionKeyPath&&b:h&&y===r.sectionIdx&&b)return null;if(f)return null;var D=r.isSubSection?s.getBentArrowPath(r.x1,r.y1,r.x2,r.y2):"M ".concat(r.x1," ").concat(r.y1," L ").concat(r.x2," ").concat(r.y2),w=S[r.sectionIdx]||{title:"",content:""},E=_[null!==(d=r.targetRightIdx)&&void 0!==d?d:r.sectionIdx]||{title:"",content:""};if(r.isSubSection&&r.subSectionKeyPath){var O=r.subSectionKeyPath.includes(s.DEVIATION_BADGE_SEPARATOR)?r.subSectionKeyPath.split(s.DEVIATION_BADGE_SEPARATOR):[],T=O[2]||r.subSectionKeyPath,q=O[3]||T,L=T.split("-").map(Number),N=q.split("-").map(Number),k=null,K=null;L.length>0&&(k=S[L[0]]||null),N.length>0&&(K=_[N[0]]||null);for(var M=(null==k?void 0:k.title)||"",z=(null==K?void 0:K.title)||"",G=1;G<L.length;G+=1)(null==k?void 0:k.subsections)&&(k=k.subsections[L[G]]||null);for(G=1;G<N.length;G+=1)(null==K?void 0:K.subsections)&&(K=K.subsections[N[G]]||null);k&&(w=e.__assign(e.__assign({},k),{title:M||k.title})),K&&(E=e.__assign(e.__assign({},K),{title:z||K.title}))}var V=!(null===(c=w.cognitiveData)||void 0===c?void 0:c.isMissingRationale)||Boolean(null===(g=null===(u=w.cognitiveData)||void 0===u?void 0:u.decisioning)||void 0===g?void 0:g.length),F=(null===(p=null===(x=null===(v=w.evaluationResult)||void 0===v?void 0:v.cognitive_decisioning)||void 0===x?void 0:x.decisioning_factors)||void 0===p?void 0:p.length)||!1,W=V||F;return i.jsxs("g",{children:[i.jsx("path",{d:D,fill:"none",stroke:r.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i.jsx("foreignObject",e.__assign({x:A-100,y:P-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i.jsx(a.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:i.jsxs(a.Box,e.__assign({onClick:function(e){e.stopPropagation(),W&&(j.open&&m===r.id?I():(B(r.id),C(R(e.currentTarget,w,E,r.sectionIdx,!1,r.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:r.style.badgeBg,color:r.style.badgeText,border:"1px solid ".concat(r.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:W?"pointer":"default"}},{children:[r.style.badgeText===o.DEFAULT_DEVIAION_COLOR&&null==r.style.label?i.jsx(l.default,{color:r.style.badgeText}):null==r.style.label?null:"0"===String(r.style.label)?"Same":r.style.label,i.jsx(a.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i.jsx(n.ButtonCognitiveIcon,{})})),W&&i.jsx(t.ChevronDown,{size:11,style:{transform:j.open&&m===r.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},r.id)}),i.jsx(r.default,{maintainRelativeOrder:f,connectedLines:A,pathRefs:P,isGuidelineMode:D})]}))};
2
2
  //# sourceMappingURL=SvgConnectors.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("@mui/material"),o=require("./ScrollLockToggle.js"),n=require("../CompareContext.js");exports.default=function(i){var s=i.connectedLines,c=i.pathRefs,a=i.maintainRelativeOrder,l=n.useCompareContext(),d=l.scrollSyncLocked,u=l.toggleScrollSyncLocked;return r.jsx(r.Fragment,{children:s.map(function(n){var i,s,l=n.pathD,x=(null===(i=n.style)||void 0===i?void 0:i.badgeBorder)||"#6366F1",f="conn-marker-".concat(n.id),p="".concat(n.id,"-bg"),g="".concat(n.id,"-stroke"),h="".concat(n.id,"-btn"),j=void 0!==n.x1?n.x1+40:0,k=void 0!==n.y1?n.y1:0;return r.jsxs("g",{children:[r.jsx("defs",{children:r.jsx("clipPath",e.__assign({id:"connections-clip"},{children:r.jsx("marker",e.__assign({id:f,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:r.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:x})}))}))}),r.jsx("path",{ref:function(e){c.current[p]=e},d:l,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),r.jsx("path",{ref:function(e){c.current[g]=e},d:l,fill:"none",stroke:x,strokeWidth:"1.75",markerEnd:"url(#".concat(f,")")}),a&&void 0!==n.x1&&r.jsx("foreignObject",e.__assign({ref:function(e){c.current[h]=e},x:j-12,y:k-12,width:"24",height:"24",style:{pointerEvents:"auto",overflow:"visible"}},{children:r.jsx(t.Box,e.__assign({onClick:function(e){e.stopPropagation(),u&&u(e)},sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",bgcolor:"#FFFFFF",borderRadius:"50%",border:"1px solid ".concat(x),cursor:"pointer",transition:"transform 0.2s ease","&:hover":{transform:"scale(1.05)",boxShadow:"0px 2px 4px rgba(0,0,0,0.1)"}}},{children:r.jsx(o.default,{locked:d,onToggle:u,color:(null===(s=n.style)||void 0===s?void 0:s.badgeText)||x,borderColor:"transparent",size:12})}))}))]},n.id)})})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("@mui/material"),n=require("./ScrollLockToggle.js"),r=require("../CompareContext.js");exports.default=function(o){var s=o.connectedLines,l=o.pathRefs,d=o.maintainRelativeOrder,a=r.useCompareContext(),c=a.scrollSyncLocked,u=a.toggleScrollSyncLocked,f=a.isGuidelineMode;return t.jsxs(t.Fragment,{children:[s.map(function(i){var n,r,o,s=i.pathD,d=(null===(n=i.style)||void 0===n?void 0:n.badgeBorder)||"#6366F1",a="conn-marker-".concat(i.id),c="".concat(i.id,"-bg"),u="".concat(i.id,"-stroke"),x="".concat(i.id,"-number");return t.jsxs("g",{children:[t.jsx("defs",{children:t.jsx("clipPath",e.__assign({id:"connections-clip"},{children:t.jsx("marker",e.__assign({id:a,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:t.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:d})}))}))}),t.jsx("path",{ref:function(e){l.current[c]=e},d:s,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),t.jsx("path",{ref:function(e){l.current[u]=e},d:s,fill:"none",stroke:d,strokeWidth:"1.75",markerEnd:"url(#".concat(a,")")}),f&&i.matchLabel&&t.jsxs("g",e.__assign({ref:function(e){l.current[x]=e},transform:"translate(".concat(i.x2-42,", ").concat(i.y2,")"),style:{pointerEvents:"none",transition:"visibility 0ms"}},{children:[t.jsx("rect",{x:"-22",y:"-8",width:"44",height:"16",rx:"4",fill:"#FFFFFF"}),t.jsx("rect",{x:"-21",y:"-7",width:"42",height:"14",rx:"3",fill:(null===(r=i.style)||void 0===r?void 0:r.badgeBg)||"#FEF08A",stroke:d,strokeWidth:"1"}),t.jsx("text",e.__assign({x:"0",y:"3.5",fontSize:"9px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',fill:(null===(o=i.style)||void 0===o?void 0:o.badgeText)||d,textAnchor:"middle"},{children:i.matchLabel}))]}))]},i.id)}),t.jsxs("g",{children:[t.jsxs("g",e.__assign({style:{transition:"visibility 0ms"}},{children:[t.jsx("path",{ref:function(e){return l.current["guideline-up-stroke"]=e},fill:"none",strokeWidth:"1.75",visibility:"hidden"}),t.jsxs("g",e.__assign({ref:function(e){return l.current["guideline-up-badge"]=e},visibility:"hidden"},{children:[t.jsx("polygon",{ref:function(e){return l.current["guideline-up-arrow"]=e},points:"-4,0 0,-6 4,0"}),t.jsx("rect",{ref:function(e){return l.current["guideline-up-badge-rect"]=e},x:"-12",y:"3",width:"24",height:"15",rx:"4",fill:"#FFFFFF",strokeWidth:"1"}),t.jsx("text",{ref:function(e){return l.current["guideline-up-text"]=e},x:"0",y:"14",fontSize:"10px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',textAnchor:"middle"})]}))]})),t.jsxs("g",e.__assign({style:{transition:"visibility 0ms"}},{children:[t.jsx("path",{ref:function(e){return l.current["guideline-down-stroke"]=e},fill:"none",strokeWidth:"1.75",visibility:"hidden"}),t.jsxs("g",e.__assign({ref:function(e){return l.current["guideline-down-badge"]=e},visibility:"hidden"},{children:[t.jsx("polygon",{ref:function(e){return l.current["guideline-down-arrow"]=e},points:"-4,0 0,6 4,0"}),t.jsx("rect",{ref:function(e){return l.current["guideline-down-badge-rect"]=e},x:"-12",y:"-18",width:"24",height:"15",rx:"4",fill:"#FFFFFF",strokeWidth:"1"}),t.jsx("text",{ref:function(e){return l.current["guideline-down-text"]=e},x:"0",y:"-7",fontSize:"10px",fontWeight:"bold",fontFamily:'"Plus Jakarta Sans", sans-serif',textAnchor:"middle"})]}))]}))]}),d&&!f&&s.map(function(r){var o,s;if(void 0===r.x1)return null;var d=(null===(o=r.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",a="".concat(r.id,"-btn"),f=r.x1+40,x=void 0!==r.y1?r.y1:0;return t.jsx("foreignObject",e.__assign({ref:function(e){l.current[a]=e},x:f-12,y:x-12,width:"24",height:"24",style:{pointerEvents:"auto",overflow:"visible"}},{children:t.jsx(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),u&&u(e)},sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",bgcolor:"#FFFFFF",borderRadius:"50%",border:"1px solid ".concat(d),cursor:"pointer",transition:"transform 0.2s ease","&:hover":{transform:"scale(1.05)",boxShadow:"0px 2px 4px rgba(0,0,0,0.1)"}}},{children:t.jsx(n.default,{locked:c,onToggle:u,color:(null===(s=r.style)||void 0===s?void 0:s.badgeText)||d,borderColor:"transparent",size:12})}))}),"".concat(r.id,"-lock"))})]})};
2
2
  //# sourceMappingURL=connectedLines.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react"),t=require("../CognitiveComparehelpers.js"),n={id:"",title:"",similarity:0,sections:[]};exports.useCognitiveTreeData=function(o,s,r,l,a){void 0===a&&(a=!0);var d="string"==typeof r?r:JSON.stringify(r||{}),u=e.useMemo(function(){var e,n,r,l;if(!o||0===Object.keys(o).length)return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"};var u=JSON.parse(d);try{var v=o.nodes||o,c=[],_=[],f=o.base_root_id,p=o.input_index_map||{0:"left",1:"right"},b=o[f]||v[f];if(!b||!1===b.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[],parseError:null};var g=function(e,t,n){if(!e||"object"!=typeof e)return e||null;if(e.deviations)return e;if(a)return e;var o=Object.keys(e).filter(function(i){return/^\d+$/.test(i)});if(!o.length)return e;var s=o.sort(function(i,e){return Number(i)-Number(e)}),r={},l={},d=null;return s.forEach(function(i){var o,s,a,u,v,c=e[i];if(c&&"object"==typeof c){d||(d=c);var _=!(null==c?void 0:c.status)||"pending"===c.status,f=_&&((null===(s=null==c?void 0:c.deviation_highlights)||void 0===s?void 0:s[t])||(null===(a=null==c?void 0:c.deviation_highlights)||void 0===a?void 0:a[p[0]]))||[],b=_&&((null===(u=null==c?void 0:c.deviation_highlights)||void 0===u?void 0:u[n])||(null===(v=null==c?void 0:c.deviation_highlights)||void 0===v?void 0:v[p[1]]))||[];r[i]=((o={})[p[0]]=f[0]||"",o[p[1]]=b[0]||"",o.deviation_summary=(null==c?void 0:c.deviation_summary)||"",o.deviation_title=null==c?void 0:c.deviation_title,o.deviation_impact=null==c?void 0:c.deviation_impact,o.deviation_explanation=null==c?void 0:c.deviation_explanation,o.evaluation_outputs=null==c?void 0:c.evaluation_outputs,o.cognitive_decisioning=null==c?void 0:c.cognitive_decisioning,o.deviation_highlights=null==c?void 0:c.deviation_highlights,o),l[i]=c}}),i.__assign(i.__assign({},e),{deviation_title:(null==d?void 0:d.deviation_title)||(null==e?void 0:e.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==e?void 0:e.deviation_impact),deviation_summary:(null==d?void 0:d.deviation_summary)||(null==e?void 0:e.deviation_summary),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==e?void 0:e.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==e?void 0:e.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==e?void 0:e.cognitive_decisioning),deviations:r,deviation_entries:l})},y=function(i){var e=new Map,t=function(i){i.forEach(function(i){var n;i.id&&e.set(i.id,i),(null===(n=i.subsections)||void 0===n?void 0:n.length)&&t(i.subsections)})};t(i);var n=function(i,t){for(var o,s=[],r=function(i){var r=i.ref_parent_section_node_id;if(r&&e.has(r)&&r!==(null==t?void 0:t.id)){var l=e.get(r);l.subsections||(l.subsections=[]),l.subsections.some(function(e){return e.id===i.id})||l.subsections.push(i)}else(null===(o=i.subsections)||void 0===o?void 0:o.length)&&(i.subsections=n(i.subsections,i)),s.push(i)},l=0,a=i;l<a.length;l++){r(a[l])}return s},o=n(i),s=function(i){i.forEach(function(i){i.subsections&&i.subsections.length>0&&(i.subsections.sort(function(i,e){return i.selfIndex<0&&e.selfIndex>=0?1:i.selfIndex>=0&&e.selfIndex<0?-1:(i.selfIndex||0)-(e.selfIndex||0)}),s(i.subsections))})};return s(o),o},h=function(e,n){var s,r,l,a,d,c=o[e]||v[e];if(!c||!1===c.display_node)return null;var _=c.comparison_inputs?Object.keys(c.comparison_inputs):[],f=p[0],b=p[1];_.length>0&&(f=_.includes(p[0])?p[0]:_[0],b=_.includes(p[1])?p[1]:_.length>1?_[1]:_[0]);var y=t.getSideData(c,n,p),m=!1!==(null===(s=y.attributes)||void 0===s?void 0:s.display_title),x=!1!==(null===(r=y.attributes)||void 0===r?void 0:r.display_content),I=!!t.safeStringify(y.title).trim(),N=!!t.safeStringify(y.content).trim(),O=t.getRationale(c),E=(null===(l=null==u?void 0:u[e])||void 0===l?void 0:l.evaluation_result)||c.evaluation_result||null,S=g(E,f,b),j=[];c.next&&Object.values(c.next).forEach(function(i){var e=v[i];if(e&&!1!==e.display_node){var t=h(i,n);t&&j.push(t)}});var R=!(!I&&!N);return i.__assign(i.__assign({id:e,title:I?y.title:"",content:N?y.content:"",change_history:N?y.change_history:"",displayTitle:m,displayContent:x,subsections:j},R?O:{score:void 0,relation:"not_defined"}),{evaluationResult:S,selfIndex:void 0!==(null===(a=y.attributes)||void 0===a?void 0:a.display_index)?Number(y.attributes.display_index):-1,ref_parent_section_node_id:null===(d=y.attributes)||void 0===d?void 0:d.ref_parent_section_node_id})};if(s){var m=function(e,n){var s,r,l,a,d,c,_,f,b,y,h,x,I,N,O,E,S,j,R,P,D,M,T,V,k,A,C,K,q,w,J,U;void 0===n&&(n=0);var B=[],F=[];if(!e)return{refSections:B,baseSections:F};var G={},W={},$=-1,z=-1;for(var H in e){var L=e[H],Q=o[L]||v[L];if(Q&&!1!==Q.display_node){var X=Q.comparison_inputs?Object.keys(Q.comparison_inputs):[],Y=p[0],Z=p[1];X.length>0&&(Y=X.includes(p[0])?p[0]:X[0],Z=X.includes(p[1])?p[1]:X.length>1?X[1]:X[0]);var ii=t.getRationale(Q),ei=(null===(s=null==u?void 0:u[L])||void 0===s?void 0:s.evaluation_result)||Q.evaluation_result||null,ti=g(ei,Y,Z),ni=t.getSideData(Q,"1",p),oi=t.getSideData(Q,"0",p),si=!1!==(null===(r=ni.attributes)||void 0===r?void 0:r.display_title)&&((null===(a=null===(l=ni.title)||void 0===l?void 0:l.trim)||void 0===a?void 0:a.call(l))||"")||!1!==(null===(d=ni.attributes)||void 0===d?void 0:d.display_content)&&((null===(_=null===(c=ni.content)||void 0===c?void 0:c.trim)||void 0===_?void 0:_.call(c))||""),ri=!1!==(null===(f=oi.attributes)||void 0===f?void 0:f.display_title)&&((null===(y=null===(b=oi.title)||void 0===b?void 0:b.trim)||void 0===y?void 0:y.call(b))||"")||!1!==(null===(h=oi.attributes)||void 0===h?void 0:h.display_content)&&((null===(I=null===(x=oi.content)||void 0===x?void 0:x.trim)||void 0===I?void 0:I.call(x))||""),li=Number(null!==(O=null===(N=ni.attributes)||void 0===N?void 0:N.display_index)&&void 0!==O?O:$--),ai=Number(null!==(S=null===(E=oi.attributes)||void 0===E?void 0:E.display_index)&&void 0!==S?S:z--),di=0===n?String(li):"".concat(li,"_").concat(L),ui=0===n?String(ai):"".concat(ai,"_").concat(L),vi=G[di]||i.__assign(i.__assign({id:L,title:!1!==(null===(j=ni.attributes)||void 0===j?void 0:j.display_title)?ni.title:"",content:!1!==(null===(R=ni.attributes)||void 0===R?void 0:R.display_content)?ni.content:"",change_history:!1!==(null===(P=ni.attributes)||void 0===P?void 0:P.display_content)?ni.change_history:"",subsections:[]},si?ii:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:li,evaluationResult:ti,displayContent:null===(D=ni.attributes)||void 0===D?void 0:D.display_content,displayTitle:null===(M=ni.attributes)||void 0===M?void 0:M.display_title,ref_parent_section_node_id:null===(T=ni.attributes)||void 0===T?void 0:T.ref_parent_section_node_id}),ci=W[ui]||i.__assign(i.__assign({id:L,title:!1!==(null===(V=oi.attributes)||void 0===V?void 0:V.display_title)?oi.title:"",content:!1!==(null===(k=oi.attributes)||void 0===k?void 0:k.display_content)?oi.content:"",change_history:!1!==(null===(A=oi.attributes)||void 0===A?void 0:A.display_content)?oi.change_history:"",subsections:[]},ri?ii:{score:void 0,relation:"not_defined"}),{refIndexes:[],selfIndex:ai,evaluationResult:ti,displayContent:null===(C=oi.attributes)||void 0===C?void 0:C.display_content,displayTitle:null===(K=oi.attributes)||void 0===K?void 0:K.display_title});Number(li)>=0&&Number(ai)>=0&&((null===(q=vi.refIndexes)||void 0===q?void 0:q.includes(Number(ai)))||null===(w=vi.refIndexes)||void 0===w||w.push(Number(ai)),(null===(J=ci.refIndexes)||void 0===J?void 0:J.includes(Number(li)))||null===(U=ci.refIndexes)||void 0===U||U.push(Number(li))),G[di]=vi,W[ui]=ci;var _i=m(Q.next,n+1),fi=_i.refSections,pi=_i.baseSections;fi.length>0&&(vi.subsections=i.__spreadArray(i.__spreadArray([],vi.subsections||[],!0),fi,!0)),pi.length>0&&(ci.subsections=i.__spreadArray(i.__spreadArray([],ci.subsections||[],!0),pi,!0))}}B=Object.values(G),F=Object.values(W);var bi=function(i,e){return i.selfIndex<0&&e.selfIndex>=0?1:i.selfIndex>=0&&e.selfIndex<0?-1:i.selfIndex-e.selfIndex};return B.sort(bi),F.sort(bi),{refSections:B,baseSections:F}},x=m(b.next),I=x.refSections,N=x.baseSections;_=y(I),c=N}else b.next&&Object.values(b.next).forEach(function(i){var e=o[i]||v[i];e&&!1!==e.display_node&&(c.push(h(i,"0")||{id:i,title:"",content:"",subsections:[]}),_.push(h(i,"1")||{id:i,title:"",content:"",subsections:[]}))}),_=y(_);return{activeProposed:{title:(null===(n=null===(e=b.comparison_inputs)||void 0===e?void 0:e[p[0]])||void 0===n?void 0:n.title)||"Uploaded Contract",description:b.decision_scope_description||"",sections:c},activeVariants:[{id:"tree-variant-1",title:(null===(l=null===(r=b.comparison_inputs)||void 0===r?void 0:r[p[1]])||void 0===l?void 0:l.title)||"Reference Template",similarity:0,sections:_,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:b.decision_scope_description||""},fields:{}}}}],parseError:null}}catch(i){return console.error("Data Transformation Error: ",i),{activeProposed:{},activeVariants:[],parseError:i instanceof Error?i.message:"Unknown Parsing Error"}}},[o,s,d,a]),v=u.activeProposed,c=u.activeVariants,_=u.parseError,f=(null==c?void 0:c[0])||n,p=e.useMemo(function(){return(null==v?void 0:v.sections)||[]},[null==v?void 0:v.sections]),b=e.useMemo(function(){return f.sections||[]},[f.sections]),g=p.length>0||b.length>0,y=e.useMemo(function(){return l.fields.filter(function(i){var e=i.key;return(!g||"description"!==e)&&(t.hasValue(null==v?void 0:v[e])||t.hasValue(f[e]))})},[v,f,g,l.fields]),h=e.useMemo(function(){var i,e,n={},r={},l={},a=0,d=null===(i=null==o?void 0:o.input_index_map)||void 0===i?void 0:i[0],u=null===(e=null==o?void 0:o.input_index_map)||void 0===e?void 0:e[1],v=function(i,e){if(!s){var t="left"===e?p.indexOf(i):b.indexOf(i);return{rootKey:"".concat(e,":").concat(t),parentNum:t+1}}if("left"===e){var n=i.selfIndex,o=void 0!==n&&n>=0?n+1:p.indexOf(i)+1;return{rootKey:"left-root:".concat(i.id),parentNum:o}}var r=i.selfIndex,l=p.find(function(i){var e;return null===(e=i.refIndexes)||void 0===e?void 0:e.includes(r)});if(l){var a=l.selfIndex,d=void 0!==a&&a>=0?a+1:p.indexOf(l)+1;return{rootKey:"left-root:".concat(l.id),parentNum:d}}var u=void 0!==r&&r>=0?r+1:b.indexOf(i)+1;return{rootKey:"right-orphan-root:".concat(i.id),parentNum:u}},c=function(i,e){if(i&&e)return i.find(function(i){return i.id===e.id})||void 0},_=function(i,e,o,s,v,f,p){if(e&&function(i,e,n){var o,s=(null===(o=null==i?void 0:i.evaluationResult)||void 0===o?void 0:o.deviations)||{};Object.keys(s).sort().forEach(function(o){var a=s[o];if(a){var v=!t.isMissingStr(a[d]),c=!t.isMissingStr(a[u]);if(v||c){var _="".concat(i.id).concat(t.DEVIATION_BADGE_SEPARATOR).concat(o);void 0===r[_]&&(void 0===l[e]&&(l[e]=1),r[_]={index:l[e]++,rootKey:e,parentNum:n})}}})}(e,s,v),e&&!f){var b=(null==p?void 0:p.id)||"fallback_parent_".concat(a++);n[b]||(n[b]=[]),n[b].push(e)}((null==e?void 0:e.subsections)||(null==i?void 0:i.subsections)||(null==o?void 0:o.subsections)||[]).forEach(function(t){var n=c(null==i?void 0:i.subsections,t),r=c(null==o?void 0:o.subsections,t);_(t,n,r,s,v,!1,e||p)})};p.forEach(function(i){var e,t=v(i,"left"),n=t.rootKey,o=t.parentNum,r=null;if(s){var l=null===(e=i.refIndexes)||void 0===e?void 0:e[0];r=b.find(function(i){return i.selfIndex===l})}else r=b[p.indexOf(i)];_(i,i,r,n,o,!0,i)}),b.forEach(function(i){var e=v(i,"right"),t=e.rootKey,n=e.parentNum;t.startsWith("right-orphan-root:")&&_(i,null,i,t,n,!0,i)});var f=Object.fromEntries(Object.entries(r).map(function(i){return[i[0],i[1].index]})),g=Object.fromEntries(Object.entries(r).map(function(i){return[i[0],i[1].parentNum]}));return{parentDeviationRecord:n,registry:f,deviationParentRegistry:g}},[p,b,s,o]),m=h.parentDeviationRecord,x=h.registry,I=h.deviationParentRegistry;return{activeProposed:v,activeVariants:c,existingRule:f,proposedSections:p,existingSections:b,visibleFields:y,parentDeviationRecord:m,deviationNumberRegistry:x,deviationParentRegistry:I,parseError:_}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react"),t=require("../CognitiveComparehelpers.js"),i={id:"",title:"",similarity:0,sections:[]};exports.useCognitiveTreeData=function(o,r,a,s,d,l){var u,v;void 0===d&&(d=!0);var c="string"==typeof a?a:JSON.stringify(a||{}),f=Boolean(l&&(null===(v=null===(u=l.data)||void 0===u?void 0:u.artifactData)||void 0===v?void 0:v.userStorySnapshot)),p=e.useMemo(function(){var e;if(!o||0===Object.keys(o).length)return{activeProposed:{},activeVariants:[],parseError:"Tree data is required"};var i=JSON.parse(c);try{var a=o.nodes||o,s=[],u=[],v=o.base_root_id,p=o.input_index_map||{0:"left",1:"right"},_=o[v]||a[v];if(!_||!1===_.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[],parseError:null};var I=o.content_mapping||{},g=function(n){return o[n]||a[n]},h=function(e,i,o){if(!e||"object"!=typeof e)return e||null;if(e.deviations)return e;if(d)return e;var r=Object.keys(e).filter(function(n){return/^\d+$/.test(n)});if(!r.length)return e;var a=r.sort(function(n,e){return Number(n)-Number(e)}),s={},l={},u=null;return a.forEach(function(n){var r,a,d,v,c,f=e[n];if(f&&"object"==typeof f){u||(u=f);var _=!(null==f?void 0:f.status)||"pending"===f.status,I=function(n){var e,t=(null===(e=null==f?void 0:f.cognitive_decisioning)||void 0===e?void 0:e.citations)||(null==f?void 0:f.citations)||{};return Object.values(t).map(function(e){var t;return null===(t=null==e?void 0:e[n])||void 0===t?void 0:t.highlighted_text}).filter(function(n){return"string"==typeof n&&n.trim().length>0})},g=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var i=0,o=n;i<o.length;i++){var r=o[i];if(Array.isArray(r)&&r.some(function(n){return!t.isMissingStr(n)}))return r}return[]},h=_?g((null===(a=null==f?void 0:f.deviation_highlights)||void 0===a?void 0:a[i])||(null===(d=null==f?void 0:f.deviation_highlights)||void 0===d?void 0:d[p[0]]),I(i),I(p[0])):[],m=_?g((null===(v=null==f?void 0:f.deviation_highlights)||void 0===v?void 0:v[o])||(null===(c=null==f?void 0:f.deviation_highlights)||void 0===c?void 0:c[p[1]]),I(o),I(p[1])):[];s[n]=((r={})[p[0]]=h[0]||"",r[p[1]]=m[0]||"",r.deviation_summary=(null==f?void 0:f.deviation_summary)||"",r.deviation_title=null==f?void 0:f.deviation_title,r.deviation_impact=null==f?void 0:f.deviation_impact,r.deviation_explanation=null==f?void 0:f.deviation_explanation,r.evaluation_outputs=null==f?void 0:f.evaluation_outputs,r.cognitive_decisioning=null==f?void 0:f.cognitive_decisioning,r.deviation_highlights=null==f?void 0:f.deviation_highlights,r),l[n]=f}}),n.__assign(n.__assign({},e),{deviation_title:(null==u?void 0:u.deviation_title)||(null==e?void 0:e.deviation_title),deviation_impact:(null==u?void 0:u.deviation_impact)||(null==e?void 0:e.deviation_impact),deviation_summary:(null==u?void 0:u.deviation_summary)||(null==e?void 0:e.deviation_summary),deviation_explanation:(null==u?void 0:u.deviation_explanation)||(null==e?void 0:e.deviation_explanation),evaluation_outputs:(null==u?void 0:u.evaluation_outputs)||(null==e?void 0:e.evaluation_outputs),cognitive_decisioning:(null==u?void 0:u.cognitive_decisioning)||(null==e?void 0:e.cognitive_decisioning),deviations:s,deviation_entries:l})},m=function(n){var e=new Map,t=function(n){n.forEach(function(n){var i;n.id&&e.set(n.id,n),(null===(i=n.subsections)||void 0===i?void 0:i.length)&&t(n.subsections)})};t(n);var i=function(n,t){for(var o,r=[],a=function(n){var a=n.ref_parent_section_node_id;if(a&&e.has(a)&&a!==(null==t?void 0:t.id)){var s=e.get(a);s.subsections||(s.subsections=[]),s.subsections.some(function(e){return e.id===n.id})||s.subsections.push(n)}else(null===(o=n.subsections)||void 0===o?void 0:o.length)&&(n.subsections=i(n.subsections,n)),r.push(n)},s=0,d=n;s<d.length;s++){a(d[s])}return r},o=i(n),r=function(n){n.forEach(function(n){n.subsections&&n.subsections.length>0&&(n.subsections.sort(function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:(n.selfIndex||0)-(e.selfIndex||0)}),r(n.subsections))})};return r(o),o},y=function(n){var e=n.comparison_inputs?Object.keys(n.comparison_inputs):[],t=p[0],i=p[1];return e.length>0&&(t=e.includes(p[0])?p[0]:e[0],i=e.includes(p[1])?p[1]:e.length>1?e[1]:e[0]),{nodeLeftId:t,nodeRightId:i}},x=function(e,i,o,r){var a=i.attributes||{},s=i.data||{},d=!1!==a.display_title,l=!1!==a.display_content,u=d?t.safeStringify(s.title||""):"",v=l?t.safeStringify(s.content||""):"",c=l?t.safeStringify(s.change_history||""):"",f=void 0!==a.display_index&&null!==a.display_index?Number(a.display_index):-1,p=function(n){return(null==n?void 0:n.entity_id)||(null==n?void 0:n.ref_parent_section_node_id)||(null==n?void 0:n.parent_entity_id)||null}(a),_=!(!u.trim()&&!v.trim());return n.__assign(n.__assign({id:"".concat(e,"::").concat(i.contentId),nodeId:e,contentId:i.contentId,parentContentId:p,title:u,content:v,change_history:c,displayTitle:d,displayContent:l,subsections:[]},_?r:{score:void 0,relation:"not_defined"}),{evaluationResult:o,evaluationResults:o?[o]:[],selfIndex:f,refIndexes:[],refContentIds:[],ref_parent_section_node_id:p})},b=function(e,t){e.refIndexes=Array.from(new Set(n.__spreadArray(n.__spreadArray([],e.refIndexes||[],!0),t.refIndexes||[],!0))),e.refContentIds=Array.from(new Set(n.__spreadArray(n.__spreadArray([],e.refContentIds||[],!0),t.refContentIds||[],!0)));var i=new Set((e.subsections||[]).map(function(n){return n.id||n.contentId||n.nodeId}));(t.subsections||[]).forEach(function(t){var o=t.id||t.contentId||t.nodeId;i.has(o)||(e.subsections=n.__spreadArray(n.__spreadArray([],e.subsections||[],!0),[t],!1),i.add(o))});var o=n.__spreadArray(n.__spreadArray([],e.evaluationResults||(e.evaluationResult?[e.evaluationResult]:[]),!0),t.evaluationResults||(t.evaluationResult?[t.evaluationResult]:[]),!0).filter(Boolean),r=new Set;return e.evaluationResults=o.filter(function(n){var e=(null==n?void 0:n.nodeId)||JSON.stringify(Object.keys((null==n?void 0:n.deviations)||n||{}));return!r.has(e)&&(r.add(e),!0)}),!e.evaluationResult&&t.evaluationResult&&(e.evaluationResult=t.evaluationResult),!e.cognitiveData&&t.cognitiveData&&(e.cognitiveData=t.cognitiveData),e},R=function(n,e){return n.selfIndex<0&&e.selfIndex>=0?1:n.selfIndex>=0&&e.selfIndex<0?-1:n.selfIndex-e.selfIndex},C=function(e,o){var r,a=g(e);if(!a||!1===a.display_node)return[];if(f&&"1"===o)return[];var s=y(a),d=s.nodeLeftId,l=s.nodeRightId,u=t.getRationale(a),v=(null===(r=null==i?void 0:i[e])||void 0===r?void 0:r.evaluation_result)||a.evaluation_result||null,c=h(v,d,l),_=c&&"object"==typeof c?n.__assign(n.__assign({},c),{nodeId:e}):c,m=t.resolveComparisonInputItems(a,o,p,I).map(function(n){return x(e,n,_,u)});if(a.next){var b=Object.values(a.next).flatMap(function(n){return C(n,o)});m.forEach(function(n){var e=b.filter(function(e){return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId});n.subsections=e.length?e:b})}return m};if(r){var S=function(e,o){var r;void 0===o&&(o=0);var a=[],s=[];if(!e)return{refSections:a,baseSections:s};var d={},l={},u=-1,v=-1,c=function(a){var s=e[a],c=g(s);if(!c||!1===c.display_node)return"continue";var _=y(c),m=_.nodeLeftId,R=_.nodeRightId,C=t.getRationale(c),E=(null===(r=null==i?void 0:i[s])||void 0===r?void 0:r.evaluation_result)||c.evaluation_result||null,O=h(E,m,R),N=O&&"object"==typeof O?n.__assign(n.__assign({},O),{nodeId:s}):O,j=S(c.next,o+1),A=j.refSections,D=j.baseSections,M=t.resolveComparisonInputItems(c,"0",p,I).map(function(n){var e=x(s,n,N,C);return-1===e.selfIndex&&(e.selfIndex=v--),e}),P=[];if(!f){var k=t.resolveComparisonInputItems(c,"1",p,I);P=k.map(function(n){var e=x(s,n,N,C);return-1===e.selfIndex&&(e.selfIndex=u--),e})}M.forEach(function(n){P.forEach(function(e){var t,i,o,r,a,s,d,l;Number(e.selfIndex)>=0&&Number(n.selfIndex)>=0&&((null===(t=e.refIndexes)||void 0===t?void 0:t.includes(Number(n.selfIndex)))||null===(i=e.refIndexes)||void 0===i||i.push(Number(n.selfIndex)),(null===(o=n.refIndexes)||void 0===o?void 0:o.includes(Number(e.selfIndex)))||null===(r=n.refIndexes)||void 0===r||r.push(Number(e.selfIndex))),n.contentId&&!(null===(a=e.refContentIds)||void 0===a?void 0:a.includes(n.contentId))&&(null===(s=e.refContentIds)||void 0===s||s.push(n.contentId)),e.contentId&&!(null===(d=n.refContentIds)||void 0===d?void 0:d.includes(e.contentId))&&(null===(l=n.refContentIds)||void 0===l||l.push(e.contentId))})}),P.forEach(function(n){var e=A.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===o?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||s);d[t]=d[t]?b(d[t],n):n}),M.forEach(function(n){var e=D.filter(function(e){var t;return!e.parentContentId||e.parentContentId===n.contentId||e.parentContentId===n.parentContentId||(null===(t=n.refContentIds)||void 0===t?void 0:t.includes(e.parentContentId))});e.length>0&&(n.subsections=e);var t=0===o?String(n.selfIndex):"".concat(n.selfIndex,"_").concat(n.contentId||s);l[t]=l[t]?b(l[t],n):n})};for(var _ in e)c(_);return a=Object.values(d),s=Object.values(l),a.sort(R),s.sort(R),{refSections:a,baseSections:s}},E=S(_.next),O=E.refSections,N=E.baseSections;f||(u=m(O)),s=N}else _.next&&Object.values(_.next).forEach(function(n){var e=g(n);e&&!1!==e.display_node&&(s.push.apply(s,C(n,"0")),f||u.push.apply(u,C(n,"1")))}),f||(u=m(u));var j=t.getSideData(_,"0",p,I),A=t.getSideData(_,"1",p,I);return{activeProposed:{title:j.title||"Uploaded Contract",description:_.decision_scope_description||"",sections:s},activeVariants:[{id:"tree-variant-1",title:f?(null===(e=null==l?void 0:l.data)||void 0===e?void 0:e.artifactTitle)||"Rulebook Guidelines":A.title||"Reference Template",similarity:0,sections:u,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:_.decision_scope_description||""},fields:{}}}}],parseError:null}}catch(n){return console.error("Data Transformation Error: ",n),{activeProposed:{},activeVariants:[],parseError:n instanceof Error?n.message:"Unknown Parsing Error"}}},[o,r,c,d,l]),_=p.activeProposed,I=p.activeVariants,g=p.parseError,h=(null==I?void 0:I[0])||i,m=e.useMemo(function(){return(null==_?void 0:_.sections)||[]},[null==_?void 0:_.sections]),y=e.useMemo(function(){return h.sections||[]},[h.sections]),x=m.length>0||y.length>0,b=e.useMemo(function(){return s.fields.filter(function(n){var e=n.key;return(!x||"description"!==e)&&(t.hasValue(null==_?void 0:_[e])||t.hasValue(h[e]))})},[_,h,x,s.fields]),R=e.useMemo(function(){var n,e,i={},a={},s={},d=0,l=null===(n=null==o?void 0:o.input_index_map)||void 0===n?void 0:n[0],u=null===(e=null==o?void 0:o.input_index_map)||void 0===e?void 0:e[1],v=function(n,e){if(!r){var t="left"===e?m.indexOf(n):y.indexOf(n);return{rootKey:"".concat(e,":").concat(t),parentNum:t+1}}if("left"===e){var i=n.selfIndex,o=void 0!==i&&i>=0?i+1:m.indexOf(n)+1;return{rootKey:"left-root:".concat(n.id),parentNum:o}}var a=n.selfIndex,s=m.find(function(n){var e;return null===(e=n.refIndexes)||void 0===e?void 0:e.includes(a)});if(s){var d=s.selfIndex,l=void 0!==d&&d>=0?d+1:m.indexOf(s)+1;return{rootKey:"left-root:".concat(s.id),parentNum:l}}var u=void 0!==a&&a>=0?a+1:y.indexOf(n)+1;return{rootKey:"right-orphan-root:".concat(n.id),parentNum:u}},c=function(n,e){if(n&&e)return n.find(function(n){return n.id===e.id||n.nodeId&&n.nodeId===e.nodeId||n.contentId&&n.contentId===e.contentId})||void 0},p=function(n,e,o,r,v,f,_){if(e&&function(n,e,i){var o;((null===(o=null==n?void 0:n.evaluationResults)||void 0===o?void 0:o.length)?n.evaluationResults:(null==n?void 0:n.evaluationResult)?[n.evaluationResult]:[]).forEach(function(o){var r=(null==o?void 0:o.deviations)||{};Object.keys(r).sort().forEach(function(d){var v=r[d];if(v){var c=!t.isMissingStr(v[l]),f=!t.isMissingStr(v[u]);if(c||f){var p=(null==o?void 0:o.nodeId)||n.nodeId||n.id,_="".concat(p).concat(t.DEVIATION_BADGE_SEPARATOR).concat(d);void 0===a[_]&&(void 0===s[e]&&(s[e]=1),a[_]={index:s[e]++,rootKey:e,parentNum:i})}}})})}(e,r,v),e&&!f){var I=(null==_?void 0:_.id)||"fallback_parent_".concat(d++);i[I]||(i[I]=[]),i[I].push(e)}((null==e?void 0:e.subsections)||(null==n?void 0:n.subsections)||(null==o?void 0:o.subsections)||[]).forEach(function(t){var i=c(null==n?void 0:n.subsections,t),a=c(null==o?void 0:o.subsections,t);p(t,i,a,r,v,!1,e||_)})};m.forEach(function(n){var e,t=v(n,"left"),i=t.rootKey,o=t.parentNum,a=null;if(r){var s=null===(e=n.refIndexes)||void 0===e?void 0:e[0];a=y.find(function(n){return n.selfIndex===s})}else a=y[m.indexOf(n)];p(n,n,a,i,o,!0,n)}),f||y.forEach(function(n){var e=v(n,"right"),t=e.rootKey,i=e.parentNum;t.startsWith("right-orphan-root:")&&p(n,null,n,t,i,!0,n)});var _=Object.fromEntries(Object.entries(a).map(function(n){return[n[0],n[1].index]})),I=Object.fromEntries(Object.entries(a).map(function(n){return[n[0],n[1].parentNum]}));return{parentDeviationRecord:i,registry:_,deviationParentRegistry:I}},[m,y,r,o,f]),C=R.parentDeviationRecord,S=R.registry,E=R.deviationParentRegistry;return{isGuidelineMode:f,activeProposed:_,activeVariants:I,existingRule:h,proposedSections:m,existingSections:y,visibleFields:b,parentDeviationRecord:C,deviationNumberRegistry:S,deviationParentRegistry:E,parseError:g}};
2
2
  //# sourceMappingURL=useCompareData.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("../CognitiveComparehelpers.js");exports.useLinesCalculator=function(n){var r=n.containerRef,i=n.leftContainerRef,c=n.rightContainerRef;n.svgContainerRef;var o=n.pathRefs,l=n.leftHeaderRef,u=n.rightHeaderRef,a=n.proposedSections,d=n.existingSections,v=n.visibleFields,s=n.leftRefs,h=n.rightRefs,g=n.sectionLeftRefs,f=n.sectionRightRefs,p=n.subSectionLeftRefs,R=n.subSectionRightRefs,y=n.lhsBadgeRefs,x=n.rhsBadgeRefs,A=n.sectionRowRefs,B=n.expandedSections,m=n.expandedSubSections,C=n.connectedSections,S=n.isSideBySide,b=n.activeSideBySideSection,T=n.maintainRelativeOrder,I=n.cognitiveMap,E=n.getSectionCompareStyle,M=n.getSubSectionCompareStyle,D=n.getDeviationStyleByKey,L=n.isArrowVisible,O=n.isAnimatingRef,H=n.isSideBySideRef,_=n.sideBySideCacheRef,P=n.sideBySideLineRef,N=n.activeSideBySideSectionRef,V=n.activeSideBySideRightSectionRef,k=n.connectedLines,w=n.setConnectedLines,G=n.cachedConnectedPositions,Y=n.calculateLinesRef,j=n.resizeTimerRef,F=n.scrollLock,z=n.scrollSyncLocked,q=n.handleResizeRef,K=n.activeProposed,J=n.existingRule,Q=n.analysisData,U=n.pendingScrollTargetRef,W=n.pendingScrollCallbackRef,X=n.resolvedComparisonConfig,Z=n.getFieldData,$=t.useState([]),tt=$[0],et=$[1],nt=t.useState(null),rt=nt[0],it=nt[1],ct=t.useState([]),ot=ct[0],lt=ct[1],ut=null!=k?k:ot,at=null!=w?w:lt,dt=t.useState({width:0,height:0}),vt=dt[0],st=dt[1],ht=t.useRef(!1),gt=t.useRef(!1),ft=t.useRef(!1),pt=t.useRef(null),Rt=t.useRef([]),yt=null!=G?G:Rt,xt=t.useCallback(function(){var t,n,o,A,L,H,_,P,N,V,k,w,G,Y,j,F,z,q,K,J,Q,U,W;if(!ht.current&&!O.current){ht.current=!0;try{if(!r.current)return;var X=function(t){var e=t.split("-"),n=e[0];if(!B[n]&&!1===T)return!1;if(T&&!B["left-".concat(n)]&&!B["right-".concat(n)]&&!B[n])return!1;for(var r=n,i=1;i<e.length-1;i++)if(r+="-".concat(e[i]),!m[r])return!1;return!0},Z=r.current.getBoundingClientRect();st({width:Z.width,height:Z.height});var $=[];if(v.forEach(function(t){var e,n,r=t.key,i=null===(e=s.current[r])||void 0===e?void 0:e.current,c=null===(n=h.current[r])||void 0===n?void 0:n.current;i&&c&&(i.style.height="auto",c.style.height="auto",i.style.minHeight="0px",c.style.minHeight="0px")}),!O.current){for(var tt=0;tt<Math.max(a.length,d.length);tt++){var nt=null===(t=g.current[tt])||void 0===t?void 0:t.current,rt=null===(n=f.current[tt])||void 0===n?void 0:n.current;nt&&(nt.style.height="auto",nt.style.minHeight="0px"),rt&&(rt.style.height="auto",rt.style.minHeight="0px")}T||Object.keys(p.current).forEach(function(t){var e,n;if(X(t)){var r=null===(e=p.current[t])||void 0===e?void 0:e.current,i=null===(n=R.current[t])||void 0===n?void 0:n.current;r&&i&&(r.style.height="auto",i.style.height="auto",r.style.minHeight="0px",i.style.minHeight="0px")}})}var ct={};v.forEach(function(t){var e,n,r=t.key,i=null===(e=s.current[r])||void 0===e?void 0:e.current,c=null===(n=h.current[r])||void 0===n?void 0:n.current;if(i&&c){var o=i.getBoundingClientRect(),l=c.getBoundingClientRect();ct[r]=Math.max(o.height,l.height)}});var ot={left:{},right:{}},lt={};if(!O.current)if(T){if(S&&null!==b)if("number"==typeof b){var ut=b,dt=a[ut],vt=null===(L=g.current[ut])||void 0===L?void 0:L.current;vt&&dt&&(dt.refIndexes||[]).forEach(function(t){var e,n=d.findIndex(function(e){return e.selfIndex===t}),r=null===(e=f.current[n])||void 0===e?void 0:e.current;if(r&&(B["left-".concat(ut)]||B["right-".concat(n)])){var i=Math.max(vt.getBoundingClientRect().height,r.getBoundingClientRect().height);ot.left[ut]=Math.max(ot.left[ut]||0,i),ot.right[n]=Math.max(ot.right[n]||0,i)}})}else{var gt=b.split(e.DEVIATION_BADGE_SEPARATOR)[2];if(gt){nt=null===(H=p.current[gt])||void 0===H?void 0:H.current,rt=null===(_=R.current[gt])||void 0===_?void 0:_.current;if(nt&&rt){ft=Math.max(nt.getBoundingClientRect().height,rt.getBoundingClientRect().height);lt[gt]=Math.max(lt[gt]||0,ft)}}}}else{Object.keys(p.current).forEach(function(t){var e,n;if(X(t)){var r=null===(e=p.current[t])||void 0===e?void 0:e.current,i=null===(n=R.current[t])||void 0===n?void 0:n.current;if(r&&i&&null!==r.offsetParent&&null!==i.offsetParent){var c=r.getBoundingClientRect(),o=i.getBoundingClientRect(),l=Math.max(c.height,o.height);lt[t]=l,r.style.minHeight="".concat(l,"px"),i.style.minHeight="".concat(l,"px")}}});for(tt=0;tt<Math.min(a.length,d.length);tt++){var nt=null===(o=g.current[tt])||void 0===o?void 0:o.current,rt=null===(A=f.current[tt])||void 0===A?void 0:A.current;if(nt&&rt){var ft=Math.max(nt.getBoundingClientRect().height,rt.getBoundingClientRect().height);ot.left[tt]=ft,ot.right[tt]=ft}}}if(v.forEach(function(t){var e,n,r=t.key,i=null===(e=s.current[r])||void 0===e?void 0:e.current,c=null===(n=h.current[r])||void 0===n?void 0:n.current;if(i&&c){var o=ct[r];i.style.minHeight="".concat(o,"px"),c.style.minHeight="".concat(o,"px")}}),O.current||(Object.entries(ot.left).forEach(function(t){var e,n=t[0],r=t[1],i=null===(e=g.current[Number(n)])||void 0===e?void 0:e.current;i&&(i.style.minHeight="".concat(r,"px"))}),Object.entries(ot.right).forEach(function(t){var e,n=t[0],r=t[1],i=null===(e=f.current[Number(n)])||void 0===e?void 0:e.current;i&&(i.style.minHeight="".concat(r,"px"))}),T||Object.keys(lt).forEach(function(t){var e,n,r=null===(e=p.current[t])||void 0===e?void 0:e.current,i=null===(n=R.current[t])||void 0===n?void 0:n.current;if(r&&i&&lt[t]){var c=lt[t];r.style.minHeight="".concat(c,"px"),i.style.minHeight="".concat(c,"px")}})),T)a.forEach(function(t,e){var n;(null===(n=g.current[e])||void 0===n?void 0:n.current)&&(t.refIndexes||[]).forEach(function(t){var n,r,o,l,u,a,v,s,h,g,f=d.findIndex(function(e){return e.selfIndex===t});if(-1!==f){var p=null===(n=y.current[e])||void 0===n?void 0:n.current,R=null===(r=x.current[f])||void 0===r?void 0:r.current;if(p&&R){var A=p.getBoundingClientRect(),B=R.getBoundingClientRect(),m=A.right-Z.left,C=B.left-Z.left,T=A.top+A.height/2-Z.top,I=B.top+B.height/2-Z.top;if(S&&b===e){var M=null!==(l=null===(o=i.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==l?l:0,D=null!==(a=null===(u=c.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==a?a:0,L=M+(null!==(s=null===(v=i.current)||void 0===v?void 0:v.clientHeight)&&void 0!==s?s:1/0),O=D+(null!==(g=null===(h=c.current)||void 0===h?void 0:h.clientHeight)&&void 0!==g?g:1/0),H=A.top+A.height/2,_=B.top+B.height/2,P=function(t,e,n){return Math.max(e,Math.min(n,t))};T=P(H,M,L)-Z.top,I=P(_,D,O)-Z.top}var N=E(e);N&&$.push({id:"line-".concat(e,"-").concat(f),x1:m,y1:T,x2:C,y2:I,style:N,sectionIdx:e,targetRightIdx:f})}}})});else{for(tt=0;tt<Math.min(a.length,d.length);tt++){var pt=null===(P=g.current[tt])||void 0===P?void 0:P.current,Rt=null===(N=f.current[tt])||void 0===N?void 0:N.current;if(pt&&Rt){var xt=pt.getBoundingClientRect(),At=Rt.getBoundingClientRect(),Bt=Math.max(xt.top,At.top)+18-Z.top,mt=(null===(V=d[tt])||void 0===V?void 0:V.id)||"sec-".concat(tt);(Dt=E(tt))&&$.push({id:mt,x1:xt.right-Z.left,y1:Bt,x2:At.left-Z.left,y2:Bt,style:Dt,sectionIdx:tt,hasCognitive:!!((null===(k=a[tt])||void 0===k?void 0:k.cognitiveData)||(null===(w=d[tt])||void 0===w?void 0:w.cognitiveData)||mt&&I[mt]),isSubSection:!1})}}Object.keys(p.current).forEach(function(t){var n,r,i,c,o,l;if(X(t)){var u=null===(n=p.current[t])||void 0===n?void 0:n.current,v=null===(r=R.current[t])||void 0===r?void 0:r.current;if(u&&v){for(var s=t.split("-").map(Number),h=a[s[0]],g=d[s[0]],f=1;f<s.length;f++)(null==h?void 0:h.subsections)&&(h=h.subsections[s[f]]),(null==g?void 0:g.subsections)&&(g=g.subsections[s[f]]);var y=!!h&&((null===(i=h.displayTitle)||void 0===i||i)&&e.hasValue(h.title)),x=!!h&&((null===(c=h.displayContent)||void 0===c||c)&&e.hasValue(h.content)),A=!!g&&((null===(o=g.displayTitle)||void 0===o||o)&&e.hasValue(g.title)),B=!!g&&((null===(l=g.displayContent)||void 0===l||l)&&e.hasValue(g.content));if(y&&x||A&&B){var m=u.getBoundingClientRect(),C=v.getBoundingClientRect(),S=Math.max(m.top,C.top)+16-Z.top,b=M(t);b&&"Not Defined"!==b.label&&$.push({id:"subsec-".concat(t),x1:m.right-Z.left,y1:S,x2:C.left-Z.left,y2:S,style:b,sectionIdx:s[0],isSubSection:!0,subSectionKeyPath:t,hasCognitive:!(!(null==h?void 0:h.cognitiveData)&&!(null==g?void 0:g.cognitiveData))})}}}})}if(S&&"string"==typeof b&&b.includes(e.DEVIATION_BADGE_SEPARATOR)){var Ct=b.split(e.DEVIATION_BADGE_SEPARATOR),St=Ct[0],bt=Ct[1],Tt=Ct[2],It=(Ct[3],"".concat(St).concat(e.DEVIATION_BADGE_SEPARATOR).concat(bt)),Et=null===(G=y.current[It])||void 0===G?void 0:G.current,Mt=null===(Y=x.current[It])||void 0===Y?void 0:Y.current;if(Et&&Mt){var Dt,Lt=Et.getBoundingClientRect(),Ot=Mt.getBoundingClientRect(),Ht=Lt.right-Z.left,_t=Ot.left-Z.left,Pt=Lt.top+Lt.height/2-Z.top,Nt=Ot.top+Ot.height/2-Z.top;if(T){var Vt=null!==(F=null===(j=i.current)||void 0===j?void 0:j.getBoundingClientRect().top)&&void 0!==F?F:0,kt=null!==(q=null===(z=c.current)||void 0===z?void 0:z.getBoundingClientRect().top)&&void 0!==q?q:0,wt=Vt+(null!==(J=null===(K=i.current)||void 0===K?void 0:K.clientHeight)&&void 0!==J?J:1/0),Gt=kt+(null!==(U=null===(Q=c.current)||void 0===Q?void 0:Q.clientHeight)&&void 0!==U?U:1/0),Yt=function(t,e,n){return Math.max(e,Math.min(n,t))};Pt=Yt(Lt.top+Lt.height/2,Vt,wt)-Z.top,Nt=Yt(Ot.top+Ot.height/2,kt,Gt)-Z.top}(Dt=null!==(W=D(St,bt))&&void 0!==W?W:M(Tt))&&$.push({id:"line-subsec-".concat(It),x1:Ht,y1:Pt,x2:_t,y2:Nt,style:Dt,sectionIdx:Number(Tt.split("-")[0]),isSubSection:!0,subSectionKeyPath:b})}}if(et($),l.current&&u.current){var jt=l.current.getBoundingClientRect(),Ft=u.current.getBoundingClientRect(),zt=(jt.top+jt.height/2-Z.top+Ft.top+Ft.height/2-Z.top)/2;it({x1:jt.right-Z.left,x2:Ft.left-Z.left,y:zt})}else it(null);if(C.size>0){var qt=[],Kt=i.current,Jt=c.current;if(Kt&&Jt){var Qt=[],Ut=Kt.getBoundingClientRect().top,Wt=Jt.getBoundingClientRect().top,Xt=Ut+Kt.clientHeight,Zt=Wt+Jt.clientHeight,$t=Kt.scrollTop,te=Jt.scrollTop,ee=Z.top,ne=function(t,e,n){return Math.max(e,Math.min(n,t))};C.forEach(function(t){var n,r,i,c,o,l;if("string"==typeof t&&t.includes(e.DEVIATION_BADGE_SEPARATOR)){var u=t.split(e.DEVIATION_BADGE_SEPARATOR),v=u[0],s=u[1],h=u[2],g=(u[3],"".concat(v).concat(e.DEVIATION_BADGE_SEPARATOR).concat(s)),f=null===(n=y.current[g])||void 0===n?void 0:n.current,p=null===(r=x.current[g])||void 0===r?void 0:r.current;if(!f||!p)return;var R=f.getBoundingClientRect(),A=p.getBoundingClientRect(),B=null!==(i=D(v,s))&&void 0!==i?i:M(h),m=(j=R.right-Z.left)+.5*((F=A.left-Z.left-0)-j),C=R.top+R.height/2,S=A.top+A.height/2,b=C-Ut+$t,I=S-Wt+te,L="conn-subsec-".concat(g);Qt.push({lhsScrollY:b,rhsScrollY:I,x1:j,x2:F,containerTop:ee,leftIdx:t,rhsArrayIdx:t,styleColor:(null==B?void 0:B.badgeBorder)||"#6366F1",styleId:L});var O=ne(C,Ut,Xt),H=ne(S,Wt,Zt),_=O-ee,P=H-ee,N=S>=Wt-4&&S<=Zt+4,V="";V=(z=C>=Ut-4&&C<=Xt+4)&&N?e.getBentArrowPath(j,_,F,P):z&&!N?"M ".concat(j,",").concat(_," L ").concat(m,",").concat(_," L ").concat(m,",").concat(P):!z&&N?"M ".concat(m,",").concat(_," L ").concat(m,",").concat(P," L ").concat(F,",").concat(P):"M ".concat(m,",").concat(_," L ").concat(m,",").concat(P),qt.push({id:L,pathD:V,style:B,leftIdx:t,rhsArrayIdx:t,x1:j,x2:F,y1:_,y2:P})}else if(T){var k=t,w=a[k];if(!(null===(l=null==w?void 0:w.refIndexes)||void 0===l?void 0:l.length))return;w.refIndexes.forEach(function(t){var n,r,i=d.findIndex(function(e){return e.selfIndex===t});if(-1!==i){var c=null===(n=y.current[k])||void 0===n?void 0:n.current,o=null===(r=x.current[i])||void 0===r?void 0:r.current;if(c&&o){var l=c.getBoundingClientRect(),u=o.getBoundingClientRect(),a=E(k),v=l.right-Z.left,s=u.left-Z.left-0,h=v+.5*(s-v),g=l.top+l.height/2,f=u.top+u.height/2,p=g-Ut+$t,R=f-Wt+te,A="conn-".concat(k,"-").concat(i);Qt.push({lhsScrollY:p,rhsScrollY:R,x1:v,x2:s,containerTop:ee,leftIdx:k,rhsArrayIdx:i,styleColor:(null==a?void 0:a.badgeBorder)||"#6366F1",styleId:A});var B=ne(g,Ut,Xt),m=ne(f,Wt,Zt),C=B-ee,S=m-ee,b=g>=Ut-4&&g<=Xt+4,T=f>=Wt-4&&f<=Zt+4,I="";I=b&&T?e.getBentArrowPath(v,C,s,S):b&&!T?"M ".concat(v,",").concat(C," L ").concat(h,",").concat(C," L ").concat(h,",").concat(S):!b&&T?"M ".concat(h,",").concat(C," L ").concat(h,",").concat(S," L ").concat(s,",").concat(S):"M ".concat(h,",").concat(C," L ").concat(h,",").concat(S),qt.push({id:A,pathD:I,style:a,leftIdx:k,rhsArrayIdx:i,x1:v,x2:s,y1:C,y2:S})}}})}else{var G=t,Y=G;f=null===(c=y.current[G])||void 0===c?void 0:c.current,p=null===(o=x.current[Y])||void 0===o?void 0:o.current;if(!f||!p)return;var j,F;R=f.getBoundingClientRect(),A=p.getBoundingClientRect(),B=E(G),m=(j=R.right-Z.left)+.5*((F=A.left-Z.left-0)-j),C=R.top+R.height/2,S=A.top+A.height/2,b=C-Ut+$t,I=S-Wt+te,L="conn-".concat(G,"-").concat(Y);Qt.push({lhsScrollY:b,rhsScrollY:I,x1:j,x2:F,containerTop:ee,leftIdx:G,rhsArrayIdx:Y,styleColor:(null==B?void 0:B.badgeBorder)||"#6366F1",styleId:L});var z;O=ne(C,Ut,Xt),H=ne(S,Wt,Zt),_=O-ee,P=H-ee,N=S>=Wt-4&&S<=Zt+4,V="";V=(z=C>=Ut-4&&C<=Xt+4)&&N?e.getBentArrowPath(j,_,F,P):z&&!N?"M ".concat(j,",").concat(_," L ").concat(m,",").concat(_," L ").concat(m,",").concat(P):!z&&N?"M ".concat(m,",").concat(_," L ").concat(m,",").concat(P," L ").concat(F,",").concat(P):"M ".concat(m,",").concat(_," L ").concat(m,",").concat(P),qt.push({id:L,pathD:V,style:B,leftIdx:G,rhsArrayIdx:Y,x1:j,x2:F,y1:_,y2:P})}}),yt.current=Qt}at(qt)}else at([]),yt.current=[]}catch(t){console.error("Line render safe fail: ",t)}finally{ht.current=!1}}},[v,a,d,I,X,Z,E,D,T,S,b,C,B,m]),At=t.useCallback(function(){var t,n,l,u,a,d,v,s,h,g,f,p,R,y,x=yt.current;if(x.length&&!O.current){var A=null!==(n=null===(t=i.current)||void 0===t?void 0:t.scrollTop)&&void 0!==n?n:0,B=null!==(u=null===(l=c.current)||void 0===l?void 0:l.scrollTop)&&void 0!==u?u:0,m=null!==(d=null===(a=i.current)||void 0===a?void 0:a.clientHeight)&&void 0!==d?d:1/0,C=null!==(s=null===(v=c.current)||void 0===v?void 0:v.clientHeight)&&void 0!==s?s:1/0,S=null!==(g=null===(h=i.current)||void 0===h?void 0:h.getBoundingClientRect().top)&&void 0!==g?g:0,b=null!==(p=null===(f=c.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==p?p:0,T=S+m,I=b+C,E=null!==(y=null===(R=r.current)||void 0===R?void 0:R.getBoundingClientRect().top)&&void 0!==y?y:0,M=function(t,e,n){return Math.max(e,Math.min(n,t))};x.forEach(function(t){var n=t.lhsScrollY-A+S,r=t.rhsScrollY-B+b,i=o.current[t.styleId+"-stroke"],c=o.current[t.styleId+"-bg"],l=o.current[t.styleId+"-btn"];if(i||c){var u,a=M(n,S,T),d=M(r,b,I),v=a-E,s=d-E,h=n>=S-4&&n<=T+4,g=r>=b-4&&r<=I+4,f=t.x1+.5*(t.x2-t.x1);u=h&&g?e.getBentArrowPath(t.x1,v,t.x2,s):h&&!g?"M ".concat(t.x1,",").concat(v," L ").concat(f,",").concat(v," L ").concat(f,",").concat(s):!h&&g?"M ".concat(f,",").concat(v," L ").concat(f,",").concat(s," L ").concat(t.x2,",").concat(s):"M ".concat(f,",").concat(v," L ").concat(f,",").concat(s),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",u)),c&&(c.setAttribute("visibility","visible"),c.setAttribute("d",u)),l&&(h?(l.setAttribute("visibility","visible"),l.setAttribute("y",String(v-12))):l.setAttribute("visibility","hidden"))}})}},[]),Bt=t.useCallback(function(){yt.current.length>0&&!O.current||(null!==pt.current&&clearTimeout(pt.current),pt.current=setTimeout(function(){Y.current(),pt.current=null},50))},[]),mt=t.useCallback(function(t){if(null!==U.current&&W.current&&Math.abs(t.currentTarget.scrollTop-U.current)<=2){var n=W.current;U.current=null,W.current=null,n()}if(!ft.current&&!F.current){if(T&&z&&(H.current||C.size>0)){var o=t.currentTarget,l=i.current,u=c.current,a=o===l?u:o===u?l:null;if(o&&a){var d=function(){var t,n,r,i,c,o,l,u,a,d,v,s=N.current,h=V.current;if(null===s)return{leftAnchor:null,rightAnchor:null};if("string"==typeof s&&s.includes(e.DEVIATION_BADGE_SEPARATOR)){var B=s.split(e.DEVIATION_BADGE_SEPARATOR),m="".concat(B[0]).concat(e.DEVIATION_BADGE_SEPARATOR).concat(B[1]);return{leftAnchor:(null===(t=y.current[m])||void 0===t?void 0:t.current)||(null===(n=p.current[B[2]])||void 0===n?void 0:n.current)||(null===(r=g.current[Number(B[2])])||void 0===r?void 0:r.current)||null,rightAnchor:(null===(i=x.current[m])||void 0===i?void 0:i.current)||(null===(c=R.current[B[3]])||void 0===c?void 0:c.current)||(null===(o=f.current[Number(B[3])])||void 0===o?void 0:o.current)||null}}var C=Number(s),S=null!==h?Number(h):C;return{leftAnchor:(null===(l=y.current[C])||void 0===l?void 0:l.current)||(null===(u=A.current[C])||void 0===u?void 0:u.current)||(null===(a=g.current[C])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=x.current[S])||void 0===d?void 0:d.current)||(null===(v=f.current[S])||void 0===v?void 0:v.current)||null}}(),v=d.leftAnchor,s=d.rightAnchor,h=o===l?v:s,B=o===l?s:v,m=null;if(h&&B){var S=h.getBoundingClientRect(),b=B.getBoundingClientRect(),I=a.getBoundingClientRect(),E=S.top+S.height/2;m=b.top-I.top+a.scrollTop+b.height/2-(E-I.top)}else{var M=Math.max(0,o.scrollHeight-o.clientHeight),D=Math.max(0,a.scrollHeight-a.clientHeight);m=M>0?o.scrollTop/M*D:o.scrollTop}var L=Math.max(0,a.scrollHeight-a.clientHeight);m=Math.max(0,Math.min(m,L)),Math.abs(a.scrollTop-m)>1&&(ft.current=!0,a.scrollTop=m,requestAnimationFrame(function(){ft.current=!1}))}}T||Bt(),gt.current||(gt.current=!0,requestAnimationFrame(function(){var t,n,o,l,u,a,d;if(H.current){var v=i.current,s=c.current;if(v&&s&&P.current){if(!_.current){var h=N.current,g=void 0;if("string"==typeof h&&h.includes(e.DEVIATION_BADGE_SEPARATOR)){var f=h.split(e.DEVIATION_BADGE_SEPARATOR),p="".concat(f[0]).concat(e.DEVIATION_BADGE_SEPARATOR).concat(f[1]);g=null===(t=y.current[p])||void 0===t?void 0:t.current}else g=null===(n=y.current[h])||void 0===n?void 0:n.current;if(g){var R=g.getBoundingClientRect();_.current={badgeScreenY:R.top+R.height/2,initialScrollTop:v.scrollTop,leftTop:v.getBoundingClientRect().top,leftBottom:v.getBoundingClientRect().top+v.clientHeight,cTop:null!==(l=null===(o=r.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==l?l:0}}}if(_.current){var x=_.current,A=v.scrollTop-x.initialScrollTop,B=x.badgeScreenY-A,m=((u=B,a=x.leftTop,d=x.leftBottom,Math.max(a,Math.min(d,u)))-x.cTop).toString(),C=B>=x.leftTop-4&&B<=x.leftBottom+4;P.current.setAttribute("y1",m),P.current.setAttribute("y2",m),P.current.setAttribute("visibility",C?"visible":"hidden")}}}yt.current.length>0&&At(),gt.current=!1}))}},[At,T,z,C,Bt]);return t.useEffect(function(){Y.current=xt},[xt]),t.useEffect(function(){var t=setTimeout(Bt,250),e=function(){return q.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==pt.current&&clearTimeout(pt.current),null!==j.current&&clearTimeout(j.current),window.removeEventListener("resize",e)}},[K,J,Q,v,B,m,a,d,X,Bt,S,b,L,C]),{lines:tt,setLines:et,overallConnector:rt,setOverallConnector:it,connectedLines:ut,setConnectedLines:at,svgDimensions:vt,cachedConnectedPositions:yt,calculateLines:xt,calculateLinesRef:Y,calculateLinesDebounced:Bt,handleColumnScroll:mt}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("../CognitiveComparehelpers.js");exports.useLinesCalculator=function(n){var i=n.containerRef,r=n.leftContainerRef,c=n.rightContainerRef;n.svgContainerRef;var l=n.pathRefs,o=n.leftHeaderRef,u=n.rightHeaderRef,a=n.proposedSections,d=n.existingSections,s=n.visibleFields,v=n.leftRefs,h=n.rightRefs,g=n.sectionLeftRefs,f=n.sectionRightRefs,b=n.subSectionLeftRefs,p=n.subSectionRightRefs,A=n.lhsBadgeRefs,y=n.rhsBadgeRefs,R=n.sectionRowRefs,x=n.expandedSections,m=n.expandedSubSections,B=n.connectedSections,S=n.isSideBySide,T=n.activeSideBySideSection,C=n.maintainRelativeOrder,I=n.isGuidelineMode,E=n.cognitiveMap,M=n.getSectionCompareStyle,D=n.getSubSectionCompareStyle,O=n.getDeviationStyleByKey,L=n.isArrowVisible,_=n.isAnimatingRef,F=n.isSideBySideRef,N=n.sideBySideCacheRef,H=n.sideBySideLineRef,P=n.activeSideBySideSectionRef,k=n.activeSideBySideRightSectionRef,G=n.connectedLines,w=n.setConnectedLines,V=n.cachedConnectedPositions,Y=n.calculateLinesRef,j=n.resizeTimerRef,z=n.scrollLock,Q=n.scrollSyncLocked,X=n.handleResizeRef,q=n.activeProposed,K=n.existingRule,J=n.analysisData,U=n.pendingScrollTargetRef,W=n.pendingScrollCallbackRef,Z=n.resolvedComparisonConfig,$=n.getFieldData,tt=t.useState([]),et=tt[0],nt=tt[1],it=t.useState(null),rt=it[0],ct=it[1],lt=t.useState([]),ot=lt[0],ut=lt[1],at=null!=G?G:ot,dt=null!=w?w:ut,st=t.useState({width:0,height:0}),vt=st[0],ht=st[1],gt=t.useRef(!1),ft=t.useRef(!1),bt=t.useRef(!1),pt=t.useRef(null),At=t.useRef([]),yt=null!=V?V:At,Rt=function(t,e,n,i,r,c,l){if(Math.abs(i-e)<=1)return c&&l?"M ".concat(t,",").concat(e," L ").concat(n,",").concat(i):c&&!l?"M ".concat(t,",").concat(e," L ").concat(r,",").concat(e):!c&&l?"M ".concat(r,",").concat(e," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i);var o=Math.min(15,Math.abs(r-t),Math.abs(i-e)/2),u=Math.min(15,Math.abs(n-r),Math.abs(i-e)/2),a=i>e?o:-o,d=i>e?u:-u,s=n>r?u:-u;return c&&l?"M ".concat(t,",").concat(e," L ").concat(r-o,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):c&&!l?"M ".concat(t,",").concat(e," L ").concat(r-o,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i):!c&&l?"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i)},xt=t.useCallback(function(){var t,n,l,R,L,F,N,H,P,k,G,w,V,Y,j,z,Q,X;if(!gt.current&&!_.current){gt.current=!0;try{if(!i.current)return;var q=function(t){var e=t.split("-"),n=e[0];if(!x[n]&&!1===C)return!1;if(C&&!x["left-".concat(n)]&&!x["right-".concat(n)]&&!x[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!m[i])return!1;return!0},K=i.current.getBoundingClientRect();ht({width:K.width,height:K.height});var J=[];if(s.forEach(function(t){var e,n,i=t.key,r=null===(e=v.current[i])||void 0===e?void 0:e.current,c=null===(n=h.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!_.current){for(var U=0;U<Math.max(a.length,d.length);U++){var W=null===(t=g.current[U])||void 0===t?void 0:t.current,Z=null===(n=f.current[U])||void 0===n?void 0:n.current;W&&(W.style.height="auto",W.style.minHeight="0px"),Z&&(Z.style.height="auto",Z.style.minHeight="0px")}C||Object.keys(b.current).forEach(function(t){var e,n;if(q(t)){var i=null===(e=b.current[t])||void 0===e?void 0:e.current,r=null===(n=p.current[t])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var $={};s.forEach(function(t){var e,n,i=t.key,r=null===(e=v.current[i])||void 0===e?void 0:e.current,c=null===(n=h.current[i])||void 0===n?void 0:n.current;if(r&&c){var l=r.getBoundingClientRect(),o=c.getBoundingClientRect();$[i]=Math.max(l.height,o.height)}});var tt={left:{},right:{}},et={};if(!_.current)if(C){if(S&&null!==T)if("number"==typeof T){var it=T,rt=a[it],lt=null===(L=g.current[it])||void 0===L?void 0:L.current;lt&&rt&&(rt.refIndexes||[]).forEach(function(t){var e,n=d.findIndex(function(e){return e.selfIndex===t}),i=null===(e=f.current[n])||void 0===e?void 0:e.current;if(i&&(x["left-".concat(it)]||x["right-".concat(n)])){var r=Math.max(lt.getBoundingClientRect().height,i.getBoundingClientRect().height);tt.left[it]=Math.max(tt.left[it]||0,r),tt.right[n]=Math.max(tt.right[n]||0,r)}})}else{var ot=T.split(e.DEVIATION_BADGE_SEPARATOR)[2];if(ot){W=null===(F=b.current[ot])||void 0===F?void 0:F.current,Z=null===(N=p.current[ot])||void 0===N?void 0:N.current;if(W&&Z){ut=Math.max(W.getBoundingClientRect().height,Z.getBoundingClientRect().height);et[ot]=Math.max(et[ot]||0,ut)}}}}else{Object.keys(b.current).forEach(function(t){var e,n;if(q(t)){var i=null===(e=b.current[t])||void 0===e?void 0:e.current,r=null===(n=p.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),l=r.getBoundingClientRect(),o=Math.max(c.height,l.height);et[t]=o,i.style.minHeight="".concat(o,"px"),r.style.minHeight="".concat(o,"px")}}});for(U=0;U<Math.min(a.length,d.length);U++){var W=null===(l=g.current[U])||void 0===l?void 0:l.current,Z=null===(R=f.current[U])||void 0===R?void 0:R.current;if(W&&Z){var ut=Math.max(W.getBoundingClientRect().height,Z.getBoundingClientRect().height);tt.left[U]=ut,tt.right[U]=ut}}}if(s.forEach(function(t){var e,n,i=t.key,r=null===(e=v.current[i])||void 0===e?void 0:e.current,c=null===(n=h.current[i])||void 0===n?void 0:n.current;if(r&&c){var l=$[i];r.style.minHeight="".concat(l,"px"),c.style.minHeight="".concat(l,"px")}}),_.current||(Object.entries(tt.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=g.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(tt.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=f.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),C||Object.keys(et).forEach(function(t){var e,n,i=null===(e=b.current[t])||void 0===e?void 0:e.current,r=null===(n=p.current[t])||void 0===n?void 0:n.current;if(i&&r&&et[t]){var c=et[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),!I){a.forEach(function(t,e){var n,i=null===(n=g.current[e])||void 0===n?void 0:n.current;if(i){var l=function(t,e){var n=(t.refIndexes||[]).map(function(t){return d.findIndex(function(e){return e.selfIndex===t})}).filter(function(t){return-1!==t});return!n.length&&d[e]?[e]:Array.from(new Set(n))}(t,e);l.forEach(function(n){var l,o,u,a,s,v,h,g,b,p,A=null===(l=f.current[n])||void 0===l?void 0:l.current;if(A){var y=i.getBoundingClientRect(),R=A.getBoundingClientRect(),x=y.right-K.left,m=R.left-K.left,B=y.top+18-K.top,I=R.top+18-K.top;if(C&&S&&T===e){var D=null!==(u=null===(o=r.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==u?u:0,O=null!==(s=null===(a=c.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,L=D+(null!==(h=null===(v=r.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0),_=O+(null!==(b=null===(g=c.current)||void 0===g?void 0:g.clientHeight)&&void 0!==b?b:1/0),F=function(t,e,n){return Math.max(e,Math.min(n,t))};B=F(y.top+18,D,L)-K.top,I=F(R.top+18,O,_)-K.top}var N=M(e);N&&J.push({id:"line-".concat(e,"-").concat(n),x1:x,y1:B,x2:m,y2:I,style:N,sectionIdx:e,targetRightIdx:n,isSubSection:!1,hasCognitive:!!((null==t?void 0:t.cognitiveData)||(null===(p=d[n])||void 0===p?void 0:p.cognitiveData)||(null==t?void 0:t.nodeId)&&E[t.nodeId])})}})}})}if(!I&&S&&"string"==typeof T&&T.includes(e.DEVIATION_BADGE_SEPARATOR)){var at=T.split(e.DEVIATION_BADGE_SEPARATOR),st=at[0],vt=at[1],ft=at[2],bt=(at[3],"".concat(st).concat(e.DEVIATION_BADGE_SEPARATOR).concat(vt)),pt=null===(H=A.current[bt])||void 0===H?void 0:H.current,At=null===(P=y.current[bt])||void 0===P?void 0:P.current;if(pt&&At){var xt=pt.getBoundingClientRect(),Bt=At.getBoundingClientRect(),St=xt.right-K.left,Tt=Bt.left-K.left,Ct=xt.top+xt.height/2-K.top,It=Bt.top+Bt.height/2-K.top;if(C){var Et=null!==(G=null===(k=r.current)||void 0===k?void 0:k.getBoundingClientRect().top)&&void 0!==G?G:0,Mt=null!==(V=null===(w=c.current)||void 0===w?void 0:w.getBoundingClientRect().top)&&void 0!==V?V:0,Dt=Et+(null!==(j=null===(Y=r.current)||void 0===Y?void 0:Y.clientHeight)&&void 0!==j?j:1/0),Ot=Mt+(null!==(Q=null===(z=c.current)||void 0===z?void 0:z.clientHeight)&&void 0!==Q?Q:1/0),Lt=function(t,e,n){return Math.max(e,Math.min(n,t))};Ct=Lt(xt.top+xt.height/2,Et,Dt)-K.top,It=Lt(Bt.top+Bt.height/2,Mt,Ot)-K.top}var _t=null!==(X=O(st,vt))&&void 0!==X?X:D(ft);_t&&J.push({id:"line-subsec-".concat(bt),x1:St,y1:Ct,x2:Tt,y2:It,style:_t,sectionIdx:Number(ft.split("-")[0]),isSubSection:!0,subSectionKeyPath:T})}}if(nt(J),o.current&&u.current){var Ft=o.current.getBoundingClientRect(),Nt=u.current.getBoundingClientRect(),Ht=(Ft.top+Ft.height/2-K.top+Nt.top+Nt.height/2-K.top)/2;ct({x1:Ft.right-K.left,x2:Nt.left-K.left,y:Ht})}else ct(null);if(B.size>0){var Pt=[],kt=r.current,Gt=c.current;if(kt&&Gt){var wt=[],Vt=kt.getBoundingClientRect().top,Yt=Gt.getBoundingClientRect().top,jt=Vt+kt.clientHeight,zt=Yt+Gt.clientHeight,Qt=kt.scrollTop,Xt=Gt.scrollTop,qt=K.top,Kt=function(t,e,n){return Math.max(e,Math.min(n,t))};B.forEach(function(t){var n,i,r,c,l,o,u,s,v;if(I){var h=null,g=null,f=null;if("string"==typeof t&&t.includes(e.DEVIATION_BADGE_SEPARATOR)){var b=t.split(e.DEVIATION_BADGE_SEPARATOR),p=b[0],R=b[1],x=b[2],m="".concat(p).concat(e.DEVIATION_BADGE_SEPARATOR).concat(R);h=null===(n=A.current[m])||void 0===n?void 0:n.current,f=null!==(i=O(p,R))&&void 0!==i?i:D(x),g=Number((null==x?void 0:x.split("-")[0])||0)}else g=Number(t),h=null===(r=A.current[g])||void 0===r?void 0:r.current,f=M(g);if(!h)return;var B=document.querySelectorAll('[id^="guideline-target-"]');B.forEach(function(n,i){var r=h.getBoundingClientRect(),c=n.getBoundingClientRect(),l=r.right-K.left,o=c.left-K.left-0,u=l+75,a=r.top+r.height/2,d=c.top+c.height/2,s=a-Vt+Qt,v=d-Yt+Xt,g="conn-guide-".concat(t,"-").concat(i),b="";"string"==typeof t&&t.includes(e.DEVIATION_BADGE_SEPARATOR)?b=(t.split(e.DEVIATION_BADGE_SEPARATOR)[2]||"").split("-").map(function(t){return Number(t)+1}).join("."):b=String(Number(t)+1);var p=String.fromCharCode(97+i),A=1===B.length?null:"".concat(b,"(").concat(p,")");wt.push({lhsScrollY:s,rhsScrollY:v,x1:l,x2:o,containerTop:qt,leftIdx:t,rhsArrayIdx:i,styleColor:(null==f?void 0:f.badgeBorder)||"#6366F1",styleBg:(null==f?void 0:f.badgeBg)||"#FFFFFF",styleText:(null==f?void 0:f.badgeText)||"#A16207",styleId:g,centerX:u});var y=Kt(a,Vt,jt),R=Kt(d,Yt,zt),x=y-qt,m=R-qt,S=Rt(l,x,o,m,u,a>=Vt-4&&a<=jt+4,d>=Yt-4&&d<=zt+4);Pt.push({id:g,pathD:S,style:f,leftIdx:t,rhsArrayIdx:i,x1:l,x2:o,y1:x,y2:m,centerX:u,matchLabel:A,isGuideline:!0})})}else if("string"==typeof t&&t.includes(e.DEVIATION_BADGE_SEPARATOR)){var S=t.split(e.DEVIATION_BADGE_SEPARATOR),T=(p=S[0],R=S[1],x=S[2],S[3],m="".concat(p).concat(e.DEVIATION_BADGE_SEPARATOR).concat(R),null===(c=A.current[m])||void 0===c?void 0:c.current),E=null===(l=y.current[m])||void 0===l?void 0:l.current;if(!T||!E)return;var L=T.getBoundingClientRect(),_=E.getBoundingClientRect(),F=null!==(o=O(p,R))&&void 0!==o?o:D(x),N=L.right-K.left,H=_.left-K.left-0,P=N+75,k=L.top+L.height/2,G=_.top+_.height/2,w=k-Vt+Qt,V=G-Yt+Xt,Y="conn-subsec-".concat(m),j=((x||"").split("-").map(function(t){return Number(t)+1}).join("."),null);wt.push({lhsScrollY:w,rhsScrollY:V,x1:N,x2:H,containerTop:qt,leftIdx:t,rhsArrayIdx:t,styleColor:(null==F?void 0:F.badgeBorder)||"#6366F1",styleBg:(null==F?void 0:F.badgeBg)||"#FFFFFF",styleText:(null==F?void 0:F.badgeText)||"#A16207",styleId:Y,centerX:P});var z=Kt(k,Vt,jt),Q=Kt(G,Yt,zt),X=Rt(N,Z=z-qt,H,$=Q-qt,P,k>=Vt-4&&k<=jt+4,G>=Yt-4&&G<=zt+4);Pt.push({id:Y,pathD:X,style:F,leftIdx:t,rhsArrayIdx:t,x1:N,x2:H,y1:Z,y2:$,matchLabel:j})}else if(C){var q=t,J=a[q];if(!(null===(v=null==J?void 0:J.refIndexes)||void 0===v?void 0:v.length))return;J.refIndexes.forEach(function(e,n){var i,r,c=d.findIndex(function(t){return t.selfIndex===e});if(-1!==c){var l=null===(i=A.current[q])||void 0===i?void 0:i.current,o=null===(r=y.current[c])||void 0===r?void 0:r.current;if(l&&o){var u=l.getBoundingClientRect(),a=o.getBoundingClientRect(),s=M(q),v=u.right-K.left,h=a.left-K.left-0,g=v+75,f=u.top+u.height/2,b=a.top+a.height/2,p=f-Vt+Qt,R=b-Yt+Xt,x="conn-".concat(q,"-").concat(c),m=String(Number(t)+1),B=String.fromCharCode(97+n),S=1===J.refIndexes.length?null:"".concat(m,"(").concat(B,")");wt.push({lhsScrollY:p,rhsScrollY:R,x1:v,x2:h,containerTop:qt,leftIdx:q,rhsArrayIdx:c,styleColor:(null==s?void 0:s.badgeBorder)||"#6366F1",styleBg:(null==s?void 0:s.badgeBg)||"#FFFFFF",styleText:(null==s?void 0:s.badgeText)||"#A16207",styleId:x,centerX:g});var T=Kt(f,Vt,jt),C=Kt(b,Yt,zt),I=T-qt,E=C-qt,D=Rt(v,I,h,E,g,f>=Vt-4&&f<=jt+4,b>=Yt-4&&b<=zt+4);Pt.push({id:x,pathD:D,style:s,leftIdx:q,rhsArrayIdx:c,x1:v,x2:h,y1:I,y2:E,matchLabel:S})}}})}else{var U=t,W=U;T=null===(u=A.current[U])||void 0===u?void 0:u.current,E=null===(s=y.current[W])||void 0===s?void 0:s.current;if(!T||!E)return;L=T.getBoundingClientRect(),_=E.getBoundingClientRect(),F=M(U),N=L.right-K.left,H=_.left-K.left-0,P=N+75,k=L.top+L.height/2,G=_.top+_.height/2,w=k-Vt+Qt,V=G-Yt+Xt,Y="conn-".concat(U,"-").concat(W),String(Number(t)+1),j=null;wt.push({lhsScrollY:w,rhsScrollY:V,x1:N,x2:H,containerTop:qt,leftIdx:U,rhsArrayIdx:W,styleColor:(null==F?void 0:F.badgeBorder)||"#6366F1",styleBg:(null==F?void 0:F.badgeBg)||"#FFFFFF",styleText:(null==F?void 0:F.badgeText)||"#A16207",styleId:Y,centerX:P});var Z,$;z=Kt(k,Vt,jt),Q=Kt(G,Yt,zt),X=Rt(N,Z=z-qt,H,$=Q-qt,P,k>=Vt-4&&k<=jt+4,G>=Yt-4&&G<=zt+4);Pt.push({id:Y,pathD:X,style:F,leftIdx:U,rhsArrayIdx:W,x1:N,x2:H,y1:Z,y2:$,matchLabel:j})}}),yt.current=wt}dt(Pt),setTimeout(function(){return mt()},10)}else dt([]),yt.current=[],setTimeout(function(){return mt()},10)}catch(t){console.error("Line render safe fail: ",t)}finally{gt.current=!1}}},[s,a,d,E,Z,$,M,O,C,S,T,B,x,m,I]),mt=t.useCallback(function(){var t,e,n,o,u,a,d,s,v,h,g,f,b,p,A,y,R,x,m,B=yt.current;if(!B.length)return null===(t=l.current["guideline-up-stroke"])||void 0===t||t.setAttribute("visibility","hidden"),null===(e=l.current["guideline-up-badge"])||void 0===e||e.setAttribute("visibility","hidden"),null===(n=l.current["guideline-down-stroke"])||void 0===n||n.setAttribute("visibility","hidden"),void(null===(o=l.current["guideline-down-badge"])||void 0===o||o.setAttribute("visibility","hidden"));if(!_.current){var S=null!==(a=null===(u=r.current)||void 0===u?void 0:u.scrollTop)&&void 0!==a?a:0,T=null!==(s=null===(d=c.current)||void 0===d?void 0:d.scrollTop)&&void 0!==s?s:0,C=null!==(h=null===(v=r.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0,I=null!==(f=null===(g=c.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0,E=null!==(p=null===(b=r.current)||void 0===b?void 0:b.getBoundingClientRect().top)&&void 0!==p?p:0,M=null!==(y=null===(A=c.current)||void 0===A?void 0:A.getBoundingClientRect().top)&&void 0!==y?y:0,D=E+C,O=M+I,L=null===(R=i.current)||void 0===R?void 0:R.getBoundingClientRect(),F=null!==(x=null==L?void 0:L.top)&&void 0!==x?x:0,N=null!==(m=null==L?void 0:L.height)&&void 0!==m?m:1/0,H=function(t,e,n){return Math.max(e,Math.min(n,t))},P=0,k=0,G=0,w=0,V="#6366F1",Y="#A16207",j=!1,z=0;if(B.forEach(function(t){var e=t.lhsScrollY-S+E,n=t.rhsScrollY-T+M,i=l.current[t.styleId+"-stroke"],r=l.current[t.styleId+"-bg"],c=l.current[t.styleId+"-btn"],o=l.current[t.styleId+"-number"];if(i||r){var u=H(e,E,D),a=H(n,M,O),d=u-F,s=a-F,v=e>=E-4&&e<=D+4,h=n>=M-4&&n<=O+4,g=!0;j=!0;var f=t.centerX||t.x1+75;0===G&&(G=t.x1,w=d,z=f,V=t.styleColor,t.styleBg,Y=t.styleText||"#A16207"),n<M-4?(P++,g=!1):n>O+4&&(k++,g=!1);var b=Rt(t.x1,d,t.x2,s,z,v,h);i&&(g&&b?(i.setAttribute("visibility","visible"),i.setAttribute("d",b)):i.setAttribute("visibility","hidden")),r&&(g&&b?(r.setAttribute("visibility","visible"),r.setAttribute("d",b)):r.setAttribute("visibility","hidden")),c&&(v&&g?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(d-12))):c.setAttribute("visibility","hidden")),o&&(v&&g?(o.setAttribute("visibility","visible"),o.setAttribute("transform","translate(".concat(t.x2-42,", ").concat(s,")"))):o.setAttribute("visibility","hidden"))}}),j&&z>0){var Q=l.current["guideline-up-stroke"],X=l.current["guideline-up-badge"],q=l.current["guideline-up-arrow"],K=l.current["guideline-up-text"],J=l.current["guideline-up-badge-rect"];if(P>0){var U=Math.max(15,M-F+15),W=Math.min(15,Math.abs(z-G),Math.max(0,w-U)),Z="M ".concat(G,",").concat(w," L ").concat(z-W,",").concat(w," Q ").concat(z,",").concat(w," ").concat(z,",").concat(w-W," L ").concat(z,",").concat(U);null==Q||Q.setAttribute("visibility","visible"),null==Q||Q.setAttribute("d",Z),null==Q||Q.setAttribute("stroke",V),null==X||X.setAttribute("visibility","visible"),null==X||X.setAttribute("transform","translate(".concat(z,", ").concat(U,")")),q&&q.setAttribute("fill",V),K&&(K.textContent="+".concat(P),K.setAttribute("fill",Y)),J&&J.setAttribute("stroke",V)}else null==Q||Q.setAttribute("visibility","hidden"),null==X||X.setAttribute("visibility","hidden");var $=l.current["guideline-down-stroke"],tt=l.current["guideline-down-badge"],et=l.current["guideline-down-arrow"],nt=l.current["guideline-down-text"],it=l.current["guideline-down-badge-rect"];if(k>0){var rt=Math.min(N-15,O-F-15);W=Math.min(15,Math.abs(z-G),Math.max(0,rt-w)),Z="M ".concat(G,",").concat(w," L ").concat(z-W,",").concat(w," Q ").concat(z,",").concat(w," ").concat(z,",").concat(w+W," L ").concat(z,",").concat(rt);null==$||$.setAttribute("visibility","visible"),null==$||$.setAttribute("d",Z),null==$||$.setAttribute("stroke",V),null==tt||tt.setAttribute("visibility","visible"),null==tt||tt.setAttribute("transform","translate(".concat(z,", ").concat(rt,")")),et&&et.setAttribute("fill",V),nt&&(nt.textContent="+".concat(k),nt.setAttribute("fill",Y)),it&&it.setAttribute("stroke",V)}else null==$||$.setAttribute("visibility","hidden"),null==tt||tt.setAttribute("visibility","hidden")}}},[]),Bt=t.useCallback(function(){yt.current.length>0&&!_.current||(null!==pt.current&&clearTimeout(pt.current),pt.current=setTimeout(function(){Y.current(),pt.current=null},50))},[]),St=t.useCallback(function(t){if(null!==U.current&&W.current&&Math.abs(t.currentTarget.scrollTop-U.current)<=2){var n=W.current;U.current=null,W.current=null,n()}if(!bt.current&&!z.current){if(C&&Q&&(F.current||B.size>0)){var l=t.currentTarget,o=r.current,u=c.current,a=l===o?u:l===u?o:null;if(l&&a){var d=function(){var t,n,i,r,c,l,o,u,a,d,s,v=P.current,h=k.current;if(null===v)return{leftAnchor:null,rightAnchor:null};if("string"==typeof v&&v.includes(e.DEVIATION_BADGE_SEPARATOR)){var x=v.split(e.DEVIATION_BADGE_SEPARATOR),m="".concat(x[0]).concat(e.DEVIATION_BADGE_SEPARATOR).concat(x[1]);return{leftAnchor:(null===(t=A.current[m])||void 0===t?void 0:t.current)||(null===(n=b.current[x[2]])||void 0===n?void 0:n.current)||(null===(i=g.current[Number(x[2])])||void 0===i?void 0:i.current)||null,rightAnchor:(null===(r=y.current[m])||void 0===r?void 0:r.current)||(null===(c=p.current[x[3]])||void 0===c?void 0:c.current)||(null===(l=f.current[Number(x[3])])||void 0===l?void 0:l.current)||null}}var B=Number(v),S=null!==h?Number(h):B;return{leftAnchor:(null===(o=A.current[B])||void 0===o?void 0:o.current)||(null===(u=R.current[B])||void 0===u?void 0:u.current)||(null===(a=g.current[B])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=y.current[S])||void 0===d?void 0:d.current)||(null===(s=f.current[S])||void 0===s?void 0:s.current)||null}}(),s=d.leftAnchor,v=d.rightAnchor,h=l===o?s:v,x=l===o?v:s,m=null;if(h&&x){var S=h.getBoundingClientRect(),T=x.getBoundingClientRect(),I=a.getBoundingClientRect(),E=S.top+S.height/2;m=T.top-I.top+a.scrollTop+T.height/2-(E-I.top)}else{var M=Math.max(0,l.scrollHeight-l.clientHeight),D=Math.max(0,a.scrollHeight-a.clientHeight);m=M>0?l.scrollTop/M*D:l.scrollTop}var O=Math.max(0,a.scrollHeight-a.clientHeight);m=Math.max(0,Math.min(m,O)),Math.abs(a.scrollTop-m)>1&&(bt.current=!0,a.scrollTop=m,requestAnimationFrame(function(){bt.current=!1}))}}C||Bt(),ft.current||(ft.current=!0,requestAnimationFrame(function(){var t,n,l,o,u,a,d;if(F.current){var s=r.current,v=c.current;if(s&&v&&H.current){if(!N.current){var h=P.current,g=void 0;if("string"==typeof h&&h.includes(e.DEVIATION_BADGE_SEPARATOR)){var f=h.split(e.DEVIATION_BADGE_SEPARATOR),b="".concat(f[0]).concat(e.DEVIATION_BADGE_SEPARATOR).concat(f[1]);g=null===(t=A.current[b])||void 0===t?void 0:t.current}else g=null===(n=A.current[h])||void 0===n?void 0:n.current;if(g){var p=g.getBoundingClientRect();N.current={badgeScreenY:p.top+p.height/2,initialScrollTop:s.scrollTop,leftTop:s.getBoundingClientRect().top,leftBottom:s.getBoundingClientRect().top+s.clientHeight,cTop:null!==(o=null===(l=i.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==o?o:0}}}if(N.current){var y=N.current,R=s.scrollTop-y.initialScrollTop,x=y.badgeScreenY-R,m=((u=x,a=y.leftTop,d=y.leftBottom,Math.max(a,Math.min(d,u)))-y.cTop).toString(),B=x>=y.leftTop-4&&x<=y.leftBottom+4;H.current.setAttribute("y1",m),H.current.setAttribute("y2",m),H.current.setAttribute("visibility",B?"visible":"hidden")}}}mt(),ft.current=!1}))}},[mt,C,Q,B,Bt]);return t.useEffect(function(){Y.current=xt},[xt]),t.useEffect(function(){var t=setTimeout(Bt,250),e=function(){return X.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==pt.current&&clearTimeout(pt.current),null!==j.current&&clearTimeout(j.current),window.removeEventListener("resize",e)}},[q,K,J,s,x,m,a,d,Z,Bt,S,T,L,B]),{lines:et,setLines:nt,overallConnector:rt,setOverallConnector:ct,connectedLines:at,setConnectedLines:dt,svgDimensions:vt,cachedConnectedPositions:yt,calculateLines:xt,calculateLinesRef:Y,calculateLinesDebounced:Bt,handleColumnScroll:St}};
2
2
  //# sourceMappingURL=useLinesCalculator.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("../CognitiveComparehelpers.js");exports.useSideBySide=function(t){var r=t.maintainRelativeOrder,i=t.proposedSections,l=t.existingSections,u=t.leftContainerRef,o=t.rightContainerRef,c=t.scrollContainerRef,s=t.sectionLeftRefs,d=t.sectionRightRefs,a=t.subSectionLeftRefs,v=t.subSectionRightRefs,p=t.lhsBadgeRefs,f=t.rhsBadgeRefs,g=t.sectionRowRefs,R=t.sectionRightRowRefs,S=t.rhsTopSpacerRef,h=t.rhsBottomSpacerRef,y=t.lhsTopSpacerRef,T=t.lhsBottomSpacerRef,B=t.calculateLinesRef,m=t.setConnectedSections,A=t.setConnectedLines,x=t.cachedConnectedPositions,E=t.closeMoreFunctionsPopup,C=t.setErrorToast;t.moreFunctions,t.closeSummaryPopup;var I=e.useState(!1),b=I[0],O=I[1],_=e.useState(!1),D=_[0],N=_[1],P=e.useState(!1),V=P[0],w=P[1],L=e.useState(!1),q=L[0],F=L[1],G=e.useState(null),H=G[0],k=G[1],M=e.useRef(!1),j=e.useRef(null),z=e.useRef(!1),J=e.useRef(null),K=e.useRef(null),Q=e.useRef(null),U=e.useRef(new Set),W=function(){U.current.forEach(function(e){n.resetClauseHighlight(e)}),U.current.clear()},X=function(e,t,r){var i,l,c,S,h,y,T,B,m,A,x,E,C=null,I=null,b=null,O=null,_=null,D=null,N=function(e,n){if(!e||!n)return!0;var t=e.getBoundingClientRect(),r=n.getBoundingClientRect();return t.bottom>=r.top&&t.top<=r.bottom};if(e){var P=t.split(n.DEVIATION_BADGE_SEPARATOR),V="".concat(P[0]).concat(n.DEVIATION_BADGE_SEPARATOR).concat(P[1]);C=(null===(i=a.current[P[2]])||void 0===i?void 0:i.current)||(null===(l=s.current[Number(P[2])])||void 0===l?void 0:l.current)||null,I=(null===(c=v.current[P[3]])||void 0===c?void 0:c.current)||(null===(S=d.current[Number(P[3])])||void 0===S?void 0:S.current)||null,b=(null===(h=p.current[V])||void 0===h?void 0:h.current)||C,O=(null===(y=f.current[V])||void 0===y?void 0:y.current)||I}else{var w=Number(t),L=null!==r?Number(r):w;C=(null===(T=s.current[w])||void 0===T?void 0:T.current)||null,I=(null===(B=d.current[L])||void 0===B?void 0:B.current)||null,_=(null===(m=p.current[w])||void 0===m?void 0:m.current)||null,D=(null===(A=f.current[L])||void 0===A?void 0:A.current)||null,b=_||(null===(x=g.current[w])||void 0===x?void 0:x.current)||C,O=D||(null===(E=R.current[L])||void 0===E?void 0:E.current)||I}if(C&&(C.style.paddingTop="0px"),I&&(I.style.paddingTop="0px"),e||(_&&(_.style.marginTop="0px"),D&&(D.style.marginTop="0px")),!e&&_&&D){var q=u.current,F=o.current;if(!N(_,q)||!N(D,F))return;var G=_.getBoundingClientRect(),H=D.getBoundingClientRect(),k=G.top-H.top;if(Math.abs(k)>32)return;k>0&&(D.style.marginTop="".concat(k,"px"))}else if(b&&O&&C&&I){G=b.getBoundingClientRect(),H=O.getBoundingClientRect();(k=G.top-H.top)>0&&(I.style.paddingTop="".concat(k,"px"))}},Y=e.useCallback(function(){var e,t,r,i,l,u,o,c,g=J.current,R=K.current;if(null!==g)if("string"==typeof g&&g.includes(n.DEVIATION_BADGE_SEPARATOR)){var B=g.split(n.DEVIATION_BADGE_SEPARATOR),m=(null===(e=a.current[B[2]])||void 0===e?void 0:e.current)||(null===(t=s.current[Number(B[2])])||void 0===t?void 0:t.current)||null,A=(null===(r=v.current[B[3]])||void 0===r?void 0:r.current)||(null===(i=d.current[Number(B[3])])||void 0===i?void 0:i.current)||null;m&&(m.style.paddingTop="0px"),A&&(A.style.paddingTop="0px")}else{m=(null===(l=s.current[g])||void 0===l?void 0:l.current)||null,A=(null===(u=d.current[null!=R?R:g])||void 0===u?void 0:u.current)||null;m&&(m.style.paddingTop="0px"),A&&(A.style.paddingTop="0px");var x=(null===(o=p.current[g])||void 0===o?void 0:o.current)||null,E=(null===(c=f.current[null!=R?R:g])||void 0===c?void 0:c.current)||null;x&&(x.style.marginTop="0px"),E&&(E.style.marginTop="0px")}S.current&&(S.current.style.height="0px"),h.current&&(h.current.style.height="0px"),y.current&&(y.current.style.height="0px"),T.current&&(T.current.style.height="0px")},[]);e.useEffect(function(){z.current=b},[b]),e.useEffect(function(){J.current=H},[H]);var Z=e.useCallback(function(){W(),O(!1),z.current=!1,j.current=null,Y(),k(null),J.current=null,K.current=null,N(!1),F(!1)},[Y]),$=e.useCallback(function(e,t,a){var v,I,_=null===(v=null==a?void 0:a.toggleIfSame)||void 0===v||v,D=null==a?void 0:a.onReady,P=null!==(I=null==a?void 0:a.sourceSide)&&void 0!==I?I:"left";if(E(),null!=e)if(t)C("No counterpart exists for this section.");else{W();var V=b&&H===e;b&&null!==H&&Y(),V&&_?Z():(m(new Set([e])),A([]),x.current=[],F(!0),M.current=!0,k(e),J.current=e,O(!0),z.current=!0,N(!1),S.current&&(S.current.style.height="0px"),h.current&&(h.current.style.height="0px"),y.current&&(y.current.style.height="0px"),T.current&&(T.current.style.height="0px"),requestAnimationFrame(function(){var t,a,v,y,T,m,A,x,E="string"==typeof e&&e.includes(n.DEVIATION_BADGE_SEPARATOR),C=null,I=null,b=null;if(E){var O=e.split(n.DEVIATION_BADGE_SEPARATOR),_="".concat(O[0]).concat(n.DEVIATION_BADGE_SEPARATOR).concat(O[1]);C=(null===(t=p.current[_])||void 0===t?void 0:t.current)||null,I=(null===(a=f.current[_])||void 0===a?void 0:a.current)||null,b=I?e:null}else if(C=(null===(v=s.current[e])||void 0===v?void 0:v.current)||(null===(y=g.current[e])||void 0===y?void 0:y.current)||null,r){var V=i[e],w=(null==V?void 0:V.refIndexes)||[];if(w.length>0){var L=w[0],q=l.findIndex(function(e){return e.selfIndex===L});-1!==q&&(I=(null===(A=d.current[q])||void 0===A?void 0:A.current)||(null===(x=R.current[q])||void 0===x?void 0:x.current)||null,b=q)}}else I=(null===(T=d.current[e])||void 0===T?void 0:T.current)||(null===(m=R.current[e])||void 0===m?void 0:m.current)||null,b=I?e:null;K.current=b;var G=u.current,H=o.current,k=function(){X(E,e,b),N(!0),B.current&&B.current(),M.current=!1,"right"===P&&H?H.dispatchEvent(new Event("scroll")):G&&G.dispatchEvent(new Event("scroll")),F(!1),null==D||D()};if(!C||!G)return M.current=!1,F(!1),void(null==D||D());if(I&&H){if(!r){var j=0;j="right"===P?I?I.getBoundingClientRect().top:0:C?C.getBoundingClientRect().top:0;var z=c.current,J=(null==z?void 0:z.getBoundingClientRect().top)||0,Q=z?z.scrollTop+j-J-150:0;return z?void n.smoothScrollTo(z,Q,200,k):void k()}var U=C.getBoundingClientRect().top-G.getBoundingClientRect().top+G.scrollTop,W=I.getBoundingClientRect().top-H.getBoundingClientRect().top+H.scrollTop,Y=200;if("left"===P){var Z=W-(U-G.scrollTop);Z<0&&S.current&&(S.current.style.height="".concat(Math.abs(Z),"px")),requestAnimationFrame(function(){var e,t=H.scrollHeight-H.clientHeight;if(Z<0)e=0;else{if(Z>t){var r=Z-t;return h.current&&(h.current.style.height="".concat(r+150,"px")),void requestAnimationFrame(function(){n.smoothScrollTo(H,Z,Y,k)})}e=Z}n.smoothScrollTo(H,e,Y,k)})}else{var $=U-(W-H.scrollTop);requestAnimationFrame(function(){var e,t=G.scrollHeight-G.clientHeight;if($<0)e=0;else{if($>t)return void requestAnimationFrame(function(){return n.smoothScrollTo(G,t,Y,k)});e=$}n.smoothScrollTo(G,e,Y,k)})}}else k()}))}},[H,E,l,b,r,i,Y,Z]);return{isSideBySide:b,setIsSideBySide:O,isArrowVisible:D,setIsArrowVisible:N,isResizing:V,setIsResizing:w,isSideBySideLoading:q,setIsSideBySideLoading:F,activeSideBySideSection:H,setActiveSideBySideSection:k,scrollLock:M,sideBySideCacheRef:j,isSideBySideRef:z,activeSideBySideSectionRef:J,activeSideBySideRightSectionRef:K,sideBySideLineRef:Q,highlightedClauseRefs:U,clearClauseHighlight:W,applyAlignmentPadding:X,resetSideBySide:Z,activateSideBySide:$}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("../CognitiveComparehelpers.js");exports.useSideBySide=function(t){var r=t.isGuidelineMode,i=t.maintainRelativeOrder,l=t.proposedSections,u=t.existingSections,o=t.leftContainerRef,c=t.rightContainerRef,s=t.scrollContainerRef,d=t.sectionLeftRefs,a=t.sectionRightRefs,v=t.subSectionLeftRefs,f=t.subSectionRightRefs,p=t.lhsBadgeRefs,g=t.rhsBadgeRefs,R=t.sectionRowRefs,S=t.sectionRightRowRefs,h=t.rhsTopSpacerRef,A=t.rhsBottomSpacerRef,T=t.lhsTopSpacerRef,y=t.lhsBottomSpacerRef,B=t.calculateLinesRef,m=t.setConnectedSections,E=t.setConnectedLines,x=t.cachedConnectedPositions,C=t.closeMoreFunctionsPopup,I=t.setErrorToast;t.moreFunctions,t.closeSummaryPopup;var O=e.useState(!1),_=O[0],b=O[1],D=e.useState(!1),N=D[0],P=D[1],V=e.useState(!1),G=V[0],w=V[1],L=e.useState(!1),q=L[0],F=L[1],H=e.useState(null),M=H[0],k=H[1],j=e.useRef(!1),z=e.useRef(null),J=e.useRef(!1),K=e.useRef(null),Q=e.useRef(null),U=e.useRef(null),W=e.useRef(new Set),X=function(){W.current.forEach(function(e){n.resetClauseHighlight(e)}),W.current.clear()},Y=function(e,t,r){var i,l,u,s,h,A,T,y,B,m,E,x,C=null,I=null,O=null,_=null,b=null,D=null,N=function(e,n){if(!e||!n)return!0;var t=e.getBoundingClientRect(),r=n.getBoundingClientRect();return t.bottom>=r.top&&t.top<=r.bottom};if(e){var P=t.split(n.DEVIATION_BADGE_SEPARATOR),V="".concat(P[0]).concat(n.DEVIATION_BADGE_SEPARATOR).concat(P[1]);C=(null===(i=v.current[P[2]])||void 0===i?void 0:i.current)||(null===(l=d.current[Number(P[2])])||void 0===l?void 0:l.current)||null,I=(null===(u=f.current[P[3]])||void 0===u?void 0:u.current)||(null===(s=a.current[Number(P[3])])||void 0===s?void 0:s.current)||null,O=(null===(h=p.current[V])||void 0===h?void 0:h.current)||C,_=(null===(A=g.current[V])||void 0===A?void 0:A.current)||I}else{var G=Number(t),w=null!==r?Number(r):G;C=(null===(T=d.current[G])||void 0===T?void 0:T.current)||null,I=(null===(y=a.current[w])||void 0===y?void 0:y.current)||null,b=(null===(B=p.current[G])||void 0===B?void 0:B.current)||null,D=(null===(m=g.current[w])||void 0===m?void 0:m.current)||null,O=b||(null===(E=R.current[G])||void 0===E?void 0:E.current)||C,_=D||(null===(x=S.current[w])||void 0===x?void 0:x.current)||I}if(C&&(C.style.paddingTop="0px"),I&&(I.style.paddingTop="0px"),e||(b&&(b.style.marginTop="0px"),D&&(D.style.marginTop="0px")),!e&&b&&D){var L=o.current,q=c.current;if(!N(b,L)||!N(D,q))return;var F=b.getBoundingClientRect(),H=D.getBoundingClientRect(),M=F.top-H.top;if(Math.abs(M)>32)return;M>0&&(D.style.marginTop="".concat(M,"px"))}else if(O&&_&&C&&I){F=O.getBoundingClientRect(),H=_.getBoundingClientRect();(M=F.top-H.top)>0&&(I.style.paddingTop="".concat(M,"px"))}},Z=e.useCallback(function(){var e,t,r,i,l,u,o,c,s=K.current,R=Q.current;if(null!==s)if("string"==typeof s&&s.includes(n.DEVIATION_BADGE_SEPARATOR)){var S=s.split(n.DEVIATION_BADGE_SEPARATOR),B=(null===(e=v.current[S[2]])||void 0===e?void 0:e.current)||(null===(t=d.current[Number(S[2])])||void 0===t?void 0:t.current)||null,m=(null===(r=f.current[S[3]])||void 0===r?void 0:r.current)||(null===(i=a.current[Number(S[3])])||void 0===i?void 0:i.current)||null;B&&(B.style.paddingTop="0px"),m&&(m.style.paddingTop="0px")}else{B=(null===(l=d.current[s])||void 0===l?void 0:l.current)||null,m=(null===(u=a.current[null!=R?R:s])||void 0===u?void 0:u.current)||null;B&&(B.style.paddingTop="0px"),m&&(m.style.paddingTop="0px");var E=(null===(o=p.current[s])||void 0===o?void 0:o.current)||null,x=(null===(c=g.current[null!=R?R:s])||void 0===c?void 0:c.current)||null;E&&(E.style.marginTop="0px"),x&&(x.style.marginTop="0px")}h.current&&(h.current.style.height="0px"),A.current&&(A.current.style.height="0px"),T.current&&(T.current.style.height="0px"),y.current&&(y.current.style.height="0px")},[]);e.useEffect(function(){J.current=_},[_]),e.useEffect(function(){K.current=M},[M]);var $=e.useCallback(function(){X(),b(!1),J.current=!1,z.current=null,Z(),k(null),K.current=null,Q.current=null,P(!1),F(!1)},[Z]),ee=e.useCallback(function(e,t,v){var f,O,D=null===(f=null==v?void 0:v.toggleIfSame)||void 0===f||f,N=null==v?void 0:v.onReady,V=null!==(O=null==v?void 0:v.sourceSide)&&void 0!==O?O:"left";if(C(),null!=e)if(!t||r){X();var G=_&&M===e;_&&null!==M&&Z(),G&&D?$():(m(new Set([e])),E([]),x.current=[],F(!0),j.current=!0,k(e),K.current=e,b(!0),J.current=!0,P(!1),h.current&&(h.current.style.height="0px"),A.current&&(A.current.style.height="0px"),T.current&&(T.current.style.height="0px"),y.current&&(y.current.style.height="0px"),requestAnimationFrame(function(){var t=function(){var t,v,f,T,y,m,E,x,C,I,O,_="string"==typeof e&&e.includes(n.DEVIATION_BADGE_SEPARATOR),b=null,D=null,G=null;if(r){if(_){var w=e.split(n.DEVIATION_BADGE_SEPARATOR),L="".concat(w[0]).concat(n.DEVIATION_BADGE_SEPARATOR).concat(w[1]);b=(null===(t=p.current[L])||void 0===t?void 0:t.current)||null}else b=(null===(v=d.current[e])||void 0===v?void 0:v.current)||(null===(f=R.current[e])||void 0===f?void 0:f.current)||null;D=document.getElementById("guideline-target-0"),G=D?e:null}else if(_){w=e.split(n.DEVIATION_BADGE_SEPARATOR),L="".concat(w[0]).concat(n.DEVIATION_BADGE_SEPARATOR).concat(w[1]);b=(null===(T=p.current[L])||void 0===T?void 0:T.current)||null,D=(null===(y=g.current[L])||void 0===y?void 0:y.current)||null,G=D?e:null}else if(b=(null===(m=d.current[e])||void 0===m?void 0:m.current)||(null===(E=R.current[e])||void 0===E?void 0:E.current)||null,i){var q=l[e],H=(null==q?void 0:q.refIndexes)||[];if(H.length>0){var M=H[0],k=u.findIndex(function(e){return e.selfIndex===M});-1!==k&&(D=(null===(I=a.current[k])||void 0===I?void 0:I.current)||(null===(O=S.current[k])||void 0===O?void 0:O.current)||null,G=k)}}else D=(null===(x=a.current[e])||void 0===x?void 0:x.current)||(null===(C=S.current[e])||void 0===C?void 0:C.current)||null,G=D?e:null;Q.current=G;var z=o.current,J=c.current,K=function(){Y(_,e,G),P(!0),B.current&&B.current(),j.current=!1,"right"===V&&J?J.dispatchEvent(new Event("scroll")):z&&z.dispatchEvent(new Event("scroll")),F(!1),null==N||N()};if(!b||!z)return j.current=!1,F(!1),void(null==N||N());if(D&&J){if(!i){var U=0;U="right"===V?D?D.getBoundingClientRect().top:0:b?b.getBoundingClientRect().top:0;var W=s.current,X=(null==W?void 0:W.getBoundingClientRect().top)||0,Z=W?W.scrollTop+U-X-150:0;return W?void n.smoothScrollTo(W,Z,200,K):void K()}var $=b.getBoundingClientRect().top-z.getBoundingClientRect().top+z.scrollTop,ee=D.getBoundingClientRect().top-J.getBoundingClientRect().top+J.scrollTop,ne=200;if("left"===V){var te=ee-($-z.scrollTop);te<0&&h.current&&!r&&(h.current.style.height="".concat(Math.abs(te),"px")),requestAnimationFrame(function(){var e,t=J.scrollHeight-J.clientHeight;if(te<0)e=0;else{if(te>t){var i=te-t;return A.current&&!r&&(A.current.style.height="".concat(i+150,"px")),void requestAnimationFrame(function(){n.smoothScrollTo(J,te,ne,K)})}e=te}n.smoothScrollTo(J,e,ne,K)})}else{var re=$-(ee-J.scrollTop);requestAnimationFrame(function(){var e,t=z.scrollHeight-z.clientHeight;if(re<0)e=0;else{if(re>t)return void requestAnimationFrame(function(){return n.smoothScrollTo(z,t,ne,K)});e=re}n.smoothScrollTo(z,e,ne,K)})}}else K()};r?setTimeout(t,100):t()}))}else I("No counterpart exists for this section.")},[M,C,u,_,i,l,Z,$,r]);return{isSideBySide:_,setIsSideBySide:b,isArrowVisible:N,setIsArrowVisible:P,isResizing:G,setIsResizing:w,isSideBySideLoading:q,setIsSideBySideLoading:F,activeSideBySideSection:M,setActiveSideBySideSection:k,scrollLock:j,sideBySideCacheRef:z,isSideBySideRef:J,activeSideBySideSectionRef:K,activeSideBySideRightSectionRef:Q,sideBySideLineRef:U,highlightedClauseRefs:W,clearClauseHighlight:X,applyAlignmentPadding:Y,resetSideBySide:$,activateSideBySide:ee}};
2
2
  //# sourceMappingURL=useSideBySide.js.map