import{t as e}from"./charges-table-CIL9Y7el.js";import{Eu as t,Lt as n,Nl as r,Pd as i,Xu as a,Zu as o,ed as s,ql as c,tc as l,tn as u,tr as d,zd as f}from"./index-Q5R6-AeA.js";import{t as p}from"./use-url-query-Cos8nKH-.js";import{t as m}from"./page-layout-Cl29SycZ.js";var h=f(i(),1),g=t(),_=()=>{let{setFiltersContext:t}=(0,h.useContext)(d),[i,f]=(0,h.useState)(!1),[_,v]=(0,h.useState)([]),{get:y}=p(),[b,x]=(0,h.useState)(y(`page`)?Number(y(`page`)):1),S=(0,h.useCallback)((e,t)=>{_.map(e=>e.id).includes(e)?v(_.filter(t=>t.id!==e)):v([..._,{id:e,onChange:t}])},[_]),[{data:C,fetching:w}]=r({query:l,variables:{page:b,limit:100}});function T(){v([])}return(0,h.useEffect)(()=>{t((0,g.jsxs)(`div`,{className:`flex flex-row gap-x-5`,children:[(0,g.jsx)(u,{content:`Expand all accounts`,children:(0,g.jsx)(c,{variant:`outline`,size:`icon`,className:`size-7.5`,onClick:()=>f(e=>!e),children:i?(0,g.jsx)(o,{className:`size-5`}):(0,g.jsx)(a,{className:`size-5`})})}),(0,g.jsx)(n,{selected:_,resetMerge:T})]}))},[C,w,b,i,t,x,f,_]),(0,g.jsx)(m,{title:`Missing Info Charges`,description:`Review charges with missing required details`,children:!C?.chargesWithMissingRequiredInfo.nodes||w?(0,g.jsx)(s,{className:`h-10 w-10 animate-spin mr-2 self-center`}):(0,g.jsx)(e,{toggleMergeCharge:S,mergeSelectedCharges:new Set(_.map(e=>e.id)),data:C?.chargesWithMissingRequiredInfo?.nodes,isAllOpened:i})})};export{_ as MissingInfoCharges};