(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4c1df756"],{"0654":function(t,e,a){"use strict";a("f576")},"0782":function(t,e,a){"use strict";a("d8dd")},1799:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.totalPages>1?a("div",{staticClass:"custom-pagination"},[a("div",{staticClass:"custom-pagination-btn custom-pagination-left-btn",on:{click:function(e){return t.updatePage(t.page-1)}}},[t._v(" << ")]),t._l(t.totalPages,(function(e){return a("div",{key:e,class:["custom-pagination-item",{active:t.page===e}],on:{click:function(a){return t.updatePage(e)}}},[t._v(" "+t._s(e)+" ")])})),a("div",{staticClass:"custom-pagination-btn custom-pagination-right-btn",on:{click:function(e){return t.updatePage(t.page+1)}}},[t._v(" >> ")])],2):t._e()},r=[],i=(a("a9e3"),{model:{prop:"page",event:"updatePage"},props:{page:{type:Number,default:1},totalResults:{default:0,type:Number},perPageLimit:{default:9,type:Number}},methods:{updatePage:function(t){t>0&&t<=this.totalPages&&(console.log(t,this.totalPages),this.$emit("updatePage",t))}},computed:{totalPages:function(){return Math.ceil(this.totalResults/this.perPageLimit)}}}),c=i,n=(a("0654"),a("2877")),o=Object(n["a"])(c,s,r,!1,null,"89f37bf0",null);e["a"]=o.exports},"2afe":function(t,e,a){"use strict";a("54ff")},"2e0b":function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.product?a("div",{staticClass:"col-sm-4 my-3 p-2"},[a("div",{staticClass:"surplus-product-container d-flex flex-column justify-content-between"},[a("div",{},[a("div",[t.product.image?a("ImageItem",{staticClass:"surplus-product-image img-fluid",attrs:{src:t.imgsrc+t.product.image}}):a("ImageItem",{staticClass:"surplus-product-image",attrs:{src:t.process&&t.process.env.VUE_APP_FALLBACK_IMAGE_SRC}})],1),a("div",{staticClass:"p-2"},[a("div",{staticClass:"mb-1"},[a("span",{staticClass:"badge badge-danger"},[t._v("Sale")]),t.product.verified?a("span",{staticClass:"mx-2 badge badge-success"},[t._v("Verified")]):t._e()]),t.product.category.name.length<20?a("div",{staticClass:"surplus-category-name"},[t._v(" "+t._s(t.product.category.name)+" ")]):t._e(),t.product.category.name.length>=20?a("div",{staticClass:"surplus-category-name"},[t._v(" "+t._s(t.product.category.name.substring(0,20)+"..")+" ")]):t._e(),t.product.title.length<18?a("div",{staticClass:"surplus-product-name"},[t._v(" "+t._s(t.product.title)+" ")]):t._e(),t.product.title.length>=18?a("div",{staticClass:"surplus-product-name"},[t._v(" "+t._s(t.product.title.substring(0,18)+"..")+" ")]):t._e()])]),a("div",[a("div",{staticClass:"d-flex justify-content-between align-items-center px-2 border-top"},[t._m(0),a("div",{staticClass:"surplus-product-qty"},[a("span",[t._v("Qnty: "+t._s(t.product.quenty))])])]),a("div",{staticClass:"text-center"},[a("router-link",{staticClass:"product-detail-link",attrs:{to:{name:"single-product",params:{id:t.product.id}}}},[t._v("PRODUCT DETAILS")])],1),t.myProducts?a("div",{staticClass:"text-center"}):t._e(),t.myProducts?a("div",{staticClass:"text-center"},[a("a",{staticClass:"product-detail-link bg-danger text-white",attrs:{href:"javascript:void(0)"},on:{click:function(e){return t.deleteSurplusItem()}}},[t._v(" Delete Surplus Item ")])]):t._e()])])]):t._e()},r=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{},[a("div",{staticClass:"vacancies_box_rating py-2"},[a("i",{staticClass:"fa fa-star"}),a("i",{staticClass:"fa fa-star"}),a("i",{staticClass:"fa fa-star"}),a("i",{staticClass:"fa fa-star",staticStyle:{color:"#c1c1c1"}}),a("i",{staticClass:"fa fa-star",staticStyle:{color:"#c1c1c1"}})])])}],i=(a("96cf"),a("1da1")),c=a("bc3a"),n=a.n(c),o=a("df9f"),u=a("97af"),l={emits:["remove"],props:{product:{type:Object,default:function(){return null}},myProducts:{type:Boolean,default:!1}},data:function(){return{imgsrc:n.a.defaults.uploadURL,isAd:!1,processingForm:!1}},watch:{product:function(t){console.log("PRODUCT UDPATE IN SURPLUS ITEM",t),this.isAd=!!t.ad}},mounted:function(){this.product&&(this.isAd=!!this.product.ad)},components:{ImageItem:o["a"]},computed:{},methods:{setSurplusAsAd:function(){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.processingForm){e.next=2;break}return e.abrupt("return");case 2:return t.processingForm=!0,e.prev=3,e.next=6,u["a"].post("/surplus/".concat(t.product.id,"/ad"));case 6:t.$toasted.success("Surplus posted as ad successfully."),t.isAd=!0,e.next=14;break;case 10:e.prev=10,e.t0=e["catch"](3),a=e.t0.response&&e.t0.response.data&&e.t0.response.data.message,t.$toasted.error(a||"Some Erorr Occured. Try again later!");case 14:t.processingForm=!1;case 15:case"end":return e.stop()}}),e,null,[[3,10]])})))()},unsetSurplusAsAd:function(){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.processingForm){e.next=2;break}return e.abrupt("return");case 2:return t.processingForm=!0,e.prev=3,e.next=6,u["a"].post("/surplus/".concat(t.product.id,"/ad/delete"));case 6:t.$toasted.success("Surplus removed from ad."),t.isAd=!1,e.next=14;break;case 10:e.prev=10,e.t0=e["catch"](3),a=e.t0.response&&e.t0.response.data&&e.t0.response.data.message,t.$toasted.error(a||"Some Erorr Occured. Try again later!");case 14:t.processingForm=!1;case 15:case"end":return e.stop()}}),e,null,[[3,10]])})))()},deleteSurplusItem:function(){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function e(){var a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(console.log("dleete surplus item"),a=confirm("Are you sure you want to delete this surplus?"),a){e.next=4;break}return e.abrupt("return");case 4:if(!t.processingForm){e.next=6;break}return e.abrupt("return");case 6:return t.processingForm=!0,e.prev=7,e.next=10,u["a"].post("/surplus/".concat(t.product.id,"/delete"));case 10:t.$toasted.success("Surplus deleted."),t.$emit("remove",t.product.id),e.next=18;break;case 14:e.prev=14,e.t0=e["catch"](7),s=e.t0.response&&e.t0.response.data&&e.t0.response.data.message,s&&e.t0.response.data.operational&&t.$toasted.error(s||"Some Erorr Occured. Try again later!");case 18:t.processingForm=!1;case 19:case"end":return e.stop()}}),e,null,[[7,14]])})))()}}},d=l,p=(a("2afe"),a("2877")),f=Object(p["a"])(d,s,r,!1,null,"0790a795",null);e["a"]=f.exports},"54ff":function(t,e,a){},"5c2e":function(t,e,a){},bf73:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"col-lg-4 col-md-12 col-sm-12"},[a("div",{staticClass:"profile-edit-left"},[t._m(0),a("form",[a("input",{directives:[{name:"model",rawName:"v-model",value:t.searchkey,expression:"searchkey"}],staticStyle:{width:"100%","background-color":"#fafafa",border:"none","border-bottom":"1px solid #ea6a69",padding:"15px"},attrs:{type:"text",name:"searchkey",placeholder:"Enter your pincode..",maxlength:"6"},domProps:{value:t.searchkey},on:{input:function(e){e.target.composing||(t.searchkey=e.target.value)}}}),a("select",{directives:[{name:"model",rawName:"v-model",value:t.searchcat,expression:"searchcat"}],staticStyle:{width:"100%","background-color":"#fafafa",padding:"15px"},attrs:{name:"searchcat",id:"searchcat"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.searchcat=e.target.multiple?a:a[0]}}},[a("option",{attrs:{disabled:"",value:""}},[t._v("Choose Category..")]),a("option",{attrs:{value:""}},[t._v("All Category")]),t._l(t.categores,(function(e,s){return a("option",{key:s,domProps:{value:e.id}},[t._v(t._s(e.name))])}))],2),a("select",{directives:[{name:"model",rawName:"v-model",value:t.city,expression:"city"}],staticStyle:{width:"100%","background-color":"#fafafa",padding:"15px"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.city=e.target.multiple?a:a[0]}}},[a("option",{attrs:{disabled:"",value:""}},[t._v("Select City")]),a("option",{attrs:{value:""}},[t._v("All City")]),t._l(t.all_city,(function(e,s){return a("option",{key:s,domProps:{value:e.city_code}},[t._v(t._s(e.city_name))])}))],2),a("button",{attrs:{type:"submit"},on:{click:t.search}},[t._v("SEARCH NOW")])])]),t._m(1),a("div",{staticClass:"profile-edit-left"},[t._m(2),t._l(t.categores,(function(e){return a("ul",{key:e.id,staticClass:"left-profile-link"},[a("li",[a("div",{staticClass:"row"},[a("div",{staticClass:"col-sm-3"},[a("img",{staticClass:"categorie_image",staticStyle:{width:"45px",height:"45px",margin:"0px"},style:{background:e.color},attrs:{src:t.imgsrc+e.img}})]),a("div",{staticClass:"col-sm-9",staticStyle:{"background-color":"#fafafa",padding:"10px"}},[a("a",{attrs:{href:"#"},on:{click:function(a){return t.filterCategory(e.id)}}},[t._v(t._s(e.name)),a("span",{staticStyle:{padding:"0px"}},[t._v("3")])])])])])])}))],2),t._m(3)])},r=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h2",[a("i",{staticClass:"fa fa-search"}),t._v(" SEARCH")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"profile-edit-left"},[a("h2",[a("i",{staticClass:"fa fa-shopping-bag"}),t._v(" LATEST PRODUCTS LISTED")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h2",[a("i",{staticClass:"fa fa-bars"}),t._v(" CATEGORIES")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"profile-edit-left"},[a("h2",[a("i",{staticClass:"fa fa-share-alt"}),t._v(" FOLLOW US ON")]),a("ul",{staticClass:"left-profile-link"},[a("li",{staticStyle:{"background-color":"#ffffff",display:"inline"}},[a("a",{attrs:{href:"#"}},[a("i",{staticClass:"fa fa-facebook-f",staticStyle:{width:"46px"}})])]),a("li",{staticStyle:{"background-color":"#ffffff",display:"inline"}},[a("a",{attrs:{href:"#"}},[a("i",{staticClass:"fa fa-google-plus",staticStyle:{width:"46px"}})])]),a("li",{staticStyle:{"background-color":"#ffffff",display:"inline"}},[a("a",{attrs:{href:"#"}},[a("i",{staticClass:"fa fa-pinterest-p",staticStyle:{width:"46px"}})])]),a("li",{staticStyle:{"background-color":"#ffffff",display:"inline"}},[a("a",{attrs:{href:"#"}},[a("i",{staticClass:"fa fa-linkedin",staticStyle:{width:"46px"}})])]),a("li",{staticStyle:{"background-color":"#ffffff",display:"inline"}},[a("a",{attrs:{href:"#"}},[a("i",{staticClass:"fa fa-instagram",staticStyle:{width:"46px"}})])])])])}],i=a("bc3a"),c=a.n(i),n=(a("e92b"),a("4a7a")),o=a.n(n),u=a("97af"),l={name:"surplus",delimiters:["${","}"],components:{vSelect:o.a},data:function(){return{imgsrc:c.a.defaults.uploadURL,filelist:[],ress:{},categores:null,subcategores:null,subbcategory:null,searchcat:"",searchkey:"",listproduct:"",state:"nostate",city:"",searchzip:"",all_city:null,action:"/surplus"}},methods:{search:function(t){t.preventDefault(),this.$router.push({path:"/search",query:{id:this.searchcat,name:this.searchkey,zip:this.searchzip,state:this.state,city:this.city}})},clickCallback:function(t){console.log(t)},filterCategory:function(t,e){var a=this;console.log(t),"undefined"===typeof e&&(e=1),u["a"].get("/listproduct-search/"+t+"?page="+e).then((function(t){return a.listproductPage=t.data,a.listproduct=t.data.data,a.non_filtered_teachers=t.data}))},getsubcategory:function(){var t=this;u["a"].get("/sub-categories/"+this.category).then((function(e){return t.subcategores=e.data}))},getResults:function(t){var e=this;"undefined"===typeof t&&(t=1),u["a"].get("/listproduct?page="+t).then((function(t){return e.listproductPage=t.data,e.listproduct=t.data.data,e.non_filtered_teachers=t.data}))}},created:function(){var t=this;u["a"].get("/categories").then((function(e){return t.categores=e.data})),u["a"].get("/category").then((function(e){return t.subbcategory=e.data})),this.getResults(),u["a"].get("/all_city").then((function(e){return t.all_city=e.data}))}},d=l,p=(a("e767"),a("2877")),f=Object(p["a"])(d,s,r,!1,null,null,null);e["a"]=f.exports},c106:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._m(0),a("div",{staticClass:"profile-section"},[a("div",{staticClass:"container"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-lg-8 col-md-12 col-sm-12"},[t._m(1),0!==t.surplusProducts.length||t.isLoading?t._e():a("div",{staticClass:"my-4 small"},[t._v(" No Products Found ")]),a("div",{staticClass:"row"},t._l(t.surplusProductsFromSearchedCategory,(function(t){return a("SurplusProductItem",{key:t.id,attrs:{product:t}})})),1),t.includesOtherCategory?[a("h4",{staticClass:"mt-3"},[t._v("Results from other categories")]),a("hr")]:t._e(),a("div",{staticClass:"row"},t._l(t.surplusProductsFromOtherCategory,(function(t){return a("SurplusProductItem",{key:t.id,attrs:{product:t}})})),1),a("div",{staticStyle:{"text-align":"center"}},[a("Pagination",{attrs:{perPageLimit:t.perPageLimit,totalResults:t.totalResults},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)],2),a("div",{staticClass:"col-lg-4 col-md-12 col-sm-12"},[a("DataFilter",{attrs:{page:t.page,perPageLimit:t.perPageLimit},on:{updatePage:function(e){t.page=e},updateTotalResults:function(e){t.totalResults=e},updateData:t.updateData,filterProcessing:t.filterProcessing},model:{value:t.surplusProducts,callback:function(e){t.surplusProducts=e},expression:"surplusProducts"}})],1)])])])])},r=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"commen-hader"},[a("div",{staticClass:"container"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-sm-12"},[a("h2",[t._v("SEARCH PRODUCTS")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"profile-edit",staticStyle:{padding:"5px","border-radius":"30px"}},[a("h2",{staticClass:"text-center p-0",staticStyle:{"border-bottom":"none"}},[t._v(" Search Products ")])])}],i=(a("4de4"),a("96cf"),a("1da1")),c=a("bc3a"),n=a.n(c),o=a("bf73"),u=a("f510"),l=a("1799"),d=a("2e0b"),p=a("525b"),f=(a("97af"),{name:"surplus",delimiters:["${","}"],components:{RightBar:o["a"],Pagination:l["a"],DataFilter:u["a"],SurplusProductItem:d["a"]},data:function(){return{imgsrc:n.a.defaults.uploadURL,totalResults:0,page:1,perPageLimit:12,surplusProducts:[],isLoading:!1,includesOtherCategory:!1}},mounted:function(){return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:Object(p["a"])();case 1:case"end":return t.stop()}}),t)})))()},computed:{surplusProductsFromSearchedCategory:function(){return this.surplusProducts.filter((function(t){return!t.other_category}))},surplusProductsFromOtherCategory:function(){return this.surplusProducts.filter((function(t){return t.other_category}))}},methods:{filterProcessing:function(t){this.isLoading=t},updateData:function(t){var e=t;e.includes_other_category&&(this.includesOtherCategory=e.includes_other_category)}}}),g=f,m=(a("0782"),a("2877")),v=Object(m["a"])(g,s,r,!1,null,null,null);e["default"]=v.exports},d8dd:function(t,e,a){},e767:function(t,e,a){"use strict";a("5c2e")},f576:function(t,e,a){}}]); //# sourceMappingURL=chunk-4c1df756.23ac79ef.js.map