- md5
- ecb1c5c4e73a0c1fce2da50b147ff686
- sha1
- 8692ef9d4bc6bb52d6816c5268c1842ef49e86e3
- sha256
- 575510322e3b572f662efc69c05d578d03b1939c6e6824d3fb457309b6ef7d0e
!function(){return function t(e,o,r){function n(s,a){if(!o[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=o[s]={exports:{}};e[s][0].call(c.exports,function(t){return n(e[s][1][t]||t)},c,c.exports,t,e,o,r)}return o[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)n(r[s]);return n}}()({1:[function(t,e,o){"use strict";function r(t){"@babel/helpers - typeof";return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t){var e=u();return function(){var o,n=c(t);if(e){var i=c(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,o)}}function s(t){var e="function"==typeof Map?new Map:void 0;return(s=function(t){if(null===t||(o=t,-1===Function.toString.call(o).indexOf("[native code]")))return t;var o;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,c(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)})(t)}function a(t,e,o){return(a=u()?Reflect.construct:function(t,e,o){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return o&&l(n,o.prototype),n}).apply(null,arguments)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f;f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(u,s(HTMLElement));var e,o,r,a=i(u);function u(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a.apply(this,arguments)}return e=u,r=[{key:"observedAttributes",get:function(){return["type","role","dismiss","acknowledge","href"]}}],(o=[{key:"connectedCallback",value:function(){this.classList.add("joomla-alert--show"),this.type&&-1!==["info","warning","danger","success"].indexOf(this.type)||this.setAttribute("type","info"),this.role&&-1!==["alert","alertdialog"].indexOf(this.role)||this.setAttribute("role","alert"),(this.hasAttribute("dismiss")||this.hasAttribute("acknowledge")||this.hasAttribute("href")&&""!==this.getAttribute("href")&&!this.querySelector("button.joomla-alert--close")&&!this.querySelector("button.joomla-alert-button--close"))&&this.appendCloseButton(),this.hasAttribute("auto-dismiss")&&this.autoDismiss(),this.dispatchCustomEvent("joomla.alert.show")}},{key:"disconnectedCallback",value:function(){this.removeEventListener("joomla.alert.show",this),this.removeEventListener("joomla.alert.close",this),this.removeEventListener("joomla.alert.closed",this),this.firstChild.tagName&&"button"===this.firstChild.tagName.toLowerCase()&&this.firstChild.removeEventListener("click",this)}},{key:"attributeChangedCallback",value:function(t,e,o){switch(t){case"type":(!o||o&&-1===["info","warning","danger","success"].indexOf(o))&&(this.type="info");break;case"role":(!o||o&&-1===["alert","alertdialog"].indexOf(o))&&(this.role="alert");break;case"dismiss":case"acknowledge":o&&"true"!==o?this.removeCloseButton():this.appendCloseButton();break;case"auto-dismiss":this.autoDismiss();break;case"href":o&&""!==o?this.querySelector("button.joomla-alert-button--close")||this.appendCloseButton():this.removeCloseButton()}}},{key:"markAlertClosed",value:function(t){this.dispatchCustomEvent("joomla.alert.closed"),t?t.parentNode.removeChild(t):this.remove()}},{key:"close",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.dispatchCustomEvent("joomla.alert.close"),window.matchMedia("(prefers-reduced-motion)").matches?this.markAlertClosed(e):this.addEventListener("transitionend",function(){return t.markAlertClosed(e)},!1),this.classList.remove("joomla-alert--show")}},{key:"dispatchCustomEvent",value:function(t){var e=new CustomEvent(t);e.relatedTarget=this,this.dispatchEvent(e),this.removeEventListener(t,this)}},{key:"appendCloseButton",value:function(){if(!this.querySelector("button.joomla-alert--close")&&!this.querySelector("button.joomla-alert-button--close")){var t=this,e=document.createElement("button");this.hasAttribute("dismiss")?(e.classList.add("joomla-alert--close"),e.innerHTML='<span aria-hidden="true">×</span>',e.setAttribute("aria-label",this.getText("JCLOSE","Close"))):(e.classList.add("joomla-alert-button--close"),this.hasAttribute("acknowledge")?e.innerHTML=this.getText("JOK","ok"):e.innerHTML=this.getText("JOPEN","Open")),this.firstChild?this.insertBefore(e,this.firstChild):this.appendChild(e),e&&(this.href?e.addEventListener("click",function(){t.dispatchCustomEvent("joomla.alert.buttonClicked"),window.location.href=t.href,t.close()}):e.addEventListener("click",function(){t.dispatchCustomEvent("joomla.alert.buttonClicked"),t.getAttribute("data-callback")?(window[t.getAttribute("data-callback")](),t.close()):t.close()}))}}},{key:"autoDismiss",value:function(){var t=this;setTimeout(function(){t.dispatchCustomEvent("joomla.alert.buttonClicked"),t.hasAttribute("data-callback")?window[t.getAttribute("data-callback")]():t.close(t)},parseInt(t.getAttribute("auto-dismiss"),10)?t.getAttribute("auto-dismiss"):3e3)}},{key:"removeCloseButton",value:function(){var t=this.querySelector("button");t&&(t.removeEventListener("click",this),t.parentNode.removeChild(t))}},{key:"getText",value:function(t,e){return window.Joomla&&Joomla.JText&&Joomla.JText._&&"function"==typeof Joomla.JText._&&Joomla.JText._(t)?Joomla.JText._(t):e}},{key:"type",get:function(){return this.getAttribute("type")},set:function(t){return this.setAttribute("type",t)}},{key:"role",get:function(){return this.getAttribute("role")},set:function(t){return this.setAttribute("role",t)}},{key:"dismiss",get:function(){return this.getAttribute("dismiss")}},{key:"autodismiss",get:function(){return this.getAttribute("auto-dismiss")}},{key:"acknowledge",get:function(){return this.getAttribute("acknowledge")}},{key:"href",get:function(){return this.getAttribute("href")}}])&&n(e.prototype,o),r&&n(e,r),u}(),customElements.define("joomla-alert",f)},{}]},{},[1]);
The same content is in 5 releases, Joomla 4.0.0-beta6 to 4.0.0-rc3. See them all, or every version of this file.