"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);t=n.call(e,t||"default");if("object"!=_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}var App=function(){return _createClass(function e(){_classCallCheck(this,e)},[{key:"initComponents",value:function(){window.Waves&&Waves.init(),window.feather&&feather.replace();var e=function(e,t){document.querySelectorAll(e).forEach(function(e){return new t(e)})};e('[data-bs-toggle="popover"]',bootstrap.Popover),e('[data-bs-toggle="tooltip"]',bootstrap.Tooltip),e(".toast",bootstrap.Toast);var o=document.getElementById("toastPlacement"),e=document.getElementById("selectToastPlacement");o&&e&&e.addEventListener("change",function(e){var t,n;null!==(n=(t=o.dataset).originalClass)&&void 0!==n||(t.originalClass=o.className),o.className="".concat(o.dataset.originalClass," ").concat(e.target.value)});var l=document.getElementById("liveAlertPlaceholder"),e=document.getElementById("liveAlertBtn");e&&e.addEventListener("click",function(){return e="Nice, you triggered this alert message!",t="primary",(n=document.createElement("div")).innerHTML='\n                <div class="alert alert-'.concat(t,' alert-dismissible" role="alert">\n                    ').concat(e,'\n                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n                </div>'),void l.append(n);var e,t,n})}},{key:"initControls",value:function(){document.querySelectorAll('[data-toggle="fullscreen"]').forEach(function(e){e.addEventListener("click",function(e){var t,n;e.preventDefault(),document.body.classList.toggle("fullscreen-enable"),t=document,n=t.documentElement,t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement?null===(e=t.exitFullscreen||t.mozCancelFullScreen||t.webkitCancelFullScreen)||void 0===e||e.call(t):null===(t=n.requestFullscreen||n.mozRequestFullScreen||n.webkitRequestFullscreen)||void 0===t||t.call(n)})});function t(){document.fullscreenElement||document.mozFullScreen||document.webkitIsFullScreen||document.body.classList.remove("fullscreen-enable")}["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach(function(e){return document.addEventListener(e,t)})}},{key:"initMenu",value:function(){var t=document.body,e=document.querySelector(".button-toggle-menu");null==e||e.addEventListener("click",function(){var e=t.dataset.sidebar;t.dataset.sidebar="default"===e?"hidden":"default"});e=function(){var e=t.dataset.sidebar;e&&"auto"!==e||(t.dataset.sidebar=window.innerWidth<1040?"hidden":"default")};e(),window.addEventListener("resize",e),$("#sidebar-menu").length&&($("#sidebar-menu li .collapse").on({"show.bs.collapse":function(e){e=$(e.target).parents(".collapse.show");$("#sidebar-menu .collapse.show").not(e).collapse("hide")}}),$("#sidebar-menu").length&&($("#sidebar-menu li .collapse").on("show.bs.collapse",function(e){e=$(e.target).parents(".collapse.show");$("#sidebar-menu .collapse.show").not(e).collapse("hide")}),$("#sidebar-menu a").each(function(){var e=window.location.href.split(/[?#]/)[0];this.href===e&&$(this).addClass("active").parent().addClass("menuitem-active").closest(".collapse").addClass("show").parentsUntil("#sidebar-menu").addClass("menuitem-active show")})))}},{key:"init",value:function(){this.initComponents(),this.initMenu(),this.initControls()}}])}();(new App).init();