1{"version":3,"sources":["../../src/bootstrap/tab.js"],"names":["DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","EVENT_HIDE","EVENT_HIDDEN","EVENT_SHOW","EVENT_SHOWN","EVENT_CLICK_DATA_API","CLASS_NAME_ACTIVE","CLASS_NAME_FADE","CLASS_NAME_SHOW","SELECTOR_ACTIVE","SELECTOR_ACTIVE_UL","Tab","element","_element","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","shownEvent","removeData","container","callback","activeElements","children","active","isTransitioning","_transitionComplete","transitionDuration","getTransitionDurationFromElement","removeClass","one","TRANSITION_END","emulateTransitionEnd","dropdownChild","getAttribute","setAttribute","addClass","reflow","classList","contains","add","dropdownElement","dropdownToggleList","slice","call","querySelectorAll","config","each","$this","data","TypeError","on","event","preventDefault","_jQueryInterface","Constructor","noConflict"],"mappings":"iKAOA,OACA,O,uXAUMA,CAAAA,CAAQ,CAAa,Q,CACrBC,CAAS,YAAgBD,CAAhB,C,CAETE,CAAkB,CAAGC,UAAEC,EAAF,I,CAErBC,CAAU,eAAoBJ,CAApB,C,CACVK,CAAY,iBAAoBL,CAApB,C,CACZM,CAAU,eAAoBN,CAApB,C,CACVO,CAAW,gBAAoBP,CAApB,C,CACXQ,CAAoB,gBAAWR,CAAX,SAPC,WAOD,C,CAGpBS,CAAiB,CAAU,Q,CAE3BC,CAAe,CAAY,M,CAC3BC,CAAe,CAAY,M,CAI3BC,CAAe,CAAkB,S,CACjCC,CAAkB,CAAe,gB,CAWjCC,C,YACJ,WAAYC,CAAZ,CAAqB,WACnB,KAAKC,QAAL,CAAgBD,CACjB,C,sCAUM,YACL,GAAI,KAAKC,QAAL,CAAcC,UAAd,EACA,KAAKD,QAAL,CAAcC,UAAd,CAAyBC,QAAzB,GAAsCC,IAA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CAAwB,UAAM,CAC5BjF,UAAEC,EAAF,KAAaF,CAAb,CACA,MAAOa,CAAAA,CAAG,CAACmE,gBACZ,CAHD,C,UAKenE,C","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"],"file":"tab.min.js"}