"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[16053,38434,57211],{38434:(e,t,a)=>{let s,r;a.d(t,{l$:()=>ee,Ay:()=>et,oR:()=>P});var i,o=a(12115);let n={data:""},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,c=/\/\*[^]*?\*\/|  +/g,d=/\n+/g,u=(e,t)=>{let a="",s="",r="";for(let i in e){let o=e[i];"@"==i[0]?"i"==i[1]?a=i+" "+o+";":s+="f"==i[1]?u(o,i):i+"{"+u(o,"k"==i[1]?"":t)+"}":"object"==typeof o?s+=u(o,t?t.replace(/([^,])+/g,e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):i):null!=o&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=u.p?u.p(i,o):i+":"+o+";")}return a+(t&&r?t+"{"+r+"}":r)+s},p={},m=e=>{if("object"==typeof e){let t="";for(let a in e)t+=a+m(e[a]);return t}return e};function f(e){let t,a,s=this||{},r=e.call?e(s.p):e;return((e,t,a,s,r)=>{var i;let o=m(e),n=p[o]||(p[o]=(e=>{let t=0,a=11;for(;t<e.length;)a=101*a+e.charCodeAt(t++)>>>0;return"go"+a})(o));if(!p[n]){let t=o!==e?e:(e=>{let t,a,s=[{}];for(;t=l.exec(e.replace(c,""));)t[4]?s.shift():t[3]?(a=t[3].replace(d," ").trim(),s.unshift(s[0][a]=s[0][a]||{})):s[0][t[1]]=t[2].replace(d," ").trim();return s[0]})(e);p[n]=u(r?{["@keyframes "+n]:t}:t,a?"":"."+n)}let f=a&&p.g?p.g:null;return a&&(p.g=p[n]),i=p[n],f?t.data=t.data.replace(f,i):-1===t.data.indexOf(i)&&(t.data=s?i+t.data:t.data+i),n})(r.unshift?r.raw?(t=[].slice.call(arguments,1),a=s.p,r.reduce((e,s,r)=>{let i=t[r];if(i&&i.call){let e=i(a),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":u(e,""):!1===e?"":e}return e+s+(null==i?"":i)},"")):r.reduce((e,t)=>Object.assign(e,t&&t.call?t(s.p):t),{}):r,(e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||n})(s.target),s.g,s.o,s.k)}f.bind({g:1});let h,y,g,b=f.bind({k:1});function x(e,t){let a=this||{};return function(){let s=arguments;function r(i,o){let n=Object.assign({},i),l=n.className||r.className;a.p=Object.assign({theme:y&&y()},n),a.o=/ *go\d+/.test(l),n.className=f.apply(a,s)+(l?" "+l:""),t&&(n.ref=o);let c=e;return e[0]&&(c=n.as||e,delete n.as),g&&c[0]&&g(n),h(c,n)}return t?t(r):r}}var v=(e,t)=>"function"==typeof e?e(t):e,w=(s=0,()=>(++s).toString()),E=()=>{if(void 0===r&&"u">typeof window){let e=matchMedia("(prefers-reduced-motion: reduce)");r=!e||e.matches}return r},N="default",k=(e,t)=>{let{toastLimit:a}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,a)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:s}=t;return k(e,{type:+!!e.toasts.find(e=>e.id===s.id),toast:s});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+i}))}}},j=[],$={toasts:[],pausedAt:void 0,settings:{toastLimit:20}},A={},D=(e,t=N)=>{A[t]=k(A[t]||$,e),j.forEach(([e,a])=>{e===t&&a(A[t])})},C=e=>Object.keys(A).forEach(t=>D(e,t)),O=(e=N)=>t=>{D(t,e)},I={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},L=e=>(t,a)=>{let s,r=((e,t="blank",a)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...a,id:(null==a?void 0:a.id)||w()}))(t,e,a);return O(r.toasterId||(s=r.id,Object.keys(A).find(e=>A[e].toasts.some(e=>e.id===s))))({type:2,toast:r}),r.id},P=(e,t)=>L("blank")(e,t);P.error=L("error"),P.success=L("success"),P.loading=L("loading"),P.custom=L("custom"),P.dismiss=(e,t)=>{let a={type:3,toastId:e};t?O(t)(a):C(a)},P.dismissAll=e=>P.dismiss(void 0,e),P.remove=(e,t)=>{let a={type:4,toastId:e};t?O(t)(a):C(a)},P.removeAll=e=>P.remove(void 0,e),P.promise=(e,t,a)=>{let s=P.loading(t.loading,{...a,...null==a?void 0:a.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let r=t.success?v(t.success,e):void 0;return r?P.success(r,{id:s,...a,...null==a?void 0:a.success}):P.dismiss(s),e}).catch(e=>{let r=t.error?v(t.error,e):void 0;r?P.error(r,{id:s,...a,...null==a?void 0:a.error}):P.dismiss(s)}),e};var R=1e3,T=b`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,_=b`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,z=b`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,S=x("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${T} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${_} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${e=>e.secondary||"#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${z} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,H=b`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,F=x("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${e=>e.secondary||"#e0e0e0"};
  border-right-color: ${e=>e.primary||"#616161"};
  animation: ${H} 1s linear infinite;
`,M=b`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,U=b`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,G=x("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${M} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${U} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${e=>e.secondary||"#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`,W=x("div")`
  position: absolute;
`,Y=x("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,q=b`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,B=x("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${q} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,V=({toast:e})=>{let{icon:t,type:a,iconTheme:s}=e;return void 0!==t?"string"==typeof t?o.createElement(B,null,t):t:"blank"===a?null:o.createElement(Y,null,o.createElement(F,{...s}),"loading"!==a&&o.createElement(W,null,"error"===a?o.createElement(S,{...s}):o.createElement(G,{...s})))},Q=x("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`,Z=x("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,J=o.memo(({toast:e,position:t,style:a,children:s})=>{let r=e.height?((e,t)=>{let a=e.includes("top")?1:-1,[s,r]=E()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[`
0% {transform: translate3d(0,${-200*a}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${-150*a}%,-1px) scale(.6); opacity:0;}
`];return{animation:t?`${b(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${b(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||t||"top-center",e.visible):{opacity:0},i=o.createElement(V,{toast:e}),n=o.createElement(Z,{...e.ariaProps},v(e.message,e));return o.createElement(Q,{className:e.className,style:{...r,...a,...e.style}},"function"==typeof s?s({icon:i,message:n}):o.createElement(o.Fragment,null,i,n))});i=o.createElement,u.p=void 0,h=i,y=void 0,g=void 0;var K=({id:e,className:t,style:a,onHeightUpdate:s,children:r})=>{let i=o.useCallback(t=>{if(t){let a=()=>{s(e,t.getBoundingClientRect().height)};a(),new MutationObserver(a).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,s]);return o.createElement("div",{ref:i,className:t,style:a},r)},X=f`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,ee=({reverseOrder:e,position:t="top-center",toastOptions:a,gutter:s,children:r,toasterId:i,containerStyle:n,containerClassName:l})=>{let{toasts:c,handlers:d}=((e,t="default")=>{let{toasts:a,pausedAt:s}=((e={},t=N)=>{let[a,s]=(0,o.useState)(A[t]||$),r=(0,o.useRef)(A[t]);(0,o.useEffect)(()=>(r.current!==A[t]&&s(A[t]),j.push([t,s]),()=>{let e=j.findIndex(([e])=>e===t);e>-1&&j.splice(e,1)}),[t]);let i=a.toasts.map(t=>{var a,s,r;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(a=e[t.type])?void 0:a.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(s=e[t.type])?void 0:s.duration)||(null==e?void 0:e.duration)||I[t.type],style:{...e.style,...null==(r=e[t.type])?void 0:r.style,...t.style}}});return{...a,toasts:i}})(e,t),r=(0,o.useRef)(new Map).current,i=(0,o.useCallback)((e,t=R)=>{if(r.has(e))return;let a=setTimeout(()=>{r.delete(e),n({type:4,toastId:e})},t);r.set(e,a)},[]);(0,o.useEffect)(()=>{if(s)return;let e=Date.now(),r=a.map(a=>{if(a.duration===1/0)return;let s=(a.duration||0)+a.pauseDuration-(e-a.createdAt);if(s<0){a.visible&&P.dismiss(a.id);return}return setTimeout(()=>P.dismiss(a.id,t),s)});return()=>{r.forEach(e=>e&&clearTimeout(e))}},[a,s,t]);let n=(0,o.useCallback)(O(t),[t]),l=(0,o.useCallback)(()=>{n({type:5,time:Date.now()})},[n]),c=(0,o.useCallback)((e,t)=>{n({type:1,toast:{id:e,height:t}})},[n]),d=(0,o.useCallback)(()=>{s&&n({type:6,time:Date.now()})},[s,n]),u=(0,o.useCallback)((e,t)=>{let{reverseOrder:s=!1,gutter:r=8,defaultPosition:i}=t||{},o=a.filter(t=>(t.position||i)===(e.position||i)&&t.height),n=o.findIndex(t=>t.id===e.id),l=o.filter((e,t)=>t<n&&e.visible).length;return o.filter(e=>e.visible).slice(...s?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+r,0)},[a]);return(0,o.useEffect)(()=>{a.forEach(e=>{if(e.dismissed)i(e.id,e.removeDelay);else{let t=r.get(e.id);t&&(clearTimeout(t),r.delete(e.id))}})},[a,i]),{toasts:a,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}})(a,i);return o.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...n},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(a=>{let i,n,l=a.position||t,c=d.calculateOffset(a,{reverseOrder:e,gutter:s,defaultPosition:t}),u=(i=l.includes("top"),n=l.includes("center")?{justifyContent:"center"}:l.includes("right")?{justifyContent:"flex-end"}:{},{left:0,right:0,display:"flex",position:"absolute",transition:E()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${c*(i?1:-1)}px)`,...i?{top:0}:{bottom:0},...n});return o.createElement(K,{id:a.id,key:a.id,onHeightUpdate:d.updateHeight,className:a.visible?X:"",style:u},"custom"===a.type?v(a.message,a):r?r(a):o.createElement(J,{toast:a,position:l}))}))},et=P},54394:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var s=a(95155),r=a(12115),i=a(73321),o=a(55368),n=a(30313),l=a(88541),c=a(2581);let d={GENERAL:"Notice",EVENT:"Event",HOLIDAY:"Holiday"},u={GENERAL:"bg-slate-100 text-slate-700",EVENT:"bg-sky-50 text-sky-800",HOLIDAY:"bg-violet-50 text-violet-800"};function p(){let e=(0,i.useParams)(),t="string"==typeof e?.studentUserId?e.studentUserId:"",[a,p]=(0,r.useState)([]),[m,f]=(0,r.useState)(!0),[h,y]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(!t)return;let e=!1;return(0,l.mk)(t).then(t=>{e||p(t)}).catch(t=>{e||(0,c.Qg)(t instanceof Error?t.message:"Failed to load notices")}).finally(()=>{e||f(!1)}),()=>{e=!0}},[t]),(0,s.jsx)(o.R,{title:"Notices",description:"School announcements, events, and holidays for your child's class.",children:m?(0,s.jsx)("div",{className:"space-y-3 animate-pulse",children:Array.from({length:3}).map((e,t)=>(0,s.jsx)("div",{className:"h-24 rounded-lg bg-slate-100"},t))}):0===a.length?(0,s.jsx)(n.i0,{title:"No notices yet",description:"When the school publishes announcements for your child's class, they will show here."}):(0,s.jsx)("ul",{className:"space-y-3",children:a.map(e=>{let t=h===e.id;return(0,s.jsx)("li",{children:(0,s.jsxs)("div",{className:"overflow-hidden rounded-lg border border-slate-100 bg-white shadow-sm",children:[(0,s.jsxs)("button",{type:"button",className:"w-full p-4 text-left touch-manipulation sm:p-5",onClick:()=>y(t?null:e.id),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${u[e.noticeType]||u.GENERAL}`,children:d[e.noticeType]||"Notice"}),e.isPinned?(0,s.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-amber-700",children:"Pinned"}):null]}),(0,s.jsx)("p",{className:"font-semibold text-slate-900",children:e.title}),(0,s.jsxs)("p",{className:"mt-1 text-xs text-slate-500",children:[e.eventDate?`${e.eventDate} \xb7 `:"",e.publishAt?new Date(e.publishAt).toLocaleDateString():""]})]}),(0,s.jsx)("span",{className:"shrink-0 text-xs font-medium text-primary-700",children:t?"Hide":"Read"})]}),t?null:(0,s.jsx)("p",{className:"mt-2 line-clamp-2 text-sm text-slate-500",children:e.body})]}),t?(0,s.jsx)("div",{className:"border-t border-slate-100 px-4 py-3 text-sm whitespace-pre-wrap text-slate-800 sm:px-5",children:e.body}):null]})},e.id)})})})}},88541:(e,t,a)=>{a.d(t,{BT:()=>n,CP:()=>f,OI:()=>d,W6:()=>i,WR:()=>u,hi:()=>c,kN:()=>o,mk:()=>l,n9:()=>m,xw:()=>p});var s=a(76541);function r(e){if(!e.data.success||void 0===e.data.data)throw Error(e.data.message||"Request failed");return e.data.data}async function i(){return r(await s.uE.get("/school/parent/home"))}async function o(e){return r(await s.uE.get(`/school/parent/children/${e}/overview`))}async function n(e){return r(await s.uE.get(`/school/parent/children/${e}/details`))}async function l(e){return r(await s.uE.get(`/school/parent/children/${e}/notices`))}async function c(e){return r(await s.uE.get(`/school/parent/children/${e}/homework`))}async function d(e,t){return r(await s.uE.get(`/school/parent/children/${e}/attendance`,{params:t}))}async function u(e){return r(await s.uE.get(`/school/parent/children/${e}/fees`))}async function p(e){return r(await s.uE.get(`/school/parent/children/${e}/exams`))}async function m(e,t){return r(await s.uE.get(`/school/parent/children/${e}/exam-result`,{params:{examId:t}}))}async function f(){return r(await s.uE.get("/school/parent/holidays"))}}}]);