(window.webpackJsonp=window.webpackJsonp||[]).push([[225],{124:function(e,t,n){"use strict";n.r(t);n(7),n(26);function s(e,t,n,s,i){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,s.getStatistics().then((function(t){e.settings.statistics="true"===t.data,e.supportsStatistics=!0}),(function(n){if(404===n.status)e.supportsStatistics=!1;else{const e=getError(n.data);t.error(e,i.instant("error.getting.settings"))}}))},e.getSettings(),e.setSettings=function(){e.loader=!0,s.toggleStatistics(e.settings.statistics).then((function(){n.close(),t.success(i.instant("saving.settings.success"))}),(function(e){const n=getError(e.data);t.error(n,i.instant("saving.settings.error"))}))},e.submitForm=function(){e.setSettings()},e.cancel=function(){n.dismiss("cancel")}}function i(e,t,n,s,i,c,r){e.loadingLicense=function(){return n.loadingLicense},n.checkLicenseStatus(),e.revertToFree=function(){c.openSimpleModal({title:r.instant("confirm.operation"),message:r.instant("revert.to.free.warning.msg"),warning:!0}).result.then((function(){t.unregisterLicense().success((function(){n.checkLicenseStatus()}))}))}}function c(e,t,n,s,i,c,r,o){e.$on("securityInit",(function(){r.isAdmin()||n.path("/license")})),e.sendLicenseToValidateAndActivate=l;const a=$(".license-textarea");function l(e){t.sendLicenseToValidate(e).success((function(n){"Invalid"!==n.licensee?(a.val(e),function(e,n){s.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then((function(){!function(e){e||(e=a.val());if(e){const n=atob(e.replace(/\s/g,""));t.registerLicense(n).success((function(){c.history.back()})).error((function(){i.error(o.instant("license.register.error"))}))}else i.error(o.instant("no.license.code.error"))}(n)}))}(n,e)):(a.val(""),i.error(n.message))})).error((function(){i.error(o.instant("invalid.license"))}))}e.$watch("currentFile",(function(){if(e.currentFile){const n=e.currentFile;t.extractFromLicenseFile(n).success((function(e){l(e)})).error((function(){i.error(o.instant("could.not.upload.file.error"))}))}})),e.getBackToPreviousPage=function(){c.history.back()}}function r(e,t,n){e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")},e.license=n}function o(e){e.loader=!0,e.setLoader=function(t){e.loader=t}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",s).controller("ValidateLicenseModalCtrl",r).controller("LicenseCtrl",i).controller("RegisterLicenseCtrl",c).controller("LoaderSamplesCtrl",o),s.$inject=["$scope","toastr","$uibModalInstance","LicenseRestService","$translate"],i.$inject=["$scope","LicenseRestService","$licenseService","toastr","$rootScope","ModalService","$translate"],c.$inject=["$scope","LicenseRestService","$location","$uibModal","toastr","$window","$jwtAuth","$translate"],r.$inject=["$scope","$uibModalInstance","license"],o.$inject=["$scope"]}}]);