!function(e,t){if("function"==typeof define&&define.amd)define([],t);else if("object"==typeof module&&module.exports)module.exports=t();else{var n=t();n._onReady(n.init),e.Duo=n}}(this,function(){var e,t,n,o,i,a,r,s=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/,u=/^ERR\|[\w\s\.\(\)]+$/,m=/^DUO_OPEN_WINDOW\|/,d=["duo.com","duosecurity.com","duomobile.s3-us-west-1.amazonaws.com"];function f(){e="",t="sig_response",n=undefined,undefined,o=undefined,i=undefined,a=undefined,r=undefined}function c(e,t){var n=t||"https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe";throw new Error("Duo Web SDK error: "+e+(n?"\nSee "+n+" for more information":""))}function l(e,t){return"dataset"in e?e.dataset[t]:e.getAttribute("data-"+t.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase())}function h(e,t,n,o){"addEventListener"in window?e.addEventListener(t,o,!1):e.attachEvent(n,o)}function g(e,t,n,o){"removeEventListener"in window?e.removeEventListener(t,o,!1):e.detachEvent(n,o)}function p(e){h(document,"DOMContentLoaded","onreadystatechange",e)}function v(e){g(document,"DOMContentLoaded","onreadystatechange",e)}function w(e){if(e){0===e.indexOf("ERR|")&&c(e.split("|")[1]),-1!==e.indexOf(":")&&2===e.split(":").length||c("Duo was given a bad token. This might indicate a configuration problem with one of Duo's client libraries.");var t=e.split(":");return e,o=t[0],i=t[1],{sigRequest:e,duoSig:t[0],appSig:t[1]}}}function _(e){return Boolean(e.origin==="https://"+n&&"string"==typeof e.data&&(e.data.match(s)||e.data.match(u)||e.data.match(m)))}function b(e){var t,n;return e.iframe&&e.iframeContainer?c("Passing both `iframe` and `iframeContainer` arguments at the same time is not allowed."):e.iframe?(t=E(e.iframe),(n=t)&&!y(n)&&c("`iframe` only accepts an iframe element or the id of an iframe. To use a non-iframe element, use the `iframeContainer` argument.")):e.iframeContainer?function(e){e&&y(e)&&c("`iframeContainer` only accepts a non-iframe element or the id of a non-iframe. To use a non-iframe element, use the `iframeContainer` argument on Duo.init().")}(t=E(e.iframeContainer)):t=document.getElementById("duo_iframe"),t}function E(e){return e.tagName?e:"string"==typeof e?document.getElementById(e):null}function y(e){return e&&e.tagName&&"iframe"===e.tagName.toLowerCase()}function C(){return["https://",n,"/frame/web/v1/auth?tx=",encodeURIComponent(o),"&parent=",encodeURIComponent(document.location.href),"&v=2.9"].join("")}function D(e){if(_(e))if(e.data.match(m)){var t=e.data.substring("DUO_OPEN_WINDOW|".length);(function(e){if(!e)return!1;var t=document.createElement("a");if(t.href=e,"duotrustedendpoints:"===t.protocol)return!0;if("https:"!==t.protocol)return!1;for(var n=0;n to this page.'),A(n,e.iframeAttributes||{}),v(t)};p(t)}(o),v(R)},_onReady:p,_parseSigRequest:w,_isDuoMessage:_,_doPostBack:O}});