import{R as k}from"./RubleIcon.js";import{_ as h,a as u,b as v}from"./plus.js";import{o as l,c as r,a as t,t as o,e as m,F as b,i as p,d as y,n as g,p as C,g as T,_ as f}from"./index.js";const e=s=>(C("data-v-6b74bdf0"),s=s(),T(),s),P={class:"iface-centered"},S=e(()=>t("div",{class:"ticket-title"},"Время отправляться!",-1)),E=e(()=>t("div",{class:"ticket-subtitle"},"Подтвердите покупку билета.",-1)),I=e(()=>t("img",{src:h},null,-1)),M=[I],w={class:"ticket"},F=e(()=>t("img",{class:"ticket__bottom-img",src:u},null,-1)),x={class:"ticket__row"},U={class:"ticket__item"},B=e(()=>t("div",{class:"ticket__key"},"Откуда",-1)),H={class:"ticket__value"},L={class:"ticket__item"},R=e(()=>t("div",{class:"ticket__key"},"Куда",-1)),N={class:"ticket__value"},O={class:"ticket__row"},V=e(()=>t("div",{class:"ticket__item"},[t("div",{class:"ticket__key"},"Пассажиров"),t("div",{class:"ticket__value"},"1 человек")],-1)),z={class:"ticket__item"},A=e(()=>t("div",{class:"ticket__key"},"Цена",-1)),G={class:"ticket__value ticket__value--position"},W=e(()=>t("div",{class:"rouble-sign--grey",style:{width:"1.6vh",height:"1.6vh"}},null,-1)),X={class:"ticket__row"},j=e(()=>t("div",{class:"ticket__item"},[t("div",{class:"ticket__key"},"Дата полета"),t("div",{class:"ticket__value"},"Сегодня")],-1)),q={class:"ticket__item"},D=e(()=>t("div",{class:"ticket__key"},"Время",-1)),J={class:"ticket__value"},K={class:"ticket-barcode"},Q={class:"ticket-code"},Y={class:"buy-button-container"},Z=e(()=>t("img",{src:v},null,-1)),$=e(()=>t("span",null,"Купить",-1)),tt=[Z,$];function et(s,i,n,a,_,c){return l(),r("div",P,[t("div",{class:g(["ticket-bg",{"ticket-mobile":c.isMobile}])},[S,E,t("button",{class:"ticket-close-button",onClick:i[0]||(i[0]=d=>c.close())},M),t("div",w,[F,t("div",x,[t("div",U,[B,t("div",H,o(c.getCountry(this.ticketFromCountry)),1)]),t("div",L,[R,t("div",N,o(c.getCountry(this.ticketToCountry)),1)])]),t("div",O,[V,t("div",z,[A,t("div",G,[W,m(o(_.ticketPrice),1)])])]),t("div",X,[j,t("div",q,[D,t("div",J,o(_.ticketHour.toString().padStart(2,"0"))+":"+o(_.ticketMin.toString().padStart(2,"0")),1)])]),t("div",K,[(l(),r(b,null,p(40,d=>t("div",{style:y({width:c.barcodeItemWidth()+"px"})},null,4)),64))]),t("div",Q,o(c.ticketCode(13)),1)]),t("div",Y,[t("div",{class:"buy-button",onClick:i[1]||(i[1]=d=>c.buyTicket())},tt)])],2)])}const st=1,it=2,ct={props:["openParams"],components:{RubleIcon:k},data(){return{ticketPrice:0,ticketHour:0,ticketMin:0,ticketFromCountry:0,ticketToCountry:0}},computed:{isMobile(){return this.$root.isMobile}},created(){this.openParams&&(this.ticketPrice=this.openParams[0],this.ticketHour=this.openParams[1],this.ticketMin=this.openParams[2],this.ticketFromCountry=this.openParams[3],this.ticketToCountry=this.openParams[4])},methods:{close(){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnPlayerTicketClick",2)},getCountry(s){switch(s){case st:return"Россия";case it:return"США"}},buyTicket(){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnPlayerTicketClick",1)},barcodeItemWidth(){const s=Math.random()*3;return s<1?1:s},ticketCode(s){const i="abcdefghijklmnopqrstuvwxyz01234567890";let n="";for(let a=0;a<s;a++){const _=i[Math.round(Math.random()*i.length)];n=n+_}return n}}},at=f(ct,[["render",et],["__scopeId","data-v-6b74bdf0"]]);export{at as default};
