1import{j as e}from"./vendor-ui-core.DP8knyZn.js";import{f as r,r as t}from"./vendor-react.BBoGJFYM.js";import{j as a,t as o,S as s,H as l,D as n,o as i,q as d,r as c,s as m}from"./index.CdjOtu-m.js";import{C as x}from"./checkbox.8aD27ZwB.js";import{u as p}from"./vendor-media.DY6E_qVO.js";import{x as b,L as g,g as u,y as f,aN as h,O as y,b as j,Z as v}from"./vendor-icons.BjAWwE8z.js";import{o as B,s as N,l as T}from"./vendor-utils.BlEnRQrd.js";import"./vendor-supabase.DS-aP8MZ.js";import"./vendor-ui-forms.CjLBxE3d.js";import"./vendor-ui-display.BT2Z6Vpo.js";import"./vendor-query.CfjDb5WU.js";import"./vendor-motion.DCvbjL6b.js";import"./vendor-charts.RWeJ_I16.js";const k={dark:{sectionBg:"linear-gradient(160deg, #15002B 0%, #2A044C 50%, #1A0235 100%)",cardBg:"rgba(255,255,255,0.04)",cardBorder:"rgba(255,255,255,0.09)",cardHoverBg:"rgba(255,255,255,0.07)",cardHoverBorder:"rgba(139,92,246,0.35)",headlineColor:"#ffffff",bodyText:"rgba(255,255,255,0.65)",mutedText:"rgba(255,255,255,0.38)",accentText:"#a78bfa",gridLine:"rgba(255,255,255,0.022)",divider:"rgba(255,255,255,0.07)",badgeBg:"rgba(139,92,246,0.18)",badgeBorder:"rgba(139,92,246,0.38)",metaBg:"rgba(255,255,255,0.06)",metaBorder:"rgba(255,255,255,0.10)",metaText:"rgba(255,255,255,0.55)",inputBg:"rgba(255,255,255,0.06)",inputBorder:"rgba(255,255,255,0.14)",inputText:"#ffffff",inputPlaceholder:"rgba(255,255,255,0.35)",dropzoneBg:"rgba(255,255,255,0.04)",dropzoneBorder:"rgba(255,255,255,0.14)",dropzoneActiveBg:"rgba(139,92,246,0.15)",dropzoneActiveBorder:"rgba(139,92,246,0.50)",btnPrimaryBg:"linear-gradient(135deg, rgba(139,92,246,0.90), rgba(109,40,217,0.90))",btnPrimaryBorder:"rgba(139,92,246,0.60)",btnOutlineBg:"rgba(255,255,255,0.05)",btnOutlineBorder:"rgba(255,255,255,0.15)",btnOutlineText:"rgba(255,255,255,0.75)",dialogBg:"linear-gradient(160deg, #1a0235 0%, #2a044c 100%)",dialogBorder:"rgba(139,92,246,0.25)",labelText:"rgba(255,255,255,0.75)",errorText:"#f87171"},light:{sectionBg:"linear-gradient(160deg, #2D0550 0%, #5B1280 50%, #3D0A6E 100%)",cardBg:"rgba(255,255,255,0.07)",cardBorder:"rgba(255,255,255,0.14)",cardHoverBg:"rgba(255,255,255,0.12)",cardHoverBorder:"rgba(167,139,250,0.50)",headlineColor:"#ffffff",bodyText:"rgba(255,255,255,0.80)",mutedText:"rgba(255,255,255,0.50)",accentText:"#c4b5fd",gridLine:"rgba(255,255,255,0.038)",divider:"rgba(255,255,255,0.14)",badgeBg:"rgba(167,139,250,0.25)",badgeBorder:"rgba(167,139,250,0.50)",metaBg:"rgba(255,255,255,0.08)",metaBorder:"rgba(255,255,255,0.18)",metaText:"rgba(255,255,255,0.65)",inputBg:"rgba(255,255,255,0.10)",inputBorder:"rgba(255,255,255,0.22)",inputText:"#ffffff",inputPlaceholder:"rgba(255,255,255,0.45)",dropzoneBg:"rgba(255,255,255,0.07)",dropzoneBorder:"rgba(255,255,255,0.20)",dropzoneActiveBg:"rgba(167,139,250,0.20)",dropzoneActiveBorder:"rgba(167,139,250,0.60)",btnPrimaryBg:"linear-gradient(135deg, rgba(167,139,250,0.95), rgba(139,92,246,0.95))",btnPrimaryBorder:"rgba(167,139,250,0.60)",btnOutlineBg:"rgba(255,255,255,0.08)",btnOutlineBorder:"rgba(255,255,255,0.22)",btnOutlineText:"rgba(255,255,255,0.85)",dialogBg:"linear-gradient(160deg, #2D0550 0%, #5B1280 100%)",dialogBorder:"rgba(167,139,250,0.30)",labelText:"rgba(255,255,255,0.80)",errorText:"#fca5a5"}},w=B({name:N().trim().min(2,"Name must be at least 2 characters").max(100),email:N().trim().email("Invalid email address").max(255),phone:N().trim().min(7,"Invalid phone number").max(20),linkedin:N().trim().url("Invalid LinkedIn URL").optional().or(T("")),consent:T(!0,{errorMap:()=>({message:"You must consent to proceed"})})});function C({value:r,onChange:t,placeholder:a,type:o="text",p:s,hasError:l}){return e.jsx("input",{type:o,value:r,onChange:e=>t(e.target.value),placeholder:a,className:"w-full px-3 py-2.5 rounded-xl text-sm outline-none transition-all duration-200",style:{background:s.inputBg,border:`1px solid ${l?s.errorText:s.inputBorder}`,color:s.inputText},onFocus:e=>{e.currentTarget.style.borderColor=l?s.errorText:"rgba(139,92,246,0.55)"},onBlur:e=>{e.currentTarget.style.borderColor=l?s.errorText:s.inputBorder}})}function S({job:r,onApply:a,onView:o,p:s}){const[l,n]=t.useState(!1);return e.jsx("div",{className:"rounded-2xl overflow-hidden transition-all duration-300",style:{background:l?s.cardHoverBg:s.cardBg,border:`1px solid ${l?s.cardHoverBorder:s.cardBorder}`,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",transform:l?"translateY(-2px)":"translateY(0)",boxShadow:l?"0 8px 32px rgba(139,92,246,0.20)":"none"},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[e.jsx("h2",{className:"text-lg font-bold leading-snug",style:{fontFamily:"'Roboto Slab', serif",color:s.headlineColor},children:r.title}),r.employment_type&&e.jsx("span",{className:"flex-shrink-0 text-xs font-semibold px-3 py-1 rounded-full capitalize",style:{background:s.badgeBg,border:`1px solid ${s.badgeBorder}`,color:s.accentText},children:r.employment_type})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-5",children:[r.location&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs px-3 py-1 rounded-lg",style:{background:s.metaBg,border:`1px solid ${s.metaBorder}`,color:s.metaText},children:[e.jsx(h,{className:"h-3 w-3"}),r.location]}),r.department&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs px-3 py-1 rounded-lg",style:{background:s.metaBg,border:`1px solid ${s.metaBorder}`,color:s.metaText},children:[e.jsx(u,{className:"h-3 w-3"}),r.department]}),r.experience_level&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs px-3 py-1 rounded-lg",style:{background:s.metaBg,border:`1px solid ${s.metaBorder}`,color:s.metaText},children:[e.jsx(y,{className:"h-3 w-3"}),r.experience_level]}),r.valid_until&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs px-3 py-1 rounded-lg",style:{background:s.metaBg,border:`1px solid ${s.metaBorder}`,color:s.metaText},children:[e.jsx(j,{className:"h-3 w-3"}),"Apply by"," ",new Date(r.valid_until).toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:o,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:s.btnOutlineBg,border:`1px solid ${s.btnOutlineBorder}`,color:s.btnOutlineText},onMouseEnter:e=>{e.currentTarget.style.borderColor="rgba(139,92,246,0.40)"},onMouseLeave:e=>{e.currentTarget.style.borderColor=s.btnOutlineBorder},children:"View Details"}),e.jsxs("button",{type:"button",onClick:a,className:"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl text-sm font-bold transition-all duration-200",style:{background:s.btnPrimaryBg,border:`1px solid ${s.btnPrimaryBorder}`,color:"#ffffff",boxShadow:"0 4px 16px rgba(139,92,246,0.25)"},children:["Apply Now ",e.jsx(v,{className:"h-4 w-4"})]})]})]})})}const _=()=>{const h=r(),{resolvedTheme:y}=a(),[j,v]=t.useState(!1),[B,N]=t.useState([]),[T,_]=t.useState(!0),[D,$]=t.useState(null),[P,A]=t.useState(!1),[z,F]=t.useState(""),[O,E]=t.useState(""),[L,I]=t.useState(""),[M,H]=t.useState(""),[R,q]=t.useState(!1),[Y,J]=t.useState(null),[V,X]=t.useState({});t.useEffect(()=>
1{v(!0);(async()=>{const{data:e,error:r}=await m.from("jobs").select("*").eq("is_active",!0).order("created_at",{ascending:!1});r||N(e||[]),_(!1)})()},[]);const U=j&&"light"===y?k.light:k.dark,W=t.useCallback(e=>{var r;const t=e[0];if(!t)return;const a=null==(r=t.name.split(".").pop())?void 0:r.toLowerCase();["pdf","docx"].includes(a||"")?t.size>10485760?o({title:"File must be under 10MB",variant:"destructive"}):(J(t),X(e=>{const r={...e};return delete r.resume,r})):o({title:"Only PDF and DOCX files are accepted",variant:"destructive"})},[]),{getRootProps:G,getInputProps:Z,isDragActive:K}=p({onDrop:W,accept:{"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"]},maxFiles:1}),Q=()=>{F(""),E(""),I(""),H(""),q(!1),J(null),X({})};return e.jsxs("div",{className:"min-h-screen flex flex-col transition-colors duration-300",style:{background:U.sectionBg},children:[e.jsx(s,{title:"Careers - SmartMentor.ai",description:"Join our team at SmartMentor.ai. Explore open positions and apply today."}),e.jsx("div",{"aria-hidden":!0,className:"fixed inset-0 pointer-events-none",style:{backgroundImage:[`linear-gradient(${U.gridLine} 1px, transparent 1px)`,`linear-gradient(90deg, ${U.gridLine} 1px, transparent 1px)`].join(", "),backgroundSize:"40px 40px",zIndex:0}}),e.jsx(l,{}),e.jsxs("main",{className:"relative z-10 flex-1 w-full max-w-4xl mx-auto px-4 sm:px-6 pt-20 pb-16",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-[0.14em] mb-4",style:{background:U.badgeBg,border:`1px solid ${U.badgeBorder}`,color:U.accentText},children:[e.jsx(b,{className:"w-3.5 h-3.5"}),"We're Hiring"]}),e.jsx("h1",{className:"text-3xl sm:text-4xl font-bold mb-3",style:{fontFamily:"'Roboto Slab', serif",color:U.headlineColor,textShadow:"0 2px 16px rgba(139,92,246,0.25)"},children:"Join Our Team"}),e.jsx("p",{className:"text-sm sm:text-base max-w-xl mx-auto",style:{color:U.bodyText},children:"Help us build the future of AI-powered interviews. Explore open positions below."})]}),T?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(g,{className:"h-8 w-8 animate-spin",style:{color:U.accentText}})}):0===B.length?e.jsxs("div",{className:"text-center py-20 rounded-2xl",style:{background:U.cardBg,border:`1px solid ${U.cardBorder}`},children:[e.jsx(u,{className:"mx-auto h-12 w-12 mb-4 opacity-30",style:{color:U.mutedText}}),e.jsx("h2",{className:"text-lg font-semibold mb-2",style:{color:U.headlineColor},children:"No open positions right now"}),e.jsx("p",{className:"text-sm",style:{color:U.mutedText},children:"Check back soon â we're growing fast!"})]}):e.jsx("div",{className:"grid grid-cols-1 gap-4",children:B.map(r=>e.jsx(S,{job:r,p:U,onView:()=>h(`/careers/${r.id}`),onApply:()=>{$(r),Q()}},r.id))})]}),e.jsx(n,{open:!!D,onOpenChange:e=>{e||($(null),Q())},children:e.jsxs(i,{className:"max-w-lg max-h-[90vh] overflow-y-auto border-0",style:{background:U.dialogBg,border:`1px solid ${U.dialogBorder}`},children:[e.jsx(d,{children:e.jsxs(c,{style:{fontFamily:"'Roboto Slab', serif",color:U.headlineColor},children:["Apply for: ",null==D?void 0:D.title]})}),e.jsxs("div",{className:"space-y-4 mt-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-semibold mb-1.5",style:{color:U.labelText},children:"Full Name *"}),e.jsx(C,{value:z,onChange:F,placeholder:"Jane Doe",p:U,hasError:!!V.name}),V.name&&e.jsx("p",{className:"text-xs mt-1",style:{color:U.errorText},children:V.name})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-semibold mb-1.5",style:{color:U.labelText},children:"Email *"}),e.jsx(C,{value:O,onChange:E,placeholder:"[email protected]",type:"email",p:U,hasError:!!V.email}),V.email&&e.jsx("p",{className:"text-xs mt-1",style:{color:U.errorText},children:V.email})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-semibold mb-1.5",style:{color:U.labelText},children:"Contact Number *"}),e.jsx(C,{value:L,onChange:I,placeholder:"+91 9876543210",type:"tel",p:U,hasError:!!V.phone}),V.phone&&e.jsx("p",{className:"text-xs mt-1",style:{color:U.errorText},children:V.phone})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-semibold mb-1.5",style:{color:U.labelText},children:"LinkedIn Profile"}),e.jsx(C,{value:M,onChange:H,placeholder:"https://linkedin.com/in/yourprofile",p:U,hasError:!!V.linkedin}),V.linkedin&&e.jsx("p",{className:"text-xs mt-1",style:{color:U.errorText},children:V.linkedin})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-semibold mb-1.5",style:{color:U.labelText},children:"Upload Resume (PDF / DOCX) *"}),e.jsxs("div",{...G(),className:"rounded-xl p-6 text-center cursor-pointer transition-all duration-200",style:{background:K?U.dropzoneActiveBg:U.dropzoneBg,border:`2px dashed ${K?U.dropzoneActiveBorder:V.resume?U.errorText:U.dropzoneBorder}`},children:[e.jsx("input",{...Z()}),e.jsx(f,{className:"mx-auto mb-2 h-5 w-5",style:{color:Y?U.accentText:U.mutedText}}),Y?e.jsx("p",{className:"text-sm font-semibold",style:{color:U.accentText},children:Y.name}):e.jsx("p",{className:"text-sm",style:{color:U.mutedText},children:K?"Drop your file hereâ¦":"Drag & drop or click to select"}),e.jsx("p",{className:"text-xs mt-1",style:{color:U.mutedText}
1,children:"PDF or DOCX · Max 10MB"})]}),V.resume&&e.jsx("p",{className:"text-xs mt-1",style:{color:U.errorText},children:V.resume})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(x,{id:"consent",checked:R,onCheckedChange:e=>{q(!0===e),e&&X(e=>{const r={...e};return delete r.consent,r})},className:"mt-0.5"}),e.jsx("label",{htmlFor:"consent",className:"text-xs leading-relaxed cursor-pointer",style:{color:U.labelText},children:"I consent to SmartMentor.ai processing my personal information for recruitment purposes. *"})]}),V.consent&&e.jsx("p",{className:"text-xs",style:{color:U.errorText},children:V.consent}),e.jsx("button",{type:"button",onClick:async()=>{const e=w.safeParse({name:z,email:O,phone:L,linkedin:M,consent:R});if(!e.success){const r={};return e.error.errors.forEach(e=>{e.path[0]&&(r[e.path[0]]=e.message)}),void X(r)}if(Y){if(D){X({}),A(!0);try{const{data:e,error:r}=await m.from("job_applications").select("id").eq("job_id",D.id).eq("candidate_email",O.trim()).eq("status","received").single();if(r&&"PGRST116"!==r.code)throw new Error("Failed to check existing application");if(e)return o({title:"Duplicate application",description:"You have already applied for this job.",variant:"destructive"}),void A(!1);const t=`${D.id}/${Date.now()}_${Y.name}`,{error:a}=await m.storage.from("career-resumes").upload(t,Y);if(a)throw new Error("Failed to upload resume");const{error:s}=await m.from("job_applications").insert({job_id:D.id,candidate_name:z.trim(),candidate_email:O.trim(),candidate_phone:L.trim(),linkedin_url:M.trim()||null,resume_path:t,resume_filename:Y.name,consent_given:!0});if(s)throw new Error("Failed to submit application");try{await m.functions.invoke("send-application-confirmation",{body:{candidate_name:z.trim(),candidate_email:O.trim(),job_title:D.title}})}catch{}
1o({title:"Application submitted!",description:"You'll receive a confirmation email shortly."}),$(null),Q()}catch(r){o({title:"Submission failed",description:r.message,variant:"destructive"})}finally{A(!1)}}}else X({resume:"Please upload your resume"})},disabled:P,className:"w-full flex items-center justify-center gap-2 py-3 rounded-xl text-sm font-bold transition-all duration-200 disabled:opacity-60",style:{background:U.btnPrimaryBg,border:`1px solid ${U.btnPrimaryBorder}`,color:"#ffffff",boxShadow:"0 4px 16px rgba(139,92,246,0.25)"},children:P?e.jsxs(e.Fragment,{children:[e.jsx(g,{className:"h-4 w-4 animate-spin"})," Submittingâ¦"]}):"Confirm & Submit Application"})]})]})})]})};export{_ 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.