- md5
- 51b178eb30a0b03ac3f8c5aeac4f76f8
- sha1
- 3eadb46d9d58dce9fff796f5b4c9845174bb2e2d
- sha256
- 0db756a0d20e79c71531542297f7344053016cb9282cd70fdc0eb39f048d7af8
function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}window.Joomla=window.Joomla||{},function(a,b){'use strict';var c=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",d="";return Object.keys(a).forEach(function(e){return"object"===_typeof(a[e])?void(d+="".concat(c(a[e],e))):(0<d.length&&(d+="&"),void(d+=""===b?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(a[e])):"".concat(encodeURIComponent(b),"[").concat(encodeURIComponent(e),"]=").concat(encodeURIComponent(a[e]))))}),d},d=function(a,b){var c=a.querySelectorAll(b);return c.length?c[0]:null},e=function(a,b){var c=a.parentElement,e=null;if("FORM"===c.nodeName)return e=d(c,b),e;var f=c.querySelectorAll("form");if(f.length)for(var g=0;g<f.length;g+=1)if(e=d(f[g],b),null!==e)return e;return null},f=function(b){a.renderMessages({error:[b]})},g=function(b,c){var d=function(b){return btoa(String.fromCharCode.apply(String,_toConsumableArray(b)))},e=function(a){var b=a.replace(/-/g,"+").replace(/_/g,"/"),c=b.length%4;if(c){if(1===c)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");b+=Array(5-c).join("=")}return b};return b.challenge?void(b.challenge=Uint8Array.from(window.atob(e(b.challenge)),function(a){return a.charCodeAt(0)}),b.allowCredentials&&(b.allowCredentials=b.allowCredentials.map(function(a){return a.id=Uint8Array.from(window.atob(e(a.id)),function(a){return a.charCodeAt(0)}),a})),navigator.credentials.get({publicKey:b}).then(function(a){var b={id:a.id,type:a.type,rawId:d(new Uint8Array(a.rawId)),response:{authenticatorData:d(new Uint8Array(a.response.authenticatorData)),clientDataJSON:d(new Uint8Array(a.response.clientDataJSON)),signature:d(new Uint8Array(a.response.signature)),userHandle:a.response.userHandle?d(new Uint8Array(a.response.userHandle)):null}};window.location="".concat(c,"&option=com_ajax&group=system&plugin=webauthn&")+"format=raw&akaction=login&encoding=redirect&data=".concat(btoa(JSON.stringify(b)))}).catch(function(a){f(a)})):void f(a.JText._("PLG_SYSTEM_WEBAUTHN_ERR_INVALID_USERNAME"))};a.plgSystemWebauthnLogin=function(d,h){var i=b.getElementById(d),j=e(i,"input[name=username]"),k=e(i,"input[name=return]");if(null===j)return a.renderMessages({error:[a.JText._("PLG_SYSTEM_WEBAUTHN_ERR_CANNOT_FIND_USERNAME")]}),!1;var l=j.value,m=k?k.value:null;if(""===l)return a.renderMessages({error:[a.JText._("PLG_SYSTEM_WEBAUTHN_ERR_EMPTY_USERNAME")]}),!1;return a.request({url:h,method:"POST",data:c({option:"com_ajax",group:"system",plugin:"webauthn",format:"raw",akaction:"challenge",encoding:"raw",username:l,returnUrl:m}),onSuccess:function onSuccess(a){var b={};try{b=JSON.parse(a)}catch(a){}g(b,h)},onError:function onError(a){f("".concat(a.status," ").concat(a.statusText))}}),!1},b.addEventListener("DOMContentLoaded",function(){var c=[].slice.call(b.querySelectorAll(".plg_system_webauthn_login_button"));c.length&&c.forEach(function(b){b.addEventListener("click",function(b){var c=b.currentTarget;a.plgSystemWebauthnLogin(c.getAttribute("data-random-form"),c.getAttribute("data-random-url"))})})})}(window,Joomla);
No other release has this exact content. See every version of this file.