{"size": 14905, "ext": "js", "max_stars_repo_path": "server/public/js/app.e88144cd.js", "max_stars_repo_name": "rashrayhan/24g-micro-project", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/public/js/app.e88144cd.js", "max_issues_repo_name": "rashrayhan/24g-micro-project", "max_issues_repo_issues_event_min_datetime": "2021-03-10T18:29:09.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T04:44:14.000Z", "max_forks_repo_path": "server/public/js/app.e88144cd.js", "max_forks_repo_name": "rashrayhan/24g-micro-project", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 7452.5, "max_line_length": 14864, "alphanum_fraction": 0.6107346528}
(function(e){function t(t){for(var a,n,c=t[0],r=t[1],d=t[2],m=0,b=[];m<c.length;m++)n=c[m],Object.prototype.hasOwnProperty.call(i,n)&&i[n]&&b.push(i[n][0]),i[n]=0;for(a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);l&&l(t);while(b.length)b.shift()();return o.push.apply(o,d||[]),s()}function s(){for(var e,t=0;t<o.length;t++){for(var s=o[t],a=!0,c=1;c<s.length;c++){var r=s[c];0!==i[r]&&(a=!1)}a&&(o.splice(t--,1),e=n(n.s=s[0]))}return e}var a={},i={app:0},o=[];function n(t){if(a[t])return a[t].exports;var s=a[t]={i:t,l:!1,exports:{}};return e[t].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=a,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(s,a,function(t){return e[t]}.bind(null,a));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],r=c.push.bind(c);c.push=t,c=c.slice();for(var d=0;d<c.length;d++)t(c[d]);var l=r;o.push([0,"chunk-vendors"]),s()})({0:function(e,t,s){e.exports=s("56d7")},"1c32":function(e,t,s){e.exports=s.p+"img/24g_logo.67e6cac5.svg"},"33fd":function(e,t,s){e.exports=s.p+"img/powered_by_24g.93a3ea2c.svg"},"3c5e":function(e,t,s){},4504:function(e,t,s){e.exports=s.p+"img/thumbs_up.4c9ca148.svg"},4678:function(e,t,s){var a={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function i(e){var t=o(e);return s(t)}function o(e){if(!s.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="4678"},"56d7":function(e,t,s){"use strict";s.r(t);s("becf"),s("cabf"),s("fee6");var a=s("2b0e"),i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"app"}},[s("HomeComponent")],1)},o=[],n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"container-wrapper",attrs:{fluid:""}},[a("mdb-navbar",{staticClass:"cw-navbar"},[a("div",{staticClass:"navbar-brand col-12"},[a("mdb-row",[a("mdb-col",{staticClass:"pl-0",attrs:{xs:"6"}},[e._v(" Welcome, "),a("span",[e._v(e._s(e.name))])]),a("mdb-col",{staticClass:"text-right",attrs:{xs:"6"}},[a("i",{staticClass:"far fa-user",attrs:{title:"change default system user"},on:{click:e.systemUsers}})])],1),a("mdb-modal",{staticClass:"user-modal",attrs:{side:"",position:"top-right",direction:"right",show:e.modal},on:{close:function(t){e.modal=!1}}},[a("mdb-modal-header",[a("mdb-modal-title",[e._v("System Users")])],1),a("mdb-modal-body",[a("ol",{staticClass:"pl-5"},e._l(e.users,(function(t){return a("li",{key:t._id},[e._v(e._s(t.name))])})),0),a("small",[a("span",{staticClass:"text-bold"},[e._v("NB:")]),e._v(" Default user is "+e._s(e.name)+"."),a("br"),e._v("Changeable from the API")])]),a("mdb-modal-footer",[a("mdb-btn",{attrs:{outline:"danger",size:"sm"},nativeOn:{click:function(t){e.modal=!1}}},[e._v("Close")])],1)],1)],1)]),a("mdb-row",{staticClass:"cw-header"},[a("mdb-col",[a("img",{attrs:{src:s("1c32"),alt:"24g logo"}}),a("h4",[e._v("video player")])])],1),a("mdb-row",{staticClass:"cw-vid-title"},[a("mdb-col",[e.flag?e._e():a("h3",[e._v(e._s(e.videos[0].title))]),e.flag?a("h3",[e._v(e._s(e.video.title))]):e._e()])],1),a("mdb-row",{staticClass:"cw-vid-grid"},[a("mdb-col",{staticClass:" mb-3 main-grid",attrs:{md:"9"}},[e.flag?e._e():a("video",{staticClass:"video-fluid z-depth-1 mb-2",attrs:{autoplay:"",loop:"",controls:""}},[a("source",{attrs:{src:e.videos[0].video,type:"video/mp4"}})]),e.flag?a("p",[a("video",{staticClass:"video-fluid z-depth-1 mb-2",attrs:{autoplay:"",loop:"",controls:""}},[a("source",{attrs:{src:e.video.video,type:"video/mp4"}})])]):e._e(),e.flag?e._e():a("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.videos[0].views)+" views ")]),e.flag?a("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.video.views)+" views ")]):e._e(),a("span",[a("img",{attrs:{src:s("4504"),alt:"like"},on:{click:function(t){return e.likeVideo(e.video_id)}}}),a("span",{staticClass:"pl-1 mr-4"},[e._v(e._s(e.likes))]),a("img",{attrs:{src:s("af49"),alt:"dislike"},on:{click:function(t){return e.dislikeVideo(e.video_id)}}}),a("span",{staticClass:"pl-1"},[e._v(" "+e._s(e.dislikes))])])]),a("mdb-col",{staticClass:"small-grids",attrs:{md:"3"}},e._l(e.videos,(function(t){return a("mdb-card",{key:t._id,staticClass:"mb-4",nativeOn:{click:function(s){e.getVideoById(t._id,e.getComments(t._id))}}},[a("mdb-card-image",{staticClass:"card-image",attrs:{src:t.thumb,alt:t.title,title:t.title}})],1)})),1)],1),a("mdb-row",{staticClass:"cw-vid-comment"},[a("mdb-col",[a("h5",{staticClass:"py-3"},[e._v("Comments")]),a("div",{staticClass:"comment-form"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.comment,expression:"comment"}],staticClass:"form-control",attrs:{type:"text",id:"new-comment",placeholder:"Type a sweet comment",rows:"2"},domProps:{value:e.comment},on:{input:function(t){t.target.composing||(e.comment=t.target.value)}}}),a("div",{staticClass:"text-right mt-2"},[a("button",{staticClass:"btn",attrs:{type:"submit"},on:{click:function(t){return e.addComment(e.video_id)}}},[e._v("add comment"),a("i",{staticClass:"far fa-paper-plane ml-2"})])])])])],1),a("mdb-row",{staticClass:"cw-vid-comment cw-vid-comments mt-2"},e._l(e.comments,(function(t){return a("mdb-col",{key:t._id,staticClass:"col-9"},[a("p",{staticClass:"mr-4"},[a("img",{attrs:{src:s("73ac"),alt:"placeholder avatar"}})]),a("p",[a("span",{staticClass:"pr-2"},[e._v(e._s(t.author.name))]),e._v(" "),a("b",[e._v(e._s(e._f("comment_moment")(t.createdAt))+" ")]),e._v(" "),a("br"),a("span",[e._v(e._s(t.content))])])])})),1),a("div",{staticClass:"footer-copyright text-center p-4 mt-5"},[a("mdb-container",{attrs:{fluid:""}},[a("img",{attrs:{src:s("33fd"),alt:"footer image"}})])],1)],1)},c=[],r=s("bc3a"),d=s.n(r);const l="api/users/";class m{static getUsers(){return new Promise(async(e,t)=>{try{const t=await d.a.get(l),s=t.data;e(s.map(e=>({...e})))}catch(s){t(s)}})}}var b=m;const f="api/videos/";class u{static getVideos(){return new Promise(async(e,t)=>{try{const t=await d.a.get(f),s=t.data;e(s.map(e=>({...e})))}catch(s){t(s)}})}static getVideo(e){return new Promise(async(t,s)=>{try{const s=await d.a.get(`${f}${e}`),a=s.data;t(a)}catch(a){s(a)}})}}var j=u;const v="api/comments/";class p{static getComments(e){return new Promise(async(t,s)=>{try{const s=await d.a.get(`${v}${e}`),a=s.data;t(a.map(e=>({...e})))}catch(a){s(a)}})}static insertComment(e,t){try{return d.a.post(v,{commentTo:e,content:t})}catch(s){return s}}}var g=p;const h="api/sentiments/";class y{static getLikes(e){return new Promise(async(t,s)=>{try{const s=await d.a.get(`${h}getlikes/${e}`),a=s.data;t(a)}catch(a){s(a)}})}static getDislikes(e){return new Promise(async(t,s)=>{try{const s=await d.a.get(`${h}getdislikes/${e}`),a=s.data;t(a)}catch(a){s(a)}})}static likeAVideo(e){try{return d.a.post(h+"savelike",{videoId:e})}catch(t){return t}}static dislikeAVideo(e){try{return d.a.post(h+"savedisike",{videoId:e})}catch(t){return t}}}var _=y,w=s("91c9"),k=s("c1df"),C=s.n(k),x={name:"HomeComponent",components:{mdbContainer:w["mdbContainer"],mdbModal:w["mdbModal"],mdbModalHeader:w["mdbModalHeader"],mdbModalTitle:w["mdbModalTitle"],mdbModalBody:w["mdbModalBody"],mdbModalFooter:w["mdbModalFooter"],mdbTextarea:w["mdbTextarea"],mdbBtn:w["mdbBtn"],mdbRow:w["mdbRow"],mdbCol:w["mdbCol"],mdbNavbar:w["mdbNavbar"],mdbNavbarBrand:w["mdbNavbarBrand"],mdbCard:w["mdbCard"],mdbCardImage:w["mdbCardImage"]},data(){return{modal:!1,videos:[],video:[],comments:[],users:[],error:"",name:"Abdulrasheed Mustapha",user_id:"",comment:"",video_id:"",views:"",flag:Boolean,likes:0,dislikes:0}},async created(){try{this.videos=await j.getVideos(),this.video_id=this.videos[0]._id,this.getComments(this.video_id),this.getLikes(this.video_id),this.getDislikes(this.video_id),this.flag=!1}catch(e){console.log(e)}},methods:{systemUsers:async function(){this.users=await b.getUsers(),this.modal=!0},getVideoById:async function(e,t){this.video=[],this.flag=!1;try{this.video=await j.getVideo(e),this.video_id=this.video._id,this.flag=!0,this.getLikes(this.video_id),this.getDislikes(this.video_id)}catch(s){console.log(s)}},getComments:async function(e){try{this.comments=await g.getComments(e)}catch(t){console.log(t)}},addComment:async function(e){await g.insertComment(this.video_id,this.comment),this.comments=await g.getComments(e),this.comment=""},getLikes:async function(e){try{this.likes=await _.getLikes(e)}catch(t){console.log(t)}},getDislikes:async function(e){try{this.dislikes=await _.getDislikes(e)}catch(t){console.log(t)}},likeVideo:async function(e){await _.likeAVideo(e),this.likes=await _.getLikes(e)},dislikeVideo:async function(e){await _.dislikeAVideo(e),this.dislikes=await _.getDislikes(e)}},filters:{comment_moment:function(e){if(e)return C()(String(e)).fromNow()}}},z=x,O=(s("9c37"),s("2877")),M=Object(O["a"])(z,n,c,!1,null,null,null),P=M.exports,V={name:"App",components:{HomeComponent:P}},N=V,A=(s("5c0b"),Object(O["a"])(N,i,o,!1,null,null,null)),B=A.exports,$=s("9483");Object($["a"])("/service-worker.js",{ready(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered(){console.log("Service worker has been registered.")},cached(){console.log("Content has been cached for offline use.")},updatefound(){console.log("New content is downloading.")},updated(){console.log("New content is available; please refresh.")},offline(){console.log("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}}),a["a"].config.productionTip=!1,new a["a"]({render:e=>e(B)}).$mount("#app")},"5c0b":function(e,t,s){"use strict";var a=s("9c0c"),i=s.n(a);i.a},"73ac":function(e,t,s){e.exports=s.p+"img/placeholder_avatar.f7f63b88.png"},"9c0c":function(e,t,s){},"9c37":function(e,t,s){"use strict";var a=s("3c5e"),i=s.n(a);i.a},af49:function(e,t,s){e.exports=s.p+"img/thumbs_down.86295bd3.svg"}});
//# sourceMappingURL=app.e88144cd.js.map