"use strict";exports.id=76756,exports.ids=[76756],exports.modules={76756:(a,b,c)=>{c.r(b),c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(19099),g=c(59478),h=c(82697);c(93529),c(91115);let i={GENERAL:"Notice",EVENT:"Event",HOLIDAY:"Holiday"},j={GENERAL:"bg-slate-100 text-slate-700",EVENT:"bg-sky-50 text-sky-800",HOLIDAY:"bg-violet-50 text-violet-800"};function k(){let a=(0,f.useParams)();"string"==typeof a?.studentUserId&&a.studentUserId;let[b,c]=(0,e.useState)([]),[k,l]=(0,e.useState)(!0),[m,n]=(0,e.useState)(null);return(0,d.jsx)(g.R,{title:"Notices",description:"School announcements, events, and holidays for your child's class.",children:k?(0,d.jsx)("div",{className:"space-y-3 animate-pulse",children:Array.from({length:3}).map((a,b)=>(0,d.jsx)("div",{className:"h-24 rounded-lg bg-slate-100"},b))}):0===b.length?(0,d.jsx)(h.i0,{title:"No notices yet",description:"When the school publishes announcements for your child's class, they will show here."}):(0,d.jsx)("ul",{className:"space-y-3",children:b.map(a=>{let b=m===a.id;return(0,d.jsx)("li",{children:(0,d.jsxs)("div",{className:"overflow-hidden rounded-lg border border-slate-100 bg-white shadow-sm",children:[(0,d.jsxs)("button",{type:"button",className:"w-full p-4 text-left touch-manipulation sm:p-5",onClick:()=>n(b?null:a.id),children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${j[a.noticeType]||j.GENERAL}`,children:i[a.noticeType]||"Notice"}),a.isPinned?(0,d.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-amber-700",children:"Pinned"}):null]}),(0,d.jsx)("p",{className:"font-semibold text-slate-900",children:a.title}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-slate-500",children:[a.eventDate?`${a.eventDate} \xb7 `:"",a.publishAt?new Date(a.publishAt).toLocaleDateString():""]})]}),(0,d.jsx)("span",{className:"shrink-0 text-xs font-medium text-primary-700",children:b?"Hide":"Read"})]}),b?null:(0,d.jsx)("p",{className:"mt-2 line-clamp-2 text-sm text-slate-500",children:a.body})]}),b?(0,d.jsx)("div",{className:"border-t border-slate-100 px-4 py-3 text-sm whitespace-pre-wrap text-slate-800 sm:px-5",children:a.body}):null]})},a.id)})})})}},93529:(a,b,c)=>{c.d(b,{BT:()=>h,CP:()=>o,OI:()=>k,W6:()=>f,WR:()=>l,hi:()=>j,kN:()=>g,mk:()=>i,n9:()=>n,xw:()=>m});var d=c(23971);function e(a){if(!a.data.success||void 0===a.data.data)throw Error(a.data.message||"Request failed");return a.data.data}async function f(){return e(await d.uE.get("/school/parent/home"))}async function g(a){return e(await d.uE.get(`/school/parent/children/${a}/overview`))}async function h(a){return e(await d.uE.get(`/school/parent/children/${a}/details`))}async function i(a){return e(await d.uE.get(`/school/parent/children/${a}/notices`))}async function j(a){return e(await d.uE.get(`/school/parent/children/${a}/homework`))}async function k(a,b){return e(await d.uE.get(`/school/parent/children/${a}/attendance`,{params:b}))}async function l(a){return e(await d.uE.get(`/school/parent/children/${a}/fees`))}async function m(a){return e(await d.uE.get(`/school/parent/children/${a}/exams`))}async function n(a,b){return e(await d.uE.get(`/school/parent/children/${a}/exam-result`,{params:{examId:b}}))}async function o(){return e(await d.uE.get("/school/parent/holidays"))}}};