(function(){"use strict";function y(e,i){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function f(e,i,n){return j()?f=Reflect.construct.bind():f=function(r,s,o){var u=[null];u.push.apply(u,s);var a=Function.bind.apply(r,u),d=new a;return o&&c(d,o.prototype),d},f.apply(null,arguments)}function _(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function h(e){var i=typeof Map=="function"?new Map:void 0;return h=function(t){if(t===null||!_(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i<"u"){if(i.has(t))return i.get(t);i.set(t,r)}function r(){return f(t,arguments,m(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,t)},h(e)}function l(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e,i){if(e){if(typeof e=="string")return g(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,i)}}function g(e,i){(i==null||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k(e,i){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,i||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(e)}function M(e){var i=k(e,"string");return typeof i=="symbol"?i:String(i)}var T=function(e){E(i,e);function i(){var t;return t=e.call(this)||this,t.close=t.close.bind(l(t)),t.destroyCloseButton=t.destroyCloseButton.bind(l(t)),t.createCloseButton=t.createCloseButton.bind(l(t)),t.onMutation=t.onMutation.bind(l(t)),t.observer=new MutationObserver(t.onMutation),t.observer.observe(l(t),{attributes:!1,childList:!0,subtree:!0}),t.addEventListener("animationend",function(r){r.animationName==="joomla-alert-fade-in"&&r.target===l(t)&&(t.dispatchEvent(new CustomEvent("joomla.alert.shown")),t.style.removeProperty("animationName"))}),t.addEventListener("animationend",function(r){r.animationName==="joomla-alert-fade-out"&&r.target===l(t)&&(t.dispatchEvent(new CustomEvent("joomla.alert.closed")),t.remove())}),t}var n=i.prototype;return n.connectedCallback=function(){this.dispatchEvent(new CustomEvent("joomla.alert.show")),this.style.animationName="joomla-alert-fade-in",(!this.type||!["info","warning","danger","success"].includes(this.type))&&this.setAttribute("type","info"),(!this.role||!["alert","alertdialog"].includes(this.role))&&this.setAttribute("role","alert"),this.firstElementChild&&this.firstElementChild.tagName==="BUTTON"&&(this.button=this.firstElementChild,this.button.classList.contains("joomla-alert--close")&&this.button.classList.add("joomla-alert--close"),this.button.innerHTML===""&&(this.button.innerHTML=''),this.button.hasAttribute("aria-label")||this.button.setAttribute("aria-label",this.closeText)),this.hasAttribute("dismiss")&&!this.button&&this.createCloseButton(),this.hasAttribute("auto-dismiss")&&this.autoDismiss()},n.disconnectedCallback=function(){this.button&&this.button.removeEventListener("click",this.close),this.observer.disconnect()},n.attributeChangedCallback=function(r,s,o){switch(r){case"type":(!o||o&&["info","warning","danger","success"].indexOf(o)===-1)&&(this.type="info");break;case"role":(!o||o&&["alert","alertdialog"].indexOf(o)===-1)&&(this.role="alert");break;case"dismiss":(!o||o==="")&&(!s||s==="")?this.button&&!this.hasAttribute("dismiss")?this.destroyCloseButton():!this.button&&this.hasAttribute("dismiss")&&this.createCloseButton():this.button&&o==="false"?this.destroyCloseButton():!this.button&&o!=="false"&&this.createCloseButton();break;case"close-text":(!o||o!==s)&&this.button&&this.button.setAttribute("aria-label",o);break;case"auto-dismiss":this.autoDismiss();break}},n.onMutation=function(r){for(var s=C(r),o;!(o=s()).done;){var u=o.value;u.type==="childList"&&u.addedNodes.length&&this.button&&this.firstElementChild!==this.button&&this.prepend(this.button)}},n.close=function(){this.dispatchEvent(new CustomEvent("joomla.alert.close")),this.style.animationName="joomla-alert-fade-out"},n.createCloseButton=function(){this.button=document.createElement("button"),this.button.setAttribute("type","button"),this.button.classList.add("joomla-alert--close"),this.button.innerHTML='',this.button.setAttribute("aria-label",this.closeText),this.insertAdjacentElement("afterbegin",this.button),this.button.addEventListener("click",this.close)},n.destroyCloseButton=function(){this.button&&(this.button.removeEventListener("click",this.close),this.button.parentNode.removeChild(this.button),this.button=null)},n.autoDismiss=function(){var r=parseInt(this.getAttribute("auto-dismiss"),10);setTimeout(this.close,r>=10?r:3e3)},A(i,[{key:"type",get:function(){return this.getAttribute("type")},set:function(r){this.setAttribute("type",r)}},{key:"role",get:function(){return this.getAttribute("role")},set:function(r){this.setAttribute("role",r)}},{key:"closeText",get:function(){return this.getAttribute("close-text")},set:function(r){this.setAttribute("close-text",r)}},{key:"dismiss",get:function(){return this.getAttribute("dismiss")},set:function(r){this.setAttribute("dismiss",r)}},{key:"autodismiss",get:function(){return this.getAttribute("auto-dismiss")},set:function(r){this.setAttribute("auto-dismiss",r)}}],[{key:"observedAttributes",get:function(){return["type","role","dismiss","auto-dismiss","close-text"]}}]),i}(h(HTMLElement));customElements.get("joomla-alert")||customElements.define("joomla-alert",T);/** * @copyright (C) 2020 Open Source Matters, Inc. * @license GNU General Public License version 2 or later; see LICENSE.txt */var v=function(i){var n;return i instanceof HTMLElement?i:(typeof i>"u"||i&&i==="#system-message-container"?n=document.getElementById("system-message-container"):n=document.querySelector(i),n)};Joomla.renderMessages=function(e,i,n,t){var r=v(i);(typeof n>"u"||n&&n===!1)&&Joomla.removeMessages(r),[].slice.call(Object.keys(e)).forEach(function(s){var o=s,u=e[s],a=document.createElement("joomla-alert");["success","info","danger","warning"].indexOf(s)<0&&(o=s==="notice"?"info":s,o=s==="message"?"success":o,o=s==="error"?"danger":o,o=s==="warning"?"warning":o),a.setAttribute("type",o),a.setAttribute("close-text",Joomla.Text._("JCLOSE")),a.setAttribute("dismiss",!0),t&&parseInt(t,10)>0&&a.setAttribute("auto-dismiss",t);var d=Joomla.Text._(s);if(typeof d<"u"){var b=document.createElement("div");b.className="alert-heading",b.innerHTML=Joomla.sanitizeHtml(''+(Joomla.Text._(s)?Joomla.Text._(s):s)+""),a.appendChild(b)}var p=document.createElement("div");p.className="alert-wrapper",u.forEach(function(L){p.innerHTML+=Joomla.sanitizeHtml('
'+L+"
")}),a.appendChild(p),r.appendChild(a)})},Joomla.removeMessages=function(e){var i=v(e),n=[].slice.call(i.querySelectorAll("joomla-alert"));n.length&&n.forEach(function(t){t.close()})},document.addEventListener("DOMContentLoaded",function(){var e=Joomla.getOptions("joomla.messages");e&&Object.keys(e).map(function(i){return Joomla.renderMessages(e[i],void 0,!0,void 0)})})})();