1import{d as C,z as b,p as j,o as n,e as y,w as u,a as m,b as i,h as q,c as s,f as t,t as l,F as f,q as w,g as B,i as g,k as p,s as R,r as W}from"./app-BhrmwYl7.js";import{_ as I}from"./AnchorTextLink.vue_vue_type_script_setup_true_lang-mI8bEXGz.js";import{_ as J}from"./TtrFormSuccessMessage.vue_vue_type_script_setup_true_lang-ChVNr1rU.js";import{t as r}from"./formRequests-obmzPvTp.js";import{_ as N}from"./AuthWithDashboardBgLayout.vue_vue_type_script_setup_true_lang-BUjLTIl3.js";import{t as V}from"./eventTracker-BZOcuCq8.js";import{s as x}from"./index-DDp3mSYh.js";import"./TtrApplicationLogo.vue_vue_type_script_setup_true_lang-DFJPLlXF.js";import"./useFlashToast-BTEdArH6.js";import"./index-qo_VO41H.js";import"./index-BxCYObgv.js";import"./index-B2Lda71_.js";import"./index-BP-PWU25.js";import"./index-s65M6HeK.js";import"./index-6OMmZnv_.js";import"./index-Dr7VGy0a.js";import"./index-BR8YZ14P.js";import"./index-9-N7EY21.js";import"./index-1XI5ECkV.js";const $={key:0},D={class:"text-secondary-900 dark:text-secondary-600"},E={key:0},F={key:1},S={class:"mb-6 flex flex-wrap justify-center gap-4"},L={class:"mb-6 flex justify-center"},P={key:2,class:"border-secondary-900 dark:bg-secondary-900 mx-4 flex rounded-md border bg-white px-2 py-1 text-center text-sm"},ae=C({__name:"JoinCompany",props:{user:{},matchingCompanies:{},isImpersonating:{type:Boolean},joinRequestPending:{type:Boolean},matchingCompany:{}},setup(_){b(()=>{r.defaults({companyId:void 0}).reset()});const o=_,c=(a,e=null)=>{V(a,e)},v=a=>{r.companyId=a.id,c("freetrial_signup_existing_company_join_request"),r.post(route("join-company-request.store"),{preserveScroll:!0})},k=()=>{c("freetrial_signup_existing_company_opt_out"),W.visit(route("account-setup",{continue_without_joining:!0}))};return(a,e)=>{const h=j("auto-animate");return n(),y(N,null,{default:u(()=>[m(i(q),{title:"Join your company"}),o.joinRequestPending?(n(),s("div",$,[e[0]||(e[0]=t("h2",{class:"text-secondary-900 dark:text-secondary-600 mb-2 text-2xl font-bold"},"Hold tight",-1)),t("p",D,"We're waiting for "+l(o.matchingCompany?.name)+" to approve you.",1)])):(n(),s(f,{key:1},[o.matchingCompanies.length===1?(n(),s("div",E,[...e[1]||(e[1]=[t("h2",{class:"text-secondary-900 dark:text-secondary-600 mb-2 text-2xl font-bold"},"We've found an existing company account",-1),t("p",{class:"text-secondary-900 dark:text-secondary-600"},"Would you like to join them?",-1)])])):(n(),s("div",F,[...e[2]||(e[2]=[t("h2",{class:"text-secondary-900 dark:text-secondary-600 mb-2 text-2xl font-bold"},"We've found existing company accounts",-1),t("p",{class:"text-secondary-900 dark:text-secondary-600"},"Would you like to join one of them?",-1)])])),w((n(),s("div",S,[(n(!0),s(f,null,B(o.matchingCompanies,d=>(n(),y(i(x),{key:d.id,fluid:o.matchingCompanies.length===1,loading:i(r).processing,rounded:o.matchingCompanies.length>1,outlined:"",severity:o.matchingCompanies.length===1?void 0:"secondary",onClick:g(z=>v(d),["prevent"])},{default:u(()=>[e[3]||(e[3]=p(" Request to join ",-1)),t("b",null,l(d.name),1),p(" ("+l(d.users_count)+" users) ",1)]),_:2},1032,["fluid","loading","rounded","severity","onClick"]))),128))])),[[h]]),t("div",L,[m(J,{form:i(r),label:"Request sent."},null,8,["form"])]),m(i(x),{fluid:"",label:"No, create new account",loading:i(r).processing,outlined:"",onClick:g(k,["prevent"])},null,8,["loading"])],64)),o.isImpersonating?(n(),s("div",P,[m(I,{href:a.route("impersonate.leave")},{default:u(()=>[t("span",null,[e[4]||(e[4]=p("Impersonating ",-1)),t("b",null,l(o.user?.complete_name),1),e[5]||(e[5]=p(" - ",-1))]),e[6]||(e[6]=t("span",{class:"text-danger-500"},"Leave impersonation",-1))]),_:1},8,["href"])])):R("",!0)]),_:1})}}});
1export{ae 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.