(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{445:function(t,e,r){"use strict";var n={name:"AnimateModuleWrapp",props:{animate:{type:Boolean,default:!0}},data:function(){return{visble:!1,out:!1}},beforeDestroy:function(){this.visble&&this.animate&&(this.visble=!1,this.out=!0)},methods:{animateIn:function(t){t&&this.animate&&(this.visble=!0)}}},o=(r(458),r(12)),component=Object(o.a)(n,(function(){var t=this;return(0,t._self._c)("section",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:{callback:t.animateIn,throttle:150},expression:"{\n\t\tcallback: animateIn,\n\t\tthrottle: 150,\n\t}"}],class:[{"animate-in":t.visble},{"animate-out":t.out},t.animate?"module-animated":"module-not-animated"]},[t._t("default")],2)}),[],!1,null,null,null);e.a=component.exports},454:function(t,e,r){var content=r(459);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(42).default)("42c1c562",content,!0,{sourceMap:!1})},458:function(t,e,r){"use strict";r(454)},459:function(t,e,r){var n=r(41)((function(i){return i[1]}));n.push([t.i,".module-animated{opacity:0}.module-animated.animate-in{animation:comeUpModule .35s cubic-bezier(.25,.25,.25,1.25) both}.module-animated.animate-out{animation:comeDownModule .35s cubic-bezier(.25,.25,.25,1.25) both}",""]),n.locals={},t.exports=n},497:function(t,e,r){var content=r(584);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(42).default)("29fcb202",content,!0,{sourceMap:!1})},583:function(t,e,r){"use strict";r(497)},584:function(t,e,r){var n=r(41)((function(i){return i[1]}));n.push([t.i,".search-wrapper{background-color:var(--colorLightBlue);padding-bottom:100px;padding-top:25px;position:relative}.search-wrapper .prelaoder-vrap{background:hsla(0,0%,95%,.54);bottom:0;left:0;margin:0;position:absolute;right:0;top:0}.search-posts-block{margin-top:80px}.search-posts-block:first-child{margin-top:0}.search-posts-block .search-type-title{margin-bottom:40px;margin-top:0}.search-posts-block .search-item{animation:comeUp .25s cubic-bezier(.25,.25,.25,1.25) both;animation-delay:var(--stagger-delay);border:2px solid var(--colorPrimary);display:block;margin-bottom:20px;opacity:0;padding:20px;position:relative}",""]),n.locals={},t.exports=n},637:function(t,e,r){"use strict";r.r(e);r(63),r(33),r(22);var n=r(10),o=r(2);function c(t){if(null==t)throw new TypeError("Cannot destructure "+t)}var l=r(1),d=(r(83),r(9),r(5),r(8),r(14),r(15),r(24),r(28)),h=r(17),f=r(270),m=r(457),v=r(68),y=r(451);function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){Object(o.a)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var P={name:"SearchPage",head:function(){return{title:this.t("Search on page"),bodyAttrs:{class:["search-page"]}}},components:{ArchiveFilters:m.a,WpLink:v.a,Preloader:f.a,PostHeader:y.a},transition:{beforeEnter:function(t){this.$store.dispatch("data/setCurrentPage")},beforeLeave:function(){this.$store.commit("data/SET_FRONT_PAGE",!1)}},mounted:function(){this.$store.commit("data/SET_FRONT_PAGE",!1),Object(d.i)(500)},asyncData:function(t){return Object(l.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c(t);case 1:case"end":return e.stop()}}),e)})))()},fetch:function(){var t=this;return Object(l.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t,e.prev=1,e.next=4,r.loadPosts();case 4:return e.abrupt("return",e.sent);case 7:e.prev=7,e.t0=e.catch(1),console.log("Error while getting archive posts",e.t0);case 10:case"end":return e.stop()}}),e,null,[[1,7]])})))()},data:function(){return{currentPageData:null,overrideSearchType:"",filters:{search:""},selectedTypes:[],loadedPosts:{},searchQuery:"",postsFound:-1,isLoading:!1,perPage:5,shortLimit:3,page:0}},watch:{filters:{handler:function(){var t=this;t.overrideSearchType="";try{return t.page=0,t.loadPosts()}catch(t){console.log("Error while getting search posts",t)}},deep:!0}},computed:{isSingleTypeSearch:function(){var t;return!(null===(t=this.filters)||void 0===t||!t.searchType)&&this.filters.searchType},searchTypes:function(){return this.isSingleTypeSearch?[this.filters.searchType]:["post","page","rwgps-poi","rwgps-routes"]},limitForQuery:function(){return this.isSingleTypeSearch?this.perPage:this.shortLimit},loadParams:function(){var t,e={limit:this.limitForQuery,type:this.searchTypes,offset:0,search:!0,fullData:!0,lang:this.$i18n.locale||"nb"};return null!==(t=this.filters)&&void 0!==t&&t.search&&(e.q=this.filters.search),e}},methods:w(w({},Object(h.b)({loadData:"data/loadData"})),{},{animationStagger:function(t){var e=0;return this.isSingleTypeSearch?this.loadedPosts[this.isSingleTypeSearch]&&(e=80*(t-(this.loadedPosts[this.isSingleTypeSearch].posts.length-this.perPage))):e=80*t,"--stagger-delay: ".concat(e,"ms")},loadMoreFrom:function(t){this.isSingleTypeSearch===t?this.loadPosts(!0):this.overrideSearchType=t},typeName:function(t){var e=this.t,r=e("Post");switch(t){case"page":r=e("Page");break;case"rwgps-poi":r=e("POI");break;case"rwgps-routes":r=e("Ride")}return r},loadPosts:function(){var t=arguments,e=this;return Object(l.a)(regeneratorRuntime.mark((function r(){var o,c,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=t.length>0&&void 0!==t[0]&&t[0],c=e,!e.isLoading){r.next=5;break}return r.abrupt("return");case 5:return e.isLoading=!0,l=e.loadParams,o&&e.isSingleTypeSearch&&(l.offset=e.loadedPosts[e.isSingleTypeSearch].posts.length),r.next=10,e.loadData(l).then((function(t){return t.posts&&!Array.isArray(t.posts)?(o&&e.isSingleTypeSearch?c.loadedPosts[e.isSingleTypeSearch].posts=[].concat(Object(n.a)(c.loadedPosts[e.isSingleTypeSearch].posts),Object(n.a)(t.posts[e.isSingleTypeSearch].posts)):c.loadedPosts=t.posts,c.postsFound=t.posts_found):(c.loadedPosts={},c.postsFound=0),c.isLoading=!1,t})).catch((function(t){c.isLoading=!1,console.warn("There was an error while loading the posts for archive block",t)}));case 10:return r.abrupt("return",r.sent);case 11:case"end":return r.stop()}}),r)})))()}})},_=P,k=(r(583),r(12)),component=Object(k.a)(_,(function(){var t=this,e=t._self._c;return e("main",{staticClass:"page search-page",attrs:{id:"main"}},[e("PostHeader",{attrs:{dark:"","custom-title":"Søk på Sykkelnorge.no"}}),t._v(" "),e("div",{staticClass:"search-content container-grid"},[e("div",{staticClass:"inner grid-col"},[e("ArchiveFilters",{staticClass:"narrow-inner m-t--xl m-b--md",attrs:{"search-type":t.overrideSearchType,"is-loading":t.isLoading,"search-loaded-data":t.loadedPosts,type:"search"},on:{change:function(e){return t.filters=e}}})],1)]),t._v(" "),e("div",{staticClass:"search-wrapper"},[e("div",{staticClass:"search-content container-grid"},[e("div",{staticClass:"inner grid-col"},[t.loadedPosts&&t.postsFound>0?e("div",{key:t.isSingleTypeSearch?"".concat(t.isSingleTypeSearch,"-wrap-search"):"all-wrap-search",staticClass:"loaded-posts-wrap"},t._l(t.loadedPosts,(function(r,n){return e("div",{key:n,staticClass:"search-posts-block",class:n},[r.posts&&r.posts.length?[e("h2",{staticClass:"search-type-title"},[t._v(t._s(t.typeName(n)))]),t._v(" "),t._l(r.posts,(function(r,n){return e("div",{key:r.id},[e("WpLink",{staticClass:"search-item micro-shadow block-hover",style:t.animationStagger(n),attrs:{title:r.title,url:r.link}},[t._v("\n\t\t\t\t\t\t\t\t\t"+t._s(r.title)+"\n\t\t\t\t\t\t\t\t")])],1)})),t._v(" "),e("div",{staticClass:"search-extra"},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(t.t("Showing %s1 of %s2 hits").replace("%s1",r.posts.length).replace("%s2",r.found))+".\n\t\t\t\t\t\t\t\t"),e("transition",{attrs:{name:"fade"}},[!t.isLoading&&r.posts.length<Number(r.found)?e("a",{staticClass:"search-from-type neet-hover neet-hover--bottom-top--underline",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.loadMoreFrom(n)}}},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.t("See more ..."))+"\n\t\t\t\t\t\t\t\t\t")]):t._e()])],1)]:t._e()],2)})),0):t.isLoading||0!==Number(t.postsFound)?t._e():e("div",{staticClass:"no-results"},[e("h2",{staticClass:"no-found-title m-o p-t--lg"},[t._v(t._s(t.t("Sorry nothing found")))])])]),t._v(" "),e("transition",{attrs:{name:"fade"}},[e("Preloader",{directives:[{name:"show",rawName:"v-show",value:t.isLoading,expression:"isLoading"}]})],1)],1)])],1)}),[],!1,null,null,null);e.default=component.exports}}]);