(function(n){"use strict";n.module("vcRecaptcha",[])})(angular),function(n){"use strict";var t=n.module("vcRecaptcha");t.service("vcRecaptchaService",["$window","$q",function(t,i){function o(){return!r?e:i.when(r)}function f(){if(!r)throw new Error("reCaptcha has not been loaded yet.");}var u=i.defer(),e=u.promise,r;return t.vcRecaptchaApiLoaded=function(){r=t.grecaptcha;u.resolve(r)},n.isDefined(t.grecaptcha)&&t.vcRecaptchaApiLoaded(),{create:function(n,t,i,r){return r.callback=i,r.sitekey=t,o().then(function(t){return t.render(n,r)})},reload:function(n){f();r.reset(n)},getResponse:function(n){return f(),r.getResponse(n)}}}])}(angular),function(n){"use strict";function t(){throw new Error('You need to set the "key" attribute to your public reCaptcha key. If you don\'t have a key, please get one from https://www.google.com/recaptcha/admin/create');}var i=n.module("vcRecaptcha");i.directive("vcRecaptcha",["$document","$timeout","vcRecaptchaService",function(n,i,r){return{restrict:"A",require:"?^^form",scope:{response:"=?ngModel",key:"=",theme:"=?",size:"=?",tabindex:"=?",onCreate:"&",onSuccess:"&",onExpire:"&"},link:function(u,f,e,o){function h(){angular.element(n[0].querySelectorAll(".pls-container")).parent().remove()}e.hasOwnProperty("key")||t();u.widgetId=null;var s=u.$watch("key",function(n){if(n){n.length!==40&&t();var c=function(n){i(function(){o&&o.$setValidity("recaptcha",!0);u.response=n;u.onSuccess({response:n,widgetId:u.widgetId})});i(function(){o&&o.$setValidity("recaptcha",!1);u.response="";u.onExpire({widgetId:u.widgetId})},12e4)};r.create(f[0],n,c,{theme:u.theme||e.theme||null,tabindex:u.tabindex||e.tabindex||null,size:u.size||e.size||null}).then(function(n){o&&o.$setValidity("recaptcha",!1);u.widgetId=n;u.onCreate({widgetId:n});u.$on("$destroy",h)});s()}})}}}])}(angular)