import{R as y,a as g,b as S,p as P}from"./CheckboxRange.js";import{M as f,a as T,b as Y}from"./Modal.js";import{S as R}from"./ScrollableContainer.js";import{C as w}from"./ContaineredButton.js";import{r as i,o as m,c as E,b as c,w as u,a as r,F as D,i as L,t as I,p as k,g as A,_ as M,H as N,R as V,y as v}from"./index.js";import"./RangeSlider.js";import"./Close.js";import"./telegram-authenticator.js";import"./close2.js";import"./Button.js";import"./donate.js";import"./money.js";import"./GraffitiPattern.js";import"./dom.js";import"./ButtonContainer.js";/* empty css                                                               */const K=e=>(k("data-v-46a22575"),e=e(),A(),e),b={class:"voice-chat-settings"},B=K(()=>r("div",{class:"voice-chat-settings-modal__subtitle"},"Настраивайте голосовой чат игроков поблизости",-1)),G={class:"voice-chat-settings-modal__items"},F={class:"voice-chat-settings-modal__item"},U={class:"voice-chat-settings-modal__item-name"},X={class:"voice-chat-settings-modal__buttons"};function z(e,t,s,a,_,l){const d=i("Range"),p=i("ScrollableContainer"),o=i("ControlsContaineredButton"),n=i("Modal");return m(),E("div",b,[c(n,{class:"voice-chat-settings-modal",isOpened:a.modalIsOpened,colorType:e.MODAL_COLOR_TYPES.GREEN,type:e.MODAL_TYPES.NO_OVERLAY,title:"Настройка голосового чата"},{default:u(()=>[B,c(p,{class:"voice-chat-settings-modal__content",type:9},{default:u(()=>[r("div",G,[(m(!0),E(D,null,L(a.players,(C,h)=>(m(),E("div",F,[r("div",U,I(C.nickname.replace("_"," ")),1),c(d,{data:{value:C.volume,min:0,max:130},colorType:e.RANGE_COLOR_TYPE.GREEN,sizeType:e.RANGE_SIZE_TYPE.S,onChange:O=>a.change(O,h)},null,8,["data","colorType","sizeType","onChange"])]))),256))])]),_:1}),r("div",X,[c(o,{containerText:"Закрыть",onPressed:a.close,keyCode:e.KEY_CODE_ESC},null,8,["onPressed","keyCode"])])]),_:1},8,["isOpened","colorType","type"])])}const H={props:["openParams"],components:{Modal:f,ScrollableContainer:R,Range:y,ControlsContaineredButton:w},data:()=>({noAdaptation:!0,HOLD_TIME:400,KEY_CODE_X:window.KEY_CODE_X,KEY_CODE_ESC:window.KEY_CODE_ESC,KEY_CODE_F3:window.KEY_CODE_F3,RANGE_COLOR_TYPE:g,RANGE_SIZE_TYPE:S,MODAL_TYPES:T,MODAL_COLOR_TYPES:Y}),setup(e){N(()=>{s.value=!0,document.addEventListener("keyup",_)}),V(()=>{s.value=!0,document.removeEventListener("keyup",_)});const t=v([]),s=v(!1),a=o=>t.value=P(o),_=o=>{o.keyCode===KEY_CODE_F3&&l()},l=()=>{s.value=!1,window.closeInterface("VoiceChatSettings"),sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"P3_OnPlayerCloseInterface")},d=(o,n)=>{t.value[n].volume=o,window.setVoiceChatPlayer(t.value[n].playerId,t.value[n].volume)},p=()=>{t.value=t.value.map(o=>({nickname:o.nickname,value:100})),window.resetVoiceChatPlayers()};return e.openParams&&a(e.openParams),{players:t,modalIsOpened:s,setPlayers:a,close:l,change:d,reset:p}},computed:{}},re=M(H,[["render",z],["__scopeId","data-v-46a22575"]]);export{re as default};
