1import{j as e,r as b}from"./vendor-react-Bw0yZR8O.js";import{u as _}from"./vendor-dexie-DZvIVlTU.js";import{u as $}from"./vendor-forms-CTVyZF50.js";import{u as J,d as B}from"./index-CNA9GrcP.js";import{c as C,f as N}from"./formatters-DmBPxZwk.js";import{l as O}from"./lazyClientLibs-CJxOBoH9.js";import{p as k}from"./printExportFacade-WuZPNfCr.js";import{b as W}from"./exportFileName-vVXBV_bD.js";import{P as V}from"./PrintHeader-D7eVcmmN.js";import{P as G}from"./PageHeader-Bxkp40HB.js";import{S as q}from"./SectionCard-DwzTcXID.js";import{E as I}from"./EmptyState-BAFWeQ2F.js";import{H as U}from"./HeaderTabs-B3le-tc5.js";import"./vendor-jspdf-DG6NFa1h.js";import"./vendor-firebase-app-BK1n4Tym.js";import"./vendor-date-B1LbXl1V.js";import"./exportUtils-DlOnMoX8.js";import"./standaloneStyles-DOysmO5P.js";import"./pdfGenerator-pUS63vyi.js";const X=({settings:l,assets:o,filterTitle:h})=>{const m=o.length,n=o.reduce((t,x)=>t+(Number(x.hargaPerolehan)||0),0),s=o.filter(t=>t.kondisi==="Baik").length,i=o.filter(t=>t.kondisi!=="Baik").length;return e.jsxs("div",{className:"font-sans text-black p-6 bg-white printable-content-wrapper",style:{width:"21cm",margin:"0 auto",boxSizing:"border-box"},children:[e.jsx(V,{settings:l,title:"LAPORAN DATA ASET & INVENTARIS"}),e.jsxs("div",{className:"flex justify-between items-end mb-4 border-b-2 border-black pb-2",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm",children:["Filter: ",e.jsx("strong",{children:h||"Semua Aset"})]}),e.jsxs("p",{className:"text-sm",children:["Dicetak: ",C(new Date().toISOString())]})]}),e.jsxs("div",{className:"text-right text-sm",children:[e.jsxs("p",{children:["Total Aset: ",e.jsxs("strong",{children:[m," Item"]})]}),e.jsxs("p",{children:["Total Valuasi: ",e.jsx("strong",{children:N(n)})]})]})]}),e.jsxs("div",{className:"mb-4 text-xs flex gap-4",children:[e.jsxs("span",{className:"bg-green-100 px-2 py-1 border border-green-300 rounded",children:["Kondisi Baik: ",s]}),e.jsxs("span",{className:"bg-red-100 px-2 py-1 border border-red-300 rounded",children:["Perlu Perbaikan/Rusak: ",i]})]}),e.jsxs("table",{className:"w-full border-collapse border border-black text-xs",children:[e.jsx("thead",{className:"bg-gray-200 uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"border border-black p-2 w-8 text-center",children:"No"}),e.jsx("th",{className:"border border-black p-2 text-left",children:"Kode & Nama Barang"}),e.jsx("th",{className:"border border-black p-2 text-left",children:"Kategori"}),e.jsx("th",{className:"border border-black p-2 text-left",children:"Lokasi"}),e.jsx("th",{className:"border border-black p-2 text-center",children:"Kondisi"}),e.jsx("th",{className:"border border-black p-2 text-center",children:"Jml/Luas"}),e.jsx("th",{className:"border border-black p-2 text-right",children:"Nilai Aset"})]})}),e.jsx("tbody",{children:o.length>0?o.map((t,x)=>e.jsxs("tr",{className:"break-inside-avoid",children:[e.jsx("td",{className:"border border-black p-2 text-center",children:x+1}),e.jsxs("td",{className:"border border-black p-2",children:[e.jsx("div",{className:"font-bold",children:t.nama}),e.jsx("div",{className:"text-[9px] text-gray-600 font-mono",children:t.kode})]}),e.jsx("td",{className:"border border-black p-2",children:t.kategori}),e.jsx("td",{className:"border border-black p-2",children:t.lokasi}),e.jsx("td",{className:"border border-black p-2 text-center",children:t.kondisi}),e.jsx("td",{className:"border border-black p-2 text-center",children:t.jenis==="Bergerak"?`${t.jumlah} ${t.satuan||""}`:`${t.luas||"-"} m²`}),e.jsx("td",{className:"border border-black p-2 text-right",children:N(t.hargaPerolehan)})]},t.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"border border-black p-8 text-center italic text-gray-500",children:"Tidak ada data aset untuk ditampilkan."})})}),e.jsx("tfoot",{className:"bg-gray-100 font-bold",children:e.jsxs("tr",{children:[e.jsx("td",{colSpan:6,className:"border border-black p-2 text-right",children:"TOTAL NILAI ASET"}),e.jsx("td",{className:"border border-black p-2 text-right",children:N(n)})]})})]}),e.jsxs("div",{className:"flex justify-between items-end mt-8 px-4 text-sm break-inside-avoid",children:[e.jsxs("div",{className:"text-center w-48",children:[e.jsx("p",{children:"Mengetahui,"}),e.jsx("p",{children:"Pimpinan Pondok"}),e.jsx("div",{className:"h-14"}),e.jsx("p",{className:"border-b border-black pb-1 font-bold",children:"........................................"})]}),e.jsxs("div",{className:"text-center w-48",children:[e.jsxs("p",{children:[l.alamat.split(",")[1]?.trim()||"Tempat",", ",C(new Date().toISOString())]}),e.jsx("p",{children:"Bagian Sarana & Prasarana"}),e.jsx("div",{className:"h-14"}),e.jsx("p",{className:"font-bold underline",children:"........................................"})]})]}),e.jsx("div",{className:"report-signature-footer print-meta border-t border-gray-400 text-center text-[8pt] text-gray-500 italic w-full mt-3 pt-1",children:"dibuat dengan aplikasi eSantri Web by AI Projek | aiprojek01.my.id"})]})},Q=({assets:l})=>{const o=l.length,h=l.reduce((i,t)=>i+(Number(t.hargaPerolehan)||0),0),m=l.filter(i=>i.jenis==="Bergerak").length,n=l.filter(i=>i.jenis==="Tidak Bergerak").length,s={Baik:l.filter(i=>i.kondisi==="Baik").length,RusakRingan:l.filter(i=>i.kondisi==="Rusak Ringan").length,RusakBerat:l.filter(i=>i.kondisi==="Rusak Berat").length};return e.jsx("div",{className:"space-y-6 animate-fade-in",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-gray-100",children:[e.jsx("p",{className:"text-gray-500 text-xs uppercase font-bold",children:"Total Nilai Aset"}),e.jsx("p",{className:"text-2xl font-bold text-teal-700 mt-1",children:N(h)}),e.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[o," Item Terdaftar"]})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-gray-100",children:[e.jsx("p",{className:"text-gray-500 text-xs uppercase font-bold",children:"Aset Bergerak"}),e.jsx("p",{className:"text-2xl font-bold text-blue-600 mt-1",children:m}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Alat Tulis, Elektronik, dll"})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-gray-100",children:[e.jsx("p",{className:"text-gray-500 text-xs uppercase font-bold",children:"Aset Tetap (Tanah/Bangunan)"}),e.jsx("p",{className:"text-2xl font-bold text-purple-600 mt-1",children:n}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Tanah, Gedung, Sumur"})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-gray-100",children:[e.jsx("p",{className:"text-gray-500 text-xs uppercase font-bold",children:"Kondisi Aset"}),e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:"Baik"}),e.jsx("span",{className:"font-bold text-green-600",children:s.Baik})]}),e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:"Rusak Ringan"}),e.jsx("span",{className:"font-bold text-yellow-600",children:s.RusakRingan})]}),e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:"Rusak Berat"}),e.jsx("span",{className:"font-bold text-red-600",children:s.RusakBerat})]})]})]})]})})},Y=({isOpen:l,onClose:o,onSave:h,onUpdate:m,initialData:n})=>{const{register:s,handleSubmit:i,watch:t,reset:x,setValue:y}=$(),v=t("jenis","Bergerak");b.useEffect(()=>{l&&x(n||{kode:`INV-${new Date().getFullYear()}-${Math.floor(Math.random()*1e3)}`,jenis:"Bergerak",kondisi:"Baik",sumber:"Beli Sendiri",tanggalPerolehan:new Date().toISOString().split("T")[0],jumlah:1,hargaPerolehan:0})},[l,n,x]);const A=async w=>{n?.id?await m({...w,id:n.id}):await h(w)};return l?e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-60 z-[70] flex justify-center items-center p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"p-5 border-b flex justify-between items-center bg-gray-50 rounded-t-lg",children:[e.jsx("h3",{className:"text-lg font-bold text-gray-800",children:n?"Edit Aset":"Tambah Aset Baru"}),e.jsx("button",{onClick:o,children:e.jsx("i",{className:"bi bi-x-lg"})})]}),e.jsxs("form",{onSubmit:i(A),className:"flex-grow overflow-y-auto p-6 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Kode Barang"}
1),e.jsx("input",{type:"text",...s("kode",{required:!0}),className:"w-full border rounded p-2 text-sm bg-gray-50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Jenis Aset"}),e.jsxs("select",{...s("jenis"),className:"w-full border rounded p-2 text-sm",children:[e.jsx("option",{value:"Bergerak",children:"Barang Bergerak"}),e.jsx("option",{value:"Tidak Bergerak",children:"Barang Tidak Bergerak (Tanah/Bangunan)"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Nama Barang / Aset"}),e.jsx("input",{type:"text",...s("nama",{required:!0}),className:"w-full border rounded p-2 text-sm",placeholder:v==="Bergerak"?"Contoh: Laptop Asus, Meja Belajar":"Contoh: Tanah Wakaf H. Fulan, Gedung Asrama A"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Kategori"}),e.jsx("input",{list:"kategori-list",...s("kategori"),className:"w-full border rounded p-2 text-sm",placeholder:"Ketik atau pilih..."}),e.jsxs("datalist",{id:"kategori-list",children:[e.jsx("option",{value:"Elektronik"}),e.jsx("option",{value:"Meubeler"}),e.jsx("option",{value:"Kendaraan"}),e.jsx("option",{value:"Peralatan Dapur"}),e.jsx("option",{value:"Tanah"}),e.jsx("option",{value:"Bangunan"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Lokasi Penempatan"}),e.jsx("input",{type:"text",...s("lokasi"),className:"w-full border rounded p-2 text-sm",placeholder:"Gedung / Ruangan / Alamat"})]})]}),v==="Bergerak"?e.jsxs("div",{className:"p-3 bg-blue-50 rounded border border-blue-100 grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-blue-800 mb-1",children:"Jumlah"}),e.jsx("input",{type:"number",...s("jumlah",{valueAsNumber:!0}),className:"w-full border rounded p-2 text-sm"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-blue-800 mb-1",children:"Satuan"}),e.jsx("input",{type:"text",...s("satuan"),className:"w-full border rounded p-2 text-sm",placeholder:"Unit, Pcs, Set"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-blue-800 mb-1",children:"Kondisi"}),e.jsxs("select",{...s("kondisi"),className:"w-full border rounded p-2 text-sm",children:[e.jsx("option",{value:"Baik",children:"Baik"}),e.jsx("option",{value:"Rusak Ringan",children:"Rusak Ringan"}),e.jsx("option",{value:"Rusak Berat",children:"Rusak Berat"}),e.jsx("option",{value:"Afkir",children:"Afkir (Dibuang)"})]})]})]}):e.jsxs("div",{className:"p-3 bg-green-50 rounded border border-green-100 grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-green-800 mb-1",children:"Luas (m²)"}),e.jsx("input",{type:"number",...s("luas",{valueAsNumber:!0}),className:"w-full border rounded p-2 text-sm",placeholder:"Luas area"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-green-800 mb-1",children:"Legalitas / Sertifikat"}),e.jsx("input",{type:"text",...s("legalitas"),className:"w-full border rounded p-2 text-sm",placeholder:"SHM No... / Akta Wakaf"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-xs font-bold text-green-800 mb-1",children:"Kondisi Fisik"}),e.jsxs("select",{...s("kondisi"),className:"w-full border rounded p-2 text-sm",children:[e.jsx("option",{value:"Baik",children:"Baik / Terawat"}),e.jsx("option",{value:"Rusak Ringan",children:"Perlu Renovasi Ringan"}),e.jsx("option",{value:"Rusak Berat",children:"Perlu Renovasi Berat"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 border-t pt-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Tanggal Perolehan"}),e.jsx("input",{type:"date",...s("tanggalPerolehan"),className:"w-full border rounded p-2 text-sm"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Sumber Perolehan"}),e.jsxs("select",{...s("sumber"),className:"w-full border rounded p-2 text-sm",children:[e.jsx("option",{value:"Beli Sendiri",children:"Beli Sendiri (Kas Pondok)"}),e.jsx("option",{value:"Wakaf",children:"Wakaf"}),e.jsx("option",{value:"Hibah/Hadiah",children:"Hibah / Hadiah"}),e.jsx("option",{value:"Bantuan Pemerintah",children:"Bantuan Pemerintah"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Nilai Aset (Rp)"}),e.jsx("input",{type:"number",...s("hargaPerolehan",{valueAsNumber:!0}),className:"w-full border rounded p-2 text-sm",placeholder:"Harga beli / Taksiran nilai"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-700 mb-1",children:"Keterangan Tambahan"}),e.jsx("textarea",{...s("keterangan"),rows:2,className:"w-full border rounded p-2 text-sm"})]}),e.jsxs("div",{className:"flex justify-end pt-4 border-t gap-2",children:[e.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 border rounded-lg text-gray-600 hover:bg-gray-100",children:"Batal"}),e.jsx("button",{type:"submit",className:"px-6 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 font-bold",children:"Simpan"})]})]})]})}):null},je=()=>{const{showToast:l,showConfirmation:o,currentUser:h,settings:m}=J(),n=_(()=>B.inventaris.filter(a=>!a.deleted).toArray(),[])||[],[s,i]=b.useState("dashboard"),[t,x]=b.useState(""),[y,v]=b.useState(""),[A,w]=b.useState(!1),[c,T]=b.useState(!1),[L,g]=b.useState(!1),[K,S]=b.useState(null),j=h?.role==="admin"||h?.permissions?.sarpras==="write",f=b.useMemo(()=>{let a=n;if(s==="bergerak"&&(a=a.filter(r=>r.jenis==="Bergerak")),s==="tetap"&&(a=a.filter(r=>r.jenis==="Tidak Bergerak")),t){const r=t.toLowerCase();a=a.filter(p=>p.nama.toLowerCase().includes(r)||p.kode.toLowerCase().includes(r)||p.lokasi.toLowerCase().includes(r))}return y&&(a=a.filter(r=>r.kondisi===y)),a},[n,s,t,y]),E=async a=>{if(!j)return;const r={...a,lastModified:Date.now()};await B.inventaris.add(r),g(!1),l("Aset berhasil ditambahkan","success")},D=async a=>{j&&(await B.inventaris.put({...a,lastModified:Date.now()}),g(!1),l("Aset diperbarui","success"))},R=a=>{j&&o("Hapus Aset?","Data ini akan dihapus permanen.",async()=>{const r=await B.inventaris.get(a);r&&(await B.inventaris.put({...r,deleted:!0,lastModified:Date.now()}),l("Aset dihapus","success"))},{confirmColor:"red"})},M=()=>W("laporan-sarpras",[s==="dashboard"?"semua":s==="bergerak"?"bergerak":"tetap"]),u=async a=>{if(c)return;const r=M();w(!1),T(!0);try{if(a==="pdfVisual"){await k.printDialog({elementId:"sarpras-print-area",fileName:r,paperSize:"A4",target:"sarpras"});return}if(a==="pdfImage"){await k.downloadPdfImage({elementId:"sarpras-print-area",fileName:r,paperSize:"A4",target:"sarpras"});return}if(a==="print"){await k.printDialog({elementId:"sarpras-print-area",fileName:r,paperSize:"A4",target:"sarpras"});return}if(a==="pdfAutoTable"){await k.downloadPdfAutoTable({elementId:"sarpras-print-area",fileName:r,paperSize:"A4",target:"sarpras"});return}if(a==="word"){k.downloadWord({elementId:"sarpras-print-area",fileName:r,paperSize:"A4",target:"sarpras"});return}if(a==="html"){k.downloadHtml({elementId:"sarpras-print-area",fileName:r,paperSize:"A4",target:"sarpras"});return}if(a==="excel"){const p=await O(),F=(s==="dashboard"?n:f).map((d,z)=>({No:z+1,Kode:d.kode,Nama:d.nama,Jenis:d.jenis,Kategori:d.kategori||"-",Lokasi:d.lokasi||"-",Kondisi:d.kondisi,Jumlah:d.jenis==="Bergerak"?d.jumlah:"",Satuan:d.jenis==="Bergerak"?d.satuan||"-":"",Luas_m2:d.jenis==="Tidak Bergerak"&&d.luas||"",Legalitas:d.jenis==="Tidak Bergerak"?d.legalitas||"-":"",Sumber:d.sumber||"-",Tanggal_Perolehan:d.tanggalPerolehan||"-",Nilai_Aset:Number(d.hargaPerolehan)||0})),H=p.utils.json_to_sheet(F),P=p.utils.book_new();p.utils.book_append_sheet(P,H,"Sarpras"),p.writeFile(P,`${r}.xlsx`);return}}catch(p){console.error(p),l("Gagal mengekspor laporan sarpras.","error")}finally{T(!1)}};return e.jsxs("div",{className:"flex h-full min-h-0 flex-col space-y-6 pb-20",children:[e.jsx(G,{eyebrow:"Keuangan & Aset",title:"Manajemen Aset & Inventaris",description:"Pantau dashboard aset, inventaris bergerak, serta tanah dan bangunan dari panel sarpras yang lebih konsisten.",tabs:e.jsx(U,{value:s,onChange:a=>i(a),tabs:[{value:"dashboard",label:"Dashboard",icon:"bi-speedometer2"},{value:"bergerak",label:"Aset Bergerak",icon:"bi-box-seam"},{value:"tetap",label:"Tanah & Bangunan",icon:"bi-building"}]})}),s==="dashboard"&&e.jsx(Q,{assets:n}),(s==="bergerak"||s==="tetap")&&e.jsxs(q,{className:"animate-fade-in",contentClassName:"p-4 md:p-6",children:[e.jsxs("div",{className:"mb-6 grid grid-cols-1 gap-2 lg:grid-cols-[2fr_1fr_auto_auto] lg:items-center",children:[e.jsx("div",{className:"w-full min-w-0",children:e.jsx("input",{type:"text",placeholder:"Cari nama, kode, lokasi...",value:t,onChange:a=>x(a.target.value),className:"border rounded-lg p-2 text-sm w-full"})}),e.jsxs("select",{value:y,onChange:a=>v(a.target.value),className:"border rounded-lg p-2 text-sm",children:[e.jsx("option",{value:"",children:"Semua Kondisi"}),e.jsx("option",{value:"Baik",children:"Baik"}),e.jsx("option",{value:"Rusak Ringan",children:"Rusak Ringan"}),e.jsx("option",{value:"Rusak Berat",children:"Rusak Berat"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>w(a=>
1!a),disabled:c,className:"bg-gray-700 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-gray-800 flex items-center justify-center gap-2 w-full lg:w-auto disabled:cursor-not-allowed disabled:opacity-60",children:[e.jsx("i",{className:`bi ${c?"bi-arrow-repeat animate-spin":"bi-printer-fill"}`}),c?"Memproses...":"Aksi Laporan"]}),A&&e.jsxs("div",{className:"absolute right-0 z-20 mt-2 w-44 rounded-lg border border-gray-200 bg-white shadow-lg overflow-hidden",children:[e.jsx("button",{disabled:c,onClick:()=>u("pdfVisual"),className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 disabled:opacity-50",children:"PDF Visual"}),e.jsx("button",{disabled:c,onClick:()=>u("pdfImage"),className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 disabled:opacity-50",children:"PDF Gambar"}),e.jsx("button",{disabled:c,onClick:()=>u("print"),className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 disabled:opacity-50",children:"Cetak"}),e.jsx("button",{disabled:c,onClick:()=>u("pdfAutoTable"),className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 disabled:opacity-50",children:"PDF AutoTable"}),e.jsx("button",{disabled:c,onClick:()=>u("word"),className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 disabled:opacity-50",children:"Word"}),e.jsx("button",{disabled:c,onClick:()=>u("excel"),className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 disabled:opacity-50",children:"Excel"}),e.jsx("button",{disabled:c,onClick:()=>u("html"),className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 disabled:opacity-50",children:"HTML"})]})]}),j&&e.jsxs("button",{onClick:()=>{S(null),g(!0)},className:"bg-teal-600 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-teal-700 flex items-center justify-center gap-2",children:[e.jsx("i",{className:"bi bi-plus-lg"})," Tambah Aset"]}),e.jsx("div",{className:"lg:hidden",children:e.jsx("button",{onClick:()=>{x(""),v("")},className:"bg-white border border-gray-300 text-gray-700 px-4 py-2 rounded-lg text-sm font-semibold hover:bg-gray-50",children:"Reset Filter"})})]}),e.jsx("div",{className:"hidden md:block app-table-shell overflow-x-auto",children:e.jsxs("table",{className:"app-table text-sm text-left",children:[e.jsx("thead",{className:"uppercase border-b border-app-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3",children:"Kode"}),e.jsx("th",{className:"px-4 py-3",children:"Nama Barang"}),e.jsx("th",{className:"px-4 py-3",children:"Kategori"}),e.jsx("th",{className:"px-4 py-3",children:"Lokasi"}),s==="bergerak"?e.jsx("th",{className:"px-4 py-3 text-center",children:"Jml"}):e.jsx("th",{className:"px-4 py-3",children:"Legalitas/Luas"}),e.jsx("th",{className:"px-4 py-3",children:"Kondisi"}),e.jsx("th",{className:"px-4 py-3 text-right",children:"Nilai Aset"}),e.jsx("th",{className:"px-4 py-3 text-center",children:"Aksi"})]})}),e.jsxs("tbody",{className:"divide-y",children:[f.map(a=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-500",children:a.kode}),e.jsxs("td",{className:"px-4 py-3 font-medium text-gray-900",children:[a.nama,e.jsxs("div",{className:"text-[10px] text-gray-400",children:[a.sumber," ⢠",a.tanggalPerolehan]})]}),e.jsx("td",{className:"px-4 py-3",children:a.kategori}),e.jsx("td",{className:"px-4 py-3 text-gray-600",children:a.lokasi}),s==="bergerak"?e.jsxs("td",{className:"px-4 py-3 text-center font-bold",children:[a.jumlah," ",a.satuan]}):e.jsxs("td",{className:"px-4 py-3 text-xs",children:[e.jsxs("div",{className:"font-bold",children:[a.luas," m²"]}),e.jsx("div",{className:"text-gray-500 truncate max-w-[150px]",title:a.legalitas,children:a.legalitas||"-"})]}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${a.kondisi==="Baik"?"bg-green-100 text-green-700":a.kondisi==="Rusak Ringan"?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"}`,children:a.kondisi})}),e.jsx("td",{className:"px-4 py-3 text-right",children:N(a.hargaPerolehan)}),e.jsx("td",{className:"px-4 py-3 text-center flex justify-center gap-2",children:j&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{S(a),g(!0)},className:"text-blue-600 hover:text-blue-800",children:e.jsx("i",{className:"bi bi-pencil-square"})}),e.jsx("button",{onClick:()=>R(a.id),className:"text-red-600 hover:text-red-800",children:e.jsx("i",{className:"bi bi-trash"})})]})})]},a.id)),f.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"p-4",children:e.jsx(I,{icon:"bi-box-seam",title:"Data aset kosong",description:"Belum ada data aset yang cocok dengan filter sarpras saat ini."})})})]})]})}),e.jsxs("div",{className:"md:hidden space-y-3",children:[f.map(a=>e.jsxs("article",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-sm text-gray-900",children:a.nama}),e.jsx("div",{className:"font-mono text-[10px] text-gray-500",children:a.kode})]}),e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${a.kondisi==="Baik"?"bg-green-100 text-green-700":a.kondisi==="Rusak Ringan"?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"}`,children:a.kondisi})]}),e.jsxs("div",{className:"mt-2 text-xs text-gray-600",children:[e.jsxs("div",{children:[a.kategori," ⢠",a.lokasi||"-"]}
1),e.jsxs("div",{children:[a.sumber," ⢠",a.tanggalPerolehan]}),s==="bergerak"?e.jsxs("div",{className:"font-semibold mt-1",children:["Jumlah: ",a.jumlah," ",a.satuan]}):e.jsxs("div",{className:"font-semibold mt-1",children:["Luas: ",a.luas||0," m² ⢠",a.legalitas||"-"]})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-bold text-gray-800",children:N(a.hargaPerolehan)}),j&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>{S(a),g(!0)},className:"text-blue-600 hover:text-blue-800 p-1",children:e.jsx("i",{className:"bi bi-pencil-square"})}),e.jsx("button",{onClick:()=>R(a.id),className:"text-red-600 hover:text-red-800 p-1",children:e.jsx("i",{className:"bi bi-trash"})})]})]})]},a.id)),f.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(I,{icon:"bi-box-seam",title:"Data aset kosong",description:"Belum ada data aset yang cocok dengan filter sarpras saat ini."})})]})]}),e.jsx(Y,{isOpen:L,onClose:()=>g(!1),onSave:E,onUpdate:D,initialData:K}),e.jsx("div",{className:"fixed -left-[10000px] top-0 z-[-1] opacity-0 pointer-events-none print:static print:left-auto print:top-auto print:z-auto print:opacity-100 print:pointer-events-auto","aria-hidden":"true",children:e.jsx("div",{id:"sarpras-print-area",children:e.jsx(X,{settings:m,assets:s==="dashboard"?n:f,filterTitle:s==="dashboard"?"Semua Aset":s==="bergerak"?"Aset Bergerak":"Aset Tetap"})})})]})};export{je as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.