1import{reactExports as o,jsxRuntimeExports as e,reactDomExports as Wn}from"./react-core-chunk-B2r03cU8.js";import{useSelector as S,useDispatch as os,useStore as Dn,connect as ls}from"./redux-core-chunk-DgWMjMkF.js";import{EVENT_ACTIONS as us,TRACK_ACTION_TYPES as ve,EVENT_CATEGORIES as zn,PRODUCT_AREAS as Hn,getConfig as Yn,datadogLogError as Gn,postJSON as ce,fetchJSON as Ys}from"./app-bundle-B0YfsjKz.js";import{cxHelpers as T,useTrackInAppSalesUx as Ur,useExtendUx as ms,Box_default as i,Text_default as v,formatTimezoneAbbrInZone as Kn,formatLocaleTimeInZone as Qn,formatMonthDayInZone as Zn,getCurrentUserPhone as Xn,useSlotCarousel as Jn,getWidgetSelectedSlot as et,setWidgetSelectedSlot as st,getWidgetPhone as rt,formatPhoneNumber as Vs,setWidgetPhone as nt,formatTimeInZone as tt,incrementOpenedCalendlyMetric as ot,AvatarStrip as lt,DateCarousel as it,SlotPicker as at,TimezoneSelector as ct,Button_default as Le,withUxRoot as Wr,useParams as Dr,usePersistScheduledEvent as dt,incrementScheduledCalendlyMetric as ut,CircularInfinite_default as ze,OfflineConfirmation as _t,buildUtmParams as pt,setSierraHidden as ss,SIERRA_LOADED_EVENT as De,getAdminAccessStepExperimentEnabled as zr,getCurrentCompanyOwner as mt,getCurrentLocationId as ht,getCurrentUserIsOwner as ft,toggleMessengerShown as yt,createChannel as xt,useFormikContext as is,TextField as _e,isEmpty as K,Form as me,Alert_default as hs,LinearProgress_default as bt,setSierraDynamicPosition as gt,flashNotice as A,CheckboxField as Hr,getCurrentCompany as He,getCurrentCompanyLocations as Ye,getCurrentLocation as Gs,getIsMultiLocation as Yr,getCompanyEligibleForMultiLocationPayroll as $e,getPayrollUSStateAbbrOptions as Gr,Formik as Ne,noop as vt,Select_default as Ct,Autocomplete_default as wt,isNull as Ge,MaskedTextInput as jt,PhoneInput_default as Et,TextInput_default as St,useIsMediumScreen as Ke,Link_default as xe,Icon_default as rs,IconButton_default as kt,isValidPhone as Ks,StringSchema as N,ValidationError as At,partial as Ce,actions$8 as Lt,updateLocationSettings as Nt,showPayrollSelfSetupFeinRejectedModal as Kr,verifyFein as Qr,getCurrentCompanyName as Zr,Checkbox_default as Tt,getCurrentCompanyUuid as Pt,getHidePayrollSsWebsiteSocial as It,List_default as Qs,useTrackUx as as,PAYROLL_TRACKING as br,Chip_default as pe,enrollEntityInExperiment as Xr,updatePayrollFeatureFlags as Ot,updateFeatureFlags as Jr,useAppDispatch as en,upsertLinearFlowAnswers as sn,FREQUENCIES_LINEAR_FLOW_MAPPER as Mt,STARTED_TRANSFER as Ft,uniq as Rt,fetchManagePlansProducts as $t,showPayrollConnectBankAccountModal as Vt,EMAIL_REGEX as qt,useIsLargeScreen as rn,getOutsideBusinessHoursVisible as nn,getWithinBusinessHoursVisible as tn,useIsMediumLargeScreen as Bt,getCurrentLocationEntity as on,useSpring as Ut,animated as Wt,browserHistory as gr,MoveMoney as Dt,SelectField as Re,PhoneField as ln,ObjectSchema as Te,lazy as zt,mapValues as Ht,SIDE_PANELS as ns,getCurrentUser as Yt,AlertText_default as Gt,actions$4 as Kt,Box as ie,useHistory as Qt,getCurrentLocationIsCloverEmbedded as Zt,getSSSV2ExperimentEnabled as Xt,updateExperiments as Jt,updateCompanyEligibleForMultiLocationPayroll as eo,PRODUCT_GROWTH_EXPERIMENTS as Je,fetchInAppSalesVisibility as so,LoadingIndicator as qs,MobileAndTablet as ro,LargeDesktop as no}from"./app-init-chunk-kk_CZVyp.js";import{StepLinearIndicator as an}from"./StepLinearIndicator-chunk-D7M2Bw5h.js";import{useSchedulingState as to}from"./useSchedulingState-chunk-724-6J9H.js";import{PhoneInput as oo,MissingTokenNotice as lo}
1from"./PhoneInput-chunk-D5T4ZS_6.js";import{toI18n as d,getTimeZone as cn}from"./tracking-chunk-Cdw_Cfie.js";import{ClickToCallbackWidget as dn}from"./ClickToCallbackWidget-chunk-Ab00gvXI.js";import{navigateToStep as H,navigateToPayroll as un,validate as Ds,FIRST_NAME_SLUG as fs,LAST_NAME_SLUG as ys,setValueAsNumber as Zs,FLASH_MESSAGE_OPTIONS as $,buildValidationErrorMessage as be,handleCheckErrorMessage as Pe,sortQuestions as Qe,filterQuestionsBySlugs as xs,booleanOptions as io,isValidEmail as ao,PERSONAL_PHONE_NUMBER_SLUG as co,EMAIL_SLUG as _n,TITLE_SLUG as uo,NOT_NUMBER_REGEX as pn}from"./util-chunk-DllNjn7B.js";import{useIsMobileOS as _o,FIRST_TIME_RUNNING_PAYROLL_ANSWERS as mn,useValidateStepAccess as he,useShowMobileStepFooter as ge,STEP_NAMES as D,checkAddressErrorFieldMap as po,BackButton as we,getInitialValues as mo,companyAddressesFormSchema as ho,QuestionLabel as cs,ErrorMessage as ts,WorkplaceLegalAddress as fo,BusinessLegalAddress as yo,NextButton as ds,ContactUsLink as hn,ErrorOopsSpilledMug as xo,SetupHomebasePayroll as bo,TermsAndConditions as go,STEP_HEADING as _s,stepComponentMapper as vo}from"./constants-chunk-COHcHPlW.js";import{SidePanelRoot as je}from"./Root-chunk-CMZsAsue.js";import{useIsWebview as bs,useViewportFitCover as Co}from"./useViewportFitCover-chunk-C_OSdOH7.js";import{trackStep as B,EVENT_ACTIONS as F,EVENT_CATEGORIES as R,PRODUCT_AREA as fn}from"./tracking-chunk-CSqLD_u3.js";import{AutocompleteField as Xs}from"./AutocompleteField-chunk-CicPsBBX.js";import{GeoSuggestTextField as Js,getGeosuggestFieldConfig as er}from"./geosuggestFieldConfig-chunk-RltdDTsk.js";import{NumberAsStringField as sr}from"./NumberAsStringField-chunk-Ts_4HS70.js";import{Accordion as wo}from"./Accordion-chunk-BLvSadYE.js";import{AccordionDetails as jo}from"./AccordionDetails-chunk-CG79Ihzm.js";import{AccordionSummary_default as Eo}from"./AccordionSummary-chunk-DFbBG46s.js";import{selectBusinessLegalName as So,selectFein as ko,selectFeinVerificationStatus as yn,selectIsFeinVerificationVerified as Ao,selectIsFeinVerificationPending as Lo,selectIsFeinVerificationRejected as No,selectIsFeinVerificationFinalRejected as To,selectIsFeinVerificationNull as xn,selectIsFeinVerificationWaiting as bn,selectIsFeinVerificationExpired as Po}from"./hooks-chunk-BeRGcVjQ.js";import{useUxTracking as Io}from"./useUxTracking-chunk-ClJWaclS.js";import{useSubmitPaySchedule as Oo,PayPeriod as Mo,usePayrollMobileUxEnrollment as Fo}from"./PayPeriod-chunk-C85oYOeJ.js";import{IMPLEMENTATION_COMPANY_TYPES as vr}from"./constants-chunk-CExiEC4C.js";import{ConnectButton as Ro}from"./ConnectButton-chunk-DlssHw7y.js";import{StepIndicator_default as $o}from"./StepIndicator-chunk-BbXUfvrG.js";import{getLeftNavCollapsed as Vo}from"./nav-chunk-CQUyaSkW.js";import{Communication as qo}from"./Communication-chunk-CPa2QAq-.js";import{Paperwork as Cr}from"./Paperwork-chunk-BmBo1NCw.js";import{TaxIdField as Bo}from"./TaxIdField-chunk-DgzzOe96.js";import{useExperimentEnrollment as wr}from"./useExperimentEnrollment-chunk-D9YzLrmi.js";import{useTrackStepExperiment as Bs}from"./useTrackStepExperiment-chunk-B6oQMQry.js";import Uo from"./index-chunk-BUenPWoB.js";try{(function(){var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new r.Error().stack;s&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[s]="c2a3b2cd-f49e-4d42-b54b-d681a409e186",r._sentryDebugIdIdentifier="sentry-dbid-c2a3b2cd-f49e-4d42-b54b-d681a409e186")})()}catch{}const{cx:Wo,cxEl:Do}=T("OfflineConfirmed"),zo=(r,s)=>{const n=new Date(r);return d("outside_business_hours.confirmed.datetime",{props:{monthDay:Zn(n,s),time:Qn(n,s),tzAbbr:Kn(n,s)}})},Ho=({scheduledEvent:r})=>{const s=Ur();return ms()({widget_state:"scheduled"}),o.useEffect(()=>{s(us.PANEL_VIEWED,ve.VIEW,{scheduled_time:r.start_time})},[s,r.start_time]),e.jsxs(i,{column:!0,gap:16,className:Wo(),children:[e.jsxs(v,{variant:"bodyBold",color:"mono900",children:[d("outside_business_hours.confirmed.your_call_is_scheduled_for"),e.jsx("br",{}),zo(r.start_time,r.invitee_timezone??cn())]}),e.jsx(v,{className:Do("email"),variant:"body",color:"mono900",children:d("outside_business_hours.confirmed.email_confirmation_sent_to",{props:{email:r.invitee_email}})})]})},{cx:Yo}=T("OfflineDefault"),Us="calendlyWidget_selectedSlot",jr="calendlyWidget_phone",zs="calendlyWidget_phoneRedirectToken",gn=()=>performance.getEntriesByType("navigation")[0]?.type==="navigate",Go=()=>sessionStorage.getItem(zs)!=="1"?!1:(sessionStorage.removeItem(zs),gn()),Ko=({onSchedule:r,scheduleError:s})=>{const n=S(Xn),t=os(),a=Ur();ms()({widget_state:"default"}),o.useEffect(()=>{a(us.PANEL_VIEWED,ve.VIEW)},[a]);const[c,u]=o.useState(cn),{currentDate:_,slotsForDate:p,isLoading:m,error:h,isPrevDisabled:x,goToPrev:f,goToNext:y,goToToday:w}=Jn(c,{persist:!0}),b=Dn(),[g,C]=o.useState(()=>{const I=et(b.getState())??(()=>{if(!gn())return null;try{const Q=sessionStorage.getItem(Us);return Q?JSON.parse(Q):null}catch{return null}})();return I&&new Date(I.start_time).getTime()>Date.now()?I:null});o.useEffect(()=>{t(st(g)),g?sessionStorage.setItem(Us,JSON.stringify(g)):sessionStorage.removeItem(Us)},[g,t]),o.useEffect(()=>()=>{sessionStorage.setItem(zs,"1")},[]);const j=o.useRef(!1),[E,k]=o.useState(()=>{const P=rt(b.getState());if(P)return j.current=!0,P;if(Go()){const I=sessionStorage.getItem(jr);if(I)return j.current=!0,I}return Vs(n||"")}),[M,U]=o.useState(!1);o.useEffect(()=>{j.current||k(Vs(n||""))},[n]),o.useEffect(()=>{t(nt(E)),sessionStorage.setItem(jr,E)},[E,t]);const W=o.useCallback(P=>{j.current=!0,k(P)},[]),Z=o.useCallback(()=>{C(null),f()},[f]),X=o.useCallback(()=>{C(null),y()},[y]),J=o.useCallback(P=>{C(null),w(),u(P)}
1,[w]),se=o.useCallback(P=>{C(P),a(us.BUTTON_CLICKED,ve.CLICK,{element:"time_slot",button_text:tt(new Date(P.start_time),c),selected_time:P.start_time})},[a,c]),Y=o.useCallback(()=>{g&&(U(!0),ot("in_app_sales_connect_sss_flow"),a(us.BUTTON_CLICKED,ve.CLICK,{element:"schedule_call_cta",button_text:d("outside_business_hours.cta"),selected_time:g.start_time,phone_number_edited:E!==Vs(n||"")?"true":"false"}),r({slot:g,phone:E,timezone:c}))},[r,g,E,c,a,n]);return e.jsxs(i,{column:!0,gap:16,className:Yo(),children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("outside_business_hours.title")}),e.jsx(lt,{}),e.jsx(it,{date:_,timezone:c,onPrev:Z,onNext:X,isPrevDisabled:x,isLoading:m}),e.jsx(at,{slots:p,selectedSlot:g,timezone:c,onSelect:se,isLoading:m}),e.jsx(ct,{value:c,onChange:J}),e.jsx(oo,{value:E,onChange:W}),e.jsxs(i,{column:!0,gap:8,children:[e.jsx(Le,{variant:"primary",size:"medium",disabled:!g||m||!E||M,onClick:Y,fullWidth:!0,children:d("outside_business_hours.cta")}),(h||s)&&e.jsx(v,{variant:"captions",color:"error",children:d("outside_business_hours.error.schedule_failed")})]})]})},{cx:Qo}=T("OutsideBusinessHoursWidget"),Zo="in_app_sales_connect_sss_flow",Xo=pt("linear_flow",null,"in_app","sales_connect_widget"),Jo=()=>{const{step:r}=Dr(),s=ms();r&&s({step:r});const{scheduledEvent:n,calendlyConfigured:t,isLoadingScheduledEvent:a}=to(),l=Yn().env.name==="production",c=!a&&!t;o.useEffect(()=>{c&&l&&Gn({message:"Calendly not configured in production",context:{component:"OutsideBusinessHoursWidget"}})},[c,l]);const[u,_]=o.useState(null),[p,m]=o.useState(null),[h,x]=o.useState(null),{persist:f}=dt(),y=o.useCallback(j=>{x(null),m(j)},[]),w=o.useCallback(j=>{x(j),m(null)},[]),b=o.useCallback(async j=>{try{const E=await f(j);ut(Zo),_(E),m(null)}catch(E){x(E instanceof Error?E:new Error(String(E))),m(null)}},[f]),g=u??n;if(c)return l?null:e.jsx(i,{maxw:300,children:e.jsx(lo,{})});const C=()=>a?e.jsx(i,{row:!0,justifyContentCenter:!0,alignItemsCenter:!0,w:"100%",h:72,children:e.jsx(ze,{})}):g?e.jsx(Ho,{scheduledEvent:g}):p?e.jsx(_t,{schedulingUrl:p.slot.scheduling_url,phone:p.phone,timezone:p.timezone,utmParams:Xo,modalSource:"sales_connect_widget",onError:w,onScheduled:b}):e.jsx(Ko,{onSchedule:y,scheduleError:h});return e.jsx(i,{column:!0,p:24,bw:1,maxw:p?void 0:250,bcolor:"mono300",bgcolor:"mono0",bradiusm:!0,className:Qo(),children:C()})},vn=Wr({productArea:Hn.PAYROLL_SELF_SERVE,eventCategory:zn.SALES_CONNECT_WIDGET,business_hours:"false"})(Jo),el=92,sl=({isInceptionCompany:r,adminAccessStepExperimentEnabled:s,companyEligibleForMultiLocationPayroll:n})=>o.useMemo(()=>["signatory_details","screener","company_details",...n?["company_addresses"]:[],"pay_and_team","pay_schedule",...r?["setup_fee"]:[],...s?["self_onboard"]:[]],[r,s,n]),Cn=({isInceptionCompany:r,adminAccessStepExperimentEnabled:s,companyEligibleForMultiLocationPayroll:n})=>{const t=sl({isInceptionCompany:r,adminAccessStepExperimentEnabled:s,companyEligibleForMultiLocationPayroll:n}),a=t.map((l,c)=>{const u=c+1,_=u/t.length*el;return{[l]:{stepNumber:u,percentage:Math.round(_)}}});return o.useMemo(()=>Object.assign({},...a),[a])},wn=o.createContext(null),rl=()=>o.useContext(wn),jn=o.createContext(null),En=()=>o.useContext(jn),nl=new Set(["text","email","password","search","tel","url","number"]),Er=r=>r instanceof HTMLElement?r instanceof HTMLTextAreaElement?!0:r instanceof HTMLInputElement?nl.has(r.type):r.isContentEditable:!1,tl=r=>{const s=_o(),[n,t]=o.useState(!1);return o.useLayoutEffect(()=>{if(!r||!s)return;const a=c=>{Er(c.target)&&t(!0)},l=c=>{Er(c.target)&&t(!1)};return document.addEventListener("focusin",a),document.addEventListener("focusout",l),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",l),t(!1)}},[r,s]),n},ol=r=>{const s=bs(),n=r&&!s,t=tl(n);o.useLayoutEffect(()=>{if(!n)return;ss(t);const a=()=>ss(t);return window.addEventListener(De,a),()=>window.removeEventListener(De,a)},[n,t]),o.useLayoutEffect(()=>{if(n)return()=>ss(!1)},[n])},ll=()=>{const r=bs();o.useLayoutEffect(()=>{if(!r)return;const s=()=>ss(!0);
1return s(),window.addEventListener(De,s),()=>{window.removeEventListener(De,s),ss(!1)}},[r])},il=(r,s)=>{const n=S(zr),t=o.useMemo(()=>s?.previous_answers?.first_time_running_payroll===mn.NEVER_RAN_PAYROLL,[s]),a=Cn({isInceptionCompany:t,adminAccessStepExperimentEnabled:n,companyEligibleForMultiLocationPayroll:s.eligible_for_multi_location_payroll});return o.useMemo(()=>{const l=Object.keys(a);return{totalSteps:l.length,currentStepNumber:l.indexOf(r)+1}},[r,a])},{cx:al,cxEl:cl}=T("CommitmentStep"),dl=xt,ul=({stepData:r,mobile:s})=>{he(r);const n=S(mt),t=S(ht),a=S(ft),l=os(),c=o.useCallback(()=>{l(dl({location_id:t,channel:{participants_attributes:[{user_id:n.get("id")}]},prefilledMessage:d("payroll.self_serve.linear_flow.steps.commitment.message_text_for_owner")})),l(yt(!0))},[t,l,n]);return a?e.jsx(i,{hcenter:!0,vcenter:!0,children:e.jsx(ze,{size:"medium",variant:"dark"})}):e.jsx(i,{hcenter:!0,children:e.jsx(i,{pl:s?0:85,pt:s?0:90,w:s?"100%":684,className:al(),children:e.jsxs(i,{column:!0,hcenter:!0,tcenter:!0,children:[e.jsx(v,{variant:s?"heading1":"display3",children:d("payroll.self_serve.linear_flow.steps.commitment.title")}),e.jsx(i,{mt:"xs",children:e.jsx(v,{variant:"heading3",color:"primary",children:d("payroll.self_serve.linear_flow.steps.commitment.subtitle")})}),e.jsx(i,{mt:40,children:e.jsx("img",{src:new URL("https://cdn.joinhomebase.com/assets/payroll_commitment-bundle-DDToEuuD.svg",import.meta.url).href,style:{maxWidth:"100%",height:"auto"}})}),e.jsx(i,{mt:40,children:e.jsx(v,{variant:"body",children:d("payroll.self_serve.linear_flow.steps.commitment.contact_owner",{props:{ownerName:n.get("name")}})})}),e.jsx(i,{w:s?"100%":214,h:"2xl",mt:40,className:cl("button-message-owner"),children:e.jsx(Le,{variant:"primary",onClick:c,fullWidth:!0,children:d("payroll.self_serve.linear_flow.steps.commitment.message_owner")})})]})})})},ae=({bw:r="sm",p:s="lg",...n})=>e.jsx(i,{bradiusm:!0,bgcolor:"mono0",bcolor:"mono300",bw:r,p:s,...n}),Sn=({disabled:r,onGeoSelected:s,payrollStateAbbrOptions:n,mobile:t,locationId:a,placeholders:l=!1,dataTestIdPrefix:c,spacebetween:u})=>{const{values:_}=is(),p=o.useCallback(h=>a!==void 0?`${h}_location_${a}`:h,[a]),m=o.useCallback(h=>c?`${c}-${h}`:void 0,[c]);return e.jsxs(i,{children:[e.jsxs(i,{children:[e.jsx(Js,{...er(),disabled:r,googlePlaceAutocompleteType:"address",hasAsterisk:!0,id:p("line1"),label:d("payroll.add_location_modal.address.line1"),name:p("line1"),onGeoSelected:s,placeholder:l?d("payroll.self_serve.linear_flow.steps.company_addresses.placeholders.line1"):void 0,usOnly:!0,value:_[p("line1")],dataTestId:m("legal-address-input")}),e.jsx(_e,{disabled:r,id:p("line2"),label:d("payroll.add_location_modal.address.line2"),name:p("line2"),placeholder:l?d("payroll.self_serve.linear_flow.steps.company_addresses.placeholders.line2"):void 0})]}),e.jsxs(i,{row:!t,column:t,spacebetween:u,children:[e.jsx(i,{w:"100%",mr:!t&&"xs",children:e.jsx(_e,{disabled:r,hasAsterisk:!0,id:p("city"),label:d("payroll.add_location_modal.address.city"),name:p("city"),dataTestId:m("city-input")})}),e.jsx(i,{w:t?"100%":"50%",mr:!t&&"xs",children:e.jsx(Xs,{disabled:r,hasAsterisk:!0,id:p("state"),label:d("payroll.add_location_modal.address.state"),multiple:!1,name:p("state"),options:n.toJS(),value:_[p("state")],dataTestId:m("state-input")})}),e.jsx(i,{w:t?"100%":"50%",children:e.jsx(sr,{disabled:r,hasAsterisk:!0,id:p("postal_code"),label:d("payroll.add_location_modal.address.postal_code"),name:p("postal_code"),placeholder:l?d("payroll.self_serve.linear_flow.steps.company_addresses.placeholders.zip"):void 0,dataTestId:m("postal-code-input")})})]})]})},{cx:_l}=T("CompanyAddressForm"),pl=({payrollStateAbbrOptions:r,stepData:s,mobile:n})=>{const{setFieldValue:t,errors:a}=is(),l=o.useMemo(()=>!!a.hasCheckCompanyErrors&&Object.keys(a).filter(_=>!_.includes("location")).length>0,[a]),c=o.useCallback(_=>{_.city&&t("city",_.city),_.state&&t("state",_.state),_.zip&&t("postal_code",_.zip),_.name&&t("line1",_.name)},[t]),u=o.useMemo(()=>!K(s.company_addresses.company.check),[s]);return e.jsx(i,{className:_l(),children:e.jsx(i,{column:!0,children:e.jsx(me,{children:e.jsxs(i,{column:!0,gap:"md","data-testid":"company-address-section",children:[e.jsxs(i,{column:!0,gap:"xs",children:[e.jsx(v,{variant:"heading4",children:d("payroll.self_serve.linear_flow.steps.company_addresses.sections.company_legal_address.title")}),e.jsx(v,{variant:"bodySm",color:"secondary",children:d("payroll.self_serve.linear_flow.steps.company_addresses.sections.company_legal_address.subtitle")})]}),l&&e.jsx(i,{mb:n?"md":"lg",children:e.jsx(hs,{variant:"error",children:d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.error_alert")})}),e.jsx(Sn,{disabled:u,onGeoSelected:c,payrollStateAbbrOptions:r,mobile:n,placeholders:!0,dataTestIdPrefix:"business",spacebetween:!0})]})})})})},{cx:ml}=T("MobileStepFooter"),Sr=r=>{gt(r===null?null:{right:"24px",bottom:`${r+24}px`})},kr="--mobile-step-footer-height",Ar=r=>{r===null?document.documentElement.style.removeProperty(kr):document.documentElement.style.setProperty(kr,`${r}px`)},Ee=({backProps:r,nextProps:s,topContent:n})=>{const{previousStep:t,i18nKey:a,onClickCallback:l}=r,c=ge(),u=bs(),_=En();Co(c&&!u);const p=rl(),m=o.useRef(null);o.useLayoutEffect(()=>{const g=m.current;if(!g)return;const C=()=>{Sr(g.offsetHeight),u&&Ar(g.offsetHeight)};
1C(),window.addEventListener(De,C);let j;return typeof ResizeObserver<"u"&&(j=new ResizeObserver(C),j.observe(g)),()=>{j?.disconnect(),window.removeEventListener(De,C),Sr(null),u&&Ar(null)}},[c,p,u]);const h=o.useCallback(()=>{l?.(),t&&H(t)},[l,t]),x=o.useCallback(()=>{s&&s.handleClickNext(s.stepData.step,s.stepData.questions)},[s]);if(!c||!p)return null;const f=!!t,{totalSteps:y=0,currentStepNumber:w=0}=_??{},b=y>0?w/y*100:0;return Wn.createPortal(e.jsxs(i,{ref:m,className:ml({webview:u}),bgcolor:"mono0",shadow:"z1",shadowDirection:"top",children:[y>1&&w>0&&e.jsx(bt,{height:"small",progress:b,hidePercentage:!0}),e.jsxs(i,{column:!0,gap:"sm",pt:"md",pb:u?0:"md",ph:"md",children:[n,e.jsxs(i,{row:!0,gap:"md",children:[f&&e.jsx(i,{grow:1,basis:0,children:e.jsx(Le,{fullWidth:!0,variant:"secondary",uxElement:"back",onClick:h,children:d(a||"payroll.self_serve.v2.linear_flow.back")})}),s&&e.jsx(i,{grow:1,basis:0,children:e.jsx(Le,{fullWidth:!0,variant:"primary",uxElement:"next",onClick:x,disabled:s.disabled,isLoading:s.isLoading,children:d("payroll.self_serve.v2.linear_flow.next")})})]})]})]}),p)},{cx:hl}=T("Footer"),fl=({currentCompanyLocations:r,stepData:s})=>{const{errors:n,values:t,setErrors:a}=is(),[l,c]=o.useState(!1),u=ge(),_=o.useMemo(()=>({address:{line1:t.line1,line2:t.line2,city:t.city,state:t.state,postal_code:t.postal_code}}),[t]),p=o.useMemo(()=>r.toJS().map(x=>({location_id:x.id,address:{line1:t[`line1_location_${x.id}`],line2:t[`line2_location_${x.id}`],city:t[`city_location_${x.id}`],state:t[`state_location_${x.id}`],postal_code:t[`postal_code_location_${x.id}`]}})),[r,t]),m=o.useCallback(()=>{c(!0),ce("/payroll/linear_flow/save_answers",{step:D.COMPANY_ADDRESSES,answers:{company_address:_,workplace_addresses:p}}).then(()=>{Ys("/payroll/linear_flow").then(x=>{H(x.current_required_step)}).catch(x=>{throw c(!1),x})}).catch(x=>{x.response.json().then(f=>{c(!1);const y=po(f.error);typeof y=="object"?a(y):A.error({...y,hasCheckCompanyErrors:!1,hasCheckWorkplaceErrors:!1}),window.scrollTo(0,0)})})},[_,a,p]),h=!!n&&Object.keys(n).length>0;return u?e.jsx(Ee,{backProps:{previousStep:s.previous_step},nextProps:{handleClickNext:m,stepData:s,disabled:h,isLoading:l}}):e.jsx(i,{className:hl(),children:e.jsx(i,{column:!0,children:e.jsx(me,{children:e.jsxs(i,{row:!0,hright:!0,gap:"md",children:[e.jsx(we,{previousStep:s.previous_step,i18nKey:void 0,onClickCallback:void 0}),e.jsx(Le,{type:"submit",variant:"primary",endIcon:"ChevronRight",onClick:m,isLoading:l,disabled:h,children:d("actions.next")})]})})})})},{cx:yl}=T("SameCompanyAddressCheckbox"),xl=({currentLocationId:r})=>{const{setFieldValue:s,values:n,validateForm:t}=is(),a=o.useCallback(l=>{const{checked:c}=l.target;c?(s(`line1_location_${r}`,n.line1),s(`line2_location_${r}`,n.line2),s(`city_location_${r}`,n.city),s(`state_location_${r}`,n.state),s(`postal_code_location_${r}`,n.postal_code)):(s(`line1_location_${r}`,""),s(`line2_location_${r}`,""),s(`city_location_${r}`,""),s(`state_location_${r}`,""),s(`postal_code_location_${r}`,"")),s("sameCompanyAddressCheckbox",c).then(()=>{t()})},[r,s,n.city,n.line1,n.line2,n.postal_code,n.state,t]);return e.jsx(i,{className:yl(),children:e.jsx(i,{column:!0,children:e.jsx(me,{children:e.jsx(i,{column:!0,children:e.jsx(i,{children:e.jsx(Hr,{dataTestId:"sameCompanyAddressCheckbox",label:d("payroll.self_serve.linear_flow.steps.company_addresses.same_company_address_checkbox_label"),name:"sameCompanyAddressCheckbox",onChange:a})})})})})})},bl=({title:r,iconName:s,iconColor:n,body:t,expanded:a,locationId:l})=>{const[c,u]=o.useState(a),_=o.useCallback(()=>{u(p=>!p)},[]);return e.jsx(i,{bw:"sm",bcolor:"mono300",bradiuss:!0,shadow:"z1",shadowDirection:"bottom",ph:"xs",pt:"xs",children:e.jsxs(wo,{id:`accordion-location-${l}`,disableGutters:!0,expanded:c,onChange:_,children:[e.jsx(Eo,{title:r,iconName:s,iconColor:n,sx:{"& .FDBText":{fontWeight:600}}}),e.jsx(jo,{children:t})]})})},{cx:gl}=T("WorkplaceAddressesForm"),vl=({currentCompanyLocations:r,currentLocation:s,isMultiLocation:n,mobile:t,payrollStateAbbrOptions:a,stepData:l})=>{const{setFieldValue:c,values:u,errors:_}=is(),[p,m]=o.useState({});o.useEffect(()=>{const b={};r.forEach(g=>{b[g?.get("id")]=!g?.get("check_workplace")}),m(b)},[r]);const h=o.useMemo(()=>!!_.hasCheckWorkplaceErrors&&Object.keys(_).some(b=>b.includes("location")),[_]),x=o.useCallback((b,g)=>{g.city&&c(`city_location_${b}`,g.city),g.state&&c(`state_location_${b}`,g.state),g.zip&&c(`postal_code_location_${b}`,g.zip),g.name&&c(`line1_location_${b}`,g.name)},[c]),f=o.useCallback(b=>g=>x(b,g),[x]),y=o.useCallback(b=>{const g=l.company_addresses.workplaces.find(C=>C.location_id===b);return!!(g&&g.check_workplace)},[l]),w=o.useCallback(b=>{const g=r.find(E=>E?.get("id")===b),C=y(b),j=e.jsx(Sn,{disabled:C||!!u.sameCompanyAddressCheckbox,onGeoSelected:f(b),payrollStateAbbrOptions:a,mobile:t,locationId:b});return e.jsx(bl,{body:j,title:g?.get("name"),iconName:C?"Complete":void 0,iconColor:"success300",expanded:p[b],locationId:b},b)},[r,p,y,t,f,a,u]);return e.jsx(i,{className:gl(),children:e.jsx(i,{column:!0,gap:t?"md":"lg",children:e.jsx(me,{children:e.jsxs(i,{"data-testid":"workplace-addresses-section",children:[e.jsxs(i,{column:!0,gap:"md",children:[e.jsx(v,{variant:"heading4",children:d("payroll.self_serve.linear_flow.steps.company_addresses.sections.workplace_addresses.title")}),!n&&!y(s.get("id"))&&e.jsx(xl,{currentLocationId:s.get("id")}),h&&e.jsx(hs,{variant:"error",children:d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.error_alert")})]}),!K(p)&&r.map(b=>w(b?.get("id")))]})})})})},{cx:Cl}=T("CompanyAddressesStep"),wl=({stepData:r,mobile:s})=>{const n=S(He),t=S(Ye),a=S(Gs),l=S(Yr),c=S($e),u=S(Gr);o.useEffect(()=>{c||un()},[c]),he(r),o.useEffect(()=>{B(R.COMPANY_ADDRESSES,F.PAGE_VIEWED)},[]);const _=o.useMemo(()=>c?mo(r,t):{},[c,t,r]);return c?e.jsx(Ne,{validationSchema:ho,initialValues:_,validateOnBlur:!0,onSubmit:vt,children:e.jsxs(i,{column:!0,gap:s?"md":"lg",children:[e.jsxs(ae,{className:Cl(),children:[e.jsxs(i,{mb:"md",column:!0,gap:"2xs",children:[e.jsx(v,{variant:s?"heading3":"heading2",color:"mono900",children:d("payroll.self_serve.linear_flow.steps.company_addresses.title",{props:{companyName:n.get("name")}})}),e.jsx(v,{color:"primary",children:d("payroll.self_serve.linear_flow.steps.company_addresses.subtitle")})]}),e.jsx(i,{"data-testid":"company-addresses-form",maxw:!s&&800,children:e.jsxs(i,{column:!0,gap:"md",children:[e.jsx(pl,{payrollStateAbbrOptions:u,stepData:r,mobile:s}),e.jsx(vl,{currentCompanyLocations:t,currentLocation:a,isMultiLocation:l,payrollStateAbbrOptions:u,stepData:r,mobile:s})]})})]}),e.jsx(fl,{currentCompanyLocations:t,stepData:r})]})}):e.jsx(i,{hcenter:!0,vcenter:!0,children:e.jsx(ze,{size:"medium",variant:"dark"})})},gs=o.createContext(void 0),jl=({name:r,label:s,value:n,onChange:t,onF
1ocus:a,options:l,placeholder:c,isRequired:u=!0,dataTestId:_,errorMessage:p,tooltip:m})=>{const h=o.useCallback(f=>t(String(f.target.value)),[t]),x=o.useCallback(()=>a?.(),[a]);return e.jsxs(i,{column:!0,children:[e.jsx(cs,{label:s,isRequired:u,tooltip:m}),e.jsxs(i,{mt:"2xs",onFocus:x,children:[e.jsx(Ct,{name:r,dataTestId:_,value:n??"",onChange:h,options:l,placeholder:c,error:!!p}),p&&e.jsx(i,{mt:"2xs",children:e.jsx(v,{variant:"bodySm",color:"error300",children:p})})]})]})},kn=({name:r,label:s,value:n,onChange:t,onFocus:a,options:l,placeholder:c,isRequired:u=!0,dataTestId:_,errorMessage:p,tooltip:m})=>{const h=o.useMemo(()=>l.find(y=>y.value===n)??null,[l,n]),x=o.useCallback((y,w)=>{const b=w&&typeof w=="object"&&!Array.isArray(w);t(b?String(w.value):null)},[t]),f=o.useCallback(()=>a?.(),[a]);return e.jsxs(i,{column:!0,children:[e.jsx(cs,{label:s,isRequired:u,tooltip:m}),e.jsxs(i,{mt:"2xs",children:[e.jsx(wt,{name:r,dataTestId:_,value:h,onFocus:f,onChange:x,options:l,placeholder:c,error:!!p,showCaret:!0}),p&&e.jsx(i,{mt:"2xs",children:e.jsx(v,{variant:"bodySm",color:"error300",children:p})})]})]})},Lr=r=>{const s=d(r);return s===r?void 0:s},El=6,ps=({step:r,slug:s,value:n,state:t,options:a,context:l,children:c,isRequired:u=!0})=>{const[_,p]=o.useState([]),m=o.useCallback(()=>Ge(t.fieldValue)?n??null:t.fieldValue,[t.fieldValue,n]),[h,x]=o.useState(null);o.useEffect(()=>{p((a??[]).map(g=>({label:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.options.${g}`),value:g})))},[a,s,r]),o.useEffect(()=>{const g=m();t.setFieldValue(g),g!==null&&x(Ds(g,t.validation))},[]);const f=o.useCallback(g=>{t.setFieldValue(g);const C=Ds(g,t.validation);x(C),l?.setValidationErrors?.(!!C),t.trackingChange&&t.trackingChange({[t.trackingKey]:g})},[l,t]),y=o.useCallback(()=>{t.trackingFocus&&t.trackingFocus(t.trackingKey)},[t]),b=t.searchable??_.length>El?kn:jl;return e.jsxs(i,{column:!0,gap:"xs",grow:!0,...t.inputContainerStyle,children:[e.jsx(b,{name:s,label:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.title`),value:m(),onChange:f,onFocus:y,options:_,placeholder:Lr(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.placeholder`),isRequired:u,dataTestId:t.dataTestId,tooltip:Lr(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.tooltip`)}),h&&e.jsx(i,{mt:"xs",children:e.jsx(ts,{errorMessage:h.message})}),t.checkAddressError&&e.jsx(i,{mt:"xs",children:e.jsx(ts,{errorMessage:t.checkAddressError})}),c]})},Sl=({name:r,label:s,value:n,onChange:t,onFocus:a,onBlur:l,placeholder:c,isRequired:u=!0,dataTestId:_,disabled:p,error:m,errorMessage:h,maxLength:x,tooltip:f,mask:y,stripChars:w,inputMode:b})=>{const g=o.useCallback(E=>t(String(E.target.value)),[t]),C=o.useCallback(()=>a?.(),[a]),j=o.useCallback(()=>l?.(),[l]);return e.jsxs(i,{column:!0,children:[e.jsx(cs,{label:s,isRequired:u,tooltip:f}),e.jsxs(i,{mt:"2xs",children:[e.jsx(jt,{mask:y,stripChars:w,name:r,value:n??"",onChange:g,onFocus:C,onBlur:j,placeholder:c,dataTestId:_,disabled:p,error:m||!!h,maxLength:x,inputMode:b}),h&&e.jsx(i,{mt:"2xs",children:e.jsx(v,{variant:"bodySm",color:"error300",children:h})})]})]})},An=({name:r,label:s,value:n,onChange:t,onFocus:a,onBlur:l,isRequired:c=!0,dataTestId:u,disabled:_,error:p,errorMessage:m,tooltip:h})=>{const x=o.useCallback(w=>t(String(w.target.value)),[t]),f=o.useCallback(()=>a?.(),[a]),y=o.useCallback(()=>l?.(),[l]);return e.jsxs(i,{column:!0,children:[e.jsx(cs,{label:s,isRequired:c,tooltip:h}),e.jsxs(i,{mt:"2xs",children:[e.jsx(Et,{name:r,value:n??"",onChange:x,onFocus:f,onBlur:y,dataTestId:u,disabled:_,error:p||!!m}),m&&e.jsx(i,{mt:"2xs",children:e.jsx(v,{variant:"bodySm",color:"error300",children:m})})]})]})},rr=({name:r,label:s,value:n,onChange:t,onFocus:a,onBlur:l,placeholder:c,isRequired:u=!0,dataTestId:_,type:p,disabled:m,error:h,errorMessage:x,maxLength:f,tooltip:y})=>{const w=o.useCallback(C=>t(String(C.target.value)),[t]),b=o.useCallback(()=>a?.(),[a]),g=o.useCallback(()=>l?.(),[l]);return e.jsxs(i,{column:!0,children:[e.jsx(cs,{label:s,isRequired:u,tooltip:y}),e.jsxs(i,{mt:"2xs",children:[e.jsx(St,{name:r,type:p,value:n??"",onChange:w,onFocus:b,onBlur:g,placeholder:c,dataTestId:_,disabled:m,error:h||!!x,maxLength:f,isClearable:!0}),x&&e.jsx(i,{mt:"2xs",children:e.jsx(v,{variant:"bodySm",color:"error300",children:x})})]})]})},Nr=r=>{const s=d(r);return s===r?void 0:s},Tr=["signer","admin","company","accountant"],Pr={ein:[/\d/,/\d/,"-",/\d/,/\d/,/\d/,/\d/,/\d/,/\d/,/\d/],zip:[/\d/,/\d/,/\d/,/\d/,/\d/]},kl={ein:[/-/g]},Al={ein:"numeric",zip:"numeric"},Ir=({step:r,slug:s,questionFormat:n,value:t,children:a,state:l,suggestedValue:c,context:u,isRequired:_=!0})=>
1{const p=Ge(l.fieldValue)?t||c||null:l.fieldValue,[m,h]=o.useState(null);o.useEffect(()=>{p&&l.setFieldValue(p),s===fs&&u?.setFirstNameValidationError?.(Tr.some(C=>p?.toLowerCase()?.includes(C))),s===ys&&u?.setLastNameValidationError?.(Tr.some(C=>p?.toLowerCase()?.includes(C)))},[p,s]),o.useEffect(()=>{l.onLoadInitialValue&&l.onLoadInitialValue(t)},[t]);const x=o.useCallback(C=>{l.setFieldValue(C);const j=Ds(C,l.validation);h(j),u?.setValidationErrors?.(!!j),l.trackingChange&&l.trackingChange({[l.trackingKey]:C})},[u,l]),f=o.useCallback(()=>{l.onBlur&&!m&&l.onBlur()},[m,l]),y=o.useCallback(()=>{l.trackingFocus&&l.trackingFocus(l.trackingKey)},[l]),w=d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.title`),b=Nr(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.placeholder`),g={name:s,label:w,value:p,onChange:x,onFocus:y,onBlur:f,placeholder:b,isRequired:_,dataTestId:l.dataTestId||`${s}-input`,disabled:l.disabled,error:l.errorBorder,maxLength:l.maxInputLength,tooltip:Nr(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.tooltip`)};return e.jsxs(i,{column:!0,gap:"xs",children:[n==="tel"?e.jsx(An,{...g}
1):n&&Pr[n]?e.jsx(Sl,{...g,mask:Pr[n],stripChars:kl[n],inputMode:Al[n]}):e.jsx(rr,{...g}),m&&e.jsx(i,{mt:"xs",children:e.jsx(ts,{errorMessage:m.message})}),l.checkAddressError&&e.jsx(i,{mt:"xs",children:e.jsx(ts,{errorMessage:l.checkAddressError})}),a]})},Fe={verified:"verified",rejected:"rejected",final_rejected:"final_rejected",waiting:"waiting",expired:"expired"},Ll={[Fe.verified]:!0,[Fe.final_rejected]:!0,[Fe.expired]:!0},Nl=["business_legal_name","federal_employer_identification_number","business_phone_number","dba_or_trade_name","company_industry","average_total_payroll_amount","business_type"],Tl=["website","social_media"],Pl=["business_legal_address_line1","business_legal_address_line2","business_legal_address_city","business_legal_address_state","business_legal_address_postal_code"],Il=["workplace_legal_address_line1","workplace_legal_address_line2","workplace_legal_address_city","workplace_legal_address_state","workplace_legal_address_postal_code"],{cx:Ol}=T("ApplyForFeinLink"),Ml="https://www.irs.gov/businesses/small-businesses-self-employed/apply-for-an-employer-identification-number-ein-online",Or="payroll.self_serve.linear_flow.steps.company_details.apply_for_fein",Fl=()=>{const r=S(Ye),s=S($e),n=Ke(),t=o.useCallback(()=>{B(R.COMPANY_DETAILS,F.HELPER_LINK_CLICKED,{cta:d(Or)})},[]);return e.jsxs(i,{vcenter:!0,column:!0,className:Ol(),children:[e.jsx(i,{children:e.jsx(xe,{href:Ml,onClick:t,target:"_blank",...n&&{endIcon:"ExternalLink"},size:"small",children:d(Or)})}),s&&r.size>1&&e.jsxs(i,{vcenter:!0,row:!0,mt:"sm","data-testid":"multi_location_fein_info_icon",children:[e.jsx(rs,{iconName:"Info",size:"small",color:"info300"}),"Â ",e.jsx(v,{variant:"bodySm",children:d("payroll.self_serve.linear_flow.steps.company_details.multi_location_fein_info")})]})]})},{cx:Rl}=T("BusinessLegalNameSuggestedFormat"),$l=()=>{const r=o.useContext(gs);return e.jsx(i,{column:!0,className:Rl(),children:e.jsx(xe,{onClick:r.toggleSuggestion,size:"small",children:d("payroll.self_serve.linear_flow.steps.company_details.business_legal_name_suggested_format.text")})})},Vl=()=>{const r=o.useContext(gs),s=Ke();return r.isSuggestionVisible?e.jsxs(i,{column:!0,gap:"xs",w:"100%",bradiusm:!0,bgcolor:"mono100",p:"xs",relative:!0,children:[e.jsx(i,{absolute:!0,style:{top:8,right:8},children:e.jsx(kt,{icon:"Close",label:"Close suggestion",onClick:r.hideSuggestion,size:"xsmall"})}),e.jsx(i,{pt:"md",children:e.jsx(v,{variant:s?"body":"bodySm",color:"primary",asHTML:!0,children:d("payroll.self_serve.linear_flow.steps.company_details.business_legal_name_suggested_format.popup_text")})}),e.jsx("img",{src:new URL("https://cdn.joinhomebase.com/assets/business_legal_name_suggested_format-bundle-BMx1GWOZ.svg",import.meta.url).href})]}):null},nr="payroll.self_serve.linear_flow.errors.validations",Ln=d(`${nr}.required`),ql=d(`${nr}.invalid_url`),Bl=d(`${nr}.invalid_fein`),Ul=/^((ftp|http|https):\/\/)?(www.)?(?!.*(ftp|http|https|www.))[a-zA-Z0-9_-]+(\.[a-zA-Z]+)+((\/)[\w#-]+)*(\/\w+\?[a-zA-Z0-9_]+=\w+(&[a-zA-Z0-9_]+=\w+)*)?$/gm,Wl=/^\d{2}-?\d{7}$/,Dl=Ks(),le=N().required(Ln).nullable(),zl=N().required(Ln).matches(Wl,{message:Bl,excludeEmptyString:!0}).nullable(),Hl=N().matches(Ul,{message:ql,excludeEmptyString:!0}).nullable(),Yl=()=>({validateSync(r){if(r){const s=Dl(r?.replace(/[^\d]/g,""));if(s)throw new At(s,r,"business_phone_number");return!!s}}}),Gl=({businessLegalName:r,fein:s,formState:n,reduxHandlers:t,companyEligibleForMultiLocationPayroll:a,checkAddressError:l,handleCompanyDetailsFocus:c,handleBusinessLegalAddressFocus:u,handleWorkplaceAddressFocus:_,handleOnloadInitialValueDBA:p,handleOnloadInitialValueWebsite:m,feinValidation:h})=>({business_legal_name:{fieldValue:r,setFieldValue:t.setBusinessLegalName,trackingKey:"legal_business_name",order:1,isRequired:!0,trackingFocus:c,children:$l,setValueAsNumber:Zs,validation:le,errorBorder:h.errorBorder,onBlur:h.handleOnBlurFeinValidationFields,icon:h.icon,disabled:h.disabled,tooltipEnabled:h.tooltipEnabled,tooltipI18n:h.legalNameTooltipI18n,dataTestId:"business-legal-name-input"},federal_employer_identification_number:{fieldValue:s,setFieldValue:t.setFe
1in,trackingKey:"ein",order:2,isRequired:!0,children:Fl,trackingFocus:c,validation:zl,errorBorder:h.errorBorder,onBlur:h.handleOnBlurFeinValidationFields,disabled:h.disabled,icon:h.icon,tooltipEnabled:h.tooltipEnabled,tooltipI18n:h.feinTooltipI18n,dataTestId:"ein-input"},dba_or_trade_name:{fieldValue:n.dbaOrTradeName,setFieldValue:n.setDbaOrTradeName,trackingKey:"dba",order:3,isRequired:!1,trackingFocus:c,onLoadInitialValue:p},average_total_payroll_amount:{fieldValue:n.averageTotalPayrollAmount,setFieldValue:n.setAverageTotalPayrollAmount,trackingKey:"avg_pay_amount",order:4,isRequired:!0,trackingFocus:c,validation:le,searchable:!1,dataTestId:"revenue-select"},company_industry:{fieldValue:n.companyIndustry,setFieldValue:n.setCompanyIndustry,trackingKey:"industry",order:5,isRequired:!0,trackingChange:Ce(B,R.COMPANY_DETAILS,F.INDUSTRY_SELECTED),trackingFocus:c,validation:le,dataTestId:"industry-select"},business_type:{fieldValue:n.businessType,setFieldValue:n.setBusinessType,trackingKey:"business_type",order:6,isRequired:!0,trackingFocus:c,validation:le,dataTestId:"business-type-select"},business_phone_number:{fieldValue:n.businessPhoneNumber,setFieldValue:n.setBusinessPhoneNumber,trackingKey:"business_phone_number",order:7,isRequired:!0,trackingFocus:c,validation:Yl(),dataTestId:"business-phone-number-input"},website:{fieldValue:n.website,setFieldValue:n.setWebsite,trackingKey:"website",order:8,isRequired:!1,trackingFocus:c,validation:Hl,onLoadInitialValue:m},social_media:{fieldValue:n.socialMedia,setFieldValue:n.setSocialMedia,trackingKey:"social_media",order:9,isRequired:!1,trackingFocus:c},business_legal_address_line1:{component:yo,fieldValue:n.businessLegalAddressLine1,setFieldValue:n.setBusinessLegalAddressLine1,trackingKey:"add_one",trackingFocus:u,isRequired:!a,order:10,validation:le,checkAddressError:l?.includes("premise")?l:null,dataTestId:"business-address-input"},business_legal_address_line2:{fieldValue:n.businessLegalAddressLine2,setFieldValue:n.setBusinessLegalAddressLine2,trackingKey:"add_two",trackingFocus:u,isRequired:!1,order:11},business_legal_address_city:{fieldValue:n.businessLegalAddressCity,setFieldValue:n.setBusinessLegalAddressCity,trackingKey:"city",trackingFocus:u,isRequired:!a,order:12,validation:le,checkAddressError:l?.includes("city")?l:null,dataTestId:"business-city-input"},business_legal_address_state:{fieldValue:n.businessLegalAddressState,setFieldValue:n.setBusinessLegalAddressState,trackingKey:"state",trackingFocus:u,trackingChange:Ce(B,R.BUSINESS_LEGAL_ADD,F.STATE_SELECTED),isRequired:!a,order:13,validation:le,checkAddressError:l?.includes("state")?l:null,dataTestId:"business-state-input"},business_legal_address_postal_code:{fieldValue:n.businessLegalAddressPostalCode,setFieldValue:n.setBusinessLegalAddressPostalCode,trackingKey:"zip_code",trackingFocus:u,isRequired:!a,order:14,maxInputLength:5,validation:le,checkAddressError:l?.includes("postal")?l:null},workplace_legal_address_line1:{component:fo,fieldValue:n.isSameLegalAddressForWorkplace?n.businessLegalAddressLine1:n.workplaceLegalAddressLine1,setFieldValue:n.setWorkplaceLegalAddressLine1,trackingKey:"add_one",trackingFocus:_,isRequired:!n.isSameLegalAddressForWorkplace&&!a,order:15,validation:n.isSameLegalAddressForWorkplace?null:le,checkAddressError:l?.includes("premise")?l:null},workplace_legal_address_line2:{fieldValue:n.isSameLegalAddressForWorkplace?n.businessLegalAddressLine2:n.workplaceLegalAddressLine2,setFieldValue:n.setWorkplaceLegalAddressLine2,trackingKey:"add_two",trackingFocus:_,isRequired:!1,order:16},workplace_legal_address_city:{fieldValue:n.isSameLegalAddressForWorkplace?n.businessLegalAddressCity:n.workplaceLegalAddressCity,setFieldValue:n.setWorkplaceLegalAddressCity,trackingKey:"city",trackingFocus:_,isRequired:!n.isSameLegalAddressForWorkplace&&!a,order:17,validation:n.isSameLegalAddressForWorkplace?null:le,checkAddressError:l?.includes("city")?l:null},workplace_legal_address_state:{fieldValue:n.isSameLegalAddressForWorkplace?n.businessLegalAddressState:n.workplaceLegalAddressState,setFieldValue:n.setWorkplaceLegalAddressState,trackingKey:"state",trackingFocus:_,trackingChange:Ce(B,R.WORKPLACE_ADD,F.STATE_
1SELECTED),isRequired:!n.isSameLegalAddressForWorkplace&&!a,order:18,validation:n.isSameLegalAddressForWorkplace?null:le,checkAddressError:l?.includes("state")?l:null},workplace_legal_address_postal_code:{fieldValue:n.isSameLegalAddressForWorkplace?n.businessLegalAddressPostalCode:n.workplaceLegalAddressPostalCode,setFieldValue:n.setWorkplaceLegalAddressPostalCode,trackingKey:"zip_code",trackingFocus:_,isRequired:!n.isSameLegalAddressForWorkplace&&!a,order:19,maxInputLength:5,validation:n.isSameLegalAddressForWorkplace?null:le,checkAddressError:l?.includes("postal")?l:null}}),Kl=()=>{const[r,s]=o.useState(null),[n,t]=o.useState(null),[a,l]=o.useState(null),[c,u]=o.useState(void 0),[_,p]=o.useState(null),[m,h]=o.useState(null),[x,f]=o.useState(null),[y,w]=o.useState(null),[b,g]=o.useState(null),[C,j]=o.useState(null),[E,k]=o.useState(null),[M,U]=o.useState(null),[W,Z]=o.useState(null),[X,J]=o.useState(null),[se,Y]=o.useState(null),[P,I]=o.useState(null),[Q,O]=o.useState(null),[L,V]=o.useState(null),[re,z]=o.useState(null),[ee,q]=o.useState(!1),[fe,te]=o.useState(!1),[de,Ie]=o.useState(!1);return{checkAddressError:r,setCheckAddressError:s,checkRawError:n,setCheckRawError:t,businessPhoneNumber:a,setBusinessPhoneNumber:l,dbaOrTradeName:c,setDbaOrTradeName:u,companyIndustry:_,setCompanyIndustry:p,averageTotalPayrollAmount:m,setAverageTotalPayrollAmount:h,website:x,setWebsite:f,socialMedia:y,setSocialMedia:w,businessType:b,setBusinessType:g,businessLegalAddressLine1:C,setBusinessLegalAddressLine1:j,businessLegalAddressLine2:E,setBusinessLegalAddressLine2:k,businessLegalAddressCity:M,setBusinessLegalAddressCity:U,businessLegalAddressState:W,setBusinessLegalAddressState:Z,businessLegalAddressPostalCode:X,setBusinessLegalAddressPostalCode:J,workplaceLegalAddressLine1:se,setWorkplaceLegalAddressLine1:Y,workplaceLegalAddressLine2:P,setWorkplaceLegalAddressLine2:I,workplaceLegalAddressCity:Q,setWorkplaceLegalAddressCity:O,workplaceLegalAddressState:L,setWorkplaceLegalAddressState:V,workplaceLegalAddressPostalCode:re,setWorkplaceLegalAddressPostalCode:z,isSameLegalAddressForWorkplace:ee,setIsSameLegalAddressForWorkplace:q,isNextLoading:fe,setIsNextLoading:te,validationErrors:de,setValidationErrors:Ie}},{setFein:Ql,setBusinessLegalName:Zl,setVerificationStatus:Xl}=Lt,Jl=()=>{const r=os(),s=o.useCallback(u=>{r(Ql(u))},[r]),n=o.useCallback(u=>{r(Zl(u))},[r]),t=o.useCallback(u=>{r(Xl(u))},[r]),a=o.useCallback(u=>{r(Nt(u))},[r]),l=o.useCallback(u=>{r(Kr(u))},[r]),c=o.useCallback(()=>r(Qr()),[r]);
1return{setFein:s,setBusinessLegalName:n,setVerificationStatus:t,updateLocationSettings:a,showPayrollSelfSetupFeinRejectedModal:l,verifyFein:c}},ei=()=>{const r=S($e),s=S(So),n=S(ko),t=S(yn),a=S(Ao),l=S(Lo),c=S(No),u=S(To),_=S(xn),p=S(bn),m=S(Po);return{companyEligibleForMultiLocationPayroll:r,businessLegalName:s,fein:n,feinVerificationStatus:t,isFeinVerificationVerified:a,isFeinVerificationPending:l,isFeinVerificationRejected:c,isFeinVerificationFinalRejected:u,isFeinVerificationNull:_,isFeinVerificationWaiting:p,isFeinVerificationExpired:m}},si=({isFeinVerificationNull:r,isFeinVerificationRejected:s,isFeinVerificationExpired:n,isFeinVerificationVerified:t,isFeinVerificationFinalRejected:a,verifyFein:l,setVerificationStatus:c})=>({handleOnBlurFeinValidationFields:o.useCallback(()=>{if(r)return l();(s||n)&&c(Fe.waiting)},[n,r,s,c,l]),errorBorder:s,disabled:t||a,icon:t?"check":null,tooltipEnabled:t||a,legalNameTooltipI18n:a?"payroll.self_serve.linear_flow.steps.company_details.final_rejected_tooltip":"payroll.self_serve.linear_flow.steps.company_details.legal_name_verified_tooltip",feinTooltipI18n:a?"payroll.self_serve.linear_flow.steps.company_details.final_rejected_tooltip":"payroll.self_serve.linear_flow.steps.company_details.fein_verified_tooltip"}),ri={list:ps,text:Ir,number:Ir},ni=({companyName:r,companyWebsite:s,children:n})=>{const{companyEligibleForMultiLocationPayroll:t,businessLegalName:a,fein:l,feinVerificationStatus:c,isFeinVerificationVerified:u,isFeinVerificationPending:_,isFeinVerificationRejected:p,isFeinVerificationFinalRejected:m,isFeinVerificationNull:h,isFeinVerificationWaiting:x,isFeinVerificationExpired:f}=ei(),y=Jl(),{setFein:w,setBusinessLegalName:b,setVerificationStatus:g,updateLocationSettings:C,showPayrollSelfSetupFeinRejectedModal:j,verifyFein:E}=y,k=Kl(),{checkAddressError:M,setCheckAddressError:U,checkRawError:W,setCheckRawError:Z,businessPhoneNumber:X,setBusinessPhoneNumber:J,dbaOrTradeName:se,setDbaOrTradeName:Y,companyIndustry:P,setCompanyIndustry:I,averageTotalPayrollAmount:Q,setAverageTotalPayrollAmount:O,website:L,setWebsite:V,socialMedia:re,setSocialMedia:z,businessType:ee,setBusinessType:q,businessLegalAddressLine1:fe,setBusinessLegalAddressLine1:te,businessLegalAddressLine2:de,setBusinessLegalAddressLine2:Ie,businessLegalAddressCity:Se,setBusinessLegalAddressCity:ke,businessLegalAddressState:Cs,setBusinessLegalAddressState:ws,businessLegalAddressPostalCode:js,setBusinessLegalAddressPostalCode:Es,workplaceLegalAddressLine1:Ss,setWorkplaceLegalAddressLine1:ks,workplaceLegalAddressLine2:As,setWorkplaceLegalAddressLine2:Ls,workplaceLegalAddressCity:Ns,setWorkplaceLegalAddressCity:Ts,workplaceLegalAddressState:Ps,setWorkplaceLegalAddressState:Is,workplaceLegalAddressPostalCode:Os,setWorkplaceLegalAddressPostalCode:Ms,isSameLegalAddressForWorkplace:Be,setIsSameLegalAddressForWorkplace:Fs,isNextLoading:Mn,setIsNextLoading:Oe,validationErrors:Rs,setValidationErrors:Fn}=k,[Rn,tr]=o.useState(!1),$n=o.useCallback(()=>tr(!1),[]),Vn=o.useCallback(()=>tr(G=>!G),[]),Ue=o.useCallback((G,oe)=>{B(G,F.FIELD_FOCUSED,{field:oe})},[]),or=o.useCallback(([G,oe])=>{if(Oe(!1),G?.error)return A.error(G?.error[0],$);if(!Ll[oe]){oe===Fe.rejected&&window.scrollTo(0,0);return}if(oe===Fe.final_rejected){j({onClickContinue:()=>{H(G.current_required_step)}});return}L&&C({payload:{website:L}}),H(G.current_required_step)},[j,C,L,Oe]),{handleOnBlurFeinValidationFields:lr,errorBorder:Ze,disabled:ir,icon:ar,tooltipEnabled:cr,legalNameTooltipI18n:dr,feinTooltipI18n:ur}=si({isFeinVerificationNull:h,isFeinVerificationRejected:p,isFeinVerificationExpired:f,isFeinVerificationVerified:u,isFeinVerificationFinalRejected:m,verifyFein:E,setVerificationStatus:g}),$s=o.useMemo(()=>Ce(Ue,R.COMPANY_DETAILS),[Ue]),_r=o.useMemo(()=>Ce(Ue,R.BUSINESS_LEGAL_ADD),[Ue]),pr=o.useMemo(()=>Ce(Ue,R.WORKPLACE_ADD),[Ue]),mr=o.useCallback(G=>{Y(G||r)},[r,Y]),hr=o.useCallback(G=>{V(G||s)},[s,V]),Xe=o.useMemo(()=>Gl({businessLegalName:a,fein:l,formState:{businessPhoneNumber:X,setBusinessPhoneNumber:J,dbaOrTradeName:se,setDbaOrTradeName:Y,companyIndustry:P,setCompanyIndustry:I,averageTotalPayrollAmount:Q,setAverageTotalPayrollAmount:O,website:L,setWebsite:V,socialMedia:re,setSocialMedia:z,businessType:ee,setBusinessType:q,businessLegalAddressLine1:fe,setBusinessLegalAddressLine1:te,businessLegalAddressLine2:de,setBusinessLegalAddressLine2:Ie,businessLegalAddressCity:Se,setBusinessLegalAddressCity:ke,businessLegalAddressState:Cs,setBusinessLegalAddressState:ws,businessLegalAddressPostalCode:js,setBusinessLegalAddressPostalCode:Es,workplaceLegalAddressLine1:Ss,setWorkplaceLegalAddressLine1:ks,workplaceLegalAddressLine2:As,setWorkplaceLegalAddressLine2:Ls,workplaceLegalAddressCity:Ns,setWorkplaceLegalAddressCity:Ts,workplaceLegalAddressState:Ps,setWorkplaceLegalAddressState:Is,workplaceLegalAddressPostalCode:Os,setWorkplaceLegalAddressPostalCode:Ms,isSameLegalAddressForWorkplace:Be}
1,reduxHandlers:{setBusinessLegalName:b,setFein:w},companyEligibleForMultiLocationPayroll:t,checkAddressError:M,handleCompanyDetailsFocus:$s,handleBusinessLegalAddressFocus:_r,handleWorkplaceAddressFocus:pr,handleOnloadInitialValueDBA:mr,handleOnloadInitialValueWebsite:hr,feinValidation:{errorBorder:Ze,handleOnBlurFeinValidationFields:lr,icon:ar,disabled:ir,tooltipEnabled:cr,legalNameTooltipI18n:dr,feinTooltipI18n:ur}}),[a,l,X,se,P,Q,L,re,ee,fe,de,Se,Cs,js,Ss,As,Ns,Ps,Os,Be,b,w,J,Y,I,O,V,z,q,te,Ie,ke,ws,Es,ks,Ls,Ts,Is,Ms,t,M,$s,_r,pr,mr,hr,Ze,lr,ar,ir,cr,dr,ur]),fr=o.useMemo(()=>Ks(),[]),qn=o.useCallback(()=>{const oe=Object.entries(Xe).filter(([,ye])=>ye.isRequired).some(([,ye])=>K(ye.fieldValue)),Me=fr(X?.replace(/[^\d]/g,""));return oe||!!Me||Rs||Ze},[Xe,X,Ze,Rs,fr]),yr=o.useCallback(G=>Object.entries(Xe).reduce((oe,[Me,ye])=>{const Ae=G.find(ue=>ue.slug===Me);return oe[Me]=Ae?.question_data_type==="number"?Zs(ye.fieldValue):ye.fieldValue,oe},{}),[Xe]),Bn=o.useCallback((G,oe)=>{let Me=Promise.resolve({payload:{status:c}});(x||h)&&(Me=E()),Me.then(ye=>{Oe(!0);const Ae=Promise.resolve(ye?.payload?.status||Fe.expired),ue=ce("/payroll/linear_flow/save_answers",{step:G,answers:yr(oe)});return Promise.all([ue,Ae])}).then(or).catch(ye=>{Oe(!1),ye.response.json().then(Ae=>{if(Ae){const ue=Array.isArray(Ae)?Ae[0]:Ae;if(ue?.answers_validation_errors)return A.error(be(ue.answers_validation_errors),$);if(ue?.check_error){const xr=Pe(ue.check_error);return U(xr),Z(ue.raw_error_data?.error??null),A.error(xr,$)}if(ue?.error)return A.error(ue.error);A.error(d("errors.generic"))}})})},[yr,c,or,h,x,E,Oe,U,Z]);o.useEffect(()=>{Oe(_)},[_,Oe]);const Un=o.useCallback(()=>{B(R.WORKPLACE_ADD,F.CHECKBOX_CLICKED,{checked:!Be}),Fs(!Be)},[Be,Fs]);return e.jsx(gs.Provider,{value:{checkAddressError:M,setCheckAddressError:U,checkRawError:W,setCheckRawError:Z,businessLegalName:a,setBusinessLegalName:b,fein:l,setFein:w,businessPhoneNumber:X,setBusinessPhoneNumber:J,dbaOrTradeName:se,setDbaOrTradeName:Y,companyIndustry:P,setCompanyIndustry:I,averageTotalPayrollAmount:Q,setAverageTotalPayrollAmount:O,website:L,setWebsite:V,socialMedia:re,setSocialMedia:z,businessType:ee,setBusinessType:q,businessLegalAddressLine1:fe,setBusinessLegalAddressLine1:te,businessLegalAddressLine2:de,setBusinessLegalAddressLine2:Ie,businessLegalAddressCity:Se,setBusinessLegalAddressCity:ke,businessLegalAddressState:Cs,setBusinessLegalAddressState:ws,businessLegalAddressPostalCode:js,setBusinessLegalAddressPostalCode:Es,workplaceLegalAddressLine1:Ss,setWorkplaceLegalAddressLine1:ks,workplaceLegalAddressLine2:As,setWorkplaceLegalAddressLine2:Ls,workplaceLegalAddressCity:Ns,setWorkplaceLegalAddressCity:Ts,workplaceLegalAddressState:Ps,setWorkplaceLegalAddressState:Is,workplaceLegalAddressPostalCode:Os,setWorkplaceLegalAddressPostalCode:Ms,handleClickNext:Bn,isNextDisabled:qn,isNextLoading:Mn,validationErrors:Rs,setValidationErrors:Fn,isSameLegalAddressForWorkplace:Be,setIsSameLegalAddressForWorkplace:Fs,handleChangeIsSameLegalAddressForWorkplace:Un,handleCompanyDetailsFocus:$s,feinErrorBorder:Ze,isFeinVerificationRejected:p,isSuggestionVisible:Rn,hideSuggestion:$n,toggleSuggestion:Vn,SLUGS_QUESTIONS_METADATA:Xe,QUESTION_TYPES_COMPONENTS:ri,COMPANY_DETAILS_SLUGS:Nl,COMPANY_SOCIAL_DATA_SLUGS:Tl,COMPANY_ADDRESS_SLUGS:Pl,WORKPLACE_ADDRESS_SLUGS:Il},children:n})},{cxEl:ti}=T("CompanyDetailsStep"),vs=(r,s,n,t)=>{const a=n.SLUGS_QUESTIONS_METADATA[s.slug];if(!a)return null;const l=a.component||n.QUESTION_TYPES_COMPONENTS[s.question_data_type];if(!l)return null;const c=a.children;return e.jsx(i,{className:ti(s.slug),grow:t,w:t?"100%":350,mr:t?void 0:"md",children:e.jsx(l,{step:r,slug:s.slug,value:s.value,questionFormat:s.answer_format,options:s.options,state:a,context:n,mobile:t,isRequired:a.isRequired,children:c?e.jsx(c,{}):null})},s.slug)},{cxEl:oi}=T("CompanyDetailsStep");function li({context:r,stepData:s,mobile:n}){const t=S(Zr),a=n?d("payroll.self_serve.linear_flow.steps.company_details.title",{props:{companyName:t}}):d("payroll.self_serve.linear_flow.steps.company_details.subtitles.details");return e.jsxs(i,{column:!0,gap:n?"md":"lg",children:[e.jsx(v,{variant:"heading3",children:a}),r.isFeinVerificationRejected&&e.jsx(i,{p:"sm",bradius:"xs",bgcolor:"alertA1",className:oi("fein_rejected_banner"),children:e.jsx(v,{variant:"bodySm",children:d("payroll.self_serve.linear_flow.steps.company_details.fein_rejected")})}),e.jsx(i,{wrap:!0,spacebetween:n,gap:"md",children:s.questions&&Qe(xs(s.questions,r.COMPANY_DETAILS_SLUGS),r).map(l=>{const c=n?"business_legal_name":"federal_employer_identification_number";return e.jsxs(o.Fragment,{children:[vs(s.step,l,r,n),l.slug===c&&e.jsx(Vl,{})]},l.slug)})})]})}function ii({stepData:r,context:s,mobile:n}){return e.jsxs(i,{column:!0,gap:n?"md":"lg",maxw:n?void 0:700,children:[e.jsxs(i,{children:[e.jsx(v,{variant:"heading3",children:d("payroll.self_serve.linear_flow.steps.company_details.subtitles.legal_address.title")}),e.jsx(v,{variant:"bodySm",color:"primary",children:d("payroll.self_serve.linear_flow.steps.company_details.subtitles.legal_address.subtitle")})]}),e.jsx(i,{wrap:!0,spacebetween:n,gap:"md",children:r.questions&&Qe(xs(r.questions,s.COMPANY_ADDRESS_SLUGS),s).map(t=>vs(r.step,t,s,n))})]})}
1const ai="https://joinhomebase.my.site.com/s/article/Homebase-Payroll-direct-deposit-payment-speed";function ci({context:r,stepData:s,mobile:n}){return e.jsxs(i,{column:!0,gap:n?"md":"lg",children:[e.jsxs(i,{children:[e.jsx(v,{variant:"heading3",children:d(n?"payroll.self_serve.linear_flow.steps.company_details.subtitles.social_data.title_mobile":"payroll.self_serve.linear_flow.steps.company_details.subtitles.social_data.title")}),e.jsx(v,{variant:"bodySm",color:"primary",children:d(n?"payroll.self_serve.linear_flow.steps.company_details.subtitles.social_data.subtitle_mobile":"payroll.self_serve.linear_flow.steps.company_details.subtitles.social_data.subtitle")})]}),!n&&e.jsx(xe,{href:ai,target:"_blank",size:"small",endIcon:"ExternalLink",children:d("payroll.self_serve.linear_flow.steps.company_details.subtitles.social_data.subtitle_link")}),e.jsx(i,{wrap:!0,spacebetween:n,gap:"md",children:s.questions&&Qe(xs(s.questions,r.COMPANY_SOCIAL_DATA_SLUGS),r).map(t=>vs(s.step,t,r,n))})]})}const Mr=()=>e.jsx(v,{variant:"captions",children:d("payroll.self_serve.linear_flow.steps.company_details.loading_message")}),di=({context:r,stepData:s,mobile:n})=>ge()?e.jsx(Ee,{backProps:{previousStep:s.previous_step},nextProps:{handleClickNext:r.handleClickNext,stepData:s,disabled:r.isNextDisabled(),isLoading:r.isNextLoading},topContent:r.isNextLoading?e.jsx(Mr,{}):void 0}):e.jsxs(i,{column:!0,children:[e.jsxs(i,{mt:40,row:!0,maxw:!n&&800,hright:!0,children:[e.jsx(i,{mr:"sm",children:e.jsx(we,{previousStep:s.previous_step,i18nKey:void 0,onClickCallback:void 0})}),e.jsx(i,{column:!0,children:e.jsx(ds,{mobile:n,handleClickNext:r.handleClickNext,stepData:s,disabled:r.isNextDisabled(),isLoading:r.isNextLoading})})]}),r.isNextLoading&&e.jsx(i,{mt:"xs",mb:"lg",row:!0,maxw:!n&&800,hright:!0,children:e.jsx(Mr,{})})]}),{cxEl:ui}=T("CompanyDetailsStep");function _i({currentLocation:r,context:s,stepData:n,mobile:t}){return e.jsxs(i,{column:!0,gap:t?"md":"lg",children:[e.jsxs(i,{children:[e.jsx(v,{variant:"heading3",children:d("payroll.self_serve.linear_flow.steps.company_details.subtitles.workplace_address.title",{props:{locationName:r.get("name")}})}),e.jsx(v,{variant:"bodySm",color:"primary",children:d("payroll.self_serve.linear_flow.steps.company_details.subtitles.workplace_address.subtitle")})]}),e.jsx(i,{className:ui("is-same-legal-address-for-workplace"),children:e.jsx(Tt,{name:"isSameLegalAddressForWorkplace",checked:s.isSameLegalAddressForWorkplace,onClick:s.handleChangeIsSameLegalAddressForWorkplace,label:d("payroll.self_serve.linear_flow.steps.company_details.subtitles.workplace_address.use_same_address_checkbox")})}),!s.isSameLegalAddressForWorkplace&&e.jsx(i,{wrap:!0,spacebetween:t,gap:"lg",maxw:t?void 0:666,children:n.questions&&Qe(xs(n.questions,s.WORKPLACE_ADDRESS_SLUGS),s).map(a=>vs(n.step,a,s,t))})]})}const{cx:pi}=T("CompanyDetailsStep"),mi=({currentCompany:r,currentLocation:s,mobile:n,stepData:t})=>{const a=S($e),l=S(Pt),c=S(It);o.useEffect(()=>{l&&B(R.COMPANY_DETAILS,F.PAGE_VIEWED,{company_uuid:l})},[l]),he(t);const u={maxw:800,p:n?"md":"lg"};return e.jsx(ni,{companyName:r?.get("name")??null,companyWebsite:s?.get("website")??null,children:e.jsx(gs.Consumer,{children:_=>e.jsxs(i,{column:!0,gap:"lg",className:pi(),children:[e.jsx(ae,{...u,children:e.jsx(li,{stepData:t,context:_,mobile:n})}),!c&&e.jsx(ae,{...u,children:e.jsx(ci,{stepData:t,context:_,mobile:n})}),!a&&e.jsx(ae,{...u,children:e.jsx(ii,{stepData:t,context:_,mobile:n})}),!a&&e.jsx(ae,{...u,children:e.jsx(_i,{currentLocation:s,context:_,stepData:t,mobile:n})}),e.jsx(di,{context:_,stepData:t,mobile:n})]})})})},{cx:hi}=T("DisqualifiedStep"),fi="payroll.self_serve.linear_flow.errors.validations",yi=({stepData:r})=>{const s=S(He),n=ge();o.useEffect(()=>{B(R.USER_DQ,F.PAGE_VIEWED)},[]),he(r);const t=r?.disqualified_by?.disqualifiers;return e.jsxs(e.Fragment,{children:[e.jsxs(ae,{className:hi(),children:[e.jsx(i,{mb:"md",children:e.jsx(v,{variant:"heading2",children:d("payroll.self_serve.update_linear_flow.steps.disqualified.disqualifiers.title",{props:{companyName:s.get("name")}})})}),e.jsxs(i,{mb:"md",children:[e.jsx(i,{children:e.jsx(v,{variant:"body",children:d("payroll.self_serve.update_linear_flow.steps.disqualified.disqualifiers.description")})}),t?e.jsx(Qs,{variant:"bullet",data:t.map(a=>({primary:d(`${fi}.${a}.field_name`)}))}):e.jsx(ze,{size:"medium",variant:"dark"})]}),e.jsx(hn,{step:r.step,color:"mono900"}),!n&&e.jsx(i,{mt:40,row:!0,hright:!0,children:e.jsx(we,{previousStep:r.previous_step,i18nKey:void 0,onClickCallback:void 0})})]}),n&&e.jsx(Ee,{backProps:{previousStep:r.previous_step}})]})},{cx:xi}=T("DisqualifiedNpoStep"),bi=({stepData:r})=>{const s=S(He),n=ge();return o.useEffect(()=>{B(R.USER_DQ_NPO,F.PAGE_VIEWED)},[]),he(r),e.jsxs(e.Fragment,{children:[e.jsxs(ae,{className:xi(),children:[e.jsx(i,{hcenter:!0,mb:"md",children:e.jsx(xo,{w:150})}),e.jsx(i,{hcenter:!0,mb:6,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.update_linear_flow.steps.disqualified_npo.title",{props:{companyName:s.get("name")}})})}),e.jsx(i,{hcenter:!0,mb:"md",children:e.jsx(v,{color:"mono700",children:d("payroll.self_serve.update_linear_flow.steps.disqualified_npo.description")})}),e.jsx(i,{hcenter:!0,mb:"lg",children:e.jsx(hn,{step:r.step})}),!n&&e.jsx(i,{hcenter:!0,children:e.jsx(we,{previousStep:r.previous_step,i18nKey:"payroll.self_serve.update_linear_flow.steps.disqualified_npo.back_to_setup",onClickCallback:void 0})})]}),n&&e.jsx(Ee,{backProps:{previousStep:r.previous_step,i18nKey:"payroll.self_serve.update_linear_flow.steps.disqualified_npo.back_to_setup"}})]})},{cx:gi}=T("InceptionSwitcherStep"),vi=({stepData:r})=>
1{const s=as(),n=ge(),[t,a]=o.useState(null);he(r),o.useEffect(()=>{s(F.PAGE_VIEWED,ve.VIEW)},[]);const l=Io({productArea:br["payroll.productArea"],eventCategory:br["payroll.event_category.zero_state_page"]}),c=n;return e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:gi(),p:c?"md":"lg",children:e.jsx(bo,{trackUx:s,linearFlowStartStepData:r,trackUxEvent:l,renderStepFooter:n,onMobileFooterReady:n?a:void 0})}),t&&e.jsx(Ee,{...t})]})},Nn=o.createContext(null),{cxEl:Ci}=T("BooleanOptions"),Tn=({currentValue:r,onChange:s})=>e.jsx(i,{row:!0,gap:"xs",children:io.map(n=>e.jsx(pe,{className:Ci("chip"),size:"medium",value:n.value,selected:r===n.value,onClick:s,children:n.label},n.value))}),Pn=({children:r,isRequired:s})=>e.jsxs(v,{variant:"body",color:"primary",children:[r,s&&e.jsx(v,{component:"span",variant:"bodyBold",color:"warning",children:" *"})]}),In=({value:r,suggestedValue:s,fieldValue:n,setFieldValue:t,trackingKey:a,trackingFunction:l})=>{const c=n??r??s??null;o.useEffect(()=>{c!==null&&t(c)},[c,t]);const u=o.useCallback(({value:_})=>{t(String(_)),a&&l({question:a,selection:String(_)})},[t,l,a]);return{currentValue:c,handleChange:u}},Hs=({step:r,slug:s,className:n,title:t,isRequired:a,value:l,suggestedValue:c,fieldValue:u,setFieldValue:_,trackingKey:p,trackingFunction:m})=>{const{currentValue:h,handleChange:x}=In({value:l,suggestedValue:c,fieldValue:u,setFieldValue:_,trackingKey:p,trackingFunction:m});return e.jsxs(i,{column:!0,className:n,gap:"md",children:[e.jsx(Pn,{isRequired:a,children:t??d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.title`)}),e.jsx(Tn,{currentValue:h,onChange:x})]})},wi=d("payroll.self_serve.linear_flow.errors.validations.invalid_w2_1009_count_option"),ji=()=>e.jsx(i,{children:e.jsx(i,{mt:"2xs",children:e.jsx(ts,{errorMessage:wi})})}),Ei=({trackingFunction:r,step:s,mobile:n})=>{const t=o.useCallback(()=>{r(F.HELPER_LINK_CLICKED,{cta:d(`payroll.self_serve.linear_flow.steps.${s}.difference.text`)})},[s,r]);return e.jsx(i,{vcenter:!0,row:!0,mt:n?void 0:"md",children:e.jsx(xe,{onClick:t,...!n&&{endIcon:"ExternalLink"},href:"https://joinhomebase.com/blog/independent-contractor-laws",target:"_blank",size:"small",children:d(`payroll.self_serve.linear_flow.steps.${s}.difference.text`)})})},{cx:Si}=T("NumberOfPaidEmployeesQuestion"),ki=ps,Ai=({step:r,...s})=>e.jsxs(i,{className:Si(),column:!0,gap:"md",children:[e.jsx(v,{variant:"heading4",color:"primary",children:d(`payroll.self_serve.linear_flow.steps.${r}.questions.number_of_team_member_w2.header`)}),e.jsx(ki,{step:r,...s})]}),Li=({children:r,stepData:s,mobile:n})=>{const t=os(),[a,l]=o.useState(()=>s.questions.find(M=>M.slug==="number_of_team_member_w2")?.value||null),[c,u]=o.useState(()=>s.questions.find(M=>M.slug==="number_of_team_member_1099")?.value||null),[_,p]=o.useState(null),[m,h]=o.useState(null),[x,f]=o.useState(null),y=o.useCallback(()=>a==="none"&&c==="none",[c,a]),w=o.useMemo(()=>({number_of_team_member_w2:{component:Ai,fieldValue:a,setFieldValue:l,order:3,row:!0,dataTestId:"w2-employees-dropdown"},number_of_team_member_1099:{component:ps,fieldValue:c,setFieldValue:u,order:4,row:!0,dataTestId:"1099-contractors-dropdown",children:e.jsxs(e.Fragment,{children:[y()&&e.jsx(ji,{}),e.jsx(Ei,{step:s.step,mobile:n,trackingFunction:Ce(B,R.FREQUENCY_TEAM_MEMBER)})]})},comp_policy:{component:ps,order:6,isRequired:!1,fieldValue:m,setFieldValue:h,dataTestId:"workers-comp-policy-dropdown",inputContainerStyle:{w:"100%",mt:n?void 0:16}},interested_in_hb_comp_policy:{component:Hs,order:7,fieldValue:x,setFieldValue:f}}),[m,x,y,n,c,a,s.step]),b=o.useCallback(M=>{B(R.FREQUENCY_TEAM_MEMBER,F.FIELD_FOCUSED,{field:M})},[]),g=o.useCallback(()=>K(a)||K(c)||y(),[a,c,y]),[C,j]=o.useState(!1),E=o.useCallback(()=>({first_pay_day:_,number_of_team_member_w2:a,number_of_team_member_1099:c,comp_policy:m,interested_in_hb_comp_policy:x}),[_,a,c,m,x]),k=o.useCallback(M=>{j(!0),ce("/payroll/linear_flow/save_answers",{step:M,answers:E()}).then(U=>{U.linear_flow_completed&&(t(Xr(["payroll_growth_task_removal_feb24_pay_12425","payroll_growth_doc_upload_email_unstructured_march24_pay_12601","payroll_growth_doc_upload_email_march24_pay_12601"])),t(Ot({key:"implementation_dashboard",data:!0}
1)),t(Jr({isPayrollEnrolled:!0}))),H(U.current_required_step)}).catch(U=>{j(!1),U.response.json().then(W=>{if(W&&W[0]?.answers_validation_errors)return A.error(be(W[0].answers_validation_errors),$);if(W.check_error){const Z=Pe(W.check_error);return A.error(Z,$)}if(W.error)return A.error(W.error);A.error(d("errors.generic"))})})},[E,t]);return e.jsx(Nn.Provider,{value:{numberOfEmployees:a,setNumberOfEmployees:l,numberOfContractors:c,setNumberOfContractors:u,firstPayday:_,setFirstPayday:p,compPolicy:m,setCompPolicy:h,interestedInHbCompPolicy:x,setInterestedInHbCompPolicy:f,handleClickNext:k,isNextDisabled:g,isNextLoading:C,handleFocus:b,SLUGS_QUESTIONS_METADATA:w},children:r})},{cx:Ni,cxEl:Ti}=T("PayAndTeamStep"),Pi=({stepData:r,mobile:s})=>{const n=o.useContext(Nn),t=ge(),a=S(Gs),l=S(Ye),c=S($e);if(!n)return null;const u=Qe(r.questions,n);return e.jsxs(e.Fragment,{children:[e.jsxs(ae,{className:Ni(),p:s?"md":"lg",maxw:800,children:[e.jsx(i,{mb:s?"md":"xl",children:e.jsx(v,{variant:"heading3",children:d("payroll.self_serve.linear_flow.steps.pay_and_team.title")})}),e.jsx(i,{column:!0,gap:s?"md":"lg",children:u.map(_=>{const p=n.SLUGS_QUESTIONS_METADATA[_.slug];if(!p)return null;const m=p.component;return m?e.jsx(i,{className:Ti(_.slug),grow:s?void 0:1,children:e.jsx(m,{step:r.step,slug:_.slug,options:_.options,value:_.value,context:n,previousAnswers:r.previous_answers,trackingFunction:Ce(B,R.FREQUENCY_TEAM_MEMBER),currentLocation:a,currentCompanyLocations:l,companyEligibleForMultiLocationPayroll:c,state:p,fieldValue:p.fieldValue,setFieldValue:p.setFieldValue,titleI18n:p.titleI18n,isRequired:p.isRequired,mobile:s,children:p.children})},_.slug):null})}),e.jsxs(i,{vcenter:!0,justifyContentSpaceBetween:!0,column:!0,children:[e.jsx(i,{children:e.jsx(go,{mobile:s})}),!t&&e.jsxs(i,{mt:40,row:!0,hright:!0,children:[e.jsx(we,{previousStep:r.previous_step,hardRefresh:c,i18nKey:void 0,onClickCallback:void 0}),e.jsx(ds,{mobile:s,handleClickNext:n.handleClickNext,stepData:r,disabled:n.isNextDisabled(),isLoading:n.isNextLoading})]})]})]}),t&&e.jsx(Ee,{backProps:{previousStep:r.previous_step},nextProps:{handleClickNext:n.handleClickNext,stepData:r,disabled:n.isNextDisabled(),isLoading:n.isNextLoading}})]})},Ii=({stepData:r,mobile:s})=>(o.useEffect(()=>{B(R.FREQUENCY_TEAM_MEMBER,F.PAGE_VIEWED)},[]),he(r),e.jsx(Li,{stepData:r,mobile:s,children:e.jsx(Pi,{stepData:r,mobile:s})})),{cx:Oi}=T("PayScheduleStep"),Mi=({stepData:r,mobile:s})=>{const n=en(),t=as(),a=ge(),l=S(Ye),c=S($e),[u,_]=o.useState({}),[p,m]=o.useState(!1),[h,x]=o.useState(!0),f=o.useMemo(()=>r.previous_answers?.first_time_running_payroll===mn.NEVER_RAN_PAYROLL?vr.inception:vr.switcher,[r.previous_answers]),y=o.useCallback((q,fe)=>{n(sn({step:D.PAY_SCHEDULE,answers:{pay_schedule_frequency:Mt[q],is_first_payroll_of_next_year:fe}})).then(te=>{H(te.payload.current_required_step)}).catch(te=>{te.response.json().then(de=>de?.errors?A.error(de.errors):A.error(d("errors.generic")))}).finally(()=>{x(!1)})},[n]),[w,b,g,C,j,E,k,M,U,W,Z,X,J,se,Y,P,I,Q,O,L]=Oo({data:u,setIsLoading:m,onSubmitCallback:y,payrollState:Ft});o.useEffect(()=>{Ys("/payroll/implementation/pay_schedule_component.json").then(q=>{_(q),b(q.start_date_answer),C(q.payroll_period)}).finally(()=>{x(!1)}),t(F.PAGE_VIEWED,ve.VIEW)},[]),he(r);const V=o.useMemo(()=>c&&l.size>1,[l,c]),re=o.useMemo(()=>Rt(l.map(q=>q.get("payroll_period")).toArray()),[l]),z=o.useMemo(()=>V&&l.every(q=>K(q.get("payroll_period"))),[l,V]),ee=o.useMemo(()=>V&&l.some(q=>!K(q.get("payroll_period")))&&re.length>1,[l,V,re.length]);return h?null:e.jsxs(e.Fragment,{children:[e.jsxs(i,{className:Oi(),children:[e.jsx(Mo,{showPayScheduleInfo:z,showPayScheduleWarning:ee,data:u,setIsLoading:m,payDate:w,setPayDate:b,frequency:g,setFrequency:C,paydays:j,setPaydays:E,payday:k,setPayday:M,payrollInfo:U,setPayrollInfo:W,startDate:Z,setStartDate:X,endDate:J,setEndDate:se,startOfPayrollPeriodFromPayDate:P,setSubmitButtonDisabled:Q,isFirstPayrollOfNextYear:O,setIsFirstPayrollOfNextYear:L,companyType:f,fullPage:!0,isPayrollLinearFlow:!0,mobile:s}
1),!a&&e.jsxs(i,{pv:24,pr:24,mt:-10,bradiusm:!0,bcolor:"mono300",row:!0,hright:!0,bgcolor:"mono0",maxw:816,children:[e.jsx(we,{previousStep:r.previous_step,i18nKey:void 0,onClickCallback:void 0}),e.jsx(ds,{mobile:s,handleClickNext:Y,stepData:r,disabled:I,isLoading:p})]})]}),a&&e.jsx(Ee,{backProps:{previousStep:r.previous_step},nextProps:{handleClickNext:Y,stepData:r,disabled:I,isLoading:p}})]})},ne={HOUSEHOLD_EMPLOYEES:"household_employees",PAID_EMPLOYEES_OUTSIDE_UNITED_STATES:"paid_employees_outside_united_states",RESTRICTED_INDUSTRY:"restricted_industry"},Fi=["adult","counterfeit","drugs","gambling","guns","flammable","marijuana","virtual_currency"],Ri=({step:r,isRequired:s,value:n,suggestedValue:t,fieldValue:a,setFieldValue:l,trackingFunction:c})=>{const{currentValue:u,handleChange:_}=In({value:n,suggestedValue:t,fieldValue:a,setFieldValue:l,trackingKey:ne.RESTRICTED_INDUSTRY,trackingFunction:c}),p=e.jsx(Qs,{variant:"bullet",gapOverride:"4px",data:Fi.map(m=>({primary:d(`payroll.self_serve.update_linear_flow.steps.${r}.questions.restricted_industry.blocked_industries.${m}`)}))});return e.jsxs(i,{column:!0,gap:"md",mt:"lg",children:[e.jsx(v,{variant:"heading4",children:d(`payroll.self_serve.update_linear_flow.steps.${r}.questions.restricted_industry.section_title`)}),p,e.jsx(Pn,{isRequired:s,children:d(`payroll.self_serve.linear_flow.steps.${r}.questions.restricted_industry.title`)}),e.jsx(Tn,{currentValue:u,onChange:_})]})},$i=Object.fromEntries(Object.values(ne).map(r=>[r,null])),Vi=()=>{const[r,s]=o.useState($i),[n,t]=o.useState(!1),a=o.useCallback((u,_)=>{s(p=>({...p,[u]:_}))},[]),l=o.useCallback(()=>Object.values(r).some(K),[r]),c=o.useCallback(u=>{t(!0),ce("/payroll/linear_flow/save_answers",{step:u,answers:r}).then(_=>{t(!1),H(_.current_required_step)}).catch(_=>{t(!1),_.response.json().then(p=>{if(p){if(p[0]?.answers_validation_errors)return A.error(be(p[0].answers_validation_errors),$);A.error(d("errors.generic"))}})})},[r]);return{answers:r,setAnswer:a,isNextDisabled:l,isNextLoading:n,handleClickNext:c}},{cx:qi}=T("ScreenerStep"),Bi=({stepData:r,mobile:s})=>{const n=as(),t=ge(),{answers:a,setAnswer:l,isNextDisabled:c,isNextLoading:u,handleClickNext:_}=Vi();o.useEffect(()=>{n(F.PAGE_VIEWED,ve.VIEW)},[]),he(r);const p=o.useCallback(b=>l(ne.HOUSEHOLD_EMPLOYEES,b),[l]),m=o.useCallback(b=>l(ne.PAID_EMPLOYEES_OUTSIDE_UNITED_STATES,b),[l]),h=o.useCallback(b=>l(ne.RESTRICTED_INDUSTRY,b),[l]),x=r.questions.find(b=>b.slug===ne.HOUSEHOLD_EMPLOYEES),f=r.questions.find(b=>b.slug===ne.PAID_EMPLOYEES_OUTSIDE_UNITED_STATES),y=r.questions.find(b=>b.slug===ne.RESTRICTED_INDUSTRY),w=Ce(B,R.SCREENER,F.SCREENER_ANSWER_SELECTED);return e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:qi(),p:s?"md":"lg",children:e.jsxs(i,{column:!0,gap:"md",children:[e.jsx(i,{children:e.jsx(v,{variant:s?"heading3":"heading2",children:d("payroll.self_serve.update_linear_flow.steps.screener.title")})}),e.jsxs(i,{column:!0,gap:"md",children:[e.jsx(Hs,{step:r.step,slug:ne.HOUSEHOLD_EMPLOYEES,isRequired:!0,value:x?.value,suggestedValue:x?.suggested_value,fieldValue:a[ne.HOUSEHOLD_EMPLOYEES],setFieldValue:p,trackingKey:"caregiver",trackingFunction:w}),e.jsx(Hs,{step:r.step,slug:ne.PAID_EMPLOYEES_OUTSIDE_UNITED_STATES,isRequired:!0,value:f?.value,suggestedValue:f?.suggested_value,fieldValue:a[ne.PAID_EMPLOYEES_OUTSIDE_UNITED_STATES],setFieldValue:m,trackingKey:"employees_outside_US",trackingFunction:w}),e.jsx(Ri,{step:r.step,isRequired:!0,value:y?.value,suggestedValue:y?.suggested_value,fieldValue:a[ne.RESTRICTED_INDUSTRY],setFieldValue:h,trackingFunction:w})]}),!t&&e.jsxs(i,{mt:40,row:!0,hright:!0,children:[e.jsx(we,{previousStep:r.previous_step}),e.jsx(ds,{mobile:s,handleClickNext:_,stepData:r,disabled:c(),isLoading:u})]})]})}),t&&e.jsx(Ee,{backProps:{previousStep:r.previous_step},nextProps:{handleClickNext:_,stepData:r,disabled:c(),isLoading:u}})]})},{cx:Ui,cxEl:Wi}=T("SetupFeeStep"),Di=({stepData:r,mobile:s})=>{const n=en();o.useEffect(()=>{B(R.SETUP_FEE,F.PAGE_VIEWED),n($t({includes:["package"]}))},[n,r.current_required_step,r.step]),he(r);
1const[t,a]=o.useState(!1),l=o.useCallback(()=>{a(!0)},[]),c=o.useCallback(()=>{n(sn({step:D.SETUP_FEE,answers:{}})).then(h=>{n(Jr({isPayrollEnrolled:!0})),H(h.payload.current_required_step)}).catch(h=>{h.response.json().then(x=>x?.errors?A.error(x.errors):A.error(d("errors.generic")))}).finally(()=>{a(!1)})},[n]),u=o.useCallback(()=>{A.success(d("payroll.dashboard.flash_notice.plaid.success"))},[]),_=o.useCallback(()=>{B(R.SETUP_FEE,F.CONNECT_ACCOUNT_CLICKED),n(Vt({onSuccessCallback:c,onPlaidLoading:l,hideCloseIcon:!0}))},[n,c,l]),p=e.jsx(we,{i18nKey:"payroll.self_serve.linear_flow.steps.setup_fee.buttons.save_exit",icon:"",onClickCallback:void 0,previousStep:void 0,variant:"tertiary"}),m=e.jsx(Ro,{className:Wi("button-connect"),buttonVariant:"primary",handleShowPayrollConnectBankAccountModal:_,onPlaidSuccess:u,onSuccessCallback:c,isLoading:t,isDisabled:void 0,handleSetIsLoading:l,icon:void 0,onClickCallback:void 0,theme:"primary",i18n:"payroll.self_serve.linear_flow.steps.setup_fee.buttons.connect",fullWidth:!0,endIcon:"ChevronRight"});return e.jsx(i,{className:Ui(),children:e.jsxs(ae,{p:s?"md":"lg",children:[e.jsx(i,{mb:"lg",children:e.jsx(v,{variant:s?"heading3":"heading2",children:d("payroll.self_serve.update_linear_flow.steps.setup_fee.title")})}),e.jsx(i,{children:e.jsx(v,{variant:"body",asHTML:!0,children:d("payroll.self_serve.update_linear_flow.steps.setup_fee.description")})}),e.jsxs(i,{column:s,hcenter:s,hright:!s,mt:24,children:[e.jsx(i,{mb:s?12:null,children:s?m:p}),s?p:m]})]})})},On=o.createContext(null),zi=({step:r,slug:s,value:n,suggestedValue:t,context:a,isRequired:l=!0})=>{const c=o.useCallback(()=>Ge(a.emailAddress)?n||t:a.emailAddress,[a.emailAddress,t,n]);o.useEffect(()=>{const _=c();a.setEmailAddress(_),a.setEmailValidationError(_&&!String(_).toLowerCase().match(qt))},[a,c]);const u=o.useCallback(()=>a.handleFocus("email"),[a]);return e.jsx(rr,{name:s,label:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.title`),value:c()??null,onChange:a.setEmailAddress,onFocus:u,placeholder:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.placeholder`),isRequired:l,type:"email"})},Hi=Ks(),Yi=({step:r,slug:s,value:n,suggestedValue:t,context:a,isRequired:l=!0})=>{const c=o.useCallback(()=>Ge(a.personalPhoneNumber)?n||t:a.personalPhoneNumber,[a.personalPhoneNumber,t,n]);o.useEffect(()=>{const _=c();a.setPersonalPhoneNumber(_),a.setPhoneValidationError(Hi(_))},[a,c]);const u=o.useCallback(()=>a.handleFocus("phone_number"),[a]);return e.jsx(An,{name:s,label:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.title`),value:c()??null,onChange:a.setPersonalPhoneNumber,onFocus:u,isRequired:l,dataTestId:"personal-phone-number-input",errorMessage:a.phoneValidationError})},Fr=["signer","admin","company","accountant"],Rr=({step:r,slug:s,value:n,suggestedValue:t,state:a,context:l,isRequired:c=!0})=>{const u=o.useMemo(()=>Ge(a.fieldValue)?n||t:a.fieldValue,[a.fieldValue,t,n]);return o.useEffect(()=>{u&&a.setFieldValue(u),s===fs&&l.setFirstNameValidationError(Fr.some(_=>u?.toLowerCase()?.includes(_))),s===ys&&l.setLastNameValidationError(Fr.some(_=>u?.toLowerCase()?.includes(_)))},[l,u,s,a]),e.jsx(rr,{name:s,label:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.title`),value:u??null,onChange:a.setFieldValue,placeholder:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.placeholder`),isRequired:c,dataTestId:`${s}-input`})},Gi=({step:r,slug:s,options:n,value:t,context:a,isRequired:l=!0})=>{const[c,u]=o.useState([]),_=o.useCallback(()=>Ge(a.title)?t??null:a.title,[a,t]);o.useEffect(()=>{u(n.map(m=>({label:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.options.${m}`),value:m})))},[n,s,r]),o.useEffect(()=>{a.setTitle(_())},[]);const p=o.useCallback(()=>a.handleFocus("title"),[a]);return e.jsx(kn,{name:s,label:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.title`),value:_(),onChange:a.setTitle,onFocus:p,options:c,placeholder:d(`payroll.self_serve.linear_flow.steps.${r}.questions.${s}.placeholder`),isRequired:l,dataTestId:"title-select"})},Ki=({children:r})=>
1{const[s,n]=o.useState(null),[t,a]=o.useState(null),[l,c]=o.useState(null),[u,_]=o.useState(null),[p,m]=o.useState(null),[h,x]=o.useState(null),[f,y]=o.useState(!1),[w,b]=o.useState(!1),[g,C]=o.useState(!1),[j,E]=o.useState(!1),[k,M]=o.useState(null),U=o.useCallback(P=>{B(R.SIGNATORY_DETAILS,F.FIELD_FOCUSED,{field:P})},[]),W=o.useMemo(()=>({first_name:{order:1,fieldValue:s,setFieldValue:n,isRequired:!0,component:Rr},last_name:{order:2,fieldValue:t,setFieldValue:a,isRequired:!0,component:Rr},title:{component:Gi,order:3},email_address:{component:zi,order:4},personal_phone_number:{component:Yi,order:5}}),[s,t]),Z=o.useCallback(()=>{const P=[s,t,u,h,k].some(K),I=w||j;return P||f||!ao(h)||I||g},[u,h,k,s,t,w,j,f,g]),[X,J]=o.useState(!1),se=o.useCallback((P,I)=>({...{title:u||I.find(O=>O.slug===uo)?.value,email_address:h||I.find(O=>O.slug===_n)?.value,personal_phone_number:Zs(k||I.find(O=>O.slug===co)?.value)},first_name:s||I.find(O=>O.slug===fs)?.value,last_name:t||I.find(O=>O.slug===ys)?.value}),[h,s,t,k,u]),Y=o.useCallback((P,I)=>{J(!0);const Q=se(P,I);ce("/payroll/linear_flow/save_answers",{step:P,answers:Q}).then(O=>{J(!1),H(O.current_required_step)}).catch(O=>{J(!1),O.response.json().then(L=>{if(L){let V;if(L.check_error){const re=Pe(L.check_error);return m(L.raw_error_data?.error??null),A.error(re,$)}if(L.error)return A.error(L.error,$);L[0]?.answers_validation_errors?V=be(L[0].answers_validation_errors):V=d("errors.generic"),B(R.SIGNATORY_DETAILS,F.ERROR_MESSAGE_SHOWN,{error:V}),A.error(V,$)}})})},[se]);return e.jsx(On.Provider,{value:{firstName:s,setFirstName:n,lastName:t,setLastName:a,legalName:l,setLegalName:c,title:u,setTitle:_,emailAddress:h,setEmailAddress:x,personalPhoneNumber:k,setPersonalPhoneNumber:M,handleClickNext:Y,isNextDisabled:Z,isNextLoading:X,handleFocus:U,SLUGS_QUESTIONS_METADATA:W,emailValidationError:f,setEmailValidationError:y,phoneValidationError:g,setPhoneValidationError:C,firstNameValidationError:w,setFirstNameValidationError:b,lastNameValidationError:j,setLastNameValidationError:E,checkRawError:p,setCheckRawError:m},children:r})},{cx:Qi,cxEl:Zi}=T("SignatoryDetailsStep"),Ws=({show:r,i18nKey:s,mt:n})=>r?e.jsx(i,{mt:n,children:e.jsx(v,{variant:"bodySm",color:"error300",children:d(s)})}):null,Xi=(r,s,n,t)=>{const a=n.SLUGS_QUESTIONS_METADATA[s.slug];if(!a)return null;const l=a.component;if(!l)return null;const c=a.children;return e.jsx(i,{column:!0,className:Zi(s.slug),basis:t?"100%":"50%",children:e.jsxs(i,{children:[e.jsx(l,{step:r,slug:s.slug,value:s.value,suggestedValue:s.suggested_value,questionFormat:s.answer_format,options:s.options,state:a,fieldValue:a.fieldValue,setFieldValue:a.setFieldValue,context:n,children:c?e.jsx(c,{}):null}),e.jsx(Ws,{show:n.emailValidationError&&s.slug===_n,i18nKey:"payroll.self_serve.linear_flow.errors.validations.email_address.invalid",mt:2}),e.jsx(Ws,{show:n.firstNameValidationError&&s.slug===fs,i18nKey:"payroll.self_serve.linear_flow.errors.validations.legal_name.invalid",mt:"2xs"}),e.jsx(Ws,{show:n.lastNameValidationError&&s.slug===ys,i18nKey:"payroll.self_serve.linear_flow.errors.validations.legal_name.invalid",mt:"2xs"})]})},s.slug)},Ji=(r,s,n)=>{const t=n?1:2,a=Qe(r.questions,s),l=[];for(let c=0;c<a.length;c+=t)l.push(a.slice(c,c+t));return l.map((c,u)=>e.jsx(i,{row:!0,gap:"md",w:"100%",children:c.map(_=>Xi(r.step,_,s,n))},u))},ea=({mobile:r,stepData:s,currentCompany:n})=>{const t=as(),l=!Ke(),c=ge(),u=c,_=o.useContext(On);return o.useEffect(()=>{t(F.PAGE_VIEWED,ve.VIEW)},[]),he(s),_?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:Qi(),p:u?"md":"lg",children:e.jsxs(i,{column:!0,gap:"md",children:[e.jsxs(i,{children:[e.jsx(v,{variant:u?"heading3":"heading2",color:"mono900",children:d("payroll.self_serve.update_linear_flow.steps.signatory_details.title")}),e.jsx(i,{children:e.jsx(v,{variant:"body",color:"primary",children:d("payroll.self_serve.update_linear_flow.steps.signatory_details.subtitle",{props:{companyName:n.get("name")}})})})]}),e.jsx(i,{column:!0,gap:"md",...l&&{hcenter:!0},children:s.questions&&Ji(s,_,l)}),!c&&e.jsxs(i,{mt:40,row:!0,maxh:72,maxw:r?"inherit":800,hright:!0,children:[e.jsx(we,{previousStep:s.previous_step,onClickCallback:void 0,i18nKey:void 0}),e.jsx(ds,{mobile:r,handleClickNext:_.handleClickNext,stepData:s,disabled:_.isNextDisabled(),isLoading:_.isNextLoading})]})]})}),c&&e.jsx(Ee,{backProps:{previousStep:s.previous_step},nextProps:{handleClickNext:_.handleClickNext,stepData:s,disabled:_.isNextDisabled(),isLoading:_.isNextLoading}})]}):null},sa=r=>e.jsx(Ki,{children:e.jsx(ea,{...r})}),ra={[D.INCEPTION_SWITCHER]:vi,[D.PAY_SCHEDULE]:Mi,[D.COMMITMENT]:ul,[D.SETUP_FEE]:Di,[D.DISQUALIFIED]:yi,[D.DISQUALIFIED_NPO]:bi,[D.COMPANY_ADDRESSES]:wl,[D.SCREENER]:Bi,[D.SIGNATORY_DETAILS
1]:sa,[D.COMPANY_DETAILS]:mi,[D.PAY_AND_TEAM]:Ii},na=({step:r})=>{const s=rn(),n=S(nn),t=S(tn),a=s&&n,l=s&&t;return!a&&!l?null:e.jsxs(e.Fragment,{children:[a&&e.jsx(i,{column:!0,shrink:0,children:e.jsx(vn,{})}),l&&e.jsx(i,{column:!0,shrink:0,children:e.jsx(dn,{step:r})})]})},ta=({isMobile:r})=>{const{totalSteps:s=0,currentStepNumber:n=0}=En()??{},t=s>1&&n>0;return r?e.jsxs(i,{row:!0,spacebetween:!0,vcenter:!0,children:[e.jsx(v,{variant:"heading3",children:d("payroll.self_serve.payroll_setup")}),t&&e.jsx(v,{variant:"captionBold",uppercase:!0,children:d("fe_design_base.step_linear_indicator.label",{props:{active:n,steps:s}})})]}):e.jsxs(i,{column:!0,gap:"md",children:[e.jsx(v,{variant:"heading1",children:d("payroll.self_serve.payroll_setup")}),t&&e.jsx(i,{w:"50%",children:e.jsx(an,{steps:s,active:n})})]})},{cx:oa,cxEl:$r}=T("LinearFlowViewMobileOptimization"),la=({step:r,stepData:s,isLoading:n})=>{const t=!Ke(),a=Bt(),l=bs(),[c,u]=o.useState(!1);o.useLayoutEffect(()=>{if(!l)return;const j=document.getElementById("react-nav-root");u(!j||j.offsetHeight===0)},[l]),ol(t),ll();const _=a?"2xl":"lg",p=a?"2xl":"lg",m=S(He),h=S(Zr),x=S(on),f=il(r,s),[y,w]=o.useState(null),b=ra[r],g=_s[r],C=a?800:"inherit";return n||!b||s.step!==r?e.jsx(i,{h:"100dvh",w:"100%",children:e.jsx(i,{hcenter:!0,vcenter:!0,h:"100%",children:e.jsx(ze,{size:"medium",variant:"dark"})})}):e.jsx(jn.Provider,{value:f,children:e.jsx(wn.Provider,{value:y,children:e.jsxs(i,{dataTestId:"linear-flow-view-mobile-optimization",column:!0,bgcolor:"page",className:oa({"no-nav":c,webview:l}),children:[e.jsxs(i,{dataTestId:"linear-flow-view-scrollable",column:!0,className:$r("scrollable"),pt:_,ph:p,pb:l?"var(--mobile-step-footer-height, 96px)":"lg",gap:"lg",children:[e.jsx(i,{maxw:C,children:e.jsx(ta,{isMobile:t})}),g&&!t&&e.jsx(i,{mt:"xs",maxw:C,children:e.jsx(v,{variant:"heading2",color:g.color,children:d(g.i18n,{props:r===D.COMPANY_DETAILS?{companyName:h}:{}})})}),e.jsxs(i,{row:!0,wrap:!a,gap:16,children:[e.jsx(i,{dataTestId:"linear-flow-step-content",grow:1,maxw:C,children:e.jsx(o.Fragment,{children:e.jsx(b,{stepData:s,currentCompany:m,currentLocation:x,className:$r(r),mobile:t})},`mobile-opt-step-${r}`)}),e.jsx(na,{step:r}),e.jsx(je,{})]})]}),e.jsx("div",{ref:w})]})})})},ia=({currentStep:r,steps:s})=>{const n=s.length,t=s.findIndex(c=>c===r);return{progressBarValue:()=>`${(t+1)/n*100}%`,progressBarStartValue:()=>`${t/n*100}%`}},{cx:aa}=T("LinearProgressBar"),ca=({currentStep:r,steps:s})=>{const{progressBarValue:n,progressBarStartValue:t}=ia({currentStep:r,steps:s}),a=Ut({from:{width:t(),height:6},to:{width:n()},config:{mass:3,tension:80,friction:35,clamp:!0}});return e.jsx("div",{className:aa(),children:e.jsx(Wt.div,{title:"Progress Bar",className:"bar-inner",style:a})})},Ve=({hardRefresh:r=!1,step:s,isDisabled:n,isLoading:t,showBackButton:a,previousStep:l,onClickBack:c,steps:u})=>{const _=o.useCallback(()=>{if(c?.(),l)return r?window.location.replace(`/payroll/setup/${l}`):gr.push(`/payroll/setup/${l}`);gr.push("/payroll")},[r,l,c]);return e.jsxs(i,{w:"auto",bgcolor:"mono0",fixed:!0,bottom:0,left:0,right:0,shadow:"z1",shadowDirection:"top",zIndex:2,children:[e.jsx(ca,{currentStep:s,steps:u}),e.jsxs(i,{p:20,gap:16,row:!0,hright:!0,children:[a&&e.jsx(Le,{variant:"tertiary",startIcon:"ChevronLeft",onClick:_,uxElement:"back",children:d("payroll.self_serve.v2.linear_flow.back")}),e.jsx(Le,{variant:"primary",endIcon:"ChevronRight",disabled:n,isLoading:t,type:"submit",uxElement:"next",children:d("payroll.self_serve.v2.linear_flow.next")})]})]})},da={about_you:qo,your_company:Cr,team_and_pay:Dt,documents:Cr},qe=({currentMilestone:r,subtitle:s,subtitleProps:n,title:t})=>{const a=da[r];return e.jsx(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:24,children:e.jsxs(i,{row:!0,gap:51,spacebetween:!0,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading2",color:"mono900",children:t?d(t):null}),e.jsx(v,{color:"mono700",children:s?d(s,{props:n||{}}):null})]}),e.jsx(a,{})]})})},ua=({step:r,steps:s,values:n,isValid:t,stepData:a,mobileView:l,isSubmitting:c,setFieldValue:u,currentCompany:_,onClickAuthorizedSignerLink:p})=>
1{const[m,h]=o.useState(!1),x=o.useCallback(({value:g})=>{m===!1&&h(!0),m&&["v2_authorized_signer_first_name","v2_authorized_signer_last_name","v2_authorized_signer_email_address","v2_authorized_signer_phone_number","v2_authorized_signer_title"].forEach(j=>u(j,"")),u("v2_is_authorized_signer",g)},[m,u]),f=o.useMemo(()=>Object.entries(d("payroll.self_serve.v2.linear_flow.steps.about_you.details.questions.title.options")).map(([g,C])=>({label:C,value:g})),[]),y=n.v2_is_authorized_signer==="true",w=y?"signer_title":"non_signer_title",b=y?"signer_desc":"non_signer_desc";return e.jsxs(me,{children:[e.jsxs(i,{mt:24,mb:110,children:[e.jsx(qe,{title:"payroll.self_serve.v2.linear_flow.steps.about_you.title",subtitle:"payroll.self_serve.v2.linear_flow.steps.about_you.subtitle",currentMilestone:"about_you"}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:24,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.about_you.is_authorized_signer.title")}),e.jsx(v,{color:"mono700",children:d("payroll.self_serve.v2.linear_flow.steps.about_you.is_authorized_signer.desc",{props:{companyName:_.get("name")}})})]}),e.jsx(i,{mv:8,gap:8,row:!0,wrap:!0,children:["true","false"].map(g=>e.jsx(pe,{value:g,uxElement:"is_authorized_signer",onClick:x,size:"medium",selected:n.v2_is_authorized_signer===g,children:d(`payroll.self_serve.v2.linear_flow.steps.about_you.is_authorized_signer.options.${g}`)},`option-${g}`))}),e.jsx(xe,{uxElement:"authorized-signer",onClick:p,children:d("payroll.self_serve.v2.linear_flow.steps.about_you.is_authorized_signer.what_is")})]}),n.v2_is_authorized_signer&&n.v2_is_authorized_signer!==""&&e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",p:20,children:[e.jsxs(i,{column:!0,gap:8,mb:16,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d(`payroll.self_serve.v2.linear_flow.steps.about_you.details.${w}`)}),e.jsx(v,{color:"mono700",children:d(`payroll.self_serve.v2.linear_flow.steps.about_you.details.${b}`)})]}),e.jsxs(i,{column:!0,children:[e.jsxs(i,{maxw:340,row:!l,gap:14,children:[e.jsx(_e,{name:"v2_authorized_signer_first_name",label:d("payroll.self_serve.v2.linear_flow.steps.about_you.details.questions.first_name"),uxElement:"first_name",fullWidth:!0,hasAsterisk:!0,trim:!0}),e.jsx(_e,{name:"v2_authorized_signer_last_name",label:d("payroll.self_serve.v2.linear_flow.steps.about_you.details.questions.last_name"),uxElement:"last_name",fullWidth:!0,hasAsterisk:!0,trim:!0})]}),e.jsxs(i,{maxw:340,row:!l,gap:14,children:[e.jsx(_e,{name:"v2_authorized_signer_email_address",label:d("payroll.self_serve.v2.linear_flow.steps.about_you.details.questions.email"),uxElement:"email",fullWidth:!0,hasAsterisk:!0,trim:!0}),e.jsx(Re,{name:"v2_authorized_signer_title",label:d("payroll.self_serve.v2.linear_flow.steps.about_you.details.questions.title.title"),placeholder:d("payroll.self_serve.v2.linear_flow.steps.about_you.details.questions.title.placeholder"),uxElement:"title",options:f,fullWidth:!0,hasAsterisk:!0})]}),e.jsx(i,{maxw:340,row:!l,children:e.jsx(ln,{name:"v2_authorized_signer_phone_number",label:d("payroll.self_serve.v2.linear_flow.steps.about_you.details.questions.phone_number"),uxElement:"phone_number",fullWidth:!0,hasAsterisk:!0})})]})]})]}),e.jsx(Ve,{isLoading:c,isDisabled:!t,step:r,previousStep:a.previous_step,showBackButton:!1,steps:s})]})},_a=/^\d{2}-?\d{7}$/,pa=Te({v2_is_authorized_signer:N().required(),v2_authorized_signer_first_name:N().required(d("fe_design_base.errors.field.first_name_required")),v2_authorized_signer_last_name:N().required(d("payroll.self_serve.v2.linear_flow.errors.last_name_required")),v2_authorized_signer_email_address:N().email(d("fe_design_base.errors.field.email_invalid")).required(d("fe_design_base.errors.field.email_required")),v2_authorized_signer_phone_number:N().required(d("fe_design_base.errors.field.phone_required")).matches(/^\d{10}$/,d("fe_design_base.errors.field.phone_invalid")),v2_authorized_signer_title:N().required()}),ma=Te({v2_business_legal_name:N().required(d("validations.generic.required")),v2_federal_employer_identification_number:N().required(d("validations.generic.required")).matches(_a,{message:d("payroll.self_serve.linear_flow.errors.validations.invalid_fein"),excludeEmptyString:!0}),v2_business_type:N().required("validations.generic.required"),v2_business_phone_number:N().required(d("fe_design_base.errors.field.phone_required")).matches(/^\d{10}$/,d("fe_design_base.errors.field.phone_invalid"))}),ha=Te({v2_company_industry:N().required(d("validations.generic.required")),v2_household_employees:N().required(d("validations.generic.required")),v2_paid_employees_outside_united_states:N().required(d("validations.generic.required")),v2_restricted_industry:N().required(d("validations.generic.required"))}),fa=Te({v2_number_of_team_member_w2:N().required(d("validations.generic.required")),v2_number_of_team_member_1099:N().required(d("validations.generic.required")).when("v2_number_of_team_member_w2",{is:"none",then:N().notOneOf(["none"],d("payroll.self_serve.linear_flow.errors.validations.invalid_w2_1009_count_option"))})}),ya=Te({v2_has_comp_policy:N().required(d("validations.generic.required")),v2_interested_in_hb_comp_policy:N().when("v2_has_comp_policy",(r,s)=>r==="true"?s.required(d("validations.generic.required")):s),v2_has_pto_policies:N().required(d("validations.generic.required"))}),xa=Te({v2_first_time_running_payroll:N().required(d("validations.generic.required")),v2_current_provider:N().when("v2_first_time_running_payroll",(r,s)=>r==="currently_runs_payroll"?s.required(d("validations.generic.required")):s),v2_unstructured_switcher_taxes:N().when("v2_current_provider",(r,s)=>r==="i_calculate_payroll_myself"||r==="my_accountant_bookkeeper_runs_payroll_for_me"?s.required(d("validations.generic.required")):s),v2_accountant_cooperation:N().when("v2_current_provider",(r,s)=>r==="my_accountant_bookkeeper_runs_payroll_for_me"?s.when("v2_unstructured_switcher_taxes",n=>{if(n==="yes_taxes_withheld")return s.required(d("validations.generic.required"))}):s),v2_average_total_payroll_amount:N().when("v2_first_time_running_payroll",(r,s)=>r==="currently_runs_payroll"?s.required(d("validations.generic.required")):s)}),ba=Te().shape({line1:N().required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.line1")).nullable(),line2:N().nullable(),city:N().required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.city")).nullable(),state:N().required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.state")).nullable(),postal_code:N().test("is-five-digits",d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.postal_code.valid"),r=>!!(r&&r.toString().length===5)).required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.postal_code.required")).nullable()}),ga=zt(r=>Te(Ht(r,(s,n)=>n.includes("line1_location")?N().required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.line1")).nullable():n.includes("line2_location")?N().nullable():n.includes("city_location")?N().required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.city")).nullable():n.includes("state_location")?N().required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.state")).nullable():n.includes("postal_code_location")?N().test("is-five-digits",d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.postal_code.valid"),t=>!!(t&&t.toString().length===5)).required(d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.postal_code.required")).nullable():!1)).concat(ba)),va=(r,s)=>{const n={};
1return s.forEach(t=>{t.includes("phone_number")?n[t]=parseInt(r[t]?.replace(pn,""),10):n[t]=r[t]}),n},Ca=({step:r,openSidePanel:s,stepData:n})=>{const t=o.useCallback(u=>va(u,["v2_is_authorized_signer","v2_authorized_signer_title","v2_authorized_signer_email_address","v2_authorized_signer_first_name","v2_authorized_signer_last_name","v2_authorized_signer_phone_number"]),[]),a=o.useCallback((u,{setSubmitting:_})=>{const p=t(u);ce("/payroll/linear_flow/save_answers",{step:r,answers:p}).then(m=>{H(m.current_required_step)}).catch(m=>{m.response.json().then(h=>{if(h){let x;if(h.check_error){const f=Pe(h.check_error);return A.error(f,$)}if(h.error)return A.error(h.error,$);h.answers_validation_errors?x=be(h.answers_validation_errors):x=d("errors.generic"),B(R.ABOUT_YOU,F.ERROR_MESSAGE_SHOWN,{error:x}),A.error(x,$)}})}).finally(()=>{_(!1)})},[t,r]),l=o.useMemo(()=>{const u=["v2_is_authorized_signer","v2_authorized_signer_first_name","v2_authorized_signer_last_name","v2_authorized_signer_email_address","v2_authorized_signer_phone_number","v2_authorized_signer_title"],_=u.reduce((p,m)=>(p[m]="",p),{});return u.forEach(p=>{const m=n.questions.find(x=>x.slug===p)?.suggested_value||"",h=n.questions.find(x=>x.slug===p)?.value||"";_[p]=h||m}),_},[n.questions]),c=o.useCallback(()=>{s({sidePanelType:ns.AUTHORIZED_SIGNER_PANEL})},[s]);return{handleClickNext:a,initialValues:l,onClickAuthorizedSignerLink:c}},wa=({step:r,stepData:s,mobileView:n,openSidePanel:t,currentCompany:a})=>{const{handleClickNext:l,initialValues:c,onClickAuthorizedSignerLink:u}=Ca({step:r,openSidePanel:t,stepData:s});return e.jsx(Ne,{validateOnMount:!0,enableReinitialize:!0,onSubmit:l,initialValues:c,validationSchema:pa,children:_=>e.jsxs(e.Fragment,{children:[e.jsx(ua,{step:r,stepData:s,mobileView:n,currentCompany:a,steps:s.required_steps.slice(1),onClickAuthorizedSignerLink:u,..._}),e.jsx(je,{})]})})},ja=({currentUserFirstName:r,step:s,steps:n,isValid:t,isSubmitting:a,previousStep:l,values:c,setValues:u,setFieldValue:_})=>{const p=o.useCallback(({value:y})=>{let w,b,g,C;y==="never_ran_payroll"?(w="",b="",g="",C="",u({v2_first_time_running_payroll:y,v2_current_provider:w,v2_unstructured_switcher_taxes:b,v2_accountant_cooperation:g,v2_average_total_payroll_amount:C})):u({...c,v2_first_time_running_payroll:y})},[u,c]),m=o.useCallback(({value:y})=>{_("v2_unstructured_switcher_taxes",y)},[_]),h=o.useCallback(({value:y})=>{_("v2_accountant_cooperation",y)},[_]),x=o.useMemo(()=>Object.entries(d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.current_provider.options")).map(([y,w])=>({label:w,value:y})),[]),f=o.useMemo(()=>Object.entries(d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.average_total_payroll_amount.options")).map(([y,w])=>({label:w,value:y})),[]);return e.jsxs(me,{className:"TeamAndPay1Form",children:[e.jsxs(i,{mt:24,mb:110,children:[e.jsx(qe,{title:"payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.title",subtitle:"payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.subtitle",currentMilestone:"team_and_pay"}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:20,children:[e.jsx(i,{column:!0,gap:8,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.first_time_running_payroll.title")})}),e.jsx(i,{pt:16,gap:8,row:!0,wrap:!0,children:["currently_runs_payroll","never_ran_payroll"].map(y=>e.jsx(pe,{value:y,uxElement:"first_time_running_payroll",onClick:p,size:"medium",selected:c.v2_first_time_running_payroll===y,children:d(`payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.first_time_running_payroll.options.${y}`)},`option-${y}`))})]}),c.v2_first_time_running_payroll==="currently_runs_payroll"&&e.jsx(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,pt:20,children:e.jsx(i,{row:!0,wrap:!0,children:e.jsx(Re,{name:"v2_current_provider",label:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.current_provider.title"),placeholder:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.current_provider.placeholder"),uxElement:"current_provider",options:x,fullWidth:!0})})}),c.v2_first_time_running_payroll==="currently_runs_payroll"&&(c.v2_current_provider==="i_calculate_payroll_myself"||c.v2_current_provider==="my_accountant_bookkeeper_runs_payroll_for_me")&&e.jsxs(i,{bradiu
1sm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,pt:20,pb:20,children:[e.jsx(i,{column:!0,gap:8,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.unstructured_switcher_taxes.title")})}),e.jsx(i,{pt:16,gap:8,row:!0,wrap:!0,children:["yes_taxes_withheld","no_taxes_not_withheld"].map(y=>e.jsx(pe,{value:y,uxElement:"unstructured_switcher_taxes",onClick:m,size:"medium",selected:c.v2_unstructured_switcher_taxes===y,children:d(`payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.unstructured_switcher_taxes.options.${y}`)},`option-${y}`))})]}),c.v2_first_time_running_payroll==="currently_runs_payroll"&&c.v2_current_provider==="my_accountant_bookkeeper_runs_payroll_for_me"&&c.v2_unstructured_switcher_taxes==="yes_taxes_withheld"&&e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,pt:20,pb:20,children:[e.jsx(i,{column:!0,gap:8,maxh:560,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.accountant_cooperation.title")})}),e.jsx(i,{pt:16,gap:8,row:!0,wrap:!0,children:["yes_will_work_with_homebase","no_wont_work_with_homebase"].map(y=>e.jsx(pe,{value:y,uxElement:"accountant_cooperation",onClick:h,size:"medium",selected:c.v2_accountant_cooperation===y,children:d(`payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.accountant_cooperation.options.${y}`)},`option-${y}`))})]}),c.v2_first_time_running_payroll==="currently_runs_payroll"&&e.jsx(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,children:e.jsx(i,{pt:16,gap:8,row:!0,wrap:!0,children:e.jsx(Re,{name:"v2_average_total_payroll_amount",label:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.average_total_payroll_amount.title"),placeholder:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.average_total_payroll_amount.placeholder"),uxElement:"average_total_payroll_amount",options:f,fullWidth:!0})})}),t&&e.jsx(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,pt:20,pb:20,children:e.jsxs(i,{vcenter:!0,row:!0,children:[e.jsx(i,{pr:16,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",children:[e.jsx("path",{d:"M14.119 19.8461C13.5565 19.2742 12.7877 18.9648 11.9908 18.9648C11.7814 18.9648 11.5706 18.9861 11.3617 19.0304C10.3661 19.2472 9.54574 19.9533 9.18762 20.9082L0.271991 44.9082C-0.141071 46.0098 0.12846 47.252 0.960491 48.0845C1.45052 48.6555 2.21833 48.9648 3.00021 48.9648C3.35468 48.9648 3.71215 48.9033 4.0549 48.7744L27.9705 39.7744C28.9258 39.4171 29.6318 38.5969 29.8483 37.6004C30.0622 36.6047 29.7576 35.5641 29.0368 34.8432L14.119 19.8461ZM3.00021 45.8805L5.69177 38.6936L10.1852 43.187L3.00021 45.8805ZM13.2658 42.1117L6.84302 35.6889L8.95615 30.0452L18.9124 40.0014L13.2658 42.1117ZM21.994 38.8398L10.1158 26.9617L11.989 21.9686C11.9866 21.9686 11.9917 21.9679 11.989 21.9686L26.9983 36.8842L21.994 38.8398ZM46.5002 24.9648H45.4802C40.7336 24.9648 36.2871 27.3817 33.274 31.592C32.7935 32.2688 32.9487 33.2036 33.6226 33.6864C33.8908 33.8711 34.2002 33.9648 34.5002 33.9648C34.9661 33.9648 35.4289 33.7451 35.7218 33.3378C38.1565 29.9242 41.6346 27.9648 45.4783 27.9648H46.5002C47.3252 27.9648 48.0002 27.2898 48.0002 26.4648C48.0002 25.6398 47.3252 24.9648 46.5002 24.9648ZM16.5002 15.9648C16.8002 15.9648 17.1096 15.8711 17.3721 15.6836C21.5815 12.6742 24.0002 8.23047 24.0002 3.48484V2.46484C24.0002 1.63572 23.3293 0.964844 22.5846 0.964844C21.7555 0.964844 21.0846 1.63572 21.0846 2.46484V3.48484C21.0846 7.24984 19.1271 10.8058 15.7118 13.2442C14.9533 13.7242 14.794 14.6617 15.1971 15.3367C15.5721 15.7492 16.0315 15.9648 16.5002 15.9648ZM6.00021 6.21484C7.24333 6.21484 8.25021 5.20703 8.25021 3.96484C8.25021 2.72172 7.24333 1.71484 6.00021 1.71484C4.75802 1.71484 3.83458 2.72172 3.83458 3.96484C3.75115 5.20703 4.75802 6.21484 6.00021 6.21484ZM45.0002 40.7148C43.758 40.7148 42.7502 41.7217 42.7502 42.9648C42.7502 44.207 43.758 45.2148 45.0002 45.2148C46.2433 45.2148 47.2502 44.207 47.2502 42.9648C47.2502 41.718 46.2471 40.7148 45.0002 40.7148ZM45.0002 13.7148C43.758 13.7148 42.7502 14.7217 42.7502 15.9648C42.7502 17.207 43.758 18.2148 45.0002 18.2148C46.2433 18.2148 47.2502 17.207 47.2502 15.9648C47.2502 14.718 46.2471 13.7148 45.0002 13.7148ZM35.8783 17.3805C37.7383 15.1773 37.6043 13.068 37.4955 11.3748C37.4018 9.86359 37.3315 8.77328 38.4125 7.48984C39.4878 6.21578 40.5509 6.11922 42.0219 5.98703C43.6981 5.83469 45.7803 5.64428 47.6497 3.42953C48.1858 2.79672 48.1038 1.85078 47.471 1.31734C46.844 0.787094 45.8951 0.863219 45.3588 1.49603C44.2835 2.77009 43.2204 2.86666 41.7494 2.99884C40.0732 3.15119 37.991 3.34159 36.1216 5.55634C34.2616 7.75947 34.3957 9.86884 34.5044 11.562C34.5982 13.0732 34.6685 14.1635 33.5875 15.447C32.515 16.7154 31.4546 16.812 29.9837 16.9442C28.3075 17.0936 26.2253 17.2811 24.3587 19.496C23.8226 20.1288 23.9046 21.0748 24.5374 21.6082C24.8158 21.8523 25.1533 21.9648 25.5002 21.9
1648C25.925 21.9648 26.3498 21.7832 26.6458 21.4316C27.7183 20.1632 28.7786 20.0666 30.2496 19.9344C31.9221 19.7898 34.0127 19.6023 35.8783 17.3805Z",fill:"#1E0B3A"}),e.jsx("path",{d:"M46.5001 24.9648H45.4801C40.7335 24.9648 36.2869 27.3817 33.2738 31.592C32.7933 32.2688 32.9486 33.2036 33.6225 33.6864C33.8907 33.8711 34.2001 33.9648 34.5001 33.9648C34.9659 33.9648 35.4287 33.7451 35.7216 33.3378C38.1563 29.9242 41.6344 27.9648 45.4782 27.9648H46.5001C47.3251 27.9648 48.0001 27.2898 48.0001 26.4648C48.0001 25.6398 47.3251 24.9648 46.5001 24.9648ZM16.5001 15.9648C16.8001 15.9648 17.1094 15.8711 17.3719 15.6836C21.5813 12.6742 24.0001 8.23047 24.0001 3.48484V2.46484C24.0001 1.63572 23.3292 0.964844 22.5844 0.964844C21.7553 0.964844 21.0844 1.63572 21.0844 2.46484V3.48484C21.0844 7.24984 19.1269 10.8058 15.7116 13.2442C14.9532 13.7242 14.7938 14.6617 15.1969 15.3367C15.5719 15.7492 16.0313 15.9648 16.5001 15.9648ZM6.00005 6.21484C7.24318 6.21484 8.25005 5.20703 8.25005 3.96484C8.25005 2.72172 7.24318 1.71484 6.00005 1.71484C4.75787 1.71484 3.83443 2.72172 3.83443 3.96484C3.75099 5.20703 4.75787 6.21484 6.00005 6.21484ZM45.0001 40.7148C43.7579 40.7148 42.7501 41.7217 42.7501 42.9648C42.7501 44.207 43.7579 45.2148 45.0001 45.2148C46.2432 45.2148 47.2501 44.207 47.2501 42.9648C47.2501 41.718 46.2469 40.7148 45.0001 40.7148ZM45.0001 13.7148C43.7579 13.7148 42.7501 14.7217 42.7501 15.9648C42.7501 17.207 43.7579 18.2148 45.0001 18.2148C46.2432 18.2148 47.2501 17.207 47.2501 15.9648C47.2501 14.718 46.2469 13.7148 45.0001 13.7148ZM35.8782 17.3805C37.7382 15.1773 37.6041 13.068 37.4954 11.3748C37.4016 9.86359 37.3313 8.77328 38.4123 7.48984C39.4876 6.21578 40.5508 6.11922 42.0217 5.98703C43.698 5.83469 45.7801 5.64428 47.6495 3.42953C48.1857 2.79672 48.1036 1.85078 47.4708 1.31734C46.8438 0.787094 45.8949 0.863219 45.3587 1.49603C44.2833 2.77009 43.2202 2.86666 41.7493 2.99884C40.073 3.15119 37.9908 3.34159 36.1215 5.55634C34.2615 7.75947 34.3955 9.86884 34.5043 11.562C34.598 13.0732 34.6683 14.1635 33.5873 15.447C32.5148 16.7154 31.4545 16.812 29.9836 16.9442C28.3073 17.0936 26.2251 17.2811 24.3586 19.496C23.8224 20.1288 23.9044 21.0748 24.5372 21.6082C24.8157 21.8523 25.1532 21.9648 25.5001 21.9648C25.9248 21.9648 26.3496 21.7832 26.6457 21.4316C27.7182 20.1632 28.7785 20.0666 30.2494 19.9344C31.9219 19.7898 34.0126 19.6023 35.8782 17.3805Z",fill:"#7E3DD4"})]})}),e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.halfway_done_info.title",{props:{currentUserFirstName:r}})}),e.jsx(v,{color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.team_and_pay_1.halfway_done_info.subtitle")})]})]})})]}),e.jsx(Ve,{showBackButton:!0,isLoading:a,isDisabled:!t,step:s,steps:n,previousStep:l})]})},Ea=({step:r,stepData:s,currentUser:n})=>{const t=o.useMemo(()=>({v2_first_time_running_payroll:s.questions.find(c=>c.slug==="v2_first_time_running_payroll")?.value||"",v2_current_provider:s.questions.find(c=>c.slug==="v2_current_provider")?.value||"",v2_unstructured_switcher_taxes:s.questions.find(c=>c.slug==="v2_unstructured_switcher_taxes")?.value||"",v2_accountant_cooperation:s.questions.find(c=>c.slug==="v2_accountant_cooperation")?.value||"",v2_average_total_payroll_amount:s.questions.find(c=>c.slug==="v2_average_total_payroll_amount")?.value||""}),[s.questions]),a=o.useCallback(c=>({v2_first_time_running_payroll:c.v2_first_time_running_payroll,v2_current_provider:c.v2_current_provider,v2_unstructured_switcher_taxes:c.v2_unstructured_switcher_taxes,v2_accountant_cooperation:c.v2_accountant_cooperation,v2_average_total_payroll_amount:c.v2_average_total_payroll_amount}),[]),l=o.useCallback((c,{setSubmitting:u})=>{const _=a(c);ce("/payroll/linear_flow/save_answers",{step:r,answers:_}).then(p=>{H(p.current_required_step)}).catch(p=>{p.response.json().then(m=>{if(m&&m[0]?.answers_validation_errors)return A.error(be(m[0].answers_validation_errors),$);if(m[0]?.check_error){const h=Pe(m[0].check_error);return A.error(h,$)}if(m[0]?.error)return A.error(m[0].error);A.error(d("errors.generic"))})}).finally(()=>{u(!1)})},[a,r]);return e.jsx(Ne,{validateOnMount:!0,enableReinitialize:!0,onSubmit:l,initialValues:t,validationSchema:xa,children:c=>e.jsxs(e.Fragment,{children:[e.jsx(ja,{currentUserFirstName:n.get("first_name"),step:r,previousStep:s.previous_step,steps:s.required_steps.slice(1),...c}),e.jsx(je,{})]})})},Sa=ls(r=>({currentUser:Yt(r)}),{})(Ea),ka=()=>e.jsx("div",{children:"To be implemented"}),Aa="https://www.irs.gov/businesses/small-businesses-self-employed/apply-for-an-employer-identification-number-ein-online",L
1a=({step:r,steps:s,isValid:n,isSubmitting:t,previousStep:a,onClickRequiredFormattingLink:l,onClickDbaLink:c})=>{const u=o.useMemo(()=>Object.entries(d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_type.options")).map(([_,p])=>({label:p,value:_})),[]);return e.jsxs(me,{children:[e.jsxs(i,{mt:24,mb:110,children:[e.jsx(qe,{title:"payroll.self_serve.v2.linear_flow.steps.your_company_1.title",subtitle:"payroll.self_serve.v2.linear_flow.steps.your_company_1.subtitle",currentMilestone:"your_company"}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:16,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",className:"required",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_legal_name.title")}),e.jsx(v,{color:"mono700",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_legal_name.desc")})]}),e.jsxs(i,{maxw:400,column:!0,gap:4,mt:24,children:[e.jsx(_e,{name:"v2_business_legal_name",uxElement:"v2_business_legal_name",placeholder:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_legal_name.placeholder"),fullWidth:!0,trim:!0}),e.jsx(xe,{uxElement:"v2_business_legal_name",onClick:l,children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_legal_name.link")})]})]}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:16,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",className:"required",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.federal_employer_identification_number.title")}),e.jsx(v,{color:"mono700",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.federal_employer_identification_number.desc")})]}),e.jsxs(i,{maxw:400,column:!0,gap:4,mt:24,children:[e.jsx(Bo,{isEIN:!0,name:"v2_federal_employer_identification_number",uxElement:"v2_federal_employer_identification_number",fullWidth:!0}),e.jsx(xe,{target:"_blank",endIcon:"ExternalLink",uxElement:"v2_federal_employer_identification_number",href:Aa,children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.federal_employer_identification_number.link")})]})]}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:16,children:[e.jsx(v,{variant:"heading3",color:"mono900",className:"required",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_phone_number.title")}),e.jsx(i,{maxw:400,mt:12,children:e.jsx(ln,{name:"v2_business_phone_number",uxElement:"phone_number",label:null,fullWidth:!0})})]}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:16,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.dba_or_trade_name.title")}),e.jsxs(i,{maxw:400,column:!0,gap:4,mt:12,children:[e.jsx(_e,{name:"v2_dba_or_trade_name",uxElement:"v2_dba_or_trade_name",placeholder:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.dba_or_trade_name.placeholder"),fullWidth:!0,trim:!0}),e.jsx(xe,{uxElement:"v2_dba_or_trade_name",onClick:c,children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.dba_or_trade_name.link")})]})]}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:16,children:[e.jsx(v,{variant:"heading3",color:"mono900",className:"required",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_type.title")}),e.jsx(i,{maxw:400,mt:10,children:e.jsx(Re,{name:"v2_business_type",placeholder:d("payroll.self_serve.v2.linear_flow.steps.your_company_1.questions.business_type.placeholder"),uxElement:"v2_business_type",options:u,fullWidth:!0})})]})]}),e.jsx(Ve,{showBackButton:!0,isLoading:t,isDisabled:!n,step:r,steps:s,previousStep:a})]})},We={verified:"verified",rejected:"rejected",final_rejected:"final_rejected",expired:"expired"},Na={[We.verified]:!0,[We.final_rejected]:!0,[We.expired]:!0},Ta=({step:r,openSidePanel:s,stepData:n,companyName:t,feinVerificationStatus:a,isFeinVerificationWaiting:l,isFeinVerificationNull:c,verifyFein:u,showPayrollSelfSetupFeinRejectedModal:_})=>{const p=(b,g)=>{const C={};return g.forEach(j=>{if(j.includes("number")){const E=b[j].charAt(0)==="0",k=b[j].replace(pn,"");C[j]=E?k:parseInt(k,10)}else C[j]=b[j]}),C},m=o.useCallback(b=>p(b,["v2_business_legal_name","v2_federal_employer_identification_number","v2_business_type","v2_business_phone_number","v2_dba_or_trade_name"]),[]),h=o.useCallback(([b,g])=>
1{if(b?.error)return A.error(b?.error[0],$);if(!Na[g]){g===We.rejected&&window.scrollTo(0,0);return}if(g===We.final_rejected){_({onClickContinue:()=>{H(b.current_required_step)}});return}H(b.current_required_step)},[_]),x=o.useCallback((b,{setSubmitting:g})=>{let C=Promise.resolve({payload:{status:a}});(l||c)&&(C=u()),C.then(j=>{const E=Promise.resolve(j?.payload?.status||We.expired),k=ce("/payroll/linear_flow/save_answers",{step:r,answers:m(b)});return Promise.all([k,E])}).then(h).catch(j=>{j.response.json().then(E=>{if(E){if(E[0]?.answers_validation_errors)return A.error(be(E[0].answers_validation_errors),$);if(E[0]?.check_error){const k=Pe(E[0].check_error);return A.error(k,$)}if(E[0]?.error)return A.error(E[0].error);A.error(d("errors.generic"))}})}).finally(()=>{g(!1)})},[m,a,h,c,l,r,u]),f=o.useMemo(()=>{const b=["v2_business_legal_name","v2_federal_employer_identification_number","v2_business_type","v2_business_phone_number","v2_dba_or_trade_name"],g=b.reduce((C,j)=>(C[j]="",C),{});return b.forEach(C=>{const j=C==="v2_dba_or_trade_name"?t:"",E=n.questions.find(k=>k.slug===C)?.value||"";g[C]=E||j}),g},[t,n.questions]),y=o.useCallback(()=>{s({sidePanelType:ns.REQUIRED_FORMATTING_PANEL})},[s]),w=o.useCallback(()=>{s({sidePanelType:ns.DBA_PANEL})},[s]);return{handleClickNext:x,initialValues:f,onClickRequiredFormattingLink:y,onClickDbaLink:w}},Pa=({step:r,stepData:s,openSidePanel:n,currentCompany:t,isFeinVerificationNull:a,verifyFein:l,showPayrollSelfSetupFeinRejectedModal:c,feinVerificationStatus:u,isFeinVerificationWaiting:_})=>{const{handleClickNext:p,initialValues:m,onClickRequiredFormattingLink:h,onClickDbaLink:x}=Ta({step:r,openSidePanel:n,stepData:s,companyName:t.get("name"),feinVerificationStatus:u,isFeinVerificationWaiting:_,isFeinVerificationNull:a,verifyFein:l,showPayrollSelfSetupFeinRejectedModal:c});return e.jsx(Ne,{validateOnMount:!0,enableReinitialize:!0,onSubmit:p,initialValues:m,validationSchema:ma,children:f=>e.jsxs(e.Fragment,{children:[e.jsx(La,{step:r,steps:s.required_steps.slice(1),previousStep:s.previous_step,onClickRequiredFormattingLink:h,onClickDbaLink:x,...f}),e.jsx(je,{})]})})},Ia=ls(r=>({isFeinVerificationNull:xn(r),feinVerificationStatus:yn(r),isFeinVerificationWaiting:bn(r)}),{verifyFein:Qr,showPayrollSelfSetupFeinRejectedModal:Kr})(Pa),Oa=(r,s)=>{const n={};return s.forEach(t=>{n[t]=r[t]}),n},Ma=({step:r})=>{const s=o.useCallback(a=>Oa(a,["v2_company_industry","v2_household_employees","v2_paid_employees_outside_united_states","v2_restricted_industry"]),[]),n=o.useCallback((a,{setSubmitting:l})=>{const c=s(a);ce("/payroll/linear_flow/save_answers",{step:r,answers:c}).then(u=>{H(u.current_required_step)}).catch(u=>{u.response.json().then(_=>{if(_){if(_[0]?.answers_validation_errors)return A.error(be(_[0].answers_validation_errors),$);A.error(d("errors.generic")),B(R.YOUR_COMPANY_2,F.ERROR_MESSAGE_SHOWN)}})}).finally(()=>{l(!1)})},[s,r]);return{initialValues:o.useMemo(()=>["v2_company_industry","v2_household_employees","v2_paid_employees_outside_united_states","v2_restricted_industry"].reduce((c,u)=>(c[u]="",c),{}),[]),handleClickNext:n}},Fa=({step:r,steps:s,values:n,isValid:t,mobileView:a,previousStep:l,isSubmitting:c,setFieldValue:u,currentCompany:_})=>{const p=o.useCallback(({value:f})=>{u("v2_household_employees",f)},[u]),m=o.useCallback(({value:f})=>{u("v2_paid_employees_outside_united_states",f)},[u]),h=o.useCallback(({value:f})=>{u("v2_restricted_industry",f)},[u]),x=o.useMemo(()=>Object.values(d("payroll.self_serve.v2.linear_flow.steps.your_company_2.restricted_industry.blocked_industries")).map(f=>({primary:f})),[]);return e.jsxs(me,{children:[e.jsxs(i,{mt:24,mb:110,children:[e.jsx(qe,{title:"payroll.self_serve.v2.linear_flow.steps.your_company_2.title",subtitle:"payroll.self_serve.v2.linear_flow.steps.your_company_2.subtitle",subtitleProps:{companyName:_.get("name")},currentMilestone:"your_company"}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:24,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{color:"mono900",variant:"heading3",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_2.company_industry.title",{props:{companyName:_.get("name")}})}),e.jsx(v,{color:"mono700",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_2.company_industry.desc")})]}),e.jsx(i,{mv:8,gap:8,row:!0,wrap:!0,children:e.jsx(Re,{name:"v2_company_industry",uxElement:"title",options:Object.entries(d("payroll.self_serve.v2.linear_flow.steps.your_company_2.company_industry.options")).map(([f,y])=>({label:y,value:f})),fullWidth:!0,hasAsterisk:!0})})]}
1),n.v2_company_industry&&n.v2_company_industry!==""&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",p:20,mb:24,children:[e.jsx(i,{column:!0,gap:8,mb:16,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_2.household_employees.title")})}),e.jsx(i,{column:!0,children:e.jsx(i,{maxw:340,row:!a,gap:14,children:e.jsx(i,{mv:8,gap:8,row:!0,wrap:!0,children:["true","false"].map(f=>e.jsx(pe,{value:f,uxElement:"household_employees",size:"medium",onClick:p,selected:n.v2_household_employees===f,children:d(`payroll.self_serve.v2.linear_flow.steps.your_company_2.household_employees.options.${f}`)},`option-${f}`))})})})]}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",p:20,mb:24,children:[e.jsx(i,{column:!0,gap:8,mb:16,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_2.paid_employees_outside_united_states.title")})}),e.jsx(i,{column:!0,children:e.jsx(i,{maxw:340,row:!a,gap:14,children:e.jsx(i,{mv:8,gap:8,row:!0,wrap:!0,children:["true","false"].map(f=>e.jsx(pe,{value:f,uxElement:"paid_employees_outside_united_states",size:"medium",onClick:m,selected:n.v2_paid_employees_outside_united_states===f,children:d(`payroll.self_serve.v2.linear_flow.steps.your_company_2.paid_employees_outside_united_states.options.${f}`)},`option-${f}`))})})})]}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",p:20,mb:24,children:[e.jsx(i,{column:!0,gap:8,mb:16,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_2.restricted_industry.title")})}),e.jsx(i,{column:!0,children:e.jsx(i,{row:!a,gap:8,children:e.jsxs(i,{mv:8,gap:12,column:!0,wrap:!0,children:[e.jsx(Qs,{data:x,variant:"bullet"}),e.jsx(i,{row:!0,gap:8,children:["true","false"].map(f=>e.jsx(pe,{value:f,uxElement:"restricted_industry",size:"medium",onClick:h,selected:n.v2_restricted_industry===f,children:d(`payroll.self_serve.v2.linear_flow.steps.your_company_2.restricted_industry.options.${f}`)},`option-${f}`))})]})})})]})]})]}),e.jsx(Ve,{isLoading:c,isDisabled:!t,step:r,showBackButton:!0,previousStep:l,steps:s})]})},Ra=({step:r,stepData:s,mobileView:n,currentCompany:t})=>{const{handleClickNext:a,initialValues:l}=Ma({step:r});return e.jsx(Ne,{validateOnMount:!0,enableReinitialize:!0,onSubmit:a,initialValues:l,validationSchema:ha,children:c=>e.jsxs(e.Fragment,{children:[e.jsx(Fa,{step:r,mobileView:n,currentCompany:t,previousStep:s.previous_step,steps:s.required_steps.slice(1),...c}),e.jsx(je,{})]})})},$a=({values:r,children:s,onGeoSelected:n,hasCompanyErrors:t,handleInputChange:a,hasValidCheckAddress:l,payrollStateAbbrOptions:c})=>e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,mb:24,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsxs(i,{row:!0,gap:6,vcenter:!0,children:[e.jsx(rs,{iconName:"Location",size:"small"}),e.jsx(v,{color:"mono900",variant:"heading3",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_company_address.title")})]}),t&&e.jsx(i,{mb:24,children:e.jsx(hs,{variant:"error",children:d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.error_alert")})})]}),e.jsxs(i,{mt:8,row:!0,wrap:!0,children:[e.jsxs(i,{row:!0,gap:8,children:[e.jsx(Js,{...er(),disabled:l,googlePlaceAutocompleteType:"address",hasAsterisk:!0,width:"379px",label:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_company_address.line1.title"),name:"line1",onChange:a,onGeoSelected:n,placeholder:d("payroll.self_serve.linear_flow.steps.company_addresses.placeholders.line1"),usOnly:!0,value:r.line1}),e.jsx(_e,{width:"379px",disabled:l,name:"line2",label:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_company_address.line2.title")})]}),e.jsxs(i,{row:!0,gap:8,children:[e.jsx(_e,{width:"250px",disabled:l,name:"city",hasAsterisk:!0,label:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_company_address.city.title")}),e.jsx(Xs,{width:"250px",disabled:l,hasAsterisk:!0,label:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_company_address.state.title"),name:"state",options:c.toJS()}),e.jsx(sr,{width:"250px",disabled:l,hasAsterisk:!0,label:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_company_address.postal_code.title"),name:"postal_code",placeholder:d("payroll.self_serve.linear_flow.steps.company_addresses.placeholders.zip")})]}),s]})]}),{cx:Va}=T("SameCompanyAddressCheckbox"),qa=({values:r,setFieldValue:s,currentLocationId:n})=>{const t=o.useCallback(a=>{const{checked:l}=a.target;l?(s(`line1_location_${n}`,r.line1),s(`line2_location_${n}`,r.line2),s(`city_location_${n}`,r.city),s(`state_location_${n}`,r.state),s(`postal_code_location_${n}`,r.postal_code)):(s(`line1_location_${n}`,""),s(`line2_location_${n}`,""),s(`city_location_${n}`,""),s(`state_location_${n}`,""),s(`postal_code_location_${n}`,"")),s("same_address_checkbox",l)},[n,s,r.city,r.line1,r.line2,r.postal_code,r.state]);return e.jsx(i,{pt:8,className:Va(),maxw:580,children:e.jsx(i,{column:!0,children:e.jsx(i,{column:!0,children:e.jsx(i,{children:e.jsx(Hr,{label:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.checkbox"),name:"same_address_checkbox",onChange:t})})})})})},Ba=({values:r,mobile:s,errors:n,stepData:t,setFieldValue:a,currentCompanyLocations:l,payrollStateAbbrOptions:c})=>{const u=o.useCallback(f=>d(`payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_company_address.${f}.title`),[]),_=o.useMemo(()=>!!n?.hasCheckWorkplaceErrors&&Object.keys(n).some(f=>f.includes("location")),[n]),p=o.useCallback((f,y)=>{y.city&&a(`city_location_${f}`,y.city),y.state&&a(`state_location_${f}`,y.state),y.zip&&a(`postal_code_location_${f}`,y.zip),y.name&&a(`line1_location_${f}`,y.name)},[a]),m=o.useCallback(f=>y=>p(f,y),[p]),h=o.useCallback(f=>{const y=t.company_addresses?.workplaces?.find(w=>w.location_id===f);return!!(y&&y.check_workplace)},[t]),x=o.useCallback(f=>{const y=l.find(C=>C.get("id")===f),w=h(f),b=e.jsxs(i,{row:!0,vcenter:!0,"data-testid":`form-header-location-${f}`,children:[w&&e.jsx(i,{mr:18,children:e.jsx(rs,{iconName:"Complete",color:"success300"})}),e.jsx(i,{children:e.jsx(v,{variant:"heading4",children:y?.get("name")}
1)})]}),g=e.jsxs(e.Fragment,{children:[e.jsxs(i,{row:!0,gap:8,children:[e.jsx(i,{mb:12,w:"100%",children:e.jsx(Js,{...er(),usOnly:!0,hasAsterisk:!0,label:u("line1"),googlePlaceAutocompleteType:"address",name:`line1_location_${f}`,onGeoSelected:m(f),disabled:w||r.same_address_checkbox,value:r[`line1_location_${f}`]})}),e.jsx(i,{w:"100%",children:e.jsx(_e,{label:u("line2"),id:`line2_location_${f}`,name:`line2_location_${f}`,disabled:w||r.same_address_checkbox})})]}),e.jsxs(i,{row:!s,column:s,mb:18,children:[e.jsx(i,{w:s?"100%":"50%",mr:!s&&8,children:e.jsx(_e,{hasAsterisk:!0,label:u("city"),name:`city_location_${f}`,disabled:w||r.same_address_checkbox})}),e.jsx(i,{w:s?"100%":"50%",mr:!s&&8,children:e.jsx(Xs,{hasAsterisk:!0,label:u("state"),id:`state_location_${f}`,name:`state_location_${f}`,options:c.toJS(),disabled:w||r.same_address_checkbox,value:r[`state_location_${f}`]})}),e.jsx(i,{w:s?"100%":"50%",children:e.jsx(sr,{hasAsterisk:!0,label:u("postal_code"),name:`postal_code_location_${f}`,disabled:w||r.same_address_checkbox})})]})]});return e.jsx(e.Fragment,{children:e.jsxs(i,{children:[b,g]})})},[s,r,u,h,c,l,m]);return e.jsx(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,children:e.jsx(i,{column:!0,children:e.jsxs(i,{column:!0,children:[e.jsxs(i,{row:!0,gap:6,vcenter:!0,mb:18,children:[e.jsx(rs,{iconName:"Location",size:"small"}),e.jsx(v,{color:"mono900",variant:"heading3",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_3.v2_workplace_addresses.title")})]}),_&&e.jsx(i,{mb:24,children:e.jsx(hs,{variant:"error",children:d("payroll.self_serve.linear_flow.steps.company_addresses.form_validation_errors.error_alert")})}),!K(l)&&l.map(f=>x(f.get("id")))]})})})},Ua=({step:r,steps:s,values:n,errors:t,isValid:a,stepData:l,setErrors:c,previousStep:u,isSubmitting:_,setFieldValue:p,currentLocation:m,isMultiLocation:h,setFormikErrorHandler:x,payrollStateAbbrOptions:f,currentCompanyLocations:y,companyEligibleForMultiLocationPayroll:w})=>{w||un();const b=o.useMemo(()=>!!t?.hasCheckCompanyErrors&&Object.keys(t).filter(k=>!k.includes("location")).length>0,[t]),g=o.useCallback(k=>{k.city&&p("city",k.city),k.state&&p("state",k.state),k.zip&&p("postal_code",k.zip),k.name&&p("line1",k.name)},[p]),C=o.useCallback(k=>{p(k.target.name,k.target.value)},[p]),j=o.useMemo(()=>!K(l?.company_addresses?.company?.check),[l]),E=o.useCallback(k=>{const M=l.company_addresses?.workplaces?.find(U=>U.location_id===k);return!!(M&&M.check_workplace)},[l]);return o.useEffect(()=>{x(c)},[c,x]),e.jsxs(me,{children:[e.jsxs(i,{mt:24,mb:110,children:[e.jsx(qe,{title:"payroll.self_serve.v2.linear_flow.steps.your_company_3.title",subtitle:"payroll.self_serve.v2.linear_flow.steps.your_company_3.subtitle",currentMilestone:"your_company"}),e.jsx($a,{values:n,onGeoSelected:g,hasCompanyErrors:b,handleInputChange:C,hasValidCheckAddress:j,payrollStateAbbrOptions:f,children:e.jsx(i,{children:!h&&!E(m.get("id"))&&e.jsx(qa,{values:n,setFieldValue:p,currentLocationId:m.get("id")})})}),e.jsx(Ba,{mobile:!1,values:n,errors:t,stepData:l,setFieldValue:p,currentCompanyLocations:y,payrollStateAbbrOptions:f})]}),e.jsx(Ve,{step:r,steps:s,isDisabled:!a,showBackButton:!0,isLoading:_,previousStep:u})]})},Wa=ls(r=>({isMultiLocation:Yr(r),currentLocation:Gs(r),currentCompanyLocations:Ye(r),payrollStateAbbrOptions:Gr(r),companyEligibleForMultiLocationPayroll:$e(r)}),{})(Ua),es={"Incorrect postal code":"postal_code","Invalid postal code":"postal_code","Incorrect state":"state","Incorrect city":"city","Foreign address":"city","Unknown street":"line1","Multiple matches returned":"line1","The premise (house or building) number for the address is not valid":"line1","Invalid premise number":"line1","Invalid address: <unknown>":"line1","":"line1"},Vr=r=>Object.keys(es).find(s=>r.includes(s)),Da=r=>{let s;return typeof r=="string"?(s=Vr(r),K(s)||!s?null:{[es[s]]:s,hasCheckCompanyErrors:"true"}):{...Object.keys(r).reduce((t,a)=>{if(!s)return t;const l=es[s];return K(a)?{...t,[l]:r[a]}:(s=Vr([r[a]]),s&&K(l)&&K(es[s])?t:{...t,[`${l||s&&es[s]}_location_${a}`]:s})},{}),hasCheckWorkplaceErrors:"true"}},za=({step:r,stepData:s,setErrors:n,currentCompanyLocations:t})=>{const a=o.useCallback(u=>({v2_company_address:{address:{line1:u.line1,line2:u.line2,city:u.city,state:u.state,postal_code:u.postal_code}},v2_workplace_addresses:t.toJS().map(_=>({location_id:_.id,address:{line1:u[`line1_location_${_.id}`],line2:u[`line2_location_${_.id}`],city:u[`city_location_${_.id}`],state:u[`state_location_${_.id}`],postal_code:u[`postal_code_location_${_.id}`]}}
1)),same_address_checkbox:u.same_address_checkbox}),[t]),l=o.useCallback((u,{setSubmitting:_})=>{const p=a(u);ce("/payroll/linear_flow/save_answers",{step:r,answers:p}).then(m=>{H(m.current_required_step)}).catch(m=>{m.response.json().then(h=>{_(!1);const x=Da(h.error);x&&typeof x=="object"?n?.(x):A.error(d("fe_design_base.errors.general")),window.scrollTo(0,0)})}).finally(()=>{_(!1)})},[a,n,r]),c=o.useMemo(()=>{const u={same_address_checkbox:!1},_=s.company_addresses.company?.check,p=s.company_addresses.company?.homebase,m=K(_)?p:_;return u.line1=m?.line1||"",u.line2=m?.line2||"",u.city=m?.city||"",u.state=m?.state||"",u.postal_code=m?.postal_code||"",t.forEach(h=>{const x=h.get("id"),f=s.company_addresses.workplaces?.find(y=>y.location_id===x);if(f){const y=f.addresses.check,w=f.addresses.homebase,b=K(y)?w:y;u[`line1_location_${x}`]=b.line1,u[`line2_location_${x}`]=b.line2,u[`city_location_${x}`]=b.city,u[`state_location_${x}`]=b.state,u[`postal_code_location_${x}`]=b.postal_code}}),u},[t,s]);return{handleClickNext:l,initialValues:c}},Ha=({step:r,stepData:s,mobileView:n,currentCompany:t,currentCompanyLocations:a})=>{const[l,c]=o.useState(),{handleClickNext:u,initialValues:_}=za({step:r,stepData:s,currentCompanyLocations:a,setErrors:l});return e.jsx(Ne,{validateOnMount:!0,enableReinitialize:!0,onSubmit:u,initialValues:_,validationSchema:ga,children:p=>e.jsxs(e.Fragment,{children:[e.jsx(Wa,{step:r,stepData:s,mobileView:n,currentCompany:t,previousStep:s.previous_step,steps:s.required_steps.slice(1),setFormikErrorHandler:c,...p}),e.jsx(je,{})]})})},Ya=ls(r=>({currentCompanyLocations:Ye(r)}),{})(Ha),Ga=({step:r,steps:s,isValid:n,isSubmitting:t,previousStep:a,onClickDifferenceLink:l,values:c})=>{const u=o.useMemo(()=>Object.entries(d("payroll.self_serve.v2.linear_flow.steps.your_company_4.team_members.options")).map(([_,p])=>({label:p,value:_})),[]);return e.jsxs(me,{children:[e.jsxs(i,{mt:24,mb:110,children:[e.jsx(qe,{title:"payroll.self_serve.v2.linear_flow.steps.your_company_4.title",subtitle:"payroll.self_serve.v2.linear_flow.steps.your_company_4.subtitle",currentMilestone:"your_company"}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:24,children:[e.jsx(i,{mb:24,children:e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_4.team_members.title")})}),c.v2_number_of_team_member_w2==="none"&&c.v2_number_of_team_member_1099==="none"&&e.jsx(i,{mb:4,children:e.jsx(Gt,{variant:"error",message:d("payroll.self_serve.linear_flow.errors.validations.invalid_w2_1009_count_option")})}),e.jsxs(i,{maxw:268,column:!0,children:[e.jsx(Re,{name:"v2_number_of_team_member_w2",placeholder:d("payroll.self_serve.v2.linear_flow.steps.your_company_4.team_members.placeholder"),label:d("payroll.self_serve.v2.linear_flow.steps.your_company_4.team_members.w2_label"),uxElement:"v2_number_of_team_member_w2",options:u,fullWidth:!0}),e.jsx(Re,{name:"v2_number_of_team_member_1099",placeholder:d("payroll.self_serve.v2.linear_flow.steps.your_company_4.team_members.placeholder"),label:d("payroll.self_serve.v2.linear_flow.steps.your_company_4.team_members.1099_label"),uxElement:"v2_number_of_team_member_1099",options:u,fullWidth:!0})]}),e.jsx(xe,{uxElement:"difference",onClick:l,children:d("payroll.self_serve.v2.linear_flow.steps.your_company_4.team_members.link")})]})]}),e.jsx(Ve,{showBackButton:!0,isLoading:t,isDisabled:!n,step:r,steps:s,previousStep:a})]})},Ka=({step:r,stepData:s,openSidePanel:n})=>{const t=o.useCallback(()=>{n({sidePanelType:ns.CONTRACTOR_W2_DIFFERENCE_PANEL})},[n]),a=o.useMemo(()=>({v2_number_of_team_member_w2:s.questions.find(u=>u.slug==="v2_number_of_team_member_w2")?.value||"",v2_number_of_team_member_1099:s.questions.find(u=>u.slug==="v2_number_of_team_member_1099")?.value||""}),[s.questions]),l=o.useCallback(u=>({v2_number_of_team_member_w2:u.v2_number_of_team_member_w2,v2_number_of_team_member_1099:u.v2_number_of_team_member_1099}),[]),c=o.useCallback((u,{setSubmitting:_})=>{const p=l(u);ce("/payroll/linear_flow/save_answers",{step:r,answers:p}).then(m=>{H(m.current_required_step)}).catch(m=>{m.response.json().then(h=>{if(h&&h[0]?.answers_validation_errors)return A.error(be(h[0].answers_validation_errors),$);if(h[0]?.check_error){const x=Pe(h[0].check_error);return A.error(x,$)}if(h[0]?.error)return A.error(h[0].error);A.error(d("errors.generic"))})}).finally(()=>{_(!1)})},[l,r]);return e.jsx(Ne,{validateOnMount:!0,enableReinitialize:!0,onSubmit:c,initialValues:a,validationSchema:fa,children:u=>e.jsxs(e.Fragment,{children:[e.jsx(Ga,{step:r,previousStep:s.previous_step,steps:s.required_steps.slice(1),onClickDifferenceLink:t,...u}),e.jsx(je,{})]})})},Qa=({step:r,steps:s,isValid:n,isSubmitting:t,previousStep:a,values:l,setFieldValue:c})=>{const u=o.useCallback(({value:m})=>{c("v2_has_comp_policy",m)},[c]),_=o.useCallback(({value:m})=>{c("v2_interested_in_hb_comp_policy",m)},[c]),p=o.useCallback(({value:m})=>{c("v2_has_pto_policies",m)},[c]);return e.jsxs(me,{children:[e.jsxs(i,{mt:24,mb:110,children:[e.jsx(qe,{title:"payroll.self_serve.v2.linear_flow.steps.your_company_5.title",subt
1itle:"payroll.self_serve.v2.linear_flow.steps.your_company_5.subtitle",currentMilestone:"your_company"}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",ph:20,pt:20,pb:20,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.has_comp_policy.title")}),e.jsx(v,{color:"mono700",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.has_comp_policy.subtitle")})]}),e.jsx(i,{pt:16,gap:8,row:!0,wrap:!0,children:["true","false"].map(m=>e.jsx(pe,{value:m,uxElement:"has_comp_policy",onClick:u,size:"medium",selected:l.v2_has_comp_policy===m,children:d(`payroll.self_serve.v2.linear_flow.steps.your_company_5.has_comp_policy.options.${m}`)},`option-${m}`))})]}),l.v2_has_comp_policy==="false"&&e.jsx(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,pt:20,pb:20,children:e.jsxs(i,{vcenter:!0,row:!0,children:[e.jsx(i,{pr:16,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",children:[e.jsx("path",{d:"M4.14 5.80389C3.5475 5.50389 2.8275 5.75139 2.5275 6.34389C2.2275 6.93639 2.475 7.65639 3.0675 7.95639L7.8675 10.3564C8.46 10.6564 9.18 10.4089 9.48 9.81639C9.78 9.22389 9.5325 8.50389 8.94 8.20389L4.14 5.80389ZM44.94 7.94889C45.5325 7.64889 45.7725 6.92889 45.48 6.33639C45.1875 5.74389 44.46 5.50389 43.8675 5.79639L39.0675 8.19639C38.475 8.49639 38.235 9.21639 38.5275 9.80889C38.82 10.4014 39.5475 10.6414 40.14 10.3489L44.94 7.94889ZM1.2 17.6764C0.54 17.6764 0 18.2164 0 18.8764C0 19.5364 0.54 20.0764 1.2 20.0764H6C6.66 20.0764 7.2 19.5364 7.2 18.8764C7.2 18.2164 6.66 17.6764 6 17.6764H1.2ZM42 17.6764C41.34 17.6764 40.8 18.2164 40.8 18.8764C40.8 19.5364 41.34 20.0764 42 20.0764H46.8C47.46 20.0764 48 19.5364 48 18.8764C48 18.2164 47.46 17.6764 46.8 17.6764H42ZM8.94 29.5489C9.5325 29.2489 9.7725 28.5289 9.48 27.9364C9.1875 27.3439 8.46 27.1039 7.8675 27.3964L3.0675 29.7964C2.475 30.0964 2.235 30.8164 2.5275 31.4089C2.82 32.0014 3.5475 32.2414 4.14 31.9489L8.94 29.5489ZM40.14 27.4039C39.5475 27.1039 38.8275 27.3514 38.5275 27.9439C38.2275 28.5364 38.475 29.2564 39.0675 29.5564L43.8675 31.9564C44.46 32.2564 45.18 32.0089 45.48 31.4164C45.78 30.8239 45.5325 30.1039 44.94 29.8039L40.14 27.4039ZM34.8 18.8764C34.8 21.1714 34.0875 23.2864 32.8725 25.0339C32.565 25.4764 32.22 25.9564 31.8525 26.4589C30.9 27.7714 29.82 29.2489 29.0025 30.7414C28.335 31.9564 27.975 33.2389 27.7875 34.4839H30.225C30.39 33.5839 30.6675 32.7064 31.11 31.8964C31.8525 30.5464 32.775 29.2789 33.6975 28.0114C34.0875 27.4789 34.4775 26.9464 34.8525 26.4064C36.3375 24.2689 37.2075 21.6814 37.2075 18.8839C37.2 11.5864 31.29 5.67639 24 5.67639C16.71 5.67639 10.8 11.5864 10.8 18.8764C10.8 21.6739 11.67 24.2689 13.155 26.3989C13.53 26.9389 13.92 27.4714 14.31 28.0039C15.2325 29.2639 16.155 30.5314 16.8975 31.8889C17.34 32.6989 17.6175 33.5764 17.7825 34.4764H20.2125C20.025 33.2314 19.665 31.9489 18.9975 30.7339C18.18 29.2339 17.1 27.7564 16.1475 26.4514C15.78 25.9489 15.435 25.4764 15.1275 25.0264C13.9125 23.2864 13.2 21.1714 13.2 18.8764C13.2 12.9139 18.0375 8.07639 24 8.07639C29.9625 8.07639 34.8 12.9139 34.8 18.8764ZM18 18.8764C18 15.5614 20.685 12.8764 24 12.8764C24.66 12.8764 25.2 12.3364 25.2 11.6764C25.2 11.0164 24.66 10.4764 24 10.4764C19.3575 10.4764 15.6 14.2339 15.6 18.8764C15.6 19.5364 16.14 20.0764 16.8 20.0764C17.46 20.0764 18 19.5364 18 18.8764ZM24 41.6764C22.4325 41.6764 21.0975 40.6714 20.6025 39.2764H27.39C26.895 40.6714 25.56 41.6764 23.9925 41.6764H24ZM18 37.6789V38.0764C18 41.3914 20.685 44.0764 24 44.0764C27.315 44.0764 30 41.3914 30 38.0764V37.6789C30 37.2364 29.64 36.8764 29.1975 36.8764H18.8025C18.36 36.8764 18 37.2364 18 37.6789Z",fill:"#1E0B3A"}),e.jsx("path",{d:"M4.14 5.50409C3.5475 5.20409 2.8275 5.45159 2.5275 6.04409C2.2275 6.63659 2.475 7.35659 3.0675 7.65659L7.8675 10.0566C8.46 10.3566 9.18 10.1091 9.48 9.51659C9.78 8.92409 9.5325 8.20409 8.94 7.90409L4.14 5.50409ZM44.94 7.64909C45.5325 7.34909 45.7725 6.62909 45.48 6.03659C45.1875 5.44409 44.46 5.20409 43.8675 5.49659L39.0675 7.89659C38.475 8.19659 38.235 8.91659 38.5275 9.50909C38.82 10.1016 39.5475 10.3416 40.14 10.0491L44.94 7.64909ZM1.2 17.3766C0.54 17.3766 0 17.9166 0 18.5766C0 19.2366 0.54 19.7766 1.2 19.7766H6C6.66 19.7766 7.2 19.2366 7.2 18.5766C7.2
117.9166 6.66 17.3766 6 17.3766H1.2ZM42 17.3766C41.34 17.3766 40.8 17.9166 40.8 18.5766C40.8 19.2366 41.34 19.7766 42 19.7766H46.8C47.46 19.7766 48 19.2366 48 18.5766C48 17.9166 47.46 17.3766 46.8 17.3766H42ZM8.94 29.2491C9.5325 28.9491 9.7725 28.2291 9.48 27.6366C9.1875 27.0441 8.46 26.8041 7.8675 27.0966L3.0675 29.4966C2.475 29.7966 2.235 30.5166 2.5275 31.1091C2.82 31.7016 3.5475 31.9416 4.14 31.6491L8.94 29.2491ZM40.14 27.1041C39.5475 26.8041 38.8275 27.0516 38.5275 27.6441C38.2275 28.2366 38.475 28.9566 39.0675 29.2566L43.8675 31.6566C44.46 31.9566 45.18 31.7091 45.48 31.1166C45.78 30.5241 45.5325 29.8041 44.94 29.5041L40.14 27.1041ZM18 18.5766C18 15.2616 20.685 12.5766 24 12.5766C24.66 12.5766 25.2 12.0366 25.2 11.3766C25.2 10.7166 24.66 10.1766 24 10.1766C19.3575 10.1766 15.6 13.9341 15.6 18.5766C15.6 19.2366 16.14 19.7766 16.8 19.7766C17.46 19.7766 18 19.2366 18 18.5766Z",fill:"#7E3DD4"})]})}),e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.insurance_policy_warning.title")}),e.jsx(v,{color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.insurance_policy_warning.subtitle")})]})]})}),l.v2_has_comp_policy==="true"&&e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,pt:20,pb:20,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.interested_in_hb_comp_policy.title")}),e.jsx(v,{color:"mono700",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.interested_in_hb_comp_policy.subtitle")})]}),e.jsx(i,{pt:16,gap:8,row:!0,wrap:!0,children:["true","false"].map(m=>e.jsx(pe,{value:m,uxElement:"interested_in_hb_comp_policy",onClick:_,size:"medium",selected:l.v2_interested_in_hb_comp_policy===m,children:d(`payroll.self_serve.v2.linear_flow.steps.your_company_5.interested_in_hb_comp_policy.options.${m}`)},`option-${m}`))})]}),e.jsxs(i,{bradiusm:!0,borderbox:!0,bgcolor:"mono0",mt:16,ph:20,pt:20,pb:20,children:[e.jsxs(i,{column:!0,gap:8,children:[e.jsx(v,{variant:"heading3",color:"mono900",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.has_pto_policies.title")}),e.jsx(v,{color:"mono700",children:d("payroll.self_serve.v2.linear_flow.steps.your_company_5.has_pto_policies.subtitle")})]}),e.jsx(i,{pt:16,gap:8,row:!0,wrap:!0,children:["true","false"].map(m=>e.jsx(pe,{value:m,uxElement:"has_pto_policies",onClick:p,size:"medium",selected:l.v2_has_pto_policies===m,children:d(`payroll.self_serve.v2.linear_flow.steps.your_company_5.has_pto_policies.options.${m}`)},`option-${m}`))})]})]}),e.jsx(Ve,{showBackButton:!0,isLoading:t,isDisabled:!n,step:r,steps:s,previousStep:a})]})},Za=({step:r,stepData:s})=>{const n=o.useMemo(()=>({v2_has_comp_policy:s.questions.find(l=>l.slug==="v2_has_comp_policy")?.value||"",v2_interested_in_hb_comp_policy:s.questions.find(l=>l.slug==="v2_interested_in_hb_comp_policy")?.value||"",v2_has_pto_policies:s.questions.find(l=>l.slug==="v2_has_pto_policies")?.value||""}),[s.questions]),t=o.useCallback(l=>({v2_has_comp_policy:l.v2_has_comp_policy,v2_interested_in_hb_comp_policy:l.v2_interested_in_hb_comp_policy,v2_has_pto_policies:l.v2_has_pto_policies}),[]),a=o.useCallback((l,{setSubmitting:c})=>{const u=t(l);ce("/payroll/linear_flow/save_answers",{step:r,answers:u}).then(_=>{H(_.current_required_step)}).catch(_=>{_.response.json().then(p=>{if(p&&p[0]?.answers_validation_errors)return A.error(be(p[0].answers_validation_errors),$);if(p[0]?.check_error){const m=Pe(p[0].check_error);return A.error(m,$)}if(p[0]?.error)return A.error(p[0].error);A.error(d("errors.generic"))})}).finally(()=>{c(!1)})},[t,r]);return e.jsx(Ne,{validateOnMount:!0,enableReinitialize:!0,onSubmit:a,initialValues:n,validationSchema:ya,children:l=>e.jsxs(e.Fragment,{children:[e.jsx(Qa,{step:r,previousStep:s.previous_step,steps:s.required_steps.slice(1),...l}),e.jsx(je,{})]})})},Xa={about_you:wa,your_company_1:Ia,your_company_2:Ra,your_company_3:Ya,your_company_4:Ka,your_company_5:Za,team_and_pay_1:Sa,team_and_pay_2:ka},Ja={about_you:"About you",your_company:"Your company",team_and_pay:"Team & pay",documents:"Documents",run_payroll:"Run payroll"},qr={about_you:["about_you"],your_company:["your_company_1","your_company_2","your_company_3","your_company_4","your_company_5"],team_and_pay:["team_and_pay_1","team_and_pay_2"],documents:["documents"],run_payroll:[]},ec=({step:r})=>{const s=Object.keys(qr).findIndex(a=>qr[a].includes(r)),[n,t]=o.useState(s);return{activeIndex:n,setActiveIndex:t}},{cx:sc,cxEl:rc}=T("LinearFlowView"),nc=({step:r,isLeftNavCollapsed:s,currentCompany:n,stepData:t,isLoading:a,openSidePanel:l})=>{const c=Ke(),u=rn(),{activeIndex:_,setActiveIndex:p}=ec({step:r}),m=u,h=!c,f=!h&&!m||h,y=o.useCallback(g=>{p(g)},[p]),w=o.useCallback(()=>
1{l({sidePanelType:ns.GET_HELP_PANEL,initiatedFrom:"payroll_sss_flow"})},[l]),b=Xa[r];return a?e.jsx(i,{h:"100vh",w:"100vw",children:e.jsx(i,{hcenter:!0,vcenter:!0,h:"100%",children:e.jsx(ze,{size:"medium",variant:"dark"})})}):e.jsx(i,{className:sc(),wrap:f,bgcolor:"mono100",column:!0,children:e.jsxs(i,{pl:!s||f?24:126,pr:24,maxw:800,children:[e.jsxs(i,{row:!0,spacebetween:!0,mt:56,mb:26,children:[e.jsx(i,{pr:24,children:e.jsx(v,{variant:"heading1",children:d("payroll.self_serve.v2.linear_flow.header")})}),e.jsx(Le,{onClick:w,variant:"secondary",children:d("payroll.self_serve.v2.linear_flow.need_help")})]}),e.jsx($o,{activeIndex:_,steps:Object.values(Ja),onStepClick:y,uxElement:"v2_linear_flow"}),e.jsx(b,{className:rc(r),step:r,stepData:t,currentCompany:n,mobileView:h,openSidePanel:l})]})})},tc=ls(r=>({isLeftNavCollapsed:Vo(r),currentCompany:He(r)}),{openSidePanel:Kt.openSidePanel})(nc),oc=({step:r})=>{ms()({eventCategory:R[r.toUpperCase()]})},lc=new URL("https://cdn.joinhomebase.com/assets/logo-bundle-1GoHr-1b.svg",import.meta.url).href,ic=()=>e.jsxs(i,{pt:32,gap:16,ph:24,pv:20,mb:32,b:"1px solid",justifyContentCenter:!0,alignItemsStart:!0,row:!0,bradiusm:!0,children:[e.jsx(i,{w:"100%",maxw:24,children:e.jsx(rs,{iconName:"LightBulb",size:"large",color:"mono900"})}),e.jsxs(i,{column:!0,children:[e.jsxs(i,{inline:!0,alignItemsCenter:!0,children:[e.jsx(v,{inline:!0,variant:"bodyBold",color:"mono900",children:d("payroll.self_serve.embedded_box.header")}),e.jsx("img",{src:lc,alt:"logo",style:{marginLeft:"5px"}})]}),e.jsxs(i,{inline:!0,children:[e.jsx(v,{inline:!0,color:"mono700",variant:"bodySm",children:d("payroll.self_serve.embedded_box.copy")}),"Â ",e.jsx(xe,{size:"small",href:"/agreements/terms",target:"_blank",uxElement:"how_does_it_work",children:d("payroll.self_serve.embedded_box.link")})]})]})]}),{cx:ac,cxEl:Br}=T("ContactWidget"),cc=({name:r=null,email:s=null,title:n=null,phone:t=null,largeDesktop:a,eventCategory:l,formattedPhone:c=null})=>{const u=as({productArea:fn,eventCategory:l}),_=n||d("payroll.dashboard.implementation_get_started.implementation_specialist.contact_name",{props:{name:r}});return o.useEffect(()=>{u(F.CONTACT_US_MODULE_SHOWN,ve.VIEW)},[u]),l==="commitment"?null:e.jsx(ie,{column:!0,pa16:!0,bg:"grayLight",className:ac(),children:e.jsx(ie,{className:Br("Name"),mt12:!0,mb12:!0,"data-testid":Br("Name"),children:e.jsx(ie,{w:!a&&"100%",children:e.jsx(Uo,{title:_,name:r,phone:t,formattedPhone:c,phoneAvailability:d("payroll.dashboard.implementation_get_started.implementation_specialist.phone_availability"),email:s,emailAvailability:d("payroll.dashboard.implementation_get_started.implementation_specialist.email_availability"),trackUx:u,displayContentInline:!0,utmContent:"linear_flow",utmCampaign:"implementation"})})})})},dc=({step:r,contactDetails:s,largeDesktop:n,mobile:t})=>e.jsx(ie,{mh:!n&&"auto",pt:t?24:64,column:!0,maxw:n&&360,minw:!t&&300,pr:n&&24,grow:!0,children:e.jsx(cc,{eventCategory:r,name:s.name,email:s.email,phone:s.phone,title:s.title,largeDesktop:n})}),{cx:uc,cxEl:_c}=T("LinearFlowView"),pc=r=>r?800:"inherit",mc=()=>{const r=Qt(),s=os(),{step:n}=Dr(),t=S(He),a=S(on),l=S(zr),c=S(Zt),u=S(Xt),p=!Ke(),{isControl:m,isVariant:h,isPending:x}=Fo({enabled:p&&n===D.INCEPTION_SWITCHER}),f=S(tn),y=S(nn),w=o.useCallback(L=>s(Jt(L)),[s]),b=o.useCallback(L=>s(eo(L)),[s]),g=o.useCallback(L=>s(Xr(L)),[s]),[C,j]=o.useState({}),[E,k]=o.useState(!0),{isControl:M,isVariant:U,isPending:W}=wr(Je.PAYROLL_SS_INCEPTION_SWITCHER_DESKTOP,{enabled:!p&&n===D.INCEPTION_SWITCHER&&C.valid_step_access}),{isControl:Z,isVariant:X}=wr(Je.PAYROLL_SS_COMPANY_DETAILS,{enabled:!1}),[J,se]=o.useState(!1),Y=o.useCallback(()=>{Ys(`/payroll/linear_flow/${n}`).then(L=>{if(L){if(!L.authorized_location)return r.push("/payroll");L.linear_flow_completed&&g(["payroll_growth_task_removal_feb24_pay_12425","payroll_growth_doc_upload_email_unstructured_march24_pay_12601","payroll_growth_doc_upload_email_march24_pay_12601"]).then(()=>{H("implementation")}),w(L.experiments),se(L.eligible_for_multi_location_payroll),b(L.eligible_for_multi_location_payroll),j(L),k(!1)}})},[r,n,w,b,g]);oc({step:n}),Bs({experimentKey:Je.PAYROLL_MOBILE_UX,isControl:m,isVariant:h}),Bs({experimentKey:Je.PAYROLL_SS_INCEPTION_SWITCHER_DESKTOP,isControl:M,isVariant:U}),Bs({experimentKey:Je.PAYROLL_SS_COMPANY_DETAILS,isControl:Z,isVariant:X}),o.useEffect(()=>{window.scrollTo(0,0),Y()},[Y]),o.useEffect(()=>{s(so())},[s]);const P=o.useMemo(()=>
1{if(C.contact_details){const{name:L,email:V,phone:re,title:z,button_copy:ee}=C.contact_details;if(L&&V&&re&&z&&ee)return C.contact_details}},[C]),I=o.useMemo(()=>C?.previous_answers?.first_time_running_payroll==="never_ran_payroll",[C]),Q=vo[n],O=Cn({isInceptionCompany:I,adminAccessStepExperimentEnabled:l,companyEligibleForMultiLocationPayroll:J});if(x||W)return e.jsx(qs,{fCentered:!0,type:"bigClock"});if(h)return e.jsx(la,{step:n,stepData:C,isLoading:E});if(u)return e.jsx(tc,{step:n,stepData:C,isLoading:E});if(Q&&C.step===n){const L=O[n],V=Object.keys(O).length,re=Object.keys(O).indexOf(n)+1;return e.jsx(ro,{children:(z,ee)=>e.jsx(no,{children:q=>{const fe=!z&&!ee&&y,te=ee||z?24:64,de=!z&&!ee&&f,Ie=fe||de?16:te,Se=pc(q),ke={pl:te,pr:Ie,...c&&{p:0}};return e.jsxs(ie,{className:uc(null,"bootstrap",c&&"CloverEmbedded"),column:ee||z,pb:50,...c&&{maxw:640,m:"0 auto",pt:32},children:[e.jsxs(ie,{column:!0,maxw:Se,w:"inherit",pt:z?24:64,...ke,children:[c&&n===D.SIGNATORY_DETAILS&&e.jsx(ic,{}),e.jsx(v,{variant:"heading1",children:d("payroll.self_serve.payroll_setup")})]}),e.jsxs(ie,{column:!0,maxw:Se,w:"inherit",...ke,children:[O&&L&&e.jsx(i,{mt:16,w:"50%",mb:32,children:e.jsx(an,{steps:V,active:re})}),!(O&&L)&&e.jsx(i,{mt:16,mb:32})]}),_s[n]&&e.jsx(ie,{column:!0,maxw:Se,w:"inherit",pb:24,...ke,children:e.jsx(v,{variant:"heading2",color:_s[n].color,children:d(_s[n].i18n,{props:n===D.COMPANY_DETAILS?{companyName:t.get("name")}:{}})})}),e.jsxs(ie,{row:!0,vtop:!0,wrap:ee||z,children:[e.jsxs(ie,{column:!0,grow:!0,maxw:Se,...ke,children:[e.jsxs(i,{children:[E&&e.jsx(qs,{fCentered:!0}),!E&&e.jsx(o.Fragment,{children:e.jsx(Q,{stepData:C,currentCompany:t,currentLocation:a,className:_c(n),mobile:z})},`linear-flow-step-${n}`)]}),e.jsx(je,{})]}),fe&&e.jsx(ie,{column:!0,shrink:0,children:e.jsx(vn,{})}),de&&e.jsx(ie,{column:!0,shrink:0,children:e.jsx(dn,{step:n})})]}),!!P&&e.jsx(dc,{step:n,contactDetails:P,largeDesktop:q,mobile:z})]})}})})}return e.jsx(qs,{fCentered:!0,type:"bigClock"})},Gc=Wr({productArea:fn})(mc);export{Gc as default}; 2//# sourceMappingURL=LinearFlowView-chunk-DvLfWa-t.js.map
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.