angular.module("Wizdom365.ProfileProgress",[]);
!function(e){function t(e){return{scope:{},template:'<div class="wizdom-profileProgress bootstrap-wrapper" ng-class="responsiveClass">\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">\n                                <div wizdom-include=\'webpartProperties.templateUrl\'></div>\n                            </div>\n                            <div ng-hide="dataReady">\n                            </div>\n                        </div>',controller:r}}function r(t,r,a,o,s,i,p,n,d,l,c){function u(){t.webpartId=c.getWebpartId(r),t.editMode=c.isInEditMode(r),c.hideEditCode(r),c.toggleWebpart(r,!1),t.$watch("hideWebpart",function(e,t){void 0!=e&&c.toggleWebpart(r,!e)},!0);var e=a.webpartProperties?JSON.parse(a.webpartProperties):null;t.webpartProperties={props:e&&e.props||[],templateUrl:e&&e.templateUrl||"ProfileProgress/Templates/ViewTemplates/default.html"}}function b(){var a=e("#SuiteNavUserName").html(),p=l.getItem("profileProgress:"+t.webpartId);t.data={procent:0,user:{accountName:o.userLoginName,name:a}},a&&null!=p&&(t.data.procent=p,t.dataReady=!0),t.data.procent<100&&(t.hideWebpart=!1),e.isArray(t.webpartProperties.props)||(t.webpartProperties.props=[]),s.progress.getProfileProgress(t.webpartId,t.webpartProperties.props).then(function(e){t.data.editLink=e.editLink,t.data.user.accountName||(t.data.user.accountName=e.user.accountName),t.data.user.name||(t.data.user.name=e.user.name),t.data.user.email||(t.data.user.email=e.user.email),t.data.user.publicUrl||(t.data.user.publicUrl=e.user.publicUrl),t.data.user.pictureURL||(t.data.user.pictureURL=e.user.pictureURL);var a=e.procent;l.setItem("profileProgress:"+t.webpartId,a),i(function(){t.data.procent=a},300),e.procent<100&&(t.hideWebpart=!1),t.dataReady=!0,d.onResponsizeChange(r,function(e){t.responsiveClass=e,t.$applyAsync()})})}u(),t.dataReady=!1,t.editWebpart=function(){n.open({templateUrl:"ProfileProgress/Templates/Dialogs/editWebpart.html",controller:"Wizdom365ProfileProgressEditWebpartController",windowClass:"bootstrap-wrapper",resolve:{webpartId:function(){return t.webpartId}}}).result.then(function(e){e&&(t.webpartProperties=e,b())},function(e){})},t.data={user:{}},t.clearCache=function(){e.isArray(t.webpartProperties.props)||(t.webpartProperties.props=[]),s.progress.clearCache(t.webpartId,t.webpartProperties.props)},b()}angular.module("Wizdom365.ProfileProgress").directive("wizdom365ProfileProgress",t),t.$inject=["webpartPropertiesService"],r.$inject=["$scope","$element","$attrs","contextInfo","profileProgressApi","$timeout","$filter","$modal","responsive","localStorageService","webpartPropertiesService"]}(jQuery);
!function(){function r(r){var e={progress:{baseUrl:"api/wizdom/profileProgress/progress",getProfileProgress:function(e,o){return r.getAppCached(this.baseUrl+"/"+e+"?props="+o)},clearCache:function(e,o){return r.put(this.baseUrl+"/"+e+"/ClearCache?props="+o)}},properties:{baseUrl:"api/wizdom/profileProgress/properties",getProfileProperties:function(){return r.get(this.baseUrl)}}};return e}angular.module("Wizdom365.ProfileProgress").factory("profileProgressApi",r),r.$inject=["webapiService"]}();
angular.module("Wizdom365").requires.push("Wizdom365.ProfileProgress");
angular.module("Wizdom365").run(["$templateCache", function($templateCache) {if($templateCache.get('ProfileProgress/Templates/ViewTemplates/default.html') == null) $templateCache.put('ProfileProgress/Templates/ViewTemplates/default.html','<div ng-show=\"dataReady\" class=\"wizdom-profileProgress-main\">\r\n    <div class=\"wizdom-profileProgress-row\">\r\n        <div class=\"wizdom-profileProgress-imgColumn\">\r\n            <!--<div wizdom365-presence-picture size=\"AVATAR\" accountname=\"data.user.accountName\" name=\"data.user.name\"></div>-->\r\n            <div wizdom365-presence-picture\r\n                 size=\"AVATAR\"\r\n                 email=\"data.user.email\"\r\n                 accountname=\"data.user.accountName\"\r\n                 name=\"data.user.name\"\r\n                 url=\"data.user.publicUrl\"\r\n                 image=\"data.user.pictureURL\"></div>\r\n        </div>\r\n        <div class=\"wizdom-profileProgress-textColumn\">\r\n            <div class=\"name\">{{data.user.name}}</div>\r\n            <section>\r\n                <div class=\"wizdom-profileProgress-bar-container\">\r\n                    <div class=\"wizdom-profileProgress-colored-bar\" ng-class=\"{zero: data.procent==0, mid:30<data.procent && data.procent<70, high:70<data.procent}\" ng-style=\"{width: data.procent == 0 ? \'100%\' : data.procent + \'%\'}\">\r\n                        {{data.procent}}%\r\n                    </div>\r\n                </div>\r\n            </section>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div ng-show=\"dataReady\" class=\"container-fluid wizdom-profileProgress-editProfile wizdom-fullwidth\">\r\n    <div class=\"row\">\r\n        <a ng-click=\"clearCache()\" ng-href=\"{{data.editLink}}\" target=\"_blank\">{{\'Add information to your profile\' | translate}}</a>\r\n    </div>\r\n</div>');}]);