(()=>{function t(e,a,t){var n=this;function i(t){n.activationSuccess=e("Certificate deployed."),n.redirectUrl=_.get(t,"redirectUrl"),_.forEach(n.activationSteps,function(t){t.status="completed"})}function c(t){n.activationException=_.get(a.getResData(t),"message");var i,c=_.get(a.getResData(t),"details.expectionClass");_.some(n.activationSteps,{exception:c})&&(i=!1,_.forEach(n.activationSteps,function(t){var e=i||t.exception===c;i=i||e,t.status=e?"failure":"completed"}))}_.assign(n,{title:e("Custom domain activation"),startActivation:function(){n.activationStarted=!0,t.activateCertificate().then(i).catch(c)},activationStarted:!1,activationSteps:[{title:e("Checking that SSL certificate is valid."),exception:"com.cumulocity.server.exception.SslTimeInvalidException"},{title:e("Checking that domain name is available."),exception:"com.cumulocity.server.exception.CertificateAlreadyInUseException"},{title:e("Checking that DNS is correctly set up."),exception:"com.cumulocity.server.exception.ApiUnavailableException"},{title:e("Deploying certificate."),exception:"com.cumulocity.server.exception.PlatformBadResponseException"}]})}t.$inject=["gettext","c8yBase","manageCertificateSvc"],angular.module("c8y.enterpriseEdition").component("c8yCertificateActivation",{templateUrl:":::PLUGIN_PATH:::/sslCertificate/certificateActivation.html",bindings:{resolve:"<",modalInstance:"<"},controller:t,controllerAs:"vm"})})();