(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[162],{67:function(){},2061:function(){},5482:function(e,t,n){Promise.resolve().then(n.bind(n,6403)),Promise.resolve().then(n.bind(n,3580)),Promise.resolve().then(n.t.bind(n,2972,23))},6403:function(e,t,n){"use strict";n.d(t,{default:function(){return d}});var a=n(7437),r=n(1649),i=n(2735),s=n(2093),l=n(3375),c=n(4457),o=n.n(c);function d(e){let{ledger:t,companyName:n}=e,c=async()=>{let e=document.querySelector(".printable-area");if(!e)return;let t=document.querySelectorAll(".no-print");t.forEach(e=>e.style.display="none");try{let t=await o()(e,{scale:2,useCORS:!0}),a=t.toDataURL("image/png"),r=new l.ZP("p","mm","a4"),i=r.internal.pageSize.getWidth(),s=t.height*i/t.width,c=r.internal.pageSize.getHeight(),d=s,u=0;for(r.addImage(a,"PNG",0,u,i,s),d-=c;d>=0;)u=d-s,r.addPage(),r.addImage(a,"PNG",0,u,i,s),d-=c;r.save("كشف_حساب_".concat(n.replace(/\\s+/g,"_"),".pdf"))}finally{t.forEach(e=>e.style.display="")}};return(0,a.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},className:"no-print",children:[(0,a.jsxs)("button",{onClick:()=>{let e=t.map(e=>({التاريخ:e.date.toLocaleDateString("ar-SA"),البيان:e.desc,"مدين (لهم)":e.debit||"-","دائن (عليهم)":e.credit||"-","الرصيد التراكمي":e.runningBalance})),a=s.P6.json_to_sheet(e);a["!dir"]||(a["!dir"]="rtl");let r=s.P6.book_new();s.P6.book_append_sheet(r,a,"كشف الحساب"),s.NC(r,"كشف_حساب_".concat(n.replace(/\\s+/g,"_"),".xlsx"))},className:"btn btn-outline",style:{borderColor:"var(--success)",color:"var(--success)"},children:[(0,a.jsx)(r.Z,{size:18})," Excel"]}),(0,a.jsxs)("button",{onClick:c,className:"btn btn-primary",style:{backgroundColor:"#e74c3c"},children:[(0,a.jsx)(i.Z,{size:18})," PDF"]})]})}},3580:function(e,t,n){"use strict";n.d(t,{default:function(){return i}});var a=n(7437);let r=(0,n(7411).Z)("printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);function i(){return(0,a.jsxs)("button",{className:"btn btn-primary",onClick:()=>window.print(),children:[(0,a.jsx)(r,{size:18})," طباعة الكشف"]})}}},function(e){e.O(0,[425,337,505,125,972,378,478,117,744],function(){return e(e.s=5482)}),_N_E=e.O()}]);