@viswa-test/test-citation 0.0.350 → 0.0.352

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),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=n.useState(null),b=w[0],g=w[1],y=n.useState(!0),E=y[0],S=y[1],z=n.useState(null),R=z[0],q=z[1],L=n.useState(null),O=L[0],W=L[1],_=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;g(function(e){return e===t?e:t})},[s,u]),n.useLayoutEffect(function(){if(b){var e=null,t=function(){var t,n,i=b.getBoundingClientRect(),o=null!==(n=null===(t=window.visualViewport)||void 0===t?void 0:t.height)&&void 0!==n?n:window.innerHeight;S(b.isConnected&&"hidden"!==b.style.visibility),q(Math.max(0,window.innerWidth-i.left-8)),W(Math.max(0,o-i.top-2*i.height)),null!=e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){var t;e=null,null===(t=_.current)||void 0===t||t.update()})},n=new MutationObserver(t);n.observe(b,{attributes:!0,attributeFilter:["style","class"]});var i="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==i||i.observe(b),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)}}S(!1)},[b]),t.jsx(a.default,e.__assign({open:Boolean(b)&&E,anchorEl:b,popperRef:_,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==R?x:"min(".concat("number"==typeof x?"".concat(x,"px"):null!=x?x:"100vw",", ").concat(R,"px)"),minWidth:0,height:"fit-content",maxHeight:null==O?"calc(85vh - 10px)":"".concat(O-100,"px"),alignSelf:"flex-start",flex:"0 0 auto",overflowX:"hidden",overflowY:"hidden",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==O?"calc(85vh - 10px)":"".concat(O-100,"px"),overflowX:"hidden",overflowY:"auto",pointerEvents:"auto",boxSizing:"border-box"}},{children:d}))}))};
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
2
  //# sourceMappingURL=CardWrapper.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("@mui/icons-material/ChevronLeft"),t=require("@mui/icons-material/Close"),a=require("@mui/material/Box"),r=require("@mui/material/Divider"),l=require("@mui/material/IconButton"),s=require("@mui/material/Paper"),o=require("@mui/material/Stack"),u=require("@mui/material/Typography"),d=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 m=h(n),f=h(t),x=h(a),_=h(r),p=h(l),v=h(s),y=h(o),j=h(u),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,l=n.score,s=n.headerName,o=void 0===s?"Cognitive Integrity":s,u=n.onBack,h=n.onClose,C=n.showCloseButton,S=void 0===C||C,H=n.width,w=void 0===H?260:H,z=n.maxWidth,q=void 0===z?260:z,k=n.className,B=n.styles,A=(null!=t?t:[]).filter(function(e){return"evidence"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),W=(null!=t?t:[]).filter(function(e){return"gap"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),R=null==a?void 0:a.trim(),I=null==r?void 0:r.trim();if(0===A.length&&R&&A.push(R),0===W.length&&I&&W.push(I),0===A.length&&0===W.length)return null;var F,M=(F=null==B?void 0:B.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"})}),E={m:0,pl:2.25,listStyleType:"decimal",listStylePosition:"outside",fontSize:11.5,lineHeight:1.3,"& > li":{pl:.25,fontSize:"inherit",lineHeight:"inherit"},"& > li::marker":{fontSize:"1em",fontWeight:"inherit"}};return i.jsx(v.default,e.__assign({className:k,elevation:4,sx:b({width:w,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==B?void 0:B.root)},{children:i.jsxs(y.default,e.__assign({spacing:.75,sx:{p:1,height:"auto",minHeight:0}},{children:[i.jsxs(y.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==B?void 0:B.header},{children:[u&&i.jsx(p.default,e.__assign({size:"small",onClick:u,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:i.jsx(m.default,{sx:{fontSize:17}})})),i.jsx(c.default,{sx:{color:"#6941C6"}}),i.jsx(j.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:l}),S&&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(f.default,{sx:{fontSize:17}})}))]})),i.jsx(_.default,{sx:{m:0}}),i.jsx(x.default,e.__assign({sx:b({bgcolor:"#F9FAFB",px:1.5,py:1.5,height:"auto",minHeight:0,flex:"0 0 auto"},null==B?void 0:B.content)},{children:i.jsxs(y.default,e.__assign({spacing:1.5},{children:[A.length>0&&i.jsxs(x.default,{children:[i.jsx(j.default,e.__assign({sx:{mb:.75,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.25}},{children:"Decision Making Factors"})),i.jsx(x.default,e.__assign({component:"ol",sx:E,style:M.list},{children:A.map(function(n,t){return i.jsx(x.default,e.__assign({component:"li",sx:{mb:.375,pl:.25}},{children:i.jsx(d.default,{value:"<summary>".concat(n,"</summary>"),styles:D})}),"evidence-".concat(t))})}))]}),A.length>0&&W.length>0&&i.jsx(_.default,{sx:{my:0,borderColor:"#E5E7EB"}}),W.length>0&&i.jsxs(x.default,{children:[i.jsx(j.default,e.__assign({sx:{mb:.75,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.25}},{children:"Gaps in Decision"})),i.jsx(x.default,e.__assign({component:"ol",sx:E,style:M.list},{children:W.map(function(n,t){return i.jsx(x.default,e.__assign({component:"li",sx:{mb:.375,pl:.25}},{children:i.jsx(d.default,{value:"<summary>".concat(n,"</summary>"),styles:D})}),"gap-".concat(t))})}))]})]}))}))]}))}))};
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"),l=require("@mui/material/Box"),r=require("@mui/material/Divider"),a=require("@mui/material/IconButton"),s=require("@mui/material/Paper"),o=require("@mui/material/Stack"),u=require("@mui/material/Typography"),d=require("../CitationRenderer/MarkdownRenderer.js"),c=require("./CognitiveIcon.js"),g=require("./CognitiveScoreBadge.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=m(n),f=m(t),x=m(l),_=m(r),p=m(a),v=m(s),j=m(o),y=m(u),b=function(i,n){return e.__spreadArray([i],Array.isArray(n)?n:null==n?[]:[n],!0)};exports.default=function(n){var t=n.reasons,l=n.reason,r=n.gap,a=n.score,s=n.headerName,o=void 0===s?"Cognitive Integrity":s,u=n.onBack,m=n.onClose,C=n.showCloseButton,H=void 0===C||C,S=n.width,z=void 0===S?260:S,w=n.maxWidth,k=void 0===w?260:w,q=n.className,A=n.styles,B=(null!=t?t:[]).filter(function(e){return"evidence"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),W=(null!=t?t:[]).filter(function(e){return"gap"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),R=null==l?void 0:l.trim(),I=null==r?void 0:r.trim();if(0===B.length&&R&&B.push(R),0===W.length&&I&&W.push(I),0===B.length&&0===W.length)return null;var F,M=(F=null==A?void 0:A.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:q,elevation:4,sx:b({width:z,maxWidth:k,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==A?void 0:A.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==A?void 0:A.header},{children:[u&&i.jsx(p.default,e.__assign({size:"small",onClick:u,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:i.jsx(h.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:a}),H&&i.jsx(p.default,e.__assign({size:"small",onClick:m,disabled:!m,"aria-label":"Close cognitive integrity",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(f.default,{sx:{fontSize:17}})}))]})),i.jsx(_.default,{sx:{m:0}}),i.jsx(x.default,e.__assign({sx:b({bgcolor:"#F9FAFB",px:1.5,py:1.25,height:"auto",minHeight:0,flex:"0 0 auto"},null==A?void 0:A.content)},{children:i.jsxs(j.default,e.__assign({spacing:1.5},{children:[B.length>0&&i.jsxs(x.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(x.default,e.__assign({component:"ol",sx:{m:0,pl:2.25,"& li":{pl:.25,mb:.75,color:"#667085",fontSize:11.5,lineHeight:1.65},"& li:last-child":{mb:0},"& li::marker":{color:"#475467",fontSize:11.5},"& p":{margin:0,color:"#667085",fontSize:11.5,lineHeight:1.65}},style:M.list},{children:B.map(function(n,t){return i.jsx(x.default,e.__assign({component:"li"},{children:i.jsx(d.default,{value:"<summary>".concat(n,"</summary>"),styles:D})}),"evidence-".concat(t))})}))]}),B.length>0&&W.length>0&&i.jsx(_.default,{sx:{my:"2px !important",borderColor:"#E4E7EC"}}),W.length>0&&i.jsxs(x.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(x.default,e.__assign({component:"ol",sx:{m:0,pl:2.25,"& li":{pl:.25,mb:.75,color:"#667085",fontSize:11.5,lineHeight:1.65},"& li:last-child":{mb:0},"& li::marker":{color:"#475467",fontSize:11.5},"& p":{margin:0,color:"#667085",fontSize:11.5,lineHeight:1.65}},style:M.list},{children:W.map(function(n,t){return i.jsx(x.default,e.__assign({component:"li"},{children:i.jsx(d.default,{value:"<summary>".concat(n,"</summary>"),styles:D})}),"gap-".concat(t))})}))]})]}))}))]}))}))};
2
2
  //# sourceMappingURL=CognitiveIntegrity.js.map
