📁 File Manager
📍
/
/
home
/
u449181296
/
domains
/
birulogi.smakpbaleendah.sch.id
/
public_html
/
lms
/
tukang-ngatur
/
assets
/
img
/
qr-logos
/home/u449181296/domains/birulogi.smakpbaleendah.sch.id/public_html/lms/tukang-ngatur/assets/img/qr-logos
Upload
Name
Size
Date
CHMOD
Action
— FILE —
logo_1773801405.php
6.73 KB
2026-03-18 02:36
644
(rw-r--r--)
Edit
|
Rename
|
Preview
|
Del
Edit
import{r as c,j as e}from"./react-vendor-Cdu9POhR.js";import{c as Re,d as L,s as Te,F as $e,l as De,x as Be,y as Me,z as Ke,n as fe,m as Ee,b as Le,i as Ie,u as He,C as Ge}from"./index-g-CJvtxD.js";import{n as ze}from"./studentIdentity-CvcNiiMo.js";import{e as ce,h as oe,f as I,s as X,j as V,o as C,q as w,w as y}from"./firebase-vendor-Cr1os6Vr.js";import{E as Ue}from"./pdf-vendor-BoEiDn9A.js";import{S as Fe}from"./SarprasWorkspace-DhSPZjAw.js";import{b as We,a as de}from"./finance-B2OdWnvh.js";import"./router-vendor-EW88JuZe.js";import"./xlsx-BBWTpfDg.js";const Oe=({onLogin:l})=>{const[o,m]=c.useState("nisn"),[x,h]=c.useState(""),[g,f]=c.useState(""),[j,H]=c.useState(""),[b,F]=c.useState(null),[v,A]=c.useState(!1),[_,S]=c.useState(null),W=async k=>{var N;if(k.preventDefault(),!!x){A(!0),S(null);try{const O=await ce(Re);let R=null;const Z=ze(O.docs.map(D=>({id:D.id,...D.data()})));for(const D of Z){const G=(N=D.students)==null?void 0:N.find(J=>String(J.nisn||J.id).trim()===x.trim());if(G){if(G.isRestricted){S("Akses siswa diblokir oleh Manajemen.");return}R={student:G,classInfo:{id:D.id,name:D.name}};break}}if(!R){S("NISN tidak ditemukan.");return}const T=String(R.student.id).trim();await Ve(T);const q=await oe(I(L,"student_auth",T)),$=q.exists()&&q.data().mustChangePassword===!0;F({...R,studentId:T}),m($?"change-password":"password")}catch(O){console.error(O),S("Terjadi kesalahan koneksi.")}finally{A(!1)}}},Y=async()=>{if(b){A(!0),S(null);try{const k=I(L,"student_auth",b.studentId),N=await oe(k);if(!N.exists()){S("Data autentikasi tidak ditemukan.");return}if(N.data().passwordHash!==g){S("Password salah.");return}l({...b,mustChangePassword:N.data().mustChangePassword===!0})}finally{A(!1)}}},P=async()=>{if(j.length<6){S("Password minimal 6 karakter.");return}if(b){A(!0),S(null);try{await X(I(L,"student_auth",b.studentId),{passwordHash:j,mustChangePassword:!1,updatedAt:V()},{merge:!0}),l({...b,mustChangePassword:!1})}catch(k){console.error(k),S("Gagal menyimpan password")}finally{A(!1)}}};return e.jsx("div",{className:"max-w-md mx-auto mt-12 px-4",children:e.jsxs("div",{className:"bg-indigo-900 p-8 rounded-[2.5rem] text-white shadow-2xl",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("img",{src:"/logo.png",alt:"Logo Sekolah",className:"h-20 w-auto drop-shadow-md"})}),e.jsx("h1",{className:"text-3xl font-black text-center mb-2",children:"Portal Siswa"}),e.jsx("p",{className:"text-center text-indigo-200 text-sm mb-8",children:"Sistem Laporan Ruang Ajar Siswa"}),o==="nisn"&&e.jsxs("form",{onSubmit:W,className:"space-y-6",children:[e.jsx("input",{value:x,onChange:k=>h(k.target.value),placeholder:"Masukkan NISN",className:"w-full px-6 py-5 rounded-2xl bg-indigo-800 text-center text-2xl font-black placeholder-indigo-300 focus:outline-none focus:ring-4 focus:ring-indigo-400"}),e.jsx("button",{disabled:v,className:"w-full bg-white text-indigo-900 py-4 rounded-2xl font-black uppercase tracking-widest hover:bg-indigo-100 transition-all disabled:opacity-50",children:v?"MEMERIKSA...":"LANJUTKAN"})]}),o==="password"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("input",{type:"password",placeholder:"Password",value:g,onChange:k=>f(k.target.value),className:"w-full px-6 py-5 rounded-2xl bg-indigo-800 placeholder-indigo-300 focus:outline-none focus:ring-4 focus:ring-indigo-400"}),e.jsx("button",{onClick:Y,disabled:v,className:"w-full bg-white text-indigo-900 py-4 rounded-2xl font-black uppercase tracking-widest hover:bg-indigo-100 transition-all disabled:opacity-50",children:v?"MEMPROSES...":"MASUK DASHBOARD"})]}),o==="change-password"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-indigo-200 text-center",children:"Login pertama — silakan ganti password"}),e.jsx("input",{type:"password",placeholder:"Password Baru (min. 6 karakter)",value:j,onChange:k=>H(k.target.value),className:"w-full px-6 py-5 rounded-2xl bg-indigo-800"}),e.jsx("button",{onClick:P,className:"w-full bg-green-500 py-4 rounded-2xl font-black",children:"SIMPAN & MASUK"})]}),_&&e.jsx("p",{className:"mt-6 text-center text-red-300 text-sm",children:_})]})})},Ve=async l=>{const o=I(L,"student_auth",l),m=await oe(o);return m.exists()?m.data():(await X(o,{passwordHash:l,mustChangePassword:!0,createdAt:V()}),{mustChangePassword:!0})},ke=l=>l&&l.length?l:[{id:"f1",title:"F1",material:"",semester:"ganjil",type:"custom"},{id:"f2",title:"F2",material:"",semester:"ganjil",type:"custom"},{id:"sas",title:"SAS",material:"",semester:"ganjil",type:"psts"},{id:"f3",title:"F3",material:"",semester:"genap",type:"custom"},{id:"f4",title:"F4",material:"",semester:"genap",type:"custom"},{id:"sat",title:"SAT",material:"",semester:"genap",type:"psaf"}],Ne=(l,o)=>{if(!l)return;if(l.assessmentScores&&o.id in l.assessmentScores)return l.assessmentScores[o.id];const x={f1:"f1",f2:"f2",sas:"sas",f3:"f3",f4:"f4",sat:"sat","ganjil-psts":"sas","ganjil-psas":"sat","genap-psts":"f3","genap-psaf":"f4"}[o.id];return x?l[x]:void 0},je=(l,o)=>{const m=ke(o).map(x=>Ne(l,x)).filter(x=>typeof x=="number"&&x>0);return m.length?Math.round(m.reduce((x,h)=>x+h,0)/m.length):0},_e=({text:l})=>{const o=l.split(` `);return e.jsx("div",{className:"space-y-6 text-slate-700",children:o.map((m,x)=>{if(m.startsWith("###"))return e.jsxs("h3",{className:"text-lg font-black text-indigo-900 border-b-2 border-indigo-50 pb-2 mt-8 flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-6 bg-indigo-600 rounded-full"}),m.replace("###","").replace(/\*\*/g,"").trim()]},x);if(m.trim().startsWith("*")){const g=m.trim().substring(1).trim().split("**");return e.jsxs("div",{className:"flex gap-3 pl-2 group",children:[e.jsx("span",{className:"text-indigo-400 mt-1.5",children:"•"}),e.jsx("p",{className:"text-sm font-medium leading-relaxed",children:g.map((f,j)=>j%2===1?e.jsx("span",{className:`font-black ${f.includes("BELUM LAYAK")||f.includes("Terancam")?"text-red-600 bg-red-50 px-1 rounded":f.includes("SANGAT BAIK")||f.includes("LAYAK")?"text-green-600 bg-green-50 px-1 rounded":"text-slate-900"}`,children:f},j):f)})]},x)}if(m.trim().length>0){const h=m.split("**");return e.jsx("p",{className:"text-sm font-medium leading-relaxed",children:h.map((g,f)=>f%2===1?e.jsx("span",{className:"font-black text-slate-900",children:g},f):g)},x)}return e.jsx("div",{className:"h-2"},x)})})},Ye=({student:l,classInfo:o,onLogout:m})=>{var he,be;const[x,h]=c.useState("Dashboard"),[g,f]=c.useState([]),[j,H]=c.useState([]),[b,F]=c.useState(""),[v,A]=c.useState(!1),[_,S]=c.useState(!0),[W,Y]=c.useState(""),[P,k]=c.useState([]),[N,O]=c.useState([]),[R,Z]=c.useState([]),[T,q]=c.useState([]),[$,D]=c.useState([]),[G,J]=c.useState([]),[z,ee]=c.useState([]),[xe,we]=c.useState([]),[ae,ye]=c.useState([]),[te,ve]=c.useState([]),[se,me]=c.useState(!1),[le,ne]=c.useState(""),[Se,Ce]=c.useState("");c.useEffect(()=>{const a=C(w(Te,y("classId","==",o.id)),r=>{f(r.docs.map(d=>({id:d.id,...d.data()})).sort((d,t)=>t.date.localeCompare(d.date)))}),s=C(w($e,y("classId","==",o.id)),r=>{H(r.docs.map(d=>({id:d.id,...d.data()})))});return()=>{a(),s()}},[o.id]),c.useEffect(()=>C(I(L,"settings","ai"),s=>{s.exists()&&S(s.data().enabled===!0)}),[]),c.useEffect(()=>{const a=C(w(De,y("classId","==",o.id)),s=>{J(s.docs.map(r=>({id:r.id,...r.data()})).sort((r,d)=>d.date.localeCompare(r.date)))});return()=>{a()}},[o.id]),c.useEffect(()=>{const a=C(w(Be,y("studentId","==",l.id)),d=>{we(d.docs.map(t=>({id:t.id,...t.data()})).sort((t,i)=>t.extracurricularName.localeCompare(i.extracurricularName)))}),s=C(w(Me,y("studentId","==",l.id)),d=>{ye(d.docs.map(t=>({id:t.id,...t.data()})).sort((t,i)=>t.category.localeCompare(i.category)||t.competitionName.localeCompare(i.competitionName)))}),r=C(w(Ke,y("studentId","==",l.id)),d=>{ve(d.docs.map(t=>({id:t.id,...t.data()})).sort((t,i)=>t.scholarshipType.localeCompare(i.scholarshipType)||t.period.localeCompare(i.period)))});return()=>{a(),s(),r()}},[l.id]);const Q=c.useCallback(async()=>{me(!0),ne("");try{const a=String(l.id).trim(),s=String(l.nisn||"").trim();let r=[];if(r=(await ce(w(fe,y("studentId","==",a)))).docs.map(i=>({id:i.id,...i.data()})),!r.length&&s&&(r=(await ce(w(fe,y("nisn","==",s)))).docs.map(n=>({id:n.id,...n.data()}))),r.sort((i,n)=>{var E,ge;const u=((E=i.updatedAt)==null?void 0:E.seconds)||0;return(((ge=n.updatedAt)==null?void 0:ge.seconds)||0)-u||n.month.localeCompare(i.month)}),!r.length){ee([]),ne(`Data keuangan untuk NISN ${l.nisn||l.id} belum ditemukan.`);return}const t=r.map(i=>({...i,note:i.note||We(i.amountDue||0)}));ee(t),Ce(new Date().toLocaleTimeString("id-ID",{hour:"2-digit",minute:"2-digit"}))}catch(a){console.error(a),ee([]),ne(a instanceof Error?a.message:"Gagal membaca data keuangan.")}finally{me(!1)}},[l.id,l.nisn]);c.useEffect(()=>{const a=()=>{document.hidden||Q()},s=window.setInterval(Q,6e4);return document.addEventListener("visibilitychange",a),()=>{window.clearInterval(s),document.removeEventListener("visibilitychange",a)}},[Q]),c.useEffect(()=>{const a=C(w(Ee,y("studentId","==",l.id)),i=>{k(i.docs.map(n=>({id:n.id,...n.data()})).sort((n,u)=>u.date.localeCompare(n.date)))}),s=C(w(Le,y("studentId","==",l.id)),i=>{O(i.docs.map(n=>({id:n.id,...n.data()})).filter(n=>n.classId===o.id).sort((n,u)=>u.date.localeCompare(n.date)))}),r=C(w(Ie,y("studentId","==",l.id)),i=>{Z(i.docs.map(n=>({id:n.id,...n.data()})).filter(n=>n.classId===o.id).sort((n,u)=>{var U,E;return(((U=u.updatedAt)==null?void 0:U.seconds)||0)-(((E=n.updatedAt)==null?void 0:E.seconds)||0)}))}),d=C(w(He,y("studentId","==",l.id)),i=>{q(i.docs.map(n=>({id:n.id,...n.data()})).filter(n=>n.classId===o.id).sort((n,u)=>{var U,E;return(((U=u.createdAt)==null?void 0:U.seconds)||0)-(((E=n.createdAt)==null?void 0:E.seconds)||0)}))}),t=C(w(Ge,y("studentId","==",l.id)),i=>{D(i.docs.map(n=>({id:n.id,...n.data()})).filter(n=>n.classId===o.id).sort((n,u)=>u.date.localeCompare(n.date)))});return()=>{a(),s(),r(),d(),t()}},[l.id,o.id]);const B=c.useMemo(()=>{const a=g.filter(i=>i.attendance[l.id]),s=a.filter(i=>i.attendance[l.id]==="Hadir").length,r=a.length>0?Math.round(s/a.length*100):0,d=j.map(i=>({entry:i.scores[l.id],config:i.assessmentConfig})).filter(i=>!!i.entry),t=d.length>0?Math.round(d.reduce((i,n)=>i+je(n.entry,n.config),0)/d.length):0;return{attendancePercentage:r,avgGrade:t,totalSesi:a.length}},[g,j,l.id]),p=c.useMemo(()=>{const a=G.filter(t=>{var i,n;return!!((i=t.attendance)!=null&&i[l.id]||(n=t.waliOverrides)!=null&&n[l.id])}),s={Hadir:0,Sakit:0,Izin:0,Alfa:0,Terlambat:0,Dispensasi:0};a.forEach(t=>{var n,u;const i=((n=t.waliOverrides)==null?void 0:n[l.id])||((u=t.attendance)==null?void 0:u[l.id])||"Hadir";s[i]+=1});const r=a.length,d=r?Math.round(s.Hadir/r*100):0;return{total:r,percentage:d,counts:s,latest:a.slice(0,10)}},[G,l.id]);c.useMemo(()=>P.slice(0,5),[P]);const M=c.useMemo(()=>({total:z.reduce((a,s)=>a+(s.amountDue||0),0),latest:z[0]||null}),[z]),re=c.useMemo(()=>xe.map(a=>({...a,semester1Display:a.semester1Score||a.score||"-",semester2Display:a.semester2Score||"-"})),[xe]),pe=c.useMemo(()=>{const a=new Map;return g.forEach(s=>{var t;const r=(t=s.attendance)==null?void 0:t[l.id];if(!r)return;const d=a.get(s.subject)||{total:0,hadir:0,terlambat:0,alfa:0};d.total+=1,r==="Hadir"&&(d.hadir+=1),r==="Terlambat"&&(d.terlambat+=1),r==="Alfa"&&(d.alfa+=1),a.set(s.subject,d)}),Array.from(a.entries()).map(([s,r])=>({subject:s,...r,percentage:r.total?Math.round(r.hadir/r.total*100):0})).sort((s,r)=>r.total-s.total||s.subject.localeCompare(r.subject))},[g,l.id]),K=c.useMemo(()=>{const a=[];return N.forEach(s=>{const r=R.find(d=>{var t;return(t=d.linkedRecordIds)==null?void 0:t.includes(s.id)});a.push({id:`record-${s.id}`,date:s.date,sourceRole:s.sourceRole,sourceName:s.sourceUserName,title:`${s.categoryName} • ${s.subcategoryName}`,note:s.description,processStatus:(r==null?void 0:r.currentStage)||s.status||"Tersimpan",badge:s.recordType==="positive"?"Catatan Positif":"Catatan Negatif"})}),P.forEach(s=>{a.push({id:`wali-${s.id}`,date:s.date,sourceRole:"wali",sourceName:s.waliTeacherName,title:"Catatan Wali Kelas",note:s.note,processStatus:"Dipantau wali kelas",badge:"Catatan Wali"})}),$.forEach(s=>{const r=R.find(d=>d.id===s.linkedCaseId);a.push({id:`minute-${s.id}`,date:s.date,sourceRole:s.counselorRole,sourceName:s.counselorTeacherName,title:`Berita Acara ${s.counselorRoleLabel}`,note:[s.basis,s.chronology,s.coachingResult,s.followUp].filter(Boolean).join(" • "),processStatus:(r==null?void 0:r.currentStage)||`${s.documentStatus} • Buku Besar BK`,badge:"Berita Acara"})}),T.filter(s=>["bk","kesiswaan"].includes(s.actorRole)).forEach(s=>{var r;a.push({id:`event-${s.id}`,date:(r=s.createdAt)!=null&&r.toDate?s.createdAt.toDate().toISOString().slice(0,10):"",sourceRole:s.actorRole,sourceName:s.actorName,title:s.actionType,note:s.note,processStatus:s.toStage||s.actionType,badge:s.actorRole==="bk"?"Tindak Lanjut BK":"Tindak Lanjut Kesiswaan"})}),a.sort((s,r)=>r.date.localeCompare(s.date))},[N,R,P,$,T]),ue=c.useMemo(()=>K.slice(0,4),[K]),ie=c.useMemo(()=>{const a=N.filter(t=>t.sourceRole==="guru"),s=[...P.map(t=>({id:`wali-note-${t.id}`,date:t.date,title:"Catatan Wali Kelas",author:t.waliTeacherName,summary:t.note,status:"Dipantau wali kelas"})),...$.filter(t=>t.counselorRole==="wali").map(t=>({id:`wali-minute-${t.id}`,date:t.date,title:`Berita Acara ${t.counselorRoleLabel}`,author:t.counselorTeacherName,summary:[t.basis,t.chronology,t.coachingResult,t.followUp].filter(Boolean).join(" • "),status:`${t.documentStatus} • Pembinaan Wali`}))].sort((t,i)=>i.date.localeCompare(t.date)),r=[...$.filter(t=>t.counselorRole==="bk").map(t=>({id:`bk-minute-${t.id}`,date:t.date,title:`Berita Acara ${t.counselorRoleLabel}`,author:t.counselorTeacherName,summary:[t.basis,t.chronology,t.coachingResult,t.followUp].filter(Boolean).join(" • "),status:`${t.documentStatus} • Buku Besar BK`})),...T.filter(t=>t.actorRole==="bk").map(t=>{var i;return{id:`bk-event-${t.id}`,date:(i=t.createdAt)!=null&&i.toDate?t.createdAt.toDate().toISOString().slice(0,10):"",title:t.actionType,author:t.actorName,summary:t.note,status:t.toStage||t.actionType}})].sort((t,i)=>i.date.localeCompare(t.date)),d=[...$.filter(t=>t.counselorRole==="kesiswaan").map(t=>({id:`kesiswaan-minute-${t.id}`,date:t.date,title:`Berita Acara ${t.counselorRoleLabel}`,author:t.counselorTeacherName,summary:[t.basis,t.chronology,t.coachingResult,t.followUp].filter(Boolean).join(" • "),status:`${t.documentStatus} • Tindak Lanjut`})),...T.filter(t=>t.actorRole==="kesiswaan").map(t=>{var i;return{id:`kesiswaan-event-${t.id}`,date:(i=t.createdAt)!=null&&i.toDate?t.createdAt.toDate().toISOString().slice(0,10):"",title:t.actionType,author:t.actorName,summary:t.note,status:t.toStage||t.actionType}})].sort((t,i)=>i.date.localeCompare(t.date));return[{key:"guru",label:"Guru Mapel",subtitle:"Catatan pembelajaran dan kedisiplinan dari guru mata pelajaran.",count:a.length,accentClass:"bg-blue-50 border-blue-100 text-blue-700",items:a.slice(0,3).map(t=>({id:`guru-${t.id}`,date:t.date,title:`${t.categoryName} • ${t.subcategoryName}`,author:t.sourceUserName,summary:t.description,status:t.status||"Tersimpan"}))},{key:"wali",label:"Wali Kelas",subtitle:"Catatan wali kelas beserta berita acara pembinaan dari wali.",count:s.length,accentClass:"bg-violet-50 border-violet-100 text-violet-700",items:s.slice(0,3)},{key:"bk",label:"BK",subtitle:"Pendampingan, konseling, dan tindak lanjut dari tim BK.",count:r.length,accentClass:"bg-emerald-50 border-emerald-100 text-emerald-700",items:r.slice(0,3)},{key:"kesiswaan",label:"Kesiswaan",subtitle:"Tindak lanjut pembinaan dan proses dari bagian kesiswaan.",count:d.length,accentClass:"bg-amber-50 border-amber-100 text-amber-700",items:d.slice(0,3)}]},[N,P,$,T]),Ae=async()=>{A(!0);try{const a=N.filter(n=>n.recordType==="positive"),s=N.filter(n=>n.recordType==="negative"),r=pe.slice(0,3).map(n=>`${n.subject} ${n.percentage}% hadir`).join(", ")||"belum ada data kehadiran mapel.",d=pe.filter(n=>n.percentage<80||n.alfa>0).slice(0,3).map(n=>`${n.subject} (${n.percentage}% hadir, alfa ${n.alfa})`).join(", "),t=R[0],i=["### Rangkuman Profil Siswa",`${l.name} dari kelas ${o.name} memiliki kehadiran sekolah sebesar **${p.percentage}%** dari **${p.total}** hari yang tercatat. Pada kehadiran mata pelajaran, tingkat hadir berada di **${B.attendancePercentage}%** dari **${B.totalSesi}** sesi pembelajaran.`,"### Kehadiran Sekolah",`* Hadir: **${p.counts.Hadir} hari**`,`* Terlambat: **${p.counts.Terlambat} kali**`,`* Alfa: **${p.counts.Alfa} kali**`,`* Sakit/Izin: **${p.counts.Sakit+p.counts.Izin} kali**`,"### Kehadiran Mata Pelajaran",`Mapel yang paling sering tercatat: **${r}**`,d?`Perlu perhatian tambahan pada: **${d}**.`:"Tidak ada mata pelajaran yang menonjol bermasalah dari sisi kehadiran.","### Catatan Guru dan Pembinaan",`* Catatan positif: **${a.length}**`,`* Catatan negatif: **${s.length+P.length}**`,`* Berita acara pembinaan/konseling: **${$.length}**`,t?`* Status proses terakhir: **${t.currentStage}**`:"* Status proses terakhir: **Belum ada kasus aktif**","### Kesimpulan Singkat",`${l.name} ${p.percentage>=90?"menunjukkan kedisiplinan kehadiran sekolah yang baik":"masih memerlukan penguatan disiplin kehadiran"} dan ${a.length>=s.length?"memiliki kecenderungan catatan perkembangan yang cukup positif":"memerlukan pendampingan lebih konsisten pada perilaku dan kedisiplinan"}. ${p.counts.Alfa>0||p.counts.Terlambat>3?"Fokus utama yang direkomendasikan adalah perbaikan kehadiran, ketepatan waktu, dan pemantauan berkala oleh wali/BK.":"Rekomendasinya adalah mempertahankan pola hadir, memperkuat komunikasi dengan guru, dan menjaga konsistensi belajar."}`].join(` `);F(i),h("Analisis")}finally{A(!1)}},Pe=()=>{const a=new Ue;a.setFontSize(18),a.text("Rangkuman Siswa SELARAS",20,20),a.setFontSize(12),a.text(`Nama: ${l.name}`,20,30),a.text(`Kelas: ${o.name}`,20,37),a.text(`Tanggal Cetak: ${new Date().toLocaleDateString("id-ID")}`,20,44),a.line(20,48,190,48);const s=a.splitTextToSize(b.replace(/[*#]/g,""),170);a.text(s,20,60),a.save(`Analisis_Akademik_${l.name}.pdf`)};return e.jsxs("div",{className:"max-w-6xl mx-auto space-y-8 animate-fade-in pb-20 px-4",children:[e.jsxs("div",{className:"bg-slate-900 text-white p-8 md:p-12 rounded-[3rem] shadow-2xl relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-indigo-500/20 blur-[100px] rounded-full"}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-8 relative z-10",children:[e.jsx("div",{className:"w-24 h-24 rounded-[2.5rem] bg-indigo-600 flex items-center justify-center shadow-2xl ring-4 ring-indigo-500/30",children:e.jsx("span",{className:"text-4xl font-black",children:l.name.charAt(0)})}),e.jsxs("div",{className:"text-center md:text-left flex-1",children:[e.jsx("h1",{className:"text-3xl font-black tracking-tight",children:l.name}),e.jsxs("p",{className:"text-indigo-300 font-bold uppercase text-xs tracking-[0.2em] mt-1",children:["NISN: ",l.nisn||l.id," • KELAS ",o.name]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-6 justify-center md:justify-start",children:["Dashboard","Catatan Siswa","Lapor Sarpras","Presensi","Nilai","Analisis","Ganti Password"].map(a=>e.jsx("button",{onClick:()=>h(a),className:`px-6 py-2.5 rounded-2xl text-[10px] font-black uppercase tracking-widest transition-all ${x===a?"bg-white text-slate-900 shadow-lg":"bg-white/10 hover:bg-white/20 text-indigo-100"}`,children:a},a))})]}),e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsxs("div",{className:"bg-white/5 backdrop-blur-xl p-6 rounded-[2.5rem] border border-white/10 text-center min-w-[150px]",children:[e.jsx("p",{className:"text-[9px] font-black text-indigo-400 uppercase tracking-widest mb-1",children:"Rata-rata Nilai"}),e.jsx("p",{className:"text-4xl font-black",children:B.avgGrade})]}),e.jsx("button",{onClick:()=>{confirm("Yakin ingin keluar?")&&m()},className:"w-full bg-red-600/20 hover:bg-red-600 text-red-400 hover:text-white border border-red-500/30 px-6 py-3 rounded-2xl text-[10px] font-black uppercase tracking-widest shadow-xl transition-all",children:"Logout"})]})]})]}),x==="Dashboard"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6 animate-fade-in",children:[e.jsxs("div",{className:"md:col-span-3 bg-white p-8 rounded-[2.5rem] shadow-xl border border-slate-50 flex flex-col items-center justify-center text-center space-y-4",children:[e.jsx("div",{className:`w-28 h-28 rounded-full border-[8px] flex items-center justify-center ${B.attendancePercentage>=80?"border-green-100":"border-red-100"}`,children:e.jsxs("span",{className:`text-3xl font-black ${B.attendancePercentage>=80?"text-green-600":"text-red-600"}`,children:[B.attendancePercentage,"%"]})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-black text-slate-800 uppercase tracking-widest",children:"Presensi Mapel"}),e.jsxs("p",{className:"text-xs text-slate-400 font-bold mt-1",children:["Status: ",B.attendancePercentage>=80?"SANGAT BAIK":"BUTUH PERHATIAN"]})]})]}),e.jsxs("div",{className:"md:col-span-3 bg-white p-8 rounded-[2.5rem] shadow-xl border border-slate-50 flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Presensi Kehadiran Sekolah"}),e.jsxs("p",{className:"mt-3 text-4xl font-black text-slate-800",children:[p.percentage,"%"]}),e.jsxs("p",{className:"mt-2 text-xs font-bold text-slate-400",children:[p.total," hari tercatat"]})]}),e.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-3 text-xs font-bold",children:[e.jsxs("div",{className:"rounded-2xl bg-red-50 px-4 py-3 text-red-600",children:["Alfa ",p.counts.Alfa]}),e.jsxs("div",{className:"rounded-2xl bg-blue-50 px-4 py-3 text-blue-600",children:["Terlambat ",p.counts.Terlambat]}),e.jsxs("div",{className:"rounded-2xl bg-amber-50 px-4 py-3 text-amber-600",children:["Sakit ",p.counts.Sakit]}),e.jsxs("div",{className:"rounded-2xl bg-orange-50 px-4 py-3 text-orange-600",children:["Izin ",p.counts.Izin]})]})]}),e.jsxs("div",{className:"md:col-span-6 bg-indigo-600 p-8 rounded-[3.5rem] shadow-2xl text-white relative overflow-hidden group",children:[e.jsx("div",{className:"absolute -bottom-10 -right-10 w-48 h-48 bg-white/10 blur-3xl rounded-full"}),e.jsxs("div",{className:"relative z-10 flex flex-col h-full justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-black",children:"Asisten AI SELARAS"}),e.jsx("p",{className:"text-indigo-100 text-sm font-medium leading-relaxed max-w-md",children:"Klik tombol rangkuman saya untuk membuat ringkasan naratif otomatis berdasarkan data kehadiran sekolah, kehadiran mapel, dan catatan pembinaan yang sudah tersimpan di sistem."})]}),e.jsx("button",{onClick:Ae,disabled:v,className:`mt-8 px-10 py-5 rounded-3xl font-black text-xs uppercase tracking-[0.2em] shadow-2xl transition-all ${_?"bg-white text-indigo-600 hover:bg-indigo-50 active:scale-95":"bg-slate-200 text-slate-400 cursor-not-allowed"} `,children:v?"MENYUSUN RANGKUMAN...":"RANGKUMAN SAYA"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 animate-fade-in",children:[e.jsxs("div",{className:"lg:col-span-6 bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Rekap Kehadiran Sekolah"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Presensi umum harian"})]}),e.jsxs("div",{className:"px-4 py-3 rounded-2xl bg-slate-50 text-xs font-black text-slate-500",children:[p.total," hari"]})]}),e.jsx("div",{className:"mt-6 space-y-3",children:p.latest.length?p.latest.map(a=>{var r,d;const s=((r=a.waliOverrides)==null?void 0:r[l.id])||((d=a.attendance)==null?void 0:d[l.id])||"Hadir";return e.jsxs("div",{className:"rounded-[1.75rem] border border-slate-100 bg-slate-50 px-5 py-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-black text-slate-800",children:a.date}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:["Kehadiran sekolah • ",a.className]})]}),e.jsx("span",{className:`px-4 py-2 rounded-full text-[10px] font-black uppercase tracking-widest ${s==="Hadir"?"bg-green-100 text-green-700":s==="Alfa"?"bg-red-100 text-red-700":s==="Terlambat"?"bg-blue-100 text-blue-700":"bg-amber-100 text-amber-700"}`,children:s})]},a.id)}):e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada presensi sekolah yang tercatat."})})]}),e.jsxs("div",{className:"lg:col-span-6 bg-slate-900 rounded-[2.75rem] shadow-2xl p-8 text-white relative overflow-hidden",children:[e.jsx("div",{className:"absolute -top-20 right-0 w-56 h-56 bg-indigo-500/20 blur-3xl rounded-full"}),e.jsx("div",{className:"absolute -bottom-16 -left-10 w-48 h-48 bg-white/10 blur-3xl rounded-full"}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[e.jsxs("div",{className:"max-w-lg",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.24em] text-indigo-200/80",children:"Pusat Catatan Siswa"}),e.jsx("h3",{className:"mt-2 text-2xl font-black",children:"Catatan terintegrasi dalam satu panel"}),e.jsxs("p",{className:"mt-3 text-sm font-medium leading-relaxed text-slate-200",children:["Semua catatan dari guru mapel, wali kelas, BK, dan kesiswaan kini dipusatkan ke menu ",e.jsx("span",{className:"font-black text-white",children:"Catatan Siswa"})," agar lebih rapi, konsisten, dan mudah dipantau."]})]}),e.jsx("button",{onClick:()=>h("Catatan Siswa"),className:"px-5 py-3 rounded-2xl bg-white text-slate-900 text-xs font-black uppercase tracking-widest shadow-lg hover:bg-slate-100 transition-colors",children:"Buka Catatan Siswa"})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"rounded-[1.9rem] border border-white/10 bg-white/10 px-5 py-5 backdrop-blur-sm",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-indigo-100/80",children:"Total Catatan"}),e.jsx("p",{className:"mt-2 text-3xl font-black",children:K.length}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-200",children:"Mencakup catatan pembelajaran, wali kelas, berita acara, dan tindak lanjut proses."})]}),e.jsxs("div",{className:"rounded-[1.9rem] border border-white/10 bg-white/10 px-5 py-5 backdrop-blur-sm",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-indigo-100/80",children:"Status Terbaru"}),e.jsx("p",{className:"mt-2 text-lg font-black text-white",children:((he=K[0])==null?void 0:he.processStatus)||"Belum ada proses"}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-200",children:"Klik panel untuk melihat detail sumber catatan secara lengkap."})]})]}),e.jsx("div",{className:"mt-6 grid grid-cols-2 gap-3",children:ie.map(a=>e.jsxs("div",{className:"rounded-[1.5rem] border border-white/10 bg-white/5 px-4 py-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-300",children:a.label}),e.jsx("p",{className:"mt-2 text-2xl font-black text-white",children:a.count})]},a.key))}),e.jsx("div",{className:"mt-6 space-y-3",children:ue.length?ue.map(a=>e.jsxs("div",{className:"rounded-[1.5rem] border border-white/10 bg-white/10 px-4 py-4 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"px-3 py-1 rounded-full bg-white text-slate-900 text-[10px] font-black uppercase tracking-widest",children:a.badge}),e.jsx("span",{className:"px-3 py-1 rounded-full bg-slate-950/70 border border-white/10 text-slate-100 text-[10px] font-black uppercase tracking-widest",children:a.processStatus})]}),e.jsx("p",{className:"mt-3 text-sm font-black text-white",children:a.title}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold uppercase tracking-widest text-slate-300",children:[a.date||"-"," • ",a.sourceName]})]},a.id)):e.jsx("p",{className:"text-sm italic font-bold text-slate-300",children:"Belum ada catatan yang tersimpan untuk siswa ini."})})]})]}),e.jsxs("div",{className:"lg:col-span-12 bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Biaya Pendidikan"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Cek biaya pendidikan"}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-500",children:"Gunakan NISN siswa yang sedang login untuk mengambil data terbaru dari spreadsheet keuangan sekolah."})]}),e.jsx("button",{onClick:Q,disabled:se,className:"px-5 py-3 rounded-2xl bg-indigo-600 text-white text-xs font-black uppercase tracking-widest disabled:opacity-50",children:se?"Memuat...":"Cek Biaya Pendidikan"})]}),e.jsxs("div",{className:"mt-5 grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"rounded-2xl bg-slate-50 border border-slate-100 px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"NISN"}),e.jsx("p",{className:"mt-1 text-sm font-black text-slate-800",children:l.nisn||l.id})]}),e.jsxs("div",{className:"rounded-2xl bg-slate-50 border border-slate-100 px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Terakhir Dicek"}),e.jsx("p",{className:"mt-1 text-sm font-black text-slate-800",children:Se||"-"})]}),e.jsxs("div",{className:"rounded-2xl bg-slate-900 text-white px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-300",children:"Total Tercatat"}),e.jsx("p",{className:"mt-1 text-sm font-black",children:de(M.total)})]})]}),e.jsxs("div",{className:"mt-6 space-y-4",children:[le?e.jsx("div",{className:"rounded-[1.75rem] border border-amber-200 bg-amber-50 px-5 py-4",children:e.jsx("p",{className:"text-sm font-bold text-amber-700",children:le})}):null,M.latest?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-[1.9rem] border border-slate-100 bg-slate-50 px-5 py-5",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-indigo-500",children:M.latest.month}),e.jsx("p",{className:"mt-2 text-sm font-black text-slate-800",children:M.latest.studentName}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:["Kelas ",M.latest.className]}),e.jsxs("div",{className:"mt-5 grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-2xl bg-white border border-slate-200 px-4 py-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Biaya Pendidikan"}),e.jsx("p",{className:`mt-1 text-2xl font-black ${M.latest.status==="LUNAS"?"text-emerald-600":"text-indigo-600"}`,children:de(M.latest.amountDue||0)})]}),e.jsxs("div",{className:"rounded-2xl bg-white border border-slate-200 px-4 py-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Catatan"}),e.jsx("p",{className:"mt-1 text-sm font-medium text-slate-700 leading-relaxed",children:M.latest.note||"-"})]})]})]}),z.length>1&&e.jsxs("div",{className:"rounded-[1.9rem] border border-slate-100 bg-white px-5 py-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Riwayat Tagihan"}),e.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-300",children:[z.length," data"]})]}),e.jsx("div",{className:"mt-4 space-y-3",children:z.slice(1).map(a=>e.jsxs("div",{className:"rounded-2xl bg-slate-50 border border-slate-100 px-4 py-4 flex flex-col md:flex-row md:items-center md:justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-indigo-500",children:a.month}),e.jsx("p",{className:"mt-1 text-sm font-black text-slate-800",children:a.studentName}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:["Kelas ",a.className]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:`text-lg font-black ${a.status==="LUNAS"?"text-emerald-600":"text-indigo-600"}`,children:de(a.amountDue||0)}),e.jsx("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:a.note})]})]},a.id))})]})]}):!le&&!se?e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Klik tombol cek biaya pendidikan untuk memuat data terbaru."}):null]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Ekstrakurikuler"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Kegiatan yang diikuti"})]}),e.jsxs("div",{className:"rounded-2xl bg-emerald-50 px-4 py-2 text-xs font-black text-emerald-700",children:[re.length," data"]})]}),e.jsx("div",{className:"mt-5 space-y-3",children:re.length?re.map(a=>e.jsxs("div",{className:"rounded-[1.5rem] border border-slate-100 bg-slate-50 px-4 py-4",children:[e.jsx("p",{className:"text-sm font-black text-slate-800",children:a.extracurricularName}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 text-xs font-bold",children:[e.jsxs("div",{className:"rounded-2xl bg-white border border-slate-100 px-3 py-3",children:["Semester 1: ",e.jsx("span",{className:"text-emerald-600",children:a.semester1Display})]}),e.jsxs("div",{className:"rounded-2xl bg-white border border-slate-100 px-3 py-3",children:["Semester 2: ",e.jsx("span",{className:"text-blue-600",children:a.semester2Display})]})]}),e.jsx("p",{className:"mt-3 text-sm font-medium text-slate-600",children:a.notes||"Belum ada catatan tambahan."})]},a.id)):e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada data ekstrakurikuler untuk siswa ini."})})]}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Prestasi"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Riwayat capaian siswa"})]}),e.jsxs("div",{className:"rounded-2xl bg-violet-50 px-4 py-2 text-xs font-black text-violet-700",children:[ae.length," data"]})]}),e.jsx("div",{className:"mt-5 space-y-3",children:ae.length?ae.map(a=>e.jsxs("div",{className:"rounded-[1.5rem] border border-slate-100 bg-slate-50 px-4 py-4",children:[e.jsx("p",{className:"text-sm font-black text-slate-800",children:a.competitionName}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold uppercase tracking-widest text-violet-500",children:[a.category," • ",a.competitionLevel]}),e.jsxs("p",{className:"mt-3 text-sm font-bold text-amber-600",children:["Peringkat: ",a.rank]}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-600",children:a.organizer}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-500",children:a.notes||"Tidak ada catatan tambahan."})]},a.id)):e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada data prestasi untuk siswa ini."})})]}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Beasiswa"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Program bantuan pendidikan"})]}),e.jsxs("div",{className:"rounded-2xl bg-blue-50 px-4 py-2 text-xs font-black text-blue-700",children:[te.length," data"]})]}),e.jsx("div",{className:"mt-5 space-y-3",children:te.length?te.map(a=>e.jsxs("div",{className:"rounded-[1.5rem] border border-slate-100 bg-slate-50 px-4 py-4",children:[e.jsx("p",{className:"text-sm font-black text-slate-800",children:a.scholarshipType}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold uppercase tracking-widest text-blue-500",children:["Periode ",a.period]}),e.jsx("p",{className:"mt-3 text-sm font-medium text-slate-600",children:a.notes||"Tidak ada catatan tambahan."})]},a.id)):e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada data beasiswa untuk siswa ini."})})]})]})]}),x==="Catatan Siswa"&&e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Catatan Siswa"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Pusat laporan dan perkembangan proses"}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-500",children:"Semua catatan dari guru mapel, wali kelas, BK, dan kesiswaan ditampilkan dalam satu tampilan yang lebih rapi agar mudah dibaca siswa."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-2xl bg-slate-50 px-4 py-3 text-center",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Total Catatan"}),e.jsx("p",{className:"mt-1 text-2xl font-black text-slate-900",children:K.length})]}),e.jsxs("div",{className:"rounded-2xl bg-indigo-50 px-4 py-3 text-center",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-indigo-500",children:"Status Terbaru"}),e.jsx("p",{className:"mt-1 text-sm font-black text-slate-900",children:((be=K[0])==null?void 0:be.processStatus)||"-"})]})]})]}),e.jsx("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-3",children:ie.map(a=>e.jsxs("div",{className:`rounded-2xl border px-4 py-4 ${a.accentClass}`,children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:a.label}),e.jsx("p",{className:"mt-2 text-2xl font-black text-slate-900",children:a.count}),e.jsx("p",{className:"mt-2 text-xs font-bold leading-relaxed text-slate-600",children:a.subtitle})]},a.key))})]}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Catatan per Sumber"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Guru mapel, wali kelas, BK, dan kesiswaan"}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-500",children:"Preview berikut menempatkan catatan wali kelas ke dalam panel catatan siswa bersama sumber lainnya."})]}),e.jsx("button",{onClick:()=>h("Dashboard"),className:"px-5 py-3 rounded-2xl bg-slate-100 text-slate-700 text-xs font-black uppercase tracking-widest",children:"Kembali ke Dashboard"})]}),e.jsx("div",{className:"mt-6 grid grid-cols-1 xl:grid-cols-2 gap-4",children:ie.map(a=>e.jsxs("div",{className:"rounded-[2rem] border border-slate-100 bg-slate-50 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:a.label}),e.jsxs("h4",{className:"mt-2 text-lg font-black text-slate-800",children:[a.count," catatan tercatat"]}),e.jsx("p",{className:"mt-2 text-sm font-medium leading-relaxed text-slate-500",children:a.subtitle})]}),e.jsxs("div",{className:`shrink-0 rounded-2xl border px-4 py-3 text-center ${a.accentClass}`,children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Total"}),e.jsx("p",{className:"mt-1 text-xl font-black text-slate-900",children:a.count})]})]}),e.jsx("div",{className:"mt-5 space-y-3",children:a.items.length?a.items.map(s=>e.jsxs("div",{className:"rounded-[1.5rem] border border-slate-200 bg-white px-4 py-4",children:[e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsx("span",{className:"px-3 py-1 rounded-full bg-slate-900 text-white text-[10px] font-black uppercase tracking-widest",children:s.status})}),e.jsx("p",{className:"mt-3 text-sm font-black text-slate-800",children:s.title}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold uppercase tracking-widest text-slate-400",children:[s.date||"-"," • ",s.author]}),e.jsx("p",{className:"mt-3 text-sm font-medium leading-relaxed text-slate-700 whitespace-pre-wrap line-clamp-3",children:s.summary||"-"})]},s.id)):e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada catatan untuk sumber ini."})})]},`panel-${a.key}`))})]}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Timeline Catatan"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Riwayat catatan siswa"})]}),e.jsx("button",{onClick:()=>h("Dashboard"),className:"px-5 py-3 rounded-2xl bg-slate-100 text-slate-700 text-xs font-black uppercase tracking-widest",children:"Kembali ke Dashboard"})]}),e.jsx("div",{className:"mt-6 space-y-4",children:K.length?K.map(a=>e.jsx("div",{className:"rounded-[2rem] border border-slate-100 bg-slate-50 p-5",children:e.jsx("div",{className:"flex flex-col xl:flex-row xl:items-start xl:justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.jsx("span",{className:"px-3 py-1 rounded-full bg-indigo-100 text-indigo-700 text-[10px] font-black uppercase tracking-widest",children:a.badge}),e.jsx("span",{className:"px-3 py-1 rounded-full bg-slate-900 text-white text-[10px] font-black uppercase tracking-widest",children:a.processStatus})]}),e.jsx("p",{className:"mt-3 text-base font-black text-slate-800",children:a.title}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold uppercase tracking-widest text-slate-400",children:[a.date||"-"," • ",a.sourceRole.toUpperCase()," • ",a.sourceName]}),e.jsx("p",{className:"mt-3 text-sm font-medium text-slate-700 leading-relaxed whitespace-pre-wrap",children:a.note||"-"})]})})},a.id)):e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada catatan yang tersimpan untuk siswa ini."})})]})]}),x==="Lapor Sarpras"&&e.jsx(Fe,{actor:{id:l.id,name:l.name,mode:"student",classInfo:o}}),x==="Presensi"&&e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 overflow-hidden",children:[e.jsxs("div",{className:"p-8 border-b border-slate-50 flex justify-between items-center",children:[e.jsx("h3",{className:"text-sm font-black text-slate-800 uppercase tracking-widest",children:"Kehadiran Sekolah"}),e.jsxs("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 rounded-full text-[9px] font-black",children:[p.total," Hari Tercatat"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{className:"bg-slate-50/50 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-8 py-5",children:"Tanggal"}),e.jsx("th",{className:"px-8 py-5",children:"Jenis"}),e.jsx("th",{className:"px-8 py-5 text-right",children:"Status"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:p.latest.map(a=>{var r,d;const s=((r=a.waliOverrides)==null?void 0:r[l.id])||((d=a.attendance)==null?void 0:d[l.id])||"Hadir";return e.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[e.jsx("td",{className:"px-8 py-5 text-xs font-bold text-slate-600",children:a.date}),e.jsx("td",{className:"px-8 py-5 font-black text-sm text-slate-800",children:"Kehadiran Sekolah"}),e.jsx("td",{className:"px-8 py-5 text-right",children:e.jsx("span",{className:`px-4 py-1.5 rounded-xl text-[9px] font-black uppercase tracking-widest ${s==="Hadir"?"bg-green-100 text-green-700":s==="Alfa"?"bg-red-100 text-red-700":s==="Terlambat"?"bg-blue-100 text-blue-700":"bg-orange-100 text-orange-700"}`,children:s})})]},a.id)})})]})})]}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 overflow-hidden",children:[e.jsxs("div",{className:"p-8 border-b border-slate-50 flex justify-between items-center",children:[e.jsx("h3",{className:"text-sm font-black text-slate-800 uppercase tracking-widest",children:"Presensi Mata Pelajaran"}),e.jsxs("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 rounded-full text-[9px] font-black",children:[B.totalSesi," Sesi Tercatat"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{className:"bg-slate-50/50 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-8 py-5",children:"Tanggal"}),e.jsx("th",{className:"px-8 py-5",children:"Mata Pelajaran"}),e.jsx("th",{className:"px-8 py-5",children:"Guru"}),e.jsx("th",{className:"px-8 py-5 text-right",children:"Status"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:g.map(a=>e.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[e.jsx("td",{className:"px-8 py-5 text-xs font-bold text-slate-600",children:a.date}),e.jsx("td",{className:"px-8 py-5 font-black text-sm text-slate-800",children:a.subject}),e.jsx("td",{className:"px-8 py-5 text-xs font-medium text-slate-400",children:a.teacherName}),e.jsx("td",{className:"px-8 py-5 text-right",children:e.jsx("span",{className:`px-4 py-1.5 rounded-xl text-[9px] font-black uppercase tracking-widest ${a.attendance[l.id]==="Hadir"?"bg-green-100 text-green-700":a.attendance[l.id]==="Alfa"?"bg-red-100 text-red-700":"bg-orange-100 text-orange-700"}`,children:a.attendance[l.id]})})]},a.id))})]})})]})]}),x==="Nilai"&&e.jsx("div",{className:"space-y-6 animate-fade-in",children:j.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:j.map(a=>{const s=a.scores[l.id]||{},r=ke(a.assessmentConfig),d=je(s,a.assessmentConfig);return e.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl border border-slate-50 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-slate-50 rounded-full translate-x-10 -translate-y-10"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start mb-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-slate-800 leading-tight",children:a.subject}),e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Rekap Nilai Akademik"})]}),e.jsxs("div",{className:`w-14 h-14 rounded-2xl flex flex-col items-center justify-center font-black shadow-lg ${d>=75?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[e.jsx("span",{className:"text-[8px] uppercase tracking-tighter opacity-70",children:"AVG"}),e.jsx("span",{className:"text-xl",children:d})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:r.map((t,i)=>{const n=Ne(s,t),u=t.type==="psts"?"blue":t.type==="psas"||t.type==="psaf"?"green":"default";return e.jsxs("div",{className:`p-4 rounded-2xl text-center border transition-all ${u==="blue"?"bg-blue-50 border-blue-100":u==="green"?"bg-green-50 border-green-100":"bg-slate-50 border-slate-100"}`,children:[e.jsx("p",{className:`text-[9px] font-black uppercase tracking-widest mb-1 ${u==="blue"?"text-blue-400":u==="green"?"text-green-400":"text-slate-400"}`,children:t.title}),e.jsx("p",{className:"text-[10px] font-bold text-slate-500 min-h-[28px]",children:t.material||"Materi belum diisi"}),e.jsx("p",{className:`mt-2 text-lg font-black ${u==="blue"?"text-blue-700":u==="green"?"text-green-700":"text-slate-800"}`,children:typeof n=="number"&&n>0?n:"-"})]},i)})})]},a.id)})}):e.jsx("div",{className:"bg-white p-20 rounded-[4rem] shadow-xl border border-slate-50 text-center",children:e.jsx("p",{className:"font-black text-slate-400 italic",children:"Data nilai belum diunggah oleh guru mata pelajaran."})})}),x==="Ganti Password"&&e.jsxs("div",{className:"bg-white p-12 rounded-[3.5rem] shadow-2xl border border-slate-50 max-w-md mx-auto animate-fade-in text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-[2rem] flex items-center justify-center mx-auto mb-8 shadow-inner",children:e.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),e.jsx("h3",{className:"text-2xl font-black mb-2 text-slate-800",children:"Keamanan Akun"}),e.jsx("p",{className:"text-sm text-slate-400 font-medium mb-8 leading-relaxed",children:"Ganti katasandi Anda secara berkala untuk menjaga keamanan data akademik Anda."}),e.jsx("input",{type:"password",placeholder:"Password Baru (min. 6 karakter)",value:W,onChange:a=>Y(a.target.value),className:"w-full px-8 py-5 rounded-[1.8rem] bg-slate-50 border border-slate-100 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all font-bold mb-6 text-center text-xl tracking-widest placeholder:text-slate-300 placeholder:text-sm placeholder:tracking-normal"}),e.jsx("button",{onClick:async()=>{if(W.length<6){alert("Password minimal 6 karakter");return}await X(I(L,"student_auth",l.nisn||l.id),{passwordHash:W,mustChangePassword:!1,updatedAt:V()},{merge:!0}),alert("Password berhasil diubah"),Y(""),h("Dashboard")},className:"w-full bg-slate-900 text-white py-5 rounded-[1.8rem] font-black uppercase tracking-widest shadow-xl hover:bg-indigo-600 active:scale-95 transition-all",children:"PERBARUI PASSWORD"})]}),x==="Analisis"&&e.jsxs("div",{className:"space-y-8 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4 px-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-14 h-14 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-xl",children:e.jsx("svg",{className:"w-7 h-7",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-black text-slate-800 leading-tight",children:"Rangkuman Naratif Siswa"}),e.jsx("p",{className:"text-slate-400 font-bold text-xs uppercase tracking-widest",children:"Dibuat otomatis dari data SELARAS"})]})]}),b&&e.jsxs("button",{onClick:Pe,className:"bg-slate-900 text-white px-8 py-3 rounded-2xl font-black text-xs uppercase tracking-widest flex items-center gap-3 shadow-xl hover:bg-indigo-600 transition-all",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Cetak PDF"]})]}),b?e.jsxs("div",{className:"bg-white p-10 md:p-16 rounded-[4rem] shadow-2xl border border-slate-100 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-full h-2 bg-gradient-to-r from-indigo-500 via-blue-500 to-indigo-600"}),e.jsx("div",{className:"max-w-3xl mx-auto",children:e.jsx(_e,{text:b})}),e.jsxs("div",{className:"mt-16 pt-8 border-t border-slate-50 flex justify-between items-center text-[10px] font-black text-slate-300 uppercase tracking-widest",children:[e.jsx("span",{children:"Sistem SELARAS v2.5"}),e.jsxs("span",{children:["© ",new Date().getFullYear()," SMA KP BALEENDAH"]})]})]}):e.jsxs("div",{className:"bg-white p-20 rounded-[4rem] shadow-xl border border-slate-50 text-center space-y-4",children:[e.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-full flex items-center justify-center mx-auto text-slate-200",children:e.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),e.jsx("p",{className:"font-black text-slate-400 italic",children:"Belum ada analisis terbaru untuk ditampilkan."}),e.jsx("button",{onClick:()=>h("Dashboard"),className:"px-8 py-3 bg-indigo-600 text-white rounded-2xl font-black text-xs uppercase tracking-widest shadow-lg",children:"Kembali Ke Dashboard"})]})]})]})},qe=({student:l,onSuccess:o})=>{const[m,x]=c.useState(""),[h,g]=c.useState(""),[f,j]=c.useState(!1),[H,b]=c.useState(null),F=async()=>{if(m.length<6){b("Password minimal 6 karakter");return}if(m!==h){b("Konfirmasi password tidak cocok");return}j(!0),b(null);try{await X(I(L,"student_auth",l.id),{passwordHash:m,mustChangePassword:!1,updatedAt:V(),createdAt:V()},{merge:!0}),o()}catch{b("Gagal menyimpan password")}finally{j(!1)}};return e.jsx("div",{className:"max-w-md mx-auto mt-16 px-4",children:e.jsxs("div",{className:"bg-white p-8 rounded-3xl shadow-xl space-y-6",children:[e.jsx("h2",{className:"text-xl font-black text-center",children:"Ganti Password"}),e.jsxs("p",{className:"text-sm text-slate-500 text-center",children:["Halo ",l.name,", silakan buat password baru"]}),e.jsx("input",{type:"password",placeholder:"Password baru",value:m,onChange:v=>x(v.target.value),className:"w-full px-5 py-4 rounded-xl border font-bold"}),e.jsx("input",{type:"password",placeholder:"Konfirmasi password",value:h,onChange:v=>g(v.target.value),className:"w-full px-5 py-4 rounded-xl border font-bold"}),H&&e.jsx("div",{className:"text-red-600 text-xs font-bold text-center",children:H}),e.jsx("button",{onClick:F,disabled:f,className:"w-full bg-indigo-600 text-white py-4 rounded-xl font-black uppercase tracking-widest",children:"SIMPAN PASSWORD"})]})})},na=()=>{const[l,o]=c.useState("login"),[m,x]=c.useState(null);return console.log("STUDENT STEP:",l),l==="login"?e.jsx(Oe,{onLogin:h=>{x(h),h.mustChangePassword===!0?o("change-password"):o("dashboard")}}):l==="change-password"?e.jsx(qe,{student:m.student,onSuccess:()=>o("dashboard")}):e.jsx(Ye,{student:m.student,classInfo:m.classInfo,onLogout:()=>{x(null),o("login")}})};export{na as default};
Save
🧪 PHP Preview
<?php echo 'hello'; ?>
Run PHP
🖥 Linux CMD
Run CMD