import{openBlock as a,createElementBlock as c,Fragment as u,createElementVNode as s,createTextVNode as m,toDisplayString as d,createCommentVNode as _,renderList as p,normalizeClass as D}from "/js/vue.esm-browser.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))f(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const n of r.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&f(n)}).observe(document,{childList:!0,subtree:!0});function o(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function f(e){if(e.ep)return;e.ep=!0;const r=o(e);fetch(e.href,r)}})();const y=(l,t)=>{const o=l.__vccOpts||l;for(const[f,e]of t)o[f]=e;return o},v={props:{app:null,version:"big"},data(){return{hasYearSelect:!1,monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],weekDays:["вс","пн","вт","ср","чт","пт","сб"],today:new Date,dayDiff:0,currentYear:2024,opened:!1,df:"2024-02-01",dt:"2024-02-14",initDate:"2024-02-01",calendars:[],monthTop:[],monthTopList:[],allowPastDates:!1,maxDate:null,dateFromObj:null,dateToObj:null,selectionMode:!1,selectionStart:null,selectionDF:null,selectionDT:null,lastMonTopList:12}},watch:{opened(l,t){},calendars(l,t){},df(){this.dayDiff=new Date(this.dt).dayDiff(new Date(this.df))},dt(){this.dayDiff=new Date(this.dt).dayDiff(new Date(this.df))}},created:function(){this.initDate=this.app.req.df,this.df=this.app.req.df,this.dt=this.app.req.dt,this.today.setHours(0,0,0,0),this.currentYear=this.today.getFullYear(),this.dateFromObj=new Date(this.df),this.dateFromObj.setHours(0,0,0,0),this.dateToObj=new Date(this.dt),this.dateToObj.setHours(0,0,0,0),this.selectionDF=this.dateFromObj.getTime(),this.selectionDT=this.dateToObj.getTime(),this.updateCalendar(parseInt(this.dateFromObj.getFullYear()),this.dateFromObj.getMonth())},computed:{},methods:{daysInMonth(l,t){return 32-new Date(t,l,32).getDate()},createCalendarBlock(l){let t=this;l.setDate(1),l.setHours(0,0,0,0);for(var o=l.getDay(),f=l.addDays(o>0?-o+1:-6),e=l.getFullYear(),r=l.getMonth(),n=[],i,h=0,w=0;w<42;w++)i=f.addDays(w),h=i.getDay(),n.push({n:w,time:i.getTime(),name:i.format("d").replace(/^0/g,""),isWeekEnd:h===0||h===6,isNotThisMon:i.getMonth()!==r,isPrev:!t.allowPastDates&&i.beforeToday(),isDisabled:t.maxDate&&i.after(t.maxDate)});return{year:e,name:t.monthNames[l.format("m")-1],days:n}},updateCalendar(l,t){let o=this;var f=new Date(l,t),e=new Date(l,t),r=new Date(o.today.getTime());r.addMonths(36),o.currentYear=l,f.after(r)&&(f=new Date(r.getTime()),e=new Date(r.getTime())),t=f.getMonth();let n=o.allowPastDates?new Date(l,0):new Date(Date.todayISO()),i=[f.format("ym"),e.addMonths(1).format("ym"),e.addMonths(1).format("ym")];o.monthTop=[],o.monthTopList=[];for(let h=0;h<12;h++)h==11&&(o.lastMonTopList=n.getMonth()),o.monthTop.push(n.format("ym")),o.monthTopList.push({date:new Date(n.getTime()),name:o.monthShort[n.format("m")-1],activeId:i.indexOf(n.format("ym")),index:h,firstActiveMonth:t}),n.addMonths(1);o.calendars=[],o.calendars.push(o.createCalendarBlock(new Date(f.getTime()))),o.calendars.push(o.createCalendarBlock(new Date(f.addMonths(1).getTime()))),o.calendars.push(o.createCalendarBlock(new Date(f.addMonths(1).getTime())))},selection(l,t){if(!(!t&&!this.selectionMode))if(!this.selectionMode)this.selectionMode=!0,this.selectionStart=l,this.selectionDF=l,this.selectionDT=l;else{if(l>this.selectionStart){let o=this.selectionStart;this.selectionDF=o,this.selectionDT=l}else{let o=this.selectionStart;this.selectionDF=l,this.selectionDT=o}t&&(this.selectionMode=!1,this.dateFromObj=new Date(this.selectionDF),this.dateToObj=new Date(this.selectionDT),this.df=this.dateFromObj.format("Y-m-d"),this.dt=this.dateToObj.format("Y-m-d"),this.app.req.df=this.dateFromObj.format("Y-m-d"),this.app.req.dt=this.dateToObj.format("Y-m-d"),this.opened=!1)}},dayText(){return window.lsfw.t(this.dayDiff,"день|дня|дней")}}},b=s("i",{class:"tour-selection-field__icon40 fas fa-calendar-alt"},null,-1),T={class:"bth__inp-block"},g=s("span",{class:"bth__inp-lbl"},"Период дат вылетов",-1),k={key:0,class:"bth__inp"},M={key:1,class:"bth__inp"},F={key:0,class:"fz13 normal"},C={class:"lsfw-filter__drop"},O={class:"fz11 hide-767"},S={class:"fz18 mr5"},Y={class:"fz12 normal"},j={class:"bth__inp-block"},x=s("span",{class:"bth__inp-lbl w115px"},"Период дат вылетов ",-1),L={key:0,class:"bth__inp"},N={key:1,class:"bth__inp"},P={key:0,class:"fz13 normal"},q={class:"lsfw-tour-search__w170px"},I={class:"lsfw-tour-search__input"},z={key:0,class:"normal ml5 fz11"},B=s("i",{class:"tour-selection-field__icon40 fas fa-calendar-alt"},null,-1),E={class:"bth__inp-block"},H=s("span",{class:"bth__inp-lbl"},"Период дат вылетов",-1),A={key:0,class:"bth__inp"},V={key:1,class:"bth__inp"},W={key:0,class:"fz13 normal"},K={key:5,class:"lsfw-form-control-wrap"},G={class:"lsfw-form-control"},J={class:"lsfw-form-control__head lsfw-form-control__head-flex"},Q={class:"lsfw-form-control__ttl"},R={class:"lsfw-form-control__body"},U={class:"lsfw-form-control__months-wrap"},X={class:"lsfw-form-control__months"},Z=["onClick"],$={class:"js-dates lsfw-form-control__calendars"},ee={class:"lsfw-form-control__calendar"},te={class:"lsfw-form-control__calendar-ttl"},se={class:"lsfw-form-control__calendar"},oe=s("ul",{class:"lsfw-form-control__calendar-weeks"},[s("li",null,"ПН"),s("li",null,"ВТ"),s("li",null,"СР"),s("li",null,"ЧТ"),s("li",null,"ПТ"),s("li",{class:"maroon"},"СБ"),s("li",{class:"maroon"},"ВС")],-1),ne={class:"lsfw-form-control__calendar-data"},le=["onClick","onMouseover"],re={key:6,class:"lsfw-form-control-wrap"},ie={class:"lsfw-form-control",style:{"max-width":"810px"}},ae={class:"lsfw-form-control__head lsfw-form-control__head-flex"},ce={class:"lsfw-form-control__ttl"},de={class:"lsfw-form-control__body lsfw-form-control__body--scroll lsfw-form-control__years-scroll"},fe={class:"lsfw-form-control__years"},_e=["onClick"];function he(l,t,o,f,e,r){return a(),c(u,null,[o.version=="big"?(a(),c("div",{key:0,onClick:t[0]||(t[0]=n=>e.opened=!0),class:"pointer relative"},[b,s("div",T,[g,l.loading?(a(),c("span",k,"...")):(a(),c("span",M,[m(d(new Date(e.df).format("weekDayShort"))+" "+d(new Date(e.df).format("d.m.y"))+" ",1),e.dayDiff>0?(a(),c("span",F,"+ "+d(e.dayDiff)+" "+d(r.dayText()),1)):_("",!0)]))])])):_("",!0),o.version=="small"?(a(),c("div",{key:1,onClick:t[1]||(t[1]=n=>e.opened=!0),class:"lsfw-filter__drop-wrap"},[s("div",C,[s("span",O,d(new Date(e.df).format("weekDayShort")),1),s("b",S,d(new Date(e.df).format("d.m.y")),1),s("span",Y," + "+d(e.dayDiff)+" "+d(r.dayText()),1)])])):_("",!0),o.version=="admin"?(a(),c("div",{key:2,onClick:t[2]||(t[2]=n=>e.opened=!0),class:"lsfw-form__cell w20p"},[s("div",j,[x,l.loading?(a(),c("b",L,"...")):(a(),c("b",N,[m(d(new Date(e.df).format("weekDayShort"))+" "+d(new Date(e.df).format("d.m.y"))+" ",1),e.dayDiff>0?(a(),c("span",P,"+ "+d(e.dayDiff)+" "+d(r.dayText()),1)):_("",!0)]))])])):_("",!0),o.version=="ti"?(a(),c("div",{key:3,onClick:t[3]||(t[3]=n=>e.opened=!0)},[s("div",q,[s("div",I,[m(d(new Date(e.df).format("weekDayShort"))+" "+d(new Date(e.df).format("d.m.y"))+" ",1),e.dayDiff>0?(a(),c("span",z,"+ "+d(e.dayDiff)+" "+d(r.dayText()),1)):_("",!0)])])])):_("",!0),o.version=="small-ti"?(a(),c("div",{key:4,onClick:t[4]||(t[4]=n=>e.opened=!0),class:"pointer relative"},[B,s("div",E,[H,l.loading?(a(),c("span",A,"...")):(a(),c("span",V,[m(d(new Date(e.df).format("weekDayShort"))+" "+d(new Date(e.df).format("d.m.y"))+" ",1),e.dayDiff>0?(a(),c("span",W,"+ "+d(e.dayDiff)+" "+d(r.dayText()),1)):_("",!0)]))])])):_("",!0),e.opened&&e.opened!="year"?(a(),c("section",K,[s("div",G,[s("div",J,[s("div",Q,[m(" Период дат вылетов "),e.hasYearSelect?(a(),c("div",{key:0,onClick:t[5]||(t[5]=n=>e.opened="year"),class:"flr d-ib bth__btn bth__btn--28 bth__btn--blue bth__loader"},d(e.currentYear),1)):_("",!0)]),s("i",{onClick:t[6]||(t[6]=n=>e.opened=!1),class:"lsfw-form-control__close-square fas fa-times-circle"})]),s("div",R,[s("div",U,[s("ul",X,[(a(!0),c(u,null,p(e.monthTopList,n=>(a(),c("li",{onClick:i=>r.updateCalendar(n.date.getFullYear(),n.date.getMonth()),class:D(["lsfw-form-control__month",{"lsfw-form-control__month--first":n.activeId===0,"lsfw-form-control__month--center":n.activeId===1,"lsfw-form-control__month--last":n.activeId===2}])},d(n.name),11,Z))),256))])]),s("div",$,[(a(!0),c(u,null,p(e.calendars,n=>(a(),c("section",ee,[s("div",te,d(n.name)+" "+d(n.year),1),s("div",se,[oe,s("ul",ne,[(a(!0),c(u,null,p(n.days,i=>(a(),c("li",{class:D({maroon:i.isWeekEnd,grey:i.isPrev,grey:i.isNotThisMon,"lsfw-form-control__calendar-data-selected":!i.isNotThisMon&&(e.selectionDF==i.time||e.selectionDT==i.time),"lsfw-form-control__calendar-data-range":!i.isNotThisMon&&e.selectionDF<i.time&&e.selectionDT>i.time}),onClick:h=>(i.isNotThisMon?function(){}:r.selection)(i.time,!0),onMouseover:h=>r.selection(i.time,!1)},d(i.name),43,le))),256))])])]))),256))])])])])):_("",!0),e.opened&&e.opened=="year"?(a(),c("section",re,[s("div",ie,[s("div",ae,[s("div",ce,[m(" Выберите год "),s("div",{onClick:t[7]||(t[7]=n=>e.opened=!0),class:"flr d-ib bth__btn bth__btn--28 bth__btn--blue bth__loader"},"назад")]),s("i",{onClick:t[8]||(t[8]=n=>e.opened=!1),class:"lsfw-form-control__close-square fas fa-times-circle"})]),s("div",de,[s("ul",fe,[(a(),c(u,null,p(72,(n,i)=>s("li",{onClick:h=>{r.updateCalendar(e.today.getFullYear()-i,0),e.opened=!0},class:D(["lsfw-form-control__year",{active:e.today.getFullYear()-i==e.currentYear}])},d(e.today.getFullYear()-i),11,_e)),64))])])])])):_("",!0)],64)}const me=y(v,[["render",he]]);window.lsfw||(window.lsfw={});window.form3Date=me;