@@ -1,2 +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"),s=require("./CardWrapper.js"),u=require("./CognitiveIntegrity.js"),d=require("./LabelCheck.js"),c=require("./PageCheck.js"),g=require("./reviewStepAdapters.js"),v=require("lucide-react"),m=require("@mui/material"),f=require("./ReviewedCard.js"),p=require("./RevertCard.js"),w=require("./RevertSuccessCard.js"),h=require("./helper.js"),_=require("./ChartBreakoutCircle.js"),y=260;exports.SegmentPdfSpecialZoomLevel=void 0,(n=exports.SegmentPdfSpecialZoomLevel||(exports.SegmentPdfSpecialZoomLevel={})).ActualSize="ActualSize",n.PageFit="PageFit",n.PageWidth="PageWidth";var b=((e={})[exports.SegmentPdfSpecialZoomLevel.ActualSize]=o.SpecialZoomLevel.ActualSize,e[exports.SegmentPdfSpecialZoomLevel.PageFit]=o.SpecialZoomLevel.PageFit,e[exports.SegmentPdfSpecialZoomLevel.PageWidth]=o.SpecialZoomLevel.PageWidth,e),S=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};exports.default=function(e){var n,x,R,C,E,P,k,A,M,j,I,N,B,L,F,q,T,W,K,z,O,D,G=this,V=e.pdfUrl,Z=e.pdfName,U=e.segments,H=e.styles,X=e.pdfViewerProps,Y=e.specialZoomLevel,J=e.showBadges,Q=void 0===J||J,$=e.sortByConfidence,ee=void 0===$?"low":$,ne=e.filterByConfidence,te=void 0===ne?"all":ne,ie=e.showBadgeNavigation,re=void 0===ie||ie,oe=e.autoSelectReviewOnPageChange,ae=void 0!==oe&&oe,le=e.autoAdvanceAfterConfirm,se=void 0===le||le,ue=e.badgePreloadPages,de=void 0===ue?8:ue,ce=e.badgeOffsetTop,ge=void 0===ce?20:ce,ve=e.badgeOffsetRight,me=void 0===ve?68:ve,fe=e.badgeOffsetLeft,pe=void 0===fe?0:fe,we=e.initialReviewId,he=e.manualPrompt,_e=e.onBoundaryAction,ye=e.onLabelAction,be=e.onPageAction,Se=e.onRevert,xe=e.onActiveReviewChange,Re=e.onCurrentPageChange,Ce=e.onActionError,Ee=e.disableAllActions,Pe=void 0!==Ee&&Ee,ke=e.disablePdfAnnotations,Ae=void 0!==ke&&ke,Me=e.disablePdfTextLayer,je=void 0===Me||Me,Ie=e.disableTitleCheckUntilBoundaryCheckCompleted,Ne=void 0!==Ie&&Ie,Be=e.onAdjustManually,Le=e.onCognitiveClick,Fe=e.className,qe=e.style,Te=e.viewerStyle,We=e.railStyle,Ke=e.redirectionData,ze=r.useMemo(function(){return g.extractSegmentReviewData(U)},[U]),Oe=ze.boundaryReviews,De=ze.labelReviews,Ge=ze.pageReviews,Ve=r.useState(function(){return new Map}),Ze=Ve[0],Ue=Ve[1],He=r.useMemo(function(){var e=new Map,n=1;return U.forEach(function(t,i){var r=g.getSegmentReviewKey(t,i);e.has(r)||(e.set(r,n),n+=1)}),e},[U]),Xe=r.useMemo(function(){return new Set(De.map(function(e){return g.getSegmentReviewKey(e.segment)}))},[De]),Ye=r.useMemo(function(){return h.getPendingMergeImpactedSegmentKeys(U)},[U]);r.useEffect(function(){Ue(function(e){var n=!1,t=new Map(e);return e.forEach(function(e,i){var r=U.find(function(e){return g.getSegmentReviewKey(e)===i});r&&!h.hasPolledStructuralAction(r,e)||(t.delete(i),n=!0)}),n?t:e})},[U]);var Je=r.useMemo(function(){return h.getOptimisticMergeImpactedSegmentKeys(U,Ze)},[Ze,U]),Qe=r.useRef(null),$e=r.useMemo(function(){return t.__spreadArray(t.__spreadArray(t.__spreadArray([],Oe.filter(function(e){return!Ye.has(g.getSegmentReviewKey(e.segment))&&!Je.has(g.getSegmentReviewKey(e.segment))&&!h.shouldHideStructuralBoundaryReview(e.review_step,e.segment,Xe.has(g.getSegmentReviewKey(e.segment)),Ze.get(g.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),De.filter(function(e){return!Ye.has(g.getSegmentReviewKey(e.segment))&&!Je.has(g.getSegmentReviewKey(e.segment))}).map(function(e){return t.__assign(t.__assign({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0),Ge.filter(function(e){return!Ye.has(g.getSegmentReviewKey(e.segment))&&!Je.has(g.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=He.get(g.getSegmentReviewKey(e.segment)))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=He.get(g.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)})},[Oe,De,Ge,Je,Ze,Ye,He,Xe]),en=r.useMemo(function(){return U.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})})},[U]),nn=r.useState(1),tn=nn[0],rn=nn[1],on=r.useState(null!=we?we:null),an=on[0],ln=on[1],sn=r.useState(null!=we?we:null),un=sn[0],dn=sn[1],cn=r.useState(!1),gn=cn[0],vn=cn[1],mn=r.useState(null),fn=mn[0],pn=mn[1],wn=r.useState(null),hn=wn[0],_n=wn[1],yn=r.useState(function(){return new Set}),bn=yn[0],Sn=yn[1],xn=r.useState(null),Rn=xn[0],Cn=xn[1],En=r.useState(null),Pn=En[0],kn=En[1],An=r.useState(!1),Mn=An[0],jn=An[1],In=r.useRef(0),Nn=r.useRef(null),Bn=r.useRef(null),Ln=r.useRef(new Map),Fn=r.useRef(null),qn=r.useRef(null),Tn=r.useState(y),Wn=Tn[0],Kn=Tn[1],zn=null!==(x=null===(n=null==H?void 0:H.aside)||void 0===n?void 0:n.width)&&void 0!==x?x:"40%",On="min(".concat("number"==typeof zn?"".concat(zn,"px"):zn,", ").concat(y,"px, 100%)");r.useEffect(function(){Sn(function(e){if(0===e.size)return e;var n=new Set(e),t=!1;return $e.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})},[$e]),r.useEffect(function(){var e=Qe.current;if(e&&Q){var n=function(){var n=e.getBoundingClientRect().width;n>0&&Kn(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()}}},[Q]);var Dn=r.useMemo(function(){var e=new Set;return $e.forEach(function(n){var t;null!=(null===(t=n.review_step.review)||void 0===t?void 0:t.action)&&e.add(n.id)}),e},[$e]),Gn=r.useMemo(function(){var e;return null!==(e=$e.find(function(e){return e.id===an}))&&void 0!==e?e:null},[an,$e]),Vn=r.useMemo(function(){return!(!Ne||"label"!==(null==Gn?void 0:Gn.kind))&&Oe.some(function(e){if(g.getSegmentReviewKey(e.segment)!==g.getSegmentReviewKey(Gn.segment)||Dn.has(e.id))return!1;var n=h.getResolvedScore(e.review_step.score,e.review_step.confidence);return null==n||n<85})},[Gn,Oe,Ne,Dn]),Zn=null==Gn?-1:U.findIndex(function(e){return g.getSegmentReviewKey(e)===g.getSegmentReviewKey(Gn.segment)}),Un=Zn>0?U[Zn-1]:void 0,Hn=Zn>=0?U[Zn+1]:void 0,Xn=(null===(R=null==Un?void 0:Un.label)||void 0===R?void 0:R.trim())||(null==Un?void 0:Un.title),Yn=(null===(C=null==Hn?void 0:Hn.label)||void 0===C?void 0:C.trim())||(null==Hn?void 0:Hn.title),Jn=h.getConfidenceColors(null==Gn?void 0:Gn.review_step.score,null==Gn?void 0:Gn.review_step.confidence,null===(E=null==Gn?void 0:Gn.segment.confidence)||void 0===E?void 0:E.awaiting_llm),Qn=(null===(P=null==Gn?void 0:Gn.review_step.reasons)||void 0===P?void 0:P.length)?Gn.review_step.reasons:null!==(A=null===(k=null==Gn?void 0:Gn.segment.confidence)||void 0===k?void 0:k.reasons)&&void 0!==A?A:[],$n=Boolean(Qn.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(M=null==Gn?void 0:Gn.review_step.reason)||void 0===M?void 0:M.trim())||(null===(j=null==Gn?void 0:Gn.review_step.gap)||void 0===j?void 0:j.trim())),et=null==Gn?null:"boundary"===Gn.kind?h.getBoundaryReviewActionBadgeLabel(Gn.review_step,Gn.segment,Ze.get(null!==(I=Gn.segment.stable_key)&&void 0!==I?I:"")):h.getTitleReviewActionBadgeLabel(Gn.review_step,Gn.segment,Ze.get(null!==(N=Gn.segment.stable_key)&&void 0!==N?N:"")),nt=null==Gn?"":(null===(B=Gn.segment.label)||void 0===B?void 0:B.trim())||Gn.segment.title,tt=null==Gn?void 0:Gn.review_step.revert,it=null==Gn?void 0:Gn.segment.revert,rt=function(e){return null==e?void 0:e.trim().toLowerCase()},ot=null==Gn||null===(F=t.__spreadArray([],null!==(L=Gn.segment.review_steps)&&void 0!==L?L:[],!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"===rt(null===(t=e.revert)||void 0===t?void 0:t.type)}))||void 0===F?void 0:F.revert,at=null!==(q=null!=tt?tt:null==Gn?void 0:Gn.segment.revert)&&void 0!==q?q:ot,lt=null==at?void 0:at.decision.trim().toUpperCase(),st=null!=et?et:(null==lt?void 0:lt.includes("SPLIT"))?"Split":(null==lt?void 0:lt.includes("MERGE"))?"Merged":null,ut="Merged"===et||"Split"===et,dt=null==Gn?void 0:ut?"boundary"===rt(null==ot?void 0:ot.type)?ot:"boundary"===rt(null==it?void 0:it.type)?it:"boundary"===rt(null==tt?void 0:tt.type)?tt:void 0:"label"===Gn.kind?"label"===rt(null==tt?void 0:tt.type)?tt:void 0:"boundary"===Gn.kind?"boundary"===rt(null==tt?void 0:tt.type)?tt:"boundary"===rt(null==ot?void 0:ot.type)?ot:"boundary"===rt(null==it?void 0:it.type)?it:void 0:void 0,ct=(null===(T=null==dt?void 0:dt.summary)||void 0===T?void 0:T.trim())||null,gt=null==Gn?null:dt?{currentSegment:{title:nt,startPage:Gn.segment.start_page,endPage:Gn.segment.end_page},previousSegments:dt.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"===st?{currentSegment:{title:nt,startPage:Gn.segment.start_page,endPage:Gn.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:nt,startPage:Gn.segment.start_page,endPage:Gn.segment.end_page}]}:"Merged"===st?{currentSegment:{title:nt,startPage:Gn.segment.start_page,endPage:Gn.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:"Request for proposal (RFP)",startPage:26,endPage:76}]}:{currentSegment:{title:nt,startPage:Gn.segment.start_page,endPage:Gn.segment.end_page},previousSegments:[]},vt=Boolean((null==dt?void 0:dt.operation_id)&&(null==dt?void 0:dt.type)&&!1!==(null==dt?void 0:dt.revertable)),mt=r.useCallback(function(e,n){In.current+=1,Nn.current={requestId:In.current,pageNumber:e,reviewId:n},_n({pageNumber:e,requestId:In.current})},[]),ft=r.useCallback(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(kn(null),ln(e.id),dn(e.id),vn(!1),pn(null),mt(e.pageNumber,e.id),null==xe||xe(e.id,e.segment))},[xe,mt]);r.useEffect(function(){if(Pn){var e=requestAnimationFrame(function(){return jn(!0)}),n=window.setTimeout(function(){jn(!1)},3500),t=window.setTimeout(function(){kn(null)},4e3);return function(){cancelAnimationFrame(e),window.clearTimeout(n),window.clearTimeout(t)}}},[Pn]),r.useEffect(function(){var e;if(Ke)if(Ke.reviewId){var n=$e.find(function(e){return e.id===Ke.reviewId&&(!Ke.type||e.kind===Ke.type)});n&&ft(n)}else if(Ke.classificationId){var t=$e.find(function(e){return"page"===e.kind&&e.metadata.classification_id===Ke.classificationId&&(!Ke.type||e.kind===Ke.type)});t&&ft(t)}else if(Ke.pageNumber&&Ke.type){var i=Number(Ke.pageNumber);if(Number.isInteger(i)&&!(i<1)){var r=null===(e=Ke.pageType)||void 0===e?void 0:e.trim().toLowerCase(),o=$e.find(function(e){var n="page"===e.kind?e.pageNumber:e.segment.start_page,t="page"!==e.kind||!r||e.metadata.page_type===r;return n===i&&e.kind===Ke.type&&t});o&&ft(o)}}},[Ke,ft,$e]);var pt=r.useCallback(function(){Nn.current=null,vn(!1),ln(null),pn(null),null==xe||xe(null,null)},[xe]),wt=r.useCallback(function(e){var n;jn(!1),kn(null);var t=null!==(n=$e.find(function(n){return!Dn.has(n.id)&&"boundary"===n.kind&&n.segment.start_page===e.startPage&&n.segment.end_page===e.endPage}))&&void 0!==n?n:$e.find(function(n){return!Dn.has(n.id)&&n.segment.start_page<=e.startPage&&n.segment.end_page>=e.startPage});t?ft(t):(pt(),In.current+=1,_n({pageNumber:e.startPage,requestId:In.current}))},[pt,Dn,$e,ft]),ht=r.useCallback(function(e){var n;if(se){var t=$e.findIndex(function(n){return n.id===e}),i=new Set($e.map(function(e){return e.id})),r=null!==(n=$e.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:$e.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return ft(r)}):pt()}else pt()},[se,pt,$e,ft,$e]),_t=r.useCallback(function(e,n,i){return t.__awaiter(G,void 0,void 0,function(){var r,o,a,s,u,d,c;return t.__generator(this,function(t){switch(t.label){case 0:if(Pe)return[2];if("boundary"===e.kind&&!_e)return[2];if("label"===e.kind&&!ye)return[2];if("page"===e.kind&&!be)return[2];r=S(e),o=n,a="boundary"===e.kind&&null!=_e&&se&&(o===l.BoundaryReviewActionEnum.SPLIT_HERE||o===l.BoundaryReviewActionEnum.MERGE_NEXT||o===l.BoundaryReviewActionEnum.MERGE_PREV||o===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),s=a?U.findIndex(function(n){return g.getSegmentReviewKey(n)===g.getSegmentReviewKey(e.segment)}):-1,a&&s>=0&&(Bn.current={action:o,originalSegmentIndex:s,segmentSignature:JSON.stringify(U.map(function(e,n){return g.getSegmentReviewKey(e,n)})),ready:!1}),Cn(e.id),t.label=1;case 1:return t.trys.push([1,8,9,10]),"boundary"!==e.kind?[3,3]:[4,null==_e?void 0:_e(n,i,r)];case 2:return t.sent(),[3,7];case 3:return"label"!==e.kind?[3,5]:[4,null==ye?void 0:ye(n,i,r)];case 4:return t.sent(),[3,7];case 5:return"page"!==e.kind?[3,7]:[4,null==be?void 0:be(n,i,r)];case 6:t.sent(),t.label=7;case 7:return Sn(function(n){var t=new Set(n);return t.add(e.id),t}),u="boundary"===e.kind&&(o===l.BoundaryReviewActionEnum.MERGE_NEXT||o===l.BoundaryReviewActionEnum.MERGE_PREV||o===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),("boundary"===e.kind&&o.toLowerCase().includes("split")||u)&&Ue(function(n){var t=new Map(n);return t.set(g.getSegmentReviewKey(e.segment),o),t}),Bn.current?(Bn.current.ready=!0,u&&(d=$e.find(function(n){return"label"===n.kind&&g.getSegmentReviewKey(n.segment)===g.getSegmentReviewKey(e.segment)}))&&requestAnimationFrame(function(){return ft(d)})):ht(e.id),[3,10];case 8:return c=t.sent(),a&&(Bn.current=null),null==Ce||Ce(c,r),[3,10];case 9:return Cn(null),[7];case 10:return[2]}})})},[se,Pe,Ce,_e,ye,be,$e,U,ft,ht]);r.useEffect(function(){var e=Bn.current;if((null==e?void 0:e.ready)&&JSON.stringify(U.map(function(e,n){return g.getSegmentReviewKey(e,n)}))!==e.segmentSignature){var n=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,t=new Map(U.map(function(e,n){return[g.getSegmentReviewKey(e,n),n]})),i=$e.find(function(e){var i,r=t.get(g.getSegmentReviewKey(e.segment));return null!=r&&r>=n&&!h.isReviewStepResolved(e.review_step,e.segment)&&(!bn.has(e.id)||!h.isReviewStepResolutionCurrent(e.review_step,e.segment))&&!0!==(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm)});if(!i)return Bn.current=null,void pt();requestAnimationFrame(function(){Bn.current=null,ft(i)})}},[pt,bn,$e,U,ft]),r.useEffect(function(){Bn.current||an&&!$e.some(function(e){return e.id===an})&&pt()},[an,pt,$e]),r.useEffect(function(){if(ae&&!Bn.current){var e=$e.find(function(e){return e.pageNumber===tn});e&&e.id!==an&&ft(e)}},[an,ae,tn,ft,$e]),r.useEffect(function(){Bn.current||an&&!$e.some(function(e){var n;return e.id===an&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&pt()},[an,pt,$e]);var yt=r.useMemo(function(){var e=$e.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===te)return e;var n=["low","medium","high"].filter(function(e){return e!==ee}),i=t.__spreadArray([ee],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,s=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==s?i.length:null!==(a=r.get(s))&&void 0!==a?a:i.length)-(null==u?i.length:null!==(l=r.get(u))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[te,ee,$e]),bt=yt.findIndex(function(e){return e.id===un}),St=r.useState(null),xt=St[0],Rt=St[1],Ct=r.useRef(!1),Et=r.useCallback(function(e){var n=yt[e];n&&ft(n)},[yt,ft]);r.useEffect(function(){un&&!yt.some(function(e){return e.id===un})&&dn(null)},[yt,un]),r.useEffect(function(){Ct.current=!1,Rt(bt>=0?String(bt+1):null)},[bt,yt.length]),r.useEffect(function(){if(Ct.current&&null!=xt){var e=window.setTimeout(function(){var e=Number(xt.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<yt.length&&(Ct.current=!1,Et(n))},300);return function(){return window.clearTimeout(e)}}},[Et,xt,yt.length]);var Pt=r.useMemo(function(){var e=new Map;$e.forEach(function(n){var t,i=null!==(t=e.get(g.getSegmentReviewKey(n.segment)))&&void 0!==t?t:[];i.push(n),e.set(g.getSegmentReviewKey(n.segment),i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=He.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},[$e,He]),kt=r.useMemo(function(){var e=new Map;$e.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},[$e]),At=r.useCallback(function(e){return{startPage:Math.max(0,e.startPage-de),endPage:Math.min(e.numPages-1,e.endPage+de)}},[de]),Mt=r.useCallback(function(){var e,n=Fn.current,t=qn.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();if($e.forEach(function(e){var n,r=Ln.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(),s=null!==(n=kt.get(e.id))&&void 0!==n?n:0,u=l.top+ge+40*s,d=u+(r.offsetHeight||32),c=u>=o.top&&d<=o.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}}),an&&null==Nn.current){var a=Ln.current.get(an);a&&"hidden"!==a.style.visibility&&pn(function(e){return e===a?e:a})}}},[an,ge,kt,$e]),jt=r.useCallback(function(e){var n=Nn.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(Nn.current=null,Mt(),requestAnimationFrame(function(){if(null==Nn.current){var e=Ln.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&pn(e)}}))},[Mt]);return r.useEffect(function(){var e=qn.current;if(e&&Q){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,Mt()}))};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()}}},[Q,Mt]),i.jsxs("div",t.__assign({ref:Fn,className:Fe,style:t.__assign(t.__assign({},qe),{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:qn,style:t.__assign(t.__assign({},Te),{flex:"1 1 auto",width:Q?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:i.jsx(a.default,t.__assign({highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},X,{defaultScale:void 0===Y?null!==(W=null==X?void 0:X.defaultScale)&&void 0!==W?W:o.SpecialZoomLevel.PageFit:b[Y],disablePdfAnnotations:Ae,disablePdfTextLayer:je,pdfUrl:V,pdfName:Z,segments:en,navigationRequest:hn,onNavigationSettled:jt,setRenderRange:At,onCurrentPageChange:function(e){rn(e),null==Nn.current&&Gn&&Gn.pageNumber!==e&&pt(),null==Re||Re(e)}}))})),Q&&i.jsxs("aside",t.__assign({"aria-label":"Page review badges",ref:Qe,style:t.__assign(t.__assign({},We),{position:"relative",width:On,maxWidth:y,flex:"0 1 ".concat(On),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[re&&yt.length>0&&i.jsxs("nav",t.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:me||"auto",left:pe||"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!=xt?xt:"-","aria-label":"Review badge number",onChange:function(e){Ct.current=!0,Rt(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(yt.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",yt.length]})),["previous","next"].map(function(e){var n="previous"===e,r=bt+(n?-1:1),o=r<0||r>=yt.length;return i.jsx("button",t.__assign({type:"button","aria-label":"".concat(n?"Previous":"Next"," review badge"),disabled:o,onClick:function(){return Et(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)})]})),$e.map(function(e){var n,r,o=an===e.id,a=null!==(n=Pt.get(e.id))&&void 0!==n?n:"1A",l=e.review_step.score,s=e.review_step.confidence,u=h.formatScore(l,s),d="boundary"===e.kind?h.getBoundaryReviewActionBadgeLabel(e.review_step,e.segment,Ze.get(g.getSegmentReviewKey(e.segment))):"label"===e.kind?h.getTitleReviewActionBadgeLabel(e.review_step,e.segment,Ze.get(g.getSegmentReviewKey(e.segment))):null,c=null!=d?d:"N/A"===u?u:"".concat(u,"%"),f=!0===(null===(r=e.segment.confidence)||void 0===r?void 0:r.awaiting_llm),p=h.getConfidenceColors(l,s,f),w=Dn.has(e.id),_=f;return i.jsx(m.Tooltip,t.__assign({title:f?"data is being processed":"",arrow:!0},{children:i.jsx("span",t.__assign({ref:function(n){n?Ln.current.set(e.id,n):Ln.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":f?"".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 ft(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:d?w&&!f?115:90:w&&!f?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(w&&!f?"#E2E8F0":p.border),borderRadius:16,backgroundColor:w&&!f?"#F8FAFC":p.background,color:w&&!f?"#475569":p.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:w&&!f?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:c}))]})),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:p.divider,strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:c}))]}))]}))}))}))}),e.id)})]}))]})),Gn&&fn&&i.jsxs(s.default,t.__assign({anchorElement:fn,placement:"bottom-start",offset:{top:8},width:Math.min(Wn,y),maxWidth:y},{children:[gn&&i.jsx(u.default,{width:"100%",maxWidth:"100%",score:Gn.review_step.score,reasons:Qn,reason:Gn.review_step.reason,gap:Gn.review_step.gap,onBack:function(){return vn(!1)},onClose:pt}),i.jsx("div",t.__assign({style:{display:gn?"none":"block"}},{children:Dn.has(Gn.id)?i.jsx(f.default,{width:"100%",maxWidth:"100%",headerName:"Split"===et?"Split approved":"Merged"===et?"Merge approved":"User approved",headerIcon:"Merged"===et?i.jsx(v.GitMerge,{size:18,strokeWidth:2}):"Split"===et?i.jsx(_.default,{width:18,height:18}):i.jsx(v.CircleCheck,{size:18,strokeWidth:2}),title:nt,pageNo:"Page ".concat(Gn.segment.start_page,"-").concat(Gn.segment.end_page),summary:gt?i.jsx(p.default,{icon:i.jsx(v.CircleCheck,{size:14,strokeWidth:2}),title:nt,pageRange:"Page ".concat(Gn.segment.start_page,"-").concat(Gn.segment.end_page),description:(null===(K=Gn.review_step.summary)||void 0===K?void 0:K.trim())||("Split"===et?"Pages ".concat(Gn.segment.start_page,"-").concat(Gn.segment.end_page," were split from “Advice of Award” to create this document “").concat(nt,"”."):"Merged"===et?"Pages 13-25 were merged into this document from “Advice of Award”.":"No changes were made. “".concat(nt,"” was kept as is with pages ").concat(Gn.segment.start_page,"-").concat(Gn.segment.end_page,".")),revertData:gt,confirmDisabled:null==Se||!vt,showDocumentHeader:!1,onRevert:function(){if(!Se)throw new Error("SegmentReviewPdfWrapper requires onRevert to handle a revert confirmation.");if(!dt)throw new Error("There is no valid revert operation for this review.");var e=ut?"boundary":"label"===Gn.kind?"label":"boundary"===Gn.kind?"boundary":null,n=rt(dt.type);if(e&&n!==e)throw new Error("Cannot use ".concat(null!=n?n:"unknown"," revert metadata for this review. Expected ").concat(e,"."));return Se(dt,S(Gn))},onRevertError:function(e){null==Ce||Ce(e,S(Gn))},onRevertComplete:function(e){var n,t,i,r,o,a;Sn(function(){return new Set}),Ue(function(){return new Map}),Gn.id;var l=null!==(n=gt.previousSegments[0])&&void 0!==n?n:gt.currentSegment,s=null==fn?void 0:fn.getBoundingClientRect(),u=null===(t=qn.current)||void 0===t?void 0:t.getBoundingClientRect(),d=Math.min(y,Math.max(220,Wn)),c=null!==(i=null==s?void 0:s.left)&&void 0!==i?i:(null!==(r=null==u?void 0:u.right)&&void 0!==r?r:window.innerWidth-d-8)+8,g=Math.max(8,Math.min(c,window.innerWidth-d-8)),v=null==(null==s?void 0:s.bottom)?Math.max(8,null!==(o=null==u?void 0:u.top)&&void 0!==o?o:8):s.bottom+8;Sn(function(){return new Set}),Bn.current=null,jn(!1),kn({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(Gn.segment.start_page,"-").concat(Gn.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(nt,"” is pending review again. Review the boundary and title to confirm the document.")),segment:l,position:{top:v,left:g,width:d}}),pt()}},Gn.id):void 0,cognitiveScore:Gn.review_step.score,styles:{root:{borderColor:"#16A34A"},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:"#16A34A"}}},onCognitiveClick:$n?function(){vn(!0),null==Le||Le(S(Gn))}:void 0,onClose:pt}):"boundary"===Gn.kind?i.jsx(l.default,{width:"100%",maxWidth:"100%",title:Gn.segment.label||Gn.segment.title,pageNo:"Page ".concat(Gn.pageNumber),content:null!==(z=Gn.review_step.question)&&void 0!==z?z:null,revertSummary:ct,cognitiveScore:Gn.review_step.score,metadata:Gn.metadata,reviewAction:null!==(O=Gn.segment.review_action)&&void 0!==O?O:void 0,previousSegmentTitle:Xn,nextSegmentTitle:Yn,manualPrompt:null!=he?he:"Set a custom boundary",defaultStartPage:Gn.segment.start_page,defaultEndPage:Gn.segment.end_page,styles:{root:{borderColor:Jn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Jn.text}}},confirmDisabled:Pe||!_e||Rn===Gn.id,onConfirm:function(e,n,t){t&&l.isBoundaryReviewAction(n.id)&&_t(Gn,n.id,t)},onAdjustManually:function(){return null==Be?void 0:Be(S(Gn))},onCognitiveClick:$n?function(){vn(!0),null==Le||Le(S(Gn))}:void 0,onClose:pt},Gn.id):"label"===Gn.kind?i.jsx(d.default,{width:"100%",maxWidth:"100%",title:Gn.metadata.current_label||Gn.segment.label||Gn.segment.title,pageNo:"Pages ".concat(Gn.segment.start_page,"-").concat(Gn.segment.end_page),content:null!==(D=Gn.review_step.question)&&void 0!==D?D:null,revertSummary:ct,cognitiveScore:Gn.review_step.score,metadata:Gn.metadata,styles:{root:{borderColor:Jn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Jn.text}}},confirmDisabled:Pe||!ye||Rn===Gn.id,confirmationBlocked:Vn,confirmationWarning:Vn?"Please confirm the boundary before confirming the title.":void 0,onActionConfirm:function(e,n){_t(Gn,e,n)},onAdjustManually:function(){return null==Be?void 0:Be(S(Gn))},onCognitiveClick:$n?function(){vn(!0),null==Le||Le(S(Gn))}:void 0,onClose:pt},Gn.id):i.jsx(c.default,{width:"100%",maxWidth:"100%",title:Gn.segment.label||Gn.segment.title,pageNo:"Page ".concat(Gn.pageNumber),content:Gn.review_step.reason,cognitiveScore:Gn.review_step.score,pageType:Gn.metadata.page_type,metadata:Gn.metadata,styles:{root:{borderColor:Jn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Jn.text}}},confirmDisabled:Pe||!be||Rn===Gn.id,onActionConfirm:function(e,n){_t(Gn,e,n)},onCognitiveClick:$n?function(){vn(!0),null==Le||Le(S(Gn))}:void 0,onClose:pt},Gn.id)}))]})),Pn&&i.jsx(m.Portal,{children:i.jsx(m.Box,t.__assign({"aria-live":"polite",sx:{position:"fixed",top:Pn.position.top,left:Pn.position.left,zIndex:1600,width:Pn.position.width,maxWidth:"calc(100vw - 16px)",opacity:Mn?1:0,transform:Mn?"translateY(0)":"translateY(-6px)",transition:"opacity 500ms ease, transform 500ms ease",filter:"drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18))",pointerEvents:Mn?"auto":"none"}},{children:i.jsx(w.default,{title:Pn.title,description:Pn.description,onReview:function(){return wt(Pn.segment)}})}))})]}))};
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"),s=require("./CognitiveIntegrity.js"),d=require("./LabelCheck.js"),g=require("./PageCheck.js"),c=require("./reviewStepAdapters.js"),v=require("lucide-react"),m=require("@mui/material"),f=require("./ReviewedCard.js"),p=require("./RevertCard.js"),w=require("./RevertSuccessCard.js"),h=require("./helper.js"),_=require("./ChartBreakoutCircle.js"),y=260;exports.SegmentPdfSpecialZoomLevel=void 0,(n=exports.SegmentPdfSpecialZoomLevel||(exports.SegmentPdfSpecialZoomLevel={})).ActualSize="ActualSize",n.PageFit="PageFit",n.PageWidth="PageWidth";var b=((e={})[exports.SegmentPdfSpecialZoomLevel.ActualSize]=o.SpecialZoomLevel.ActualSize,e[exports.SegmentPdfSpecialZoomLevel.PageFit]=o.SpecialZoomLevel.PageFit,e[exports.SegmentPdfSpecialZoomLevel.PageWidth]=o.SpecialZoomLevel.PageWidth,e),S=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};exports.default=function(e){var n,x,R,E,C,P,k,A,M,j,I,B,N,L,F,T,q,W,K,z,O,D,G,V=this,Z=e.pdfUrl,H=e.pdfName,U=e.segments,X=e.styles,Y=e.pdfViewerProps,J=e.specialZoomLevel,Q=e.showBadges,$=void 0===Q||Q,ee=e.sortByConfidence,ne=void 0===ee?"low":ee,te=e.filterByConfidence,ie=void 0===te?"all":te,re=e.showBadgeNavigation,oe=void 0===re||re,ae=e.autoSelectReviewOnPageChange,le=void 0!==ae&&ae,ue=e.autoAdvanceAfterConfirm,se=void 0===ue||ue,de=e.badgePreloadPages,ge=void 0===de?8:de,ce=e.badgeOffsetTop,ve=void 0===ce?20:ce,me=e.badgeOffsetRight,fe=void 0===me?68:me,pe=e.badgeOffsetLeft,we=void 0===pe?0:pe,he=e.initialReviewId,_e=e.manualPrompt,ye=e.onBoundaryAction,be=e.onLabelAction,Se=e.onPageAction,xe=e.onRevert,Re=e.onActiveReviewChange,Ee=e.onCurrentPageChange,Ce=e.onActionError,Pe=e.disableAllActions,ke=void 0!==Pe&&Pe,Ae=e.disablePdfAnnotations,Me=void 0!==Ae&&Ae,je=e.disablePdfTextLayer,Ie=void 0===je||je,Be=e.disableTitleCheckUntilBoundaryCheckCompleted,Ne=void 0!==Be&&Be,Le=e.onAdjustManually,Fe=e.onCognitiveClick,Te=e.className,qe=e.style,We=e.viewerStyle,Ke=e.railStyle,ze=e.redirectionData,Oe=r.useMemo(function(){return c.extractSegmentReviewData(U)},[U]),De=Oe.boundaryReviews,Ge=Oe.labelReviews,Ve=Oe.pageReviews,Ze=r.useState(function(){return new Map}),He=Ze[0],Ue=Ze[1],Xe=r.useMemo(function(){var e=new Map,n=1;return U.forEach(function(t,i){var r=c.getSegmentReviewKey(t,i);e.has(r)||(e.set(r,n),n+=1)}),e},[U]),Ye=r.useMemo(function(){return new Set(Ge.map(function(e){return c.getSegmentReviewKey(e.segment)}))},[Ge]),Je=r.useMemo(function(){return h.getPendingMergeImpactedSegmentKeys(U)},[U]);r.useEffect(function(){Ue(function(e){var n=!1,t=new Map(e);return e.forEach(function(e,i){var r=U.find(function(e){return c.getSegmentReviewKey(e)===i});r&&!h.hasPolledStructuralAction(r,e)||(t.delete(i),n=!0)}),n?t:e})},[U]);var Qe=r.useMemo(function(){return h.getOptimisticMergeImpactedSegmentKeys(U,He)},[He,U]),$e=r.useRef(null),en=r.useMemo(function(){return t.__spreadArray(t.__spreadArray(t.__spreadArray([],De.filter(function(e){return!Je.has(c.getSegmentReviewKey(e.segment))&&!Qe.has(c.getSegmentReviewKey(e.segment))&&!h.shouldHideStructuralBoundaryReview(e.review_step,e.segment,Ye.has(c.getSegmentReviewKey(e.segment)),He.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),Ge.filter(function(e){return!Je.has(c.getSegmentReviewKey(e.segment))&&!Qe.has(c.getSegmentReviewKey(e.segment))}).map(function(e){return t.__assign(t.__assign({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0),Ve.filter(function(e){return!Je.has(c.getSegmentReviewKey(e.segment))&&!Qe.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=Xe.get(c.getSegmentReviewKey(e.segment)))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=Xe.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)})},[De,Ge,Ve,Qe,He,Je,Xe,Ye]),nn=r.useMemo(function(){return U.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})})},[U]),tn=r.useState(1),rn=tn[0],on=tn[1],an=r.useState(null!=he?he:null),ln=an[0],un=an[1],sn=r.useState(null!=he?he:null),dn=sn[0],gn=sn[1],cn=r.useState(!1),vn=cn[0],mn=cn[1],fn=r.useState(null),pn=fn[0],wn=fn[1],hn=r.useState(null),_n=hn[0],yn=hn[1],bn=r.useState(function(){return new Set}),Sn=bn[0],xn=bn[1],Rn=r.useState(null),En=Rn[0],Cn=Rn[1],Pn=r.useState(null),kn=Pn[0],An=Pn[1],Mn=r.useState(!1),jn=Mn[0],In=Mn[1],Bn=r.useRef(0),Nn=r.useRef(null),Ln=r.useRef(null),Fn=r.useRef(new Map),Tn=r.useRef(null),qn=r.useRef(null),Wn=r.useState(y),Kn=Wn[0],zn=Wn[1],On=null!==(x=null===(n=null==X?void 0:X.aside)||void 0===n?void 0:n.width)&&void 0!==x?x:"40%",Dn="min(".concat("number"==typeof On?"".concat(On,"px"):On,", ").concat(y,"px, 100%)");r.useEffect(function(){xn(function(e){if(0===e.size)return e;var n=new Set(e),t=!1;return en.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})},[en]),r.useEffect(function(){var e=$e.current;if(e&&$){var n=function(){var n=e.getBoundingClientRect().width;n>0&&zn(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()}}},[$]);var Gn=r.useMemo(function(){var e=new Set;return en.forEach(function(n){var t;null!=(null===(t=n.review_step.review)||void 0===t?void 0:t.action)&&e.add(n.id)}),e},[en]),Vn=r.useMemo(function(){var e;return null!==(e=en.find(function(e){return e.id===ln}))&&void 0!==e?e:null},[ln,en]),Zn=r.useMemo(function(){return!(!Ne||"label"!==(null==Vn?void 0:Vn.kind))&&De.some(function(e){if(c.getSegmentReviewKey(e.segment)!==c.getSegmentReviewKey(Vn.segment)||Gn.has(e.id))return!1;var n=h.getResolvedScore(e.review_step.score,e.review_step.confidence);return null==n||n<85})},[Vn,De,Ne,Gn]),Hn=null==Vn?-1:U.findIndex(function(e){return c.getSegmentReviewKey(e)===c.getSegmentReviewKey(Vn.segment)}),Un=Hn>0?U[Hn-1]:void 0,Xn=Hn>=0?U[Hn+1]:void 0,Yn=(null===(R=null==Un?void 0:Un.label)||void 0===R?void 0:R.trim())||(null==Un?void 0:Un.title),Jn=(null===(E=null==Xn?void 0:Xn.label)||void 0===E?void 0:E.trim())||(null==Xn?void 0:Xn.title),Qn=h.getConfidenceColors(null==Vn?void 0:Vn.review_step.score,null==Vn?void 0:Vn.review_step.confidence,null===(C=null==Vn?void 0:Vn.segment.confidence)||void 0===C?void 0:C.awaiting_llm),$n=(null===(P=null==Vn?void 0:Vn.review_step.reasons)||void 0===P?void 0:P.length)?Vn.review_step.reasons:null!==(A=null===(k=null==Vn?void 0:Vn.segment.confidence)||void 0===k?void 0:k.reasons)&&void 0!==A?A:[],et=Boolean($n.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(M=null==Vn?void 0:Vn.review_step.reason)||void 0===M?void 0:M.trim())||(null===(j=null==Vn?void 0:Vn.review_step.gap)||void 0===j?void 0:j.trim())),nt=null==Vn?null:"boundary"===Vn.kind?h.getBoundaryReviewActionBadgeLabel(Vn.review_step,Vn.segment,He.get(null!==(I=Vn.segment.stable_key)&&void 0!==I?I:"")):h.getTitleReviewActionBadgeLabel(Vn.review_step,Vn.segment,He.get(null!==(B=Vn.segment.stable_key)&&void 0!==B?B:"")),tt=null==Vn?"":(null===(N=Vn.segment.label)||void 0===N?void 0:N.trim())||Vn.segment.title,it=null==Vn?void 0:Vn.review_step.revert,rt=null==Vn?void 0:Vn.segment.revert,ot=function(e){return null==e?void 0:e.trim().toLowerCase()},at=null==Vn||null===(F=t.__spreadArray([],null!==(L=Vn.segment.review_steps)&&void 0!==L?L:[],!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"===ot(null===(t=e.revert)||void 0===t?void 0:t.type)}))||void 0===F?void 0:F.revert,lt=null!==(T=null!=it?it:null==Vn?void 0:Vn.segment.revert)&&void 0!==T?T:at,ut=null==lt?void 0:lt.decision.trim().toUpperCase(),st=null!=nt?nt:(null==ut?void 0:ut.includes("SPLIT"))?"Split":(null==ut?void 0:ut.includes("MERGE"))?"Merged":null,dt="Merged"===nt||"Split"===nt,gt=null==Vn?void 0:dt?"boundary"===ot(null==at?void 0:at.type)?at:"boundary"===ot(null==rt?void 0:rt.type)?rt:"boundary"===ot(null==it?void 0:it.type)?it:void 0:"label"===Vn.kind?"label"===ot(null==it?void 0:it.type)?it:void 0:"boundary"===Vn.kind?"boundary"===ot(null==it?void 0:it.type)?it:"boundary"===ot(null==at?void 0:at.type)?at:"boundary"===ot(null==rt?void 0:rt.type)?rt:void 0:void 0,ct=(null===(q=null==gt?void 0:gt.summary)||void 0===q?void 0:q.trim())||null,vt=null==Vn?null:gt?{currentSegment:{title:tt,startPage:Vn.segment.start_page,endPage:Vn.segment.end_page},previousSegments:gt.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"===st?{currentSegment:{title:tt,startPage:Vn.segment.start_page,endPage:Vn.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:tt,startPage:Vn.segment.start_page,endPage:Vn.segment.end_page}]}:"Merged"===st?{currentSegment:{title:tt,startPage:Vn.segment.start_page,endPage:Vn.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:"Request for proposal (RFP)",startPage:26,endPage:76}]}:{currentSegment:{title:tt,startPage:Vn.segment.start_page,endPage:Vn.segment.end_page},previousSegments:[]},mt=Boolean((null==gt?void 0:gt.operation_id)&&(null==gt?void 0:gt.type)&&!1!==(null==gt?void 0:gt.revertable)),ft=r.useCallback(function(e,n){Bn.current+=1,Nn.current={requestId:Bn.current,pageNumber:e,reviewId:n},yn({pageNumber:e,requestId:Bn.current})},[]),pt=r.useCallback(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(An(null),un(e.id),gn(e.id),mn(!1),wn(null),ft(e.pageNumber,e.id),null==Re||Re(e.id,e.segment))},[Re,ft]);r.useEffect(function(){if(kn){var e=requestAnimationFrame(function(){return In(!0)}),n=window.setTimeout(function(){In(!1)},3500),t=window.setTimeout(function(){An(null)},4e3);return function(){cancelAnimationFrame(e),window.clearTimeout(n),window.clearTimeout(t)}}},[kn]),r.useEffect(function(){var e;if(ze)if(ze.reviewId){var n=en.find(function(e){return e.id===ze.reviewId&&(!ze.type||e.kind===ze.type)});n&&pt(n)}else if(ze.classificationId){var t=en.find(function(e){return"page"===e.kind&&e.metadata.classification_id===ze.classificationId&&(!ze.type||e.kind===ze.type)});t&&pt(t)}else if(ze.pageNumber&&ze.type){var i=Number(ze.pageNumber);if(Number.isInteger(i)&&!(i<1)){var r=null===(e=ze.pageType)||void 0===e?void 0:e.trim().toLowerCase(),o=en.find(function(e){var n="page"===e.kind?e.pageNumber:e.segment.start_page,t="page"!==e.kind||!r||e.metadata.page_type===r;return n===i&&e.kind===ze.type&&t});o&&pt(o)}}},[ze,pt,en]);var wt=r.useCallback(function(){Nn.current=null,mn(!1),un(null),wn(null),null==Re||Re(null,null)},[Re]),ht=r.useCallback(function(e){var n;In(!1),An(null);var t=null!==(n=en.find(function(n){return!Gn.has(n.id)&&"boundary"===n.kind&&n.segment.start_page===e.startPage&&n.segment.end_page===e.endPage}))&&void 0!==n?n:en.find(function(n){return!Gn.has(n.id)&&n.segment.start_page<=e.startPage&&n.segment.end_page>=e.startPage});t?pt(t):(wt(),Bn.current+=1,yn({pageNumber:e.startPage,requestId:Bn.current}))},[wt,Gn,en,pt]),_t=r.useCallback(function(e){var n;if(se){var t=en.findIndex(function(n){return n.id===e}),i=new Set(en.map(function(e){return e.id})),r=null!==(n=en.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:en.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return pt(r)}):wt()}else wt()},[se,wt,en,pt,en]),yt=r.useCallback(function(e,n,i){return t.__awaiter(V,void 0,void 0,function(){var r,o,a,u,s,d,g,v,m;return t.__generator(this,function(t){switch(t.label){case 0:if(ke)return[2];if("boundary"===e.kind&&!ye)return[2];if("label"===e.kind&&!be)return[2];if("page"===e.kind&&!Se)return[2];r=S(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,s="boundary"===e.kind&&null!=ye&&se&&(u===l.BoundaryReviewActionEnum.SPLIT_HERE||u===l.BoundaryReviewActionEnum.MERGE_NEXT||u===l.BoundaryReviewActionEnum.MERGE_PREV||u===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),d=s?U.findIndex(function(n){return c.getSegmentReviewKey(n)===c.getSegmentReviewKey(e.segment)}):-1,s&&d>=0&&u&&(Ln.current={action:u,originalSegmentIndex:d,segmentSignature:JSON.stringify(U.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}),Cn(e.id),t.label=1;case 1:return t.trys.push([1,8,9,10]),"boundary"!==e.kind?[3,3]:[4,null==ye?void 0:ye(n,i,r)];case 2:return t.sent(),[3,7];case 3:return"label"!==e.kind?[3,5]:[4,null==be?void 0:be(n,i,r)];case 4:return t.sent(),[3,7];case 5:return"page"!==e.kind?[3,7]:[4,null==Se?void 0:Se(n,i,r)];case 6:t.sent(),t.label=7;case 7:return xn(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&&Ue(function(n){var t=new Map(n);return t.set(c.getSegmentReviewKey(e.segment),u),t}),Ln.current?(Ln.current.ready=!0,g&&(v=en.find(function(n){return"label"===n.kind&&c.getSegmentReviewKey(n.segment)===c.getSegmentReviewKey(e.segment)}))&&requestAnimationFrame(function(){return pt(v)})):_t(e.id),[3,10];case 8:return m=t.sent(),s&&(Ln.current=null),null==Ce||Ce(m,r),[3,10];case 9:return Cn(null),[7];case 10:return[2]}})})},[se,ke,Ce,ye,be,Se,en,U,pt,_t]);r.useEffect(function(){var e=Ln.current;if(null==e?void 0:e.ready){var n=JSON.stringify(U.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(U.map(function(e,n){return[c.getSegmentReviewKey(e,n),n]})),r=en.find(function(e){var n,r=i.get(c.getSegmentReviewKey(e.segment));return null!=r&&r>=t&&!h.isReviewStepResolved(e.review_step,e.segment)&&(!Sn.has(e.id)||!h.isReviewStepResolutionCurrent(e.review_step,e.segment))&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if(!r)return Ln.current=null,void wt();requestAnimationFrame(function(){Ln.current=null,pt(r)})}}},[wt,Sn,en,U,pt]),r.useEffect(function(){Ln.current||ln&&!en.some(function(e){return e.id===ln})&&wt()},[ln,wt,en]),r.useEffect(function(){if(le&&!Ln.current){var e=en.find(function(e){return e.pageNumber===rn});e&&e.id!==ln&&pt(e)}},[ln,le,rn,pt,en]),r.useEffect(function(){Ln.current||ln&&!en.some(function(e){var n;return e.id===ln&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&wt()},[ln,wt,en]);var bt=r.useMemo(function(){var e=en.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===ie)return e;var n=["low","medium","high"].filter(function(e){return e!==ne}),i=t.__spreadArray([ne],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(),s=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==s?i.length:null!==(l=r.get(s))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[ie,ne,en]),St=bt.findIndex(function(e){return e.id===dn}),xt=r.useState(null),Rt=xt[0],Et=xt[1],Ct=r.useRef(!1),Pt=r.useCallback(function(e){var n=bt[e];n&&pt(n)},[bt,pt]);r.useEffect(function(){dn&&!bt.some(function(e){return e.id===dn})&&gn(null)},[bt,dn]),r.useEffect(function(){Ct.current=!1,Et(St>=0?String(St+1):null)},[St,bt.length]),r.useEffect(function(){if(Ct.current&&null!=Rt){var e=window.setTimeout(function(){var e=Number(Rt.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<bt.length&&(Ct.current=!1,Pt(n))},300);return function(){return window.clearTimeout(e)}}},[Pt,Rt,bt.length]);var kt=r.useMemo(function(){var e=new Map;en.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=Xe.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},[en,Xe]),At=r.useMemo(function(){var e=new Map;en.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},[en]),Mt=r.useCallback(function(e){return{startPage:Math.max(0,e.startPage-ge),endPage:Math.min(e.numPages-1,e.endPage+ge)}},[ge]),jt=r.useCallback(function(){var e,n=Tn.current,t=qn.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();if(en.forEach(function(e){var n,r=Fn.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=At.get(e.id))&&void 0!==n?n:0,s=l.top+ve+40*u,d=s+(r.offsetHeight||32),g=s>=o.top&&d<=o.bottom;r.style.top="".concat(s-i.top,"px"),r.style.visibility=g?"visible":"hidden"}else r.style.visibility="hidden"}}),ln&&null==Nn.current){var a=Fn.current.get(ln);a&&"hidden"!==a.style.visibility&&wn(function(e){return e===a?e:a})}}},[ln,ve,At,en]),It=r.useCallback(function(e){var n=Nn.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(Nn.current=null,jt(),requestAnimationFrame(function(){if(null==Nn.current){var e=Fn.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&wn(e)}}))},[jt]);return r.useEffect(function(){var e=qn.current;if(e&&$){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,jt()}))};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()}}},[$,jt]),i.jsxs("div",t.__assign({ref:Tn,className:Te,style:t.__assign(t.__assign({},qe),{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:qn,style:t.__assign(t.__assign({},We),{flex:"1 1 auto",width:$?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:i.jsx(a.default,t.__assign({highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},Y,{defaultScale:void 0===J?null!==(W=null==Y?void 0:Y.defaultScale)&&void 0!==W?W:o.SpecialZoomLevel.PageFit:b[J],disablePdfAnnotations:Me,disablePdfTextLayer:Ie,pdfUrl:Z,pdfName:H,segments:nn,navigationRequest:_n,onNavigationSettled:It,setRenderRange:Mt,onCurrentPageChange:function(e){on(e),null==Nn.current&&Vn&&Vn.pageNumber!==e&&wt(),null==Ee||Ee(e)}}))})),$&&i.jsxs("aside",t.__assign({"aria-label":"Page review badges",ref:$e,style:t.__assign(t.__assign({},Ke),{position:"relative",width:Dn,maxWidth:y,flex:"0 1 ".concat(Dn),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[oe&&bt.length>0&&i.jsxs("nav",t.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:fe||"auto",left:we||"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!=Rt?Rt:"-","aria-label":"Review badge number",onChange:function(e){Ct.current=!0,Et(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(bt.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",bt.length]})),["previous","next"].map(function(e){var n="previous"===e,r=St+(n?-1:1),o=r<0||r>=bt.length;return i.jsx("button",t.__assign({type:"button","aria-label":"".concat(n?"Previous":"Next"," review badge"),disabled:o,onClick:function(){return Pt(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)})]})),en.map(function(e){var n,r,o=ln===e.id,a=null!==(n=kt.get(e.id))&&void 0!==n?n:"1A",l=e.review_step.score,u=e.review_step.confidence,s=h.formatScore(l,u),d="boundary"===e.kind?h.getBoundaryReviewActionBadgeLabel(e.review_step,e.segment,He.get(c.getSegmentReviewKey(e.segment))):"label"===e.kind?h.getTitleReviewActionBadgeLabel(e.review_step,e.segment,He.get(c.getSegmentReviewKey(e.segment))):null,g=null!=d?d:"N/A"===s?s:"".concat(s,"%"),f=!0===(null===(r=e.segment.confidence)||void 0===r?void 0:r.awaiting_llm),p=h.getConfidenceColors(l,u,f),w=Gn.has(e.id),_=f;return i.jsx(m.Tooltip,t.__assign({title:f?"data is being processed":"",arrow:!0},{children:i.jsx("span",t.__assign({ref:function(n){n?Fn.current.set(e.id,n):Fn.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":f?"".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 pt(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:d?w&&!f?115:90:w&&!f?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(w&&!f?"#E2E8F0":p.border),borderRadius:16,backgroundColor:w&&!f?"#F8FAFC":p.background,color:w&&!f?"#475569":p.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:w&&!f?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:p.divider,strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]}))]}))}))}))}),e.id)})]}))]})),Vn&&pn&&i.jsxs(u.default,t.__assign({anchorElement:pn,placement:"bottom-start",offset:{top:8},width:Math.min(Kn,y),maxWidth:y},{children:[vn&&i.jsx(s.default,{width:"100%",maxWidth:"100%",score:Vn.review_step.score,reasons:$n,reason:Vn.review_step.reason,gap:Vn.review_step.gap,onBack:function(){return mn(!1)},onClose:wt}),i.jsx("div",t.__assign({style:{display:vn?"none":"block"}},{children:Gn.has(Vn.id)?i.jsx(f.default,{width:"100%",maxWidth:"100%",headerName:"Split"===nt?"Split approved":"Merged"===nt?"Merge approved":"User approved",headerIcon:"Merged"===nt?i.jsx(v.GitMerge,{size:18,strokeWidth:2}):"Split"===nt?i.jsx(_.default,{width:18,height:18}):i.jsx(v.CircleCheck,{size:18,strokeWidth:2}),title:tt,pageNo:"Page ".concat(Vn.segment.start_page,"-").concat(Vn.segment.end_page),summary:vt?i.jsx(p.default,{icon:i.jsx(v.CircleCheck,{size:14,strokeWidth:2}),title:tt,pageRange:"Page ".concat(Vn.segment.start_page,"-").concat(Vn.segment.end_page),description:null!==(z=null===(K=Vn.review_step.summary)||void 0===K?void 0:K.trim())&&void 0!==z?z:"",revertData:vt,confirmDisabled:null==xe||!mt,showDocumentHeader:!1,onRevert:function(){if(!xe)throw new Error("SegmentReviewPdfWrapper requires onRevert to handle a revert confirmation.");if(!gt)throw new Error("There is no valid revert operation for this review.");var e=dt?"boundary":"label"===Vn.kind?"label":"boundary"===Vn.kind?"boundary":null,n=ot(gt.type);if(e&&n!==e)throw new Error("Cannot use ".concat(null!=n?n:"unknown"," revert metadata for this review. Expected ").concat(e,"."));return xe(gt,S(Vn))},onRevertError:function(e){null==Ce||Ce(e,S(Vn))},onRevertComplete:function(e){var n,t,i,r,o,a;xn(function(){return new Set}),Ue(function(){return new Map}),Vn.id;var l=null!==(n=vt.previousSegments[0])&&void 0!==n?n:vt.currentSegment,u=null==pn?void 0:pn.getBoundingClientRect(),s=null===(t=qn.current)||void 0===t?void 0:t.getBoundingClientRect(),d=Math.min(y,Math.max(220,Kn)),g=null!==(i=null==u?void 0:u.left)&&void 0!==i?i:(null!==(r=null==s?void 0:s.right)&&void 0!==r?r:window.innerWidth-d-8)+8,c=Math.max(8,Math.min(g,window.innerWidth-d-8)),v=null==(null==u?void 0:u.bottom)?Math.max(8,null!==(o=null==s?void 0:s.top)&&void 0!==o?o:8):u.bottom+8;xn(function(){return new Set}),Ln.current=null,In(!1),An({title:"Split"===nt?"Split reverted":"Merged"===nt?"Merge reverted":"Approval reverted",description:(null===(a=null==e?void 0:e.message)||void 0===a?void 0:a.trim())||("Split"===nt?"Pages ".concat(Vn.segment.start_page,"-").concat(Vn.segment.end_page," are now part of “Advice of Award” again. Review the boundary and title to confirm the document."):"Merged"===nt?"The documents have been separated again. Review their boundaries and titles to confirm them.":"“".concat(tt,"” is pending review again. Review the boundary and title to confirm the document.")),segment:l,position:{top:v,left:c,width:d}}),wt()}},Vn.id):void 0,cognitiveScore:Vn.review_step.score,styles:{root:{borderColor:"#16A34A"},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:"#16A34A"}}},onCognitiveClick:et?function(){mn(!0),null==Fe||Fe(S(Vn))}:void 0,onClose:wt}):"boundary"===Vn.kind?i.jsx(l.default,{width:"100%",maxWidth:"100%",title:Vn.segment.label||Vn.segment.title,pageNo:"Page ".concat(Vn.pageNumber),content:null!==(O=Vn.review_step.question)&&void 0!==O?O:null,revertSummary:ct,cognitiveScore:Vn.review_step.score,metadata:Vn.metadata,reviewAction:null!==(D=Vn.segment.review_action)&&void 0!==D?D:void 0,previousSegmentTitle:Yn,nextSegmentTitle:Jn,manualPrompt:null!=_e?_e:"Set a custom boundary",defaultStartPage:Vn.segment.start_page,defaultEndPage:Vn.segment.end_page,styles:{root:{borderColor:Qn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Qn.text}}},confirmDisabled:ke||!ye||En===Vn.id,onConfirm:function(e,n,t){t&&l.isBoundaryReviewAction(n.id)&&yt(Vn,n.id,t)},onAdjustManually:function(){return null==Le?void 0:Le(S(Vn))},onCognitiveClick:et?function(){mn(!0),null==Fe||Fe(S(Vn))}:void 0,onClose:wt},Vn.id):"label"===Vn.kind?i.jsx(d.default,{width:"100%",maxWidth:"100%",title:Vn.metadata.current_label||Vn.segment.label||Vn.segment.title,pageNo:"Pages ".concat(Vn.segment.start_page,"-").concat(Vn.segment.end_page),content:null!==(G=Vn.review_step.question)&&void 0!==G?G:null,revertSummary:ct,cognitiveScore:Vn.review_step.score,metadata:Vn.metadata,styles:{root:{borderColor:Qn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Qn.text}}},confirmDisabled:ke||!be||En===Vn.id,confirmationBlocked:Zn,confirmationWarning:Zn?"Please confirm the boundary before confirming the title.":void 0,onActionConfirm:function(e,n){yt(Vn,e,n)},onAdjustManually:function(){return null==Le?void 0:Le(S(Vn))},onCognitiveClick:et?function(){mn(!0),null==Fe||Fe(S(Vn))}:void 0,onClose:wt},Vn.id):i.jsx(g.default,{width:"100%",maxWidth:"100%",title:Vn.segment.label||Vn.segment.title,pageNo:"Page ".concat(Vn.pageNumber),content:Vn.review_step.reason,cognitiveScore:Vn.review_step.score,pageType:Vn.metadata.page_type,metadata:Vn.metadata,styles:{root:{borderColor:Qn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Qn.text}}},confirmDisabled:ke||!Se||En===Vn.id,onActionConfirm:function(e,n){yt(Vn,e,n)},onCognitiveClick:et?function(){mn(!0),null==Fe||Fe(S(Vn))}:void 0,onClose:wt},Vn.id)}))]})),kn&&i.jsx(m.Portal,{children:i.jsx(m.Box,t.__assign({"aria-live":"polite",sx:{position:"fixed",top:kn.position.top,left:kn.position.left,zIndex:1600,width:kn.position.width,maxWidth:"calc(100vw - 16px)",opacity:jn?1:0,transform:jn?"translateY(0)":"translateY(-6px)",transition:"opacity 500ms ease, transform 500ms ease",filter:"drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18))",pointerEvents:jn?"auto":"none"}},{children:i.jsx(w.default,{title:kn.title,description:kn.description,onReview:function(){return ht(kn.segment)}})}))})]}))};
2
2
  //# sourceMappingURL=SegmentReviewPdfWrapper.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("./reviewStepAdapters.js"),n=function(e){if(null==e)return null;if("number"==typeof e)return Number.isFinite(e)?e:null;var r=e.trim();if(!r)return null;var n=Number.parseFloat(r);return Number.isFinite(n)?n:null},t=function(e){switch(null==e?void 0:e.trim().toLowerCase()){case"low":return 40;case"medium":return 70;case"high":return 95;default:return null}},u=function(e,r){var u;return null!==(u=n(e))&&void 0!==u?u:t(r)},i=function(e){switch(null==e?void 0:e.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"Split";case"MERGE":case"MERGE_NEXT":case"MERGE_PREV":case"MERGE_PREVIOUS":return"Merged";default:return null}},o=function(e){switch(null==e?void 0:e.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"SPLIT_HERE";case"MERGE_NEXT":return"MERGE_NEXT";case"MERGE_PREV":case"MERGE_PREVIOUS":return"MERGE_PREV";default:return null}},a=function(e){var r=e.type.trim().toLowerCase();return"page_boundary"===r||"page boundary review"===r},l=function(r){var n,t,u,o=(null!==(n=r.review_steps)&&void 0!==n?n:[]).filter(a);return null!==(u=null!==(t=e.__spreadArray([],o,!0).reverse().find(function(e){return null!=i(e.human_action_enum)}))&&void 0!==t?t:e.__spreadArray([],o,!0).reverse().find(s))&&void 0!==u?u:o[o.length-1]},d=function(e){var r,n,t,u;return null!==(t=null!==(r=i(e.human_action_enum))&&void 0!==r?r:i(null===(n=e.human_resolution)||void 0===n?void 0:n.action))&&void 0!==t?t:i(null===(u=e.review)||void 0===u?void 0:u.action)},v=function(e,r){var n,t=e.type.trim().toLowerCase();if(!("label"===t||"label review"===t))return!0;var u=null===(n=e.human_resolution)||void 0===n?void 0:n.segment_version,i=r.version;return null==u||null==i||u===i},s=function(e){var r,n,t,u;return null!=i(e.human_action_enum)||null!=i(null===(r=e.human_resolution)||void 0===r?void 0:r.action)||null!=i(null===(n=e.review)||void 0===n?void 0:n.action)||!0===(null===(u=null===(t=e.metadata)||void 0===t?void 0:t.performed_actions)||void 0===u?void 0:u.some(function(e){return null!=i(e.action)}))},c=function(r){var n,t,u,a,d,v,s=l(r);if(!s)return null;var c=o(null===(n=s.human_resolution)||void 0===n?void 0:n.action),_=null===(t=s.human_resolution)||void 0===t?void 0:t.after,p=(null==_?void 0:_.start_page)===r.start_page&&(null==_?void 0:_.end_page)===r.end_page;if("SPLIT_HERE"===c)return p?null:"Split";if("MERGE_NEXT"===c||"MERGE_PREV"===c)return p?"Merged":null;var f=i(s.human_action_enum);if(f)return f;var g=i(null===(u=s.review)||void 0===u?void 0:u.action);if(g)return g;var m=e.__spreadArray([],null!==(a=r.human_action_log)&&void 0!==a?a:[],!0).filter(function(e){return null!=i(e.action)}).sort(function(e,r){return r.human_revision-e.human_revision||r.performed_at.localeCompare(e.performed_at)})[0];if(!m)return null;var E=i(m.action),R=(null===(d=m.after)||void 0===d?void 0:d.start_page)===r.start_page&&(null===(v=m.after)||void 0===v?void 0:v.end_page)===r.end_page;return"Split"===E?R?null:E:R?E:null},_=function(e,r){var n,t,u,a,d,v,s=o(r),_=l(e),p=null!==(u=null!==(n=o(null==_?void 0:_.human_action_enum))&&void 0!==n?n:o(null===(t=null==_?void 0:_.human_resolution)||void 0===t?void 0:t.action))&&void 0!==u?u:o(null===(a=null==_?void 0:_.review)||void 0===a?void 0:a.action),f=i(r),g=null===(d=null==_?void 0:_.human_resolution)||void 0===d?void 0:d.after,m="SPLIT_HERE"===s&&null!=(null===(v=null==_?void 0:_.human_resolution)||void 0===v?void 0:v.action)&&(null==g?void 0:g.start_page)===e.start_page&&(null==g?void 0:g.end_page)===e.end_page;return null!=s&&p===s&&null!=f&&(m||c(e)===f)};exports.formatScore=function(e,r){var n=u(e,r);return null==n?"N/A":Number.isInteger(n)?String(n):n.toFixed(2).replace(/\.?0+$/,"")},exports.getBoundaryReviewActionBadgeLabel=function(e,r,n){var t,u;return null!==(u=null!==(t=i(n))&&void 0!==t?t:d(e))&&void 0!==u?u:c(r)},exports.getConfidenceColors=function(e,r,t){var u={border:"#E5E7EB",cardBorder:"#374151",background:"#F9FAFB",text:"#374151",divider:"#D1D5DB"};if(t)return u;var i={border:"#FECACA",cardBorder:"#B91C1C",background:"#FEF2F2",text:"#B91C1C",divider:"#FCA5A5"},o={border:"#d9cda2",cardBorder:"#997800",background:"#fff1bf",text:"#997800",divider:"#e6b400"},a={border:"#16A34A",cardBorder:"#4F9E6C",background:"#F0FDF4",text:"#4F9E6C",divider:"#00A43C"};switch(function(e){var r=null==e?void 0:e.trim().toLowerCase();return"low"===r||"medium"===r||"high"===r?r:null}(r)){case"low":return i;case"medium":return o;case"high":return a}var l=n(e);return null!=l&&l<=40?i:null!=l&&l<=70?o:null!=l?a:u},exports.getFallbackScore=t,exports.getHumanActionBadgeLabel=i,exports.getNumericScore=n,exports.getOptimisticMergeImpactedSegmentKeys=function(n,t){var u=e.__spreadArray([],n,!0).sort(function(e,r){return e.start_page-r.start_page||e.end_page-r.end_page}),i=new Set;return t.forEach(function(e,n){var t=u.findIndex(function(e){return r.getSegmentReviewKey(e)===n});if(!(t<0)){var a=u[t];if(!_(a,e)){var l=o(e),d=u["MERGE_PREV"===l?t-1:"MERGE_NEXT"===l?t+1:-1];d&&i.add(r.getSegmentReviewKey(d))}}}),i},exports.getPendingMergeImpactedSegmentKeys=function(n){var t=e.__spreadArray([],n,!0).sort(function(e,r){return e.start_page-r.start_page||e.end_page-r.end_page}),u=new Set;return t.forEach(function(e,n){var i,l=(null!==(i=e.review_steps)&&void 0!==i?i:[]).find(function(r){var n,t,u;if(!a(r))return!1;var i=o(r.human_action_enum),l=o(null===(n=r.human_resolution)||void 0===n?void 0:n.action),d=null===(t=r.human_resolution)||void 0===t?void 0:t.before,v=null===(u=r.human_resolution)||void 0===u?void 0:u.after,s=null!=(null==d?void 0:d.start_page)&&null!=d.end_page&&null!=(null==v?void 0:v.start_page)&&null!=v.end_page&&(d.start_page!==v.start_page||d.end_page!==v.end_page),c=(null==v?void 0:v.start_page)===e.start_page&&(null==v?void 0:v.end_page)===e.end_page;return("MERGE_NEXT"===i||"MERGE_PREV"===i)&&!(l===i&&s&&c)});if(l){var d=o(l.human_action_enum),v=t["MERGE_PREV"===d?n-1:n+1];v&&u.add(r.getSegmentReviewKey(v))}}),u},exports.getResolvedScore=u,exports.getReviewStepActionBadgeLabel=d,exports.getStructuralResultBadgeLabel=c,exports.getTitleReviewActionBadgeLabel=function(e,r,n){var t=i(n);if(t)return t;var u=d(e);return u||c(r)},exports.hasPolledStructuralAction=_,exports.hasStructuralBoundaryAction=s,exports.isReviewStepResolutionCurrent=v,exports.isReviewStepResolved=function(e,r){var n,t,u;if(!v(e,r))return!1;if(null!=(null===(n=e.review)||void 0===n?void 0:n.action))return!0;var i=null===(u=null===(t=e.human_resolution)||void 0===t?void 0:t.state)||void 0===u?void 0:u.trim().toLowerCase();return"resolved_by_human"===i||"approved"===i||"confirmed"===i},exports.shouldHideStructuralBoundaryReview=function(e,r,n,t){var u=i(t);if("Merged"===u)return n;if("Split"===u)return!0;var o=d(e);return"Split"===o||"Merged"===o&&("Merged"!==c(r)||n)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("./reviewStepAdapters.js"),n=function(e){if(null==e)return null;if("number"==typeof e)return Number.isFinite(e)?e:null;var r=e.trim();if(!r)return null;var n=Number.parseFloat(r);return Number.isFinite(n)?n:null},t=function(e){switch(null==e?void 0:e.trim().toLowerCase()){case"low":return 40;case"medium":return 70;case"high":return 95;default:return null}},u=function(e,r){var u;return null!==(u=n(e))&&void 0!==u?u:t(r)},i=function(e){switch(null==e?void 0:e.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"Split";case"MERGE":case"MERGE_NEXT":case"MERGE_PREV":case"MERGE_PREVIOUS":return"Merged";default:return null}},o=function(e){var r,n,t,u;if(![e.human_action_enum,null===(r=e.human_resolution)||void 0===r?void 0:r.action,null===(n=e.review)||void 0===n?void 0:n.action].some(function(e){return"SET_RANGE"===(null==e?void 0:e.trim().toUpperCase())}))return null;var i=null===(t=e.human_resolution)||void 0===t?void 0:t.before,o=null===(u=e.human_resolution)||void 0===u?void 0:u.after;if(null==(null==i?void 0:i.start_page)||null==i.end_page||null==(null==o?void 0:o.start_page)||null==o.end_page)return null;var a=o.start_page<i.start_page||o.end_page>i.end_page,l=o.start_page>i.start_page||o.end_page<i.end_page;if(a&&!l)return"Merged";if(l&&!a)return"Split";var d=i.end_page-i.start_page+1,v=o.end_page-o.start_page+1;return v>d?"Merged":v<d?"Split":null},a=function(e){switch(null==e?void 0:e.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"SPLIT_HERE";case"MERGE_NEXT":return"MERGE_NEXT";case"MERGE_PREV":case"MERGE_PREVIOUS":return"MERGE_PREV";case"SET_RANGE":return"SET_RANGE";default:return null}},l=function(e){var r=e.type.trim().toLowerCase();return"page_boundary"===r||"page boundary review"===r},d=function(r){var n,t,u,o=(null!==(n=r.review_steps)&&void 0!==n?n:[]).filter(l);return null!==(u=null!==(t=e.__spreadArray([],o,!0).reverse().find(function(e){return null!=i(e.human_action_enum)}))&&void 0!==t?t:e.__spreadArray([],o,!0).reverse().find(_))&&void 0!==u?u:o[o.length-1]},v=function(e){var r,n,t,u,a;return null!==(u=null!==(n=null!==(r=o(e))&&void 0!==r?r:i(e.human_action_enum))&&void 0!==n?n:i(null===(t=e.human_resolution)||void 0===t?void 0:t.action))&&void 0!==u?u:i(null===(a=e.review)||void 0===a?void 0:a.action)},s=function(e,r){var n,t=e.type.trim().toLowerCase();if(!("label"===t||"label review"===t))return!0;var u=null===(n=e.human_resolution)||void 0===n?void 0:n.segment_version,i=r.version;return null==u||null==i||u===i},_=function(e){var r,n,t,u;return null!=i(e.human_action_enum)||null!=i(null===(r=e.human_resolution)||void 0===r?void 0:r.action)||null!=i(null===(n=e.review)||void 0===n?void 0:n.action)||!0===(null===(u=null===(t=e.metadata)||void 0===t?void 0:t.performed_actions)||void 0===u?void 0:u.some(function(e){return null!=i(e.action)}))},c=function(r){var n,t,u,l,v,s,_=d(r);if(!_)return null;var c=a(null===(n=_.human_resolution)||void 0===n?void 0:n.action),p=null===(t=_.human_resolution)||void 0===t?void 0:t.after,g=(null==p?void 0:p.start_page)===r.start_page&&(null==p?void 0:p.end_page)===r.end_page,f=o(_);if(f)return g?f:null;if("SPLIT_HERE"===c)return g?null:"Split";if("MERGE_NEXT"===c||"MERGE_PREV"===c)return g?"Merged":null;var m=i(_.human_action_enum);if(m)return m;var E=i(null===(u=_.review)||void 0===u?void 0:u.action);if(E)return E;var R=e.__spreadArray([],null!==(l=r.human_action_log)&&void 0!==l?l:[],!0).filter(function(e){return null!=i(e.action)}).sort(function(e,r){return r.human_revision-e.human_revision||r.performed_at.localeCompare(e.performed_at)})[0];if(!R)return null;var h=i(R.action),S=(null===(v=R.after)||void 0===v?void 0:v.start_page)===r.start_page&&(null===(s=R.after)||void 0===s?void 0:s.end_page)===r.end_page;return"Split"===h?S?null:h:S?h:null},p=function(e,r){var n,t,u,o,l,v,s=a(r),_=d(e),p=null!==(u=null!==(n=a(null==_?void 0:_.human_action_enum))&&void 0!==n?n:a(null===(t=null==_?void 0:_.human_resolution)||void 0===t?void 0:t.action))&&void 0!==u?u:a(null===(o=null==_?void 0:_.review)||void 0===o?void 0:o.action),g=i(r),f=null===(l=null==_?void 0:_.human_resolution)||void 0===l?void 0:l.after,m="SPLIT_HERE"===s&&null!=(null===(v=null==_?void 0:_.human_resolution)||void 0===v?void 0:v.action)&&(null==f?void 0:f.start_page)===e.start_page&&(null==f?void 0:f.end_page)===e.end_page;return null!=s&&p===s&&null!=g&&(m||c(e)===g)};exports.formatScore=function(e,r){var n=u(e,r);return null==n?"N/A":Number.isInteger(n)?String(n):n.toFixed(2).replace(/\.?0+$/,"")},exports.getBoundaryReviewActionBadgeLabel=function(e,r,n){var t,u;return null!==(u=null!==(t=i(n))&&void 0!==t?t:v(e))&&void 0!==u?u:c(r)},exports.getConfidenceColors=function(e,r,t){var u={border:"#E5E7EB",cardBorder:"#374151",background:"#F9FAFB",text:"#374151",divider:"#D1D5DB"};if(t)return u;var i={border:"#FECACA",cardBorder:"#B91C1C",background:"#FEF2F2",text:"#B91C1C",divider:"#FCA5A5"},o={border:"#d9cda2",cardBorder:"#997800",background:"#fff1bf",text:"#997800",divider:"#e6b400"},a={border:"#16A34A",cardBorder:"#4F9E6C",background:"#F0FDF4",text:"#4F9E6C",divider:"#00A43C"};switch(function(e){var r=null==e?void 0:e.trim().toLowerCase();return"low"===r||"medium"===r||"high"===r?r:null}(r)){case"low":return i;case"medium":return o;case"high":return a}var l=n(e);return null!=l&&l<=40?i:null!=l&&l<=70?o:null!=l?a:u},exports.getFallbackScore=t,exports.getHumanActionBadgeLabel=i,exports.getNumericScore=n,exports.getOptimisticMergeImpactedSegmentKeys=function(n,t){var u=e.__spreadArray([],n,!0).sort(function(e,r){return e.start_page-r.start_page||e.end_page-r.end_page}),i=new Set;return t.forEach(function(e,n){var t=u.findIndex(function(e){return r.getSegmentReviewKey(e)===n});if(!(t<0)){var o=u[t];if(!p(o,e)){var l=a(e),d=u["MERGE_PREV"===l?t-1:"MERGE_NEXT"===l?t+1:-1];d&&i.add(r.getSegmentReviewKey(d))}}}),i},exports.getPendingMergeImpactedSegmentKeys=function(n){var t=e.__spreadArray([],n,!0).sort(function(e,r){return e.start_page-r.start_page||e.end_page-r.end_page}),u=new Set;return t.forEach(function(e,n){var i,o=(null!==(i=e.review_steps)&&void 0!==i?i:[]).find(function(r){var n,t,u;if(!l(r))return!1;var i=a(r.human_action_enum),o=a(null===(n=r.human_resolution)||void 0===n?void 0:n.action),d=null===(t=r.human_resolution)||void 0===t?void 0:t.before,v=null===(u=r.human_resolution)||void 0===u?void 0:u.after,s=null!=(null==d?void 0:d.start_page)&&null!=d.end_page&&null!=(null==v?void 0:v.start_page)&&null!=v.end_page&&(d.start_page!==v.start_page||d.end_page!==v.end_page),_=(null==v?void 0:v.start_page)===e.start_page&&(null==v?void 0:v.end_page)===e.end_page;return("MERGE_NEXT"===i||"MERGE_PREV"===i)&&!(o===i&&s&&_)});if(o){var d=a(o.human_action_enum),v=t["MERGE_PREV"===d?n-1:n+1];v&&u.add(r.getSegmentReviewKey(v))}}),u},exports.getResolvedScore=u,exports.getReviewStepActionBadgeLabel=v,exports.getStructuralResultBadgeLabel=c,exports.getTitleReviewActionBadgeLabel=function(e,r,n){var t=i(n);if(t)return t;var u=v(e);return u||c(r)},exports.hasPolledStructuralAction=p,exports.hasStructuralBoundaryAction=_,exports.isReviewStepResolutionCurrent=s,exports.isReviewStepResolved=function(e,r){var n,t,u;if(!s(e,r))return!1;if(null!=(null===(n=e.review)||void 0===n?void 0:n.action))return!0;var i=null===(u=null===(t=e.human_resolution)||void 0===t?void 0:t.state)||void 0===u?void 0:u.trim().toLowerCase();return"resolved_by_human"===i||"approved"===i||"confirmed"===i},exports.shouldHideStructuralBoundaryReview=function(e,r,n,t){var u=i(t);if("Merged"===u)return n;if("Split"===u)return!0;var o=v(e);return"Split"===o||"Merged"===o&&("Merged"!==c(r)||n)};
