import{H as B}from"./Heading.js";import{S as L}from"./Subtitle.js";import{C as M}from"./Button.js";import{_ as E,o as r,c,p as x,g as C,a as i,r as h,b as o,w as n,e as a,t as g,f as p,T as b,F as O,i as I,d as S,h as v,n as W}from"./index.js";import"./telegram-authenticator.js";import"./close2.js";import"./donate.js";import"./money.js";const T={name:"Box"},k=e=>(x("data-v-95857df1"),e=e(),C(),e),D={viewBox:"0 0 33 38",xmlns:"http://www.w3.org/2000/svg"},F=k(()=>i("path",{d:"M26.916 5.99664L33 9.5L32.8732 9.57306V28.5L16.5 37.9269V38L16.4366 37.9641L16.3732 38V37.9269L10.4193 34.499L10.416 15.4966L26.916 5.99664Z",fill:"white"},null,-1)),N=k(()=>i("path",{d:"M22.4571 3.42914L16.5 0L0 9.5V28.5L5.95391 31.928L5.95711 12.9291L22.4571 3.42914Z",fill:"white"},null,-1)),P=[F,N];function A(e,_,f,y,t,s){return r(),c("svg",D,P)}const K=E(T,[["render",A],["__scopeId","data-v-95857df1"]]),u=e=>(x("data-v-eb0affcf"),e=e(),C(),e),Y={class:"fishing-work__depth"},Z=u(()=>i("div",{class:"fishing-work__depth--number__after"},"м",-1)),R={key:0,class:"fishing-work__view-weight"},U=u(()=>i("div",{class:"view-weight__number__after"},"KG",-1)),G={key:0,class:"fishing-work__boxes"},z={class:"boxes__container"},H={class:"fishing-work__controls mt-32"},X={class:"controls__button"},j={class:"controls__button"},q=u(()=>i("div",{class:"controls--overlay"},null,-1));function J(e,_,f,y,t,s){const l=h("sub-title"),m=h("heading"),V=h("box"),w=h("controls-button");return r(),c("div",{class:W(["fishing-work iface-container",{"fishing-work_mobile":s.isMobile}])},[i("div",Y,[o(l,{class:"fishing-work__depth--title"},{default:n(()=>[a("Клетка погружена на")]),_:1}),o(m,{class:"fishing-work__depth--number"},{default:n(()=>[a(g(t.depth),1),Z]),_:1})]),o(b,{name:"fade"},{default:n(()=>[t.isViewWeight?(r(),c("div",R,[o(l,{class:"view-weight__title"},{default:n(()=>[a("Краб успешно пойман")]),_:1}),o(m,{class:"view-weight__number"},{default:n(()=>[a("+"+g(t.weightOfFish),1),U]),_:1})])):p("",!0)]),_:1}),o(b,{name:"fade"},{default:n(()=>[t.isViewWeight?p("",!0):(r(),c("div",G,[o(l,{class:"boxes__title"},{default:n(()=>[a("Клеток на судне")]),_:1}),i("div",z,[(r(),c(O,null,I(6,d=>o(V,{class:"boxes__item",key:d,style:S({opacity:d<=t.countOfBoxes?1:.45})},null,8,["style"])),64))])]))]),_:1}),i("div",H,[i("div",X,[o(w,{keyCode:t.KEY_CODE_Z,text:s.isMobile?"Поднять":"Z",onPressed:_[0]||(_[0]=d=>s.action(t.EVENT.RAISE)),mobileAdaptive:s.isMobile},null,8,["keyCode","text","mobileAdaptive"]),s.isMobile?p("",!0):(r(),v(l,{key:0,class:"controls__button--text"},{default:n(()=>[a("Поднять")]),_:1}))]),i("div",j,[o(w,{keyCode:t.KEY_CODE_C,text:s.isMobile?"Погрузить":"C",onPressed:_[1]||(_[1]=d=>s.action(t.EVENT.SUBMERGE)),mobileAdaptive:s.isMobile},null,8,["keyCode","text","mobileAdaptive"]),s.isMobile?p("",!0):(r(),v(l,{key:0,class:"controls__button--text"},{default:n(()=>[a("Погрузить")]),_:1}))]),q])],2)}const Q={props:["openParams"],components:{Heading:B,ControlsButton:M,SubTitle:L,Box:K},data(){return{EVENT:{RAISE:0,SUBMERGE:1},KEY_CODE_Z:window.KEY_CODE_Z,KEY_CODE_C:window.KEY_CODE_C,countOfBoxes:2,depth:0,weightOfFish:45,isViewWeight:!1}},computed:{isMobile(){return this.$root.isMobile}},created(){this.$data.noAdaptation=!0,this.openParams&&(this.setBoxCount(this.openParams[0]),this.setDepth(this.openParams[1]))},methods:{setDepth(e,_){if(e==this.depth)return;const f=setInterval(()=>{e>=this.depth?this.depth++:this.depth--,this.depth==e&&clearInterval(f)},_/Math.abs(e-this.depth))},setBoxCount(e){this.countOfBoxes=e},viewWeight(){this.isViewWeight=!this.isViewWeight},openFishModal(e){this.weightOfFish=e,this.isViewWeight=!0,setTimeout(()=>{this.isViewWeight=!1},3e3)},action(e){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"FishingWork_OnPlayerEvent",e)}}},ae=E(Q,[["render",J],["__scopeId","data-v-eb0affcf"]]);export{ae as default};
