(window.webpackJsonp=window.webpackJsonp||[]).push([[170],{1488:function(e,t,r){var content=r(1882);"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,r(26).default)("2cb6ee49",content,!0,{sourceMap:!1})},1881:function(e,t,r){"use strict";var o=r(1488);r.n(o).a},1882:function(e,t,r){(t=r(25)(!1)).push([e.i,".view-tools[data-v-bbdec84e]{background-color:#f5f7fa}.deals-filters-buttons-button[data-v-bbdec84e]{border:1px solid #ced0d5;color:#1f2430}.deals-filters-buttons-active_button[data-v-bbdec84e],.deals-filters-buttons-button[data-v-bbdec84e]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;margin-right:1rem;margin-bottom:1rem;padding:1rem;font-size:.9rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.deals-filters-buttons-active_button[data-v-bbdec84e]{border:1px solid #4440db;background-color:#4440db;color:#fff}",""]),e.exports=t},2275:function(e,t,r){"use strict";r.r(t);r(9),r(6),r(5),r(3),r(8),r(166),r(61),r(79);var o=r(0),n=(r(20),r(4)),c=r(818),l=r(1741),meta=r(78),h=r(810),d=r(21),f=r.n(d),m=r(813),v=r.n(m),y=r(815),C=r.n(y);function w(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}function O(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?w(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):w(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var _={name:"PageTools",components:{ToolsPageContent:l.a,SearchBar:c.a},head:function(){return Object(meta.a)({title:"Curated Deals for Startups",description:"Exclusive offers and free trials on amazing products for The Hub community members.",path:this.$route.path,imageUrl:"https://thehub.io/images/thehub_2023_tools.png"})},data:function(){var e=this.$store.getters["meta/sitePreferredCountryCode"],t=f()(this.$route,"query.categories")||[];return{searchForm:{search:f()(this.$route,"query.search"),countryCode:f()(this.$route,"query.countryCode",e)},filters:{countryCode:f()(this.$route,"query.countryCode",e),search:f()(this.$route,"query.search"),categories:f()(this.$route,"query.categories")},activeCategories:t&&Array.isArray(t)?t:[t]}},computed:{params:function(){var e=v()(C()(this.filters),h.c);return this.page>=2&&(e.page=this.page),e},tools:function(){return this.$store.state.tools.tools},toolCategories:function(){return this.$store.getters["meta/toolCategories"]}},watch:{"searchForm.countryCode":function(e,t){e!==t&&(this.filters.countryCode=this.searchForm.countryCode,this.$store.dispatch("meta/setPreferredCountryCode",this.filters.countryCode))},activeCategories:{deep:!0,handler:function(){this.page=1,this.doSearch()}},filters:{deep:!0,handler:function(){this.page=1,this.doSearch()}}},asyncData:function(e){return Object(n.a)(regeneratorRuntime.mark((function t(){var r,o,n,c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.query,o=e.store,n=e.error,t.prev=1,c=O({},r),l=o.getters["meta/sitePreferredCountryCode"],c.countryCode||(c.countryCode=[l]),t.next=7,o.dispatch("tools/find",c);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),n(t.t0);case 12:case"end":return t.stop()}}),t,null,[[1,9]])})))()},mounted:function(){this.$router.push({path:"/deals"})},methods:{clickToCategory:function(e){this.activeCategories.includes(e)?this.activeCategories=this.activeCategories.filter((function(t){return t!==e})):this.activeCategories.push(e),this.filters.categories=this.activeCategories},clickToAll:function(){this.activeCategories&&0===this.activeCategories.length||(this.activeCategories=[],this.filters.categories=this.activeCategories)},onSearchBarSubmit:function(){this.filters.search=this.searchForm.search,this.filters.countryCode=this.searchForm.countryCode,this.filters.categories=this.activeCategories,this.doSearch()},doSearch:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("tools/find",e.params);case 2:e.$router.push({query:e.params});case 3:case"end":return t.stop()}}),t)})))()}}},k=(r(1881),r(10)),component=Object(k.a)(_,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"view-tools"},[r("b-container",[r("b-row",[r("b-col",{staticStyle:{"padding-bottom":"1rem","margin-top":"2.5rem"}},[r("SearchBar",{attrs:{"search-placeholder":"Search deals by name or keyword","light-shadow":"","full-country-names":"","disable-address-search":"","on-submit":e.onSearchBarSubmit},model:{value:e.searchForm,callback:function(t){e.searchForm=t},expression:"searchForm"}})],1)],1),e._v(" "),r("b-row",{staticStyle:{display:"flex",margin:"0rem 0rem 2rem 0rem"}},[r("div",{class:e.activeCategories&&0===e.activeCategories.length?"deals-filters-buttons-active_button":"deals-filters-buttons-button",on:{click:function(t){return e.clickToAll()}}},[e._v("\n All\n ")]),e._v(" "),e._l(this.toolCategories,(function(t){return r("div",{key:t._id},[r("div",{class:e.activeCategories.includes(t._id)?"deals-filters-buttons-active_button":"deals-filters-buttons-button",on:{click:function(r){return e.clickToCategory(t._id)}}},[e._v("\n "+e._s(t.title)+"\n ")])])}))],2),e._v(" "),r("b-row",{staticClass:"pb-60"},[r("div",{staticStyle:{"margin-left":"1rem","margin-right":"1rem"}},[r("h2",[e._v("Curated deals for the startups")]),e._v(" "),r("p",[e._v("\n Exclusive offers on amazing products for The Hub community members\n ")])])]),e._v(" "),r("b-row",{staticClass:"pb-60"},[r("ToolsPageContent",{attrs:{tools:e.tools}})],1)],1)],1)}),[],!1,null,"bbdec84e",null);t.default=component.exports}}]); //# sourceMappingURL=c661477241c41a29c4dd.js.map