{"version":3,"file":"button.min.js","sources":["https:\/\/hivtrainingcdu.remote-learner.net\/theme\/boost\/amd\/src\/bootstrap\/button.js"],"sourcesContent":["\/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.5.0): button.js\n * Licensed under MIT (https:\/\/github.com\/twbs\/bootstrap\/blob\/master\/LICENSE)\n * --------------------------------------------------------------------------\n *\/\n\nimport $ from 'jquery'\n\n\/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n *\/\n\nconst NAME = 'button'\nconst VERSION = '4.5.0'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_BUTTON = 'btn'\nconst CLASS_NAME_FOCUS = 'focus'\n\nconst SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^=\"button\"]'\nconst SELECTOR_DATA_TOGGLES = '[data-toggle=\"buttons\"]'\nconst SELECTOR_DATA_TOGGLE = '[data-toggle=\"button\"]'\nconst SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle=\"buttons\"] .btn'\nconst SELECTOR_INPUT = 'input:not([type=\"hidden\"])'\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_BUTTON = '.btn'\n\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_FOCUS_BLUR_DATA_API = `focus${EVENT_KEY}${DATA_API_KEY} ` +\n `blur${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\n\/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n *\/\n\nclass Button {\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 toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n const rootElement = $(this._element).closest(\n SELECTOR_DATA_TOGGLES\n )[0]\n\n if (rootElement) {\n const input = this._element.querySelector(SELECTOR_INPUT)\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked &&\n this._element.classList.contains(CLASS_NAME_ACTIVE)) {\n triggerChangeEvent = false\n } else {\n const activeElement = rootElement.querySelector(SELECTOR_ACTIVE)\n\n if (activeElement) {\n $(activeElement).removeClass(CLASS_NAME_ACTIVE)\n }\n }\n }\n\n if (triggerChangeEvent) {\n \/\/ if it's not a radio button or checkbox don't add a pointless\/invalid checked property to the input\n if (input.type === 'checkbox' || input.type === 'radio') {\n input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE)\n }\n $(input).trigger('change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n }\n\n if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !this._element.classList.contains(CLASS_NAME_ACTIVE))\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(CLASS_NAME_ACTIVE)\n }\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n \/\/ Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'toggle') {\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_CARROT, (event) => {\n let button = event.target\n const initialButton = button\n\n if (!$(button).hasClass(CLASS_NAME_BUTTON)) {\n button = $(button).closest(SELECTOR_BUTTON)[0]\n }\n\n if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {\n event.preventDefault() \/\/ work around Firefox bug #1540995\n } else {\n const inputBtn = button.querySelector(SELECTOR_INPUT)\n\n if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {\n event.preventDefault() \/\/ work around Firefox bug #1540995\n return\n }\n\n if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') {\n event.preventDefault() \/\/ work around event sent to label and input\n }\n Button._jQueryInterface.call($(button), 'toggle')\n }\n })\n .on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, (event) => {\n const button = $(event.target).closest(SELECTOR_BUTTON)[0]\n $(button).toggleClass(CLASS_NAME_FOCUS, \/^focus(in)?$\/.test(event.type))\n })\n\n$(window).on(EVENT_LOAD_DATA_API, () => {\n \/\/ ensure correct active class is set to match the controls' actual values\/states\n\n \/\/ find all checkboxes\/readio buttons inside data-toggle groups\n let buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS))\n for (let i = 0, len = buttons.length; i < len; i++) {\n const button = buttons[i]\n const input = button.querySelector(SELECTOR_INPUT)\n if (input.checked || input.hasAttribute('checked')) {\n button.classList.add(CLASS_NAME_ACTIVE)\n } else {\n button.classList.remove(CLASS_NAME_ACTIVE)\n }\n }\n\n \/\/ find all button toggles\n buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))\n for (let i = 0, len = buttons.length; i < len; i++) {\n const button = buttons[i]\n if (button.getAttribute('aria-pressed') === 'true') {\n button.classList.add(CLASS_NAME_ACTIVE)\n } else {\n button.classList.remove(CLASS_NAME_ACTIVE)\n }\n }\n})\n\n\/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n *\/\n\n$.fn[NAME] = Button._jQueryInterface\n$.fn[NAME].Constructor = Button\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n}\n\nexport default Button\n"],"names":["NAME","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","EVENT_CLICK_DATA_API","EVENT_FOCUS_BLUR_DATA_API","EVENT_LOAD_DATA_API","Button","element","_element","config","this","each","data","triggerChangeEvent","addAriaPressed","rootElement","closest","input","querySelector","type","checked","classList","contains","activeElement","removeClass","trigger","focus","hasAttribute","setAttribute","toggleClass","removeData","document","on","event","button","target","initialButton","hasClass","preventDefault","inputBtn","tagName","_jQueryInterface","call","test","window","buttons","slice","querySelectorAll","i","len","length","add","remove","getAttribute","Constructor","noConflict"],"mappings":"+fAeMA,KAAsB,SAGtBC,qBADsB,aAGtBC,mBAAsBC,gBAAEC,GAAGJ,MAc3BK,oCAAoCJ,kBAfd,aAgBtBK,0BAA4B,eAAQL,kBAhBd,+BAiBKA,kBAjBL,aAkBtBM,kCAAmCN,kBAlBb,aA0BtBO,kCACQC,2JACLC,SAAWD,yGAKlB,iBApC0B,wCAkG1B,SAAwBE,eACfC,KAAKC,MAAK,eACXC,MAAO,mBAAEF,MAAME,KAnGG,aAqGjBA,OACHA,KAAO,IAAIN,OAAOI,0BAChBA,MAAME,KAvGY,YAuGGA,OAGV,WAAXH,QACFG,KAAKH,iDAlEX,eACMI,oBAAqB,EACrBC,gBAAiB,EACfC,aAAc,mBAAEL,KAAKF,UAAUQ,QAlCH,2BAoChC,MAEED,YAAa,KACTE,MAAQP,KAAKF,SAASU,cApCI,iCAsC5BD,MAAO,IACU,UAAfA,MAAME,QACJF,MAAMG,SACRV,KAAKF,SAASa,UAAUC,SAjDV,UAkDdT,oBAAqB,MAChB,KACCU,cAAgBR,YAAYG,cA3CR,WA6CtBK,mCACAA,eAAeC,YAvDL,UA4DdX,qBAEiB,aAAfI,MAAME,MAAsC,UAAfF,MAAME,OACrCF,MAAMG,SAAWV,KAAKF,SAASa,UAAUC,SA\/D3B,+BAiEdL,OAAOQ,QAAQ,WAGnBR,MAAMS,QACNZ,gBAAiB,GAIfJ,KAAKF,SAASmB,aAAa,aAAejB,KAAKF,SAASa,UAAUC,SAAS,cAC3ER,qBACGN,SAASoB,aAAa,gBACxBlB,KAAKF,SAASa,UAAU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