-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-instant2fa.min.js
1 lines (1 loc) · 1.57 KB
/
angular-instant2fa.min.js
1
(function(){"use strict";var n="instant2fa";var e="https://js.instant2fa.com/hosted.js";var t={uri:["data-uri","string"]};var r;if(typeof module!=="undefined"&&typeof module.exports==="object"){r=require("angular");module.exports=n}else{r=window.angular}var o=r.extend;r.module(n,[]).directive("instant2fa",a).provider("Instant2FA",i);a.$inject=["$parse","Instant2FA"];function a(n,e){return{link:t};function t(t,r,o){e.load().then(function(){var a=s(r);var i=n(o.instant2fa)(t);e.configure(a,i)})}}function i(){var n={};this.defaults=function(e){o(n,e)};this.load=function(n){return n.load()};this.load.$inject=["Instant2FA"];this.$get=function(e,t){return new u(e,t,n)};this.$get.$inject=["$document","$q"]}function u(n,e,t){var r={};var a;this.configure=function(n,e){return new window.Instant2FAPage(o({},t,r,n),e)};this.load=function(){if(!a)a=f(n,e);return a};this.defaults=function(n){o(r,n)}}function s(n){var e,r,o,a={};for(e in t){if(!t.hasOwnProperty(e))continue;r=t[e];o=l(n.attr(r[0]),r[1]);if(o!=null)a[e]=o}a.element=n[0];return a}function f(n,t){var r=t.defer();var o=n[0];var a=o.createElement("script");a.src=e;a.onload=function(){r.resolve()};a.onreadystatechange=function(){var n=this.readyState;if(n==="loaded"||n==="complete")r.resolve()};a.onerror=function(){r.reject(new Error("Unable to load hosted.js"))};var i=o.getElementsByTagName("head")[0];i.appendChild(a);return r.promise}function l(n,e){if(e==="boolean"){return n&&n!=="false"}else if(e==="number"){return n&&Number(n)}else if(e==="boolean-or-auto"){if(n==="auto")return n;else return l(n,"boolean")}else{return n}}})();