1import{_ as b,m as M,j as v,b as n,c as d,e as u,o as h,a as e,g as c,f as m,t as l,w as r,a1 as w,a9 as D,a4 as N}from"./index-sUPB-bMu.js";import{a as T}from"./Base-Cq-6GNZm.js";const E={name:"ChatAccess",data(){return{username:null,showAccessModal:!1}},computed:{...v(["chatConnectionData","chatFormatData","chatUserData","userToken","userRoles","userClientAccount"]),isLogged(){return!!this.userClientAccount&&!!this.userToken},modalWidth(){return window.screen.width<575?"90%":"480px"}},watch:{userClientAccount(){!this.isLogged&&this.chatFormatData.embed||this.useLoggedData()}},mounted(){if(this.chatFormatData.embed&&this.chatUserData.name&&!this.isLogged){this.userIsAccessing(!0);return}if(!this.isLogged){this.chatResetUser();return}this.useLoggedData()},methods:{...M(["chatSetUserNotLogged","chatSetUserLogged","chatResetUser"]),async useNotLoggedData(){const{valid:t}=await this.$refs.accessChat.validate();t&&(this.chatSetUserNotLogged(this.username),this.userIsAccessing(!0),this.closeModal())},useLoggedData(){this.chatSetUserLogged({name:`${this.userClientAccount.nome} ${this.userClientAccount.sobrenome}`,avatar:this.userClientAccount.image?.url,email:this.userClientAccount.email,id:this.userClientAccount.id,role:this.userRoles}),this.userIsAccessing(!0)},userIsAccessing(t){t===!0&&this.notifyJoin(),this.$emit("showAction",t)},notifyJoin(){T.postMessage({data:{channel:this.chatConnectionData.channel,type:"JOIN",user:{...this.chatUserData},body:{type:"NOTIFY",message:null}}})},openModal(){this.showAccessModal=!0},closeModal(){this.showAccessModal=!1}}},y={key:0,class:"chat-access"},S={class:"chat-access__content"},O={class:"btn__text"},U={class:"access-modal"},k={class:"access-modal__content"},F={class:"access-modal__content__entry"},I=["innerHTML"],B={class:"access-modal__content__content"},R={class:"input-item__floated-label"},H=["placeholder"],V={class:"access-form__action"},$={type:"submit",class:"btn btn--color-primary"},x={class:"btn__text"},G={class:"login-button"},J={class:"btn__text"};function q(t,s,W,j,i,a){const _=n("SvgElement"),p=n("ErrorMessage"),g=n("Field"),A=n("Form"),f=n("router-link"),C=n("ModalElement");return t.chatFormatData.embed?u("",!0):(h(),d("div",y,[e("div",S,[a.isLogged?u("",!0):(h(),d("button",{key:0,class:"btn btn--color-primary",onClick:s[0]||(s[0]=m((...o)=>a.openModal&&a.openModal(...o),["prevent"]))},[e("span",O,l(t.$t("CHAT.BUTTON.CALL_ACCESS_MODAL")),1)]))]),c(C,{"modal-id":"access-modal",width:a.modalWidth,"close-button":!0,"click-to-close":!0,show:i.showAccessModal,onModalVisible:s[3]||(s[3]=o=>i.showAccessModal=o)},{default:r(()=>[e("div",U,[e("div",k,[e("div",F,[c(_,{name:"IlustraChat",title:"IlustraChat",type:"other"}),e("p",{class:"subtitle",innerHTML:t.$t("CHAT.TEXT.ACCESS_MODAL")},null,8,I)]),e("div",B,[c(A,{ref:"accessChat",slim:""},{default:r(()=>[e("form",{class:"form-styled access-form",onSubmit:s[2]||(s[2]=m((...o)=>a.useNotLoggedData&&a.useNotLoggedData(...o),["prevent"]))},[c(g,{name:t.$t("FORM.LABEL.NAME"),class:"input-item",tag:"div",rules:"required|alpha_spaces"},{default:r(({field:o})=>[e("div",R,[w(e("input",D(o,{"onUpdate:modelValue":s[1]||(s[1]=L=>i.username=L),type:"text",name:"nome",placeholder:t.$t("FORM.LABEL.NAME"),class:"input-item__field--normal input-item__field"}),null,16,H),[[N,i.username]])]),c(p,{name:t.$t("FORM.LABEL.NAME"),class:"input-item__feedback input-item__feedback--invalid"},null,8,["name"])]),_:1},8,["name"]),e("div",V,[e("button",$,[e("span",x,l(t.$t("CHAT.BUTTON.ACCESS_NO_LOGIN")),1)])])],32)]),_:1},512),e("div",G,[c(f,{to:{name:"userAccess",query:{redirectTo:"/live/"}},class:"btn btn--text-primary btn--border"},{default:r(()=>[e("span",J,l(t.$t("CHAT.BUTTON.ACCESS_LOGIN")),1)]),_:1})])])])])]),_:1},8,["width","show"])]))}const Y=b(E,[["render",q],["__scopeId","data-v-c9783a38"]]);export{Y 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.