text: (window.webpackJsonp=window.webpackJsonp||[]).push([[23],{428:function(t,o,e){t.exports=e.p+"img/delete-circle.a3e638d.svg"},430:function(t,o,e){t.exports=e.p+"img/view-circle.8253afc.svg"},477:function(t,o,e){},519:function(t,o,e){"use strict";e(477)},602:function(t,o,e){"use strict";e.r(o);e(25),e(32);var n={middleware:["auth","companyaccess","checkLoggedIn"],layout:"companymaindashboard",filters:{formatTime:function(t){var o=((o=new Date(t.replace(/-/g,"/"))).getHours()>12?o.getHours()-12:o.getHours())+":"+o.getMinutes()+" "+(o.getHours()>=12?"PM":"AM"),e=new Date(t.replace(/-/g,"/"));return e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+" ("+o+")"}},data:function(){return{notifications:[],links:[],loaded:!1,companySlug:null,message:null,notificationlist:!0,newloaded:!1,cchannel:null,showreview:null,reviewData:null,reviewError:null,user_name:null,assetUrl:"https://robob.credotree.com/"}},mounted:function(){var t=this;document.getElementsByClassName("afterLogin").length>0||(document.body.className+=" afterLogin "),this.companySlug=this.$route.params.slug,this.newloaded=!1,this.$axios.post("https://robob.credotree.com/api/get-company-notifications",{companySlug:this.companySlug}).then((function(o){t.notifications=o.data.notifications.data,t.links=o.data.notifications.links,t.loaded=!0,t.newloaded=!0})).catch((function(t){}))},methods:{showReview:function(t,o,e,n,c,r,l,d,m,f,h){var v=this;0==t&&(this.$store.commit("decreaseCompanyNotificationCount"),this.$store.commit("rightReload")),this.message=null,localStorage.setItem("getlinkidfromnotification",l),localStorage.setItem("getuseridfromnotification",c),localStorage.setItem("company_review_id",n),localStorage.setItem("getcompanyidfromnotification",r),this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,type:e,company_review_id:n,companySlug:this.companySlug,link_id:l}).then((function(t){"cannot give review"==t.data.status?(v.reviewError=!0,v.notificationlist=!1,v.message="The review given by employee",v.$store.commit("rightReload"),v.$store.commit("stopLoading")):"review given already"==t.data.status?(v.reviewError=!0,v.notificationlist=!1,v.message="You have given the review for user already",v.$store.commit("rightReload"),v.$store.commit("stopLoading")):(v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),v.$store.commit("stopLoading"),v.$axios.post("https://robob.credotree.com/api/get-review-page",{link_id:l}).then((function(t){"review done"==t.data.status?(localStorage.setItem("reviewpagefunction","done"),v.notificationlist=!1,v.showreview=!0,v.user_name=h,v.message=f):(localStorage.setItem("reviewpagefunction","not done"),v.reviewError=!0,v.notificationlist=!1,v.message="You have given the review for user already")})).catch((function(t){})))})).catch((function(t){this.$store.commit("stopLoading")}))},backtoNotify:function(){this.showreview=!1,this.reviewError=!1,this.notificationlist=!0},openReview:function(){this.$router.push("/review")},viewProfile:function(){this.$router.push("/company/"+this.companySlug+"/profile")},submitURL:function(t){var o=this;null!=t&&(this.newloaded=!1,this.$axios.post(t,{companySlug:this.companySlug}).then((function(t){o.notifications=t.data.notifications.data,o.links=t.data.notifications.links,o.newloaded=!0})).catch((function(t){this.newloaded=!0})))},seennotification:function(t,o,e,n,c,r,l,d,m,f,h){var v=this;0==t&&(this.$store.commit("decreaseCompanyNotificationCount"),this.$store.commit("rightReload")),"company review"==e?this.showReview(t,o,e,n,c,r,l,d,m,f,h):"company-mentioned"==d?this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,type:e,action:d,company_review_id:n,companySlug:this.companySlug,link_id:l}).then((function(t){console.log(t),"current employee"==t.data.status?(v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),localStorage.setItem("userCurrentEmp",1),localStorage.setItem("userCurrentEmpId",l),v.$router.push("/company/"+v.companySlug+"/current-employees"),v.$store.commit("stopLoading")):(v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),v.$store.commit("stopLoading"),localStorage.setItem("userPastEmp",1),localStorage.setItem("userPastEmpId",l),v.$router.push("/company/"+v.companySlug+"/past-employees"))})).catch((function(t){this.$store.commit("stopLoading")})):"leave-company"==d?this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,type:e,action:d,company_review_id:n,companySlug:this.companySlug,link_id:l}).then((function(t){v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),v.$store.commit("stopLoading"),localStorage.setItem("userLeaveCompany",1),localStorage.setItem("userLeaveCompanyId",l),v.$router.push("/company/"+v.companySlug+"/past-employees")})).catch((function(t){this.$store.commit("stopLoading")})):"accepted interview"==d?this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,type:e,action:d,company_review_id:n,companySlug:this.companySlug,link_id:l}).then((function(t){"success"==t.data.status&&(v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),localStorage.setItem("userSchedule",1),localStorage.setItem("userScheduleid",m),v.$router.push("/company/"+v.companySlug+"/scheduled-interview"),v.$store.commit("stopLoading"))})).catch((function(t){this.$store.commit("stopLoading")})):"rejected interview"==d||"Request Reschedule"==d?this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,type:e,action:d,company_review_id:n,companySlug:this.companySlug,link_id:l}).then((function(t){"success"==t.data.status&&(v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),localStorage.setItem("userSchedule",1),localStorage.setItem("userScheduleid",m),v.$router.push("/company/"+v.companySlug+"/interview-invitation"),v.$store.commit("stopLoading"))})).catch((function(t){this.$store.commit("stopLoading")})):"accepted offer"==d||"rejected offer"==d||"reschedule offer"==d?this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,type:e,action:d,company_review_id:n,companySlug:this.companySlug,link_id:l}).then((function(t){"success"==t.data.status&&(v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),localStorage.setItem("userOffer",1),localStorage.setItem("userOfferid",m),v.$router.push("/company/"+v.companySlug+"/offer-given"),v.$store.commit("stopLoading"))})).catch((function(t){this.$store.commit("stopLoading")})):"accepted hr"==d||"rejected hr"==d?this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,type:e,action:d,company_review_id:n,companySlug:this.companySlug,link_id:l}).then((function(t){"success"==t.data.status&&(v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),v.$router.push("/company/"+v.companySlug+"/add-hr"),v.$store.commit("stopLoading"))})).catch((function(t){this.$store.commit("stopLoading")})):(this.$store.commit("startLoading"),this.$axios.post("https://robob.credotree.com/api/seen-company-notification",{id:o,companySlug:this.companySlug}).then((function(t){v.notifications=t.data.notifications.data,v.links=t.data.notifications.links,v.$store.commit("rightReload"),v.$store.commit("stopLoading")})).catch((function(t){this.$store.commit("stopLoading")})))},deletenotification:function(t,o){var e=this;this.newloaded=!0,0==o&&this.$store.commit("decreaseCompanyNotificationCount"),this.$axios.post("https://robob.credotree.com/api/delete-company-notification",{id:t,companySlug:this.companySlug}).then((function(t){e.$store.commit("rightReload"),e.notifications=t.data.notifications.data,e.links=t.data.notifications.links,e.newloaded=!0})).catch((function(t){this.newloaded=!0}))}}},c=(e(519),e(24)),component=Object(c.a)(n,(function(){var t=this,o=t.$createElement,n=t._self._c||o;return n("div",{staticClass:"col-lg-7 col-md-6 mb-3 mb-md-0"},[1==t.reviewError?n("div",{staticClass:"updateBox"},[n("div",{staticClass:"updateContent"},[n("div",{staticClass:"invitationText"},[n("div",[n("span",[t._v(t._s(t.message))])]),t._v(" "),n("div",{staticClass:"formBtnBox"},[n("button",{staticClass:"btn outline w-auto",on:{click:function(o){return t.backtoNotify()}}},[t._v("\n            Back\n          ")]),t._v(" "),"The review given by employee"==t.message?n("button",{staticClass:"btn w-auto",on:{click:t.viewProfile}},[t._v("\n            View Profile\n          ")]):t._e()])])])]):t._e(),t._v(" "),1==t.showreview?n("div",{staticClass:"updateBox"},[n("div",{staticClass:"updateContent"},[n("div",{staticClass:"invitationText"},[n("div",[t._v("\n          "+t._s(t.message)+"\n          "),n("p",[t._v("For view your review, you need to give a review to "+t._s(t.user_name))])]),t._v(" "),n("div",{staticClass:"formBtnBox"},[n("button",{staticClass:"btn outline w-auto",on:{click:function(o){return t.backtoNotify()}}},[t._v("\n            Back\n          ")]),t._v(" "),n("button",{staticClass:"btn w-auto",on:{click:function(o){return t.openReview()}}},[t._v("\n           Give Review\n          ")])])])])]):t._e(),t._v(" "),1==t.notificationlist?n("div",{staticClass:"updateBox"},[n("div",{staticClass:"updateContent notification"},[t._m(0),t._v(" "),0==t.newloaded?[t._m(1)]:t._e(),t._v(" "),t.notifications.length>0&&1==t.newloaded?t._l(t.notifications,(function(o,c){return n("div",{key:c,staticClass:"notificationBox",class:["1"==o.seen?"read":""]},[n("div",{staticClass:"profileImg"},[n("img",{attrs:{src:t.assetUrl+"profileimage/"+o.decoded_image,alt:""}})]),t._v(" "),n("div",{staticClass:"notifText"},[n("span",[t._v(t._s(o.message))]),t._v(" "),n("p",[t._v(t._s(t._f("formatTime")(o.notify_created_at)))])]),t._v(" "),n("div",{staticClass:"notifBtn"},[n("a",{on:{click:function(e){return t.seennotification(o.seen,o.notify_id,o.type,o.company_review_id,o.notify_user_id,o.company_id,o.link_id,o.action,o.interview_id,o.message,o.user_name)}}},[n("img",{attrs:{src:e(430),alt:""}})]),t._v(" "),n("a",{on:{click:function(e){return t.deletenotification(o.notify_id,o.seen)}}},[n("img",{attrs:{src:e(428),alt:""}})])])])})):t._e(),t._v(" "),0==t.notifications.length&&1==t.newloaded?[n("p",[t._v("There is no notification available for you.")])]:t._e(),t._v(" "),n("div",{staticClass:"paginationBox"},[n("nav",{attrs:{"aria-label":"Page navigation example"}},[n("ul",{staticClass:"pagination"},[t.notifications.length>0&&t.links.length>3?[t._l(t.links,(function(o){return[n("li",{key:o.id,staticClass:"page-item",class:[1==o.active?"active":""]},["&laquo; Previous"==o.label?n("a",{staticClass:"page-link prev",attrs:{"aria-label":"Previous"},on:{click:function(e){return t.submitURL(o.url)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("«")])]):"Next &raquo;"==o.label?n("a",{staticClass:"page-link prev",attrs:{"aria-label":"Previous"},on:{click:function(e){return t.submitURL(o.url)}}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("»")])]):n("a",{staticClass:"page-link",on:{click:function(e){return t.submitURL(o.url)}}},[t._v(t._s(o.label))])])]}))]:t._e()],2)])])],2)]):t._e()])}),[function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"title2"},[e("span",[t._v("Notifications")])])},function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"educationView"},[e("div",{staticClass:"contentLoader"},[e("div",{staticClass:"text-line"}),t._v(" "),e("h4",{staticClass:"text-line"}),t._v(" "),e("p",{staticClass:"text-line"})]),t._v(" "),e("div",{staticClass:"contentLoader"},[e("div",{staticClass:"text-line"}),t._v(" "),e("h4",{staticClass:"text-line"}),t._v(" "),e("p",{staticClass:"text-line"})]),t._v(" "),e("div",{staticClass:"contentLoader"},[e("div",{staticClass:"text-line"}),t._v(" "),e("h4",{staticClass:"text-line"}),t._v(" "),e("p",{staticClass:"text-line"})])])}],!1,null,null,null);o.default=component.exports}}]);