2
2
  //# sourceMappingURL=helper.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as n}from"react/jsx-runtime";import{useState as t,useRef as i,useLayoutEffect as o}from"react";import l from"@mui/material/Box";import r from"@mui/material/Popper";function a(a){var d,u,c=a.anchorRef,s=a.anchorElement,m=a.children,f=a.className,v=a.offset,h=void 0===v?{}:v,p=a.placement,x=void 0===p?"bottom-start":p,w=a.width,b=a.maxWidth;a.customStyles;var g=t(null),z=g[0],y=g[1],E=t(!0),R=E[0],W=E[1],A=t(null),O=A[0],S=A[1],F=t(null),H=F[0],L=F[1],B=i(null);return o(function(){var e,n=null!==(e=null!=s?s:null==c?void 0:c.current)&&void 0!==e?e:null;y(function(e){return e===n?e:n})},[s,c]),o(function(){if(z){var e=null,n=function(){var n,t,i=z.getBoundingClientRect(),o=null!==(t=null===(n=window.visualViewport)||void 0===n?void 0:n.height)&&void 0!==t?t:window.innerHeight;W(z.isConnected&&"hidden"!==z.style.visibility),S(Math.max(0,window.innerWidth-i.left-8)),L(Math.max(0,o-i.top-2*i.height)),null!=e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){var n;e=null,null===(n=B.current)||void 0===n||n.update()})},t=new MutationObserver(n);t.observe(z,{attributes:!0,attributeFilter:["style","class"]});var i="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==i||i.observe(z),window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),n(),function(){t.disconnect(),null==i||i.disconnect(),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0),null!=e&&cancelAnimationFrame(e)}}W(!1)},[z]),n(r,e({open:Boolean(z)&&R,anchorEl:z,popperRef:B,placement:x,className:f,popperOptions:{strategy:"fixed"},modifiers:[{name:"offset",options:{offset:[null!==(d=h.left)&&void 0!==d?d:0,null!==(u=h.top)&&void 0!==u?u:0]}},{name:"flip",enabled:!1},{name:"preventOverflow",options:{mainAxis:!1,altAxis:!0,tether:!1}}],sx:{zIndex:function(e){return e.zIndex.tooltip},width:w,maxWidth:null==O?b:"min(".concat("number"==typeof b?"".concat(b,"px"):null!=b?b:"100vw",", ").concat(O,"px)"),minWidth:0,height:"fit-content",maxHeight:null==H?"calc(85vh - 10px)":"".concat(H-100,"px"),alignSelf:"flex-start",flex:"0 0 auto",overflowX:"hidden",overflowY:"hidden",borderRadius:2,boxShadow:function(e){return e.shadows[4]},boxSizing:"border-box"}},{children:n(l,e({sx:{width:"100%",maxWidth:"100%",minWidth:0,height:"fit-content",minHeight:0,maxHeight:null==H?"calc(85vh - 10px)":"".concat(H-100,"px"),overflowX:"hidden",overflowY:"auto",pointerEvents:"auto",boxSizing:"border-box"}},{children:m}))}))}export{a as default};
