import{o as n,c as a,a as t,n as l,d as h,f as c,t as _,p as m,g as p,_ as r}from"./index.js";const f=e=>(m("data-v-c366d534"),e=e(),p(),e),g={class:"iface-centered"},u={key:0,class:"fishing"},v={class:"fishing__container"},I=f(()=>t("div",{class:"complete__title"},"Вы поймали",-1)),E={class:"complete__image"},P=["src"],y={class:"complete__name"},C={class:"complete__value"},x={class:"complete__buttons"};function S(e,s,B,F,i,o){return n(),a("div",g,[i.fishingWindow?(n(),a("div",u,[t("div",v,[t("div",{class:l(["fishing__float",`fishing__float_${i.state}`]),style:h({top:"calc(50% + "+i.floatPosition+"%)"})},null,6)])])):c("",!0),i.completeWindow?(n(),a("div",{key:1,class:l(["complete",{complete_mobile:o.isMobile}])},[I,t("div",E,[t("img",{src:o.getFishImage(i.fishIndex)},null,8,P)]),t("div",y,_(i.fishes[i.fishIndex].name),1),t("div",C,_(i.fishWeight)+" кг",1),t("div",x,[t("div",{class:"complete__button",onClick:s[0]||(s[0]=d=>o.selectButton(1))},"Забрать"),t("div",{class:"complete__button",onClick:s[1]||(s[1]=d=>o.selectButton(2))},"Отпустить")])],2)):c("",!0)])}const b={name:"fishing",props:["openParams"],data(){return{state:0,floatPosition:0,floatMaxPosition:0,fishIndex:0,fishWeight:0,fishes:[{name:"Карась"},{name:"Красноперка"},{name:"Окунь"},{name:"Сом"},{name:"Щука"}],statuses:["В спокойствии..","Колышется..","Под водой!"],fishingWindow:!0,completeWindow:!1}},computed:{isMobile(){return this.$root.isMobile}},created(){this.$data.noAdaptation=!0,this.openParams&&this.updateFishingInfo(this.openParams)},methods:{getFishImage(e){return"/images/fishing/fish/"+e+".png"},updateStatus(e){this.state=e},updateFishingInfo(e){let s=typeof e=="object"?e:JSON.parse(e);this.state=s[0],this.fishIndex=s[1],this.fishWeight=s[2],this.completeWindow=s[3],this.floatPosition=s[4]},selectButton(e){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnPlayerFishingSelect",e)},close(){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnPlayerFishingSelect",3)}}},k=r(b,[["render",S],["__scopeId","data-v-c366d534"]]);export{k as default};
