principal-dashboard-lib-v2 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("angular-google-charts"),require("file-saver"),require("xlsx"),require("@angular/common"),require("ng2-datepicker")):"function"==typeof define&&define.amd?define("principal-dashboard-lib-v2",["exports","@angular/core","rxjs","angular-google-charts","file-saver","xlsx","@angular/common","ng2-datepicker"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["principal-dashboard-lib-v2"]={},e.ng.core,e.rxjs,e.angularGoogleCharts,e.FileSaver,e.XLSX,e.ng.common,e.ng2Datepicker)}(this,(function(e,t,a,i,r,s,o,n){"use strict";var l=function(){function e(){this.isResoureMetaDataReady=new a.ReplaySubject,this.isResoureMetaDataReady$=this.isResoureMetaDataReady.asObservable(),this.isUserReqiuredDataReady=new a.ReplaySubject,this.isUserReqiuredDataReady$=this.isUserReqiuredDataReady.asObservable(),this.mychartType="",this.dataType="",this.userAllData="",this.userMetadata={userDetails:[],resourceDetails:[]},this.resoureMetadata=new Array,this.userDetailObject={},this.userlist=!1,this.chartType=new a.BehaviorSubject(this.mychartType),this.chartType$=this.chartType.asObservable(),this.isUserWise_data=new a.BehaviorSubject(!0),this.isUserWise_data$=this.isUserWise_data.asObservable(),this.isAllUsers=new a.BehaviorSubject(this.userlist),this.isAllUsers$=this.isAllUsers.asObservable(),this.detailedviewData=new a.BehaviorSubject(this.userMetadata),this.detailedviewData$=this.detailedviewData.asObservable()}return e.prototype.genarateResourseReqiuredData=function(e){this.isResoureMetaDataReady.next(!1);var t=new Array;if(e&&null!==e){var a=e.resourcesMetadata.resourceMetadata;if(null!=a&&a.length>0)for(var i=0;i<a.length;i++){var r={resouseID:a[i].resourceId,subject:null!=a[i].subject&&null!=a[i].subject.title?a[i].subject.title:"",grade:null!=a[i].grade&&null!=a[i].grade.title?a[i].grade.title:"",chapter:null!=a[i].chapter&&null!=a[i].chapter.title?a[i].chapter.title:"",teachingpoint:null!=a[i].teachingpoint&&null!=a[i].teachingpoint.title?a[i].teachingpoint.title:"",type:null!=a[i].type?this.getDisplaytypeValue(a[i].type):"",title:null!=a[i].title?a[i].title:""};t.push(r),this.resoureMetaData=t,this.isResoureMetaDataReady.next(!0)}}return t},e.prototype.genarateUserReqiuredData=function(e){this.isUserReqiuredDataReady.next(!1);var t=new Array,a=new Array,i=new Array,r=new Array;if(e&&null!==e){var s=e.usersConsole.userConsole,o=e.usersMetadata.userMetadata,n=e.schoolTerminals.schoolTerminal;if(null!=o&&o.length>0)for(var l=0;l<o.length;l++){var d=void 0,h={};""!=o[l].userId&&(d=o[l].userId,console.log("--chartDataUserWise--\x3e>",o[l].fullName),h={userId:d,userName:void 0!==o[l].fullName?o[l].fullName:"",userSubjects:void 0!==o[l].userSubjects?o[l].userSubjects:""},t.push(h))}for(var c=0;c<t.length;c++)t.forEach((function(e){t[c].userName===e.userName&&(a.push(t[c]),t.splice(c,1))}));for(c=0;c<a.length;c++)a[c].userName=a[c].userName,t.push(a[c]),this.usersMetaData=t;if(null!=n&&n.length>0)for(c=0;c<n.length;c++){var u,p=void 0,m=void 0,y=void 0,v=void 0;if(p=void 0!==n[c].schoolId?n[c].schoolId:"",m=void 0!==n[c].terminalKey?n[c].terminalKey:"",y=void 0!==n[c].terminalType?n[c].terminalType:"",void 0!==n[c].metadata)v=JSON.parse(n[c].metadata).location,console.log("metadataJSON",v);else v="";u={schoolId:p,terminalKey:m,terminalType:y,location:v},console.log("ccc--",u),i.push(u),this.schoolTerminalData=i}if(null!=s&&s.length>0)for(var g=function(e){var a=void 0,o=void 0,n=void 0,l=void 0,d=void 0,h=void 0,c=[],u=[],p=void 0,m=void 0,y=void 0;a=void 0!==s[e].userId?s[e].userId:"",o=void 0!==s[e].startTime?s[e].startTime:"",void 0!==s[e].endTime?(n=s[e].endTime,f.myEndTime=n):n="",void 0!==s[e].selectedDate&&s[e].selectedDate,l=void 0!==s[e].duration?s[e].duration:"",d=void 0!==s[e].terminalIP?s[e].terminalIP:"",null!=(h=void 0!==s[e].userConsoleResources?s[e].userConsoleResources:null)&&(void 0!==h.userConsoleResource?h.userConsoleResource.forEach((function(e){c.push(e.resourceId),u.push(e.duration)})):(c=[],u=[]));for(var v=0;v<t.length;v++)a===t[v].userId&&(p=t[v].userName,m=t[v].userSubjects);for(var g=0;g<i.length;g++){if(d===i[g].terminalKey){y=i[g].location;break}y=""}void 0!==y&&"undefined"!==y||(y="");var b={userId:a,userName:p,startTime:new Date(o),endTime:new Date(n),terminalIP:d,resourceMetauserConsoleData:c,resourceDurationFromConsole:u,duration:l,terminalLocation:y,userSubjects:m};r.push(b),f.userConsoleData=r,f.isUserReqiuredDataReady.next(!0)},f=this,b=0;b<s.length;b++)g(b)}return{usersMetadata:t,schoolTerminalData:i,userConsoleData:r}},e.prototype.userWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData&&(console.log("chartDataUserWiseNew--\x3e>",this.userConsoleData),this.userConsoleData.length>0))for(var t=0;t<this.userConsoleData.length;t++){void 0===this.userConsoleData[t].userName&&(this.userConsoleData[t].userName="-"),"-"!==this.userConsoleData[t].userName&&"--"!==this.userConsoleData[t].userName||this.userConsoleData.splice(t,1);var a=[this.userConsoleData[t].userName,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(a)}return e},e.prototype.classRoomWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData)for(var t=0;t<this.userConsoleData.length;t++){var a=this.userConsoleData[t].terminalLocation,i=a+" - "+this.userConsoleData[t].terminalIP;console.log("bbblocation--\x3e",i);var r=[i,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(r)}return console.log("this.classRoomWiseChartData",e),e},e.prototype.newGetCurrentClassroomData=function(){var e=new Array;if(e=[],this.userConsoleData)for(var t=0;t<this.userConsoleData.length;t++){var a=this.userConsoleData[t].terminalLocation+" - "+this.userConsoleData[t].terminalIP;console.log("bbblocation--\x3e",a),e.push(a)}return console.log("this.classRoomWiseChartData",e),e=this.uniq(e)},e.prototype.uniq=function(e){return Array.from(new Set(e))},e.prototype.allUserChartData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.usersMetaData){for(var a=void 0,i=void 0,r=void 0,s=new Array,o=0;o<this.userConsoleData.length;o++)s.push(this.userConsoleData[o]),t.push(this.userConsoleData[o]);for(var n=0;n<this.usersMetaData.length;n++){r=this.usersMetaData[n].userId,a=this.usersMetaData[n].userName,console.log("alluser-1->>",a),i=this.usersMetaData[n].userSubjects;var l={userId:r,userName:a,startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:"",resourceMetauserConsoleData:[],duration:"0",terminalLocation:"",userSubjects:i},d={userId:r,userName:a,startTime:"",endTime:"",terminalIP:"",resourceMetauserConsoleData:[],duration:0,terminalLocation:"",userSubjects:i};t.push(d),s.push(l)}setTimeout((function(){for(var t=0;t<s.length;t++){console.log("alluser-3->>",s[t].userName),void 0===s[t].userName&&(s[t].userName="--"),s[t].userName;var a=[s[t].userName,s[t].startTime,s[t].endTime];e.push(a)}}),50)}return{forChartData:e,fordurationTable:t}},e.prototype.allRoomsData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.schoolTerminalData){for(var a={},i=void 0,r=0;r<this.userConsoleData.length;r++){t.push(this.userConsoleData[r]),console.log("bbb allRoom--\x3e",this.userConsoleData[r]);var s=this.userConsoleData[r].terminalLocation;""!==s&&void 0!==s||(s="No Name");var o=s+" - "+this.userConsoleData[r].terminalIP;console.log("bbbbRoom",o);var n=[o,this.userConsoleData[r].startTime,this.userConsoleData[r].endTime];e.push(n)}for(r=0;r<this.schoolTerminalData.length;r++){console.log("schoolTerminalData",this.schoolTerminalData),i=this.schoolTerminalData[r].location+" - "+this.schoolTerminalData[r].terminalKey,a={userId:"",userName:"",startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:i,resourceMetauserConsoleData:[],duration:0,terminalLocation:"",userSubjects:""},t.push(a);var l=[i,new Date(this.myEndTime),new Date(this.myEndTime)];e.push(l)}}return{forChartData:e,fordurationTable:t}},e.prototype.dataForTableView=function(e,t){var a;console.log("AAA userConsoleMatrix",e);var i=new Array;new Array;i=[];for(var r=0;r<e.length;r++){var s,o,n=void 0,l=void 0,d=void 0,h=void 0,c=void 0,u=(new Array,new Array);new Array;u=[],[],c=e[r].userSubjects,h=e[r].userName,null!=e[r].startTime&&""!=e[r].startTime&&null!=e[r].endTime&&""!=e[r].endTime&&(n=e[r].startTime.toLocaleTimeString("en-US",{hour12:!0}),l=e[r].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[r].startTime.getDate()+"/"+(e[r].startTime.getMonth()+1)+"/"+e[r].startTime.getFullYear()),d=Math.floor(e[r].duration);var p=e[r].terminalLocation+" "+e[r].terminalIP;if(s=e[r].resourceMetauserConsoleData,o=e[r].resourceDurationFromConsole,0===s.length)void 0,void 0,u=[h,c,a,n,l,d,p,void 0,void 0,void 0,void 0,void 0],i.push(u);else for(var m=0;m<s.length;m++)for(var y=0;y<t.length;y++)s[m]===t[y].resouseID&&(u=[h,c,a,n,l,d,p,t[y].subject,t[y].grade,t[y].chapter,t[y].teachingpoint,"whiteboard"===t[y].title.toLowerCase()||"question"===t[y].title.toLowerCase()?this.getDisplaytypeValue(t[y].type)+" : "+this.convertSeconds(o[m]):this.getDisplaytypeValue(t[y].type)+" : "+t[y].title+" : "+this.convertSeconds(o[m])],i.push(u),h=void 0,c=void 0,a=void 0,n=void 0,l=void 0,d=void 0,p=void 0)}return i},e.prototype.dataForDetailedView=function(e,t,a){var i=new Array;var r,s,o,n,l,d,h=new Array;h=[];var c=new Array;c=[],n=e[a].userSubjects,o=e[a].userName,null!=e[a].startTime&&""!=e[a].startTime&&null!=e[a].endTime&&""!=e[a].endTime&&(r=e[a].startTime.toLocaleTimeString("en-US",{hour12:!0}),s=e[a].endTime.toLocaleTimeString("en-US",{hour12:!0}),e[a].startTime.getDate(),e[a].startTime.getMonth(),e[a].startTime.getFullYear()),Math.floor(e[a].duration);var u=e[a].terminalLocation+" "+e[a].terminalIP;if(l=e[a].resourceMetauserConsoleData,d=e[a].resourceDurationFromConsole,i=[o,r,n,s,u],0==l.length)void 0,void 0,void 0,void 0,void 0;else for(var p=0;p<l.length;p++)for(var m=0;m<t.length;m++)l[p]===t[m].resouseID&&(c=[t[m].subject,t[m].grade,t[m].chapter,t[m].teachingpoint,"whiteboard"===t[m].title.toLowerCase()||"question"===t[m].title.toLowerCase()?t[m].type+": "+this.convertSeconds(d[p]):t[m].type+": "+t[m].title+": "+this.convertSeconds(d[p])],h.push(c));return{userDetails:i,resourceDetails:h}},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e.prototype.convertSeconds=function(e){return Math.floor(e/60)+"m "+e%60+"s"},e}();l.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new l},token:l,providedIn:"root"}),l.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[]};var d=function(){function e(){this.userSelectedDate=new t.EventEmitter,this.messageForUser="Loding..."}return Object.defineProperty(e.prototype,"responseStatus",{set:function(e){this.setMessageForUser(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.setMessageForUser=function(e){this.messageForUser=e},e.prototype.onUserSelectDate=function(e){this.data=null,this.userSelectedDate.emit(e)},e}();d.decorators=[{type:t.Component,args:[{selector:"lib-principal-dashboard-lib-v2",template:'<div id="reprtModule">\n <div id="pd-mainDiv" class="pd-mainContainer">\n <lib-header [data]="data" (userSelectedDate)="onUserSelectDate($event)">\n </lib-header>\n <lib-chartheader></lib-chartheader>\n \n <div id="pd-preloader" class="pd-preloaderDiv" *ngIf="responseStatus !== \'true\' && !data">\n {{messageForUser}} \n </div>\n <lib-chartview *ngIf="data" [data]="data"></lib-chartview>\n <lib-tableview *ngIf="data" [data]="data"></lib-tableview>\n <lib-detailedview *ngIf="data" [data]="data"></lib-detailedview>\n \n </div>\n</div>\n ',styles:[".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;z-index:2}.bs-datepicker-head{background-color:#000!important}"]}]}],d.ctorParameters=function(){return[]},d.propDecorators={data:[{type:t.Input}],responseStatus:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var h=function(){function e(e){this.pdService=e,this.mytype=i.ChartType.Timeline,this.datadisplaytype="UserWise",this.isUserWise=!0,this.isChartView=!0}return e.prototype.ngOnInit=function(){this.libVersion="0.0.21"},e.prototype.changeChatType=function(){this.mytype==i.ChartType.Timeline?(this.isChartView=!1,this.mytype=i.ChartType.Table,this.pdService.chartType.next(this.mytype)):(this.isChartView=!0,this.mytype=i.ChartType.Timeline,this.pdService.chartType.next(this.mytype))},e.prototype.changeDataTypeClassRoom=function(){this.isUserWise=!1,this.pdService.isUserWise_data.next(!1)},e.prototype.changeDataTypeUser=function(){this.isUserWise=!0,this.pdService.isUserWise_data.next(!0)},e}();h.decorators=[{type:t.Component,args:[{selector:"lib-chartheader",template:'\n<div id="pd-chartheader">\n <div id="pd-chatTypeBtnDiv" class="pd-tabIconBtn" [ngClass]=" isChartView ? \'tableIconImg\' : \'chartIconImg\'" (click)="changeChatType()">\n </div>\n \n <div id="pd-userWisechatTypeBtn" class="userWiseBtn" [ngStyle]="{ color: isUserWise ? \'#ffffff\' : \'#000000\' , backgroundColor: isUserWise ? \'#000000\' : \'#c4c4c4\'}"\n (click)="changeDataTypeUser()">User wise</div>\n <div id="pd-classRoomWiseBtn" class="classWiseBtn" [ngStyle]="{ color: isUserWise ? \'#000000\' : \'#ffffff\' , backgroundColor: isUserWise ? \'#c4c4c4\' : \'#000000\'}"\n (click)="changeDataTypeClassRoom()">Classroom wise</div>\n\n \n <div class="libVersionDiv">v{{libVersion}}</div>\n</div>',styles:['#pd-chartheader{font-size:12pt;font-weight:400;color:#5c5c5c;z-index:1;width:100%;height:40px;position:relative;margin:10 auto;text-align:center;background-color:#e0e0e0}#pd-chartheader #pd-classRoomWiseBtn,#pd-chartheader #pd-userWisechatTypeBtn{background:-moz-linear-gradient(center top,#45a1da 5%,#1172ae 100%);display:inline-block;padding:0 20px;cursor:pointer;margin:5px 0 0;width:160px;height:30px;line-height:30px}#pd-chartheader .libVersionDiv{position:absolute;font-size:12px;color:#343a40;margin-top:-21px;font-weight:700;margin-left:71px}.userWiseBtn{border-radius:6px 0 0 6px}.classWiseBtn{border-radius:0 6px 6px 0}.pd-tabIconBtn{cursor:pointer;position:absolute;left:10px;top:-17px;width:62px;height:52px;background-repeat:no-repeat}.tableIconImg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAzCAYAAADPX7uaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzA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nD3sb+mXfpUOPgHU7CSCz8VZOqVeL1En+L8AAjJTPo0iRABoAAAAASUVORK5CYII=")}']}]}],h.ctorParameters=function(){return[{type:l}]};Object.create;function c(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var i,r,s=a.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return o}function u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}Object.create;var p=function(){function e(e){this.pdService=e,this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=i.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=new Array,this.totalChartDataMatrix=new Array}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadChart(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadChart=function(e){var t=this;this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=i.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=[],this.totalChartDataMatrix=[],this.chartview=document.getElementById("pd-chartview"),this.myDataList=document.getElementById("pd-xmlData"),e&&(this.myXmlData=JSON.parse(e)),this.myXmlData&&(this.currentdataList=this.pdService.genarateUserReqiuredData(this.myXmlData),this.alluserList=this.pdService.allUserChartData(),this.resourceDataList=this.pdService.genarateResourseReqiuredData(this.myXmlData),this.totalUsers=this.currentdataList.usersMetadata.length,this.eligibleUsers=this.findEligibleUserCount(),this.installedClassrooms=this.findInstalledClassrooms(),this.currentRooms=this.findCurrentClassrooms(),this.findCurrentUserCount()),this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),window.addEventListener("resize",this.onResizeWindow.bind(this))},e.prototype.onResizeWindow=function(e){this.myChartwidth=.88*window.innerWidth},e.prototype.myChartReady=function(){this.createDivforTotalDurartion(),this.setHeightofDivforTotalDurartion()},e.prototype.updateChartType=function(e){null!=this.chartview&&null!=this.chartview&&(e==i.ChartType.Table?this.chartview.style.display="none":this.chartview.style.display="block")},e.prototype.updateDataType=function(e){this.isUserWise=e,this.myXmlData&&(this.isUserWise?(this.currentList="Current Users",this.allList="All Users",this.isAllUsers?this.userWiseAllData():this.userWiseCurrentData()):(this.allList="All Rooms",this.currentList="Current Rooms",this.isAllUsers?this.classRoomWiseAllData():this.classRoomWiseCurrentData()))},e.prototype.updateChart=function(){for(var e=this,t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);this.chartDataTable=this.myChartDataMatrix,console.log("this.myChartDataMatrix",this.myChartDataMatrix),this.myChartOptions={tooltip:{trigger:"none"},colors:["#ff7f0e","#2ca02c","#8c564b","#d62728","#bcbd22","#17becf"],timeline:{colorByRowLabel:!0,barLabelStyle:{fontSize:7}},hAxis:{format:"HH:mm a"}},setTimeout((function(){e.myChartHeight=e.AllrowHeight+100}),1e3)},e.prototype.calulateTotalDuration=function(e){var t,a=new Array;if(a=[],this.totalChartDataMatrix=[],this.isUserWise)for(var i=0;i<e.length;i++)t={name:e[i].userName,value:parseInt(e[i].duration)},a.push(t);else for(i=0;i<e.length;i++)t={name:e[i].terminalIP,value:parseInt(e[i].duration)},a.push(t);var r={};(a=u(new Set(a))).forEach((function(e){r[e.name]?r[e.name].value=r[e.name].value+e.value:r[e.name]=e}));var s=Object.values(r),o=new Array;o=[],s.forEach((function(e){o.push(e.value)}));for(i=0;i<o.length;i++){var n=[this.timeConvert(o[i]).toString()+" hrs"];this.totalChartDataMatrix.push(n)}},e.prototype.timeConvert=function(e){var t=Math.floor(e)/60,a=Math.floor(t),i=60*(t-a);return a+":"+Math.round(i)},e.prototype.removeBlankEntryBar=function(){for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=1e8,a=[],i=0;i<e.length;i++){var r=parseInt(e[i].getAttribute("width"));r<t?(a=[e[i]],t=r):r==t&&a.push(e[i])}for(i=0;i<a.length;i++)a[i].setAttribute("fill","none")},e.prototype.createDivforTotalDurartion=function(){var e=[];this.rowElements=[];for(var t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);for(var a=0;a<this.totalChartDataMatrix.length;a++){var i=this.totalChartDataMatrix[a][0];e.push(i);var r=t.appendChild(document.createElement("div"));r.style["border-bottom"]="1px solid #b7b7b7",r.style["font-family"]="Arial",r.style["font-size"]="13px",r.style["text-align"]="left",r.style["padding-left"]="8px",r.style["padding-right"]="8px",r.style.position="inherit",r.style["background-color"]=a%2?"#e6e6e6":"#ffffff",r.innerHTML=i,this.rowElements.push(r)}},e.prototype.setHeightofDivforTotalDurartion=function(){this.AllrowHeight=0;for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=-1,a=0;a<e.length;a++)if(++t<this.rowElements.length){var i=parseFloat(e[a].getAttribute("height"))+"px";this.AllrowHeight+=parseFloat(e[a].getAttribute("height"));var r=this.rowElements[t];r&&(r.style.height=i,r.style.lineHeight=i)}},e.prototype.onSelectRowData=function(e){var t=e.selection[0],a=t.row;t.column;this.isAllUsers?this.selectedUserData=this.pdService.dataForDetailedView(this.alluserList.fordurationTable,this.resourceDataList,a):this.selectedUserData=this.pdService.dataForDetailedView(this.currentdataList.userConsoleData,this.resourceDataList,a),this.pdService.detailedviewData.next(this.selectedUserData),this.updateChart()},e.prototype.showAllUser=function(){this.pdService.isAllUsers.next(!0),this.isAllUsers=!0,this.isUserWise?this.userWiseAllData():this.classRoomWiseAllData()},e.prototype.showCurrentUser=function(){this.isAllUsers=!1,this.pdService.isAllUsers.next(!1),this.isUserWise?this.userWiseCurrentData():this.classRoomWiseCurrentData()},e.prototype.userWiseCurrentData=function(){var e=this.pdService.userWiseChartData();console.log("chartDataUserWise",e),e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.userWiseAllData=function(){var e=this.alluserList.forChartData;e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.calulateTotalDuration(this.alluserList.fordurationTable))},e.prototype.classRoomWiseCurrentData=function(){var e=this.pdService.classRoomWiseChartData();console.log("classRoomdata",e),e&&e.length>0&&(this.myChartDataMatrix=e,console.log("myChartDataMatrix",this.myChartDataMatrix),this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.classRoomWiseAllData=function(){var e=this.pdService.allRoomsData();e.forChartData&&e.forChartData.length>0&&(this.myChartDataMatrix=e.forChartData,this.updateChart()),e.fordurationTable&&e.fordurationTable.length>0&&this.calulateTotalDuration(e.fordurationTable)},e.prototype.findCurrentUserCount=function(){for(var e=this.currentdataList.userConsoleData,t=new Array,a=0;a<e.length;a++){var i=e[a].userName;t.push(i)}var r=u(new Set(t));this.currentUsers=r.length},e.prototype.findCurrentClassrooms=function(){var e=this.pdService.newGetCurrentClassroomData();return console.log("findCurrentClassrooms",e),e.length},e.prototype.findInstalledClassrooms=function(){return console.log("findInstalledClassrooms",this.currentdataList.schoolTerminalData),this.currentdataList.schoolTerminalData.length},e.prototype.findEligibleUserCount=function(){console.log("findEligibleUserCount",this.currentdataList);for(var e=0,t=this.currentdataList.usersMetadata,a=0;a<t.length;a++){""!==t[a].userSubjects&&(e+=1)}return e},e.prototype.ngOnDestroy=function(){},e}();p.decorators=[{type:t.Component,args:[{selector:"lib-chartview",template:'<div id="pd-chartview-main-container" class="pd-chartview-main-container">\n <div id="userSummary">\n <table class="summaryTable">\n <tbody>\n <tr>\n <td id="totalUsers" class="chartview-navigationbar">\n Total users: {{totalUsers}}\n </td>\n <td id="eligibleUsers" class="chartview-navigationbar">\n Eligible users: {{eligibleUsers}}\n </td>\n <td id="currentUsers" class="chartview-navigationbar">\n Current users: {{currentUsers}}\n </td>\n <td id="totalRooms" class="chartview-navigationbar">\n Installed Classrooms: {{installedClassrooms}}\n </td>\n <td id="currentRooms" class="chartview-navigationbar">\n Current Classrooms: {{currentRooms}}\n </td>\n \x3c!-- <td\n id="currentRooms"\n \n >\n <span id="totalUsers_list" class="activeAll">User List</span>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </div>\n <div id="pd-messageDivContainer" class=\'pd-messageDivContainer\'>\n <div id="pd-messageDiv" class=\'pd-messageDiv\'>Click the bars to view details of content accessed by a teacher.</div>\n <div id="pd-toggleContainer" class="pd-toggleContainer">\n \n <div id="pd-currentUserBtn" class="pd-currentUserBtn-div pd-commonStyleBtn" (click)="showCurrentUser()" [ngStyle]="{ color: isAllUsers ? \'#000000\' : \'#ffffff\' , backgroundColor: isAllUsers ? \'#c4c4c4\' : \'#000000\'}">\n {{currentList}}</div>\n <div id="pd-allUserBtn" class="pd-allUserBtn-div pd-commonStyleBtn" (click)="showAllUser()" [ngStyle]="{ color: isAllUsers ? \'#ffffff\' : \'#000000\' , backgroundColor: isAllUsers ? \'#000000\' : \'#c4c4c4\'}">\n {{allList}}</div>\n </div>\n </div>\n <div id="pd-chartview" class="pd-chartview">\n <div id="myChartDiv">\n <div id="myTimeLine">\n <google-chart\n [type]="myChartType"\n [data]="chartDataTable"\n [options]="myChartOptions"\n [width]="myChartwidth"\n [height]="myChartHeight"\n (select)="onSelectRowData($event)"\n (ready)="myChartReady()"\n > \n </google-chart>\n \n </div>\n <div class="inline" id="labels"></div> \n \n \n </div>\n</div>\n',styles:[".pd-chartview-main-container .pd-chartview{display:block;overflow:scroll;width:100%;height:484px;font-family:Tahoma;font-size:12pt;font-weight:400;color:#666;margin:10 auto;text-align:center;padding-top:1px}.pd-chartview-main-container #userSummary{background:#e0e0e0;margin-top:1px}.pd-chartview-main-container #roomSummary,.pd-chartview-main-container #userSummary{position:relative;width:100%;text-align:center;padding-top:6px;padding-bottom:6px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer{margin-top:1px}.pd-chartview-main-container .pd-messageDivContainer .pd-messageDiv{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:absolute;margin-left:5px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer .pd-toggleContainer{line-height:30px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;float:right;margin:5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-allUserBtn-div{border-radius:0 5px 5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-currentUserBtn-div{border-radius:5px 0 0 5px}.pd-chartview-main-container .pd-messageDivContainer .pd-commonStyleBtn{display:inline-block;cursor:pointer;font-size:12px;width:92px;text-align:center}.pd-chartview-main-container .summaryTable{width:100%;border-collapse:collapse;border-spacing:2px;border-color:grey}.pd-chartview-main-container .activeAll{cursor:pointer;background:none!important;border-radius:13px;border:none;width:64px;height:18px!important;line-height:18px!important;color:#45a1da;margin-right:0!important;padding:1px 5px;vertical-align:sub}.pd-chartview-main-container #myTimeLine{width:89%;height:60%;margin-left:5px;overflow-x:scroll;overflow-y:hidden;float:left}.pd-chartview-main-container #myTimeLine2{width:71px;position:relative;overflow-x:hidden;overflow-y:hidden}.pd-chartview-main-container #myChartDiv{width:100%}.pd-chartview-main-container .chartview-navigationbar{border-collapse:collapse;border-right:1px solid #999;text-align:center}.pd-chartview-main-container #labels{border-right:1px solid #b7b7b7;border-top:1px solid #b7b7b7;width:10%;float:left;font-size:1.2vw;overflow-x:hidden;overflow-y:hidden}.inline{vertical-align:top;position:relative}"]}]}],p.ctorParameters=function(){return[{type:l}]},p.propDecorators={data:[{type:t.Input}]};var m=function(){function e(e){this.pdService=e,this.userMetadataHeadingArray=["Name:","Start Time:","Subject:","End Time:","Room Details:"],this.resourseMetadataHeadingArray=["Subject","Class","Chapter Name","Topic Name","Assets Details"]}return e.prototype.ngOnInit=function(){var e=this;this.deatilViewContainer=document.getElementById("pd-deatilViewContainer"),this.deatilViewTable=document.getElementById("pd-deatilViewTable"),this.closeButton=document.getElementById("pd-closeButton"),this.pdService.detailedviewData.subscribe((function(t){t&&(t.userDetails.length>0&&e.createTable(t.userDetails),t.resourceDetails.length>0&&e.createResourcesTable(t.resourceDetails))})),this.deatilViewContainer.style.display="none"},e.prototype.createTable=function(e){for(this.deatilViewContainer.style.display="block";this.deatilViewTable.firstChild;)this.deatilViewTable.removeChild(this.deatilViewTable.lastChild);for(var t=new Array,a=0,i=0;i<e.length;i++){var r=document.createElement("label");r.appendChild(document.createTextNode(this.userMetadataHeadingArray[i])),"undefined"!==r.textContent&&void 0!==r.textContent||(r.textContent=""),t.push(r);var s=document.createElement("label");s.appendChild(document.createTextNode(e[i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var o=document.createElement("table");o.id="userDataTable",o.className="table table-bordered";for(var n=document.createElement("tbody"),l=0;l<e.length/2;l++){var d=document.createElement("tr"),h=void 0;for(i=0;i<4;i++)i%2==0?(h=document.createElement("th")).style["font-weight"]="bold":h=document.createElement("td"),a<t.length&&(h.appendChild(t[a]),d.appendChild(h)),a++;n.appendChild(d),o.appendChild(n),this.deatilViewTable.appendChild(o)}},e.prototype.createResourcesTable=function(e){for(var t=new Array,a=0,i=0;i<this.resourseMetadataHeadingArray.length;i++){(s=document.createElement("label")).appendChild(document.createTextNode(this.resourseMetadataHeadingArray[i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}for(i=0;i<e.length;i++)for(var r=0;r<5;r++){var s;(s=document.createElement("label")).appendChild(document.createTextNode(e[i][r])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var o=document.createElement("table");o.className="table table-bordered",o.id="resoureMetadataTable";var n=document.createElement("tbody");for(r=0;r<=e.length;r++){var l=document.createElement("tr"),d=void 0;for(i=0;i<5;i++)0==r?(d=document.createElement("th")).style["font-weight"]="bold":d=document.createElement("td"),a<t.length&&(d.appendChild(t[a]),l.appendChild(d)),a++;n.appendChild(l),o.appendChild(n),this.deatilViewTable.appendChild(o)}},e.prototype.onCloseBtnClick=function(){this.deatilViewContainer.style.display="none"},e}();m.decorators=[{type:t.Component,args:[{selector:"lib-detailedview",template:'<div id="pd-deatilViewContainer">\n <div class="pd-detailview-header">\n <div class="pd-detailview-title">Details</div>\n <div id="pd-closeButton" (click)="onCloseBtnClick()">+</div>\n </div>\n <div id="pd-deatilViewTable"></div>\n</div>\n',styles:["#pd-deatilViewContainer{position:absolute;background:#fff;box-shadow:0 0 17px #818181;font-size:12px;width:50%;max-height:350px;top:140px;left:230px}#pd-deatilViewContainer .pd-detailview-header{position:relative;width:100%;height:35px;background-color:#e6e6e6}#pd-deatilViewContainer .pd-detailview-title{position:absolute;margin-left:5px;font-size:20px;line-height:35px}#pd-deatilViewContainer #pd-closeButton{width:24px;position:absolute;float:right;right:0;cursor:pointer;height:24px;background:#000;border-radius:12px;color:#fff;line-height:22px;text-align:center;font-size:26px;transform:rotate(45deg);margin:5px}#pd-deatilViewContainer #pd-deatilViewTable{overflow:scroll;scroll-behavior:smooth;height:auto;margin:5px;max-height:300px}"]}]}],m.ctorParameters=function(){return[{type:l}]};var y=function(){function e(){this.resourceTypes=new Array,this.tabName=[{name:"School"},{name:"User Summary"},{name:"Terminal Summary"},{name:"Usage Details"}]}return e.prototype.exportAsExcelFile=function(e,t){for(var a,i={Sheets:{},SheetNames:[]},r=0;r<e.length;r++){var o=s.utils.json_to_sheet(e[r]);i.Sheets[this.tabName[r].name]=o,i.SheetNames.push(this.tabName[r].name)}var n=i;a=s.write(n,{bookType:"xlsx",type:"array"}),this.saveAsExcelFile(a,t)},e.prototype.saveAsExcelFile=function(e,t){var a=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});r.saveAs(a,t+".xlsx")},e.prototype.genarateResourseReqiuredData_Excel=function(e){var t,a=new Array,i=e.resourcesMetadata.resourceMetadata;if(null!=i&&i.length>0)for(var r=0;r<i.length;r++){var s={resouseID:i[r].resourceId,subject:null!=i[r].subject&&null!=i[r].subject.title?i[r].subject.title:"",grade:null!=i[r].grade&&null!=i[r].grade.title?i[r].grade.title:"",chapter:null!=i[r].chapter&&null!=i[r].chapter.title?i[r].chapter.title:"",teachingpoint:null!=i[r].teachingpoint&&null!=i[r].teachingpoint.title?i[r].teachingpoint.title:"",type:t=null!=i[r].type?this.getDisplaytypeValue(i[r].type):"",title:null!=i[r].title?i[r].title:""};a.push(s),this.resourceTypes.push(t)}return this.resourceTypes=u(new Set(this.resourceTypes)),a},e.prototype.genarateUserReqiuredData_Excel=function(e){var t=e.usersConsole.userConsole,a=e.usersMetadata.userMetadata,i=e.schoolTerminals.schoolTerminal,r=new Array,s=new Array,o=new Array,n=new Array;if(null!=a&&a.length>0)for(var l=0;l<a.length;l++){var d={};""!=a[l].userId&&(d={userId:a[l].userId,userName:void 0!==a[l].fullName?a[l].fullName:"",userSubjects:void 0!==a[l].userSubjects?a[l].userSubjects:""},r.push(d))}for(var h=0;h<r.length;h++)r.forEach((function(e){r[h].userName===e.userName&&(s.push(r[h]),r.splice(h,1))}));for(h=0;h<s.length;h++)s[h].userName=s[h].userName+" "+h,r.push(s[h]);if(null!=i&&i.length>0)for(h=0;h<i.length;h++){var c;c={schoolId:void 0!==i[h].schoolId?i[h].schoolId:"",terminalKey:void 0!==i[h].terminalKey?i[h].terminalKey:"",terminalType:void 0!==i[h].terminalType?i[h].terminalType:"",location:void 0!==i[h].metadata?i[h].metadata:""},o.push(c)}if(null!=t&&t.length>0)for(var u=function(e){var a=void 0,i=void 0,s=void 0,l=void 0,d=void 0,h=void 0,c=[],u=[],m=void 0,y=void 0,v=void 0;a=void 0!==t[e].userId?t[e].userId:"",i=void 0!==t[e].startTime?t[e].startTime:"",void 0!==t[e].endTime?(s=t[e].endTime,p.myEndTime=s):s="",void 0!==t[e].selectedDate&&t[e].selectedDate,l=void 0!==t[e].duration?t[e].duration:"",d=void 0!==t[e].terminalIP?t[e].terminalIP:"",null!=(h=void 0!==t[e].userConsoleResources?t[e].userConsoleResources:null)&&(void 0!==h.userConsoleResource?h.userConsoleResource.forEach((function(e){c.push(e.resourceId),u.push(e.duration)})):(c=[],u=[]));for(var g=0;g<r.length;g++)a===r[g].userId&&(m=r[g].userName,y=r[g].userSubjects);for(var f=0;f<o.length;f++)d===o[f].terminalKey&&(v=o[f].location);var b={userId:a,userName:m,startTime:new Date(i),endTime:new Date(s),terminalIP:d,resourceMetauserConsoleData:c,duration:l,terminalLocation:v,userSubjects:y,resourceDurationFromConsole:u};n.push(b)},p=this,m=0;m<t.length;m++)u(m);return{usersMetadata:r,schoolTerminalData:o,userConsoleData:n}},e.prototype.deatilData_Excel=function(e,t){var a,i=new Array;i=[];for(var r=0;r<e.length;r++){var s,o,n,l,d,h=void 0,c=void 0,u=void 0,p=void 0,m=void 0,y=new Array;s=e[r].userId,m=e[r].userSubjects,p=e[r].userName,null!=e[r].startTime&&""!=e[r].startTime&&null!=e[r].endTime&&""!=e[r].endTime&&(h=e[r].startTime.toLocaleTimeString("en-US",{hour12:!0}),c=e[r].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[r].startTime.getDate()+"/"+(e[r].startTime.getMonth()+1)+"/"+e[r].startTime.getFullYear()),u=Math.floor(e[r].duration);n=e[r].terminalLocation,o=e[r].terminalIP;var v=n,g=o;if(l=e[r].resourceMetauserConsoleData,d=e[r].resourceDurationFromConsole,0==l.length)y=[p,m,a,h,c,u,v,g,"","","","","","",s],i.push(y);else for(var f=0;f<l.length;f++)for(var b=0;b<t.length;b++)l[f]===t[b].resouseID&&(y=[p,m,a,h,c,u,v,g,t[b].subject,t[b].grade,t[b].chapter,t[b].teachingpoint,t[b].title,this.getDisplaytypeValue(t[b].type),s,d[f]],i.push(y),p="",m="",a="",h="",c="",v="",g="",u="")}return i},e.prototype.deatilUsage_Excel=function(e){var t=[];if(e.length>0)for(var a=0;a<e.length;a++){var i={Name:e[a][0],Subjects:e[a][1],Date:e[a][2],startTime:e[a][3],endTime:e[a][4],"duration(mins)":e[a][5],location:e[a][6],IP:e[a][7],subjectTitle:e[a][8],gradeTitle:e[a][9],Chapter:e[a][10],tpTitle:e[a][11],resourceTitle:e[a][12],resourceType:e[a][13],"resourceDuration(sec)":e[a][15]};t.push(i)}return t},e.prototype.userSummary_Excel=function(e,t){for(var a=e.usersMetadata.userMetadata,i=new Array,r=new Array,s=new Array,o=new Array,n=new Array,l=new Array,d=new Array,h=0,c=0;c<a.length;c++){i=[],r=[],o=[],n=[],l=[],d=[],h=0;for(var p=0;p<t.length;p++)a[c].userId===t[p][14]&&(""!=t[p][12]&&i.push(t[p][12]),""!=t[p][13]&&r.push(t[p][13]),""!=t[p][5]&&(h+=t[p][5]),o.push(t[p][6]),n.push(t[p][2]),l.push(t[p][9]),d.push(t[p][8]));var m=void 0,y=void 0,v=void 0,g=void 0,f=void 0;m=o.length>0?u(new Set(o))[0]:"",f=n.length>0?u(new Set(n)).length:"",y=n.length>0?u(new Set(n))[0]:"",v=l.length>0?u(new Set(l))[0]:"",g=d.length>0?u(new Set(d))[0]:"";var b={Name:a[c].fullName,Subjects:a[c].userSubjects,duration:h,ClassRooms:m,DatesAccess:y,DayAccess:f,Grades:v,SubjectTought:g,AseestUsed:i,AssetType:r};s.push(b)}var D=new Array,w=function(e){var t=[],a=s[e].AssetType;a=u(new Set(a)),s[e].AssetType.forEach((function(e){t[e]=(t[e]||0)+1})),C.resourceTypes.filter((function(e){return!a.includes(e)})).forEach((function(e){t[e]=0}));var i={Name:s[e].Name,Subjects_taught:s[e].Subjects," Duration(mins)":s[e].duration,ClassRooms:s[e].ClassRooms,DaysAccsessed:s[e].DayAccess,DatesAccess:s[e].DatesAccess,Grades:s[e].Grades,Subjects:s[e].SubjectTought},r=Object.assign(i,t);D.push(r)},C=this;for(c=0;c<s.length;c++)w(c);return D},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e}();y.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new y},token:y,providedIn:"root"}),y.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],y.ctorParameters=function(){return[]};var v=function(){function e(e,a){this.excelService=e,this.pdService=a,this.userSelectedDate=new t.EventEmitter,this.refreshTimer=0,this.title="datepicker",this.date=new Date,this.options={inputClass:"input",calendarClass:"datepicker-default",scrollBarColor:"#010001",format:"dd/LL/yyyy",maxDate:new Date}}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadData(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.getDefaultDate(),this.startTimer()},e.prototype.getDefaultDate=function(){var e=new Date;this.getDateFormat(e),this.todayDate=this.calenderCurrentDate},e.prototype.dateSelected=function(e){this.getDateFormat(e),this.mydata=null,this.refreshChart()},e.prototype.getDateFormat=function(e){var t,a=e.getDate(),i=e.getMonth()+1;t=i<10?"0"+i:i;var r=e.getFullYear()+"-"+t+"-"+(a<10?"0"+a:a);this.currentDate=r,this.calenderCurrentDate=r.split("-").reverse().join("-")},e.prototype.refreshChart=function(){this.stopTimer(),this.refreshTimer=0,this.calenderCurrentDate===this.todayDate&&this.countDown(),this.userSelectedDate.emit(this.calenderCurrentDate)},e.prototype.startTimer=function(){this.countDown()},e.prototype.stopTimer=function(){this.clearTimer(),this.message=""},e.prototype.clearTimer=function(){this.refreshTimer=0,window.clearInterval(this.intervalId)},e.prototype.countDown=function(){var e=this;console.log("countDown"),this.clearTimer(),this.intervalId=window.setInterval((function(){e.refreshTimer-=1,0===e.refreshTimer?(e.refreshChart(),e.message=""):(e.refreshTimer<0&&(e.refreshTimer=300),e.message=""+e.refreshTimer)}),1e3)},e.prototype.timeConvert=function(e){var t=e/60,a=Math.floor(t),i=60*(t-a);return a+":"+Math.round(i)},e.prototype.loadData=function(e){if(e&&(this.mydata=JSON.parse(e),this.mydata)){var t=this.excelService.genarateUserReqiuredData_Excel(this.mydata).userConsoleData,a=this.excelService.genarateResourseReqiuredData_Excel(this.mydata),i=this.excelService.deatilData_Excel(t,a),r=this.excelService.deatilUsage_Excel(i),s=this.excelService.userSummary_Excel(this.mydata,i),o=this.mydata.schoolMetadata.school,n=r,l=this.mydata.schoolTerminals.schoolTerminal;this.dataList=[[o],s,l,n]}},e.prototype.exportReport=function(){this.mydata&&this.excelService.exportAsExcelFile(this.dataList,"UsageReport-"+this.calenderCurrentDate)},e.prototype.ngOnDestroy=function(){this.clearTimer()},e}();v.decorators=[{type:t.Component,args:[{selector:"lib-header",template:'<div id="pd_header" class="pd_header">\n \n <div *ngIf="message && mydata && (this.todayDate === this.calenderCurrentDate)" id="pd_refeshView" class="pd_refesh_bar">\n <div class="timer_msg"> This page will be refreshed in</div>\n <div class="timer_value"> {{timeConvert(message)}} min</div>\n <div id="pd_refeshBtn" (click)="refreshChart()"> Refresh </div>\n </div>\n\n <div id="pd_exportBtn" class="pd_exportButton" *ngIf="mydata"\n [ngClass]="{\'pd_exportButton_shiftRight\': this.todayDate != this.calenderCurrentDate}" (click)="exportReport()"> \n <span class="pd_exportButton_text">Download Report</span>\n <div class="pd_download_icon"></div>\n </div>\n \n <div class="pd_header_calendar">\n \x3c!-- <input type="Date" [max]="currentDate" [value]="currentDate" id="myCalendar" (input)="selectDate($event)" /> --\x3e\n <ngx-datepicker [(ngModel)]="date" [options]="options" (ngModelChange)="dateSelected($event)"></ngx-datepicker>\n </div>\n <div class="pd_header_content" >Realtime usage data</div>\n</div>\n',styles:['.pd_header{width:100%;background-color:#e0e0e0;height:50px;border-bottom:2px solid #fff}.pd_header_calendar{position:absolute;width:150px;margin:5px 5px 5px 17px}.pd_header_content{position:relative;width:350px;margin:0 auto;color:#000;text-align:center;font-size:30px;line-height:50px;pointer-events:none}.pd_exportButton{position:absolute;display:inline-block;right:144px;padding:0 16px;cursor:pointer;margin:9px 0 0;height:30px;width:160px;line-height:30px;background-color:#4285f9;font-size:10pt;font-weight:400;transition:right .5s;border-radius:5px;color:#fff;font-weight:700}.pd_exportButton_shiftRight{right:10px}.pd_download_icon{position:absolute;width:16px;height:16px;background-size:100% 100%;top:8px;background-repeat:no-repeat;display:inline-block;right:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAAY0lEQVRIiWNgGOqAkQS1/8nRy0SCBWSBUQtGLRjiFpQzQDIXDKMDZLl6ch2Abgk2TLbhxFhCseH4LKGa4dgsIdpwZhIsOMoAKUEPMjAwNJLktFGADyDXStgyE8Vm07yoGPoAAH1UItbw1O5lAAAAAElFTkSuQmCC")}.pd_exportButton_text{position:relative;display:inline-block;width:130px}.pd_refesh_bar{position:absolute;color:#000;width:120px;height:78px;right:15px;top:4px;z-index:2;background-color:#fff;float:right;text-align:center;font-size:12px;border-radius:.25rem;border:1px solid #a09898;box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-animation:refreshViewAnimate .6s;animation:refreshViewAnimate .6s}@-webkit-keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}@keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}.timer_msg{position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:14px;top:2px}.timer_value{font-weight:700;font-size:15px}#pd_refeshBtn,.timer_value{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;top:28px}#pd_refeshBtn{background-color:#2172f6;cursor:pointer;width:60px;margin:0 auto;border-radius:3px;color:#fff;height:22px;line-height:20px}#pd_refeshBtn:hover{opacity:.6}::ng-deep.bs-datepicker{margin-left:200px}.bs-datepicker-body table td span.selected,.theme-default .bs-datepicker-body table td.selected span,.theme-default .bs-datepicker-body table td[class*=select-] span:after,.theme-default .bs-datepicker-body table td span[class*=select-]:after{background-color:#000}.bs-datepicker-head{background-color:#000!important}']}]}],v.ctorParameters=function(){return[{type:y},{type:l}]},v.propDecorators={data:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var g=function(){function e(e){this.pdService=e,this.myChartType=i.ChartType.Table,this.isUserWise=!0}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadTable(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadTable=function(e){var t=this;if(e&&(this.myXmlData=JSON.parse(e),this.myXmlData)){var a=this.pdService.genarateUserReqiuredData(this.myXmlData);this.currentdataList=a.userConsoleData;var i=this.pdService.allUserChartData();this.alluserList=i.fordurationTable,this.currentResoursedataList=this.pdService.genarateResourseReqiuredData(this.myXmlData),console.log("AAA genarateUserReqiuredData--\x3e>",a),console.log("AAA this.currentResoursedataList--\x3e>",this.currentResoursedataList)}this.tableViewDiv=document.getElementById("tableViewDiv"),this.tableRow=document.getElementById("tableRow"),this.tblBody=document.getElementById("tblBody"),this.tableViewDiv.style.display="none",this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),this.pdService.isAllUsers.subscribe((function(e){e?t.showAllUser():t.showCurrentDataUser()}))},e.prototype.showCurrentDataUser=function(){this.tableViewData=this.pdService.dataForTableView(this.currentdataList,this.currentResoursedataList),this.tableViewData&&this.ueserWiseTableView(this.tableViewData)},e.prototype.showAllUser=function(){this.tableViewData=this.pdService.dataForTableView(this.alluserList,this.currentResoursedataList),this.tableViewData&&this.ueserWiseTableView(this.tableViewData)},e.prototype.updateDataType=function(e){this.isUserWise=e},e.prototype.updateChartType=function(e){this.myChartType=e,this.myChartType==i.ChartType.Timeline?this.tableViewDiv.style.display="none":this.tableViewDiv.style.display="block"},e.prototype.ueserWiseTableView=function(e){console.log("AAA resoureMetadata",e),document.getElementById("tblBody").innerHTML="";for(var t=new Array,a=0,i=0;i<e.length;i++)for(var r=0;r<12;r++){var s=document.createElement("label");s.appendChild(document.createTextNode(e[i][r])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}for(r=0;r<=e.length;r++){var o=document.createElement("tr"),n=void 0;for(i=0;i<12;i++)n=document.createElement("td"),a<t.length&&(n.appendChild(t[a]),o.appendChild(n)),a++;this.tblBody.appendChild(o)}},e}();g.decorators=[{type:t.Component,args:[{selector:"lib-tableview",template:'\n <div id="tableViewDiv" class="pd-tableViewDiv">\n \n <table class="table table-bordered" id="tableRow">\n <thead class="table-head">\n <tr class="table-headerRow">\n <th scope="col">Teacher Name</th>\n <th scope="col">Subjects</th>\n <th scope="col">Date</th>\n <th scope="col">Start Time</th>\n <th scope="col">End Time</th>\n <th scope="col">Duration (mins)</th>\n <th scope="col">Room</th>\n <th scope="col">Subject</th>\n <th scope="col">Topic of Class</th>\n <th scope="col">Chapter Name</th>\n <th scope="col">Topic Name</th>\n <th scope="col">Assets Details</th>\n </tr>\n </thead>\n <tbody id="tblBody">\n \n </tbody>\n </table>\n </div>\n \n',styles:[".pd-tableViewDiv{width:100%;height:744px;overflow:scroll}.pd-tableViewDiv #tableRow{font-size:small;width:100%;margin-left:24px;margin-top:10px}.pd-tableViewDiv .table-headerRow{font-weight:700}.pd-tableViewDiv .table-head{position:sticky;top:0;background:#fff}"]}]}],g.ctorParameters=function(){return[{type:l}]},g.propDecorators={data:[{type:t.Input}]};var f=function(){};f.decorators=[{type:t.NgModule,args:[{declarations:[h,p,m,v,g,d],imports:[o.CommonModule,i.GoogleChartsModule,n.DatepickerModule],exports:[d]}]}],e.PrincipalDashboardLibV2Component=d,e.PrincipalDashboardLibV2Module=f,e.PrincipalDashboardLibV2Service=l,e.ɵa=h,e.ɵb=p,e.ɵc=m,e.ɵd=v,e.ɵe=y,e.ɵf=g,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("angular-google-charts"),require("file-saver"),require("xlsx"),require("@angular/common"),require("ng2-datepicker")):"function"==typeof define&&define.amd?define("principal-dashboard-lib-v2",["exports","@angular/core","rxjs","angular-google-charts","file-saver","xlsx","@angular/common","ng2-datepicker"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["principal-dashboard-lib-v2"]={},e.ng.core,e.rxjs,e.angularGoogleCharts,e.FileSaver,e.XLSX,e.ng.common,e.ng2Datepicker)}(this,(function(e,t,a,i,r,s,o,n){"use strict";var l=function(){function e(){this.isResoureMetaDataReady=new a.ReplaySubject,this.isResoureMetaDataReady$=this.isResoureMetaDataReady.asObservable(),this.isUserReqiuredDataReady=new a.ReplaySubject,this.isUserReqiuredDataReady$=this.isUserReqiuredDataReady.asObservable(),this.mychartType="",this.dataType="",this.userAllData="",this.userMetadata={userDetails:[],resourceDetails:[]},this.resoureMetadata=new Array,this.userDetailObject={},this.userlist=!1,this.chartType=new a.BehaviorSubject(this.mychartType),this.chartType$=this.chartType.asObservable(),this.isUserWise_data=new a.BehaviorSubject(!0),this.isUserWise_data$=this.isUserWise_data.asObservable(),this.isAllUsers=new a.BehaviorSubject(this.userlist),this.isAllUsers$=this.isAllUsers.asObservable(),this.detailedviewData=new a.BehaviorSubject(this.userMetadata),this.detailedviewData$=this.detailedviewData.asObservable()}return e.prototype.genarateResourseReqiuredData=function(e){this.isResoureMetaDataReady.next(!1);var t=new Array;if(e&&null!==e){var a=e.resourcesMetadata.resourceMetadata;if(null!=a&&a.length>0)for(var i=0;i<a.length;i++){var r={resouseID:a[i].resourceId,subject:null!=a[i].subject&&null!=a[i].subject.title?a[i].subject.title:"",grade:null!=a[i].grade&&null!=a[i].grade.title?a[i].grade.title:"",chapter:null!=a[i].chapter&&null!=a[i].chapter.title?a[i].chapter.title:"",teachingpoint:null!=a[i].teachingpoint&&null!=a[i].teachingpoint.title?a[i].teachingpoint.title:"",type:null!=a[i].type?this.getDisplaytypeValue(a[i].type):"",title:null!=a[i].title?a[i].title:""};t.push(r),this.resoureMetaData=t,this.isResoureMetaDataReady.next(!0)}}return t},e.prototype.genarateUserReqiuredData=function(e){this.isUserReqiuredDataReady.next(!1);var t=new Array,a=new Array,i=new Array,r=new Array;if(e&&null!==e){var s=e.usersConsole.userConsole,o=e.usersMetadata.userMetadata,n=e.schoolTerminals.schoolTerminal;if(null!=o&&o.length>0)for(var l=0;l<o.length;l++){var d={};""!=o[l].userId&&(d={userId:o[l].userId,userName:void 0!==o[l].fullName?o[l].fullName:"",userSubjects:void 0!==o[l].userSubjects?o[l].userSubjects:""},t.push(d))}for(var h=0;h<t.length;h++)console.log("usersMetadataMatrix--\x3e",t[h].userName),t.forEach((function(e){console.log("element.userName--\x3e>",e.userName),t[h].userName===e.userName&&(a.push(t[h]),t.splice(h,1))}));for(h=0;h<a.length;h++)a[h].userName=a[h].userName,t.push(a[h]),this.usersMetaData=t;if(null!=n&&n.length>0)for(h=0;h<n.length;h++){var c,u=void 0,p=void 0,m=void 0,y=void 0;if(u=void 0!==n[h].schoolId?n[h].schoolId:"",p=void 0!==n[h].terminalKey?n[h].terminalKey:"",m=void 0!==n[h].terminalType?n[h].terminalType:"",void 0!==n[h].metadata)y=JSON.parse(n[h].metadata).location,console.log("metadataJSON",y);else y="";c={schoolId:u,terminalKey:p,terminalType:m,location:y},console.log("ccc--",c),i.push(c),this.schoolTerminalData=i}if(null!=s&&s.length>0)for(var v=function(e){var a=void 0,o=void 0,n=void 0,l=void 0,d=void 0,h=void 0,c=[],u=[],p=void 0,m=void 0,y=void 0,v=[];console.log("myuserConsole",s[e]),a=void 0!==s[e].userId?s[e].userId:"",o=void 0!==s[e].startTime?s[e].startTime:"",void 0!==s[e].endTime?(n=s[e].endTime,g.myEndTime=n):n="",void 0!==s[e].selectedDate&&s[e].selectedDate,l=void 0!==s[e].duration?s[e].duration:"",d=void 0!==s[e].terminalIP?s[e].terminalIP:"",null!=(h=void 0!==s[e].userConsoleResources?s[e].userConsoleResources:null)&&(void 0!==h.userConsoleResource?h.userConsoleResource.forEach((function(e){console.log("lookingFor: ",e),c.push(e.resourceId),u.push(e.duration),e.launchedFrom&&v.push(e.launchedFrom)})):(console.log("lookingFor: ELSE "),c=[],u=[],v=[]));for(var f=0;f<t.length;f++)a===t[f].userId&&(p=t[f].userName,m=t[f].userSubjects);for(var b=0;b<i.length;b++){if(d===i[b].terminalKey){y=i[b].location;break}y=""}void 0!==y&&"undefined"!==y||(y="");var D={userId:a,userName:p,startTime:new Date(o),endTime:new Date(n),terminalIP:d,resourceMetauserConsoleData:c,resourceDurationFromConsole:u,launchedFrom:v,duration:l,terminalLocation:y,userSubjects:m};r.push(D),g.userConsoleData=r,g.isUserReqiuredDataReady.next(!0)},g=this,f=0;f<s.length;f++)v(f)}return{usersMetadata:t,schoolTerminalData:i,userConsoleData:r}},e.prototype.userWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData&&this.userConsoleData.length>0)for(var t=0;t<this.userConsoleData.length;t++){console.log("chartDataUserWiseNew--\x3e>",this.userConsoleData),void 0===typeof this.userConsoleData[t].userName&&(this.userConsoleData[t].userName=Math.floor(100*Math.random()).toString()),void 0===this.userConsoleData[t].userName&&(this.userConsoleData[t].userName="-");var a=[this.userConsoleData[t].userName,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(a)}return e},e.prototype.classRoomWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData)for(var t=0;t<this.userConsoleData.length;t++){var a=this.userConsoleData[t].terminalLocation,i=a+" - "+this.userConsoleData[t].terminalIP;console.log("bbblocation--\x3e",i);var r=[i,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(r)}return console.log("this.classRoomWiseChartData",e),e},e.prototype.newGetCurrentClassroomData=function(){var e=new Array;if(e=[],this.userConsoleData)for(var t=0;t<this.userConsoleData.length;t++){var a=this.userConsoleData[t].terminalLocation+" - "+this.userConsoleData[t].terminalIP;console.log("bbblocation--\x3e",a),e.push(a)}return console.log("this.classRoomWiseChartData",e),e=this.uniq(e)},e.prototype.uniq=function(e){return Array.from(new Set(e))},e.prototype.allUserChartData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.usersMetaData){for(var a=void 0,i=void 0,r=void 0,s=new Array,o=0;o<this.userConsoleData.length;o++)s.push(this.userConsoleData[o]),t.push(this.userConsoleData[o]);for(var n=0;n<this.usersMetaData.length;n++){r=this.usersMetaData[n].userId,a=this.usersMetaData[n].userName,console.log("alluser-1->>",a),i=this.usersMetaData[n].userSubjects;var l={userId:r,userName:a,startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:"",resourceMetauserConsoleData:[],duration:"0",terminalLocation:"",userSubjects:i},d={userId:r,userName:a,startTime:"",endTime:"",terminalIP:"",resourceMetauserConsoleData:[],duration:0,terminalLocation:"",userSubjects:i};t.push(d),s.push(l)}setTimeout((function(){for(var t=function(t){console.log("alluser-3->>",s[t]),null==s[t].userName&&s.splice(t,1),"--"===s[t].userName&&s.splice(t,1),setTimeout((function(){var a=[s[t].userName,s[t].startTime,s[t].endTime];e.push(a)}),300)},a=0;a<s.length;a++)t(a)}),50)}return{forChartData:e,fordurationTable:t}},e.prototype.allRoomsData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.schoolTerminalData){for(var a={},i=void 0,r=0;r<this.userConsoleData.length;r++){t.push(this.userConsoleData[r]),console.log("bbb allRoom--\x3e",this.userConsoleData[r]);var s=this.userConsoleData[r].terminalLocation;""!==s&&void 0!==s||(s="No Name");var o=s+" - "+this.userConsoleData[r].terminalIP;console.log("bbbbRoom",o);var n=[o,this.userConsoleData[r].startTime,this.userConsoleData[r].endTime];e.push(n)}for(r=0;r<this.schoolTerminalData.length;r++){console.log("schoolTerminalData",this.schoolTerminalData),i=this.schoolTerminalData[r].location+" - "+this.schoolTerminalData[r].terminalKey,a={userId:"",userName:"",startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:i,resourceMetauserConsoleData:[],duration:0,terminalLocation:"",userSubjects:""},t.push(a);var l=[i,new Date(this.myEndTime),new Date(this.myEndTime)];e.push(l)}}return{forChartData:e,fordurationTable:t}},e.prototype.dataForTableView=function(e,t){var a;console.log("AAA userConsoleMatrix",e,"-resourceMetadataMatrix->",t);var i=new Array;new Array;i=[];for(var r=0;r<e.length;r++){var s,o,n,l=void 0,d=void 0,h=void 0,c=void 0,u=void 0,p=void 0,m=void 0,y=void 0,v=void 0,g=void 0,f=(new Array,new Array);new Array;f=[],[],g=e[r].userSubjects,v=e[r].userName,null!=e[r].startTime&&""!=e[r].startTime&&null!=e[r].endTime&&""!=e[r].endTime&&(l=e[r].startTime.toLocaleTimeString("en-US",{hour12:!0}),d=e[r].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[r].startTime.getDate()+"/"+(e[r].startTime.getMonth()+1)+"/"+e[r].startTime.getFullYear()),h=Math.floor(e[r].duration);var b=e[r].terminalLocation+" "+e[r].terminalIP;s=e[r].resourceMetauserConsoleData,o=e[r].resourceDurationFromConsole;var D=Array(e[r].launchedFrom);if(console.log("mlaunchedFrom len--\x3e> ",D),n=D,0===s.length)void 0,void 0,f=[v,g,a,l,d,h,b,c=void 0,u=void 0,p=void 0,y=void 0,m=void 0,n],i.push(f);else for(var w=0;w<s.length;w++)for(var C=0;C<t.length;C++)s[w]===t[C].resouseID&&(c=t[C].subject,u=t[C].grade,p=t[C].chapter,y=t[C].teachingpoint,m="whiteboard"===t[C].title.toLowerCase()||"question"===t[C].title.toLowerCase()?this.getDisplaytypeValue(t[C].type)+" : "+this.convertSeconds(o[w]):this.getDisplaytypeValue(t[C].type)+" : "+t[C].title+" : "+this.convertSeconds(o[w]),console.log("roomDetail",b),f=[v,g,a,l,d,h,b,c,u,p,y,m,n],i.push(f),v=void 0,g=void 0,a=void 0,l=void 0,d=void 0,h=void 0,b=void 0)}return i},e.prototype.dataForDetailedView=function(e,t,a){var i=new Array;var r,s,o,n,l,d,h=new Array;h=[];var c=new Array;c=[],n=e[a].userSubjects,o=e[a].userName,null!=e[a].startTime&&""!=e[a].startTime&&null!=e[a].endTime&&""!=e[a].endTime&&(r=e[a].startTime.toLocaleTimeString("en-US",{hour12:!0}),s=e[a].endTime.toLocaleTimeString("en-US",{hour12:!0}),e[a].startTime.getDate(),e[a].startTime.getMonth(),e[a].startTime.getFullYear()),Math.floor(e[a].duration);var u=e[a].terminalLocation+" "+e[a].terminalIP;if(l=e[a].resourceMetauserConsoleData,d=e[a].resourceDurationFromConsole,i=[o,r,n,s,u],0==l.length)void 0,void 0,void 0,void 0,void 0;else for(var p=0;p<l.length;p++)for(var m=0;m<t.length;m++)l[p]===t[m].resouseID&&(c=[t[m].subject,t[m].grade,t[m].chapter,t[m].teachingpoint,"whiteboard"===t[m].title.toLowerCase()||"question"===t[m].title.toLowerCase()?t[m].type+": "+this.convertSeconds(d[p]):t[m].type+": "+t[m].title+": "+this.convertSeconds(d[p])],h.push(c));return{userDetails:i,resourceDetails:h}},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e.prototype.convertSeconds=function(e){return Math.floor(e/60)+"m "+e%60+"s"},e}();l.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new l},token:l,providedIn:"root"}),l.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[]};var d=function(){function e(){this.userSelectedDate=new t.EventEmitter,this.messageForUser="Loding..."}return Object.defineProperty(e.prototype,"responseStatus",{set:function(e){this.setMessageForUser(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.setMessageForUser=function(e){this.messageForUser=e},e.prototype.onUserSelectDate=function(e){this.data=null,this.userSelectedDate.emit(e)},e}();d.decorators=[{type:t.Component,args:[{selector:"lib-principal-dashboard-lib-v2",template:'<div id="reprtModule">\n <div id="pd-mainDiv" class="pd-mainContainer">\n <lib-header [data]="data" (userSelectedDate)="onUserSelectDate($event)">\n </lib-header>\n <lib-chartheader></lib-chartheader>\n \n <div id="pd-preloader" class="pd-preloaderDiv" *ngIf="responseStatus !== \'true\' && !data">\n {{messageForUser}} \n </div>\n <lib-chartview *ngIf="data" [data]="data"></lib-chartview>\n <lib-tableview *ngIf="data" [data]="data"></lib-tableview>\n <lib-detailedview *ngIf="data" [data]="data"></lib-detailedview>\n \n </div>\n</div>\n ',styles:[".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;z-index:2}.bs-datepicker-head{background-color:#000!important}"]}]}],d.ctorParameters=function(){return[]},d.propDecorators={data:[{type:t.Input}],responseStatus:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var h=function(){function e(e){this.pdService=e,this.mytype=i.ChartType.Timeline,this.datadisplaytype="UserWise",this.isUserWise=!0,this.isChartView=!0}return e.prototype.ngOnInit=function(){this.libVersion="0.0.22"},e.prototype.changeChatType=function(){this.mytype==i.ChartType.Timeline?(this.isChartView=!1,this.mytype=i.ChartType.Table,this.pdService.chartType.next(this.mytype)):(this.isChartView=!0,this.mytype=i.ChartType.Timeline,this.pdService.chartType.next(this.mytype))},e.prototype.changeDataTypeClassRoom=function(){this.isUserWise=!1,this.pdService.isUserWise_data.next(!1)},e.prototype.changeDataTypeUser=function(){this.isUserWise=!0,this.pdService.isUserWise_data.next(!0)},e}();h.decorators=[{type:t.Component,args:[{selector:"lib-chartheader",template:'\n<div id="pd-chartheader">\n <div id="pd-chatTypeBtnDiv" class="pd-tabIconBtn" [ngClass]=" isChartView ? \'tableIconImg\' : \'chartIconImg\'" (click)="changeChatType()">\n </div>\n \n <div id="pd-userWisechatTypeBtn" class="userWiseBtn" [ngStyle]="{ color: isUserWise ? \'#ffffff\' : \'#000000\' , backgroundColor: isUserWise ? \'#000000\' : \'#c4c4c4\'}"\n (click)="changeDataTypeUser()">User wise</div>\n <div id="pd-classRoomWiseBtn" class="classWiseBtn" [ngStyle]="{ color: isUserWise ? \'#000000\' : \'#ffffff\' , backgroundColor: isUserWise ? \'#c4c4c4\' : \'#000000\'}"\n (click)="changeDataTypeClassRoom()">Classroom wise</div>\n\n \n <div class="libVersionDiv">v{{libVersion}}</div>\n</div>',styles:['#pd-chartheader{font-size:12pt;font-weight:400;color:#5c5c5c;z-index:1;width:100%;height:40px;position:relative;margin:10 auto;text-align:center;background-color:#e0e0e0}#pd-chartheader #pd-classRoomWiseBtn,#pd-chartheader #pd-userWisechatTypeBtn{background:-moz-linear-gradient(center top,#45a1da 5%,#1172ae 100%);display:inline-block;padding:0 20px;cursor:pointer;margin:5px 0 0;width:160px;height:30px;line-height:30px}#pd-chartheader .libVersionDiv{position:absolute;font-size:12px;color:#343a40;margin-top:-21px;font-weight:700;margin-left:71px}.userWiseBtn{border-radius:6px 0 0 6px}.classWiseBtn{border-radius:0 6px 6px 0}.pd-tabIconBtn{cursor:pointer;position:absolute;left:10px;top:-17px;width:62px;height:52px;background-repeat:no-repeat}.tableIconImg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAzCAYAAADPX7uaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZ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ygmMEtLS+DHIklgqMxtahK/an06QT3YXu524eTVwflDICnj+nUEXHfLuD4xMfEfO5EFSPUycMTxL/tdXFyMyxinu9fQzOTk5A4e95nJQLlShR5Dzrd2GCbM5/t4rJqDivOl8MqlL4udyjEYjxrZR6lcMh4aVJVau1JP8ahutIOhmmybmawXKlYQ/Z/IOM92yloXYImu/zjiBQHFNaEtG2eGTG94H+GxMGzIuqXyIuNm+RtrkiUxAODFPrCZb4ZdsuQF43r9fhtYj4v3tb0Tx1nJ17O267EUkfF+kXFzJv7ymGmz9Lc5Pu9lbsMxb3l2p29ZZV8s++XD3WYLWwDnD3sb+mXfpUOPgHU7CSCz8VZOqVeL1En+L8AAjJTPo0iRABoAAAAASUVORK5CYII=")}']}]}],h.ctorParameters=function(){return[{type:l}]};Object.create;function c(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var i,r,s=a.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return o}function u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}Object.create;var p=function(){function e(e){this.pdService=e,this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=i.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=new Array,this.totalChartDataMatrix=new Array}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadChart(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadChart=function(e){var t=this;console.log(" INloadChart --\x3e",e),this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=i.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=[],this.totalChartDataMatrix=[],this.chartview=document.getElementById("pd-chartview"),this.myDataList=document.getElementById("pd-xmlData"),e&&(this.myXmlData=JSON.parse(e)),this.myXmlData&&(this.currentdataList=this.pdService.genarateUserReqiuredData(this.myXmlData),this.alluserList=this.pdService.allUserChartData(),this.resourceDataList=this.pdService.genarateResourseReqiuredData(this.myXmlData),this.totalUsers=this.currentdataList.usersMetadata.length,this.eligibleUsers=this.findEligibleUserCount(),this.installedClassrooms=this.findInstalledClassrooms(),this.currentRooms=this.findCurrentClassrooms(),this.findCurrentUserCount()),this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),window.addEventListener("resize",this.onResizeWindow.bind(this))},e.prototype.onResizeWindow=function(e){this.myChartwidth=.88*window.innerWidth},e.prototype.myChartReady=function(){this.createDivforTotalDurartion(),this.setHeightofDivforTotalDurartion()},e.prototype.updateChartType=function(e){null!=this.chartview&&null!=this.chartview&&(e==i.ChartType.Table?this.chartview.style.display="none":this.chartview.style.display="block")},e.prototype.updateDataType=function(e){this.isUserWise=e,this.myXmlData&&(this.isUserWise?(this.currentList="Current Users",this.allList="All Users",this.isAllUsers?this.userWiseAllData():this.userWiseCurrentData()):(this.allList="All Rooms",this.currentList="Current Rooms",this.isAllUsers?this.classRoomWiseAllData():this.classRoomWiseCurrentData()))},e.prototype.updateChart=function(){for(var e=this,t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);var a=this.myChartDataMatrix.filter((function(e){return"-"!==e[0]&&"--"!==e[0]}));this.chartDataTable=a,console.log("this.myChartDataMatrix",this.myChartDataMatrix),this.myChartOptions={tooltip:{trigger:"none"},colors:["#ff7f0e","#2ca02c","#8c564b","#d62728","#bcbd22","#17becf"],timeline:{colorByRowLabel:!0,barLabelStyle:{fontSize:7}},hAxis:{format:"HH:mm a"}},setTimeout((function(){e.myChartHeight=e.AllrowHeight+100}),1e3)},e.prototype.calulateTotalDuration=function(e){console.log("detailViewMatrix--\x3e",e);var t,a=e.filter((function(e){return"-"!==e.userName&&"--"!==e.userName}));e=a;var i=new Array;if(i=[],this.totalChartDataMatrix=[],this.isUserWise)for(var r=0;r<e.length;r++)t={name:e[r].userName,value:parseInt(e[r].duration)},i.push(t);else for(r=0;r<e.length;r++)t={name:e[r].terminalIP,value:parseInt(e[r].duration)},i.push(t);var s={};(i=u(new Set(i))).forEach((function(e){s[e.name]?s[e.name].value=s[e.name].value+e.value:s[e.name]=e}));var o=Object.values(s),n=new Array;n=[],o.forEach((function(e){n.push(e.value)}));for(r=0;r<n.length;r++){var l=[this.timeConvert(n[r]).toString()+" hrs"];this.totalChartDataMatrix.push(l)}},e.prototype.timeConvert=function(e){var t=Math.floor(e)/60,a=Math.floor(t),i=60*(t-a);return a+":"+Math.round(i)},e.prototype.removeBlankEntryBar=function(){for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=1e8,a=[],i=0;i<e.length;i++){var r=parseInt(e[i].getAttribute("width"));r<t?(a=[e[i]],t=r):r==t&&a.push(e[i])}for(i=0;i<a.length;i++)a[i].setAttribute("fill","none")},e.prototype.createDivforTotalDurartion=function(){var e=[];this.rowElements=[];for(var t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);for(var a=0;a<this.totalChartDataMatrix.length;a++){var i=this.totalChartDataMatrix[a][0];e.push(i);var r=t.appendChild(document.createElement("div"));r.style["border-bottom"]="1px solid #b7b7b7",r.style["font-family"]="Arial",r.style["font-size"]="13px",r.style["text-align"]="left",r.style["padding-left"]="8px",r.style["padding-right"]="8px",r.style.position="inherit",r.style["background-color"]=a%2?"#e6e6e6":"#ffffff",r.innerHTML=i,this.rowElements.push(r)}},e.prototype.setHeightofDivforTotalDurartion=function(){this.AllrowHeight=0;for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=-1,a=0;a<e.length;a++)if(++t<this.rowElements.length){var i=parseFloat(e[a].getAttribute("height"))+"px";this.AllrowHeight+=parseFloat(e[a].getAttribute("height"));var r=this.rowElements[t];r&&(r.style.height=i,r.style.lineHeight=i)}},e.prototype.onSelectRowData=function(e){var t=e.selection[0],a=t.row;t.column;this.isAllUsers?this.selectedUserData=this.pdService.dataForDetailedView(this.alluserList.fordurationTable,this.resourceDataList,a):this.selectedUserData=this.pdService.dataForDetailedView(this.currentdataList.userConsoleData,this.resourceDataList,a),this.pdService.detailedviewData.next(this.selectedUserData),this.updateChart()},e.prototype.showAllUser=function(){this.pdService.isAllUsers.next(!0),this.isAllUsers=!0,this.isUserWise?this.userWiseAllData():this.classRoomWiseAllData()},e.prototype.showCurrentUser=function(){this.isAllUsers=!1,this.pdService.isAllUsers.next(!1),this.isUserWise?this.userWiseCurrentData():this.classRoomWiseCurrentData()},e.prototype.userWiseCurrentData=function(){var e=this.pdService.userWiseChartData();console.log("chartDataUserWise",e),e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.userWiseAllData=function(){var e=this.alluserList.forChartData;e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.calulateTotalDuration(this.alluserList.fordurationTable))},e.prototype.classRoomWiseCurrentData=function(){var e=this.pdService.classRoomWiseChartData();console.log("classRoomdata",e),e&&e.length>0&&(this.myChartDataMatrix=e,console.log("myChartDataMatrix",this.myChartDataMatrix),this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.classRoomWiseAllData=function(){var e=this.pdService.allRoomsData();e.forChartData&&e.forChartData.length>0&&(this.myChartDataMatrix=e.forChartData,this.updateChart()),e.fordurationTable&&e.fordurationTable.length>0&&this.calulateTotalDuration(e.fordurationTable)},e.prototype.findCurrentUserCount=function(){for(var e=this.currentdataList.userConsoleData,t=new Array,a=0;a<e.length;a++){var i=e[a].userName;t.push(i)}var r=u(new Set(t));this.currentUsers=r.length},e.prototype.findCurrentClassrooms=function(){var e=this.pdService.newGetCurrentClassroomData();return console.log("findCurrentClassrooms",e),e.length},e.prototype.findInstalledClassrooms=function(){return console.log("findInstalledClassrooms",this.currentdataList.schoolTerminalData),this.currentdataList.schoolTerminalData.length},e.prototype.findEligibleUserCount=function(){console.log("findEligibleUserCount",this.currentdataList);for(var e=0,t=this.currentdataList.usersMetadata,a=0;a<t.length;a++){""!==t[a].userSubjects&&(e+=1)}return e},e.prototype.ngOnDestroy=function(){},e}();p.decorators=[{type:t.Component,args:[{selector:"lib-chartview",template:'<div id="pd-chartview-main-container" class="pd-chartview-main-container">\n <div id="userSummary">\n <table class="summaryTable">\n <tbody>\n <tr>\n <td id="totalUsers" class="chartview-navigationbar">\n Total users: {{totalUsers}}\n </td>\n <td id="eligibleUsers" class="chartview-navigationbar">\n Eligible users: {{eligibleUsers}}\n </td>\n <td id="currentUsers" class="chartview-navigationbar">\n Current users: {{currentUsers}}\n </td>\n <td id="totalRooms" class="chartview-navigationbar">\n Installed Classrooms: {{installedClassrooms}}\n </td>\n <td id="currentRooms" class="chartview-navigationbar">\n Current Classrooms: {{currentRooms}}\n </td>\n \x3c!-- <td\n id="currentRooms"\n \n >\n <span id="totalUsers_list" class="activeAll">User List</span>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </div>\n <div id="pd-messageDivContainer" class=\'pd-messageDivContainer\'>\n <div id="pd-messageDiv" class=\'pd-messageDiv\'>Click the bars to view details of content accessed by a teacher.</div>\n <div id="pd-toggleContainer" class="pd-toggleContainer">\n \n <div id="pd-currentUserBtn" class="pd-currentUserBtn-div pd-commonStyleBtn" (click)="showCurrentUser()" [ngStyle]="{ color: isAllUsers ? \'#000000\' : \'#ffffff\' , backgroundColor: isAllUsers ? \'#c4c4c4\' : \'#000000\'}">\n {{currentList}}</div>\n <div id="pd-allUserBtn" class="pd-allUserBtn-div pd-commonStyleBtn" (click)="showAllUser()" [ngStyle]="{ color: isAllUsers ? \'#ffffff\' : \'#000000\' , backgroundColor: isAllUsers ? \'#000000\' : \'#c4c4c4\'}">\n {{allList}}</div>\n </div>\n </div>\n <div id="pd-chartview" class="pd-chartview">\n <div id="myChartDiv">\n <div id="myTimeLine">\n <google-chart\n [type]="myChartType"\n [data]="chartDataTable"\n [options]="myChartOptions"\n [width]="myChartwidth"\n [height]="myChartHeight"\n (select)="onSelectRowData($event)"\n (ready)="myChartReady()"\n > \n </google-chart>\n \n </div>\n <div class="inline babloo" id="labels"></div> \n \n \n </div>\n</div>\n',styles:[".pd-chartview-main-container .pd-chartview{display:block;overflow:scroll;width:100%;height:484px;font-family:Tahoma;font-size:12pt;font-weight:400;color:#666;margin:10 auto;text-align:center;padding-top:1px}.pd-chartview-main-container #userSummary{background:#e0e0e0;margin-top:1px}.pd-chartview-main-container #roomSummary,.pd-chartview-main-container #userSummary{position:relative;width:100%;text-align:center;padding-top:6px;padding-bottom:6px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer{margin-top:1px}.pd-chartview-main-container .pd-messageDivContainer .pd-messageDiv{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:absolute;margin-left:5px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer .pd-toggleContainer{line-height:30px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;float:right;margin:5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-allUserBtn-div{border-radius:0 5px 5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-currentUserBtn-div{border-radius:5px 0 0 5px}.pd-chartview-main-container .pd-messageDivContainer .pd-commonStyleBtn{display:inline-block;cursor:pointer;font-size:12px;width:92px;text-align:center}.pd-chartview-main-container .summaryTable{width:100%;border-collapse:collapse;border-spacing:2px;border-color:grey}.pd-chartview-main-container .activeAll{cursor:pointer;background:none!important;border-radius:13px;border:none;width:64px;height:18px!important;line-height:18px!important;color:#45a1da;margin-right:0!important;padding:1px 5px;vertical-align:sub}.pd-chartview-main-container #myTimeLine{width:89%;height:60%;margin-left:5px;overflow-x:scroll;overflow-y:hidden;float:left}.pd-chartview-main-container #myTimeLine2{width:71px;position:relative;overflow-x:hidden;overflow-y:hidden}.pd-chartview-main-container #myChartDiv{width:100%}.pd-chartview-main-container .chartview-navigationbar{border-collapse:collapse;border-right:1px solid #999;text-align:center}.pd-chartview-main-container #labels{border-right:1px solid #b7b7b7;border-top:1px solid #b7b7b7;width:10%;float:left;font-size:1.2vw;overflow-x:hidden;overflow-y:hidden}.inline{vertical-align:top;position:relative}"]}]}],p.ctorParameters=function(){return[{type:l}]},p.propDecorators={data:[{type:t.Input}]};var m=function(){function e(e){this.pdService=e,this.userMetadataHeadingArray=["Name:","Start Time:","Subject:","End Time:","Room Details:"],this.resourseMetadataHeadingArray=["Subject","Class","Chapter Name","Topic Name","Assets Details"]}return e.prototype.ngOnInit=function(){var e=this;this.deatilViewContainer=document.getElementById("pd-deatilViewContainer"),this.deatilViewTable=document.getElementById("pd-deatilViewTable"),this.closeButton=document.getElementById("pd-closeButton"),this.pdService.detailedviewData.subscribe((function(t){t&&(t.userDetails.length>0&&e.createTable(t.userDetails),t.resourceDetails.length>0&&e.createResourcesTable(t.resourceDetails))})),this.deatilViewContainer.style.display="none"},e.prototype.createTable=function(e){for(this.deatilViewContainer.style.display="block";this.deatilViewTable.firstChild;)this.deatilViewTable.removeChild(this.deatilViewTable.lastChild);for(var t=new Array,a=0,i=0;i<e.length;i++){var r=document.createElement("label");r.appendChild(document.createTextNode(this.userMetadataHeadingArray[i])),"undefined"!==r.textContent&&void 0!==r.textContent||(r.textContent=""),t.push(r);var s=document.createElement("label");s.appendChild(document.createTextNode(e[i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var o=document.createElement("table");o.id="userDataTable",o.className="table table-bordered";for(var n=document.createElement("tbody"),l=0;l<e.length/2;l++){var d=document.createElement("tr"),h=void 0;for(i=0;i<4;i++)i%2==0?(h=document.createElement("th")).style["font-weight"]="bold":h=document.createElement("td"),a<t.length&&(h.appendChild(t[a]),d.appendChild(h)),a++;n.appendChild(d),o.appendChild(n),this.deatilViewTable.appendChild(o)}},e.prototype.createResourcesTable=function(e){for(var t=new Array,a=0,i=0;i<this.resourseMetadataHeadingArray.length;i++){(s=document.createElement("label")).appendChild(document.createTextNode(this.resourseMetadataHeadingArray[i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}for(i=0;i<e.length;i++)for(var r=0;r<5;r++){var s;(s=document.createElement("label")).appendChild(document.createTextNode(e[i][r])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var o=document.createElement("table");o.className="table table-bordered",o.id="resoureMetadataTable";var n=document.createElement("tbody");for(r=0;r<=e.length;r++){var l=document.createElement("tr"),d=void 0;for(i=0;i<5;i++)0==r?(d=document.createElement("th")).style["font-weight"]="bold":d=document.createElement("td"),a<t.length&&(d.appendChild(t[a]),l.appendChild(d)),a++;n.appendChild(l),o.appendChild(n),this.deatilViewTable.appendChild(o)}},e.prototype.onCloseBtnClick=function(){this.deatilViewContainer.style.display="none"},e}();m.decorators=[{type:t.Component,args:[{selector:"lib-detailedview",template:'<div id="pd-deatilViewContainer">\n <div class="pd-detailview-header">\n <div class="pd-detailview-title">Details</div>\n <div id="pd-closeButton" (click)="onCloseBtnClick()">+</div>\n </div>\n <div id="pd-deatilViewTable"></div>\n</div>\n',styles:["#pd-deatilViewContainer{position:absolute;background:#fff;box-shadow:0 0 17px #818181;font-size:12px;width:50%;max-height:350px;top:140px;left:230px}#pd-deatilViewContainer .pd-detailview-header{position:relative;width:100%;height:35px;background-color:#e6e6e6}#pd-deatilViewContainer .pd-detailview-title{position:absolute;margin-left:5px;font-size:20px;line-height:35px}#pd-deatilViewContainer #pd-closeButton{width:24px;position:absolute;float:right;right:0;cursor:pointer;height:24px;background:#000;border-radius:12px;color:#fff;line-height:22px;text-align:center;font-size:26px;transform:rotate(45deg);margin:5px}#pd-deatilViewContainer #pd-deatilViewTable{overflow:scroll;scroll-behavior:smooth;height:auto;margin:5px;max-height:300px}"]}]}],m.ctorParameters=function(){return[{type:l}]};var y=function(){function e(){this.resourceTypes=new Array,this.tabName=[{name:"School"},{name:"User Summary"},{name:"Terminal Summary"},{name:"Usage Details"}]}return e.prototype.exportAsExcelFile=function(e,t){for(var a,i={Sheets:{},SheetNames:[]},r=0;r<e.length;r++){var o=s.utils.json_to_sheet(e[r]);i.Sheets[this.tabName[r].name]=o,i.SheetNames.push(this.tabName[r].name)}var n=i;a=s.write(n,{bookType:"xlsx",type:"array"}),this.saveAsExcelFile(a,t)},e.prototype.saveAsExcelFile=function(e,t){var a=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});r.saveAs(a,t+".xlsx")},e.prototype.genarateResourseReqiuredData_Excel=function(e){var t,a=new Array,i=e.resourcesMetadata.resourceMetadata;if(null!=i&&i.length>0)for(var r=0;r<i.length;r++){var s={resouseID:i[r].resourceId,subject:null!=i[r].subject&&null!=i[r].subject.title?i[r].subject.title:"",grade:null!=i[r].grade&&null!=i[r].grade.title?i[r].grade.title:"",chapter:null!=i[r].chapter&&null!=i[r].chapter.title?i[r].chapter.title:"",teachingpoint:null!=i[r].teachingpoint&&null!=i[r].teachingpoint.title?i[r].teachingpoint.title:"",type:t=null!=i[r].type?this.getDisplaytypeValue(i[r].type):"",title:null!=i[r].title?i[r].title:""};a.push(s),this.resourceTypes.push(t)}return this.resourceTypes=u(new Set(this.resourceTypes)),a},e.prototype.genarateUserReqiuredData_Excel=function(e){var t=e.usersConsole.userConsole,a=e.usersMetadata.userMetadata,i=e.schoolTerminals.schoolTerminal,r=new Array,s=new Array,o=new Array,n=new Array;if(null!=a&&a.length>0)for(var l=0;l<a.length;l++){var d={};""!=a[l].userId&&(d={userId:a[l].userId,userName:void 0!==a[l].fullName?a[l].fullName:"",userSubjects:void 0!==a[l].userSubjects?a[l].userSubjects:""},r.push(d))}for(var h=0;h<r.length;h++)r.forEach((function(e){r[h].userName===e.userName&&(s.push(r[h]),r.splice(h,1))}));for(h=0;h<s.length;h++)s[h].userName=s[h].userName+" "+h,r.push(s[h]);if(null!=i&&i.length>0)for(h=0;h<i.length;h++){var c;c={schoolId:void 0!==i[h].schoolId?i[h].schoolId:"",terminalKey:void 0!==i[h].terminalKey?i[h].terminalKey:"",terminalType:void 0!==i[h].terminalType?i[h].terminalType:"",location:void 0!==i[h].metadata?i[h].metadata:""},o.push(c)}if(null!=t&&t.length>0)for(var u=function(e){var a=void 0,i=void 0,s=void 0,l=void 0,d=void 0,h=void 0,c=[],u=[],m=void 0,y=void 0,v=void 0;a=void 0!==t[e].userId?t[e].userId:"",i=void 0!==t[e].startTime?t[e].startTime:"",void 0!==t[e].endTime?(s=t[e].endTime,p.myEndTime=s):s="",void 0!==t[e].selectedDate&&t[e].selectedDate,l=void 0!==t[e].duration?t[e].duration:"",d=void 0!==t[e].terminalIP?t[e].terminalIP:"",null!=(h=void 0!==t[e].userConsoleResources?t[e].userConsoleResources:null)&&(void 0!==h.userConsoleResource?h.userConsoleResource.forEach((function(e){c.push(e.resourceId),u.push(e.duration)})):(c=[],u=[]));for(var g=0;g<r.length;g++)a===r[g].userId&&(m=r[g].userName,y=r[g].userSubjects);for(var f=0;f<o.length;f++)d===o[f].terminalKey&&(v=o[f].location);var b={userId:a,userName:m,startTime:new Date(i),endTime:new Date(s),terminalIP:d,resourceMetauserConsoleData:c,duration:l,terminalLocation:v,userSubjects:y,resourceDurationFromConsole:u};n.push(b)},p=this,m=0;m<t.length;m++)u(m);return{usersMetadata:r,schoolTerminalData:o,userConsoleData:n}},e.prototype.deatilData_Excel=function(e,t){var a,i=new Array;i=[];for(var r=0;r<e.length;r++){var s,o,n,l,d,h=void 0,c=void 0,u=void 0,p=void 0,m=void 0,y=new Array;s=e[r].userId,m=e[r].userSubjects,p=e[r].userName,null!=e[r].startTime&&""!=e[r].startTime&&null!=e[r].endTime&&""!=e[r].endTime&&(h=e[r].startTime.toLocaleTimeString("en-US",{hour12:!0}),c=e[r].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[r].startTime.getDate()+"/"+(e[r].startTime.getMonth()+1)+"/"+e[r].startTime.getFullYear()),u=Math.floor(e[r].duration);n=e[r].terminalLocation,o=e[r].terminalIP;var v=n,g=o;if(l=e[r].resourceMetauserConsoleData,d=e[r].resourceDurationFromConsole,0==l.length)y=[p,m,a,h,c,u,v,g,"","","","","","",s],i.push(y);else for(var f=0;f<l.length;f++)for(var b=0;b<t.length;b++)l[f]===t[b].resouseID&&(y=[p,m,a,h,c,u,v,g,t[b].subject,t[b].grade,t[b].chapter,t[b].teachingpoint,t[b].title,this.getDisplaytypeValue(t[b].type),s,d[f]],i.push(y),p="",m="",a="",h="",c="",v="",g="",u="")}return i},e.prototype.deatilUsage_Excel=function(e){var t=[];if(e.length>0)for(var a=0;a<e.length;a++){var i={Name:e[a][0],Subjects:e[a][1],Date:e[a][2],startTime:e[a][3],endTime:e[a][4],"duration(mins)":e[a][5],location:e[a][6],IP:e[a][7],subjectTitle:e[a][8],gradeTitle:e[a][9],Chapter:e[a][10],tpTitle:e[a][11],resourceTitle:e[a][12],resourceType:e[a][13],"resourceDuration(sec)":e[a][15]};t.push(i)}return t},e.prototype.userSummary_Excel=function(e,t){for(var a=e.usersMetadata.userMetadata,i=new Array,r=new Array,s=new Array,o=new Array,n=new Array,l=new Array,d=new Array,h=0,c=0;c<a.length;c++){i=[],r=[],o=[],n=[],l=[],d=[],h=0;for(var p=0;p<t.length;p++)a[c].userId===t[p][14]&&(""!=t[p][12]&&i.push(t[p][12]),""!=t[p][13]&&r.push(t[p][13]),""!=t[p][5]&&(h+=t[p][5]),o.push(t[p][6]),n.push(t[p][2]),l.push(t[p][9]),d.push(t[p][8]));var m=void 0,y=void 0,v=void 0,g=void 0,f=void 0;m=o.length>0?u(new Set(o))[0]:"",f=n.length>0?u(new Set(n)).length:"",y=n.length>0?u(new Set(n))[0]:"",v=l.length>0?u(new Set(l))[0]:"",g=d.length>0?u(new Set(d))[0]:"";var b={Name:a[c].fullName,Subjects:a[c].userSubjects,duration:h,ClassRooms:m,DatesAccess:y,DayAccess:f,Grades:v,SubjectTought:g,AseestUsed:i,AssetType:r};s.push(b)}var D=new Array,w=function(e){var t=[],a=s[e].AssetType;a=u(new Set(a)),s[e].AssetType.forEach((function(e){t[e]=(t[e]||0)+1})),C.resourceTypes.filter((function(e){return!a.includes(e)})).forEach((function(e){t[e]=0}));var i={Name:s[e].Name,Subjects_taught:s[e].Subjects," Duration(mins)":s[e].duration,ClassRooms:s[e].ClassRooms,DaysAccsessed:s[e].DayAccess,DatesAccess:s[e].DatesAccess,Grades:s[e].Grades,Subjects:s[e].SubjectTought},r=Object.assign(i,t);D.push(r)},C=this;for(c=0;c<s.length;c++)w(c);return D},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e}();y.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new y},token:y,providedIn:"root"}),y.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],y.ctorParameters=function(){return[]};var v=function(){function e(e,a){this.excelService=e,this.pdService=a,this.userSelectedDate=new t.EventEmitter,this.refreshTimer=0,this.title="datepicker",this.date=new Date,this.options={inputClass:"input",calendarClass:"datepicker-default",scrollBarColor:"#010001",format:"dd/LL/yyyy",maxDate:new Date}}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadData(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.getDefaultDate(),this.startTimer()},e.prototype.getDefaultDate=function(){var e=new Date;this.getDateFormat(e),this.todayDate=this.calenderCurrentDate},e.prototype.dateSelected=function(e){this.getDateFormat(e),this.mydata=null,this.refreshChart()},e.prototype.getDateFormat=function(e){var t,a=e.getDate(),i=e.getMonth()+1;t=i<10?"0"+i:i;var r=e.getFullYear()+"-"+t+"-"+(a<10?"0"+a:a);this.currentDate=r,this.calenderCurrentDate=r.split("-").reverse().join("-")},e.prototype.refreshChart=function(){this.stopTimer(),this.refreshTimer=0,this.calenderCurrentDate===this.todayDate&&this.countDown(),this.userSelectedDate.emit(this.calenderCurrentDate)},e.prototype.startTimer=function(){this.countDown()},e.prototype.stopTimer=function(){this.clearTimer(),this.message=""},e.prototype.clearTimer=function(){this.refreshTimer=0,window.clearInterval(this.intervalId)},e.prototype.countDown=function(){var e=this;console.log("countDown"),this.clearTimer(),this.intervalId=window.setInterval((function(){e.refreshTimer-=1,0===e.refreshTimer?(e.refreshChart(),e.message=""):(e.refreshTimer<0&&(e.refreshTimer=300),e.message=""+e.refreshTimer)}),1e3)},e.prototype.timeConvert=function(e){var t=e/60,a=Math.floor(t),i=60*(t-a);return a+":"+Math.round(i)},e.prototype.loadData=function(e){if(e&&(this.mydata=JSON.parse(e),this.mydata)){var t=this.excelService.genarateUserReqiuredData_Excel(this.mydata).userConsoleData,a=this.excelService.genarateResourseReqiuredData_Excel(this.mydata),i=this.excelService.deatilData_Excel(t,a),r=this.excelService.deatilUsage_Excel(i),s=this.excelService.userSummary_Excel(this.mydata,i),o=this.mydata.schoolMetadata.school,n=r,l=this.mydata.schoolTerminals.schoolTerminal;this.dataList=[[o],s,l,n]}},e.prototype.exportReport=function(){this.mydata&&this.excelService.exportAsExcelFile(this.dataList,"UsageReport-"+this.calenderCurrentDate)},e.prototype.ngOnDestroy=function(){this.clearTimer()},e}();v.decorators=[{type:t.Component,args:[{selector:"lib-header",template:'<div id="pd_header" class="pd_header">\n \n <div *ngIf="message && mydata && (this.todayDate === this.calenderCurrentDate)" id="pd_refeshView" class="pd_refesh_bar">\n <div class="timer_msg"> This page will be refreshed in</div>\n <div class="timer_value"> {{timeConvert(message)}} min</div>\n <div id="pd_refeshBtn" (click)="refreshChart()"> Refresh </div>\n </div>\n\n <div id="pd_exportBtn" class="pd_exportButton" *ngIf="mydata"\n [ngClass]="{\'pd_exportButton_shiftRight\': this.todayDate != this.calenderCurrentDate}" (click)="exportReport()"> \n <span class="pd_exportButton_text">Download Report</span>\n <div class="pd_download_icon"></div>\n </div>\n \n <div class="pd_header_calendar">\n \x3c!-- <input type="Date" [max]="currentDate" [value]="currentDate" id="myCalendar" (input)="selectDate($event)" /> --\x3e\n <ngx-datepicker [(ngModel)]="date" [options]="options" (ngModelChange)="dateSelected($event)"></ngx-datepicker>\n </div>\n <div class="pd_header_content" >Realtime usage data</div>\n</div>\n',styles:['.pd_header{width:100%;background-color:#e0e0e0;height:50px;border-bottom:2px solid #fff}.pd_header_calendar{position:absolute;width:150px;margin:5px 5px 5px 17px}.pd_header_content{position:relative;width:350px;margin:0 auto;color:#000;text-align:center;font-size:30px;line-height:50px;pointer-events:none}.pd_exportButton{position:absolute;display:inline-block;right:144px;padding:0 16px;cursor:pointer;margin:9px 0 0;height:30px;width:160px;line-height:30px;background-color:#4285f9;font-size:10pt;font-weight:400;transition:right .5s;border-radius:5px;color:#fff;font-weight:700}.pd_exportButton_shiftRight{right:10px}.pd_download_icon{position:absolute;width:16px;height:16px;background-size:100% 100%;top:8px;background-repeat:no-repeat;display:inline-block;right:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAAY0lEQVRIiWNgGOqAkQS1/8nRy0SCBWSBUQtGLRjiFpQzQDIXDKMDZLl6ch2Abgk2TLbhxFhCseH4LKGa4dgsIdpwZhIsOMoAKUEPMjAwNJLktFGADyDXStgyE8Vm07yoGPoAAH1UItbw1O5lAAAAAElFTkSuQmCC")}.pd_exportButton_text{position:relative;display:inline-block;width:130px}.pd_refesh_bar{position:absolute;color:#000;width:120px;height:78px;right:15px;top:4px;z-index:2;background-color:#fff;float:right;text-align:center;font-size:12px;border-radius:.25rem;border:1px solid #a09898;box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-animation:refreshViewAnimate .6s;animation:refreshViewAnimate .6s}@-webkit-keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}@keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}.timer_msg{position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:14px;top:2px}.timer_value{font-weight:700;font-size:15px}#pd_refeshBtn,.timer_value{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;top:28px}#pd_refeshBtn{background-color:#2172f6;cursor:pointer;width:60px;margin:0 auto;border-radius:3px;color:#fff;height:22px;line-height:20px}#pd_refeshBtn:hover{opacity:.6}::ng-deep.bs-datepicker{margin-left:200px}.bs-datepicker-body table td span.selected,.theme-default .bs-datepicker-body table td.selected span,.theme-default .bs-datepicker-body table td[class*=select-] span:after,.theme-default .bs-datepicker-body table td span[class*=select-]:after{background-color:#000}.bs-datepicker-head{background-color:#000!important}']}]}],v.ctorParameters=function(){return[{type:y},{type:l}]},v.propDecorators={data:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var g=function(){function e(e){this.pdService=e,this.myChartType=i.ChartType.Table,this.isUserWise=!0}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadTable(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadTable=function(e){var t=this;if(e&&(this.myXmlData=JSON.parse(e),this.myXmlData)){console.log("AAA myXmlData--\x3e>",this.myXmlData);var a=this.pdService.genarateUserReqiuredData(this.myXmlData);this.currentdataList=a.userConsoleData;var i=this.pdService.allUserChartData();this.alluserList=i.fordurationTable,this.currentResoursedataList=this.pdService.genarateResourseReqiuredData(this.myXmlData),console.log("AAA genarateUserReqiuredData--\x3e>",a),console.log("AAA this.currentResoursedataList--\x3e>",this.currentResoursedataList)}this.tableViewDiv=document.getElementById("tableViewDiv"),this.tableRow=document.getElementById("tableRow"),this.tblBody=document.getElementById("tblBody"),this.tableViewDiv.style.display="none",this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),this.pdService.isAllUsers.subscribe((function(e){e?t.showAllUser():t.showCurrentDataUser()}))},e.prototype.findAndSimplifyNestedArray=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t])){var a=e[t];return a.every((function(e){return Array.isArray(e)&&e.every((function(t){return t===e[0]}))}))&&(e[t]=[[a[0][0]]]),e[t]}return"No nested array found."},e.prototype.showCurrentDataUser=function(){var e;this.tableViewData=this.pdService.dataForTableView(this.currentdataList,this.currentResoursedataList);for(var t=0;t<this.tableViewData.length;t++)(e=this.findAndSimplifyNestedArray(this.tableViewData[t]))[e.length-1]=e[e.length-1][0];for(var a=0;a<this.tableViewData.length;a++)this.mergerSourceWithRoomData(this.tableViewData[a]);this.tableViewData&&this.ueserWiseTableView(this.tableViewData),console.log("AAA mlaunchedFromm tableViewData",this.tableViewData)},e.prototype.mergerSourceWithRoomData=function(e){var t=e[e.length-1].join(" ");"ce6"===t?t='<span style="color:black;"></span>':"ce6-a"===t&&(t='<span style="color:black;font-weight:bold;font-size:14px;"><i class="fa fa-android" aria-hidden="true"></i></span>'),e[6]='<div style="display: flex;flex-direction: row;align-content: center;justify-content: flex-start;align-items: center;"><span style="font-size:11px !important;color:gray;font-weight:600;">'+e[6]+'</span><span style="color:transparent">-</span>'+t+"</div>",e.pop()},e.prototype.showAllUser=function(){var e;this.tableViewData=this.pdService.dataForTableView(this.alluserList,this.currentResoursedataList);for(var t=0;t<this.tableViewData.length;t++)(e=this.findAndSimplifyNestedArray(this.tableViewData[t]))[e.length-1]&&(e[e.length-1]=e[e.length-1][0]);for(var a=0;a<this.tableViewData.length;a++)this.mergerSourceWithRoomData(this.tableViewData[a]);this.tableViewData&&this.ueserWiseTableView(this.tableViewData)},e.prototype.updateDataType=function(e){this.isUserWise=e},e.prototype.updateChartType=function(e){this.myChartType=e,this.myChartType==i.ChartType.Timeline?this.tableViewDiv.style.display="none":this.tableViewDiv.style.display="block"},e.prototype.ueserWiseTableView=function(e){console.log("AAA resoureMetadata",e),document.getElementById("tblBody").innerHTML="";for(var t=new Array,a=0,i=0;i<e.length;i++)for(var r=0;r<12;r++){var s=document.createElement("div");s.innerHTML=e[i][r],console.log("label.textContent",s.textContent),"undefined"!==s.textContent&&void 0!==s.textContent&&"undefined\nce6-a"!==s.textContent&&"undefined\nce6"!==s.textContent&&"undefined\n"!==s.textContent&&"undefined\nAndroid"!==s.textContent&&"undefined\nWeb"!==s.textContent&&"undefined\n"!==s.textContent&&"\nundefined"!==s.textContent&&" undefined"!==s.textContent&&"undefined-"!==s.textContent||(s.textContent=""),t.push(s)}for(r=0;r<=e.length;r++){var o=document.createElement("tr"),n=void 0;for(i=0;i<12;i++)n=document.createElement("td"),a<t.length&&(n.appendChild(t[a]),o.appendChild(n)),a++;this.tblBody.appendChild(o)}},e}();g.decorators=[{type:t.Component,args:[{selector:"lib-tableview",template:'\n <div id="tableViewDiv" class="pd-tableViewDiv">\n \n <table class="table table-bordered" id="tableRow">\n <thead class="table-head">\n <tr class="table-headerRow">\n <th scope="col">Teacher Name</th>\n <th scope="col">Subjects</th>\n <th scope="col">Date</th>\n <th scope="col">Start Time</th>\n <th scope="col">End Time</th>\n <th scope="col">Duration (mins)</th>\n <th scope="col">Room</th>\n <th scope="col">Subject</th>\n <th scope="col">Topic of Class</th>\n <th scope="col">Chapter Name</th>\n <th scope="col">Topic Name</th>\n <th scope="col">Assets Details</th>\n \n </tr>\n </thead>\n <tbody id="tblBody">\n \n </tbody>\n </table>\n </div>\n \n',styles:[".pd-tableViewDiv{width:100%;height:744px;overflow:scroll}.pd-tableViewDiv #tableRow{font-size:small;width:100%;margin-left:24px;margin-top:10px}.pd-tableViewDiv .table-headerRow{font-weight:700}.pd-tableViewDiv .table-head{position:sticky;top:0;background:#fff}.roomCell{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center}"]}]}],g.ctorParameters=function(){return[{type:l}]},g.propDecorators={data:[{type:t.Input}]};var f=function(){};f.decorators=[{type:t.NgModule,args:[{declarations:[h,p,m,v,g,d],imports:[o.CommonModule,i.GoogleChartsModule,n.DatepickerModule],exports:[d]}]}],e.PrincipalDashboardLibV2Component=d,e.PrincipalDashboardLibV2Module=f,e.PrincipalDashboardLibV2Service=l,e.ɵa=h,e.ɵb=p,e.ɵc=m,e.ɵd=v,e.ɵe=y,e.ɵf=g,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=principal-dashboard-lib-v2.umd.min.js.map