{"version":3,"file":"tab.js","sources":["../src/util/index.js","../src/tab.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-beta2): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nconst toType = obj => {\n if (obj === null || obj === undefined) {\n return `${obj}`\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID)\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-bs-target')\n\n if (!selector || selector === '#') {\n let hrefAttr = element.getAttribute('href')\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttr || (!hrefAttr.includes('#') && !hrefAttr.startsWith('.'))) {\n return null\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {\n hrefAttr = '#' + hrefAttr.split('#')[1]\n }\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null\n }\n\n return selector\n}\n\nconst getSelectorFromElement = element => {\n const selector = getSelector(element)\n\n if (selector) {\n return document.querySelector(selector) ? selector : null\n }\n\n return null\n}\n\nconst getElementFromSelector = element => {\n const selector = getSelector(element)\n\n return selector ? document.querySelector(selector) : null\n}\n\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } = window.getComputedStyle(element)\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration)\n const floatTransitionDelay = Number.parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = obj => (obj[0] || obj).nodeType\n\nconst emulateTransitionEnd = (element, duration) => {\n let called = false\n const durationPadding = 5\n const emulatedDuration = duration + durationPadding\n\n function listener() {\n called = true\n element.removeEventListener(TRANSITION_END, listener)\n }\n\n element.addEventListener(TRANSITION_END, listener)\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(element)\n }\n }, emulatedDuration)\n}\n\nconst typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes).forEach(property => {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`\n )\n }\n })\n}\n\nconst isVisible = element => {\n if (!element) {\n return false\n }\n\n if (element.style && element.parentNode && element.parentNode.style) {\n const elementStyle = getComputedStyle(element)\n const parentNodeStyle = getComputedStyle(element.parentNode)\n\n return elementStyle.display !== 'none' &&\n parentNodeStyle.display !== 'none' &&\n elementStyle.visibility !== 'hidden'\n }\n\n return false\n}\n\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => function () {}\n\nconst reflow = element => element.offsetHeight\n\nconst getjQuery = () => {\n const { jQuery } = window\n\n if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return jQuery\n }\n\n return null\n}\n\nconst onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', callback)\n } else {\n callback()\n }\n}\n\nconst isRTL = document.documentElement.dir === 'rtl'\n\nconst defineJQueryPlugin = (name, plugin) => {\n onDOMContentLoaded(() => {\n const $ = getjQuery()\n /* istanbul ignore if */\n if ($) {\n const JQUERY_NO_CONFLICT = $.fn[name]\n $.fn[name] = plugin.jQueryInterface\n $.fn[name].Constructor = plugin\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT\n return plugin.jQueryInterface\n }\n }\n })\n}\n\nexport {\n getUID,\n getSelectorFromElement,\n getElementFromSelector,\n getTransitionDurationFromElement,\n triggerTransitionEnd,\n isElement,\n emulateTransitionEnd,\n typeCheckConfig,\n isVisible,\n findShadowRoot,\n noop,\n reflow,\n getjQuery,\n onDOMContentLoaded,\n isRTL,\n defineJQueryPlugin\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-beta2): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n defineJQueryPlugin,\n emulateTransitionEnd,\n getElementFromSelector,\n getTransitionDurationFromElement,\n reflow\n} from './util/index'\nimport Data from './dom/data'\nimport EventHandler from './dom/event-handler'\nimport SelectorEngine from './dom/selector-engine'\nimport BaseComponent from './base-component'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tab'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\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 = ':scope > li > .active'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"tab\"], [data-bs-toggle=\"pill\"], [data-bs-toggle=\"list\"]'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\nconst SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tab extends BaseComponent {\n // Getters\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n // Public\n\n show() {\n if ((this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n this._element.classList.contains(CLASS_NAME_ACTIVE)) ||\n this._element.classList.contains(CLASS_NAME_DISABLED)) {\n return\n }\n\n let previous\n const target = getElementFromSelector(this._element)\n const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP)\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE\n previous = SelectorEngine.find(itemSelector, listElement)\n previous = previous[previous.length - 1]\n }\n\n const hideEvent = previous ?\n EventHandler.trigger(previous, EVENT_HIDE, {\n relatedTarget: this._element\n }) :\n null\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {\n relatedTarget: previous\n })\n\n if (showEvent.defaultPrevented || (hideEvent !== null && hideEvent.defaultPrevented)) {\n return\n }\n\n this._activate(this._element, listElement)\n\n const complete = () => {\n EventHandler.trigger(previous, EVENT_HIDDEN, {\n relatedTarget: this._element\n })\n EventHandler.trigger(this._element, EVENT_SHOWN, {\n relatedTarget: previous\n })\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n // Private\n\n _activate(element, container, callback) {\n const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ?\n SelectorEngine.find(SELECTOR_ACTIVE_UL, container) :\n SelectorEngine.children(container, SELECTOR_ACTIVE)\n\n const active = activeElements[0]\n const isTransitioning = callback && (active && active.classList.contains(CLASS_NAME_FADE))\n\n const complete = () => this._transitionComplete(element, active, callback)\n\n if (active && isTransitioning) {\n const transitionDuration = getTransitionDurationFromElement(active)\n active.classList.remove(CLASS_NAME_SHOW)\n\n EventHandler.one(active, 'transitionend', complete)\n emulateTransitionEnd(active, transitionDuration)\n } else {\n complete()\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n active.classList.remove(CLASS_NAME_ACTIVE)\n\n const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode)\n\n if (dropdownChild) {\n dropdownChild.classList.remove(CLASS_NAME_ACTIVE)\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false)\n }\n }\n\n element.classList.add(CLASS_NAME_ACTIVE)\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true)\n }\n\n 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.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {\n const dropdownElement = element.closest(SELECTOR_DROPDOWN)\n\n if (dropdownElement) {\n SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE)\n .forEach(dropdown => dropdown.classList.add(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 data = Data.getData(this, DATA_KEY) || new Tab(this)\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n event.preventDefault()\n\n const data = Data.getData(this, DATA_KEY) || new Tab(this)\n data.show()\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Tab to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(NAME, Tab)\n\nexport default Tab\n"],"names":["MILLISECONDS_MULTIPLIER","TRANSITION_END","getSelector","element","selector","getAttribute","hrefAttr","includes","startsWith","split","trim","getElementFromSelector","document","querySelector","getTransitionDurationFromElement","window","getComputedStyle","transitionDuration","transitionDelay","floatTransitionDuration","Number","parseFloat","floatTransitionDelay","triggerTransitionEnd","dispatchEvent","Event","emulateTransitionEnd","duration","called","durationPadding","emulatedDuration","listener","removeEventListener","addEventListener","setTimeout","reflow","offsetHeight","getjQuery","jQuery","body","hasAttribute","onDOMContentLoaded","callback","readyState","documentElement","dir","defineJQueryPlugin","name","plugin","$","JQUERY_NO_CONFLICT","fn","jQueryInterface","Constructor","noConflict","NAME","DATA_KEY","EVENT_KEY","DATA_API_KEY","EVENT_HIDE","EVENT_HIDDEN","EVENT_SHOW","EVENT_SHOWN","EVENT_CLICK_DATA_API","CLASS_NAME_DROPDOWN_MENU","CLASS_NAME_ACTIVE","CLASS_NAME_DISABLED","CLASS_NAME_FADE","CLASS_NAME_SHOW","SELECTOR_DROPDOWN","SELECTOR_NAV_LIST_GROUP","SELECTOR_ACTIVE","SELECTOR_ACTIVE_UL","SELECTOR_DATA_TOGGLE","SELECTOR_DROPDOWN_TOGGLE","SELECTOR_DROPDOWN_ACTIVE_CHILD","Tab","show","_element","parentNode","nodeType","Node","ELEMENT_NODE","classList","contains","previous","target","listElement","closest","itemSelector","nodeName","SelectorEngine","find","length","hideEvent","EventHandler","trigger","relatedTarget","showEvent","defaultPrevented","_activate","complete","container","activeElements","children","active","isTransitioning","_transitionComplete","remove","one","dropdownChild","findOne","setAttribute","add","dropdownElement","forEach","dropdown","config","each","data","Data","getData","TypeError","BaseComponent","on","event","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EAGA,IAAMA,uBAAuB,GAAG,IAAhC;EACA,IAAMC,cAAc,GAAG,eAAvB;;EAyBA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAAAC,OAAO,EAAI;EAC7B,MAAIC,QAAQ,GAAGD,OAAO,CAACE,YAAR,CAAqB,gBAArB,CAAf;;EAEA,MAAI,CAACD,QAAD,IAAaA,QAAQ,KAAK,GAA9B,EAAmC;EACjC,QAAIE,QAAQ,GAAGH,OAAO,CAACE,YAAR,CAAqB,MAArB,CAAf,CADiC;EAIjC;EACA;EACA;;EACA,QAAI,CAACC,QAAD,IAAc,CAACA,QAAQ,CAACC,QAAT,CAAkB,GAAlB,CAAD,IAA2B,CAACD,QAAQ,CAACE,UAAT,CAAoB,GAApB,CAA9C,EAAyE;EACvE,aAAO,IAAP;EACD,KATgC;;;EAYjC,QAAIF,QAAQ,CAACC,QAAT,CAAkB,GAAlB,KAA0B,CAACD,QAAQ,CAACE,UAAT,CAAoB,GAApB,CAA/B,EAAyD;EACvDF,MAAAA,QAAQ,GAAG,MAAMA,QAAQ,CAACG,KAAT,CAAe,G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