angular.module("Wizdom365.Employees",[]).config(["$compileProvider",function(o){}]);
angular.module("Wizdom365.Employees").directive("wizdom365Employees",[function(){return{scope:{},template:'<div class="wizdom-employees bootstrap-wrapper">\n                            <div class="webpart-edit-button-container" ng-if="editMode">\n                                <button class="editWebpartButton btn" ng-click="editWebpart()" type="button" title=\'{{"Edit Webpart" | translate}}\'>\n                                    <span class="ms-Icon ms-Icon--Edit"></span><span class="editWebpartButtonText">{{"Edit" | translate}}</span>\n                                </button>\n                            </div>\n                        	<div ng-show="dataReady && data.length > 0">\n                        		<div wizdom-include=\'webpartProperties.templateUrl\'></div>\n                        	</div>\n                        	<div ng-hide="dataReady">\n                        	</div>\n                        </div>',link:function(e,t,r){},controller:["$scope","$element","$attrs","webpartPropertiesService","$filter","contextInfo","employeesApi","$modal",function(e,t,r,a,s,o,i,n){function p(){e.text=e.webpartProperties.text;var t={field:e.webpartProperties.field,days:e.webpartProperties.days,users:e.webpartProperties.users,department:e.webpartProperties.department,useUsersDepartment:e.webpartProperties.useUsersDepartment,location:e.webpartProperties.location,useUsersLocation:e.webpartProperties.useUsersLocation};i.getEmployees(t).then(function(t){e.data=t,e.data.length>0&&(e.hideWebpart=!1),e.dataReady=!0})}e.webpartId=a.getWebpartId(t),e.editMode=a.isInEditMode(t),a.hideEditCode(t);var d=r.webpartProperties?JSON.parse(r.webpartProperties):null;e.webpartProperties={field:d&&d.field||"w365HireDate",days:d&&d.days||7,users:d&&d.users||3,text:d&&d.text||s("translate")("Hired"),useUsersDepartment:d&&d.useUsersDepartment||!1,department:d&&d.department||"",useUsersLocation:d&&d.useUsersLocation||!1,location:d&&d.location||"",templateUrl:d&&d.templateUrl||"Employees/Templates/ViewTemplates/default.html"},a.toggleWebpart(t,!1),e.$watch("hideWebpart",function(e,r){void 0!=e&&a.toggleWebpart(t,!e)},!0),e.dataReady=!1,e.data=[],e.editWebpart=function(){n.open({templateUrl:"Employees/Templates/Dialogs/EditWebpart.html",controller:"employeeEditCtrl",windowClass:"bootstrap-wrapper",resolve:{webpartId:function(){return e.webpartId},webpartProperties:function(){return e.webpartProperties}}}).result.then(function(t){t&&(e.webpartProperties=t,p())})},p()}]}}]);
!function(){function e(e){var s={baseUrl:"api/wizdom/Employees",allowBatching:!1,getEmployees:function(s){return e.get(this.baseUrl+"?field="+s.field+"&days="+s.days+"&users="+s.users+"&department="+s.department+"&useUsersDepartment="+s.useUsersDepartment+"&location="+s.location+"&useUsersLocation="+s.useUsersLocation,this.allowBatching)}};return s}angular.module("Wizdom365.Employees").factory("employeesApi",e),e.$inject=["webapiService"]}();
angular.module("Wizdom365").requires.push("Wizdom365.Employees");
angular.module("Wizdom365").run(["$templateCache", function($templateCache) {if($templateCache.get('Employees/Templates/ViewTemplates/default.html') == null) $templateCache.put('Employees/Templates/ViewTemplates/default.html','<div ng-show=\"dataReady\" class=\"wizdom-employees-main\">\r\n\r\n	<div ng-repeat=\"user in data\">\r\n\r\n\r\n		<div class=\"wizdom-employees-row\">\r\n			<div class=\"wizdom-employees-imgColumn\">\r\n				<div wizdom365-presence-picture=\"\" size=\"AVATAR\" accountname=\"user.accountName\" email=\"user.email\" name=\"user.name\" image=\"user.pictureURL\"></div>\r\n			</div>\r\n\r\n			<div class=\"wizdom-employees-textColumn\">\r\n				<div class=\"name\"><a ng-href=\"{{user.publicUrl}}\">{{user.name}}</a></div>\r\n				<section>\r\n					<div class=\"department\" ng-show=\"user.department.length\"><b>{{\'Department\' | translate}}:</b> {{user.department}}</div>\r\n					<div class=\"workedsince\" ng-show=\"user.date.length\"><b>{{text}}: </b> {{user.date | wizdom365PhonebookDateFilter | date: \'shortDate\'}}</div>\r\n				</section>\r\n			</div>\r\n\r\n		</div>\r\n	</div>\r\n\r\n</div>');}]);