PageSourceSearch

https://cdn.businessdraft.com/build/assets/CompanyAccountCreate-Hf209X4C.js

js businessdraft.com collected 2026-09-24 13:19:46 UTC 28,733 bytes, 2 lines download raw bytes

1import{_ as he}from"./StepContainer-C9v0YxaC.js";import{a as q}from"./StepItem-DCMByPiy.js";import{F as L}from"./FormInput-DBM7Ath9.js";import{F as re}from"./FormCheckbox-nzq2AKKj.js";import{_ as ve}from"./FormSingleOrMultiAddresses-DEBKpO-7.js";import{_ as Ce}from"./FormInputPrefix-D9hr23ui.js";import{ae as we,an as xe,ao as Se,ap as Pe,cr as Ae,b0 as Z,cs as de,av as Ve,am as fe,a as N,R as M,k as J,N as z,q as Y,o as S,e as D,w as k,d as b,u as t,L as $,J as P,c as _,K,D as G,r as Ne,S as B,g as W,au as ke,a0 as Ie,i as me,M as Ee,p as Q,l as $e,F as Le}from"./SetupSentry-DE6y2Ajh.js";import{i as I,f as De,d as ue,a as pe,b as _e,c as Ue,e as Te}from"./ValidationRules-BrtWcv_n.js";import{v as x,c as Fe,a as Be,s as qe}from"./CommonAccountFunctions-6jCrXEYg.js";import{g as Re,s as je}from"./Cookies-CrwVfLew.js";import{e as He,f as Me}from"./GoogleAnalytics-kF7mJAxL.js";import{B as ze}from"./BillingPlanApi-BpQVvrPB.js";import"./_sentry-release-injection-file-DmW9TZFH.js";import{v as ce}from"./v4-Cq4pYcwM.js";import{t as ge}from"./DebounceAndThrottle-Byl0p2Gi.js";import{_ as ye}from"./FormVerificationCodeInput-TgnUy6aD.js";import{_ as Ye}from"./FormPasswordValidator-BmUM6Iu4.js";import{_ as Ge}from"./TwoFactorChallenge-VFVS8Ycw.js";import{F as be}from"./FormButton-CCi9BtWO.js";import{_ as X}from"./AnimationLoading-BzEG18Vj.js";import{_ as We}from"./BillingPlanSelector-smZ5Gv5f.js";import{_ as Ze}from"./StripePaymentInfo-B8xPT6BX.js";import{u as Qe}from"./ReferrerQueryParams-CmR1biyI.js";import{r as Je}from"./PlusCircleIcon-U5v89e8l.js";import{_ as Ke}from"./AnimationCelebrate-v3V588q-.js";import{u as Xe,a as Oe}from"./AbandonedSignUp-4eky6hV8.js";import{_ as et}from"./StepTeamMemberAddCalendar-QaZXn5Qo.js";import"./AnimatedProgressBar-D9l_-EcU.js";import"./FormLabel-DamWP-by.js";import"./InputFormatter-CdXY6dpf.js";import"./formatters-Dp2ha40b.js";import"./EyeIcon-m1RBer64.js";import"./Color-DTu3v_EO.js";import"./CheckIcon-KA8F6ckU.js";import"./HoverTooltip-D-oR1nbg.js";import"./FormAutocompleteLocation-CyVRhuss.js";import"./GoogleMapsAPI-BNDERpRG.js";import"./index-Da8NloRR.js";import"./TrashIcon-DSc4Pul5.js";import"./FormSelectDropdown-L5NOSIcs.js";import"./_commonjsHelpers-DKZAErUA.js";import"./preload-helper-nkV39p5t.js";import"./reCAPTCHA-j3a1wd68.js";import"./HandThumbUpIcon-CUgYP5sh.js";import"./BillingPlanCard-BhuBYdD3.js";import"./CheckCircleIcon-CT5wk6nX.js";import"./FormSwitch-DufCXY9r.js";import"./ArrowUpRightIcon-BtB9lakr.js";import"./NaturalLanguage-2iP3sHnn.js";import"./ReferrerApi-Cc2kORBM.js";import"./FormFullAddress-DzRoI8RW.js";import"./FormDropdownSearch-BO3sgOd_.js";import"./HoverTooltipFixed-Rx88k-Ex.js";import"./Lists-H4h7fopk.js";import"./vue3-lottie.es-79uqia0B.js";import"./AnimationConfetti-CdVhfxJ9.js";import"./CalendarIntegrationType-DaAVlhx_.js";import"./WebsitePopup-Dt0FgmkJ.js";import"./CronofyApi-Ae6ixVE4.js";import"./UseFeatureFlag-Dc2GQjI8.js";import"./Features-CneqwmYJ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},m=new a.Error().stack;m&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[m]="5ecbaf08-8951-4f57-a6c8-844d4606fa00",a._sentryDebugIdIdentifier="sentry-dbid-5ecbaf08-8951-4f57-a6c8-844d4606fa00")}catch{}})();{var R=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};R._sentryModuleMetadata=R._sentryModuleMetadata||{},R._sentryModuleMetadata[new R.Error().stack]=Object.assign({},R._sentryModuleMetadata[new R.Error().stack],{"_sentryBundlerPluginAppKey:business-draft-crm":!0})}const H=we(),T=xe("companyAccountCreate",{state:()=>({username:"",name:"",website:"",locationGroupName:"",locations:[{location:"",addressLine1:"",addressLine2:"",city:"",state:"",country:"",postalCode:"",lat:null,lng:null,nickname:""}],companyPhoneVerificationCode:"",tosChecked:!1,enableDefaultSmsNotifications:!0,firstName:"",lastName:"",email:"",phone:"",password:"",passwordConfirmation:"",smsVerificationCode:"",existingEmail:"",existingPassword:"",useExistingAccountAsAdmin:!1,billingEmail:"",billingLocation:"",billingAddressLine1:"",billingAddressLine2:"",billingCity:"",b
1illingState:"",billingCountry:"",billingPostalCode:"",promotionCodeId:null,trialDays:0,billingPlanId:null,stripePaymentId:"",cycleInterval:Se,checkoutSessionUuid:"",referralCode:"",billingPlans:[],furthestStep:"",furthestStepAt:null,totalSteps:4,completedSteps:0,activatingTrial:!1}),actions:{setFurthestStep(a,m){a<=this.completedSteps||(this.furthestStep=m,this.furthestStepAt=new Date,this.completedSteps=a)},validateStep1(){return!0},async validateStep2(a=!1){let m=x(I(this.name,!0,250),a,"Company name is required and must be less than 250 characters",l=>this.errors.name=l,()=>this.clearError("name")),e=x(De(this.website),a,"Please enter a valid company website",l=>this.errors.website=l,()=>this.clearError("website")),s=!0;this.locations.forEach((l,f)=>{const u=`Location #${f+1}`;let p=x(I(l.location,!0),a,`${u} is missing an address`,c=>this.errors.location=c,()=>this.clearError("location")),i=x(ue(l.lat,-90,90),a,`${u} has an invalid address - please select an option from the dropdown`,c=>this.errors.lat=c,()=>this.clearError("lat")),y=x(ue(l.lng,-180,180),a,`${u} has an invalid address - please select an option from the dropdown`,c=>this.errors.lng=c,()=>this.clearError("lng")),w=!0;this.locations.length>1&&(w=x(I(l.nickname,!0),a,`${u} is missing a name`,c=>this.errors.locations=c,()=>this.clearError("locations"))),(!p||!i||!y||!w)&&(s=!1)});let d=!0;return this.locations.length>1&&(d=x(I(this.locationGroupName,!0),a,"Please name the group of locations",l=>this.errors.locationGroupName=l,()=>this.clearError("locationGroupName"))),this.setFurthestStep(1,"Tell us about your company"),m&&e&&s&&d&&this.tosChecked},validateStep3(){return!0},async validateStep4(a=!1){if(this.useExistingAccountAsAdmin)return!!this.existingEmail&&!!this.existingPassword;let m=x(I(this.firstName,!0),a,"Company admin first name is required",p=>this.errors.firstName=p,()=>this.clearError("firstName")),e=x(I(this.lastName,!0),a,"Company admin last name is required",p=>this.errors.lastName=p,()=>this.clearError("lastName")),s=x(pe(this.email,!0),a,"Please enter a valid email",p=>this.errors.email=p,()=>this.clearError("email")),d=x(_e(this.phone,!0),a,"Please enter a valid phone number",p=>this.errors.phone=p,()=>this.clearError("phone")),l=x(Ue(this.password),a,"Password must be at least 8 characters and contain at least one number and one letter",p=>this.errors.password=p,()=>this.clearError("password")),f=x(this.password===this.passwordConfirmation,a,"Passwords must match",p=>this.errors.passwordConfirmation=p,()=>this.clearError("passwordConfirmation")),u=x(Te(this.username,!0),a,"Username must be between 5-30 characters and contain only letters, numbers, and periods. It must start with a letter, and have no consecutive periods.",p=>this.errors.username=p,()=>this.clearError("username"));return this.setFurthestStep(2,"Setup a company admin account"),m&&e&&s&&d&&l&&f&&u},validateStep5(){return!0},validateStep7(a=!1){let m=x(pe(this.billingEmail,!0),a,"Please enter a valid email",i=>this.errors.billingEmail=i,()=>this.clearError("billingEmail")),e=x(I(this.billingAddressLine1,!0),a,"Please check the billing address",i=>this.errors.billingAddressLine1=i,()=>this.clearError("billingAddressLine1")),s=x(I(this.billingAddressLine2,!1),a,"Please check the billing address",i=>this.errors.billingAddressLine2=i,()=>this.clearError("billingAddressLine2")),d=x(I(this.billingCity,!0),a,"Please check the billing address",i=>this.errors.billingCity=i,()=>this.clearError("billingCity")),l=x(I(this.billingState,!0),a,"Please check the billing address",i=>this.errors.billingState=i,()=>this.clearError("billingState")),f=x(I(this.billingCountry,!0),a,"Please check the billing address",i=>this.errors.billingCountry=i,()=>this.clearError("billingCountry")),u=x(I(this.billingPostalCode,!0),a,"Please check the billing address",i=>this.errors.billingPostalCode=i,()=>this.clearError("billingPostalCode")),p=x(I(this.referrerCode,!1),a,"Please enter a valid referrer code",i=>this.errors.referrerCode=i,()=>this.clearError("referrerCode"));return m&&e&&s&&d&&l&&f&&u&&p},addLocation(){this.locations.push({location:"",addressLine1:"",addressLine2:"",city:"",state:"",country:"",postalCode:"",lat:null,lng:null})},clearError(a){this.errors||(this.errors={}),a in this.errors&&(this.errors[a]="")},async getBillingPlans(){const a=new ze;try{const m=await a.index();this.billingPlans=Pe(m.data)}catch(m){H.error("Failed to load billing plans"),console.error(m)}},async createCompany(a){this.locations.length>1?await this.createMultiLocationCompany(a):await this.createSingleLocationCompany(a)},async createMultiLocationCompany(a){window.progressBar.start();const m=navigator.language||navigator.userLanguage;await new Ae().create({...Z(this.$state,["billingPlans"]),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,language:m}).then(s=>{s.data.id||H.warning("Company sign up is not enabled at this time. Please try again later."),s.data.id&&(window.progressBar.complete(),He(s.data.id),a(!0),H.success("Welcome to Business Draft, "+this.name+"!"))}).catch(s=>a(!1,s)).finally(()=>window.progressBar.complete())},async createSingleLocationCompany(a){window.progressBar.start();const m=new de,e={...Z(this.$state,["billingPlans","locations","locationGroupName"]),...Z(this.locations[0])};await m.create({...e,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,language:navigator.language||navigator.userLanguage}).then(s=>{s.data.id||H.warning("Company sign up is not enabled at this time. Please try again later."),s.data.id&&(window.progressBar.complete(),Me(s.data.id),a(!0),H.success("Welcome to Business Draft, "+this.name+"!"))}).catch(s=>a(!1,s)).finally(()=>window.progressBar.complete())},handleCheckoutUuid(){let a=Re("checkoutSessionUuid");a||(a=ce()+ce(),je("checkoutSessionUuid",a,1)),this.checkoutSessionUuid=a},async handleActivateTrial(a){if(!a)return;const m=new de;this.activatingTrial=!0;try{const e=await m.activateTrial(a);Object.assign(this.$state,Ve(e.data))}finally{this.activatingTrial=!1}}}}),tt={__name:"StepCompanyCreate2",emits:["complete"],setup(a,{emit:m}){const e=m,s=T(),d=fe(),l=N(!1),f=N(!1),u=async()=>
1{if(!f.value){f.value=!0;try{await i(!0),l.value&&e("complete",2)}finally{f.value=!1}}},p=M(()=>d.name==="activate-trial"?"Activate Your 14-Day Free Trial":"Tell us about your company"),i=async(c=!1)=>l.value=await s.validateStep2(c),y=()=>ge(()=>i(!1),100);return J(()=>s.activatingTrial,(c,r)=>{r&&!c&&i(!1)},{immediate:!0}),z(()=>i(!1)),Y(()=>i(!1)),(()=>{const r=new URLSearchParams(window.location.search).get("email");r&&(s.email=r)})(),(c,r)=>(S(),D(q,{format:"form",title:p.value,subtitle:"This page is encrypted for your security | Step 1 of 3",loading:f.value,"show-lock":"",onHandleNextStep:u,"is-ready-for-next-step":l.value},{default:k(()=>{var V,E,U,F,A,o,v,n;return[b(L,{class:"mb-2 w-full",required:"",label:"Company Name / DBA",placeholder:"e.g. Business Draft",modelValue:t(s).name,"onUpdate:modelValue":[r[0]||(r[0]=h=>t(s).name=h),y],error:(E=(V=t(s))==null?void 0:V.errors)==null?void 0:E.name},null,8,["modelValue","error"]),b(Ce,{class:"my-6 w-full",type:"text","input-mode":"url",placeholder:"example.com",format:"website",prefixes:["https://","http://"],"default-prefix":"https://",modelValue:t(s).website,"onUpdate:modelValue":[r[1]||(r[1]=h=>t(s).website=h),y],label:"Company Website","label-hint":"(Optional)",error:(F=(U=t(s))==null?void 0:U.errors)==null?void 0:F.website},null,8,["modelValue","error"]),b(ve,{groupName:t(s).locationGroupName,"onUpdate:groupName":[r[2]||(r[2]=h=>t(s).locationGroupName=h),y],locations:t(s).locations,"onUpdate:locations":[r[3]||(r[3]=h=>t(s).locations=h),y]},null,8,["groupName","locations"]),b(re,{modelValue:t(s).enableDefaultSmsNotifications,"onUpdate:modelValue":[r[4]||(r[4]=h=>t(s).enableDefaultSmsNotifications=h),r[5]||(r[5]=h=>i(!1))],class:"mt-12 mb-4",error:(o=(A=t(s))==null?void 0:A.errors)==null?void 0:o.enableDefaultSmsNotifications},{default:k(()=>r[8]||(r[8]=[$(" Send time-sensitive notifications to me via text messages (recommended) ")])),_:1},8,["modelValue","error"]),b(re,{modelValue:t(s).tosChecked,"onUpdate:modelValue":[r[6]||(r[6]=h=>t(s).tosChecked=h),r[7]||(r[7]=h=>i(!1))],error:(n=(v=t(s))==null?void 0:v.errors)==null?void 0:n.tosChecked},{default:k(()=>r[9]||(r[9]=[$(" I have read and agree to the "),P("a",{href:"/privacy-policy",tabindex:"-1",target:"_blank"},[P("u",null,"Privacy Policy")],-1),$(" and "),P("a",{href:"/terms-of-service",tabindex:"-1",target:"_blank"},[P("u",null,"Terms of Service")],-1),$(", confirm that I am at least 18 years old, and represent that I am authorized to accept these Terms on behalf of the company or organization associated with this account. ")])),_:1},8,["modelValue","error"])]}),_:1},8,["title","loading","is-ready-for-next-step"]))}},at={class:"mt-8 select-none text-center text-sm text-slate-500"},st={key:0,class:"w-92"},it={key:1},lt={__name:"StepCompanyCreate3",emits:["complete"],setup(a,{emit:m}){const e=T(),s=N(!1),d=N(0),l=m;l("complete");const f=()=>{s.value=e.validateStep3(),s.value&&l("complete")},u=()=>{d.value===0&&(d.value=59),setTimeout(()=>{d.value-=1,d.value>0&&u()},1e3)};return z(()=>u()),(p,i)=>(S(),D(q,{format:"form",title:"Verify Company Phone Number",subtitle:"Code sent!",onHandleNextStep:f,"can-go-to-prev-step":"","is-ready-for-next-step":t(e).companyPhoneVerificationCode.length===6},{default:k(()=>[b(ye,{modelValue:t(e).companyPhoneVerificationCode,"onUpdate:modelValue":i[0]||(i[0]=y=>t(e).companyPhoneVerificationCode=y)},null,8,["modelValue"]),P("p",at,[i[2]||(i[2]=$(" Didn't receive a code? ")),P("b",{onClick:i[1]||(i[1]=(...y)=>p.requestNewVerificationCode&&p.requestNewVerificationCode(...y)),class:"cursor-pointer hover:underline"},[d.value!==0?(S(),_("span",st,"Request again in "+K(d.value)+"s",1)):(S(),_("span",it,"Send new verification code"))])])]),"next-step-text":k(()=>i[3]||(i[3]=[$("Verify Account")])),_:1},8,["is-ready-for-next-step"]))}},ot={key:0},nt={class:"mb-4 flex items-center justify-between gap-4 md:gap-6"},rt={class:"mb-6 flex items-center justify-between gap-4 md:gap-6"},dt={class:"mt-7 flex items-center justify-between gap-4 md:gap-6"},mt={key:1},ut={class:"flex items-center justify-between gap-4 md:gap-6"},pt={key:0,class:"space-y-6 mb-24 mt-12"},ct={class:"mt-6 mb-96 flex items-center justify-center gap-4"},ft={__name:"StepCompanyCreate4",emits:["complete","prev-step"],setup(a,{emit:m}){const e=T(),s=G(),d=N(!1),l=N(!1),f=m,u=Ne({required:!1,loading:!1,code:"",recoveryCode:""}),p=async()=>
1{if(!(!d.value||l.value)){l.value=!0;try{if(e.useExistingAccountAsAdmin)s.isLoggedIn&&await s.logout(),await s.login(e.existingEmail,e.existingPassword,!0).then(()=>{l.value=!1,s.isLoggedIn?f("complete",2):u.required=!0});else{if(await w()||await c())return l.value=!1;f("complete",1)}}finally{l.value=!1}}},i=()=>{u.loading=!0,s.twoFactorChallenge({code:u.code,recoveryCode:u.recoveryCode}).then(()=>f("complete",2)).finally(()=>u.loading=!1)},y=()=>f("prev-step",2),w=async()=>{const A=await Fe(e.email);return A&&(e.errors.email="Email already exists",d.value=!1),A},c=async()=>{const A=await Be(e.username);return A.taken&&toast.error("That username is already taken. Please try another one."),A.taken||!A.valid||!!A.reason},r=B.debounce(()=>{const A=e.firstName.replace(/[^a-zA-Z]/g,""),o=e.lastName.replace(/[^a-zA-Z]/g,""),v=A&&o?".":"";e.username=`${A}${v}${o}`.toLowerCase(),V()}),V=async(A=!1)=>d.value=await e.validateStep4(A),E=()=>ge(()=>V(!1),300);J(()=>e.useExistingAccountAsAdmin,()=>{e.useExistingAccountAsAdmin?(e.username="",e.email=""):(e.existingEmail="",e.existingPassword="")});const U=()=>{s.isLoggedIn&&(toast.success("You are already logged in! No need to enter your account details."),e.existingEmail=s.user.email,e.useExistingAccountAsAdmin=!0,f("complete",2))},F=async()=>{await ke(),U(),await V(!1)};return Y(async()=>await F()),z(async()=>await F()),(A,o)=>(S(),D(q,{format:"form",title:"Setup a company admin account",subtitle:"This page is encrypted for your security | Step 2 of 3",loading:l.value,"show-lock":"","can-go-to-prev-step":"",onHandlePrevStep:y,on
1HandleNextStep:p,"is-ready-for-next-step":d.value},{default:k(()=>{var v,n,h,j,g,O,ee,te,ae,se,ie,le,oe,ne;return[t(e).useExistingAccountAsAdmin?(S(),_("div",mt,[P("div",ut,[b(L,{label:"Email Address",placeholder:"Email address",required:"",modelValue:t(e).existingEmail,"onUpdate:modelValue":[o[8]||(o[8]=C=>t(e).existingEmail=C),E],type:"email","input-mode":"email",class:"w-full sm:w-96"},null,8,["modelValue"]),b(L,{label:"Password",placeholder:"••••••••",required:"",modelValue:t(e).existingPassword,"onUpdate:modelValue":[o[9]||(o[9]=C=>t(e).existingPassword=C),E],type:"password",class:"w-full sm:w-96"},null,8,["modelValue"])]),u.required?(S(),_("div",pt,[b(Ge,{code:u.code,"onUpdate:code":o[10]||(o[10]=C=>u.code=C),"recovery-code":u.recoveryCode,"onUpdate:recoveryCode":o[11]||(o[11]=C=>u.recoveryCode=C)},null,8,["code","recovery-code"]),P("div",ct,[b(be,{type:"button",size:"full",color:"gradient",loading:u.loading,onClick:i},{default:k(()=>o[16]||(o[16]=[$(" Submit Code ")])),_:1},8,["loading"])])])):W("",!0),P("button",{type:"button",onClick:o[12]||(o[12]=C=>t(e).useExistingAccountAsAdmin=!t(e).useExistingAccountAsAdmin),class:"mt-4 cursor-pointer text-sm text-slate-400 underline hover:text-slate-900"}," Or Create New Account ")])):(S(),_("div",ot,[P("div",nt,[b(L,{class:"w-full",required:"",label:"First Name",autocomplete:"given-name",placeholder:"John",modelValue:t(e).firstName,"onUpdate:modelValue":[o[0]||(o[0]=C=>t(e).firstName=C),t(r)],error:(n=(v=t(e))==null?void 0:v.errors)==null?void 0:n.firstName},null,8,["modelValue","error","onUpdate:modelValue"]),b(L,{class:"w-full",required:"",label:"Last Name",autocomplete:"family-name",placeholder:"Doe",modelValue:t(e).lastName,"onUpdate:modelValue":[o[1]||(o[1]=C=>t(e).lastName=C),t(r)],error:(j=(h=t(e))==null?void 0:h.errors)==null?void 0:j.lastName},null,8,["modelValue","error","onUpdate:modelValue"])]),P("div",rt,[b(L,{class:"w-full",required:"",label:"Email Address",type:"email","input-mode":"email",placeholder:"[email protected]",modelValue:t(e).email,"onUpdate:modelValue":[o[2]||(o[2]=C=>t(e).email=C),E],error:(O=(g=t(e))==null?void 0:g.errors)==null?void 0:O.email},null,8,["modelValue","error"]),b(L,{class:"w-full",required:"",label:"Phone Number",format:"phone",type:"tel",placeholder:"(123) 555-5555",modelValue:t(e).phone,"onUpdate:modelValue":[o[3]||(o[3]=C=>t(e).phone=C),E],error:(te=(ee=t(e))==null?void 0:ee.errors)==null?void 0:te.phone,autocomplete:"tel"},null,8,["modelValue","error"])]),o[13]||(o[13]=P("hr",{class:"my-3 bg-slate-100"},null,-1)),b(L,{class:"w-full",required:"",label:"Username",format:"username",placeholder:"@username",modelValue:t(e).username,"onUpdate:modelValue":[o[4]||(o[4]=C=>t(e).username=C),E],error:(se=(ae=t(e))==null?void 0:ae.errors)==null?void 0:se.username},null,8,["modelValue","error"]),o[14]||(o[14]=P("p",{class:"mt-2 mb-6 text-xs text-slate-400"},"Usernames must be 5-30 characters, and only have only letters, numbers, or periods.",-1)),o[15]||(o[15]=P("hr",{class:"my-3 bg-slate-100"},null,-1)),P("div",dt,[b(L,{class:"w-full",required:"",label:"Company Admin Password",type:"password",autocomplete:"new-password",placeholder:"••••••••",modelValue:t(e).password,"onUpdate:modelValue":[o[5]||(o[5]=C=>t(e).password=C),E],error:(le=(ie=t(e))==null?void 0:ie.errors)==null?void 0:le.password},null,8,["modelValue","error"]),b(L,{class:"w-full",required:"",label:"Confirm Company Admin Password",type:"password",autocomplete:"new-password",placeholder:"••••••••",modelValue:t(e).passwordConfirmation,"onUpdate:modelValue":[o[6]||(o[6]=C=>t(e).passwordConfirmation=C),E],error:(ne=(oe=t(e))==null?void 0:oe.errors)==null?void 0:ne.passwordConfirmation},null,8,["modelValue","error"])]),b(Ye,{password:t(e).password,"password-confirmation":t(e).passwordConfirmation},null,8,["password","password-confirmation"]),P("button",{type:"button",onClick:o[7]||(o[7]=C=>t(e).useExistingAccountAsAdmin=!t(e).useExistingAccountAsAdmin),class:"mt-6 cursor-pointer text-sm text-slate-400 underline hover:text-slate-900"}," Or Login to Existing Account ")]))]}),_:1},8,["loading","is-ready-for-next-step"]))}},gt={class:"text-sm text-slate-500 select-none text-center mt-8"},yt={key:0,class:"w-92"},bt={key:1},ht={__name:"StepCompanyCreate5",emits:["complete","prev-step"],setup(a,{emit:m}){const e=T(),s=N(!1),d=N(0),l=m,f=()=>{s.value=e.validateStep5(),s.value&&l("complete",1)},u=()=>l("prev-step"),p=()=>
1{if(d.value!==0){toast.warning("Sending a new code in "+d.value+" seconds."),setTimeout(()=>{p()},(d.value+1)*1e3);return}qe(e.phone,w=>{w?toast.success("Verification code sent!"):u(),i()})},i=()=>{d.value===0&&(d.value=59),setTimeout(()=>{d.value-=1,d.value>0&&i()},1e3)},y=w=>{if(!w)return"";let c=w.toString();const r=c.match(/^(\d{1,3})(\d{0,3})(\d{0,4})$/);if(r)c=`${r[1]?"(":""}${r[1]}${r[2]?") ":""}${r[2]}${r[3]?"-":""}${r[3]}`;else{const V=c.slice(-10).match(/^(\d{1,3})(\d{0,3})(\d{0,4})$/);V&&(c="+"+c.slice(0,c.length-10)+` ${V[1]?"(":""}${V[1]}${V[2]?") ":""}${V[2]}${V[3]?"-":""}${V[3]}`)}return c};return Y(()=>p()),z(()=>p()),(w,c)=>(S(),D(q,{format:"form",title:"Verify Company Admin Phone Number",subtitle:"Code sent to "+y(t(e).phone),onHandlePrevStep:u,onHandleNextStep:f,"can-go-to-prev-step":"","is-ready-for-next-step":t(e).smsVerificationCode.length===6},{default:k(()=>[b(ye,{modelValue:t(e).smsVerificationCode,"onUpdate:modelValue":c[0]||(c[0]=r=>t(e).smsVerificationCode=r)},null,8,["modelValue"]),P("p",gt,[c[1]||(c[1]=$(" Didn't receive a code? ")),P("b",{onClick:p,class:"hover:underline cursor-pointer"},[d.value!==0?(S(),_("span",yt,"Request again in "+K(d.value)+"s",1)):(S(),_("span",bt,"Send new verification code"))])])]),"next-step-text":k(()=>c[2]||(c[2]=[$(" Verify Account")])),_:1},8,["subtitle","is-ready-for-next-step"]))}},vt={__name:"StepCompanyCreate6",emits:["complete","prev-step"],setup(a,{emit:m}){const e=T(),s=G(),d=m,l=N(!1),f=M(()=>s.isLoggedIn?4:1),u=()=>d("prev-step",f.value),p=async()=>{if(!e.billingPlanId)return;e.setFurthestStep(3,"Select a Plan");const i=e.billingPlans.find(w=>w.id===e.billingPlanId);(i==null?void 0:i.planType)==="free"&&e.locations.length===1?(e.billingEmail||(e.billingEmail=e.email||e.existingEmail),l.value=!0,await e.createCompany((w,c=null)=>{l.value=!1,w&&!c&&(s.fetchUserAccount(),d("complete",2))})):d("complete")};return Ie(()=>e.getBillingPlans()),(i,y)=>(S(),D(q,{format:"form",title:"Plan & Payment",subtitle:"This page is encrypted for your security | Step 3 of 3","show-lock":"","without-buttons":"","form-max-width-class":"w-screen-lg","is-ready-for-next-step":!0},{default:k(()=>[l.value?(S(),D(X,{key:0,dark:"",fullscreen:"",text:`Creating ${t(e).name||"Company"} • Do Not Close This Page`},null,8,["text"])):W("",!0),b(We,{"default-is-billing-yearly":"","billing-plans":t(e).billingPlans,billingPlanId:t(e).billingPlanId,"onUpdate:billingPlanId":[y[0]||(y[0]=w=>t(e).billingPlanId=w),p],cycleInterval:t(e).cycleInterval,"onUpdate:cycleInterval":y[1]||(y[1]=w=>t(e).cycleInterval=w),"is-enterprise":t(e).locations.length>1,"show-contact-sales":""},null,8,["billing-plans","billingPlanId","cycleInterval","is-enterprise"]),b(be,{onClick:u,color:"secondary",class:"block mx-auto mt-24"},{default:k(()=>y[2]||(y[2]=[$(" Back ")])),_:1})]),_:1}))}},Ct={__name:"StepCompanyCreate7",emits:["complete","prev-step"],setup(a,{emit:m}){const e=T(),s=G(),d=Qe(),l=m,f=N(!1),u=N(!1),p=N(!1),i=N(!1),y=N("$0"),w=N(),c=me("manuallyCancelAbandonedSignUp",()=>{}),r=me("manuallyStartAbandonedSignUp",()=>{}),V=()=>l("prev-step",1),E=async()=>{if(p.value){toast.warning("Please click the 'Apply' button to apply the promotion code.");return}if(U(),!f.value)return;u.value=!0;const v=await w.value.getCardInfo({name:e.name});if(!v){u.value=!1;return}e.stripePaymentId=v.id,e.setFurthestStep(4,"Payment Details Added"),c(),await e.createCompany((n,h=null)=>{u.value=!1,h&&r(),n&&!h&&(s.fetchUserAccount(),l("complete"))})},U=v=>f.value=e.validateStep7(v),F=()=>{e.billingEmail=B.cloneDeep(e.displayEmail),e.billingAddressLine1||(e.billingAddressLine1=B.cloneDeep(e.addressLine1),e.billingAddressLine2=B.cloneDeep(e.addressLine2),e.billingCity=B.cloneDeep(e.city),e.billingState=B.cloneDeep(e.state),e.billingPostalCode=B.cloneDeep(e.postalCode),e.billingCountry="US"),U()},A=M(()=>e.trialDays>0?`Start ${e.trialDays} Day Free Trial`:`Pay ${y.value} & Create Company`),o=M(()=>{if(!e.billingPlanId||!e.cycleInterval)return null;const v=e.billingPlans.find(h=>h.id===e.billingPlanId),n=e.billingPlans.indexOf(v);return v?{billingPlan:v,index:n}:null});return J(()=>d.referrerCode,(v,n)=>{!v.value||(v==null?void 0:v.value)===(n==null?void 0:n.value)||(e.referralCode=v.value)},{immediate:!0}),Y(()=>{F()}),(v,n)=>(S(),D(q,{format:"form",title:"Payment Details",subtitle:"This page is encrypted for your security | Step 3 of 3","show-lock":"","can-go-to-prev-step":"",onHandlePrevStep:V,onHandleNextStep:E,"is-ready-for-next-step":f.value},{"next-step-text":k(()=>[$(K(A.value),1)]),default:k(()=>{var h,j;return[u.value?(S(),D(X,{key:0,dark:"",fullscreen:"",text:`Creating ${t(e).name||"Company"} • Do Not Close This Page`},null,8,["text"])):W("",!0),b(Ze,{ref_key:"stripePaymentInfo",ref:w,billingPlan:(h=o.value)==null?void 0:h.billingPlan,billingPlanIndex:(j=o.value)==null?void 0:j.index,cycleInterval:t(e).cycleInterval,billingEmail:t(e).billingEmail,"onUpdate:billingEmail":n[0]||(n[0]=g=>t(e).billingEmail=g),billingAddressLine1:t(e).billingAddressLine1,"onUpdate:billingAddressLine1":n[1]||(n[1]=g=>t(e).billingAddressLine1=g),billingAddressLine2:t(e).billingAddressLine2,"onUpdate:billingAddressLine2":n[2]||(n[2]=g=>t(e).billingAddressLine2=g),billingCity:t(e).billingCity,"onUpdate:billingCity":n[3]||(n[3]=g=>t(e).billingCity=g),billingState:t(e).billingState,"onUpdate:billingState":n[4]||(n[4]=g=>t(e).billingState=g),billingPostalCode:t(e).billingPostalCode,"onUpdate:billingPostalCode":n[5]||(n[5]=g=>t(e).billingPostalCode=g),billingCountry:t(e).billingCountry,"onUpdate:billingCountry":n[6]||(n[6]=g=>t(e).billingCountry=g),promotionCodeId:t(e).promotionCodeId,"onUpdate:promotionCodeId":n[7]||(n[7]=g=>t(e).promotionCodeId=g),promotionCodeIsDitry:p.value,"onUpdate:promotionCodeIsDitry":n[8]||(n[8]=g=>p.value=g),trialDays:t(e).trialDays,"onUpdate:trialDays":n[9]||(n[9]=g=>t(e).trialDays=g),"location-count":t(e).locations.length,"validate-current-step":U,"handle-previous-step":V,price:y.value,"onUpdate:price":n[10]||(n[10]=g=>y.value=g)},null,8,["billingPlan","billingPlanIndex","cycleInterval","billingEmail","billingAddressLine1","billingAddressLine2","billingCity","billingState","billingPostalCode","billingCountry","promotionCodeId","promotionCodeIsDitry","trialDays","location-count","price"]),i.value||t(e).referralCode?(S(),D(L,{key:1,modelValue:t(e).referralCode,"onUpdate:modelValue":n[11]||(n[11]=g=>t(e).referralCode=g),label:"Referral Code",placeholder:"Enter Referral Code",class:"mt-6"},null,8,["modelValue"])):(S(),_("button",{key:2,type:"button",onClick:n[12]||(n[12]=g=>
1i.value=!i.value),class:"mt-6 flex items-center justify-start text-sm font-medium text-slate-500 space-x-2 hover:text-bdBlue-800 hover:underline"},[b(t(Je),{class:"h-5 w-5"}),n[13]||(n[13]=P("span",null,"Add Referral Code",-1))]))]}),_:1},8,["is-ready-for-next-step"]))}},wt={__name:"StepCompanyCreate8",setup(a){const m=Ee(),e=G(),s=()=>{e.fetchUserAccount(),m.push({path:"/company-dashboard"})};return(d,l)=>(S(),D(q,{format:"splash",title:"Welcome to Business Draft",subtitle:"You've taken the first step towards effortlessly finding your dream candidates. Let's match you with top-notch talent, tailored just for your business.",onHandleNextStep:s,"is-ready-for-next-step":!0},{"next-step-text":k(()=>l[0]||(l[0]=[$("Explore Dashboard")])),"splash-image":k(()=>[b(Ke)]),_:1}))}},Ia={__name:"CompanyAccountCreate",setup(a){const m=[tt,lt,ft,ht,vt,Ct,et,wt],e=fe(),s=T();s.handleCheckoutUuid(),s.handleActivateTrial(e.query.token);const{manuallyTrigger:d,manuallyStart:l,manuallyCancel:f}=Xe(Oe,T);return Q("manuallyTriggerAbandonedSignUp",d),Q("manuallyStartAbandonedSignUp",l),Q("manuallyCancelAbandonedSignUp",f),$e(()=>f()),(u,p)=>(S(),_(Le,null,[t(s).activatingTrial?(S(),D(X,{key:0})):W("",!0),b(he,{"step-list":m,"track-history":""})],64))}};export{Ia as default};
2//# sourceMappingURL=CompanyAccountCreate-Hf209X4C.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.