1
+ import{__assign as e}from"tslib";import{jsx as n}from"react/jsx-runtime";import{useState as t,useRef as i,useLayoutEffect as o}from"react";import l from"@mui/material/Box";import r from"@mui/material/Popper";function a(a){var d,u,c=a.anchorRef,s=a.anchorElement,m=a.children,f=a.className,v=a.offset,h=void 0===v?{}:v,p=a.placement,x=void 0===p?"bottom-start":p,w=a.width,b=a.maxWidth;a.customStyles;var g=a.fallbackMaxHeightVh,z=void 0===g?85:g,y=a.heightBuffer,E=void 0===y?100:y,R=t(null),W=R[0],A=R[1],H=t(!0),O=H[0],S=H[1],B=t(null),F=B[0],L=B[1],M=t(null),C=M[0],I=M[1],N=i(null);return o(function(){var e,n=null!==(e=null!=s?s:null==c?void 0:c.current)&&void 0!==e?e:null;A(function(e){return e===n?e:n})},[s,c]),o(function(){if(W){var e=null,n=function(){var n,t,i=W.getBoundingClientRect(),o=null!==(t=null===(n=window.visualViewport)||void 0===n?void 0:n.height)&&void 0!==t?t:window.innerHeight;S(W.isConnected&&"hidden"!==W.style.visibility),L(Math.max(0,window.innerWidth-i.left-8)),I(Math.max(0,o-i.top-2*i.height)),null!=e&&cancelAnimationFrame(e),e=requestAnimationFrame(function(){var n;e=null,null===(n=N.current)||void 0===n||n.update()})},t=new MutationObserver(n);t.observe(W,{attributes:!0,attributeFilter:["style","class"]});var i="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==i||i.observe(W),window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),n(),function(){t.disconnect(),null==i||i.disconnect(),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0),null!=e&&cancelAnimationFrame(e)}}S(!1)},[W]),n(r,e({open:Boolean(W)&&O,anchorEl:W,popperRef:N,placement:x,className:f,popperOptions:{strategy:"fixed"},modifiers:[{name:"offset",options:{offset:[null!==(d=h.left)&&void 0!==d?d:0,null!==(u=h.top)&&void 0!==u?u:0]}},{name:"flip",enabled:!1},{name:"preventOverflow",options:{mainAxis:!1,altAxis:!0,tether:!1}}],sx:{zIndex:function(e){return e.zIndex.tooltip},width:w,maxWidth:null==F?b:"min(".concat("number"==typeof b?"".concat(b,"px"):null!=b?b:"100vw",", ").concat(F,"px)"),minWidth:0,height:"fit-content",maxHeight:null==C?"calc(".concat(z,"vh - 10px)"):"".concat(C-E,"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:n(l,e({sx:{width:"100%",maxWidth:"100%",minWidth:0,height:"fit-content",minHeight:0,maxHeight:null==C?"calc(".concat(z,"vh - 10px)"):"".concat(C-E,"px"),overflowX:"hidden",overflowY:"auto",pointerEvents:"auto",boxSizing:"border-box"}},{children:m}))}))}export{a as default};
2
2
  //# sourceMappingURL=CardWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i,__spreadArray as e}from"tslib";import{jsx as t,jsxs as n}from"react/jsx-runtime";import o from"@mui/icons-material/ChevronLeft";import r from"@mui/icons-material/Close";import l from"@mui/material/Box";import a from"@mui/material/Divider";import m from"@mui/material/IconButton";import s from"@mui/material/Paper";import c from"@mui/material/Stack";import h from"@mui/material/Typography";import d from"../CitationRenderer/MarkdownRenderer.js";import u from"./CognitiveIcon.js";import g from"./CognitiveScoreBadge.js";var p=function(i,t){return e([i],Array.isArray(t)?t:null==t?[]:[t],!0)};function f(e){var f=e.reasons,x=e.reason,v=e.gap,y=e.score,b=e.headerName,C=void 0===b?"Cognitive Integrity":b,S=e.onBack,H=e.onClose,w=e.showCloseButton,z=void 0===w||w,k=e.width,B=void 0===k?260:k,W=e.maxWidth,A=void 0===W?260:W,R=e.className,I=e.styles,j=(null!=f?f:[]).filter(function(i){return"evidence"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),F=(null!=f?f:[]).filter(function(i){return"gap"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),D=null==x?void 0:x.trim(),E=null==v?void 0:v.trim();if(0===j.length&&D&&j.push(D),0===F.length&&E&&F.push(E),0===j.length&&0===F.length)return null;var L,M=(L=null==I?void 0:I.markdown,i(i({},L),{containerWrapper:i(i({},null==L?void 0:L.containerWrapper),{display:"block",height:"auto",minHeight:0,maxHeight:"fit-content",flex:"0 0 auto"}),mainCard:i(i({},null==L?void 0:L.mainCard),{height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto",padding:0,border:"none",borderRadius:0,boxShadow:"none",backgroundColor:"transparent"}),scrollArea:i({height:"auto",minHeight:0,maxHeight:"none",overflowY:"visible",paddingRight:0,color:"#475467",fontSize:11.5,lineHeight:1.3},null==L?void 0:L.scrollArea),list:i({margin:"0",padding:"0 0 0 18px",fontSize:"11.5px",lineHeight:"1.3"},null==L?void 0:L.list)})),N=i(i({},M),{scrollArea:i(i({},M.scrollArea),{fontSize:"inherit",lineHeight:"inherit"}),summary:i(i({},M.summary),{display:"inline-flex",padding:0,fontSize:"inherit",lineHeight:"inherit"})}),T={m:0,pl:2.25,listStyleType:"decimal",listStylePosition:"outside",fontSize:11.5,lineHeight:1.3,"& > li":{pl:.25,fontSize:"inherit",lineHeight:"inherit"},"& > li::marker":{fontSize:"1em",fontWeight:"inherit"}};return t(s,i({className:R,elevation:4,sx:p({width:B,maxWidth:A,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==I?void 0:I.root)},{children:n(c,i({spacing:.75,sx:{p:1,height:"auto",minHeight:0}},{children:[n(c,i({direction:"row",alignItems:"center",spacing:.75,sx:null==I?void 0:I.header},{children:[S&&t(m,i({size:"small",onClick:S,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:t(o,{sx:{fontSize:17}})})),t(u,{sx:{color:"#6941C6"}}),t(h,i({sx:{flex:1,fontSize:12,fontWeight:500,alignItems:"center",display:"flex",lineHeight:1.25,textTransform:"capitalise"}},{children:C})),t(g,{score:y}),z&&t(m,i({size:"small",onClick:H,disabled:!H,"aria-label":"Close cognitive integrity",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:t(r,{sx:{fontSize:17}})}))]})),t(a,{sx:{m:0}}),t(l,i({sx:p({bgcolor:"#F9FAFB",px:1.5,py:1.5,height:"auto",minHeight:0,flex:"0 0 auto"},null==I?void 0:I.content)},{children:n(c,i({spacing:1.5},{children:[j.length>0&&n(l,{children:[t(h,i({sx:{mb:.75,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.25}},{children:"Decision Making Factors"})),t(l,i({component:"ol",sx:T,style:M.list},{children:j.map(function(e,n){return t(l,i({component:"li",sx:{mb:.375,pl:.25}},{children:t(d,{value:"<summary>".concat(e,"</summary>"),styles:N})}),"evidence-".concat(n))})}))]}),j.length>0&&F.length>0&&t(a,{sx:{my:0,borderColor:"#E5E7EB"}}),F.length>0&&n(l,{children:[t(h,i({sx:{mb:.75,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.25}},{children:"Gaps in Decision"})),t(l,i({component:"ol",sx:T,style:M.list},{children:F.map(function(e,n){return t(l,i({component:"li",sx:{mb:.375,pl:.25}},{children:t(d,{value:"<summary>".concat(e,"</summary>"),styles:N})}),"gap-".concat(n))})}))]})]}))}))]}))}))}export{f as default};
