@e-llm-studio/citation 0.0.243 → 0.0.245

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 (140) hide show
  1. package/dist/assests/icons/InfoAlert.js +2 -0
  2. package/dist/assests/icons/InfoAlert.js.map +1 -0
  3. package/dist/cjs/assests/icons/InfoAlert.js +2 -0
  4. package/dist/cjs/assests/icons/InfoAlert.js.map +1 -0
  5. package/dist/cjs/features/PdfViewer/PdfContainer.js +1 -1
  6. package/dist/cjs/features/PdfViewer/PdfStyle.js +1 -1
  7. package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
  8. package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
  9. package/dist/cjs/features/PdfViewer/rotationManager.js +2 -0
  10. package/dist/cjs/features/PdfViewer/rotationManager.js.map +1 -0
  11. package/dist/cjs/features/ReviewPanel/ReviewPanel.js +2 -0
  12. package/dist/cjs/features/ReviewPanel/ReviewPanel.js.map +1 -0
  13. package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js +2 -0
  14. package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js.map +1 -0
  15. package/dist/cjs/features/SegmentReviewComponents/CardWrapper.js +2 -0
  16. package/dist/cjs/features/SegmentReviewComponents/CardWrapper.js.map +1 -0
  17. package/dist/cjs/features/SegmentReviewComponents/ChartBreakoutCircle.js +2 -0
  18. package/dist/cjs/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +1 -0
  19. package/dist/cjs/features/SegmentReviewComponents/CognitiveIcon.js +2 -0
  20. package/dist/cjs/features/SegmentReviewComponents/CognitiveIcon.js.map +1 -0
  21. package/dist/cjs/features/SegmentReviewComponents/CognitiveIntegrity.js +2 -0
  22. package/dist/cjs/features/SegmentReviewComponents/CognitiveIntegrity.js.map +1 -0
  23. package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js +2 -0
  24. package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js.map +1 -0
  25. package/dist/cjs/features/SegmentReviewComponents/LabelCheck.js +2 -0
  26. package/dist/cjs/features/SegmentReviewComponents/LabelCheck.js.map +1 -0
  27. package/dist/cjs/features/SegmentReviewComponents/PageCheck.js +2 -0
  28. package/dist/cjs/features/SegmentReviewComponents/PageCheck.js.map +1 -0
  29. package/dist/cjs/features/SegmentReviewComponents/RevertCard.js +2 -0
  30. package/dist/cjs/features/SegmentReviewComponents/RevertCard.js.map +1 -0
  31. package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +2 -0
  32. package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js.map +1 -0
  33. package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js +2 -0
  34. package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js.map +1 -0
  35. package/dist/cjs/features/SegmentReviewComponents/ReviewedBoundaryActions.js +2 -0
  36. package/dist/cjs/features/SegmentReviewComponents/ReviewedBoundaryActions.js.map +1 -0
  37. package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js +2 -0
  38. package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js.map +1 -0
  39. package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +2 -0
  40. package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js.map +1 -0
  41. package/dist/cjs/features/SegmentReviewComponents/helper.js +2 -0
  42. package/dist/cjs/features/SegmentReviewComponents/helper.js.map +1 -0
  43. package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js +2 -0
  44. package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js.map +1 -0
  45. package/dist/cjs/index.js +1 -1
  46. package/dist/features/PdfViewer/PdfContainer.js +1 -1
  47. package/dist/features/PdfViewer/PdfStyle.js +1 -1
  48. package/dist/features/PdfViewer/PdfToolbar.js +1 -1
  49. package/dist/features/PdfViewer/PdfViewer.js +1 -1
  50. package/dist/features/PdfViewer/rotationManager.js +2 -0
  51. package/dist/features/PdfViewer/rotationManager.js.map +1 -0
  52. package/dist/features/ReviewPanel/ReviewPanel.js +2 -0
  53. package/dist/features/ReviewPanel/ReviewPanel.js.map +1 -0
  54. package/dist/features/SegmentReviewComponents/BoundaryCard.js +2 -0
  55. package/dist/features/SegmentReviewComponents/BoundaryCard.js.map +1 -0
  56. package/dist/features/SegmentReviewComponents/CardWrapper.js +2 -0
  57. package/dist/features/SegmentReviewComponents/CardWrapper.js.map +1 -0
  58. package/dist/features/SegmentReviewComponents/ChartBreakoutCircle.js +2 -0
  59. package/dist/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +1 -0
  60. package/dist/features/SegmentReviewComponents/CognitiveIcon.js +2 -0
  61. package/dist/features/SegmentReviewComponents/CognitiveIcon.js.map +1 -0
  62. package/dist/features/SegmentReviewComponents/CognitiveIntegrity.js +2 -0
  63. package/dist/features/SegmentReviewComponents/CognitiveIntegrity.js.map +1 -0
  64. package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js +2 -0
  65. package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js.map +1 -0
  66. package/dist/features/SegmentReviewComponents/LabelCheck.js +2 -0
  67. package/dist/features/SegmentReviewComponents/LabelCheck.js.map +1 -0
  68. package/dist/features/SegmentReviewComponents/PageCheck.js +2 -0
  69. package/dist/features/SegmentReviewComponents/PageCheck.js.map +1 -0
  70. package/dist/features/SegmentReviewComponents/RevertCard.js +2 -0
  71. package/dist/features/SegmentReviewComponents/RevertCard.js.map +1 -0
  72. package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +2 -0
  73. package/dist/features/SegmentReviewComponents/RevertSuccessCard.js.map +1 -0
  74. package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js +2 -0
  75. package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js.map +1 -0
  76. package/dist/features/SegmentReviewComponents/ReviewedBoundaryActions.js +2 -0
  77. package/dist/features/SegmentReviewComponents/ReviewedBoundaryActions.js.map +1 -0
  78. package/dist/features/SegmentReviewComponents/ReviewedCard.js +2 -0
  79. package/dist/features/SegmentReviewComponents/ReviewedCard.js.map +1 -0
  80. package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +2 -0
  81. package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js.map +1 -0
  82. package/dist/features/SegmentReviewComponents/helper.js +2 -0
  83. package/dist/features/SegmentReviewComponents/helper.js.map +1 -0
  84. package/dist/features/SegmentReviewComponents/reviewStepAdapters.js +2 -0
  85. package/dist/features/SegmentReviewComponents/reviewStepAdapters.js.map +1 -0
  86. package/dist/index.js +1 -1
  87. package/dist/types/src/assests/icons/ChartSplitIcon.d.ts +3 -0
  88. package/dist/types/src/assests/icons/ChartSplitIcon.d.ts.map +1 -0
  89. package/dist/types/src/assests/icons/InfoAlert.d.ts +3 -0
  90. package/dist/types/src/assests/icons/InfoAlert.d.ts.map +1 -0
  91. package/dist/types/src/features/PdfViewer/PdfContainer.d.ts +4 -2
  92. package/dist/types/src/features/PdfViewer/PdfContainer.d.ts.map +1 -1
  93. package/dist/types/src/features/PdfViewer/PdfStyle.d.ts.map +1 -1
  94. package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts +4 -1
  95. package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
  96. package/dist/types/src/features/PdfViewer/PdfViewer.d.ts +19 -2
  97. package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
  98. package/dist/types/src/features/PdfViewer/coordinateTransformer.d.ts +41 -0
  99. package/dist/types/src/features/PdfViewer/coordinateTransformer.d.ts.map +1 -0
  100. package/dist/types/src/features/PdfViewer/rotationManager.d.ts +23 -0
  101. package/dist/types/src/features/PdfViewer/rotationManager.d.ts.map +1 -0
  102. package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts +85 -0
  103. package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -0
  104. package/dist/types/src/features/SegmentReviewComponents/CardWrapper.d.ts +26 -0
  105. package/dist/types/src/features/SegmentReviewComponents/CardWrapper.d.ts.map +1 -0
  106. package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts +3 -0
  107. package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts.map +1 -0
  108. package/dist/types/src/features/SegmentReviewComponents/CognitiveIcon.d.ts +3 -0
  109. package/dist/types/src/features/SegmentReviewComponents/CognitiveIcon.d.ts.map +1 -0
  110. package/dist/types/src/features/SegmentReviewComponents/CognitiveIntegrity.d.ts +33 -0
  111. package/dist/types/src/features/SegmentReviewComponents/CognitiveIntegrity.d.ts.map +1 -0
  112. package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts +7 -0
  113. package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts.map +1 -0
  114. package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts +87 -0
  115. package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts.map +1 -0
  116. package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts +51 -0
  117. package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts.map +1 -0
  118. package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts +37 -0
  119. package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts.map +1 -0
  120. package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts +9 -0
  121. package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +1 -0
  122. package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts +7 -0
  123. package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts.map +1 -0
  124. package/dist/types/src/features/SegmentReviewComponents/ReviewedBoundaryActions.d.ts +17 -0
  125. package/dist/types/src/features/SegmentReviewComponents/ReviewedBoundaryActions.d.ts.map +1 -0
  126. package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts +33 -0
  127. package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts.map +1 -0
  128. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts +124 -0
  129. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -0
  130. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts +13 -0
  131. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts.map +1 -0
  132. package/dist/types/src/features/SegmentReviewComponents/helper.d.ts +53 -0
  133. package/dist/types/src/features/SegmentReviewComponents/helper.d.ts.map +1 -0
  134. package/dist/types/src/features/SegmentReviewComponents/index.d.ts +23 -0
  135. package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -0
  136. package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +242 -0
  137. package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -0
  138. package/dist/types/src/index.d.ts +4 -0
  139. package/dist/types/src/index.d.ts.map +1 -1
  140. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import{__assign as r}from"tslib";import{jsx as o}from"react/jsx-runtime";import i from"@mui/material/SvgIcon";function t(t){var e,n;return o(i,r({},t,{viewBox:"0 0 13 13",sx:r({width:null!==(e=t.width)&&void 0!==e?e:14,height:null!==(n=t.height)&&void 0!==n?n:14},t.sx)},{children:o("path",{d:"M6.33333 3.99996V6.33329M6.33333 8.66663H6.33917M12.1667 6.33329C12.1667 3.11163 9.555 0.499959 6.33333 0.499959C3.11167 0.499959 0.5 3.11163 0.5 6.33329C0.5 9.55495 3.11167 12.1666 6.33333 12.1666C9.555 12.1666 12.1667 9.55495 12.1667 6.33329Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}))}export{t as default};
2
+ //# sourceMappingURL=InfoAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoAlert.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(require("@mui/material/SvgIcon"));exports.default=function(t){var n,o;return r.jsx(i.default,e.__assign({},t,{viewBox:"0 0 13 13",sx:e.__assign({width:null!==(n=t.width)&&void 0!==n?n:14,height:null!==(o=t.height)&&void 0!==o?o:14},t.sx)},{children:r.jsx("path",{d:"M6.33333 3.99996V6.33329M6.33333 8.66663H6.33917M12.1667 6.33329C12.1667 3.11163 9.555 0.499959 6.33333 0.499959C3.11167 0.499959 0.5 3.11163 0.5 6.33329C0.5 9.55495 3.11167 12.1666 6.33333 12.1666C9.555 12.1666 12.1667 9.55495 12.1667 6.33329Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}))};
2
+ //# sourceMappingURL=InfoAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoAlert.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),s=require("@react-pdf-viewer/core"),i=require("./PdfStyle.js"),n="https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js";exports.default=function(t){var l=t.pdfUrl,o=t.plugins,a=t.onLoad,d=t.customStyles,u=t.onPageChange,p=t.defaultScale;return r.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.pdfStyles.pdfConatiner),null==d?void 0:d.pdfContainer)},{children:r.jsx(s.Worker,e.__assign({workerUrl:n},{children:r.jsx(s.Viewer,{fileUrl:l,defaultScale:p,plugins:o,onDocumentLoad:a,onPageChange:u})}))}))},exports.pdfWorker=n;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),n=require("@react-pdf-viewer/core"),s=require("./PdfStyle.js"),t="https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js";exports.default=function(i){var a=i.pdfUrl,d=i.plugins,l=i.onLoad,o=i.customStyles,u=i.onPageChange,p=i.defaultScale,f=i.renderPage,g=i.setRenderRange;return r.jsx("div",e.__assign({style:e.__assign(e.__assign({},s.pdfStyles.pdfConatiner),null==o?void 0:o.pdfContainer)},{children:r.jsx(n.Worker,e.__assign({workerUrl:t},{children:r.jsx(n.Viewer,{fileUrl:a,defaultScale:p,plugins:d,onDocumentLoad:l,onPageChange:u,renderPage:f,setRenderRange:g})}))}))},exports.pdfWorker=t;
2
2
  //# sourceMappingURL=PdfContainer.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.pdfStyles={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",width:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",width:"100%",minWidth:0,boxSizing:"border-box"},title:{fontSize:"14px",fontWeight:600,color:"#60A3F8",fontFamily:'Roboto, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'},toolbar:{display:"flex",alignItems:"center",gap:"8px",position:"relative"},button:{border:"1px solid #DFE5EC",borderRadius:"6px",padding:"4px 8px",fontSize:"12px",cursor:"pointer",backgroundColor:"#FFFFFF"},buttonDisabled:{opacity:.4,cursor:"not-allowed"},counter:{fontSize:"13px",color:"#64748B",margin:"0 6px"},viewerWrapper:{height:"30rem",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid #DEE4EB",borderRadius:"8px"},emptyState:{fontSize:"14px",color:"#EF4444"},pdfConatiner:{height:"100%",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center"}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.pdfStyles={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",width:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},header:{display:"flex",flexShrink:0,justifyContent:"space-between",alignItems:"center",position:"relative",width:"100%",minWidth:0,boxSizing:"border-box"},title:{fontSize:"14px",fontWeight:600,color:"#60A3F8",fontFamily:'Roboto, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'},toolbar:{display:"flex",alignItems:"center",gap:"8px",position:"relative"},button:{border:"1px solid #DFE5EC",borderRadius:"6px",padding:"4px 8px",fontSize:"12px",cursor:"pointer",backgroundColor:"#FFFFFF"},buttonDisabled:{opacity:.4,cursor:"not-allowed"},counter:{fontSize:"13px",color:"#64748B",margin:"0 6px"},viewerWrapper:{height:"30rem",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid #DEE4EB",borderRadius:"8px"},emptyState:{fontSize:"14px",color:"#EF4444"},pdfConatiner:{flex:"1 1 0",height:0,minHeight:0,minWidth:0,width:"100%",boxSizing:"border-box",overflow:"hidden",display:"block"}};
2
2
  //# sourceMappingURL=PdfStyle.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PdfStyle.js"),s=require("../../assests/svg/PdfViewerIcons.js"),o=require("@mui/material"),r=require("lucide-react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(i);exports.default=function(i){i.highlightIndex;var l=i.totalHighlights,d=i.controls,c=i.currentPosition,p=i.pdfName,g=i.onClose,x=i.pdfUrl,u=i.viewerRef,h=i.customStyles,f=i.customClasses,_=i.customIcons,v=i.headerAction,y=i.isZoomEnabled,m=void 0===y||y,j=i.showHighlightsAction,b=void 0===j||j,w=i.showFullScreenAction,S=void 0===w||w,k=i.currentSegment,I=i.segmentTooltipText,F=void 0===I?"Details of current segment":I,C=i.currentPage,D=i.totalPages,W=i.onPageNavigate,E=d.ZoomInButton,B=d.ZoomOutButton,P=d.ZoomPopover,T=d.goToPrevious,z=d.goToNext,A=a.default.useState(String(C)),L=A[0],q=A[1];a.default.useEffect(function(){q(String(C))},[C]);var N={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},R=function(e){return String(e).padStart(2,"0")};return n.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},t.pdfStyles.header),null==h?void 0:h.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:0}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0,overflow:"hidden"}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==h?void 0:h.pdfIconWrapper),{flexShrink:0})},{children:(null==_?void 0:_.pdfIcon)||n.jsx(s.DefaultPdfIcon,{})})),n.jsx(o.Tooltip,e.__assign({title:p||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n.jsx("span",e.__assign({style:e.__assign({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==h?void 0:h.pdfName),className:null==f?void 0:f.pdfName},{children:p}))}))}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:b?"16px":"2px",color:"#4B5563",flexShrink:0,whiteSpace:"nowrap",minWidth:"fit-content"}},{children:[D>0&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n.jsx("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:L,onChange:function(e){var n=e.target.value.replace(/\D/g,"");q(n)},onBlur:function(){var e=Number(L);if(!Number.isInteger(e)||e<1)q(String(C));else{var n=D?Math.min(e,D):e;W(n),q(String(n))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(q(String(C)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(D)}))]})),m&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(B,{}),n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n.jsx(P,{})})),n.jsx(E,{})]})),!!l&&b&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("span",e.__assign({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[c," of ",l]})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c<=1?"not-allowed":"pointer",padding:"2px 4px",color:c<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:T,disabled:c<=1},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c===l?"not-allowed":"pointer",padding:"2px 4px",color:c===l?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:z,disabled:c===l},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n.jsx("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==S&&((null==v?void 0:v.icon)&&(null==v?void 0:v.onClick)?n.jsx(o.Tooltip,e.__assign({title:(null==v?void 0:v.tooltip)||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({onClick:v.onClick,style:e.__assign({display:"flex",alignItems:"center",cursor:"pointer"},N)},{children:v.icon}))})):n.jsx("button",e.__assign({onClick:function(){var e=null==u?void 0:u.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:N,title:"Full Screen"},{children:(null==_?void 0:_.fullScreenIcon)||n.jsx(s.DefaultFullScreenIcon,{})}))),x&&n.jsx("a",e.__assign({href:x,target:"_blank",rel:"noopener noreferrer",style:N,title:"Open in new tab"},{children:(null==_?void 0:_.downloadIcon)||n.jsx(s.DefaultDownloadIcon,{})})),g&&n.jsx("button",e.__assign({onClick:g,style:N,title:"Close"},{children:(null==_?void 0:_.closeIcon)||n.jsx(s.DefaultCloseIcon,{})}))]}))]}))]})),k&&n.jsxs("div",e.__assign({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n.jsx(o.Tooltip,e.__assign({title:F,arrow:!0,placement:"top"},{children:n.jsx(r.Info,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n.jsxs("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:["Viewing ",k.title," • Pages ",R(k.start_page),"-",R(k.end_page)]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("./PdfStyle.js"),o=require("../../assests/svg/PdfViewerIcons.js"),r=require("@mui/material/Tooltip"),s=require("lucide-react"),l=require("@mui/icons-material/RotateRight");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(t),c=a(r),p=a(l);exports.default=function(t){t.highlightIndex;var r=t.totalHighlights,l=t.controls,a=t.currentPosition,g=t.pdfName,u=t.onClose,x=t.pdfUrl,h=t.viewerRef,f=t.customStyles,_=t.customClasses,v=t.customIcons,m=t.headerAction,y=t.isZoomEnabled,j=void 0===y||y,b=t.showHighlightsAction,w=void 0===b||b,S=t.showFullScreenAction,k=void 0===S||S,I=t.currentSegment,F=t.segmentTooltipText,C=void 0===F?"Details of current segment":F,D=t.currentPage,W=t.totalPages,E=t.onPageNavigate,R=t.onRotatePage,P=t.currentPageRotation,T=void 0===P?0:P,B=t.showRotateButton,L=void 0===B||B,z=l.ZoomInButton,q=l.ZoomOutButton,A=l.ZoomPopover,N=l.goToPrevious,M=l.goToNext,H=d.default.useState(String(D)),O=H[0],Z=H[1];d.default.useEffect(function(){Z(String(D))},[D]);var G={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},V=function(e){return String(e).padStart(2,"0")};return n.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},i.pdfStyles.header),null==f?void 0:f.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",columnGap:"16px",rowGap:"12px",minWidth:0}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flex:"1 1 180px",minWidth:0}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==f?void 0:f.pdfIconWrapper),{flexShrink:0})},{children:(null==v?void 0:v.pdfIcon)||n.jsx(o.DefaultPdfIcon,{})})),n.jsx(c.default,e.__assign({title:g||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n.jsx("span",e.__assign({style:e.__assign({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==f?void 0:f.pdfName),className:null==_?void 0:_.pdfName},{children:g}))}))}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:w?"16px":"2px",color:"#4B5563",flex:"0 1 auto",marginLeft:"auto",whiteSpace:"nowrap",minWidth:0,maxWidth:"100%",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"}},{children:[W>0&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n.jsx("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:O,onChange:function(e){var n=e.target.value.replace(/\D/g,"");Z(n)},onBlur:function(){var e=Number(O);if(!Number.isInteger(e)||e<1)Z(String(D));else{var n=W?Math.min(e,W):e;E(n),Z(String(n))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(Z(String(D)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(W)}))]})),j&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(q,{}),n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n.jsx(A,{})})),n.jsx(z,{})]})),L&&R&&W>0&&n.jsx(c.default,e.__assign({title:"Rotate page (".concat(T,"°)")},{children:n.jsx("button",e.__assign({onClick:function(){R&&"function"==typeof R&&R()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",color:0!==T?"#1976d2":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px",transition:"color 0.2s ease"},onMouseEnter:function(e){e.currentTarget&&(e.currentTarget.style.color="#1976d2")},onMouseLeave:function(e){e.currentTarget&&(e.currentTarget.style.color=0!==T?"#1976d2":"#475467")},"aria-label":"Rotate current page"},{children:n.jsx(p.default,{sx:{fontSize:"18px"}})}))})),!!r&&w&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("span",e.__assign({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[a," of ",r]})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:a<=1?"not-allowed":"pointer",padding:"2px 4px",color:a<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:N,disabled:a<=1},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:a===r?"not-allowed":"pointer",padding:"2px 4px",color:a===r?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:M,disabled:a===r},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n.jsx("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==k&&((null==m?void 0:m.icon)&&(null==m?void 0:m.onClick)?n.jsx(c.default,e.__assign({title:(null==m?void 0:m.tooltip)||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({onClick:m.onClick,style:e.__assign({display:"flex",alignItems:"center",cursor:"pointer"},G)},{children:m.icon}))})):n.jsx("button",e.__assign({onClick:function(){var e=null==h?void 0:h.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:G,title:"Full Screen"},{children:(null==v?void 0:v.fullScreenIcon)||n.jsx(o.DefaultFullScreenIcon,{})}))),x&&n.jsx("a",e.__assign({href:x,target:"_blank",rel:"noopener noreferrer",style:G,title:"Open in new tab"},{children:(null==v?void 0:v.downloadIcon)||n.jsx(o.DefaultDownloadIcon,{})})),u&&n.jsx("button",e.__assign({onClick:u,style:G,title:"Close"},{children:(null==v?void 0:v.closeIcon)||n.jsx(o.DefaultCloseIcon,{})}))]}))]}))]})),I&&n.jsxs("div",e.__assign({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n.jsx(c.default,e.__assign({title:C,arrow:!0,placement:"top"},{children:n.jsx(s.Info,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n.jsx("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:n.jsx(c.default,e.__assign({title:I.title,arrow:!0,placement:"top"},{children:n.jsxs("span",{children:["Viewing ",I.title," • Pages ",V(I.start_page),"-",V(I.end_page)]})}))}))]}))]}))};
2
2
  //# sourceMappingURL=PdfToolbar.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("@react-pdf-viewer/core"),o=require("./PdfContainer.js"),n=require("./PdfToolbar.js"),r=require("./PdfStyle.js"),a=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var s=require("react"),l=require("../ScannedDocCitation/ScannedDocCitation.js"),u=function(e){switch(e){case"ActualSize":return i.SpecialZoomLevel.ActualSize;case"PageFit":return i.SpecialZoomLevel.PageFit;case"PageWidth":return i.SpecialZoomLevel.PageWidth;default:return null!=e?e:i.SpecialZoomLevel.PageWidth}};exports.default=function(c){var d,g=c.pdfUrl,f=c.highlightText,h=c.highlightPages,v=c.highlightCordinatePages,p=c.highlightColor,m=void 0===p?"yellow":p,x=c.activeHighlightColor,S=void 0===x?"#f7dc51":x,_=c.jumpToPageValue,P=void 0===_?0:_,T=c.pdfName,C=c.onClose,w=c.customStyles,y=c.customClasses,b=c.customIcons,A=c.useCoordinates,q=c.fallbackPages,j=c.activeCitationIndex,H=c.onActiveCitationChange,I=c.headerAction,F=c.isZoomEnabled,Z=void 0===F||F,L=c.showHighlightsAction,N=void 0===L||L,z=c.defaultScale,R=void 0===z?i.SpecialZoomLevel.ActualSize:z,D=c.useRange,E=void 0!==D&&D,M=c.rangeOfPages,V=void 0===M?null:M,W=c.showFullScreenAction,O=void 0===W||W,B=c.segments,U=void 0===B?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:B,k=c.segmentTooltipText,J=s.useRef(null),K=s.useState(0),G=K[0],Q=K[1],X=s.useState(0),Y=X[0],$=X[1],ee=s.useMemo(function(){if(A)return new Set(v.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(h).forEach(function(t){t>0&&e.add(t-1)}),e},[v,h,A]),te=(d=f)&&0!==d.length?d.filter(function(e){return!d.some(function(t){return t!==e&&t.includes(e)})}):d,ie=a.PdfHighlightControls(te,A?{}:h,J,ee,A,A?v:[],m,S),oe=ie.highlightIndex,ne=ie.cursorIndex,re=ie.setCursorIndex,ae=ie.orderedKeys,se=ie.totalHighlights,le=ie.getValidPosition,ue=ie.tryJump,ce=ie.jumpToPage,de=ie.zoomTo,ge=ie.plugins,fe=ie.controls,he=ie.hideNonTargetHighlights,ve=ie.deduplicateHighlights,pe=le(ne),me=s.useMemo(function(){var e=G+1;return U.find(function(t){return e>=t.start_page&&e<=t.end_page})},[G,U]);s.useEffect(function(){void 0!==j&&j!==ne&&re(j)},[j]);var xe=e.__assign(e.__assign({},fe),{goToNext:function(){ne>=se-1||(fe.goToNext(),H&&H(ne+1))},goToPrevious:function(){ne<=0||(fe.goToPrevious(),H&&H(ne-1))}});if(!g)return t.jsx(l.default,{pages:q,activeCitationIndex:j,onActiveCitationChange:H,headerAction:I});return t.jsxs("div",e.__assign({ref:J,className:(null==y?void 0:y.pdfViewerWrapper)||"",style:e.__assign(e.__assign(e.__assign({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},r.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==w?void 0:w.pdfViewer)},{children:[t.jsx(n.default,{highlightIndex:oe,totalHighlights:se,controls:xe,currentPosition:pe,pdfName:T,onClose:C,pdfUrl:g,viewerRef:J,customStyles:w,customClasses:y,customIcons:b,headerAction:I,isZoomEnabled:Z,showHighlightsAction:N,showFullScreenAction:O,currentSegment:me,segmentTooltipText:k,currentPage:G+1,totalPages:Y,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),Y||e);Q(t-1),ce(t-1)}}),t.jsx(o.default,{defaultScale:u(R),pdfUrl:g,plugins:ge,customStyles:w,onLoad:function(t){$(t.doc.numPages);var o=!A&&!E&&P<=0;if(de(i.SpecialZoomLevel.ActualSize),P>0&&!E){var n=P-1,r=ae[n],a=h[r],s=v[n];re(n),console.log(s,"cordinateTargetHighlight"),A&&s.pageIndex>0&&ce(s.pageIndex),a>0&&(setTimeout(function(){he(ee),ve(a-1)},1e3),A||ce(a-1))}else if(E&&V&&2===V.length){e.__awaiter(void 0,void 0,void 0,function(){var t,i,o,n,r;return e.__generator(this,function(e){switch(e.label){case 0:t=V[0],i=V[1],o=t,e.label=1;case 1:return o<=i?(ce(n=o-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(e.sent(),he(ee),(r=ve(n))&&r>0)return[3,4];e.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}else if(!A&&h){var l=ae.find(function(e){return h[e]>0});if(void 0!==l){var u=h[l]-1;ce(u),setTimeout(function(){he(ee),ve(u)},1e3)}}requestAnimationFrame(function(){o&&ue(),!A&&P>0&&!E&&function(){if(J.current){var e=P-1,t=ae[e],i=h[t],o=i>0?i-1:0,n={};ae.forEach(function(e,t){var i=h[e];i>0&&(n[i]||(n[i]=[]),n[i].push(t))});var r=(n[i]||[]).indexOf(e),a=0,s=function(){var e,t;if(!(++a>40)){var i=null===(e=J.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(i){var n=null===(t=J.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(o,'"]'));if(n){var l=i.getBoundingClientRect(),u=n.getBoundingClientRect();if(u.top<l.bottom&&u.bottom>l.top){var c=n.querySelectorAll(".rpv-search__highlight")[r];if(c){var d=c.getBoundingClientRect(),g=i.scrollTop+(d.top-l.top)-i.clientHeight/2+d.height/2;i.scrollTo({top:g,behavior:"smooth"})}else setTimeout(s,100)}else setTimeout(s,100)}else setTimeout(s,100)}else setTimeout(s,100)}};setTimeout(s,500)}}()})},onPageChange:function(e){var t=e.currentPage;Q(t),ee.has(t)?(ve(t),he(ee)):he(ee)}})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@react-pdf-viewer/core"),r=require("./PdfContainer.js"),i=require("./PdfToolbar.js"),o=require("./PdfStyle.js"),a=require("./usePdfHighlight.js"),u=require("./rotationManager.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var l=require("react"),s=require("../ScannedDocCitation/ScannedDocCitation.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(l);exports.default=function(c){var g=c.pdfUrl,f=c.highlightText,v=c.highlightPages,h=c.highlightCordinatePages,p=c.highlightColor,m=void 0===p?"yellow":p,_=c.activeHighlightColor,y=void 0===_?"#f7dc51":_,w=c.jumpToPageValue,x=void 0===w?0:w,P=c.pdfName,S=c.onClose,b=c.customStyles,T=c.customClasses,C=c.customIcons,q=c.useCoordinates,R=c.fallbackPages,A=c.activeCitationIndex,L=c.onActiveCitationChange,M=c.headerAction,j=c.isZoomEnabled,I=void 0===j||j,E=c.showHighlightsAction,H=void 0===E||E,N=c.defaultScale,F=void 0===N?n.SpecialZoomLevel.ActualSize:N,B=c.useRange,Z=void 0!==B&&B,D=c.rangeOfPages,O=void 0===D?null:D,V=c.showFullScreenAction,W=void 0===V||V,z=c.showRotateButton,U=void 0!==z&&z,k=c.segments,J=void 0===k?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:k,K=c.segmentTooltipText,G=c.onCurrentPageChange,Q=c.navigationRequest,X=c.onNavigationSettled,Y=c.disablePdfAnnotations,$=void 0!==Y&&Y,ee=c.disablePdfTextLayer,te=void 0!==ee&&ee,ne=c.renderPage,re=c.setRenderRange,ie=l.useRef(null),oe=function(e){switch(e){case"ActualSize":return n.SpecialZoomLevel.ActualSize;case"PageFit":return n.SpecialZoomLevel.PageFit;case"PageWidth":return n.SpecialZoomLevel.PageWidth;default:return null!=e?e:n.SpecialZoomLevel.PageWidth}}(F),ae=l.useState(0),ue=ae[0],le=ae[1],se=l.useState(0),ce=se[0],de=se[1],ge=l.useState(0),fe=ge[0],ve=ge[1],he=l.useRef(null),pe=l.useRef(null),me=l.useRef(0),_e=l.useRef(null),ye=l.useMemo(function(){if(!g)return"";try{return new URL(g,window.location.origin).pathname.split("/").pop()||"default"}catch(e){return"default"}},[g]);l.useEffect(function(){ye&&u.rotationManager.setPdfIdentifier(ye)},[ye]);l.useEffect(function(){return u.rotationManager.onRotationChange(function(e,t){e===ue+1&&ve(t)})},[ue]),l.useEffect(function(){var e=new MutationObserver(function(){var e,t=null===(e=ie.current)||void 0===e?void 0:e.querySelectorAll('[data-testid^="core__page-layer-"]'),n=new Set;null==t||t.forEach(function(e){var t,r=null===(t=e.getAttribute("data-testid"))||void 0===t?void 0:t.match(/core__page-layer-(\d+)/);if(r&&r.length>=2){var i=parseInt(r[1],10)+1;n.has(i)||(u.rotationManager.registerPageElement(i,e),n.add(i))}})});return ie.current&&(e.observe(ie.current,{childList:!0,subtree:!0,attributes:!1}),_e.current=e),function(){e.disconnect(),_e.current=null}},[]),l.useEffect(function(){return function(){u.rotationManager.clearAll(),_e.current&&_e.current.disconnect()}},[]),l.useEffect(function(){var e=ue+1;ve(u.rotationManager.getRotation(e))},[ue]);var we,xe=l.useMemo(function(){return $||te?function(n){var r=te?t.jsx("div",e.__assign({"aria-hidden":"true",style:{display:"none"}},{children:n.textLayer.children})):n.textLayer.children,i=e.__assign(e.__assign({},n),{annotationLayer:e.__assign(e.__assign({},n.annotationLayer),{children:$?null:n.annotationLayer.children}),textLayer:e.__assign(e.__assign({},n.textLayer),{children:r})});return ne?ne(i):t.jsxs(t.Fragment,{children:[n.canvasLayer.children,r,!$&&n.annotationLayer.children]})}:ne},[$,te,ne]),Pe=l.useMemo(function(){if(q)return new Set(h.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(v).forEach(function(t){t>0&&e.add(t-1)}),e},[h,v,q]),Se=(we=f)&&0!==we.length?we.filter(function(e){return!we.some(function(t){return t!==e&&t.includes(e)})}):we,be=a.PdfHighlightControls(Se,q?{}:v,ie,Pe,q,q?h:[],m,y),Te=be.highlightIndex,Ce=be.cursorIndex,qe=be.setCursorIndex,Re=be.orderedKeys,Ae=be.totalHighlights,Le=be.getValidPosition,Me=be.tryJump,je=be.jumpToPage,Ie=be.plugins,Ee=be.controls,He=be.hideNonTargetHighlights,Ne=be.deduplicateHighlights,Fe=Le(Ce),Be=l.useMemo(function(){var e=ue+1;return J.find(function(t){return e>=t.start_page&&e<=t.end_page})},[ue,J]);l.useEffect(function(){void 0!==A&&A!==Ce&&qe(A)},[A]);var Ze=e.__assign(e.__assign({},Ee),{goToNext:function(){Ce>=Ae-1||(Ee.goToNext(),L&&L(Ce+1))},goToPrevious:function(){Ce<=0||(Ee.goToPrevious(),L&&L(Ce-1))}}),De=d.default.useCallback(function(e,t){me.current+=1;var n=me.current;null!=pe.current&&window.clearTimeout(pe.current);var r=null,i=0,o=0,a=function(){var u,l;if(me.current===n){o+=1;var s=null===(u=ie.current)||void 0===u?void 0:u.querySelector(".rpv-core__inner-pages"),c=null===(l=ie.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(t-1,'"]'));if(!s||!c)return o>=40?(pe.current=null,void(null==X||X({pageNumber:t,requestId:e.requestId}))):void(pe.current=window.setTimeout(a,50));r===s.scrollTop?i+=1:(r=s.scrollTop,i=0);var d=s.getBoundingClientRect(),g=c.getBoundingClientRect(),f=Boolean(d&&g&&g.bottom>d.top&&g.top<d.bottom);if(i>=2&&f||o>=40)return pe.current=null,void(null==X||X({pageNumber:t,requestId:e.requestId}));pe.current=window.setTimeout(a,50)}};pe.current=window.setTimeout(a,50)},[X]);if(l.useEffect(function(){return function(){me.current+=1,null!=pe.current&&window.clearTimeout(pe.current)}},[]),l.useEffect(function(){var e;if(Q&&!(ce<=0)){var t=Math.min(Math.max(Math.trunc(Q.pageNumber),1),ce),n="".concat(null!==(e=Q.requestId)&&void 0!==e?e:t,":").concat(t);he.current!==n&&(he.current=n,le(t-1),je(t-1),De(Q,t))}},[je,Q,ce,De]),!g)return t.jsx(s.default,{pages:R,activeCitationIndex:A,onActiveCitationChange:L,headerAction:M});return t.jsxs("div",e.__assign({ref:ie,className:(null==T?void 0:T.pdfViewerWrapper)||"","data-disable-pdf-annotations":$?"true":void 0,"data-pdf-page-fit":oe===n.SpecialZoomLevel.PageFit?"true":void 0,style:e.__assign(e.__assign(e.__assign({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},o.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==b?void 0:b.pdfViewer)},{children:[t.jsx(i.default,{highlightIndex:Te,totalHighlights:Ae,controls:Ze,currentPosition:Fe,pdfName:P,onClose:S,pdfUrl:g,viewerRef:ie,customStyles:b,customClasses:T,customIcons:C,headerAction:M,isZoomEnabled:I,showHighlightsAction:H,showFullScreenAction:W,currentSegment:Be,segmentTooltipText:K,currentPage:ue+1,totalPages:ce,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),ce||e);le(t-1),je(t-1)},onRotatePage:function(){var e=ue+1;u.rotationManager.rotatePageBy90(e),ve(u.rotationManager.getRotation(e))},currentPageRotation:fe,showRotateButton:U}),t.jsx(r.default,{defaultScale:oe,pdfUrl:g,plugins:Ie,customStyles:b,onLoad:function(t){de(t.doc.numPages);var n=!q&&!Z&&x<=0;if(x>0&&!Z){var r=x-1,i=Re[r],o=v[i],a=h[r];qe(r),console.log(a,"cordinateTargetHighlight"),q&&a.pageIndex>0&&je(a.pageIndex),o>0&&(setTimeout(function(){He(Pe),Ne(o-1)},1e3),q||je(o-1))}else if(Z&&O&&2===O.length){e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,i,o;return e.__generator(this,function(e){switch(e.label){case 0:t=O[0],n=O[1],r=t,e.label=1;case 1:return r<=n?(je(i=r-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(e.sent(),He(Pe),(o=Ne(i))&&o>0)return[3,4];e.label=3;case 3:return r++,[3,1];case 4:return[2]}})})}else if(!q&&v){var u=Re.find(function(e){return v[e]>0});if(void 0!==u){var l=v[u]-1;je(l),setTimeout(function(){He(Pe),Ne(l)},1e3)}}requestAnimationFrame(function(){n&&Me(),!q&&x>0&&!Z&&function(){if(ie.current){var e=x-1,t=Re[e],n=v[t],r=n>0?n-1:0,i={};Re.forEach(function(e,t){var n=v[e];n>0&&(i[n]||(i[n]=[]),i[n].push(t))});var o=(i[n]||[]).indexOf(e),a=0,u=function(){var e,t;if(!(++a>40)){var n=null===(e=ie.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(n){var i=null===(t=ie.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(r,'"]'));if(i){var l=n.getBoundingClientRect(),s=i.getBoundingClientRect();if(s.top<l.bottom&&s.bottom>l.top){var c=i.querySelectorAll(".rpv-search__highlight")[o];if(c){var d=c.getBoundingClientRect(),g=n.scrollTop+(d.top-l.top)-n.clientHeight/2+d.height/2;n.scrollTo({top:g,behavior:"smooth"})}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}};setTimeout(u,500)}}()})},onPageChange:function(e){var t=e.currentPage;le(t),null==G||G(t+1),Pe.has(t)?(Ne(t),He(Pe)):He(Pe)},renderPage:xe,setRenderRange:re})]}))};
2
2
  //# sourceMappingURL=PdfViewer.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){function t(){this.rotations=new WeakMap,this.pageMap=new Map,this.rotationChangeListeners=new Set,this.pdfIdentifier=""}return t.prototype.setPdfIdentifier=function(t){this.pdfIdentifier=t},t.prototype.registerPageElement=function(t,e){this.pageMap.get(t),this.pageMap.set(t,e);var o=this.getPersistedRotation(t);0!==o&&this.applyRotation(e,t,o)},t.prototype.unregisterPageElement=function(t){this.pageMap.delete(t)},t.prototype.getRotation=function(t){var e=this.pageMap.get(t);return e&&this.rotations.get(e)||0},t.prototype.rotatePageBy90=function(t){var e=this.pageMap.get(t);if(e){var o=((this.rotations.get(e)||0)+90)%360;this.applyRotation(e,t,o)}},t.prototype.setRotation=function(t,e){var o=(e%360+360)%360,i=this.pageMap.get(t);i&&this.applyRotation(i,t,o)},t.prototype.applyRotation=function(t,e,o){this.rotations.set(t,o);var i=t.closest(".rpv-core__page-layer");i&&(0===o?(i.style.transform="",i.style.transformOrigin="",i.style.transition=""):(i.style.transform="rotate(".concat(o,"deg)"),i.style.transformOrigin="center center",i.style.transition="transform 0.2s ease")),this.notifyRotationChange(e,o),this.persistRotation(e,o)},t.prototype.onRotationChange=function(t){var e=this;return this.rotationChangeListeners.add(t),function(){e.rotationChangeListeners.delete(t)}},t.prototype.notifyRotationChange=function(t,e){this.rotationChangeListeners.forEach(function(o){try{o(t,e)}catch(t){console.error("Error in rotation change listener:",t)}})},t.prototype.getPersistedRotation=function(t){if(!this.pdfIdentifier)return 0;var e="pdf-rotation-".concat(this.pdfIdentifier,"-").concat(t),o=localStorage.getItem(e);if(null===o)return 0;if(!o)return 0;var i=parseInt(o,10);return Number.isFinite(i)?i:0},t.prototype.persistRotation=function(t,e){if(this.pdfIdentifier){var o="pdf-rotation-".concat(this.pdfIdentifier,"-").concat(t);0===e?localStorage.removeItem(o):localStorage.setItem(o,e.toString())}},t.prototype.loadPersistedRotations=function(t){var e=this;this.pdfIdentifier&&t.forEach(function(t){var o=e.getPersistedRotation(t);if(0!==o){var i=e.pageMap.get(t);i&&e.applyRotation(i,t,o)}})},t.prototype.clearAll=function(){var t=this;this.pageMap.forEach(function(e,o){var i=e.closest(".rpv-core__page-layer");if(i&&(i.style.transform="",i.style.transformOrigin="",i.style.transition=""),t.pdfIdentifier){var n="pdf-rotation-".concat(t.pdfIdentifier,"-").concat(o);localStorage.removeItem(n)}}),this.pageMap.clear(),this.rotations=new WeakMap},t.prototype.resetPage=function(t){var e=this.pageMap.get(t);e&&this.applyRotation(e,t,0)},t.prototype.getRotatedPages=function(){var t=this,e=new Map;return this.pageMap.forEach(function(o,i){var n=t.rotations.get(o);void 0!==n&&0!==n&&e.set(i,n)}),e},t}(),e=new t;exports.RotationManager=t,exports.rotationManager=e;
2
+ //# sourceMappingURL=rotationManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotationManager.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react");function n(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return e.filter(Boolean).join(" ")}var s=function(){return i.jsx("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},{children:i.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2"})}))},r=function(){return i.jsx("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},{children:i.jsx("path",{d:"M18 15l-6-6-6 6",stroke:"currentColor",strokeWidth:"2"})}))},o=function(){return i.jsxs("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-maximize2-icon lucide-maximize-2 rp-border"},{children:[i.jsx("path",{d:"M15 3h6v6"}),i.jsx("path",{d:"m21 3-7 7"}),i.jsx("path",{d:"m3 21 7-7"}),i.jsx("path",{d:"M9 21H3v-6"})]}))},l=function(){return i.jsxs("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-minimize2-icon lucide-minimize-2 rp-border"},{children:[i.jsx("path",{d:"m14 10 7-7"}),i.jsx("path",{d:"M20 10h-6V4"}),i.jsx("path",{d:"m3 21 7-7"}),i.jsx("path",{d:"M4 14h6v6"})]}))},d=function(){return i.jsxs("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#87c66b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-circle-check-icon lucide-circle-check"},{children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("path",{d:"m9 12 2 2 4-4"})]}))},a={dark:{"--rp-bg":"#000","--rp-text":"#fff","--rp-active-bg":"#1f2930","--rp-muted":"#8c8c8c","--rp-border":"#434343","--rp-success":"#4ade80"},light:{"--rp-bg":"#fff","--rp-text":"#000","--rp-active-bg":"#e5eef5","--rp-muted":"#8c8c8c","--rp-border":"#434343","--rp-success":"#16a34a"}};function c(t){var s,r,o,l,a,c,u=t.item,h=t.index,v=t.isActive,x=t.status,g=void 0===x?"pending":x,p=t.config,m=t.classes,f=p.textKey,j=void 0===f?"text":f,_=p.showStatusIcon,w=void 0===_||_,k=p.showRightBadge,b=void 0===k||k,N=p.rightBadgeText;return i.jsxs("div",e.__assign({className:n("rp-item",v&&"rp-item--active","reviewed"===g&&"rp-item--reviewed",null===(s=null==m?void 0:m.item)||void 0===s?void 0:s.root,v&&(null===(r=null==m?void 0:m.item)||void 0===r?void 0:r.active),"reviewed"===g&&(null===(o=null==m?void 0:m.item)||void 0===o?void 0:o.reviewed))},{children:[w&&"reviewed"===g&&i.jsx("span",e.__assign({className:null===(l=null==m?void 0:m.item)||void 0===l?void 0:l.icon},{children:i.jsx(d,{})})),i.jsx("span",e.__assign({className:n("rp-item-text",null===(a=null==m?void 0:m.item)||void 0===a?void 0:a.text)},{children:String(u[j])})),b&&N&&i.jsx("span",e.__assign({className:n("rp-item-badge",null===(c=null==m?void 0:m.item)||void 0===c?void 0:c.rightBadge)},{children:N(u,h)}))]}))}exports.ReviewPanel=function(d){var u=d.data,h=d.renderItem,v=d.itemConfig,x=d.classes,g=d.keyExtractor,p=void 0===g?function(e,i){return i.toString()}:g,m=d.activeIndex,f=d.onActiveChange,j=d.expanded,_=d.onExpandedChange,w=d.headerLeftSlot,k=d.footerSlot,b=d.headerRightSlot,N=d.getItemStatus,C=d.theme,B=void 0===C?"dark":C,M=d.className,S=t.useState(0),I=S[0],y=S[1],E=t.useState(!1),R=E[0],z=E[1],A=null!=m?m:I,q=null!=j?j:R,W=t.useRef([]),P=function(e){null==f||f(e),void 0===m&&y(e)},V=function(e){null==_||_(e),void 0===j&&z(e)};return t.useEffect(function(){var e;q&&(null===(e=W.current[A])||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"}))},[A,q]),i.jsxs("div",e.__assign({className:n("rp-container",M),style:a[B]},{children:[i.jsxs("div",e.__assign({className:n("rp-header",null==x?void 0:x.header)},{children:[i.jsx("div",e.__assign({className:"rp-header-left"},{children:w})),b?b({activeIndex:A,total:u.length,setIndex:P,isExpanded:q,setExpanded:V}):i.jsxs("div",e.__assign({className:n("rp-header-right",null==x?void 0:x.headerRight)},{children:[i.jsxs("span",{children:[A+1," of ",u.length]}),i.jsx("button",e.__assign({onClick:function(){return P(Math.min(A+1,u.length-1))}},{children:i.jsx(s,{})})),i.jsx("button",e.__assign({onClick:function(){return P(Math.max(A-1,0))}},{children:i.jsx(r,{})}))]})),i.jsx("button",e.__assign({onClick:function(){return V(!q)}},{children:q?i.jsx(l,{}):i.jsx(o,{})}))]})),q&&i.jsx("div",e.__assign({className:n("rp-list",null==x?void 0:x.listWrapper)},{children:u.map(function(t,n){var s=null==N?void 0:N(t,n),r=n===A;return i.jsx("div",e.__assign({ref:function(e){return W.current[n]=e},onClick:function(){return P(n)}},{children:h?h({item:t,index:n,isActive:r,status:s}):i.jsx(c,{item:t,index:n,isActive:r,status:s,config:null!=v?v:{},classes:x})}),p(t,n))})})),k&&i.jsx("div",e.__assign({className:"rp-footer"},{children:k}))]}))};
2
+ //# sourceMappingURL=ReviewPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewPanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ChevronRight"),r=require("@mui/icons-material/Close"),o=require("@mui/icons-material/ExpandMore"),a=require("@mui/material/Box"),l=require("@mui/material/Button"),s=require("@mui/material/ButtonBase"),d=require("@mui/material/Divider"),u=require("@mui/material/IconButton"),c=require("@mui/material/Paper"),x=require("@mui/material/Radio"),g=require("@mui/material/Stack"),f=require("@mui/material/TextField"),p=require("@mui/material/Typography"),h=require("./RevertSummaryNotice.js"),m=require("./CognitiveIcon.js"),_=require("./CognitiveScoreBadge.js"),E=require("../../assests/icons/InfoAlert.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v,C=b(n),j=b(r),F=b(o),y=b(a),S=b(l),w=b(s),R=b(d),A=b(u),M=b(c),I=b(x),B=b(g),z=b(f),T=b(p),k=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)},P="MERGE_ADJACENT";exports.BoundaryReviewActionEnum=void 0,(v=exports.BoundaryReviewActionEnum||(exports.BoundaryReviewActionEnum={})).KEEP="KEEP",v.SPLIT_HERE="SPLIT_HERE",v.MERGE_NEXT="MERGE_NEXT",v.MERGE_PREV="MERGE_PREV",v.MERGE_PREVIOUS="MERGE_PREVIOUS",v.SET_RANGE="SET_RANGE";var W=function(e){return Object.values(exports.BoundaryReviewActionEnum).includes(e)},N=function(i,t,n,r){if(!t||!i)return[];var o=t.additional_decisions,a=Array.isArray(o)?o:o?Object.values(o).flat():[],l=Array.from(new Set(e.__spreadArray(e.__spreadArray([],t.allowed_decisions,!0),a,!0)));return l.flatMap(function(e){var t=i.focus_page,o=l.find(function(e){return e.toLowerCase().includes("merge")}),a=null!=t&&null!=n&&null!=r&&t===n&&t===r,s=null!=t&&null!=n&&t===n,d=null!=t&&null!=r&&(t===r||t===r+1),u=s||d||!(null!=t&&(!(null!=n&&null!=r)||t>n&&t<r));switch(e){case exports.BoundaryReviewActionEnum.SET_RANGE:return[];case"KEEP":return[{id:e,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:e,title:"Split to a separate document",description:u?"A valid page inside the document is required to split it.":t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary.",disabled:u}];case"MERGE_PREV":case"MERGE_NEXT":case"MERGE_PREVIOUS":return e!==o?[]:a?[{id:P,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]:s?[{id:exports.BoundaryReviewActionEnum.MERGE_PREVIOUS,title:"Merge with previous document",description:"Combine this document with the previous document."}]:d?[{id:exports.BoundaryReviewActionEnum.MERGE_NEXT,title:"Merge with next document",description:"Combine this document with the next document."}]:[{id:P,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]}return[]})};exports.createBoundaryCardOptions=N,exports.default=function(n){var r=n.headerName,o=void 0===r?"Boundary Check":r,a=n.title,l=n.pageNo,s=n.content,d=n.revertSummary,u=n.cognitiveScore,c=n.config,x=n.metadata,g=n.previousSegmentTitle,f=n.nextSegmentTitle,p=n.selectedIndex,b=n.defaultSelectedIndex,v=void 0===b?null:b,G=n.defaultStartPage,D=n.defaultEndPage,q=n.onSelectionChange,H=n.onConfirm,O=n.onActionConfirm,V=n.onCognitiveClick,U=n.onAdjustManually,L=n.onClose,X=n.confirmLabel,K=void 0===X?"Confirm":X,$=n.manualPrompt,J=void 0===$?"Didn't find the right option?":$,Y=n.manualActionLabel,Q=void 0===Y?"Adjust Manually":Y,Z=n.cognitiveLabel,ee=void 0===Z?"Cognitive Integrity":Z,ie=n.showAdjustManually,te=void 0===ie||ie,ne=n.showCognitiveIntegrity,re=void 0===ne||ne,oe=n.showCloseButton,ae=void 0===oe||oe,le=n.confirmDisabled,se=void 0!==le&&le,de=n.width,ue=void 0===de?260:de,ce=n.maxWidth,xe=void 0===ce?260:ce,ge=n.className,fe=n.styles,pe=n.reviewAction,he=n.totalPages,me=t.useMemo(function(){return(null!=c?c:x?N(x,pe,G,D):[]).filter(function(e){return e.id!==exports.BoundaryReviewActionEnum.SET_RANGE})},[c,D,G,x,pe]),_e=t.useState(v),Ee=_e[0],be=_e[1],ve=t.useState(null==G?"":String(G)),Ce=ve[0],je=ve[1],Fe=t.useState(null==D?"":String(D)),ye=Fe[0],Se=Fe[1],we=t.useState(!1),Re=we[0],Ae=we[1],Me=t.useState(!1),Ie=Me[0],Be=Me[1],ze=t.useState(null),Te=ze[0],ke=ze[1],Pe=void 0===p?Ee:p,We=null==Pe?void 0:me[Pe],Ne=(null==We?void 0:We.id)===P,Ge=null!=g,De=null!=f,qe=function(e){return!0===e.disabled||e.id===exports.BoundaryReviewActionEnum.MERGE_PREV&&!Ge||e.id===exports.BoundaryReviewActionEnum.MERGE_PREVIOUS&&!Ge||e.id===exports.BoundaryReviewActionEnum.MERGE_NEXT&&!De||e.id===P&&!Ge&&!De},He=Number(Ce),Oe=Number(ye),Ve=Ce.trim().length>0&&ye.trim().length>0&&Number.isInteger(He)&&Number.isInteger(Oe)&&He>0&&Oe>0,Ue=null!=he&&He>he,Le=null!=he&&Oe>he,Xe=Ve&&He<=Oe&&!Ue&&!Le,Ke=se||!We||qe(We)||Ne&&null==Te||!H&&!O;return i.jsx(M.default,e.__assign({className:ge,elevation:4,sx:k({width:ue,maxWidth:xe,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==fe?void 0:fe.root)},{children:i.jsxs(B.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(B.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==fe?void 0:fe.header},{children:[i.jsx(E.default,{color:"error",height:16,width:16}),i.jsx(T.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:o})),ae&&i.jsx(A.default,e.__assign({size:"small",onClick:L,disabled:!L,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(j.default,{sx:{fontSize:17}})}))]})),i.jsxs(y.default,{children:[i.jsx(T.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=l&&i.jsx(T.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:l})),i.jsx(R.default,{sx:{my:.625}}),null!=d?i.jsx(h.default,{children:d}):null!=s&&i.jsx(T.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:s}))]}),i.jsxs(B.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[me.map(function(t,n){var r=Pe===n,o=qe(t);return i.jsxs(M.default,e.__assign({variant:"outlined",sx:k({borderColor:r?"#1976d2":"divider",borderRadius:2,bgcolor:o?"#F8FAFC":"background.paper",overflow:"hidden"},null==fe?void 0:fe.option)},{children:[i.jsxs(w.default,e.__assign({role:"radio","aria-checked":r,disabled:se||o,onClick:function(){return function(e,i){se||qe(i)||(void 0===p&&be(e),i.id!==P&&ke(null),Re&&(Ae(!1),Be(!1)),null==q||q(e,i))}(n,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(I.default,{checked:r,disabled:se||o,tabIndex:-1,size:"small",sx:{p:.25,mr:.5,"&.Mui-disabled":{color:"#CBD5E1"}}}),i.jsxs(y.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(T.default,e.__assign({sx:{color:o?"#94A3B8":"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(T.default,e.__assign({sx:{mt:.125,color:o?"#94A3B8":"text.secondary",fontSize:11}},{children:t.description}))]}))]})),r&&t.id===P&&i.jsx(B.default,e.__assign({direction:"row",spacing:.75,sx:k({px:.75,pb:.75},null==fe?void 0:fe.adjacentSelector)},{children:[{direction:"previous",title:null!=g?g:"No Previous document",caption:"← Merge into Previous",available:Ge},{direction:"next",title:null!=f?f:"No Next document",caption:"Merge into Next →",available:De}].map(function(t){var n=Te===t.direction;return i.jsxs(B.default,e.__assign({sx:{flex:1,minWidth:0}},{children:[i.jsx(w.default,e.__assign({disabled:se||!t.available,onClick:function(){return ke(t.direction)},"aria-pressed":n,sx:{width:"100%",minWidth:0,minHeight:46,alignItems:"flex-start",justifyContent:"flex-start",p:.625,border:"1px solid",borderColor:n?"#7F56D9":"#D0D5DD",borderRadius:1.5,bgcolor:n?"#E0E7FF":"background.paper",color:n?"#7F56D9":t.available?"text.primary":"#98A2B3",textAlign:"left","&.Mui-disabled":{color:"#98A2B3",bgcolor:"#F8FAFC"}}},{children:i.jsx(T.default,e.__assign({sx:{color:"inherit",fontSize:11,fontWeight:500,lineHeight:1.25,overflowWrap:"anywhere"}},{children:t.title}))})),i.jsx(T.default,e.__assign({sx:{mt:.5,color:n?"#5925DC":"text.secondary",fontSize:9.5,lineHeight:1.2,whiteSpace:"nowrap",textAlign:"next"===t.direction?"right":"left"}},{children:t.caption}))]}),t.direction)})}))]}),t.id)}),Ne&&null!=Te&&i.jsxs(B.default,e.__assign({direction:"row",alignItems:"flex-start",spacing:.625,sx:k({p:.75,border:"1px solid #FCA5A5",borderRadius:1.5,bgcolor:"#FEF2F2"},null==fe?void 0:fe.impactWarning)},{children:[i.jsx(E.default,{color:"error",height:14,width:14,sx:{mt:.125}}),i.jsxs(T.default,e.__assign({sx:{color:"#DC2626",fontSize:10.5,lineHeight:1.4}},{children:["This will impact the ",Te," document. Its content and page range will change."]}))]})),i.jsx(S.default,e.__assign({variant:"contained",fullWidth:!0,disabled:Ke,onClick:function(){if(!Ke&&null!=Pe&&We){var i=Ne?"previous"===Te?exports.BoundaryReviewActionEnum.MERGE_PREVIOUS:exports.BoundaryReviewActionEnum.MERGE_NEXT:We.id,t=Ne?e.__assign(e.__assign({},We),{id:i}):We,n={selectedIndex:Pe,option:t,metadata:x};null==H||H(Pe,t,n),O&&W(i)&&O(i,n)}},sx:k({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==fe?void 0:fe.confirmButton)},{children:K}))]})),te&&i.jsxs(B.default,e.__assign({spacing:.625,sx:null==fe?void 0:fe.manualSection},{children:[i.jsxs(w.default,e.__assign({disabled:se,onClick:function(){var e=!Re;Ae(e),Be(!1),e&&(void 0===p&&be(null),null==U||U())},"aria-expanded":Re,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[i.jsx(y.default,{children:i.jsx(T.default,e.__assign({sx:{color:"text.primary",fontSize:12,fontWeight:600}},{children:J}))}),i.jsx(F.default,{sx:{color:"text.secondary",fontSize:16,transform:Re?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),Re&&!Ie&&i.jsxs(y.default,e.__assign({sx:{pt:.5,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[i.jsxs(y.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[i.jsx(T.default,e.__assign({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Starts"})),i.jsx(T.default,e.__assign({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Ends"}))]})),i.jsxs(y.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[i.jsxs(y.default,{children:[i.jsx(z.default,{size:"small",type:"text",value:Ce,disabled:se,error:Ue,onChange:function(e){var i=e.target.value;/^\d*$/.test(i)&&je(i)},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:Ue?"#EF4444":"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:Ue?"#EF4444":"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:Ue?"#EF4444":"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"}}}),Ue&&i.jsxs(T.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:["Must be ≤ ",he," (total pages)"]}))]}),i.jsxs(y.default,{children:[i.jsx(z.default,{size:"small",type:"text",value:ye,disabled:se,error:Le||Ce.trim().length>0&&ye.trim().length>0&&He>Oe,onChange:function(e){var i=e.target.value;/^\d*$/.test(i)&&Se(i)},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:Le||Ce.trim().length>0&&ye.trim().length>0&&He>Oe?"#EF4444":"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:Le||Ce.trim().length>0&&ye.trim().length>0&&He>Oe?"#EF4444":"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:Le||Ce.trim().length>0&&ye.trim().length>0&&He>Oe?"#EF4444":"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"}}}),Le&&i.jsxs(T.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:["Must be ≤ ",he," (total pages)"]})),!Le&&Ce.trim().length>0&&ye.trim().length>0&&He>Oe&&i.jsx(T.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:"End page must be ≥ start page"}))]})]})),i.jsx(y.default,{children:i.jsx(S.default,e.__assign({onClick:function(){Xe&&Be(!0)},disabled:se||!Xe,sx:{height:"30px",padding:"0 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"1px solid #8E80F3",borderRadius:"6px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"12px",fontWeight:600,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Xe?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Xe?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))}),i.jsx(y.default,{sx:{width:"100%",height:"1px",marginTop:"8px",backgroundColor:"#EEF0F2",border:"0"}})]})),Re&&Ie&&i.jsxs(B.default,e.__assign({spacing:.75,sx:k({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==fe?void 0:fe.manualConfirmation)},{children:[i.jsxs(B.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(E.default,{color:"warning",height:14,width:14}),i.jsx(T.default,e.__assign({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),i.jsxs(T.default,e.__assign({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",He,"-",Oe," will become part of ",a,", including pages from other documents in this range."]})),i.jsxs(B.default,e.__assign({direction:"row",spacing:.75},{children:[i.jsx(S.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:function(){return Be(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),i.jsx(S.default,e.__assign({variant:"contained",fullWidth:!0,disabled:se||!H,onClick:function(){if(Xe&&H){var e={id:exports.BoundaryReviewActionEnum.SET_RANGE,title:Q};H(-1,e,{selectedIndex:-1,option:e,startPage:He,endPage:Oe,metadata:x})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),i.jsx(B.default,e.__assign({spacing:.625,sx:null==fe?void 0:fe.footer},{children:re&&i.jsxs(i.Fragment,{children:[i.jsx(R.default,{}),i.jsxs(w.default,e.__assign({onClick:V,disabled:!V,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:V?"pointer":"not-allowed"}},{children:[i.jsxs(B.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(m.default,{sx:{color:"text.secondary"}}),i.jsx(T.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:ee}))]})),i.jsxs(B.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(_.default,{score:u}),i.jsx(C.default,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))},exports.isBoundaryReviewAction=W;
2
+ //# sourceMappingURL=BoundaryCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoundaryCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("@mui/material/Box"),o=require("@mui/material/Popper");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=r(i),a=r(o);exports.default=function(i){var o,r,u=i.anchorRef,s=i.anchorElement,d=i.children,c=i.className,f=i.offset,v=void 0===f?{}:f,h=i.placement,m=void 0===h?"bottom-start":h,p=i.width,x=i.maxWidth;i.customStyles;var w=i.fallbackMaxHeightVh,b=void 0===w?85:w,g=i.heightBuffer,y=void 0===g?100:g,E=n.useState(null),S=E[0],z=E[1],R=n.useState(!0),q=R[0],L=R[1],O=n.useState(null),W=O[0],_=O[1],j=n.useState(null),A=j[0],H=j[1],M=n.useRef(null);return n.useLayoutEffect(function(){var e,t=null!==(e=null!=s?s:null==u?void 0:u.current)&&void 0!==e?e:null;z(function(e){return e===t?e:t})},[s,u]),n.useLayoutEffect(function(){if(S){var e=null,t=function(){var t,n,i=S.getBoundingClientRect(),o=null!==(n=null===(t=window.visualViewport)||void 0===t?void 0:t.height)&&void 0!==n?n:window.innerHeight;L(S.isConnected&&"hidden"!==S.style.visibility),_(Math.max(0,window.innerWidth-i.left-8)),H(Math.max(0,o-i.top-2*i.height)),null!=e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){var t;e=null,null===(t=M.current)||void 0===t||t.update()})},n=new MutationObserver(t);n.observe(S,{attributes:!0,attributeFilter:["style","class"]});var i="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==i||i.observe(S),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),t(),function(){n.disconnect(),null==i||i.disconnect(),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),null!=e&&cancelAnimationFrame(e)}}L(!1)},[S]),t.jsx(a.default,e.__assign({open:Boolean(S)&&q,anchorEl:S,popperRef:M,placement:m,className:c,popperOptions:{strategy:"fixed"},modifiers:[{name:"offset",options:{offset:[null!==(o=v.left)&&void 0!==o?o:0,null!==(r=v.top)&&void 0!==r?r:0]}},{name:"flip",enabled:!1},{name:"preventOverflow",options:{mainAxis:!1,altAxis:!0,tether:!1}}],sx:{zIndex:function(e){return e.zIndex.tooltip},width:p,maxWidth:null==W?x:"min(".concat("number"==typeof x?"".concat(x,"px"):null!=x?x:"100vw",", ").concat(W,"px)"),minWidth:0,height:"fit-content",maxHeight:null==A?"calc(".concat(b,"vh - 10px)"):"".concat(A-y,"px"),alignSelf:"flex-start",flex:"0 0 auto",overflowX:"hidden",overflowY:"auto",borderRadius:2,boxShadow:function(e){return e.shadows[4]},boxSizing:"border-box"}},{children:t.jsx(l.default,e.__assign({sx:{width:"100%",maxWidth:"100%",minWidth:0,height:"fit-content",minHeight:0,maxHeight:null==A?"calc(".concat(b,"vh - 10px)"):"".concat(A-y,"px"),overflowX:"hidden",overflowY:"auto",pointerEvents:"auto",boxSizing:"border-box"}},{children:d}))}))};
2
+ //# sourceMappingURL=CardWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime");exports.default=function(t){return r.jsx("svg",e.__assign({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r.jsx("path",{d:"M8.9375 1.4375V0.5M11.3996 2.10041L12.0625 1.4375M12.0689 4.5625H13.0064M12.9691 7.375C12.6556 10.5333 9.99084 13 6.75 13C3.29822 13 0.5 10.2018 0.5 6.75C0.5 3.50916 2.96667 0.844437 6.125 0.53086M6.75 4.25H9.25V6.75M9.0123 4.25C7.54083 6.32975 5.11648 7.6875 2.375 7.6875C1.74819 7.6875 1.13795 7.61652 0.551889 7.48216",stroke:"#16A34A","stroke-linecap":"round","stroke-linejoin":"round"})}))};
2
+ //# sourceMappingURL=ChartBreakoutCircle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartBreakoutCircle.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var C=require("tslib"),e=require("react/jsx-runtime");function t(C){return C&&"object"==typeof C&&"default"in C?C:{default:C}}var r=t(require("@mui/material/SvgIcon"));exports.default=function(t){return e.jsxs(r.default,C.__assign({},t,{viewBox:"0 0 12 17",sx:C.__assign({width:12,height:17},t.sx)},{children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.778549 6.35498C0.947509 6.06234 1.14047 5.78701 1.35448 5.53127L1.05841 6.77432C0.87679 7.48466 0.80378 8.17502 1.05378 8.73356C1.09106 8.81682 1.13466 8.8951 1.18403 8.96801C1.17505 9.11859 1.17346 9.27007 1.17938 9.42164C1.21133 10.2394 1.46064 11.0339 1.90165 11.7232C2.34265 12.4126 2.95942 12.9719 3.68845 13.3437C3.78702 13.3948 3.86973 13.4719 3.92758 13.5667C3.98544 13.6614 4.01623 13.7702 4.01664 13.8814V16.3427C4.01664 16.422 4.00103 16.5004 3.97071 16.5736C3.94039 16.6468 3.89595 16.7133 3.83993 16.7693C3.78391 16.8253 3.71741 16.8698 3.64421 16.9001C3.57102 16.9305 3.49257 16.946 3.41335 16.946C3.33412 16.946 3.25567 16.9305 3.18248 16.9001C3.10928 16.8698 3.04278 16.8253 2.98676 16.7693C2.93074 16.7133 2.8863 16.6468 2.85598 16.5736C2.82567 16.5004 2.81006 16.422 2.81006 16.3427V14.2366C1.50675 13.4505 0.563809 12.1847 0.18393 10.7109C-0.195948 9.23705 0.017555 7.67304 0.778549 6.35498ZM2.5956 4.4202C2.58489 4.46583 2.57238 4.51587 2.55818 4.57051L2.10596 6.46709C2.4519 6.00902 2.88178 5.61795 3.37484 5.31587C3.45372 5.26755 3.53389 5.2217 3.61524 5.17836L3.91437 4.02581C3.94069 3.92848 3.96334 3.83471 3.98223 3.74482C3.4887 3.90843 3.02287 4.13636 2.5956 4.4202ZM4.97997 3.50929C4.95187 3.76277 4.89721 4.01844 4.83146 4.26296L4.70096 4.7659C5.02368 4.68809 5.35523 4.64508 5.68997 4.63852C6.50816 4.62249 7.31584 4.82482 8.02986 5.22467C8.74387 5.62452 9.33837 6.20745 9.75227 6.91343C10.1661 7.61942 10.3843 8.42296 10.3845 9.24135V13.029C10.3845 13.1201 10.3483 13.2075 10.2838 13.272C10.2193 13.3365 10.132 13.3726 10.0408 13.3726H8.14698C7.98698 13.3726 7.83353 13.4362 7.72039 13.5493C7.60726 13.6625 7.5437 13.816 7.5437 13.9759V16.3427C7.5437 16.5028 7.60726 16.6562 7.72039 16.7693C7.83353 16.8825 7.98698 16.946 8.14698 16.946C8.30699 16.946 8.46043 16.8825 8.57357 16.7693C8.6867 16.6562 8.75027 16.5028 8.75027 16.3427V14.5792H10.0408C10.2444 14.5792 10.446 14.5391 10.634 14.4612C10.8221 14.3833 10.993 14.2691 11.137 14.1252C11.2809 13.9812 11.3951 13.8103 11.473 13.6223C11.551 13.4342 11.591 13.2326 11.591 13.029V9.24224C11.5909 8.20964 11.3155 7.1957 10.7933 6.30483C10.271 5.41397 9.5209 4.67834 8.61996 4.17369C7.50563 3.55832 6.22659 3.32916 4.97997 3.50929ZM3.31096 7.17824C3.06416 7.47379 2.86777 7.81154 2.73281 8.17818C2.67346 8.33942 2.62681 8.50407 2.59287 8.67068C2.96541 8.66305 3.3259 8.58961 4.09408 7.98043L4.4813 7.65806C4.62698 7.53143 4.68583 7.33671 4.65268 7.14949L4.63322 7.06982C4.53815 6.83998 4.24287 6.77137 4.02738 6.89566C3.80462 7.02416 3.56339 7.12021 3.31096 7.17824ZM5.50956 6.70762C5.39307 6.42581 5.2101 6.22391 4.9955 6.09139C5.4636 5.96152 5.95753 5.9332 6.44355 6.01261C7.21223 6.13821 7.9139 6.52554 8.4298 7.10905C8.7773 7.50191 8.68077 8.0666 8.32362 8.38802C7.27342 9.33691 5.53306 10.5666 3.80331 11.0251C3.36315 11.141 2.88052 10.9286 2.71933 10.4749C2.62076 10.1971 2.55967 9.90972 2.53604 9.62C2.82204 9.61857 3.17908 9.5971 3.63183 9.39587C4.05727 9.20681 4.51985 8.88082 5.10381 8.3732C5.58794 7.95226 5.70675 7.30946 5.5355 6.77894L5.52437 6.74281L5.50956 6.70762Z"}),e.jsx("path",{d:"M2.49253 8.67144C1.98274 8.67144 1.60843 8.35663 1.96545 6.97238L2.55084 4.51665C2.65295 4.12345 2.66944 3.96624 2.55084 3.96624C2.1154 4.07601 2.33401 4.00777 1.9654 4.16485L1.71094 3.73988C2.95167 2.68571 2.97363 2.40709 3.58474 2.40709C4.09454 2.40709 4.17978 3.02062 3.92448 3.96464L3.25466 6.54621C3.13565 7.00253 3.18712 7.15973 3.30531 7.15973C3.56398 7.10114 3.81132 7.00404 4.03939 6.87249C4.25773 6.74655 4.55616 6.81591 4.65239 7.04889C4.72106 7.26145 4.66773 7.49745 4.49914 7.64399C3.36616 8.62885 2.9653 8.67144 2.49253 8.67144ZM3.66602 0.00239655C3.7822 -0.00651177 3.89895 0.00947896 4.00846 0.0493006C4.11797 0.0891223 4.21772 0.151858 4.30105 0.233314C4.38438 0.314771 4.44935 0.413073 4.49165 0.521653C4.53394 0.630232 4.55258 0.746588 4.54631 0.862945V0.860752C4.53258 1.15708 4.40525 1.43674 4.19074 1.64164C3.97623 1.84656 3.69104 1.96097 3.39439 1.96112L3.37064 1.96075C3.25288 1.97358 3.13485 1.95962 3.02324 1.91993C2.91164 1.88024 2.81044 1.81584 2.72723 1.73154C2.64402 1.64723 2.58094 1.54522 2.54271 1.43311C2.50477 1.32187 2.49227 1.20356 2.5061 1.08687C2.51738 0.789536 2.64564 0.508673 2.86299 0.305421C3.08056 0.101963 3.36973 -0.00722427 3.66748 0.00166549L3.66602 0.00239655Z"})]}))};
2
+ //# sourceMappingURL=CognitiveIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveIcon.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("@mui/icons-material/ChevronLeft"),t=require("@mui/icons-material/Close"),a=require("@mui/material/Box"),r=require("@mui/material/Divider"),s=require("@mui/material/IconButton"),l=require("@mui/material/Paper"),o=require("@mui/material/Stack"),d=require("@mui/material/Typography"),u=require("../CitationRenderer/MarkdownRenderer.js"),c=require("./CognitiveIcon.js"),g=require("./CognitiveScoreBadge.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=h(n),x=h(t),m=h(a),_=h(r),p=h(s),v=h(l),j=h(o),y=h(d),b=function(i,n){return e.__spreadArray([i],Array.isArray(n)?n:null==n?[]:[n],!0)};exports.default=function(n){var t=n.reasons,a=n.reason,r=n.gap,s=n.score,l=n.headerName,o=void 0===l?"Cognitive Integrity":l,d=n.onBack,h=n.onClose,H=n.showCloseButton,C=void 0===H||H,S=n.width,z=void 0===S?260:S,w=n.maxWidth,q=void 0===w?260:w,k=n.className,W=n.styles,A=(null!=t?t:[]).filter(function(e){return"evidence"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),B=(null!=t?t:[]).filter(function(e){return"gap"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),I=null==a?void 0:a.trim(),R=null==r?void 0:r.trim();if(0===A.length&&I&&A.push(I),0===B.length&&R&&B.push(R),0===A.length&&0===B.length)return null;var F,M=(F=null==W?void 0:W.markdown,e.__assign(e.__assign({},F),{containerWrapper:e.__assign(e.__assign({},null==F?void 0:F.containerWrapper),{display:"block",height:"auto",minHeight:0,maxHeight:"fit-content",flex:"0 0 auto"}),mainCard:e.__assign(e.__assign({},null==F?void 0:F.mainCard),{height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto",padding:0,border:"none",borderRadius:0,boxShadow:"none",backgroundColor:"transparent"}),scrollArea:e.__assign({height:"auto",minHeight:0,maxHeight:"none",overflowY:"visible",paddingRight:0,color:"#475467",fontSize:11.5,lineHeight:1.3},null==F?void 0:F.scrollArea),list:e.__assign({margin:"0",padding:"0 0 0 18px",fontSize:"11.5px",lineHeight:"1.3"},null==F?void 0:F.list)})),D=e.__assign(e.__assign({},M),{scrollArea:e.__assign(e.__assign({},M.scrollArea),{fontSize:"inherit",lineHeight:"inherit"}),summary:e.__assign(e.__assign({},M.summary),{display:"inline-flex",padding:0,fontSize:"inherit",lineHeight:"inherit"})});return i.jsx(v.default,e.__assign({className:k,elevation:4,sx:b({width:z,maxWidth:q,height:"fit-content",minHeight:0,alignSelf:"flex-start",flex:"0 0 auto",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==W?void 0:W.root)},{children:i.jsxs(j.default,e.__assign({spacing:.75,sx:{p:1,height:"auto",minHeight:0}},{children:[i.jsxs(j.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==W?void 0:W.header},{children:[d&&i.jsx(p.default,e.__assign({size:"small",onClick:d,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:i.jsx(f.default,{sx:{fontSize:17}})})),i.jsx(c.default,{sx:{color:"#6941C6"}}),i.jsx(y.default,e.__assign({sx:{flex:1,fontSize:12,fontWeight:500,alignItems:"center",display:"flex",lineHeight:1.25,textTransform:"capitalise"}},{children:o})),i.jsx(g.default,{score:s}),C&&i.jsx(p.default,e.__assign({size:"small",onClick:h,disabled:!h,"aria-label":"Close cognitive integrity",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(x.default,{sx:{fontSize:17}})}))]})),i.jsx(_.default,{sx:{m:0}}),i.jsx(m.default,e.__assign({sx:b({bgcolor:"#F9FAFB",px:1.5,py:1.25,height:"auto",minHeight:0,flex:"0 0 auto"},null==W?void 0:W.content)},{children:i.jsxs(j.default,e.__assign({spacing:1.5},{children:[A.length>0&&i.jsxs(m.default,{children:[i.jsx(y.default,e.__assign({sx:{mb:1,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.4}},{children:"Decision Making Factors"})),i.jsx(j.default,e.__assign({spacing:.75},{children:A.map(function(n,t){return i.jsxs(j.default,e.__assign({direction:"row",alignItems:"flex-start",spacing:.75},{children:[i.jsxs(y.default,e.__assign({component:"span",sx:{flex:"0 0 auto",minWidth:14,color:"#475467",fontSize:11.5,lineHeight:1.65}},{children:[t+1,"."]})),i.jsx(m.default,e.__assign({sx:{flex:1,minWidth:0,color:"#667085",fontSize:11.5,lineHeight:1.65,"& p":{m:0,color:"inherit",fontSize:"inherit",lineHeight:"inherit"}}},{children:i.jsx(u.default,{value:"<summary>".concat(n,"</summary>"),styles:D})}))]}),"evidence-".concat(t))})}))]}),A.length>0&&B.length>0&&i.jsx(_.default,{sx:{my:"2px !important",borderColor:"#E4E7EC"}}),B.length>0&&i.jsxs(m.default,{children:[i.jsx(y.default,e.__assign({sx:{mb:1,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.4}},{children:"Gaps in Decision"})),i.jsx(j.default,e.__assign({spacing:.75},{children:B.map(function(n,t){return i.jsxs(j.default,e.__assign({direction:"row",alignItems:"flex-start",spacing:.75},{children:[i.jsxs(y.default,e.__assign({component:"span",sx:{flex:"0 0 auto",minWidth:14,color:"#475467",fontSize:11.5,lineHeight:1.65}},{children:[t+1,"."]})),i.jsx(m.default,e.__assign({sx:{flex:1,minWidth:0,color:"#667085",fontSize:11.5,lineHeight:1.65,"& p":{m:0,color:"inherit",fontSize:"inherit",lineHeight:"inherit"}}},{children:i.jsx(u.default,{value:"<summary>".concat(n,"</summary>"),styles:D})}))]}),"gap-".concat(t))})}))]})]}))}))]}))}))};
2
+ //# sourceMappingURL=CognitiveIntegrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveIntegrity.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(require("@mui/material/Box"));exports.default=function(t){var o=t.score;if(null==o||"string"==typeof o&&""===o.trim())return null;var i="number"==typeof o?"".concat(o,"%"):o;return r.jsx(n.default,e.__assign({component:"span",sx:{px:.625,py:0,border:"1.5px solid",borderColor:"secondary.main",borderRadius:10,color:"secondary.main",fontSize:11,lineHeight:1.25}},{children:i}))};
2
+ //# sourceMappingURL=CognitiveScoreBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveScoreBadge.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),r=require("@mui/icons-material/ChevronRight"),n=require("@mui/icons-material/Close"),o=require("@mui/material/Box"),l=require("@mui/material/Button"),a=require("@mui/material/ButtonBase"),s=require("@mui/material/Divider"),d=require("@mui/material/IconButton"),u=require("@mui/material/Paper"),c=require("@mui/material/Radio"),x=require("@mui/material/Stack"),f=require("@mui/material/TextField"),h=require("@mui/material/Typography"),m=require("./RevertSummaryNotice.js"),p=require("./CognitiveIcon.js"),g=require("./CognitiveScoreBadge.js"),b=require("../../assests/icons/InfoAlert.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _,j=v(r),C=v(n),y=v(o),w=v(l),S=v(a),A=v(s),L=v(d),E=v(u),I=v(c),q=v(x),k=v(f),B=v(h),D=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)};exports.LabelReviewActionEnum=void 0,(_=exports.LabelReviewActionEnum||(exports.LabelReviewActionEnum={})).KEEP_LABEL="KEEP_LABEL",_.SET_CUSTOM_LABEL="SET_CUSTOM_LABEL";var z=function(e){return e.user_actions.map(function(i){switch(i){case"KEEP_LABEL":return{id:i,title:"Keep as is",description:e.current_label?'Label stays "'.concat(e.current_label,'"'):"Keep the current document label"};case"SET_CUSTOM_LABEL":return{id:i,title:"Fix a document title",description:"Correct the page title if it's not right",requiresInput:!0,inputPlaceholder:e.current_label?"e.g. ".concat(e.current_label):"Enter a document label"}}})},M=function(e){return Object.values(exports.LabelReviewActionEnum).includes(e)};exports.createLabelCheckOptions=z,exports.default=function(r){var n,o=r.headerName,l=void 0===o?"Title Check":o,a=r.title,s=r.pageNo,d=r.content,u=void 0===d?"We're not fully confident about this label. Confirm it, choose a different type, or add a new one.":d,c=r.revertSummary,x=r.cognitiveScore,f=r.config,h=r.metadata,v=r.selectedIndex,_=r.defaultSelectedIndex,F=void 0===_?null:_,O=r.onSelectionChange,R=r.customLabel,W=r.defaultCustomLabel,T=r.onCustomLabelChange,P=r.onConfirm,K=r.onActionConfirm,H=r.onCognitiveClick;r.onAdjustManually;var N=r.onClose,U=r.confirmLabel,G=void 0===U?"Confirm":U,J=r.customInputAriaLabel,Q=void 0===J?"Custom document label":J;r.manualPrompt,r.manualActionLabel;var V=r.cognitiveLabel,X=void 0===V?"Cognitive Integrity":V;r.showAdjustManually;var Y=r.showCognitiveIntegrity,Z=void 0===Y||Y,$=r.showCloseButton,ee=void 0===$||$,ie=r.confirmDisabled,te=void 0!==ie&&ie,re=r.confirmationBlocked,ne=void 0!==re&&re,oe=r.confirmationWarning,le=r.disableAllActions,ae=void 0!==le&&le,se=r.width,de=void 0===se?260:se,ue=r.maxWidth,ce=void 0===ue?260:ue,xe=r.className,fe=r.styles,he=t.useMemo(function(){return null!=f?f:h?z(h):[]},[f,h]),me=t.useState(F),pe=me[0],ge=me[1],be=t.useState(null!==(n=null!=W?W:null==h?void 0:h.custom_label)&&void 0!==n?n:""),ve=be[0],_e=be[1],je=void 0===v?pe:v,Ce=void 0===R?ve:R,ye=null==je?void 0:he[je],we=Boolean(null==ye?void 0:ye.requiresInput),Se=ne||ae||te||!P&&!K||!ye||!0===ye.disabled||we&&0===Ce.trim().length,Ae=function(){if(!Se&&null!=je&&ye){var e=we?Ce.trim():void 0;null==P||P(je,ye,e),K&&M(ye.id)&&K(ye.id,{selectedIndex:je,option:ye,customLabel:e,metadata:h})}};return i.jsx(E.default,e.__assign({className:xe,elevation:0,sx:D({width:de,maxWidth:ce,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.2)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==fe?void 0:fe.root)},{children:i.jsx(y.default,e.__assign({sx:{overflow:"hidden"}},{children:i.jsxs(q.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(q.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==fe?void 0:fe.header},{children:[i.jsx(b.default,{color:"error",height:16,width:16}),i.jsx(B.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:l})),ee&&i.jsx(L.default,e.__assign({size:"small",onClick:N,disabled:!N,"aria-label":"Close label check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(C.default,{sx:{fontSize:17}})}))]})),i.jsxs(y.default,{children:[i.jsx(B.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=s&&i.jsx(B.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:s})),i.jsx(A.default,{sx:{my:.625}}),null!=c?i.jsx(m.default,{children:c}):null!=u&&i.jsx(B.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:u}))]}),i.jsxs(q.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Label options"},{children:[null!=oe&&i.jsxs(q.default,e.__assign({direction:"row",alignItems:"flex-start",spacing:.5,role:"alert",sx:D({px:.75,py:.625,borderRadius:1,bgcolor:"#FEFCE8",color:"#CA8A04"},null==fe?void 0:fe.confirmationWarning)},{children:[i.jsx(b.default,{color:"inherit",height:15,width:15}),i.jsx(B.default,e.__assign({sx:{color:"inherit",fontSize:11.5,lineHeight:1.3}},{children:oe}))]})),he.map(function(t,r){var n=je===r;return i.jsxs(E.default,e.__assign({variant:"outlined",sx:D({borderColor:n?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==fe?void 0:fe.option)},{children:[i.jsxs(S.default,e.__assign({role:"radio","aria-checked":n,disabled:te||t.disabled||ne,onClick:function(){return function(e,i){te||i.disabled||(void 0===v&&ge(e),null==O||O(e,i))}(r,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left",cursor:"pointer","&.Mui-disabled":{cursor:"not-allowed"}}},{children:[i.jsx(I.default,{checked:n,disabled:te||t.disabled||ne,tabIndex:-1,size:"small",sx:{p:.25,mr:.5,cursor:"pointer","&.Mui-disabled":{cursor:"not-allowed"}}}),i.jsxs(y.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(B.default,e.__assign({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(B.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:t.description}))]}))]})),n&&t.requiresInput&&i.jsx(y.default,e.__assign({sx:{px:1.25,pb:1}},{children:i.jsx(k.default,{autoFocus:!0,fullWidth:!0,size:"small",value:Ce,disabled:te,placeholder:t.inputPlaceholder,inputProps:{"aria-label":Q},onChange:function(e){return i=e.target.value,void 0===R&&_e(i),void(null==T||T(i));var i},onKeyDown:function(e){"Enter"===e.key&&Ae()},variant:"outlined",InputProps:{sx:{height:36,borderRadius:2,backgroundColor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1px"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1.5px"},"& .MuiOutlinedInput-input":{height:"100%",boxSizing:"border-box",px:1.25,py:0,fontSize:12,lineHeight:1.25},"& .MuiOutlinedInput-input::placeholder":{color:"#98A2B3",opacity:1}}},sx:null==fe?void 0:fe.customInput})}))]}),t.id)}),i.jsx(w.default,e.__assign({variant:"contained",fullWidth:!0,disabled:Se,onClick:Ae,sx:D({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==fe?void 0:fe.confirmButton)},{children:G}))]})),i.jsx(q.default,e.__assign({spacing:.625,sx:null==fe?void 0:fe.footer},{children:Z&&i.jsxs(i.Fragment,{children:[i.jsx(A.default,{}),i.jsxs(S.default,e.__assign({onClick:H,disabled:!H,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:H?"pointer":"not-allowed"}},{children:[i.jsxs(q.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(p.default,{sx:{color:"text.secondary"}}),i.jsx(B.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:X}))]})),i.jsxs(q.default,e.__assign({direction:"row",alignItems:"center",spacing:.75},{children:[i.jsx(g.default,{score:x}),i.jsx(j.default,{sx:{color:"text.secondary",fontSize:18}})]}))]}))]})}))]}))}))}))},exports.isLabelReviewAction=M;
2
+ //# sourceMappingURL=LabelCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabelCheck.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),o=require("react"),r=require("@mui/icons-material/ChevronRight"),t=require("@mui/icons-material/Close"),n=require("@mui/material/Box"),a=require("@mui/material/Button"),s=require("@mui/material/Divider"),l=require("@mui/material/IconButton"),d=require("@mui/material/Paper"),c=require("@mui/material/Stack"),u=require("@mui/material/Typography"),x=require("./CognitiveIcon.js"),g=require("./CognitiveScoreBadge.js"),f=require("../../assests/icons/InfoAlert.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m,p=h(r),C=h(t),b=h(n),_=h(a),v=h(s),j=h(l),y=h(d),k=h(c),F=h(u),A=function(i,o){return e.__spreadArray([i],Array.isArray(o)?o:null==o?[]:[o],!0)};exports.PageCheckActionEnum=void 0,(m=exports.PageCheckActionEnum||(exports.PageCheckActionEnum={})).YES="YES",m.NO="NO";exports.default=function(r){var t,n=r.headerName,a=void 0===n?"Page Type Check":n,s=r.title,l=r.pageNo,d=r.content,c=r.cognitiveScore,u=r.pageType,h=r.metadata,m=r.onActionConfirm,S=r.onCognitiveClick,w=r.onClose,E=r.showCognitiveIntegrity,q=void 0===E||E,D=r.showCloseButton,P=void 0===D||D,z=r.confirmDisabled,I=void 0!==z&&z,B=r.disableAllActions,N=void 0!==B&&B,T=r.width,W=void 0===T?260:T,O=r.maxWidth,R=void 0===O?260:O,Y=r.className,H=r.styles,M=null!==(t=null!=u?u:null==h?void 0:h.page_type)&&void 0!==t?t:"table",G=null!=d?d:"We're not fully confident about the type of this page. Is this page a ".concat(M,"?"),J=N||I||!m,K=o.useCallback(function(){J||null==m||m(exports.PageCheckActionEnum.YES,{action:exports.PageCheckActionEnum.YES,pageType:M,metadata:h})},[J,m,M,h]),L=o.useCallback(function(){J||null==m||m(exports.PageCheckActionEnum.NO,{action:exports.PageCheckActionEnum.NO,pageType:M,metadata:h})},[J,m,M,h]);return i.jsx(y.default,e.__assign({className:Y,elevation:0,sx:A({width:W,maxWidth:R,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.2)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==H?void 0:H.root)},{children:i.jsx(b.default,e.__assign({sx:{overflow:"hidden"}},{children:i.jsxs(k.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==H?void 0:H.header},{children:[i.jsx(f.default,{color:"error",height:16,width:16}),i.jsx(F.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:a})),P&&i.jsx(j.default,e.__assign({size:"small",onClick:w,disabled:!w,"aria-label":"Close page check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(C.default,{sx:{fontSize:17}})}))]})),i.jsxs(b.default,{children:[i.jsx(F.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:s})),null!=l&&i.jsx(F.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:l})),i.jsx(v.default,{sx:{my:.625}}),null!=G&&i.jsx(F.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:G}))]}),i.jsxs(k.default,e.__assign({direction:"row",spacing:.75},{children:[i.jsx(_.default,e.__assign({variant:"outlined",fullWidth:!0,disabled:J,onClick:L,sx:A({minHeight:32,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",borderColor:"#D0D5DD",color:"#475569",backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"#F8FAFC",borderColor:"#D0D5DD"},"&.Mui-disabled":{backgroundColor:"#F3F4F6",color:"#9CA3AF",borderColor:"#E5E7EB"}},null==H?void 0:H.noButton)},{children:"No"})),i.jsx(_.default,e.__assign({variant:"contained",fullWidth:!0,disabled:J,onClick:K,sx:A({minHeight:32,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==H?void 0:H.yesButton)},{children:"Yes"}))]})),i.jsx(k.default,e.__assign({spacing:.625,sx:null==H?void 0:H.footer},{children:q&&i.jsxs(i.Fragment,{children:[i.jsx(v.default,{}),i.jsxs(b.default,e.__assign({onClick:S,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderRadius:1,cursor:S?"pointer":"not-allowed","&:hover":S?{opacity:.8}:{}}},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(x.default,{sx:{color:"text.secondary"}}),i.jsx(F.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:"Cognitive Integrity"}))]})),i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.75},{children:[i.jsx(g.default,{score:c}),i.jsx(p.default,{sx:{color:"text.secondary",fontSize:18}})]}))]}))]})}))]}))}))}))},exports.isPageCheckAction=function(e){return Object.values(exports.PageCheckActionEnum).includes(e)};
2
+ //# sourceMappingURL=PageCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageCheck.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),n=require("@mui/material/Box"),i=require("@mui/material/Button"),s=require("@mui/material/ButtonBase"),a=require("@mui/material/Divider"),o=require("@mui/material/Stack"),l=require("@mui/material/Tooltip"),d=require("@mui/material/Typography"),c=require("lucide-react");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=u(n),x=u(i),g=u(s),h=u(a),_=u(o),m=u(l),p=u(d),b=function(e){var r=e.startPage,t=e.endPage;return"Pages ".concat(r,"-").concat(t)},v=function(t){var n=t.segment;return r.jsxs(f.default,e.__assign({sx:{px:.75,py:.625,minWidth:0}},{children:[r.jsx(p.default,e.__assign({sx:{color:"text.secondary",fontSize:11,lineHeight:1.3,overflowWrap:"anywhere"}},{children:n.title})),r.jsx(p.default,e.__assign({sx:{color:"text.primary",fontSize:12,fontWeight:400,lineHeight:1.3}},{children:b(n)}))]}))};var j={minHeight:34,borderColor:"#94A3B8",color:"#64748B",borderRadius:"8px",fontSize:12,fontWeight:500,textTransform:"none"},y={minHeight:34,borderRadius:"8px",bgcolor:"#4F46E5",fontSize:12,fontWeight:500,textTransform:"none",boxShadow:"none","&:hover":{bgcolor:"#4338CA",boxShadow:"none"}};exports.default=function(n){var i=this,s=n.icon,a=n.title,o=n.pageRange,l=n.description,d=n.onRevert,u=n.onRevertComplete,b=n.onRevertError,C=n.revertData,S=n.confirmDisabled,w=void 0!==S&&S,R=n.showDocumentHeader,W=void 0===R||R,F=t.useState(!1),z=F[0],k=F[1],H=t.useState(!1),q=H[0],A=H[1],B=C.previousSegments.length>0,E=function(){return e.__awaiter(i,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:if(q||w)return[2];A(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,d()];case 2:return r=e.sent(),null==u||u(r),[3,5];case 3:return t=e.sent(),null==b||b(t),[3,5];case 4:return A(!1),[7];case 5:return[2]}})})};return r.jsxs(_.default,e.__assign({spacing:.875,sx:{minWidth:0}},{children:[W&&r.jsxs(f.default,e.__assign({sx:{minWidth:0}},{children:[r.jsx(p.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500,lineHeight:1.4,overflowWrap:"anywhere"}},{children:a})),r.jsx(p.default,e.__assign({sx:{color:"text.secondary",fontSize:12,lineHeight:1.4}},{children:o}))]})),l&&r.jsxs(_.default,e.__assign({direction:"row",alignItems:"flex-start",spacing:.625,sx:{px:.75,py:.625,border:"1px solid #86EFAC",borderRadius:2,bgcolor:"#FFFFFF",color:"#16A34A"}},{children:[r.jsx(f.default,e.__assign({"aria-hidden":"true",sx:{display:"flex",flexShrink:0,mt:"1px",fontSize:14}},{children:s})),r.jsx(p.default,e.__assign({sx:{minWidth:0,color:"inherit",fontSize:11,lineHeight:1.5,overflowWrap:"anywhere"}},{children:l}))]})),r.jsx(h.default,{sx:{borderStyle:"dashed",borderColor:"#CBD5E1"}}),z?r.jsxs(_.default,e.__assign({spacing:.75},{children:[r.jsxs(g.default,e.__assign({onClick:function(){return k(!1)},"aria-label":"Back from revert confirmation",sx:{width:"fit-content",borderRadius:.5,color:"text.primary",fontSize:13,fontWeight:500,lineHeight:1.3,textAlign:"left"}},{children:[r.jsx(f.default,e.__assign({component:"span","aria-hidden":"true",sx:{mr:.625,alignItems:"center",display:"flex"}},{children:r.jsx(c.ChevronLeft,{size:16})})),"Revert"]})),B?r.jsxs(f.default,e.__assign({sx:{p:.75,borderRadius:1,bgcolor:"#F8FAFC"}},{children:[r.jsx(p.default,e.__assign({sx:{mb:.375,color:"text.secondary",fontSize:12}},{children:"Current"})),r.jsx(f.default,e.__assign({sx:{mb:.75,border:"1px solid #E2E8F0",borderRadius:1,bgcolor:"background.paper"}},{children:r.jsx(v,{segment:C.currentSegment})})),r.jsx(p.default,e.__assign({sx:{mb:.375,color:"text.secondary",fontSize:12}},{children:"After Revert"})),r.jsx(f.default,e.__assign({sx:{border:"1px solid #E2E8F0",borderRadius:1,bgcolor:"background.paper",overflow:"hidden"}},{children:C.previousSegments.map(function(e,t){return r.jsxs(f.default,{children:[t>0&&r.jsx(h.default,{sx:{borderColor:"#E2E8F0"}}),r.jsx(v,{segment:e})]},"".concat(e.title,"-").concat(e.startPage,"-").concat(e.endPage,"-").concat(t))})})),r.jsxs(_.default,e.__assign({direction:"row",spacing:1,sx:{mt:.875}},{children:[r.jsx(x.default,e.__assign({variant:"outlined",fullWidth:!0,disabled:q,onClick:function(){return k(!1)},sx:j},{children:"Cancel"})),r.jsx(m.default,e.__assign({title:w?"Revert data is not present, cannot revert this":"",disableHoverListener:!w,arrow:!0},{children:r.jsx("span",e.__assign({style:{flex:1}},{children:r.jsx(x.default,e.__assign({variant:"contained",fullWidth:!0,disabled:q||w,onClick:function(){E()},sx:y},{children:q?"Reverting…":"Confirm"}))}))}))]}))]})):r.jsxs(f.default,e.__assign({sx:{p:.875,borderRadius:1,bgcolor:"#F8FAFC"}},{children:[r.jsx(p.default,e.__assign({sx:{color:"text.secondary",fontSize:12,fontWeight:500}},{children:"Revert approval?"})),r.jsx(p.default,e.__assign({sx:{mt:.75,color:"text.secondary",fontSize:13,lineHeight:1.45}},{children:"This document will be moved back to pending review and will need to be confirmed again."})),r.jsxs(_.default,e.__assign({direction:"row",spacing:1,sx:{mt:1}},{children:[r.jsx(x.default,e.__assign({variant:"outlined",fullWidth:!0,disabled:q,onClick:function(){return k(!1)},sx:j},{children:"Cancel"})),r.jsx(m.default,e.__assign({title:w?"Revert data is not present, cannot revert this":"",disableHoverListener:!w,arrow:!0},{children:r.jsx("span",e.__assign({style:{flex:1}},{children:r.jsx(x.default,e.__assign({variant:"contained",fullWidth:!0,disabled:q||w,onClick:function(){E()},sx:y},{children:q?"Reverting…":"Confirm"}))}))}))]}))]}))]})):r.jsx(x.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:function(){return k(!0)},sx:{minHeight:36,borderColor:"#9B8AFB",color:"#5925DC",borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none","&:hover":{borderColor:"secondary.dark",bgcolor:"rgba(79, 70, 229, 0.04)"}}},{children:"Revert"}))]}))};
2
+ //# sourceMappingURL=RevertCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevertCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("@mui/icons-material/ArrowForward"),t=require("@mui/material/Box"),o=require("@mui/material/Button"),l=require("@mui/material/Paper"),a=require("@mui/material/Stack"),n=require("@mui/material/Typography"),s=require("lucide-react");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(i),c=d(t),x=d(o),g=d(l),h=d(a),f=d(n);exports.default=function(i){var t=i.title,o=i.description,l=i.onReview,a=i.reviewLabel,n=void 0===a?"Review":a;return r.jsx(g.default,e.__assign({elevation:0,role:"status",sx:{width:"100%",px:1.5,py:1.5,border:"1.5px solid #86EFAC",borderRadius:2,bgcolor:"#F0FDF4",boxSizing:"border-box"}},{children:r.jsxs(h.default,e.__assign({alignItems:"center",spacing:1.5,sx:{textAlign:"center"}},{children:[r.jsx(c.default,e.__assign({sx:{display:"grid",placeItems:"center",width:58,height:58,border:"8px solid rgba(255, 255, 255, 0.9)",borderRadius:"50%",bgcolor:"#DCFCE7",color:"#0A9B49"}},{children:r.jsx(s.CheckCircleIcon,{height:36,width:36})})),r.jsxs(c.default,{children:[r.jsx(f.default,e.__assign({sx:{color:"#166534",fontSize:15,fontWeight:600,lineHeight:1.4}},{children:t})),r.jsx(f.default,e.__assign({sx:{mt:.75,color:"#07883F",fontSize:14,lineHeight:1.55}},{children:o}))]}),r.jsx(x.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:l,endIcon:r.jsx(u.default,{}),sx:{minHeight:42,border:"1.5px solid #CBD5E1",borderRadius:2,bgcolor:"#FFFFFF",color:"#475569",fontSize:16,fontWeight:700,textTransform:"none","&:hover":{borderColor:"#94A3B8",bgcolor:"#FFFFFF"}}},{children:n}))]}))}))};
2
+ //# sourceMappingURL=RevertSuccessCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevertSuccessCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("@mui/material/Box"),t=require("@mui/material/Typography"),a=require("lucide-react");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(i),s=o(t);exports.default=function(i){var t=i.children;return r.jsxs(l.default,e.__assign({sx:{display:"flex",alignItems:"flex-start",gap:1,px:1,py:1.125,border:"1px solid #FACC15",borderRadius:1.5,bgcolor:"#FFFBEB",color:"#D18A00"}},{children:[r.jsx(a.GitMerge,{size:18,strokeWidth:2.25,style:{flex:"0 0 auto",marginTop:1}}),r.jsx(s.default,e.__assign({component:"div",sx:{color:"inherit",fontSize:12,lineHeight:1.5,overflowWrap:"anywhere"}},{children:t}))]}))};
2
+ //# sourceMappingURL=RevertSummaryNotice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevertSummaryNotice.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ExpandMore"),r=require("@mui/material/Box"),o=require("@mui/material/Button"),s=require("@mui/material/ButtonBase"),a=require("@mui/material/Divider"),d=require("@mui/material/Paper"),l=require("@mui/material/Radio"),u=require("@mui/material/Stack"),c=require("@mui/material/TextField"),f=require("@mui/material/Typography"),x=require("./BoundaryCard.js"),m=require("../../assests/icons/InfoAlert.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=g(n),h=g(r),_=g(o),b=g(s),E=g(a),v=g(d),C=g(l),j=g(u),F=g(c),y=g(f),A="MERGE_ADJACENT",S=function(e){return(null==e?void 0:e.additional_decisions)?Array.from(new Set(Object.values(e.additional_decisions).flat())).filter(function(e){return Object.values(x.BoundaryReviewActionEnum).includes(e)}):[]};exports.default=function(n){var r=n.metadata,o=n.reviewAction,s=n.startPage,a=n.endPage,d=n.title,l=void 0===d?"this document":d,u=n.previousSegmentTitle,c=n.nextSegmentTitle,f=n.disabled,g=void 0!==f&&f,R=n.onConfirm,w=t.useMemo(function(){return S(o)},[o]),B=t.useMemo(function(){return function(e,i,t,n){var r=i.focus_page,o=null!=r&&r===t,s=null!=r&&(r===n||r===n+1),a=[];if(e.some(function(e){return e.includes("MERGE")})&&a.push(t===n||!o&&!s?{id:A,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}:o?{id:x.BoundaryReviewActionEnum.MERGE_PREVIOUS,title:"Merge with previous document",description:"Combine this document with the previous document."}:{id:x.BoundaryReviewActionEnum.MERGE_NEXT,title:"Merge with next document",description:"Combine this document with the next document."}),e.includes(x.BoundaryReviewActionEnum.SPLIT_HERE)){var d=null!=r&&r>t&&r<n;a.push({id:x.BoundaryReviewActionEnum.SPLIT_HERE,title:"Split to a separate document",description:d?"Start a new document at page ".concat(r,"."):"A valid page inside the document is required to split it.",disabled:!d})}return a}(w,r,s,a)},[w,a,r,s]),M=t.useState(null),T=M[0],z=M[1],I=t.useState(null),q=I[0],G=I[1],P=t.useState(String(s)),W=P[0],D=P[1],N=t.useState(String(a)),k=N[0],H=N[1],O=t.useState(!1),U=O[0],V=O[1],X=t.useState(!1),L=X[0],J=X[1],$=w.includes(x.BoundaryReviewActionEnum.SET_RANGE);if(0===B.length&&!$)return null;var K=null==T?void 0:B[T],Q=(null==K?void 0:K.id)===A,Y=null!=u,Z=null!=c,ee=function(e){return!0===e.disabled||e.id===x.BoundaryReviewActionEnum.MERGE_PREV&&!Y||e.id===x.BoundaryReviewActionEnum.MERGE_PREVIOUS&&!Y||e.id===x.BoundaryReviewActionEnum.MERGE_NEXT&&!Z||e.id===A&&!Y&&!Z},ie=Number(W),te=Number(k),ne=""!==W.trim()&&""!==k.trim()&&Number.isInteger(ie)&&Number.isInteger(te)&&ie>0&&ie<=te,re=g||!K||ee(K)||Q&&null==q;return i.jsxs(j.default,e.__assign({spacing:.75},{children:[i.jsx(E.default,{}),i.jsx(y.default,e.__assign({sx:{color:"text.primary",fontSize:12,fontWeight:600}},{children:"Additional actions"})),i.jsx(j.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Additional boundary actions"},{children:B.map(function(t,n){var r=T===n,o=ee(t);return i.jsxs(v.default,e.__assign({variant:"outlined",sx:{borderColor:r?"#7F56D9":"divider",borderRadius:2,bgcolor:o?"#F8FAFC":"background.paper",overflow:"hidden"}},{children:[i.jsxs(b.default,e.__assign({role:"radio","aria-checked":r,disabled:g||o,onClick:function(){z(n),t.id!==A&&G(null)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(C.default,{checked:r,disabled:g||o,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),i.jsxs(h.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(y.default,e.__assign({sx:{color:o?"#94A3B8":"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(y.default,e.__assign({sx:{mt:.125,color:o?"#94A3B8":"text.secondary",fontSize:11}},{children:t.description}))]}))]})),r&&Q&&i.jsx(j.default,e.__assign({direction:"row",spacing:.75,sx:{px:.75,pb:.75}},{children:[["previous",null!=u?u:"No previous document",Y],["next",null!=c?c:"No next document",Z]].map(function(t){var n=t[0],r=t[1],o=t[2];return i.jsx(b.default,e.__assign({disabled:g||!o,onClick:function(){return G(n)},"aria-pressed":q===n,sx:{flex:1,minWidth:0,minHeight:42,alignItems:"flex-start",justifyContent:"flex-start",p:.625,border:"1px solid",borderColor:q===n?"#7F56D9":"#D0D5DD",borderRadius:1.5,color:o?"text.primary":"#98A2B3",textAlign:"left"}},{children:i.jsx(y.default,e.__assign({sx:{color:"inherit",fontSize:11,fontWeight:500,overflowWrap:"anywhere"}},{children:r}))}),n)})}))]}),t.id)})})),i.jsx(_.default,e.__assign({variant:"contained",fullWidth:!0,disabled:re,onClick:function(){if(!re&&K&&null!=T){var i=Q?"previous"===q?x.BoundaryReviewActionEnum.MERGE_PREVIOUS:x.BoundaryReviewActionEnum.MERGE_NEXT:K.id;R(i,{selectedIndex:T,option:e.__assign(e.__assign({},K),{id:i}),metadata:r})}},sx:{minHeight:32,borderRadius:2,bgcolor:"#5925DC",fontSize:13,fontWeight:600,textTransform:"none","&:hover":{bgcolor:"#4A1FB8"}}},{children:"Confirm"})),$&&i.jsxs(j.default,e.__assign({spacing:.625},{children:[i.jsxs(b.default,e.__assign({disabled:g,onClick:function(){var e=!U;V(e),J(!1),e&&(z(null),G(null))},"aria-expanded":U,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[i.jsx(y.default,e.__assign({sx:{color:"text.primary",fontSize:12,fontWeight:600}},{children:"Set a custom boundary"})),i.jsx(p.default,{sx:{color:"text.secondary",fontSize:16,transform:U?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),U&&!L&&i.jsxs(h.default,e.__assign({sx:{pt:.5,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[i.jsxs(h.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[i.jsx(y.default,e.__assign({sx:{fontSize:"10.5px",lineHeight:"14px",color:"#57697E"}},{children:"Starts"})),i.jsx(y.default,e.__assign({sx:{fontSize:"10.5px",lineHeight:"14px",color:"#57697E"}},{children:"Ends"}))]})),i.jsx(h.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[[W,D],[k,H]].map(function(e,t){var n=e[0],r=e[1];return i.jsx(F.default,{size:"small",type:"text",value:n,disabled:g,error:1===t&&""!==W.trim()&&""!==k.trim()&&ie>te,onChange:function(e){return/^\d*$/.test(e.target.value)&&r(e.target.value)},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiOutlinedInput-root":{height:"30px",bgcolor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderRadius:"6px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{height:"30px",p:"0 10px",color:"#34445A",fontSize:"12px"}}},0===t?"starts":"ends")})})),i.jsx(_.default,e.__assign({onClick:function(){return J(!0)},disabled:g||!ne,sx:{height:"30px",px:"12px",bgcolor:"#FFFFFF",border:"1px solid #8E80F3",borderRadius:"6px",color:"#4A24CF",fontSize:"12px",fontWeight:600,textTransform:"none","&:hover":{bgcolor:"#FAF9FF",borderColor:"#7F6FF0"},"&.Mui-disabled":{bgcolor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE"}}},{children:"Apply"})),i.jsx(h.default,{sx:{width:"100%",height:"1px",mt:"8px",bgcolor:"#EEF0F2"}})]})),U&&L&&i.jsxs(j.default,e.__assign({spacing:.75,sx:{p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"}},{children:[i.jsxs(j.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(m.default,{color:"warning",height:14,width:14}),i.jsx(y.default,e.__assign({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),i.jsxs(y.default,e.__assign({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",ie,"-",te," will become part of ",l,", including pages from other documents in this range."]})),i.jsxs(j.default,e.__assign({direction:"row",spacing:.75},{children:[i.jsx(_.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:function(){return J(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),i.jsx(_.default,e.__assign({variant:"contained",fullWidth:!0,disabled:g,onClick:function(){if(!g&&ne){var e={id:x.BoundaryReviewActionEnum.SET_RANGE,title:"Set a custom boundary"};R(x.BoundaryReviewActionEnum.SET_RANGE,{selectedIndex:-1,option:e,metadata:r,startPage:ie,endPage:te})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]}))]}))},exports.getAdditionalBoundaryActions=S;
2
+ //# sourceMappingURL=ReviewedBoundaryActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewedBoundaryActions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("@mui/icons-material/ChevronRight"),t=require("@mui/icons-material/Close"),s=require("@mui/material/Box"),n=require("@mui/material/ButtonBase"),a=require("@mui/material/Divider"),o=require("@mui/material/IconButton"),l=require("@mui/material/Paper"),d=require("@mui/material/Stack"),c=require("@mui/material/Typography"),u=require("../../assests/icons/InfoAlert.js"),x=require("./CognitiveIcon.js"),f=require("./CognitiveScoreBadge.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=h(r),m=h(t),p=h(s),v=h(n),_=h(a),j=h(o),w=h(l),y=h(d),b=h(c),C=function(i,r){return e.__spreadArray([i],Array.isArray(r)?r:null==r?[]:[r],!0)};exports.default=function(r){var t=r.headerName,s=void 0===t?"Reviewed":t,n=r.headerIcon,a=r.title,o=r.pageNo,l=r.summary,d=r.additionalActions,c=r.cognitiveScore,h=r.onCognitiveClick,q=r.onClose,W=r.cognitiveLabel,S=void 0===W?"Cognitive Integrity":W,I=r.showCognitiveIntegrity,A=void 0===I||I,k=r.showCloseButton,z=void 0===k||k,B=r.width,N=void 0===B?260:B,R=r.maxWidth,D=void 0===R?260:R,F=r.className,M=r.styles;return i.jsxs(w.default,e.__assign({className:F,elevation:4,sx:C({width:N,maxWidth:"min(".concat(D,"number"==typeof D?"px, 100%)":", 100%)"),minWidth:0,flexShrink:1,borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.16)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==M?void 0:M.root)},{children:[i.jsxs(y.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:C({minWidth:0,px:1.25,py:1,bgcolor:"#ECFDF5",color:"#16A34A"},null==M?void 0:M.header)},{children:[null!=n?n:i.jsx(u.default,{color:"success",height:16,width:16}),i.jsx(b.default,e.__assign({sx:{flex:1,minWidth:0,color:"inherit",fontSize:13,fontWeight:500,lineHeight:1.25,textTransform:"uppercase",overflowWrap:"anywhere"}},{children:s})),z&&i.jsx(j.default,e.__assign({size:"small",onClick:q,disabled:!q,"aria-label":"Close reviewed card",sx:{p:0,color:"#475569","&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(m.default,{sx:{fontSize:17}})}))]})),i.jsxs(y.default,e.__assign({spacing:.875,sx:{px:1.25,pt:1.25,pb:1}},{children:[i.jsxs(p.default,{children:[i.jsx(b.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500,overflowWrap:"anywhere"}},{children:a})),null!=o&&i.jsx(b.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:o}))]}),null!=l&&i.jsx(y.default,e.__assign({sx:null==M?void 0:M.content},{children:l})),null!=d&&i.jsx(y.default,{children:d}),A&&i.jsxs(y.default,e.__assign({spacing:.625,sx:null==M?void 0:M.footer},{children:[i.jsx(_.default,{}),i.jsxs(v.default,e.__assign({onClick:h,disabled:!h,sx:{width:"100%",minWidth:0,justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:h?"pointer":"not-allowed"}},{children:[i.jsxs(y.default,e.__assign({direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,flex:1}},{children:[i.jsx(x.default,{sx:{color:"text.secondary"}}),i.jsx(b.default,e.__assign({sx:{minWidth:0,color:"text.primary",fontSize:12,overflowWrap:"anywhere"}},{children:S}))]})),i.jsxs(y.default,e.__assign({direction:"row",alignItems:"center",spacing:.5,sx:{flexShrink:0}},{children:[i.jsx(f.default,{score:c}),i.jsx(g.default,{sx:{color:"text.secondary"}})]}))]}))]}))]}))]}))};
2
+ //# sourceMappingURL=ReviewedCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewedCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n,t=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),o=require("@react-pdf-viewer/core"),a=require("../PdfViewer/PdfViewer.js"),l=require("./BoundaryCard.js"),u=require("./CardWrapper.js"),d=require("./CognitiveIntegrity.js"),s=require("./LabelCheck.js"),g=require("./PageCheck.js"),c=require("./reviewStepAdapters.js"),v=require("lucide-react"),m=require("@mui/material"),p=require("./ReviewedCard.js"),f=require("./ReviewedBoundaryActions.js"),w=require("./RevertCard.js"),_=require("./RevertSuccessCard.js"),h=require("./helper.js"),y=require("./ChartBreakoutCircle.js"),b=260;exports.SegmentPdfSpecialZoomLevel=void 0,(n=exports.SegmentPdfSpecialZoomLevel||(exports.SegmentPdfSpecialZoomLevel={})).ActualSize="ActualSize",n.PageFit="PageFit",n.PageWidth="PageWidth";var S=((e={})[exports.SegmentPdfSpecialZoomLevel.ActualSize]=o.SpecialZoomLevel.ActualSize,e[exports.SegmentPdfSpecialZoomLevel.PageFit]=o.SpecialZoomLevel.PageFit,e[exports.SegmentPdfSpecialZoomLevel.PageWidth]=o.SpecialZoomLevel.PageWidth,e),x=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};exports.default=function(e){var n,R,E,C,P,k,A,M,I,j,B,N,L,F,T,q,K,W,z,G,O,D,V,H,U,Z,X,Y,J,Q,$,ee,ne,te,ie=this,re=e.pdfUrl,oe=e.pdfName,ae=e.segments,le=e.totalPages,ue=e.styles,de=e.pdfViewerProps,se=e.specialZoomLevel,ge=e.showBadges,ce=void 0===ge||ge,ve=e.sortByConfidence,me=void 0===ve?"low":ve,pe=e.filterByConfidence,fe=void 0===pe?"all":pe,we=e.showBadgeNavigation,_e=void 0===we||we,he=e.autoSelectReviewOnPageChange,ye=void 0!==he&&he,be=e.autoAdvanceAfterConfirm,Se=void 0===be||be,xe=e.autoAdvanceScoreBand,Re=e.badgePreloadPages,Ee=void 0===Re?8:Re,Ce=e.badgeOffsetTop,Pe=void 0===Ce?20:Ce,ke=e.badgeOffsetRight,Ae=void 0===ke?68:ke,Me=e.badgeOffsetLeft,Ie=void 0===Me?0:Me,je=e.initialReviewId,Be=e.manualPrompt,Ne=e.heightBuffer,Le=e.onBoundaryAction,Fe=e.onLabelAction,Te=e.onPageAction,qe=e.onPageTypeRevert,Ke=e.onRevert,We=e.onActiveReviewChange,ze=e.onCurrentPageChange,Ge=e.onActionError,Oe=e.disableAllActions,De=void 0!==Oe&&Oe,Ve=e.disablePdfAnnotations,He=void 0!==Ve&&Ve,Ue=e.disablePdfTextLayer,Ze=void 0===Ue||Ue,Xe=e.disableTitleCheckUntilBoundaryCheckCompleted,Ye=void 0!==Xe&&Xe,Je=e.onAdjustManually,Qe=e.onCognitiveClick,$e=e.className,en=e.style,nn=e.viewerStyle,tn=e.railStyle,rn=e.redirectionData,on=e.onBadgeSelected,an=r.useMemo(function(){return c.extractSegmentReviewData(ae)},[ae]),ln=an.boundaryReviews,un=an.labelReviews,dn=an.pageReviews,sn=r.useState(function(){return new Map}),gn=sn[0],cn=sn[1],vn=r.useState(function(){return new Set}),mn=vn[0],pn=vn[1],fn=r.useMemo(function(){var e=new Map,n=1;return ae.forEach(function(t,i){var r=c.getSegmentReviewKey(t,i);e.has(r)||(e.set(r,n),n+=1)}),e},[ae]),wn=r.useMemo(function(){return new Set(un.map(function(e){return c.getSegmentReviewKey(e.segment)}))},[un]),_n=r.useMemo(function(){return h.getPendingMergeImpactedSegmentKeys(ae)},[ae]);r.useEffect(function(){cn(function(e){var n=!1,t=new Map(e);return e.forEach(function(e,i){var r=ae.find(function(e){return c.getSegmentReviewKey(e)===i});r&&!h.hasPolledStructuralAction(r,e)||(t.delete(i),n=!0)}),n?t:e})},[ae]),r.useEffect(function(){pn(function(e){var n=!1,t=new Set(e);return e.forEach(function(e){gn.has(e)||(t.delete(e),n=!0)}),n?t:e})},[gn]);var hn=r.useMemo(function(){return h.getOptimisticMergeImpactedSegmentKeys(ae,gn,mn)},[mn,gn,ae]),yn=r.useRef(null),bn=r.useMemo(function(){return t.__spreadArray(t.__spreadArray(t.__spreadArray([],ln.filter(function(e){return!_n.has(c.getSegmentReviewKey(e.segment))&&!hn.has(c.getSegmentReviewKey(e.segment))&&!h.shouldHideStructuralBoundaryReview(e.review_step,e.segment,wn.has(c.getSegmentReviewKey(e.segment)),gn.get(c.getSegmentReviewKey(e.segment)))}).map(function(e){var n;return t.__assign(t.__assign({},e),{kind:"boundary",pageNumber:null!==(n=e.metadata.focus_page)&&void 0!==n?n:e.segment.start_page})}),!0),un.filter(function(e){return!_n.has(c.getSegmentReviewKey(e.segment))&&!hn.has(c.getSegmentReviewKey(e.segment))}).map(function(e){return t.__assign(t.__assign({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0),dn.filter(function(e){return!_n.has(c.getSegmentReviewKey(e.segment))&&!hn.has(c.getSegmentReviewKey(e.segment))}).map(function(e){var n;return t.__assign(t.__assign({},e),{kind:"page",pageNumber:null!==(n=e.metadata.page_num)&&void 0!==n?n:e.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=fn.get(c.getSegmentReviewKey(e.segment)))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=fn.get(c.getSegmentReviewKey(n.segment)))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-o||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[ln,un,dn,hn,gn,_n,fn,wn]),Sn=r.useMemo(function(){return ae.map(function(e){var n,i;return t.__assign(t.__assign({},e),{title:(null===(n=e.label)||void 0===n?void 0:n.trim())||e.title,page_count:null!==(i=e.page_count)&&void 0!==i?i:e.end_page-e.start_page+1})})},[ae]),xn=r.useState(1),Rn=xn[0],En=xn[1],Cn=r.useState(null!=je?je:null),Pn=Cn[0],kn=Cn[1],An=r.useState(null!=je?je:null),Mn=An[0],In=An[1],jn=r.useState(!1),Bn=jn[0],Nn=jn[1],Ln=r.useState(null),Fn=Ln[0],Tn=Ln[1],qn=r.useState(null),Kn=qn[0],Wn=qn[1],zn=r.useState(function(){return new Set}),Gn=zn[0],On=zn[1],Dn=r.useState(null),Vn=Dn[0],Hn=Dn[1],Un=r.useState(null),Zn=Un[0],Xn=Un[1],Yn=r.useState(null),Jn=Yn[0],Qn=Yn[1],$n=r.useState(!1),et=$n[0],nt=$n[1],tt=r.useRef(0),it=r.useRef(null),rt=r.useRef(null),ot=r.useRef(new Map),at=r.useRef(null),lt=r.useRef(null),ut=r.useRef(null),dt=r.useState(b),st=dt[0],gt=dt[1],ct=null!==(R=null===(n=null==ue?void 0:ue.aside)||void 0===n?void 0:n.width)&&void 0!==R?R:"40%",vt="min(".concat("number"==typeof ct?"".concat(ct,"px"):ct,", ").concat(b,"px, 100%)");r.useEffect(function(){On(function(e){if(0===e.size)return e;var n=new Set(e),t=!1;return bn.forEach(function(e){var i;null!=(null===(i=e.review_step.review)||void 0===i?void 0:i.action)&&n.has(e.id)&&(n.delete(e.id),t=!0)}),t?n:e})},[bn]),r.useEffect(function(){var e=yn.current;if(e&&ce){var n=function(){var n=e.getBoundingClientRect().width;n>0&&gt(n)};n();var t="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==t||t.observe(e),function(){return null==t?void 0:t.disconnect()}}},[ce]);var mt=r.useMemo(function(){var e=new Set;return bn.forEach(function(n){var t;null!=(null===(t=n.review_step.review)||void 0===t?void 0:t.action)&&e.add(n.id)}),e},[bn]),pt=r.useMemo(function(){var e;return null!==(e=bn.find(function(e){return e.id===Pn}))&&void 0!==e?e:null},[Pn,bn]),ft=r.useMemo(function(){return!(!Ye||"label"!==(null==pt?void 0:pt.kind))&&ln.some(function(e){if(c.getSegmentReviewKey(e.segment)!==c.getSegmentReviewKey(pt.segment)||mt.has(e.id))return!1;var n=h.getResolvedScore(e.review_step.score,e.review_step.confidence);return null==n||n<85})},[pt,ln,Ye,mt]),wt=null==pt?-1:ae.findIndex(function(e){return c.getSegmentReviewKey(e)===c.getSegmentReviewKey(pt.segment)}),_t=wt>0?ae[wt-1]:void 0,ht=wt>=0?ae[wt+1]:void 0,yt=(null===(E=null==_t?void 0:_t.label)||void 0===E?void 0:E.trim())||(null==_t?void 0:_t.title),bt=(null===(C=null==ht?void 0:ht.label)||void 0===C?void 0:C.trim())||(null==ht?void 0:ht.title),St=h.getConfidenceColors(null==pt?void 0:pt.review_step.score,null==pt?void 0:pt.review_step.confidence,null===(P=null==pt?void 0:pt.segment.confidence)||void 0===P?void 0:P.awaiting_llm),xt=(null===(k=null==pt?void 0:pt.review_step.reasons)||void 0===k?void 0:k.length)?pt.review_step.reasons:null!==(M=null===(A=null==pt?void 0:pt.segment.confidence)||void 0===A?void 0:A.reasons)&&void 0!==M?M:[],Rt=Boolean(xt.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(I=null==pt?void 0:pt.review_step.reason)||void 0===I?void 0:I.trim())||(null===(j=null==pt?void 0:pt.review_step.gap)||void 0===j?void 0:j.trim())),Et=null==pt?null:"boundary"===pt.kind?h.getBoundaryReviewActionBadgeLabel(pt.review_step,pt.segment,gn.get(null!==(B=pt.segment.stable_key)&&void 0!==B?B:"")):h.getTitleReviewActionBadgeLabel(pt.review_step,pt.segment,gn.get(null!==(N=pt.segment.stable_key)&&void 0!==N?N:"")),Ct="label"===(null==pt?void 0:pt.kind)?[Et,pt.review_step.human_action_enum,null===(L=pt.review_step.review)||void 0===L?void 0:L.action,null===(F=pt.review_step.human_resolution)||void 0===F?void 0:F.action]:[],Pt="label"===(null==pt?void 0:pt.kind)&&Ct.some(function(e){var n,t=null!==(n=null==e?void 0:e.trim().toUpperCase())&&void 0!==n?n:"";return t.includes("MERGE")||t.includes("SPLIT")}),kt=null!=pt&&bn.some(function(e){return"boundary"===e.kind&&c.getSegmentReviewKey(e.segment)===c.getSegmentReviewKey(pt.segment)}),At=Pt&&!kt,Mt=("boundary"===(null==pt?void 0:pt.kind)||At)&&null!=pt?function(){var e,n,i,r,o,a;if("boundary"===pt.kind)return pt;var l=ln.find(function(e){return c.getSegmentReviewKey(e.segment)===c.getSegmentReviewKey(pt.segment)});return l?t.__assign(t.__assign({},l),{kind:"boundary",pageNumber:null!==(e=l.metadata.focus_page)&&void 0!==e?e:l.segment.start_page}):t.__assign(t.__assign({},pt),{kind:"boundary",pageNumber:null!==(i=null===(n=pt.segment.review_action)||void 0===n?void 0:n.focus_page)&&void 0!==i?i:pt.segment.start_page,metadata:{focus_page:null!==(o=null===(r=pt.segment.review_action)||void 0===r?void 0:r.focus_page)&&void 0!==o?o:null,boundary_margin:null!==(a=pt.segment.boundary_margin)&&void 0!==a?a:null,user_actions:[]}})}():void 0,It=null==pt?"":(null===(T=pt.segment.label)||void 0===T?void 0:T.trim())||pt.segment.title,jt=null==pt?void 0:pt.review_step.revert,Bt=null==pt?void 0:pt.segment.revert,Nt=function(e){return null==e?void 0:e.trim().toLowerCase()},Lt=null==pt||null===(K=t.__spreadArray([],null!==(q=pt.segment.review_steps)&&void 0!==q?q:[],!0).reverse().find(function(e){var n,t,i=null===(n=e.type)||void 0===n?void 0:n.trim().toLowerCase();return("page_boundary"===i||"page boundary review"===i)&&"boundary"===Nt(null===(t=e.revert)||void 0===t?void 0:t.type)}))||void 0===K?void 0:K.revert,Ft=null!==(W=null!=jt?jt:null==pt?void 0:pt.segment.revert)&&void 0!==W?W:Lt,Tt=null==Ft?void 0:Ft.decision.trim().toUpperCase(),qt=null!=Et?Et:(null==Tt?void 0:Tt.includes("SPLIT"))?"Split":(null==Tt?void 0:Tt.includes("MERGE"))?"Merged":null,Kt="label"===(null==pt?void 0:pt.kind)&&"SET_RANGE"===(null===(z=null==Lt?void 0:Lt.decision)||void 0===z?void 0:z.trim().toUpperCase())&&Lt.current_segment_ids.length!==Lt.previous_state.length,Wt="Merged"===Et||"Split"===Et||Kt,zt=null==pt?void 0:Wt?"boundary"===Nt(null==Lt?void 0:Lt.type)?Lt:"boundary"===Nt(null==Bt?void 0:Bt.type)?Bt:"boundary"===Nt(null==jt?void 0:jt.type)?jt:void 0:"label"===pt.kind?"label"===Nt(null==jt?void 0:jt.type)?jt:void 0:"boundary"===pt.kind?"boundary"===Nt(null==jt?void 0:jt.type)?jt:"boundary"===Nt(null==Lt?void 0:Lt.type)?Lt:"boundary"===Nt(null==Bt?void 0:Bt.type)?Bt:void 0:void 0,Gt=Wt&&(null==zt?void 0:zt.operation_id)?ae.flatMap(function(e){var n;return null!==(n=e.review_steps)&&void 0!==n?n:[]}).find(function(e){var n,t,i,r,o,a,l,u=null===(n=e.type)||void 0===n?void 0:n.trim().toLowerCase();return("page_boundary"===u||"page boundary review"===u)&&((null!==(o=null!==(i=null===(t=e.human_resolution)||void 0===t?void 0:t.operation_id)&&void 0!==i?i:null===(r=e.revert)||void 0===r?void 0:r.operation_id)&&void 0!==o?o:e.operation_id)===zt.operation_id&&Boolean(null===(l=null===(a=e.human_resolution)||void 0===a?void 0:a.change_summary)||void 0===l?void 0:l.trim()))}):void 0,Ot=(null===(G=null==zt?void 0:zt.summary)||void 0===G?void 0:G.trim())||null,Dt=Wt?(null===(D=null===(O=null==Gt?void 0:Gt.human_resolution)||void 0===O?void 0:O.change_summary)||void 0===D?void 0:D.trim())||(null===(V=null==zt?void 0:zt.summary)||void 0===V?void 0:V.trim())||"":(null===(Z=null===(U=null===(H=null==pt?void 0:pt.review_step)||void 0===H?void 0:H.human_resolution)||void 0===U?void 0:U.change_summary)||void 0===Z?void 0:Z.trim())||(null===(Y=null===(X=null==pt?void 0:pt.review_step)||void 0===X?void 0:X.summary)||void 0===Y?void 0:Y.trim())||"",Vt=null==pt?null:zt?{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:zt.previous_state.map(function(e){var n,t;return{title:(null===(n=e.label)||void 0===n?void 0:n.trim())||(null===(t=e.title)||void 0===t?void 0:t.trim())||"Untitled document",startPage:e.start_page,endPage:e.end_page}})}:"Split"===qt?{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page}]}:"Merged"===qt?{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:"Request for proposal (RFP)",startPage:26,endPage:76}]}:{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:[]},Ht="page"===(null==pt?void 0:pt.kind)&&null!==(J=pt.metadata.classification_id)&&void 0!==J?J:null,Ut="page"===(null==pt?void 0:pt.kind)?Boolean(qe&&Ht):Boolean((null==zt?void 0:zt.operation_id)&&(null==zt?void 0:zt.type)&&!1!==(null==zt?void 0:zt.revertable));Boolean(Vt&&Ut&&("page"!==(null==pt?void 0:pt.kind)||Ht));var Zt=r.useCallback(function(e,n){tt.current+=1,it.current={requestId:tt.current,pageNumber:e,reviewId:n},Wn({pageNumber:e,requestId:tt.current})},[]),Xt=r.useCallback(function(e){var n,t;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(null==on||on({reviewId:e.id,segment_id:null!==(t=e.segment.segment_id)&&void 0!==t?t:null,reviewStepIndex:e.reviewStepIndex,kind:e.kind,pageNumber:e.pageNumber,metadata:e.metadata}),Xn(null),Qn(null),kn(e.id),In(e.id),Nn(!1),Tn(null),Zt(e.pageNumber,e.id),null==We||We(e.id,e.segment))},[We,on,Zt]);r.useEffect(function(){if(Jn){var e=requestAnimationFrame(function(){return nt(!0)}),n=window.setTimeout(function(){nt(!1)},3500),t=window.setTimeout(function(){Qn(null)},4e3);return function(){cancelAnimationFrame(e),window.clearTimeout(n),window.clearTimeout(t)}}},[Jn]),r.useEffect(function(){var e,n,t,i;if(rn){if("pageGroup"===rn.type){var r=null!==(e=rn.pages)&&void 0!==e?e:[],o=null!==(n=rn.pageIndex)&&void 0!==n?n:0,a=r[o];if(null==a)return;return Yt(),Xn({pages:r,index:o,label:null!==(t=rn.groupLabel)&&void 0!==t?t:""}),tt.current+=1,void Wn({pageNumber:a,requestId:tt.current})}if(Xn(null),rn.reviewId){var l=bn.find(function(e){return e.id===rn.reviewId&&(!rn.type||e.kind===rn.type)});if(l)return void Xt(l)}if(rn.classificationId){var u=bn.find(function(e){return!("page"!==e.kind||e.metadata.classification_id!==rn.classificationId||rn.segmentId&&e.segment.segment_id!==rn.segmentId||rn.type&&e.kind!==rn.type)});if(u)return void Xt(u)}if(rn.pageNumber&&rn.type){var d=Number(rn.pageNumber);if(Number.isInteger(d)&&!(d<1)){var s=null===(i=rn.pageType)||void 0===i?void 0:i.trim().toLowerCase(),g=bn.find(function(e){var n="page"===e.kind?e.pageNumber:e.segment.start_page,t="page"!==e.kind||!s||e.metadata.page_type===s;return(!rn.segmentId||e.segment.segment_id===rn.segmentId)&&n===d&&e.kind===rn.type&&t});g?Xt(g):"page"===rn.type&&(Yt(),tt.current+=1,Wn({pageNumber:d,requestId:tt.current}))}}}},[rn,Xt,bn]);var Yt=r.useCallback(function(){it.current=null,Nn(!1),kn(null),Tn(null),null==We||We(null,null)},[We]),Jt=r.useCallback(function(e){var n;nt(!1),Qn(null);var t=null!==(n=bn.find(function(n){return!mt.has(n.id)&&"boundary"===n.kind&&n.segment.start_page===e.startPage&&n.segment.end_page===e.endPage}))&&void 0!==n?n:bn.find(function(n){return!mt.has(n.id)&&n.segment.start_page<=e.startPage&&n.segment.end_page>=e.startPage});t?Xt(t):(Yt(),tt.current+=1,Wn({pageNumber:e.startPage,requestId:tt.current}))},[Yt,mt,bn,Xt]),Qt=r.useCallback(function(e,n){var t,i=h.getReviewScoreBand(e.review_step.score),r=null==xe||i===xe,o=Gn.has(e.id)&&h.isReviewStepResolutionCurrent(e.review_step,e.segment);return e.id!==n&&r&&!0!==(null===(t=e.segment.confidence)||void 0===t?void 0:t.awaiting_llm)&&!h.isReviewStepResolved(e.review_step,e.segment)&&!o},[xe,Gn]),$t=r.useCallback(function(e){var n;if(Se){var t=bn.findIndex(function(n){return n.id===e}),i=null!==(n=bn.find(function(n,i){return i>t&&Qt(n,e)}))&&void 0!==n?n:bn.find(function(n){return Qt(n,e)});i?requestAnimationFrame(function(){return Xt(i)}):Yt()}else Yt()},[Se,Yt,Qt,bn,Xt]),ei=r.useCallback(function(e,n,i){return t.__awaiter(ie,void 0,void 0,function(){var r,o,a,u,d,s,g,v,m,p;return t.__generator(this,function(t){switch(t.label){case 0:if(De)return[2];if("boundary"===e.kind&&!Le)return[2];if("label"===e.kind&&!Fe)return[2];if("page"===e.kind&&!Te)return[2];r=x(e),a=i,u=(o=n)===l.BoundaryReviewActionEnum.SET_RANGE?function(){var n=a.startPage,t=a.endPage;if(null==n||null==t)return null;var i=n<e.segment.start_page||t>e.segment.end_page,r=n>e.segment.start_page||t<e.segment.end_page;return i&&!r?n<e.segment.start_page?l.BoundaryReviewActionEnum.MERGE_PREV:l.BoundaryReviewActionEnum.MERGE_NEXT:r?l.BoundaryReviewActionEnum.SPLIT_HERE:null}():o,d="boundary"===e.kind&&null!=Le&&Se&&(u===l.BoundaryReviewActionEnum.SPLIT_HERE||u===l.BoundaryReviewActionEnum.MERGE_NEXT||u===l.BoundaryReviewActionEnum.MERGE_PREV||u===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),s=d?ae.findIndex(function(n){return c.getSegmentReviewKey(n)===c.getSegmentReviewKey(e.segment)}):-1,d&&s>=0&&u&&(rt.current={action:u,originalSegmentIndex:s,segmentSignature:JSON.stringify(ae.map(function(e,n){var t;return{key:c.getSegmentReviewKey(e,n),startPage:e.start_page,endPage:e.end_page,version:null!==(t=e.version)&&void 0!==t?t:null}})),ready:!1}),Hn(e.id),t.label=1;case 1:return t.trys.push([1,8,9,10]),"boundary"!==e.kind?[3,3]:[4,null==Le?void 0:Le(n,i,r)];case 2:return t.sent(),[3,7];case 3:return"label"!==e.kind?[3,5]:[4,null==Fe?void 0:Fe(n,i,r)];case 4:return t.sent(),[3,7];case 5:return"page"!==e.kind?[3,7]:[4,null==Te?void 0:Te(n,i,r)];case 6:t.sent(),t.label=7;case 7:return On(function(n){var t=new Set(n);return t.add(e.id),t}),g="boundary"===e.kind&&(u===l.BoundaryReviewActionEnum.MERGE_NEXT||u===l.BoundaryReviewActionEnum.MERGE_PREV||u===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),("boundary"===e.kind&&u===l.BoundaryReviewActionEnum.SPLIT_HERE||g)&&u&&(v=c.getSegmentReviewKey(e.segment),pn(function(e){var n=new Set(e);return o===l.BoundaryReviewActionEnum.SET_RANGE?n.add(v):n.delete(v),n}),cn(function(e){var n=new Map(e);return n.set(v,u),n})),rt.current?(rt.current.ready=!0,g&&(m=bn.find(function(n){return"label"===n.kind&&c.getSegmentReviewKey(n.segment)===c.getSegmentReviewKey(e.segment)}))&&requestAnimationFrame(function(){return Xt(m)})):$t(e.id),[3,10];case 8:return p=t.sent(),d&&(rt.current=null),null==Ge||Ge(p,r),[3,10];case 9:return Hn(null),[7];case 10:return[2]}})})},[Se,De,Ge,Le,Fe,Te,qe,bn,ae,Xt,$t]);r.useEffect(function(){var e=rt.current;if(null==e?void 0:e.ready){var n=JSON.stringify(ae.map(function(e,n){var t;return{key:c.getSegmentReviewKey(e,n),startPage:e.start_page,endPage:e.end_page,version:null!==(t=e.version)&&void 0!==t?t:null}}));if(n!==e.segmentSignature){var t=e.action===l.BoundaryReviewActionEnum.SPLIT_HERE?e.originalSegmentIndex+1:e.action===l.BoundaryReviewActionEnum.MERGE_PREV||e.action===l.BoundaryReviewActionEnum.MERGE_PREVIOUS?Math.max(0,e.originalSegmentIndex-1):e.originalSegmentIndex,i=new Map(ae.map(function(e,n){return[c.getSegmentReviewKey(e,n),n]})),r=bn.find(function(e){var n=i.get(c.getSegmentReviewKey(e.segment));return null!=n&&n>=t&&Qt(e)});if(!r)return rt.current=null,void Yt();requestAnimationFrame(function(){rt.current=null,Xt(r)})}}},[Yt,Qt,bn,ae,Xt]),r.useEffect(function(){rt.current||Pn&&!bn.some(function(e){return e.id===Pn})&&Yt()},[Pn,Yt,bn]),r.useEffect(function(){if(ye&&!rt.current){var e=bn.find(function(e){return e.pageNumber===Rn});e&&e.id!==Pn&&Xt(e)}},[Pn,ye,Rn,Xt,bn]),r.useEffect(function(){rt.current||Pn&&!bn.some(function(e){var n;return e.id===Pn&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&Yt()},[Pn,Yt,bn]);var ni=r.useMemo(function(){var e=bn.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===fe)return e;var n=["low","medium","high"].filter(function(e){return e!==me}),i=t.__spreadArray([me],n,!0),r=new Map(i.map(function(e,n){return[e,n]}));return e.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,a,l,u=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),d=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==u?i.length:null!==(a=r.get(u))&&void 0!==a?a:i.length)-(null==d?i.length:null!==(l=r.get(d))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[fe,me,bn]),ti=ni.findIndex(function(e){return e.id===Mn}),ii=r.useState(null),ri=ii[0],oi=ii[1],ai=r.useRef(!1),li=r.useCallback(function(e){var n=ni[e];n&&Xt(n)},[ni,Xt]);r.useCallback(function(e){if(!(!Zn||e<0||e>=Zn.pages.length)){var n=Zn.pages[e];null!=n&&(Yt(),Xn(function(n){return null==n?n:t.__assign(t.__assign({},n),{index:e})}),tt.current+=1,Wn({pageNumber:n,requestId:tt.current}))}},[Zn,Yt]),r.useEffect(function(){Mn&&!ni.some(function(e){return e.id===Mn})&&In(null)},[ni,Mn]),r.useEffect(function(){ai.current=!1,oi(ti>=0?String(ti+1):null)},[ti,ni.length]),r.useEffect(function(){if(ai.current&&null!=ri){var e=window.setTimeout(function(){var e=Number(ri.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<ni.length&&(ai.current=!1,li(n))},300);return function(){return window.clearTimeout(e)}}},[li,ri,ni.length]);var ui=r.useMemo(function(){var e=new Map;bn.forEach(function(n){var t,i=null!==(t=e.get(c.getSegmentReviewKey(n.segment)))&&void 0!==t?t:[];i.push(n),e.set(c.getSegmentReviewKey(n.segment),i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=fn.get(t))&&void 0!==i?i:1;e.sort(function(e,n){return e.reviewStepIndex-n.reviewStepIndex}).forEach(function(e,t){n.set(e.id,"".concat(r).concat(function(e){for(var n=e+1,t="";n>0;)n-=1,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}(t)))})}),n},[bn,fn]),di=r.useMemo(function(){var e=new Map;bn.forEach(function(n){var t,i=null!==(t=e.get(n.pageNumber))&&void 0!==t?t:[];i.push(n),e.set(n.pageNumber,i)});var n=new Map;return e.forEach(function(e){e.forEach(function(e,t){return n.set(e.id,t)})}),n},[bn]),si=r.useCallback(function(e){return{startPage:Math.max(0,e.startPage-Ee),endPage:Math.min(e.numPages-1,e.endPage+Ee)}},[Ee]),gi=r.useCallback(function(){var e,n=lt.current,t=ut.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),o=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();bn.forEach(function(e){var n,r=ot.current.get(e.id);if(r){var a=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(a){var l=a.getBoundingClientRect(),u=null!==(n=di.get(e.id))&&void 0!==n?n:0,d=l.top+Pe+40*u,s=d+(r.offsetHeight||32),g=d>=o.top&&s<=o.bottom;r.style.top="".concat(d-i.top,"px"),r.style.visibility=g?"visible":"hidden"}else r.style.visibility="hidden"}});var a=at.current;if(a){var l=null==Zn?void 0:Zn.pages[Zn.index],u=null==l?null:t.querySelector('[data-testid="core__page-layer-'.concat(l-1,'"]'));if(Zn&&u){var d=u.getBoundingClientRect().top+Pe,s=d+(a.offsetHeight||25),g=d>=o.top&&s<=o.bottom;a.style.top="".concat(d-i.top,"px"),a.style.visibility=g?"visible":"hidden"}else a.style.visibility="hidden"}if(Pn&&null==it.current){var c=ot.current.get(Pn);c&&"hidden"!==c.style.visibility&&Tn(function(e){return e===c?e:c})}}},[Zn,Pn,Pe,di,bn]),ci=r.useCallback(function(e){var n=it.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(it.current=null,gi(),requestAnimationFrame(function(){if(null==it.current){var e=ot.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Tn(e)}}))},[gi]);return r.useEffect(function(){var e=ut.current;if(e&&ce){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,gi()}))};e.addEventListener("scroll",t,!0),window.addEventListener("resize",t);var i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});var r="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==r||r.observe(e),t(),function(){null!=n&&cancelAnimationFrame(n),e.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t),i.disconnect(),null==r||r.disconnect()}}},[ce,gi]),i.jsxs("div",t.__assign({ref:lt,className:$e,style:t.__assign(t.__assign({},en),{display:"block",position:"relative",width:"100%",height:"100%",minWidth:0,overflowX:"auto",overflowY:"hidden"})},{children:[i.jsxs("div",t.__assign({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,width:"100%",minWidth:700,height:"100%"}},{children:[i.jsx("div",t.__assign({ref:ut,style:t.__assign(t.__assign({},nn),{flex:"1 1 auto",width:ce?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:i.jsx(a.default,t.__assign({highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1,showRotateButton:!0},de,{defaultScale:void 0===se?null!==(Q=null==de?void 0:de.defaultScale)&&void 0!==Q?Q:o.SpecialZoomLevel.PageFit:S[se],disablePdfAnnotations:He,disablePdfTextLayer:Ze,pdfUrl:re,pdfName:oe,segments:Sn,navigationRequest:Kn,onNavigationSettled:ci,setRenderRange:si,onCurrentPageChange:function(e){En(e),null==it.current&&pt&&pt.pageNumber!==e&&Yt(),null==ze||ze(e)}}))})),ce&&i.jsxs("aside",t.__assign({"aria-label":"Page review badges",ref:yn,style:t.__assign(t.__assign({},tn),{position:"relative",width:vt,maxWidth:b,flex:"0 1 ".concat(vt),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[Zn&&i.jsx("span",t.__assign({ref:at,style:{position:"absolute",top:0,left:10,visibility:"hidden",zIndex:2,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,minHeight:25,padding:"2px 8px",border:"1px solid #E2E8F0",borderRadius:16,backgroundColor:"#F8FAFC",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)",font:"inherit"}},{children:i.jsxs(m.Typography,t.__assign({fontFamily:"Inter",sx:{fontSize:11,fontWeight:500,color:"#475569",whiteSpace:"nowrap"}},{children:[Zn.label||"Pages"," Pg: ",Zn.index+1]}))})),_e&&ni.length>0&&!Zn&&i.jsxs("nav",t.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:Ae||"auto",left:Ie||"auto",zIndex:2,display:"flex",alignItems:"center",gap:7,width:128,minHeight:40,padding:"4px 6px",border:"1px solid #CBD5E1",borderRadius:6,backgroundColor:"#FFFFFF",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.06)",font:"inherit"}},{children:[i.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=ri?ri:"-","aria-label":"Review badge number",onChange:function(e){ai.current=!0,oi(e.target.value)},style:{width:30,height:28,padding:0,border:"1px solid #A5B4FC",borderRadius:3,color:"#4F46E5",backgroundColor:"#FFFFFF",textAlign:"center",font:"inherit",fontSize:15,outline:"none"}}),i.jsxs("span",t.__assign({"aria-label":"".concat(ni.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",ni.length]})),["previous","next"].map(function(e){var n="previous"===e,r=ti+(n?-1:1),o=r<0||r>=ni.length;return i.jsx("button",t.__assign({type:"button","aria-label":"".concat(n?"Previous":"Next"," review badge"),disabled:o,onClick:function(){return li(r)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:o?"#C7D2FE":"#4F46E5",cursor:o?"default":"pointer"}},{children:i.jsx("svg",t.__assign({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:i.jsx("path",{d:n?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),e)})]})),!Zn&&bn.map(function(e){var n,r,o=Pn===e.id,a=null!==(n=ui.get(e.id))&&void 0!==n?n:"1A",l=e.review_step.score,u=e.review_step.confidence,d=h.formatScore(l,u),s="boundary"===e.kind?h.getBoundaryReviewActionBadgeLabel(e.review_step,e.segment,gn.get(c.getSegmentReviewKey(e.segment))):"label"===e.kind?h.getTitleReviewActionBadgeLabel(e.review_step,e.segment,gn.get(c.getSegmentReviewKey(e.segment))):null,g=null!=s?s:"N/A"===d?d:"".concat(d,"%"),p=!0===(null===(r=e.segment.confidence)||void 0===r?void 0:r.awaiting_llm),f=h.getConfidenceColors(l,u,p),w=mt.has(e.id),_=p;return i.jsx(m.Tooltip,t.__assign({title:p?"data is being processed":"",arrow:!0},{children:i.jsx("span",t.__assign({ref:function(n){n?ot.current.set(e.id,n):ot.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:_?"not-allowed":"pointer"}},{children:i.jsx("button",t.__assign({disabled:_,type:"button","aria-pressed":o,"aria-label":p?"".concat(e.review_step.type," · Page ").concat(e.pageNumber," · Data is being processed"):"".concat(e.review_step.type," · Page ").concat(e.pageNumber),onClick:function(){return Xt(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:s?w&&!p?115:90:w&&!p?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(w&&!p?"#E2E8F0":f.border),borderRadius:16,backgroundColor:w&&!p?"#F8FAFC":f.background,color:w&&!p?"#475569":f.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:w&&!p?i.jsxs(m.Typography,t.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),i.jsxs("span",t.__assign({style:{display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]})),i.jsxs("span",t.__assign({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:i.jsx(v.CircleCheck,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]})):i.jsxs(m.Typography,t.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),i.jsxs("span",t.__assign({style:{display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:f.divider,strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]}))]}))}))}))}),e.id)})]}))]})),pt&&Fn&&i.jsxs(u.default,t.__assign({anchorElement:Fn,placement:"bottom-start",offset:{top:8},width:Math.min(st,b),maxWidth:b,heightBuffer:null!=Ne?Ne:25},{children:[Bn&&i.jsx(d.default,{width:"100%",maxWidth:"100%",score:pt.review_step.score,reasons:xt,reason:pt.review_step.reason,gap:pt.review_step.gap,onBack:function(){return Nn(!1)},onClose:Yt}),i.jsx("div",t.__assign({style:{display:Bn?"none":"block"}},{children:mt.has(pt.id)?i.jsx(p.default,{width:"100%",maxWidth:"100%",headerName:"page"===pt.kind?"Page format approved":"Split"===Et?"Split approved":"Merged"===Et?"Merge approved":"User approved",headerIcon:"page"===pt.kind?i.jsx(v.Check,{size:18,strokeWidth:2}):"Merged"===Et?i.jsx(v.GitMerge,{size:18,strokeWidth:2}):"Split"===Et?i.jsx(y.default,{width:18,height:18}):i.jsx(v.CircleCheck,{size:18,strokeWidth:2}),title:It,pageNo:"Page ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page),summary:Vt?i.jsx(w.default,{icon:i.jsx(v.CircleCheck,{size:14,strokeWidth:2}),title:It,pageRange:"Page ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page),description:null!=Dt?Dt:null,revertData:Vt,confirmDisabled:"page"===pt.kind?!Ut:null==Ke||!Ut,showDocumentHeader:!1,onRevert:function(){if("page"===pt.kind){if(!qe||!Ht){var e=new Error("SegmentReviewPdfWrapper requires onPageTypeRevert and a classification id to revert a page-type decision.");return null==Ge||Ge(e,x(pt)),Promise.reject(e)}return qe({classification_id:Ht,human_verdict:"No"},x(pt))}if(!Ke)throw new Error("SegmentReviewPdfWrapper requires onRevert to handle a revert confirmation.");if(!zt)throw new Error("There is no valid revert operation for this review.");var n=Wt?"boundary":"label"===pt.kind?"label":"boundary"===pt.kind?"boundary":null,t=Nt(zt.type);if(n&&t!==n)throw new Error("Cannot use ".concat(null!=t?t:"unknown"," revert metadata for this review. Expected ").concat(n,"."));return Ke(zt,x(pt))},onRevertError:function(e){null==Ge||Ge(e,x(pt))},onRevertComplete:function(e){var n,t,i,r,o,a;On(function(){return new Set}),"page"!==pt.kind&&(pn(function(){return new Set}),cn(function(){return new Map})),pt.id;var l=null!==(n=Vt.previousSegments[0])&&void 0!==n?n:Vt.currentSegment,u=null==Fn?void 0:Fn.getBoundingClientRect(),d=null===(t=ut.current)||void 0===t?void 0:t.getBoundingClientRect(),s=Math.min(b,Math.max(220,st)),g=null!==(i=null==u?void 0:u.left)&&void 0!==i?i:(null!==(r=null==d?void 0:d.right)&&void 0!==r?r:window.innerWidth-s-8)+8,c=Math.max(8,Math.min(g,window.innerWidth-s-8)),v=null==(null==u?void 0:u.bottom)?Math.max(8,null!==(o=null==d?void 0:d.top)&&void 0!==o?o:8):u.bottom+8;On(function(){return new Set}),"page"!==pt.kind&&(rt.current=null),nt(!1),Qn({title:"Split"===Et?"Split reverted":"Merged"===Et?"Merge reverted":"Approval reverted",description:(null===(a=null==e?void 0:e.message)||void 0===a?void 0:a.trim())||("Split"===Et?"Pages ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page," are now part of “Advice of Award” again. Review the boundary and title to confirm the document."):"Merged"===Et?"The documents have been separated again. Review their boundaries and titles to confirm them.":"“".concat(It,"” is pending review again. Review the boundary and title to confirm the document.")),segment:l,position:{top:v,left:c,width:s}}),Yt()}},pt.id):void 0,additionalActions:Mt?i.jsx(f.default,{metadata:Mt.metadata,reviewAction:null!==($=pt.segment.review_action)&&void 0!==$?$:void 0,startPage:pt.segment.start_page,endPage:pt.segment.end_page,title:It,previousSegmentTitle:yt,nextSegmentTitle:bt,disabled:De||!Le||Vn===pt.id,onConfirm:function(e,n){ei(Mt,e,n)}}):void 0,cognitiveScore:pt.review_step.score,styles:{root:{borderColor:"#16A34A"},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:"#16A34A"}}},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt}):"boundary"===pt.kind?i.jsx(l.default,{width:"100%",maxWidth:"100%",totalPages:le,title:pt.segment.label||pt.segment.title,pageNo:"Page ".concat(pt.pageNumber),content:null!==(ee=pt.review_step.question)&&void 0!==ee?ee:null,revertSummary:Ot,cognitiveScore:pt.review_step.score,metadata:pt.metadata,reviewAction:null!==(ne=pt.segment.review_action)&&void 0!==ne?ne:void 0,previousSegmentTitle:yt,nextSegmentTitle:bt,manualPrompt:null!=Be?Be:"Set a custom boundary",defaultStartPage:pt.segment.start_page,defaultEndPage:pt.segment.end_page,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:De||!Le||Vn===pt.id,onConfirm:function(e,n,t){t&&l.isBoundaryReviewAction(n.id)&&ei(pt,n.id,t)},onAdjustManually:function(){return null==Je?void 0:Je(x(pt))},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt},pt.id):"label"===pt.kind?i.jsx(s.default,{width:"100%",maxWidth:"100%",title:pt.metadata.current_label||pt.segment.label||pt.segment.title,pageNo:"Pages ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page),content:null!==(te=pt.review_step.question)&&void 0!==te?te:null,revertSummary:Ot,cognitiveScore:pt.review_step.score,metadata:pt.metadata,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:De||!Fe||Vn===pt.id,confirmationBlocked:ft,confirmationWarning:ft?"Please confirm the boundary before confirming the title.":void 0,onActionConfirm:function(e,n){ei(pt,e,n)},onAdjustManually:function(){return null==Je?void 0:Je(x(pt))},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt},pt.id):i.jsx(g.default,{width:"100%",maxWidth:"100%",title:pt.segment.label||pt.segment.title,pageNo:"Page ".concat(pt.pageNumber),content:pt.review_step.reason,cognitiveScore:pt.review_step.score,pageType:pt.metadata.page_type,metadata:pt.metadata,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:De||!Te||Vn===pt.id,onActionConfirm:function(e,n){ei(pt,e,n)},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt},pt.id)}))]})),Jn&&i.jsx(m.Portal,{children:i.jsx(m.Box,t.__assign({"aria-live":"polite",sx:{position:"fixed",top:Jn.position.top,left:Jn.position.left,zIndex:1600,width:Jn.position.width,maxWidth:"calc(100vw - 16px)",opacity:et?1:0,transform:et?"translateY(0)":"translateY(-6px)",transition:"opacity 500ms ease, transform 500ms ease",filter:"drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18))",pointerEvents:et?"auto":"none"}},{children:i.jsx(_.default,{title:Jn.title,description:Jn.description,onReview:function(){return Jt(Jn.segment)}})}))})]}))};
2
+ //# sourceMappingURL=SegmentReviewPdfWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SegmentReviewPdfWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}