function isValidBrowserInformation(){var i=get_browser(),n=i.name.toLowerCase(),t=parseInt(i.version);return n==="msie"&&t<=8||n==="chrome"&&t<50||n==="safari"&&t<9?!1:!0}function get_browser(){var i=navigator.userAgent,t,n=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?(t=/\brv[ :]+(\d+)/g.exec(i)||[],{name:"IE",version:t[1]||""}):n[1]==="Chrome"&&(t=i.match(/\bOPR\/(\d+)/),t!=null)?{name:"Opera",version:t[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(t=i.match(/version\/(\d+)/i))!=null&&n.splice(1,1,t[1]),{name:n[0],version:n[1]})}function getQueryString(n,t){var u,i,r,f;return(t||(t=window.location.href),n=n.replace(/[\[\]]/g,"\\$&"),u=new RegExp("[?&]("+n+")(=([^&#]*)|&|#|$)","i"),i=u.exec(t),!i)?null:(r={},i[3]?(f=decodeURIComponent(i[3].replace(/\+/g," ")),r[i[1]]=f):r[i[1]]="",r)}function getQueryStringValue(n,t){var i=getQueryString(n,t);return i?Object.keys(i).map(function(n){return i[n]})[0]:null}function redirect(n){window.location.replace(n)}var url_forgotPassword="/account/forgotpassword",url_login="/account/login",url_logout="/account/logout",url_resetPassword="/account/resetpassword",api="/api",api_nav_get=api+"/navApi",api_user_search=api+"/userApi/search?pageSize={pageSize}&pageNo={pageNo}&sort={sort}&keyword={keyword}&browserTimeZone={tz}",api_resource_add=api+"/resourceApi/addResource",api_resource_get=api+"/resourceApi/getResource/{id}",api_resource_delete=api+"/resourceApi/deleteResource/{id}",api_resource_update=api+"/resourceApi/editResource",api_resource_search=api+"/resourceApi/searchResource?pageSize={pageSize}&pageNo={pageNo}&sort={sort}&keyword={keyword?}",api_resource_getHcpRecommenededResources=api+"/resourceApi/getHcpRecommendedResource/{userId}",api_clinic_add=api+"/clinicApi/addClinic",api_clinic_get=api+"/clinicApi/getClinic/{id}",api_clinic_delete=api+"/clinicApi/deleteClinic/{id}",api_clinic_update=api+"/clinicApi/editClinic",api_clinic_search=api+"/clinicApi/searchClinic/{pageSize}/{pageNo}/{sort}/{keyword?}",api_lookup_byType=api+"/lookupApi/{0}",api_lookup_brand=api+"/lookupApi/brand",api_lookup_enum=api+"/lookupApi/enum?listEnumName={0}",api_clinics_search=api+"/clinicApi/byname?pageSize={0}&pageNo={1}&name={2}&tz={3}&exceptIds={4}",api_education=api+"/education/landing",api_evaluation_completed=api+"/education/isCourseEvaluationCompleted/{educationCourseId}",api_education_hcp=api+"/education/hcp/landing",api_education_nonHcp=api+"/education/landing",api_get_educationCourseDetails=api+"/education/courseDetails/{courseId}",api_submit_survey=api+"/education/submitSurvey/{courseId}/{educationModuleId}",api_totalface_evaluation=api+"/education/totalface/evaluation",api_totalface_training=api+"/education/totalface/training",api_totalface_training_videos=api+"/education/totalface/trainingVideos",api_facialAnatomy_evaluation=api+"/education/facialAnatomy/evaluation",api_facialAnatomy_training=api+"/education/facialAnatomy/training",api_facialAnatomy_training_videos=api+"/education/facialAnatomy/trainingVideos",api_botox_evaluation=api+"/education/botox/evaluation",api_botox_training=api+"/education/botox/training",api_botox_training_videos=api+"/education/botox/trainingVideos",api_botox_unlock_evaluation=api+"/education/botox/unlockEducationModule/{courseId}/{moduleId}",api_belkyra_training=api+"/education/belkyra/training",api_belkyra_evaluation=api+"/education/belkyra/evaluation",api_belkyra_training_videos=api+"/education/belkyra/trainingVideos",api_belkyra_unlock_evaluation=api+"/education/belkyra/unlockEducationModule/{courseId}/{moduleId}",api_Juvederm_training=api+"/education/juvederm/trainingImages",api_Juvederm_evaluation=api+"/education/juvederm/evaluation",api_juvederm_training_videos=api+"/education/juvederm/trainingVideos",api_Juvederm_quiz=api+"/education/juvederm/quiz",api_Juvederm_part_one_training=api+"/education/juvedermPartOne/trainingImages",api_Juvederm_part_one_evaluation=api+"/education/juvedermPartOne/evaluation",api_Juvederm_part_one_training_videos=api+"/education/juvedermPartOne/trainingVideos",api_juvederm_part_one_completeIntroductoryTechniquesVC=api+"/education/juvedermPartOne/completeIntroductoryTechniquesVC?courseId={0}&currentModuleId={1}",api_Juvederm_part_two_training=api+"/education/juvedermPartTwo/trainingImages",api_Juvederm_part_two_training_videos=api+"/education/juvedermPartTwo/trainingVideos",api_Juvederm_part_two_complete=api+"/education/juvedermPartTwo/complete",api_Juvederm_intermediate_training=api+"/education/juvedermIntermediate/trainingImages",api_Juvederm_intermediate_evaluation=api+"/education/juvedermIntermediate/evaluation",api_Juvederm_intermediate_training_videos=api+"/education/juvedermIntermediate/trainingVideos",api_Juvederm_advanced_training=api+"/education/juvedermAdvanced/trainingImages",api_Juvederm_advanced_evaluation=api+"/education/juvedermAdvanced/evaluation",api_Juvederm_advanced_training_videos=api+"/education/juvedermAdvanced/trainingVideos",api_MDCodes_visionary_training=api+"/education/mdCodesVisionary/trainingImages",api_MDCodes_visionary_evaluation=api+"/education/mdCodesVisionary/evaluation",api_MDCodes_visionary_training_videos=api+"/education/mdCodesVisionary/trainingVideos",api_MDCodes_visionary_complete=api+"/education/mdCodesVisionary/complete",api_MDCodes_Distinction_training=api+"/education/mdCodesDistinction/trainingImages",api_MDCodes_Distinction_evaluation=api+"/education/mdCodesDistinction/evaluation",api_MDCodes_Distinction_training_videos=api+"/education/mdCodesDistinction/trainingVideos",api_MDCodes_Distinction_complete=api+"/education/mdCodesDistinction/complete",api_Volite_training=api+"/education/volite/trainingImages",api_Volite_evaluation=api+"/education/volite/evaluation",api_Volite_training_videos=api+"/education/volite/trainingVideos",api_Volite_complete=api+"/education/volite/complete",api_unlock_hcp_evaluation=api+"/education/unlockHcpEducationCourseModule/{courseId}/{moduleId}",api_complete_hcp_module=api+"/education/completeHcpEducationCourseModule/{courseId}/{moduleId}",api_Juvederm_advanced_jawline=api+"/education/juvedermAdvanced/jawline",api_Juvederm_advanced_midface=api+"/education/juvedermAdvanced/midface",api_Juvederm_advanced_advacedTechniques=api+"/education/juvedermAdvanced/advancedTechniques",api_juvederm_advanced_educationModuleDetails=api+"/education/juvedermAdvanced/getHcpEducationModuleDetails/{courseId}",api_advancedTechniques_saveAdvancedJuvedermCourseStartDate=api+"/education/juvedermAdvanced/saveAdvancedJuvedermCourseStartDate/{courseId}",url_privacy="/privacy",url_contact_us="/contact-us",api_hcp_register=api+"/hcps/register",api_hcp_updateprofile=api+"/hcps/UpdateProfile",api_hcp_updateusername=api+"/hcps/UpdateUserName",api_hcp_updatepassword=api+"/hcps/UpdatePassword",api_my_profile=api+"/hcps/GetProfile",api_hcp_search_by_name=api+"/hcps/searchByname/{name}",api_remove_hcp_resource=api+"/hcps/removeHcpResource/{hcpResource}",api_add_hcp_resource=api+"/hcps/addHcpResource",api_resource_for_practitioner_search=api+"/resourceApi/searchResourcesForPratitioner?pageSize={pageSize}&pageNo={pageNo}&hcpId={hcpId}&sort={sort}&keyword={keyword?}",api_hcp_resource_search=api+"/resourceApi/searchHCPResources?pageSize={pageSize}&pageNo={pageNo}&sort={sort}&keyword={keyword?}",api_get_resourceBrands=api+"/resourceApi/getResourceBrands",api_users_getrolesforaddupdate=api+"/userApi/GetRolesForAddUpdateUser?viewMode={0}",api_users_getById=api+"/userApi/getById?id={0}",api_users_update=api+"/userApi/update",api_hcp_dashboard_education=api+"/hcps/GetDashboardHcpEducationDetails/{userId}",api_users_delete=api+"/userApi/delete",api_users_add=api+"/userApi/add",api_users_getPractitioner=api+"/userApi/GetPractitioner/{0}",api_users_updatePractitioner=api+"/userApi/UpdatePractitioner",api_users_addPractitioner=api+"/userApi/AddPractitioner",api_users_deletePractitioner=api+"/userApi/DeletePractitioner",api_hcp_getPractitionerEducationActivityDetails=api+"/hcps/getPractitionerEducationActivityDetails/{pageSize?}/{pageNo?}/{sort?}/{hcpId}?clientBrowserTimeZone={0}&keyword={1}",api_hcp_isPractitionerEducationActivityDetailsAccessible=api+"/hcps/IsPractitionerEducationActivityDetailsAccessible/{userRole}/{hcpId}",api_hcp_fastTrackDetails=api+"/hcps/saveHcpTrackDetails/{hcpId}?Ids={0}",api_hcp_getHcpAllEducationCourseDetails=api+"/hcps/getHcpAllEducationCourseDetails/{hcpId}",api_hcp_searchInjectorDevelopment=api+"/hcps/searchInjectorDevelopment?hcpId={hcpId}&pageSize={pageSize}&pageNo={pageNo}&sort={sort}&keyword={keyword}&browserTimeZone={tz}",api_hcp_searchInjectorDevelopmentByHcp=api+"/hcps/searchInjectorDevelopmentByHcp?pageSize={pageSize}&pageNo={pageNo}&sort={sort}&keyword={keyword}&browserTimeZone={tz}",api_hcp_addInjectorDevelopmentPlan=api+"/hcps/AddInjectorDevelopmentPlan",api_hcp_getProducts=api+"/hcps/getProducts",api_hcp_exportInjectorDevelopmentPlan=api+"/hcps/ExportInjectorDevelopmentByHcp?startTime={0}&endTime={1}",api_hcp_pathwayAnalytics=api+"/hcps/hcpProgress",api_users_registerApprove=api+"/userApi/registerApprove/{pageSize}/{pageNo}/{sort}",api_users_updateHcpStatus=api+"/userApi/updateHcpStatus/{hcpId}/{status}",api_users_trainingApprove=api+"/userApi/trainingApprove?pageSize={pageSize}&pageNo={pageNo}&sort={sort}&filterOption={filterOption}&keyword={keyword}&browserTimeZone={tz}",api_users_workshopStatus=api+"/userApi/getWorkshopStatus",api_users_updateWorkshopStatus=api+"/userApi/updateWorkshopStatus/{hcpWorkshopId}/{status}",api_users_getEducationActivity=api+"/userApi/educationActivity/{pageSize}/{pageNo}/{sort}",api_users_ProductPurchaseHcps=api+"/userApi/productPurchaseHcps?pageSize={pageSize}&pageNo={pageNo}&sort={sort}&keyword={keyword}&browserTimeZone={tz}",api_users_confirmProductPurchase=api+"/userApi/confirmProductPurchase?id={hcpEducationModuleId}&hcpId={hcp_id}&courseId={course_id}",api_users_unlockEducationCourse=api+"/education/unlockHcpEducationCourse?hcpEducationCourseId={0}&educationCourse={1}&hcpId={2}",api_admin_analytics=api+"/admin/analytics",api_users_getrolesforaddupdate=api+"/userApi/GetRolesForAddUpdateUser?viewMode={0}",api_users_getById=api+"/userApi/getById?id={0}",api_users_update=api+"/userApi/update",api_workshop_search=api+"/WorkshopApi/search?pageSize={pageSize}&pageNo={pageNo}&sort={sort}&keyword={keyword}&browserTimeZone={tz}",api_workshop_add=api+"/WorkshopApi/Add",api_workshop_getById=api+"/WorkshopApi/GetById/{0}",api_workshop_getEducations=api+"/WorkshopApi/GetEducations",api_workshop_addPractitioner=api+"/WorkshopApi/addPractitioner",api_workshop_searchPractitioner=api+"/WorkshopApi/SearchPractitioner?pageSize={0}&pageNo={1}&name={2}&tz={3}&exceptIds={4}",api_workshop_delete=api+"/WorkshopApi/delete",api_workshop_confirmWorkshopPractitioner=api+"/WorkshopApi/confirmWorkshop/{workshopId}/{hcpId}",api_get_my_resource=api+"/myResourceApi/getMyResource",api_search_my_resource=api+"/myResourceApi/searchMyResource?keyword={keyword}",api_search_consumer_resource=api+"/myResourceApi/SearchConsumerResource?keyword={keyword}",api_search_clinic_paper_resource=api+"/myResourceApi/SearchClinicPagerResource?keyword={keyword}",api_search_clinic_paper_hcpResource=api+"/myResourceApi/SearchHcpClinicPagerResource?keyword={keyword}",api_search_video_resource=api+"/myResourceApi/SearchVideoResource?keyword={keyword}",api_search_video_hcpResource=api+"/myResourceApi/SearchVideoHcpResource?keyword={keyword}",api_addFeedback=api+"/Hcps/AddFeedback",api_getFeedback=api+"/Hcps/GetFeedback",api_getProgress=api+"/Hcps/GetProgress",api_hcp_saveGame=api+"/Hcps/saveHcpGame",api_analytics_registerEvent=api+"/analytics/registerEvent",api_analytics_getEducation=api+"/analytics/education",api_analytics_getResource=api+"/analytics/resource",common,CONSTANTS;(function(){"use strict";String.prototype.includes=String.prototype.includes||function(n){return this.indexOf(n)>=0};window.app=angular.module("ALLSYLearningPortal",["ngSanitize","ngStorage","ngAnimate","ui.bootstrap","ui.mask","ui.grid","ui.grid.pagination","ui.grid.autoResize","ng.deviceDetector","vcRecaptcha","toaster","naif.base64","ui.grid.edit","ngTouch","angular-carousel","btorfs.multiselect"]).constant("broadcast","").constant("moment",moment).config(["$httpProvider",function(n){n.interceptors.push("httpInterceptor");n.interceptors.push("antiForgeryInterceptor");n.interceptors.push("documentSvc");n.defaults.headers.common["Cache-Control"]="no-cache";n.defaults.headers.common.Pragma="no-cache";n.defaults.headers.common["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT"}]).config(["uiMask.ConfigProvider",function(n){n.clearOnBlur(!1);n.allowInvalidValue(!0)}]);window.app.run(["$window","$rootScope","httpService","$timeout","documentSvc",function(n,t,i,r,u){t.recaptcha={siteKey:"6LequUkUAAAAAEXrkIOTmq2cUm4IOqCxJSB-h5a8"};t.logOut=function(){i.post(url_logout,null).then(function(){n.location.href=url_login;t.menus=[]})};t.showModal=function(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")};t.menus=[];i.get(api_nav_get).then(function(n){n.data&&(t.menus=n.data.header,t.footers=n.data.footer)});r(function(){u.recalculateHeight()},0);angular.element(n).on("resize",function(){u.recalculateHeight()});n.vcRecaptchaApiLoaded=n.vcRecaptchaApiLoaded||function(){}}]);app.filter("trustUrl",["$sce",function(n){return function(t){return n.trustAsResourceUrl(t)}}])})();Number.isNaN=Number.isNaN||function(n){return n!==n},function(n,t){"use strict";n._arrayBufferToBase64=function(t){for(var r="",u=new Uint8Array(t),f=u.byteLength,i=0;i<f;i++)r+=String.fromCharCode(u[i]);return n.btoa(r)};var i=n.angular.module("naif.base64",[]);i.directive("baseSixtyFourInput",["$window","$q",function(n,i){for(var e,f={onChange:"&",onAfterValidate:"&",parser:"&"},r=["onabort","onerror","onloadstart","onloadend","onprogress","onload"],u=r.length-1;u>=0;u--)e=r[u],f[e]="&";return{restrict:"A",require:"ngModel",scope:f,link:function(u,f,e,o){function c(){for(var f=[],t=s.length-1;t>=0;t--)s[t].deferredObj=i.defer(),f.push(s[t].deferredObj.promise);for(i.all(f).then(w),t=s.length-1;t>=0;t--){var e=new n.FileReader,r=s[t],u={};u.filetype=r.type;u.filename=r.name;u.filesize=r.size;v(e,r,u);e.readAsArrayBuffer(r)}}function l(n){if(e.onChange)if(u.onChange&&typeof u.onChange()=="function")u.onChange()(n,s);else u.onChange(n,s)}function a(n){var r,t;if(e.onAfterValidate){for(r=[],t=s.length-1;t>=0;t--)r.push(s[t].deferredObj.promise);i.all(r).then(function(){if(u.onAfterValidate&&typeof u.onAfterValidate()=="function")u.onAfterValidate()(n,h,s);else u.onAfterValidate(n,h,s)})}}function v(n,t,i){for(var f,o=r.length-1;o>=0;o--)f=r[o],e[f]&&f!=="onload"&&y(f,u[f],n,t,i);n.onload=p(n,t,i)}function y(n,t,i,r,u){i[n]=function(n){t()(n,i,r,s,h,u)}}function p(r,f,o){return function(c){var a=c.target.result,l,v=e.maxsize&&f.size>e.maxsize*1024;if(o.base64=e.doNotParseIfOversize!==t&&v?null:n._arrayBufferToBase64(a),l=e.parser?i.when(u.parser()(f,o)):i.when(o),l.then(function(n){h.push(n);f.deferredObj.resolve()}),e.onload)if(u.onload&&typeof u.onload()=="function")u.onload()(c,r,f,s,h,o);else u.onload(c,s)}}function w(){var n=e.multiple?h:h[0];o.$setViewValue(n);d(n);g(n);b(n);k(n);nt(n)}function b(n){if(e.maxnum&&e.multiple&&n){var t=n.length<=parseInt(e.maxnum);o.$setValidity("maxnum",t)}return n}function k(n){if(e.minnum&&e.multiple&&n){var t=n.length>=parseInt(e.minnum);o.$setValidity("minnum",t)}return n}function d(n){var i=!0,r,t,u;if(e.maxsize&&n){if(r=parseFloat(e.maxsize)*1e3,e.multiple){for(t=0;t<n.length;t++)if(u=n[t],u.filesize>r){i=!1;break}}else i=n.filesize<=r;o.$setValidity("maxsize",i)}return n}function g(n){var i=!0,r=parseFloat(e.minsize)*1e3,t,u;if(e.minsize&&n){if(e.multiple){for(t=0;t<n.length;t++)if(u=n[t],u.filesize<r){i=!1;break}}else i=n.filesize>=r;o.$setValidity("minsize",i)}return n}function nt(n){var i=!0,t,s,r,u,f;if(e.accept&&(s=e.accept.trim().replace(/[,\s]+/gi,"|").replace(/\./g,"\\.").replace(/\/\*/g,"/.*"),t=new RegExp(s,"i")),e.accept&&n){if(e.multiple){for(u=0;u<n.length;u++)if(f=n[u],r="."+f.filename.split(".").pop(),i=t.test(f.filetype)||t.test(r),!i)break}else r="."+n.filename.split(".").pop(),i=t.test(n.filetype)||t.test(r);o.$setValidity("accept",i)}return n}if(o){var s=[],h=[];f.on("change",function(n){n.target.files.length&&(h=[],h=angular.copy(h),s=n.target.files,c(),l(n),a(n))});o.$isEmpty=function(n){return!n||(angular.isArray(n)?n.length===0:!n.base64)};u._clearInput=function(){f[0].value=""};u.$watch(function(){return o.$viewValue},function(n){o.$isEmpty(n)&&u._clearInput()})}}}}])}(window),function(){function n(n,t){return{request:function(n){var t=$('input:hidden[name="__RequestVerificationToken"]').val();return!!t&&t.length>0&&(n.headers?n.headers.__RequestVerificationToken=t:n.headers={__RequestVerificationToken:t}),n},responseError:function(n){return n.status===403&&n.data&&typeof n.data=="string"&&alert(n.data+"\nPlease refresh your browser and try again."),t.reject(n)}}}window.app.factory("antiForgeryInterceptor",n);n.$inject=["$location","$q"]}(),function(){function n(n,t,i){function r(){}function u(n){return i(function(){r()},0),n||$q.when(n)}return{recalculateHeight:r,response:u}}window.app.factory("documentSvc",n);n.$inject=["$window","$filter","$timeout","$q"]}(),function(){"use strict";window.app.factory("httpService",["$http",function(n){return{get:function(t,i){var u={method:"GET",url:t,headers:{"Content-Type":undefined},data:i},r=n(u);return r.error(function(){}),r},download:function(t){var r={method:"GET",cache:!1,url:t,headers:{"Content-Type":"application/json; charset=utf-8"},responseType:"arraybuffer"},i=n(r);return i.error(function(){}),i},post:function(t,i){var u={method:"POST",url:t,headers:{"Content-Type":"application/json"},data:i},r=n(u);return r.error(function(n,t){switch(t){}}),r},putFile:function(t,i,r){var f=new FormData,u;return f.append("file",file),u=n({method:"PUT",url:t,headers:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+r},data:i,transformRequest:function(n,t){var i=new FormData,r;return angular.forEach(n,function(n,t){i.append(t,n)}),r=t(),delete r["Content-Type"],i}}),u.error(function(n,t){switch(t){case 500:NotificationService.ShowError("Internal server error");break;default:NotificationService.ShowError("an error occurred while processing your request. Please try again...")}}),u},put:function(t,i){var u={method:"PUT",url:t,headers:{"Content-Type":"application/json"},data:i},r=n(u);return r.error(function(){location.href=location.href}),r},"delete":function(t,i){var u={method:"DELETE",url:t,headers:{"Content-Type":undefined},data:i},r=n(u);return r.error(function(){location.href=location.href}),r},upload:function(n,t,i,r){return Upload.upload({method:t,url:n,data:i,headers:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+r}})},exportFile:function(t,i){var u={method:"POST",url:t,headers:{"Content-Type":"application/json"},data:i,responseType:"blob"},r=n(u);return r.error(function(){return $q.reject(response.data)}),r}}}])}(),function(){function n(n,t,i,r){function f(f){if(u++,f.url.indexOf("typeahead")<0&&f.url.indexOf("institution")<0&&n.$broadcast("loader_show"),i){var e=i.device=="unknown"?"desktop":i.device,o=i.raw.userAgent;f.headers?(f.headers.AuditDevice=e,f.headers.AuditBrowser=o,f.headers.UserTimeOffset=r().utcOffset(),f.headers["X-Requested-With"]="XMLHttpRequest"):f.headers={AuditDevice:e,AuditBrowser:o,UserTimeOffset:r().utcOffset(),"X-Requested-With":"XMLHttpRequest"}}return f||t.when(f)}function e(i){return--u==0&&n.$broadcast("loader_hide"),i||t.when(i)}function o(){return n.$broadcast("loader_hide"),t.reject(response)}function s(i){return--u||n.$broadcast("loader_hide"),i.status==401&&(location.href="/Error/AccessDenied?ReturnUrl="+encodeURIComponent(location.pathname)+"&Url="+encodeURIComponent(i.config.url)),t.reject(i)}var u=0;return{request:f,requestError:o,responseError:s,response:e}}window.app.factory("httpInterceptor",n);n.$inject=["$rootScope","$q","deviceDetector","moment"]}(),function(){"use strict";window.app.service("modalService",["$uibModal",function(n){var t={backdrop:!0,keyboard:!0,modalFade:!0,templateUrl:"reusableModal.html",windowClass:"reusableModal"},i={closeButtonText:"Close",actionButtonText:"OK",headerText:"Proceed?",bodyText:"Perform this action?",showCloseButton:!0};this.showModal=function(n,t){return n||(n={}),n.backdrop="static",this.show(n,t)};this.show=function(r,u){var f={},e={};return angular.extend(f,t,r),angular.extend(e,i,u),f.controller||(f.controller=["$scope","$uibModalInstance",function(n,t){n.modalOptions=e;n.modalOptions.ok=function(n){t.close(n)};n.modalOptions.close=function(){t.dismiss("cancel")}}]),n.open(f).result}}])}(),function(){function n(){function n(n,t){angular.forEach(n,function(n){var i=n.key==undefined?n.Key==undefined?"":n.Key:n.key;i!=""&&t[i.toLowerCase()+"_error"]===undefined&&(t[i.toLowerCase().replace(".","_")+"_error"]=!0)})}return{build:n}}window.app.factory("modelStateErrorBuilder",n)}(),function(){function n(n,t,i){function r(t,i){i||(i=n.location.href);t=t.replace(/[\[\]]/g,"\\$&");var u=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)"),r=u.exec(i);return r?r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"":null}function u(n){if(n){var r=new Date(n),t=""+(r.getMonth()+1),i=""+r.getDate(),u=r.getFullYear();return t.length<2&&(t="0"+t),i.length<2&&(i="0"+i),[i,t,u].join("/")}}function f(n){if(n){var t=n.split("/");return new Date(parseInt(t[2]),parseInt(t[1])-1,parseInt(t[0])).toISOString()}}function e(n){if(n){var t=n.split("/");return new Date(parseInt(t[2]),parseInt(t[1])-1,parseInt(t[0]))}}function o(n,t,r,u){return{rowHeight:30,enableHorizontalScrollbar:n.scrollbars.NEVER,enableVerticalScrollbar:n.scrollbars.NEVER,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,gridMenuShowHideColumns:!1,enableColumnMenus:!1,paginationPageSizes:[1,5,10,25,50,100],paginationPageSize:t.pageSize,onRegisterApi:function(n){n.core.on.sortChanged(null,function(n,f){if(f.length==0)t.sort=u?u:"id";else{var o=i("orderBy")(f,"sort.priority"),e=[];angular.forEach(o,function(n){var t=n.name;n.sort.direction=="desc"&&(t="-"+t);e.push(t)});t.sort=e.join(",")}r()});n.pagination.on.paginationChanged(null,function(n,i){t.pageNumber=n;t.pageSize=i;r()})}}}function s(n){var t=n.data?n.data.length:0,i=n.paginationPageSize,r=t==0?1:t<i?t:i;return{height:r*30+32+32+"px"}}function h(n){return t.download(n).then(function(n){var i=!1,l=n.headers("Content-Type"),a=n.headers("Content-Disposition"),r="",o,s,f,u,c,t,e;a&&(o=a.match(/.*filename=\"?([^;\"]+)\"?.*/),o[1]&&(r=o[1]));r=r.replace(/[<>:"\/\\|?*]+/g,"_");try{if(t=new Blob([n.data],{type:l}),navigator.msSaveBlob)navigator.msSaveBlob(t,r);else{if(s=navigator.webkitSaveBlob||navigator.mozSaveBlob||navigator.saveBlob,s===undefined)throw"Not supported";s(t,r)}console.log("saveBlob succeeded");i=!0}catch(h){console.log("saveBlob method failed with the following exception:");console.log(h)}if(!i&&(f=window.URL||window.webkitURL||window.mozURL||window.msURL,f)){if(u=document.createElement("a"),"download"in u)try{console.log("Trying download link method with simulated click ...");t=new Blob([n.data],{type:l});e=f.createObjectURL(t);u.setAttribute("href",e);u.setAttribute("download",r);c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null);u.dispatchEvent(c);console.log("Download link method with simulated click succeeded");i=!0}catch(h){console.log("Download link method with simulated click failed with the following exception:");console.log(h)}if(!i)try{console.log("Trying download link method with window.location ...");t=new Blob([n.data],{type:octetStreamMime});e=f.createObjectURL(t);window.location=e;console.log("Download link method with window.location succeeded");i=!0}catch(h){console.log("Download link method with window.location failed with the following exception:");console.log(h)}}i||(console.log("No methods worked for saving the arraybuffer, using last resort window.open"),window.open(httpPath,"_blank",""))})}function c(n){var t;if(n.$error.required!==undefined)for(t=0;t<n.$error.required.length;t++)n.$error.required[t].$setDirty();if(n.$error.requireChecked!==undefined)for(t=0;t<n.$error.requireChecked.length;t++)n.$error.requireChecked[t].$setDirty()}function l(n){var i=[],t;if(arguments.length>1&&arguments[1]&&(i=arguments[1]),t="Password",arguments.length>2&&arguments[2]&&(t=arguments[2]),n!==undefined&&n!==null){if(n.length<8)return i.push({message:t+" must have a minimum of 8 characters"}),!1;if(!/^(?=.*[0-9]).+$/.test(n))return i.push({message:t+" must contain at least one numeric character"}),!1;if(!/^(?=.*[a-zA-Z]).+$/.test(n))return i.push({message:t+" must contain at least 1 letter"}),!1;if(!/^\S+$/.test(n))return i.push({message:t+" must not contain spaces"}),!1;if(!/^(?=.*[A-Z]).+$/.test(n))return i.push({message:t+" must contain at least 1 capital letter"}),!1}return!0}return{getParameterByName:r,convertISODateToDDMMYYYY:u,convertDDMMYYYYToISODate:f,uiGrid:{createDefaultUIGridOptions:o,getTableHeightStyle:s},downloadFileFromApi:h,invalidateControlOnSubmission:c,isPasswordValid:l,convertTextToDate:e}}window.app.factory("utilitySvc",n);n.$inject=["$window","httpService","$filter"]}(),function(){window.app.directive("addressDetails",function(){return{restrict:"E",scope:{labelprepend:"@?",controlprepend:"@?",model:"=",form:"=",states:"=",ngDisabled:"=?",ngRequired:"=?"},link:function(n,t,i){n.disabled=!1;(i.disabled||i.disabled==="")&&(n.disabled=!0);n.required=!1;(i.required||i.required==="")&&(n.required=!0);n.disableInputs=function(){return n.disabled||n.ngDisabled};n.requireInputs=function(){return n.required||n.ngRequired}},templateUrl:"/templates/address.html"}})}(),function(){"use strict";function n(){return{restrict:"E",transclude:{titleLabelTemplate:"titleLabel",controlItemsTemplate:"?controlItems",loadingItemsTemplate:"?loadingItems",noResultsTemplate:"?noResults"},scope:{typeaheadTemplateUrl:"@",typeaheadMinLength:"=?",typeaheadMaxLength:"=?",getItems:"=?",selectItem:"=?",id:"@?",name:"@",placeholder:"@?",ngModel:"=",ngDisabled:"=?",ngRequired:"=?",ngSearchDisabled:"=?",inputTextClass:"=?",advancedGetItems:"&?",advancedSelectItem:"&?"},replace:!0,template:'<div class="form-group">    <label for="{{id}}" ng-transclude="titleLabelTemplate"><\/label>    <div window-resize ng-class="{\'input-group\' : (inputBtnExists && windowWidth >= 768)}">        <input autocomplete="off" type="text" class="form-control typeahead-input-text" id="{{id}}" name="{{name}}" ng-required="required || ngRequired" ng-disabled="disabled || ngDisabled"                uib-typeahead="item.typeahead_displayField for item in onGetItems($viewValue) | limitTo:limitTo" typeahead-template-url="{{typeaheadTemplateUrl}}"                typeahead-on-select="selectItem($item)" typeahead-no-results="noResults" typeahead-loading="loadingItems" aria-autocomplete="list" placeholder="{{placeholder}}"                ng-model="ngModel" typeahead-min-length="typeaheadMinLength" ng-class="inputTextClass" maxlength="{{typeaheadMaxLength}}"/>        <span class="input-group-btn" ng-transclude="controlItemsTemplate"><\/span>    <\/div>    <div ng-if="!(ngSearchDisabled)" id="typeahead_results">        <div ng-transclude="loadingItemsTemplate" ng-if="loadingItems"><i class="glyphicon glyphicon-refresh" style=""><\/i><\/div>        <div ng-transclude="noResultsTemplate" ng-if="ngModel && ngModel != \'\' && ngModel.length >= typeaheadMinLength && noResults"><i class="glyphicon glyphicon-remove"><\/i>No Results Found<\/div>    <\/div><\/div>',compile:function(n,t){function u(n){return n.replace(/\W+/g,"-").replace(/([a-z\d])([A-Z])/g,"$1-$2")}var i=n.html(),r;i=i.replace("typeahead_displayField",t.displayField);t.advancedGetItems&&(i=i.replace("onGetItems($viewValue)",t.advancedGetItems));t.advancedSelectItem&&(i=i.replace("selectItem($item)",t.advancedSelectItem));n.html(i);for(r in t)r[0]!=="$"&&r!=="class"&&n.removeAttr(u(r));return{pre:function(n,t,i){n.inputBtnExists=!1;n.typeaheadMinLength=n.typeaheadMinLength||3;n.disabled=!1;(i.disabled||i.disabled==="")&&(n.disabled=!0);n.required=!1;(i.required||i.required==="")&&(n.required=!0);n.advancedGetItems||(n.onGetItems=function(){if(!n.ngSearchDisabled)return $("#typeahead_results").show(),n.getItems(arguments[0])})},post:function(n,t){var i=t.find("span.input-group-btn").contents();i.length>0&&(n.inputBtnExists=!0)}}}}}window.app.directive("advTypeAheadCtrl",n);n.$inject=["$compile"]}(),function(){window.app.directive("compareTo",function(){return{scope:{targetModel:"=compareTo",compareOperator:"@?compareToOperator",transformFunc:"=?compareToTransformFunc"},require:"ngModel",link:function(n,t,i,r){var u=function(){var i=t.val(),r;if(n.transformFunc&&(i=n.transformFunc(i)),i===undefined||i===null||typeof i=="string"&&i.trim()==="")return!0;if(r=n.targetModel,n.transformFunc&&(r=n.transformFunc(r)),r!==null)if(n.compareOperator)switch(n.compareOperator){case"==":return i==r;case">":return i>r;case"<":return i<r;case">=":return i>=r;case"<=":return i<=r;default:return i===r}else return i===r;return!1};n.$watch(u,function(n){r.$setValidity("compare",n)})}}})}(),function(){window.app.directive("datepicker",function(){return{restrict:"A",controller:"datepickerCtrl",controllerAs:"dp",templateUrl:"app/directive/datepicker.html",scope:{value:"="},link:function(){}}})}(),function(){window.app.directive("dob",function(){return{restrict:"A",require:"ngModel",link:function(n,t,i,r){function u(n){var t=new Date,i=moment(n).add(1,"year").toDate();return i<t}function f(n){var t=r.$isEmpty(n);return t||(t=u(n)),r.$setValidity("dob",t),n}r.$parsers.push(f)}}});window.app.directive("date",["dateFilter",function(n){return{require:"ngModel",link:function(t,i,r,u){var f=r.date||"yyyy-MM-dd";u.$formatters.unshift(function(t){return n(t,f)})}}}])}(),function(){"use strict";function n(n,t,i,r,u){return{restrict:"E",replace:!0,scope:{footers:"=",roles:"=?"},template:'<ul>                        <li ng-repeat="footer in footers | orderBy: \'sequence\'">                            <a ng-click="clickFooterListener(footer.path, footer.id, $index)" href="{{footer.path}}">{{footer.name}}<\/a>                        <\/li>                    <\/ul>',link:function(t){function f(t){return n.location.pathname.toLowerCase()==t.path.toLowerCase()?!0:!1}function e(n){var i=!1;return t.roles&&n.role&&n.role!==""?angular.forEach(t.roles,function(t){if(console.log("navRole =",n.role,", userRole =",t),t===n.role){i=!0;return}}):i=!0,i}t.isSelected=f;t.hasAccess=e;t.clickFooterListener=function(t,f){switch(f){case 1:n.location.href=t;break;case 2:r.get(url_privacy).then(function(n){var t={headerText:"PRIVACY POLICY",bodyText:u.trustAsHtml(n.data),showCloseButton:!1};i.showModal({},t).then(function(){})});break;case 3:r.get(url_contact_us).then(function(n){var t={headerText:"CONTACT US",bodyText:u.trustAsHtml(n.data),showCloseButton:!1};i.showModal({},t).then(function(){})});break;case 4:window.location.href="/aboutAMI"}}}}}window.app.directive("footerNavigationCtrl",n);n.$inject=["$window","userRoles","modalService","httpService","$sce"]}(),function(){window.app.directive("hcpAddressDetails",function(){return{restrict:"E",scope:{labelprepend:"@?",controlprepend:"@?",model:"=",form:"=",states:"=",ngDisabled:"=?",ngRequired:"=?",isRequiredDisabled:"=?"},link:function(n,t,i){n.disabled=!1;n.disabledAddress=!1;n.disabledSuburbStatePostcodeInputs=!1;(i.disabled||i.disabled==="")&&(n.disabled=!0,n.disabledAddress=!0);n.required=!1;(i.required||i.required==="")&&(n.required=!0);n.requireInputs=function(){return n.required||n.ngRequired};n.disableAddressInputs=function(){return n.disabledAddress||n.ngDisabled};n.disabledSuburbStatePostcode=function(){return n.disabledSuburbStatePostcodeInputs=n.model!=undefined&&n.model.id!=undefined&&n.model.id!=null&&n.model.addrLine1!=null?!0:!1,n.disabledSuburbStatePostcodeInputs}},templateUrl:"/templates/address.html"}})}(),function(){window.app.directive("lightboxDirective",function(){return{restrict:"E",transclude:!0,template:"<section ng-transclude><\/section>"}})}(),function(){"use strict";function n(){return function(n,t){t.hide();n.$on("loader_show",function(){return t.show()});n.$on("loader_hide",function(){return t.hide()})}}window.app.directive("loader",n);n.$inject=["$rootScope"]}(),function(){"use strict";function n(n){return{restrict:"E",replace:!0,scope:{menus:"=",roles:"=?"},template:'<ul>                        <li ng-class="{ \'active\': isSelected(menu) ,\'first\' : $first, \'dropdown\' : hasChild(menu) }"                            ng-repeat="menu in menus | filter: hasAccess | orderBy: \'sequence\'">                            <a ng-if="!hasChild(menu)" ng-href="{{menu.path}}">{{menu.name}}<\/a>                            <a ng-if="hasChild(menu)" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{menu.name}} <span class="caret"><\/span><\/a>                            <ul ng-if="hasChild(menu)" class="dropdown-menu">                                <li ng-repeat="menu2 in menu.childItems" ng-class="{ \'active\': isSelected(menu2) }"><a ng-href="{{menu2.path}}">{{menu2.name}}<\/a><\/li>                            <\/ul>                            <hr class="horizantal-menu-separator">                        <\/li>                    <\/ul>',link:function(t){function i(t){return n.location.pathname.toLowerCase()==t.path.toLowerCase()||t.path.toLowerCase()=="/dashboard"&&n.location.pathname.toLowerCase().indexOf("/dashboard")>=0||t.path.toLowerCase()=="/about"&&n.location.pathname.toLowerCase().includes("/about/")||t.path.toLowerCase()=="/education"&&n.location.pathname.toLowerCase().includes("/education/")||t.path.toLowerCase()=="/brands"&&n.location.pathname.toLowerCase().includes("/brands/")||t.path.toLowerCase()=="/resources"&&n.location.pathname.toLowerCase().includes("/resources/")||t.path.toLowerCase()=="/admin/users"&&n.location.pathname.toLowerCase().includes("/hcp/add")||t.path.toLowerCase()=="/admin/users"&&n.location.pathname.toLowerCase().includes("/hcp/practitionerdetails")||t.path.toLowerCase()=="/admin/users"&&n.location.pathname.toLowerCase().includes("/users/add")||t.path.toLowerCase()=="/admin/users"&&n.location.pathname.toLowerCase().includes("/users/edit")?!0:!1}function r(n){return n.childItems&&n.childItems.length>0}function u(n){var i=!1;return t.roles&&n.role&&n.role!==""?angular.forEach(t.roles,function(t){if(console.log("navRole =",n.role,", userRole =",t),t===n.role){i=!0;return}}):i=!0,i}t.isSelected=i;t.hasAccess=u;t.hasChild=r}}}window.app.directive("navigationCtrl",n);n.$inject=["$window","userRoles"]}(),function(){window.app.directive("numberSelection",function(){return{restrict:"E",scope:{selectedValue:"=",number:"="},link:function(n){n.numberArray=[];for(var t=1;t<=n.number;t++)n.numberArray.push(t);n.setSelectedValue=function(t){n.selectedValue=t}},template:'<div class="btn-group"><button ng-repeat="num in numberArray" type="button" class="btn" ng-click="setSelectedValue(num)" ng-class="{ \'btn-primary\': (num == selectedValue), \'btn-default\': (num != selectedValue) }">{{num}}<\/button><\/div>'}})}(),function(){window.app.directive("phone",function(){return{restrict:"A",require:"ngModel",link:function(n,t,i,r){function u(n){n=n===undefined||n===null?"":n;var t=$.trim(n.replace(/\_/g,"").replace(/\ /g,"").replace(/\)/g,"").replace(/\(/g,""));return/[0-9-()+]{3,20}/.test(t)&&(t.length==10||t.length==0)}function f(n){var t=r.$isEmpty(n);return t||(t=u(n)),r.$setValidity("phone",t),n}r.$parsers.push(f)}}})}(),function(){window.app.directive("postcode",function(){return{restrict:"A",require:"ngModel",link:function(n,t,i,r){function u(n){n=n===undefined?"":n;var t=$.trim(n),i=t.indexOf(".");return i>=0?!1:!isNaN(t)&&(t.length==3||t.length==4)&&t!="000"&&t!="0000"}function f(n){var t=r.$isEmpty(n);return t||(t=u(n)),r.$setValidity("postcode",t),n}r.$parsers.push(f)}}})}(),function(){window.app.directive("progressBar",["httpService",function(){return{restrict:"E",scope:{ngModel:"="},link:function(n){n.progressDisplay=function(){return n.ngModel==undefined||n.ngModel===0?0:parseFloat(Math.round(n.ngModel/9*100)).toFixed(0)}},template:'<div class="progress-info">    <div class="row">        <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">            <p>MY PROGRESS<\/p>        <\/div>        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">    <div class="row progress-info-bar">        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 1)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 2)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 3)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 4)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 5)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 6)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 7)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 8)}"><\/div>        <div class="col-progress" ng-class="{\'col-highlight\': (ngModel >= 9)}"><\/div>    <\/div>        <\/div>        <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">            <p>{{progressDisplay()}}%<\/p>        <\/div>    <\/div> <\/div>'}}])}(),function(){window.app.directive("requireChecked",function(){return{restrict:"A",require:"ngModel",link:function(n,t,i,r){r&&(r.$validators.requireChecked=function(n,t){return t},i.$observe("requireChecked",function(){r.$validate()}))}}})}(),function(){"use strict";function n(){return{require:"ngModel",link:function(n,t,i,r){var u=new RegExp(/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/,"i");r.$validators.email=function(n,t){var i=n||t;return r.$isEmpty(i)||u.test(i)}}}}window.app.directive("strictEmail",n);n.$inject=["$compile"]}(),function(){"use strict";function n(){return{restrict:"E",transclude:{titleLabel:"titleLabel"},scope:{controlId:"@",controlName:"@",inputText:"=?",displayField:"@",onGetItems:"=",form:"=",typeaheadTemplateUrl:"@",onSelectItem:"=",onCreateNew:"=",onClear:"=",isDisabled:"=",allowEditItem:"=?",initialItem:"=?",mode:"=?",ngDisabled:"=?",ngRequired:"=?",placeholder:"@?",editLabel:"@?",createLabel:"@?",clearLabel:"@?"},templateUrl:"/templates/typeAheadControl.html",compile:function(n,t){var i=n.html();return i=i.replace("typeahead_displayField",t.displayField),n.html(i),{pre:function(n,t,i){function r(){return n.disabled||n.ngDisabled||n.mode===undefined||n.mode==="add"&&(n.inputText===undefined||n.inputText==="")}function u(t){n.selectedItem=t;n.onSelectItem(t)}function f(){n.mode="edit"}function e(){n.mode="add";n.selectedItem=undefined;n.onCreateNew()}function o(){n.selectedItem=undefined;n.noResults=undefined;n.mode=undefined;n.inputText=undefined;n.onClear()}function s(t){return n.mode===undefined?n.onGetItems(t):[]}n.hasInitialItem=!1;n.selectedItem=undefined;n.selectItem=u;n.editItem=f;n.createNew=e;n.clear=o;n.getItems=s;n.disabled=!1;(i.disabled||i.disabled==="")&&(n.disabled=!0);n.required=!1;(i.required||i.required==="")&&(n.required=!0);n.$watch("initialItem",function(t){n.hasInitialItem||t===undefined||(console.log("initialItem is initialised..."),n.selectedItem=n.initialItem,n.hasInitialItem=!0)});n.$watch("inputText",function(){n.isDisabled=r()});n.$watch("mode",function(){n.isDisabled=r()})},post:function(){}}}}}window.app.directive("typeAheadCtrl",n);n.$inject=["$compile","httpService"]}(),function(){"use strict";function n(){return{restrict:"E",transclude:{titleLabel:"titleLabel"},scope:{controlId:"@",controlName:"@",inputText:"=",displayField:"@",onGetItems:"=",form:"=",typeaheadTemplateUrl:"@",onSelectItem:"=",onCreateNew:"=",allowEditItem:"=?",initialItem:"=?",mode:"=?",ngDisabled:"=?",ngRequired:"=?",placeHolder:"@?",editLabel:"@?",createLabel:"@?",clearLabel:"@?"},templateUrl:"/templates/typeAheadControlSearch.html",compile:function(n,t){var i=n.html();return i=i.replace("typeahead_displayField",t.displayField),n.html(i),{pre:function(n,t,i){function r(){return n.disabled||n.ngDisabled||n.mode===undefined||n.mode==="add"&&(n.inputText===undefined||n.inputText==="")}function u(t){n.selectedItem=t;n.onSelectItem(t)}function f(){n.selectedItem=undefined;n.onCreateNew()}function e(t){return n.mode===undefined?n.onGetItems(t):[]}n.hasInitialItem=!1;n.selectedItem=undefined;n.selectItem=u;n.createNew=f;n.getItems=e;n.disabled=!0;(i.disabled||i.disabled==="")&&(n.disabled=!0);n.required=!1;(i.required||i.required==="")&&(n.required=!0);n.$watch("initialItem",function(t){n.hasInitialItem||t===undefined||(console.log("initialItem is initialised..."),n.selectedItem=n.initialItem,n.hasInitialItem=!0)});n.$watch("inputText",function(){n.isDisabled=r()});n.$watch("mode",function(){n.isDisabled=r()})},post:function(){}}}}}window.app.directive("typeAheadCtrlSearch",n);n.$inject=["$compile","httpService"]}(),function(){window.app.directive("uiGridEditDatepicker",["$timeout","$document","uiGridConstants","uiGridEditConstants",function(n,t,i,r){return{template:function(){return'<div class="datepicker-wrapper" ><input type="text" uib-datepicker-popup="dd/MM/yyyy" datepicker-options="datepickerOptions" class="date-picker" datepicker-append-to-body="true" is-open="isOpen" ng-model="datePickerValue" ng-change="changeDate($event)"/><\/div>'},require:["?^uiGrid","?^uiGridRenderContainer"],scope:!0,compile:function(){return{pre:function(n,t,i){i.datepickerOptions&&n.col.grid.appScope[i.datepickerOptions]&&(n.datepickerOptions=n.col.grid.appScope[i.datepickerOptions])},post:function(t,u,f,e){var a=function(){var f=$(".ui-grid-viewport"),t={width:f.outerWidth(),height:f.outerHeight(),offset:f.offset()},e=$(u),n={width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()},r=$("div[uib-datepicker-popup-wrap]"),i={width:r.outerWidth(),height:r.outerHeight()},s=function(){var u=t.height-(n.offset.top-t.offset.top)-n.height,f=t.height-u-n.height,r=(i.height-n.height)/2;return u>=r&&f>=r?n.offset.top-r+10:u>=r&&f<r?n.offset.top-f+10:t.height-i.height+t.offset.top-20},h=function(){var r=window.innerHeight-10,u=r-n.offset.top,f=r-u-n.height,t=(i.height-n.height)/2;return u>=t&&f>=t?n.offset.top-t:u>=t&&f<t?n.offset.top-f:r-i.height-10},o={},c=t.width-(n.offset.left-t.offset.left)-n.width>i.width;o.left=c?n.offset.left+n.width:n.offset.left;o.top=i.height<t.height?s():h();r.offset(o);r.css("visibility","visible")},s,h;if(n(function(){a()},0),t.row.entity[t.col.field]==null)t.datePickerValue=new Date;else try{s=t.row.entity[t.col.field].match(/(\d+)/g);h=new Date(s[2],s[1]-1,s[0]);t.datePickerValue=new Date(h)}catch(y){t.datePickerValue=new Date(t.row.entity[t.col.field])}t.isOpen=!0;var o=e[0],v=e[1],c=function(n){var i=angular.element(n.target).attr("class"),r;i?(r=i.indexOf("datepicker-calendar")>-1,r||n.target.nodeName==="INPUT"||t.stopEdit(n)):t.stopEdit(n)},l=function(n){angular.element(document.querySelectorAll(".ui-grid-cell-contents")).off("click",l);t.stopEdit(n)};t.changeDate=function(n){t.row.entity[t.col.field]=t.datePickerValue;t.stopEdit(n)};t.$on(r.events.BEGIN_CELL_EDIT,function(){if(o.grid.api.cellNav)o.grid.api.cellNav.on.navigate(t,function(){t.stopEdit()});else angular.element(document.querySelectorAll(".ui-grid-cell-contents")).on("click",l);angular.element(window).on("click",c)});t.$on("$destroy",function(){angular.element(window).off("click",c);$("div[uib-datepicker-popup-wrap]").remove()});t.stopEdit=function(){t.$emit(r.events.END_CELL_EDIT)};u.on("keydown",function(n){switch(n.keyCode){case i.keymap.ESC:n.stopPropagation();t.$emit(r.events.CANCEL_CELL_EDIT)}if(o&&o.grid.api.cellNav)n.uiGridTargetRenderContainerId=v.containerId,o.cellNav.handleKeyDown(n)!==null&&t.stopEdit(n);else switch(n.keyCode){case i.keymap.ENTER:case i.keymap.TAB:n.stopPropagation();n.preventDefault();t.stopEdit(n)}return!0})}}}}}])}(),function(){window.app.directive("validatePassword",["utilitySvc",function(n){return{restrict:"A",require:"ngModel",scope:{label:"@?validatePasswordLabel",errorArray:"=?validatePasswordErrorArray"},link:function(t,i,r,u){function f(i){var r=u.$isEmpty(i);return r||(t.errorArray=[],r=n.isPasswordValid(i,t.errorArray,t.label)),u.$setValidity("password",r),i}u.$parsers.push(f)}}}])}(),function(){"use strict";window.app.directive("windowResize",["$window","$timeout",function(n){return{link:function(t){var i=angular.element(n);t.$watch(function(){return{h:i.height(),w:i.width()}},function(n){t.windowHeight=n.h;t.windowWidth=n.w},!0);i.bind("resize",function(){t.$apply()})}}}])}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){f.get(api_my_profile).success(function(n){h.model=n.data;h.model.clinics!=null&&(h.model.clinicsTmp=h.model.clinics.concat())})}function a(){f.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){h.hcpProfessions=n.Hcp_Profession;h.titles=n.Title;h.states=n.State;h.countries=n.Country})}function v(n){var i,t,r;if(n.mobile.$error.phone&&c("The mobile number entered is invalid"),n.phone.$error.phone&&c("The phone number entered is invalid"),!(h.model.ahpraNumber===undefined||h.model.ahpraNumber==null||h.model.ahpraNumber==""))if(h.model.countryId&&h.model.countryId===2)i="5,6",h.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(h.model.ahpraNumber)||c("Your Medical Council of New Zealand registration number is invalid. Please check your entry");else{t=h.model.ahpraNumber.toLowerCase();switch(h.model.professionId){case 1:r=t.indexOf("med");(r!=0||t.length!=13||isNaN(t.substring(3)))&&c("Your AHPRA is invalid please check your entry");break;case 2:r=t.indexOf("nmw");(r!=0||t.length!=13||isNaN(t.substring(3)))&&c("Your AHPRA is invalid please check your entry")}}h.model.supervisingDoctorAhpraNumber===undefined||h.model.supervisingDoctorAhpraNumber==null||h.model.supervisingDoctorAhpraNumber==""||h.model.professionId!=2||(h.model.countryId&&h.model.countryId===2?(i="5,6",h.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(value)||c("Your Medical Council of New Zealand registration number is invalid. Please check your entry")):(t=h.model.supervisingDoctorAhpraNumber.toLowerCase(),r=t.indexOf("med"),(r!=0||t.length!=13||isNaN(t.substring(3)))&&c("The AHPRA number provided for your supervising doctor is invalid please check your entry")));h.model.prescriberNumber!=null&&h.model.prescriberNumber!==undefined&&h.model.prescriberNumber!=""&&h.model.prescriberNumber.length!=8&&c("Your prescriber number is invalid please check your entry");h.model.supervisingDoctorPrescriberNumber!=null&&h.model.supervisingDoctorPrescriberNumber!==undefined&&h.model.supervisingDoctorPrescriberNumber!=""&&h.model.supervisingDoctorPrescriberNumber.length!=8&&h.model.professionId==2&&c("The prescriber number provided for your supervising doctor is invalid please check your entry");(h.model.clinicsTmp==null||h.model.clinicsTmp===undefined||h.model.clinicsTmp.length==0)&&c("Require at least 1 clinic")}function c(n){for(var i=!1,t=0;t<h.errors.length;t++)if(h.errors[t].message==n){i=!0;break}i||h.errors.push({message:n})}var h=this;h.isShowSupervisor=!1;h.errors=[];h.submitSuccess={success:!1,messages:[]};h.isHasFile=!1;h.$onInit=function(){h.model=h.model||{};h.model.clinicsTmp=[];a();l()};h.submitRegistration=function(n){if(h.errors=[],h.submitSuccess.success=!1,v(n),n.$valid&&h.errors.length==0){h.model.clinics=h.model.clinicsTmp.concat();var i=h.model,t=api_hcp_updateprofile;f.post(t,h.model).then(function(n){n.data.success?location.href="/education":(h.errors=n.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();u.invalidateControlOnSubmission(n)};h.submitpassword=function(n){if(h.errors=[],h.submitSuccess.success=!1,handleValidateClientPassword(n),n.$valid&&h.errors.length==0){h.mypassword.id=h.model.id;var t=api_hcp_updatepassword;f.post(t,h.mypassword).then(function(n){n.data.success?(h.submitSuccess.success=!0,h.submitSuccess.messages=[],h.submitSuccess.messages.push("Saved Successfully"),h.mypassword={},document.getElementById("page-wrapper").scrollIntoView()):(h.errors=n.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();u.invalidateControlOnSubmission(n)};h.onChangeProfession=function(){h.isShowSupervisor=h.model.professionId==2?!0:!1};h.isValidAHPRA=function(){var i,n,t;if(h.model.ahpraNumber===undefined||h.model.ahpraNumber==null||h.model.ahpraNumber=="")return!1;if(h.model.countryId&&h.model.countryId===2)return i="5,6",h.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(value);n=h.model.ahpraNumber.toLowerCase();switch(h.model.professionId){case 1:if(t=n.indexOf("med"),t!==0||n.length!=13||Number.isNaN(Number(n.substring(3))))return!1;break;case 2:case 3:if(t=n.indexOf("nmw"),t!==0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1;break;case 4:if(t=n.indexOf("den"),t!==0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1}return!0};h.isValidAHPRASupervising=function(n){var i,t,r;return n===undefined||n==null||n==""?!1:h.model.countryId&&h.model.countryId===2?(i="5,6",h.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(n)):(t=n.toLowerCase(),r=t.indexOf("med"),r!=0||t.length!==13||isNaN(t.substring(3)))?!1:!0};h.removeClinic=function(n){var t=h.model.clinicsTmp.indexOf(n);h.model.clinicsTmp.splice(t,1)};h.isValidPrecriberNumber=function(n){if(h.model.countryId!==2)return!0;var t="6";return h.model.professionId===4&&(t="0,6"),n===undefined||n===null||n.length===0||new RegExp("^[A-Za-z0-9]{"+t+"}$").test(n)}}window.app.component("myProfile",{templateUrl:"/Scripts/app/components/myProfile/myProfileView.html",controller:n});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","formConfig"]}(),function(){"use strict";var t=function(n){console.log(n);nv.addGraph(function(){var t=nv.models.multiBarChart().reduceXTicks(!0).rotateLabels(0).showControls(!1).groupSpacing(.1);return t.yAxis.tickFormat(d3.format(",.1f")),d3.select("#pathway-analytics svg").datum(d3.range(n.length).map(function(t){return{key:n[t].label,values:d3.range(n[t].data.length).map(function(i){var r=n[t].data[i].name;return r.length>16&&(r=r.substring(0,16)+"..."),{x:r,y:n[t].data[i].count}})}})).call(t),nv.utils.windowResize(t.update),t})},n=function(n,i,r,u,f){var e=this;e.$onInit=function(){f.get(api_hcp_pathwayAnalytics).then(function(n){var i=n.data.data;t(i)})}};n.$inject=["$scope","$rootScope","$window","utilitySvc","httpService","$timeout"];window.app.component("pathwayAnalytics",{templateUrl:"/Scripts/app/components/pathwayAnalytics/pathwayAnalytics.html",controller:n,controllerAs:"vm"})}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function a(){c.searchOption={pageNumber:1,pageSize:25,sort:"practitioner"};c.gridOptions=u.uiGrid.createDefaultUIGridOptions(s,c.searchOption,l);c.gridOptions.appScopeProvider=c;c.gridOptions.columnDefs=[{name:"fullName",displayName:"Practitioner"},{name:"courseName",displayName:"Education course"},{name:"startedDate",displayName:"Course started"},{name:"completedDate",displayName:"Online completed"},{name:"attendedDate",displayName:"Workshop attended"}]}function l(){var n=api_users_getEducationActivity;return n=n.replace("{pageSize}",c.searchOption.pageSize),n=n.replace("{pageNo}",c.searchOption.pageNumber),n=n.replace("{sort}",c.searchOption.sort),f.get(n).then(function(n){n.data.success&&(c.gridOptions.data=n.data.data.result,c.gridOptions.totalItems=n.data.data.totalCount,angular.forEach(c.gridOptions.data,function(n){n.fullName=n.firstName+" "+n.lastName;n.completedDate=n.completedDate!=null?h.utc(n.completedDate).local().format("DD/MM/YYYY"):n.completedDateStr;n.startedDate=n.startedDate!=null?h.utc(n.startedDate).local().format("DD/MM/YYYY"):n.startedDateStr;n.attendedDate!=null&&(n.attendedDate=h.utc(n.attendedDate).local().format("DD/MM/YYYY"),n.attendedDate=="01/01/2000"&&(n.attendedDate="N/A"))}))})}var c=this;this.$onInit=function(){a();t.$broadcast("loader_show");l()}}window.app.component("recentActivityApproval",{templateUrl:"/Scripts/app/components/recentActivity/recentActivityView.html",controller:n,controllerAs:"vm"});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","uiGridConstants","moment"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c){function v(){f.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){l.hcpProfessions=n.Hcp_Profession;l.titles=n.Title;l.states=n.State;l.countries=n.Country})}function y(n){var u,t,i,e,f,r;n.email.$error.email&&a("Please provide a valid email address");n.confirmEmail.$error.email&&a("Please provide a valid email address");n.confirmEmail.$error.compare&&a("Please confirm your email address");n.mobile.$error.phone&&a("The mobile number entered is invalid");n.hcpphone.$error.phone&&a("The phone number entered is invalid");l.model.fileName===undefined||l.model.fileName.length===0?(a("Please upload a valid registration certificate"),l.showMedicalCertificateError=!0):l.showMedicalCertificateError=!1;u=l.model.countryId===2?"Medical Council of New Zealand registration":"AHPRA";t=u;l.model.countryId===2&&(l.model.professionId===2&&(t="Nursing Council of New Zealand registration"),l.model.professionId===4&&(t="Registration Number"));l.model.ahpraNumber===undefined?a("You must supply a "+t+" number."):l.isValidAHPRA(l.model.ahpraNumber)||a("Your "+t+" number is invalid");l.model.professionId===2&&(l.model.supervisingDoctorAhpraNumber===undefined?a("You must supply a supervising doctor's "+u+" number."):l.isValidAHPRASupervising(l.model.supervisingDoctorAhpraNumber)||a("Your supervising doctor's "+u+" number is invalid"));l.model.countryId===2&&(l.isValidPrecriberNumber(l.model.prescriberNumber)||a("Your Health Practitioners Index is invalid please check your entry"),l.isValidPrecriberNumber(l.model.supervisingDoctorPrescriberNumber)||a("The Health Practitioners Index provided for your supervising doctor is invalid please check your entry"));(l.model.clinicsTmp==null||l.model.clinicsTmp===undefined||l.model.clinicsTmp.length==0)&&a("Require at least 1 clinic");n.isPrivacyAgreed.$error.requireChecked&&a("You must acknowledge that you have read and understood the privacy statement");i=$("#file")[0].files[0];i!==undefined&&i!==null&&(e=i.size/1048576,e>10&&a("You cannot upload a file greater then 10mb"),f=i.name.split("."),r=f[f.length-1].toLowerCase(),r==="pdf"||r==="jpeg"||r==="png"||r==="jpg"||a("You can only upload PDF, JPEG and PNG files"))}function a(n){for(var i=!1,t=0;t<l.errors.length;t++)if(l.errors[t].message==n){i=!0;break}i||l.errors.push({message:n})}var l=this;l.isShowSupervisor=!1;l.isHasFile=!1;l.showMedicalCertificateError=!1;l.$onInit=function(){l.model=l.model||{};l.model.clinicsTmp=[];v()};l.submitRegistration=function(n){if(l.errors=[],y(n),n.$valid&&l.errors.length==0){l.model.clinics=l.model.clinicsTmp.concat();var e=l.model,r=api_hcp_register;f.post(r,l.model).then(function(n){n.data.success?(t.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"You have successfully registered",timeout:3e3,onHideCallback:function(){i.location.href="/account/ThankYouPractitioner";t.$broadcast("loader_hide")}})):(l.errors=n.data.errors,document.getElementById("error-wrapper").scrollIntoView())})}else document.getElementById("error-wrapper").scrollIntoView();u.invalidateControlOnSubmission(n)};l.onChangeProfession=function(){l.isShowSupervisor=l.model.professionId==2?!0:!1};l.isValidAHPRA=function(n){var r,t,i;if(n===undefined||n==="")return!1;if(l.model.countryId&&l.model.countryId===2)return r="5,6",l.model.professionId===4&&(r="1,6"),new RegExp("^[A-Za-z0-9]{"+r+"}$").test(l.model.ahpraNumber);t=n.toLowerCase();switch(l.model.professionId){case 1:if(i=t.indexOf("med"),i!=0||t.length!==13||Number.isNaN(Number(t.substring(3))))return!1;break;case 2:case 3:if(i=t.indexOf("nmw"),i!=0||t.length!==13||Number.isNaN(Number(t.substring(3))))return!1;break;case 4:if(i=t.indexOf("den"),i!=0||t.length!==13||Number.isNaN(Number(t.substring(3))))return!1}return!0};l.isValidAHPRASupervising=function(n){var i,t,r;return n===undefined||n===null||n===""?!1:l.model.countryId!==undefined&&l.model.countryId===2?(i="5,6",l.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(n)):(t=n.toLowerCase(),r=t.indexOf("med"),r!=0||t.length!==13||Number.isNaN(Number(t.substring(3))))?!1:!0};l.isValidPrecriberNumber=function(n){if(l.model.countryId!==2)return!0;var t="6";return l.model.professionId===4&&(t="0,6"),n===undefined||n===null||n.length===0||new RegExp("^[A-Za-z0-9]{"+t+"}$").test(n)};l.removeClinic=function(n){var t=l.model.clinicsTmp.indexOf(n);l.model.clinicsTmp.splice(t,1)};l.selectFile=function(){$("#file").trigger("click")};l.clearFile=function(){$("#file").val("");l.model.fileName="";l.isHasFile=!1};l.fileNameChanged=function(){var i=$("#file").val().replace(/C:\\fakepath\\/i,""),r,t;l.isHasFile=!0;l.model.fileName=i;r=$("#file")[0].files[0];t=new FileReader;t.readAsDataURL(r);t.onload=function(){l.model.registrationCertificateFile={base64:t.result,fileName:i,fileType:"",fileSize:0}};t.onerror=function(n){console.log("Error: ",n)};n.$apply()};l.showPrivacyAgreement=function(){f.get(url_privacy).then(function(n){var t={headerText:"PRIVACY POLICY",bodyText:c.trustAsHtml(n.data),showCloseButton:!1};h.showModal({},t).then(function(){})})}}window.app.component("register",{templateUrl:"/Scripts/app/components/register/registerView.html",controller:n});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","formConfig","modalService","$sce"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function v(){c.searchOption={pageNumber:1,pageSize:25,sort:"registerDate"};c.gridOptions=u.uiGrid.createDefaultUIGridOptions(s,c.searchOption,l);c.gridOptions.appScopeProvider=c;c.updateHcpStatus=y;c.gridOptions.columnDefs=[{name:"practitioner",displayName:"Practitioner"},{name:"clinics",displayName:"Clinic"},{name:"registerDate",displayName:"Registered date"},{name:"viewCert",displayName:"",cellTemplate:'<div class="ui-grid-cell-contents"><a href="{{row.entity.registrationCertificateFileUrl}}" class="form-control btn btn-default"><span>View certificate<\/span><\/a><\/div>'},{field:"status",enableSorting:!1,displayName:"",minWidth:300,enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center" ><div class="row" ng-if="!row.entity.isReadOnly" ><div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"><button class="form-control btn btn-default" id="{{row.entity.id}}_statusApproved" name="{{row.entity.id}}_status" ng-value="2" ng-model="row.entity.status" ng-click="grid.appScope.updateHcpStatus(row.entity, 2)"><span>Approved<\/span><\/button><\/div><div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"><button class="form-control btn btn-default" id="{{row.entity.id}}_statusDeclined" name="{{row.entity.id}}_status" ng-value="3" ng-model="row.entity.status" ng-click="grid.appScope.updateHcpStatus(row.entity, 3)"><span>Declined<\/span><\/button><\/div><\/div><div ng-if="row.entity.isReadOnly"><label ng-if="row.entity.status == 2" >Approved<\/label><label ng-if="row.entity.status == 3" >Declined<\/label><\/div><\/div>'}]}function l(){var n=api_users_registerApprove;return n=n.replace("{pageSize}",c.searchOption.pageSize),n=n.replace("{pageNo}",c.searchOption.pageNumber),n=n.replace("{sort}",c.searchOption.sort),f.get(n).then(function(n){n.data.success&&(c.gridOptions.data=n.data.data.result,c.gridOptions.totalItems=n.data.data.totalCount,angular.forEach(c.gridOptions.data,function(n){n.registerDate&&n.registerDate!=null&&(n.registerDate=h.utc(n.registerDate).local().format("DD/MM/YYYY"))}))})}function y(n,i){if(i==3){t.showModal("warningDecline");var r=$("#warningDecline");$("#declineHcpUserStatus").off("click").click(function(){a(n,i);r.modal("hide")});$("#cancelDeclineHcpUserStatus").off("click").click(function(){n.status=n.oriStatus;r.modal("hide")})}else a(n,i)}function a(n,t){f.post(api_users_updateHcpStatus.replace("{hcpId}",n.id).replace("{status}",t)).then(function(i){i.data.success?(n.isReadOnly=!0,n.status=t):n.status=n.oriStatus})}var c=this;c.$onInit=function(){v();t.$broadcast("loader_show");l()}}window.app.component("registrationApproval",{templateUrl:"/Scripts/app/components/registrationApprovals/registrationApprovalView.html",controller:n,controllerAs:"vm"});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","uiGridConstants","moment"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function a(n){var t=[];return f.get(n,{disable_loading:!0}).then(function(n){return n.data.data.result.forEach(function(n){t.push(n)}),t})}function v(){f.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){h.hcpProfessions=n.Hcp_Profession;h.titles=n.Title;h.states=n.State})}function l(){h.model={};h.model.address={};c(!0);h.disableClinicName=!1;h.disableNewButton=!1;h.isNewClinic=!1;h.outer&&h.outer.countryId&&(h.model.address.countryId=h.outer.countryId)}function y(){var n=h.model.name;h.model={name:n};h.model.address={};c(!1);h.disableClearButton=!0;h.disableNewButton=!0;h.isNewClinic=!0;$("#typeahead_results").hide();h.outer&&h.outer.countryId&&(h.model.address.countryId=h.outer.countryId)}function p(n){h.model=n;c(!0);h.disableClinicName=!1;h.disableNewButton=!1;h.disableClearButton=!1;h.isNewClinic=!1}function c(n){h.disableClinicName=n;h.disableClearButton=n;h.disableNewButton=n;h.disableAddressLine1=n;h.disableAddressLine2=n;h.disableSuburb=n;h.disableState=n;h.disablePostcode=n;h.disableCity=n;h.disablePhone=n;h.disableAddButton=n}var h=this;h.model={};h.model.address={};h.onClearClinic=l;h.onNewClinic=y;h.onSelectClinic=p;h.isNewClinic=!1;n.$watch("vm.outer.countryId",function(n){n!==undefined&&(l(),h.model.address.countryId=n)});this.$onInit=function(){v();c(!0);h.disableClinicName=!1;h.disableNewButton=!1};this.AddClinic=function(){var t,i,n;for((this.records==null||this.records==undefined)&&(this.records=[]),t={},n=0;n<h.states.length;n++)h.states[n].Value==h.model.address.state&&(h.model.address.stateName=h.states[n].Name);for(angular.copy(this.model,t),i=!1,n=0;n<this.records.length;n++)if(this.records[n].id==t.id){i=!0;break}i||this.records.push(t);l()};this.getClinics=function(n){var r="",i,t;if(h.records!==undefined&&h.records!=null)for(i=0;i<h.records.length;i++)h.records[i].id>0&&(r==""?r=h.records[i].id:r+=","+h.records[i].id);return t=api_clinics_search,t=t.replace("{0}",10),t=t.replace("{1}",1),t=t.replace("{2}",n),t=t.replace("{3}",""),t=t.replace("{4}",r),h.model.address.countryId&&(t=t+"&countryId={5}",t=t.replace("{5}",h.model.address.countryId)),a(t)};h.checkRequiredFields=function(){}}window.app.component("clinicDetail",{templateUrl:"/Scripts/app/components/shared/clinicDetailView.html",controller:n,controllerAs:"vm",bindings:{records:"=",model:"=",form:"<",outer:"=",countries:"="}});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f){function s(n){n.password.$error.required&&o("You have not entered a new password");n.confirmPassword.$error.required&&o("Please confirm your new password");n.confirmPassword.$error.compare&&o("The new password and confirm password entered do not match.");n.confirmcurrentpassword.$error.required&&o("Please enter your current password")}function o(n){for(var i=!1,t=0;t<e.errors.length;t++)if(e.errors[t].message==n){i=!0;break}i||e.errors.push({message:n})}var e=this;e.model={};this.$onInit=function(){};e.submitpassword=function(n){if(e.errors=[],e.success.success=!1,s(n),n.$valid&&e.errors.length==0){e.model.id=e.hcp.id;var t=api_hcp_updatepassword;e.model.currentPassword=e.model.currentPassword2;f.post(t,e.model).then(function(t){t.data.success?(e.success.success=!0,e.success.messages=[],e.success.messages.push("Saved Successfully"),e.model=null,n.$setPristine(),n.$setUntouched(),document.getElementById("page-wrapper").scrollIntoView()):(e.errors=t.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();u.invalidateControlOnSubmission(n)}}window.app.component("updatePassword",{templateUrl:"/Scripts/app/components/shared/updatePasswordView.html",controller:n,controllerAs:"vm",bindings:{errors:"=",hcp:"=",success:"=",model:"="}});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f){function s(n){n.updateusername.$error.required&&o("Please provide email address");n.updateusername.$error.email&&o("Please provide a valid email address");n.confirmupdateusername.$error.required&&o("Please confirm your email address");n.confirmupdateusername.$error.compare&&o("The email/username and confirm email/username entered do not match");n.confirmpasswordusername.$error.required&&o("Please enter your password")}function o(n){for(var i=!1,t=0;t<e.errors.length;t++)if(e.errors[t].message==n){i=!0;break}i||e.errors.push({message:n})}var e=this;e.model={};this.$onInit=function(){};this.submitUserName=function(n){if(e.errors=[],e.success.success=!1,s(n),n.$valid&&e.errors.length==0){var t=api_hcp_updateusername;e.model.id=e.hcp.id;e.model.currentPassword=e.model.currentPassword1;f.post(t,e.model).then(function(t){t.data.success?(e.success.success=!0,e.success.messages=[],e.success.messages.push("Saved Successfully"),e.model=null,n.$setPristine(),n.$setUntouched(),document.getElementById("page-wrapper").scrollIntoView()):(e.errors=t.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();u.invalidateControlOnSubmission(n)}}window.app.component("updateUserName",{templateUrl:"/Scripts/app/components/shared/updateUserNameView.html",controller:n,controllerAs:"vm",bindings:{errors:"=",hcp:"=",success:"=",model:"="}});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function l(){var n=api_users_ProductPurchaseHcps,t=h.tz.guess();return n=n.replace("{pageSize}",c.searchOption.pageSize),n=n.replace("{pageNo}",c.searchOption.pageNumber),n=n.replace("{sort}",c.searchOption.sort),n=n.replace("{keyword}",c.searchOption.keyword),n=n.replace("{tz}",t),f.get(n).then(function(n){n.data.success&&(c.gridOptions.data=n.data.data.result,c.gridOptions.totalItems=n.data.data.totalCount,angular.forEach(c.gridOptions.data,function(n){n.productPurchaseConfirmedDate&&n.productPurchaseConfirmedDate!=null&&(n.productPurchaseConfirmedDate=h.utc(n.productPurchaseConfirmedDate).local().format("DD/MM/YYYY"))}))})}function a(){c.filterOptionList=[];c.filterOption=0;c.filterTrainingApprovalGrid=y;c.searchKeywords=p;c.searchOption={pageNumber:1,pageSize:25,sort:"practitionerName",filterOption:1,keyword:""};c.gridOptions=u.uiGrid.createDefaultUIGridOptions(s,c.searchOption,l);c.gridOptions.appScopeProvider=c;c.confirmProductPurchase=v;c.gridOptions.columnDefs=[{name:"practitionerName",displayName:"Practitioner"},{name:"productName",displayName:"Education pathway course"},{name:"productPurchaseConfirmedDate",displayName:"Purchase confirmation date"},{field:"id",enableSorting:!1,displayName:"",minWidth:300,enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center" ><div class="col-xs-12"><button class="form-control btn btn-default" id="{{row.entity.workshopId}}_id" name="{{row.entity.workshopId}}_id" ng-if="row.entity.productPurchaseConfirmedDate == null" ng-click="grid.appScope.confirmProductPurchase(row.entity)"><span>Confirm Purchase<\/span><\/button><\/div><\/div>'}]}function v(n){var i=api_users_confirmProductPurchase.replace("{hcpEducationModuleId}",n.id).replace("{hcp_id}",n.hcpId).replace("{course_id}",n.courseId);f.post(i).then(function(n){n.data.success?(t.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Product purchase confirmed",timeout:2500,onHideCallback:function(){l();t.$broadcast("loader_hide")}})):(t.$broadcast("loader_show"),o.pop({type:"error",title:"Failed",body:"Failed to confirm product purchase",timeout:2500,onHideCallback:function(){l();t.$broadcast("loader_hide")}}))})}function y(n){c.searchOption.filterOption=n;w()}function p(n){n!=null&&(c.searchOption.keyword=n,l())}function w(){var n=api_users_trainingApprove,t=h.tz.guess();return n=n.replace("{pageSize}",c.searchOption.pageSize),n=n.replace("{pageNo}",c.searchOption.pageNumber),n=n.replace("{sort}",c.searchOption.sort),n=n.replace("{filterOption}",c.searchOption.filterOption),n=n.replace("{keyword}",c.searchOption.keyword),n=n.replace("{tz}",t),f.get(n).then(function(n){n.data.success&&(c.gridOptions.data=n.data.data.result,c.gridOptions.totalItems=n.data.data.totalCount,angular.forEach(c.gridOptions.data,function(n){n.workshopDate&&n.workshopDate!=null&&(n.workshopDate=h.utc(n.workshopDate).local().format("DD/MM/YYYY"))}))})}function b(n,t){f.post(api_users_updateWorkshopStatus.replace("{hcpWorkshopId}",n.id).replace("{status}",t)).then(function(i){i.data.success&&(n.oriStatus=t)})}var c=this;this.$onInit=function(){a();t.$broadcast("loader_show");l()}}window.app.component("trainingApproval",{templateUrl:"/Scripts/app/components/trainingApprovals/trainingApprovalView.html",controller:n,controllerAs:"vm"});n.$inject=["$scope","$rootScope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","toaster","uiGridConstants","moment"]}(),function(){"use strict";function n(n){var t=this,i=1;t.buttonText="Select file";t.$onInit=function(){t.model=t.model||{};t.isdisableurl=t.isdisableurl||!1;t.isdisablefile=t.isdisablefile||!1};n.$watch("vm.model.fileName",function(){t.isdisableurl?(t.buttonText="Clear",i=2):(t.buttonText="Select file",i=1)});t.selectedFile=function(){t.isdisableurl=!0;var r=angular.element(".file"),i=r[0].files;i===null||i===undefined||i.length===0?n.$apply(function(){t.model.fileName=""}):n.$apply(function(){t.model.fileName=i[0].name});t.onFileChange(r)};t.action=function(){if(i===1)angular.element(".file").trigger("click");else if(i===2){var n=angular.element(".file")[0];n.value="";n.value&&(n.type="text",n.type="file");t.isdisableurl=!1;t.model.fileName=""}}}window.app.component("uploadFile",{templateUrl:"/Scripts/app/components/uploadFile/uploadFileView.html",controller:n,controllerAs:"vm",bindings:{model:"=",isdisableurl:"=",isdisablefile:"=",onFileChange:"&"}});n.$inject=["$scope"]}(),function(){"use strict";var t=function(n){n.forEach(function(n){n.values=[];n.data.forEach(function(t){n.values.push(t.item2)})});nv.addGraph(function(){var t=nv.models.multiBarChart().reduceXTicks(!0).rotateLabels(0).showControls(!1).groupSpacing(.1);return t.yAxis.tickFormat(d3.format(",.1f")),d3.select("#usage-analytics svg").datum(d3.range(n.length).map(function(t){return{key:n[t].label,values:d3.range(n[t].values.length).map(function(i){return{x:n[t].data[i].item1,y:n[t].data[i].item2}})}})).call(t),nv.utils.windowResize(t.update),t})},n=function(n,i,r,u,f){var e=this;e.$onInit=function(){f.get(api_admin_analytics).then(function(n){var i=n.data;t(i)})}};n.$inject=["$scope","$rootScope","$window","utilitySvc","httpService","$timeout"];window.app.component("usageAnalytics",{templateUrl:"/Scripts/app/components/usageAnalytics/usageAnalytics.html",controller:n,controllerAs:"vm"})}();common={openLoading:function(){$("html").addClass("loading")},closeLoading:function(){$("html").removeClass("loading")},disableScreen:function(){var n=document.createElement("div");n.className+="overlay";document.body.appendChild(n)},activeScreen:function(){$("body .overlay").remove()},maskNumberOnly:function(){$(".mask-number-only").inputmask("9")},numberOnly:function(){$(".number-only").keydown(function(n){$.inArray(n.keyCode,[46,8,9,27,13,110,190])!==-1||n.keyCode==65&&(n.ctrlKey===!0||n.metaKey===!0)||n.keyCode>=35&&n.keyCode<=40||(n.shiftKey||n.keyCode<48||n.keyCode>57)&&(n.keyCode<96||n.keyCode>105)&&n.preventDefault()})},maskMobile:function(n){n.inputmask("9999 999 999")},maskPhone:function(n){n.inputmask("(99) 9999 9999")},maskDate:function(n){n.inputmask("99/99/9999")},clickDatePicker:function(){setTimeout(function(){$(document).on("click",".datepicker",function(){$(this).datetimepicker({pickTime:!1,format:"DD/MM/YYYY"}).on("change",function(){angular.element($(this)).triggerHandler("input")}).focus()})},1)},validateDate:function(){$.validator.addMethod("date",function(n,t){if(this.optional(t))return!0;var i=!0;try{$.datepicker.parseDate("dd/mm/yy",n)}catch(r){i=!1}return i})}};CONSTANTS={get MOBILE_FORMAT(){return"9999 999 999"},get DATE_FORMAT(){return"99/99/9999"}};window.app.factory("videoCommonService",["httpService","formConfig",function(){var t=function(n){var t=n.data().vimeo;t.ready().then(function(){t.play()})},n=function(t,i,r){var u=t.data().vimeo,h;if(u!==undefined)return new Promise(function(f){delete t.data().vimeo;u.destroy().then(function(){n(t,i,r).then(f)})});h=r||{width:"570px"};h.url=i;u=new Vimeo.Player(t.get(0),h);var f=0,e=0,o=0,c=!1,s=!1;if(!(r!==undefined&&r.allowFastForward)){u.on("timeupdate",function(n){s||(f=e,e=n.seconds,f-o<.5&&(o=f))});u.on("seeked",function(n){s=!0;var t=o;u.getPaused().then(function(i){c=i;u.pause().then(function(){var i=n.seconds;i>t?(e=t,f=t,u.setCurrentTime(t).then(function(){s=!1;c||u.play()})):(e=i,f=i,o=i,s=!1,c||u.play())})})})}return t.data("vimeo",u),new Promise(function(n){n(u)})},i=function(i,r){var u=$("#videoPopUp .player");n(u,i,{allowFastForward:Boolean(r),width:"570px"}).then(function(n){$("#videoPopUp").off("hidden.bs.modal").modal("show").on("hidden.bs.modal",function(){n&&n.pause()});t(u)})};return{createReplaceVimeo:n,loadAndPlay:t,showVideoPopup:i}}]),function(){"use strict";function n(n,t,i,r,u,f){function o(n){e.widgetId=n}function s(n){h(n)==1&&(e.model.Captcha=e.recaptchaResponse,r.post(url_forgotPassword,e.model).then(function(n){e.errors=n.data.errors;e.errors.length>0?(u.build(e.errors,e.model),f.reload(e.widgetId)):(e.success=[],e.success.push({message:"Please go to your email and follow the instructions to reset your password"}),u.build(e.success,e.model))}))}function h(n){var t=1;return e.errors=[],e.success=[],n.$valid||(n.username.$error.required?e.errors.push({message:"Please enter email address"}):n.username.$error.email&&e.errors.push({message:"Invalid email address"}),t=0),e.recaptchaResponse||(e.errors.push({message:"Please complete the CAPTCHA field"}),t=0),t}var e=this;e.model={};e.resetPassword=s;e.setWidgetId=o}window.app.controller("ForgotPasswordController",n);n.$inject=["$rootScope","$scope","$window","httpService","modelStateErrorBuilder","vcRecaptchaService"]}(),function(){"use strict";function n(n,t,i){function e(u){f();o(u)==1&&t.post(url_login,r.login).then(function(t){r.errors=t.data.errors===undefined?[]:t.data.errors;r.errors.length>0?i.build(r.errors,r.login):t.status===200&&t.data.type=="loginRedirectUrl"&&(n.location.href=t.data.message)})}function o(n){var t=1;return r.errors=[],n.$valid||(n.username.$error.required?r.errors.push({message:"Please enter email address"}):n.username.$error.email&&r.errors.push({message:"Invalid email address"}),n.password.$error.required&&r.errors.push({message:"Please enter password"}),t=0),t}function f(){r.errors=[]}var r=this,u;f();r.signin=e;(r.login==undefined||r.login==null)&&(r.login={});u=getQueryStringValue("returnurl");u&&(r.login.ReturnUrl=u)}window.app.controller("LoginController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o){function h(n){return n.$valid}function c(n){h(n)&&r.post(url_resetPassword,s.model).then(function(n){s.errors=n.data.errors;s.errors.length>0?f.build(s.errors,s.model):i.location.href=url_login});o.invalidateControlOnSubmission(n)}var s=this;s.model=u;s.updatePassword=c;(s.model==undefined||s.model==null)&&(s.model={})}window.app.controller("ResetPasswordController",n);n.$inject=["$rootScope","$scope","$window","httpService","model","modelStateErrorBuilder","vcRecaptchaService","utilitySvc"]}(),function(){"use strict";function n(n,t){var i=this,r;i.sourceUrl=n.trustAsResourceUrl("https://"+t.hostUrl+"/video/brand_belkyra_moa.mp4");r='<video controls style="width: 100%"><source src="'+i.sourceUrl+'" type="video/mp4"><source src="'+i.sourceUrl+'" type="video/ogg"><source src="'+i.sourceUrl+'" type="video/webm"><\/video>';$("#videoModal .modal-body").html(r);i.showVideoPopup=function(){$("#videoModal").modal("show")};i.onClose=function(){var n=angular.element("video");n.each(function(){this.pause()})}}window.app.controller("belkyraController",n);n.$inject=["$sce","formConfig"]}(),function(){"use strict";function n(){var n=this,t=$("#accordionOne .player iframe");$(function(){var i=new Vimeo.Player(t);n.onClose=function(){i.pause()}})}window.app.controller("botoxController",n);n.$inject=["$sce","videoCommonService","formConfig"]}(),function(){"use strict";function n(){var n=this,t=$("#accordionOne .player iframe"),i=$("#accordionTwo .player iframe");$(function(){var r=new Vimeo.Player(t),u=new Vimeo.Player(i);n.onClose=function(){r.pause();u.pause()}})}window.app.controller("juvedermController",n);n.$inject=["$sce","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function c(){l()}function l(){u.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){h.states=n.State;h.countries=n.Country})}function a(n){if(v(n)){var e=h.states.filter(function(n){return n.Value===h.model.state}),c={AddrLine1:h.model.addressLine1,AddrLine2:h.model.addressLine2,Suburb:h.model.suburb,State:h.model.state,StateName:e.length===1?e[0].Name:"",Postcode:h.model.postcode,City:h.model.city,CountryId:h.model.countryId},l={AccountNumber:h.model.accountNumber,Fax:h.model.faxNumber,Email:h.model.email,Name:h.model.clinicName,Phone:h.model.phoneNumber,Address:c},a=api_clinic_add;u.post(a,l).then(function(n){h.errors=[];h.errors=n.data.errors;n.data.errors.length>0?(i.build(h.errors,h.model),document.getElementById("page-wrapper").scrollIntoView()):(o.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Clinic added successfully",timeout:2500,onHideCallback:function(){t.location.href=f.listUrl;o.$broadcast("loader_hide")}}))})}else document.getElementById("page-wrapper").scrollIntoView();r.invalidateControlOnSubmission(n)}function v(n){h.errors=[];var t=n.$valid,i=y(n);return i&&t}function y(n){var t=!0,i,r,u;return h.model.countryId&&h.model.countryId!==0||(h.errors.push({message:"Please enter Clinic's country"}),t=!1),h.model.accountNumber&&h.model.accountNumber.length>100&&(h.errors.push({message:"The account number field cannot exceed 100 characters"}),t=!1),h.model.clinicName&&h.model.clinicName.length!==0||(h.errors.push({message:"Please enter Clinic's name"}),t=!1),h.model.addressLine1&&h.model.addressLine1.length!==0||(h.errors.push({message:"Please enter Clinic's Address line 1 information"}),t=!1),h.model.addressLine2&&h.model.addressLine2.length>100&&(h.errors.push({message:"The address line 2 field cannot exceed 100 characters"}),t=!1),h.model.countryId&&(h.model.countryId!==1||h.model.suburb&&h.model.suburb.length!==0||(h.errors.push({message:"Please enter Clinic's suburb"}),t=!1),h.model.countryId!==1||h.model.state&&h.model.state!==0||(h.errors.push({message:"Please select Clinic's state"}),t=!1),h.model.countryId!==2||h.model.city&&h.model.city!==0||(h.errors.push({message:"Please select Clinic's city/town"}),t=!1)),h.model.postcode&&h.model.postcode.length!==0||(h.errors.push({message:"Please enter Clinic's postcode"}),t=!1),h.model.postcode&&h.model.postcode.length>0&&(i=/\d{3,4}/,i.test(h.model.postcode)?h.invalidData.postcode=!1:(h.errors.push({message:"Postcode provided is invalid"}),h.invalidData.postcode=!0,t=!1)),h.model.phoneNumber&&h.model.phoneNumber.length!==0||(h.errors.push({message:"Please enter Clinic's phone number"}),t=!1),h.model.phoneNumber&&h.model.phoneNumber.length>0&&(r=/[0-9-()+]{3,20}/,r.test(h.model.phoneNumber)&&h.model.phoneNumber.length===10?h.invalidData.phoneNumber=!1:(h.errors.push({message:"The phone number provided is invalid"}),h.invalidData.phoneNumber=!0,t=!1)),h.model.faxNumber&&h.model.faxNumber.length!==0&&(u=/[0-9-()+]{3,20}/,u.test(h.model.faxNumber)&&h.model.faxNumber.length===10?h.invalidData.faxNumber=!1:(h.errors.push({message:"The fax number provided is invalid"}),h.invalidData.faxNumber=!0,t=!1)),n.email.$error.email?(h.errors.push({message:"Please enter a valid email"}),h.invalidData.email=!0,t=!1):h.invalidData.email=!1,t}var h=this;h.model=h.model||{};h.init=c;h.errors=[];h.submit=a;h.invalidData={postcode:!1,phoneNumber:!1,faxNumber:!1,email:!1}}window.app.controller("ClinicAddController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","$timeout","$rootScope","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function l(){a();v()}function a(){u.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){c.states=n.State;c.countries=n.Country})}function v(){var n=api_clinic_get.replace("{id}",f.clinicId);u.get(n).success(function(n){c.model.addressLine1=n.address.addrLine1;c.model.addressLine2=n.address.addrLine2;c.model.suburb=n.address.suburb;c.model.state=n.address.state;c.model.postcode=n.address.postcode;c.model.city=n.address.city;c.model.countryId=n.address.countryId;c.model.accountNumber=n.accountNumber;c.model.faxNumber=n.fax;c.model.email=n.email;c.model.clinicName=n.name;c.model.phoneNumber=n.phone})}function y(){var n=api_clinic_delete.replace("{id}",f.clinicId);u.post(n).then(function(n){c.errors=[];c.errors=n.data.errors;n.data.errors.length>0?(i.build(c.errors,c.model),document.getElementById("page-wrapper").scrollIntoView()):(o.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Clinic deleted successfully",timeout:2500,onHideCallback:function(){t.location.href="/admin/Clinics";o.$broadcast("loader_hide")}}))})}function p(n){if(w(n)){var e=c.states.filter(function(n){return n.Value===c.model.state}),h={AddrLine1:c.model.addressLine1,AddrLine2:c.model.addressLine2,Suburb:c.model.suburb,State:c.model.state,StateName:e.length===1?e[0].Name:"",Postcode:c.model.postcode,City:c.model.city,CountryId:c.model.countryId},l={Id:f.clinicId,AccountNumber:c.model.accountNumber,Fax:c.model.faxNumber,Email:c.model.email,Name:c.model.clinicName,Phone:c.model.phoneNumber,Address:h},a=api_clinic_update;u.post(a,l).then(function(n){c.errors=[];c.errors=n.data.errors;n.data.errors.length>0?(i.build(c.errors,c.model),document.getElementById("page-wrapper").scrollIntoView()):(o.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Clinic Edited successfully",timeout:2500,onHideCallback:function(){t.location.href=f.listUrl;o.$broadcast("loader_hide")}}))})}else document.getElementById("page-wrapper").scrollIntoView();r.invalidateControlOnSubmission(n)}function w(n){c.errors=[];var t=n.$valid,i=b(n);return i&&t}function b(n){var t=!0,i,r,u;return c.model.countryId&&c.model.countryId!==0||(c.errors.push({message:"Please enter Clinic's country"}),t=!1),c.model.accountNumber&&c.model.accountNumber.length>100&&(c.errors.push({message:"The account number field cannot exceed 100 characters"}),t=!1),c.model.clinicName&&c.model.clinicName.length!==0||(c.errors.push({message:"Please enter Clinic's name"}),t=!1),c.model.addressLine1&&c.model.addressLine1.length!==0||(c.errors.push({message:"Please enter Clinic's Address line 1 information"}),t=!1),c.model.addressLine2&&c.model.addressLine2.length>100&&(c.errors.push({message:"The address line 2 field cannot exceed 100 characters"}),t=!1),c.model.countryId&&(c.model.countryId!==1||c.model.suburb&&c.model.suburb.length!==0||(c.errors.push({message:"Please enter Clinic's suburb"}),t=!1),c.model.countryId!==1||c.model.state&&c.model.state!==0||(c.errors.push({message:"Please select Clinic's state"}),t=!1),c.model.countryId!==2||c.model.city&&c.model.city!==0||(c.errors.push({message:"Please select Clinic's city/town"}),t=!1)),c.model.postcode&&c.model.postcode.length!==0||(c.errors.push({message:"Please enter Clinic's postcode"}),t=!1),c.model.postcode&&c.model.postcode.length>0&&(i=/\d{3,4}/,i.test(c.model.postcode)?c.invalidData.postcode=!1:(c.errors.push({message:"Postcode provided is invalid"}),c.invalidData.postcode=!0,t=!1)),c.model.phoneNumber&&c.model.phoneNumber.length!==0||(c.errors.push({message:"Please enter Clinic's phone number"}),t=!1),c.model.phoneNumber&&c.model.phoneNumber.length>0&&(r=/[0-9-()+]{3,20}/,r.test(c.model.phoneNumber)&&c.model.phoneNumber.length===10?c.invalidData.phoneNumber=!1:(c.errors.push({message:"The phone number provided is invalid"}),c.invalidData.phoneNumber=!0,t=!1)),c.model.faxNumber&&c.model.faxNumber.length!==0&&(u=/[0-9-()+]{3,20}/,u.test(c.model.faxNumber)&&c.model.faxNumber.length===10?c.invalidData.faxNumber=!1:(c.errors.push({message:"The fax number provided is invalid"}),c.invalidData.faxNumber=!0,t=!1)),n.email.$error.email?(c.errors.push({message:"Please enter a valid email"}),c.invalidData.email=!0,t=!1):c.invalidData.email=!1,t}var c=this;c.model=c.model||{};c.init=l;c.errors=[];c.submit=p;c.invalidData={postcode:!1,phoneNumber:!1,faxNumber:!1,email:!1};c.confirmDeleteClinic=function(){h.showModal({},{closeButtonText:"No",actionButtonText:"Yes",headerText:"Delete Confirm",bodyText:"Are you sure?",showCloseButton:!0}).then(function(){y()})}}window.app.controller("ClinicEditController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","$timeout","$rootScope","toaster","modalService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function h(){o()}function o(){var n=api_clinic_search;return n=n.replace("{pageSize}",e.searchOption.pageSize),n=n.replace("{pageNo}",e.searchOption.pageNumber),n=n.replace("{sort}",e.searchOption.sort),n=n.replace("{keyword?}",e.searchOption.keyword),u.get(n).success(function(n){e.ClinicGridOptions.data=n.result;e.ClinicGridOptions.totalItems=n.totalCount;angular.forEach(e.ClinicGridOptions.data,function(n){n.address.stateName&&(n.statecity=n.address.stateName);n.address.city&&(n.statecity=n.address.city)})})}var e=this,s;e.model=e.model||{};e.init=h;e.errors=[];e.searchOption={pageNumber:1,pageSize:25,sort:"name",keyword:""};n.$watch("vm.filterValue",function(n){n!==undefined&&(e.searchOption.keyword=n,o())});e.ClinicGridOptions=r.uiGrid.createDefaultUIGridOptions(f,e.searchOption,o);e.ClinicGridOptions.paginationPageSizes=[15,25,50,100];e.ClinicGridOptions.columnDefs=[];s=[{name:"name",displayName:"Clinic name",maxWidth:180},{name:"address.suburb",displayName:"Suburb",maxWidth:200},{name:"statecity",displayName:"State/City"},{name:"address.postcode",displayName:"Postcode"},{name:"address.countryName",displayName:"Country"},{name:"accountNumber",displayName:"Account number"},{field:"id",enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a ng-href="/admin/clinics/edit/{{COL_FIELD}}">edit<\/a><\/div>',maxWidth:180}];e.ClinicGridOptions.appScopeProvider=e;e.ClinicGridOptions.columnDefs=e.ClinicGridOptions.columnDefs.concat(s)}window.app.controller("ClinicListController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","uiGridConstants","$timeout"]}(),function(){"use strict";function n(n,t,i,r,u,f){function o(){s();h();c()}function s(){u.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){e.ClinicTypes=n.Clinic_Type})}function h(){u.get(api_lookup_brand).success(function(n){e.brands=n})}function c(){var n=api_Clinic_get.replace("{id}",f.ClinicId);u.get(n).success(function(n){if(e.model=n,n.metaDataTags){var t=JSON.parse(n.metaDataTags);e.tags=t.map(function(n){return{value:n}})}n.isExternalClinic&&n.existClinicUrl.length>0&&n.existFileUrl.length===0?(e.model.url=n.existClinicUrl,e.isDisabledfile=!0):!n.isExternalClinic&&n.existClinicUrl.length===0&&n.existFileUrl.length>0&&(e.model.url=n.existFileUrl,e.model.fileName=n.existFileUrl,e.isDisabledClinicUrl=!0)})}var e=this;e.model=e.model||{};e.init=o;e.isDisabledClinicUrl=!0;e.isDisabledfile=!0;e.tags=[];e.viewClinic=function(){t.open(e.model.url,"_blank")}}window.app.controller("ClinicViewController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","$timeout","$rootScope","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f){function o(){f.isHcp?h():(e.isFacialAnatomyAccessible=e.isBotoxAccessible=e.isBelkyraAccessible=e.isJuvedermOverviewAccessible=e.isJuvedermTreatmentProtocolsAccessible=e.isJuvedermIntroTechniquesAccessible=e.isJuvedermIntermediateAccessible=e.isJuvedermAdvancedAccessible=e.isMDCodesVisionaryAccessible=e.isMDCodesDistinctionAccessible=!0,e.isTotalFaceCompleted=e.isFacialAnatomyCompleted=e.isBotoxCompleted=e.isBelkyraCompleted=e.isJuvedermOverviewCompleted=e.isJuvedermTreatmentProtocolsCompleted=e.isJuvedermIntroTechniquesCompleted=e.isJuvedermIntermediateCompleted=e.isJuvedermAdvancedCompleted=e.isMDCodesVisionaryCompleted=e.isMDCodesDistinctionCompleted=e.isVoliteCompleted=!1)}function s(n){n==1||n==2&&e.isFacialAnatomyAccessible?window.location.href="/education/totalface?module="+n:n==3&&e.isBotoxAccessible?window.location.href="/education/botox":n==4&&e.isBelkyraAccessible?window.location.href="/education/belkyra":n==5&&e.isJuvedermOverviewAccessible?window.location.href="/education/juvederm":n==6&&e.isJuvedermTreatmentProtocolsAccessible?window.location.href="/education/juvedermTreatmentProtocols":n==7&&e.isJuvedermIntroTechniquesAccessible?window.location.href="/education/juvedermIntroductoryTechniques":n==8&&e.isJuvedermIntermediateAccessible?window.location.href="/education/juvedermIntermediate":n==9&&e.isJuvedermAdvancedAccessible?window.location.href="/education/juvedermAdvanced":n==10&&e.isMDCodesVisionaryAccessible?window.location.href="/education/mdCodesVisionary":n==11&&e.isMDCodesDistinctionAccessible?window.location.href="/education/mdCodesDistinction":n==12&&(window.location.href="/education/volite")}function h(){i.get(api_education_hcp).then(function(n){var i,t;if(n)for(i=0;i<n.data.data.length;i++){t=n.data.data[i];switch(i){case 0:e.isTotalFaceCompleted=t.isCompleted;break;case 1:e.isFacialAnatomyAccessible=t.isAccessible;e.isFacialAnatomyCompleted=t.isCompleted;break;case 2:e.isBotoxAccessible=t.isAccessible;e.isBotoxCompleted=t.isCompleted;break;case 3:e.isBelkyraAccessible=t.isAccessible;e.isBelkyraCompleted=t.isCompleted;break;case 4:e.isJuvedermOverviewAccessible=t.isAccessible;e.isJuvedermOverviewCompleted=t.isCompleted;break;case 5:e.isJuvedermTreatmentProtocolsAccessible=t.isAccessible;e.isJuvedermTreatmentProtocolsCompleted=t.isCompleted;break;case 6:e.isJuvedermIntroTechniquesAccessible=t.isAccessible;e.isJuvedermIntroTechniquesCompleted=t.isCompleted;break;case 7:e.isJuvedermIntermediateAccessible=t.isAccessible;e.isJuvedermIntermediateCompleted=t.isCompleted;break;case 8:e.isJuvedermAdvancedAccessible=t.isAccessible;e.isJuvedermAdvancedCompleted=t.isCompleted;break;case 9:e.isMDCodesVisionaryAccessible=t.isAccessible;e.isMDCodesVisionaryCompleted=t.isCompleted;break;case 10:e.isMDCodesDistinctionAccessible=t.isAccessible;e.isMDCodesDistinctionCompleted=t.isCompleted;break;case 11:e.isVoliteCompleted=t.isCompleted}}})}var e=this;e.init=o;e.courseStatusList=[];e.classNames=[];e.courseSelected=s;$(".images, .course").hover(function(){$(".education-welcome-header").stop(!0,!1).animate({opacity:0},1e3)},function(){});$(".pathway-summary").hover(function(){$(".pathway-summary").css({scale3d:[1.2,1.2,1.2]}).css({"z-index":5});$(".first-summary-box").css({opacity:1}).css({visibility:"initial"}).css({"z-index":4})},function(){});$(".next-summary-button").click(function(){$(".first-summary-box").css({opacity:0}).css({visibility:"hidden"});$(".second-summary-box").css({opacity:1}).css({visibility:"initial"}).css({"z-index":4})});$(".back-summary-button").click(function(){$(".second-summary-box").css({opacity:0}).css({visibility:"hidden"});$(".first-summary-box").css({opacity:1}).css({visibility:"initial"}).css({"z-index":4})});$(".close-button").click(function(){$(".pathway-summary").css({scale3d:[1,1,1]}).css({"z-index":1});$(".first-summary-box, .second-summary-box").css({opacity:0}).css({visibility:"hidden"});$(".education-welcome-header").stop(!0,!1).animate({opacity:1},1e3)})}window.app.controller("EducationLandingController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","formConfig"]}(),function(){var n=function(n){return n.is("select")?Number(n.val()):n.is("input[type=checkbox],input[type=radio]")?n.is(":checked")?1:0:undefined},t=function(n,t){var i=n.closest(".form-group");n.is("input[type=checkbox],input[type=radio]")&&n.is(":checked")&&i.addClass(t?"correct":"incorrect");n.is("select")&&(i.removeClass("incorrect").removeClass("correct"),n.val()!==""&&(t?i.addClass("correct"):i.addClass("incorrect")))},i="input[type=checkbox], input[type=radio], select";window.app.factory("evaluationCommonService",function(){return{checkAnswerCorrect:function(r){var u=!0,f;return $(i,r).each(function(){var i=$(this),f=i.data("answer-val"),r=n(i)===f;t(i,r);u=u&&r}),f=r.find(".validation-response").removeClass("incorrect").removeClass("correct"),r.find(".dropdown").length>0?r.find("select").filter(function(){return $(this).val()===""}).length===0&&f.addClass(u?"correct":"incorrect"):f.addClass(u?"correct":"incorrect"),u}}})}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){$(".carousel").carousel();h.videoCompleteInfo="Completed Belkyra Virtual Classroom";h.isNavigationOpen=!0;h.isHcp=!1;f.isHcp=="True"&&(h.isHcp=!0,c());a();v();w()}function a(){i.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",f.belkyraId);i.get(n).then(function(n){n.data.success&&(h.belkyraCourseDetails=n.data,h.belkyraModules=h.belkyraCourseDetails.data.modules)})}function v(){i.get(api_belkyra_training).success(function(n){h.belkyraCourseSlides=n.data;h.totalSlides=h.belkyraCourseSlides.length-1})}function y(){var n=api_complete_hcp_module.replace("{courseId}",f.belkyraId).replace("{moduleId}",f.belkyraEducationModuleId);i.post(n)}function p(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.belkyraId).replace("{moduleId}",f.belkyraVirtualClassId);i.post(n).then(function(n){n.data.success&&c()})}function w(){i.get(api_belkyra_training_videos).success(function(n){h.belkyraCourseVideos=n.data;h.virtualClassVideo=h.belkyraCourseVideos[0];var t=$("#virtualClassroomVideo");s.createReplaceVimeo(t,h.virtualClassVideo).then(function(n){n.on("ended",function(){$("#videoCompleteInfo").modal("show")})})})}function b(){$("#belkyraSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function k(){h.activeTabIndex<6&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function d(n){if(h.activeTabIndex=n,h.activeTabIndex!=2){var t=$("#virtualClassroomVideo");t.get(0).pause()}}function g(n){if(n.$setSubmitted(),nt(n)){var t=api_submit_survey.replace("{courseId}",f.belkyraId).replace("{educationModuleId}",f.belkyraSurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){c();h.activeTabIndex=5;u.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();e.invalidateControlOnSubmission(n)}function nt(n){return n.$valid}function tt(){var n=api_complete_hcp_module.replace("{courseId}",f.belkyraId).replace("{moduleId}",f.belkyraVirtualClassId);i.post(n)}function it(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.belkyraId).replace("{moduleId}",f.belkyraEvaluationModuleId);i.post(n).then(function(n){n.data.success&&c()})}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=b;h.nextTab=k;h.activeTabIndex=1;h.activeTabSelected=d;h.submitSurvey=g;h.getBelkyraEducationCourseDetails=c;h.totalSlides=54;h.belkyraCourseSlides=[];h.belkyraCourseVideos=[];h.idx=0;$("#BelkyraSlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.belkyraModules.length>0&&h.belkyraModules[0].completedDate===null&&(y(),p(),h.isNavigationOpen==!1&&($("#belkyraSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))});$("#videoCompleteInfo").on("hidden.bs.modal",function(){tt();it();h.activeTabIndex=3})}window.app.controller("BelkyraController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function c(){o.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id"),u=$(this).hasClass("multi-answer-dropdown"),t,i,r;u?$("select[name='question-"+n+"']").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:$(this).val()};o.Answers.push(t)}):(t=$("input[name='question-"+n+"']:checked"),i="",t.length>0&&(i=t.attr("data-val")),r={QuestionId:n,AnswerId:i,Value:"selected"},o.Answers.push(r))});i.post(api_belkyra_evaluation,o.Answers).then(function(n){n.data.success?a():n.data.errors.length==0&&(n.data.data!=null?l(n):s("NotCompleted"))})}function l(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});s("PleaseReTry")}function a(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});s("Congratulations")}function s(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function v(n){if(n==="next"){var t=f.checkAnswerCorrect($(".question-"+e.belkyraQuestionNumber));t&&(e.belkyraQuestionNumber=e.belkyraQuestionNumber+1)}n==="back"&&(e.belkyraQuestionNumber=e.belkyraQuestionNumber-1)}var e=this,o={},h;e.submit=c;e.belkyraQuestionNumber=1;e.navigateBelkyraQuestions=v;h={};$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){f.checkAnswerCorrect($(this).closest(".item"))});$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getBelkyraEducationCourseDetails();n.$parent.vm.activeTabIndex=4})}window.app.controller("BelkyraEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function o(){$(".carousel").carousel();s();h()}function s(){t.get(api_belkyra_training).success(function(n){e.belkyraCourseSlides=n.data})}function h(){t.get(api_belkyra_training_videos).success(function(n){e.belkyraCourseVideos=n.data;f.$parent.vm.virtualClassVideo=e.belkyraCourseVideos[0];$("#virtualClassroomVideo").get(0).load()})}var e=this;e.init=o;e.belkyraCourseSlides=[];e.belkyraCourseVideos=[]}window.app.controller("BelkyraRmpTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","$scope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function a(){$(".carousel").carousel();c.videoCompleteInfo="Completed Botox Virtual Classroom";c.isNavigationOpen=!0;c.isHcp=!1;f.isHcp=="True"&&(c.isHcp=!0,l());v();y();p()}function v(){t.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){c.surveyRating=n.SurveyRating})}function l(){var n=api_get_educationCourseDetails.replace("{courseId}",f.botoxId);t.get(n).then(function(n){n.data.success&&(c.botoxCourseDetails=n.data,c.botoxModules=c.botoxCourseDetails.data.modules)})}function y(){t.get(api_botox_training).success(function(n){c.botoxCourseSlides=n.data;c.totalSlides=c.botoxCourseSlides.length-1})}function p(){t.get(api_botox_training_videos).success(function(n){c.botoxCoursesVideos=n.data;c.virtualClassVideo=c.botoxCoursesVideos[1];var t=$("#virtualClassroomVideo");h.createReplaceVimeo(t,c.virtualClassVideo).then(function(n){n.on("ended",function(){$("#videoCompleteInfo").modal("show")})})})}function w(n){n==13&&(c.videoUrl=c.botoxCoursesVideos[0],h.showVideoPopup(c.videoUrl))}function b(){var n=api_complete_hcp_module.replace("{courseId}",f.botoxId).replace("{moduleId}",f.botoxEducationModuleId);t.post(n)}function k(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.botoxId).replace("{moduleId}",f.botoxVirtualClassId);t.post(n).then(function(n){n.data.success&&l()})}function d(){$("#botoxSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");c.isNavigationOpen==!0?c.isNavigationOpen=!1:c.isNavigationOpen==!1&&(c.isNavigationOpen=!0)}function g(){c.activeTabIndex<6&&(c.errors=[],c.activeTabIndex=c.activeTabIndex+1)}function nt(n){if(c.activeTabIndex=n,c.activeTabIndex!=2){var t=$("#virtualClassroomVideo");t.get(0).pause()}}function tt(n){if(n.$setSubmitted(),it(n)){var i=api_submit_survey.replace("{courseId}",f.botoxId).replace("{educationModuleId}",f.botoxSurveyModuleId);t.post(i,c.model.survey).then(function(n){n.data.success&&(u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){l();c.activeTabIndex=5;u.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();e.invalidateControlOnSubmission(n)}function it(n){return n.$valid}function rt(){var n=api_complete_hcp_module.replace("{courseId}",f.botoxId).replace("{moduleId}",f.botoxVirtualClassId);t.post(n)}function ut(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.botoxId).replace("{moduleId}",f.botoxEvaluationModuleId);t.post(n).then(function(n){n.data.success&&l()})}var c=this;c.init=a;c.isNavigationOpen=!0;c.toggleNavigation=d;c.nextTab=g;c.activeTabIndex=1;c.activeTabSelected=nt;c.submitSurvey=tt;c.getBotoxEducationCourseDetails=l;c.botoxCourseSlides=[];c.botoxCoursesVideos=[];c.botoxCourseDetails={};c.botoxModules={};c.loadVideo=w;c.totalSlides=54;c.idx=0;$("#BotoxSlider").on("slid.bs.carousel",function(){c.idx=$(".carousel-inner div.active").index();s.$apply();c.idx===c.totalSlides&&c.botoxModules.length>0&&c.botoxModules[0].completedDate===null&&(b(),k(),c.isNavigationOpen==!1&&($("#botoxSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),c.isNavigationOpen=!0))});$("#videoCompleteInfo").on("hidden.bs.modal",function(){rt();ut();c.activeTabIndex=3})}window.app.controller("BotoxController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","$scope","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function a(){e.isNavigationOpen=!0;e.botoxQuestionNumber=1;w();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){f.checkAnswerCorrect($(this).closest(".item"))})}function l(){o=!1;s.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};s.Answers.push(t)})});i.post(api_botox_evaluation,s.Answers).then(function(n){n.data.success?y():n.data.errors.length==0&&(n.data.data!=null?v(n):h("NotCompleted"))})}function v(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});h("PleaseReTry")}function y(){$(".questions .item").each(function(){var n=$(this).children(".title");n.find("p[class^='question-status']").removeClass().addClass("question-status").removeClass("text-blue").addClass("correct-question")});h("Congratulations")}function h(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function p(n){if(n=="next"||n=="submit"){var t=f.checkAnswerCorrect($(".question-"+e.botoxQuestionNumber));t&&(n=="next"?e.botoxQuestionNumber=e.botoxQuestionNumber+1:n=="submit"&&(o=!0))}else n=="back"&&(e.botoxQuestionNumber=e.botoxQuestionNumber-1)}function w(){c={1:"In Australia and New Zealand, BOTOX<sup>&reg;<\/sup> is approved for 3 cosmetic indications: glabellar lines, crow's feet and forehead lines. It is also approved in AU/NZ for more than 9 therapeutic indications. (BOTOX PI, BOTOX DS)",2:"BOTOX<sup>&reg;<\/sup> is a unique biological pharmaceutical, with a distinct efficacy and safety profile and therapeutic margin and, therefore, is not interchangeable with other botulinum toxin products (BOTOX PI, DS; Dysport PI, DS; Xeomin PI, DS)",3:"BOTOX<sup>&reg;<\/sup> treatment usually starts to take effect within 1–2 days, with visible results by 7 days, and lasts up to 4 months in all 3 approved cosmetic indications. BOTOX<sup>&reg;<\/sup> treatment results wear off in a progressive manner, not suddenly, and repeat treatments are recommended to maintain results <br /><br />1. BOTOX<sup>&reg;<\/sup> Approved PI. 2. BOTOX<sup>&reg;<\/sup> Approved DS. 3. Beer KR et al. J Drugs Dermatol 2011;10(1):39–44. 4. Glogau R et al. Dermatol Surg 2012;38:1794–1803. 5. Lowe NJ et al. Dermatol Surg 2005;31:257–262.6. Trindade de Almeida AR et al. Dermatol Surg 2007;33(Suppl1):S37–S43. 7. Carruthers A et al. J Clin Res 2004;7:1–20. 8. Dailey RA et al. Dermatol Surg 2011;37(7):918–28.",4:"Having excellent knowledge of facial anatomy, performing a comprehensive assessment of an individual's unique anatomy under dynamic and resting conditions, and appropriate hygiene during treatment, help to avoid complications.",5:"Patients should avoid rubbing or massaging the treated area for at least 4 hours after treatment. It is best practice to provide this information, and other aftercare advice regarding possible side effect management to patients to manage their expectations and increase satisfaction.",6:"The procerus muscle lowers the medial aspect of the eyebrow and is responsible for horizontal lines in the glabellar area. The corrugator muscle draws down the medial aspect of the eyebrow and is responsible for vertical glabellar lines. (Drake RL et al Gray’s Anatomy)",7:"The recommended dose for the glabellar area is 20 units of BOTOX<sup>&reg;<\/sup>, using 1–4 units per injection site (Drake RL et al Gray's Anatomy; BOTOX PI).",8:"The recommended dose for the crow's feet area is 12–36 units of BOTOX<sup>&reg;<\/sup> (6–18 U per side), using 2–6 units per injection site (Drake RL et al Gray's Anatomy; BOTOX PI).",9:"It is recommended that the patient keep their eyes closed when treating crow's feet.",10:"The recommended dose for the forehead lines area is 8–24 units of BOTOX<sup>&reg;<\/sup>, using 1 to 4 units and 0.5 to 1 unit, per injection site. (BOTOX PI).",11:"Excessive brow elevation can be corrected by either: •\tInjecting 1–2 U of BOTOX® treatment into the frontalis 2 cm above the lateral brow; OR •\tInjecting 1 U of BOTOX® treatment intradermally into the line above the lateral eyebrow"}}var e=this,s={},c,o;e.submit=l;e.init=a;e.navigateBotoxQuestions=p;c={};o=!1;$("#botoxPopUpInfo").on("hidden.bs.modal",function(){o&&l()});$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getBotoxEducationCourseDetails();n.$parent.vm.activeTabIndex=4})}window.app.controller("BotoxEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o){var s=this;s.model={};s.history=[];s.pointsLevel1=[];s.pointsLevel2=[];s.pointsLevel3=[];s.level1Completing=!1;s.level2Completing=!1;s.level3Completing=!1;s.level1Completed=!1;s.level2Completed=!1;s.level3Completed=!1;s.showPrev=!1;s.showNext=!1;s.showFooter=!1;s.blockClickWhenEditting=!1;s.errors=[];s.toggleGameNavigation=function(){$("#botoxSideNavigation").toggleClass("collapsed",1e3);$("#content").toggleClass("col-md-12 col-md-9",1e3);s.isNavigationOpen==!0?s.isNavigationOpen=!1:s.isNavigationOpen==!1&&(s.isNavigationOpen=!0)};s.startGame=function(){var n=$("#gameBotox").find("section.active");n.next().length>0&&(n.next().addClass("active"),n.removeClass("active"),s.hideSideNavigation());s.showNav()};s.hideSideNavigation=function(){$("#botoxSideNavigation").addClass("collapsed");$("#content").removeClass("col-md-9");$("#content").addClass("col-md-12");s.isNavigationOpen=!0};s.nextStep=function(){var n=$("#gameBotox").find("section.active");n.next().length>0&&(n.next().addClass("active"),n.removeClass("active"));s.showNav();s.displayPageInFullScreen()};s.prevStep=function(){var n=$("#gameBotox").find("section.active");n.prev().length>0&&(n.prev().addClass("active"),n.removeClass("active"));s.showNav();s.displayPageInFullScreen()};s.tabSwitch=function(n,t){var i=$("section.active").attr("id"),r;$("#"+i+" .tab").removeClass("active");$("#"+i+" .tab-content").removeClass("active");console.log(i);$(t).addClass("active");$(n.target).addClass("active");r=$("section.active").find("video");r.length>0&&$.each(r,function(n,t){$(t)[0].load()})};s.pauseOrPlay=function(n){var t=angular.element(n.target);t[0].play()};s.displayPageInFullScreen=function(){var n=$("section.active").attr("id");["gameBotoxSlide3","gameBotoxSlide5","gameBotoxSlide8","gameBotoxSlide11"].indexOf(n)>=0?(s.hideSideNavigation(),$("#botoxGameToggleNavigationButton").hide()):$("#botoxGameToggleNavigationButton").show()};s.showNav=function(){var n=$("section.active").attr("id"),t=$("section.active .plot").attr("data-level");s.showNext=$.inArray(n,["gameBotoxSlide1","gameBotoxSlide5","gameBotoxSlide8","gameBotoxSlide13"])>0?!1:!0;s.showPrev=$.inArray(n,["gameBotoxSlide1"])>0?!1:!0;s.showFooter=$.inArray(n,["gameBotoxSlide1"])>0?!1:!0;s["level"+t+"Completed"]&&(s.showNext=!0)};s.zoom=function(n){var t=$("section.active").find(".plot");n=="in"?t.addClass("zoomedIn"):n=="out"&&t.removeClass("zoomedIn")};s.tip=function(){$("section.active").find(".tipLady").toggleClass("active")};s.close=function(n){$(n).removeClass("active")};s.editPoint=function(n){var t=$(n.target).parents(".point").attr("id"),i=$("#"+t).parents("section").attr("id"),r=$("#"+t).find("input").val();r==""&&($("#"+t).addClass("editting"),$("#"+t).find("input").focus(),$("#"+i).find(".editting-confirm").addClass("show"))};s.addOnClick=function(n){var t=$("section.active .plot").attr("data-level"),i=$("section.active .plot").attr("id"),r=$("section.active .plot").find(".editting");r.length<=0&&(s["pointsLevel"+t].push({id:i+(s["pointsLevel"+t].length+1),x:n.offsetX-10,y:n.offsetY-85}),f(function(){$("#"+s["pointsLevel"+t][s["pointsLevel"+t].length-1].id).find("input").focus()},200))};s.blockClick=function(){var n=$("#gameBotox").find("section.active"),t=$(n).find(".editting");s.blockClickWhenEditting=t.length>0?!0:!1};s.confirm=function(n){var i=$(n.target).parents("section").attr("id"),t=$("#"+i).find(".editting"),r=$(t).find("input").val();r==""?$(t).removeClass("editting"):($(t).find("input").blur(),$(t).addClass("value-added").removeClass("editting"));$("#"+i).find(".editting-confirm").removeClass("show");s.checkIfAllValuesEntered();s.blockClick()};s.enterToConfirm=function(n){isNaN(String.fromCharCode(n.keyCode))&&n.preventDefault();(n.keyCode=="13"||n.keyCode>=48&&n.keyCode<=57)&&f(function(){s.confirm(n)},200)};s.clear=function(){var n=$("section.active .plot").attr("data-level");s["level"+n+"Completed"]=!1;s["pointsLevel"+n]=[];s.checkIfAllValuesEntered()};s.undo=function(){var n=$("section.active .plot").attr("data-level");s["pointsLevel"+n].length>0&&s["pointsLevel"+n].pop();s.checkIfAllValuesEntered()};s.checkIfAllValuesEntered=function(){var n=$("section.active .plot").attr("data-level");s["level"+n+"Completing"]=s["pointsLevel"+n].length>0?!0:!1};s.submit=function(){var n=$("section.active .plot").attr("data-level"),t=$("section.active").attr("id"),i=$("#"+t+" :input").serialize(),r=$("#"+t+" :input");e.isHcp=="True"?s.captureDataInModel(n,r):(s["level"+n+"Completed"]=!0,s["level"+n+"Completing"]=!1,s.showNav());console.log(i)};s.print=function(){window.print()};s.captureDataInModel=function(n,t){for(var r,o,i,c,u,h=0,f=0;f<t.length;f++)h+=parseInt(t[f].value);if(s.validateUnitsInjected(n,h)&&(r=n==1?s.pointsLevel1:n==2?s.pointsLevel2:s.pointsLevel3,o=[],t!=null&&t!=undefined)){for(i=0;i<t.length;i++)c=t[i].name,u=r.findIndex(function(n){return n.id==c}),u>=0&&o.push({x_coordinate:r[u].x,y_coordinate:r[u].y,unit:parseInt(t[i].value)});s.model.moduleId=e.botoxId;s.model.gameTypeId=n;s.model.hcpGamePlottedPoints=o;s.saveHcpGame(n)}};s.validateUnitsInjected=function(n,t){var i=n==1?1:n==2?8:12,r=n==1?20:n==2?24:36;return(s.errors=[],t<i)?(s.errors.push({message:"Minumum units not met"}),!1):t>r?(s.errors.push({message:"Exceeded maximum units"}),!1):!0};s.saveHcpGame=function(n){var t=s.model.gameTypeId==1?"Glabellar lines":s.model.gameTypeId==2?"Forehead lines":"Crow's feet";i.post(api_hcp_saveGame,s.model).then(function(i){i.data.success?(s["level"+n+"Completed"]=!0,s["level"+n+"Completing"]=!1,s.showNav(),u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"You have successfully completed "+t+" treatment",timeout:2500,onHideCallback:function(){u.$broadcast("loader_hide")}})):(s.errors=i.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}}window.app.controller("BotoxGameController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","$timeout","formConfig","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function s(){$(".carousel").carousel();p();h();c()}function h(){t.get(api_botox_training).success(function(n){o.botoxCourseSlides=n.data})}function c(){t.get(api_botox_training_videos).success(function(n){o.botoxCoursesVideos=n.data;f.$parent.vm.virtualClassVideo=o.botoxCoursesVideos[1];$("#virtualClassroomVideo").get(0).load()})}function l(n){if(n==13){o.videoUrl=o.botoxCoursesVideos[0];var t=$("#carouselVideo");t.find("source").attr("src",o.videoUrl);$("#videoPopUp").modal("show");a(t)}}function a(n){var n=$("#carouselVideo");n.get(0).load();n.get(0).play()}function v(){var n=api_complete_hcp_module.replace("{courseId}",e.botoxId).replace("{moduleId}",e.botoxEducationModuleId);t.post(n)}function y(){var n=api_unlock_hcp_evaluation.replace("{courseId}",e.botoxId).replace("{moduleId}",e.botoxVirtualClassId);t.post(n)}function p(){var n=api_get_educationCourseDetails.replace("{courseId}",e.botoxId);t.get(n).then(function(n){n.data.success&&(o.botoxCourseDetails=n.data,o.botoxModules=o.botoxCourseDetails.data.modules)})}var o=this;o.init=s;o.botoxCourseSlides=[];o.botoxCoursesVideos=[];o.botoxCourseDetails={};o.botoxModules={};o.loadVideo=l;o.slideNavigation=slideNavigation;o.idx=0;$("#videoPopUp").on("hidden.bs.modal",function(){var n=$("#carouselVideo");n.get(0).pause()});$("#BotoxSlider").on("slid.bs.carousel",function(){o.idx=$(".carousel-inner div.active").index();f.$apply();o.idx===54&&o.botoxModules.length>0&&o.botoxModules[0].completedDate===null&&(v(),y())})}window.app.controller("BotoxTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","$scope","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){h.isNavigationOpen=!0;h.isHcp=!1;k();f.isHcp=="True"&&(h.isHcp=!0,c());a();v()}function a(){i.get(api_Juvederm_training).success(function(n){h.juvedermCourseSlides=n.data;h.totalSlides=h.juvedermCourseSlides.length-1})}function v(){i.get(api_juvederm_training_videos).success(function(n){h.juvedermCourseVideos=n.data})}function y(n){n===11&&(h.videoUrl=h.juvedermCourseVideos[0],s.showVideoPopup(h.videoUrl))}function p(){var n=api_complete_hcp_module.replace("{courseId}",f.juvedermId).replace("{moduleId}",f.juvedermEducationModuleId);i.post(n)}function w(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.juvedermId).replace("{moduleId}",f.juvedermEvaluationId);i.post(n).then(function(n){n.data.success&&c()})}function b(){$("#JuvedermSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function k(){i.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",f.juvedermId);i.get(n).then(function(n){n.data.success&&(h.juvedermCourseDetails=n.data,h.juvedermModules=h.juvedermCourseDetails.data.modules)})}function d(){h.activeTabIndex<3&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function g(n){h.activeTabIndex=n}function nt(n){if(n.$setSubmitted(),tt(n)){var t=api_submit_survey.replace("{courseId}",f.juvedermId).replace("{educationModuleId}",f.juvedermSurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(h.activeTabIndex=1,u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){u.$broadcast("loader_hide");window.location.href="/education"}}))})}else document.getElementById("display-error").scrollIntoView();e.invalidateControlOnSubmission(n)}function tt(n){return n.$valid}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=b;h.nextTab=d;h.activeTabIndex=1;h.submitSurvey=nt;h.activeTabSelected=g;h.getJuvedermCourseDetails=c;h.juvedermCourseSlides=[];h.juvedermCourseVideos=[];h.loadVideo=y;h.totalSlides=10;h.idx=0;$("#JuvedermSlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.juvedermModules.length>0&&h.juvedermModules[0].completedDate===null&&(p(),w(),h.isNavigationOpen==!1&&($("#JuvedermSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))});$("#carouselVideo").on("loadstart",function(){$("#videoLoaderId").show()});$("#carouselVideo").on("canplay",function(){$("#videoLoaderId").hide()})}window.app.controller("JuvedermController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function l(){o.isNavigationOpen=!0;o.juvedermQuestionNumber=1;p();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){e.checkAnswerCorrect($(this).closest(".item"))})}function a(){s.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};s.Answers.push(t)})});i.post(api_Juvederm_evaluation,s.Answers).then(function(n){n.data.success?y():n.data.errors.length==0&&(n.data.data!=null?v(n):h("NotCompleted"))})}function v(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});h("PleaseReTry")}function y(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});h("Congratulations")}function h(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function p(){c={1:"In a national online survey of 2,008 Australian women aged 20–49 years, 31% remained unaware of dermal fillers. <br /><br />1. Face Value survey, 2016.",3:"The VYCROSS<sup>&trade;<\/sup> Collection have customised gel hardness (G') and cohesivity (ability to retain integrity and resist spreading) to provide products with a range of lift capacities tailored for different facial areas and injection depths1<br /><br />1. Hee C et al. Dermatol Surg. 2015;41 Suppl 1:S373-81",4:"HYLACROSS<sup>&trade;<\/sup> proprietary technology incorporates a high degree of crosslinking and homogenisation to achieve a smooth-consistency gel with even flow characteristics.1-3<br /><br />1. Baumann LS et al. Dermatol Surg 2007;33:S128–S135; 2. Bernardin A et al. Presented at AMEC EMAA 2013; 3. Tezel A and Fredrickson GH. J Cosmet Laser Ther. 2008;10:35-42",5:"JUVEDÉRM<sup>&trade;<\/sup> VOLUMA<sup>&trade;<\/sup> with lidocaine restores volume in the face for up to 2 years.<br /><br />Callan P et al. Clin Cosmet Investig Dermatol. 2013;6;81-89."}}function w(n){if(n=="next"){var t=e.checkAnswerCorrect($(".question-"+o.juvedermQuestionNumber));t&&(o.juvedermQuestionNumber=o.juvedermQuestionNumber+1)}n=="back"&&(o.juvedermQuestionNumber=o.juvedermQuestionNumber-1)}var o=this,s,c;o.init=l;s={};o.submit=a;o.questions=[];o.navigateJuvedermQuestions=w;c={};$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getJuvedermCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("JuvedermEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","$sce","evaluationCommonService"]}(),function(){"use strict";function n(n,t){function r(){$(".carousel").carousel();u();f()}function u(){t.get(api_Juvederm_training).success(function(n){i.juvedermCourseSlides=n.data})}function f(){t.get(api_juvederm_training_videos).success(function(n){i.juvedermCourseVideos=n.data})}function e(n){n==11&&(i.videoUrl=i.juvedermCourseVideos[0],$("#carouselVideo").find("source").attr("src",i.videoUrl),$("#videoPopUp").modal("show"),o())}function o(){var n=$("#carouselVideo");n.get(0).load();n.get(0).play()}var i=this;i.init=r;i.juvedermCourseSlides=[];i.juvedermCourseVideos=[];i.loadVideo=e;$("#videoPopUp").on("hidden.bs.modal",function(){var n=$("video");n.get(0).pause()})}window.app.controller("JuvedermTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){h.isNavigationOpen=!0;h.isHcp=!1;k();f.isHcp=="True"&&(h.isHcp=!0,c());a();p()}function a(){i.get(api_Juvederm_advanced_training).success(function(n){h.juvedermAdvancedCourseSlides=n.data;h.totalSlides=h.juvedermAdvancedCourseSlides.length-1})}function v(){var n=api_complete_hcp_module.replace("{courseId}",f.juvedermAdvancedId).replace("{moduleId}",f.juvedermAdvancedEducationModuleId);i.post(n)}function y(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.juvedermAdvancedId).replace("{moduleId}",f.juvedermAdvancedEvaluationId);i.post(n).then(function(n){n.data.success&&c()})}function p(){i.get(api_Juvederm_advanced_training_videos).success(function(n){h.juvedermAdvancedCourseVideos=n.data})}function w(n){h.videoUrl="";n===18?h.videoUrl=h.juvedermAdvancedCourseVideos[0]:n===27?h.videoUrl=h.juvedermAdvancedCourseVideos[1]:n===35&&(h.videoUrl=h.juvedermAdvancedCourseVideos[2]);h.videoUrl!==""&&s.showVideoPopup(h.videoUrl)}function b(){$("#JuvedermAdvancedSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function k(){i.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",f.juvedermAdvancedId);i.get(n).then(function(n){n.data.success&&(h.juvedermAdvancedCourseDetails=n.data,h.juvedermAdvancedModules=h.juvedermAdvancedCourseDetails.data.modules)})}function d(){h.activeTabIndex<3&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function g(n){h.activeTabIndex=n}function nt(n){if(n.$setSubmitted(),tt(n)){var t=api_submit_survey.replace("{courseId}",f.juvedermAdvancedId).replace("{educationModuleId}",f.juvedermAdvancedSurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(h.activeTabIndex=4,u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){window.location.href="/education";u.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();e.invalidateControlOnSubmission(n)}function tt(n){return n.$valid}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=b;h.nextTab=d;h.activeTabIndex=1;h.submitSurvey=nt;h.activeTabSelected=g;h.getJuvedermAdvancedCourseDetails=c;h.juvedermCourseSlides=[];h.juvedermAdvancedCourseVideos=[];h.loadVideo=w;h.totalSlides=10;h.idx=0;$("#JuvedermAdvancedSlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.juvedermAdvancedModules.length>0&&h.juvedermAdvancedModules[0].completedDate===null&&(v(),y(),h.isNavigationOpen==!1&&($("#JuvedermAdvancedSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))});$("#carouselVideo").on("loadstart",function(){$("#videoLoaderId").show()});$("#carouselVideo").on("canplay",function(){$("#videoLoaderId").hide()})}window.app.controller("JuvedermAdvancedController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function l(){o.isNavigationOpen=!0;o.juvedermAdvancedQuestionNumber=1;w();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){e.checkAnswerCorrect($(this).closest(".item"))})}function a(n){if(n=="next"){var t=e.checkAnswerCorrect($(".question-"+o.juvedermAdvancedQuestionNumber));t&&(o.juvedermAdvancedQuestionNumber=o.juvedermAdvancedQuestionNumber+1)}n=="back"&&(o.juvedermAdvancedQuestionNumber=o.juvedermAdvancedQuestionNumber-1)}function v(){s.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};s.Answers.push(t)})});i.post(api_Juvederm_advanced_evaluation,s.Answers).then(function(n){n.data.success?p():n.data.errors.length==0&&(n.data.data!=null?y(n):h("NotCompleted"))})}function y(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});h("PleaseReTry")}function p(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});h("Congratulations")}function h(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function w(){c={2:"Assessment considerations in the mid face include atrophy or fat pads and loss of malar projection and bone structure. The best results for shaping the cheekbones are obtained in patients with good mid facial fullness but insufficient malar projection and with minor malar and submalar deficiencies. (de Maio et al 2009; de Maio et al 2006)",3:"The male lower face is usually more square with stronger jaws. Use of filler in the lips in less common in males compared with females. Volume loss and sagging produces marionette lines, nasolabial folds and grooves. Loss of definition of the jawline can be dramatic after the fifth decade (de Maio 2015)"}}var o=this,s,c;o.init=l;s={};o.submit=v;o.questions=[];o.navigateJuvedermAdvancedQuestions=a;c={};$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getJuvedermAdvancedCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("JuvedermAdvancedEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","$sce","evaluationCommonService"]}(),function(){"use strict";function n(n,t){function r(){$(".carousel").carousel();u();f()}function u(){t.get(api_Juvederm_advanced_training).success(function(n){i.juvedermAdvancedCourseSlides=n.data})}function f(){t.get(api_Juvederm_advanced_training_videos).success(function(n){i.juvedermAdvancedCourseVideos=n.data})}function e(n){n==18?i.videoUrl=i.juvedermAdvancedCourseVideos[0]:n==27?i.videoUrl=i.juvedermAdvancedCourseVideos[1]:n==35&&(i.videoUrl=i.juvedermAdvancedCourseVideos[2]);$("video").find("source").attr("src",i.videoUrl);$("#videoPopUp").modal("show");o()}function o(){var n=$("video");n.get(0).load();n.get(0).play()}var i=this;i.init=r;i.juvedermCourseSlides=[];i.juvedermAdvancedCourseVideos=[];i.loadVideo=e;$("#videoPopUp").on("hidden.bs.modal",function(){var n=$("video");n.get(0).pause()})}window.app.controller("JuvedermAdvancedTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){h.isNavigationOpen=!0;h.isHcp=!1;k();$(".carousel").carousel();f.isHcp=="True"&&(h.isHcp=!0,c());a();v()}function a(){i.get(api_Juvederm_intermediate_training).success(function(n){h.juvedermIntermediateCourseSlides=n.data;h.totalSlides=h.juvedermIntermediateCourseSlides.length-1})}function v(){i.get(api_Juvederm_intermediate_training_videos).success(function(n){h.juvedermIntermediateCourseVideos=n.data})}function y(n){h.videoUrl="";n===26?h.videoUrl=h.juvedermIntermediateCourseVideos[0]:n===46?h.videoUrl=h.juvedermIntermediateCourseVideos[1]:n===62&&(h.videoUrl=h.juvedermIntermediateCourseVideos[2]);h.videoUrl!==""&&s.showVideoPopup(h.videoUrl)}function p(){var n=api_complete_hcp_module.replace("{courseId}",f.juvedermIntermediateId).replace("{moduleId}",f.juvedermIntermediateEducationModuleId);i.post(n)}function w(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.juvedermIntermediateId).replace("{moduleId}",f.juvedermIntermediateEvaluationId);i.post(n).then(function(n){n.data.success&&c()})}function b(){$("#JuvedermIntermediateSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function k(){i.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",f.juvedermIntermediateId);i.get(n).then(function(n){n.data.success&&(h.juvedermIntermediateCourseDetails=n.data,h.juvedermIntermediateModules=h.juvedermIntermediateCourseDetails.data.modules)})}function d(){h.activeTabIndex<3&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function g(n){h.activeTabIndex=n}function nt(n){if(n.$setSubmitted(),tt(n)){var t=api_submit_survey.replace("{courseId}",f.juvedermIntermediateId).replace("{educationModuleId}",f.juvedermIntermediateSurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(h.activeTabIndex=4,u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){window.location.href="/education";u.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();e.invalidateControlOnSubmission(n)}function tt(n){return n.$valid}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=b;h.nextTab=d;h.activeTabIndex=1;h.submitSurvey=nt;h.activeTabSelected=g;h.getJuvedermIntermediateCourseDetails=c;h.juvedermCourseSlides=[];h.juvedermIntermediateCourseVideos=[];h.loadVideo=y;h.idx=0;h.totalSlides=36;$("#JuvedermIntermediateSlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.juvedermIntermediateModules.length>0&&h.juvedermIntermediateModules[0].completedDate===null&&(p(),w(),h.isNavigationOpen==!1&&($("#JuvedermIntermediateSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))})}window.app.controller("JuvedermIntermediateController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function l(){o.isNavigationOpen=!0;o.juvedermIntermediateQuestionNumber=1;w();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){e.checkAnswerCorrect($(this).closest(".item"))})}function a(n){if(n=="next"){var t=e.checkAnswerCorrect($(".question-"+o.juvedermIntermediateQuestionNumber));t&&(o.juvedermIntermediateQuestionNumber=o.juvedermIntermediateQuestionNumber+1)}n=="back"&&(o.juvedermIntermediateQuestionNumber=o.juvedermIntermediateQuestionNumber-1)}function v(){s.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};s.Answers.push(t)})});i.post(api_Juvederm_intermediate_evaluation,s.Answers).then(function(n){n.data.success?p():n.data.errors.length==0&&(n.data.data!=null?y(n):h("NotCompleted"))})}function y(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});h("PleaseReTry")}function p(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});h("Congratulations")}function h(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function w(){c={2:"Assessment considerations in the mid face include atrophy or fat pads and loss of malar projection and bone structure. The best results for shaping the cheekbones are obtained in patients with good mid facial fullness but insufficient malar projection and with minor malar and submalar deficiencies. (de Maio et al 2009; de Maio et al 2006)",3:"The male lower face is usually more square with stronger jaws. Use of filler in the lips in less common in males compared with females. Volume loss and sagging produces marionette lines, nasolabial folds and grooves. Loss of definition of the jawline can be dramatic after the fifth decade (de Maio 2015)"}}var o=this,s,c;o.init=l;s={};o.submit=v;o.questions=[];o.navigateJuvedermIntermediateQuestions=a;c={};$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getJuvedermIntermediateCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("JuvedermIntermediateEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","$sce","evaluationCommonService"]}(),function(){"use strict";function n(n,t){function r(){$(".carousel").carousel();u();f()}function u(){t.get(api_Juvederm_intermediate_training).success(function(n){i.juvedermIntermediateCourseSlides=n.data})}function f(){t.get(api_Juvederm_intermediate_training_videos).success(function(n){i.juvedermIntermediateCourseVideos=n.data})}function e(n){n==26?i.videoUrl=i.juvedermIntermediateCourseVideos[0]:n==46?i.videoUrl=i.juvedermIntermediateCourseVideos[1]:n==62&&(i.videoUrl=i.juvedermIntermediateCourseVideos[2]);$("video").find("source").attr("src",i.videoUrl);$("#videoPopUp").modal("show");o()}function o(){var n=$("video");n.get(0).load();n.get(0).play()}var i=this;i.init=r;i.juvedermCourseSlides=[];i.juvedermIntermediateCourseVideos=[];i.loadVideo=e;$("#videoPopUp").on("hidden.bs.modal",function(){var n=$("video");n.get(0).pause()})}window.app.controller("JuvedermIntermediateTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){h.isNavigationOpen=!0;h.videoCompleteInfo="Completed JUVÉDERM® - Introductory Techniques Virtual Classroom";h.isHcp=!1;v();f.isHcp=="True"&&(c(),h.isHcp=!0);y();p()}function a(){$("#JuvedermPartOneSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function v(){i.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",f.juvedermPartOneId);i.get(n).then(function(n){n.data.success&&(h.juvedermPartOneCourseDetails=n.data,h.juvedermPartOneModules=h.juvedermPartOneCourseDetails.data.modules)})}function y(){i.get(api_Juvederm_part_one_training).success(function(n){h.juvedermPartOneCourseSlides=n.data;h.totalSlides=h.juvedermPartOneCourseSlides.length-1})}function p(){i.get(api_Juvederm_part_one_training_videos).success(function(n){h.juvedermPartOneCourseVideos=n.data;h.virtualClassVideo=h.juvedermPartOneCourseVideos[3];var t=$("#virtualClassroomVideo");s.createReplaceVimeo(t,h.virtualClassVideo).then(function(n){n.on("ended",function(){$("#videoCompleteInfo").modal("show")})})})}function w(n){h.videoUrl="";n===26?h.videoUrl=h.juvedermPartOneCourseVideos[0]:n===46?h.videoUrl=h.juvedermPartOneCourseVideos[1]:n===62&&(h.videoUrl=h.juvedermPartOneCourseVideos[2]);h.videoUrl!==""&&s.showVideoPopup(h.videoUrl)}function b(){var n=api_complete_hcp_module.replace("{courseId}",f.juvedermPartOneId).replace("{moduleId}",f.juvedermPartOneEducationModuleId);i.post(n)}function k(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.juvedermPartOneId).replace("{moduleId}",f.juvedermPartOneVirtualClassId);i.post(n).then(function(n){n.data.success&&c()})}function d(){h.activeTabIndex<3&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function g(n){h.activeTabIndex=n}function nt(){var n=api_complete_hcp_module.replace("{courseId}",f.juvedermPartOneId).replace("{moduleId}",f.juvedermPartOneVirtualClassId);i.post(n)}function tt(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.juvedermPartOneId).replace("{moduleId}",f.juvedermPartOneEvaluationId);i.post(n).then(function(n){n.data.success&&c()})}function it(n){if(n.$setSubmitted(),rt(n)){var t=api_submit_survey.replace("{courseId}",f.juvedermPartOneId).replace("{educationModuleId}",f.juvedermPartOneSurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(h.activeTabIndex=1,u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){c();h.activeTabIndex=5;u.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();e.invalidateControlOnSubmission(n)}function rt(n){return n.$valid}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=a;h.nextTab=d;h.activeTabIndex=1;h.submitSurvey=it;h.activeTabSelected=g;h.getJuvedermPartOneCourseDetails=c;h.juvedermPartOneCourseSlides=[];h.juvedermPartOneCourseVideos=[];h.loadVideo=w;h.idx=0;h.totalSlides=46;$("#JuvedermPartOneSlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.juvedermPartOneModules.length>0&&h.juvedermPartOneModules[0].completedDate===null&&(b(),k(),h.isNavigationOpen==!1&&($("#JuvedermPartOneSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))});$("#videoCompleteInfo").on("hidden.bs.modal",function(){nt();tt();h.activeTabIndex=3})}window.app.controller("JuvedermIntroductoryTechniquesController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function l(){o.isNavigationOpen=!0;o.juvedermPartOneQuestionNumber=1;w();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){e.checkAnswerCorrect($(this).closest(".item"))})}function a(n){if(n=="next"){var t=e.checkAnswerCorrect($(".question-"+o.juvedermPartOneQuestionNumber));t&&(o.juvedermPartOneQuestionNumber=o.juvedermPartOneQuestionNumber+1)}n=="back"&&(o.juvedermPartOneQuestionNumber=o.juvedermPartOneQuestionNumber-1)}function v(){s.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};s.Answers.push(t)})});i.post(api_Juvederm_part_one_evaluation,s.Answers).then(function(n){n.data.success?p():n.data.errors.length==0&&(n.data.data!=null?y(n):h("NotCompleted"))})}function y(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});h("PleaseReTry")}function p(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});h("Congratulations")}function h(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function w(){c={2:"Assessment considerations in the mid face include atrophy or fat pads and loss of malar projection and bone structure. The best results for shaping the cheekbones are obtained in patients with good mid facial fullness but insufficient malar projection and with minor malar and submalar deficiencies. (de Maio et al 2009; de Maio et al 2006)",3:"The male lower face is usually more square with stronger jaws. Use of filler in the lips in less common in males compared with females. Volume loss and sagging produces marionette lines, nasolabial folds and grooves. Loss of definition of the jawline can be dramatic after the fifth decade (de Maio 2015)"}}var o=this,s,c;o.init=l;s={};o.submit=v;o.questions=[];o.navigateJuvedermPartOneQuestions=a;c={};$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getJuvedermPartOneCourseDetails();n.$parent.vm.activeTabIndex=4})}window.app.controller("JuvedermIntroductoryTechniquesEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","$sce","evaluationCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function s(){$(".carousel").carousel();h();c();e.initPlayerBehaviour($("video"))}function h(){t.get(api_Juvederm_part_one_training).success(function(n){o.juvedermPartOneCourseSlides=n.data})}function c(){t.get(api_Juvederm_part_one_training_videos).success(function(n){o.juvedermPartOneCourseVideos=n.data;f.$parent.vm.virtualClassVideo=o.juvedermPartOneCourseVideos[3];$("#virtualClassroomVideo").get(0).load()})}function l(n){o.videoUrl="";n===26?o.videoUrl=o.juvedermPartOneCourseVideos[0]:n===46?o.videoUrl=o.juvedermPartOneCourseVideos[1]:n===62&&(o.videoUrl=o.juvedermPartOneCourseVideos[2]);o.videoUrl!==""&&e.showVideoPopup(o.videoUrl)}var o=this;o.init=s;o.juvedermPartOneCourseSlides=[];o.juvedermPartOneCourseVideos=[];o.loadVideo=l}window.app.controller("JuvedermIntroductoryTechniquesTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","$scope","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){$(".carousel").carousel();h.isNavigationOpen=!0;c();v();a()}function a(){i.get(api_Juvederm_part_two_training).success(function(n){h.juvedermPartTwoCourseSlides=n.data;h.totalSlides=h.juvedermPartTwoCourseSlides.length-1})}function v(){i.get(api_lookup_byType.replace("{0}",e.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",e.juvedermPartTwoId);i.get(n).then(function(n){n.data.success&&(h.juvedermPartTwoCourseDetails=n.data,h.juvedermPartTwoModules=h.juvedermPartTwoCourseDetails.data.modules)})}function y(){$("#JuvedermPartTwoSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function p(){h.activeTabIndex<6&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function w(n){h.activeTabIndex=n}function b(n){if(n.$setSubmitted(),k(n)){var t=api_submit_survey.replace("{courseId}",e.juvedermPartTwoId).replace("{educationModuleId}",e.juvedermPartTwoSurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(f.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){window.location.href="/education";f.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();o.invalidateControlOnSubmission(n)}function k(n){return n.$valid}function d(){var n=api_Juvederm_part_two_complete;i.post(n).then(function(){h.idx=h.totalSlides;window.setTimeout(function(){window.location.href="/education"},2500)})}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=y;h.nextTab=p;h.activeTabIndex=1;h.activeTabSelected=w;h.submitSurvey=b;h.getJuvedermPartTwoEducationCourseDetails=c;h.juvedermPartTwoCourseSlides=[];h.totalSlides=26;h.idx=0;$("#JuvedermPartTwoSlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.juvedermPartTwoModules.length>0&&h.juvedermPartTwoModules[0].completedDate===null&&(d(),h.isNavigationOpen==!1&&($("#JuvedermPartTwoSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))})}window.app.controller("JuvedermTreatmentProtocolsController",n);n.$inject=["$scope","$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster"]}(),function(){"use strict";function n(n,t,i){function s(){r.isNavigationOpen=!0;r.juvedermPartTwoQuestionNumber=1;a()}function o(){e.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};e.Answers.push(t)})});i.post(api_JuvedermPartTwo_evaluation,e.Answers).then(function(n){n.data.success?c():n.data.errors.length==0&&(n.data.data!=null?h(n):f("NotCompleted"))})}function h(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});f("PleaseReTry")}function c(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});f("Congratulations")}function f(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function l(n){if(n=="next"||n=="submit"){r.juvedermPartTwoInfo=u[r.juvedermPartTwoQuestionNumber];var t=r.juvedermPartTwoQuestionNumber in u;t&&f("JuvedermPartTwoPopUpInfo");r.juvedermPartTwoQuestionNumber=r.juvedermPartTwoQuestionNumber+1}else n=="back"&&(r.juvedermPartTwoQuestionNumber=r.juvedermPartTwoQuestionNumber-1)}function a(){u={}}var r=this,e={},u;r.submit=o;r.init=s;r.navigateJuvedermPartTwoQuestions=l;u={};$("#JuvedermPartTwoPopUpInfo").on("hidden.bs.modal",function(){r.juvedermPartTwoQuestionNumber>11&&o()});$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getJuvedermPartTwoEducationCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("JuvedermTreatmentProtocolsEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(){var n=this;n.init=init;n.idx=0;n.juvedermPartTwoCourseSlides=[]}window.app.controller("JuvedermTreatmentProtocolsTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","$scope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function a(){$(".carousel").carousel();c.isNavigationOpen=!0;l();p();v();y()}function v(){i.get(api_MDCodes_Distinction_training).success(function(n){c.mdCodesDistinctionCourseSlides=n.data;c.totalSlides=c.mdCodesDistinctionCourseSlides.length-1})}function y(){i.get(api_MDCodes_Distinction_training_videos).success(function(n){c.mdCodesDistinctionCoursesVideos=n.data})}function p(){i.get(api_lookup_byType.replace("{0}",e.lookupType)).success(function(n){c.surveyRating=n.SurveyRating})}function l(){var n=api_get_educationCourseDetails.replace("{courseId}",e.mdCodesDistinctionId);i.get(n).then(function(n){n.data.success&&(c.mdCodesDistinctionCourseDetails=n.data,c.mdCodesDistinctionModules=c.mdCodesDistinctionCourseDetails.data.modules)})}function w(n){n==22&&(c.videoUrl=c.mdCodesDistinctionCoursesVideos[0],h.showVideoPopup(c.videoUrl));n==23&&(c.videoUrl=c.mdCodesDistinctionCoursesVideos[1],h.showVideoPopup(c.videoUrl));n==24&&(c.videoUrl=c.mdCodesDistinctionCoursesVideos[2],h.showVideoPopup(c.videoUrl))}function b(){$("#MDCodesDistinctionSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");c.isNavigationOpen==!0?c.isNavigationOpen=!1:c.isNavigationOpen==!1&&(c.isNavigationOpen=!0)}function k(){c.activeTabIndex<6&&(c.errors=[],c.activeTabIndex=c.activeTabIndex+1)}function d(n){c.activeTabIndex=n}function g(n){if(n.$setSubmitted(),nt(n)){var t=api_submit_survey.replace("{courseId}",e.mdCodesDistinctionId).replace("{educationModuleId}",e.mdCodesDistinctionSurveyModuleId);i.post(t,c.model.survey).then(function(n){n.data.success&&(f.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){window.location.href="/education";f.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();o.invalidateControlOnSubmission(n)}function nt(n){return n.$valid}function tt(){var n=api_MDCodes_Distinction_complete;i.post(n).then(function(){c.idx=c.totalSlides})}function it(){var n=api_unlock_hcp_evaluation.replace("{courseId}",e.mdCodesDistinctionId).replace("{moduleId}",e.mdCodesDistinctionEvaluationId);i.post(n).then(function(n){n.data.success&&l()})}var c=this;c.init=a;c.isNavigationOpen=!0;c.toggleNavigation=b;c.nextTab=k;c.activeTabIndex=1;c.activeTabSelected=d;c.submitSurvey=g;c.getMDCodesDistinctionEducationCourseDetails=l;c.mdCodesDistinctionCoursesVideos=[];c.mdCodesDistinctionCourseSlides=[];c.totalSlides=41;c.idx=0;c.loadVideo=w;$("#MDCodesDistinctionSlider").on("slid.bs.carousel",function(){c.idx=$(".carousel-inner div.active").index();n.$apply();c.idx===c.totalSlides&&c.mdCodesDistinctionModules.length>0&&c.mdCodesDistinctionModules[0].completedDate===null&&(tt(),it(),c.isNavigationOpen==!1&&($("#MDCodesDistinctionSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),c.isNavigationOpen=!0))})}window.app.controller("MDCodesDistinctionController",n);n.$inject=["$scope","$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function l(){e.isNavigationOpen=!0;e.mdCodesDistinctionQuestionNumber=1;p();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){f.checkAnswerCorrect($(this).closest(".item"))})}function c(){o.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};o.Answers.push(t)})});i.post(api_MDCodes_Distinction_evaluation,o.Answers).then(function(n){n.data.success?v():n.data.errors.length==0&&(n.data.data!=null?a(n):s("NotCompleted"))})}function a(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});s("PleaseReTry")}function v(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});s("Congratulations")}function s(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function y(n){if(n=="next"||n=="submit"){var t=f.checkAnswerCorrect($(".mdCodesDistinctionQuestionNumber.question-"+e.mdCodesDistinctionQuestionNumber));t&&(e.mdCodesDistinctionQuestionNumber=e.mdCodesDistinctionQuestionNumber+1)}else n=="back"&&(e.mdCodesDistinctionQuestionNumber=e.mdCodesDistinctionQuestionNumber-1)}function p(){h={}}var e=this,o={},h;e.submit=c;e.init=l;e.navigateMDCodesDistinctionQuestions=y;h={};$("#MDCodesDistinctionPopUpInfo").on("hidden.bs.modal",function(){e.mdCodesDistinctionQuestionNumber>11&&c()});$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getMDCodesDistinctionEducationCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("MDCodesDistinctionEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){$(".carousel").carousel();h.isNavigationOpen=!0;c();v();a()}function a(){i.get(api_MDCodes_visionary_training).success(function(n){h.mdCodesVisionaryCourseSlides=n.data;h.totalSlides=h.mdCodesVisionaryCourseSlides.length-1})}function v(){i.get(api_lookup_byType.replace("{0}",e.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",e.mdCodesVisionaryId);i.get(n).then(function(n){n.data.success&&(h.mdCodesVisionaryCourseDetails=n.data,h.mdCodesVisionaryModules=h.mdCodesVisionaryCourseDetails.data.modules)})}function y(){$("#MDCodesVisionarySideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function p(){h.activeTabIndex<6&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function w(n){h.activeTabIndex=n}function b(n){if(n.$setSubmitted(),k(n)){var t=api_submit_survey.replace("{courseId}",e.mdCodesVisionaryId).replace("{educationModuleId}",e.mdCodesVisionarySurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(f.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){window.location.href="/education";f.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();o.invalidateControlOnSubmission(n)}function k(n){return n.$valid}function d(){var n=api_unlock_hcp_evaluation.replace("{courseId}",e.mdCodesVisionaryId).replace("{moduleId}",e.mdCodesVisionaryEvaluationId);i.post(n).then(function(n){n.data.success&&c()})}function g(){var n=api_MDCodes_visionary_complete;i.post(n).then(function(){h.idx=h.totalSlides})}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=y;h.nextTab=p;h.activeTabIndex=1;h.activeTabSelected=w;h.submitSurvey=b;h.getMDCodesVisionaryEducationCourseDetails=c;h.mdCodesVisionaryCourseSlides=[];h.totalSlides=41;h.idx=0;$("#MDCodesVisionarySlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.mdCodesVisionaryModules.length>0&&h.mdCodesVisionaryModules[0].completedDate===null&&(g(),d(),h.isNavigationOpen==!1&&($("#MDCodesVisionarySideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))})}window.app.controller("MDCodesVisionaryController",n);n.$inject=["$scope","$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f){function l(){e.isNavigationOpen=!0;e.mdCodesVisionaryQuestionNumber=1;p();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){f.checkAnswerCorrect($(this).closest(".item"))})}function c(){o.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};o.Answers.push(t)})});i.post(api_MDCodes_visionary_evaluation,o.Answers).then(function(n){n.data.success?v():n.data.errors.length==0&&(n.data.data!=null?a(n):s("NotCompleted"))})}function a(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});s("PleaseReTry")}function v(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});s("Congratulations")}function s(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function y(n){if(n=="next"||n=="submit"){var t=f.checkAnswerCorrect($(".mdCodesVisionaryQuestionNumber.question-"+e.mdCodesVisionaryQuestionNumber));t&&(e.mdCodesVisionaryQuestionNumber=e.mdCodesVisionaryQuestionNumber+1)}else n=="back"&&(e.mdCodesVisionaryQuestionNumber=e.mdCodesVisionaryQuestionNumber-1)}function p(){h={}}var e=this,o={},h;e.submit=c;e.init=l;e.navigateMDCodesVisionaryQuestions=y;h={};$("#MDCodesVisionaryPopUpInfo").on("hidden.bs.modal",function(){e.mdCodesVisionaryQuestionNumber>11&&c()});$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getMDCodesVisionaryEducationCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("MDCodesVisionaryEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function c(){e.isNavigationOpen=!0;e.facialAnatomyQuestionNumber=1;l();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){f.checkAnswerCorrect($(this).closest(".item"))})}function l(){h={1:"Ageing has a direct impact on volume in the face. Fat loss and descent in the fat pads inverts the ‘triangle of youth’. (Massry et al 2011)",2:"The skin comprises hyaluronic acid, collagen and elastin, which are produced by fibroblasts. Hyaluronic acid retains water within the dermis, providing volume. (Tortora et al 2012; Papkonstantinou et al. 2012)",4:"In general, facial skin is thinner in the upper face compared with the lower face region, which contributes to early signs of ageing in this area. During ageing, skin thickness increases on the forehead and cheeks but decreases in infraorbital areas (Ha et al. 2005; Pellacani et al. 1999)",5:"The underlying cause of tear troughs can be multifactorial, including volume loss and skin laxity, but the predominant cause of tear trough deformity is volume loss. In some patients, dark circles under the eyes can also develop due to prominent subcutaneous venous pooling, pigmentation and changes in skin thickness. (Sadick et al 2007)",6:"Ageing of the mid face typically occurs in the mid-40s. The lower eyelids and surrounding tissues are usually the first to cause concern. Almost all aspects of the mid face undergo degeneration and this is predictable in the majority of individuals. (Hartstein et al. 2012)",8:"Asian patients show signs of facial ageing later than Caucasians and usually develop wrinkles 10-20 years later. Thicker skin and dermal support delays the onset of facial sagging. (Nouveau-Richard et al 2005; Chung et al. 2003; Liew et al 2016)",9:"Marionette lines are deep grooves that appear from the edge of the mouth to the jaw. They draw the corners of the mouth downwards and make the face look sad or hard. They are caused by action of the depressor anguli oris and the platysma muscles and increased laxity of the SMAS. (de Maio et al 2006)"}}function a(n){if(n=="next"){var t=f.checkAnswerCorrect($(".facialAnatomyQuestionNumber.question-"+e.facialAnatomyQuestionNumber));t&&(e.facialAnatomyQuestionNumber=e.facialAnatomyQuestionNumber+1)}n=="back"&&(e.facialAnatomyQuestionNumber=e.facialAnatomyQuestionNumber-1)}function v(){o.Answers=[];$(".questions .facialAnatomyQuestionNumber").each(function(){var n=$(this).attr("data-id");$(".facialAnatomyQuestionNumber input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};o.Answers.push(t)})});i.post(api_facialAnatomy_evaluation,o.Answers).then(function(n){n.data.success?p():n.data.errors.length==0&&(n.data.data!=null?y(n):s("NotCompletedFacialAnatomy"))})}function y(n){$(".questions .facialAnatomyQuestionNumber").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});s("PleaseReTryFacialAnatomy")}function p(){$(".questions .facialAnatomyQuestionNumber").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});s("CongratulationsFacialAnatomy")}function s(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}var e=this,o={},h;e.submitFacialAnatomy=v;e.init=c;h={};e.navigateFacialAnatomyQuestions=a;o.Answers=[];$("#CongratulationsFacialAnatomy").on("hidden.bs.modal",function(){n.$parent.vm.getTotalFaceEducationCourseDetails();n.$parent.vm.getFacialAnatomyEducationCourseDetails();n.$parent.vm.activeTabIndex=6})}window.app.controller("FacialAnatomyEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(n,t){function r(){$(".carousel").carousel();u();f()}function u(){t.get(api_facialAnatomy_training).success(function(n){i.facialAnatomyCourseSlides=n.data})}function f(){t.get(api_facialAnatomy_training_videos).success(function(n){i.facialAnatomyCourseVideos=n.data})}function e(n){var t;n==19?t=0:n==36?t=1:n==45?t=2:n==62&&(t=3);t!==undefined&&(i.videoUrl=i.facialAnatomyCourseVideos[t],$("video source").attr("src",i.videoUrl),$("#videoPopUp").modal("show"),o())}function o(){var n=$("video");n.get(0).load();n.get(0).play()}var i=this;i.initFacialAnatomy=r;i.facialAnatomyCourseSlides=[];i.facialAnatomyCourseVideos=[];i.loadVideo=e;i.videoUrl="";$("#videoPopUp").on("hidden.bs.modal",function(){var n=$("video");n.get(0).pause()})}window.app.controller("FacialAnatomyTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function v(){f.selectedCourseInHomePage===2&&(c.activeTabIndex=4);$("#TotalFaceSlider, #FacialAnatomySlider").carousel();c.isNavigationOpen=!0;c.isHcp=!1;et();f.isHcp==="True"&&(c.isHcp=!0,l(),a())}function y(){p();w()}function p(){t.get(api_totalface_training).success(function(n){c.totalFaceCourseSlides=n.data;c.totalSlides=c.totalFaceCourseSlides.length-1})}function w(){t.get(api_totalface_training_videos).success(function(n){c.totalFaceCourseVideos=n.data})}function b(n){c.videoUrl="";n===31?(c.videoUrl=c.totalFaceCourseVideos[0],$("video").attr("src",c.videoUrl)):n===36&&(c.videoUrl=c.totalFaceCourseVideos[1],$("video").attr("src",c.videoUrl));c.videoUrl!==""&&h.showVideoPopup(c.videoUrl)}function k(){var n=api_complete_hcp_module.replace("{courseId}",f.totalFaceId).replace("{moduleId}",f.totalFaceEducationModuleId);t.post(n)}function d(){var n=api_unlock_hcp_evaluation.replace("{courseId}",f.totalFaceId).replace("{moduleId}",f.totalFaceEvaluationId);t.post(n).then(function(n){n.data.success&&l()})}function g(){nt();tt()}function nt(){t.get(api_facialAnatomy_training).success(function(n){c.facialAnatomyCourseSlides=n.data;c.totalFASlides=c.facialAnatomyCourseSlides.length-1})}function tt(){t.get(api_facialAnatomy_training_videos).success(function(n){c.facialAnatomyCourseVideos=n.data})}function it(n){var t;n===19?t=0:n===36?t=1:n===45?t=2:n===62&&(t=3);t!==undefined&&(c.videoUrl=c.facialAnatomyCourseVideos[t],h.showVideoPopup(c.videoUrl))}function rt(){var n=api_complete_hcp_module.replace("{courseId}",f.facialAnatomyId).replace("{moduleId}",f.totalAnatomyEducationModuleId);t.post(n)}function ut(){var n=Date.now(),i=api_unlock_hcp_evaluation.replace("{courseId}",f.facialAnatomyId).replace("{moduleId}",f.totalAnatomyEvaluationId);t.post(i).then(function(t){t.data.success&&f.selectedCourseInHomePage===2&&a(function(n,t){return function(){var i=5e3-Date.now()+n;i=i>0?i:0;window.setTimeout(function(){t.activeTabSelected(5)},i)}}(n,c))})}function ft(){$("#totalFaceSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");c.isNavigationOpen===!0?c.isNavigationOpen=!1:c.isNavigationOpen===!1&&(c.isNavigationOpen=!0)}function et(){t.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){c.surveyRating=n.SurveyRating})}function l(){var n=api_get_educationCourseDetails.replace("{courseId}",f.totalFaceId);t.get(n).then(function(n){n.data.success&&(c.totalFaceCourseDetails=n.data,c.totalFaceModules=c.totalFaceCourseDetails.data.modules)})}function a(n){var i=api_get_educationCourseDetails.replace("{courseId}",f.facialAnatomyId);t.get(i).then(function(t){t.data.success&&(c.facialAnatomyCourseDetails=t.data,c.facialAnatomyModules=c.facialAnatomyCourseDetails.data.modules,console.log(c.facialAnatomyModules),n&&n())})}function ot(){c.activeTabIndex<=5&&(c.errors=[],c.activeTabIndex=c.activeTabIndex+1)}function st(n){c.activeTabIndex=n}function ht(n,i){var r,s,h;n.$setSubmitted();ct(n)?(r=0,s=0,i==="totalFace"?(r=f.totalFaceId,s=f.totalFaceSurveyModuleId):i==="facialAnatomy"&&(r=f.facialAnatomyId,s=f.facialAnatomySurveyModuleId),h=api_submit_survey.replace("{courseId}",r).replace("{educationModuleId}",s),t.post(h,c.model.survey).then(function(n){n.data.success&&(u.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){u.$broadcast("loader_hide");window.location.href="/education"}}))})):document.getElementById("display-error").scrollIntoView();e.invalidateControlOnSubmission(n)}function ct(n){return n.$valid}var c=this;c.init=v;c.isNavigationOpen=!0;c.toggleNavigation=ft;c.nextTab=ot;c.activeTabIndex=1;c.activeTabSelected=st;c.totalFaceCourseSlides=[];c.getFacialAnatomyEducationCourseDetails=a;c.getTotalFaceEducationCourseDetails=l;c.submitSurvey=ht;c.initTotalFace=y;c.loadFaceVideo=b;c.totalFaceCourseSlides=[];c.totalFaceCourseVideos=[];c.videoUrl="";c.totalSlides=10;c.idx=0;c.initFacialAnatomy=g;c.facialAnatomyCourseSlides=[];c.facialAnatomyCourseVideos=[];c.loadFAVideo=it;c.videoFAUrl="";c.totalFASlides=10;c.idxfa=0;$("#TotalFaceSlider").on("slid.bs.carousel",function(){c.idx=$(".carousel-inner div.active").index();s.$apply();c.idx===c.totalSlides&&c.totalFaceModules.length>0&&c.totalFaceModules[0].completedDate===null&&(k(),d(),c.isNavigationOpen===!1&&($("#totalFaceSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),c.isNavigationOpen=!0))});$("#FacialAnatomySlider").on("slid.bs.carousel",function(){c.idxfa=$("#FacialAnatomySlider").find(".carousel-inner div.active").index();s.$apply();c.idxfa===c.totalFASlides&&c.facialAnatomyModules.length>0&&c.facialAnatomyModules[0].completedDate===null&&(rt(),ut(),c.isNavigationOpen===!1&&($("#totalFaceSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),c.isNavigationOpen=!0))})}window.app.controller("TotalFaceController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster","$scope","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function c(){e.isNavigationOpen=!0;e.totalFaceQuestionNumber=1;l();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){f.checkAnswerCorrect($(this).closest(".item"))})}function l(){h={1:"There are many factors that can influence your patient's decision to seek treatment with facial injectables. Understanding your patient and applying a Total Face consultation can overcome barriers and improve patient satisfaction in facial rejuvenation.",2:"Avoid phrases such as 'looking younger' or 'turning back the clock'. Women don't necessarily want to look 20 years younger. Instead, consider talking about 'ageing well' and 'ageing the way you want, in a natural way. <br /><br />Address media scares and controversy to help dispel incorrect information or confusion. Tackle issues head-on to remove any doubt about the treatment they have received.",3:"A Total Face consultation will help alleviate any concerns your patient may have on perceptions, expectations, cost and results. If your patient is open to it, you should suggest a future treatment plan based on your expectations of their ongoing ageing process and beauty goals.",6:"A 2- to 4-week follow-up appointment provides you the opportunity to review your patient’s results, take post-treatment photographs and to discuss future treatment plans.",7:"During the initial assessment, gain an overall impression of the patient’s facial appearance. This includes skin quality (e.g. discolouration, vascularisation, scarring), and facial shape and curves (i.e. ovoid, oblong, square, round, or trapezoid).",8:"During a spot assessment, evaluate the face at rest and during animation and identify any key distractors on the face. Assess: dynamic and static lines, position and mobility of brow, eyelid function and presence of excess skin, and volume loss in the upper face."}}function a(n){if(n=="next"){var t=f.checkAnswerCorrect($(".totalFaceQuestionNumber.question-"+e.totalFaceQuestionNumber));t&&(e.totalFaceQuestionNumber=e.totalFaceQuestionNumber+1)}n=="back"&&(e.totalFaceQuestionNumber=e.totalFaceQuestionNumber-1)}function v(){o.Answers=[];$(".questions .totalFaceQuestionNumber").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};o.Answers.push(t)})});i.post(api_totalface_evaluation,o.Answers).then(function(n){n.data.success?p():n.data.errors.length==0&&(n.data.data!=null?y(n):s("NotCompleted"))})}function y(n){$(".questions .totalFaceQuestionNumber").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});s("PleaseReTry")}function p(){$(".questions .totalFaceQuestionNumber").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});s("CongratulationsTotalFace")}function s(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}var e=this,o={},h;e.submit=v;e.init=c;h={};e.navigateTotalFaceQuestions=a;$("#CongratulationsTotalFace").on("hidden.bs.modal",function(){n.$parent.vm.getTotalFaceEducationCourseDetails();n.$parent.vm.getFacialAnatomyEducationCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("TotalFaceEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(n,t){function r(){$(".carousel").carousel();u();f()}function u(){t.get(api_totalface_training).success(function(n){i.totalFaceCourseSlides=n.data})}function f(){t.get(api_totalface_training_videos).success(function(n){i.totalFaceCourseVideos=n.data})}function e(n){n==31?(i.videoUrl=i.totalFaceCourseVideos[0],$("video").attr("src",i.videoUrl)):n==36&&(i.videoUrl=i.totalFaceCourseVideos[1],$("video").attr("src",i.videoUrl));$("#videoPopUp").modal("show");o()}function o(){var n=$("video");n.get(0).load();n.get(0).play()}var i=this;i.initTotalFace=r;i.loadVideo=e;i.totalFaceCourseSlides=[];i.totalFaceCourseVideos=[];i.videoUrl="";$("#videoPopUp").on("hidden.bs.modal",function(){var n=$("video");n.get(0).pause()})}window.app.controller("TotalFaceTrainingController",n);n.$inject=["$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function l(){$(".carousel").carousel();h.isNavigationOpen=!0;c();v();a()}function a(){i.get(api_Volite_training).success(function(n){h.voliteCourseSlides=n.data;h.totalSlides=h.voliteCourseSlides.length-1})}function v(){i.get(api_lookup_byType.replace("{0}",e.lookupType)).success(function(n){h.surveyRating=n.SurveyRating})}function c(){var n=api_get_educationCourseDetails.replace("{courseId}",e.voliteId);i.get(n).then(function(n){n.data.success&&(h.voliteCourseDetails=n.data,h.voliteModules=h.voliteCourseDetails.data.modules)})}function y(){$("#VoliteSideNavigation").toggleClass("collapsed");$("#content").toggleClass("col-md-12 col-md-9");h.isNavigationOpen==!0?h.isNavigationOpen=!1:h.isNavigationOpen==!1&&(h.isNavigationOpen=!0)}function p(){h.activeTabIndex<6&&(h.errors=[],h.activeTabIndex=h.activeTabIndex+1)}function w(n){h.activeTabIndex=n}function b(n){if(n.$setSubmitted(),k(n)){var t=api_submit_survey.replace("{courseId}",e.voliteId).replace("{educationModuleId}",e.voliteSurveyModuleId);i.post(t,h.model.survey).then(function(n){n.data.success&&(f.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Thank you for your feedback",timeout:2500,onHideCallback:function(){window.location.href="/education";f.$broadcast("loader_hide")}}))})}else document.getElementById("display-error").scrollIntoView();o.invalidateControlOnSubmission(n)}function k(n){return n.$valid}function d(){var n=api_Volite_complete;i.post(n).then(function(){h.idx=h.totalSlides})}function g(){var n=api_unlock_hcp_evaluation.replace("{courseId}",e.voliteId).replace("{moduleId}",e.voliteEvaluationId);i.post(n).then(function(n){n.data.success&&c()})}var h=this;h.init=l;h.isNavigationOpen=!0;h.toggleNavigation=y;h.nextTab=p;h.activeTabIndex=1;h.activeTabSelected=w;h.submitSurvey=b;h.getVoliteEducationCourseDetails=c;h.voliteCoursesVideos=[];h.voliteCourseSlides=[];h.totalSlides=41;h.idx=0;$("#VoliteSlider").on("slid.bs.carousel",function(){h.idx=$(".carousel-inner div.active").index();n.$apply();h.idx===h.totalSlides&&h.voliteModules.length>0&&h.voliteModules[0].completedDate===null&&(d(),g(),h.isNavigationOpen==!1&&($("#VoliteSideNavigation").toggleClass("collapsed"),$("#content").toggleClass("col-md-12 col-md-9"),h.isNavigationOpen=!0))})}window.app.controller("VoliteController",n);n.$inject=["$scope","$window","httpService","modelStateErrorBuilder","$sessionStorage","$rootScope","formConfig","utilitySvc","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f){function l(){e.isNavigationOpen=!0;e.voliteQuestionNumber=1;p();$("input[type=radio], input[type=checkbox], select",".questions").on("change",function(){f.checkAnswerCorrect($(this).closest(".item"))})}function c(){o.Answers=[];$(".questions .item").each(function(){var n=$(this).attr("data-id");$("input[name='question-"+n+"']:checked").each(function(){var t={QuestionId:n,AnswerId:$(this).attr("data-val"),Value:"selected"};o.Answers.push(t)})});i.post(api_Volite_evaluation,o.Answers).then(function(n){n.data.success?v():n.data.errors.length==0&&(n.data.data!=null?a(n):s("NotCompleted"))})}function a(n){$(".questions .item").each(function(){var t=$(this).children(".title"),r,i;t.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");r=$(this).attr("data-id");t.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question");for(i in n.data.data)if(!n.data.data[i].isCorrect&&parseInt(r)==n.data.data[i].questionId){t.find("p[class^='question-status']").removeClass("correct-question").addClass("wrong-question");break}});s("PleaseReTry")}function v(){$(".questions .item").each(function(){var n=$(this).children(".title"),t;n.find("p[class^='question-status']").removeClass().addClass("question-status text-blue");t=$(this).attr("data-id");n.find("p[class^='question-status']").removeClass("text-blue").addClass("correct-question")});s("Congratulations")}function s(n){var r=$(window).height(),i=205,t;$("#"+n+" .modal-dialog").height(i);t=(r-i)/2;$("#"+n+" .modal-dialog").css("margin-top",t-t*.2);$("#"+n).modal("show")}function y(n){if(n=="next"||n=="submit"){var t=f.checkAnswerCorrect($(".voliteQuestionNumber.question-"+e.voliteQuestionNumber));t&&(e.voliteQuestionNumber=e.voliteQuestionNumber+1)}else n=="back"&&(e.voliteQuestionNumber=e.voliteQuestionNumber-1)}function p(){h={}}var e=this,o={},h;e.submit=c;e.init=l;e.navigateVoliteQuestions=y;h={};$("#VolitePopUpInfo").on("hidden.bs.modal",function(){e.voliteQuestionNumber>11&&c()});$("#Congratulations").on("hidden.bs.modal",function(){n.$parent.vm.getVoliteEducationCourseDetails();n.$parent.vm.activeTabIndex=3})}window.app.controller("VoliteEvaluationController",n);n.$inject=["$scope","$window","httpService","$sessionStorage","$rootScope","evaluationCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e){function s(){h();c()}function h(){var n=api_hcp_dashboard_education.replace("{userId}",f.userId);u.get(n).success(function(n){o.hcpEducationDetails=n.data;angular.forEach(o.hcpEducationDetails,function(n){n.courseId==f.totalFaceModuleId?n.course="TOTAL FACE MODULE":n.courseId==f.botoxModuleId?n.course="BOTOX MODULES":n.courseId==f.juvedermModuleId&&(n.course="JUVEDERM MODULES");n.startDate!=null&&(n.startDateDay=e.utc(n.startDate).local().format("D"),n.startDateMonth=e.utc(n.startDate).local().format("MMM"))})})}function c(){var n=api_search_my_resource.replace("{keyword}","");u.get(n).success(function(n){console.log(n);o.resources=n.result;o.resources.length<1&&o.resources.push({resourceId:1,resourceTitle:"Clinical Papers page",url:"/resources/clinicalPaperResources",isRecommended:!1});o.resources.length<2&&o.resources.push({resourceId:1,resourceTitle:"Consumer Resources page",url:"/resources/comsumerResources",isRecommended:!1});o.resources.length<3&&o.resources.push({resourceId:2,resourceTitle:"Video Resources page",url:"/resources/videos",isRecommended:!1})})}function l(n){return o.resources[n].url!=null&&o.resources[n].url!=""?o.resources[n].url:o.resources[n].fileUrl!=null&&o.resources[n].fileUrl!=""?o.resources[n].fileUrl:o.resources[n].resourceType==4?o.resources[n].videoUrl:void 0}var o=this;o.model=o.model||{};o.init=s;o.redirectToResource=l;o.resources=[]}window.app.controller("HcpDashboardController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","moment"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function y(){u.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){c.dosings=n.Dosing;c.treatmentAreas=n.TreatmentArea});u.get(api_hcp_getProducts).success(function(n){c.products=n.data})}function p(t){if(c.errors=[],w(t),t.$valid&&c.errors.length==0){var r=api_hcp_addInjectorDevelopmentPlan,i=o.convertTextToDate(c.model.dateOfVisittmp);c.model.visitDate=i.getFullYear()+"-"+(i.getMonth()+1)+"-"+i.getDate();c.model.hcpId=s.hcpId;u.post(r,c.model).then(function(i){i.data.success?(l(),c.model=null,t.$setPristine(),t.$setUntouched(),n.$broadcast("loader_show"),h.pop({type:"success",title:"Success",body:"Saved successfully",timeout:1e3,onHideCallback:function(){n.$broadcast("loader_hide")}})):(c.errors=i.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();o.invalidateControlOnSubmission(t)}function l(){var n=api_hcp_searchInjectorDevelopment,t=e.tz.guess();return n=n.replace("{hcpId}",c.searchOption.hcpId),n=n.replace("{pageSize}",c.searchOption.pageSize),n=n.replace("{pageNo}",c.searchOption.pageNumber),n=n.replace("{sort}",c.searchOption.sort),n=n.replace("{keyword}",c.searchOption.keyword),n=n.replace("{tz}",t),u.get(n).then(function(n){var i,t,r,u;if(n.data.success){for(c.gridOptions.totalItems=n.data.data.totalCount,i=0;i<n.data.data.result.length;i++)t=n.data.data.result[i],t.visitStartTime!=null&&(r=t.visitStartTime.split(":"),t.visitStartTime=r[0]+":"+r[1]),t.visitEndTime!=null&&(u=t.visitEndTime.split(":"),t.visitEndTime=u[0]+":"+u[1]);c.gridOptions.data=n.data.data.result}else c.errors=n.data.errors})}function w(n){if(c.model.dateOfVisittmp!=null&&c.model.dateOfVisittmp!==undefined&&c.model.dateOfVisittmp!=""){var t=new Date,i=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=o.convertTextToDate(c.model.dateOfVisittmp);if(r>i){v("Future visit dates can not be entered");return}}n.startTimetmp.$error.required||n.endTimetmp.$error.required||c.model.visitEndTime<c.model.visitStartTime&&v("End time cannot occur before the start time")}function v(n){for(var i=!1,t=0;t<c.errors.length;t++)if(c.errors[t].message==n){i=!0;break}i||c.errors.push({message:n})}var c=this,a;c.roleHcp=s.roleHcp;c.model=c.model||{};c.submitForm=p;c.errors=[];c.searchOption={hcpId:s.hcpId,pageNumber:1,pageSize:25,sort:"-visitDate",keyword:""};c.gridOptions=o.uiGrid.createDefaultUIGridOptions(f,c.searchOption,l);c.gridOptions.columnDefs=[{name:"visitDate",displayName:"Date time",maxWidth:120,enableCellEdit:!1,cellTemplate:"<span ng-bind=\"(row.entity.visitDate | date: 'dd/MM/yyyy')\"><\/span><div ng-bind=\"row.entity.visitStartTime + ' - ' + row.entity.visitEndTime\"><\/div>"},{name:"trainerName",displayName:"Trainer",enableCellEdit:!1},{name:"treatmentAreaName",displayName:"Treatment areas",enableCellEdit:!1},{name:"dosingName",displayName:"Dosing",enableCellEdit:!1},{name:"numberOfPatients",displayName:"Patients",enableCellEdit:!1},{name:"productName",displayName:"Products",enableCellEdit:!1},{name:"actionPlan",displayName:"Action plan",enableCellEdit:!1}];a=c.gridOptions.onRegisterApi;c.gridOptions.onRegisterApi=function(n){a(n)};t.$watch("vm.filterValue",function(n){n!==undefined&&(c.searchOption.keyword=n,l())});c.init=function(){n.$broadcast("loader_show");l();var i=new Date,u=i.getHours(),t=i.getMinutes(),r=u+":"+(t>9?t:"0"+t);$(".date-picker").datepicker({autoclose:!0,todayHighlight:!0});$(".time-picker").timepicker({showMeridian:!1,defaultTime:"current",secondStep:1,minuteStep:1});c.model.visitStartTime=r;c.model.visitEndTime=r;y()}}window.app.controller("AdminInjectorDevelopmentController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig","toaster"]}(),function(){"use strict";function n(){function t(t){n.activeTabIndex=t}var n=this;n.activeTabSelected=t;n.activeTabIndex=parseInt($("#hdftabId").val())}window.app.controller("PractitionerDetailsController",n);n.$inject=["$scope"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c){function a(){p();v()}function y(n){console.log(n);u.post(api_workshop_confirmWorkshopPractitioner.replace("{workshopId}",n.workshopId).replace("{hcpId}",f.hcpId)).then(function(t){t.data.success&&(n.courseStatus="Completed",n.workshopAttended=t.data.data)})}function v(){var t=h.tz.guess(),n=api_hcp_getPractitionerEducationActivityDetails;return n=n.replace("{pageSize?}",l.searchOption.pageSize),n=n.replace("{pageNo?}",l.searchOption.pageNo),n=n.replace("{sort?}",l.searchOption.sort),n=n.replace("{hcpId}",l.searchOption.hcpId),n=n.replace("{0}",t),n=n.replace("{1}",l.searchOption.keyword),u.get(n).success(function(n){l.gridOptions.data=n.data.result;l.gridOptions.totalItems=n.data.totalCount;angular.forEach(l.gridOptions.data,function(n){n.courseStartedDate==null&&n.workshopAttendedDate!=null?n.courseStarted="not started":n.courseStartedDate!=null&&(n.courseStarted=h.utc(n.courseStartedDate).local().format("DD/MM/YYYY"));n.courseStarted!=null&&n.evaluationCompleted==="N/A"?n.evaluationCompleted=n.courseCompletedDate!=null?h.utc(n.courseCompletedDate).local().format("DD/MM/YYYY"):"completed":n.evaluationCompletedDate==null?n.evaluationCompleted="not completed":n.evaluationCompletedDate!=null&&(n.evaluationCompleted=h.utc(n.evaluationCompletedDate).local().format("DD/MM/YYYY"));n.workshopAttendedDate!=null&&n.workshopAttended!="N/A"&&(n.workshopAttended=h.utc(n.workshopAttendedDate).local().format("DD/MM/YYYY"));n.fastTrackedDate!=null&&n.fastTrackedDate!=undefined&&n.fastTrackedDate!=""&&(n.fastTrackedDate=h.utc(n.fastTrackedDate).local().format("DD/MM/YYYY"))})})}function p(){var n=api_hcp_getHcpAllEducationCourseDetails.replace("{hcpId}",f.hcpId);u.get(n).success(function(n){l.responseData=n.data;angular.forEach(l.responseData,function(n){n.completedDate!=null&&(n.courseId==1?l.isTotalFaceDisabled=!0:n.courseId==2?l.isFacialAnatomyDisabled=!0:n.courseId==3?l.isBotoxDisabled=!0:n.courseId==4?l.isBelkyraDisabled=!0:n.courseId==5?l.isJuvedermDisabled=!0:n.courseId==6?l.isTreatmentProtocolsDisabled=!0:n.courseId==7?l.isIntroductoryTechniquesDisabled=!0:n.courseId==8?l.isIntermediateTechniquesDisabled=!0:n.courseId==9?l.isAdvancedTechniquesDisabled=!0:n.courseId==10?l.isVisionaryDisabled=!0:n.courseId==11&&(l.isDistinctionDisabled=!0));n.isFastTracked&&(n.courseId==1?l.isTotalFace=!0:n.courseId==2?l.isFacialAnatomy=!0:n.courseId==3?l.isBotox=!0:n.courseId==4?l.isBelkyra=!0:n.courseId==5?l.isJuvederm=!0:n.courseId==6?l.isTreatmentProtocols=!0:n.courseId==7?l.isIntroductoryTechniques=!0:n.courseId==8?l.isIntermediateTechniques=!0:n.courseId==9?l.isAdvancedTechniques=!0:n.courseId==10?l.isVisionary=!0:n.courseId==11&&(l.isDistinction=!0))});d()})}function w(n,t){n?(l.isAdvancedTechniques&&!l.isIntermediateTechniquesDisabled&&(l.isIntermediateTechniques=!0),l.isIntermediateTechniques&&!l.isIntroductoryTechniquesDisabled&&(l.isIntroductoryTechniques=!0),l.isIntroductoryTechniques&&!l.isTreatmentProtocolsDisabled&&(l.isTreatmentProtocols=!0),l.isTreatmentProtocols&&!l.isJuvedermDisabled&&(l.isJuvederm=!0),(l.isJuvederm&&!l.isBotoxDisabled||l.isBelkyra&&!l.isBotoxDisabled)&&(l.isBotox=!0),l.isBotox&&!l.isFacialAnatomyDisabled&&(l.isFacialAnatomy=!0),l.isFacialAnatomy&&!l.isTotalFaceDisabled&&(l.isTotalFace=!0),(l.isJuvederm||l.isTreatmentProtocols||l.isIntroductoryTechniques||l.isIntermediateTechniques||l.isAdvancedTechniques)&&t=="juvederm"&&(l.isBelkyra=!1),l.isBelkyra&&t=="belkyra"&&(l.isJuvederm=l.isTreatmentProtocols=l.isIntroductoryTechniques=l.isIntermediateTechniques=l.isAdvancedTechniques=!1)):n||(l.isTotalFace||l.isFacialAnatomyDisabled||(l.isFacialAnatomy=!1),l.isFacialAnatomy||l.isBotoxDisabled||(l.isBotox=!1),l.isBotox||l.isBelkyraDisabled||(l.isBelkyra=!1),l.isBotox||l.isJuvedermDisabled||(l.isJuvederm=!1),l.isJuvederm||l.isTreatmentProtocolsDisabled||(l.isTreatmentProtocols=!1),l.isTreatmentProtocols||l.isIntroductoryTechniquesDisabled||(l.isIntroductoryTechniques=!1),l.isIntroductoryTechniques||l.isIntermediateTechniquesDisabled||(l.isIntermediateTechniques=!1),l.isIntermediateTechniques||l.isAdvancedTechniquesDisabled||(l.isAdvancedTechniques=!1))}function b(){k();var n=api_hcp_fastTrackDetails.replace("{hcpId}",f.hcpId).replace("{0}",l.checkedCourseIds.trim(","));console.log(n);u.post(n).success(function(n){l.errors=[];l.errors=n.errors;n.errors.length>0?(i.build(l.errors,l.model),document.getElementById("page-wrapper").scrollIntoView()):(o.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Practitioner fast tracked successfully",timeout:2500,onHideCallback:function(){o.$broadcast("loader_hide");a()}}))})}function k(){l.checkedCourseIds="";$(".hcp-training-details input[name='course']:checked").each(function(){var n=$(this).attr("data-val");l.checkedCourseIds!=""?l.checkedCourseIds+=","+n:l.checkedCourseIds=n});console.log(l.checkedCourseIds)}function d(){l.isAdvancedTechniquesDisabled?(l.isIntermediateTechniquesDisabled=!0,l.isIntroductoryTechniquesDisabled=!0,l.isTreatmentProtocolsDisabled=!0,l.isJuvedermDisabled=!0,l.isBelkyraDisabled=!0,l.isBotoxDisabled=!0,l.isFacialAnatomyDisabled=!0,l.isTotalFaceDisabled=!0):l.isIntermediateTechniquesDisabled?(l.isIntroductoryTechniquesDisabled=!0,l.isTreatmentProtocolsDisabled=!0,l.isJuvedermDisabled=!0,l.isBelkyraDisabled=!0,l.isBotoxDisabled=!0,l.isFacialAnatomyDisabled=!0,l.isTotalFaceDisabled=!0):l.isIntroductoryTechniquesDisabled?(l.isTreatmentProtocolsDisabled=!0,l.isJuvedermDisabled=!0,l.isBelkyraDisabled=!0,l.isBotoxDisabled=!0,l.isFacialAnatomyDisabled=!0,l.isTotalFaceDisabled=!0):l.isTreatmentProtocolsDisabled?(l.isJuvedermDisabled=!0,l.isBelkyraDisabled=!0,l.isBotoxDisabled=!0,l.isFacialAnatomyDisabled=!0,l.isTotalFaceDisabled=!0):l.isJuvedermDisabled||l.isBelkyraDisabled?(l.isBotoxDisabled=!0,l.isFacialAnatomyDisabled=!0,l.isTotalFaceDisabled=!0):l.isBotoxDisabled?(l.isFacialAnatomyDisabled=!0,l.isTotalFaceDisabled=!0):l.isFacialAnatomyDisabled&&(l.isTotalFaceDisabled=!0)}var l=this;l.model=l.model||{};l.init=a;l.tickFastTrackingCourse=w;l.submitFastTrack=b;l.isBotox=!1;l.isJuvederm=!1;l.isAdvancedTraining=!1;l.isAdvancedTechniques=!1;l.isBelkyra=!1;l.isVisionary=!1;l.isDistinction=!1;l.isBotoxDisabled=!1;l.isJuvedermDisabled=!1;l.isAdvancedTrainingDisabled=!1;l.isAdvancedTechniquesDisabled=!1;l.isBelkyraDisabled=!1;l.isVisionaryDisabled=!1;l.isDistinctionDisabled=!1;l.fastTrackDetails=[];l.searchOption={pageNo:1,pageSize:25,sort:"courseStarted",keyword:"",hcpId:f.hcpId};l.gridOptions=r.uiGrid.createDefaultUIGridOptions(c,l.searchOption,v);l.gridOptions.appScopeProvider=l;l.markCompleted=y;l.gridOptions.columnDefs=[{name:"educationCourse",displayName:"Education course",enableCellEdit:!1},{name:"courseStarted",displayName:"Course started",enableCellEdit:!1},{name:"evaluationCompleted",displayName:"Online completed",enableCellEdit:!1},{name:"fastTrackedDate",displayName:"Fast tracked date",enableCellEdit:!1},{name:"workshopAttended",displayName:"Workshop attended",enableCellEdit:!1}];n.$watch("vm.filterValue",function(n){n!==undefined&&(l.searchOption.keyword=n,getPractitonerEducationCourseDetails())})}window.app.controller("TrainingDetailsController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","$timeout","$rootScope","toaster","moment","uiGridConstants"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o){function h(){var n=api_hcp_searchInjectorDevelopmentByHcp,t=e.tz.guess();return n=n.replace("{pageSize}",s.searchOption.pageSize),n=n.replace("{pageNo}",s.searchOption.pageNumber),n=n.replace("{sort}",s.searchOption.sort),n=n.replace("{keyword}",s.searchOption.keyword),n=n.replace("{tz}",t),u.get(n).then(function(n){var i,t,r,u;if(n.data.success){for(s.gridOptions.totalItems=n.data.data.totalCount,i=0;i<n.data.data.result.length;i++)t=n.data.data.result[i],t.visitStartTime!=null&&(r=t.visitStartTime.split(":"),t.visitStartTime=r[0]+":"+r[1]),t.visitEndTime!=null&&(u=t.visitEndTime.split(":"),t.visitEndTime=u[0]+":"+u[1]);s.gridOptions.data=n.data.data.result}else s.errors=n.data.errors})}function l(){var t="/education/ExportInjectorDevPlanPdf?startTime={0}&endTime={1}",i="",r="",n;s.model.startDatetmp!=null&&s.model.startDatetmp!==undefined&&s.model.startDatetmp!=""&&(n=o.convertTextToDate(s.model.startDatetmp),i=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate());s.model.endDatetmp!=null&&s.model.endDatetmp!==undefined&&s.model.endDatetmp!=""&&(n=o.convertTextToDate(s.model.endDatetmp),r=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate());t=t.replace("{0}",i);t=t.replace("{1}",r);location.href=t}var s=this,c;s.model=s.model||{};s.errors=[];s.exportToPdf=l;s.searchOption={pageNumber:1,pageSize:25,sort:"-visitDate",keyword:""};s.gridOptions=o.uiGrid.createDefaultUIGridOptions(f,s.searchOption,h);s.gridOptions.columnDefs=[{name:"visitDate",displayName:"Date time",maxWidth:120,enableCellEdit:!1,cellTemplate:"<span ng-bind=\"(row.entity.visitDate | date: 'dd/MM/yyyy')\"><\/span><div ng-bind=\"row.entity.visitStartTime + ' - ' + row.entity.visitEndTime\"><\/div>"},{name:"trainerName",displayName:"Trainer",enableCellEdit:!1},{name:"treatmentAreaName",displayName:"Treatment areas",enableCellEdit:!1},{name:"dosingName",displayName:"Dosing",enableCellEdit:!1},{name:"numberOfPatients",displayName:"Patients",enableCellEdit:!1},{name:"productName",displayName:"Products",enableCellEdit:!1},{name:"actionPlan",displayName:"Action plan",enableCellEdit:!1}];c=s.gridOptions.onRegisterApi;s.gridOptions.onRegisterApi=function(n){c(n)};t.$watch("vm.filterValue",function(n){n!==undefined&&(s.searchOption.keyword=n,h())});s.init=function(){n.$broadcast("loader_show");h();$(".date-picker").datepicker({autoclose:!0,todayHighlight:!0})}}window.app.controller("InjectorDevelopmentController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c,l){function p(){v()}function v(){a.isLoaded=!1;var n="";n=h.isHcp!=1?api_search_clinic_paper_resource.replace("{keyword}",a.filterValue?a.filterValue:""):api_search_clinic_paper_hcpResource.replace("{keyword}",a.filterValue?a.filterValue:"");u.get(n).success(function(n){a.isLoaded=!0;a.listResource=n.result;a.resourceGridOptions.data=n.result;a.resourceGridOptions.totalItems=n.totalCount})}var a=this,y;a.listResource=[];a.isLoaded=!0;a.searchOption={pageNumber:1,pageSize:25,sort:"title",keyword:""};a.resourceGridOptions=r.uiGrid.createDefaultUIGridOptions(c,a.searchOption,v);a.resourceGridOptions.paginationPageSizes=[15,25,50,100];a.resourceGridOptions.columnDefs=[];y=[{name:"resourceTitle",displayName:"Title",maxWidth:180},{name:"resourceDescription",displayName:"Description",maxWidth:200},{name:"brand",displayName:"Brand"},{field:"view",enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a href="javascript:void(0);" ng-click="grid.appScope.onClickResourcePageItem(row.entity);">View<\/a><\/div>',maxWidth:180}];a.resourceGridOptions.appScopeProvider=a;a.resourceGridOptions.columnDefs=a.resourceGridOptions.columnDefs.concat(y);n.$watch("vm.filterValue",function(n){n!==undefined&&v()});a.onClickResourcePageItem=function(n){var i=n.url==null||n.url==""?n.fileUrl:n.url,r=function(i){/^https:\/\/vimeo.com\//i.test(i)?(a.activeResource=n,l.showVideoPopup(i,!0)):t.open(i,"_blank")};i.indexOf("/GetResourceUrl?fileUrl=")>-1?u.get(i).success(r).error(function(){window.alert("there was an error retrieving the resource")}):r(i)};p()}window.app.controller("clinicalPaperResourceController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","$rootScope","toaster","$sce","formConfig","uiGridConstants","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c){function v(){a()}function a(){l.isLoaded=!1;var n=api_search_consumer_resource.replace("{keyword}",l.filterValue?l.filterValue:"");u.get(n).success(function(n){l.isLoaded=!0;l.listResource=n.result;l.resourceGridOptions.data=n.result;l.resourceGridOptions.totalItems=n.totalCount})}var l=this;l.listResource=[];l.isLoaded=!0;l.searchOption={pageNumber:1,pageSize:25,sort:"title",keyword:""};l.resourceGridOptions=r.uiGrid.createDefaultUIGridOptions(h,l.searchOption,a);l.resourceGridOptions.paginationPageSizes=[15,25,50,100];l.resourceGridOptions.columnDefs=[{name:"resourceTitle",displayName:"Title",maxWidth:180},{name:"resourceDescription",displayName:"Description",maxWidth:200},{name:"brand",displayName:"Brand"},{field:"view",enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a href="javascript:void(0);" ng-click="grid.appScope.onClickResourcePageItem(row.entity);">View<\/a><\/div>',maxWidth:180}];l.resourceGridOptions.appScopeProvider=l;n.$watch("vm.filterValue",function(n){n!==undefined&&a()});l.onClickResourcePageItem=function(n){var r=function(i){/\.mp4/.test(i)?(l.activeResource=n,c.showVideoPopup(i,!0)):t.open(i,"_blank")},i=n.url==null||n.url==""?n.fileUrl:n.url;i.indexOf("/GetResourceUrl?fileUrl=")>-1?u.get(i).success(r).error(function(){window.alert("there was an error retrieving the resource")}):r(i)};v()}window.app.controller("consumerResourcePageController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","$rootScope","toaster","$sce","uiGridConstants","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c){function v(){a()}function a(){var n=api_search_my_resource.replace("{keyword}",l.filterValue?l.filterValue:"");l.isLoaded=!1;u.get(n).success(function(n){l.isLoaded=!0;l.listResource=n.result;l.resourceGridOptions.data=n.result;l.resourceGridOptions.totalItems=n.totalCount})}var l=this;l.listResource=[];l.isLoaded=!0;l.searchOption={pageNumber:1,pageSize:25,sort:"title",keyword:""};l.resourceGridOptions=r.uiGrid.createDefaultUIGridOptions(h,l.searchOption,a);l.resourceGridOptions.paginationPageSizes=[15,25,50,100];l.resourceGridOptions.columnDefs=[{name:"resourceTitle",displayName:"Title",maxWidth:180},{name:"resourceDescription",displayName:"Description",maxWidth:200},{name:"brand",displayName:"Brand"},{field:"view",enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a href="javascript:void(0);" ng-click="grid.appScope.onClickResourcePageItem(row.entity);">View<\/a><\/div>',maxWidth:180}];l.resourceGridOptions.appScopeProvider=l;n.$watch("vm.filterValue",function(n){n!==undefined&&a()});l.onClickResourcePageItem=function(n){var r=function(i){/\.mp4/.test(i)?(l.activeResource=n,c.showVideoPopup(i,!0)):t.open(i,"_blank")},i=n.url==null||n.url==""?n.fileUrl:n.url;i.indexOf("/GetResourceUrl?fileUrl=")>-1?u.get(i).success(r).error(function(){window.alert("there was an error retrieving the resource")}):r(i)};v()}window.app.controller("myRecommendedResourcePageController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","$rootScope","toaster","$sce","uiGridConstants","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u){function e(){o()}function o(){u.get(api_get_my_resource).success(function(n){console.log(n);f.listPage=n})}var f=this;f.listPage=[];f.onClickResourcePageItem=function(n){t.open(n,"_self")};e()}window.app.controller("myResourcePageController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","$rootScope","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c,l){function y(){v()}function v(){var n="";n=h.isHcp!=1?api_search_video_resource.replace("{keyword}",a.filterValue?a.filterValue:""):api_search_video_hcpResource.replace("{keyword}",a.filterValue?a.filterValue:"");a.isLoaded=!1;u.get(n).success(function(n){a.isLoaded=!0;a.listResource=n.result;a.resourceGridOptions.data=n.result;a.resourceGridOptions.totalItems=n.totalCount})}var a=this;a.listResource=[];a.isLoaded=!0;a.searchOption={pageNumber:1,pageSize:25,sort:"title",keyword:""};a.resourceGridOptions=r.uiGrid.createDefaultUIGridOptions(c,a.searchOption,v);a.resourceGridOptions.paginationPageSizes=[15,25,50,100];a.resourceGridOptions.columnDefs=[{name:"resourceTitle",displayName:"Title",maxWidth:180},{name:"resourceDescription",displayName:"Description",maxWidth:200},{name:"brand",displayName:"Brand"},{field:"view",enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a href="javascript:void(0);" ng-click="grid.appScope.onClickResourcePageItem(row.entity);">View<\/a><\/div>',maxWidth:180}];a.resourceGridOptions.appScopeProvider=a;n.$watch("vm.filterValue",function(n){n!==undefined&&v()});a.onClickResourcePageItem=function(n){var r=function(i){/^https:\/\/vimeo.com\//i.test(i)?(a.activeResource=n,l.showVideoPopup(i,!0)):t.open(i,"_blank")},i=n.url==null||n.url==""?n.fileUrl:n.url;i.indexOf("/GetResourceUrl?fileUrl=")>-1?u.get(i).success(r).error(function(){window.alert("there was an error retrieving the resource")}):r(i)};y()}window.app.controller("videoResourceController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","$rootScope","toaster","$sce","formConfig","uiGridConstants","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function c(){u.get(api_getProgress).then(function(n){h.progress=n.data.data})}function l(n){h.errors=[];var t=a(n);return n.$valid&&t}function a(n){return n.email.$error.email?(h.errors.push({message:"Please enter valid email address"}),!1):!0}var h=this;h.model={};h.feedbackSubmitted=!1;h.feedbackSuccess=!1;h.options=[];h.init=function(){c()};h.submit=function(n){if(n.$setSubmitted(),l(n)){var f=api_addFeedback;u.post(f,h.model).then(function(n){h.errors=[];h.errors=n.data.errors;n.data.errors.length>0?(i.build(h.errors,h.model),document.getElementById("feedback-form-title").scrollIntoView()):n.status===200&&(n.data.data!=null&&n.data.data.type=="loginRedirectUrl"?t.location.href=n.data.data.message:(h.feedbackSubmitted=!0,h.feedbackSuccess=!0))})}else document.getElementById("feedback-form-title").scrollIntoView();r.invalidateControlOnSubmission(n)}}window.app.controller("myProfilePageController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","$timeout","$rootScope","toaster","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function y(){c();l()}function c(){var n=api_resource_for_practitioner_search,t=h.selectedPractitioner?h.selectedPractitioner.id:0;return n=n.replace("{pageSize}",h.searchResourceOption.pageSize),n=n.replace("{pageNo}",h.searchResourceOption.pageNumber),n=n.replace("{hcpId}",t),n=n.replace("{sort}",h.searchResourceOption.sort),n=n.replace("{keyword?}",h.searchResourceOption.keyword),u.get(n).success(function(n){h.RecommendResourceGridOptions.data=n.result;h.RecommendResourceGridOptions.totalItems=n.totalCount})}function l(){var n=api_hcp_resource_search;return n=n.replace("{pageSize}",h.searchHcpResourceOption.pageSize),n=n.replace("{pageNo}",h.searchHcpResourceOption.pageNumber),n=n.replace("{sort}",h.searchHcpResourceOption.sort),n=n.replace("{keyword?}",h.searchHcpResourceOption.keyword),u.get(n).success(function(n){h.ResourceAllocationHistoryGridOptions.data=n.result;h.ResourceAllocationHistoryGridOptions.totalItems=n.totalCount})}function p(n){if(b()){var t={HcpId:h.selectedPractitioner.id,ResourceId:n};u.post(api_add_hcp_resource,t).then(function(n){h.errors=[];h.errors=n.data.errors;n.data.errors.length>0?(i.build(h.errors,h.model),document.getElementById("page-wrapper").scrollIntoView()):(s.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Allocate resource added successfully",timeout:2500,onHideCallback:function(){l();c();s.$broadcast("loader_hide")}}))})}}function w(n){var t=api_remove_hcp_resource.replace("{hcpResource}",n);u.post(t).then(function(n){h.errors=[];h.errors=n.data.errors;n.data.errors.length>0?(i.build(h.errors,h.model),document.getElementById("page-wrapper").scrollIntoView()):(s.$broadcast("loader_show"),o.pop({type:"success",title:"Success",body:"Allocate Resource deleted successfully",timeout:2500,onHideCallback:function(){l();c();s.$broadcast("loader_hide")}}))})}function b(){var n=!0;return(!h.selectedPractitioner.id||h.selectedPractitioner.id&&h.selectedPractitioner.id===0)&&(h.errors.push({key:"validateField",message:"Please select a practitioner"}),n=!1),n}var h=this,a,v;h.model=h.model||{};h.init=y;h.errors=[];h.selectedPractitioner={};h.allocateResource=p;h.removeAllocateResource=w;h.searchResourceOption={pageNumber:1,pageSize:25,sort:"title",keyword:""};h.searchHcpResourceOption={pageNumber:1,pageSize:25,sort:"title",keyword:""};n.$watch("vm.filterValue",function(n){n!==undefined&&(h.searchResourceOption.keyword=n,c())});n.$watch("vm.filterHcpValue",function(n){n!==undefined&&(h.searchHcpResourceOption.keyword=n,l())});n.$watch("vm.model.selectedPractitioner",function(n){n!==undefined&&n!==null&&n.length===0&&(h.selectedPractitioner={},c())});h.searchPractitioner=function(n){var i=api_hcp_search_by_name.replace("{name}",n),t=[];return u.get(i,{disable_loading:!0}).then(function(n){return n.data.data.forEach(function(n){t.push(n)}),t})};h.onSelectPractitioner=function(n){h.selectedPractitioner=n;console.log(h.selectedPractitioner);c()};h.clearPractitioner=function(){h.selectedPractitioner={};console.log(h.selectedPractitioner);angular.element(document.querySelector("#practitionerName")).val("");c()};h.RecommendResourceGridOptions=r.uiGrid.createDefaultUIGridOptions(f,h.searchResourceOption,c);h.RecommendResourceGridOptions.paginationPageSizes=[15,25,50,100];h.RecommendResourceGridOptions.columnDefs=[];a=[{name:"title",displayName:"Resource Title",maxWidth:180},{name:"typeName",displayName:"Resource Type",maxWidth:200},{name:"brand",displayName:"Brand"},{name:"description",displayName:"Description"},{field:"isShowAllocated",enableSorting:!1,displayName:"Recommend",enableCellEdit:!1,cellTemplate:'<div ng-if="row.entity.isShowAllocated === true" class="ui-grid-cell-contents text-center"><a href="#" ng-click="grid.appScope.allocateResource(row.entity.id)">Allocate<\/a><\/div>',maxWidth:180}];h.RecommendResourceGridOptions.appScopeProvider=h;h.RecommendResourceGridOptions.columnDefs=h.RecommendResourceGridOptions.columnDefs.concat(a);h.ResourceAllocationHistoryGridOptions=r.uiGrid.createDefaultUIGridOptions(f,h.searchHcpResourceOption,l);h.ResourceAllocationHistoryGridOptions.paginationPageSizes=[15,25,50,100];h.ResourceAllocationHistoryGridOptions.columnDefs=[];v=[{name:"resourceTitle",displayName:"Resource Title",maxWidth:180},{name:"assignedTo",displayName:"Allocated to",maxWidth:200},{name:"assignedBy",displayName:"Assigned by",maxWidth:200},{name:"brand",displayName:"Brand",maxWidth:200},{name:"assignedOnString",displayName:"Assigned on",maxWidth:200},{name:"expiresOnString",displayName:"Expires on",maxWidth:200},{name:"viewedOnString",displayName:"Viewed on",maxWidth:200},{field:"id",enableSorting:!1,displayName:"Remove allocation",enableCellEdit:!1,cellTemplate:'<div  ng-if="row.entity.isShowRemoveAllocated === true" class="ui-grid-cell-contents text-center"><a href="#" ng-click="grid.appScope.removeAllocateResource(row.entity.id)">Remove<\/a><\/div><div  ng-if="row.entity.isShowRemoveAllocated === false" class="ui-grid-cell-contents text-center">{{row.entity.removeOnString}}<\/div>',maxWidth:180}];h.ResourceAllocationHistoryGridOptions.appScopeProvider=h;h.ResourceAllocationHistoryGridOptions.columnDefs=h.ResourceAllocationHistoryGridOptions.columnDefs.concat(v)}window.app.controller("RecommendResourceListController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","uiGridConstants","$timeout","toaster","$rootScope"]}(),function(){"use strict";function n(n){function i(){t.browserTimezone=n.tz.guess()}var t=this;t.init=i}window.app.controller("reportController",n);n.$inject=["moment"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function v(){y();p()}function y(){u.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){h.resourceTypes=n.Resource_Type})}function p(){u.get(api_get_resourceBrands).success(function(n){h.brands=n.data})}function w(n){var u,e;if(b(n)){h.model.resourceUrl!==undefined&&h.model.resourceUrl!==null&&h.model.resourceUrl.length>0&&h.model.file!==undefined&&h.model.file!==null&&(h.model.file=null);var v=h.tags.map(function(n){return n.value}),c=api_resource_add,l=function(n){h.errors=[];h.errors=n.errors;n.errors.length>0?(i.build(h.errors,h.model),document.getElementById("page-wrapper").scrollIntoView(),o.$broadcast("loader_hide")):(o.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Resource added successfully",timeout:2500,onHideCallback:function(){t.location.href=f.listUrl;o.$broadcast("loader_hide")}}))},a=function(n,t,i){return n.addEventListener?(n.addEventListener(t,i,!1),!0):n.attachEvent?n.attachEvent("on"+t,i):(window.alert("browser uses old-style event binding. Please upgrade your browser."),!1)};o.$broadcast("loader_show");u=new XMLHttpRequest;a(u,"readystatechange",function(){this.readyState==4&&(this.status==200?l.call(u,JSON.parse(u.response)):o.$broadcast("loader_hide"))});u.open("POST",c,!0);e=new FormData;u.nonFileParams={};h.model.file&&e.append("resourceFile",h.model.file,h.model.file.name);Object.keys(h.model).forEach(function(n){n!=="file"&&e.append(n,h.model[n])});u.send(e)}else document.getElementById("page-wrapper").scrollIntoView();r.invalidateControlOnSubmission(n)}function b(n){h.errors=[];var t=n.$valid,i=k(),r=d(),u=l(),f=g();return i&&t&&r&&u&&f}function k(){var n=!0;return h.model.resourceType&&h.model.resourceType!==0||(h.errors.push({key:"validateField",message:"Please select the resource type"}),n=!1),h.model.file||h.model.resourceUrl&&h.model.resourceUrl.length!==0||(h.errors.push({key:"validateField",message:"Please enter the resource URL or select a resource file."}),n=!1),h.model.brandType&&h.model.brandType!==0||(h.errors.push({key:"validateField",message:"Please select a brand"}),n=!1),h.model.resourceTitle&&h.model.resourceTitle.length!==0||(h.errors.push({key:"validateField",message:"Please enter the resource title"}),n=!1),h.model.resourceTitle&&h.model.resourceTitle.length>100&&(h.errors.push({key:"validateField",message:"The resource title can not exceed 100 characters"}),n=!1),h.model.resourceDescription&&h.model.resourceDescription.length!==0||(h.errors.push({key:"validateField",message:"Please enter the resource description"}),n=!1),h.model.resourceDescription&&h.model.resourceDescription.length>260&&(h.errors.push({key:"validateField",message:"Your description can not exceed 260 characters."}),n=!1),n}function d(){return h.model.file!=null&&h.model.file!=undefined&&c.indexOf(h.model.file.type)<0?(h.errors.push({key:"fileInvalid",message:"Only pdf, ppt, pptx, and mp4 files are allowed for resource file"}),!1):!0}function l(){var n=h.model.resourceUrl,t;if(h.errors=h.errors.filter(function(n){return n.key!=="InvalidUrl"}),n!=null&&n.length>0){if(n.substr(0,4).toUpperCase()!="HTTP")return h.errors.push({key:"InvalidUrl",message:"Resource URL must start with http"}),!1;if(n.indexOf(" ")>=0)return h.errors.push({key:"InvalidUrl",message:"Resource URL cannot contain space"}),!1;if(t=/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/,!t.test(n))return h.errors.push({key:"InvalidUrl",message:"Please enter valid Resource URL"}),!1}return!0}function g(){var n=h.model.file,t;return n&&(t=parseInt(f.fileMaxSize),n.size>t)?(h.errors.push({key:"InvalidFileSize",message:"Resource file cannot be greater than 500MB"}),!1):!0}var h=this,c,a;h.model=h.model||{};h.init=v;h.errors=[];h.submit=w;h.isDisabledResourceUrl=!1;h.isDisabledfile=!1;h.tags=[];c=["application/pdf","application/ppt","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"];a=["application/pdf","application/ppt","application/pptx","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"];h.addTag=function(){var n=h.model.metaDataTag;n&&n.length>0&&(h.tags.push({value:n}),h.model.metaDataTag="")};h.removeTag=function(n){var t=h.tags.filter(function(t,i){return i!==n});h.tags=t};h.changeResourceUrl=function(){h.isDisabledfile=h.model.resourceUrl&&h.model.resourceUrl.length>0?!0:!1};h.viewResource=function(){h.isDisabledfile&&h.model.resourceUrl&&h.model.resourceUrl.length>0&&l()&&t.open(h.model.resourceUrl,"_blank")};h.clearResourceUrl=function(){h.model.resourceUrl="";h.isDisabledfile=!1};h.onFileChange=function(){var n=angular.element(".file")[0];n.files[0]?h.model.file=n.files[0]:delete h.model.file}}window.app.controller("ResourceAddController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","$timeout","$rootScope","toaster","videoCommonService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function y(){p();w();b()}function p(){u.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){c.resourceTypes=n.Resource_Type})}function w(){u.get(api_get_resourceBrands).success(function(n){c.brands=n.data})}function b(){var n=api_resource_get.replace("{id}",f.resourceId);u.get(n).success(function(n){if(c.model=n,n.metaDataTags){var t=JSON.parse(n.metaDataTags);c.tags=t.map(function(n){return{value:n}})}n.isExternalResource&&n.existResourceUrl&&(!n.existFileUrl||n.existFileUrl.length===0)?c.isDisabledfile=!0:n.isExternalResource||n.existResourceUrl&&n.existResourceUrl.length!==0||!n.existFileUrl||(c.model.fileName=n.existFileUrl,c.isDisabledResourceUrl=!0)})}function k(n){var u,e;if(g(n)){c.model.resourceUrl!==undefined&&c.model.resourceUrl!==null&&c.model.resourceUrl.length>0&&c.model.file!==undefined&&c.model.file!==null&&(c.model.file=null);var v=c.tags.map(function(n){return n.value}),h=api_resource_update,l=function(n){c.errors=[];c.errors=n.errors;n.errors.length>0?(i.build(c.errors,c.model),document.getElementById("page-wrapper").scrollIntoView(),o.$broadcast("loader_hide")):(o.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Resource added successfully",timeout:2500,onHideCallback:function(){t.location.href=f.listUrl;o.$broadcast("loader_hide")}}))},a=function(n,t,i){return n.addEventListener?(n.addEventListener(t,i,!1),!0):n.attachEvent?n.attachEvent("on"+t,i):(window.alert("browser uses old-style event binding. Please upgrade your browser."),!1)};o.$broadcast("loader_show");u=new XMLHttpRequest;a(u,"readystatechange",function(){this.readyState==4&&(this.status==200?l.call(u,JSON.parse(u.response)):o.$broadcast("loader_hide"))});u.open("POST",h,!0);e=new FormData;u.nonFileParams={};c.model.file&&e.append("resourceFile",c.model.file,c.model.file.name);Object.keys(c.model).forEach(function(n){n!=="file"&&e.append(n,c.model[n])});u.send(e)}else document.getElementById("page-wrapper").scrollIntoView();r.invalidateControlOnSubmission(n)}function d(){var n=api_resource_delete.replace("{id}",f.resourceId);u.post(n).then(function(n){c.errors=[];c.errors=n.data.errors;n.data.errors.length>0?(i.build(c.errors,c.model),document.getElementById("page-wrapper").scrollIntoView()):(o.$broadcast("loader_show"),s.pop({type:"success",title:"Success",body:"Resource deleted successfully",timeout:2500,onHideCallback:function(){t.location.href="/admin/resources";o.$broadcast("loader_hide")}}))})}function g(n){c.errors=[];var t=n.$valid,i=nt(),r=tt(),u=a(),f=it();return i&&t&&r&&u&&f}function nt(){var n=!0;return c.model.resourceType&&c.model.resourceType!==0||(c.errors.push({key:"validateField",message:"Please select the resource type"}),n=!1),c.model.file||c.model.fileName&&c.model.fileName.length!==0||c.model.resourceUrl&&c.model.resourceUrl.length!==0||(c.errors.push({key:"validateField",message:"Please enter the resource URL or select a resource file."}),n=!1),c.model.brandType&&c.model.brandType!==0||(c.errors.push({key:"validateField",message:"Please select a brand"}),n=!1),c.model.resourceTitle&&c.model.resourceTitle.length!==0||(c.errors.push({key:"validateField",message:"Please enter the resource title"}),n=!1),c.model.resourceTitle&&c.model.resourceTitle.length>100&&(c.errors.push({key:"validateField",message:"The resource title can not exceed 100 characters"}),n=!1),c.model.resourceDescription&&c.model.resourceDescription.length!==0||(c.errors.push({key:"validateField",message:"Please enter the resource description"}),n=!1),c.model.resourceDescription&&c.model.resourceDescription.length>260&&(c.errors.push({key:"validateField",message:"Your description can not exceed 260 characters."}),n=!1),n}function tt(){return c.model.file!=null&&c.model.file!=undefined&&l.indexOf(c.model.file.type)<0?(c.errors.push({key:"fileInvalid",message:"Only pdf, ppt, pptx and mp4 files are allowed for resource file"}),!1):!0}function a(){var n=c.model.resourceUrl,t;if(c.errors=c.errors.filter(function(n){return n.key!=="InvalidUrl"}),n!=null&&n.length>0){if(n.substr(0,4).toUpperCase()!="HTTP")return c.errors.push({key:"InvalidUrl",message:"Resource URL must start with http"}),!1;if(n.indexOf(" ")>=0)return c.errors.push({key:"InvalidUrl",message:"Resource URL cannot contain space"}),!1;if(t=/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/,!t.test(n))return c.errors.push({key:"InvalidUrl",message:"Please enter valid Resource URL"}),!1}return!0}function it(){var n=c.model.file,t;return n&&(t=parseInt(f.fileMaxSize),n.size>t)?(c.errors.push({key:"InvalidFileSize",message:"Resource file should cannot be greater than 500MB"}),!1):!0}var c=this,l,v;c.model=c.model||{};c.init=y;c.errors=[];c.submit=k;c.isDisabledResourceUrl=!1;c.isDisabledfile=!1;c.tags=[];l=["application/pdf","application/ppt","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"];v=["application/pdf","application/ppt","application/pptx","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"];c.confirmDeleteResource=function(){h.showModal({},{closeButtonText:"No",actionButtonText:"Yes",headerText:"Delete Confirm",bodyText:"Are you sure?",showCloseButton:!0}).then(function(){d()})};c.addTag=function(){var n=c.model.metaDataTag;n&&n.length>0&&(c.tags.push({value:n}),c.model.metaDataTag="")};c.removeTag=function(n){var t=c.tags.filter(function(t,i){return i!==n});c.tags=t};c.changeResourceUrl=function(){c.isDisabledfile=c.model.resourceUrl&&c.model.resourceUrl.length>0?!0:!1};c.viewResource=function(){c.isDisabledResourceUrl&&c.model.fileName&&c.model.fileName.length>0?t.open(c.model.internalFileUrl,"_blank"):c.isDisabledfile&&c.model.resourceUrl&&c.model.resourceUrl.length>0&&a()&&t.open(c.model.resourceUrl,"_blank")};c.clearResourceUrl=function(){c.model.resourceUrl="";c.isDisabledfile=!1};c.onFileChange=function(){var n=angular.element(".file")[0];n.files[0]?c.model.file=n.files[0]:delete c.model.file}}window.app.controller("ResourceEditController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","$timeout","$rootScope","toaster","modalService"]}(),function(){"use strict";function n(n,t,i,r,u,f){function h(){o()}function o(){var n=api_resource_search;return n=n.replace("{pageSize}",e.searchOption.pageSize),n=n.replace("{pageNo}",e.searchOption.pageNumber),n=n.replace("{sort}",e.searchOption.sort),n=n.replace("{keyword?}",e.searchOption.keyword),u.get(n).success(function(n){e.resourceGridOptions.data=n.result;e.resourceGridOptions.totalItems=n.totalCount})}var e=this,s;e.model=e.model||{};e.init=h;e.errors=[];e.searchOption={pageNumber:1,pageSize:25,sort:"title",keyword:""};n.$watch("vm.filterValue",function(n){n!==undefined&&(e.searchOption.keyword=n,o())});e.resourceGridOptions=r.uiGrid.createDefaultUIGridOptions(f,e.searchOption,o);e.resourceGridOptions.paginationPageSizes=[15,25,50,100];e.resourceGridOptions.columnDefs=[];s=[{name:"title",displayName:"Resource Title",maxWidth:180},{name:"typeName",displayName:"Resource Type",maxWidth:200},{name:"brand",displayName:"Brand"},{name:"published",displayName:"Published",type:"date",cellFilter:"date:'dd/MM/yyyy'"},{field:"id",enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a ng-href="/admin/resources/edit/{{COL_FIELD}}">edit<\/a><\/div>',maxWidth:180}];e.resourceGridOptions.appScopeProvider=e;e.resourceGridOptions.columnDefs=e.resourceGridOptions.columnDefs.concat(s)}window.app.controller("ResourceListController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","uiGridConstants","$timeout"]}(),function(){"use strict";function n(n,t,i,r,u,f){function o(){s();h();c()}function s(){u.get(api_lookup_byType.replace("{0}",f.lookupType)).success(function(n){e.resourceTypes=n.Resource_Type})}function h(){u.get(api_get_resourceBrands).success(function(n){e.brands=n.data})}function c(){var n=api_resource_get.replace("{id}",f.resourceId);u.get(n).success(function(n){if(e.model=n,n.metaDataTags){var t=JSON.parse(n.metaDataTags);e.tags=t.map(function(n){return{value:n}})}n.isExternalResource&&n.existResourceUrl&&(!n.existFileUrl||n.existFileUrl.length===0)?e.model.url=n.existResourceUrl:n.isExternalResource||n.existResourceUrl&&n.existResourceUrl.length!==0||!n.existFileUrl||(e.model.url=n.existFileUrl,e.model.fileName=n.existFileUrl)})}var e=this;e.model=e.model||{};e.init=o;e.isDisabledResourceUrl=!0;e.isDisabledfile=!0;e.tags=[];e.viewResource=function(){t.open(e.model.url,"_blank")}}window.app.controller("ResourceViewController",n);n.$inject=["$scope","$window","modelStateErrorBuilder","utilitySvc","httpService","formConfig","$timeout","$rootScope","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function a(){p();w()}function v(t){if(c.errors=[],y(t),t.$valid&&c.errors.length==0){c.model.clinics=c.model.clinicsTmp.concat();var i=api_users_addPractitioner;u.post(i,c.model).then(function(t){t.data.success?(n.$broadcast("loader_show"),h.pop({type:"success",title:"Success",body:"Saved successfully",timeout:1e3,onHideCallback:function(){location.href="/admin/users";n.$broadcast("loader_hide")}})):(c.errors=t.data.errors,document.getElementById("error-wrapper").scrollIntoView())})}else document.getElementById("error-wrapper").scrollIntoView();o.invalidateControlOnSubmission(t)}function y(n){var u,t,i,e,f,r;n.email.$error.email&&l("Please provide a valid email address");n.mobile.$error.phone&&l("The mobile number entered is invalid");n.hcpphone.$error.phone&&l("The phone number entered is invalid");c.model.fileName===undefined||c.model.fileName.length===0?(l("Please upload a valid registration certificate"),c.showMedicalCertificateError=!0):c.showMedicalCertificateError=!1;u=c.model.countryId===2?"Medical Council of New Zealand registration":"AHPRA";t=u;c.model.countryId===2&&(c.model.professionId===2&&(t="Nursing Council of New Zealand registration"),c.model.professionId===4&&(t="Registration Number"));c.model.ahpraNumber===undefined?l("You must supply a "+t+" number."):c.isValidAHPRA(c.model.ahpraNumber)||l("Your "+t+" number is invalid");c.model.professionId===2&&(c.model.supervisingDoctorAhpraNumber===undefined?l("You must supply a supervising doctor's "+u+" number."):c.isValidAHPRASupervising(c.model.supervisingDoctorAhpraNumber)||l("Your supervising doctor's "+u+" number is invalid"));c.model.countryId===2&&(c.isValidPrecriberNumber(c.model.prescriberNumber)||l("Your Health Practitioners Index is invalid please check your entry"),c.isValidPrecriberNumber(c.model.supervisingDoctorPrescriberNumber)||l("The Health Practitioners Index provided for your supervising doctor is invalid please check your entry"));(c.model.clinicsTmp==null||c.model.clinicsTmp===undefined||c.model.clinicsTmp.length==0)&&l("Require at least 1 clinic");i=$("#file")[0].files[0];i!==undefined&&i!==null&&(e=i.size/1048576,e>10&&l("You cannot upload a file greater then 10mb"),f=i.name.split("."),r=f[f.length-1].toLowerCase(),r==="pdf"||r==="jpeg"||r==="png"||r==="jpg"||l("You can only upload PDF, JPEG and PNG files"))}function p(){u.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){if(c.status=n.User_Status,c.titles=n.Title,c.states=n.State,c.hcpProfessions=n.Hcp_Profession,c.countries=n.Country,s.userRole=="TBM"){for(var t=0;t<c.status.length;t++)c.status[t].Value==2&&(c.model.user.status=c.status[t].Value);c.isDisableStatus=!0}})}function w(){c.roles=[];c.roles.push({id:s.roleHcpId,description:"Practitioner"});c.model.user.roleId=s.roleHcpId}function b(){window.history.back()}function l(n){for(var i=!1,t=0;t<c.errors.length;t++)if(c.errors[t].message==n){i=!0;break}i||c.errors.push({message:n})}var c=this;c.isDisableStatus=!1;c.init=a;c.model={user:{}};c.model.clinicsTmp=[];c.goBack=b;c.submitForm=v;c.showMedicalCertificateError=!1;c.isValidAHPRA=function(){var i,t,n;if(c.model.ahpraNumber===undefined||c.model.ahpraNumber==null||c.model.ahpraNumber=="")return!1;if(c.model.countryId&&c.model.countryId===2)return i="5,6",c.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(c.model.ahpraNumber);n=c.model.ahpraNumber.toLowerCase();switch(c.model.professionId){case 1:if(t=n.indexOf("med"),t!=0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1;break;case 2:case 3:if(t=n.indexOf("nmw"),t!=0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1;break;case 4:if(t=n.indexOf("den"),t!=0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1}return!0};c.isValidAHPRASupervising=function(n){var i,t,r;return n===undefined||n==null||n==""?!1:c.model.countryId!==undefined&&c.model.countryId===2?(i="5,6",c.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(n)):(t=n.toLowerCase(),r=t.indexOf("med"),r!=0||t.length!=13||Number.isNaN(Number(t.substring(3))))?!1:!0};c.isValidPrecriberNumber=function(n){if(c.model.countryId!==2)return!0;var t="6";return c.model.professionId===4&&(t="0,6"),n===undefined||n===null||n.length===0||new RegExp("^[A-Za-z0-9]{0,6}$").test(n)};c.selectFile=function(){$("#file").trigger("click")};c.clearFile=function(){$("#file").val("");c.model.fileName="";c.isHasFile=!1};c.fileNameChanged=function(){var i=$("#file").val().replace(/C:\\fakepath\\/i,""),r,n;c.isHasFile=!0;c.model.fileName=i;r=$("#file")[0].files[0];n=new FileReader;n.readAsDataURL(r);n.onload=function(){c.model.registrationCertificateFile={base64:n.result,fileName:i,fileType:"",fileSize:0}};n.onerror=function(n){console.log("Error: ",n)};t.$apply()};c.removeClinic=function(n){var t=c.model.clinicsTmp.indexOf(n);c.model.clinicsTmp.splice(t,1)}}window.app.controller("AddPractitionerController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function a(){w();b();s.userRole=="SuperAdmin"&&$("#EditPractitioner :input").prop("disabled",!0)}function v(t){if(c.errors=[],y(t),t.$valid&&c.errors.length==0){c.model.clinics=c.model.clinicsTmp.concat();var i=api_users_updatePractitioner;u.post(i,c.model).then(function(t){t.data.success?(n.$broadcast("loader_show"),h.pop({type:"success",title:"Success",body:"Saved successfully",timeout:1e3,onHideCallback:function(){n.$broadcast("loader_hide");location.href="/admin/users"}}),c.model=t.data.data,c.model.clinics!=null&&(c.model.clinicsTmp=c.model.clinics.concat()),c.clinic=null,c.clearFile()):(c.errors=t.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();o.invalidateControlOnSubmission(t)}function y(n){var u,t,i,e,f,r;n.email.$error.email&&l("Please provide a valid email address");n.mobile.$error.phone&&l("The mobile number entered is invalid");n.hcpphone.$error.phone&&l("The phone number entered is invalid");u=c.model.countryId===2?"Medical Council of New Zealand registration":"AHPRA";t=u;c.model.countryId===2&&(c.model.professionId===2&&(t="Nursing Council of New Zealand registration"),c.model.professionId===4&&(t="Registration Number"));c.model.ahpraNumber===undefined?l("You must supply a "+t+" number."):c.isValidAHPRA(c.model.ahpraNumber)||l("Your "+t+" number is invalid");c.model.professionId===2&&(c.model.supervisingDoctorAhpraNumber===undefined?l("You must supply a supervising doctor's "+u+" number."):c.isValidAHPRASupervising(c.model.supervisingDoctorAhpraNumber)||l("Your supervising doctor's "+u+" number is invalid"));c.model.countryId===2&&(c.isValidPrecriberNumber(c.model.prescriberNumber)||l("Your Health Practitioners Index is invalid please check your entry"),c.isValidPrecriberNumber(c.model.supervisingDoctorPrescriberNumber)||l("The Health Practitioners Index provided for your supervising doctor is invalid please check your entry"));(c.model.clinicsTmp==null||c.model.clinicsTmp===undefined||c.model.clinicsTmp.length==0)&&l("Require at least 1 clinic");i=$("#file")[0].files[0];i!==undefined&&i!==null&&(e=i.size/1048576,e>10&&l("You cannot upload a file greater then 10mb"),f=i.name.split("."),r=f[f.length-1].toLowerCase(),r==="pdf"||r==="jpeg"||r==="png"||r==="jpg"||l("You can only upload PDF, JPEG and PNG files"))}function p(){u.get(api_users_getPractitioner.replace("{0}",s.hcpId)).success(function(n){c.model=n.data;c.model.clinics!=null&&(c.model.clinicsTmp=c.model.clinics.concat())})}function w(){u.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){c.status=n.User_Status;c.titles=n.Title;c.states=n.State;c.hcpProfessions=n.Hcp_Profession;c.countries=n.Country})}function b(){c.roles=[];c.roles.push({id:s.roleHcpId,description:"Practitioner"});p()}function k(){window.history.back()}function l(n){for(var i=!1,t=0;t<c.errors.length;t++)if(c.errors[t].message==n){i=!0;break}i||c.errors.push({message:n})}function d(){var n=api_users_deletePractitioner;u.post(n,c.model).then(function(n){n.data.success?location.href="/admin/users":(c.errors=n.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}var c=this;c.init=a;c.model={};c.goBack=k;c.submitForm=v;c.delete=d;c.isValidAHPRA=function(){var i,t,n;if(c.model.ahpraNumber===undefined||c.model.ahpraNumber==="")return!1;if(c.model.countryId&&c.model.countryId===2)return i="5,6",c.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(c.model.ahpraNumber);n=c.model.ahpraNumber.toLowerCase();switch(c.model.professionId){case 1:if(t=n.indexOf("med"),t!==0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1;break;case 2:case 3:if(t=n.indexOf("nmw"),t!==0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1;break;case 4:if(t=n.indexOf("den"),t!==0||n.length!==13||Number.isNaN(Number(n.substring(3))))return!1}return!0};c.isValidAHPRASupervising=function(n){var i,t,r;return n===undefined||n==null||n==""?!1:c.model.countryId!==undefined&&c.model.countryId===2?(i="5,6",c.model.professionId===4&&(i="1,6"),new RegExp("^[A-Za-z0-9]{"+i+"}$").test(n)):(t=n.toLowerCase(),r=t.indexOf("med"),r!=0||t.length!==13||Number.isNaN(Number(t.substring(3))))?!1:!0};c.isValidPrecriberNumber=function(n){if(c.model.countryId!==2)return!0;var t="6";return c.model.professionId===4&&(t="0,6"),n===undefined||n===null||n.length===0||new RegExp("^[A-Za-z0-9]{"+t+"}$").test(n)};c.selectFile=function(){$("#file").trigger("click")};c.clearFile=function(){$("#file").val("");c.model.fileName="";c.isHasFile=!1};c.fileNameChanged=function(){var i=$("#file").val().replace(/C:\\fakepath\\/i,""),r,n;c.isHasFile=!0;c.model.fileName=i;r=$("#file")[0].files[0];n=new FileReader;n.readAsDataURL(r);n.onload=function(){c.model.registrationCertificateFile={base64:n.result,fileName:i,fileType:"",fileSize:0}};n.onerror=function(n){console.log("Error: ",n)};t.$apply()};c.removeClinic=function(n){var t=c.model.clinicsTmp.indexOf(n);c.model.clinicsTmp.splice(t,1)}}window.app.controller("EditPractitionerController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function c(){y();p();h.model={};h.model.clinicsTmp=[]}function l(n){if(h.errors=[],a(n),n.$valid&&h.errors.length==0){h.model.tbmClinics=h.model.clinicsTmp.concat();var t=api_users_add;u.post(t,h.model).then(function(n){n.data.success?location.href="/admin/users":(h.errors=n.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();o.invalidateControlOnSubmission(n)}function a(){h.model.roleId==5&&(h.model.clinicsTmp==null||h.model.clinicsTmp===undefined||h.model.clinicsTmp.length==0)&&v("Require at least 1 clinic")}function v(n){for(var i=!1,t=0;t<h.errors.length;t++)if(h.errors[t].message==n){i=!0;break}i||h.errors.push({message:n})}function y(){u.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){h.status=n.User_Status;h.titles=n.Title;h.states=n.State;h.countries=n.Country})}function p(){u.get(api_users_getrolesforaddupdate.replace("{0}",1)).success(function(n){h.roles=n.data})}var h=this;h.init=c;h.submitForm=l;h.removeClinic=function(n){var t=h.model.clinicsTmp.indexOf(n);h.model.clinicsTmp.splice(t,1)}}window.app.controller("UserAddController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function l(){c.model=c.model||{};c.model.clinicsTmp=[];b();k()}function a(t){if(c.errors=[],y(t),t.$valid&&c.errors.length==0){c.model.tbmClinics=c.model.clinicsTmp.concat();var i=api_users_update;u.post(i,c.model).then(function(t){t.data.success?(n.$broadcast("loader_show"),h.pop({type:"success",title:"Success",body:"Saved successfully",timeout:1e3,onHideCallback:function(){n.$broadcast("loader_hide");location.href="/admin/users"}})):(c.errors=t.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();o.invalidateControlOnSubmission(t)}function v(){var n=api_users_delete;u.post(n,c.model).then(function(n){n.data.success?location.href="/admin/users":(c.errors=n.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}function y(){c.model.roleId==5&&(c.model.clinicsTmp==null||c.model.clinicsTmp===undefined||c.model.clinicsTmp.length==0)&&p("Require at least 1 clinic")}function p(n){for(var i=!1,t=0;t<c.errors.length;t++)if(c.errors[t].message==n){i=!0;break}i||c.errors.push({message:n})}function w(n){u.get(api_users_getById.replace("{0}",n)).success(function(n){var i,t;if(c.model=n.data,c.model.tbmClinics!=null&&(c.model.clinicsTmp=c.model.tbmClinics.concat()),c.model.roleId==1||c.model.roleId==3||c.model.roleId==8){for(c.disabledRoleDropdown=!0,i=!1,t=0;t<c.roles.length;t++)if(c.roles[t].id==c.model.roleId){i=!0;break}i||c.roles.push({id:c.model.roleId,description:c.model.roleName})}})}function b(){u.get(api_lookup_byType.replace("{0}",s.lookupType)).success(function(n){c.status=n.User_Status;c.titles=n.Title;c.states=n.State;c.countries=n.Country})}function k(){u.get(api_users_getrolesforaddupdate.replace("{0}",2)).success(function(n){c.roles=n.data;w(s.userId)})}var c=this;c.init=l;c.submitForm=a;c.deleteUser=v;c.disabledRoleDropdown=!1;c.removeClinic=function(n){var t=c.model.clinicsTmp.indexOf(n);c.model.clinicsTmp.splice(t,1)}}window.app.controller("UserDetailController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function c(){var n=api_user_search,t=e.tz.guess();return n=n.replace("{pageSize}",h.searchOption.pageSize),n=n.replace("{pageNo}",h.searchOption.pageNumber),n=n.replace("{sort}",h.searchOption.sort),n=n.replace("{keyword}",h.searchOption.keyword),n=n.replace("{tz}",t),u.get(n).then(function(n){n.data.success?(h.gridOptions.totalItems=n.data.data.totalCount,h.gridOptions.data=n.data.data.result):h.errors=n.data.errors})}var h=this,l;h.roleHcp=s.roleHcp;h.searchOption={pageNumber:1,pageSize:25,sort:"+fullName",keyword:""};h.gridOptions=o.uiGrid.createDefaultUIGridOptions(f,h.searchOption,c);h.gridOptions.columnDefs=[{name:"id",displayName:"User ID",maxWidth:120,enableCellEdit:!1},{name:"fullName",displayName:"Name",enableCellEdit:!1},{name:"email",displayName:"Email address",enableCellEdit:!1},{name:"roleName",displayName:"Role",enableCellEdit:!1},{name:"statusName",displayName:"Status",enableCellEdit:!1},{name:"stateName",displayName:"State",enableCellEdit:!1},{field:"id",maxWidth:50,enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a ng-if="row.entity.role != '+h.roleHcp+'" ng-href="/admin/users/edit/{{COL_FIELD}}">Edit<\/a><a ng-if="row.entity.role == '+h.roleHcp+'" ng-href="/hcp/practitionerDetails?id={{row.entity.hcpId}}&tabId=1">Edit<\/a><\/div>'}];l=h.gridOptions.onRegisterApi;h.gridOptions.onRegisterApi=function(n){l(n)};t.$watch("vm.filterValue",function(n){n!==undefined&&(h.searchOption.keyword=n,c())});h.init=function(){n.$broadcast("loader_show");c()}}window.app.controller("UserListController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function v(){n.$broadcast("loader_show");p();l();$(".date-picker").datepicker({autoclose:!0,todayHighlight:!0});y()}function y(){}function l(){var n=api_workshop_search,t=e.tz.guess();return n=n.replace("{pageSize}",c.searchOption.pageSize),n=n.replace("{pageNo}",c.searchOption.pageNumber),n=n.replace("{sort}",c.searchOption.sort),n=n.replace("{keyword}",c.searchOption.keyword),n=n.replace("{tz}",t),u.get(n).then(function(n){n.data.success?(c.gridOptions.totalItems=n.data.data.totalCount,c.gridOptions.data=n.data.data.result):c.errors=n.data.errors})}function p(){var n=api_workshop_getEducations;return u.get(n).then(function(n){n.data.success?(c.educations=n.data.data,angular.forEach(c.educations,function(n){n.id==7&&(n.name="Juvederm Introduction")})):c.errors=n.data.errors})}function w(t){if(c.errors=[],b(t),t.$valid&&c.errors.length==0){var r=api_workshop_add,i=o.convertTextToDate(c.model.datetmp);c.model.date=i.getFullYear()+"-"+(i.getMonth()+1)+"-"+i.getDate();u.post(r,c.model).then(function(i){i.data.success?(l(),c.model=null,t.$setPristine(),t.$setUntouched(),n.$broadcast("loader_show"),h.pop({type:"success",title:"Success",body:"Saved successfully",timeout:1e3,onHideCallback:function(){n.$broadcast("loader_hide")}})):(c.errors=i.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}else document.getElementById("page-wrapper").scrollIntoView();o.invalidateControlOnSubmission(t)}function b(){}var c=this,a;c.model=c.model||{};c.init=v;c.submitForm=w;c.errors=[];c.searchOption={pageNumber:1,pageSize:25,sort:"-date",keyword:""};c.gridOptions=o.uiGrid.createDefaultUIGridOptions(f,c.searchOption,l);c.gridOptions.columnDefs=[{name:"date",displayName:"Workshop date",maxWidth:120,enableCellEdit:!1,cellTemplate:"<span ng-bind=\"row.entity.date | date: 'dd/MM/yyyy'\"><\/span>"},{name:"name",displayName:"Workshop name",enableCellEdit:!1},{name:"education",displayName:"Online education",enableCellEdit:!1},{field:"id",maxWidth:50,enableSorting:!1,displayName:"",enableCellEdit:!1,cellTemplate:'<div class="ui-grid-cell-contents text-center"><a ng-href="/Workshops/ReconcileAttendance/{{COL_FIELD}}">Edit<\/a><\/div>'}];a=c.gridOptions.onRegisterApi;c.gridOptions.onRegisterApi=function(n){a(n)};t.$watch("vm.filterValue",function(n){n!==undefined&&(c.searchOption.keyword=n,l())})}window.app.controller("WorkshopController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig","toaster"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){function l(){a(s.workshopId)}function a(n){u.get(api_workshop_getById.replace("{0}",n)).success(function(n){c.model=n.data})}function v(n){var t=[];return u.get(n,{disable_loading:!0}).then(function(n){return n.data.data.result.forEach(function(n){n.fullName=n.firstName+" "+n.lastName;t.push(n)}),t})}function y(){var n=api_workshop_delete;u.post(n,c.model).then(function(n){n.data.success?location.href="/workshops":(c.errors=n.data.errors,document.getElementById("page-wrapper").scrollIntoView())})}function p(n){var t=c.model.attendants.indexOf(n);c.model.attendants.splice(t,1)}function w(t){var r,i,f;for(c.errors=[],k(t),r={id:s.workshopId,hcpIds:[]},i=0;i<c.model.attendants.length;i++)r.hcpIds.push(c.model.attendants[i].hcpId);f=api_workshop_addPractitioner;u.post(f,r).then(function(i){i.data.success?(t.$setPristine(),t.$setUntouched(),n.$broadcast("loader_show"),h.pop({type:"success",title:"Success",body:"Saved successfully",timeout:1e3,onHideCallback:function(){n.$broadcast("loader_hide");location.href="/workshops"}})):(c.errors=i.data.errors,document.getElementById("page-wrapper").scrollIntoView())});o.invalidateControlOnSubmission(t)}function b(){window.history.back()}function k(){}var c=this;c.model=c.model||{};c.init=l;c.errors=[];c.goBack=b;c.submitForm=w;c.model.attendants=[];c.removePractitioner=p;c.deleteWorkshop=y;c.statusApproved=s.workShopStatusApproved;c.searchPractitioner=function(n){var r="",i,t;if(c.model.attendants!==undefined&&c.model.attendants!=null)for(i=0;i<c.model.attendants.length;i++)c.model.attendants[i].hcpId>0&&(r==""?r=c.model.attendants[i].hcpId:r+=","+c.model.attendants[i].hcpId);return t=api_workshop_searchPractitioner,t=t.replace("{0}",10),t=t.replace("{1}",1),t=t.replace("{2}",n),t=t.replace("{3}",""),t=t.replace("{4}",r),v(t)};c.onSelectPractitioner=function(n){c.selectedPractitioner=n;c.model.attendants.push(n)};c.clearPractitioner=function(){c.selectedPractitioner=null;$("#typeahead_results").hide()}}window.app.controller("WorkshopDetailController",n);n.$inject=["$rootScope","$scope","$window","filterFilter","httpService","uiGridConstants","moment","utilitySvc","formConfig","toaster"]}()