LightRAG/lightrag/api/webui/assets/feature-documents-BSJWpkhB.js

88 lines
103 KiB
JavaScript
Raw Normal View History

import{j as t,E as Wa,I as Dt,F as Ga,G as Va,H as Nt,J as Ya,V as zt,L as Ja,K as Qa,M as Ct,N as Pt,Q as Xa,U as St,W as Et,X as _t,_ as ge,d as Ft}from"./ui-vendor-CeCm8EER.js";import{r as o,g as Za,R as Tt}from"./react-vendor-DEwriMA6.js";import{c as E,C as et,a as At,b as Ot,d as oa,F as Rt,e as sa,f as at,u as me,s as Mt,g as O,U as la,S as It,h as tt,B as T,X as nt,i as qt,j as ae,D as qe,k as ha,l as Le,m as Be,n as Ue,o as $e,p as Lt,q as Bt,E as Ut,T as it,I as Oe,r as ot,t as st,L as $t,v as Ht,w as Kt,x as ba,y as ya,z as Wt,A as Gt,G as Vt,H as Yt,J as Jt,K as Qt,M as Ce,N as Pe,O as ja,P as wa,Q as Xt,R as ka,V as Da,W as Zt,Y as en,Z as an,_ as Qe,$ as Xe}from"./feature-graph-C6IuADHZ.js";const Na=St,yi=_t,za=Et,ra=o.forwardRef(({className:e,children:a,...n},i)=>t.jsxs(Wa,{ref:i,className:E("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[a,t.jsx(Dt,{asChild:!0,children:t.jsx(et,{className:"h-4 w-4 opacity-50"})})]}));ra.displayName=Wa.displayName;const lt=o.forwardRef(({className:e,...a},n)=>t.jsx(Ga,{ref:n,className:E("flex cursor-default items-center justify-center py-1",e),...a,children:t.jsx(At,{className:"h-4 w-4"})}));lt.displayName=Ga.displayName;const rt=o.forwardRef(({className:e,...a},n)=>t.jsx(Va,{ref:n,className:E("flex cursor-default items-center justify-center py-1",e),...a,children:t.jsx(et,{className:"h-4 w-4"})}));rt.displayName=Va.displayName;const ca=o.forwardRef(({className:e,children:a,position:n="popper",...i},l)=>t.jsx(Nt,{children:t.jsxs(Ya,{ref:l,className:E("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...i,children:[t.jsx(lt,{}),t.jsx(zt,{className:E("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),t.jsx(rt,{})]})}));ca.displayName=Ya.displayName;const tn=o.forwardRef(({className:e,...a},n)=>t.jsx(Ja,{ref:n,className:E("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...a}));tn.displayName=Ja.displayName;const pa=o.forwardRef(({className:e,children:a,...n},i)=>t.jsxs(Qa,{ref:i,className:E("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ct,{children:t.jsx(Ot,{className:"h-4 w-4"})})}),t.jsx(Pt,{children:a})]}));pa.displayName=Qa.displayName;const nn=o.forwardRef(({className:e,...a},n)=>t.jsx(Xa,{ref:n,className:E("bg-muted -mx-1 my-1 h-px",e),...a}));nn.displayName=Xa.displayName;const ct=o.forwardRef(({className:e,...a},n)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:n,className:E("w-full caption-bottom text-sm",e),...a})}));ct.displayName="Table";const pt=o.forwardRef(({className:e,...a},n)=>t.jsx("thead",{ref:n,className:E("[&_tr]:border-b",e),...a}));pt.displayName="TableHeader";const dt=o.forwardRef(({className:e,...a},n)=>t.jsx("tbody",{ref:n,className:E("[&_tr:last-child]:border-0",e),...a}));dt.displayName="TableBody";const on=o.forwardRef(({className:e,...a},n)=>t.jsx("tfoot",{ref:n,className:E("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pn(e){if(Array.isArray(e))return ua(e)}function Oa(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,i)}return n}function Ra(e){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?Oa(Object(n),!0).forEach(function(i){ft(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oa(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function ft(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function Se(e,a){return _n(e)||En(e,a)||xt(e,a)||Sn()}function Sn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xt(e,a){if(e){if(typeof e=="string")return ua(e,a);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ua(e,a)}}function ua(e,a){(a==null||a>e.length)&&(a=e.length);for(var n=0,i=new Array(a);n<a;n++)i[n]=e[n];return i}function En(e,a){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i=[],l=!0,r=!1,p,d;try{for(n=n.call(e);!(l=(p=n.next()).done)&&(i.push(p.value),!(a&&i.length===a));l=!0);}catch(b){r=!0,d=b}finally{try{!l&&n.return!=null&&n.return()}finally{if(r)throw d}}return i}}function _n(e){if(Array.isArray(e))return e}var Fn=typeof ta=="function"?ta:ta.default,Tn="file-invalid-type",An="file-too-large",On="file-too-small",Rn="too-many-files",Mn=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=a.split(","),i=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:Tn,message:"File type must be ".concat(i)}},Ma=function(a){return{code:An,message:"File is larger than ".concat(a," ").concat(a===1?"byte":"bytes")}},Ia=function(a){return{code:On,message:"File is smaller than ".concat(a," ").concat(a===1?"byte":"bytes")}},In={code:Rn,message:"Too many files"};function vt(e,a){var n=e.type==="application/x-moz-file"||Fn(e,a);return[n,n?null:Mn(a)]}function gt(e,a,n){if(ve(e.size))if(ve(a)&&ve(n)){if(e.size>n)return[!1,Ma(n)];if(e.size<a)return[!1,Ia(a)]}else{if(ve(a)&&e.size<a)return[!1,Ia(a)];if(ve(n)&&e.size>n)return[!1,Ma(n)]}return[!0,null]}function ve(e){return e!=null}function qn(e){var a=e.files,n=e.accept,i=e.minSize,l=e.maxSize,r=e.multiple,p=e.maxFiles,d=e.validator;return!r&&a.length>1||r&&p>=1&&a.length>p?!1:a.every(function(b){var f=vt(b,n),x=Se(f,1),_=x[0],y=gt(b,i,l),j=Se(y,1),C=j[0],w=d?d(b):null;return _&&C&&!w})}function Me(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ae(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(a){return a==="Files"||a==="application/x-moz-file"}):!!e.target&&!!e.target.files}function qa(e){e.preventDefault()}function Ln(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Bn(e){return e.indexOf("Edge/")!==-1}function Un(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Ln(e)||Bn(e)}function ee(){for(var e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return function(i){for(var l=arguments.length,r=new Array(l>1?l-1:0),p=1;p<l;p++)r[p-1]=arguments[p];return a.some(function(d){return!Me(i)&&d&&d.apply(void 0,[i].concat(r)),Me(i)})}}function $n(){return"showOpenFilePicker"in window}function Hn(e){if(ve(e)){var a=Object.entries(e).filter(function(n){var i=Se(n,2),l=i[0],r=i[1],p=!0;return ht(l)||(console.warn('Skipped "'.concat(l,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),p=!1),(!Array.isArray(r)||!r.every(bt))&&(console.warn('Skipped "'.concat(l,'" because an invalid file extension was provided.')),p=!1),p}).reduce(function(n,i){var l=Se(i,2),r=l[0],p=l[1];return Ra(Ra({},n),{},ft({},r,p))},{});return[{description:"Files",accept:a}]}return e}function Kn(e){if(ve(e))return Object.entries(e).reduce(function(a,n){var i=Se(n,2),l=i[0],r=i[1];return[].concat(Aa(a),[l],Aa(r))},[]).filter(function(a){return ht(a)||bt(a)}).join(",")}function Wn(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Gn(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ht(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function bt(e){return/^.*\.[\w]+$/.test(e)}var Vn=["children"],Yn=["open"],Jn=["refKey","ro
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ei(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ai(e){if(Array.isArray(e))return fa(e)}function na(e,a){return ii(e)||ni(e,a)||yt(e,a)||ti()}function ti(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yt(e,a){if(e){if(typeof e=="string")return fa(e,a);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fa(e,a)}}function fa(e,a){(a==null||a>e.length)&&(a=e.length);for(var n=0,i=new Array(a);n<a;n++)i[n]=e[n];return i}function ni(e,a){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i=[],l=!0,r=!1,p,d;try{for(n=n.call(e);!(l=(p=n.next()).done)&&(i.push(p.value),!(a&&i.length===a));l=!0);}catch(b){r=!0,d=b}finally{try{!l&&n.return!=null&&n.return()}finally{if(r)throw d}}return i}}function ii(e){if(Array.isArray(e))return e}function La(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,i)}return n}function M(e){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?La(Object(n),!0).forEach(function(i){xa(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):La(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function xa(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function Ie(e,a){if(e==null)return{};var n=oi(e,a),i,l;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l<r.length;l++)i=r[l],!(a.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function oi(e,a){if(e==null)return{};var n={},i=Object.keys(e),l,r;for(r=0;r<i.length;r++)l=i[r],!(a.indexOf(l)>=0)&&(n[l]=e[l]);return n}var He=o.forwardRef(function(e,a){var n=e.children,i=Ie(e,Vn),l=si(i),r=l.open,p=Ie(l,Yn);return o.useImperativeHandle(a,function(){return{open:r}},[r]),Tt.createElement(o.Fragment,null,n(M(M({},p),{},{open:r})))});He.displayName="Dropzone";var jt={disabled:!1,getFilesFromEvent:xn,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};He.defaultProps=jt;He.propTypes={children:F.func,accept:F.objectOf(F.arrayOf(F.string)),multiple:F.bool,preventDropOnDocument:F.bool,noClick:F.bool,noKeyboard:F.bool,noDrag:F.bool,noDragEventsBubbling:F.bool,minSize:F.number,maxSize:F.number,maxFiles:F.number,disabled:F.bool,getFilesFromEvent:F.func,onFileDialogCancel:F.func,onFileDialogOpen:F.func,useFsAccessApi:F.bool,autoFocus:F.bool,onDragEnter:F.func,onDragLeave:F.func,onDragOver:F.func,onDrop:F.func,onDropAccepted:F.func,onDropRejected:F.func,onError:F.func,validator:F.func};var va={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function si(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=M(M({},jt),e),n=a.accept,i=a.disabled,l=a.getFilesFromEvent,r=a.maxSize,p=a.minSize,d=a.multiple,b=a.maxFiles,f=a.onDragEnter,x=a.onDragLeave,_=a.onDragOver,y=a.onDrop,j=a.onDropAccepted,C=a.onDropRejected,w=a.onFileDialogCancel,N=a.onFileDialogOpen,g=a.useFsAccessApi,$=a.autoFocus,I=a.preventDropOnDocument,P=a.noClick,u=a.noKeyboard,z=a.noDrag,k=a.noDragEventsBubbling,q=a.onError,D=a.validator,G=o.useMemo(function(){return Kn(n)},[n]),ue=o.useMemo(function(){return Hn(n)},[n]),L=o.useMemo(function(){return typeof N=="function"?N:Ba},[N]),H=o.useMemo(function(){return typeof w=="function"?w:Ba},[w]),R=o.useRef(null),U=o.useRef(null),De=o.useReducer(li,va),ce=na(De,2),te=ce[0],B=ce[1],pe=te.isFocused,K=te.isFileDialogActive,ne=o.useRef(typeof window<"u"&&window.isSecureContext&&g&&$n()),Ne=function(){!ne.current&&K&&setTimeout(function(){if(U.current){var m=U.current.files;m.length||(B({type:"closeDialog"}),H())}},300)};o.useEffect(function(){return window.addEve
/* Tooltip styles */
.tooltip-container {
position: relative;
overflow: visible !important;
}
.tooltip {
position: fixed; /* Use fixed positioning to escape overflow constraints */
z-index: 9999; /* Ensure tooltip appears above all other elements */
max-width: 600px;
white-space: normal;
border-radius: 0.375rem;
padding: 0.5rem 0.75rem;
background-color: rgba(0, 0, 0, 0.95);
color: white;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
pointer-events: none; /* Prevent tooltip from interfering with mouse events */
opacity: 0;
visibility: hidden;
transition: opacity 0.15s, visibility 0.15s;
}
.tooltip.visible {
opacity: 1;
visibility: visible;
}
.dark .tooltip {
background-color: rgba(255, 255, 255, 0.95);
color: black;
}
/* Position tooltip helper class */
.tooltip-helper {
position: absolute;
visibility: hidden;
pointer-events: none;
top: 0;
left: 0;
width: 100%;
height: 0;
}
@keyframes pulse {
0% {
background-color: rgb(255 0 0 / 0.1);
border-color: rgb(255 0 0 / 0.2);
}
50% {
background-color: rgb(255 0 0 / 0.2);
border-color: rgb(255 0 0 / 0.4);
}
100% {
background-color: rgb(255 0 0 / 0.1);
border-color: rgb(255 0 0 / 0.2);
}
}
.dark .pipeline-busy {
animation: dark-pulse 2s infinite;
}
@keyframes dark-pulse {
0% {
background-color: rgb(255 0 0 / 0.2);
border-color: rgb(255 0 0 / 0.4);
}
50% {
background-color: rgb(255 0 0 / 0.3);
border-color: rgb(255 0 0 / 0.6);
}
100% {
background-color: rgb(255 0 0 / 0.2);
border-color: rgb(255 0 0 / 0.4);
}
}
.pipeline-busy {
animation: pulse 2s infinite;
border: 1px solid;
}
`;function ji(){const e=o.useRef(!0);o.useEffect(()=>{e.current=!0;const c=()=>{e.current=!1};return window.addEventListener("beforeunload",c),()=>{e.current=!1,window.removeEventListener("beforeunload",c)}},[]);const[a,n]=o.useState(!1),{t:i,i18n:l}=me(),r=Ce.use.health(),p=Ce.use.pipelineBusy(),[d,b]=o.useState(null),f=Pe.use.currentTab(),x=Pe.use.showFileName(),_=Pe.use.setShowFileName(),y=Pe.use.documentsPageSize(),j=Pe.use.setDocumentsPageSize(),[,C]=o.useState([]),[w,N]=o.useState({page:1,page_size:y,total_count:0,total_pages:0,has_next:!1,has_prev:!1}),[g,$]=o.useState({all:0}),[I,P]=o.useState(!1),[u,z]=o.useState("updated_at"),[k,q]=o.useState("desc"),[D,G]=o.useState("all"),[ue,L]=o.useState({all:1,processed:1,processing:1,pending:1,failed:1}),[H,R]=o.useState([]),U=H.length>0,De=o.useCallback((c,s)=>{R(m=>s?[...m,c]:m.filter(v=>v!==c))},[]),ce=o.useCallback(()=>{R([])},[]),te=c=>{let s=c;c==="id"&&(s=x?"file_path":"id");const m=u===s&&k==="desc"?"asc":"desc";z(s),q(m),N(v=>({...v,page:1})),L({all:1,processed:1,processing:1,pending:1,failed:1})},B=o.useCallback(c=>[...c].sort((s,m)=>{let v,h;u==="id"&&x?(v=ia(s),h=ia(m)):u==="id"?(v=s.id,h=m.id):(v=new Date(s[u]).getTime(),h=new Date(m[u]).getTime());const S=k==="asc"?1:-1;return typeof v=="string"&&typeof h=="string"?S*v.localeCompare(h):S*(v>h?1:v<h?-1:0)}),[u,k,x]),pe=o.useMemo(()=>{if(!d)return null;const c=[];return D==="all"?Object.entries(d.statuses).forEach(([s,m])=>{m.forEach(v=>{c.push({...v,status:s})})}):(d.statuses[D]||[]).forEach(m=>{c.push({...m,status:D})}),u&&k?B(c):c},[d,u,k,D,B]),K=o.useMemo(()=>(pe==null?void 0:pe.map(c=>c.id))||[],[pe]),ne=o.useMemo(()=>K.filter(c=>H.includes(c)).length,[K,H]),Ne=o.useMemo(()=>K.length>0&&ne===K.length,[K,ne]),V=o.useMemo(()=>ne>0,[ne]),he=o.useCallback(()=>{R(K)},[K]),ie=o.useCallback(()=>V?Ne?{text:i("documentPanel.selectDocuments.deselectAll",{count:K.length}),action:ce,icon:nt}:{text:i("documentPanel.selectDocuments.selectCurrentPage",{count:K.length}),action:he,icon:ja}:{text:i("documentPanel.selectDocuments.selectCurrentPage",{count:K.length}),action:he,icon:ja},[V,Ne,K.length,he,ce,i]),de=o.useMemo(()=>{if(!d)return{all:0};const c={all:0};return Object.entries(d.statuses).forEach(([s,m])=>{c[s]=m.length,c.all+=m.length}),c},[d]),ze=o.useRef({processed:0,processing:0,pending:0,failed:0});o.useEffect(()=>{const c=document.createElement("style");return c.textContent=vi,document.head.appendChild(c),()=>{document.head.removeChild(c)}},[]);const Ee=o.useRef(null);o.useEffect(()=>{if(!d)return;const c=()=>{document.querySelectorAll(".tooltip-container").forEach(h=>{const S=h.querySelector(".tooltip");if(!S||!S.classList.contains("visible"))return;const A=h.getBoundingClientRect();S.style.left=`${A.left}px`,S.style.top=`${A.top-5}px`,S.style.transform="translateY(-100%)"})},s=v=>{const S=v.target.closest(".tooltip-container");if(!S)return;const A=S.querySelector(".tooltip");A&&(A.classList.add("visible"),c())},m=v=>{const S=v.target.closest(".tooltip-container");if(!S)return;const A=S.querySelector(".tooltip");A&&A.classList.remove("visible")};return document.addEventListener("mouseover",s),document.addEventListener("mouseout",m),()=>{document.removeEventListener("mouseover",s),document.removeEventListener("mouseout",m)}},[d]);const oe=o.useCallback(async(c,s,m)=>{try{if(!e.current)return;P(!0);const h=await wa({status_filter:m==="all"?null:m,page:c,page_size:s,sort_field:u,sort_direction:k});if(!e.current)return;N(h.pagination),C(h.documents),$(h.status_counts);const S={statuses:{processed:h.documents.filter(A=>A.status==="processed"),processing:h.documents.filter(A=>A.status==="processing"),pending:h.documents.filter(A=>A.status==="pending"),failed:h.documents.filter(A=>A.status==="failed")}};h.pagination.total_count>0?b(S):b(null)}catch(v){e.current&&O.error(i("documentPanel.documentManager.errors.loadFailed",{error:ae(v)}))}finally{e.current&&P(!1)}},[u,k,i]),Y=o.useCallback(async()=>{await oe(w.page,w.page_size,D)},[oe,w.page,w.page_size,D]),J=o.useRef(void 0),fe=o.useRef(null),Q=o.useCallback(()=>{fe.