1import{_ as F,e as f,c as h,o as n,b as s,a as _,w as c,t as r,v as d,n as p,F as g,r as y,g as b,d as v,D as x,l as B,T as E,k as M,j as W,i as V,p as k}from"./index-DNv8jj1O.js";import{h as D,i as A,_ as S}from"./app-DUAsKxzO.js";import{I as L}from"./Items-Di0s7GWC.js";import{B as N}from"./BelarusHouseCard-B_utGebT.js";import{_ as P}from"./sort-B2svTexw.js";import{_ as G}from"./info-ZLzv0oOL.js";import"./check-DAYf0oA9.js";import"./check_black-MBtnOAfc.js";const I="/build/assets/iphone-B0Bdo7Yl.png",T="/build/assets/check_green-Dbl8kaxX.svg",J="/build/assets/heart_gradient-DwfVjcuo.png",R={shadowRoot:!1,components:{Switch:A,SocialShare:D,Items:L,BelarusHouseCard:N},beforeMount(){this.page_items&&(this.page_length=Number(this.page_items)),this.syncBelarusFavorites(),this.housesOnly||this.syncWithGlobal(),this.i=this.readJson("favorites-page-i18n",{}),this.sort_items=this.readJson("favorites-page-sort",[]),this.switchData.items.FirstPerson.name=this.i.first_person,this.switchData.items.Total.name=this.i.total},mounted(){if(this.isAuthenticated=!!window.__isAuthenticated,window.addEventListener("belarus-favorites-changed",this.syncBelarusFavorites),this.housesOnly)return;window.__isAuthenticated&&(window.FavoritesManager.loadFromDb(),this.showWishList=!0),this.wishlistLink=this.wishlist_link,this.syncWithGlobal(),window.addEventListener("favorites-changed",this.syncWithGlobal),window.addEventListener("storage",this.syncWithGlobal);const i=[],t=Date.now()-24*60*60*1e3;this.favorites.forEach(l=>{l.updatedAt<=t&&l.startDate>Math.floor(Date.now()/1e3)&&i.push(l.url)}),i.length&&this.updateFavorites(i)},unmounted(){window.removeEventListener("favorites-changed",this.syncWithGlobal),window.removeEventListener("storage",this.syncWithGlobal),window.removeEventListener("belarus-favorites-changed",this.syncBelarusFavorites)},data(){return{i:{},h1:"",isAuthenticated:!1,favorites:[],houses:[],tab:this.houses_only?"houses":"tours",tabTouched:!1,countFavorites:0,offersShow:!0,loader:!1,errorNote:!1,showMoreBtn:!1,showWishList:!1,switchData:{items:{FirstPerson:{id:"price_switch_1",name:null,type:"FirstPerson",active:!0},Total:{id:"price_switch_2",name:null,type:"Total",active:!1}},currentValue:"FirstPerson"},isSortShow:!1,sort_value:"price_low",sort_items:[],wishlist_loading:!1,wishlistLink:!1}},computed:{browseUrl(){return this.browse_url||"/"},isToursTab(){return this.tab==="tours"},housesOnly(){return!!this.houses_only},showTabs(){return this.housesOnly?!1:!!this.houses_url||this.favorites.length>0&&this.houses.length>0},activeCount(){return this.isToursTab?this.countFavorites:this.houses.length},activeCountLabel(){return this.isToursTab?this.title_count:this.plural(this.houses.length,["ÑÑадÑба","ÑÑадÑбÑ","ÑÑадеб"])}},methods:{syncBelarusFavorites(){var i;this.houses=this.houses_url?[]:((i=window.BelarusFavoritesManager)==null?void 0:i.get())??[],this.ensureTab()},readJson(i,t){const l=document.getElementById(i);return l?JSON.parse(l.textContent):t},removeHouse(i){var t;(t=window.BelarusFavoritesManager)==null||t.remove(i.url)},ensureTab(){if(!this.housesOnly){if(!this.tabTouched){this.tab=this.favorites.length||!this.houses.length?"tours":"houses";return}this.isToursTab&&!this.favorites.length&&this.houses.length?this.tab="houses":!this.isToursTab&&!this.houses.length&&this.favorites.length&&(this.tab="tours")}},setTab(i){this.tab=i,this.tabTouched=!0},plural(i,t){const l=Math.abs(i)%100,u=l%10;return l>10&&l<20?t[2]:u>1&&u<5?t[1]:u===1?t[0]:t[2]},syncWithGlobal(){var t;const i=((t=window.FavoritesManager)==null?void 0:t.get())??[];if(this.sort_value)switch(this.sort_value){case"price_low":this.favorites=i.sort((l,u)=>(l.firstPersonPrice??l.totalPrice)-(u.firstPersonPrice??u.totalPrice));break;case"date":this.favorites=i.sort((l,u)=>l.startDate-u.startDate);break;default:this.favorites=i}this.countFavorites=this.favorites.length,this.ensureTab()},clearFavorites(){window.FavoritesManager.clearAll(),this.syncWithGlobal()},updateFavorites(i){var t;this.loader=!0,this.offersShow=!1,axios.post("/api/favorites-update",{favorites:i},{headers:{"Accept-Language":(t=document==null?void 0:document.documentElement)!=null&&t.lang?document.documentElement.lang:"ru"}}
1).then(l=>{l!=null&&l.data&&(window.FavoritesManager.update(l==null?void 0:l.data),this.syncWithGlobal(),this.loader=!1,this.offersShow=!0)})},toggleSwitch(i){this.$refs.itemsRef.setPriceType(i),this.switchData.currentValue=i},setSort(i){i!=null&&i.value&&(this.sort_value=i==null?void 0:i.value,this.isSortShow=!1,this.syncWithGlobal())},getSortLabel(){let i="";return this.sort_items.forEach(t=>{t.value===this.sort_value&&(i=t.short_title)}),i},openLogin(){window.openAuthModal("login")},openRegister(){window.openAuthModal("registration")},async toggleShare(){this.wishlist_loading=!0;try{const{data:i}=await axios.post("/api/favorites/share/toggle");this.wishlistLink=i.url||null}finally{this.wishlist_loading=!1}}},props:{h1:String,title_count:String,wishlist_link:String,browse_url:String,houses_only:String,houses_url:String}},H={class:"b-titleWrap b-offersSearch__sort_container"},U={class:"b-h2"},j={key:0,class:"b-favoritesTabs"},z={class:"b-SOTags"},X=["href"],Y={class:"b-filterTags_container"},q={class:"b-filterTags__sort b-filterTags__sort--favorites"},K={class:"b-titleWrap_desc"},Q={class:"b-offersSearch__sort_modal"},Z=["onClick"],$={key:1,class:"b-offersListWrap"},tt={key:0,class:"b-offersListWrap__filter"},st={class:"b-filter b-filter_favorites"},et={class:"b-filter__item"},it={class:"b-filter__title"},ot={class:"b-filter__price"},rt={class:"b-filter__item"},lt={class:"b-filter__title b-filter__title--favorites"},nt={class:"b-filter__item_content"},at={class:"b-filter__item_favorite_bar"},ht={key:0,class:"b-filter__item"},_t={key:0,class:"b-offers__loader"},ut={class:"b-filter__title"},ct={key:0,class:"b-filter__item_favorite_btns"},dt={class:"b-filter__price"},ft={key:1},bt={class:"b-filter__price"},vt={key:0,class:"b-filter"},gt={class:"b-filter_favorites"},wt={class:"b-filter_favorites--title"},mt={class:"b-filter_favorites--desc"},pt={class:"b-filter_favorites_block"},yt={class:"b-filter_favorites_block_text"},kt={class:"b-filter_favorites_block_text_item"},St={class:"b-filter_favorites_block_text_item"},Tt={id:"search-container",class:"b-offersListWrap__list"},Ft={key:0},Lt={key:0,class:"b-filter__loader"},Ct={key:1,class:"b-filter__error"},Ot={key:2,class:"b-filter__more_btn"},xt={key:1,class:"b-belarusOffers__grid"},Bt={key:2,class:"b-favoritesEmpty"},Et={class:"b-favoritesEmpty__title"},Mt={class:"b-favoritesEmpty__desc"},Wt=["href"],Vt={key:0,class:"b-favoritesEmpty__devices"},Dt={key:1,class:"b-favoritesEmpty__account"};function At(i,t,l,u,e,o){const w=f("Switch"),m=f("SocialShare"),C=f("Items"),O=f("BelarusHouseCard");return n(),h(g,null,[s("div",H,[s("h1",U,r(l.h1),1),c(s("div",{class:"b-tag"},r(o.activeCount)+" "+r(o.activeCountLabel),513),[[d,o.activeCount]])]),o.showTabs?(n(),h("div",j,[s("div",z,[s("button",{type:"button",class:p(["b-SOTags__tag",{"b-SOTags__tag--active":o.isToursTab}]),onClick:t[0]||(t[0]=a=>o.setTab("tours"))},"ТÑÑÑ",2),l.houses_url?(n(),h("a",{key:0,href:l.houses_url,class:"b-SOTags__tag"},"УÑадÑбÑ",8,X)):(n(),h("button",{key:1,type:"button",class:p(["b-SOTags__tag",{"b-SOTags__tag--active":!o.isToursTab}]),onClick:t[1]||(t[1]=a=>o.setTab("houses"))},"УÑадÑбÑ",2))])])):_("",!0),s("div",Y,[s("div",q,[s("div",K,r(o.housesOnly?"СÑавниÑе ваÑианÑÑ Ð¸ вÑбеÑиÑе, где оÑдоÑ
нÑÑÑ.":e.i.favorites_desc),1),c(s("div",{class:p(["b-btn b-btn--rect b-btn--gray b-btn__info b-btn--sort",{active:e.isSortShow}]),onClick:t[2]||(t[2]=a=>e.isSortShow=!e.isSortShow)},[s("span",null,r(o.getSortLabel()),1),t[11]||(t[11]=s("img",{src:P,alt:"filters form",width:"24",height:"24"},null,-1))],2),[[d,o.isToursTab&&e.favorites.length]]),c(s("div",Q,[(n(!0),h(g,null,y(e.sort_items,a=>(n(),h("span",{class:"b-offersSearch__sort_modal--item",onClick:zt=>o.setSort(a)},r(a.title),9,Z))),256))],512),[[d,e.isSortShow&&o.isToursTab&&e.favorites.length]])])]),e.favorites.length||e.houses.length?(n(),h("div",$,[o.isToursTab?(n(),h("div",tt,[s("div",st,[s("div",et,[s("div",it,r(e.i.price_title),1),s("div",ot,[b(w,{modelValue:e.switchData,"onUpdate:modelValue":t[3]||(t[3]=a=>e.switchData=a),onToggleSwitch:o.toggleSwitch},null,8,["modelValue","onToggleSwitch"])])]),s("div",rt,[s("div",lt,[v(r(e.i.holidays_saved)+" ",1),s("span",null,r(e.countFavorites)+" "+r(e.i.of)+" 25",1)]),s("div",nt,[s("div",at,[s("span",{style:x({width:e.countFavorites/25*100+"%"})},null,4)]),s("button",{type:"button",class:"b-btn b-btn--medium b-btn--grey",onClick:t[4]||(t[4]=(...a)=>o.clearFavorites&&o.clearFavorites(...a))},r(e.i.clear_all),1)])]),e.showWishList?(n(),h("div",ht,[b(E,{name:"b-loader-fade"},{default:B(()=>[e.wishlist_loading?(n(),h("div",_t,t[12]||(t[12]=[s("img",{src:S,width:"32",height:"32",class:"b-offers__loader--img",alt:"loader"},null,-1)]))):_("",!0)]),_:1}),s("div",ut,r(e.i.wishlist_title),1),e.wishlistLink?(n(),h("div",ct,[b(m,{url:e.wishlistLink,"trigger-class":"b
1-btn b-btn--medium b-btn--grey"},null,8,["url"]),s("div",dt,[s("button",{type:"button",class:"b-btn b-btn--medium b-btn--grey",onClick:t[5]||(t[5]=(...a)=>o.toggleShare&&o.toggleShare(...a)),style:{width:"fit-content"}},r(e.i.wishlist_btn_off),1)])])):(n(),h("div",ft,[s("div",bt,[s("button",{type:"button",class:"b-btn b-btn--medium b-btn--grey",onClick:t[6]||(t[6]=(...a)=>o.toggleShare&&o.toggleShare(...a)),style:{width:"fit-content"}},[t[13]||(t[13]=s("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s("path",{d:"M20 13V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V13",stroke:"#525252","stroke-width":"1.5","stroke-linecap":"round"}),s("path",{d:"M12 14V4",stroke:"#525252","stroke-width":"1.5","stroke-linecap":"round"}),s("path",{d:"M7 9L12 4L17 9",stroke:"#525252","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),v(" "+r(e.i.wishlist_btn),1)])])]))])):_("",!0)]),e.isAuthenticated?_("",!0):(n(),h("div",vt,[s("div",gt,[s("div",null,[s("div",wt,r(e.i.favorites_block_title),1),s("div",mt,r(e.i.favorites_block_desc),1)]),s("div",pt,[t[16]||(t[16]=s("div",{class:"b-filter_favorites_block_img"},[s("img",{src:I,alt:"favorites mockup",width:"122",height:"113"})],-1)),s("div",yt,[s("div",kt,[t[14]||(t[14]=s("img",{src:T},null,-1)),s("span",null,r(e.i.favorites_block_text1),1)]),s("div",St,[t[15]||(t[15]=s("img",{src:T},null,-1)),s("span",null,r(e.i.favorites_block_text2),1)])])]),s("button",{class:"b-btn b-btn--big b-btn--center b-offersItem__mainbtn",onClick:t[7]||(t[7]=(...a)=>o.openLogin&&o.openLogin(...a))},r(e.i.favorites_login),1)])]))])):_("",!0),s("div",Tt,[o.housesOnly?_("",!0):c((n(),h("div",Ft,[c(s("div",null,[b(C,{modelValue:e.favorites,"onUpdate:modelValue":t[8]||(t[8]=a=>e.favorites=a),isFavoritesType:!0,i18n:JSON.stringify(e.i),ref:"itemsRef"},null,8,["modelValue","i18n"])],512),[[d,e.offersShow]]),e.loader?(n(),h("div",Lt,t[17]||(t[17]=[s("img",{src:S,width:"120",height:"120",class:"w-os-from__loader",alt:"loader search"},null,-1)]))):_("",!0),e.errorNote?(n(),h("div",Ct,[t[18]||(t[18]=s("img",{src:G,alt:"error search"},null,-1)),v(r(e.i.errorNote),1)])):_("",!0),e.showMoreBtn?(n(),h("div",Ot,[s("span",{class:"b-btn b-btn--alt b-btn--big",onClick:t[9]||(t[9]=(...a)=>i.showMoreOffers&&i.showMoreOffers(...a))},r(e.i.more_items),1)])):_("",!0)],512)),[[d,o.isToursTab]]),o.isToursTab?_("",!0):(n(),h("div",xt,[(n(!0),h(g,null,y(e.houses,a=>(n(),M(O,{key:a.url,item:a,"is-favorite":!0,onToggleFavorite:o.removeHouse},null,8,["item","onToggleFavorite"]))),128))]))])])):(n(),h("div",Bt,[t[20]||(t[20]=s("img",{src:J,class:"b-favoritesEmpty__icon",width:"151",height:"127",alt:""},null,-1)),s("div",Et,r(o.housesOnly?"ÐдеÑÑ Ð¿Ð¾ÑвÑÑÑÑ ÑÑадÑбÑ, коÑоÑÑе вам понÑавилиÑÑ":e.i.empty_title),1),s("div",Mt,r(o.housesOnly?"ÐажмиÑе на ÑеÑдеÑко на каÑÑоÑке ÑÑадÑÐ±Ñ â ÑпиÑок ÑоÑ
ÑаниÑÑÑ Ð² ÑÑом бÑаÑзеÑе.":e.i.empty_desc),1),s("a",{href:o.browseUrl,class:"b-btn b-btn--big b-favoritesEmpty__btn"},r(o.housesOnly?"СмоÑÑеÑÑ ÑÑадÑбÑ":e.i.empty_browse),9,Wt),!e.isAuthenticated&&!o.housesOnly?(n(),h("div",Vt,t[19]||(t[19]=[W('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3.75" y="4.75" width="16.5" height="12.5" rx="2.25" stroke="#525252" stroke-width="1.5"></rect><path d="M2 20.25H22" stroke="#525252" stroke-width="1.5" stroke-linecap="round"></path></svg><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="18.25" y="3.75" width="16.5" height="11.5" rx="3.25" transform="rotate(90 18.25 3.75)" stroke="#525252" stroke-width="1.5"></rect><rect x="12" y="6" width="1" height="1" fill="#525252"></rect></svg>',2)]))):_("",!0),!e.isAuthenticated&&!o.housesOnly?(n(),h("div",Dt,[s("a",{href:"#",onClick:t[10]||(t[10]=V((...a)=>o.openRegister&&o.openRegister(...a),["prevent"]))},r(e.i.empty_account_link),1),v(" "+r(e.i.empty_account),1)])):_("",!0)]))],64)}const Nt=F(R,[["render",At]]),Pt={shadowRoot:!1,components:{Items:L},props:{h1:String,title_count:String},data(){return{i:{},h1:"",favorites:[]}},beforeMount(){this.i=JSON.parse(document.getElementById("favorites-public-i18n").textContent);const i=JSON.parse(document.getElementById("favorites-public-tours").textContent);this.favorites=i},mounted(){window.__isAuthenticated&&window.FavoritesManager.loadFromDb()}},Gt={class:"b-titleWrap b-offersSearch__sort_container"},It={class:"b-h2"},Jt={class:"b-offersListWrap"},Rt={class:"b-offersListWrap__list"},Ht={key:0};function Ut(i,t,l,u,e,o){const w=f("Items");return n(),h(g,null,[s("div",Gt,[s("h1",It,r(e.i.share_title),1),c(s("div",{class:"b-tag"},r(e.favorites.length)+" "+r(l.title_count),513),[[d,e.favorites.length]])]),s("div",Jt,[s("div",Rt,[e.favorites.length?_("",!0):(n(),h("div",Ht,[s("p",null,r(e.i.empty_favorites),1)])),c(s("div",null,[b(w,{modelValue:e.favorites,"onUpdate:modelValue":t[0]||(t[0]=m=>e.favorites=m),isFavoritesType:!0,i18n:JSON.stringify(e.i),ref:"itemsRef"},null,8,["modelValue","i18n"])],512),[[d,e.favorites.length]])])])],64)}const jt=F(Pt,[["render",Ut]]);customElements.define("favorites-page",k(Nt)),customElements.define("favorites-public",k(jt));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.