{"version":3,"sources":["../../js/src/util.js","../../js/src/general.js","../../js/src/scrollbar.js","../../js/src/sidebar.js","../../js/src/aside.js","../../js/src/toaster.js","../../js/src/widget.js","../../js/src/fileinput.js","../../js/src/wysiwyg.js","../../js/src/tab-scroll.js","../../js/src/tab-swipe.js","../../js/src/scroll-top.js","../../js/src/sticky.js","../../js/src/index.umd.js"],"sourcesContent":["/**\r\n * --------------------------------------------------------------------------\r\n * Ace (v3.1.0): util.js\r\n Some Utility Functions\r\n*/\r\n\r\n// import $ from 'jquery'\r\n// import bootstrap from 'bootstrap'\r\n\r\nclass Util {\r\n static isReducedMotion () {\r\n return window.matchMedia('(prefers-reduced-motion)').matches\r\n }\r\n\r\n static isRTL () {\r\n return document.documentElement.classList.contains('rtl') || document.documentElement.dir === 'rtl'\r\n }\r\n\r\n static hasClosest () {\r\n return 'closest' in document.documentElement\r\n }\r\n\r\n /**\r\n static hasTransitionStart () {\r\n if (Util._supportsTransitionStart !== null) return Util._supportsTransitionStart\r\n\r\n Util._supportsTransitionStart = 'ontransitionstart' in window// doesn't work in Chrome\r\n if (!Util._supportsTransitionStart) {\r\n var tmp = $('
').appendTo(document.body)\r\n tmp.on('transitionstart', function () {\r\n Util._supportsTransitionStart = true\r\n }).on('transitionend', function () {\r\n tmp.remove()\r\n })\r\n\r\n tmp.get(0).offsetTop\r\n tmp.css('opacity', '1')\r\n }\r\n\r\n return Util._supportsTransitionStart\r\n }\r\n */\r\n\r\n static getScrollbarInfo (recalc = false) {\r\n if (recalc === false && Util._scrollbarInfo !== null) return Util._scrollbarInfo\r\n\r\n const scrollDiv = document.createElement('div')\r\n scrollDiv.style.overflow = 'scroll'\r\n scrollDiv.style.position = 'absolute'\r\n scrollDiv.style.width = '50px'\r\n scrollDiv.style.height = '50px'\r\n\r\n var scrollbar = {}\r\n\r\n document.body.appendChild(scrollDiv)\r\n scrollbar.width = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\r\n document.documentElement.style.setProperty('--scrollbar-width', scrollbar.width + 'px')\r\n\r\n var thinWidth = scrollbar.width\r\n if (window.CSS) {\r\n scrollbar.thin = window.CSS.supports('scrollbar-width', 'thin')// currently only firefox 64+ supports it\r\n if (scrollbar.thin) {\r\n scrollDiv.style['scrollbar-width'] = 'thin'\r\n thinWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\r\n }\r\n\r\n scrollbar.overlay = window.CSS.supports('overflow', 'overlay')\r\n } else {\r\n scrollbar.thin = false\r\n\r\n scrollDiv.style.overflow = 'overlay'// Webkit/Chromium based browsers support it\r\n scrollbar.overlay = scrollbar.width > 0 && scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth === 0\r\n }\r\n document.documentElement.style.setProperty('--moz-scrollbar-thin', thinWidth + 'px')\r\n\r\n scrollDiv.style['-ms-overflow-style'] = '-ms-autohiding-scrollbar'// IE\r\n scrollbar.autohide = scrollbar.width > 0 && scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth === 0\r\n\r\n /// //////////////////////////////////\r\n document.body.removeChild(scrollDiv)\r\n Util._scrollbarInfo = scrollbar\r\n\r\n return Util._scrollbarInfo\r\n }\r\n}\r\nUtil._supportsTransitionStart = null// static property\r\nUtil._scrollbarInfo = null// static property\r\n\r\n/**\r\n* ------------------------------------------------------------------------\r\n* jQuery\r\n* ------------------------------------------------------------------------\r\n*/\r\n\r\nexport default Util\r\n","/**\r\n * --------------------------------------------------------------------------\r\n * Ace (v3.1.0): general.js\r\n General Ace Functions\r\n*/\r\n\r\nimport $ from 'jquery'\r\nimport Util from './util'\r\n\r\nclass Basic {\r\n static _HandleBasics () {\r\n // for IE\r\n if (window.NodeList && !NodeList.prototype.forEach) {\r\n NodeList.prototype.forEach = Array.prototype.forEach\r\n }\r\n\r\n Basic._handleAlerts()\r\n\r\n Basic._handleDropdowns()\r\n\r\n Basic._handleNavbar()\r\n\r\n Basic._handleOther()\r\n\r\n $(document.body).addClass('is-document-loaded')\r\n }\r\n\r\n /**\r\n * collapse .alert instead of fading it out\r\n */\r\n static _handleAlerts () {\r\n $(document)\r\n .on('close.bs.alert.alert-collapse', '.alert.alert-collapse', function (e) {\r\n e.preventDefault()\r\n $(this).wrap('').parent().collapse('hide').one('hidden.bs.collapse.alert-collapse', function () {\r\n $(this).remove()\r\n })\r\n })\r\n }\r\n\r\n /// ////////\r\n\r\n static _handleDropdowns () {\r\n // dismiss (hide) a dropdown menu\r\n var _dismissDropdown = function () {\r\n var menu = $(this).closest('.dropdown-menu')\r\n var dropdown = menu.parent()\r\n var toggle = dropdown.find('[data-toggle=dropdown]')\r\n\r\n toggle.dropdown('hide')\r\n menu.removeClass('show')\r\n dropdown.removeClass('show')\r\n }\r\n\r\n // hide dropdown when clicked on an element inside it with `data-dismiss=dropdown` attribute\r\n $(document)\r\n .on('click', '[data-dismiss=dropdown]', function (e) {\r\n e.preventDefault()\r\n _dismissDropdown.call(e.target)\r\n })\r\n\r\n // hide dropdown when a `form` inside it is submitted\r\n $(document)\r\n .on('submit', '.dropdown-menu form[data-submit=dismiss]', function (e) {\r\n e.preventDefault()\r\n _dismissDropdown.call(e.target)\r\n })\r\n\r\n // don't hide dropdown when clicked inside a `.dropdown-clickable` element\r\n $(document)\r\n .on('click.dropdown-clickable', '.dropdown-clickable', function (e) {\r\n e.stopImmediatePropagation()\r\n })\r\n\r\n // hide `body` scrollbars when dropdowns are opened in mobile view\r\n $(document)\r\n .on('shown.bs.dropdown', '.dropdown.dd-backdrop', function () {\r\n // check `display` of .dropdown::before, if not visible it means `backdrop` is not visible (applied)\r\n if (window.getComputedStyle(this, ':before').display === 'none') return\r\n\r\n // the device width is such that backdrop is visible (.dropdown-inner is visible)\r\n var scrollbarInfo = Util.getScrollbarInfo()\r\n if (scrollbarInfo.width === 0) {\r\n document.body.classList.add('mob-dropdown-body')\r\n }\r\n this.classList.add('backdrop-shown')// used later to add `.navbar-modal` class to .navbar\r\n\r\n $(this).one('hidden.bs.dropdown', function () {\r\n document.body.classList.remove('mob-dropdown-body')\r\n this.classList.remove('backdrop-shown')\r\n })\r\n })\r\n }\r\n\r\n /// ////////\r\n\r\n static _handleNavbar () {\r\n // hide `.navbar-collapse` when clicked on it (specifically on the backdrop in mobile view)\r\n $(document)\r\n .on('click', '.navbar-backdrop.collapse.show', function (e) {\r\n if (e.target === this) $(this).collapse('hide')\r\n })\r\n\r\n // hide dropdown when a `form` inside it is submitted\r\n $(document)\r\n .on('submit', '.navbar-collapse.show form[data-submit=dismiss]', function (e) {\r\n e.preventDefault()\r\n $(this).closest('.navbar-collapse').collapse('hide')\r\n })\r\n\r\n // when navbar or a dropdown-menu inside it is displayed, move focus to the \".autofocus\" element.\r\n // For example a search box can be .autofocus\r\n $(document)\r\n .on('shown.bs.dropdown', '.navbar .dropdown', function () {\r\n $(this).find('.autofocus').focus()\r\n })\r\n .on('shown.bs.collapse', '.navbar-collapse', function () {\r\n $(this).find('.autofocus').focus()\r\n\r\n // also hide body scrollbars in mobile devices\r\n if (this.classList.contains('navbar-backdrop')) {\r\n var scrollbarInfo = Util.getScrollbarInfo()\r\n if (scrollbarInfo.width === 0) {\r\n document.body.classList.add('mob-navbar-body')\r\n }\r\n }\r\n })\r\n .on('hidden.bs.collapse', function () {\r\n document.body.classList.remove('mob-navbar-body')\r\n })\r\n .on('show.bs.collapse', function () {\r\n // hide other 'shown/open' ones\r\n $('.navbar-collapse.show').css('transition-duration', '1ms').collapse('hide').css('transition-duration', '')\r\n })\r\n\r\n // if navbar dropdowns are not entirely inside window area, move them accordingly\r\n var _adjustDropdown = function () {\r\n var isRTL = Util.isRTL()\r\n var isRightAligned = this.classList.contains('dropdown-menu-right')\r\n\r\n var _dir = !isRightAligned ? (!isRTL ? 'left' : 'right') : (!isRTL ? 'right' : 'left')\r\n var prop = 'margin-' + _dir\r\n\r\n this.style.removeProperty(prop)\r\n\r\n var moveBy = 0\r\n var rect = this.getBoundingClientRect()\r\n if (rect.left < 0) {\r\n moveBy = parseInt(-1 * rect.left) + 5\r\n } else {\r\n var sw = document.body.scrollWidth\r\n if (rect.right > sw) {\r\n moveBy = parseInt(sw - rect.right - 5)\r\n }\r\n }\r\n\r\n if (moveBy < 5) return\r\n\r\n if (isRightAligned) moveBy *= -1\r\n this.style.setProperty(prop, moveBy + 'px', 'important')\r\n }\r\n\r\n var _closest = 'closest' in document.documentElement\r\n $(document)\r\n .on('transitionstart.adjust', '.navbar .dropdown-mega .dropdown-menu', function (ev) {\r\n if (ev.target !== this || ev.originalEvent.propertyName !== 'transform') return\r\n _adjustDropdown.call(this)\r\n })\r\n .on('shown.bs.dropdown', '.navbar .dropdown', function () {\r\n if (this.classList.contains('dropdown-mega')) {\r\n var dropdown = this.querySelector('.dropdown-menu[data-display=\"static\"]')\r\n if (dropdown !== null) _adjustDropdown.call(dropdown)\r\n }\r\n\r\n // when a .dropdown is opened, add .navbar-open to increase z-index, so that dropdowns go above 'asides', etc\r\n if (_closest) {\r\n var navbar = this.closest('.navbar')\r\n if (this.classList.contains('backdrop-shown')) navbar.classList.add('navbar-modal')\r\n else navbar.classList.add('navbar-open')\r\n }\r\n })\r\n .on('hidden.bs.dropdown', '.navbar .dropdown', function () {\r\n if (_closest) {\r\n var navbar = this.closest('.navbar')\r\n navbar.classList.remove('navbar-open')\r\n navbar.classList.remove('navbar-modal')\r\n }\r\n })\r\n }\r\n\r\n /// ////////\r\n\r\n static _handleOther () {\r\n document.querySelectorAll('.input-floating-label input').forEach((inp) => {\r\n if (inp.value !== '') inp.classList.add('has-content')\r\n else inp.classList.remove('has-content')\r\n })\r\n\r\n document.addEventListener('focusout', (ev) => {\r\n const inp = ev.target\r\n if ('matches' in inp) {\r\n if (!inp.matches('.input-floating-label input')) return\r\n }\r\n else if ('msMatchesSelector' in inp && !inp.msMatchesSelector('.input-floating-label input')) return\r\n\r\n if (inp.value !== '') inp.classList.add('has-content')\r\n else inp.classList.remove('has-content')\r\n })\r\n }\r\n}\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * jQuery\r\n * ------------------------------------------------------------------------\r\n*/\r\n\r\nif (typeof $ !== 'undefined') {\r\n Basic._HandleBasics()\r\n}\r\n\r\nexport default Basic\r\n","/**\r\n * --------------------------------------------------------------------------\r\n * Ace (v3.1.0): scrollbar.js\r\n*/\r\n\r\nimport $ from 'jquery'\r\nimport bootstrap from 'bootstrap'\r\nimport Util from './util'\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Constants\r\n * ------------------------------------------------------------------------\r\n */\r\n\r\nconst NAME = 'aceScroll'\r\nconst VERSION = '3.1.0'\r\nconst DATA_KEY = 'ace.scroll'\r\nconst EVENT_KEY = `.${DATA_KEY}`\r\nconst DATA_API_KEY = '.data-api'\r\n\r\nconst Event = {\r\n LOAD_DATA_API: `load${EVENT_KEY}${DATA_API_KEY}`\r\n}\r\n\r\nconst Selector = {\r\n ACE_SCROLL: '[ace-scroll]',\r\n DATA_ACE_SCROLL: '[data-ace-scroll]'\r\n}\r\n\r\nconst DefaultType = {\r\n type: 'string',\r\n smooth: 'boolean',\r\n\r\n height: '(number|null)',\r\n lock: 'boolean',\r\n\r\n ignore: '(string|null)',\r\n\r\n plugin: 'string',\r\n options: '(object|null)', // plugin settings\r\n\r\n color: '(string|null)',\r\n autohide: '(boolean|null)'\r\n}\r\n\r\nconst Default = {\r\n type: 'native',\r\n smooth: false,\r\n\r\n height: null,\r\n lock: false,\r\n\r\n ignore: null,\r\n\r\n plugin: 'SimpleBar',\r\n options: null,\r\n\r\n color: null,\r\n autohide: true\r\n}\r\n\r\nclass Scrollbar {\r\n constructor (element, config) {\r\n this._element\t= element\r\n this._config = this._getConfig(config)\r\n\r\n this._scrollbarInfo = Util.getScrollbarInfo()\r\n\r\n this.enableScrollbars()\r\n }\r\n\r\n static get VERSION () {\r\n return VERSION\r\n }\r\n\r\n static get DefaultType () {\r\n return DefaultType\r\n }\r\n\r\n static get Default () {\r\n return Default\r\n }\r\n\r\n enableScrollbars () {\r\n /**\r\n this._element.scrollTop = 0\r\n // For firefox. Because it has persistent scroll position on page reload\r\n // which doesn't look good when changing overflow: hidden to overflow: scroll on hover\r\n */\r\n\r\n // no scrollbars when specified\r\n if (this._config.ignore !== null) {\r\n if (this._config.ignore === 'mobile' && this._scrollbarInfo.width === 0 && 'ontouchstart' in window && window.matchMedia('(max-width: 840px)').matches) return\r\n else if (this._config.ignore === 'desktop' && this._scrollbarInfo.width > 0) return\r\n }\r\n\r\n this.update(this._config.height)\r\n this.lock(this._config.lock)\r\n\r\n this._element.classList.remove('ace-scroll', 'ace-scroll-mob', 'ace-scroll-wrap')\r\n if (this._config.type === 'native') {\r\n this._addNativeScrolls()\r\n } else if (this._config.type === 'auto') {\r\n this._preferNativeScrolls()\r\n } else if (this._config.type === 'plugin') {\r\n this._addPluginScrolls()\r\n }\r\n }\r\n\r\n update (_height) {\r\n if (!_height) return\r\n if (!isNaN(_height)) _height += 'px'\r\n this._element.style.maxHeight = _height\r\n }\r\n\r\n lock (_lock) {\r\n if (_lock) this._element.classList.add('ace-scroll-lock')\r\n else this._element.classList.remove('ace-scroll-lock')\r\n }\r\n\r\n _addNativeScrolls (smooth) {\r\n if (this._scrollbarInfo.width === 0) this._element.classList.add('ace-scroll-mob')// mobile device\r\n else {\r\n this._element.classList.add('ace-scroll')\r\n\r\n if (this._config.color !== null) this._element.classList.add('ace-scroll-' + this._config.color)\r\n if (this._config.autohide === false) this._element.classList.add('is-always-on')\r\n\r\n var _smooth = typeof smooth !== 'undefined' ? smooth : this._config.smooth\r\n if (_smooth) {\r\n // wrap children inside an .ace-scroll-inner\r\n var wrapper = document.createElement('div')\r\n wrapper.classList.add('ace-scroll-inner')\r\n wrapper.style.color = window.getComputedStyle(this._element).color\r\n\r\n while (this._element.firstChild) {\r\n wrapper.appendChild(this._element.firstChild)\r\n }\r\n this._element.appendChild(wrapper)\r\n\r\n /// ///////\r\n // disable the initial transition effects\r\n this._element.style.transition = 'none'\r\n\r\n this._element.classList.add('ace-scroll-wrap')\r\n this._element.offsetHeight// reflow\r\n this._element.style.transition = ''\r\n }\r\n }\r\n }\r\n\r\n _preferNativeScrolls () {\r\n if (this._scrollbarInfo.width === 0 || this._scrollbarInfo.overlay || this._scrollbarInfo.thin || !this._hasScrollbarPlugin()) {\r\n this._addNativeScrolls()\r\n } else {\r\n this._addPluginScrolls()\r\n }\r\n }\r\n\r\n _addPluginScrolls () {\r\n if (this._hasScrollbarPlugin()) {\r\n return new window[this._config.plugin](this._element, this._config.options)\r\n } else {\r\n this._addNativeScrolls()\r\n }\r\n }\r\n\r\n _hasScrollbarPlugin () {\r\n return !!window[this._config.plugin]\r\n }\r\n\r\n _getConfig (config) {\r\n config = {\r\n ...Default,\r\n ...typeof config === 'object' && config ? config : {}\r\n }\r\n\r\n if (typeof bootstrap !== 'undefined') {\r\n bootstrap.Util.typeCheckConfig(\r\n NAME,\r\n config,\r\n this.constructor.DefaultType\r\n )\r\n }\r\n\r\n return config\r\n }\r\n\r\n // Static methods\r\n static _jQueryInterface (config) {\r\n return this.each(function () {\r\n const $this = $(this)\r\n let data = $this.data(DATA_KEY)\r\n\r\n let options = this.getAttribute('ace-scroll') || this.getAttribute('data-ace-scroll') || {}\r\n if (!isNaN(options)) options = { height: parseInt(options) }\r\n else if (options.length > 1) {\r\n try {\r\n options = JSON.parse(options)\r\n } catch (e) {}\r\n }\r\n\r\n const _config = {\r\n ...Default,\r\n ...$this.data(),\r\n ...typeof config === 'object' && config ? config : {},\r\n ...typeof options === 'object' && options ? options : {}\r\n }\r\n\r\n if (!data) {\r\n data = new Scrollbar(this, _config)\r\n $this.data(DATA_KEY, data)\r\n }\r\n\r\n if (typeof config === 'string') {\r\n if (typeof data[config] === 'undefined') {\r\n throw new TypeError(`No method named \"${config}\"`)\r\n }\r\n data[config]()\r\n }\r\n })\r\n }\r\n}\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Data Api implementation\r\n * ------------------------------------------------------------------------\r\n*/\r\n\r\n$(window).on(Event.LOAD_DATA_API, () => {\r\n const scrollbars = ([].slice.call(document.querySelectorAll(Selector.ACE_SCROLL))).concat([].slice.call(document.querySelectorAll(Selector.DATA_ACE_SCROLL)))\r\n\r\n for (let i = 0; i < scrollbars.length; i++) {\r\n const $scrollbars = $(scrollbars[i])\r\n Scrollbar._jQueryInterface.call($scrollbars, $scrollbars.data())\r\n }\r\n})\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * jQuery\r\n * ------------------------------------------------------------------------\r\n*/\r\nif (typeof $ !== 'undefined') {\r\n const JQUERY_NO_CONFLICT = $.fn[NAME]\r\n $.fn[NAME] = Scrollbar._jQueryInterface\r\n $.fn[NAME].Constructor = Scrollbar\r\n $.fn[NAME].noConflict = () => {\r\n $.fn[NAME] = JQUERY_NO_CONFLICT\r\n return Scrollbar._jQueryInterface\r\n }\r\n}\r\n\r\nexport default Scrollbar\r\n","/**\r\n * --------------------------------------------------------------------------\r\n * Ace (v3.1.0): sidebar.js\r\n Handling Sidebar\r\n*/\r\n\r\nimport $ from 'jquery'\r\nimport bootstrap from 'bootstrap'\r\nimport Util from './util'\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Constants\r\n * ------------------------------------------------------------------------\r\n */\r\n\r\nconst NAME = 'aceSidebar'\r\nconst VERSION = '3.1.0'\r\nconst DATA_KEY = 'ace.sidebar'\r\nconst EVENT_KEY = `.${DATA_KEY}`\r\nconst DATA_API_KEY = '.data-api'\r\n\r\nconst Event = {\r\n SHOW: `show${EVENT_KEY}`,\r\n HIDE: `hide${EVENT_KEY}`,\r\n COLLAPSE: `collapse${EVENT_KEY}`,\r\n EXPAND: `expand${EVENT_KEY}`,\r\n SHOWN: `shown${EVENT_KEY}`,\r\n HIDDEN: `hidden${EVENT_KEY}`,\r\n COLLAPSED: `collapsed${EVENT_KEY}`,\r\n EXPANDED: `expanded${EVENT_KEY}`,\r\n LOAD_DATA_API: `load${EVENT_KEY}${DATA_API_KEY}`,\r\n CLICK_DATA_API: `click${EVENT_KEY}${DATA_API_KEY}`\r\n}\r\n\r\nconst Selector = {\r\n SIDEBAR: '.sidebar',\r\n DATA_TOGGLE: '[data-toggle=\"sidebar\"]',\r\n DATA_TOGGLE_MOBILE: '[data-toggle-mobile=\"sidebar\"]'\r\n}\r\n\r\nconst DefaultType = {\r\n swipe: 'boolean',\r\n dismiss: 'boolean',\r\n backdrop: 'boolean',\r\n\r\n gotoactive: 'boolean',\r\n subscroll: 'boolean',\r\n\r\n pullup: 'boolean'\r\n}\r\n\r\nconst Default = {\r\n swipe: false,\r\n dismiss: false,\r\n backdrop: false,\r\n\r\n gotoactive: false,\r\n subscroll: true,\r\n\r\n pullup: false\r\n}\r\n\r\nconst ClassName = {\r\n DESKTOP_HIDE: 'collapsed',\r\n MOBILE_SHOW: 'sidebar-visible',\r\n COLLAPSED:\t'collapsed',\r\n\r\n TOGGLING: 'toggling',\r\n\r\n INNER_HOVER: 'is-hover',\r\n\r\n BACKDROP: 'sidebar-backdrop',\r\n\r\n HORIZONTAL: 'sidebar-h'\r\n}\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Class Definition\r\n * ------------------------------------------------------------------------\r\n */\r\n\r\nclass Sidebar {\r\n constructor (element, config) {\r\n this._hasTransitionEvent = false\r\n this._hasTransitionEvent2 = false\r\n this._isTransitioning = false\r\n\r\n this._sidebar = element\r\n this._sidebar.offsetHeight // force reflow, so that if we instantly call 'collapse' or 'expand', transition effect takes place\r\n this._sidebar.classList.add('sidebar')\r\n this._inner = this._sidebar.querySelector('.sidebar-inner')\r\n this._config = this._getConfig(config)\r\n this._scroller = \tthis._sidebar.querySelector('[class*=\"ace-scroll\"]')\r\n\r\n if (this._sidebar.querySelector('.submenu.show') !== null) this._sidebar.classList.add('has-open')\r\n\r\n this._pullupEnabled = false\r\n\r\n this._triggerArray = [].slice.call(document.querySelectorAll(\r\n `[data-toggle=\"sidebar\"][href=\"#${element.id}\"],` +\r\n `[data-toggle=\"sidebar\"][data-target=\"#${element.id}\"]`\r\n ))\r\n this._triggerArrayMobile = [].slice.call(document.querySelectorAll(\r\n `[data-toggle-mobile=\"sidebar\"][href=\"#${element.id}\"],` +\r\n `[data-toggle-mobile=\"sidebar\"][data-target=\"#${element.id}\"]`\r\n ))\r\n\r\n this._horizontal = this._sidebar.classList.contains(ClassName.HORIZONTAL)\r\n this._desktopCollapsedClass = this._triggerArray.length > 0 ? (this._triggerArray[0].getAttribute('data-toggle-class') || ClassName.DESKTOP_HIDE) : ClassName.DESKTOP_HIDE\r\n\r\n //\r\n this._collapsed = this._sidebar.classList.contains(this._desktopCollapsedClass)\r\n\r\n $(this._inner).on('focus', 'input', (e) => {\r\n if (!this._collapsed) return\r\n this._inner.classList.add('has-focus')\r\n $(e.target).one('blur', () => {\r\n this._inner.classList.remove('has-focus')\r\n })\r\n })\r\n //\r\n\r\n this._handleTriggerEvents()\r\n this.enableSubmenuToggle()\r\n\r\n if (this._config.pullup) this.enableSubmenuPullup()\r\n if (this._config.gotoactive) this.scrollToActive()\r\n if (this._config.backdrop) {\r\n this._sidebar.classList.add(ClassName.BACKDROP)\r\n } else if (this._sidebar.classList.contains(ClassName.BACKDROP)) {\r\n this._config.backdrop = true\r\n }\r\n\r\n if (!this._horizontal && this._collapsed) {\r\n this._addTransitionEvent()\r\n }\r\n }\r\n\r\n // Getters\r\n static get VERSION () {\r\n return VERSION\r\n }\r\n\r\n static get Default () {\r\n return Default\r\n }\r\n\r\n static get DefaultType () {\r\n return DefaultType\r\n }\r\n\r\n _handleTriggerEvents () {\r\n var This = this\r\n $(this._triggerArray).on('click', function () {\r\n This.toggle(this)\r\n })\r\n\r\n $(this._triggerArrayMobile).on('click', function () {\r\n This.toggleMobile(this)\r\n })\r\n }\r\n\r\n toggle (btn = null) {\r\n if (this._sidebar.classList.contains(this._desktopCollapsedClass)) {\r\n this.expand(btn)\r\n } else {\r\n this.collapse(btn)\r\n }\r\n }\r\n\r\n toggleMobile (btn = null) {\r\n if (!this._sidebar.classList.contains(ClassName.MOBILE_SHOW)) {\r\n this.show(btn)\r\n } else {\r\n this.hide(btn)\r\n }\r\n }\r\n\r\n /// ////\r\n\r\n expand (btn = null) {\r\n if (!this._hasTransitionEvent) this._addTransitionEvent()\r\n if (this._isTransitioning) return\r\n\r\n const ev = new $.Event(Event.EXPAND)\r\n $(this._sidebar).trigger(ev)\r\n if (ev.isDefaultPrevented()) return\r\n\r\n this._isTransitioning = true\r\n\r\n this._sidebar.classList.add(ClassName.TOGGLING)\r\n this._sidebar.classList.remove(this._desktopCollapsedClass)\r\n\r\n this._updateTriggerBtns(this._triggerArray, true)\r\n\r\n this._collapsed = false\r\n\r\n if (Util.isReducedMotion() || this._horizontal) this._toggleCompleted()// call completion now\r\n\r\n //\r\n if (this._pullupEnabled) this._resetPullUp()\r\n\r\n // this._inner.classList.remove(ClassName.INNER_HOVER)//we'll remove it in _toggleCompleted\r\n }\r\n\r\n collapse (btn = null) {\r\n if (!this._hasTransitionEvent) this._addTransitionEvent()\r\n if (this._isTransitioning) return\r\n\r\n const ev = new $.Event(Event.COLLAPSE)\r\n $(this._sidebar).trigger(ev)\r\n if (ev.isDefaultPrevented()) return\r\n\r\n this._isTransitioning = true\r\n\r\n this._sidebar.classList.add(ClassName.TOGGLING)\r\n this._sidebar.classList.add(this._desktopCollapsedClass)\r\n\r\n this._updateTriggerBtns(this._triggerArray, false)\r\n\r\n this._collapsed = true\r\n\r\n if (Util.isReducedMotion() || this._horizontal) this._toggleCompleted()// call completion now\r\n\r\n //\r\n if (this._pullupEnabled) this._resetPullUp()\r\n\r\n // if the triggering button is inside sidebar and we want it to remain expaned (.let-expanded), add .is-hover class as well\r\n if (btn !== null && this._sidebar.classList.contains('expandable') && this._sidebar.classList.contains('let-expanded') && this._inner.contains(btn)) {\r\n this._inner.classList.add(ClassName.INNER_HOVER)\r\n }\r\n }\r\n\r\n show (btn = null) {\r\n if (!this._hasTransitionEvent2) this._addTransitionEvent2()\r\n\r\n const ev = new $.Event(Event.SHOW)\r\n $(this._sidebar).trigger(ev)\r\n if (ev.isDefaultPrevented()) return\r\n\r\n this._sidebar.classList.add(ClassName.MOBILE_SHOW)\r\n this._updateTriggerBtns(this._triggerArrayMobile, true)\r\n\r\n // hide sidebar if clicked outside of it\r\n if (this._config.dismiss) {\r\n $(this._triggerArrayMobile).css('pointer-events', 'none') // disable this button, because if we click on it, it will hide and then instantly show the sidebar again\r\n $(document).on('mouseup.sidebar-dismiss', (e) => {\r\n if (!$.contains(this._sidebar, e.target)) { // if clicked outside sidebar\r\n this.hide()\r\n }\r\n })\r\n }\r\n\r\n if (this._config.swipe) this.enableSwipeHide()\r\n\r\n if (Util.isReducedMotion()) this._toggleMobileCompleted()// call completion now\r\n\r\n // in some webkit mobile browsers, sidebar scrolling works but scrollbars are not visible, unless something like this forces it to become visible\r\n if (this._scroller && !this._scroller.classList.contains('overflow-hidden')) {\r\n this._scroller.classList.add('overflow-hidden')\r\n this._scroller.offsetHeight// force redraw\r\n this._scroller.classList.remove('overflow-hidden')\r\n }\r\n\r\n // hide body scrollbars\r\n // if sidebar is fixed and has backdrop or is .sidebar-push\r\n var scrollbarInfo = Util.getScrollbarInfo()\r\n if (scrollbarInfo.width === 0 && this._sidebar.classList.contains('sidebar-fixed') && (this._config.backdrop || this._sidebar.classList.contains('sidebar-push'))) {\r\n document.body.classList.add('mob-sidebar-body')\r\n }\r\n }\r\n\r\n hide (btn = null) {\r\n if (!this._hasTransitionEvent2) this._addTransitionEvent2()\r\n\r\n const ev = new $.Event(Event.HIDE)\r\n $(this._sidebar).trigger(ev)\r\n if (ev.isDefaultPrevented()) return\r\n\r\n this._sidebar.classList.remove(ClassName.MOBILE_SHOW)\r\n this._updateTriggerBtns(this._triggerArrayMobile, false)\r\n\r\n // document.body.classList.remove('mob-sidebar-body') // moved to `_toggleMobileCompleted`\r\n\r\n if (this._config.dismiss) {\r\n $(this._triggerArrayMobile).css('pointer-events', '')\r\n $(document).off('.sidebar-dismiss')\r\n }\r\n if (this._config.swipe) {\r\n $(document).off('.sidebar-swipe')\r\n }\r\n\r\n if (Util.isReducedMotion()) this._toggleMobileCompleted()// call completion now\r\n }\r\n\r\n _updateTriggerBtns (btns, expanded = false) {\r\n for (let i = 0, len = btns.length; i < len; i++) {\r\n if (expanded) btns[i].classList.remove(ClassName.COLLAPSED)\r\n else btns[i].classList.add(ClassName.COLLAPSED)\r\n\r\n btns[i].setAttribute('aria-expanded', expanded)\r\n }\r\n }\r\n\r\n _toggleCompleted () {\r\n this._isTransitioning = false\r\n this._sidebar.classList.remove(ClassName.TOGGLING)\r\n\r\n var expanded = !this._sidebar.classList.contains(this._desktopCollapsedClass)\r\n if (expanded) $(this._sidebar).trigger(Event.EXPANDED)\r\n else $(this._sidebar).trigger(Event.COLLAPSED)\r\n\r\n if (expanded) this._inner.classList.remove(ClassName.INNER_HOVER)\r\n }\r\n\r\n _toggleMobileCompleted () {\r\n var shown = this._sidebar.classList.contains(ClassName.MOBILE_SHOW)\r\n if (shown) $(this._sidebar).trigger(Event.SHOWN)\r\n else {\r\n document.body.classList.remove('mob-sidebar-body')\r\n if (this._config.swipe) {\r\n document.body.classList.remove('mob-sidebarswipe-body')\r\n }\r\n\r\n $(this._sidebar).trigger(Event.HIDDEN)\r\n }\r\n }\r\n\r\n _addTransitionEvent () {\r\n if (this._hasTransitionEvent) return\r\n this._hasTransitionEvent = true\r\n var counter = 0\r\n\r\n $(this._sidebar)\r\n .on('transitionend', (e) => {\r\n if (e.target !== this._sidebar) return// make sure its not the children triggerring the event!\r\n\r\n this._toggleCompleted()\r\n\r\n counter = 0\r\n })\r\n\r\n // add 'is-hover' class to '.sidebar-inner' when it becomes expanded (i.e. when mouse hovers it)\r\n $(this._inner)\r\n .on('transitionstart', (e) => {\r\n // skip on mobile (in which propertyName is `transform`)\r\n if (e.target !== this._inner || this._isTransitioning || (e.originalEvent && e.originalEvent.propertyName !== 'width')) return\r\n\r\n counter++\r\n if (counter === 1) this._inner.classList.add(ClassName.INNER_HOVER)\r\n // else if (counter >= 2) {\r\n // this.classList.remove(ClassName.INNER_HOVER)\r\n // counter = 0\r\n // }\r\n })\r\n .on('transitionend', (e) => {\r\n // skip `transitionend` on mobile (in which propertyName is `transform`)\r\n if (e.target !== this._inner || (e.originalEvent && e.originalEvent.propertyName !== 'width')) return\r\n if (this._inner.clientWidth < 120) {\r\n // just to make sure we remove the extra class name when not needed\r\n this._inner.classList.remove(ClassName.INNER_HOVER)\r\n counter = 0\r\n // blur input element\r\n if (document.activeElement.tagName === 'INPUT' && this._inner.contains(document.activeElement)) document.activeElement.blur()\r\n }\r\n })\r\n }\r\n\r\n _addTransitionEvent2 () {\r\n if (this._hasTransitionEvent2) return\r\n this._hasTransitionEvent2 = true\r\n\r\n $(this._inner).on('transitionend', (e) => {\r\n if (e.target !== this._inner || (e.originalEvent && e.originalEvent.propertyName !== 'transform')) return\r\n\r\n this._toggleMobileCompleted()\r\n })\r\n }\r\n\r\n enableSwipeHide () {\r\n // swipe to hide sidebar\r\n var x1 = 0\r\n var y1 = 0\r\n var swipeDir = 0\r\n\r\n var isRTL = false\r\n var lastX = 0\r\n\r\n var pushContent = false\r\n var sidebarWidth = 0\r\n\r\n var touchMoveCallback = function (ev) {\r\n var touches = ev.changedTouches[0] || null\r\n if (!touches) return\r\n\r\n var newX = touches.pageX\r\n var newY = touches.pageY\r\n lastX = newX\r\n\r\n if (swipeDir === 0) {\r\n var diffY = Math.abs(y1 - newY)\r\n var diffX = Math.abs(x1 - newX)\r\n\r\n if (diffY > diffX) {\r\n swipeDir = 2// vertical i.e. scroll\r\n if (this._scroller) this._scroller.classList.remove('overflow-hidden')\r\n document.body.classList.remove('mob-sidebarswipe-body')\r\n\r\n $(document).off('touchmove.sidebar-swipe')\r\n } else if (diffX > 10) {\r\n swipeDir = 1// horizontal swipe\r\n this._inner.setAttribute('style', 'transition: none !important; touch-action: none;')\r\n if (this._scroller) this._scroller.classList.add('overflow-hidden')\r\n document.body.classList.add('mob-sidebarswipe-body')\r\n }\r\n }\r\n if (swipeDir !== 1) return\r\n\r\n var moveX = parseInt(x1 - newX)\r\n if ((!isRTL && moveX > 0) || (isRTL && moveX < 0)) { // move it outside of view\r\n this._inner.style.transform = 'translateX(' + (-1 * moveX) + 'px)'\r\n if (pushContent) this._sidebar.style.width = (sidebarWidth - (moveX > 0 ? moveX : -1 * moveX)) + 'px'\r\n } else {\r\n this._inner.style.transform = ''\r\n if (pushContent) this._sidebar.style.width = ''\r\n }\r\n }\r\n\r\n var t1 = 0\r\n $(document)\r\n .on('touchstart.sidebar-swipe', (e) => {\r\n var touches = e.originalEvent.changedTouches[0] || null\r\n if (!touches) return\r\n\r\n x1 = touches.pageX\r\n y1 = touches.pageY\r\n\r\n t1 = Date.now()\r\n isRTL = Util.isRTL()\r\n\r\n pushContent = this._sidebar.classList.contains('sidebar-push')\r\n if (pushContent) {\r\n sidebarWidth = this._sidebar.offsetWidth\r\n this._sidebar.style.minWidth = 'auto'\r\n this._sidebar.style.transition = 'none'\r\n }\r\n\r\n $(document)\r\n .on('touchmove.sidebar-swipe', (e) => {\r\n touchMoveCallback.call(this, e.originalEvent)\r\n })\r\n })\r\n .on('touchend.sidebar-swipe touchcancel.sidebar-swipe', (e) => {\r\n var touches = e.originalEvent.changedTouches[0] || null\r\n // if (!touches) return // in case we're coming from a `dismiss` mouseup event\r\n\r\n this._inner.setAttribute('style', '')\r\n if (pushContent) {\r\n this._sidebar.style.width = ''\r\n this._sidebar.style.minWidth = ''\r\n this._sidebar.style.transition = ''\r\n }\r\n\r\n var x2 = touches !== null ? touches.pageX : lastX\r\n var t2 = Date.now()\r\n\r\n if (swipeDir === 1 &&\r\n ( // dismiss if moved by more than 100px or moved more than 40px in a short time (less than 300ms)\r\n (!isRTL && (x1 - x2 > 100 || (x1 - x2 > 40 && t2 - t1 < 300))) || (isRTL && (x1 - x2 < -100 || (x1 - x2 < -40 && t2 - t1 < 300)))\r\n )\r\n ) { // if moved more than 100px or 40px in less than 300ms\r\n this.hide()\r\n } else {\r\n // remove '.mob-sidebarswipe-body' to bring back body scrollbars if sidebar isn't swiped to hide\r\n // but we probably won't have body scrollbars because of `.mob-sidebar-body`\r\n document.body.classList.remove('mob-sidebarswipe-body')\r\n }\r\n\r\n // bring back sidebar scrollbars\r\n if (this._scroller) this._scroller.classList.remove('overflow-hidden')\r\n\r\n swipeDir = 0\r\n })\r\n }\r\n\r\n enableSubmenuToggle () {\r\n var _firefox = 'MozAppearance' in document.documentElement.style\r\n var _scrollIntoViewOptions = 'scrollBehavior' in document.documentElement.style\r\n var isOpening = false\r\n\r\n var This = this\r\n $(this._sidebar).on('click', '.dropdown-toggle', function (ev) {\r\n ev.preventDefault()\r\n if (isOpening) return\r\n\r\n var navItem = $(this).closest('.nav-item')// get the parent LI.nav-item\r\n var subMenu = navItem.find('> .submenu').eq(0)// get the direct submenu (not the children)\r\n var navLink = navItem.find('> .nav-link').eq(0)// get the parent LI.nav-item\r\n\r\n var subPos = null\r\n if ((This._collapsed && This._sidebar.classList.contains('hoverable')) || This._sidebar.classList.contains('sidebar-hover')) {\r\n // don't toggle submenu if submenu is supposed to be displayed as popup (this includes horizontal sidebar when it's `.sidebar-hover`)\r\n subPos = window.getComputedStyle(subMenu.get(0)).position\r\n if (subPos === 'absolute') return\r\n }\r\n\r\n if (subMenu.hasClass('collapsing')) return// don't toggle in the middle of toggling\r\n\r\n // hide sibling submenus\r\n navItem.addClass('is-toggling')\r\n navItem.parent().find('> .nav-item.open').addClass('is-toggling').not(navItem).removeClass('open').find('> .submenu.show').collapse('hide')\r\n\r\n // toggle submenu\r\n if (navItem.hasClass('open')) {\r\n navItem.removeClass('open')\r\n navLink.addClass('collapsed')\r\n\r\n This._sidebar.classList.remove('has-open')\r\n subMenu.collapse('hide')\r\n } else {\r\n isOpening = true\r\n\r\n navItem.addClass('open')\r\n navLink.removeClass('collapsed')\r\n\r\n This._sidebar.classList.add('has-open')\r\n subMenu.collapse('show')\r\n }\r\n\r\n if (!subMenu.data('has-event')) {\r\n subMenu\r\n .data('has-event', true)\r\n .on('shown.bs.collapse.is-toggling hidden.bs.collapse.is-toggling', function () {\r\n isOpening = false\r\n $(This._sidebar).find('.is-toggling').removeClass('is-toggling')\r\n\r\n // firefox continues to disable scroll chaining when sidebar is not scrollable anymore, so a little fix around here\r\n if (_firefox) {\r\n if (This._scroller === null) return\r\n if (This._scroller.scrollHeight <= This._scroller.clientHeight) {\r\n This._scroller.style.overscrollBehavior = 'auto'\r\n } else This._scroller.style.overscrollBehavior = ''\r\n }\r\n })\r\n }\r\n\r\n // scroll submenu into view (only on modern browsers)\r\n if (_scrollIntoViewOptions && This._config.subscroll && This._sidebar.classList.contains('sidebar-fixed') && navItem.hasClass('open')) {\r\n if (This._sidebar.classList.contains(ClassName.HORIZONTAL)) {\r\n subPos = window.getComputedStyle(subMenu.get(0)).position\r\n if (subPos === 'absolute') return // no scroll for desktop horizontal menu (when it's not `.sidebar-hover`)\r\n }\r\n\r\n var smooth = !Util.isReducedMotion()\r\n setTimeout(function () {\r\n try {\r\n if (_scrollIntoViewOptions) {\r\n subMenu.get(0).scrollIntoView({\r\n behavior: smooth ? 'smooth' : 'auto',\r\n block: 'nearest'\r\n })\r\n } else {\r\n // subMenu.get(0).scrollIntoView(false)\r\n }\r\n } catch (err) {}\r\n }, smooth ? 150 : 0)\r\n }\r\n })\r\n }\r\n\r\n enableSubmenuPullup () {\r\n if (this._pullupEnabled) return\r\n this._pullupEnabled = true\r\n\r\n var marginProp = 'margin-' + (!Util.isRTL() ? 'left' : 'right')\r\n\r\n var This = this\r\n $(this._sidebar).on('transitionstart', '.submenu', function (ev) {\r\n if (ev.target !== this || ev.originalEvent.propertyName !== marginProp || !(This._collapsed || This._sidebar.classList.contains('sidebar-hover'))) return\r\n\r\n var navItem = $(this).parent()\r\n var submenu = $(this)\r\n\r\n var navtxt = navItem.find('> .nav-link > .nav-text.fadeable')// only first level nav-text items\r\n\r\n navItem.removeClass('submenu-pullup')\r\n submenu.css('transform', '')\r\n navtxt.css('transform', '')\r\n\r\n /// ///////////////////////\r\n\r\n var rect = submenu.get(0).getBoundingClientRect()\r\n var wh = $(window).height()\r\n\r\n var diff = parseInt(rect.bottom - wh)\r\n\r\n if (diff > 0) { // if submenu bottom is below window area\r\n // check to see if submenu top will go out of window if we move it up by \"diff\" pixels\r\n // also consider that the first level item's .nav-text shouldn't go out of window's top\r\n var navtxtHeight = navtxt.height() || 0\r\n\r\n var diff2 = rect.top - navtxtHeight - diff - $('.navbar').height()// don't go above navbar\r\n if (diff2 < 0) diff = diff + diff2\r\n\r\n diff = parseInt(diff) + 1// so that submenu's border is visible\r\n if (This._collapsed) {\r\n if (navtxtHeight && diff > navtxtHeight / 2) navItem.addClass('submenu-pullup')// this class makes the .sub-arrow's color white, to match submenu color\r\n } else {\r\n navItem.addClass('submenu-pullup')\r\n }\r\n\r\n submenu.css('transform', 'translateY(-' + diff + 'px)')\r\n if (This._collapsed) {\r\n navtxt.css('transform', 'translateY(-' + diff + 'px)')\r\n }\r\n }\r\n })\r\n }\r\n\r\n disableSubmenuPullup () {\r\n this._pullupEnabled = false\r\n $(this._sidebar).off('transitionstart.pullup')\r\n this._resetPullUp()\r\n }\r\n\r\n _resetPullUp () {\r\n $(this._sidebar).find('.submenu-pullup').removeClass('submenu-pullup').find('.nav-text, .submenu').css('transform', '')\r\n }\r\n\r\n // scroll active item into view\r\n scrollToActive () {\r\n if (!this._sidebar.classList.contains('sidebar-fixed') || this._scroller === null) return\r\n\r\n var active = this._sidebar.querySelector('.nav-item.active:not(.open) > .nav-link')\r\n try {\r\n active.scrollIntoView({ behavior: 'auto', block: 'end' })// or block: \"center\"?\r\n this._scroller.scrollTop = this._scroller.scrollTop + 30\r\n } catch (e) {}\r\n }\r\n\r\n _getConfig (config) {\r\n config = {\r\n ...Default,\r\n ...typeof config === 'object' && config ? config : {}\r\n }\r\n\r\n if (typeof bootstrap !== 'undefined') {\r\n bootstrap.Util.typeCheckConfig(\r\n NAME,\r\n config,\r\n this.constructor.DefaultType\r\n )\r\n }\r\n\r\n return config\r\n }\r\n\r\n // Static methods\r\n static _jQueryInterface (config) {\r\n return this.each(function () {\r\n const $this = $(this)\r\n let data = $this.data(DATA_KEY)\r\n\r\n const _config = {\r\n ...Default,\r\n ...$this.data(),\r\n ...typeof config === 'object' && config ? config : {}\r\n }\r\n\r\n if (!data) {\r\n data = new Sidebar(this, _config)\r\n $this.data(DATA_KEY, data)\r\n }\r\n\r\n if (typeof config === 'string') {\r\n if (typeof data[config] === 'undefined') {\r\n throw new TypeError(`No method named \"${config}\"`)\r\n }\r\n data[config]()\r\n }\r\n })\r\n }\r\n}\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Data Api implementation\r\n * ------------------------------------------------------------------------\r\n*/\r\n\r\n$(window).on(Event.LOAD_DATA_API, () => {\r\n const sidebars = [].slice.call(document.querySelectorAll(Selector.SIDEBAR))\r\n\r\n for (let i = 0; i < sidebars.length; i++) {\r\n const $sidebar = $(sidebars[i])\r\n Sidebar._jQueryInterface.call($sidebar, $sidebar.data())\r\n }\r\n})\r\n\r\n/**\r\n$(document).on(Event.CLICK_DATA_API, `${Selector.DATA_TOGGLE} , ${Selector.DATA_TOGGLE_MOBILE}`, function (event) {\r\n\tif (event.currentTarget.tagName === 'A') {\r\n\t event.preventDefault()\r\n\t}\r\n\r\n\tconst $trigger = $(this)\r\n\tconst selector = bootstrap.Util.getSelectorFromElement(this)\r\n\tconst selectors = [].slice.call(document.querySelectorAll(selector))\r\n\r\n\t$(selectors).each(function () {\r\n\t const $target = $(this)\r\n\t const data = $target.data(DATA_KEY)\r\n\t const config = data ? 'toggle' : $trigger.data()\r\n\t Sidebar._jQueryInterface.call($target, config)\r\n\t})\r\n})\r\n*/\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * jQuery\r\n * ------------------------------------------------------------------------\r\n*/\r\n\r\nif (typeof $ !== 'undefined') {\r\n const JQUERY_NO_CONFLICT = $.fn[NAME]\r\n $.fn[NAME] = Sidebar._jQueryInterface\r\n $.fn[NAME].Constructor = Sidebar\r\n $.fn[NAME].noConflict = () => {\r\n $.fn[NAME] = JQUERY_NO_CONFLICT\r\n return Sidebar._jQueryInterface\r\n }\r\n}\r\n\r\nexport default Sidebar\r\n","/**\r\n * --------------------------------------------------------------------------\r\n * Ace (v3.1.0): aside.js\r\n Aside element based on Bootstrap's modal\r\n*/\r\n\r\nimport $ from 'jquery'\r\nimport bootstrap from 'bootstrap'\r\nimport Util from './util'\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Constants\r\n * ------------------------------------------------------------------------\r\n */\r\n\r\nconst NAME = 'aceAside'\r\nconst VERSION = '3.1.0'\r\nconst DATA_KEY = 'ace.aside'\r\nconst EVENT_KEY = `.${DATA_KEY}`\r\n\r\nconst Event = {\r\n SHOW: `show${EVENT_KEY}`,\r\n HIDE: `hide${EVENT_KEY}`\r\n}\r\n\r\nconst DefaultType = {\r\n placement: 'string',\r\n // margin: 'number',\r\n\r\n fade: 'boolean',\r\n\r\n autohide: '(boolean|number)',\r\n dismiss: 'boolean',\r\n\r\n blocking: 'boolean',\r\n backdrop: '(boolean|string)',\r\n\r\n container: 'boolean',\r\n belowNav: 'boolean',\r\n aboveNav: 'boolean',\r\n\r\n width: '(boolean|number)',\r\n height: '(boolean|number)',\r\n\r\n scroll: '(boolean|string)'\r\n}\r\n\r\nconst Default = {\r\n placement: 'center',\r\n // margin: 0,\r\n\r\n fade: false,\r\n\r\n autohide: false,\r\n dismiss: false,\r\n\r\n blocking: false,\r\n backdrop: false,\r\n\r\n container: false,\r\n belowNav: false,\r\n aboveNav: false,\r\n\r\n width: false,\r\n height: false,\r\n\r\n scroll: 'body'\r\n}\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Class Definition\r\n * ------------------------------------------------------------------------\r\n */\r\n\r\nclass Aside {\r\n constructor (element, config) {\r\n this._config = this._getConfig(config)\r\n this._element = element\r\n this.$element = $(element)\r\n\r\n this._init(this._config)\r\n }\r\n\r\n static get VERSION () {\r\n return VERSION\r\n }\r\n\r\n static get DefaultType () {\r\n return DefaultType\r\n }\r\n\r\n static get Default () {\r\n return Default\r\n }\r\n\r\n _init (config) {\r\n this._setPlacement(config.placement)\r\n\r\n this._element.classList.add('ace-aside')\r\n\r\n if (!config.blocking) {\r\n this._element.classList.add('modal-nb')\r\n this.$element.attr('data-backdrop', 'false').data('backdrop', false)\r\n } else {\r\n if (config.backdrop) {\r\n this.$element.attr('data-backdrop-bg', config.backdrop)\r\n }\r\n this.$element.attr('data-backdrop', 'true').data('backdrop', true)\r\n }\r\n\r\n if (config.dismiss) this._element.classList.add('modal-dismiss')\r\n\r\n if (config.fade) {\r\n this._element.classList.add('aside-fade', 'fade')\r\n }\r\n\r\n if (config.belowNav) this._element.classList.add('aside-below-nav')\r\n if (config.aboveNav) this._element.classList.add('aside-above-nav')\r\n\r\n if (config.extraClass) this._element.classList.add(...config.extraClass.split(' '))\r\n\r\n if (config.container) {\r\n this._element.classList.add('container')\r\n var bdc = document.querySelector('.body-container')\r\n if (bdc !== null && bdc.classList.contains('container-plus')) {\r\n this._element.classList.add('container-plus')\r\n }\r\n }\r\n\r\n if (config.width) {\r\n this.$element.find('.modal-dialog').css('width', isNaN(config.width) ? config.width : this._config.width + 'px')\r\n }\r\n if (config.height) {\r\n this.$element.find('.modal-dialog').css('height', isNaN(config.height) ? config.height : this._config.height + 'px')\r\n }\r\n\r\n // if (/^(content|body)$/.test(config.scroll)) {\r\n // this.$element.find('.modal-content').addClass('scroll-' + config.scroll)\r\n // }\r\n\r\n this.$element.off('shown.bs.modal.autohide')\r\n if (config.autohide) {\r\n const This = this\r\n this.$element.on('shown.bs.modal.autohide', function () {\r\n setTimeout(function () {\r\n This.hide()\r\n }, config.autohide)\r\n })\r\n }\r\n }\r\n\r\n _setPlacement (placement = 'center') {\r\n const placementMap = {\r\n t: 'aside-top',\r\n top: 'aside-top',\r\n tc: 'aside-top aside-c',\r\n tr: 'aside-top aside-r',\r\n tl: 'aside-top aside-l',\r\n\r\n b: 'aside-bottom',\r\n bottom: 'aside-bottom',\r\n bc: 'aside-bottom aside-c',\r\n br: 'aside-bottom aside-r',\r\n bl: 'aside-bottom aside-l',\r\n\r\n r: 'aside-right',\r\n right: 'aside-right',\r\n rc: 'aside-right aside-m',\r\n\r\n l: 'aside-left',\r\n left: 'aside-left',\r\n lc: 'aside-left aside-m',\r\n\r\n c: 'aside-center',\r\n center: 'aside-center'\r\n }\r\n\r\n placement = placement || 'c'\r\n const className = placementMap[placement] || 'aside-center'\r\n if (placement === 'c' || placement === 'center') {\r\n this._config.fade = true\r\n this._element.classList.remove('container')\r\n }\r\n\r\n this._element.className = this._element.className + ' ' + className\r\n }\r\n\r\n // Public methods\r\n show () {\r\n const showEvent = new $.Event(Event.SHOW)\r\n this.$element.trigger(showEvent)\r\n if (showEvent.isDefaultPrevented()) {\r\n return\r\n }\r\n\r\n this.$element.modal('show')\r\n }\r\n\r\n hide () {\r\n const hideEvent = new $.Event(Event.HIDE)\r\n this.$element.trigger(hideEvent)\r\n if (hideEvent.isDefaultPrevented()) {\r\n return\r\n }\r\n\r\n this.$element.modal('hide')\r\n }\r\n\r\n // Private methods\r\n _getConfig (config) {\r\n config = {\r\n ...Default,\r\n ...typeof config === 'object' && config ? config : {}\r\n }\r\n\r\n if (typeof bootstrap !== 'undefined') {\r\n bootstrap.Util.typeCheckConfig(\r\n NAME,\r\n config,\r\n this.constructor.DefaultType\r\n )\r\n }\r\n\r\n return config\r\n }\r\n\r\n // Static methods\r\n static _jQueryInterface (config) {\r\n return this.each(function () {\r\n const $this = $(this)\r\n let data = $this.data(DATA_KEY)\r\n\r\n const _config = {\r\n ...Default,\r\n ...$(this).data(),\r\n ...typeof config === 'object' && config ? config : {}\r\n }\r\n\r\n if (!data) {\r\n data = new Aside(this, _config)\r\n $this.data(DATA_KEY, data)\r\n }\r\n\r\n if (typeof config === 'string') {\r\n if (typeof data[config] === 'undefined') {\r\n throw new TypeError(`No method named \"${config}\"`)\r\n }\r\n data[config]()\r\n }\r\n })\r\n }\r\n\r\n //\r\n static _HandleAside () {\r\n var visibleModalSelector = '.modal.show:not(.modal-nb)'\r\n var dismissEventId = 0\r\n\r\n $('.ace-aside.modal-nb').attr('data-backdrop', 'false').data('backdrop', false)\r\n\r\n $(document)\r\n .on('show.bs.modal', '.modal', function (e) {\r\n if (e.isDefaultPrevented()) return\r\n\r\n var modal = this\r\n if (modal.classList.contains('modal-nb')) {\r\n if ($(visibleModalSelector).length === 0) {\r\n document.body.classList.add('modal-nb')// disable .modal-open effects for .modal-nb\r\n }\r\n } else {\r\n if (!modal.classList.contains('ace-aside')) {\r\n // check to see if we will have modal scrollbars\r\n modal.style.display = 'block'\r\n if (modal.scrollHeight > modal.clientHeight) document.body.classList.add('modal-scroll')\r\n var scrollbars = Util.getScrollbarInfo()\r\n if (scrollbars.width === 0) document.body.classList.add('scrollbar-w0')\r\n modal.style.display = ''\r\n }\r\n\r\n // set modal padding value (equal to scrollbar width)\r\n document.body.style.setProperty('--modal-padding', (window.innerWidth - document.body.scrollWidth) + 'px')\r\n\r\n var isModalOff = modal.className.match(/modal-off(-[a-z0-9]*)?/i)\r\n\r\n var backdropBg = $(modal).attr('data-backdrop-bg')\r\n if (backdropBg || isModalOff) {\r\n setTimeout(function () {\r\n var backdrop = document.querySelector('.modal-backdrop:last-child')\r\n if (backdrop !== null) {\r\n if (backdropBg) backdrop.classList.add(backdropBg)\r\n\r\n // for example if our modal is a `.modal-off-lg` then we add `.d-lg-none` to `.modal-backdrop` to hide it in `lg+` view\r\n if (isModalOff) backdrop.classList.add(`d${isModalOff[1] || ''}-none`)\r\n }\r\n }, 0)\r\n }\r\n\r\n var blur = modal.getAttribute('data-blur')\r\n if (blur !== null && window.CSS) {\r\n /**\r\n // using `backdrop-filter` is less intrusive but doesn't have the same blur effect\r\n if (window.CSS.supports(\"backdrop-filter\", \"none\")) {\r\n setTimeout(function () {\r\n $('.modal-backdrop:last-child').addClass('modal-blur')\r\n }, 0)\r\n }\r\n else */\r\n if (window.CSS.supports('filter', 'none')) {\r\n var bodyContainer = document.querySelector('.body-container')\r\n if (bodyContainer !== null) {\r\n document.body.classList.add('modal-blur')\r\n bodyContainer.style.filter = 'blur(' + blur + ')'\r\n\r\n var modalParent = modal.parentNode\r\n var modalSibling = modal.nextSibling\r\n\r\n $(modal).appendTo('body').one('hidden.bs.modal.blur', function () {\r\n modalParent.insertBefore(modal, modalSibling)\r\n document.body.classList.remove('modal-blur')\r\n bodyContainer.style.filter = ''\r\n })\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .on('shown.bs.modal', '.modal', function (e) {\r\n var modal = this\r\n\r\n if (modal.classList.contains('modal-nb')) {\r\n document.body.classList.remove('modal-nb')\r\n\r\n if ($(visibleModalSelector).length === 0) { // if no blocking modals\r\n document.body.classList.remove('modal-open')// disable .modal-open effects\r\n document.body.style.paddingRight = ''// and remove paddingRight\r\n }\r\n\r\n if (modal.classList.contains('modal-dismiss') || modal.getAttribute('data-dismiss') === 'true') {\r\n // we add an extra ID to our event namespace\r\n // because sometimes before a dismissible modal is hidden inside the below setTimeout, another dismissible gets shown and registers the following event which gets\r\n // cleared in the on.hidden event below ... so we use different IDs for each one ...\r\n modal.setAttribute('data-dismiss-event-id', ++dismissEventId)\r\n $(document).on('mouseup.aside-dismiss.' + dismissEventId, function (e) {\r\n // why mouseup? because 'click' may get 'stopPropagated' in some plugins such as Bootstrap's dropdown\r\n if (!$.contains(modal, e.target)) { // clicked outside modal\r\n // why timeout?\r\n // because if we click on the same button that triggers this modal, its 'hide' function will be called and instantly followed by 'show' function\r\n // so we first let 'show' be called and then we call 'hide'\r\n setTimeout(function () {\r\n $(modal).modal('hide')\r\n }, 0)\r\n }\r\n })\r\n }\r\n }\r\n })\r\n .on('hidden.bs.modal', '.modal', function () {\r\n if ($(visibleModalSelector).length === 0) document.body.style.paddingRight = ''// required for rare cases that body padding is still not cleared\r\n else document.body.classList.add('modal-open') // sometimes an aside is closed (so .modal-open is removed) but a .modal is still open (so we add .modal-open again)\r\n\r\n if (!this.classList.contains('modal-nb')) {\r\n document.body.classList.remove('modal-scroll')\r\n document.body.classList.remove('scrollbar-w0')\r\n }\r\n\r\n // we might have dismissed modal dialog using the close button inside it, so we turn off the events looking for clicks outside modal\r\n if (this.classList.contains('modal-dismiss') || this.getAttribute('data-dismiss') === 'true') {\r\n var eid = this.getAttribute('data-dismiss-event-id')\r\n $(document).off('.aside-dismiss.' + eid)\r\n }\r\n })\r\n\r\n // enable modal functionality for modal boxes and asides that are shown (.show) by default\r\n $('.modal.show').modal('show')\r\n }\r\n}\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * jQuery\r\n * ------------------------------------------------------------------------\r\n*/\r\n\r\nif (typeof $ !== 'undefined') {\r\n Aside._HandleAside()\r\n\r\n const JQUERY_NO_CONFLICT = $.fn[NAME]\r\n $.fn[NAME] = Aside._jQueryInterface\r\n $.fn[NAME].Constructor = Aside\r\n $.fn[NAME].noConflict = () => {\r\n $.fn[NAME] = JQUERY_NO_CONFLICT\r\n return Aside._jQueryInterface\r\n }\r\n}\r\n\r\nexport default Aside\r\n","/**\r\n * --------------------------------------------------------------------------\r\n * Ace (v3.1.0): toaster.js\r\n Wrapper for Bootstrap's toast elements\r\n*/\r\n\r\nimport $ from 'jquery'\r\nimport bootstrap from 'bootstrap'\r\n\r\n/**\r\n * ------------------------------------------------------------------------\r\n * Constants\r\n * ------------------------------------------------------------------------\r\n */\r\n\r\nconst NAME = 'aceToaster'\r\nconst VERSION = '3.1.0'\r\nconst DATA_KEY = 'ace.toaster'\r\nconst EVENT_KEY = `.${DATA_KEY}`\r\n\r\nconst Event = {\r\n CLEAR: `clear${EVENT_KEY}`,\r\n ADD: `add${EVENT_KEY}`,\r\n ADDED: `added${EVENT_KEY}`\r\n}\r\n\r\nconst DefaultType = {\r\n placement: 'string',\r\n close: 'boolean',\r\n autoremove: 'boolean',\r\n delay: 'number',\r\n template: 'string',\r\n alert: 'boolean'\r\n}\r\n\r\nconst Default = {\r\n placement: 'tr',\r\n close: true,\r\n autoremove: true,\r\n delay: 2500,\r\n template: '