(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["home"],{1222:function(t,e,a){"use strict";a("6e05")},1276:function(t,e,a){"use strict";var s=a("d784"),n=a("44e7"),i=a("825a"),r=a("1d80"),o=a("4840"),c=a("8aa5"),l=a("50c4"),d=a("14c3"),u=a("9263"),m=a("9f7f"),p=m.UNSUPPORTED_Y,h=[].push,f=Math.min,_=4294967295;s("split",2,(function(t,e,a){var s;return s="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,a){var s=String(r(this)),i=void 0===a?_:a>>>0;if(0===i)return[];if(void 0===t)return[s];if(!n(t))return e.call(s,t,i);var o,c,l,d=[],m=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,f=new RegExp(t.source,m+"g");while(o=u.call(f,s)){if(c=f.lastIndex,c>p&&(d.push(s.slice(p,o.index)),o.length>1&&o.index=i))break;f.lastIndex===o.index&&f.lastIndex++}return p===s.length?!l&&f.test("")||d.push(""):d.push(s.slice(p)),d.length>i?d.slice(0,i):d}:"0".split(void 0,0).length?function(t,a){return void 0===t&&0===a?[]:e.call(this,t,a)}:e,[function(e,a){var n=r(this),i=void 0==e?void 0:e[t];return void 0!==i?i.call(e,n,a):s.call(String(n),e,a)},function(t,n){var r=a(s,t,this,n,s!==e);if(r.done)return r.value;var u=i(t),m=String(this),h=o(u,RegExp),v=u.unicode,g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(p?"g":"y"),w=new h(p?"^(?:"+u.source+")":u,g),b=void 0===n?_:n>>>0;if(0===b)return[];if(0===m.length)return null===d(w,m)?[m]:[];var C=0,y=0,x=[];while(y0?t._l(t.restaurants,(function(t){return a("RestaurantBox",{key:t.id,staticClass:"animate__animated",attrs:{restaurant:t}})})):t.restaurantsClosed.length>0?[a("RestaurantsEmpty",{staticClass:"animate__animated",attrs:{"no-active":""}})]:[a("RestaurantsEmpty",{staticClass:"animate__animated"})]],2)],1),a("div",{staticClass:"restaurants_container no_animation"},[a("sequential-entrance",{attrs:{animation:"animate__fadeInUp",tag:"div"}},t._l(t.restaurantsClosed,(function(t){return a("RestaurantBox",{key:t.id,staticClass:"animate__animated",attrs:{restaurant:t,closed:""}})})),1)],1),a("div",{staticClass:"flex-fill animate__animated"}),a("PlainFooter",{staticClass:"animate__animated"})],1),a("Drawer"),a("SearchAddress")],1)},n=[],i=a("5530"),r=(a("ac1f"),a("1276"),a("b0c0"),a("2f62")),o=a("2241"),c=a("042a"),l=a("6826"),d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",t._g({staticClass:"square-button",class:{"is-selected":t.selected}},t.$listeners),[a("img",{attrs:{src:t.$asset(t.image),alt:t.text}}),a("div",[a("span",[t._v(t._s(t.text))])])])},u=[],m={name:"SquareButton",props:{text:String,image:String,selected:Boolean}},p=m,h=(a("788e"),a("2877")),f=Object(h["a"])(p,d,u,!1,null,"3496a084",null),_=f.exports,v=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"restaurants--empty"},[a("h3",{staticClass:"restaurants--empty--header"},[t._v("Brak restauracji w pobliżu")]),t.noActive?a("p",{staticClass:"restaurants--empty--content"},[t._v("Brak dostępnych restauracji w podanym obszarze dostaw")]):a("p",{staticClass:"restaurants--empty--content"},[t._v("Wybrany adres znajduje się poza obszarem dostaw")])])},g=[],w={name:"RestaurantsEmpty",props:{noActive:Boolean}},b=w,C=(a("bdc6"),Object(h["a"])(b,v,g,!1,null,"f3a81e0a",null)),y=C.exports,x=a("28ca"),k=a("f5dd"),S=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"restaurant_box",on:{click:t.goToRestaurant}},[a("div",{staticClass:"image_main"},[t.restaurant.image_main?a("img",{attrs:{src:t.$asset(t.restaurant.image_main.path),alt:t.restaurant.name}}):t._e()]),a("div",{staticClass:"image_logo"},[t.restaurant.image_logo?a("img",{attrs:{src:t.$asset(t.restaurant.image_logo.path),alt:"Logo "+t.restaurant.name}}):t._e()]),a("div",{staticClass:"restaurant_box_content"},[a("div",{staticClass:"title_line"},[a("span",{staticClass:"title"},[t._v(t._s(t.restaurant.name))]),t.restaurant.rate>0?a("div",{staticClass:"elem",attrs:{title:"Ocena restauracji"}},[t._m(0),a("div",{staticClass:"content"},[t._v(" "+t._s((Math.round(10*t.restaurant.rate)/10).toFixed(1))+" "),t.restaurant.number_opinions>0?a("span",[t._v("("+t._s(t.restaurant.number_opinions)+")")]):t._e()])]):t._e()]),a("p",{staticClass:"restaurant_description"},[t._v(" "+t._s(t.restaurant.description)+" ")])]),t.closed?a("div",{staticClass:"closed_container"},[a("div",{staticClass:"closed_text"},[t._v(t._s("Nieczynne"===t.restaurant.today_open||null===t.restaurant.today_open?"Dzisiaj nieczynne":"Dzisiaj otwarte: "+t.restaurant.today_open))])]):t._e(),t.closed||0!==t.restaurant.active_deliveries?t._e():a("div",{staticClass:"closed_container"},[a("div",{staticClass:"closed_text"},[t._v("Dostawy wstrzymane")])])])},$=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"icon"},[s("img",{attrs:{src:a("f5b2"),alt:"Like"}})])}],j={name:"RestaurantBox",props:{restaurant:Object,closed:Boolean},methods:{goToRestaurant:function(){this.$router.push({name:"Restaurant",params:{id:this.restaurant.id}})}}},z=j,F=(a("2bba"),Object(h["a"])(z,S,$,!1,null,"6f288c25",null)),D=F.exports,E=a("2f89"),O={name:"Home",components:{DownloadFromStore:E["a"],RestaurantBox:D,SearchAddress:k["a"],Drawer:x["a"],RestaurantsEmpty:y,SquareButton:_,Logo:o["a"],StickyHeader:c["a"],PlainFooter:l["a"]},computed:Object(i["a"])(Object(i["a"])({},Object(r["b"])(["types","selectedType","restaurants","restaurantsClosed","isLogged","user"])),{},{greetings:function(){if(this.isLogged){var t=this.user.name.split(" ")[0];return"Cześć, ".concat(t,"!")}return"Cześć"}}),data:function(){return{showShadow:!1}},methods:{onScroll:function(t){window.document.scrollingElement.scrollTop>=120?!1===this.showShadow&&(this.showShadow=!0):!0===this.showShadow&&(this.showShadow=!1)}},created:function(){},mounted:function(){window.addEventListener("scroll",this.onScroll)},beforeDestroy:function(){window.removeEventListener("scroll",this.onScroll)}},T=O,A=(a("1668"),Object(h["a"])(T,s,n,!1,null,"dc5d0d3c",null));e["default"]=A.exports},bdc6:function(t,e,a){"use strict";a("9630")},ef4b:function(t,e,a){},f5b2:function(t,e,a){t.exports=a.p+"img/like-new.4c890005.svg"},f5dd:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("transition",{attrs:{name:"slide-fade-in"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.showSearchAddress,expression:"showSearchAddress"}],staticClass:"search-address-outer",on:{click:function(e){return e.target!==e.currentTarget?null:t.$store.commit("setShowSearchAddress",!1)}}},[a("div",{staticClass:"search-address"},[a("TextField",{attrs:{name:"street",label:"Ulica",placeholder:"Ulica",required:""},on:{input:t.validateFormTick},model:{value:t.form,callback:function(e){t.form=e},expression:"form"}}),a("TextField",{attrs:{name:"house_nr",label:"Numer budynku",placeholder:"Numer budynku",required:"","max-length":10},on:{input:t.validateFormTick},model:{value:t.form,callback:function(e){t.form=e},expression:"form"}}),a("TextField",{attrs:{name:"apartment_nr",label:"Numer mieszkania","max-length":6,placeholder:"Numer mieszkania (opcjonalne)"},model:{value:t.form,callback:function(e){t.form=e},expression:"form"}}),a("TextField",{directives:[{name:"mask",rawName:"v-mask",value:"##-###",expression:"'##-###'"}],attrs:{name:"postcode",label:"Kod pocztowy",placeholder:"Kod pocztowy",required:""},on:{input:t.validateFormTick},model:{value:t.form,callback:function(e){t.form=e},expression:"form"}}),a("TextField",{attrs:{name:"city",label:"Miasto",placeholder:"Miasto",required:""},on:{input:t.validateFormTick},model:{value:t.form,callback:function(e){t.form=e},expression:"form"}}),a("Btn",{attrs:{disabled:!t.formIsValid},on:{click:t.saveAddress}},[t._v("Zapisz")]),a("p",{staticStyle:{"text-align":"left","font-size":"13px"}},[a("span",{staticClass:"required-star"},[t._v("*")]),t._v(" Pole wymagane")])],1)])])},n=[],i=a("5530"),r=a("2f62"),o=a("fead"),c=a("dedc"),l=a("b6d0"),d={name:"SearchAddress",directives:{mask:l["a"]},components:{Btn:c["a"],TextField:o["a"]},data:function(){return{form:{street:"",house_nr:"",apartment_nr:"",postcode:"",city:""},formIsValid:!1}},computed:Object(i["a"])({},Object(r["b"])(["showSearchAddress","address"])),watch:{address:{handler:function(t){this.$set(this,"form",{street:t.street,house_nr:t.house_nr,apartment_nr:t.apartment_nr,postcode:t.postcode,city:t.city}),this.validateFormTick()},immediate:!0,deep:!0}},methods:{validateFormTick:function(){var t=this;this.$nextTick((function(){t.validateForm()}))},validateForm:function(){var t=!0;return this.form.street||(t=!1),this.form.house_nr||(t=!1),this.form.city||(t=!1),this.form.postcode||(t=!1),this.formIsValid=t,t},saveAddress:function(){var t=this;this.validateForm()&&(this.$store.dispatch("getAddressByAddress",{form:{address:this.form}}).then((function(e){var a=e.statusCode,s=e.message,n=void 0===s?"":s;400===a&&("not_found"===n?t.$toast.error("Nie znaleźliśmy podanego adresu.
Popraw adres i spróbuj ponownie"):"not_found_city"===n?t.$toast.error("Nie znaleźliśmy miasta.
Popraw adres i spróbuj ponownie"):"not_found_house_nr"===n?t.$toast.error("Nie znaleźliśmy numeru ulicy.
Popraw adres i spróbuj ponownie"):"not_found_city_id"===n?t.$toast.error("Niestety nie jesteśmy jeszcze dostępni w wybranym mieście"):t.$toast.error(n))})),this.$store.commit("setShowSearchAddress",!1))}}},u=d,m=(a("452d"),a("2877")),p=Object(m["a"])(u,s,n,!1,null,"041cd273",null);e["a"]=p.exports},f960:function(t,e,a){t.exports=a.p+"img/1024.f1b97249.png"}}]); //# sourceMappingURL=home.614b52e1.js.map