"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75388],{74714:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var s=n(95155),a=n(12115),r=n(55368),i=n(30313),o=n(88541),c=n(2581);function l(){let[t,e]=(0,a.useState)([]),[n,l]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let t=!1;return(0,o.CP)().then(n=>{t||e(n)}).catch(e=>{t||(0,c.Qg)(e instanceof Error?e.message:"Failed to load holidays")}).finally(()=>{t||l(!1)}),()=>{t=!0}},[]),(0,s.jsx)(r.R,{title:"Holidays",description:"Upcoming school holidays for your linked children.",children:n?(0,s.jsx)("div",{className:"h-40 animate-pulse rounded-lg bg-slate-100"}):t.length?(0,s.jsx)("ul",{className:"divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-100 bg-white shadow-sm",children:t.map(t=>(0,s.jsx)("li",{className:"px-4 py-4 sm:px-5",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-semibold text-slate-900",children:t.title}),(0,s.jsx)("p",{className:"mt-1 text-sm tabular-nums text-slate-600",children:t.startDate===t.endDate?t.startDate:`${t.startDate} → ${t.endDate}`}),t.description?(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:t.description}):null]}),(0,s.jsx)("span",{className:"rounded-md bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600",children:t.holidayType})]})},t.id))}):(0,s.jsx)(i.i0,{title:"No upcoming holidays",description:"When the school publishes holidays, they will appear here."})})}},88541:(t,e,n)=>{n.d(e,{BT:()=>o,CP:()=>p,OI:()=>u,W6:()=>r,WR:()=>d,hi:()=>l,kN:()=>i,mk:()=>c,n9:()=>m,xw:()=>h});var s=n(76541);function a(t){if(!t.data.success||void 0===t.data.data)throw Error(t.data.message||"Request failed");return t.data.data}async function r(){return a(await s.uE.get("/school/parent/home"))}async function i(t){return a(await s.uE.get(`/school/parent/children/${t}/overview`))}async function o(t){return a(await s.uE.get(`/school/parent/children/${t}/details`))}async function c(t){return a(await s.uE.get(`/school/parent/children/${t}/notices`))}async function l(t){return a(await s.uE.get(`/school/parent/children/${t}/homework`))}async function u(t,e){return a(await s.uE.get(`/school/parent/children/${t}/attendance`,{params:e}))}async function d(t){return a(await s.uE.get(`/school/parent/children/${t}/fees`))}async function h(t){return a(await s.uE.get(`/school/parent/children/${t}/exams`))}async function m(t,e){return a(await s.uE.get(`/school/parent/children/${t}/exam-result`,{params:{examId:e}}))}async function p(){return a(await s.uE.get("/school/parent/holidays"))}},90927:(t,e,n)=>{n.d(e,{B7:()=>h,Bw:()=>d,I9:()=>o,X8:()=>u,ae:()=>m,oG:()=>c}),n(86559);var s=n(76541);let a=["res.cloudinary.com"];function r(t){let e=t.toLowerCase();return"supabase.co"===e||e.endsWith(".supabase.co")||e.includes("datahub.com.np")||e.includes("s3-np1")}function i(t,e,n){let s=t.trim(),a=`url=${encodeURIComponent(s)}`;return`/api/media/image?${a}`}function o(t){return`/api/media/file?url=${encodeURIComponent(t.trim())}`}function c(t,e){if(!t||"string"!=typeof t)return"";let n=t.trim();if(!n)return"";if(n.startsWith("blob:")||n.startsWith("data:"))return n;let a=e??(0,s.getApiBaseUrl)();if(u(n)){let t=d(n,a);return t.includes("/media/image")?t:i(n,a)}return d(n,a)||n}function l(t){if(!t||"string"!=typeof t)return!1;let e=t.trim();return e.startsWith("/")&&!e.startsWith("//")}function u(t){if(!t||"string"!=typeof t)return!1;let e=t.trim();return!(!e||l(e)||e.startsWith("blob:")||e.startsWith("data:")||e.includes("/media/image")||e.includes("/storage/v1/object/sign/"))&&(!/^https?:\/\//i.test(e)||function(t){if(!t||!/^https?:\/\//i.test(t))return!1;try{let e=new URL(t);return r(e.hostname)||e.pathname.includes("/dplms-saas-bucket/")}catch{return!1}}(e)||function(t){try{let e=new URL(t);return"drive.google.com"===e.hostname||e.hostname.endsWith(".drive.google.com")||"docs.google.com"===e.hostname||e.hostname.endsWith(".googleusercontent.com")||"googleusercontent.com"===e.hostname}catch{return!1}}(e))}function d(t,e){if(!t||"string"!=typeof t)return"";let n=t.trim();return n?n.includes("/media/image")||n.includes("/storage/v1/object/sign/")||l(n)?n:!/^https?:\/\//i.test(n)||u(n)?i(n,e):n:""}function h(t,e){return c(t,e)}function m(t){if(!t||"string"!=typeof t)return!1;let e=t.trim();if(e.startsWith("blob:")||e.startsWith("data:"))return!1;try{if(e.startsWith("https://")||e.startsWith("http://"))return!0;let n=new URL(t).hostname.toLowerCase();return r(n)||a.some(t=>n===t||n.endsWith("."+t))}catch{return!1}}}}]);