PageSourceSearch

https://optical-academy.com/assets/events._accessCode-CwquzAFf.js

js optical-academy.com collected 2026-10-07 15:37:51 UTC 34,728 bytes, 5 lines download raw bytes

vendor: 5,461 bytes, line 1
1import{c as rt,r,j as e,X as nt,d as _e,k as ot}from"./index-C0dy2hPP.js";import{u as it,f as lt,C as ct,P as dt,h as ut,R as mt,g as ht,F as pt,D as xt,e as Xe,S as E,a as R,b as P,c as A,d as y,L as p,I as v,B as ee}from"./select-CCLBm9JR.js";import{P as O,u as ss,e as se,b as W,d as ts,c as T,i as ft,a as be,j as gt}from"./index-CSr3wcrL.js";import{P as re}from"./index-9UYPoaBG.js";import{c as De}from"./createServerFn-DdlYNCAh.js";import{C as vt}from"./circle-check-BtO-WRUA.js";import"./tslib.es6-eMSY344_.js";const bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ze=rt("circle-alert",bt);var ne="Checkbox",[yt]=ts(ne),[jt,we]=yt(ne);function Nt(t){const{__scopeCheckbox:s,checked:n,children:l,defaultChecked:i,disabled:o,form:d,name:c,onCheckedChange:u,required:m,value:f="on",internal_do_not_use_render:x}=t,[j,D]=ss({prop:n,defaultProp:i??!1,onChange:u,caller:ne}),[w,S]=r.useState(null),[F,g]=r.useState(null),b=r.useRef(!1),L=w?!!d||!!w.closest("form"):!0,Y={checked:j,disabled:o,setChecked:D,control:w,setControl:S,name:c,form:d,value:f,hasConsumerStoppedPropagationRef:b,required:m,defaultChecked:M(i)?!1:i,isFormControl:L,bubbleInput:F,setBubbleInput:g};return e.jsx(jt,{scope:s,...Y,children:Ct(x)?x(Y):l})}var as="CheckboxTrigger",rs=r.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:n,...l},i)=>{const{control:o,value:d,disabled:c,checked:u,required:m,setControl:f,setChecked:x,hasConsumerStoppedPropagationRef:j,isFormControl:D,bubbleInput:w}=we(as,t),S=se(i,f),F=r.useRef(u);return r.useEffect(()=>{const g=o?.form;if(g){const b=()=>x(F.current);return g.addEventListener("reset",b),()=>g.removeEventListener("reset",b)}},[o,x]),e.jsx(O.button,{type:"button",role:"checkbox","aria-checked":M(u)?"mixed":u,"aria-required":m,"data-state":cs(u),"data-disabled":c?"":void 0,disabled:c,value:d,...l,ref:S,onKeyDown:W(s,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:W(n,g=>{x(b=>M(b)?!0:!b),w&&D&&(j.current=g.isPropagationStopped(),j.current||g.stopPropagation())})})});rs.displayName=as;var Ie=r.forwardRef((t,s)=>{const{__scopeCheckbox:n,name:l,checked:i,defaultChecked:o,required:d,disabled:c,value:u,onCheckedChange:m,form:f,...x}=t;return e.jsx(Nt,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:c,required:d,onCheckedChange:m,name:l,form:f,value:u,internal_do_not_use_render:({isFormControl:j})=>e.jsxs(e.Fragment,{children:[e.jsx(rs,{...x,ref:s,__scopeCheckbox:n}),j&&e.jsx(ls,{__scopeCheckbox:n})]})})});Ie.displayName=ne;var ns="CheckboxIndicator",os=r.forwardRef((t,s)=>{const{__scopeCheckbox:n,forceMount:l,...i}=t,o=we(ns,n);return e.jsx(re,{present:l||M(o.checked)||o.checked===!0,children:e.jsx(O.span,{"data-state":cs(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:s,style:{pointerEvents:"none",...t.style}})})});os.displayName=ns;var is="CheckboxBubbleInput",ls=r.forwardRef(({__scopeCheckbox:t,...s},n)=>{const{control:l,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:d,required:c,disabled:u,name:m,value:f,form:x,bubbleInput:j,setBubbleInput:D}=we(is,t),w=se(n,D),S=it(o),F=lt(l);r.useEffect(()=>{const b=j;if(!b)return;const L=window.HTMLInputElement.prototype,H=Object.getOwnPropertyDescriptor(L,"checked").set,ie=!i.current;if(S!==o&&H){const K=new Event("click",{bubbles:ie});b.indeterminate=M(o),H.call(b,M(o)?!1:o),b.dispatchEvent(K)}},[j,S,o,i]);const g=r.useRef(M(o)?!1:o);return e.jsx(O.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??g.current,required:c,disabled:u,name:m,value:f,form:x,...s,tabIndex:-1,ref:w,style:{...s.style,...F,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ls.displayName=is;function Ct(t){return typeof t=="function"}function M(t){return t==="indeterminate"}function cs(t){return M(t)?"indeterminate":t?"checked":"unchecked"}const U=r.forwardRef(({className:t,...s},n)=>e.jsx(Ie,{ref:n,className:T("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...s,children:e.jsx(os,{className:T("grid place-content-center text-current"),children:e.jsx(ct,{className:"h-4 w-4"})})}));U.displayName=Ie.displayName;function St(t){const s=_t(t),n=r.forwardRef((l,i)=>{const{children:o,...d}=l,c=r.Children.toArray(o),u=c.find(wt);if(u){const m=u.props.children,f=c.map(x=>x===u?r.Children.count(m)>1?r.Children.only(null):r.isValidElement(m)?m.props.children:null:x);return e.jsx(s,{...d,ref:i,children:r.isValidElement(m)?r.cloneElement(m,void 0,f):null})}return e.jsx(s,{...d,ref:i,children:o})});return n.displayName=`${t}.Slot`,n}function _t(t){const s=r.forwardRef((n,l)=>{const{children:i,...o}=n;if(r.isValidElement(i)){const d=kt(i),c=It(o,i.props);return i.type!==r.Fragment&&(c.ref=l?ft(l,d):d),r.cloneElement(i,c)}return r.Children.count(i)>1?r.Children.only(null):null});return s.displayName=`${t}.SlotClone`,s}var Dt=Symbol("radix.slottable");function wt(t){return r.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Dt}function It(t,s){const n={...s};for(const l in s){const i=t[l],o=s[l];/^on[A-Z]/.test(l)?i&&o?n[l]=(...c)=>{const u=o(...c);return i(...c),u}:i&&(n[l]=i):l==="style"?n[l]={...i,...o}
vendor: 6,165 bytes, lines 1-5
1:l==="className"&&(n[l]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function kt(t){let s=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=s&&"isReactWarning"in s&&s.isReactWarning;return n?t.ref:(s=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=s&&"isReactWarning"in s&&s.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var oe="Dialog",[ds]=ts(oe),[Et,C]=ds(oe),us=t=>{const{__scopeDialog:s,children:n,open:l,defaultOpen:i,onOpenChange:o,modal:d=!0}=t,c=r.useRef(null),u=r.useRef(null),[m,f]=ss({prop:l,defaultProp:i??!1,onChange:o,caller:oe});return e.jsx(Et,{scope:s,triggerRef:c,contentRef:u,contentId:be(),titleId:be(),descriptionId:be(),open:m,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(x=>!x),[f]),modal:d,children:n})};us.displayName=oe;var ms="DialogTrigger",Rt=r.forwardRef((t,s)=>{const{__scopeDialog:n,...l}=t,i=C(ms,n),o=se(s,i.triggerRef);return e.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Re(i.open),...l,ref:o,onClick:W(t.onClick,i.onOpenToggle)})});Rt.displayName=ms;var ke="DialogPortal",[Pt,hs]=ds(ke,{forceMount:void 0}),ps=t=>{const{__scopeDialog:s,forceMount:n,children:l,container:i}=t,o=C(ke,s);return e.jsx(Pt,{scope:s,forceMount:n,children:r.Children.map(l,d=>e.jsx(re,{present:n||o.open,children:e.jsx(dt,{asChild:!0,container:i,children:d})}))})};ps.displayName=ke;var ae="DialogOverlay",xs=r.forwardRef((t,s)=>{const n=hs(ae,t.__scopeDialog),{forceMount:l=n.forceMount,...i}=t,o=C(ae,t.__scopeDialog);return o.modal?e.jsx(re,{present:l||o.open,children:e.jsx(Mt,{...i,ref:s})}):null});xs.displayName=ae;var At=St("DialogOverlay.RemoveScroll"),Mt=r.forwardRef((t,s)=>{const{__scopeDialog:n,...l}=t,i=C(ae,n);return e.jsx(mt,{as:At,allowPinchZoom:!0,shards:[i.contentRef],children:e.jsx(O.div,{"data-state":Re(i.open),...l,ref:s,style:{pointerEvents:"auto",...l.style}})})}),B="DialogContent",fs=r.forwardRef((t,s)=>{const n=hs(B,t.__scopeDialog),{forceMount:l=n.forceMount,...i}=t,o=C(B,t.__scopeDialog);return e.jsx(re,{present:l||o.open,children:o.modal?e.jsx(Tt,{...i,ref:s}):e.jsx(Ot,{...i,ref:s})})});fs.displayName=B;var Tt=r.forwardRef((t,s)=>{const n=C(B,t.__scopeDialog),l=r.useRef(null),i=se(s,n.contentRef,l);return r.useEffect(()=>{const o=l.current;if(o)return ut(o)},[]),e.jsx(gs,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(t.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(t.onPointerDownOutside,o=>{const d=o.detail.originalEvent,c=d.button===0&&d.ctrlKey===!0;(d.button===2||c)&&o.preventDefault()}),onFocusOutside:W(t.onFocusOutside,o=>o.preventDefault())})}),Ot=r.forwardRef((t,s)=>{const n=C(B,t.__scopeDialog),l=r.useRef(!1),i=r.useRef(!1);return e.jsx(gs,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(l.current||n.triggerRef.current?.focus(),o.preventDefault()),l.current=!1,i.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(l.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const d=o.target;n.triggerRef.current?.contains(d)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),gs=r.forwardRef((t,s)=>{const{__scopeDialog:n,trapFocus:l,onOpenAutoFocus:i,onCloseAutoFocus:o,...d}=t,c=C(B,n),u=r.useRef(null),m=se(s,u);return ht(),e.jsxs(e.Fragment,{children:[e.jsx(pt,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(xt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Re(c.open),...d,ref:m,onDismiss:()=>c.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Ft,{titleId:c.titleId}),e.jsx(Vt,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Ee="DialogTitle",vs=r.forwardRef((t,s)=>{const{__scopeDialog:n,...l}=t,i=C(Ee,n);return e.jsx(O.h2,{id:i.titleId,...l,ref:s})});vs.displayName=Ee;var bs="DialogDescription",ys=r.forwardRef((t,s)=>{const{__scopeDialog:n,...l}=t,i=C(bs,n);return e.jsx(O.p,{id:i.descriptionId,...l,ref:s})});ys.displayName=bs;var js="DialogClose",Ns=r.forwardRef((t,s)=>{const{__scopeDialog:n,...l}=t,i=C(js,n);return e.jsx(O.button,{type:"button",...l,ref:s,onClick:W(t.onClick,()=>i.onOpenChange(!1))})});Ns.displayName=js;function Re(t){return t?"open":"closed"}var Cs="DialogTitleWarning",[ra,Ss]=gt(Cs,{contentName:B,titleName:Ee,docsSlug:"dialog"}),Ft=({titleId:t})=>{const s=Ss(Cs),n=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users.
2
3If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
4
5For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return r.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Lt="DialogDescriptionWarning",Vt=({contentRef:t,descriptionId:s})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ss(Lt).contentName}}.`;return r.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");s&&i&&(document.getElementById(s)||console.warn(l))},[l,t,s]),null},$t=us,Gt=ps,_s=xs,Ds=fs,ws=vs,Is=ys,Wt=Ns;const Je=$t,Bt=Gt,ks=r.forwardRef(({className:t,...s},n)=>e.jsx(_s,{ref:n,className:T("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s}));ks.displayName=_s.displayName;const ye=r.forwardRef(({className:t,children:s,...n},l)=>e.jsxs(Bt,{children:[e.jsx(ks,{}),e.jsxs(Ds,{ref:l,className:T("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
5nded-lg",t),...n,children:[s,e.jsxs(Wt,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ye.displayName=Ds.displayName;const je=({className:t,...s})=>e.jsx("div",{className:T("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});je.displayName="DialogHeader";const Ne=({className:t,...s})=>e.jsx("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});Ne.displayName="DialogFooter";const Ce=r.forwardRef(({className:t,...s},n)=>e.jsx(ws,{ref:n,className:T("text-lg font-semibold leading-none tracking-tight",t),...s}));Ce.displayName=ws.displayName;const Se=r.forwardRef(({className:t,...s},n)=>e.jsx(Is,{ref:n,className:T("text-sm text-muted-foreground",t),...s}));Se.displayName=Is.displayName;const Ht=De({method:"GET"}).handler(_e("08b40c58c6956e2dd6d775e53a89dfb07e8468252026a74964110fb1e2930ed2")),qt=De({method:"GET"}).handler(_e("caf051527d364801737dfdac53e7fbb9a2f31b8f0f1895f7912ff3cce3aa25cb")),zt=De({method:"POST"}).handler(_e("94bf775d5dbfba2e78bcc6e6a69b580643d272a428f5d34bfc2a11f6d5d3800a")),Ut=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY","DC"],Yt=["None","Thyroid Problems","Allergies","Cataracts","Blurry Vision","Diabetes","Heart Disease","Cancer","Eye Surgery","Frequent Headaches","High Blood Pressure","Asthma","Glaucoma","Double Vision","Seizures"],Kt=["Dry Eye","Double Vision","Blurry Vision","Headaches","Red/Itchy Eyes","Other"],Xt=["Less than 1 year ago","1-2 years ago","3-5 years ago","More than 5 years ago","Never"],Qe=[{label:"Yes",value:"yes"},{label:"No",value:"no"}],es=["Appointment","Demographics","Health","Insurance","Terms and Conditions"];function na(){const{accessCode:t}=ot.useParams(),[s,n]=r.useState(null),[l,i]=r.useState([]),[o,d]=r.useState(!0),[c,u]=r.useState(null),[m,f]=r.useState(0),[x,j]=r.useState(""),[D,w]=r.useState([]),[S,F]=r.useState(""),[g,b]=r.useState(""),[L,Y]=r.useState(""),[H,ie]=r.useState(""),[K,Es]=r.useState(""),[le,Rs]=r.useState(""),[te,Ps]=r.useState(""),[ce,As]=r.useState(""),[de,Ms]=r.useState(""),[Pe,Ts]=r.useState(""),[Ae,Os]=r.useState("self"),[ue,Fs]=r.useState([]),[me,Ls]=r.useState([]),[he,Vs]=r.useState("No"),[Me,$s]=r.useState(""),[q,Gs]=r.useState(""),[_,Ws]=r.useState(""),[V,Bs]=r.useState(""),[z,Te]=r.useState(""),[$,Oe]=r.useState(""),[Fe,Le]=r.useState(""),[G,Ve]=r.useState(""),[k,$e]=r.useState(""),[pe,Ge]=r.useState(""),[Hs,X]=r.useState(!1),[qs,Z]=r.useState(!1),zs=_==="yes"||V==="yes",Us=_!=="yes"||z.trim()&&$.trim(),Ys=V!=="yes"||G.trim()&&k.trim(),[We,Ks]=r.useState(!1),[xe,Xs]=r.useState(!1),[Be,He]=r.useState(!1),[qe,fe]=r.useState(null),[ge,ze]=r.useState(null),[Zs,Js]=r.useState(!1),[Ue,Qs]=r.useState("");r.useEffect(()=>{async function a(){d(!0),u(null);try{const[h,N]=await Promise.all([Ht({data:{accessCode:t}}),qt({data:{accessCode:t}})]);if(!h.ok){u(h.status===404?"Event not found. Please check your link and try again.":"Unable to load event details. Please try again later.");return}const I=h.data?.event??h.data,Q=N.ok?N.data:[];n(I),i(Array.isArray(Q)?Q:Q.slots??[])}catch{u("Unable to connect. Please check your internet and try again.")}finally{d(!1)}}a()},[t]);function ve(a,h,N){N(a.includes(h)?a.filter(I=>I!==h):[...a,h])}const et=s?.needs_insurance?5:4,st=s?.needs_insurance?[0,1,2,3,4]:[0,1,2,4];function Ye(a){return st[a]}function Ke(){switch(Ye(m)){case 0:return!!x;case 1:return!!(S&&g&&L&&H&&K&&le&&te&&ce&&de);case 2:return!!q;case 3:return!!(_&&V&&Us&&Ys);case 4:return xe;default:return!0}}async function tt(){He(!0),fe(null),ze(null);const a={access_code:t,slot_id:x,first_name:S,last_name:g,date_of_birth:de||null,phone:ce,email:te,address:L,city:H,state:K,zip_code:le,sex:Pe,registrant_type:Ae,services:D,insurance:s?.needs_insurance?zs?{has_insurance:!0,vision_coverage:_==="yes",medical_coverage:V==="yes",carrier:_==="yes"?z:G,member_id:_==="yes"?$:k,group_number:_==="yes"?Fe||null:pe||null,..._==="yes"&&V==="yes"?{medical_carrier:G,medical_member_id:k,medical_group_number:pe||null}:{}}:{has_insurance:!1,vision_coverage:!1,medical_coverage:!1}:null,medical:(()=>{const h=/^\d{4}-\d{2}-\d{2}$/.test(q);return{medical_history:ue,symptoms:me,taking_medications:he,medication_details:Me||null,last_exam_date:h?q:null,doctor_notes:!h&&q?`Last eye exam: ${q}`:""}})(),sms_consent:We,terms_agreed:xe};try{const h=await zt({data:{payload:a}}),N=h.data;if(!h.ok||N.ok===!1){fe(N.error||"Registration failed. Please try again."),ze(N.field||null);return}const I=l.find(Q=>Q.id===x);Qs(I?.label||I?.time||""),Js(!0),window.scrollTo({top:0,behavior:"smooth"})}catch{fe("Unable to connect. Please try again.")}finally{He(!1)}}if(o)return e.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:e.jsx(Xe,{className:"h-8 w-8 animate-spin text-primary"})});if(c||!s)return e.jsx("div",{className:"flex min-h-[60vh] items-center justify-center px-4",children:e.jsxs("div",{className:"mx-auto max-w-md w-full rounded-lg border bg-card p-12 text-center",children:[e.jsx(Ze,{className:"mx-auto h-12 w-12 text-destructive"}),e.jsx("p",{className:"mt-4 text-lg font-medium",children:c||"Event not found."})]})});if(Zs)return e.jsx("div",{className:"flex min-h-[60vh] items-center justify-center px-4 py-12",children:e.jsxs("div",{className:"mx-auto max-w-lg w-full rounded-lg border bg-card p-12 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-primary/10",children:e.jsx(vt,{className:"h-8 w-8 text-primary"})}),e.jsx("h2",{className:"mt-6 text-2xl font-bold",children:"You're Registered!"}),e.jsxs("p",{className:"mt-3 text-muted-foreground",children:["Your appointment for ",e.jsx("span",{className:"font-semibold text-foreground",children:s.title})," has been confirmed."]}),Ue&&e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Time: ",e.jsx("span",{className:"font-medium",children:Ue})]}),e.jsxs("p",{className:"mt-4 text-sm text-muted-foreground",children:["A confirmation will be sent to ",e.jsx("span",{className:"font-medium",children:te}),"."]})]})});const J=Ye(m),at=s.needs_insurance?es:es.filter((a,h)=>h!==3);return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-6 sm:py-10",children:[e.jsx("h1",{className:"text-2xl font-semibold text-[#2a8cb5] sm:text-3xl",children:s.title}),e.jsx("div",{className:"mt-4 flex gap-1 sm:gap-2",children:at.map((a,h)=>
5{const N=h===m,I=h<m;return e.jsxs("button",{type:"button",onClick:()=>{h<m&&f(h)},disabled:h>m,className:`flex flex-1 items-center justify-between rounded-md border px-2 py-2 text-xs font-medium transition-colors sm:px-4 sm:text-sm ${N?"border-[#2a8cb5] bg-white text-foreground":I?"border-muted bg-muted/60 text-foreground cursor-pointer":"border-muted bg-muted/30 text-muted-foreground cursor-default"}`,children:[e.jsxs("span",{children:[h+1,". ",a]}),e.jsx("span",{className:`ml-1 h-2.5 w-2.5 rounded-full ${N?"bg-[#1a3a6b]":I?"bg-[#e8a630]":"bg-[#e8a630]/40"}`})]},a)})}),e.jsxs("div",{className:"mt-6 min-h-[400px] rounded-lg border bg-card p-6 sm:p-8",children:[qe&&e.jsxs("div",{className:"mb-6 flex items-start gap-3 rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx(Ze,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),e.jsx("p",{className:"text-sm text-destructive",children:qe})]}),J===0&&e.jsxs("div",{className:"grid gap-8 lg:grid-cols-3",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold",children:"Appointment Date:"}),e.jsxs("p",{className:"text-muted-foreground",children:[s.event_date?new Date(`${s.event_date}T12:00:00`).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"Date TBD"," ",s.start_time&&s.end_time?`${s.start_time} – ${s.end_time}`:""]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold",children:"Appointment Time: *"}),e.jsxs(E,{value:x,onValueChange:j,children:[e.jsx(R,{className:"mt-1 w-full max-w-xs",children:e.jsx(P,{placeholder:"- Select Time -"})}),e.jsx(A,{children:l.map(a=>e.jsxs(y,{value:a.id,disabled:a.available<=0,children:[a.label||a.time,a.available<=0?" (Full)":""]},a.id))})]})]})]}),s.show_service_choices&&(s.allowed_services??s.services)?.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"font-bold",children:"Choose your service"}),e.jsx("div",{className:"space-y-2",children:(s.allowed_services??s.services).map(a=>e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx(U,{checked:D.includes(a.value),onCheckedChange:()=>ve(D,a.value,w)}),e.jsx("span",{className:"text-sm",children:a.label})]},a.value))})]}),(s.full_address||s.address||s.location)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"font-bold",children:"Address:"}),e.jsx("p",{className:"text-sm",children:s.full_address??`${s.address??""} ${s.city??""} ${s.state??""} ${s.zip_code??""}`.trim()}),(s.maps_url||s.address)&&e.jsx("a",{href:s.maps_url??`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(`${s.address} ${s.city} ${s.state} ${s.zip_code}`)}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded border border-[#2a8cb5] px-3 py-1.5 text-xs font-medium text-[#2a8cb5] hover:bg-[#2a8cb5]/5",children:"Open in Maps ↗"})]})]}),J===1&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx(p,{className:"text-sm",children:"Registering for"}),e.jsxs(E,{value:Ae,onValueChange:Os,children:[e.jsx(R,{className:"mt-1 w-full max-w-xs",children:e.jsx(P,{})}),e.jsxs(A,{children:[e.jsx(y,{value:"self",children:"Myself or Spouse"}),e.jsx(y,{value:"child",children:"My Child"}),e.jsx(y,{value:"other",children:"Someone Else"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold text-[#2a8cb5]",children:"Patient Details"}),e.jsx("hr",{className:"mt-1 border-[#2a8cb5]"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"firstName",children:"First Name *"}),e.jsx(v,{id:"firstName",required:!0,value:S,onChange:a=>F(a.target.value),className:ge==="first_name"?"border-destructive":""})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"lastName",children:"Last Name *"}),e.jsx(v,{id:"lastName",required:!0,value:g,onChange:a=>b(a.target.value),className:ge==="last_name"?"border-destructive":""})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"address",children:"Address *"}),e.jsx(v,{id:"address",required:!0,value:L,onChange:a=>Y(a.target.value),className:ge==="address"?"border-destructive":""})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"city",children:"City *"}),e.jsx(v,{id:"city",required:!0,value:H,onChange:a=>ie(a.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"state",children:"State *"}),e.jsxs(E,{value:K,onValueChange:Es,children:[e.jsx(R,{children:e.jsx(P,{placeholder:"--"})}),e.jsx(A,{children:Ut.map(a=>e.jsx(y,{value:a,children:a},a))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"zip",children:"ZIP *"}),e.jsx(v,{id:"zip",required:!0,value:le,onChange:a=>Rs(a.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"email",children:"Email *"}),e.jsx(v,{id:"email",type:"email",required:!0,value:te,onChange:a=>Ps(a.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"phone",children:"Mobile Phone *"}),e.jsx(v,{id:"phone",type:"tel",required:!0,value:ce,onChange:a=>As(a.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"dob",children:"D.O.B *"}),e.jsx(v,{id:"dob",type:"date",required:!0,value:de,onChange:a=>Ms(a.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"sex",children:"Sex *"}),e.jsxs(E,{value:Pe,onValueChange:Ts,children:[e.jsx(R,{children:e.jsx(P,{placeholder:"--"})}),e.jsxs(A,{children:[e.jsx(y,{value:"male",children:"Male"}),e.jsx(y,{value:"female",children:"Female"}),e.jsx(y,{value:"other",children:"Other"}),e.jsx(y,{value:"prefer_not_to_say",children:"Prefer not to say"})]})]})]})]})]}),J===2&&e.jsxs("div",{className:"grid gap-8 lg:grid-cols-2",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-center text-xl font-semibold text-[#2a8cb5]",children:"Medical history"}),e.jsx("hr",{className:"border-[#2a8cb5]"}),e.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 sm:grid-cols-3",children:Yt.map(a=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[e.jsx(U,{checked:ue.includes(a),onCheckedChange:()=>ve(ue,a,Fs)}),a]},a))}),e.jsxs("div",{className:"space-y-1 pt-2",children:[e.jsx(p,{children:"Are you currently taking any medications?"}),e.jsxs(E,{value:he,onValueChange:Vs,children:[e.jsx(R,{className:"w-32",children:e.jsx(P,{})}),e.jsxs(A,{children:[e.jsx(y,{value:"No",children:"No"}),e.jsx(y,{value:"Yes",children:"Yes"})]})]}),he==="Yes"&&e.jsx(v,{className:"mt-2",placeholder:"Please list medications...",value:Me,onChange:a=>$s(a.target.value)})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-center text-xl font-semibold text-[#2a8cb5]",children:"Symptoms"}),e.jsx("hr",{className:"border-[#2a8cb5]"}),e.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:Kt.map(a=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[e.jsx(U,{checked:me.includes(a),onCheckedChange:()=>ve(me,a,Ls)}),a]},a))}),e.jsxs("div",{className:"space-y-1 pt-2",children:[e.jsx(p,{children:"When was your last eye exam? *"}),e.jsxs(E,{value:q,onValueChange:Gs,children:[e.jsx(R,{children:e.jsx(P,{placeholder:"- select -"})}),e.jsx(A,{children:Xt.map(a=>e.jsx(y,{value:a,children:a},a))})]})]})]})]}),J===3&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold text-[#2a8cb5]",children:"Insurance Information"}),e.jsx("hr",{className:"mt-1 border-[#2a8cb5]"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"If you do not have Vision Insurance, you can use your Optical Academy membership and pay only $30.00 for your Eye Exam, which can be paid at the event. Payment will be due at the time of the event. Acceptable forms of payment include Cash or Credit."}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{children:"Do you have Vision Insurance? *"}),e.jsxs(E,{value:_,onValueChange:a=>{Ws(a),a==="yes"?X(!0):(Te(""),Oe(""),Le(""))},children:[e.jsx(R,{className:"max-w-xs",children:e.jsx(P,{placeholder:"- Select -"})}),e.jsx(A,{children:Qe.map(a=>e.jsx(y,{value:a.value,children:a.label},a.value))})]}),_==="yes"&&e.jsx("div",{className:"mt-2 rounded-md border bg-muted/30 p-3 text-sm",children:z&&$?e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"truncate",children:[e.jsx("span",{className:"font-medium",children:z}),$&&e.jsxs("span",{className:"text-muted-foreground",children:[" · Member ID ",$]})]}),e.jsx("button",{type:"button",onClick:()=>X(!0),className:"shrink-0 text-xs font-medium text-[#2a8cb5] underline",children:"Edit"})]}):e.jsx("button",{type:"button",onClick:()=>X(!0),className:"text-xs font-medium text-[#2a8cb5] underline",children:"Add Vision Insurance details"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{children:"Do you have Medical Insurance? *"}),e.jsxs(E,{value:V,onValueChange:a=>{Bs(a),a==="yes"?Z(!0):(Ve(""),$e(""),Ge(""))},children:[e.jsx(R,{className:"max-w-xs",children:e.jsx(P,{placeholder:"- Select -"})}),e.jsx(A,{children:Qe.map(a=>e.jsx(y,{value:a.value,children:a.label},a.value))})]}),V==="yes"&&e.jsx("div",{className:"mt-2 rounded-md border bg-muted/30 p-3 text-sm",children:G&&k?e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"truncate",children:[e.jsx("span",{className:"font-medium",children:G}),k&&e.jsxs("span",{className:"text-muted-foreground",children:[" · Member ID ",k]})]}),e.jsx("button",{type:"button",onClick:()=>Z(!0),className:"shrink-0 text-xs font-medium text-[#2a8cb5] underline",children:"Edit"})]}):e.jsx("button",{type:"button",onClick:()=>Z(!0),className:"text-xs font-medium text-[#2a8cb5] underline",children:"Add Medical Insurance details"})})]})]}),e.jsx(Je,{open:Hs,onOpenChange:X,children:e.jsxs(ye,{className:"sm:max-w-md",children:[e.jsxs(je,{children:[e.jsx(Ce,{children:"Vision Insurance Details"}),e.jsx(Se,{children:"Enter your vision insurance information so we can verify your benefits."})]}),e.jsxs("div",{className:"grid gap-4 py-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"visionCarrier",children:"Insurance Carrier *"}),e.jsx(v,{id:"visionCarrier",value:z,onChange:a=>Te(a.target.value),placeholder:"e.g. VSP, EyeMed"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"visionMemberId",children:"Member ID *"}),e.jsx(v,{id:"visionMemberId",value:$,onChange:a=>Oe(a.target.value),placeholder:"Member ID on card"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"visionGroupNumber",children:"Group Number"}
5),e.jsx(v,{id:"visionGroupNumber",value:Fe,onChange:a=>Le(a.target.value),placeholder:"Group number (if shown)"})]})]}),e.jsx(Ne,{children:e.jsx(ee,{type:"button",disabled:!z.trim()||!$.trim(),className:"bg-[#2a8cb5] hover:bg-[#237a9e]",onClick:()=>X(!1),children:"Save Vision Insurance"})})]})}),e.jsx(Je,{open:qs,onOpenChange:Z,children:e.jsxs(ye,{className:"sm:max-w-md",children:[e.jsxs(je,{children:[e.jsx(Ce,{children:"Medical Insurance Details"}),e.jsx(Se,{children:"Enter your medical insurance information so we can verify your benefits."})]}),e.jsxs("div",{className:"grid gap-4 py-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"medicalCarrier",children:"Insurance Carrier *"}),e.jsx(v,{id:"medicalCarrier",value:G,onChange:a=>Ve(a.target.value),placeholder:"e.g. Aetna, Blue Cross"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"medicalMemberId",children:"Member ID *"}),e.jsx(v,{id:"medicalMemberId",value:k,onChange:a=>$e(a.target.value),placeholder:"Member ID on card"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(p,{htmlFor:"medicalGroupNumber",children:"Group Number"}),e.jsx(v,{id:"medicalGroupNumber",value:pe,onChange:a=>Ge(a.target.value),placeholder:"Group number (if shown)"})]})]}),e.jsx(Ne,{children:e.jsx(ee,{type:"button",disabled:!G.trim()||!k.trim(),className:"bg-[#2a8cb5] hover:bg-[#237a9e]",onClick:()=>Z(!1),children:"Save Medical Insurance"})})]})})]}),J===4&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[e.jsx(U,{checked:We,onCheckedChange:a=>Ks(a===!0),className:"mt-1"}),e.jsxs("span",{className:"text-sm leading-relaxed",children:["By checking this box, I consent to receive SMS related to appointment reminders, scheduling assistance, order status updates, insurance verification, event information, prescription requests, and customer service follow-up from Optical Academy. Reply STOP to opt-out; Reply HELP for support; Message & data rates may apply; Messaging frequency may vary. Visit"," ",e.jsx("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-[#2a8cb5] underline",children:"Privacy Policy"})," ","and"," ",e.jsx("a",{href:"/terms-and-conditions",target:"_blank",rel:"noopener noreferrer",className:"text-[#2a8cb5] underline",children:"Terms of Service"}),"."]})]}),e.jsx("div",{className:"max-h-48 overflow-y-auto rounded border p-4 text-sm leading-relaxed text-muted-foreground",children:"The privacy of your medical information is important to us. We understand that your medical information is personal and we are committed to protecting it. This notice will tell you about the ways we may use and share medical information about you. We also describe your rights and certain duties we have regarding the use and disclosure of medical information. Our Legal Duty-Law Requires Us to keep your medical information private and give you this notice describing our legal duties, privacy practices, and your rights regarding your medical information. Notice of Change to Privacy Practices: Before we make an important change in our privacy practices, we will change this notice and make the new notice available upon request. Use and Disclosure of Your Medical Information. The following section describes different ways that we use and disclose medical information. Not every use or disclosure will be listed. However, we have listed all of the different ways we are permitted to use and disclose medical information. We will not use or disclose your medical information for any purpose not listed below, without your specific written authorization. Any specific written authorization you provide may be revoked at any time by writing to us. For Treatment: We may use medical information about you to provide you with medical treatment or services."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"By submitting this electronic form you confirm that you have read this agreement and agree to its terms and also serves as an acknowledgement that you have received the HIPAA notice form described above."}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx(U,{checked:xe,onCheckedChange:a=>Xs(a===!0)}),e.jsx("span",{className:"text-sm font-semibold",children:"I have READ and AGREE to the terms listed above."})]})]})]}),e.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[m>0&&e.jsx(ee,{type:"button",variant:"default",className:"bg-[#2a8cb5] hover:bg-[#237a9e]",onClick:()=>{f(a=>a-1),window.scrollTo({top:0,behavior:"smooth"})},children:"Previous"}),m<et-1?e.jsx(ee,{type:"button",disabled:!Ke(),className:"bg-[#2a8cb5] hover:bg-[#237a9e]",onClick:()=>{f(a=>a+1),window.scrollTo({top:0,behavior:"smooth"})},children:"Next"}):e.jsx(ee,{type:"button",disabled:!Ke()||Be,className:"bg-[#2a8cb5] hover:bg-[#237a9e]",onClick:tt,children:Be?e.jsxs(e.Fragment,{children:[e.jsx(Xe,{className:"h-4 w-4 animate-spin"})," Submitting..."]}):"Finish"})]})]})}export{na as component};

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.