(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[797],{4813:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(5155);function l(){return(0,a.jsxs)("div",{className:"animate-pulse bg-white rounded-lg shadow-md p-4",children:[(0,a.jsx)("div",{className:"h-48 bg-gray-200 rounded-md mb-4"})," ",(0,a.jsx)("div",{className:"h-5 bg-gray-200 rounded w-3/4 mb-2"})," ",(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2"})," "]})}},4887:(e,t,s)=>{"use strict";s.d(t,{N:()=>l});var a=s(3464);let l=async()=>(await a.A.get("".concat("https://www.samimramizfellowship.org/api","/classes"))).data},5442:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var a=s(5155),l=s(6766),r=s(2115),i=s(9509);let n=e=>{let{post:t}=e,[s,n]=(0,r.useState)(!1),[o,c]=(0,r.useState)(!1),d=t.title.length>50?"".concat(t.title.substring(0,50),"..."):t.title;return(0,a.jsxs)("article",{className:"bg-white rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[(0,a.jsxs)("div",{className:"relative w-full h-48 overflow-hidden",children:["video"===t.type&&t.videoSrc&&!s?(0,a.jsxs)("video",{className:"w-full h-full object-cover",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,poster:t.image,onError:()=>n(!0),children:[(0,a.jsx)("source",{src:t.videoSrc,type:"video/mp4"}),"Your browser does not support the video tag."]}):(0,a.jsx)(l.default,{src:t.image||"".concat(i.env.NEXT_PUBLIC_URL,"/placeholder.svg"),alt:t.title,className:"w-full h-full object-cover transition-transform duration-500 ".concat(o?"scale-105":"scale-100"),width:1200,height:800}),"video"===t.type&&(0,a.jsx)("div",{className:"absolute top-3 right-3 bg-black bg-opacity-70 text-white text-xs px-2 py-1 rounded",children:"Video"})]}),(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center text-gray-500 text-xs mb-2",children:[(0,a.jsx)("span",{children:t.date}),(0,a.jsx)("span",{className:"mx-2",children:"•"}),(0,a.jsx)("span",{children:t.author})]}),(0,a.jsx)("h3",{className:"font-semibold text-lg mb-2 line-clamp-2",title:t.title,children:d}),(0,a.jsx)("p",{className:"text-gray-600 text-sm line-clamp-3 mb-4",children:t.excerpt}),(0,a.jsxs)("button",{className:"text-blue-600 hover:text-blue-800 text-sm font-medium flex items-center transition-transform duration-200 ".concat(o?"translate-x-1":""),children:["Read more",(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})}},5695:(e,t,s)=>{"use strict";var a=s(8999);s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}})},6533:(e,t,s)=>{Promise.resolve().then(s.bind(s,7117))},7117:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(5155),l=s(2115),r=s(3464),i=s(4887);let n=async e=>(await r.A.get("".concat("https://www.samimramizfellowship.org/api","/classes/").concat(e))).data;function o(e){let{tabs:t,active:s,onSelect:l,counts:r}=e;return(0,a.jsx)("div",{role:"tablist","aria-label":"Class sections",className:"flex flex-wrap justify-center gap-2 border-b border-gray-200",children:t.map(e=>{let t=e.key===s,i=null==r?void 0:r[e.key];return(0,a.jsxs)("button",{role:"tab","aria-selected":t,onClick:()=>l(e.key),className:"px-4 py-3 -mb-px text-sm md:text-base font-medium border-b-2 transition-colors ".concat(t?"border-[#BE4C19] text-[#BE4C19]":"border-transparent text-gray-600 hover:text-black"),children:[e.label,"number"==typeof i&&(0,a.jsxs)("span",{className:"ml-2 text-xs text-gray-400",children:["(",i,")"]})]},e.key)})})}var c=s(6766);let d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/placeholder.svg";return e?/^(https?:)?\/\//.test(e)||e.startsWith("/")?e:"".concat("https://www.samimramizfellowship.org/storage","/").concat(e):t};function m(e){let{fellows:t}=e;return 0===t.length?(0,a.jsx)("p",{className:"text-center text-gray-500",children:"No fellows have been added for this class yet."}):(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-6",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:"bg-white shadow-md rounded-lg p-6 hover:shadow-lg transition-shadow",children:[(0,a.jsx)("a",{href:"/blogs/?fellow=".concat(e.id),className:"text-lg font-semibold hover:underline",target:"_blank",rel:"noopener noreferrer",children:(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,a.jsx)(c.default,{src:d(null!=(t=e.image_url)?t:e.image),alt:e.name,className:"w-20 h-20 object-cover rounded-full",width:80,height:80}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:e.name}),(0,a.jsx)("p",{className:"text-gray-500 text-sm",children:e.location})]})]})}),(0,a.jsx)("p",{className:"text-gray-700 text-sm leading-7",dangerouslySetInnerHTML:{__html:e.description}})]},e.id)})})}function h(e){let{members:t}=e;return(0,a.jsxs)("section",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-gray-600 mb-8",children:"Meet the experts who carefully select and guide this class of fellowship candidates."}),0===t.length?(0,a.jsx)("p",{className:"text-gray-500",children:"No selection committee has been added for this class yet."}):(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6",children:t.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsx)(c.default,{src:d(e.image_url),alt:e.name,className:"w-32 h-32 rounded-full object-cover",width:128,height:128}),(0,a.jsx)("h3",{className:"mt-4 font-semibold",children:e.name}),(0,a.jsx)("p",{className:"text-gray-500",children:e.role||"Selection Committee"})]},e.id))})]})}function x(e){let{partners:t}=e;return(0,a.jsxs)("section",{children:[(0,a.jsx)("p",{className:"text-gray-600 mb-8 text-center",children:"We proudly collaborate with these organizations to make this class of the fellowship possible."}),0===t.length?(0,a.jsx)("p",{className:"text-center text-gray-500",children:"No partners have been added for this class yet."}):(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-6",children:t.map(e=>(0,a.jsxs)("div",{className:"bg-white shadow-md rounded-lg p-11 hover:shadow-lg transition-shadow",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,a.jsx)(c.default,{src:d(e.image_url),alt:e.name,className:"w-16 h-16 object-cover",width:64,height:64}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:e.name}),e.location&&(0,a.jsx)("p",{className:"text-gray-500 text-sm",children:e.location})]})]}),e.description&&(0,a.jsx)("p",{className:"text-gray-700 text-sm leading-7",children:e.description})]},e.id))})]})}function g(e){let{contributors:t}=e;return(0,a.jsxs)("section",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-gray-600 mb-8",children:"The people whose support and expertise made this class possible."}),0===t.length?(0,a.jsx)("p",{className:"text-gray-500",children:"No contributors have been added for this class yet."}):(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-6",children:t.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsx)(c.default,{src:d(e.image_url),alt:e.name,className:"w-28 h-28 rounded-full object-cover",width:112,height:112}),(0,a.jsx)("h3",{className:"mt-3 font-semibold text-sm",children:e.name})]},e.id))})]})}var u=s(6874),p=s.n(u),f=s(5695),b=s(5442),w=s(4813),j=s(9356);let v=e=>{var t;let s=null==e||null==(t=e.split(".").pop())?void 0:t.toLowerCase();return s&&["mp4","avi","mkv"].includes(s)?"video":"image"};function N(e){let{classId:t,year:s}=e,r=(0,f.useRouter)(),[i,n]=(0,l.useState)([]),[o,c]=(0,l.useState)(1),[m,h]=(0,l.useState)(!0),[x,g]=(0,l.useState)(!0),[u,N]=(0,l.useState)("");return((0,l.useEffect)(()=>{let e=!1;return(async()=>{g(!0);try{let s=(await (0,j.n)(o,{per_page:6,class:t})).data||[];if(e)return;n(e=>1===o?s:[...e,...s]),h(6===s.length)}catch(t){console.error(t),e||N("Failed to load posts.")}finally{e||g(!1)}})(),()=>{e=!0}},[t,o]),u)?(0,a.jsx)("p",{className:"text-center text-red-500",children:u}):x&&0===i.length?(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array.from({length:3}).map((e,t)=>(0,a.jsx)(w.A,{},t))}):0===i.length?(0,a.jsxs)("p",{className:"text-center text-gray-500",children:["No posts from Class ",s," yet."]}):(0,a.jsxs)("section",{children:[(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:i.map(e=>{var t;let s=v(e.file),l=e.file?d(e.file):void 0;return(0,a.jsx)("div",{onClick:()=>r.push("/blogs/?post=".concat(e.slug)),className:"cursor-pointer h-full flex flex-col",children:(0,a.jsx)(b.A,{post:{id:String(e.id),title:e.title,excerpt:e.excerpt,image:l,type:s,videoSrc:"video"===s?l:void 0,date:new Date(e.published_at).toLocaleDateString(),author:(null==(t=e.user)?void 0:t.name)||"Unknown"}})},e.id)})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 mt-10",children:[m&&(0,a.jsx)("button",{onClick:()=>c(e=>e+1),disabled:x,className:"px-6 py-2 rounded-md bg-[#BE4C19] text-white font-medium hover:bg-black transition disabled:opacity-60",children:x?"Loading...":"Load more"}),(0,a.jsxs)(p(),{href:"/blogs/?class=".concat(t),className:"text-[#BE4C19] hover:underline font-medium",children:["See all Class ",s," posts"]})]})]})}let y=[{key:"fellows",label:"Fellows"},{key:"committee",label:"Selection Committee"},{key:"partners",label:"Partners"},{key:"contributors",label:"Contributors"},{key:"blogs",label:"Blogs"}],k=e=>y.some(t=>t.key===e);function S(){let[e,t]=(0,l.useState)(null),[s,c]=(0,l.useState)("fellows"),[d,u]=(0,l.useState)(!0),[p,f]=(0,l.useState)("");(0,l.useEffect)(()=>{let e=new URLSearchParams(window.location.search),s=window.location.hash.replace("#","");k(s)&&c(s),(async()=>{u(!0),f("");try{let s=e.get("year");if(!s){let e=await (0,i.N)();if(0===e.length)throw Error("No classes have been published yet.");s=String(e[0].year)}let a=await n(s);t(a)}catch(e){var s;console.error(e),r.A.isAxiosError(e)&&(null==(s=e.response)?void 0:s.status)===404?f("That class does not exist."):e instanceof Error?f(e.message):f("Failed to load this class.")}finally{u(!1)}})()},[]);let b=(0,l.useCallback)(e=>{c(e),window.history.replaceState(null,"","".concat(window.location.pathname).concat(window.location.search,"#").concat(e))},[]);return(0,a.jsx)("main",{className:"min-h-screen bg-gray-50 py-10 px-4",children:(0,a.jsx)("div",{className:"max-w-6xl mx-auto",children:d?(0,a.jsx)("p",{className:"text-center text-gray-500 text-lg",children:"Loading class..."}):p?(0,a.jsx)("p",{className:"text-center text-red-500",children:p}):e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"text-3xl md:text-4xl font-bold mb-4 text-center leading-tight",children:e.name.trim()}),(0,a.jsx)("div",{className:"text-gray-600 mb-8 text-center max-w-3xl mx-auto",dangerouslySetInnerHTML:{__html:e.description}}),(0,a.jsx)(o,{tabs:y,active:s,onSelect:b,counts:{fellows:e.fellows.length,committee:e.committee_members.length,partners:e.partners.length,contributors:e.contributors.length}}),(0,a.jsxs)("div",{className:"mt-8",children:["fellows"===s&&(0,a.jsx)(m,{fellows:e.fellows}),"committee"===s&&(0,a.jsx)(h,{members:e.committee_members}),"partners"===s&&(0,a.jsx)(x,{partners:e.partners}),"contributors"===s&&(0,a.jsx)(g,{contributors:e.contributors}),"blogs"===s&&(0,a.jsx)(N,{classId:e.id,year:e.year})]})]}):null})})}},9356:(e,t,s)=>{"use strict";s.d(t,{n:()=>l});var a=s(3464);let l=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return(await a.A.get("".concat("https://www.samimramizfellowship.org/api","/blogs"),{params:{page:e,...t}})).data}}},e=>{var t=t=>e(e.s=t);e.O(0,[464,766,874,441,684,358],()=>t(6533)),_N_E=e.O()}]);