PageSourceSearch

https://dbohra.com/assets/ProgrammeDetailPage-BDvBRPjK.js

js dbohra.com collected 2026-10-05 08:00:42 UTC 11,394 bytes, 1 lines download raw bytes

1import{u as D,r as j,j as e,z as n,A as F,L as w}from"./index-YH8sdNi-.js";import{u as T}from"./useQuery-C4Ldm0GU.js";import{H as g,F as f}from"./FooterSection-Jgqs7IYw.js";import{c as O,e as M,T as $,a as R,f as v,g as h,p as V}from"./programmeConstants-CHTJkUFO.js";import{X as I}from"./x-CU_6F55C.js";import{L}from"./loader-circle-xLAg6t_1.js";import{S as z}from"./send-3qWdAqBI.js";import{R as A}from"./Reveal-DSpBouxY.js";import{C as u}from"./calendar-CD0sGZ86.js";import{A as B}from"./arrow-left-CiaXAoLP.js";import{V as H,I as C}from"./video-CciAG8k5.js";import{M as k}from"./map-pin-CPlY-yDW.js";import{C as S}from"./clock-6vJSorew.js";import{C as Y}from"./circle-check-RSp0exo7.js";import{M as q}from"./mail-C37fVktw.js";import{U}from"./users-BhVJ_5eO.js";import{C as _}from"./copy-DueTe5HS.js";import"./usePublicApi-BPQ92rar.js";import"./itsLogin-DdqDbBA9.js";import"./utils-CgvHKzWO.js";import"./dropdown-menu-DyaUnczF.js";import"./MemberAvatar-_4ohba_p.js";import"./fullName-C2jboP2C.js";import"./assetUrl-BMxYt00G.js";import"./itsPortalLogin-C09PXzNP.js";const K=({slug:l,onClose:i,onAlreadyApplied:d})=>{const c=D(),[x,s]=j.useState(""),[t,a]=j.useState(!1),p=async m=>{m.preventDefault(),a(!0);try{const{status:r,data:o}=await O(`programmes/${l}/apply`,"POST",{motivation:x||void 0});if(r===401){c("/user/login");return}if(r===409){d(),i();return}r>=200&&r<300?(n.success("Application submitted!"),i()):n.error((o==null?void 0:o.message)??"Failed to apply")}catch{n.error("Something went wrong")}finally{a(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Apply for this Programme"}),e.jsx("button",{onClick:i,className:"p-1.5 rounded-lg hover:bg-gray-100",children:e.jsx(I,{className:"h-5 w-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Motivation (optional)"}),e.jsx("textarea",{value:x,onChange:m=>s(m.target.value),maxLength:1e3,rows:5,className:"w-full rounded-lg border px-3 py-2 text-sm focus:ring-2 focus:ring-[#0e6b99] focus:border-[#0e6b99] resize-none",placeholder:"Tell us why you want to participate..."}),e.jsxs("p",{className:"text-right text-xs text-gray-500 mt-1",children:[x.length,"/1000"]})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm rounded-lg border hover:bg-gray-50",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:t,className:"inline-flex items-center gap-2 px-5 py-2 text-sm rounded-lg bg-[#0e6b99] text-white hover:bg-[#0a4d6e] disabled:opacity-50",children:[t?e.jsx(L,{className:"h-4 w-4 animate-spin"}):e.jsx(z,{className:"h-4 w-4"}),"Submit Application"]})]})]})]})})},ye=()=>{var y,N,b;const{slug:l}=F(),[i,d]=j.useState(!1),{data:c,isLoading:x}=T({queryKey:["publicProgramme",l],queryFn:()=>V(`programmes/${l}`),enabled:!!l}),s=(c==null?void 0:c.data)??null;if(x)return e.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50",children:[e.jsx(g,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(L,{className:"h-8 w-8 animate-spin text-[#0e6b99]"})}),e.jsx(f,{})]});if(!s)return e.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50",children:[e.jsx(g,{}),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[e.jsx(u,{className:"h-12 w-12 text-gray-300 mb-3"}),e.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:"Programme not found"}),e.jsx(w,{to:"/programmes",className:"mt-4 text-sm text-[#0e6b99] hover:underline",children:"Browse all programmes"})]}),e.jsx(f,{})]});const t=M(s.applicationDeadline),a=s.isVirtual?null:[(y=s.city)==null?void 0:y.name,(N=s.state)==null?void 0:N.name,(b=s.country)==null?void 0:b.name].filter(
1Boolean).join(", "),p=s.status==="OPEN",m=t.expired,r=p&&!m,o=()=>{const P=window.location.href;navigator.clipboard.writeText(P).then(()=>n.success("Link copied!")).catch(()=>n.error("Could not copy link"))},E=()=>{n("You have already applied for this programme.",{icon:"ℹ️"})};return e.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50",children:[e.jsx(g,{}),e.jsx("div",{className:"bg-gradient-to-r from-[#0e6b99] to-[#0a4d6e] py-12 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs(w,{to:"/programmes",className:"inline-flex items-center gap-1.5 text-white/70 hover:text-white text-sm mb-4 transition-colors",children:[e.jsx(B,{className:"h-4 w-4"})," All Programmes"]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[e.jsx("span",{className:`inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold ${R[s.programmeType]??"bg-gray-100 text-gray-700"}`,children:$[s.programmeType]??s.programmeType}),s.professionalCategory&&e.jsx("span",{className:"inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold bg-white/20 text-white",children:s.professionalCategory.name})]}),e.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-white [font-family:'Raleway',Helvetica] leading-tight",children:s.title}),s.organizerName&&e.jsxs("p",{className:"text-white/70 mt-2",children:["by ",s.organizerName]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 mt-4 text-white/80 text-sm",children:[s.startsAt&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(u,{className:"h-4 w-4"}),v(s.startsAt),s.endsAt&&s.endsAt!==s.startsAt&&e.jsxs("span",{className:"text-white/50",children:[" – ",v(s.endsAt)]})]}),s.isVirtual?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(H,{className:"h-4 w-4 text-indigo-300"}),"Online / Virtual"]}):a?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(k,{className:"h-4 w-4"}),a]}):null,s.isFree?e.jsx("span",{className:"inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold bg-success-400/20 text-success-200",children:"Free"}):s.cost?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-semibold bg-amber-400/20 text-amber-200",children:[e.jsx(C,{className:"h-3 w-3"}),s.cost.toLocaleString("en-IN")]}):null]}),s.applicationDeadline&&e.jsxs("div",{className:`mt-3 flex items-center gap-1.5 text-sm ${t.expired?"text-red-300":"text-white/70"}`,children:[e.jsx(S,{className:"h-4 w-4"}),t.text,!t.expired&&e.jsxs("span",{className:"text-white/40 ml-1",children:["(",h(s.applicationDeadline),")"]})]})]})}),e.jsx("div",{className:"max-w-5xl mx-auto w-full px-4 sm:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs(A,{y:16,className:"lg:col-span-2 space-y-6",children:[s.description&&e.jsxs("section",{className:"bg-white rounded-2xl border p-6",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 mb-3",children:"About"}),e.jsx("p",{className:"text-gray-700 text-sm leading-relaxed whitespace-pre-wrap",children:s.description})]}),s.eligibilityNotes&&e.jsxs("section",{className:"bg-white rounded-2xl border p-6",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 mb-3",children:"Eligibility"}),e.jsx("p",{className:"text-gray-700 text-sm leading-relaxed whitespace-pre-wrap",children:s.eligibilityNotes})]}),(s.startsAt||s.endsAt)&&e.jsxs("section",{className:"bg-white rounded-2xl border p-6",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:"Schedule"}),e.jsxs("div",{className:"space-y-3",children:[s.startsAt&&e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx(u,{className:"h-4 w-4 text-[#0e6b99] mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wide",children:"Starts"}),e.jsx("p",{className:"text-gray-800 font-medium",children:h(s.startsAt)})]})]}),s.endsAt&&e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx(Y,{className:"h-4 w-4 text-gray-400 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wide",children:"Ends"}),e.jsx("p",{className:"text-gray-800 font-medium",children:h(s.endsAt)})]})]}),s.applicationDeadline&&e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx(S,{className:"h-4 w-4 text-red-400 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wide",children:"Application Deadline"}),e.jsx("p",{className:`font-medium ${t.expired?"text-red-500":"text-gray-800"}`,children:h(s.applicationDeadline)})]})]})]})]})]}),e.jsxs(A,{y:16,delay:80,className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-2xl border p-5 space-y-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"Organizer"}),s.organizerName?e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s.organizerName}):e.jsx("p",{className:"text-sm text-gray-400",children:"Not specified"}),s.organizerEmail&&e.jsxs("a",{href:`mailto:${s.organizerEmail}`,className:"flex items-center gap-2 text-sm text-[#0e6b99] hover:underline",children:[e.jsx(q,{className:"h-4 w-4"}),s.organizerEmail]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border p-5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[e.jsx(U,{className:"h-4 w-4 text-gray-400"}),e.jsxs("span",{children:[s.applicationCount??0," applied",s.capacity?` / ${s.capacity} capacity`:""]})]}),s.isFree?e.jsx("div",{className:"inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold bg-success-100 text-success-700",children:"Free"}):s.cost?e.jsxs("div",{className:"inline-flex items-center gap-1 rounded-full px-3 py-1 text-xs font-semibold bg-amber-100 text-amber-700",children:[e.jsx(C,{className:"h-3 w-3"}
1),s.cost.toLocaleString("en-IN")]}):null]}),!s.isVirtual&&a&&e.jsxs("div",{className:"bg-white rounded-2xl border p-5 space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"Location"}),e.jsxs("div",{className:"flex items-start gap-2 text-sm text-gray-600",children:[e.jsx(k,{className:"h-4 w-4 text-gray-400 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{children:a}),s.venue&&e.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:s.venue})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[r?e.jsxs("button",{onClick:()=>d(!0),className:"w-full py-3 px-5 rounded-xl bg-[#0e6b99] text-white text-sm font-semibold hover:bg-[#0a4d6e] transition-colors flex items-center justify-center gap-2",children:[e.jsx(z,{className:"h-4 w-4"}),"Apply Now"]}):e.jsx("div",{className:"w-full py-3 px-5 rounded-xl bg-gray-100 text-gray-400 text-sm font-medium text-center",children:p?t.text:"Applications closed"}),e.jsxs("button",{onClick:o,className:"w-full py-2.5 px-5 rounded-xl border text-gray-600 text-sm font-medium hover:bg-gray-50 transition-colors flex items-center justify-center gap-2",children:[e.jsx(_,{className:"h-4 w-4"}),"Copy Link"]})]})]})]})}),e.jsx(f,{}),i&&e.jsx(K,{slug:l,onClose:()=>d(!1),onAlreadyApplied:E})]})};export{ye as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.