1import{k as _,r as n,_ as h,z as d,K as e,N as A,G as S,V as p,W as m,H as y,J as x,y as g}from"./vendor-misc-5pJBpqhN.js";import{u as C}from"./vendor-vue-BIDZeepx.js";import{e as k,f as w,s as f,o as V,k as M,_ as N}from"./index-BNPflmqD.js";import"./vendor-tanstack-B6ELLr_Q.js";import"./vendor-sentry-84cD2ryj.js";import"./vendor-utils-CxkvrZ9U.js";const P={class:"onboard-wrapper"},T={class:"onboard-card"},U={class:"form-field"},z={class:"form-field"},B={key:0,class:"form-error",role:"alert"},O=["disabled"],q=_({__name:"AgencyOnboardPage",setup(D){const c=C(),v=k(),l=w(),o=n(""),i=n(""),s=n(null),r=n(!1);h(()=>{l.initFromMemberships(),l.hasAgencyAccess&&(f("agency"),c.replace("/agency/roster"))});async function b(){s.value=null,r.value=!0;try{const{data:t}=await V.post("/api/v1/agency/organizations",{name:o.value.trim(),country_code:i.value.trim().toUpperCase()||null});try{await v.refreshProfile()}catch{}t!=null&&t.id&&l.setActiveOrg(t.id),f("agency"),await c.push("/agency/roster")}catch(t){s.value=M(t,"Failed to create agency. Please try again.")}finally{r.value=!1}}return(t,a)=>(g(),d("div",P,[e("div",T,[a[4]||(a[4]=e("div",{class:"onboard-header"},[e("h1",{class:"onboard-title"},"Set up your agency"),e("p",{class:"onboard-subtitle"},"Tell us about your business")],-1)),e("form",{class:"onboard-form",onSubmit:A(b,["prevent"])},[e("div",U,[a[2]||(a[2]=e("label",{for:"agency-name"},[S("Agency name "),e("span",{class:"required"},"*")],-1)),p(e("input",{id:"agency-name","onUpdate:modelValue":a[0]||(a[0]=u=>o.value=u),type:"text",required:"",autocomplete:"organization",placeholder:"e.g. Stellar Talent Agency"},null,512),[[m,o.value]])]),e("div",z,[a[3]||(a[3]=e("label",{for:"agency-country"},"Country (optional)",-1)),p(e("input",{id:"agency-country","onUpdate:modelValue":a[1]||(a[1]=u=>i.value=u),type:"text",maxlength:"2",autocomplete:"country",placeholder:"e.g. US"},null,512),[[m,i.value]])]),s.value?(g(),d("p",B,y(s.value),1)):x("",!0),e("button",{type:"submit",class:"submit-btn",disabled:r.value||!o.value.trim()},y(r.value?"Creatingâ¦":"Create workspace"),9,O)],32)])]))}}),J=N(q,[["__scopeId","data-v-f1c6b12d"]]);export{J as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.