import{_ as c,o as a,c as n,a as s,r as l,F as y,i as $,n as b,b as p,f as u,t as v,d as h,w as k,h as E,T}from"./index.js";import{_ as g,a as N,b as A}from"./dead.js";const D={},P={width:"66",height:"66",viewBox:"0 0 66 66",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B=s("path",{render:!0,d:"M1 65H10.6H55.4H65V0.996872H55.4H10.6H1V65Z",fill:"#0D0D17","fill-opacity":"0.6"},null,-1),C=s("path",{render:!0,d:"M1 61V65H5",stroke:"#F3F2ED"},null,-1),S=s("path",{render:!0,d:"M1 5V1H5",stroke:"#F3F2ED"},null,-1),O=s("path",{render:!0,d:"M65 5V1H61",stroke:"#F3F2ED"},null,-1),w=s("path",{render:!0,d:"M65 61V65H61",stroke:"#F3F2ED"},null,-1),F=[B,C,S,O,w];function H(e,r){return a(),n("svg",P,F)}const M=c(D,[["render",H]]),V={class:"dbd-players"},x={class:"dbd-players__item__skin"},I={key:0,class:"dbd-players__item__skin__connection",src:g},R={key:1,class:"dbd-players__item__skin__connection",src:N},K={key:2,class:"dbd-players__item__skin__dead",src:A},z=["src"],J={class:"dbd-players__item__name"};function L(e,r,_,o,d,i){const m=l("PlayerBackground");return a(),n("div",V,[(a(!0),n(y,null,$(_.players,(t,f)=>(a(),n("div",{class:b(["dbd-players__item",{"dbd-players__item_dead":t.state===e.STATE.DEAD,"dbd-players__item_connection":t.state===e.STATE.CONNECTION||t.state===e.STATE.TAKE_PART,"dbd-players__item_connection-estabilish":t.state===e.STATE.CONNECTION}]),key:f},[s("div",x,[p(m,{class:"dbd-players__item__skin__bg"}),t.state===e.STATE.CONNECTION?(a(),n("img",I)):u("",!0),t.state===e.STATE.TAKE_PART?(a(),n("img",R)):u("",!0),t.state===e.STATE.DEAD?(a(),n("img",K)):u("",!0),s("img",{class:"dbd-players__item__skin__image",src:`/images/skins/${t.skin}.png`},null,8,z)]),s("div",J,v(t.name.split("_").join(" ")),1)],2))),128))])}const Z={props:["players"],components:{PlayerBackground:M},data:()=>({STATE:{NORMAL:0,CONNECTION:1,TAKE_PART:2,DEAD:3}})},q=c(Z,[["render",L]]),G={class:"dbd-effect"};function Q(e,r,_,o,d,i){return a(),n("div",G)}const U={},W=c(U,[["render",Q]]),X={class:"dbd-bar"},Y={class:"dbd-bar__track dbd-bar__track_left"},j={class:"dbd-bar__track dbd-bar__track_right"};function ee(e,r,_,o,d,i){return a(),n("div",X,[s("div",Y,[s("div",{class:"dbd-bar__fill",style:h({width:`${_.value}%`})},null,4)]),s("div",j,[s("div",{class:"dbd-bar__fill",style:h({width:`${_.value}%`})},null,4)])])}const se={props:{value:{type:Number,default:0}}},te=c(se,[["render",ee]]);function ae(e,r,_,o,d,i){const m=l("Players"),t=l("Bar"),f=l("Effect");return a(),n("div",{class:b(["dbd iface-container",{dbd_mobile:i.isMobile}])},[p(m,{class:"dbd__players",players:e.players},null,8,["players"]),p(t,{class:"dbd__bar",value:e.bar},null,8,["value"]),p(T,{name:"effect",appear:""},{default:k(()=>[e.useEffect?(a(),E(f,{key:0,class:"dbd__effect"})):u("",!0)]),_:1})],2)}const _e={props:["openParams"],components:{Players:q,Effect:W,Bar:te},data:()=>({players:[{skin:123,name:"Pavel_Nabokov",state:0},{skin:200,name:"Pavel_Nabokov",state:2},{skin:170,name:"Pavel_Nabokov",state:3}],bar:30,useEffect:!1}),computed:{isMobile(){return this.$root.isMobile}},created(){this.$data.noAdaptation=!0,this.openParams&&this.setData(this.openParams)},methods:{setData(e){const r=typeof e=="string"?JSON.parse(e):e,[_,o,d]=r;this.setPlayers(_),this.setBar(o),this.setEffect(d)},setPlayers(e){const _=(typeof e=="string"?JSON.parse(e):e).map(([o,d,i])=>({skin:o,name:d,state:i}));this.players=_},setBar(e){this.bar=e},setEffect(e){this.useEffect=e}}},oe=c(_e,[["render",ae]]);export{oe as default};
