import{_ as X,m as M,C as Z,o as s,c,d as e,w as h,e as n,t as E,h as T,y as be,H as R,O as Q,g as f,f as V,F as j,u as l,D as Y,T as te,p as oe,i as ne,a as P,I as Ne,s as z,B as F,M as qe,j as ze,l as We,k as Ke,x as Qe,a1 as Xe,q as D,a2 as Me,G as Fe}from"./index-4e8c1b57.js";import{c as ae,a as N,f as G,g as Pe,u as Ze,b as A}from"./index.esm-1201bb6a.js";import{r as el,e as ll,a as al,l as tl,f as ol,d as nl,g as sl,s as il,b as Le,h as dl,m as ul,o as rl,i as cl,j as vl}from"./constants-b85a7a22.js";import{N as ml}from"./NavTabs-635d315d.js";import{N as pl}from"./NavBottom-8f7c6b37.js";import{B}from"./BaseMultiselect-d0c0021d.js";import{B as J}from"./BaseInput-1a25812b.js";import{B as Ye}from"./BaseRadio-a051ce67.js";import{B as q}from"./BaseCheckbox-dff8834d.js";const fl={class:"date-container"},yl={key:0,class:"form-error"},bl={key:0,class:"form-error"},_l={key:0,class:"form-error"},hl={__name:"DateSelector",props:{year:String,month:String,day:String,isYearDisabled:Boolean,isMonthDisabled:Boolean,isDayDisabled:Boolean,disabledTippy:String,tippy:String,yearError:String,monthError:String,dayError:String},emits:["update:year","update:month","update:day"],setup(t,{emit:L}){const I=t,O=L,p=M({get(){return I.year},set(d){O("update:year",d)}}),m=M({get(){return I.month},set(d){O("update:month",d)}}),b=M({get(){return I.day},set(d){O("update:day",d)}}),u=M(()=>{let d=new Date().getFullYear();return r(d-100,d)}),v=[{label:"January",value:"1"},{label:"February",value:"2"},{label:"March",value:"3"},{label:"April",value:"4"},{label:"May",value:"5"},{label:"June",value:"6"},{label:"July",value:"7"},{label:"August",value:"8"},{label:"September",value:"9"},{label:"October",value:"10"},{label:"November",value:"11"},{label:"December",value:"12"}],C=M(()=>{let d=31;return m.value&&(p.value?d=new Date(p.value,m.value,0).getDate():d=m.value==2?29:new Date(0,m.value,0).getDate()),r(1,d)});function r(d,w){let x=[];for(let _=d;_<=w;_++)x.push(_.toString());return x}return(d,w)=>{const x=Z("tippy");return s(),c("div",fl,[e("div",null,[h(n(B,{mode:"single",options:u.value,placeholder:"Year",disabled:t.isYearDisabled,modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=_=>p.value=_)},null,8,["options","disabled","modelValue"]),[[x,t.isYearDisabled?t.disabledTippy:t.tippy]]),t.yearError?(s(),c("div",yl,E(t.yearError),1)):T("",!0)]),e("div",null,[h(n(B,{mode:"single",options:v,placeholder:"Month",disabled:t.isMonthDisabled,modelValue:m.value,"onUpdate:modelValue":w[1]||(w[1]=_=>m.value=_)},null,8,["disabled","modelValue"]),[[x,t.isMonthDisabled?t.disabledTippy:t.tippy]]),t.monthError?(s(),c("div",bl,E(t.monthError),1)):T("",!0)]),e("div",null,[h(n(B,{mode:"single",options:C.value,placeholder:"Day",disabled:t.isDayDisabled,modelValue:b.value,"onUpdate:modelValue":w[2]||(w[2]=_=>b.value=_)},null,8,["options","disabled","modelValue"]),[[x,t.isDayDisabled?t.disabledTippy:t.tippy]]),t.dayError?(s(),c("div",_l,E(t.dayError),1)):T("",!0)])])}}},Re=X(hl,[["__scopeId","data-v-479b6f5e"]]);const gl=t=>(oe("data-v-76b33dd3"),t=t(),ne(),t),Vl={class:"race-and-ethnicity"},wl=gl(()=>e("div",{class:"question"},"How would you best describe yourself? Please select as many as apply:",-1)),$l={class:"race-and-ethnicity-list"},kl={class:"form-error"},Sl={class:"form-error"},Cl={class:"form-error"},xl={__name:"RaceAndEthnicity",props:{race:{type:Array,default:[""]},asian:{type:Array,default:[""]},hispanic:{type:Array,default:[""]},raceError:String,asianError:String,hispanicError:String,disabled:Boolean},emits:["update:race","update:asian","update:hispanic"],setup(t,{emit:L}){const I=t,O=L,p=M({get(){return I.race},set(u){O("update:race",u)}}),m=M({get(){return I.asian},set(u){O("update:asian",u)}}),b=M({get(){return I.hispanic},set(u){O("update:hispanic",u)}});return be(p,u=>{u.includes("other")||(u[0]=""),u.includes("Asian or Asian American")||(m.value=[""]),u.includes("Hispanic or Latinx/o/a")||(b.value=[""])}),be(m,u=>{u.includes("other")||(u[0]="")}),be(b,u=>{u.includes("other")||(u[0]="")}),(u,v)=>{const C=Z("tippy");return h((s(),c("div",Vl,[wl,e("ul",$l,[(s(!0),c(R,null,Q(l(al),r=>(s(),c("li",null,[n(q,{value:r,disabled:t.disabled,modelValue:p.value,"onUpdate:modelValue":v[0]||(v[0]=d=>p.value=d)},{default:f(()=>[V(E(r),1)]),_:2},1032,["value","disabled","modelValue"]),r==="Asian or Asian American"?(s(),j(te,{key:0,name:"slide"},{default:f(()=>[h(e("ul",null,[(s(!0),c(R,null,Q(l(el),d=>(s(),c("li",null,[n(q,{value:d,disabled:t.disabled,modelValue:m.value,"onUpdate:modelValue":v[1]||(v[1]=w=>m.value=w)},{default:f(()=>[V(E(d),1)]),_:2},1032,["value","disabled","modelValue"])]))),256)),e("li",null,[n(q,{value:"other",disabled:t.disabled,modelValue:m.value,"onUpdate:modelValue":v[2]||(v[2]=d=>m.value=d)},{default:f(()=>[V("Not Listed")]),_:1},8,["disabled","modelValue"]),n(J,{type:"text",class:"not-list-input",placeholder:"Please specify",disabled:!m.value.includes("other")||t.disabled,modelValue:m.value[0],"onUpdate:modelValue":v[3]||(v[3]=d=>m.value[0]=d)},null,8,["disabled","modelValue"])]),e("div",kl,E(t.asianError),1)],512),[[Y,p.value.includes(r)]])]),_:2},1024)):T("",!0),r==="Hispanic or Latinx/o/a"?(s(),j(te,{key:1,name:"slide"},{default:f(()=>[h(e("ul",null,[(s(!0),c(R,null,Q(l(ll),d=>(s(),c("li",null,[n(q,{value:d,modelValue:b.value,"onUpdate:modelValue":v[4]||(v[4]=w=>b.value=w)},{default:f(()=>[V(E(d),1)]),_:2},1032,["value","modelValue"])]))),256)),e("li",null,[n(q,{value:"other",disabled:t.disabled,modelValue:b.value,"onUpdate:modelValue":v[5]||(v[5]=d=>b.value=d)},{default:f(()=>[V("Not Listed")]),_:1},8,["disabled","modelValue"]),n(J,{type:"text",class:"not-list-input",placeholder:"Please specify",disabled:!b.value.includes("other")||t.disabled,modelValue:b.value[0],"onUpdate:modelValue":v[6]||(v[6]=d=>b.value[0]=d)},null,8,["disabled","modelValue"])]),e("div",Sl,E(t.hispanicError),1)],512),[[Y,p.value.includes(r)]])]),_:2},1024)):T("",!0)]))),256)),e("li",null,[n(q,{value:"other",disabled:t.disabled,modelValue:p.value,"onUpdate:modelValue":v[7]||(v[7]=r=>p.value=r)},{default:f(()=>[V("Not Listed")]),_:1},8,["disabled","modelValue"]),n(J,{type:"text",class:"not-list-input",placeholder:"Please specify",disabled:!p.value.includes("other")||t.disabled,modelValue:p.value[0],"onUpdate:modelValue":v[8]||(v[8]=r=>p.value[0]=r)},null,8,["disabled","modelValue"])]),e("div",Cl,E(t.raceError),1)])])),[[C,t.disabled?"This field has reached its editing limit. If it has an existing value you may reset it. It will become editable again 30 days after the last reset.":"This field can be edited twice"]])}}},Dl=X(xl,[["__scopeId","data-v-76b33dd3"]]);const Oe=t=>(oe("data-v-77ca6137"),t=t(),ne(),t),Al={class:"language-items"},Ul={class:"language-item"},El={class:"language"},Il={class:"fluency"},Pl=["onClick"],Tl={class:"new-language"},Nl={class:"language-name"},Ol=Oe(()=>e("div",{class:"title"},"Language",-1)),Bl={class:"language-fluency"},Ml=Oe(()=>e("div",{class:"title"},"Fluency",-1)),Fl={key:0,class:"new-item-functions"},Ll=Oe(()=>e("div",{class:"note"},"Remember to add all languages you speak before saving changes; otherwise, you will not be able to add more until 24 hours later. ",-1)),Yl={class:"form-error"},Rl={__name:"Languages",props:{modelValue:{type:Array,default:[]},disabled:Boolean,error:String},emits:["update:modelValue"],setup(t,{emit:L}){const I=t,O=L,p=P(!1),m=P(""),b=P(""),u=P(""),v=M({get(){return I.modelValue},set(w){O("update:modelValue",w)}});function C(w){v.value.splice(w,1)}function r(){if(!m.value||!b.value)return u.value="Please select both language and fluency";if(v.value.some(w=>m.value===w.language))return u.value="This language is already added";p.value=!1,u.value="",v.value.push({language:m.value,fluency:b.value}),m.value="",b.value=""}function d(){p.value=!p.value,p.value||(u.value="")}return(w,x)=>{const _=Z("tippy");return s(),c("div",null,[h((s(),c("div",Al,[(s(!0),c(R,null,Q(v.value,(g,i)=>(s(),c("div",Ul,[e("span",El,E(g.language),1),V(" - "),e("span",Il,E(g.fluency),1),t.disabled?T("",!0):(s(),c("a",{key:0,class:"delete-btn",onClick:U=>C(i)},[n(l(Ne),{icon:"mdi:close-circle"})],8,Pl))]))),256))])),[[_,"Please click Add to add language <br/> This field can be edited every 24 hours"]]),n(te,{name:"slide"},{default:f(()=>[h(e("div",Tl,[e("div",Nl,[Ol,n(B,{mode:"single",options:l(tl),placeholder:"Please select",modelValue:m.value,"onUpdate:modelValue":x[0]||(x[0]=g=>m.value=g)},null,8,["options","modelValue"])]),e("div",Bl,[Ml,n(B,{mode:"single",options:l(ol),placeholder:"Please select",modelValue:b.value,"onUpdate:modelValue":x[1]||(x[1]=g=>b.value=g)},null,8,["options","modelValue"])])],512),[[Y,p.value&&!t.disabled]])]),_:1}),t.disabled?T("",!0):(s(),c("div",Fl,[p.value?(s(),c(R,{key:1},[e("a",{onClick:d},"Cancel"),n(F,{variant:"main",size:"small",onClick:z(r,["prevent"])},{default:f(()=>[V("Add")]),_:1})],64)):(s(),c("a",{key:0,onClick:d},"Add a new language"))])),Ll,e("div",Yl,E(t.error||u.value),1)])}}},Hl=X(Rl,[["__scopeId","data-v-77ca6137"]]);const _e=t=>(oe("data-v-d3a2850b"),t=t(),ne(),t),Jl={class:"education-items"},jl={class:"education-item"},Gl={class:"institution"},ql=["onClick"],zl={class:"degree"},Wl={key:0,class:"degree-date"},Kl={key:1,class:"degree-date"},Ql={class:"new-education"},Xl={class:"institution"},Zl=_e(()=>e("div",{class:"title"},"New Institution",-1)),ea={class:"degree"},la={class:"degree-type"},aa=_e(()=>e("div",{class:"title"},"Degree",-1)),ta={class:"degree-year"},oa=_e(()=>e("div",{class:"title"},"Graduation year",-1)),na={class:"enrolled"},sa={key:0,class:"new-item-functions"},ia=_e(()=>e("div",{class:"note"},"Remember to add all schools and institutions you have attended before saving changes; otherwise, you will not be able to add more until 24 hours later. ",-1)),da={class:"form-error"},ua={__name:"Education",props:{modelValue:{type:Array,default:[]},disabled:Boolean,error:String},emits:["update:modelValue"],setup(t,{emit:L}){const I=t,O=L,p=P(!1),m=P(""),b=P(""),u=P(""),v=P(""),C=P(!1),r=M({get(){return I.modelValue},set(_){O("update:modelValue",_)}});function d(_){r.value.splice(_,1)}function w(){if(!b.value||!u.value)return m.value="Please fill out both institution and degree";const _={institution:b.value,degree:u.value,graduation_year:Number(v.value),enrolled:C.value};if(r.value.some(g=>JSON.stringify(_)===JSON.stringify(g)))return m.value="This entry is already in your education history";if(_.graduation_year<1900||_.graduation_year>new Date().getFullYear()+10)return m.value=`The graduation year must be between 1900 and ${new Date().getFullYear()+10}`;r.value.push(_),r.value.sort((g,i)=>g.graduation_year<i.graduation_year&&1||-1),p.value=!1,m.value="",b.value="",u.value="",C.value=!1,v.value=""}function x(){p.value=!p.value,p.value||(m.value="")}return(_,g)=>{const i=Z("tippy");return s(),c("div",null,[h((s(),c("div",Jl,[(s(!0),c(R,null,Q(r.value,(U,W)=>(s(),c("div",jl,[e("div",Gl,[V(E(U.institution)+" ",1),t.disabled?T("",!0):(s(),c("a",{key:0,class:"delete-btn",onClick:$=>d(W)},[n(l(Ne),{icon:"mdi:close-circle"})],8,ql))]),e("div",zl,[V(E(U.degree)+" - ",1),U.enrolled?(s(),c("span",Wl,"Graduating in "+E(U.graduation_year),1)):(s(),c("span",Kl,"Class of "+E(U.graduation_year),1))])]))),256))])),[[i,"Please complete your education history by listing each institution you are attending and have attended. This field can be edited every 24 hours."]]),n(te,{name:"slide"},{default:f(()=>[h(e("div",Ql,[e("div",Xl,[Zl,n(J,{type:"text",placeholder:"Enter the full name of the institution",modelValue:b.value,"onUpdate:modelValue":g[0]||(g[0]=U=>b.value=U)},null,8,["modelValue"])]),e("div",ea,[e("div",la,[aa,n(B,{mode:"single",options:l(nl),placeholder:"Please select",modelValue:u.value,"onUpdate:modelValue":g[1]||(g[1]=U=>u.value=U)},null,8,["options","modelValue"])]),e("div",ta,[oa,n(J,{type:"text",placeholder:"YYYY",modelValue:v.value,"onUpdate:modelValue":g[2]||(g[2]=U=>v.value=U)},null,8,["modelValue"])])]),h(e("div",na,[n(q,{modelValue:C.value,"onUpdate:modelValue":g[3]||(g[3]=U=>C.value=U)},{default:f(()=>[V("I am currently attending this institution")]),_:1},8,["modelValue"])],512),[[Y,v.value>=new Date().getFullYear()]])],512),[[Y,p.value&&!t.disabled]])]),_:1}),t.disabled?T("",!0):(s(),c("div",sa,[p.value?(s(),c(R,{key:1},[e("a",{onClick:x},"Cancel"),n(F,{variant:"main",size:"small",onClick:z(w,["prevent"])},{default:f(()=>[V("Add")]),_:1})],64)):(s(),c("a",{key:0,onClick:x},"Add a new entry"))])),ia,e("div",da,E(t.error||m.value),1)])}}},ra=X(ua,[["__scopeId","data-v-d3a2850b"]]);const ca=t=>(oe("data-v-d86bf913"),t=t(),ne(),t),va={class:"child-dob-items"},ma={class:"child-dob-item"},pa={class:"fwt-500"},fa={class:"fwt-300"},ya=["onClick"],ba={class:"new-child-dob"},_a={key:0,class:"new-item-functions"},ha=ca(()=>e("div",{class:"note"},"Please add the DOB of all children before saving changes; otherwise, you will not be able to add more until 24 hours later. ",-1)),ga={class:"form-error"},Va={__name:"ChildrenBirthday",props:{modelValue:{type:Array,default:[]},disabled:Boolean,error:String,maxItems:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:L}){const I=t,O=L,p=P(!1),m=P(""),b=P(""),u=P(""),v=P(""),C=M({get(){return I.modelValue},set(x){O("update:modelValue",x)}});function r(x){C.value.splice(x,1)}function d(){if(!b.value&&!u.value&&!v.value)return;let x={year:b.value,month:u.value,day:v.value};if(C.value.some(_=>JSON.stringify(_)===JSON.stringify(x)))return m.value="Already added";if(I.maxItems<=C.value.length)return m.value="Please change the Number of Children to add more birthdays";C.value.push(x),p.value=!1,m.value="",b.value="",u.value="",v.value=""}function w(){p.value=!p.value,p.value||(m.value="")}return(x,_)=>{const g=Z("tippy");return s(),c("div",null,[h((s(),c("div",va,[(s(!0),c(R,null,Q(C.value,(i,U)=>(s(),c("div",ma,[e("span",pa,"Child #"+E(U+1),1),V(" - "),e("span",fa,E(new Intl.DateTimeFormat([],{dateStyle:"long"}).format(new Date(i.year,i.month,i.day))),1),t.disabled?T("",!0):(s(),c("a",{key:0,class:"delete-btn",onClick:W=>r(U)},[n(l(Ne),{icon:"mdi:close-circle"})],8,ya))]))),256))])),[[g,"This field can be edited every 24 hours"]]),n(te,{name:"slide"},{default:f(()=>[h(e("div",ba,[n(Re,{year:b.value,"onUpdate:year":_[0]||(_[0]=i=>b.value=i),month:u.value,"onUpdate:month":_[1]||(_[1]=i=>u.value=i),day:v.value,"onUpdate:day":_[2]||(_[2]=i=>v.value=i)},null,8,["year","month","day"])],512),[[Y,p.value&&!t.disabled]])]),_:1}),t.disabled?T("",!0):(s(),c("div",_a,[p.value?(s(),c(R,{key:1},[e("a",{onClick:w},"Cancel"),n(F,{variant:"main",size:"small",onClick:z(d,["prevent"])},{default:f(()=>[V("Add")]),_:1})],64)):(s(),c("a",{key:0,onClick:w},"Add a new child DOB"))])),ha,e("div",ga,E(t.error||m.value),1)])}}},wa=X(Va,[["__scopeId","data-v-d86bf913"]]);const S=t=>(oe("data-v-0c3ce430"),t=t(),ne(),t),$a={class:"demographics-container"},ka={class:"region-head"},Sa={class:"title"},Ca=S(()=>e("div",{class:"note"}," All fields are optional. Your data will be used for research studies only. ",-1)),xa={class:"form"},Da={class:"profile-section"},Aa={class:"section-content"},Ua=S(()=>e("label",{class:"label"},"Date of birth",-1)),Ea={class:"field-functions"},Ia=S(()=>e("label",{for:"gender",class:"label"},"Gender",-1)),Pa={class:"field-functions"},Ta=S(()=>e("label",{for:"sexual_orientation",class:"label"},"Sexual Orientation",-1)),Na=S(()=>e("div",{class:"field-functions"},null,-1)),Oa=S(()=>e("label",{class:"label"},"Race and Ethnicity",-1)),Ba={class:"field-functions"},Ma={class:"section-content"},Fa=S(()=>e("label",{for:"country_of_residence",class:"label"},"Country of Residence",-1)),La=S(()=>e("div",{class:"field-functions"},null,-1)),Ya=S(()=>e("label",{for:"country_of_origin",class:"label"},"Country of Origin",-1)),Ra={class:"field-functions"},Ha=S(()=>e("div",{class:"field-functions"},null,-1)),Ja=S(()=>e("label",{for:"languages",class:"label"},"Languages",-1)),ja=S(()=>e("div",{class:"field-functions"},null,-1)),Ga=S(()=>e("label",{for:"religion",class:"label"},"Religion",-1)),qa=S(()=>e("div",{class:"field-functions"},null,-1)),za={class:"section-content"},Wa=S(()=>e("label",{class:"label"},"Education",-1)),Ka={class:"section-content"},Qa=S(()=>e("label",{for:"marital_status",class:"label"},"Marital Status",-1)),Xa=S(()=>e("label",{for:"num_of_children",class:"label"},"Number of Children",-1)),Za=S(()=>e("label",{class:"label"},"Children's Date of Birth",-1)),et={class:"section-content"},lt=S(()=>e("label",{for:"occupation_industry",class:"label"},"Occupation Industry",-1)),at=S(()=>e("label",{for:"occupation_title",class:"label"},"Occupation Title",-1)),tt=S(()=>e("label",{for:"employment_status",class:"label"},"Employment Status",-1)),ot=S(()=>e("label",{for:"employment_hours",class:"label"},"Employment Hours",-1)),nt=S(()=>e("label",{for:"self_employed",class:"label"},"Self-employed",-1)),st={class:"self-employed-row"},it={class:"form-error"},dt=S(()=>e("label",{for:"annual_income_currency",class:"label"},"Annual Income Currency",-1)),ut=S(()=>e("label",{for:"annual_income_amount",class:"label"},"Annual Income Amount",-1)),rt=S(()=>e("p",null,[V(" You are resetting a field that has reached its lifetime editing limit. Once reset, the field will become disabled for the next 30 days, and you will "),e("span",{class:"fwt-700 color-orange"},"not"),V(" be able to qualify for any study that uses this field's data for eligibility determination during that time. ")],-1)),Te="This field has reached its editing limit. If it has an existing value you may reset it. It will become editable again 30 days after the last reset.",ct={__name:"Demographics",props:{section:String,field:String},emits:["change"],setup(t,{emit:L}){const I=t,O=L,p=qe(),m=ze(),b=We(),u=Ke(),v=Qe(),C=[{icon:"fa6-solid:bars",label:"General",value:"general"},{icon:"fa6-solid:globe",label:"Location & Culture",value:"location-and-culture"},{icon:"fa6-solid:graduation-cap",label:"Education",value:"education"},{icon:"fa6-solid:house-chimney",label:"Family",value:"family"},{icon:"fa6-solid:suitcase",label:"Occupation",value:"occupation"}],r=P(0),d=P(r.value);be(()=>p.hash,y=>{const o=y.substring(1)||C[0].value;r.value=C.findIndex(k=>k.value===o)},{immediate:!0}),I.section&&(r.value=C.findIndex(y=>y.value===I.section));const w=P(!1);function x(y){if(d.value=y,he.value&&he.value.dirty){w.value=!0;return}r.value=y,!I.section&&m.push({hash:`#${C[y].value}`})}function _(){w.value=!1,Be({values:W.value}),r.value=d.value,m.push({hash:`#${C[d.value].value}`})}const g=M(()=>b.user.profile||{}),i=M(()=>{const y=[],o=new Set(["dob_year","dob_month","dob_day","gender","race","race_Asian","ethnicity_Hispanic","country_of_origin"]),k=Math.floor(Date.now()/1e3);for(let a in g.value)if(o.has(a)){if(g.value[a].update_counter>=2)if(a==="race"||a==="race_Asian"||a==="ethnicity_Hispanic"){if(g.value[a].value.length===1&&g.value[a].value[0]===""&&k-g.value[a].updated_at>30*24*3600)continue;y.push("race")}else{if(g.value[a].value.length===0&&k-g.value[a].updated_at>30*24*3600)continue;y.push(a)}}else g.value[a].updated_at+86400>k&&y.push(a);return y}),U=[ae({dob_year:N().default("").optional().label("Year"),dob_month:N().default("").optional().label("Month"),dob_day:N().default("").optional().label("Day"),gender:N().default("").optional().max(50).label("Gender"),sexual_orientation:N().default("").optional().max(50).label("Sexual orientation"),race:G().default([""]).optional().of(N().max(50).label("Input")).label("Race"),race_Asian:G().default([""]).optional().of(N().max(50).label("Input")).label("This"),ethnicity_Hispanic:G().default([""]).optional().of(N().max(50).label("Input")).label("This")}),ae({country_of_residence:N().default("").optional().label("Country of residence"),country_of_origin:G().default([]).optional().label("Country of origin"),languages:G().default([]).optional().label("Languages"),religion:N().default("").optional().max(50).label("Religion")}),ae({education:G().default([]).optional().label("Education")}),ae({marital_status:N().default("").optional().label("Marital status"),num_of_children:Pe().integer().default("").notRequired().min(0).max(20).transform(y=>isNaN(y)?null:y).label("Number of children"),children_dob:G().default([]).optional().label("Children's date of birth")}),ae({occupation_industry:N().default("").optional().max(50).label("Occupation industry"),occupation_title:N().default("").optional().max(50).label("Occupation title"),employment_status:N().default("").optional().label("Employment status"),employment_hours:Pe().integer().default("").notRequired().transform(y=>isNaN(y)?null:y).min(0).max(168).label("Employment hours"),self_employed:N().default("").optional().label("Self employed"),annual_income_currency:N().default("").optional().label("Annual income currency"),annual_income_amount:Pe().integer().default("").notRequired().transform(y=>isNaN(y)?null:y).min(0).label("Annual income amount")})],W=M(()=>{var o;const y={};for(const k of U)for(const a in k.fields)y[a]=((o=g.value[a])==null?void 0:o.value)??k.fields[a].default();return y}),{errors:$,handleSubmit:He,meta:he,resetForm:Be,setFieldValue:Je}=Ze({initialValues:W.value,validationSchema:M(()=>U[r.value]),initialErrors:{[I.field]:"Please fill out this field"}}),{value:se}=A("dob_year"),{value:ie}=A("dob_month"),{value:de}=A("dob_day"),{value:ue}=A("gender"),{value:ge}=A("sexual_orientation"),{value:re}=A("race"),{value:ce}=A("race_Asian"),{value:ve}=A("ethnicity_Hispanic"),{value:Ve}=A("country_of_residence"),{value:me}=A("country_of_origin"),{value:we}=A("languages"),{value:$e}=A("religion"),{value:ke}=A("education"),{value:Se}=A("marital_status"),{value:ee}=A("num_of_children"),{value:Ce}=A("children_dob"),{value:xe}=A("occupation_industry"),{value:De}=A("occupation_title"),{value:pe}=A("employment_status"),{value:Ae}=A("employment_hours"),{value:K}=A("self_employed"),{value:Ue}=A("annual_income_currency"),{value:Ee}=A("annual_income_amount"),je=He(async(y,o)=>{u.pop("Saving changes...","loading"),v.disablePage();const k=Object.fromEntries(Object.keys(U[r.value].fields).map(H=>Array.isArray(y[H])?[H,y[H].map(le=>typeof le=="object"?JSON.stringify(le):le)]:[H,y[H]]));k.submit=C[r.value].value.replace(/(^\w|-\w)/g,H=>H.replace(/-/,"").toUpperCase());const a=await Xe(k);if(a.ok)await b.getUserProfile(),Be({values:W.value}),I.field&&O("change"),await u.pop("Successfully saved changes","success",1500);else{let H="Unexpected error occurred. Please try again later";if(a.status==400){const le=await a.json();o.setErrors(le),H="Please double-check the highlighted fields"}await u.pop(H,"error",2e3)}v.disablePage(!0)}),fe=P(!1),Ie=P([]);function ye(...y){fe.value=!0,Ie.value=y}function Ge(){if(fe.value=!1,Ie.value.length!==0)for(const y of Ie.value)Je(y,U[r.value].fields[y].default())}return(y,o)=>{const k=Z("tippy");return s(),c("div",$a,[n(ml,{tabs:C,activeStep:r.value,onChange:x},null,8,["activeStep"]),e("div",ka,[e("span",Sa,"Section "+E(r.value+1)+" of 5",1),Ca]),e("div",xa,[h(e("section",Da,[e("div",Aa,[Ua,n(Re,{year:l(se),"onUpdate:year":o[0]||(o[0]=a=>D(se)?se.value=a:null),month:l(ie),"onUpdate:month":o[1]||(o[1]=a=>D(ie)?ie.value=a:null),day:l(de),"onUpdate:day":o[2]||(o[2]=a=>D(de)?de.value=a:null),yearError:l($).dob_year,monthError:l($).dob_month,dayError:l($).dob_day,isYearDisabled:i.value.includes("dob_year"),isMonthDisabled:i.value.includes("dob_month"),isDayDisabled:i.value.includes("dob_day"),tippy:"This field can be edited twice.",disabledTippy:Te},null,8,["year","month","day","yearError","monthError","dayError","isYearDisabled","isMonthDisabled","isDayDisabled"]),e("div",Ea,[i.value.includes("dob_year")&&l(se)||i.value.includes("dob_month")&&l(ie)||i.value.includes("dob_day")&&l(de)?(s(),j(F,{key:0,variant:"reset",class:"reset-btn",onClick:o[3]||(o[3]=z(a=>ye("dob_year","dob_month","dob_day"),["prevent"]))},{default:f(()=>[V("reset ")]),_:1})):T("",!0)]),Ia,h(n(B,{mode:"single",id:"gender",placeholder:"Please select or specify",options:[{label:"Please select or specify",value:""},...l(sl)],allowCustomInput:"",modelValue:l(ue),"onUpdate:modelValue":o[4]||(o[4]=a=>D(ue)?ue.value=a:null),error:l($).gender,disabled:i.value.includes("gender")},null,8,["options","modelValue","error","disabled"]),[[k,i.value.includes("gender")?Te:"This field can be edited twice."]]),e("div",Pa,[l(ue)&&i.value.includes("gender")?(s(),j(F,{key:0,variant:"reset",class:"reset-btn",onClick:o[5]||(o[5]=z(a=>ye("gender"),["prevent"]))},{default:f(()=>[V("reset ")]),_:1})):T("",!0)]),Ta,h(n(B,{mode:"single",id:"sexual_orientation",placeholder:"Please select or specify",options:[{label:"Please select or specify",value:""},...l(il)],allowCustomInput:"",modelValue:l(ge),"onUpdate:modelValue":o[6]||(o[6]=a=>D(ge)?ge.value=a:null),error:l($).sexual_orientation,disabled:i.value.includes("sexual_orientation")},null,8,["options","modelValue","error","disabled"]),[[k,"If not listed, please specify. <br/> This field can be edited every 24 hours"]]),Na,Oa,n(Dl,{race:l(re),"onUpdate:race":o[7]||(o[7]=a=>D(re)?re.value=a:null),asian:l(ce),"onUpdate:asian":o[8]||(o[8]=a=>D(ce)?ce.value=a:null),hispanic:l(ve),"onUpdate:hispanic":o[9]||(o[9]=a=>D(ve)?ve.value=a:null),raceError:l($).race||l($)["race[0]"],asianError:l($).race_Asian||l($)["race_Asian[0]"],hispanicError:l($).ethnicity_Hispanic||l($)["ethnicity_Hispanic[0]"],disabled:i.value.includes("race")},null,8,["race","asian","hispanic","raceError","asianError","hispanicError","disabled"]),e("div",Ba,[i.value.includes("race")&&(l(re).length>1||l(ce).length>1||l(ve).length>1)?(s(),j(F,{key:0,variant:"reset",class:"reset-btn",onClick:o[10]||(o[10]=z(a=>ye("race","race_Asian","ethnicity_Hispanic"),["prevent"]))},{default:f(()=>[V("reset")]),_:1})):T("",!0)])])],512),[[Y,r.value===0]]),h(e("section",null,[e("div",Ma,[Fa,h(n(B,{mode:"single",id:"country_of_residence",placeholder:"Please select",options:[{label:"Please select",value:""},...l(Le)],modelValue:l(Ve),"onUpdate:modelValue":o[11]||(o[11]=a=>D(Ve)?Ve.value=a:null),error:l($).country_of_residence,disabled:i.value.includes("country_of_residence")},null,8,["options","modelValue","error","disabled"]),[[k,"This field can be edited every 24 hours"]]),La,Ya,h(n(B,{mode:"multiple",id:"country_of_origin",options:l(Le),placeholder:"Please select as many as apply",modelValue:l(me),"onUpdate:modelValue":o[12]||(o[12]=a=>D(me)?me.value=a:null),error:l($).country_of_origin,disabled:i.value.includes("country_of_origin")},null,8,["options","modelValue","error","disabled"]),[[k,i.value.includes("country_of_origin")?Te:"This field can be edited twice"]]),e("div",Ra,[Ha,l(me).length&&i.value.includes("country_of_origin")?(s(),j(F,{key:0,variant:"reset",class:"reset-btn",onClick:o[13]||(o[13]=z(a=>ye("country_of_origin"),["prevent"]))},{default:f(()=>[V("reset")]),_:1})):T("",!0)]),Ja,n(Hl,{modelValue:l(we),"onUpdate:modelValue":o[14]||(o[14]=a=>D(we)?we.value=a:null),error:l($).languages,disabled:i.value.includes("languages")},null,8,["modelValue","error","disabled"]),ja,Ga,h(n(B,{mode:"single",id:"religion",placeholder:"Please select or specify",options:[{label:"Please select or specify",value:""},...l(dl)],allowCustomInput:"",modelValue:l($e),"onUpdate:modelValue":o[15]||(o[15]=a=>D($e)?$e.value=a:null),error:l($).religion,disabled:i.value.includes("religion")},null,8,["options","modelValue","error","disabled"]),[[k,"If not listed, please specify. <br/> This field can be edited every 24 hours"]]),qa])],512),[[Y,r.value===1]]),h(e("section",null,[e("div",za,[Wa,n(ra,{modelValue:l(ke),"onUpdate:modelValue":o[16]||(o[16]=a=>D(ke)?ke.value=a:null),error:l($).education,disabled:i.value.includes("education")},null,8,["modelValue","error","disabled"])])],512),[[Y,r.value===2]]),h(e("section",null,[e("div",Ka,[Qa,h(n(B,{mode:"single",id:"marital_status",placeholder:"Please select",options:[{label:"Please select",value:""},...l(ul)],modelValue:l(Se),"onUpdate:modelValue":o[17]||(o[17]=a=>D(Se)?Se.value=a:null),error:l($).marital_status,disabled:i.value.includes("marital_status")},null,8,["options","modelValue","error","disabled"]),[[k,"This field can be edited every 24 hours"]]),Xa,h(n(J,{type:"number",placeholder:"Please enter numbers only",modelValue:l(ee),"onUpdate:modelValue":o[18]||(o[18]=a=>D(ee)?ee.value=a:null),modelModifiers:{number:!0},error:l($).num_of_children,disabled:i.value.includes("num_of_children")},null,8,["modelValue","error","disabled"]),[[k,"This field can be edited every 24 hours"]]),n(Me,{name:"slide"},{default:f(()=>[l(ee)>0?(s(),c(R,{key:0},[Za,n(wa,{maxItems:l(ee)||0,modelValue:l(Ce),"onUpdate:modelValue":o[19]||(o[19]=a=>D(Ce)?Ce.value=a:null),error:l($).children_dob,disabled:i.value.includes("children_dob")},null,8,["maxItems","modelValue","error","disabled"])],64)):T("",!0)]),_:1})])],512),[[Y,r.value===3]]),h(e("section",null,[e("div",et,[lt,h(n(B,{mode:"single",id:"occupation_industry",placeholder:"Please select or specify",options:[{label:"Please select or specify",value:""},...l(rl)],allowCustomInput:"",modelValue:l(xe),"onUpdate:modelValue":o[20]||(o[20]=a=>D(xe)?xe.value=a:null),error:l($).occupation_industry,disabled:i.value.includes("occupation_industry")},null,8,["options","modelValue","error","disabled"]),[[k,"If not listed, please specify <br/> This field can be edited every 24 hours"]]),at,h(n(J,{type:"text",id:"occupation_title",placeholder:"Please enter job title",modelValue:l(De),"onUpdate:modelValue":o[21]||(o[21]=a=>D(De)?De.value=a:null),modelModifiers:{trim:!0},error:l($).occupation_title,disabled:i.value.includes("occupation_title")},null,8,["modelValue","error","disabled"]),[[k,"This field can be edited every 24 hours"]]),tt,h(n(B,{mode:"single",id:"employment_status",placeholder:"Please select",options:[{label:"Please select",value:""},...l(cl)],modelValue:l(pe),"onUpdate:modelValue":o[22]||(o[22]=a=>D(pe)?pe.value=a:null),error:l($).employment_status,disabled:i.value.includes("employment_status")},null,8,["options","modelValue","error","disabled"]),[[k,"This field can be edited every 24 hours"]]),n(Me,{name:"slide"},{default:f(()=>[["Full-time","Part-time"].includes(l(pe))?(s(),c(R,{key:0},[ot,h(n(J,{type:"number",id:"employment_hours",placeholder:"Please enter numbers only",modelValue:l(Ae),"onUpdate:modelValue":o[23]||(o[23]=a=>D(Ae)?Ae.value=a:null),modelModifiers:{number:!0},error:l($).employment_hours,disabled:i.value.includes("employment_hours")},null,8,["modelValue","error","disabled"]),[[k,"Please enter work hours per week <br/> This field can be edited every 24 hours"]]),nt,h((s(),c("div",st,[n(Ye,{value:"True",modelValue:l(K),"onUpdate:modelValue":o[24]||(o[24]=a=>D(K)?K.value=a:null),disabled:i.value.includes("self_employed")},{default:f(()=>[V("True ")]),_:1},8,["modelValue","disabled"]),n(Ye,{value:"False",modelValue:l(K),"onUpdate:modelValue":o[25]||(o[25]=a=>D(K)?K.value=a:null),disabled:i.value.includes("self_employed")},{default:f(()=>[V(" False")]),_:1},8,["modelValue","disabled"]),e("div",it,E(l($).self_employed),1)])),[[k,"This field can be edited every 24 hours"]])],64)):T("",!0)]),_:1}),dt,h(n(B,{mode:"single",id:"annual_income_currency",placeholder:"Please select",options:[{label:"Please select",value:""},...l(vl)],modelValue:l(Ue),"onUpdate:modelValue":o[26]||(o[26]=a=>D(Ue)?Ue.value=a:null),error:l($).annual_income_currency,disabled:i.value.includes("annual_income_currency")},null,8,["options","modelValue","error","disabled"]),[[k,"This field can be edited every 24 hours"]]),ut,h(n(J,{type:"number",id:"annual_income_amount",placeholder:"Please enter numbers only",modelValue:l(Ee),"onUpdate:modelValue":o[27]||(o[27]=a=>D(Ee)?Ee.value=a:null),modelModifiers:{number:!0},error:l($).annual_income_amount,disabled:i.value.includes("annual_income_amount")},null,8,["modelValue","error","disabled"]),[[k,"This field can be edited every 24 hours"]])])],512),[[Y,r.value===4]])]),fe.value?(s(),j(Fe,{key:0},{title:f(()=>[V("30-day rule regarding data reset")]),body:f(()=>[rt,V(" Are you sure you want to reset the field? ")]),footer:f(()=>[n(F,{variant:"confirm",onClick:Ge},{default:f(()=>[V("Confirm")]),_:1}),n(F,{variant:"cancel",onClick:o[28]||(o[28]=a=>fe.value=!1)},{default:f(()=>[V("Cancel")]),_:1})]),_:1})):T("",!0),w.value?(s(),j(Fe,{key:1,size:"small"},{title:f(()=>[V("Unsaved changes")]),body:f(()=>[V('If you intend to save those changes, please click "Cancel" and then "Save changes" before navigating to another section. Clicking "Leave" will abandon those changes.')]),footer:f(()=>[n(F,{variant:"confirm",onClick:_},{default:f(()=>[V("Leave")]),_:1}),n(F,{variant:"cancel",onClick:o[29]||(o[29]=a=>w.value=!1)},{default:f(()=>[V("Cancel")]),_:1})]),_:1})):T("",!0),n(pl,{activeStep:r.value,maxStep:C.length,onChange:x},{default:f(()=>[n(F,{variant:"primary",disabled:!l(he).dirty,onClick:l(je)},{default:f(()=>[V("Save changes")]),_:1},8,["disabled","onClick"])]),_:1},8,["activeStep","maxStep"])])}}},Vt=X(ct,[["__scopeId","data-v-0c3ce430"]]);export{Vt as D};