1
+ import{__assign as i,__spreadArray as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import n from"@mui/icons-material/ChevronLeft";import r from"@mui/icons-material/Close";import l from"@mui/material/Box";import a from"@mui/material/Divider";import m from"@mui/material/IconButton";import c from"@mui/material/Paper";import s from"@mui/material/Stack";import h from"@mui/material/Typography";import d from"../CitationRenderer/MarkdownRenderer.js";import g from"./CognitiveIcon.js";import p from"./CognitiveScoreBadge.js";var u=function(i,t){return e([i],Array.isArray(t)?t:null==t?[]:[t],!0)};function f(e){var f=e.reasons,x=e.reason,v=e.gap,b=e.score,y=e.headerName,C=void 0===y?"Cognitive Integrity":y,H=e.onBack,S=e.onClose,z=e.showCloseButton,w=void 0===z||z,k=e.width,B=void 0===k?260:k,A=e.maxWidth,W=void 0===A?260:A,R=e.className,I=e.styles,j=(null!=f?f:[]).filter(function(i){return"evidence"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),F=(null!=f?f:[]).filter(function(i){return"gap"===i.type.trim().toLowerCase()}).map(function(i){return i.text.trim()}).filter(Boolean),D=null==x?void 0:x.trim(),E=null==v?void 0:v.trim();if(0===j.length&&D&&j.push(D),0===F.length&&E&&F.push(E),0===j.length&&0===F.length)return null;var L,M=(L=null==I?void 0:I.markdown,i(i({},L),{containerWrapper:i(i({},null==L?void 0:L.containerWrapper),{display:"block",height:"auto",minHeight:0,maxHeight:"fit-content",flex:"0 0 auto"}),mainCard:i(i({},null==L?void 0:L.mainCard),{height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto",padding:0,border:"none",borderRadius:0,boxShadow:"none",backgroundColor:"transparent"}),scrollArea:i({height:"auto",minHeight:0,maxHeight:"none",overflowY:"visible",paddingRight:0,color:"#475467",fontSize:11.5,lineHeight:1.3},null==L?void 0:L.scrollArea),list:i({margin:"0",padding:"0 0 0 18px",fontSize:"11.5px",lineHeight:"1.3"},null==L?void 0:L.list)})),N=i(i({},M),{scrollArea:i(i({},M.scrollArea),{fontSize:"inherit",lineHeight:"inherit"}),summary:i(i({},M.summary),{display:"inline-flex",padding:0,fontSize:"inherit",lineHeight:"inherit"})});return t(c,i({className:R,elevation:4,sx:u({width:B,maxWidth:W,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==I?void 0:I.root)},{children:o(s,i({spacing:.75,sx:{p:1,height:"auto",minHeight:0}},{children:[o(s,i({direction:"row",alignItems:"center",spacing:.75,sx:null==I?void 0:I.header},{children:[H&&t(m,i({size:"small",onClick:H,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:t(n,{sx:{fontSize:17}})})),t(g,{sx:{color:"#6941C6"}}),t(h,i({sx:{flex:1,fontSize:12,fontWeight:500,alignItems:"center",display:"flex",lineHeight:1.25,textTransform:"capitalise"}},{children:C})),t(p,{score:b}),w&&t(m,i({size:"small",onClick:S,disabled:!S,"aria-label":"Close cognitive integrity",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:t(r,{sx:{fontSize:17}})}))]})),t(a,{sx:{m:0}}),t(l,i({sx:u({bgcolor:"#F9FAFB",px:1.5,py:1.25,height:"auto",minHeight:0,flex:"0 0 auto"},null==I?void 0:I.content)},{children:o(s,i({spacing:1.5},{children:[j.length>0&&o(l,{children:[t(h,i({sx:{mb:1,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.4}},{children:"Decision Making Factors"})),t(l,i({component:"ol",sx:{m:0,pl:2.25,"& li":{pl:.25,mb:.75,color:"#667085",fontSize:11.5,lineHeight:1.65},"& li:last-child":{mb:0},"& li::marker":{color:"#475467",fontSize:11.5},"& p":{margin:0,color:"#667085",fontSize:11.5,lineHeight:1.65}},style:M.list},{children:j.map(function(e,o){return t(l,i({component:"li"},{children:t(d,{value:"<summary>".concat(e,"</summary>"),styles:N})}),"evidence-".concat(o))})}))]}),j.length>0&&F.length>0&&t(a,{sx:{my:"2px !important",borderColor:"#E4E7EC"}}),F.length>0&&o(l,{children:[t(h,i({sx:{mb:1,color:"#344054",fontSize:12,fontWeight:600,lineHeight:1.4}},{children:"Gaps in Decision"})),t(l,i({component:"ol",sx:{m:0,pl:2.25,"& li":{pl:.25,mb:.75,color:"#667085",fontSize:11.5,lineHeight:1.65},"& li:last-child":{mb:0},"& li::marker":{color:"#475467",fontSize:11.5},"& p":{margin:0,color:"#667085",fontSize:11.5,lineHeight:1.65}},style:M.list},{children:F.map(function(e,o){return t(l,i({component:"li"},{children:t(d,{value:"<summary>".concat(e,"</summary>"),styles:N})}),"gap-".concat(o))})}))]})]}))}))]}))}))}export{f as default};
2
2
  //# sourceMappingURL=CognitiveIntegrity.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e,__assign as n,__awaiter as t,__generator as i}from"tslib";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useMemo as a,useState as l,useEffect as d,useRef as u,useCallback as s}from"react";import{SpecialZoomLevel as c}from"@react-pdf-viewer/core";import g from"../PdfViewer/PdfViewer.js";import v,{BoundaryReviewActionEnum as p,isBoundaryReviewAction as m}from"./BoundaryCard.js";import f from"./CardWrapper.js";import h from"./CognitiveIntegrity.js";import w from"./LabelCheck.js";import b from"./PageCheck.js";import{extractSegmentReviewData as y,getSegmentReviewKey as _}from"./reviewStepAdapters.js";import{CircleCheck as x,GitMerge as S}from"lucide-react";import{Tooltip as C,Typography as P,Portal as k,Box as E}from"@mui/material";import M from"./ReviewedCard.js";import R from"./RevertCard.js";import A from"./RevertSuccessCard.js";import{getPendingMergeImpactedSegmentKeys as I,hasPolledStructuralAction as N,getOptimisticMergeImpactedSegmentKeys as F,shouldHideStructuralBoundaryReview as W,getResolvedScore as B,getConfidenceColors as L,getBoundaryReviewActionBadgeLabel as T,getTitleReviewActionBadgeLabel as z,isReviewStepResolved as j,isReviewStepResolutionCurrent as q,formatScore as O}from"./helper.js";import D from"./ChartBreakoutCircle.js";var V,G,U=260;!function(e){e.ActualSize="ActualSize",e.PageFit="PageFit",e.PageWidth="PageWidth"}(G||(G={}));var H=((V={})[G.ActualSize]=c.ActualSize,V[G.PageFit]=c.PageFit,V[G.PageWidth]=c.PageWidth,V),X=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};function Y(V){var G,Y,J,Z,K,Q,$,ee,ne,te,ie,re,oe,ae,le,de,ue,se,ce,ge,ve,pe,me=this,fe=V.pdfUrl,he=V.pdfName,we=V.segments,be=V.styles,ye=V.pdfViewerProps,_e=V.specialZoomLevel,xe=V.showBadges,Se=void 0===xe||xe,Ce=V.sortByConfidence,Pe=void 0===Ce?"low":Ce,ke=V.filterByConfidence,Ee=void 0===ke?"all":ke,Me=V.showBadgeNavigation,Re=void 0===Me||Me,Ae=V.autoSelectReviewOnPageChange,Ie=void 0!==Ae&&Ae,Ne=V.autoAdvanceAfterConfirm,Fe=void 0===Ne||Ne,We=V.badgePreloadPages,Be=void 0===We?8:We,Le=V.badgeOffsetTop,Te=void 0===Le?20:Le,ze=V.badgeOffsetRight,je=void 0===ze?68:ze,qe=V.badgeOffsetLeft,Oe=void 0===qe?0:qe,De=V.initialReviewId,Ve=V.manualPrompt,Ge=V.onBoundaryAction,Ue=V.onLabelAction,He=V.onPageAction,Xe=V.onRevert,Ye=V.onActiveReviewChange,Je=V.onCurrentPageChange,Ze=V.onActionError,Ke=V.disableAllActions,Qe=void 0!==Ke&&Ke,$e=V.disablePdfAnnotations,en=void 0!==$e&&$e,nn=V.disablePdfTextLayer,tn=void 0===nn||nn,rn=V.disableTitleCheckUntilBoundaryCheckCompleted,on=void 0!==rn&&rn,an=V.onAdjustManually,ln=V.onCognitiveClick,dn=V.className,un=V.style,sn=V.viewerStyle,cn=V.railStyle,gn=V.redirectionData,vn=a(function(){return y(we)},[we]),pn=vn.boundaryReviews,mn=vn.labelReviews,fn=vn.pageReviews,hn=l(function(){return new Map}),wn=hn[0],bn=hn[1],yn=a(function(){var e=new Map,n=1;return we.forEach(function(t,i){var r=_(t,i);e.has(r)||(e.set(r,n),n+=1)}),e},[we]),_n=a(function(){return new Set(mn.map(function(e){return _(e.segment)}))},[mn]),xn=a(function(){return I(we)},[we]);d(function(){bn(function(e){var n=!1,t=new Map(e);return e.forEach(function(e,i){var r=we.find(function(e){return _(e)===i});r&&!N(r,e)||(t.delete(i),n=!0)}),n?t:e})},[we]);var Sn=a(function(){return F(we,wn)},[wn,we]),Cn=u(null),Pn=a(function(){return e(e(e([],pn.filter(function(e){return!xn.has(_(e.segment))&&!Sn.has(_(e.segment))&&!W(e.review_step,e.segment,_n.has(_(e.segment)),wn.get(_(e.segment)))}).map(function(e){var t;return n(n({},e),{kind:"boundary",pageNumber:null!==(t=e.metadata.focus_page)&&void 0!==t?t:e.segment.start_page})}),!0),mn.filter(function(e){return!xn.has(_(e.segment))&&!Sn.has(_(e.segment))}).map(function(e){return n(n({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0),fn.filter(function(e){return!xn.has(_(e.segment))&&!Sn.has(_(e.segment))}).map(function(e){var t;return n(n({},e),{kind:"page",pageNumber:null!==(t=e.metadata.page_num)&&void 0!==t?t:e.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=yn.get(_(e.segment)))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=yn.get(_(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)})},[pn,mn,fn,Sn,wn,xn,yn,_n]),kn=a(function(){return we.map(function(e){var t,i;return n(n({},e),{title:(null===(t=e.label)||void 0===t?void 0:t.trim())||e.title,page_count:null!==(i=e.page_count)&&void 0!==i?i:e.end_page-e.start_page+1})})},[we]),En=l(1),Mn=En[0],Rn=En[1],An=l(null!=De?De:null),In=An[0],Nn=An[1],Fn=l(null!=De?De:null),Wn=Fn[0],Bn=Fn[1],Ln=l(!1),Tn=Ln[0],zn=Ln[1],jn=l(null),qn=jn[0],On=jn[1],Dn=l(null),Vn=Dn[0],Gn=Dn[1],Un=l(function(){return new Set}),Hn=Un[0],Xn=Un[1],Yn=l(null),Jn=Yn[0],Zn=Yn[1],Kn=l(null),Qn=Kn[0],$n=Kn[1],et=l(!1),nt=et[0],tt=et[1],it=u(0),rt=u(null),ot=u(null),at=u(new Map),lt=u(null),dt=u(null),ut=l(U),st=ut[0],ct=ut[1],gt=null!==(Y=null===(G=null==be?void 0:be.aside)||void 0===G?void 0:G.width)&&void 0!==Y?Y:"40%",vt="min(".concat("number"==typeof gt?"".concat(gt,"px"):gt,", ").concat(U,"px, 100%)");d(function(){Xn(function(e){if(0===e.size)return e;var n=new Set(e),t=!1;return Pn.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})},[Pn]),d(function(){var e=Cn.current;if(e&&Se){var n=function(){var n=e.getBoundingClientRect().width;n>0&&ct(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()}}},[Se]);var pt=a(function(){var e=new Set;return Pn.forEach(function(n){var t;null!=(null===(t=n.review_step.review)||void 0===t?void 0:t.action)&&e.add(n.id)}),e},[Pn]),mt=a(function(){var e;return null!==(e=Pn.find(function(e){return e.id===In}))&&void 0!==e?e:null},[In,Pn]),ft=a(function(){return!(!on||"label"!==(null==mt?void 0:mt.kind))&&pn.some(function(e){if(_(e.segment)!==_(mt.segment)||pt.has(e.id))return!1;var n=B(e.review_step.score,e.review_step.confidence);return null==n||n<85})},[mt,pn,on,pt]),ht=null==mt?-1:we.findIndex(function(e){return _(e)===_(mt.segment)}),wt=ht>0?we[ht-1]:void 0,bt=ht>=0?we[ht+1]:void 0,yt=(null===(J=null==wt?void 0:wt.label)||void 0===J?void 0:J.trim())||(null==wt?void 0:wt.title),_t=(null===(Z=null==bt?void 0:bt.label)||void 0===Z?void 0:Z.trim())||(null==bt?void 0:bt.title),xt=L(null==mt?void 0:mt.review_step.score,null==mt?void 0:mt.review_step.confidence,null===(K=null==mt?void 0:mt.segment.confidence)||void 0===K?void 0:K.awaiting_llm),St=(null===(Q=null==mt?void 0:mt.review_step.reasons)||void 0===Q?void 0:Q.length)?mt.review_step.reasons:null!==(ee=null===($=null==mt?void 0:mt.segment.confidence)||void 0===$?void 0:$.reasons)&&void 0!==ee?ee:[],Ct=Boolean(St.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(ne=null==mt?void 0:mt.review_step.reason)||void 0===ne?void 0:ne.trim())||(null===(te=null==mt?void 0:mt.review_step.gap)||void 0===te?void 0:te.trim())),Pt=null==mt?null:"boundary"===mt.kind?T(mt.review_step,mt.segment,wn.get(null!==(ie=mt.segment.stable_key)&&void 0!==ie?ie:"")):z(mt.review_step,mt.segment,wn.get(null!==(re=mt.segment.stable_key)&&void 0!==re?re:"")),kt=null==mt?"":(null===(oe=mt.segment.label)||void 0===oe?void 0:oe.trim())||mt.segment.title,Et=null==mt?void 0:mt.review_step.revert,Mt=null==mt?void 0:mt.segment.revert,Rt=function(e){return null==e?void 0:e.trim().toLowerCase()},At=null==mt||null===(le=e([],null!==(ae=mt.segment.review_steps)&&void 0!==ae?ae:[],!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"===Rt(null===(t=e.revert)||void 0===t?void 0:t.type)}))||void 0===le?void 0:le.revert,It=null!==(de=null!=Et?Et:null==mt?void 0:mt.segment.revert)&&void 0!==de?de:At,Nt=null==It?void 0:It.decision.trim().toUpperCase(),Ft=null!=Pt?Pt:(null==Nt?void 0:Nt.includes("SPLIT"))?"Split":(null==Nt?void 0:Nt.includes("MERGE"))?"Merged":null,Wt="Merged"===Pt||"Split"===Pt,Bt=null==mt?void 0:Wt?"boundary"===Rt(null==At?void 0:At.type)?At:"boundary"===Rt(null==Mt?void 0:Mt.type)?Mt:"boundary"===Rt(null==Et?void 0:Et.type)?Et:void 0:"label"===mt.kind?"label"===Rt(null==Et?void 0:Et.type)?Et:void 0:"boundary"===mt.kind?"boundary"===Rt(null==Et?void 0:Et.type)?Et:"boundary"===Rt(null==At?void 0:At.type)?At:"boundary"===Rt(null==Mt?void 0:Mt.type)?Mt:void 0:void 0,Lt=(null===(ue=null==Bt?void 0:Bt.summary)||void 0===ue?void 0:ue.trim())||null,Tt=null==mt?null:Bt?{currentSegment:{title:kt,startPage:mt.segment.start_page,endPage:mt.segment.end_page},previousSegments:Bt.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"===Ft?{currentSegment:{title:kt,startPage:mt.segment.start_page,endPage:mt.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:kt,startPage:mt.segment.start_page,endPage:mt.segment.end_page}]}:"Merged"===Ft?{currentSegment:{title:kt,startPage:mt.segment.start_page,endPage:mt.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:"Request for proposal (RFP)",startPage:26,endPage:76}]}:{currentSegment:{title:kt,startPage:mt.segment.start_page,endPage:mt.segment.end_page},previousSegments:[]},zt=Boolean((null==Bt?void 0:Bt.operation_id)&&(null==Bt?void 0:Bt.type)&&!1!==(null==Bt?void 0:Bt.revertable)),jt=s(function(e,n){it.current+=1,rt.current={requestId:it.current,pageNumber:e,reviewId:n},Gn({pageNumber:e,requestId:it.current})},[]),qt=s(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&($n(null),Nn(e.id),Bn(e.id),zn(!1),On(null),jt(e.pageNumber,e.id),null==Ye||Ye(e.id,e.segment))},[Ye,jt]);d(function(){if(Qn){var e=requestAnimationFrame(function(){return tt(!0)}),n=window.setTimeout(function(){tt(!1)},3500),t=window.setTimeout(function(){$n(null)},4e3);return function(){cancelAnimationFrame(e),window.clearTimeout(n),window.clearTimeout(t)}}},[Qn]),d(function(){var e;if(gn)if(gn.reviewId){var n=Pn.find(function(e){return e.id===gn.reviewId&&(!gn.type||e.kind===gn.type)});n&&qt(n)}else if(gn.classificationId){var t=Pn.find(function(e){return"page"===e.kind&&e.metadata.classification_id===gn.classificationId&&(!gn.type||e.kind===gn.type)});t&&qt(t)}else if(gn.pageNumber&&gn.type){var i=Number(gn.pageNumber);if(Number.isInteger(i)&&!(i<1)){var r=null===(e=gn.pageType)||void 0===e?void 0:e.trim().toLowerCase(),o=Pn.find(function(e){var n="page"===e.kind?e.pageNumber:e.segment.start_page,t="page"!==e.kind||!r||e.metadata.page_type===r;return n===i&&e.kind===gn.type&&t});o&&qt(o)}}},[gn,qt,Pn]);var Ot=s(function(){rt.current=null,zn(!1),Nn(null),On(null),null==Ye||Ye(null,null)},[Ye]),Dt=s(function(e){var n;tt(!1),$n(null);var t=null!==(n=Pn.find(function(n){return!pt.has(n.id)&&"boundary"===n.kind&&n.segment.start_page===e.startPage&&n.segment.end_page===e.endPage}))&&void 0!==n?n:Pn.find(function(n){return!pt.has(n.id)&&n.segment.start_page<=e.startPage&&n.segment.end_page>=e.startPage});t?qt(t):(Ot(),it.current+=1,Gn({pageNumber:e.startPage,requestId:it.current}))},[Ot,pt,Pn,qt]),Vt=s(function(e){var n;if(Fe){var t=Pn.findIndex(function(n){return n.id===e}),i=new Set(Pn.map(function(e){return e.id})),r=null!==(n=Pn.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:Pn.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return qt(r)}):Ot()}else Ot()},[Fe,Ot,Pn,qt,Pn]),Gt=s(function(e,n,r){return t(me,void 0,void 0,function(){var t,o,a,l,d,u,s;return i(this,function(i){switch(i.label){case 0:if(Qe)return[2];if("boundary"===e.kind&&!Ge)return[2];if("label"===e.kind&&!Ue)return[2];if("page"===e.kind&&!He)return[2];t=X(e),o=n,a="boundary"===e.kind&&null!=Ge&&Fe&&(o===p.SPLIT_HERE||o===p.MERGE_NEXT||o===p.MERGE_PREV||o===p.MERGE_PREVIOUS),l=a?we.findIndex(function(n){return _(n)===_(e.segment)}):-1,a&&l>=0&&(ot.current={action:o,originalSegmentIndex:l,segmentSignature:JSON.stringify(we.map(function(e,n){return _(e,n)})),ready:!1}),Zn(e.id),i.label=1;case 1:return i.trys.push([1,8,9,10]),"boundary"!==e.kind?[3,3]:[4,null==Ge?void 0:Ge(n,r,t)];case 2:return i.sent(),[3,7];case 3:return"label"!==e.kind?[3,5]:[4,null==Ue?void 0:Ue(n,r,t)];case 4:return i.sent(),[3,7];case 5:return"page"!==e.kind?[3,7]:[4,null==He?void 0:He(n,r,t)];case 6:i.sent(),i.label=7;case 7:return Xn(function(n){var t=new Set(n);return t.add(e.id),t}),d="boundary"===e.kind&&(o===p.MERGE_NEXT||o===p.MERGE_PREV||o===p.MERGE_PREVIOUS),("boundary"===e.kind&&o.toLowerCase().includes("split")||d)&&bn(function(n){var t=new Map(n);return t.set(_(e.segment),o),t}),ot.current?(ot.current.ready=!0,d&&(u=Pn.find(function(n){return"label"===n.kind&&_(n.segment)===_(e.segment)}))&&requestAnimationFrame(function(){return qt(u)})):Vt(e.id),[3,10];case 8:return s=i.sent(),a&&(ot.current=null),null==Ze||Ze(s,t),[3,10];case 9:return Zn(null),[7];case 10:return[2]}})})},[Fe,Qe,Ze,Ge,Ue,He,Pn,we,qt,Vt]);d(function(){var e=ot.current;if((null==e?void 0:e.ready)&&JSON.stringify(we.map(function(e,n){return _(e,n)}))!==e.segmentSignature){var n=e.action===p.SPLIT_HERE?e.originalSegmentIndex+1:e.action===p.MERGE_PREV||e.action===p.MERGE_PREVIOUS?Math.max(0,e.originalSegmentIndex-1):e.originalSegmentIndex,t=new Map(we.map(function(e,n){return[_(e,n),n]})),i=Pn.find(function(e){var i,r=t.get(_(e.segment));return null!=r&&r>=n&&!j(e.review_step,e.segment)&&(!Hn.has(e.id)||!q(e.review_step,e.segment))&&!0!==(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm)});if(!i)return ot.current=null,void Ot();requestAnimationFrame(function(){ot.current=null,qt(i)})}},[Ot,Hn,Pn,we,qt]),d(function(){ot.current||In&&!Pn.some(function(e){return e.id===In})&&Ot()},[In,Ot,Pn]),d(function(){if(Ie&&!ot.current){var e=Pn.find(function(e){return e.pageNumber===Mn});e&&e.id!==In&&qt(e)}},[In,Ie,Mn,qt,Pn]),d(function(){ot.current||In&&!Pn.some(function(e){var n;return e.id===In&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&Ot()},[In,Ot,Pn]);var Ut=a(function(){var n=Pn.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===Ee)return n;var t=["low","medium","high"].filter(function(e){return e!==Pe}),i=e([Pe],t,!0),r=new Map(i.map(function(e,n){return[e,n]}));return n.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,a,l,d=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==d?i.length:null!==(a=r.get(d))&&void 0!==a?a:i.length)-(null==u?i.length:null!==(l=r.get(u))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[Ee,Pe,Pn]),Ht=Ut.findIndex(function(e){return e.id===Wn}),Xt=l(null),Yt=Xt[0],Jt=Xt[1],Zt=u(!1),Kt=s(function(e){var n=Ut[e];n&&qt(n)},[Ut,qt]);d(function(){Wn&&!Ut.some(function(e){return e.id===Wn})&&Bn(null)},[Ut,Wn]),d(function(){Zt.current=!1,Jt(Ht>=0?String(Ht+1):null)},[Ht,Ut.length]),d(function(){if(Zt.current&&null!=Yt){var e=window.setTimeout(function(){var e=Number(Yt.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<Ut.length&&(Zt.current=!1,Kt(n))},300);return function(){return window.clearTimeout(e)}}},[Kt,Yt,Ut.length]);var Qt=a(function(){var e=new Map;Pn.forEach(function(n){var t,i=null!==(t=e.get(_(n.segment)))&&void 0!==t?t:[];i.push(n),e.set(_(n.segment),i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=yn.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},[Pn,yn]),$t=a(function(){var e=new Map;Pn.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},[Pn]),ei=s(function(e){return{startPage:Math.max(0,e.startPage-Be),endPage:Math.min(e.numPages-1,e.endPage+Be)}},[Be]),ni=s(function(){var e,n=lt.current,t=dt.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();if(Pn.forEach(function(e){var n,r=at.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(),d=null!==(n=$t.get(e.id))&&void 0!==n?n:0,u=l.top+Te+40*d,s=u+(r.offsetHeight||32),c=u>=o.top&&s<=o.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}}),In&&null==rt.current){var a=at.current.get(In);a&&"hidden"!==a.style.visibility&&On(function(e){return e===a?e:a})}}},[In,Te,$t,Pn]),ti=s(function(e){var n=rt.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(rt.current=null,ni(),requestAnimationFrame(function(){if(null==rt.current){var e=at.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&On(e)}}))},[ni]);return d(function(){var e=dt.current;if(e&&Se){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,ni()}))};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()}}},[Se,ni]),r("div",n({ref:lt,className:dn,style:n(n({},un),{display:"block",position:"relative",width:"100%",height:"100%",minWidth:0,overflowX:"auto",overflowY:"hidden"})},{children:[r("div",n({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,width:"100%",minWidth:700,height:"100%"}},{children:[o("div",n({ref:dt,style:n(n({},sn),{flex:"1 1 auto",width:Se?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:o(g,n({highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},ye,{defaultScale:void 0===_e?null!==(se=null==ye?void 0:ye.defaultScale)&&void 0!==se?se:c.PageFit:H[_e],disablePdfAnnotations:en,disablePdfTextLayer:tn,pdfUrl:fe,pdfName:he,segments:kn,navigationRequest:Vn,onNavigationSettled:ti,setRenderRange:ei,onCurrentPageChange:function(e){Rn(e),null==rt.current&&mt&&mt.pageNumber!==e&&Ot(),null==Je||Je(e)}}))})),Se&&r("aside",n({"aria-label":"Page review badges",ref:Cn,style:n(n({},cn),{position:"relative",width:vt,maxWidth:U,flex:"0 1 ".concat(vt),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[Re&&Ut.length>0&&r("nav",n({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:je||"auto",left:Oe||"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:[o("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=Yt?Yt:"-","aria-label":"Review badge number",onChange:function(e){Zt.current=!0,Jt(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"}}),r("span",n({"aria-label":"".concat(Ut.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",Ut.length]})),["previous","next"].map(function(e){var t="previous"===e,i=Ht+(t?-1:1),r=i<0||i>=Ut.length;return o("button",n({type:"button","aria-label":"".concat(t?"Previous":"Next"," review badge"),disabled:r,onClick:function(){return Kt(i)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:r?"#C7D2FE":"#4F46E5",cursor:r?"default":"pointer"}},{children:o("svg",n({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:o("path",{d:t?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),e)})]})),Pn.map(function(e){var t,i,a=In===e.id,l=null!==(t=Qt.get(e.id))&&void 0!==t?t:"1A",d=e.review_step.score,u=e.review_step.confidence,s=O(d,u),c="boundary"===e.kind?T(e.review_step,e.segment,wn.get(_(e.segment))):"label"===e.kind?z(e.review_step,e.segment,wn.get(_(e.segment))):null,g=null!=c?c:"N/A"===s?s:"".concat(s,"%"),v=!0===(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm),p=L(d,u,v),m=pt.has(e.id);return o(C,n({title:v?"data is being processed":"",arrow:!0},{children:o("span",n({ref:function(n){n?at.current.set(e.id,n):at.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:v?"not-allowed":"pointer"}},{children:o("button",n({disabled:v,type:"button","aria-pressed":a,"aria-label":v?"".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 qt(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:c?m&&!v?115:90:m&&!v?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(m&&!v?"#E2E8F0":p.border),borderRadius:16,backgroundColor:m&&!v?"#F8FAFC":p.background,color:m&&!v?"#475569":p.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:r(P,n({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},m&&!v?{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:l})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]})),r("span",n({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:o(x,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]}:{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:l})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:p.divider,strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]}))]}))}))}))}),e.id)})]}))]})),mt&&qn&&r(f,n({anchorElement:qn,placement:"bottom-start",offset:{top:8},width:Math.min(st,U),maxWidth:U},{children:[Tn&&o(h,{width:"100%",maxWidth:"100%",score:mt.review_step.score,reasons:St,reason:mt.review_step.reason,gap:mt.review_step.gap,onBack:function(){return zn(!1)},onClose:Ot}),o("div",n({style:{display:Tn?"none":"block"}},{children:pt.has(mt.id)?o(M,{width:"100%",maxWidth:"100%",headerName:"Split"===Pt?"Split approved":"Merged"===Pt?"Merge approved":"User approved",headerIcon:"Merged"===Pt?o(S,{size:18,strokeWidth:2}):"Split"===Pt?o(D,{width:18,height:18}):o(x,{size:18,strokeWidth:2}),title:kt,pageNo:"Page ".concat(mt.segment.start_page,"-").concat(mt.segment.end_page),summary:Tt?o(R,{icon:o(x,{size:14,strokeWidth:2}),title:kt,pageRange:"Page ".concat(mt.segment.start_page,"-").concat(mt.segment.end_page),description:(null===(ce=mt.review_step.summary)||void 0===ce?void 0:ce.trim())||("Split"===Pt?"Pages ".concat(mt.segment.start_page,"-").concat(mt.segment.end_page," were split from “Advice of Award” to create this document “").concat(kt,"”."):"Merged"===Pt?"Pages 13-25 were merged into this document from “Advice of Award”.":"No changes were made. “".concat(kt,"” was kept as is with pages ").concat(mt.segment.start_page,"-").concat(mt.segment.end_page,".")),revertData:Tt,confirmDisabled:null==Xe||!zt,showDocumentHeader:!1,onRevert:function(){if(!Xe)throw new Error("SegmentReviewPdfWrapper requires onRevert to handle a revert confirmation.");if(!Bt)throw new Error("There is no valid revert operation for this review.");var e=Wt?"boundary":"label"===mt.kind?"label":"boundary"===mt.kind?"boundary":null,n=Rt(Bt.type);if(e&&n!==e)throw new Error("Cannot use ".concat(null!=n?n:"unknown"," revert metadata for this review. Expected ").concat(e,"."));return Xe(Bt,X(mt))},onRevertError:function(e){null==Ze||Ze(e,X(mt))},onRevertComplete:function(e){var n,t,i,r,o,a;Xn(function(){return new Set}),bn(function(){return new Map}),mt.id;var l=null!==(n=Tt.previousSegments[0])&&void 0!==n?n:Tt.currentSegment,d=null==qn?void 0:qn.getBoundingClientRect(),u=null===(t=dt.current)||void 0===t?void 0:t.getBoundingClientRect(),s=Math.min(U,Math.max(220,st)),c=null!==(i=null==d?void 0:d.left)&&void 0!==i?i:(null!==(r=null==u?void 0:u.right)&&void 0!==r?r:window.innerWidth-s-8)+8,g=Math.max(8,Math.min(c,window.innerWidth-s-8)),v=null==(null==d?void 0:d.bottom)?Math.max(8,null!==(o=null==u?void 0:u.top)&&void 0!==o?o:8):d.bottom+8;Xn(function(){return new Set}),ot.current=null,tt(!1),$n({title:"Split"===Pt?"Split reverted":"Merged"===Pt?"Merge reverted":"Approval reverted",description:(null===(a=null==e?void 0:e.message)||void 0===a?void 0:a.trim())||("Split"===Pt?"Pages ".concat(mt.segment.start_page,"-").concat(mt.segment.end_page," are now part of “Advice of Award” again. Review the boundary and title to confirm the document."):"Merged"===Pt?"The documents have been separated again. Review their boundaries and titles to confirm them.":"“".concat(kt,"” is pending review again. Review the boundary and title to confirm the document.")),segment:l,position:{top:v,left:g,width:s}}),Ot()}},mt.id):void 0,cognitiveScore:mt.review_step.score,styles:{root:{borderColor:"#16A34A"},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:"#16A34A"}}},onCognitiveClick:Ct?function(){zn(!0),null==ln||ln(X(mt))}:void 0,onClose:Ot}):"boundary"===mt.kind?o(v,{width:"100%",maxWidth:"100%",title:mt.segment.label||mt.segment.title,pageNo:"Page ".concat(mt.pageNumber),content:null!==(ge=mt.review_step.question)&&void 0!==ge?ge:null,revertSummary:Lt,cognitiveScore:mt.review_step.score,metadata:mt.metadata,reviewAction:null!==(ve=mt.segment.review_action)&&void 0!==ve?ve:void 0,previousSegmentTitle:yt,nextSegmentTitle:_t,manualPrompt:null!=Ve?Ve:"Set a custom boundary",defaultStartPage:mt.segment.start_page,defaultEndPage:mt.segment.end_page,styles:{root:{borderColor:xt.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:xt.text}}},confirmDisabled:Qe||!Ge||Jn===mt.id,onConfirm:function(e,n,t){t&&m(n.id)&&Gt(mt,n.id,t)},onAdjustManually:function(){return null==an?void 0:an(X(mt))},onCognitiveClick:Ct?function(){zn(!0),null==ln||ln(X(mt))}:void 0,onClose:Ot},mt.id):"label"===mt.kind?o(w,{width:"100%",maxWidth:"100%",title:mt.metadata.current_label||mt.segment.label||mt.segment.title,pageNo:"Pages ".concat(mt.segment.start_page,"-").concat(mt.segment.end_page),content:null!==(pe=mt.review_step.question)&&void 0!==pe?pe:null,revertSummary:Lt,cognitiveScore:mt.review_step.score,metadata:mt.metadata,styles:{root:{borderColor:xt.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:xt.text}}},confirmDisabled:Qe||!Ue||Jn===mt.id,confirmationBlocked:ft,confirmationWarning:ft?"Please confirm the boundary before confirming the title.":void 0,onActionConfirm:function(e,n){Gt(mt,e,n)},onAdjustManually:function(){return null==an?void 0:an(X(mt))},onCognitiveClick:Ct?function(){zn(!0),null==ln||ln(X(mt))}:void 0,onClose:Ot},mt.id):o(b,{width:"100%",maxWidth:"100%",title:mt.segment.label||mt.segment.title,pageNo:"Page ".concat(mt.pageNumber),content:mt.review_step.reason,cognitiveScore:mt.review_step.score,pageType:mt.metadata.page_type,metadata:mt.metadata,styles:{root:{borderColor:xt.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:xt.text}}},confirmDisabled:Qe||!He||Jn===mt.id,onActionConfirm:function(e,n){Gt(mt,e,n)},onCognitiveClick:Ct?function(){zn(!0),null==ln||ln(X(mt))}:void 0,onClose:Ot},mt.id)}))]})),Qn&&o(k,{children:o(E,n({"aria-live":"polite",sx:{position:"fixed",top:Qn.position.top,left:Qn.position.left,zIndex:1600,width:Qn.position.width,maxWidth:"calc(100vw - 16px)",opacity:nt?1:0,transform:nt?"translateY(0)":"translateY(-6px)",transition:"opacity 500ms ease, transform 500ms ease",filter:"drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18))",pointerEvents:nt?"auto":"none"}},{children:o(A,{title:Qn.title,description:Qn.description,onReview:function(){return Dt(Qn.segment)}})}))})]}))}export{G as SegmentPdfSpecialZoomLevel,Y as default};
1
+ import{__spreadArray as e,__assign as n,__awaiter as t,__generator as i}from"tslib";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useMemo as a,useState as l,useEffect as d,useRef as u,useCallback as s}from"react";import{SpecialZoomLevel as c}from"@react-pdf-viewer/core";import g from"../PdfViewer/PdfViewer.js";import v,{BoundaryReviewActionEnum as p,isBoundaryReviewAction as m}from"./BoundaryCard.js";import f from"./CardWrapper.js";import h from"./CognitiveIntegrity.js";import w from"./LabelCheck.js";import b from"./PageCheck.js";import{extractSegmentReviewData as y,getSegmentReviewKey as _}from"./reviewStepAdapters.js";import{CircleCheck as x,GitMerge as S}from"lucide-react";import{Tooltip as P,Typography as E,Portal as C,Box as k}from"@mui/material";import R from"./ReviewedCard.js";import M from"./RevertCard.js";import I from"./RevertSuccessCard.js";import{getPendingMergeImpactedSegmentKeys as A,hasPolledStructuralAction as N,getOptimisticMergeImpactedSegmentKeys as F,shouldHideStructuralBoundaryReview as W,getResolvedScore as T,getConfidenceColors as L,getBoundaryReviewActionBadgeLabel as B,getTitleReviewActionBadgeLabel as z,isReviewStepResolved as j,isReviewStepResolutionCurrent as q,formatScore as G}from"./helper.js";import O from"./ChartBreakoutCircle.js";var D,V,H=260;!function(e){e.ActualSize="ActualSize",e.PageFit="PageFit",e.PageWidth="PageWidth"}(V||(V={}));var U=((D={})[V.ActualSize]=c.ActualSize,D[V.PageFit]=c.PageFit,D[V.PageWidth]=c.PageWidth,D),X=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};function Y(D){var V,Y,J,Z,K,Q,$,ee,ne,te,ie,re,oe,ae,le,de,ue,se,ce,ge,ve,pe,me,fe=this,he=D.pdfUrl,we=D.pdfName,be=D.segments,ye=D.styles,_e=D.pdfViewerProps,xe=D.specialZoomLevel,Se=D.showBadges,Pe=void 0===Se||Se,Ee=D.sortByConfidence,Ce=void 0===Ee?"low":Ee,ke=D.filterByConfidence,Re=void 0===ke?"all":ke,Me=D.showBadgeNavigation,Ie=void 0===Me||Me,Ae=D.autoSelectReviewOnPageChange,Ne=void 0!==Ae&&Ae,Fe=D.autoAdvanceAfterConfirm,We=void 0===Fe||Fe,Te=D.badgePreloadPages,Le=void 0===Te?8:Te,Be=D.badgeOffsetTop,ze=void 0===Be?20:Be,je=D.badgeOffsetRight,qe=void 0===je?68:je,Ge=D.badgeOffsetLeft,Oe=void 0===Ge?0:Ge,De=D.initialReviewId,Ve=D.manualPrompt,He=D.onBoundaryAction,Ue=D.onLabelAction,Xe=D.onPageAction,Ye=D.onRevert,Je=D.onActiveReviewChange,Ze=D.onCurrentPageChange,Ke=D.onActionError,Qe=D.disableAllActions,$e=void 0!==Qe&&Qe,en=D.disablePdfAnnotations,nn=void 0!==en&&en,tn=D.disablePdfTextLayer,rn=void 0===tn||tn,on=D.disableTitleCheckUntilBoundaryCheckCompleted,an=void 0!==on&&on,ln=D.onAdjustManually,dn=D.onCognitiveClick,un=D.className,sn=D.style,cn=D.viewerStyle,gn=D.railStyle,vn=D.redirectionData,pn=a(function(){return y(be)},[be]),mn=pn.boundaryReviews,fn=pn.labelReviews,hn=pn.pageReviews,wn=l(function(){return new Map}),bn=wn[0],yn=wn[1],_n=a(function(){var e=new Map,n=1;return be.forEach(function(t,i){var r=_(t,i);e.has(r)||(e.set(r,n),n+=1)}),e},[be]),xn=a(function(){return new Set(fn.map(function(e){return _(e.segment)}))},[fn]),Sn=a(function(){return A(be)},[be]);d(function(){yn(function(e){var n=!1,t=new Map(e);return e.forEach(function(e,i){var r=be.find(function(e){return _(e)===i});r&&!N(r,e)||(t.delete(i),n=!0)}),n?t:e})},[be]);var Pn=a(function(){return F(be,bn)},[bn,be]),En=u(null),Cn=a(function(){return e(e(e([],mn.filter(function(e){return!Sn.has(_(e.segment))&&!Pn.has(_(e.segment))&&!W(e.review_step,e.segment,xn.has(_(e.segment)),bn.get(_(e.segment)))}).map(function(e){var t;return n(n({},e),{kind:"boundary",pageNumber:null!==(t=e.metadata.focus_page)&&void 0!==t?t:e.segment.start_page})}),!0),fn.filter(function(e){return!Sn.has(_(e.segment))&&!Pn.has(_(e.segment))}).map(function(e){return n(n({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0),hn.filter(function(e){return!Sn.has(_(e.segment))&&!Pn.has(_(e.segment))}).map(function(e){var t;return n(n({},e),{kind:"page",pageNumber:null!==(t=e.metadata.page_num)&&void 0!==t?t:e.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=_n.get(_(e.segment)))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=_n.get(_(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)})},[mn,fn,hn,Pn,bn,Sn,_n,xn]),kn=a(function(){return be.map(function(e){var t,i;return n(n({},e),{title:(null===(t=e.label)||void 0===t?void 0:t.trim())||e.title,page_count:null!==(i=e.page_count)&&void 0!==i?i:e.end_page-e.start_page+1})})},[be]),Rn=l(1),Mn=Rn[0],In=Rn[1],An=l(null!=De?De:null),Nn=An[0],Fn=An[1],Wn=l(null!=De?De:null),Tn=Wn[0],Ln=Wn[1],Bn=l(!1),zn=Bn[0],jn=Bn[1],qn=l(null),Gn=qn[0],On=qn[1],Dn=l(null),Vn=Dn[0],Hn=Dn[1],Un=l(function(){return new Set}),Xn=Un[0],Yn=Un[1],Jn=l(null),Zn=Jn[0],Kn=Jn[1],Qn=l(null),$n=Qn[0],et=Qn[1],nt=l(!1),tt=nt[0],it=nt[1],rt=u(0),ot=u(null),at=u(null),lt=u(new Map),dt=u(null),ut=u(null),st=l(H),ct=st[0],gt=st[1],vt=null!==(Y=null===(V=null==ye?void 0:ye.aside)||void 0===V?void 0:V.width)&&void 0!==Y?Y:"40%",pt="min(".concat("number"==typeof vt?"".concat(vt,"px"):vt,", ").concat(H,"px, 100%)");d(function(){Yn(function(e){if(0===e.size)return e;var n=new Set(e),t=!1;return Cn.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})},[Cn]),d(function(){var e=En.current;if(e&&Pe){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()}}},[Pe]);var mt=a(function(){var e=new Set;return Cn.forEach(function(n){var t;null!=(null===(t=n.review_step.review)||void 0===t?void 0:t.action)&&e.add(n.id)}),e},[Cn]),ft=a(function(){var e;return null!==(e=Cn.find(function(e){return e.id===Nn}))&&void 0!==e?e:null},[Nn,Cn]),ht=a(function(){return!(!an||"label"!==(null==ft?void 0:ft.kind))&&mn.some(function(e){if(_(e.segment)!==_(ft.segment)||mt.has(e.id))return!1;var n=T(e.review_step.score,e.review_step.confidence);return null==n||n<85})},[ft,mn,an,mt]),wt=null==ft?-1:be.findIndex(function(e){return _(e)===_(ft.segment)}),bt=wt>0?be[wt-1]:void 0,yt=wt>=0?be[wt+1]:void 0,_t=(null===(J=null==bt?void 0:bt.label)||void 0===J?void 0:J.trim())||(null==bt?void 0:bt.title),xt=(null===(Z=null==yt?void 0:yt.label)||void 0===Z?void 0:Z.trim())||(null==yt?void 0:yt.title),St=L(null==ft?void 0:ft.review_step.score,null==ft?void 0:ft.review_step.confidence,null===(K=null==ft?void 0:ft.segment.confidence)||void 0===K?void 0:K.awaiting_llm),Pt=(null===(Q=null==ft?void 0:ft.review_step.reasons)||void 0===Q?void 0:Q.length)?ft.review_step.reasons:null!==(ee=null===($=null==ft?void 0:ft.segment.confidence)||void 0===$?void 0:$.reasons)&&void 0!==ee?ee:[],Et=Boolean(Pt.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(ne=null==ft?void 0:ft.review_step.reason)||void 0===ne?void 0:ne.trim())||(null===(te=null==ft?void 0:ft.review_step.gap)||void 0===te?void 0:te.trim())),Ct=null==ft?null:"boundary"===ft.kind?B(ft.review_step,ft.segment,bn.get(null!==(ie=ft.segment.stable_key)&&void 0!==ie?ie:"")):z(ft.review_step,ft.segment,bn.get(null!==(re=ft.segment.stable_key)&&void 0!==re?re:"")),kt=null==ft?"":(null===(oe=ft.segment.label)||void 0===oe?void 0:oe.trim())||ft.segment.title,Rt=null==ft?void 0:ft.review_step.revert,Mt=null==ft?void 0:ft.segment.revert,It=function(e){return null==e?void 0:e.trim().toLowerCase()},At=null==ft||null===(le=e([],null!==(ae=ft.segment.review_steps)&&void 0!==ae?ae:[],!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"===It(null===(t=e.revert)||void 0===t?void 0:t.type)}))||void 0===le?void 0:le.revert,Nt=null!==(de=null!=Rt?Rt:null==ft?void 0:ft.segment.revert)&&void 0!==de?de:At,Ft=null==Nt?void 0:Nt.decision.trim().toUpperCase(),Wt=null!=Ct?Ct:(null==Ft?void 0:Ft.includes("SPLIT"))?"Split":(null==Ft?void 0:Ft.includes("MERGE"))?"Merged":null,Tt="Merged"===Ct||"Split"===Ct,Lt=null==ft?void 0:Tt?"boundary"===It(null==At?void 0:At.type)?At:"boundary"===It(null==Mt?void 0:Mt.type)?Mt:"boundary"===It(null==Rt?void 0:Rt.type)?Rt:void 0:"label"===ft.kind?"label"===It(null==Rt?void 0:Rt.type)?Rt:void 0:"boundary"===ft.kind?"boundary"===It(null==Rt?void 0:Rt.type)?Rt:"boundary"===It(null==At?void 0:At.type)?At:"boundary"===It(null==Mt?void 0:Mt.type)?Mt:void 0:void 0,Bt=(null===(ue=null==Lt?void 0:Lt.summary)||void 0===ue?void 0:ue.trim())||null,zt=null==ft?null:Lt?{currentSegment:{title:kt,startPage:ft.segment.start_page,endPage:ft.segment.end_page},previousSegments:Lt.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"===Wt?{currentSegment:{title:kt,startPage:ft.segment.start_page,endPage:ft.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:kt,startPage:ft.segment.start_page,endPage:ft.segment.end_page}]}:"Merged"===Wt?{currentSegment:{title:kt,startPage:ft.segment.start_page,endPage:ft.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:"Request for proposal (RFP)",startPage:26,endPage:76}]}:{currentSegment:{title:kt,startPage:ft.segment.start_page,endPage:ft.segment.end_page},previousSegments:[]},jt=Boolean((null==Lt?void 0:Lt.operation_id)&&(null==Lt?void 0:Lt.type)&&!1!==(null==Lt?void 0:Lt.revertable)),qt=s(function(e,n){rt.current+=1,ot.current={requestId:rt.current,pageNumber:e,reviewId:n},Hn({pageNumber:e,requestId:rt.current})},[]),Gt=s(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(et(null),Fn(e.id),Ln(e.id),jn(!1),On(null),qt(e.pageNumber,e.id),null==Je||Je(e.id,e.segment))},[Je,qt]);d(function(){if($n){var e=requestAnimationFrame(function(){return it(!0)}),n=window.setTimeout(function(){it(!1)},3500),t=window.setTimeout(function(){et(null)},4e3);return function(){cancelAnimationFrame(e),window.clearTimeout(n),window.clearTimeout(t)}}},[$n]),d(function(){var e;if(vn)if(vn.reviewId){var n=Cn.find(function(e){return e.id===vn.reviewId&&(!vn.type||e.kind===vn.type)});n&&Gt(n)}else if(vn.classificationId){var t=Cn.find(function(e){return"page"===e.kind&&e.metadata.classification_id===vn.classificationId&&(!vn.type||e.kind===vn.type)});t&&Gt(t)}else if(vn.pageNumber&&vn.type){var i=Number(vn.pageNumber);if(Number.isInteger(i)&&!(i<1)){var r=null===(e=vn.pageType)||void 0===e?void 0:e.trim().toLowerCase(),o=Cn.find(function(e){var n="page"===e.kind?e.pageNumber:e.segment.start_page,t="page"!==e.kind||!r||e.metadata.page_type===r;return n===i&&e.kind===vn.type&&t});o&&Gt(o)}}},[vn,Gt,Cn]);var Ot=s(function(){ot.current=null,jn(!1),Fn(null),On(null),null==Je||Je(null,null)},[Je]),Dt=s(function(e){var n;it(!1),et(null);var t=null!==(n=Cn.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:Cn.find(function(n){return!mt.has(n.id)&&n.segment.start_page<=e.startPage&&n.segment.end_page>=e.startPage});t?Gt(t):(Ot(),rt.current+=1,Hn({pageNumber:e.startPage,requestId:rt.current}))},[Ot,mt,Cn,Gt]),Vt=s(function(e){var n;if(We){var t=Cn.findIndex(function(n){return n.id===e}),i=new Set(Cn.map(function(e){return e.id})),r=null!==(n=Cn.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:Cn.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return Gt(r)}):Ot()}else Ot()},[We,Ot,Cn,Gt,Cn]),Ht=s(function(e,n,r){return t(fe,void 0,void 0,function(){var t,o,a,l,d,u,s,c,g;return i(this,function(i){switch(i.label){case 0:if($e)return[2];if("boundary"===e.kind&&!He)return[2];if("label"===e.kind&&!Ue)return[2];if("page"===e.kind&&!Xe)return[2];t=X(e),a=r,l=(o=n)===p.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?p.MERGE_PREV:p.MERGE_NEXT:r?p.SPLIT_HERE:null}():o,d="boundary"===e.kind&&null!=He&&We&&(l===p.SPLIT_HERE||l===p.MERGE_NEXT||l===p.MERGE_PREV||l===p.MERGE_PREVIOUS),u=d?be.findIndex(function(n){return _(n)===_(e.segment)}):-1,d&&u>=0&&l&&(at.current={action:l,originalSegmentIndex:u,segmentSignature:JSON.stringify(be.map(function(e,n){var t;return{key:_(e,n),startPage:e.start_page,endPage:e.end_page,version:null!==(t=e.version)&&void 0!==t?t:null}})),ready:!1}),Kn(e.id),i.label=1;case 1:return i.trys.push([1,8,9,10]),"boundary"!==e.kind?[3,3]:[4,null==He?void 0:He(n,r,t)];case 2:return i.sent(),[3,7];case 3:return"label"!==e.kind?[3,5]:[4,null==Ue?void 0:Ue(n,r,t)];case 4:return i.sent(),[3,7];case 5:return"page"!==e.kind?[3,7]:[4,null==Xe?void 0:Xe(n,r,t)];case 6:i.sent(),i.label=7;case 7:return Yn(function(n){var t=new Set(n);return t.add(e.id),t}),s="boundary"===e.kind&&(l===p.MERGE_NEXT||l===p.MERGE_PREV||l===p.MERGE_PREVIOUS),("boundary"===e.kind&&l===p.SPLIT_HERE||s)&&l&&yn(function(n){var t=new Map(n);return t.set(_(e.segment),l),t}),at.current?(at.current.ready=!0,s&&(c=Cn.find(function(n){return"label"===n.kind&&_(n.segment)===_(e.segment)}))&&requestAnimationFrame(function(){return Gt(c)})):Vt(e.id),[3,10];case 8:return g=i.sent(),d&&(at.current=null),null==Ke||Ke(g,t),[3,10];case 9:return Kn(null),[7];case 10:return[2]}})})},[We,$e,Ke,He,Ue,Xe,Cn,be,Gt,Vt]);d(function(){var e=at.current;if(null==e?void 0:e.ready){var n=JSON.stringify(be.map(function(e,n){var t;return{key:_(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===p.SPLIT_HERE?e.originalSegmentIndex+1:e.action===p.MERGE_PREV||e.action===p.MERGE_PREVIOUS?Math.max(0,e.originalSegmentIndex-1):e.originalSegmentIndex,i=new Map(be.map(function(e,n){return[_(e,n),n]})),r=Cn.find(function(e){var n,r=i.get(_(e.segment));return null!=r&&r>=t&&!j(e.review_step,e.segment)&&(!Xn.has(e.id)||!q(e.review_step,e.segment))&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if(!r)return at.current=null,void Ot();requestAnimationFrame(function(){at.current=null,Gt(r)})}}},[Ot,Xn,Cn,be,Gt]),d(function(){at.current||Nn&&!Cn.some(function(e){return e.id===Nn})&&Ot()},[Nn,Ot,Cn]),d(function(){if(Ne&&!at.current){var e=Cn.find(function(e){return e.pageNumber===Mn});e&&e.id!==Nn&&Gt(e)}},[Nn,Ne,Mn,Gt,Cn]),d(function(){at.current||Nn&&!Cn.some(function(e){var n;return e.id===Nn&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&Ot()},[Nn,Ot,Cn]);var Ut=a(function(){var n=Cn.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===Re)return n;var t=["low","medium","high"].filter(function(e){return e!==Ce}),i=e([Ce],t,!0),r=new Map(i.map(function(e,n){return[e,n]}));return n.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,a,l,d=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==d?i.length:null!==(a=r.get(d))&&void 0!==a?a:i.length)-(null==u?i.length:null!==(l=r.get(u))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[Re,Ce,Cn]),Xt=Ut.findIndex(function(e){return e.id===Tn}),Yt=l(null),Jt=Yt[0],Zt=Yt[1],Kt=u(!1),Qt=s(function(e){var n=Ut[e];n&&Gt(n)},[Ut,Gt]);d(function(){Tn&&!Ut.some(function(e){return e.id===Tn})&&Ln(null)},[Ut,Tn]),d(function(){Kt.current=!1,Zt(Xt>=0?String(Xt+1):null)},[Xt,Ut.length]),d(function(){if(Kt.current&&null!=Jt){var e=window.setTimeout(function(){var e=Number(Jt.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<Ut.length&&(Kt.current=!1,Qt(n))},300);return function(){return window.clearTimeout(e)}}},[Qt,Jt,Ut.length]);var $t=a(function(){var e=new Map;Cn.forEach(function(n){var t,i=null!==(t=e.get(_(n.segment)))&&void 0!==t?t:[];i.push(n),e.set(_(n.segment),i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=_n.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},[Cn,_n]),ei=a(function(){var e=new Map;Cn.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},[Cn]),ni=s(function(e){return{startPage:Math.max(0,e.startPage-Le),endPage:Math.min(e.numPages-1,e.endPage+Le)}},[Le]),ti=s(function(){var e,n=dt.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();if(Cn.forEach(function(e){var n,r=lt.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(),d=null!==(n=ei.get(e.id))&&void 0!==n?n:0,u=l.top+ze+40*d,s=u+(r.offsetHeight||32),c=u>=o.top&&s<=o.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}}),Nn&&null==ot.current){var a=lt.current.get(Nn);a&&"hidden"!==a.style.visibility&&On(function(e){return e===a?e:a})}}},[Nn,ze,ei,Cn]),ii=s(function(e){var n=ot.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(ot.current=null,ti(),requestAnimationFrame(function(){if(null==ot.current){var e=lt.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&On(e)}}))},[ti]);return d(function(){var e=ut.current;if(e&&Pe){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,ti()}))};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()}}},[Pe,ti]),r("div",n({ref:dt,className:un,style:n(n({},sn),{display:"block",position:"relative",width:"100%",height:"100%",minWidth:0,overflowX:"auto",overflowY:"hidden"})},{children:[r("div",n({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,width:"100%",minWidth:700,height:"100%"}},{children:[o("div",n({ref:ut,style:n(n({},cn),{flex:"1 1 auto",width:Pe?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:o(g,n({highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},_e,{defaultScale:void 0===xe?null!==(se=null==_e?void 0:_e.defaultScale)&&void 0!==se?se:c.PageFit:U[xe],disablePdfAnnotations:nn,disablePdfTextLayer:rn,pdfUrl:he,pdfName:we,segments:kn,navigationRequest:Vn,onNavigationSettled:ii,setRenderRange:ni,onCurrentPageChange:function(e){In(e),null==ot.current&&ft&&ft.pageNumber!==e&&Ot(),null==Ze||Ze(e)}}))})),Pe&&r("aside",n({"aria-label":"Page review badges",ref:En,style:n(n({},gn),{position:"relative",width:pt,maxWidth:H,flex:"0 1 ".concat(pt),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[Ie&&Ut.length>0&&r("nav",n({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:qe||"auto",left:Oe||"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:[o("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=Jt?Jt:"-","aria-label":"Review badge number",onChange:function(e){Kt.current=!0,Zt(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"}}),r("span",n({"aria-label":"".concat(Ut.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",Ut.length]})),["previous","next"].map(function(e){var t="previous"===e,i=Xt+(t?-1:1),r=i<0||i>=Ut.length;return o("button",n({type:"button","aria-label":"".concat(t?"Previous":"Next"," review badge"),disabled:r,onClick:function(){return Qt(i)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:r?"#C7D2FE":"#4F46E5",cursor:r?"default":"pointer"}},{children:o("svg",n({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:o("path",{d:t?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),e)})]})),Cn.map(function(e){var t,i,a=Nn===e.id,l=null!==(t=$t.get(e.id))&&void 0!==t?t:"1A",d=e.review_step.score,u=e.review_step.confidence,s=G(d,u),c="boundary"===e.kind?B(e.review_step,e.segment,bn.get(_(e.segment))):"label"===e.kind?z(e.review_step,e.segment,bn.get(_(e.segment))):null,g=null!=c?c:"N/A"===s?s:"".concat(s,"%"),v=!0===(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm),p=L(d,u,v),m=mt.has(e.id);return o(P,n({title:v?"data is being processed":"",arrow:!0},{children:o("span",n({ref:function(n){n?lt.current.set(e.id,n):lt.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:v?"not-allowed":"pointer"}},{children:o("button",n({disabled:v,type:"button","aria-pressed":a,"aria-label":v?"".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 Gt(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:c?m&&!v?115:90:m&&!v?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(m&&!v?"#E2E8F0":p.border),borderRadius:16,backgroundColor:m&&!v?"#F8FAFC":p.background,color:m&&!v?"#475569":p.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:r(E,n({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},m&&!v?{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:l})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]})),r("span",n({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:o(x,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]}:{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:l})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:p.divider,strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]}))]}))}))}))}),e.id)})]}))]})),ft&&Gn&&r(f,n({anchorElement:Gn,placement:"bottom-start",offset:{top:8},width:Math.min(ct,H),maxWidth:H},{children:[zn&&o(h,{width:"100%",maxWidth:"100%",score:ft.review_step.score,reasons:Pt,reason:ft.review_step.reason,gap:ft.review_step.gap,onBack:function(){return jn(!1)},onClose:Ot}),o("div",n({style:{display:zn?"none":"block"}},{children:mt.has(ft.id)?o(R,{width:"100%",maxWidth:"100%",headerName:"Split"===Ct?"Split approved":"Merged"===Ct?"Merge approved":"User approved",headerIcon:"Merged"===Ct?o(S,{size:18,strokeWidth:2}):"Split"===Ct?o(O,{width:18,height:18}):o(x,{size:18,strokeWidth:2}),title:kt,pageNo:"Page ".concat(ft.segment.start_page,"-").concat(ft.segment.end_page),summary:zt?o(M,{icon:o(x,{size:14,strokeWidth:2}),title:kt,pageRange:"Page ".concat(ft.segment.start_page,"-").concat(ft.segment.end_page),description:null!==(ge=null===(ce=ft.review_step.summary)||void 0===ce?void 0:ce.trim())&&void 0!==ge?ge:"",revertData:zt,confirmDisabled:null==Ye||!jt,showDocumentHeader:!1,onRevert:function(){if(!Ye)throw new Error("SegmentReviewPdfWrapper requires onRevert to handle a revert confirmation.");if(!Lt)throw new Error("There is no valid revert operation for this review.");var e=Tt?"boundary":"label"===ft.kind?"label":"boundary"===ft.kind?"boundary":null,n=It(Lt.type);if(e&&n!==e)throw new Error("Cannot use ".concat(null!=n?n:"unknown"," revert metadata for this review. Expected ").concat(e,"."));return Ye(Lt,X(ft))},onRevertError:function(e){null==Ke||Ke(e,X(ft))},onRevertComplete:function(e){var n,t,i,r,o,a;Yn(function(){return new Set}),yn(function(){return new Map}),ft.id;var l=null!==(n=zt.previousSegments[0])&&void 0!==n?n:zt.currentSegment,d=null==Gn?void 0:Gn.getBoundingClientRect(),u=null===(t=ut.current)||void 0===t?void 0:t.getBoundingClientRect(),s=Math.min(H,Math.max(220,ct)),c=null!==(i=null==d?void 0:d.left)&&void 0!==i?i:(null!==(r=null==u?void 0:u.right)&&void 0!==r?r:window.innerWidth-s-8)+8,g=Math.max(8,Math.min(c,window.innerWidth-s-8)),v=null==(null==d?void 0:d.bottom)?Math.max(8,null!==(o=null==u?void 0:u.top)&&void 0!==o?o:8):d.bottom+8;Yn(function(){return new Set}),at.current=null,it(!1),et({title:"Split"===Ct?"Split reverted":"Merged"===Ct?"Merge reverted":"Approval reverted",description:(null===(a=null==e?void 0:e.message)||void 0===a?void 0:a.trim())||("Split"===Ct?"Pages ".concat(ft.segment.start_page,"-").concat(ft.segment.end_page," are now part of “Advice of Award” again. Review the boundary and title to confirm the document."):"Merged"===Ct?"The documents have been separated again. Review their boundaries and titles to confirm them.":"“".concat(kt,"” is pending review again. Review the boundary and title to confirm the document.")),segment:l,position:{top:v,left:g,width:s}}),Ot()}},ft.id):void 0,cognitiveScore:ft.review_step.score,styles:{root:{borderColor:"#16A34A"},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:"#16A34A"}}},onCognitiveClick:Et?function(){jn(!0),null==dn||dn(X(ft))}:void 0,onClose:Ot}):"boundary"===ft.kind?o(v,{width:"100%",maxWidth:"100%",title:ft.segment.label||ft.segment.title,pageNo:"Page ".concat(ft.pageNumber),content:null!==(ve=ft.review_step.question)&&void 0!==ve?ve:null,revertSummary:Bt,cognitiveScore:ft.review_step.score,metadata:ft.metadata,reviewAction:null!==(pe=ft.segment.review_action)&&void 0!==pe?pe:void 0,previousSegmentTitle:_t,nextSegmentTitle:xt,manualPrompt:null!=Ve?Ve:"Set a custom boundary",defaultStartPage:ft.segment.start_page,defaultEndPage:ft.segment.end_page,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:$e||!He||Zn===ft.id,onConfirm:function(e,n,t){t&&m(n.id)&&Ht(ft,n.id,t)},onAdjustManually:function(){return null==ln?void 0:ln(X(ft))},onCognitiveClick:Et?function(){jn(!0),null==dn||dn(X(ft))}:void 0,onClose:Ot},ft.id):"label"===ft.kind?o(w,{width:"100%",maxWidth:"100%",title:ft.metadata.current_label||ft.segment.label||ft.segment.title,pageNo:"Pages ".concat(ft.segment.start_page,"-").concat(ft.segment.end_page),content:null!==(me=ft.review_step.question)&&void 0!==me?me:null,revertSummary:Bt,cognitiveScore:ft.review_step.score,metadata:ft.metadata,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:$e||!Ue||Zn===ft.id,confirmationBlocked:ht,confirmationWarning:ht?"Please confirm the boundary before confirming the title.":void 0,onActionConfirm:function(e,n){Ht(ft,e,n)},onAdjustManually:function(){return null==ln?void 0:ln(X(ft))},onCognitiveClick:Et?function(){jn(!0),null==dn||dn(X(ft))}:void 0,onClose:Ot},ft.id):o(b,{width:"100%",maxWidth:"100%",title:ft.segment.label||ft.segment.title,pageNo:"Page ".concat(ft.pageNumber),content:ft.review_step.reason,cognitiveScore:ft.review_step.score,pageType:ft.metadata.page_type,metadata:ft.metadata,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:$e||!Xe||Zn===ft.id,onActionConfirm:function(e,n){Ht(ft,e,n)},onCognitiveClick:Et?function(){jn(!0),null==dn||dn(X(ft))}:void 0,onClose:Ot},ft.id)}))]})),$n&&o(C,{children:o(k,n({"aria-live":"polite",sx:{position:"fixed",top:$n.position.top,left:$n.position.left,zIndex:1600,width:$n.position.width,maxWidth:"calc(100vw - 16px)",opacity:tt?1:0,transform:tt?"translateY(0)":"translateY(-6px)",transition:"opacity 500ms ease, transform 500ms ease",filter:"drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18))",pointerEvents:tt?"auto":"none"}},{children:o(I,{title:$n.title,description:$n.description,onReview:function(){return Dt($n.segment)}})}))})]}))}export{V as SegmentPdfSpecialZoomLevel,Y as default};
2
2
  //# sourceMappingURL=SegmentReviewPdfWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as n}from"tslib";import{getSegmentReviewKey as r}from"./reviewStepAdapters.js";var e=function(n){if(null==n)return null;if("number"==typeof n)return Number.isFinite(n)?n:null;var r=n.trim();if(!r)return null;var e=Number.parseFloat(r);return Number.isFinite(e)?e:null},u=function(n){switch(null==n?void 0:n.trim().toLowerCase()){case"low":return 40;case"medium":return 70;case"high":return 95;default:return null}},t=function(n,r){var t;return null!==(t=e(n))&&void 0!==t?t:u(r)},i=function(n,r){var e=t(n,r);return null==e?"N/A":Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")},l=function(n){switch(null==n?void 0:n.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"Split";case"MERGE":case"MERGE_NEXT":case"MERGE_PREV":case"MERGE_PREVIOUS":return"Merged";default:return null}},o=function(n){switch(null==n?void 0:n.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"SPLIT_HERE";case"MERGE_NEXT":return"MERGE_NEXT";case"MERGE_PREV":case"MERGE_PREVIOUS":return"MERGE_PREV";default:return null}},a=function(n){var r=n.type.trim().toLowerCase();return"page_boundary"===r||"page boundary review"===r},d=function(r){var e,u,t,i=(null!==(e=r.review_steps)&&void 0!==e?e:[]).filter(a);return null!==(t=null!==(u=n([],i,!0).reverse().find(function(n){return null!=l(n.human_action_enum)}))&&void 0!==u?u:n([],i,!0).reverse().find(s))&&void 0!==t?t:i[i.length-1]},v=function(n){var r,e,u,t;return null!==(u=null!==(r=l(n.human_action_enum))&&void 0!==r?r:l(null===(e=n.human_resolution)||void 0===e?void 0:e.action))&&void 0!==u?u:l(null===(t=n.review)||void 0===t?void 0:t.action)},_=function(n,r){var e,u=n.type.trim().toLowerCase();if(!("label"===u||"label review"===u))return!0;var t=null===(e=n.human_resolution)||void 0===e?void 0:e.segment_version,i=r.version;return null==t||null==i||t===i},c=function(n,r){var e,u,t;if(!_(n,r))return!1;if(null!=(null===(e=n.review)||void 0===e?void 0:e.action))return!0;var i=null===(t=null===(u=n.human_resolution)||void 0===u?void 0:u.state)||void 0===t?void 0:t.trim().toLowerCase();return"resolved_by_human"===i||"approved"===i||"confirmed"===i},s=function(n){var r,e,u,t;return null!=l(n.human_action_enum)||null!=l(null===(r=n.human_resolution)||void 0===r?void 0:r.action)||null!=l(null===(e=n.review)||void 0===e?void 0:e.action)||!0===(null===(t=null===(u=n.metadata)||void 0===u?void 0:u.performed_actions)||void 0===t?void 0:t.some(function(n){return null!=l(n.action)}))},f=function(r){var e,u,t,i,a,v,_=d(r);if(!_)return null;var c=o(null===(e=_.human_resolution)||void 0===e?void 0:e.action),s=null===(u=_.human_resolution)||void 0===u?void 0:u.after,f=(null==s?void 0:s.start_page)===r.start_page&&(null==s?void 0:s.end_page)===r.end_page;if("SPLIT_HERE"===c)return f?null:"Split";if("MERGE_NEXT"===c||"MERGE_PREV"===c)return f?"Merged":null;var E=l(_.human_action_enum);if(E)return E;var m=l(null===(t=_.review)||void 0===t?void 0:t.action);if(m)return m;var p=n([],null!==(i=r.human_action_log)&&void 0!==i?i:[],!0).filter(function(n){return null!=l(n.action)}).sort(function(n,r){return r.human_revision-n.human_revision||r.performed_at.localeCompare(n.performed_at)})[0];if(!p)return null;var g=l(p.action),h=(null===(a=p.after)||void 0===a?void 0:a.start_page)===r.start_page&&(null===(v=p.after)||void 0===v?void 0:v.end_page)===r.end_page;return"Split"===g?h?null:g:h?g:null},E=function(n,r,e){var u=l(e);if(u)return u;var t=v(n);return t||f(r)},m=function(n,r,e){var u,t;return null!==(t=null!==(u=l(e))&&void 0!==u?u:v(n))&&void 0!==t?t:f(r)},p=function(n,r,e,u){var t=l(u);if("Merged"===t)return e;if("Split"===t)return!0;var i=v(n);return"Split"===i||"Merged"===i&&("Merged"!==f(r)||e)},g=function(n,r){var e,u,t,i,a,v,_=o(r),c=d(n),s=null!==(t=null!==(e=o(null==c?void 0:c.human_action_enum))&&void 0!==e?e:o(null===(u=null==c?void 0:c.human_resolution)||void 0===u?void 0:u.action))&&void 0!==t?t:o(null===(i=null==c?void 0:c.review)||void 0===i?void 0:i.action),E=l(r),m=null===(a=null==c?void 0:c.human_resolution)||void 0===a?void 0:a.after,p="SPLIT_HERE"===_&&null!=(null===(v=null==c?void 0:c.human_resolution)||void 0===v?void 0:v.action)&&(null==m?void 0:m.start_page)===n.start_page&&(null==m?void 0:m.end_page)===n.end_page;return null!=_&&s===_&&null!=E&&(p||f(n)===E)},h=function(e,u){var t=n([],e,!0).sort(function(n,r){return n.start_page-r.start_page||n.end_page-r.end_page}),i=new Set;return u.forEach(function(n,e){var u=t.findIndex(function(n){return r(n)===e});if(!(u<0)){var l=t[u];if(!g(l,n)){var a=o(n),d=t["MERGE_PREV"===a?u-1:"MERGE_NEXT"===a?u+1:-1];d&&i.add(r(d))}}}),i},R=function(e){var u=n([],e,!0).sort(function(n,r){return n.start_page-r.start_page||n.end_page-r.end_page}),t=new Set;return u.forEach(function(n,e){var i,l=(null!==(i=n.review_steps)&&void 0!==i?i:[]).find(function(r){var e,u,t;if(!a(r))return!1;var i=o(r.human_action_enum),l=o(null===(e=r.human_resolution)||void 0===e?void 0:e.action),d=null===(u=r.human_resolution)||void 0===u?void 0:u.before,v=null===(t=r.human_resolution)||void 0===t?void 0:t.after,_=null!=(null==d?void 0:d.start_page)&&null!=d.end_page&&null!=(null==v?void 0:v.start_page)&&null!=v.end_page&&(d.start_page!==v.start_page||d.end_page!==v.end_page),c=(null==v?void 0:v.start_page)===n.start_page&&(null==v?void 0:v.end_page)===n.end_page;return("MERGE_NEXT"===i||"MERGE_PREV"===i)&&!(l===i&&_&&c)});if(l){var d=o(l.human_action_enum),v=u["MERGE_PREV"===d?e-1:e+1];v&&t.add(r(v))}}),t},w=function(n,r,u){var t={border:"#E5E7EB",cardBorder:"#374151",background:"#F9FAFB",text:"#374151",divider:"#D1D5DB"};if(u)return t;var i={border:"#FECACA",cardBorder:"#B91C1C",background:"#FEF2F2",text:"#B91C1C",divider:"#FCA5A5"},l={border:"#d9cda2",cardBorder:"#997800",background:"#fff1bf",text:"#997800",divider:"#e6b400"},o={border:"#16A34A",cardBorder:"#4F9E6C",background:"#F0FDF4",text:"#4F9E6C",divider:"#00A43C"};switch(function(n){var r=null==n?void 0:n.trim().toLowerCase();return"low"===r||"medium"===r||"high"===r?r:null}(r)){case"low":return i;case"medium":return l;case"high":return o}var a=e(n);return null!=a&&a<=40?i:null!=a&&a<=70?l:null!=a?o:t};export{i as formatScore,m as getBoundaryReviewActionBadgeLabel,w as getConfidenceColors,u as getFallbackScore,l as getHumanActionBadgeLabel,e as getNumericScore,h as getOptimisticMergeImpactedSegmentKeys,R as getPendingMergeImpactedSegmentKeys,t as getResolvedScore,v as getReviewStepActionBadgeLabel,f as getStructuralResultBadgeLabel,E as getTitleReviewActionBadgeLabel,g as hasPolledStructuralAction,s as hasStructuralBoundaryAction,_ as isReviewStepResolutionCurrent,c as isReviewStepResolved,p as shouldHideStructuralBoundaryReview};
1
+ import{__spreadArray as n}from"tslib";import{getSegmentReviewKey as e}from"./reviewStepAdapters.js";var r=function(n){if(null==n)return null;if("number"==typeof n)return Number.isFinite(n)?n:null;var e=n.trim();if(!e)return null;var r=Number.parseFloat(e);return Number.isFinite(r)?r:null},u=function(n){switch(null==n?void 0:n.trim().toLowerCase()){case"low":return 40;case"medium":return 70;case"high":return 95;default:return null}},t=function(n,e){var t;return null!==(t=r(n))&&void 0!==t?t:u(e)},i=function(n,e){var r=t(n,e);return null==r?"N/A":Number.isInteger(r)?String(r):r.toFixed(2).replace(/\.?0+$/,"")},l=function(n){switch(null==n?void 0:n.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"Split";case"MERGE":case"MERGE_NEXT":case"MERGE_PREV":case"MERGE_PREVIOUS":return"Merged";default:return null}},a=function(n){var e,r,u,t;if(![n.human_action_enum,null===(e=n.human_resolution)||void 0===e?void 0:e.action,null===(r=n.review)||void 0===r?void 0:r.action].some(function(n){return"SET_RANGE"===(null==n?void 0:n.trim().toUpperCase())}))return null;var i=null===(u=n.human_resolution)||void 0===u?void 0:u.before,l=null===(t=n.human_resolution)||void 0===t?void 0:t.after;if(null==(null==i?void 0:i.start_page)||null==i.end_page||null==(null==l?void 0:l.start_page)||null==l.end_page)return null;var a=l.start_page<i.start_page||l.end_page>i.end_page,o=l.start_page>i.start_page||l.end_page<i.end_page;if(a&&!o)return"Merged";if(o&&!a)return"Split";var d=i.end_page-i.start_page+1,v=l.end_page-l.start_page+1;return v>d?"Merged":v<d?"Split":null},o=function(n){switch(null==n?void 0:n.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"SPLIT_HERE";case"MERGE_NEXT":return"MERGE_NEXT";case"MERGE_PREV":case"MERGE_PREVIOUS":return"MERGE_PREV";case"SET_RANGE":return"SET_RANGE";default:return null}},d=function(n){var e=n.type.trim().toLowerCase();return"page_boundary"===e||"page boundary review"===e},v=function(e){var r,u,t,i=(null!==(r=e.review_steps)&&void 0!==r?r:[]).filter(d);return null!==(t=null!==(u=n([],i,!0).reverse().find(function(n){return null!=l(n.human_action_enum)}))&&void 0!==u?u:n([],i,!0).reverse().find(f))&&void 0!==t?t:i[i.length-1]},_=function(n){var e,r,u,t,i;return null!==(t=null!==(r=null!==(e=a(n))&&void 0!==e?e:l(n.human_action_enum))&&void 0!==r?r:l(null===(u=n.human_resolution)||void 0===u?void 0:u.action))&&void 0!==t?t:l(null===(i=n.review)||void 0===i?void 0:i.action)},c=function(n,e){var r,u=n.type.trim().toLowerCase();if(!("label"===u||"label review"===u))return!0;var t=null===(r=n.human_resolution)||void 0===r?void 0:r.segment_version,i=e.version;return null==t||null==i||t===i},s=function(n,e){var r,u,t;if(!c(n,e))return!1;if(null!=(null===(r=n.review)||void 0===r?void 0:r.action))return!0;var i=null===(t=null===(u=n.human_resolution)||void 0===u?void 0:u.state)||void 0===t?void 0:t.trim().toLowerCase();return"resolved_by_human"===i||"approved"===i||"confirmed"===i},f=function(n){var e,r,u,t;return null!=l(n.human_action_enum)||null!=l(null===(e=n.human_resolution)||void 0===e?void 0:e.action)||null!=l(null===(r=n.review)||void 0===r?void 0:r.action)||!0===(null===(t=null===(u=n.metadata)||void 0===u?void 0:u.performed_actions)||void 0===t?void 0:t.some(function(n){return null!=l(n.action)}))},p=function(e){var r,u,t,i,d,_,c=v(e);if(!c)return null;var s=o(null===(r=c.human_resolution)||void 0===r?void 0:r.action),f=null===(u=c.human_resolution)||void 0===u?void 0:u.after,p=(null==f?void 0:f.start_page)===e.start_page&&(null==f?void 0:f.end_page)===e.end_page,E=a(c);if(E)return p?E:null;if("SPLIT_HERE"===s)return p?null:"Split";if("MERGE_NEXT"===s||"MERGE_PREV"===s)return p?"Merged":null;var g=l(c.human_action_enum);if(g)return g;var m=l(null===(t=c.review)||void 0===t?void 0:t.action);if(m)return m;var h=n([],null!==(i=e.human_action_log)&&void 0!==i?i:[],!0).filter(function(n){return null!=l(n.action)}).sort(function(n,e){return e.human_revision-n.human_revision||e.performed_at.localeCompare(n.performed_at)})[0];if(!h)return null;var R=l(h.action),w=(null===(d=h.after)||void 0===d?void 0:d.start_page)===e.start_page&&(null===(_=h.after)||void 0===_?void 0:_.end_page)===e.end_page;return"Split"===R?w?null:R:w?R:null},E=function(n,e,r){var u=l(r);if(u)return u;var t=_(n);return t||p(e)},g=function(n,e,r){var u,t;return null!==(t=null!==(u=l(r))&&void 0!==u?u:_(n))&&void 0!==t?t:p(e)},m=function(n,e,r,u){var t=l(u);if("Merged"===t)return r;if("Split"===t)return!0;var i=_(n);return"Split"===i||"Merged"===i&&("Merged"!==p(e)||r)},h=function(n,e){var r,u,t,i,a,d,_=o(e),c=v(n),s=null!==(t=null!==(r=o(null==c?void 0:c.human_action_enum))&&void 0!==r?r:o(null===(u=null==c?void 0:c.human_resolution)||void 0===u?void 0:u.action))&&void 0!==t?t:o(null===(i=null==c?void 0:c.review)||void 0===i?void 0:i.action),f=l(e),E=null===(a=null==c?void 0:c.human_resolution)||void 0===a?void 0:a.after,g="SPLIT_HERE"===_&&null!=(null===(d=null==c?void 0:c.human_resolution)||void 0===d?void 0:d.action)&&(null==E?void 0:E.start_page)===n.start_page&&(null==E?void 0:E.end_page)===n.end_page;return null!=_&&s===_&&null!=f&&(g||p(n)===f)},R=function(r,u){var t=n([],r,!0).sort(function(n,e){return n.start_page-e.start_page||n.end_page-e.end_page}),i=new Set;return u.forEach(function(n,r){var u=t.findIndex(function(n){return e(n)===r});if(!(u<0)){var l=t[u];if(!h(l,n)){var a=o(n),d=t["MERGE_PREV"===a?u-1:"MERGE_NEXT"===a?u+1:-1];d&&i.add(e(d))}}}),i},w=function(r){var u=n([],r,!0).sort(function(n,e){return n.start_page-e.start_page||n.end_page-e.end_page}),t=new Set;return u.forEach(function(n,r){var i,l=(null!==(i=n.review_steps)&&void 0!==i?i:[]).find(function(e){var r,u,t;if(!d(e))return!1;var i=o(e.human_action_enum),l=o(null===(r=e.human_resolution)||void 0===r?void 0:r.action),a=null===(u=e.human_resolution)||void 0===u?void 0:u.before,v=null===(t=e.human_resolution)||void 0===t?void 0:t.after,_=null!=(null==a?void 0:a.start_page)&&null!=a.end_page&&null!=(null==v?void 0:v.start_page)&&null!=v.end_page&&(a.start_page!==v.start_page||a.end_page!==v.end_page),c=(null==v?void 0:v.start_page)===n.start_page&&(null==v?void 0:v.end_page)===n.end_page;return("MERGE_NEXT"===i||"MERGE_PREV"===i)&&!(l===i&&_&&c)});if(l){var a=o(l.human_action_enum),v=u["MERGE_PREV"===a?r-1:r+1];v&&t.add(e(v))}}),t},b=function(n,e,u){var t={border:"#E5E7EB",cardBorder:"#374151",background:"#F9FAFB",text:"#374151",divider:"#D1D5DB"};if(u)return t;var i={border:"#FECACA",cardBorder:"#B91C1C",background:"#FEF2F2",text:"#B91C1C",divider:"#FCA5A5"},l={border:"#d9cda2",cardBorder:"#997800",background:"#fff1bf",text:"#997800",divider:"#e6b400"},a={border:"#16A34A",cardBorder:"#4F9E6C",background:"#F0FDF4",text:"#4F9E6C",divider:"#00A43C"};switch(function(n){var e=null==n?void 0:n.trim().toLowerCase();return"low"===e||"medium"===e||"high"===e?e:null}(e)){case"low":return i;case"medium":return l;case"high":return a}var o=r(n);return null!=o&&o<=40?i:null!=o&&o<=70?l:null!=o?a:t};export{i as formatScore,g as getBoundaryReviewActionBadgeLabel,b as getConfidenceColors,u as getFallbackScore,l as getHumanActionBadgeLabel,r as getNumericScore,R as getOptimisticMergeImpactedSegmentKeys,w as getPendingMergeImpactedSegmentKeys,t as getResolvedScore,_ as getReviewStepActionBadgeLabel,p as getStructuralResultBadgeLabel,E as getTitleReviewActionBadgeLabel,h as hasPolledStructuralAction,f as hasStructuralBoundaryAction,c as isReviewStepResolutionCurrent,s as isReviewStepResolved,m as shouldHideStructuralBoundaryReview};
2
2
  //# sourceMappingURL=helper.js.map
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const useCompareLayout: (initialMaintainOrder: boolean, scrollContainerRef: React.RefObject<HTMLDivElement>, lhsBadgeRefs: any, rhsBadgeRefs: any, proposedSections: any[], existingSections: any[]) => {
3
2
  maintainRelativeOrder: boolean;
4
3
  setMaintainRelativeOrder: import("react").Dispatch<import("react").SetStateAction<boolean>>;
@@ -1 +1 @@
1
- {"version":3,"file":"useCompareLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useCompareLayout.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,gBAAgB,yBACL,OAAO,sBACT,MAAM,SAAS,CAAC,cAAc,CAAC,gBACrC,GAAG,gBACH,GAAG,oBACC,GAAG,EAAE,oBACL,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;CAkFxB,CAAC"}
1
+ {"version":3,"file":"useCompareLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useCompareLayout.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,yBACL,OAAO,sBACT,MAAM,SAAS,CAAC,cAAc,CAAC,gBACrC,GAAG,gBACH,GAAG,oBACC,GAAG,EAAE,oBACL,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;CAkFxB,CAAC"}
@@ -16,7 +16,11 @@ export interface CardWrapperProps {
16
16
  width?: number | string;
17
17
  maxWidth?: number | string;
18
18
  customStyles?: Record<string, React.CSSProperties>;
19
+ /** Fallback max-height as percentage of viewport when availableHeight is not calculated. Default: '85vh' */
20
+ fallbackMaxHeightVh?: number;
21
+ /** Height buffer to subtract from availableHeight calculation. Default: 100px */
22
+ heightBuffer?: number;
19
23
  }
20
24
  /** Renders a scrollable card in a portal, anchored below another element. */
21
- export default function CardWrapper({ anchorRef, anchorElement, children, className, offset, placement, width, maxWidth, customStyles, }: CardWrapperProps): import("react/jsx-runtime").JSX.Element;
25
+ export default function CardWrapper({ anchorRef, anchorElement, children, className, offset, placement, width, maxWidth, customStyles, fallbackMaxHeightVh, heightBuffer, }: CardWrapperProps): import("react/jsx-runtime").JSX.Element;
22
26
  //# sourceMappingURL=CardWrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/CardWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,wDAAwD;IACxD,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,YAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CACrD;AAED,6EAA6E;AAC7E,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,SAAS,EACT,aAAa,EACb,QAAQ,EACR,SAAS,EACT,MAAW,EACX,SAA0B,EAC1B,KAAK,EACL,QAAQ,EACR,YAAiB,GAClB,EAAE,gBAAgB,2CAqIlB"}
1
+ {"version":3,"file":"CardWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/CardWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,wDAAwD;IACxD,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,YAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACpD,4GAA4G;IAC5G,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,6EAA6E;AAC7E,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,SAAS,EACT,aAAa,EACb,QAAQ,EACR,SAAS,EACT,MAAW,EACX,SAA0B,EAC1B,KAAK,EACL,QAAQ,EACR,YAAiB,EACjB,mBAAwB,EACxB,YAAkB,GACnB,EAAE,gBAAgB,2CAqIlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveIntegrity.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/CognitiveIntegrity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAyB,E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SAAS,EACT,MAAM,GACP,EAAE,uBAAuB,kDA8KzB"}
1
+ {"version":3,"file":"CognitiveIntegrity.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/CognitiveIntegrity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAyB,EACvB,KAAK,sBAAsB,EAC5B,MAAM,sCAAsC,CAAC;AAY9C,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CACnC;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,SAAS,wBAAwB,EAAE,GAAG,IAAI,CAAC;IACrD,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AA8CD,8EAA8E;AAC9E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,MAAM,EACN,GAAG,EACH,KAAK,EAAE,cAAc,EACrB,UAAkC,EAClC,MAAM,EACN,OAAO,EACP,eAAsB,EACtB,KAAW,EACX,QAAc,EACd,SAAS,EACT,MAAM,GACP,EAAE,uBAAuB,kDAmQzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentReviewPdfWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAkB,EAGhB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAqB,EAGnB,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,gBAAgB,CAAC;AAGxB,OAAmB,EACjB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAkB,EAChB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAI9B,OAAmB,EACjB,KAAK,kBAAkB,EAGxB,MAAM,cAAc,CAAC;AAiBtB,KAAK,uBAAuB,GAAG,OAAO,CAAC,IAAI,CACzC,cAAc,EACZ,QAAQ,GACR,SAAS,GACT,UAAU,GACV,qBAAqB,GACrB,mBAAmB,GACnB,qBAAqB,GACrB,YAAY,GACZ,gBAAgB,CACnB,CAAC,CAAC;AA+BH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AACzD,MAAM,MAAM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I,CAAC;IAEjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4CAA4C,CAAC,EAAE,OAAO,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAsBD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,UAAiB,EACjB,gBAAwB,EACxB,kBAA0B,EAC1B,mBAA0B,EAC1B,4BAAoC,EACpC,uBAA8B,EAC9B,iBAAqB,EACrB,cAAmB,EACnB,gBAAqB,EACrB,eAAmB,EACnB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,iBAAyB,EACzB,qBAA6B,EAC7B,mBAA0B,EAC1B,4CAAoD,EACpD,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,eAAe,GAChB,EAAE,4BAA4B,2CAiqD9B"}
1
+ {"version":3,"file":"SegmentReviewPdfWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAk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,CAAC,EAC9C,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,UAAiB,EACjB,gBAAwB,EACxB,kBAA0B,EAC1B,mBAA0B,EAC1B,4BAAoC,EACpC,uBAA8B,EAC9B,iBAAqB,EACrB,cAAmB,EACnB,gBAAqB,EACrB,eAAmB,EACnB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,iBAAyB,EACzB,qBAA6B,EAC7B,mBAA0B,EAC1B,4CAAoD,EACpD,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,eAAe,GAChB,EAAE,4BAA4B,2CA+tD9B"}
@@ -4,9 +4,9 @@ export declare const getFallbackScore: (confidence?: string | null) => 40 | 70 |
4
4
  export declare const getResolvedScore: (score?: number | string | null, confidence?: string | null) => number | null;
5
5
  export declare const formatScore: (score?: number | string | null, confidence?: string | null) => string;
6
6
  /** Returns the user-facing badge text for structural segment actions. */
7
- export declare const getHumanActionBadgeLabel: (humanAction?: string | null) => "Split" | "Merged" | null;
7
+ export declare const getHumanActionBadgeLabel: (humanAction?: string | null) => "Merged" | "Split" | null;
8
8
  /** Resolves an action label from pending or approved review-step data. */
9
- export declare const getReviewStepActionBadgeLabel: (step: ReviewStepSource) => "Split" | "Merged" | null;
9
+ export declare const getReviewStepActionBadgeLabel: (step: ReviewStepSource) => "Merged" | "Split" | null;
10
10
  export declare const isReviewStepResolutionCurrent: (step: ReviewStepSource, segment: SegmentReviewSource) => boolean;
11
11
  export declare const isReviewStepResolved: (step: ReviewStepSource, segment: SegmentReviewSource) => boolean;
12
12
  /** Returns whether this boundary step belongs to a split or merge operation. */
@@ -16,14 +16,14 @@ export declare const hasStructuralBoundaryAction: (step: ReviewStepSource) => bo
16
16
  * to both outputs, so the retained `after` range is not the Split result. A
17
17
  * merge result, on the other hand, is the expanded `after` range.
18
18
  */
19
- export declare const getStructuralResultBadgeLabel: (segment: SegmentReviewSource) => "Split" | "Merged" | null;
19
+ export declare const getStructuralResultBadgeLabel: (segment: SegmentReviewSource) => "Merged" | "Split" | null;
20
20
  /**
21
21
  * Title checks inherit only merge results from their segment. Split remains
22
22
  * specific to the boundary step that performed it.
23
23
  */
24
- export declare const getTitleReviewActionBadgeLabel: (step: ReviewStepSource, segment: SegmentReviewSource, optimisticAction?: string | null) => "Split" | "Merged" | null;
24
+ export declare const getTitleReviewActionBadgeLabel: (step: ReviewStepSource, segment: SegmentReviewSource, optimisticAction?: string | null) => "Merged" | "Split" | null;
25
25
  /** Optimistic structural state wins over stale polling for boundary badges. */
26
- export declare const getBoundaryReviewActionBadgeLabel: (step: ReviewStepSource, segment: SegmentReviewSource, optimisticAction?: string | null) => "Split" | "Merged" | null;
26
+ export declare const getBoundaryReviewActionBadgeLabel: (step: ReviewStepSource, segment: SegmentReviewSource, optimisticAction?: string | null) => "Merged" | "Split" | null;
27
27
  export declare const shouldHideStructuralBoundaryReview: (step: ReviewStepSource, segment: SegmentReviewSource, hasTitleReview: boolean, optimisticAction?: string | null) => boolean;
28
28
  /** Polling has taken ownership only when it reflects the same optimistic action. */
29
29
  export declare const hasPolledStructuralAction: (segment: SegmentReviewSource, optimisticAction?: string | null) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,eAAe,WAAY,MAAM,GAAG,MAAM,GAAG,IAAI,kBAY7D,CAAC;AAEF,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,GAAG,IAAI,wBAW1D,CAAC;AAEF,eAAO,MAAM,gBAAgB,WAAY,MAAM,GAAG,MAAM,GAAG,IAAI,eAAe,MAA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,kCAAkC,SACvC,gBAAgB,WACb,mBAAmB,kBACZ,OAAO,qBACJ,MAAM,GAAG,IAAI,YAgBjC,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,YAC3B,mBAAmB,qBACT,MAAM,GAAG,IAAI,YAmBjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,aACtC,SAAS,mBAAmB,EAAE,qBACrB,YAAY,MAAM,EAAE,MAAM,CAAC,gBA2B/C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,aACnC,SAAS,mBAAmB,EAAE,gBAsCzC,CAAC;AAYF,eAAO,MAAM,mBAAmB,WAAY,MAAM,GAAG,MAAM,GAAG,IAAI,eAAe,MAAM,GAAG,IAAI,iBAAiB,OAAO;;;;;;CAmDrH,CAAC"}
@@ -163,6 +163,7 @@ export interface SegmentReviewSource {
163
163
  start_page: number;
164
164
  end_page: number;
165
165
  page_count?: number;
166
+ sensitivity?: string | null;
166
167
  status?: string;
167
168
  reviewed_by?: string | null;
168
169
  reviewed_at?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"reviewStepAdapters.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/reviewStepAdapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,GAAG,eAAe,CAAC;IACnE,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,YA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AM,wBAAwB;;;;CAiEpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viswa-test/test-citation",
3
- "version": "0.0.350",
3
+ "version": "0.0.352",
4
4
  "author": "Viswa Koduru",
5
5
  "description": "",
6
6
  "license": "MIT",