1import{i as Je,d as Xe,u as Ke,r as p,j as e,m as z,L as B,A as _e}from"./vendor-DyxzB9Av.js";import{j as We,M as te,r as se,a as L,A as I,n as qe,m as et}from"./index-BqECBvsS.js";import{C as tt}from"./CustomDropdown-TQr-mr2b.js";import{S as Se}from"./SharedComponents-Cfcgg4My.js";import{u as st}from"./usePostalLookup-h4lJraa-.js";import{C as at}from"./CountryCombobox-B9SCeQfj.js";import{A as rt}from"./AddressAutocomplete-Bsul3EEK.js";import{M as it}from"./ModernErrorBanner-hx2ZuR-B.js";import{f as nt,A as Ee,aj as T,i as Ae,k as lt,e as de,K as U,v as me,aP as De,aQ as ot,aR as Re,aq as ct}from"./lucide-CFsqSJ-d.js";import"./imageUtils-CILKrD_Y.js";function Nt(){const{id:xe}=Je(),pe=Xe();Ke();const[_,Le]=p.useState(null),[Ie,O]=p.useState(!0),[V,X]=p.useState(!1),[Te,$e]=p.useState(!1),[K,Pe]=p.useState([]),[W,k]=p.useState(null),[$,S]=p.useState(null),[Y,ue]=p.useState(1),[he,fe]=p.useState(null),[be,ge]=p.useState(null),G=p.useRef(!1),ae=p.useRef(null),[y,Z]=p.useState({}),q=p.useRef(null),ye=p.useRef(null),ee=p.useRef(null),re=p.useRef(null),ie=p.useRef(null),ze=p.useRef(null),Fe=p.useRef(null),Be=p.useRef(null),Oe=p.useRef(null),ne=p.useRef(null),C=s=>{y[s]&&Z(i=>{const l={...i};return delete l[s],l})},[r,j]=p.useState({trialsInLast30Days:"",zipCode:"",address:"",streetAddress:"",city:"",state:"",country:"",firstName:"",middleName:"",lastName:"",email:"",phone:"",bestTime:"",cvConsent:!1}),[P,le]=p.useState({}),[Ye,we]=p.useState(new Set),[dt,Me]=p.useState(null);p.useEffect(()=>{W&&ae.current&&ae.current.scrollIntoView({behavior:"smooth",block:"center"})},[W]);const oe=["Are you between the ages of 18 and 65?","Do you have a documented history of the condition under study?","Are you willing to attend all scheduled clinic visits?","Are you currently taking any excluded medications?"],x=We();p.useLayoutEffect(()=>{"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual"),window.scrollTo(0,0)},[]),p.useEffect(()=>{(async()=>{O(!0);try{const i=await L(`${I}/api/public-studies/${xe}/`);if(i.ok){const l=await i.json();Le(l);const t=(l.status||"").toUpperCase();if(t==="UPCOMING"){ge("This study is upcoming and not yet open for registration."),O(!1);return}if(["COMPLETED","RECRUITMENT_COMPLETED","CLOSED_ARCHIVED","ANALYSIS_UNDERWAY","PROGRESS_REPORT_DRAFT","FINAL_REPORT_SENT"].includes(t)){ge("This study has completed recruitment and is no longer accepting new participants."),O(!1);return}if(x)try{const[f,b]=await Promise.all([L(`${I}/api/public-studies/`),L(`${I}/api/participants/`)]);if(f.ok&&b.ok){const u=await f.json(),A=Array.isArray(u)?u:u.results||[],c=await b.json(),v=Array.isArray(c)?c:c.results||[];v.find(a=>(String(a.study)===String(l.id)||a.protocol_id&&String(a.protocol_id)===String(l.protocol_id)||a.study_protocol_id&&String(a.study_protocol_id)===String(l.protocol_id))&&["CONSENTED","ENROLLED","SCREENING","SCHEDULED","ACTIVE","RANDOMIZED"].includes((a.status||"").toUpperCase()))&&(k("You are already actively enrolled or screening for this study. Please check your participant dashboard."),S("DUPLICATE"));const w=v.find(a=>{const g=A.find(R=>String(R.id)===String(a.study)||R.protocol_id&&String(R.protocol_id)===String(a.protocol_id));if(!g)return!1;const M=(g.status||"").toUpperCase();return["PAUSED","COMPLETED","CLOSED_ARCHIVED","DRAFT"].includes(M)||g.is_archived?!1:["CONSENTED","ENROLLED","SCREENING","SCHEDULED","ACTIVE","RANDOMIZED"].includes((a.status||"").toUpperCase())});if(w&&String(w.study)!==String(l.id)&&String(w.protocol_id)!==String(l.protocol_id)){const a=new Date(w.created_at||w.submitted_at),R=(new Date().getTime()-a.getTime())/(1e3*60*60*24);R<30&&fe(Math.ceil(30-R))}const D=v.filter(a=>(a.status||"").toUpperCase()==="DROPPED");for(const a of D){const g=a.updated_at||a.created_at;if(g){const M=new Date(g),Q=(new Date().getTime()-M.getTime())/(1e3*60*60*24);if(Q<10){const J=Math.ceil(10-Q),Qe=A.find(Ce=>String(Ce.id)===String(a.study)||a.study_protocol_id&&String(Ce.protocol_id)===String(a.study_protocol_id));fe(J),k(`You withdrew from the study '${Qe?.title||a.study_name||"previous study"}'. You have to wait for at least 10 days before joining another. You can join in ${J} days.`);break}}}}}catch(f){console.error("Error checking screener cooldown:",f)}
1let n={trialsInLast30Days:"",zipCode:"",address:"",streetAddress:"",city:"",state:"",country:"",firstName:"",middleName:"",lastName:"",email:"",phone:"",bestTime:"",cvConsent:!1};if(x){const b=(x.decrypted_name||x.full_name||"").trim().split(" ");n={...n,firstName:b[0]||n.firstName,lastName:b.length>1?b.slice(1).join(" "):n.lastName,email:x.email||n.email,phone:x.decrypted_phone||x.mobile_number||x.phone_number||n.phone,zipCode:x.zip_code||n.zipCode,city:x.city||n.city,state:x.state||n.state,country:x.country||n.country}}if(x&&!x.decrypted_phone&&!x.mobile_number&&!x.phone_number&&!x.zip_code)try{const f=await L(`${I}/api/contact/submissions/?limit=1`);if(f.ok){const u=(await f.json()).results?.[0];u&&(Me(u),n={...n,firstName:n.firstName||u.first_name||"",lastName:n.lastName||u.last_name||"",email:n.email||u.email||"",phone:n.phone||u.phone||"",zipCode:n.zipCode||u.zip_code||"",city:n.city||u.city||"",state:n.state||u.state||"",country:n.country||u.country||""})}}catch(f){console.error("Error loading prefilled data:",f)}j(n),Z({});const m={},o=new Set,h=l.custom_screener?.questions||l.screener_questions||[];h.length>0?(h.forEach(f=>{const b=f.id||String(f.order),u=(f.label||f.placeholder||f.question_text||"").toLowerCase();if(x)if(u.includes("age"))x.age&&(m[b]=x.age,o.add(b));else if(u.includes("gender")||u.includes("sex")){const A=x.gender;if(A)if(f.options){const c=f.options.find(v=>v.toLowerCase()===A.toLowerCase()||A.toLowerCase()==="male"&&v.toLowerCase()==="man"||A.toLowerCase()==="female"&&v.toLowerCase()==="woman");c&&(m[b]=c,o.add(b))}else m[b]=A,o.add(b)}else u.includes("country")?(m[b]=x.country||"",o.add(b)):(u.includes("reside")||u.includes("location"))&&(x.country||x.city)&&(m[b]=x.country||x.city,o.add(b))}),le(m),we(o)):(oe.forEach((f,b)=>{m[String(b)]=!1}),le(m))}else pe("/trials")}catch(i){console.error(i),pe("/trials")}finally{O(!1)}})()},[xe]);const E=(s,i,l=!1)=>{we(t=>{const d=new Set(t);return d.delete(s),d}),le(t=>{if(l){const d=Array.isArray(t[s])?t[s]:[];return d.includes(i)?{...t,[s]:d.filter(n=>n!==i)}:{...t,[s]:[...d,i]}}return{...t,[s]:i}})},{isLoading:Ue}=st({zipCode:r.zipCode,country:r.country,onSuccess:(s,i)=>{j(l=>({...l,city:s.city||l.city||"",state:s.state||l.state||"",country:i?s.country||l.country||"":l.country}))},onClear:()=>{j(s=>({...s,city:"",state:"",country:""}))}}),Ve=s=>{j(i=>({...i,zipCode:s}))},Ne=async s=>{try{if(!_)return;if(x){const[i,l]=await Promise.all([L(`${I}/api/participants/`),L(`${I}/api/contact/submissions/`)]);if(i.ok){const t=await i.json();if((Array.isArray(t)?t:t.results||[]).find(m=>(String(m.study)===String(_.id)||m.protocol_id&&String(m.protocol_id)===String(_.protocol_id)||m.study_protocol_id&&String(m.study_protocol_id)===String(_.protocol_id))&&(m.contact_email?.toLowerCase()===s||m.user_email?.toLowerCase()===s)&&["CONSENTED","ENROLLED","SCREENING","SCHEDULED","ACTIVE","RANDOMIZED"].includes((m.status||"").toUpperCase()))){k("You are already actively enrolled or screening for this study. Please check your participant dashboard."),S("DUPLICATE");return}}}else $==="DUPLICATE"&&(k(null),S(null))}catch(i){console.error("Error checking duplicate for email:",i)}},Ge=async s=>{if(!s||!s.trim())return;const i=s.trim().toLowerCase();if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i))try{const t=await L(`${I}/api/auth/check-email/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i})});t.ok&&((await t.json()).exists?x&&i===x.email.toLowerCase().trim()?await Ne(i):(k("An account with this email already exists. Please log in to your dashboard to continue."),S("EXISTS")):await Ne(i))}catch(t){console.error("Error checking email on blur:",t)}},ce=p.useRef(null),Ze=async s=>{if(s.credential){O(!0),k(null);try{const i=Intl.DateTimeFormat().resolvedOptions().timeZone,l=await L(`${I}/api/auth/google-login/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credential:s.credential,timezone:i})}),t=await l.json();if(!l.ok)throw new Error(t.error||"Google login failed");qe(t.access,t.user.role,void 0,t.refresh),et(t.user),window.location.reload()}catch(i){console.error("Google Auth Error:",i),k(i.message||"Google sign-in could not be completed. Please try again."),S("AUTH")}finally{O(!1)}}};p.useEffect(()=>{if(x)return;const i=setTimeout(()=>{window.google?.accounts?.id&&(window.google.accounts.id.initialize({client_id:"591181560891-jm09fm75b83t82f2daqpiqocfoq2899a.apps.googleusercontent.com",callback:Ze}),ce.current&&window.google.accounts.id.renderButton(ce.current,{theme:"outline",size:"large",width:320,text:"continue_with",shape:"rectangular"}))},1e3);return()=>clearTimeout(i)},[x]);const H=(s,i)=>{const l=i.trim();let t="";if(s==="firstName")l?l.length<2?t="First name must be at least 2 letters.":/^[a-zA-Z\s'\-]+$/.test(l)||(t="First name should only contain letters."):t="First name is required.";else if(s==="middleName")l&&!/^[a-zA-Z\s'\-]+$/.test(l)&&(t="Middle name should only contain letters.");else if(s==="lastName")l?l.length<2?t="Last name must be at least 2 letters.":/^[a-zA-Z\s'\-]+$/.test(l)||(t="Last name should only contain letters."):t="Last name is required.";else if(s==="email")l?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(l)||(t="Please enter a valid email address (e.g. [email protected])."):t="Email address is required.";else if(s==="phone"){const d=i.replace(/\D/g,"");l?(d.length<10||d.length>15)&&(t="Please enter a valid 10-digit phone number."):t="Phone number is required."}t?Z(d=>({...d,[s]:t})):C(s)},je=()=>{const s={};let i=null,l=null;const t=(f,b,u)=>{s[f]=b,i||(i=f,l=u)},d=r.firstName.trim();d?d.length<2?t("firstName","First name must be at least 2 letters.",q):/^[a-zA-Z\s'\-]+$/.test(d)||t("firstName","First name should only contain letters.",q):t("firstName","First name is required.",q);const n=r.middleName.trim();n&&!/^[a-zA-Z\s'\-]+$/.test(n)&&t("middleName","Middle name should only contain letters.",ye);const m=r.lastName.trim();m?m.length<2?t("lastName","Last name must be at least 2 letters.",ee):/^[a-zA-Z\s'\-]+$/.test(m)||t("lastName","Last name should only contain letters.",ee):t("lastName","Last name is required.",ee);const o=r.email.trim();o?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(o)||t("email","Please enter a valid email address (e.g. [email protected]).",re):t("email","Email address is required.",re);const h=r.phone.replace(/\D/g,"");return r.phone.trim()?(h.length<10||h.length>15)&&t("phone","Please enter a valid 10-digit phone number.",ie):t("phone","Phone number is required.",ie),Z(s),i&&l?(k(null),S(null),setTimeout(()=>{l?.current&&(l.current.scrollIntoView({behavior:"smooth",block:"center"}),typeof l.current.focus=="function"&&l.current.focus())},50),!1):!0},ve=async()=>
1{if(!(G.current||V||!je())){if(!r.cvConsent){Z(i=>({...i,cvConsent:"Please consent to being contacted by checking the confirmation box."})),k(null),S(null),setTimeout(()=>{ne.current&&ne.current.scrollIntoView({behavior:"smooth",block:"center"})},50);return}G.current=!0,X(!0),k(null),S(null);try{const i=_.screener_config?.questions||_.screener_config?.steps?.find(c=>c.type==="user_input")?.questions||oe,l=Array.isArray(i)?i.every((c,v)=>{if(typeof c=="string"||c.type==="header"||c.type==="sub_header"||c.type==="description")return!0;const N=c.id||c.key||String(v),w=P[N];return w==null?!1:c.type==="matrix"?(c.rows||[]).every(D=>w[D]!==void 0&&w[D]!==null&&w[D]!==""):Array.isArray(w)?w.length>0:w!==""}):!0,t=[];r.trialsInLast30Days==="Yes"&&t.push("Currently participating in another clinical trial (must wait 30 days)"),Array.isArray(i)&&i.forEach((c,v)=>{const N=c.id||c.key||String(v),w=P[N],D=typeof c=="string"?c:c.label||c.placeholder;typeof c=="string"?w!==!0&&w!=="Yes"&&t.push(c):c.required_value&&w!==c.required_value&&t.push(c.rejection_reason||D)});const d=t.length>0?"INELIGIBLE":l?"ELIGIBLE":"MAYBE";Pe(t);const n=Array.isArray(i)?i.map((c,v)=>{const N=c.id||c.key||String(v);return{text:typeof c=="string"?c:c?.label||"Untitled Question",value:P[N]}}):[],m=await L(`${I}/api/contact/submit/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:`${r.firstName} ${r.lastName}`.trim(),email:r.email,phone:r.phone,study_id:_.id,inquiry_type_slug:"screening",metadata:{outcome:d,rejection_reasons:t,answers:P,formData:{...r,checklist_results:n}}})});if(!m.ok){const c=await m.json();if(c.error==="EXISTS"){k(c.detail),S("EXISTS"),X(!1),G.current=!1;return}if(c.error==="DUPLICATE"||m.status===409){k(x?"You have already submitted a screener for this study. If you don't see it in your dashboard, it may still be under review.":"This email has already been used to submit a screener for this study. Please log in to your account to view status."),S("DUPLICATE"),X(!1),G.current=!1;return}throw new Error(c.detail||c.error||"Submission failed")}const o=c=>{if(!Array.isArray(i))return null;const v=i.findIndex(N=>(typeof N=="string"?N:N.label||N.placeholder||"").toLowerCase().includes(c));if(v!==-1){const N=i[v],w=N.id||N.key||String(v);return P[w]}return null},h=o("age"),f=o("birth")||o("year"),b=o("gender")||o("sex")||"",u=o("origin")||o("birth country")||o("country of birth")||r.country||"",A={fullName:`${r.firstName} ${r.lastName}`.trim(),firstName:r.firstName,middleName:r.middleName,lastName:r.lastName,zipCode:r.zipCode,zip_code:r.zipCode,phone:r.phone,mobile_number:r.phone,location:r.city?`${r.city}, ${r.state||""}, ${r.country||""}`.replace(/,\s*,/g,",").trim():"",full_address:r.city?`${r.city}, ${r.state||""}, ${r.country||""}`.replace(/,\s*,/g,",").trim():"",city:r.city,state:r.state,country:r.country,place_of_origin:u,gender:b,age:h,birthYear:f,birth_year:f};localStorage.setItem("screener_prefill",JSON.stringify(A)),$e(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(i){k(i.message||"Submission failed. Please try again."),S("GENERAL")}finally{X(!1),G.current=!1}}};if(Ie||!_)return e.jsx("div",{className:"min-h-screen bg-transparent pt-40 pb-24 px-6 flex flex-col items-center",children:e.jsxs("div",{className:"w-full max-w-2xl space-y-6",children:[e.jsx(Se,{className:"h-[200px] w-full rounded-3xl bg-white/5"}),e.jsx(Se,{className:"h-[300px] w-full rounded-3xl bg-white/5"})]})});if(Te)return e.jsxs("div",{className:"min-h-screen bg-transparent pt-28 sm:pt-32 md:pt-36 pb-10 sm:pb-24 px-4 sm:px-6 font-sans text-white relative overflow-hidden flex items-center justify-center",children:[e.jsx(te,{}),e.jsx(se,{}),e.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full max-w-lg bg-slate-900/80 backdrop-blur-2xl border border-white/10 rounded-2xl sm:rounded-3xl p-4 sm:p-8 md:p-10 text-center space-y-4 sm:space-y-8 shadow-2xl relative z-10",children:[e.jsx("div",{className:"w-14 h-14 sm:w-20 sm:h-20 bg-cyan-500/10 border border-cyan-500/20 rounded-full flex items-center justify-center mx-auto text-cyan-400",children:e.jsx(nt,{className:"w-7 h-7 sm:w-10 sm:h-10"})}),e.jsxs("div",{className:"space-y-2 sm:space-y-4",children:[e.jsx("h2",{className:"text-xl sm:text-3xl font-black text-white uppercase tracking-tight",children:K.length>0?"Eligibility Update":"Form Submitted"}),e.jsx("p",{className:"text-xs sm:text-base text-slate-300 leading-relaxed font-medium",children:K.length>0?e.jsxs(e.Fragment,{children:["Thank you for your interest in the ",e.jsx("span",{className:"text-white font-bold",children:_.title}),". Based on your responses, you do not currently meet all the inclusion criteria for this specific study."]}):e.jsxs(e.Fragment,{children:["Thank you for your interest in the ",e.jsx("span",{className:"text-white font-bold",children:_.title}),". Our team will review your information and reach out to you shortly."]})})]}),K.length>0&&e.jsxs("div",{className:"p-3.5 sm:p-6 bg-amber-500/5 border border-amber-500/10 rounded-xl sm:rounded-3xl space-y-2.5 sm:space-y-4 text-left",children:[e.jsx("h4",{className:"text-[10px] sm:text-[11px] font-black text-amber-500 uppercase tracking-widest",children:"Requirements not met:"}),e.jsx("ul",{className:"space-y-1.5 sm:space-y-2",children:K.map((s,i)=>e.jsxs("li",{className:"flex gap-2 text-xs sm:text-sm text-slate-300",children:[e.jsx("span",{className:"text-amber-500",children:"â¢"}),s]},i))}),e.jsx("p",{className:"pt-1 sm:pt-2 text-[10px] sm:text-[11px] text-slate-500 italic",children:"Note: You may still qualify for other ongoing or future studies. We will keep your profile active for relevant opportunities."})]}),e.jsxs("div",{className:"pt-3 sm:pt-6 flex flex-col gap-3 sm:gap-6",children:[x?e.jsxs("div",{className:"space-y-3 sm:space-y-6",children:[e.jsx("p",{className:"text-slate-400 text-xs sm:text-sm font-medium",children:"Since you're already logged in, you can track y
1our application status directly in your portal."}),e.jsxs(B,{to:"/dashboard/participant",className:"w-full inline-flex items-center justify-center gap-2.5 px-6 py-2.5 sm:py-4 h-[42px] sm:h-[50px] bg-white text-black rounded-xl font-black text-xs uppercase tracking-widest hover:bg-blue-500 hover:text-white transition-all shadow-xl group",children:["Go to My Dashboard ",e.jsx(Ee,{className:"w-4 h-4 group-hover:translate-x-1 transition-transform"})]})]}):e.jsxs("div",{className:"space-y-3 sm:space-y-6",children:[e.jsxs("div",{className:"p-3.5 sm:p-6 bg-white/5 border border-white/10 rounded-xl sm:rounded-2xl space-y-2 sm:space-y-4",children:[e.jsx("h4",{className:"text-[10px] sm:text-[11px] font-black text-emerald-400 uppercase tracking-widest",children:"Next Step: Account Creation"}),e.jsx("p",{className:"text-slate-400 text-xs sm:text-sm font-medium leading-relaxed text-left",children:"To view your results and track your application progress for this study, please create an account or sign in to your existing one."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:gap-4",children:[e.jsxs(B,{to:"/signin",state:{initialMode:"REGISTER",email:r.email,name:`${r.firstName} ${r.lastName}`.trim(),phone:r.phone},className:"flex-1 inline-flex items-center justify-center gap-1.5 px-2 sm:px-6 py-2.5 sm:py-4 h-[40px] sm:h-[50px] bg-emerald-500 text-white rounded-xl font-black text-[10px] sm:text-xs uppercase tracking-widest hover:bg-emerald-600 transition-all shadow-xl group",children:["Create Account ",e.jsx(Ee,{className:"w-3.5 h-3.5 group-hover:translate-x-1 transition-transform hidden sm:inline"})]}),e.jsx(B,{to:"/signin",state:{initialMode:"LOGIN",email:r.email},className:"flex-1 inline-flex items-center justify-center gap-1.5 px-2 sm:px-6 py-2.5 sm:py-4 h-[40px] sm:h-[50px] bg-[#262626] text-white border border-white/10 rounded-xl font-black text-[10px] sm:text-xs uppercase tracking-widest hover:bg-white/10 transition-all",children:"Sign In"})]})]}),e.jsx(B,{to:"/trials",className:"inline-flex items-center justify-center gap-2 text-[10px] font-black text-slate-500 uppercase tracking-widest hover:text-white transition-all mt-1 sm:mt-4",children:"â Back to all Clinical Trials"})]})]})]});if(be!==null)return e.jsxs("div",{className:"min-h-screen bg-transparent pt-32 pb-24 px-6 font-sans text-white relative overflow-hidden flex items-center justify-center",children:[e.jsx(te,{}),e.jsx(se,{}),e.jsx("div",{className:"max-w-xl w-full mx-auto relative z-10",children:e.jsxs(z.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-[#0f172a]/80 backdrop-blur-3xl rounded-[3rem] border border-white/10 p-10 md:p-12 text-center space-y-8 shadow-[0_50px_100px_-20px_rgba(0,0,0,0.8)]",children:[e.jsx("div",{className:"w-20 h-20 bg-rose-500/10 border border-rose-500/20 rounded-[2rem] flex items-center justify-center mx-auto text-rose-500",children:e.jsx(T,{className:"w-10 h-10 animate-pulse"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-black text-white uppercase italic tracking-tighter",children:"Registration Unavailable"}),e.jsx("p",{className:"text-[13px] text-slate-400 font-bold uppercase tracking-widest leading-relaxed",children:be})]}),e.jsx("div",{className:"pt-6",children:e.jsx(B,{to:"/trials",className:"inline-flex items-center justify-center px-8 py-4 bg-[#00ADEF] text-white rounded-full font-black text-xs uppercase tracking-widest hover:bg-white hover:text-[#00ADEF] transition-all shadow-lg",children:"Return to Discover"})})]})})]});if(he!==null)return e.jsxs("div",{className:"min-h-screen bg-transparent pt-32 pb-24 px-6 font-sans text-white relative overflow-hidden flex items-center justify-center",children:[e.jsx(te,{}),e.jsx(se,{}),e.jsx("div",{className:"max-w-xl w-full mx-auto relative z-10",children:e.jsxs(z.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-[#0f172a]/80 backdrop-blur-3xl rounded-[3rem] border border-white/10 p-10 md:p-12 text-center space-y-8 shadow-[0_50px_100px_-20px_rgba(0,0,0,0.8)]",children:[e.jsx("div",{className:"w-20 h-20 bg-rose-500/10 border border-rose-500/20 rounded-[2rem] flex items-center justify-center mx-auto text-rose-500",children:e.jsx(Ae,{className:"w-10 h-10 animate-pulse"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-3xl font-black text-white uppercase italic tracking-tighter",children:"Cool Down Active"}),e.jsx("p",{className:"text-[13px] text-slate-400 font-bold uppercase tracking-widest leading-relaxed",children:"Please try after 30 days. You are currently enrolled or consented
1in an active protocol and must wait for the 30-day cool down period to complete."}),e.jsx("div",{className:"mt-4 px-6 py-2.5 bg-slate-900/60 border border-white/5 rounded-2xl inline-block",children:e.jsxs("span",{className:"text-cyan-400 font-black text-[12px] uppercase tracking-[0.2em]",children:[he," Days Remaining"]})})]}),e.jsx("div",{className:"pt-6",children:e.jsx(B,{to:"/trials",className:"inline-flex items-center justify-center px-8 py-4 bg-[#00ADEF] text-white rounded-full font-black text-xs uppercase tracking-widest hover:bg-white hover:text-[#00ADEF] transition-all shadow-lg",children:"Return to Discover"})})]})})]});const F=_?.screener_config?.questions||_?.screener_config?.steps?.find(s=>s.type==="user_input")?.questions||oe,He=F?.some(s=>(typeof s=="string"?s:s.label||s.placeholder||s.question_text||"").toLowerCase().includes("true for you"))||!1;return e.jsxs("div",{className:"min-h-screen bg-transparent pt-28 sm:pt-32 md:pt-36 pb-16 sm:pb-24 px-3 sm:px-6 font-sans text-white relative overflow-hidden",children:[e.jsx(te,{}),e.jsx(se,{}),e.jsx("div",{className:"max-w-4xl mx-auto space-y-6 sm:space-y-10 relative z-10",children:e.jsxs(z.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"space-y-6 sm:space-y-10",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-[10px] sm:text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:["MusB Research ⢠Step ",Y," of 2"]}),Y===2&&e.jsxs("button",{onClick:()=>ue(1),className:"text-[10px] sm:text-xs font-bold text-cyan-400 uppercase tracking-wider hover:text-white transition-all flex items-center gap-1.5",children:[e.jsx(lt,{className:"w-3.5 h-3.5"})," Back to Step 1"]})]}),e.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-white tracking-tight uppercase",children:Y===1?"Check your eligibility":_.title||"Eligibility screening"}),e.jsx("p",{className:"text-slate-400 text-xs sm:text-sm font-normal leading-relaxed",children:Y===1?"Start by providing your basic information and recent trial history.":"Please answer the following questions to see if you qualify for this study."})]}),e.jsx(_e,{mode:"wait",children:W&&e.jsx("div",{ref:ae,className:"mb-6",children:e.jsx(it,{error:W,errorType:$,onDismiss:()=>{k(null),S(null)},emailForSignIn:r.email})})}),Y===1&&e.jsxs(z.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-6 sm:space-y-8",children:[e.jsxs("div",{className:"bg-transparent sm:bg-slate-900/40 sm:backdrop-blur-xl border-b sm:border border-white/10 rounded-xl sm:rounded-2xl p-3 sm:p-6 md:p-8 space-y-3 sm:space-y-6 shadow-none sm:shadow-xl text-left",children:[e.jsx("h3",{className:"text-xs sm:text-sm font-black text-[#00ADEF] uppercase tracking-wider italic",children:"Your Contact Information"}),!x&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3 items-center",children:[e.jsx("div",{ref:ce,className:"flex-1 w-full"}),e.jsxs("div",{className:"hidden sm:flex flex-col items-center gap-1 px-4 py-2 border border-white/10 rounded-xl bg-white/5 text-center shrink-0",children:[e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:"Already enrolled?"}),e.jsx(B,{to:"/signin",className:"text-xs font-bold text-white hover:text-cyan-400 transition-all",children:"Sign in"})]})]}),e.jsxs("div",{className:"relative flex items-center justify-center my-2",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-white/10"})}),e.jsx("span",{className:"relative bg-slate-900 px-3 text-[9px] font-black text-slate-400 uppercase tracking-wider backdrop-blur-sm rounded-md",children:"or fill in manually"})]})]}),e.jsxs("div",{className:"space-y-2.5 sm:space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-1.5 sm:gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"First name"}),e.jsx("input",{ref:q,type:"text",value:r.firstName,onChange:s=>{j({...r,firstName:s.target.value.replace(/\d/g,"")}),C("firstName")},onBlur:s=>H("firstName",s.target.value),className:`w-full bg-slate-900/80 sm:bg-white/5 border rounded-lg sm:rounded-xl px-2.5 py-1.5
1sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm outline-none transition-all text-white placeholder:text-slate-600 ${y.firstName?"border-rose-500 bg-rose-500/10 focus:border-rose-400":"border-white/10 focus:border-cyan-500"}`,placeholder:"Jane"}),y.firstName&&e.jsxs("p",{className:"text-[9px] font-semibold text-rose-400 mt-0.5 flex items-center gap-0.5",children:[e.jsx(T,{className:"w-2.5 h-2.5 text-rose-400 shrink-0"}),y.firstName]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"Middle"}),e.jsx("input",{ref:ye,type:"text",value:r.middleName,onChange:s=>{j({...r,middleName:s.target.value.replace(/\d/g,"")}),C("middleName")},onBlur:s=>H("middleName",s.target.value),className:`w-full bg-slate-900/80 sm:bg-white/5 border rounded-lg sm:rounded-xl px-2.5 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm outline-none transition-all text-white placeholder:text-slate-600 ${y.middleName?"border-rose-500 bg-rose-500/10 focus:border-rose-400":"border-white/10 focus:border-cyan-500"}`,placeholder:"A."}),y.middleName&&e.jsxs("p",{className:"text-[9px] font-semibold text-rose-400 mt-0.5 flex items-center gap-0.5",children:[e.jsx(T,{className:"w-2.5 h-2.5 text-rose-400 shrink-0"}),y.middleName]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"Last name"}),e.jsx("input",{ref:ee,type:"text",value:r.lastName,onChange:s=>{j({...r,lastName:s.target.value.replace(/\d/g,"")}),C("lastName")},onBlur:s=>H("lastName",s.target.value),className:`w-full bg-slate-900/80 sm:bg-white/5 border rounded-lg sm:rounded-xl px-2.5 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm outline-none transition-all text-white placeholder:text-slate-600 ${y.lastName?"border-rose-500 bg-rose-500/10 focus:border-rose-400":"border-white/10 focus:border-cyan-500"}`,placeholder:"Smith"}),y.lastName&&e.jsxs("p",{className:"text-[9px] font-semibold text-rose-400 mt-0.5 flex items-center gap-0.5",children:[e.jsx(T,{className:"w-2.5 h-2.5 text-rose-400 shrink-0"}),y.lastName]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"Email address"}),e.jsx("input",{ref:re,type:"email",value:r.email,onChange:s=>{j({...r,email:s.target.value}),C("email"),($==="EXISTS"||$==="DUPLICATE")&&(k(null),S(null))},onBlur:s=>{H("email",s.target.value),Ge(s.target.value)},className:`w-full bg-slate-900/80 sm:bg-white/5 border rounded-lg sm:rounded-xl px-2.5 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm outline-none transition-all text-white placeholder:text-slate-600 ${y.email?"border-rose-500 bg-rose-500/10 focus:border-rose-400":"border-white/10 focus:border-cyan-500"}`,placeholder:"[email protected]"}),y.email&&e.jsxs("p",{className:"text-[9px] font-semibold text-rose-400 mt-0.5 flex items-center gap-0.5",children:[e.jsx(T,{className:"w-2.5 h-2.5 text-rose-400 shrink-0"}),y.email]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-4 items-end",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"h-4 flex items-end",children:e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300 whitespace-nowrap",children:"Phone number"})}),e.jsx("input",{ref:ie,type:"tel",name:"phone",value:r.phone,onChange:s=>{j(i=>({...i,phone:s.target.value.replace(/\D/g,"")})),C("phone")},onBlur:s=>H("phone",s.target.value),className:`w-full bg-slate-900/80 sm:bg-white/5 border rounded-lg sm:rounded-xl px-2.5 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm outline-none transition-all text-white placeholder:text-slate-600 ${y.phone?"border-rose-500 bg-rose-500/10 focus:border-rose-400":"border-white/10 focus:border-cyan-500"}`,placeholder:"Phone number"}),y.phone&&e.jsxs("p",{className:"text-[9px] font-semibold text-rose-400 mt-0.5 flex items-center gap-0.5",children:[e.jsx(T,{className:"w-2.5 h-2.5 text-rose-400 shrink-0"}),y.phone]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"h-4 flex items-end",children:e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300 truncate",children:"Best time to reach you"})}),e.jsxs("select",{value:r.bestTime,onChange:s=>j({...r,bestTime:s.target.value}),className:"w-full bg-slate-900 border border-white/10 rounded-lg sm:rounded-xl px-2 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm focus:border-cyan-500 outline-none transition-all text-white truncate",children:[e.jsx("option",{value:"",children:"Select a preference"}),e.jsx("option",{value:"MORNING",children:"Morning (8am-12pm)"}),e.jsx("option",{value:"AFTERNOON",children:"Afternoon (12pm-5pm)"}),e.jsx("option",{value:"EVENING",children:"Evening (5pm-8pm)"})]})]})]})]})]}),e.jsxs("div",{className:"bg-transparent sm:bg-slate-900/40 sm:backdrop-blur-xl border-b sm:border border-white/10 rounded-xl sm:rounded-2xl p-3 sm:p-6 md:p-8 space-y-3 sm:space-y-5 shadow-none sm:shadow-xl text-left",children:[e.jsx("h3",{className:"text-xs sm:text-sm font-black text-[#00ADEF] uppercase tracking-wider italic",children:"Your Location"}),e.jsxs("div",{className:"space-y-2.5 sm:space-y-4",children:[e.jsx("div",{children:e.jsx(rt,{label:"Street Address",value:r.address||r.streetAddress||"",onChange:s=>{j(i=>
1({...i,address:s,streetAddress:s})),C("address")},onAddressSelect:s=>{j(i=>({...i,address:s.streetAddress,streetAddress:s.streetAddress,city:s.city||i.city,state:s.state||i.state,zipCode:s.zipCode||i.zipCode,country:s.country||i.country})),C("address"),C("city"),C("state"),C("zipCode"),C("country")},placeholder:"Start typing street address (e.g. 68325 Marcellus Ave)...",variant:"dark"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-4",children:[e.jsxs("div",{ref:ze,className:"space-y-1 min-w-0",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"Country"}),e.jsx(at,{value:r.country,onChange:s=>{j({...r,country:s}),C("country")},variant:"dark",className:"w-full"}),y.country&&e.jsxs("p",{className:"text-[9px] font-semibold text-rose-400 mt-0.5 flex items-center gap-0.5",children:[e.jsx(T,{className:"w-2.5 h-2.5 text-rose-400 shrink-0"}),y.country]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"Postal / ZIP code"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:Fe,type:"text",value:r.zipCode,autoComplete:"postal-code",inputMode:"numeric",onChange:s=>{const i=s.target.value.replace(/[^a-zA-Z0-9]/g,"").toUpperCase().slice(0,10);Ve(i),C("zipCode"),localStorage.setItem("musb_screener_contact",JSON.stringify({...r,zipCode:i}))},className:`w-full bg-slate-900/80 sm:bg-white/5 border rounded-lg sm:rounded-xl px-2.5 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm outline-none transition-all pr-8 text-white placeholder:text-slate-600 ${y.zipCode?"border-rose-500 bg-rose-500/10 focus:border-rose-400":"border-white/10 focus:border-cyan-500"}`,placeholder:"ZIP Code"}),Ue&&e.jsx("div",{className:"absolute right-2.5 top-1/2 -translate-y-1/2",children:e.jsx(de,{className:"w-3.5 h-3.5 text-cyan-400 animate-spin"})})]}),y.zipCode&&e.jsxs("p",{className:"text-[9px] font-semibold text-rose-400 mt-0.5 flex items-center gap-0.5",children:[e.jsx(T,{className:"w-2.5 h-2.5 text-rose-400 shrink-0"}),y.zipCode]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"City"}),e.jsx("input",{ref:Be,type:"text",value:r.city,onChange:s=>{j({...r,city:s.target.value}),C("city")},className:"w-full bg-slate-900/80 sm:bg-white/5 border border-white/10 rounded-lg sm:rounded-xl px-2.5 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm focus:border-cyan-500 outline-none transition-all text-white placeholder:text-slate-600",placeholder:"City"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-[9px] sm:text-[11px] font-bold text-slate-300",children:"State"}),e.jsx("input",{ref:Oe,type:"text",value:r.state,onChange:s=>{j({...r,state:s.target.value}),C("state")},className:"w-full bg-slate-900/80 sm:bg-white/5 border border-white/10 rounded-lg sm:rounded-xl px-2.5 py-1.5 sm:px-3.5 sm:py-2.5 h-[34px] sm:h-[44px] text-xs sm:text-sm focus:border-cyan-500 outline-none transition-all text-white placeholder:text-slate-600",placeholder:"State"})]})]})]}),e.jsx("p",{className:"text-[9px] sm:text-[11px] text-slate-400 font-normal italic",children:"Street address, city, state, zip code & country fill automatically via Google Places Autocomplete."})]}),e.jsxs("div",{className:"bg-transparent sm:bg-slate-900/40 sm:backdrop-blur-xl border-b sm:border border-white/10 rounded-xl sm:rounded-2xl p-3 sm:p-6 md:p-8 space-y-3 sm:space-y-5 shadow-none sm:shadow-xl text-left",children:[e.jsx("h3",{className:"text-xs sm:text-sm font-black text-[#00ADEF] uppercase tracking-wider italic",children:"Recent Trial Participation"}),e.jsx("p",{className:"text-[11px] sm:text-sm font-bold text-white leading-tight",children:"Have you participated in a clinical trial in the past 30 days?"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-4",children:[e.jsx("button",{type:"button",onClick:()=>{j({...r,trialsInLast30Days:"Yes"}),k(null)},className:`py-2 sm:py-3.5 h-[36px] sm:h-[44px] rounded-lg sm:rounded-xl text-xs sm:text-sm font-black uppercase tracking-wide transition-all border flex items-center justify-center ${r.trialsInLast30Days==="Yes"?"bg-cyan-500 text-slate-900 border-cyan-500 shadow-md":"bg-slate-900/80 sm:bg-white/5 text-white border-white/10 hover:border-white/30"}`,children:"Yes"}),e.jsx("button",{type:"button",onClick:()=>{je()&&(j({...r,trialsInLast30Days:"No"}),ue(2),window.scrollTo({top:0,behavior:"smooth"}))},className:`py-2 sm:py-3.5 h-[36px] sm:h-[44px] rounded-lg sm:rounded-xl text-xs sm:text-sm font-black uppercase tracking-wide transition-all border flex items-center justify-center ${r.trialsInLast30Days==="No"?"bg-cyan-500 text-slate-900 border-cyan-500 shadow-md":"bg-slate-900/80 sm:bg-white/5 text-white border-white/10 hover:border-white/30"}`,children:"No"})]}),e.jsx(_e,{children:r.trialsInLast30Days==="Yes"&&e.jsx(z.div,{initial:{opacity:0,height:0}
1,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden mt-3",children:e.jsxs("div",{className:"p-3.5 sm:p-4 bg-amber-500/10 border border-amber-500/20 rounded-xl flex items-start gap-3",children:[e.jsx(Ae,{className:"w-4 h-4 text-amber-500 shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-amber-200/90 leading-relaxed font-normal",children:"Most studies require a 30-day washout period between trials. You can still proceed, but our team will need to confirm your last dose date."})]})})})]}),r.trialsInLast30Days==="Yes"&&e.jsxs(z.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-4",children:[e.jsxs("div",{className:"pt-2",children:[e.jsxs("label",{ref:ne,className:`flex items-start gap-3 p-3.5 sm:p-4 rounded-xl border text-left cursor-pointer transition-all duration-200 active:scale-[0.99] w-full ${y.cvConsent?"bg-rose-500/10 border-rose-500/80 shadow-[0_0_15px_rgba(244,63,94,0.2)] text-white":r.cvConsent?"bg-indigo-950/30 border-indigo-500/80 shadow-[0_0_20px_rgba(99,102,241,0.15)] text-white":"bg-indigo-950/10 border-indigo-500/20 hover:border-indigo-500/40 hover:bg-indigo-950/20 text-slate-300"}`,children:[e.jsxs("div",{className:"relative flex items-center justify-center shrink-0 mt-0.5",children:[e.jsx("input",{type:"checkbox",checked:r.cvConsent,onChange:s=>{j({...r,cvConsent:s.target.checked}),C("cvConsent")},className:"peer absolute opacity-0 w-6 h-6 cursor-pointer"}),e.jsx("div",{className:`w-5 h-5 rounded-md border-2 flex items-center justify-center transition-all duration-200 ${r.cvConsent?"bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.3)]":"border-indigo-500/40"}`,children:r.cvConsent&&e.jsx(U,{className:"w-3.5 h-3.5 text-white stroke-[3]"})})]}),e.jsxs("div",{className:"flex-grow space-y-1",children:[e.jsx("span",{className:"text-xs sm:text-sm font-semibold leading-snug block",children:"I confirm that the information provided is accurate and I consent to being contacted by MusB Research."}),e.jsxs("span",{className:"text-[10px] text-indigo-400 font-bold uppercase tracking-wider flex items-center gap-1 opacity-90",children:[e.jsx(me,{size:12,className:"text-indigo-400"}),"Required Consent for Verification"]})]})]}),y.cvConsent&&e.jsxs("p",{className:"text-[11px] font-semibold text-rose-400 mt-1.5 flex items-center gap-1",children:[e.jsx(T,{className:"w-3.5 h-3.5 text-rose-400 shrink-0"}),y.cvConsent]})]}),e.jsx("button",{type:"button",onClick:ve,disabled:V||$==="EXISTS"||$==="DUPLICATE",className:"w-full bg-cyan-500 text-slate-900 py-3 sm:py-3.5 rounded-xl font-bold text-xs sm:text-sm uppercase tracking-wider hover:bg-white hover:-translate-y-0.5 transition-all shadow-lg disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:V?e.jsx(de,{className:"w-4 h-4 animate-spin"}):"Submit my information"})]})]}),Y===2&&e.jsx(z.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-4 sm:space-y-10",children:e.jsxs("div",{className:"bg-transparent sm:bg-white/5 sm:backdrop-blur-xl border-b sm:border border-white/10 rounded-xl sm:rounded-2xl p-2.5 sm:p-6 md:p-8 space-y-3 sm:space-y-8 shadow-none sm:shadow-xl text-left",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-1 sm:gap-2 border-b border-white/5 pb-2 sm:pb-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("h3",{className:"text-xs sm:text-sm font-black text-slate-500 uppercase tracking-[0.2em]",children:"Eligibility Questionnaire"}),!He&&e.jsx("p",{className:"text-[10px] sm:text-xs text-slate-400 font-semibold",children:"Check if these are true for you:"})]}),e.jsx("span",{className:"text-[9px] sm:text-[10px] font-bold text-[#e0e0e0]/40 uppercase tracking-widest sm:text-right shrink-0",children:"Select all that apply to you"})]}),(()=>{const s=F.filter(t=>{if(typeof t=="string")return!0;const d=t.type||"yesno";return d==="yesno"||d==="boolean"||d==="checkbox"}),i=F.filter(t=>{if(typeof t=="string")return!1;const d=t.type||"yesno";return d!=="yesno"&&d!=="boolean"&&d!=="checkbox"&&d!=="header"&&d!=="sub_header"}),l=F.some(t=>typeof t!="string"&&(t.type==="header"||t.type==="sub_header"));
1return e.jsxs("div",{className:"space-y-4 sm:space-y-8",children:[s.length>0&&e.jsx("div",{className:"flex flex-col gap-1.5 sm:gap-3",children:s.map((t,d)=>{const n=t.id||t.key||String(F.indexOf(t)),m=typeof t=="string"?t:t.label||t.placeholder||t.question_text||"",o=P[n]===!0||P[n]==="Yes";return e.jsxs("button",{type:"button",onClick:()=>{E(n,!o,!1)},className:`flex items-center gap-2.5 p-2.5 sm:p-4 rounded-lg sm:rounded-xl border text-left transition-all duration-200 active:scale-[0.99] w-full ${o?"bg-[#131B2D]/90 border-cyan-500/50 shadow-[0_0_20px_rgba(6,182,212,0.08)]":"bg-[#131B2D]/40 border-white/8 hover:border-white/20 hover:bg-[#131B2D]/60"}`,children:[e.jsx("div",{className:`w-4 h-4 rounded-md border-2 flex items-center justify-center shrink-0 transition-all duration-200 ${o?"bg-cyan-500 border-cyan-500 shadow-[0_0_10px_rgba(6,182,212,0.2)]":"border-white/20"}`,children:o&&e.jsx(U,{className:"w-2.5 h-2.5 text-slate-900 stroke-[3]"})}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:`text-xs sm:text-[13px] font-semibold leading-snug ${o?"text-white":"text-slate-300"}`,children:m}),t.note&&e.jsx("span",{className:"text-[10px] text-slate-500 font-medium leading-relaxed italic",children:t.note})]})]},n)})}),(i.length>0||l)&&e.jsx("div",{className:"space-y-3 sm:space-y-6",children:F.filter(t=>{if(typeof t=="string")return!1;const d=t.type||"yesno";return d!=="yesno"&&d!=="boolean"&&d!=="checkbox"}).map((t,d)=>{const n=t.id||t.key||String(F.indexOf(t)),m=typeof t=="string"?t:t.label||t.placeholder||t.question_text||"",o=t.type||"yesno",h=P[n],f=Ye.has(n);if(o==="header")return e.jsx("div",{className:"pt-4 pb-1.5 border-b border-white/10",children:e.jsx("h4",{className:"text-[11px] sm:text-xs font-black text-white uppercase tracking-[0.2em]",children:m})},n);if(o==="sub_header")return e.jsx("div",{className:"pt-3 pb-1 border-b border-white/5",children:e.jsx("h5",{className:"text-[10px] sm:text-xs font-bold text-slate-350 uppercase tracking-widest",children:m})},n);if(o==="description")return e.jsx("div",{className:"p-3 bg-white/5 border border-white/10 rounded-xl",children:e.jsx("p",{className:"text-[11px] text-slate-400 font-medium leading-relaxed",children:m})},n);const b=t.options||["Yes","No"],u=o==="multiple_choice"||t.allow_multiple,c=(u||["choice","radio","likert","dropdown","yesno","boolean"].includes(o))&&b.length===2&&b.every(a=>(a||"").length<=14),v=a=>{const g=Array.isArray(h)?h.includes(a):h===a;return e.jsxs("button",{type:"button",onClick:()=>E(n,a,u),className:`flex items-center justify-center sm:justify-start gap-1.5 px-3 py-1.5 sm:py-2 h-[34px] sm:h-[40px] rounded-lg sm:rounded-xl border text-center sm:text-left transition-all duration-200 active:scale-[0.97] w-full sm:w-auto ${g?"bg-[#131B2D]/90 border-cyan-500/50 font-bold text-white shadow-md":"bg-[#131B2D]/50 border-white/5 hover:border-white/15 font-bold text-slate-300"}`,children:[e.jsx("span",{className:`w-3.5 h-3.5 ${u?"rounded-md":"rounded-full"} border-2 flex items-center justify-center shrink-0 ${g?"bg-cyan-500 border-cyan-500":"border-white/20"}`,children:g&&(u?e.jsx(U,{className:"w-2 h-2 text-slate-900 stroke-[3]"}):e.jsx("span",{className:"w-1.5 h-1.5 bg-slate-900 rounded-full"}))}),e.jsx("span",{className:"text-[11px] sm:text-[13px] font-bold",children:a})]},a)},N=n==="demo_dob"||n==="dob"||m&&m.toLowerCase().includes("date of birth"),w=N?"Year of Birth":m,D=N?"Age will be calculated automatically from your year of birth.":t.note;return e.jsxs("div",{className:"p-2.5 sm:p-4 rounded-lg sm:rounded-2xl bg-white/[0.03] border border-white/10 space-y-2 sm:space-y-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-2 sm:gap-4",children:[e.jsxs("div",{className:"flex-1 space-y-0.5 min-w-0",children:[e.jsx("p",{className:"text-[11px] sm:text-sm font-bold text-white leading-snug",children:w}),D&&e.jsx("p",{className:"text-[10px] sm:text-xs text-slate-400 font-medium leading-relaxed italic",children:D}),f&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-black text-cyan-400 uppercase tracking-widest mt-0.5",children:[e.jsx(U,{className:"w-2.5 h-2.5"})," Auto-filled from profile"]})]}),c&&e.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:flex sm:gap-2 shrink-0 pt-0.5 sm:pt-0 w-full sm:w-auto",children:b.map(a=>v(a))})]}),!c&&(o==="multiple_choice"||t.allow_multiple?e.jsx("div",{className:`${(t.options||["Yes","No"]).length===2&&(t.options||["Yes","No"]).every(a=>(a||"").length<=24)?"grid grid-cols-2":"flex flex-col"} gap-3 mt-4`,children:(t.options||["Yes","No"]).map(a=>{const g=Array.isArray(h)?h.includes(a):h===a;return e.jsxs("button",{type:"button",onClick:()=>E(n,a,!0),className:`flex items-center gap-4 p-4.5 rounded-xl border text-left transition-all duration-200 active:scale-[0.99] w-full ${g?"bg-[#131B2D]/90 border-cyan-500/50 shadow-[0_0_20px_rgba(6,182,212,0.1)] font-bold text-white":"bg-[#131B2D]/50 border-white/5 hover:border-white/15 hover:bg-[#131B2D]/70 font-bold text-slate-300"}`,children:[e.jsx("div",{className:`w-5.5 h-5.5 rounded-md border-2 flex items-center justify-center transition-all duration-200 shrink-0 ${g?"bg-cyan-500 border-cyan-500 shadow-[0_0_10px_rgba(6,182,212,0.2)]":"border-white/20"}`,children:g&&e.jsx(U,{className:"w-3.5 h-3.5 text-slate-900 stroke-[3]"})}),e.jsx("span",{className:"text-[13px] font-bold break-words leading-relaxed",children:a})]},a)})}):o==="dropdown"||o==="select"||n==="demo_language"||m&&m.toLowerCase().includes("preferred language")?e.
1jsx("div",{className:"mt-3",children:e.jsx(tt,{options:(t.options||["Yes","No"]).map(a=>({label:typeof a=="string"?a:a?.label||String(a),value:typeof a=="string"?a:a?.value||String(a)})),value:h||"",onChange:a=>E(n,a,!1),placeholder:t.placeholder||"Select an option..."})}):(o==="choice"||o==="radio"||o==="likert"||o==="yesno"||o==="boolean")&&e.jsx("div",{className:`${(t.options||["Yes","No"]).length===2&&(t.options||["Yes","No"]).every(a=>(a||"").length<=24)?"grid grid-cols-2":"flex flex-col"} gap-3 mt-4`,children:(t.options||["Yes","No"]).map(a=>{const g=h===a;return e.jsxs("button",{type:"button",onClick:()=>E(n,a,!1),className:`flex items-center gap-4 p-4.5 rounded-xl border text-left transition-all duration-200 active:scale-[0.99] w-full ${g?"bg-[#131B2D]/90 border-cyan-500/50 shadow-[0_0_20px_rgba(6,182,212,0.1)] font-bold text-white":"bg-[#131B2D]/50 border-white/5 hover:border-white/15 hover:bg-[#131B2D]/70 font-bold text-slate-300"}`,children:[e.jsx("div",{className:`w-5.5 h-5.5 rounded-full border-2 flex items-center justify-center transition-all duration-200 shrink-0 ${g?"bg-cyan-500 border-cyan-500 shadow-[0_0_10px_rgba(6,182,212,0.2)]":"border-white/20"}`,children:g&&e.jsx("div",{className:"w-2 h-2 bg-slate-950 rounded-full"})}),e.jsx("span",{className:"text-[13px] font-bold break-words leading-relaxed",children:a})]},a)})})),(o==="faces"||o==="emoji")&&e.jsx("div",{className:"flex gap-3 justify-between",children:[{label:"Excellent",icon:e.jsx(De,{className:"w-7 h-7"}),val:"5",color:"text-emerald-400",ring:"ring-emerald-400"},{label:"Good",icon:e.jsx(De,{className:"w-7 h-7 opacity-70"}),val:"4",color:"text-teal-400",ring:"ring-teal-400"},{label:"Fair",icon:e.jsx(ot,{className:"w-7 h-7"}),val:"3",color:"text-slate-400",ring:"ring-slate-400"},{label:"Poor",icon:e.jsx(Re,{className:"w-7 h-7 opacity-70"}),val:"2",color:"text-amber-400",ring:"ring-amber-400"},{label:"Very Poor",icon:e.jsx(Re,{className:"w-7 h-7"}),val:"1",color:"text-rose-400",ring:"ring-rose-400"}].map(a=>{const g=String(h)===a.val;return e.jsxs("button",{type:"button",onClick:()=>E(n,a.val),className:`flex-1 flex flex-col items-center gap-2 py-3 rounded-xl border transition-all ${g?`bg-white/10 border-white ${a.ring} ring-2`:"border-white/10 hover:border-white/30 bg-white/5"}`,children:[e.jsx("span",{className:a.color,children:a.icon}),e.jsx("span",{className:`text-[9px] font-black uppercase tracking-widest ${g?"text-white":"text-slate-500"}`,children:a.label})]},a.val)})}),o==="scale"&&e.jsxs("div",{className:"space-y-2 bg-white/5 border border-white/10 rounded-2xl p-5",children:[e.jsxs("div",{className:"relative h-6 flex items-center",children:[e.jsx("div",{className:"absolute left-0 right-0 h-1.5 bg-white/10 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-cyan-500 rounded-full",style:{width:`${(Number(h)||0)/(t.scale_max||100)*100}%`}})}),e.jsx("input",{type:"range",min:t.scale_min||0,max:t.scale_max||100,value:h||0,onChange:a=>E(n,a.target.value),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"}),e.jsx("div",{className:"absolute w-4 h-4 bg-white border-2 border-cyan-500 rounded-full shadow pointer-events-none transition-all",style:{left:`calc(${(Number(h)||0)/(t.scale_max||100)*100}% - 8px)`}})]}),e.jsxs("div",{className:"flex justify-between text-[9px] font-black uppercase tracking-widest text-slate-400",children:[e.jsx("span",{children:t.options?.[0]||t.scale_min||"Min"}),e.jsx("span",{className:"text-cyan-400 bg-cyan-500/10 px-2 py-0.5 rounded-lg",children:h||0}),e.jsx("span",{children:t.options?.[1]||t.scale_max||"Max"})]})]}),o==="matrix"&&e.jsx("div",{className:"overflow-x-auto bg-[#131B2D]/40 border border-white/5 rounded-2xl p-4",children:e.jsxs("table",{className:"w-full text-left border-collapse min-w-[500px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/5",children:[e.jsx("th",{className:"py-2.5 px-3 text-xs font-black text-slate-400 uppercase tracking-widest"}),(t.options||[]).map((a,g)=>e.jsx("th",{className:"py-2.5 px-3 text-center text-[10px] font-black text-slate-400 uppercase tracking-widest",children:a},g))]})}),e.jsx("tbody",{children:(t.rows||[]).map((a,g)=>{const M=h?.[a]||"";return e.jsxs("tr",{className:"border-b border-white/5 last:border-0 hover:bg-white/[0.01] transition-colors",children:[e.jsx("td",{className:"py-3 px-3 text-xs font-bold text-white",children:a}),(t.options||[]).map((R,ke)=>{const Q=M===R;return e.jsx("td",{className:"py-3 px-3 text-center",children:e.jsx("button",{type:"button",onClick:()=>{const J={...h||{}};J[a]=R,E(n,J,!1)},className:`w-5.5 h-5.5 rounded-full border-2 inline-flex items-center justify-center transition-all duration-200 shrink-0 ${Q?"bg-cyan-500 border-cyan-500 shadow-[0_0_10px_rgba(6,182,212,0.2)]":"border-white/20 hover:border-white/40"}`,children:Q&&e.jsx("div",{className:"w-2 h-2 bg-slate-950 rounded-full"})})}
1,ke)})]},g)})})]})}),(o==="number"||N)&&e.jsx("input",{type:"number",min:N?1900:t.min,max:N?new Date().getFullYear():t.max,value:h||"",onChange:a=>E(n,a.target.value),placeholder:N?"e.g. 2001":t.placeholder||"0",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-sm font-bold text-white focus:border-cyan-500 outline-none transition-all"}),o==="date"&&!N&&e.jsx("input",{type:"date",value:h||"",onChange:a=>E(n,a.target.value),className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-sm font-bold text-white focus:border-cyan-500 outline-none transition-all"}),o==="short_text"&&e.jsx("input",{type:"text",value:h||"",onChange:a=>E(n,a.target.value),placeholder:t.placeholder||"Type your answer here...",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-sm font-bold text-white focus:border-cyan-500 outline-none transition-all"}),(o==="text"||o==="textarea"||o==="open")&&e.jsx("textarea",{value:h||"",onChange:a=>E(n,a.target.value),placeholder:t.placeholder||"Type your answer here...",rows:3,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-sm font-bold text-white focus:border-cyan-500 outline-none transition-all resize-none"})]},n)})})]})})(),e.jsxs("label",{className:`flex items-start gap-2.5 sm:gap-4 p-2.5 sm:p-4.5 rounded-lg sm:rounded-xl border text-left cursor-pointer transition-all duration-200 active:scale-[0.99] w-full ${r.cvConsent?"bg-indigo-950/30 border-indigo-500/80 shadow-[0_0_20px_rgba(99,102,241,0.15)] text-white":"bg-indigo-950/10 border-indigo-500/20 hover:border-indigo-500/40 hover:bg-indigo-950/20 text-slate-300"}`,children:[e.jsxs("div",{className:"relative flex items-center justify-center shrink-0 mt-0.5",children:[e.jsx("input",{type:"checkbox",checked:r.cvConsent,onChange:s=>j({...r,cvConsent:s.target.checked}),className:"peer absolute opacity-0 w-5 h-5 cursor-pointer"}),e.jsx("div",{className:`w-4 h-4 sm:w-5 h-5 rounded-md border-2 flex items-center justify-center transition-all duration-200 ${r.cvConsent?"bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.3)]":"border-indigo-500/30"}`,children:r.cvConsent&&e.jsx(U,{className:"w-2.5 h-2.5 sm:w-3.5 sm:h-3.5 text-white stroke-[3]"})})]}),e.jsxs("div",{className:"flex-grow space-y-1",children:[e.jsx("span",{className:"text-xs sm:text-[13px] font-semibold leading-snug block",children:"I confirm that the information provided is accurate and I consent to being contacted by MusB Research."}),e.jsxs("span",{className:"text-[9px] sm:text-[10px] text-indigo-400 font-bold uppercase tracking-wider flex items-center gap-1 opacity-80",children:[e.jsx(me,{size:11,className:"text-indigo-400"}),"Required Consent for Verification"]})]})]}),e.jsx("button",{type:"button",onClick:ve,disabled:V||$==="EXISTS"||$==="DUPLICATE",className:"w-full bg-[#131B2D] border border-white/10 hover:bg-[#1C2840] hover:border-cyan-500/40 text-white py-2.5 sm:py-4 h-[42px] sm:h-[50px] rounded-xl sm:rounded-2xl font-bold text-xs sm:text-[13px] uppercase tracking-[0.2em] transition-all flex items-center justify-center gap-2.5 disabled:opacity-50",children:V?e.jsx(de,{className:"w-4 h-4 sm:w-5 sm:h-5 animate-spin"}):"Continue"}),e.jsxs("div",{className:"flex justify-center gap-6 py-2.5 opacity-40 text-[9px] font-black uppercase tracking-widest mt-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(me,{className:"w-3.5 h-3.5 text-cyan-400"}),e.jsx("span",{children:"HIPAA Compliant"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ct,{className:"w-3.5 h-3.5 text-cyan-400"}),e.jsx("span",{children:"Secure & Private"})]})]})]})})]})})]})}export{Nt 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.