{"version":3,"file":"tab.min.js","sources":["https:\/\/hivtrainingcdu.remote-learner.net\/theme\/boost\/amd\/src\/bootstrap\/tab.js"],"sourcesContent":["\/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.5.0): tab.js\n * Licensed under MIT (https:\/\/github.com\/twbs\/bootstrap\/blob\/master\/LICENSE)\n * --------------------------------------------------------------------------\n *\/\n\nimport $ from 'jquery'\nimport Util from '.\/util'\n\n\/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n *\/\n\nconst NAME = 'tab'\nconst VERSION = '4.5.0'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_DISABLED = 'disabled'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\nconst SELECTOR_DROPDOWN = '.dropdown'\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_ACTIVE_UL = '> li > .active'\nconst SELECTOR_DATA_TOGGLE = '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\nconst SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'\n\n\/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n *\/\n\nclass Tab {\n constructor(element) {\n this._element = element\n }\n\n \/\/ Getters\n\n static get VERSION() {\n return VERSION\n }\n\n \/\/ Public\n\n show() {\n if (this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n $(this._element).hasClass(CLASS_NAME_ACTIVE) ||\n $(this._element).hasClass(CLASS_NAME_DISABLED)) {\n return\n }\n\n let target\n let previous\n const listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]\n const selector = Util.getSelectorFromElement(this._element)\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE\n previous = $.makeArray($(listElement).find(itemSelector))\n previous = previous[previous.length - 1]\n }\n\n const hideEvent = $.Event(EVENT_HIDE, {\n relatedTarget: this._element\n })\n\n const showEvent = $.Event(EVENT_SHOW, {\n relatedTarget: previous\n })\n\n if (previous) {\n $(previous).trigger(hideEvent)\n }\n\n $(this._element).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented() ||\n hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n this._activate(\n this._element,\n listElement\n )\n\n const complete = () => {\n const hiddenEvent = $.Event(EVENT_HIDDEN, {\n relatedTarget: this._element\n })\n\n const shownEvent = $.Event(EVENT_SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n \/\/ Private\n\n _activate(element, container, callback) {\n const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')\n ? $(container).find(SELECTOR_ACTIVE_UL)\n : $(container).children(SELECTOR_ACTIVE)\n\n const active = activeElements[0]\n const isTransitioning = callback && (active && $(active).hasClass(CLASS_NAME_FADE))\n const complete = () => this._transitionComplete(\n element,\n active,\n callback\n )\n\n if (active && isTransitioning) {\n const transitionDuration = Util.getTransitionDurationFromElement(active)\n\n $(active)\n .removeClass(CLASS_NAME_SHOW)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n $(active).removeClass(CLASS_NAME_ACTIVE)\n\n const dropdownChild = $(active.parentNode).find(\n SELECTOR_DROPDOWN_ACTIVE_CHILD\n )[0]\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(CLASS_NAME_ACTIVE)\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false)\n }\n }\n\n $(element).addClass(CLASS_NAME_ACTIVE)\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true)\n }\n\n Util.reflow(element)\n\n if (element.classList.contains(CLASS_NAME_FADE)) {\n element.classList.add(CLASS_NAME_SHOW)\n }\n\n if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {\n const dropdownElement = $(element).closest(SELECTOR_DROPDOWN)[0]\n\n if (dropdownElement) {\n const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE))\n\n $(dropdownToggleList).addClass(CLASS_NAME_ACTIVE)\n }\n\n element.setAttribute('aria-expanded', true)\n }\n\n if (callback) {\n callback()\n }\n }\n\n \/\/ Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = new Tab(this)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n\/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n *\/\n\n$(document)\n .on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n event.preventDefault()\n Tab._jQueryInterface.call($(this), 'show')\n })\n\n\/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n *\/\n\n$.fn[NAME] = Tab._jQueryInterface\n$.fn[NAME].Constructor = Tab\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab._jQueryInterface\n}\n\nexport default Tab\n"],"names":["EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","EVENT_HIDE","EVENT_HIDDEN","EVENT_SHOW","EVENT_SHOWN","EVENT_CLICK_DATA_API","Tab","element","_element","config","this","each","$this","data","TypeError","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","itemSelector","nodeName","makeArray","find","length","hideEvent","Event","relatedTarget","showEvent","trigger","isDefaultPrevented","document","querySelector","_activate","complete","hiddenEvent","_this","shownEvent","removeData","container","callback","active","children","isTransitioning","_this2","_transitionComplete","transitionDuration","getTransitionDurationFromElement","removeClass","one","TRANSITION_END","emulateTransitionEnd","dropdownChild","getAttribute","setAttribute","addClass","reflow","classList","contains","add","dropdownElement","dropdownToggleList","slice","call","querySelectorAll","on","event","preventDefault","_jQueryInterface","Constructor","noConflict"],"mappings":"ymBAmBMA,qBADqB,UAGrBC,mBAAqBC,gBAAEC,GAAF,IAErBC,yBAA8BJ,WAC9BK,6BAAgCL,WAChCM,yBAA8BN,WAC9BO,2BAA+BP,WAC\/BQ,oCAA+BR,kBAPV,aA6BrBS,4BACQC,wJACLC,SAAWD,sGAKlB,iBAvCyB,wCA+LzB,SAAwBE,eACfC,KAAKC,MAAK,eACTC,OAAQ,mBAAEF,MACZG,KAAOD,MAAMC,KAjMI,aAmMhBA,OACHA,KAAO,IAAIP,IAAII,MACfE,MAAMC,KArMa,SAqMEA,OAGD,iBAAXJ,OAAqB,SACF,IAAjBI,KAAKJ,cACR,IAAIK,qCAA8BL,aAE1CI,KAAKJ,gDAhKX,+BACMC,KAAKF,SAASO,YACdL,KAAKF,SAASO,WAAWC,W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