import{j as t,I as m,b as f}from"./mui-vendor-CkIVaoQP.js";import{Q as s,l5 as p,G as r,S as o}from"./index-Cr86_nOs.js";import{r as n}from"./react-vendor-CmFgShSM.js";import{N as x,L as h,B as A,C as j}from"./chart-vendor-sE2SUVPW.js";import{A as b}from"./AdvancedTable-BvRVoK6m.js";import"./auto-gcBAg08D.js";import{d as y}from"./PictureAsPdf-DRk2BQst.js";import{u as S,f as g}from"./redux-vendor-B7uoacJt.js";import"./index-IuzvFnSU.js";import"./Close-C8iZ2Qr6.js";import"./Search-DLgMQCPC.js";import"./Delete-CTUmuli-.js";A.font.family="iranyekan";console.log(j);const F=()=>{const d=S(),{killsDailyReport:u}=g(e=>e.jahadSlice),[i,c]=n.useState([]),[C]=n.useState({labels:u==null?void 0:u.map(e=>s(new Date(e.date),"yyyy/MM/dd")),datasets:[{label:"درخواست کشتار",data:u==null?void 0:u.map(e=>e.totalPoultryRequestQuantity),backgroundColor:"#ff6384"},{label:"تایید شده",data:u==null?void 0:u.map(e=>e.acceptedRequestQuantity),backgroundColor:"#36a2eb"}],options:{title:{display:!0,text:"Monthly Sales and Expenses Report",fontSize:18},legend:{position:"bottom"},scales:{yAxes:[{ticks:{beginAtZero:!0}}]}}}),[l]=n.useState({labels:u==null?void 0:u.map(e=>s(new Date(e.date),"yyyy/MM/dd")),datasets:[{label:"میانگین وزن",data:u==null?void 0:u.map(e=>e.indexWeight),borderColor:"#ff6384",fill:!1}],options:{title:{display:!0,text:"Monthly Sales Report",fontSize:18},legend:{position:"bottom"},tooltips:{mode:"index",intersect:!1}}});return n.useEffect(()=>{d(p())},[]),n.useEffect(()=>{const e=u==null?void 0:u.map((a,M)=>[a.province,a.date,a.indexWeight,a.remainQuantity,a.provinceQuantity,a.countryQuantity,t.jsx("a",{target:"_blank",href:`https://core-inventory.iran.liara.run/pdf/kills-daily-report?date=${a.date}&which=${window.location.origin}`,rel:"noreferrer",children:t.jsx(m,{color:"primary",children:t.jsx(y,{})},"rrr")},"rrr")]);c(e)},[u]),t.jsxs(r,{mt:o.SMALL,children:[t.jsxs(r,{container:!0,children:[t.jsx(r,{xs:12,sm:6,children:t.jsx(x,{data:C})}),t.jsx(r,{xs:12,sm:6,children:t.jsx(h,{data:l})})]}),t.jsx(b,{name:"آمار روزانه کشتار استان",columns:["استان","درخواست کشتار","وزن اعلامی","مرغ باقی مانده","تایید نهایی استان","تایید نهایی کشوری","دریافت سند"],data:i})]})},N=()=>t.jsx(t.Fragment,{children:t.jsx(f,{display:"flex",justifyContent:"center",children:t.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(r,{container:!0,justifyContent:"space-between",gap:o.SMALL,children:t.jsx(r,{xs:12,children:t.jsx(F,{})})})})})});export{N as default};
