import{_ as p,a as g,b as T,c as y}from"./unusual.js";import{_ as v,a as E,b as S}from"./star3.js";/* empty css      */import{C as w}from"./Button.js";import{A as C}from"./achievements.js";import{o as b}from"./menu3.js";import{r as B,o as a,c,b as _,w as l,a as i,l as A,F as D,t as h,h as N,f as u,T as P,n as R,_ as k}from"./index.js";import"./telegram-authenticator.js";import"./close2.js";import"./donate.js";import"./money.js";const x={key:0,class:"achievement-notification__container"},I={class:"achievement-notification__progress"},O=["src"],H=i("div",{class:"achievement-notification__pattern"},null,-1),M=i("div",{class:"achievement-notification__light",key:"light"},null,-1),V={class:"achievement-notification__body",key:"body"},W={class:"achievement-notification__title"},Y={class:"achievement-notification__text"},K=i("img",{src:v},null,-1),U=[K];function F(s,o,r,m,t,e){const d=B("ControlsButton");return a(),c("div",{class:R(["achievement-notification",{"achievement-notification_small":t.isSmall,"achievement-notification_rewards":t.interfaceType===t.TYPES.REWARDS}])},[_(P,{name:"slide-down",mode:"out-in",appear:""},{default:l(()=>[t.isShow?(a(),c("div",x,[i("div",I,[i("img",{src:e.getIcon},null,8,O)]),H,_(A,{name:"fade"},{default:l(()=>[!t.isSmall&&t.isShowBody?(a(),c(D,{key:0},[M,i("div",V,[i("div",W,h(e.title),1),i("div",Y,h(t.text),1)]),e.isMobile?(a(),c("div",{key:0,class:"achievement-notification__arrow-btn",onClick:o[0]||(o[0]=(...f)=>e.onButtonPressed&&e.onButtonPressed(...f))},U)):(a(),N(d,{key:1,onPressed:e.onButtonPressed,text:"H",keyCode:t.KEY_CODE_H},null,8,["onPressed","keyCode"]))],64)):u("",!0)]),_:1})])):u("",!0)]),_:1})],2)}const z=5e3,n={ACHIEVEMENTS:0,REWARDS:1},G={props:["openParams"],components:{ControlsButton:w},data(){return{TYPES:n,KEY_CODE_H:window.KEY_CODE_H,icons:Object.assign({"/src/assets/images/main-menu/statistics/achievements/icons/achive.svg":p,"/src/assets/images/main-menu/statistics/achievements/icons/classical.svg":g,"/src/assets/images/main-menu/statistics/achievements/icons/rare.svg":T,"/src/assets/images/main-menu/statistics/achievements/icons/unusual.svg":y}),achievementsIcons:Object.assign({"/src/assets/images/achievement-notification/arrow.svg":v,"/src/assets/images/achievement-notification/pattern.png":E,"/src/assets/images/achievement-notification/star.svg":S}),isShow:!0,isSmall:!0,isShowBody:!1,startTimeout:null,closeTimeout:null,id:0,type:null,text:"Достижение выполнено, получите награду!",interfaceType:n.ACHIEVEMENTS}},computed:{isMobile(){return this.$root.isMobile},title(){return this.interfaceType===n.REWARDS?"ЕЖЕДНЕВНЫЕ НАГРАДЫ УЖЕ ДОСТУПНЫ!":C[this.id].name},getIcon(){if(this.interfaceType===n.REWARDS)return this.achievementsIcons["/src/assets/images/achievement-notification/star.svg"];const s=["classical","unusual","rare"],o=this.icons[`/src/assets/images/main-menu/statistics/achievements/icons/${s[this.type]}.svg`];return o||this.icons["/src/assets/images/main-menu/statistics/achievements/icons/achive.svg"]}},created(){this.$data.noAdaptation=!0,this.openParams&&this.setData(this.openParams),this.show()},methods:{setData(s){const o=typeof s=="string"?JSON.parse(s):s,[r,m,t,e]=o;this.id=r,this.type=m,this.text=t||(e===n.REWARDS?"Скорее забирайте ее во вкладке 'Награды'":"Достижение выполнено, получите награду!"),this.interfaceType=e},show(){this.isShow=!0,this.isSmall=!0,this.startTimeout&&clearTimeout(this.startTimeout),this.startTimeout=setTimeout(()=>{this.isSmall=!1,setTimeout(()=>{this.isShowBody=!0},250)},500),this.close()},close(s=z){this.closeTimeout&&clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(()=>{this.isShowBody=!1,setTimeout(()=>{this.isSmall=!0,setTimeout(()=>{this.isShow=!1,setTimeout(()=>{window.closeInterface("AchievementNotification")},500)},250)},150)},s)},onButtonPressed(){this.interfaceType===n.REWARDS?(b("rewards",""),this.close(0)):(sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"AchvNotif_OnButtonPressed"),this.close(0))}}},it=k(G,[["render",F]]);export{it as default};
