bootstrap.js 123 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249
  1. /*!
  2. * Bootstrap v4.2.1 (https://getbootstrap.com/)
  3. * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('popper.js'), require('jquery')) :
  8. typeof define === 'function' && define.amd ? define(['exports', 'popper.js', 'jquery'], factory) :
  9. (factory((global.bootstrap = {}),global.Popper,global.jQuery));
  10. }(this, (function (exports,Popper,$) { 'use strict';
  11. Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
  12. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _defineProperty(obj, key, value) {
  28. if (key in obj) {
  29. Object.defineProperty(obj, key, {
  30. value: value,
  31. enumerable: true,
  32. configurable: true,
  33. writable: true
  34. });
  35. } else {
  36. obj[key] = value;
  37. }
  38. return obj;
  39. }
  40. function _objectSpread(target) {
  41. for (var i = 1; i < arguments.length; i++) {
  42. var source = arguments[i] != null ? arguments[i] : {};
  43. var ownKeys = Object.keys(source);
  44. if (typeof Object.getOwnPropertySymbols === 'function') {
  45. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  46. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  47. }));
  48. }
  49. ownKeys.forEach(function (key) {
  50. _defineProperty(target, key, source[key]);
  51. });
  52. }
  53. return target;
  54. }
  55. function _inheritsLoose(subClass, superClass) {
  56. subClass.prototype = Object.create(superClass.prototype);
  57. subClass.prototype.constructor = subClass;
  58. subClass.__proto__ = superClass;
  59. }
  60. /**
  61. * --------------------------------------------------------------------------
  62. * Bootstrap (v4.2.1): util.js
  63. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  64. * --------------------------------------------------------------------------
  65. */
  66. /**
  67. * ------------------------------------------------------------------------
  68. * Private TransitionEnd Helpers
  69. * ------------------------------------------------------------------------
  70. */
  71. var TRANSITION_END = 'transitionend';
  72. var MAX_UID = 1000000;
  73. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  74. function toType(obj) {
  75. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  76. }
  77. function getSpecialTransitionEndEvent() {
  78. return {
  79. bindType: TRANSITION_END,
  80. delegateType: TRANSITION_END,
  81. handle: function handle(event) {
  82. if ($(event.target).is(this)) {
  83. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  84. }
  85. return undefined; // eslint-disable-line no-undefined
  86. }
  87. };
  88. }
  89. function transitionEndEmulator(duration) {
  90. var _this = this;
  91. var called = false;
  92. $(this).one(Util.TRANSITION_END, function () {
  93. called = true;
  94. });
  95. setTimeout(function () {
  96. if (!called) {
  97. Util.triggerTransitionEnd(_this);
  98. }
  99. }, duration);
  100. return this;
  101. }
  102. function setTransitionEndSupport() {
  103. $.fn.emulateTransitionEnd = transitionEndEmulator;
  104. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  105. }
  106. /**
  107. * --------------------------------------------------------------------------
  108. * Public Util Api
  109. * --------------------------------------------------------------------------
  110. */
  111. var Util = {
  112. TRANSITION_END: 'bsTransitionEnd',
  113. getUID: function getUID(prefix) {
  114. do {
  115. // eslint-disable-next-line no-bitwise
  116. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  117. } while (document.getElementById(prefix));
  118. return prefix;
  119. },
  120. getSelectorFromElement: function getSelectorFromElement(element) {
  121. var selector = element.getAttribute('data-target');
  122. if (!selector || selector === '#') {
  123. var hrefAttr = element.getAttribute('href');
  124. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  125. }
  126. return selector && document.querySelector(selector) ? selector : null;
  127. },
  128. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  129. if (!element) {
  130. return 0;
  131. } // Get transition-duration of the element
  132. var transitionDuration = $(element).css('transition-duration');
  133. var transitionDelay = $(element).css('transition-delay');
  134. var floatTransitionDuration = parseFloat(transitionDuration);
  135. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  136. if (!floatTransitionDuration && !floatTransitionDelay) {
  137. return 0;
  138. } // If multiple durations are defined, take the first
  139. transitionDuration = transitionDuration.split(',')[0];
  140. transitionDelay = transitionDelay.split(',')[0];
  141. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  142. },
  143. reflow: function reflow(element) {
  144. return element.offsetHeight;
  145. },
  146. triggerTransitionEnd: function triggerTransitionEnd(element) {
  147. $(element).trigger(TRANSITION_END);
  148. },
  149. // TODO: Remove in v5
  150. supportsTransitionEnd: function supportsTransitionEnd() {
  151. return Boolean(TRANSITION_END);
  152. },
  153. isElement: function isElement(obj) {
  154. return (obj[0] || obj).nodeType;
  155. },
  156. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  157. for (var property in configTypes) {
  158. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  159. var expectedTypes = configTypes[property];
  160. var value = config[property];
  161. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  162. if (!new RegExp(expectedTypes).test(valueType)) {
  163. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  164. }
  165. }
  166. }
  167. },
  168. findShadowRoot: function findShadowRoot(element) {
  169. if (!document.documentElement.attachShadow) {
  170. return null;
  171. } // Can find the shadow root otherwise it'll return the document
  172. if (typeof element.getRootNode === 'function') {
  173. var root = element.getRootNode();
  174. return root instanceof ShadowRoot ? root : null;
  175. }
  176. if (element instanceof ShadowRoot) {
  177. return element;
  178. } // when we don't find a shadow root
  179. if (!element.parentNode) {
  180. return null;
  181. }
  182. return Util.findShadowRoot(element.parentNode);
  183. }
  184. };
  185. setTransitionEndSupport();
  186. /**
  187. * ------------------------------------------------------------------------
  188. * Constants
  189. * ------------------------------------------------------------------------
  190. */
  191. var NAME = 'alert';
  192. var VERSION = '4.2.1';
  193. var DATA_KEY = 'bs.alert';
  194. var EVENT_KEY = "." + DATA_KEY;
  195. var DATA_API_KEY = '.data-api';
  196. var JQUERY_NO_CONFLICT = $.fn[NAME];
  197. var Selector = {
  198. DISMISS: '[data-dismiss="alert"]'
  199. };
  200. var Event = {
  201. CLOSE: "close" + EVENT_KEY,
  202. CLOSED: "closed" + EVENT_KEY,
  203. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  204. };
  205. var ClassName = {
  206. ALERT: 'alert',
  207. FADE: 'fade',
  208. SHOW: 'show'
  209. /**
  210. * ------------------------------------------------------------------------
  211. * Class Definition
  212. * ------------------------------------------------------------------------
  213. */
  214. };
  215. var Alert =
  216. /*#__PURE__*/
  217. function () {
  218. function Alert(element) {
  219. this._element = element;
  220. } // Getters
  221. var _proto = Alert.prototype;
  222. // Public
  223. _proto.close = function close(element) {
  224. var rootElement = this._element;
  225. if (element) {
  226. rootElement = this._getRootElement(element);
  227. }
  228. var customEvent = this._triggerCloseEvent(rootElement);
  229. if (customEvent.isDefaultPrevented()) {
  230. return;
  231. }
  232. this._removeElement(rootElement);
  233. };
  234. _proto.dispose = function dispose() {
  235. $.removeData(this._element, DATA_KEY);
  236. this._element = null;
  237. }; // Private
  238. _proto._getRootElement = function _getRootElement(element) {
  239. var selector = Util.getSelectorFromElement(element);
  240. var parent = false;
  241. if (selector) {
  242. parent = document.querySelector(selector);
  243. }
  244. if (!parent) {
  245. parent = $(element).closest("." + ClassName.ALERT)[0];
  246. }
  247. return parent;
  248. };
  249. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  250. var closeEvent = $.Event(Event.CLOSE);
  251. $(element).trigger(closeEvent);
  252. return closeEvent;
  253. };
  254. _proto._removeElement = function _removeElement(element) {
  255. var _this = this;
  256. $(element).removeClass(ClassName.SHOW);
  257. if (!$(element).hasClass(ClassName.FADE)) {
  258. this._destroyElement(element);
  259. return;
  260. }
  261. var transitionDuration = Util.getTransitionDurationFromElement(element);
  262. $(element).one(Util.TRANSITION_END, function (event) {
  263. return _this._destroyElement(element, event);
  264. }).emulateTransitionEnd(transitionDuration);
  265. };
  266. _proto._destroyElement = function _destroyElement(element) {
  267. $(element).detach().trigger(Event.CLOSED).remove();
  268. }; // Static
  269. Alert._jQueryInterface = function _jQueryInterface(config) {
  270. return this.each(function () {
  271. var $element = $(this);
  272. var data = $element.data(DATA_KEY);
  273. if (!data) {
  274. data = new Alert(this);
  275. $element.data(DATA_KEY, data);
  276. }
  277. if (config === 'close') {
  278. data[config](this);
  279. }
  280. });
  281. };
  282. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  283. return function (event) {
  284. if (event) {
  285. event.preventDefault();
  286. }
  287. alertInstance.close(this);
  288. };
  289. };
  290. _createClass(Alert, null, [{
  291. key: "VERSION",
  292. get: function get() {
  293. return VERSION;
  294. }
  295. }]);
  296. return Alert;
  297. }();
  298. /**
  299. * ------------------------------------------------------------------------
  300. * Data Api implementation
  301. * ------------------------------------------------------------------------
  302. */
  303. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  304. /**
  305. * ------------------------------------------------------------------------
  306. * jQuery
  307. * ------------------------------------------------------------------------
  308. */
  309. $.fn[NAME] = Alert._jQueryInterface;
  310. $.fn[NAME].Constructor = Alert;
  311. $.fn[NAME].noConflict = function () {
  312. $.fn[NAME] = JQUERY_NO_CONFLICT;
  313. return Alert._jQueryInterface;
  314. };
  315. /**
  316. * ------------------------------------------------------------------------
  317. * Constants
  318. * ------------------------------------------------------------------------
  319. */
  320. var NAME$1 = 'button';
  321. var VERSION$1 = '4.2.1';
  322. var DATA_KEY$1 = 'bs.button';
  323. var EVENT_KEY$1 = "." + DATA_KEY$1;
  324. var DATA_API_KEY$1 = '.data-api';
  325. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  326. var ClassName$1 = {
  327. ACTIVE: 'active',
  328. BUTTON: 'btn',
  329. FOCUS: 'focus'
  330. };
  331. var Selector$1 = {
  332. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  333. DATA_TOGGLE: '[data-toggle="buttons"]',
  334. INPUT: 'input:not([type="hidden"])',
  335. ACTIVE: '.active',
  336. BUTTON: '.btn'
  337. };
  338. var Event$1 = {
  339. CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  340. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
  341. /**
  342. * ------------------------------------------------------------------------
  343. * Class Definition
  344. * ------------------------------------------------------------------------
  345. */
  346. };
  347. var Button =
  348. /*#__PURE__*/
  349. function () {
  350. function Button(element) {
  351. this._element = element;
  352. } // Getters
  353. var _proto = Button.prototype;
  354. // Public
  355. _proto.toggle = function toggle() {
  356. var triggerChangeEvent = true;
  357. var addAriaPressed = true;
  358. var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];
  359. if (rootElement) {
  360. var input = this._element.querySelector(Selector$1.INPUT);
  361. if (input) {
  362. if (input.type === 'radio') {
  363. if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
  364. triggerChangeEvent = false;
  365. } else {
  366. var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
  367. if (activeElement) {
  368. $(activeElement).removeClass(ClassName$1.ACTIVE);
  369. }
  370. }
  371. }
  372. if (triggerChangeEvent) {
  373. if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
  374. return;
  375. }
  376. input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
  377. $(input).trigger('change');
  378. }
  379. input.focus();
  380. addAriaPressed = false;
  381. }
  382. }
  383. if (addAriaPressed) {
  384. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
  385. }
  386. if (triggerChangeEvent) {
  387. $(this._element).toggleClass(ClassName$1.ACTIVE);
  388. }
  389. };
  390. _proto.dispose = function dispose() {
  391. $.removeData(this._element, DATA_KEY$1);
  392. this._element = null;
  393. }; // Static
  394. Button._jQueryInterface = function _jQueryInterface(config) {
  395. return this.each(function () {
  396. var data = $(this).data(DATA_KEY$1);
  397. if (!data) {
  398. data = new Button(this);
  399. $(this).data(DATA_KEY$1, data);
  400. }
  401. if (config === 'toggle') {
  402. data[config]();
  403. }
  404. });
  405. };
  406. _createClass(Button, null, [{
  407. key: "VERSION",
  408. get: function get() {
  409. return VERSION$1;
  410. }
  411. }]);
  412. return Button;
  413. }();
  414. /**
  415. * ------------------------------------------------------------------------
  416. * Data Api implementation
  417. * ------------------------------------------------------------------------
  418. */
  419. $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  420. event.preventDefault();
  421. var button = event.target;
  422. if (!$(button).hasClass(ClassName$1.BUTTON)) {
  423. button = $(button).closest(Selector$1.BUTTON);
  424. }
  425. Button._jQueryInterface.call($(button), 'toggle');
  426. }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  427. var button = $(event.target).closest(Selector$1.BUTTON)[0];
  428. $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  429. });
  430. /**
  431. * ------------------------------------------------------------------------
  432. * jQuery
  433. * ------------------------------------------------------------------------
  434. */
  435. $.fn[NAME$1] = Button._jQueryInterface;
  436. $.fn[NAME$1].Constructor = Button;
  437. $.fn[NAME$1].noConflict = function () {
  438. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  439. return Button._jQueryInterface;
  440. };
  441. /**
  442. * ------------------------------------------------------------------------
  443. * Constants
  444. * ------------------------------------------------------------------------
  445. */
  446. var NAME$2 = 'carousel';
  447. var VERSION$2 = '4.2.1';
  448. var DATA_KEY$2 = 'bs.carousel';
  449. var EVENT_KEY$2 = "." + DATA_KEY$2;
  450. var DATA_API_KEY$2 = '.data-api';
  451. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  452. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  453. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  454. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  455. var SWIPE_THRESHOLD = 40;
  456. var Default = {
  457. interval: 5000,
  458. keyboard: true,
  459. slide: false,
  460. pause: 'hover',
  461. wrap: true,
  462. touch: true
  463. };
  464. var DefaultType = {
  465. interval: '(number|boolean)',
  466. keyboard: 'boolean',
  467. slide: '(boolean|string)',
  468. pause: '(string|boolean)',
  469. wrap: 'boolean',
  470. touch: 'boolean'
  471. };
  472. var Direction = {
  473. NEXT: 'next',
  474. PREV: 'prev',
  475. LEFT: 'left',
  476. RIGHT: 'right'
  477. };
  478. var Event$2 = {
  479. SLIDE: "slide" + EVENT_KEY$2,
  480. SLID: "slid" + EVENT_KEY$2,
  481. KEYDOWN: "keydown" + EVENT_KEY$2,
  482. MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  483. MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  484. TOUCHSTART: "touchstart" + EVENT_KEY$2,
  485. TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  486. TOUCHEND: "touchend" + EVENT_KEY$2,
  487. POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  488. POINTERUP: "pointerup" + EVENT_KEY$2,
  489. DRAG_START: "dragstart" + EVENT_KEY$2,
  490. LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  491. CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  492. };
  493. var ClassName$2 = {
  494. CAROUSEL: 'carousel',
  495. ACTIVE: 'active',
  496. SLIDE: 'slide',
  497. RIGHT: 'carousel-item-right',
  498. LEFT: 'carousel-item-left',
  499. NEXT: 'carousel-item-next',
  500. PREV: 'carousel-item-prev',
  501. ITEM: 'carousel-item',
  502. POINTER_EVENT: 'pointer-event'
  503. };
  504. var Selector$2 = {
  505. ACTIVE: '.active',
  506. ACTIVE_ITEM: '.active.carousel-item',
  507. ITEM: '.carousel-item',
  508. ITEM_IMG: '.carousel-item img',
  509. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  510. INDICATORS: '.carousel-indicators',
  511. DATA_SLIDE: '[data-slide], [data-slide-to]',
  512. DATA_RIDE: '[data-ride="carousel"]'
  513. };
  514. var PointerType = {
  515. TOUCH: 'touch',
  516. PEN: 'pen'
  517. /**
  518. * ------------------------------------------------------------------------
  519. * Class Definition
  520. * ------------------------------------------------------------------------
  521. */
  522. };
  523. var Carousel =
  524. /*#__PURE__*/
  525. function () {
  526. function Carousel(element, config) {
  527. this._items = null;
  528. this._interval = null;
  529. this._activeElement = null;
  530. this._isPaused = false;
  531. this._isSliding = false;
  532. this.touchTimeout = null;
  533. this.touchStartX = 0;
  534. this.touchDeltaX = 0;
  535. this._config = this._getConfig(config);
  536. this._element = element;
  537. this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
  538. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  539. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  540. this._addEventListeners();
  541. } // Getters
  542. var _proto = Carousel.prototype;
  543. // Public
  544. _proto.next = function next() {
  545. if (!this._isSliding) {
  546. this._slide(Direction.NEXT);
  547. }
  548. };
  549. _proto.nextWhenVisible = function nextWhenVisible() {
  550. // Don't call next when the page isn't visible
  551. // or the carousel or its parent isn't visible
  552. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  553. this.next();
  554. }
  555. };
  556. _proto.prev = function prev() {
  557. if (!this._isSliding) {
  558. this._slide(Direction.PREV);
  559. }
  560. };
  561. _proto.pause = function pause(event) {
  562. if (!event) {
  563. this._isPaused = true;
  564. }
  565. if (this._element.querySelector(Selector$2.NEXT_PREV)) {
  566. Util.triggerTransitionEnd(this._element);
  567. this.cycle(true);
  568. }
  569. clearInterval(this._interval);
  570. this._interval = null;
  571. };
  572. _proto.cycle = function cycle(event) {
  573. if (!event) {
  574. this._isPaused = false;
  575. }
  576. if (this._interval) {
  577. clearInterval(this._interval);
  578. this._interval = null;
  579. }
  580. if (this._config.interval && !this._isPaused) {
  581. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  582. }
  583. };
  584. _proto.to = function to(index) {
  585. var _this = this;
  586. this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  587. var activeIndex = this._getItemIndex(this._activeElement);
  588. if (index > this._items.length - 1 || index < 0) {
  589. return;
  590. }
  591. if (this._isSliding) {
  592. $(this._element).one(Event$2.SLID, function () {
  593. return _this.to(index);
  594. });
  595. return;
  596. }
  597. if (activeIndex === index) {
  598. this.pause();
  599. this.cycle();
  600. return;
  601. }
  602. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  603. this._slide(direction, this._items[index]);
  604. };
  605. _proto.dispose = function dispose() {
  606. $(this._element).off(EVENT_KEY$2);
  607. $.removeData(this._element, DATA_KEY$2);
  608. this._items = null;
  609. this._config = null;
  610. this._element = null;
  611. this._interval = null;
  612. this._isPaused = null;
  613. this._isSliding = null;
  614. this._activeElement = null;
  615. this._indicatorsElement = null;
  616. }; // Private
  617. _proto._getConfig = function _getConfig(config) {
  618. config = _objectSpread({}, Default, config);
  619. Util.typeCheckConfig(NAME$2, config, DefaultType);
  620. return config;
  621. };
  622. _proto._handleSwipe = function _handleSwipe() {
  623. var absDeltax = Math.abs(this.touchDeltaX);
  624. if (absDeltax <= SWIPE_THRESHOLD) {
  625. return;
  626. }
  627. var direction = absDeltax / this.touchDeltaX; // swipe left
  628. if (direction > 0) {
  629. this.prev();
  630. } // swipe right
  631. if (direction < 0) {
  632. this.next();
  633. }
  634. };
  635. _proto._addEventListeners = function _addEventListeners() {
  636. var _this2 = this;
  637. if (this._config.keyboard) {
  638. $(this._element).on(Event$2.KEYDOWN, function (event) {
  639. return _this2._keydown(event);
  640. });
  641. }
  642. if (this._config.pause === 'hover') {
  643. $(this._element).on(Event$2.MOUSEENTER, function (event) {
  644. return _this2.pause(event);
  645. }).on(Event$2.MOUSELEAVE, function (event) {
  646. return _this2.cycle(event);
  647. });
  648. }
  649. this._addTouchEventListeners();
  650. };
  651. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  652. var _this3 = this;
  653. if (!this._touchSupported) {
  654. return;
  655. }
  656. var start = function start(event) {
  657. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  658. _this3.touchStartX = event.originalEvent.clientX;
  659. } else if (!_this3._pointerEvent) {
  660. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  661. }
  662. };
  663. var move = function move(event) {
  664. // ensure swiping with one touch and not pinching
  665. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  666. _this3.touchDeltaX = 0;
  667. } else {
  668. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  669. }
  670. };
  671. var end = function end(event) {
  672. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  673. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  674. }
  675. _this3._handleSwipe();
  676. if (_this3._config.pause === 'hover') {
  677. // If it's a touch-enabled device, mouseenter/leave are fired as
  678. // part of the mouse compatibility events on first tap - the carousel
  679. // would stop cycling until user tapped out of it;
  680. // here, we listen for touchend, explicitly pause the carousel
  681. // (as if it's the second time we tap on it, mouseenter compat event
  682. // is NOT fired) and after a timeout (to allow for mouse compatibility
  683. // events to fire) we explicitly restart cycling
  684. _this3.pause();
  685. if (_this3.touchTimeout) {
  686. clearTimeout(_this3.touchTimeout);
  687. }
  688. _this3.touchTimeout = setTimeout(function (event) {
  689. return _this3.cycle(event);
  690. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  691. }
  692. };
  693. $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
  694. return e.preventDefault();
  695. });
  696. if (this._pointerEvent) {
  697. $(this._element).on(Event$2.POINTERDOWN, function (event) {
  698. return start(event);
  699. });
  700. $(this._element).on(Event$2.POINTERUP, function (event) {
  701. return end(event);
  702. });
  703. this._element.classList.add(ClassName$2.POINTER_EVENT);
  704. } else {
  705. $(this._element).on(Event$2.TOUCHSTART, function (event) {
  706. return start(event);
  707. });
  708. $(this._element).on(Event$2.TOUCHMOVE, function (event) {
  709. return move(event);
  710. });
  711. $(this._element).on(Event$2.TOUCHEND, function (event) {
  712. return end(event);
  713. });
  714. }
  715. };
  716. _proto._keydown = function _keydown(event) {
  717. if (/input|textarea/i.test(event.target.tagName)) {
  718. return;
  719. }
  720. switch (event.which) {
  721. case ARROW_LEFT_KEYCODE:
  722. event.preventDefault();
  723. this.prev();
  724. break;
  725. case ARROW_RIGHT_KEYCODE:
  726. event.preventDefault();
  727. this.next();
  728. break;
  729. default:
  730. }
  731. };
  732. _proto._getItemIndex = function _getItemIndex(element) {
  733. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
  734. return this._items.indexOf(element);
  735. };
  736. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  737. var isNextDirection = direction === Direction.NEXT;
  738. var isPrevDirection = direction === Direction.PREV;
  739. var activeIndex = this._getItemIndex(activeElement);
  740. var lastItemIndex = this._items.length - 1;
  741. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  742. if (isGoingToWrap && !this._config.wrap) {
  743. return activeElement;
  744. }
  745. var delta = direction === Direction.PREV ? -1 : 1;
  746. var itemIndex = (activeIndex + delta) % this._items.length;
  747. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  748. };
  749. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  750. var targetIndex = this._getItemIndex(relatedTarget);
  751. var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
  752. var slideEvent = $.Event(Event$2.SLIDE, {
  753. relatedTarget: relatedTarget,
  754. direction: eventDirectionName,
  755. from: fromIndex,
  756. to: targetIndex
  757. });
  758. $(this._element).trigger(slideEvent);
  759. return slideEvent;
  760. };
  761. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  762. if (this._indicatorsElement) {
  763. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
  764. $(indicators).removeClass(ClassName$2.ACTIVE);
  765. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  766. if (nextIndicator) {
  767. $(nextIndicator).addClass(ClassName$2.ACTIVE);
  768. }
  769. }
  770. };
  771. _proto._slide = function _slide(direction, element) {
  772. var _this4 = this;
  773. var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  774. var activeElementIndex = this._getItemIndex(activeElement);
  775. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  776. var nextElementIndex = this._getItemIndex(nextElement);
  777. var isCycling = Boolean(this._interval);
  778. var directionalClassName;
  779. var orderClassName;
  780. var eventDirectionName;
  781. if (direction === Direction.NEXT) {
  782. directionalClassName = ClassName$2.LEFT;
  783. orderClassName = ClassName$2.NEXT;
  784. eventDirectionName = Direction.LEFT;
  785. } else {
  786. directionalClassName = ClassName$2.RIGHT;
  787. orderClassName = ClassName$2.PREV;
  788. eventDirectionName = Direction.RIGHT;
  789. }
  790. if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
  791. this._isSliding = false;
  792. return;
  793. }
  794. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  795. if (slideEvent.isDefaultPrevented()) {
  796. return;
  797. }
  798. if (!activeElement || !nextElement) {
  799. // Some weirdness is happening, so we bail
  800. return;
  801. }
  802. this._isSliding = true;
  803. if (isCycling) {
  804. this.pause();
  805. }
  806. this._setActiveIndicatorElement(nextElement);
  807. var slidEvent = $.Event(Event$2.SLID, {
  808. relatedTarget: nextElement,
  809. direction: eventDirectionName,
  810. from: activeElementIndex,
  811. to: nextElementIndex
  812. });
  813. if ($(this._element).hasClass(ClassName$2.SLIDE)) {
  814. $(nextElement).addClass(orderClassName);
  815. Util.reflow(nextElement);
  816. $(activeElement).addClass(directionalClassName);
  817. $(nextElement).addClass(directionalClassName);
  818. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  819. if (nextElementInterval) {
  820. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  821. this._config.interval = nextElementInterval;
  822. } else {
  823. this._config.interval = this._config.defaultInterval || this._config.interval;
  824. }
  825. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  826. $(activeElement).one(Util.TRANSITION_END, function () {
  827. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
  828. $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
  829. _this4._isSliding = false;
  830. setTimeout(function () {
  831. return $(_this4._element).trigger(slidEvent);
  832. }, 0);
  833. }).emulateTransitionEnd(transitionDuration);
  834. } else {
  835. $(activeElement).removeClass(ClassName$2.ACTIVE);
  836. $(nextElement).addClass(ClassName$2.ACTIVE);
  837. this._isSliding = false;
  838. $(this._element).trigger(slidEvent);
  839. }
  840. if (isCycling) {
  841. this.cycle();
  842. }
  843. }; // Static
  844. Carousel._jQueryInterface = function _jQueryInterface(config) {
  845. return this.each(function () {
  846. var data = $(this).data(DATA_KEY$2);
  847. var _config = _objectSpread({}, Default, $(this).data());
  848. if (typeof config === 'object') {
  849. _config = _objectSpread({}, _config, config);
  850. }
  851. var action = typeof config === 'string' ? config : _config.slide;
  852. if (!data) {
  853. data = new Carousel(this, _config);
  854. $(this).data(DATA_KEY$2, data);
  855. }
  856. if (typeof config === 'number') {
  857. data.to(config);
  858. } else if (typeof action === 'string') {
  859. if (typeof data[action] === 'undefined') {
  860. throw new TypeError("No method named \"" + action + "\"");
  861. }
  862. data[action]();
  863. } else if (_config.interval) {
  864. data.pause();
  865. data.cycle();
  866. }
  867. });
  868. };
  869. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  870. var selector = Util.getSelectorFromElement(this);
  871. if (!selector) {
  872. return;
  873. }
  874. var target = $(selector)[0];
  875. if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
  876. return;
  877. }
  878. var config = _objectSpread({}, $(target).data(), $(this).data());
  879. var slideIndex = this.getAttribute('data-slide-to');
  880. if (slideIndex) {
  881. config.interval = false;
  882. }
  883. Carousel._jQueryInterface.call($(target), config);
  884. if (slideIndex) {
  885. $(target).data(DATA_KEY$2).to(slideIndex);
  886. }
  887. event.preventDefault();
  888. };
  889. _createClass(Carousel, null, [{
  890. key: "VERSION",
  891. get: function get() {
  892. return VERSION$2;
  893. }
  894. }, {
  895. key: "Default",
  896. get: function get() {
  897. return Default;
  898. }
  899. }]);
  900. return Carousel;
  901. }();
  902. /**
  903. * ------------------------------------------------------------------------
  904. * Data Api implementation
  905. * ------------------------------------------------------------------------
  906. */
  907. $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  908. $(window).on(Event$2.LOAD_DATA_API, function () {
  909. var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
  910. for (var i = 0, len = carousels.length; i < len; i++) {
  911. var $carousel = $(carousels[i]);
  912. Carousel._jQueryInterface.call($carousel, $carousel.data());
  913. }
  914. });
  915. /**
  916. * ------------------------------------------------------------------------
  917. * jQuery
  918. * ------------------------------------------------------------------------
  919. */
  920. $.fn[NAME$2] = Carousel._jQueryInterface;
  921. $.fn[NAME$2].Constructor = Carousel;
  922. $.fn[NAME$2].noConflict = function () {
  923. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  924. return Carousel._jQueryInterface;
  925. };
  926. /**
  927. * ------------------------------------------------------------------------
  928. * Constants
  929. * ------------------------------------------------------------------------
  930. */
  931. var NAME$3 = 'collapse';
  932. var VERSION$3 = '4.2.1';
  933. var DATA_KEY$3 = 'bs.collapse';
  934. var EVENT_KEY$3 = "." + DATA_KEY$3;
  935. var DATA_API_KEY$3 = '.data-api';
  936. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  937. var Default$1 = {
  938. toggle: true,
  939. parent: ''
  940. };
  941. var DefaultType$1 = {
  942. toggle: 'boolean',
  943. parent: '(string|element)'
  944. };
  945. var Event$3 = {
  946. SHOW: "show" + EVENT_KEY$3,
  947. SHOWN: "shown" + EVENT_KEY$3,
  948. HIDE: "hide" + EVENT_KEY$3,
  949. HIDDEN: "hidden" + EVENT_KEY$3,
  950. CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  951. };
  952. var ClassName$3 = {
  953. SHOW: 'show',
  954. COLLAPSE: 'collapse',
  955. COLLAPSING: 'collapsing',
  956. COLLAPSED: 'collapsed'
  957. };
  958. var Dimension = {
  959. WIDTH: 'width',
  960. HEIGHT: 'height'
  961. };
  962. var Selector$3 = {
  963. ACTIVES: '.show, .collapsing',
  964. DATA_TOGGLE: '[data-toggle="collapse"]'
  965. /**
  966. * ------------------------------------------------------------------------
  967. * Class Definition
  968. * ------------------------------------------------------------------------
  969. */
  970. };
  971. var Collapse =
  972. /*#__PURE__*/
  973. function () {
  974. function Collapse(element, config) {
  975. this._isTransitioning = false;
  976. this._element = element;
  977. this._config = this._getConfig(config);
  978. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  979. var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
  980. for (var i = 0, len = toggleList.length; i < len; i++) {
  981. var elem = toggleList[i];
  982. var selector = Util.getSelectorFromElement(elem);
  983. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  984. return foundElem === element;
  985. });
  986. if (selector !== null && filterElement.length > 0) {
  987. this._selector = selector;
  988. this._triggerArray.push(elem);
  989. }
  990. }
  991. this._parent = this._config.parent ? this._getParent() : null;
  992. if (!this._config.parent) {
  993. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  994. }
  995. if (this._config.toggle) {
  996. this.toggle();
  997. }
  998. } // Getters
  999. var _proto = Collapse.prototype;
  1000. // Public
  1001. _proto.toggle = function toggle() {
  1002. if ($(this._element).hasClass(ClassName$3.SHOW)) {
  1003. this.hide();
  1004. } else {
  1005. this.show();
  1006. }
  1007. };
  1008. _proto.show = function show() {
  1009. var _this = this;
  1010. if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
  1011. return;
  1012. }
  1013. var actives;
  1014. var activesData;
  1015. if (this._parent) {
  1016. actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
  1017. if (typeof _this._config.parent === 'string') {
  1018. return elem.getAttribute('data-parent') === _this._config.parent;
  1019. }
  1020. return elem.classList.contains(ClassName$3.COLLAPSE);
  1021. });
  1022. if (actives.length === 0) {
  1023. actives = null;
  1024. }
  1025. }
  1026. if (actives) {
  1027. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  1028. if (activesData && activesData._isTransitioning) {
  1029. return;
  1030. }
  1031. }
  1032. var startEvent = $.Event(Event$3.SHOW);
  1033. $(this._element).trigger(startEvent);
  1034. if (startEvent.isDefaultPrevented()) {
  1035. return;
  1036. }
  1037. if (actives) {
  1038. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  1039. if (!activesData) {
  1040. $(actives).data(DATA_KEY$3, null);
  1041. }
  1042. }
  1043. var dimension = this._getDimension();
  1044. $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
  1045. this._element.style[dimension] = 0;
  1046. if (this._triggerArray.length) {
  1047. $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
  1048. }
  1049. this.setTransitioning(true);
  1050. var complete = function complete() {
  1051. $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
  1052. _this._element.style[dimension] = '';
  1053. _this.setTransitioning(false);
  1054. $(_this._element).trigger(Event$3.SHOWN);
  1055. };
  1056. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  1057. var scrollSize = "scroll" + capitalizedDimension;
  1058. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1059. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1060. this._element.style[dimension] = this._element[scrollSize] + "px";
  1061. };
  1062. _proto.hide = function hide() {
  1063. var _this2 = this;
  1064. if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
  1065. return;
  1066. }
  1067. var startEvent = $.Event(Event$3.HIDE);
  1068. $(this._element).trigger(startEvent);
  1069. if (startEvent.isDefaultPrevented()) {
  1070. return;
  1071. }
  1072. var dimension = this._getDimension();
  1073. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  1074. Util.reflow(this._element);
  1075. $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
  1076. var triggerArrayLength = this._triggerArray.length;
  1077. if (triggerArrayLength > 0) {
  1078. for (var i = 0; i < triggerArrayLength; i++) {
  1079. var trigger = this._triggerArray[i];
  1080. var selector = Util.getSelectorFromElement(trigger);
  1081. if (selector !== null) {
  1082. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  1083. if (!$elem.hasClass(ClassName$3.SHOW)) {
  1084. $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
  1085. }
  1086. }
  1087. }
  1088. }
  1089. this.setTransitioning(true);
  1090. var complete = function complete() {
  1091. _this2.setTransitioning(false);
  1092. $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
  1093. };
  1094. this._element.style[dimension] = '';
  1095. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1096. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1097. };
  1098. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  1099. this._isTransitioning = isTransitioning;
  1100. };
  1101. _proto.dispose = function dispose() {
  1102. $.removeData(this._element, DATA_KEY$3);
  1103. this._config = null;
  1104. this._parent = null;
  1105. this._element = null;
  1106. this._triggerArray = null;
  1107. this._isTransitioning = null;
  1108. }; // Private
  1109. _proto._getConfig = function _getConfig(config) {
  1110. config = _objectSpread({}, Default$1, config);
  1111. config.toggle = Boolean(config.toggle); // Coerce string values
  1112. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  1113. return config;
  1114. };
  1115. _proto._getDimension = function _getDimension() {
  1116. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  1117. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  1118. };
  1119. _proto._getParent = function _getParent() {
  1120. var _this3 = this;
  1121. var parent;
  1122. if (Util.isElement(this._config.parent)) {
  1123. parent = this._config.parent; // It's a jQuery object
  1124. if (typeof this._config.parent.jquery !== 'undefined') {
  1125. parent = this._config.parent[0];
  1126. }
  1127. } else {
  1128. parent = document.querySelector(this._config.parent);
  1129. }
  1130. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  1131. var children = [].slice.call(parent.querySelectorAll(selector));
  1132. $(children).each(function (i, element) {
  1133. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  1134. });
  1135. return parent;
  1136. };
  1137. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  1138. var isOpen = $(element).hasClass(ClassName$3.SHOW);
  1139. if (triggerArray.length) {
  1140. $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  1141. }
  1142. }; // Static
  1143. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  1144. var selector = Util.getSelectorFromElement(element);
  1145. return selector ? document.querySelector(selector) : null;
  1146. };
  1147. Collapse._jQueryInterface = function _jQueryInterface(config) {
  1148. return this.each(function () {
  1149. var $this = $(this);
  1150. var data = $this.data(DATA_KEY$3);
  1151. var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {});
  1152. if (!data && _config.toggle && /show|hide/.test(config)) {
  1153. _config.toggle = false;
  1154. }
  1155. if (!data) {
  1156. data = new Collapse(this, _config);
  1157. $this.data(DATA_KEY$3, data);
  1158. }
  1159. if (typeof config === 'string') {
  1160. if (typeof data[config] === 'undefined') {
  1161. throw new TypeError("No method named \"" + config + "\"");
  1162. }
  1163. data[config]();
  1164. }
  1165. });
  1166. };
  1167. _createClass(Collapse, null, [{
  1168. key: "VERSION",
  1169. get: function get() {
  1170. return VERSION$3;
  1171. }
  1172. }, {
  1173. key: "Default",
  1174. get: function get() {
  1175. return Default$1;
  1176. }
  1177. }]);
  1178. return Collapse;
  1179. }();
  1180. /**
  1181. * ------------------------------------------------------------------------
  1182. * Data Api implementation
  1183. * ------------------------------------------------------------------------
  1184. */
  1185. $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  1186. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  1187. if (event.currentTarget.tagName === 'A') {
  1188. event.preventDefault();
  1189. }
  1190. var $trigger = $(this);
  1191. var selector = Util.getSelectorFromElement(this);
  1192. var selectors = [].slice.call(document.querySelectorAll(selector));
  1193. $(selectors).each(function () {
  1194. var $target = $(this);
  1195. var data = $target.data(DATA_KEY$3);
  1196. var config = data ? 'toggle' : $trigger.data();
  1197. Collapse._jQueryInterface.call($target, config);
  1198. });
  1199. });
  1200. /**
  1201. * ------------------------------------------------------------------------
  1202. * jQuery
  1203. * ------------------------------------------------------------------------
  1204. */
  1205. $.fn[NAME$3] = Collapse._jQueryInterface;
  1206. $.fn[NAME$3].Constructor = Collapse;
  1207. $.fn[NAME$3].noConflict = function () {
  1208. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  1209. return Collapse._jQueryInterface;
  1210. };
  1211. /**
  1212. * ------------------------------------------------------------------------
  1213. * Constants
  1214. * ------------------------------------------------------------------------
  1215. */
  1216. var NAME$4 = 'dropdown';
  1217. var VERSION$4 = '4.2.1';
  1218. var DATA_KEY$4 = 'bs.dropdown';
  1219. var EVENT_KEY$4 = "." + DATA_KEY$4;
  1220. var DATA_API_KEY$4 = '.data-api';
  1221. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  1222. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  1223. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  1224. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  1225. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  1226. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  1227. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  1228. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  1229. var Event$4 = {
  1230. HIDE: "hide" + EVENT_KEY$4,
  1231. HIDDEN: "hidden" + EVENT_KEY$4,
  1232. SHOW: "show" + EVENT_KEY$4,
  1233. SHOWN: "shown" + EVENT_KEY$4,
  1234. CLICK: "click" + EVENT_KEY$4,
  1235. CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  1236. KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  1237. KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  1238. };
  1239. var ClassName$4 = {
  1240. DISABLED: 'disabled',
  1241. SHOW: 'show',
  1242. DROPUP: 'dropup',
  1243. DROPRIGHT: 'dropright',
  1244. DROPLEFT: 'dropleft',
  1245. MENURIGHT: 'dropdown-menu-right',
  1246. MENULEFT: 'dropdown-menu-left',
  1247. POSITION_STATIC: 'position-static'
  1248. };
  1249. var Selector$4 = {
  1250. DATA_TOGGLE: '[data-toggle="dropdown"]',
  1251. FORM_CHILD: '.dropdown form',
  1252. MENU: '.dropdown-menu',
  1253. NAVBAR_NAV: '.navbar-nav',
  1254. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  1255. };
  1256. var AttachmentMap = {
  1257. TOP: 'top-start',
  1258. TOPEND: 'top-end',
  1259. BOTTOM: 'bottom-start',
  1260. BOTTOMEND: 'bottom-end',
  1261. RIGHT: 'right-start',
  1262. RIGHTEND: 'right-end',
  1263. LEFT: 'left-start',
  1264. LEFTEND: 'left-end'
  1265. };
  1266. var Default$2 = {
  1267. offset: 0,
  1268. flip: true,
  1269. boundary: 'scrollParent',
  1270. reference: 'toggle',
  1271. display: 'dynamic'
  1272. };
  1273. var DefaultType$2 = {
  1274. offset: '(number|string|function)',
  1275. flip: 'boolean',
  1276. boundary: '(string|element)',
  1277. reference: '(string|element)',
  1278. display: 'string'
  1279. /**
  1280. * ------------------------------------------------------------------------
  1281. * Class Definition
  1282. * ------------------------------------------------------------------------
  1283. */
  1284. };
  1285. var Dropdown =
  1286. /*#__PURE__*/
  1287. function () {
  1288. function Dropdown(element, config) {
  1289. this._element = element;
  1290. this._popper = null;
  1291. this._config = this._getConfig(config);
  1292. this._menu = this._getMenuElement();
  1293. this._inNavbar = this._detectNavbar();
  1294. this._addEventListeners();
  1295. } // Getters
  1296. var _proto = Dropdown.prototype;
  1297. // Public
  1298. _proto.toggle = function toggle() {
  1299. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
  1300. return;
  1301. }
  1302. var parent = Dropdown._getParentFromElement(this._element);
  1303. var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
  1304. Dropdown._clearMenus();
  1305. if (isActive) {
  1306. return;
  1307. }
  1308. var relatedTarget = {
  1309. relatedTarget: this._element
  1310. };
  1311. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  1312. $(parent).trigger(showEvent);
  1313. if (showEvent.isDefaultPrevented()) {
  1314. return;
  1315. } // Disable totally Popper.js for Dropdown in Navbar
  1316. if (!this._inNavbar) {
  1317. /**
  1318. * Check for Popper dependency
  1319. * Popper - https://popper.js.org
  1320. */
  1321. if (typeof Popper === 'undefined') {
  1322. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  1323. }
  1324. var referenceElement = this._element;
  1325. if (this._config.reference === 'parent') {
  1326. referenceElement = parent;
  1327. } else if (Util.isElement(this._config.reference)) {
  1328. referenceElement = this._config.reference; // Check if it's jQuery element
  1329. if (typeof this._config.reference.jquery !== 'undefined') {
  1330. referenceElement = this._config.reference[0];
  1331. }
  1332. } // If boundary is not `scrollParent`, then set position to `static`
  1333. // to allow the menu to "escape" the scroll parent's boundaries
  1334. // https://github.com/twbs/bootstrap/issues/24251
  1335. if (this._config.boundary !== 'scrollParent') {
  1336. $(parent).addClass(ClassName$4.POSITION_STATIC);
  1337. }
  1338. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  1339. } // If this is a touch-enabled device we add extra
  1340. // empty mouseover listeners to the body's immediate children;
  1341. // only needed because of broken event delegation on iOS
  1342. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  1343. if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
  1344. $(document.body).children().on('mouseover', null, $.noop);
  1345. }
  1346. this._element.focus();
  1347. this._element.setAttribute('aria-expanded', true);
  1348. $(this._menu).toggleClass(ClassName$4.SHOW);
  1349. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  1350. };
  1351. _proto.show = function show() {
  1352. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
  1353. return;
  1354. }
  1355. var relatedTarget = {
  1356. relatedTarget: this._element
  1357. };
  1358. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  1359. var parent = Dropdown._getParentFromElement(this._element);
  1360. $(parent).trigger(showEvent);
  1361. if (showEvent.isDefaultPrevented()) {
  1362. return;
  1363. }
  1364. $(this._menu).toggleClass(ClassName$4.SHOW);
  1365. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  1366. };
  1367. _proto.hide = function hide() {
  1368. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
  1369. return;
  1370. }
  1371. var relatedTarget = {
  1372. relatedTarget: this._element
  1373. };
  1374. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  1375. var parent = Dropdown._getParentFromElement(this._element);
  1376. $(parent).trigger(hideEvent);
  1377. if (hideEvent.isDefaultPrevented()) {
  1378. return;
  1379. }
  1380. $(this._menu).toggleClass(ClassName$4.SHOW);
  1381. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  1382. };
  1383. _proto.dispose = function dispose() {
  1384. $.removeData(this._element, DATA_KEY$4);
  1385. $(this._element).off(EVENT_KEY$4);
  1386. this._element = null;
  1387. this._menu = null;
  1388. if (this._popper !== null) {
  1389. this._popper.destroy();
  1390. this._popper = null;
  1391. }
  1392. };
  1393. _proto.update = function update() {
  1394. this._inNavbar = this._detectNavbar();
  1395. if (this._popper !== null) {
  1396. this._popper.scheduleUpdate();
  1397. }
  1398. }; // Private
  1399. _proto._addEventListeners = function _addEventListeners() {
  1400. var _this = this;
  1401. $(this._element).on(Event$4.CLICK, function (event) {
  1402. event.preventDefault();
  1403. event.stopPropagation();
  1404. _this.toggle();
  1405. });
  1406. };
  1407. _proto._getConfig = function _getConfig(config) {
  1408. config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
  1409. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  1410. return config;
  1411. };
  1412. _proto._getMenuElement = function _getMenuElement() {
  1413. if (!this._menu) {
  1414. var parent = Dropdown._getParentFromElement(this._element);
  1415. if (parent) {
  1416. this._menu = parent.querySelector(Selector$4.MENU);
  1417. }
  1418. }
  1419. return this._menu;
  1420. };
  1421. _proto._getPlacement = function _getPlacement() {
  1422. var $parentDropdown = $(this._element.parentNode);
  1423. var placement = AttachmentMap.BOTTOM; // Handle dropup
  1424. if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
  1425. placement = AttachmentMap.TOP;
  1426. if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  1427. placement = AttachmentMap.TOPEND;
  1428. }
  1429. } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
  1430. placement = AttachmentMap.RIGHT;
  1431. } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
  1432. placement = AttachmentMap.LEFT;
  1433. } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  1434. placement = AttachmentMap.BOTTOMEND;
  1435. }
  1436. return placement;
  1437. };
  1438. _proto._detectNavbar = function _detectNavbar() {
  1439. return $(this._element).closest('.navbar').length > 0;
  1440. };
  1441. _proto._getPopperConfig = function _getPopperConfig() {
  1442. var _this2 = this;
  1443. var offsetConf = {};
  1444. if (typeof this._config.offset === 'function') {
  1445. offsetConf.fn = function (data) {
  1446. data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
  1447. return data;
  1448. };
  1449. } else {
  1450. offsetConf.offset = this._config.offset;
  1451. }
  1452. var popperConfig = {
  1453. placement: this._getPlacement(),
  1454. modifiers: {
  1455. offset: offsetConf,
  1456. flip: {
  1457. enabled: this._config.flip
  1458. },
  1459. preventOverflow: {
  1460. boundariesElement: this._config.boundary
  1461. }
  1462. } // Disable Popper.js if we have a static display
  1463. };
  1464. if (this._config.display === 'static') {
  1465. popperConfig.modifiers.applyStyle = {
  1466. enabled: false
  1467. };
  1468. }
  1469. return popperConfig;
  1470. }; // Static
  1471. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  1472. return this.each(function () {
  1473. var data = $(this).data(DATA_KEY$4);
  1474. var _config = typeof config === 'object' ? config : null;
  1475. if (!data) {
  1476. data = new Dropdown(this, _config);
  1477. $(this).data(DATA_KEY$4, data);
  1478. }
  1479. if (typeof config === 'string') {
  1480. if (typeof data[config] === 'undefined') {
  1481. throw new TypeError("No method named \"" + config + "\"");
  1482. }
  1483. data[config]();
  1484. }
  1485. });
  1486. };
  1487. Dropdown._clearMenus = function _clearMenus(event) {
  1488. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  1489. return;
  1490. }
  1491. var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
  1492. for (var i = 0, len = toggles.length; i < len; i++) {
  1493. var parent = Dropdown._getParentFromElement(toggles[i]);
  1494. var context = $(toggles[i]).data(DATA_KEY$4);
  1495. var relatedTarget = {
  1496. relatedTarget: toggles[i]
  1497. };
  1498. if (event && event.type === 'click') {
  1499. relatedTarget.clickEvent = event;
  1500. }
  1501. if (!context) {
  1502. continue;
  1503. }
  1504. var dropdownMenu = context._menu;
  1505. if (!$(parent).hasClass(ClassName$4.SHOW)) {
  1506. continue;
  1507. }
  1508. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  1509. continue;
  1510. }
  1511. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  1512. $(parent).trigger(hideEvent);
  1513. if (hideEvent.isDefaultPrevented()) {
  1514. continue;
  1515. } // If this is a touch-enabled device we remove the extra
  1516. // empty mouseover listeners we added for iOS support
  1517. if ('ontouchstart' in document.documentElement) {
  1518. $(document.body).children().off('mouseover', null, $.noop);
  1519. }
  1520. toggles[i].setAttribute('aria-expanded', 'false');
  1521. $(dropdownMenu).removeClass(ClassName$4.SHOW);
  1522. $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  1523. }
  1524. };
  1525. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  1526. var parent;
  1527. var selector = Util.getSelectorFromElement(element);
  1528. if (selector) {
  1529. parent = document.querySelector(selector);
  1530. }
  1531. return parent || element.parentNode;
  1532. }; // eslint-disable-next-line complexity
  1533. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  1534. // If not input/textarea:
  1535. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  1536. // If input/textarea:
  1537. // - If space key => not a dropdown command
  1538. // - If key is other than escape
  1539. // - If key is not up or down => not a dropdown command
  1540. // - If trigger inside the menu => not a dropdown command
  1541. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  1542. return;
  1543. }
  1544. event.preventDefault();
  1545. event.stopPropagation();
  1546. if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
  1547. return;
  1548. }
  1549. var parent = Dropdown._getParentFromElement(this);
  1550. var isActive = $(parent).hasClass(ClassName$4.SHOW);
  1551. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  1552. if (event.which === ESCAPE_KEYCODE) {
  1553. var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
  1554. $(toggle).trigger('focus');
  1555. }
  1556. $(this).trigger('click');
  1557. return;
  1558. }
  1559. var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS));
  1560. if (items.length === 0) {
  1561. return;
  1562. }
  1563. var index = items.indexOf(event.target);
  1564. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  1565. // Up
  1566. index--;
  1567. }
  1568. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  1569. // Down
  1570. index++;
  1571. }
  1572. if (index < 0) {
  1573. index = 0;
  1574. }
  1575. items[index].focus();
  1576. };
  1577. _createClass(Dropdown, null, [{
  1578. key: "VERSION",
  1579. get: function get() {
  1580. return VERSION$4;
  1581. }
  1582. }, {
  1583. key: "Default",
  1584. get: function get() {
  1585. return Default$2;
  1586. }
  1587. }, {
  1588. key: "DefaultType",
  1589. get: function get() {
  1590. return DefaultType$2;
  1591. }
  1592. }]);
  1593. return Dropdown;
  1594. }();
  1595. /**
  1596. * ------------------------------------------------------------------------
  1597. * Data Api implementation
  1598. * ------------------------------------------------------------------------
  1599. */
  1600. $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  1601. event.preventDefault();
  1602. event.stopPropagation();
  1603. Dropdown._jQueryInterface.call($(this), 'toggle');
  1604. }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  1605. e.stopPropagation();
  1606. });
  1607. /**
  1608. * ------------------------------------------------------------------------
  1609. * jQuery
  1610. * ------------------------------------------------------------------------
  1611. */
  1612. $.fn[NAME$4] = Dropdown._jQueryInterface;
  1613. $.fn[NAME$4].Constructor = Dropdown;
  1614. $.fn[NAME$4].noConflict = function () {
  1615. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  1616. return Dropdown._jQueryInterface;
  1617. };
  1618. /**
  1619. * ------------------------------------------------------------------------
  1620. * Constants
  1621. * ------------------------------------------------------------------------
  1622. */
  1623. var NAME$5 = 'modal';
  1624. var VERSION$5 = '4.2.1';
  1625. var DATA_KEY$5 = 'bs.modal';
  1626. var EVENT_KEY$5 = "." + DATA_KEY$5;
  1627. var DATA_API_KEY$5 = '.data-api';
  1628. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  1629. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  1630. var Default$3 = {
  1631. backdrop: true,
  1632. keyboard: true,
  1633. focus: true,
  1634. show: true
  1635. };
  1636. var DefaultType$3 = {
  1637. backdrop: '(boolean|string)',
  1638. keyboard: 'boolean',
  1639. focus: 'boolean',
  1640. show: 'boolean'
  1641. };
  1642. var Event$5 = {
  1643. HIDE: "hide" + EVENT_KEY$5,
  1644. HIDDEN: "hidden" + EVENT_KEY$5,
  1645. SHOW: "show" + EVENT_KEY$5,
  1646. SHOWN: "shown" + EVENT_KEY$5,
  1647. FOCUSIN: "focusin" + EVENT_KEY$5,
  1648. RESIZE: "resize" + EVENT_KEY$5,
  1649. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  1650. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  1651. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  1652. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  1653. CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  1654. };
  1655. var ClassName$5 = {
  1656. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  1657. BACKDROP: 'modal-backdrop',
  1658. OPEN: 'modal-open',
  1659. FADE: 'fade',
  1660. SHOW: 'show'
  1661. };
  1662. var Selector$5 = {
  1663. DIALOG: '.modal-dialog',
  1664. DATA_TOGGLE: '[data-toggle="modal"]',
  1665. DATA_DISMISS: '[data-dismiss="modal"]',
  1666. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  1667. STICKY_CONTENT: '.sticky-top'
  1668. /**
  1669. * ------------------------------------------------------------------------
  1670. * Class Definition
  1671. * ------------------------------------------------------------------------
  1672. */
  1673. };
  1674. var Modal =
  1675. /*#__PURE__*/
  1676. function () {
  1677. function Modal(element, config) {
  1678. this._config = this._getConfig(config);
  1679. this._element = element;
  1680. this._dialog = element.querySelector(Selector$5.DIALOG);
  1681. this._backdrop = null;
  1682. this._isShown = false;
  1683. this._isBodyOverflowing = false;
  1684. this._ignoreBackdropClick = false;
  1685. this._isTransitioning = false;
  1686. this._scrollbarWidth = 0;
  1687. } // Getters
  1688. var _proto = Modal.prototype;
  1689. // Public
  1690. _proto.toggle = function toggle(relatedTarget) {
  1691. return this._isShown ? this.hide() : this.show(relatedTarget);
  1692. };
  1693. _proto.show = function show(relatedTarget) {
  1694. var _this = this;
  1695. if (this._isShown || this._isTransitioning) {
  1696. return;
  1697. }
  1698. if ($(this._element).hasClass(ClassName$5.FADE)) {
  1699. this._isTransitioning = true;
  1700. }
  1701. var showEvent = $.Event(Event$5.SHOW, {
  1702. relatedTarget: relatedTarget
  1703. });
  1704. $(this._element).trigger(showEvent);
  1705. if (this._isShown || showEvent.isDefaultPrevented()) {
  1706. return;
  1707. }
  1708. this._isShown = true;
  1709. this._checkScrollbar();
  1710. this._setScrollbar();
  1711. this._adjustDialog();
  1712. this._setEscapeEvent();
  1713. this._setResizeEvent();
  1714. $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
  1715. return _this.hide(event);
  1716. });
  1717. $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
  1718. $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
  1719. if ($(event.target).is(_this._element)) {
  1720. _this._ignoreBackdropClick = true;
  1721. }
  1722. });
  1723. });
  1724. this._showBackdrop(function () {
  1725. return _this._showElement(relatedTarget);
  1726. });
  1727. };
  1728. _proto.hide = function hide(event) {
  1729. var _this2 = this;
  1730. if (event) {
  1731. event.preventDefault();
  1732. }
  1733. if (!this._isShown || this._isTransitioning) {
  1734. return;
  1735. }
  1736. var hideEvent = $.Event(Event$5.HIDE);
  1737. $(this._element).trigger(hideEvent);
  1738. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  1739. return;
  1740. }
  1741. this._isShown = false;
  1742. var transition = $(this._element).hasClass(ClassName$5.FADE);
  1743. if (transition) {
  1744. this._isTransitioning = true;
  1745. }
  1746. this._setEscapeEvent();
  1747. this._setResizeEvent();
  1748. $(document).off(Event$5.FOCUSIN);
  1749. $(this._element).removeClass(ClassName$5.SHOW);
  1750. $(this._element).off(Event$5.CLICK_DISMISS);
  1751. $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
  1752. if (transition) {
  1753. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1754. $(this._element).one(Util.TRANSITION_END, function (event) {
  1755. return _this2._hideModal(event);
  1756. }).emulateTransitionEnd(transitionDuration);
  1757. } else {
  1758. this._hideModal();
  1759. }
  1760. };
  1761. _proto.dispose = function dispose() {
  1762. [window, this._element, this._dialog].forEach(function (htmlElement) {
  1763. return $(htmlElement).off(EVENT_KEY$5);
  1764. });
  1765. /**
  1766. * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
  1767. * Do not move `document` in `htmlElements` array
  1768. * It will remove `Event.CLICK_DATA_API` event that should remain
  1769. */
  1770. $(document).off(Event$5.FOCUSIN);
  1771. $.removeData(this._element, DATA_KEY$5);
  1772. this._config = null;
  1773. this._element = null;
  1774. this._dialog = null;
  1775. this._backdrop = null;
  1776. this._isShown = null;
  1777. this._isBodyOverflowing = null;
  1778. this._ignoreBackdropClick = null;
  1779. this._isTransitioning = null;
  1780. this._scrollbarWidth = null;
  1781. };
  1782. _proto.handleUpdate = function handleUpdate() {
  1783. this._adjustDialog();
  1784. }; // Private
  1785. _proto._getConfig = function _getConfig(config) {
  1786. config = _objectSpread({}, Default$3, config);
  1787. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  1788. return config;
  1789. };
  1790. _proto._showElement = function _showElement(relatedTarget) {
  1791. var _this3 = this;
  1792. var transition = $(this._element).hasClass(ClassName$5.FADE);
  1793. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  1794. // Don't move modal's DOM position
  1795. document.body.appendChild(this._element);
  1796. }
  1797. this._element.style.display = 'block';
  1798. this._element.removeAttribute('aria-hidden');
  1799. this._element.setAttribute('aria-modal', true);
  1800. this._element.scrollTop = 0;
  1801. if (transition) {
  1802. Util.reflow(this._element);
  1803. }
  1804. $(this._element).addClass(ClassName$5.SHOW);
  1805. if (this._config.focus) {
  1806. this._enforceFocus();
  1807. }
  1808. var shownEvent = $.Event(Event$5.SHOWN, {
  1809. relatedTarget: relatedTarget
  1810. });
  1811. var transitionComplete = function transitionComplete() {
  1812. if (_this3._config.focus) {
  1813. _this3._element.focus();
  1814. }
  1815. _this3._isTransitioning = false;
  1816. $(_this3._element).trigger(shownEvent);
  1817. };
  1818. if (transition) {
  1819. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  1820. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  1821. } else {
  1822. transitionComplete();
  1823. }
  1824. };
  1825. _proto._enforceFocus = function _enforceFocus() {
  1826. var _this4 = this;
  1827. $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
  1828. .on(Event$5.FOCUSIN, function (event) {
  1829. if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
  1830. _this4._element.focus();
  1831. }
  1832. });
  1833. };
  1834. _proto._setEscapeEvent = function _setEscapeEvent() {
  1835. var _this5 = this;
  1836. if (this._isShown && this._config.keyboard) {
  1837. $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
  1838. if (event.which === ESCAPE_KEYCODE$1) {
  1839. event.preventDefault();
  1840. _this5.hide();
  1841. }
  1842. });
  1843. } else if (!this._isShown) {
  1844. $(this._element).off(Event$5.KEYDOWN_DISMISS);
  1845. }
  1846. };
  1847. _proto._setResizeEvent = function _setResizeEvent() {
  1848. var _this6 = this;
  1849. if (this._isShown) {
  1850. $(window).on(Event$5.RESIZE, function (event) {
  1851. return _this6.handleUpdate(event);
  1852. });
  1853. } else {
  1854. $(window).off(Event$5.RESIZE);
  1855. }
  1856. };
  1857. _proto._hideModal = function _hideModal() {
  1858. var _this7 = this;
  1859. this._element.style.display = 'none';
  1860. this._element.setAttribute('aria-hidden', true);
  1861. this._element.removeAttribute('aria-modal');
  1862. this._isTransitioning = false;
  1863. this._showBackdrop(function () {
  1864. $(document.body).removeClass(ClassName$5.OPEN);
  1865. _this7._resetAdjustments();
  1866. _this7._resetScrollbar();
  1867. $(_this7._element).trigger(Event$5.HIDDEN);
  1868. });
  1869. };
  1870. _proto._removeBackdrop = function _removeBackdrop() {
  1871. if (this._backdrop) {
  1872. $(this._backdrop).remove();
  1873. this._backdrop = null;
  1874. }
  1875. };
  1876. _proto._showBackdrop = function _showBackdrop(callback) {
  1877. var _this8 = this;
  1878. var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
  1879. if (this._isShown && this._config.backdrop) {
  1880. this._backdrop = document.createElement('div');
  1881. this._backdrop.className = ClassName$5.BACKDROP;
  1882. if (animate) {
  1883. this._backdrop.classList.add(animate);
  1884. }
  1885. $(this._backdrop).appendTo(document.body);
  1886. $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
  1887. if (_this8._ignoreBackdropClick) {
  1888. _this8._ignoreBackdropClick = false;
  1889. return;
  1890. }
  1891. if (event.target !== event.currentTarget) {
  1892. return;
  1893. }
  1894. if (_this8._config.backdrop === 'static') {
  1895. _this8._element.focus();
  1896. } else {
  1897. _this8.hide();
  1898. }
  1899. });
  1900. if (animate) {
  1901. Util.reflow(this._backdrop);
  1902. }
  1903. $(this._backdrop).addClass(ClassName$5.SHOW);
  1904. if (!callback) {
  1905. return;
  1906. }
  1907. if (!animate) {
  1908. callback();
  1909. return;
  1910. }
  1911. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  1912. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  1913. } else if (!this._isShown && this._backdrop) {
  1914. $(this._backdrop).removeClass(ClassName$5.SHOW);
  1915. var callbackRemove = function callbackRemove() {
  1916. _this8._removeBackdrop();
  1917. if (callback) {
  1918. callback();
  1919. }
  1920. };
  1921. if ($(this._element).hasClass(ClassName$5.FADE)) {
  1922. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  1923. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  1924. } else {
  1925. callbackRemove();
  1926. }
  1927. } else if (callback) {
  1928. callback();
  1929. }
  1930. }; // ----------------------------------------------------------------------
  1931. // the following methods are used to handle overflowing modals
  1932. // todo (fat): these should probably be refactored out of modal.js
  1933. // ----------------------------------------------------------------------
  1934. _proto._adjustDialog = function _adjustDialog() {
  1935. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  1936. if (!this._isBodyOverflowing && isModalOverflowing) {
  1937. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  1938. }
  1939. if (this._isBodyOverflowing && !isModalOverflowing) {
  1940. this._element.style.paddingRight = this._scrollbarWidth + "px";
  1941. }
  1942. };
  1943. _proto._resetAdjustments = function _resetAdjustments() {
  1944. this._element.style.paddingLeft = '';
  1945. this._element.style.paddingRight = '';
  1946. };
  1947. _proto._checkScrollbar = function _checkScrollbar() {
  1948. var rect = document.body.getBoundingClientRect();
  1949. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  1950. this._scrollbarWidth = this._getScrollbarWidth();
  1951. };
  1952. _proto._setScrollbar = function _setScrollbar() {
  1953. var _this9 = this;
  1954. if (this._isBodyOverflowing) {
  1955. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  1956. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  1957. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  1958. var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
  1959. $(fixedContent).each(function (index, element) {
  1960. var actualPadding = element.style.paddingRight;
  1961. var calculatedPadding = $(element).css('padding-right');
  1962. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
  1963. }); // Adjust sticky content margin
  1964. $(stickyContent).each(function (index, element) {
  1965. var actualMargin = element.style.marginRight;
  1966. var calculatedMargin = $(element).css('margin-right');
  1967. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
  1968. }); // Adjust body padding
  1969. var actualPadding = document.body.style.paddingRight;
  1970. var calculatedPadding = $(document.body).css('padding-right');
  1971. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  1972. }
  1973. $(document.body).addClass(ClassName$5.OPEN);
  1974. };
  1975. _proto._resetScrollbar = function _resetScrollbar() {
  1976. // Restore fixed content padding
  1977. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  1978. $(fixedContent).each(function (index, element) {
  1979. var padding = $(element).data('padding-right');
  1980. $(element).removeData('padding-right');
  1981. element.style.paddingRight = padding ? padding : '';
  1982. }); // Restore sticky content
  1983. var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
  1984. $(elements).each(function (index, element) {
  1985. var margin = $(element).data('margin-right');
  1986. if (typeof margin !== 'undefined') {
  1987. $(element).css('margin-right', margin).removeData('margin-right');
  1988. }
  1989. }); // Restore body padding
  1990. var padding = $(document.body).data('padding-right');
  1991. $(document.body).removeData('padding-right');
  1992. document.body.style.paddingRight = padding ? padding : '';
  1993. };
  1994. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  1995. // thx d.walsh
  1996. var scrollDiv = document.createElement('div');
  1997. scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
  1998. document.body.appendChild(scrollDiv);
  1999. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  2000. document.body.removeChild(scrollDiv);
  2001. return scrollbarWidth;
  2002. }; // Static
  2003. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  2004. return this.each(function () {
  2005. var data = $(this).data(DATA_KEY$5);
  2006. var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {});
  2007. if (!data) {
  2008. data = new Modal(this, _config);
  2009. $(this).data(DATA_KEY$5, data);
  2010. }
  2011. if (typeof config === 'string') {
  2012. if (typeof data[config] === 'undefined') {
  2013. throw new TypeError("No method named \"" + config + "\"");
  2014. }
  2015. data[config](relatedTarget);
  2016. } else if (_config.show) {
  2017. data.show(relatedTarget);
  2018. }
  2019. });
  2020. };
  2021. _createClass(Modal, null, [{
  2022. key: "VERSION",
  2023. get: function get() {
  2024. return VERSION$5;
  2025. }
  2026. }, {
  2027. key: "Default",
  2028. get: function get() {
  2029. return Default$3;
  2030. }
  2031. }]);
  2032. return Modal;
  2033. }();
  2034. /**
  2035. * ------------------------------------------------------------------------
  2036. * Data Api implementation
  2037. * ------------------------------------------------------------------------
  2038. */
  2039. $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
  2040. var _this10 = this;
  2041. var target;
  2042. var selector = Util.getSelectorFromElement(this);
  2043. if (selector) {
  2044. target = document.querySelector(selector);
  2045. }
  2046. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
  2047. if (this.tagName === 'A' || this.tagName === 'AREA') {
  2048. event.preventDefault();
  2049. }
  2050. var $target = $(target).one(Event$5.SHOW, function (showEvent) {
  2051. if (showEvent.isDefaultPrevented()) {
  2052. // Only register focus restorer if modal will actually get shown
  2053. return;
  2054. }
  2055. $target.one(Event$5.HIDDEN, function () {
  2056. if ($(_this10).is(':visible')) {
  2057. _this10.focus();
  2058. }
  2059. });
  2060. });
  2061. Modal._jQueryInterface.call($(target), config, this);
  2062. });
  2063. /**
  2064. * ------------------------------------------------------------------------
  2065. * jQuery
  2066. * ------------------------------------------------------------------------
  2067. */
  2068. $.fn[NAME$5] = Modal._jQueryInterface;
  2069. $.fn[NAME$5].Constructor = Modal;
  2070. $.fn[NAME$5].noConflict = function () {
  2071. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  2072. return Modal._jQueryInterface;
  2073. };
  2074. /**
  2075. * ------------------------------------------------------------------------
  2076. * Constants
  2077. * ------------------------------------------------------------------------
  2078. */
  2079. var NAME$6 = 'tooltip';
  2080. var VERSION$6 = '4.2.1';
  2081. var DATA_KEY$6 = 'bs.tooltip';
  2082. var EVENT_KEY$6 = "." + DATA_KEY$6;
  2083. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  2084. var CLASS_PREFIX = 'bs-tooltip';
  2085. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  2086. var DefaultType$4 = {
  2087. animation: 'boolean',
  2088. template: 'string',
  2089. title: '(string|element|function)',
  2090. trigger: 'string',
  2091. delay: '(number|object)',
  2092. html: 'boolean',
  2093. selector: '(string|boolean)',
  2094. placement: '(string|function)',
  2095. offset: '(number|string)',
  2096. container: '(string|element|boolean)',
  2097. fallbackPlacement: '(string|array)',
  2098. boundary: '(string|element)'
  2099. };
  2100. var AttachmentMap$1 = {
  2101. AUTO: 'auto',
  2102. TOP: 'top',
  2103. RIGHT: 'right',
  2104. BOTTOM: 'bottom',
  2105. LEFT: 'left'
  2106. };
  2107. var Default$4 = {
  2108. animation: true,
  2109. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  2110. trigger: 'hover focus',
  2111. title: '',
  2112. delay: 0,
  2113. html: false,
  2114. selector: false,
  2115. placement: 'top',
  2116. offset: 0,
  2117. container: false,
  2118. fallbackPlacement: 'flip',
  2119. boundary: 'scrollParent'
  2120. };
  2121. var HoverState = {
  2122. SHOW: 'show',
  2123. OUT: 'out'
  2124. };
  2125. var Event$6 = {
  2126. HIDE: "hide" + EVENT_KEY$6,
  2127. HIDDEN: "hidden" + EVENT_KEY$6,
  2128. SHOW: "show" + EVENT_KEY$6,
  2129. SHOWN: "shown" + EVENT_KEY$6,
  2130. INSERTED: "inserted" + EVENT_KEY$6,
  2131. CLICK: "click" + EVENT_KEY$6,
  2132. FOCUSIN: "focusin" + EVENT_KEY$6,
  2133. FOCUSOUT: "focusout" + EVENT_KEY$6,
  2134. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  2135. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  2136. };
  2137. var ClassName$6 = {
  2138. FADE: 'fade',
  2139. SHOW: 'show'
  2140. };
  2141. var Selector$6 = {
  2142. TOOLTIP: '.tooltip',
  2143. TOOLTIP_INNER: '.tooltip-inner',
  2144. ARROW: '.arrow'
  2145. };
  2146. var Trigger = {
  2147. HOVER: 'hover',
  2148. FOCUS: 'focus',
  2149. CLICK: 'click',
  2150. MANUAL: 'manual'
  2151. /**
  2152. * ------------------------------------------------------------------------
  2153. * Class Definition
  2154. * ------------------------------------------------------------------------
  2155. */
  2156. };
  2157. var Tooltip =
  2158. /*#__PURE__*/
  2159. function () {
  2160. function Tooltip(element, config) {
  2161. /**
  2162. * Check for Popper dependency
  2163. * Popper - https://popper.js.org
  2164. */
  2165. if (typeof Popper === 'undefined') {
  2166. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  2167. } // private
  2168. this._isEnabled = true;
  2169. this._timeout = 0;
  2170. this._hoverState = '';
  2171. this._activeTrigger = {};
  2172. this._popper = null; // Protected
  2173. this.element = element;
  2174. this.config = this._getConfig(config);
  2175. this.tip = null;
  2176. this._setListeners();
  2177. } // Getters
  2178. var _proto = Tooltip.prototype;
  2179. // Public
  2180. _proto.enable = function enable() {
  2181. this._isEnabled = true;
  2182. };
  2183. _proto.disable = function disable() {
  2184. this._isEnabled = false;
  2185. };
  2186. _proto.toggleEnabled = function toggleEnabled() {
  2187. this._isEnabled = !this._isEnabled;
  2188. };
  2189. _proto.toggle = function toggle(event) {
  2190. if (!this._isEnabled) {
  2191. return;
  2192. }
  2193. if (event) {
  2194. var dataKey = this.constructor.DATA_KEY;
  2195. var context = $(event.currentTarget).data(dataKey);
  2196. if (!context) {
  2197. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2198. $(event.currentTarget).data(dataKey, context);
  2199. }
  2200. context._activeTrigger.click = !context._activeTrigger.click;
  2201. if (context._isWithActiveTrigger()) {
  2202. context._enter(null, context);
  2203. } else {
  2204. context._leave(null, context);
  2205. }
  2206. } else {
  2207. if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
  2208. this._leave(null, this);
  2209. return;
  2210. }
  2211. this._enter(null, this);
  2212. }
  2213. };
  2214. _proto.dispose = function dispose() {
  2215. clearTimeout(this._timeout);
  2216. $.removeData(this.element, this.constructor.DATA_KEY);
  2217. $(this.element).off(this.constructor.EVENT_KEY);
  2218. $(this.element).closest('.modal').off('hide.bs.modal');
  2219. if (this.tip) {
  2220. $(this.tip).remove();
  2221. }
  2222. this._isEnabled = null;
  2223. this._timeout = null;
  2224. this._hoverState = null;
  2225. this._activeTrigger = null;
  2226. if (this._popper !== null) {
  2227. this._popper.destroy();
  2228. }
  2229. this._popper = null;
  2230. this.element = null;
  2231. this.config = null;
  2232. this.tip = null;
  2233. };
  2234. _proto.show = function show() {
  2235. var _this = this;
  2236. if ($(this.element).css('display') === 'none') {
  2237. throw new Error('Please use show on visible elements');
  2238. }
  2239. var showEvent = $.Event(this.constructor.Event.SHOW);
  2240. if (this.isWithContent() && this._isEnabled) {
  2241. $(this.element).trigger(showEvent);
  2242. var shadowRoot = Util.findShadowRoot(this.element);
  2243. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  2244. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  2245. return;
  2246. }
  2247. var tip = this.getTipElement();
  2248. var tipId = Util.getUID(this.constructor.NAME);
  2249. tip.setAttribute('id', tipId);
  2250. this.element.setAttribute('aria-describedby', tipId);
  2251. this.setContent();
  2252. if (this.config.animation) {
  2253. $(tip).addClass(ClassName$6.FADE);
  2254. }
  2255. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  2256. var attachment = this._getAttachment(placement);
  2257. this.addAttachmentClass(attachment);
  2258. var container = this._getContainer();
  2259. $(tip).data(this.constructor.DATA_KEY, this);
  2260. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  2261. $(tip).appendTo(container);
  2262. }
  2263. $(this.element).trigger(this.constructor.Event.INSERTED);
  2264. this._popper = new Popper(this.element, tip, {
  2265. placement: attachment,
  2266. modifiers: {
  2267. offset: {
  2268. offset: this.config.offset
  2269. },
  2270. flip: {
  2271. behavior: this.config.fallbackPlacement
  2272. },
  2273. arrow: {
  2274. element: Selector$6.ARROW
  2275. },
  2276. preventOverflow: {
  2277. boundariesElement: this.config.boundary
  2278. }
  2279. },
  2280. onCreate: function onCreate(data) {
  2281. if (data.originalPlacement !== data.placement) {
  2282. _this._handlePopperPlacementChange(data);
  2283. }
  2284. },
  2285. onUpdate: function onUpdate(data) {
  2286. return _this._handlePopperPlacementChange(data);
  2287. }
  2288. });
  2289. $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
  2290. // empty mouseover listeners to the body's immediate children;
  2291. // only needed because of broken event delegation on iOS
  2292. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  2293. if ('ontouchstart' in document.documentElement) {
  2294. $(document.body).children().on('mouseover', null, $.noop);
  2295. }
  2296. var complete = function complete() {
  2297. if (_this.config.animation) {
  2298. _this._fixTransition();
  2299. }
  2300. var prevHoverState = _this._hoverState;
  2301. _this._hoverState = null;
  2302. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  2303. if (prevHoverState === HoverState.OUT) {
  2304. _this._leave(null, _this);
  2305. }
  2306. };
  2307. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  2308. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  2309. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  2310. } else {
  2311. complete();
  2312. }
  2313. }
  2314. };
  2315. _proto.hide = function hide(callback) {
  2316. var _this2 = this;
  2317. var tip = this.getTipElement();
  2318. var hideEvent = $.Event(this.constructor.Event.HIDE);
  2319. var complete = function complete() {
  2320. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  2321. tip.parentNode.removeChild(tip);
  2322. }
  2323. _this2._cleanTipClass();
  2324. _this2.element.removeAttribute('aria-describedby');
  2325. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  2326. if (_this2._popper !== null) {
  2327. _this2._popper.destroy();
  2328. }
  2329. if (callback) {
  2330. callback();
  2331. }
  2332. };
  2333. $(this.element).trigger(hideEvent);
  2334. if (hideEvent.isDefaultPrevented()) {
  2335. return;
  2336. }
  2337. $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
  2338. // empty mouseover listeners we added for iOS support
  2339. if ('ontouchstart' in document.documentElement) {
  2340. $(document.body).children().off('mouseover', null, $.noop);
  2341. }
  2342. this._activeTrigger[Trigger.CLICK] = false;
  2343. this._activeTrigger[Trigger.FOCUS] = false;
  2344. this._activeTrigger[Trigger.HOVER] = false;
  2345. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  2346. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  2347. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  2348. } else {
  2349. complete();
  2350. }
  2351. this._hoverState = '';
  2352. };
  2353. _proto.update = function update() {
  2354. if (this._popper !== null) {
  2355. this._popper.scheduleUpdate();
  2356. }
  2357. }; // Protected
  2358. _proto.isWithContent = function isWithContent() {
  2359. return Boolean(this.getTitle());
  2360. };
  2361. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  2362. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  2363. };
  2364. _proto.getTipElement = function getTipElement() {
  2365. this.tip = this.tip || $(this.config.template)[0];
  2366. return this.tip;
  2367. };
  2368. _proto.setContent = function setContent() {
  2369. var tip = this.getTipElement();
  2370. this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
  2371. $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
  2372. };
  2373. _proto.setElementContent = function setElementContent($element, content) {
  2374. var html = this.config.html;
  2375. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  2376. // Content is a DOM node or a jQuery
  2377. if (html) {
  2378. if (!$(content).parent().is($element)) {
  2379. $element.empty().append(content);
  2380. }
  2381. } else {
  2382. $element.text($(content).text());
  2383. }
  2384. } else {
  2385. $element[html ? 'html' : 'text'](content);
  2386. }
  2387. };
  2388. _proto.getTitle = function getTitle() {
  2389. var title = this.element.getAttribute('data-original-title');
  2390. if (!title) {
  2391. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  2392. }
  2393. return title;
  2394. }; // Private
  2395. _proto._getContainer = function _getContainer() {
  2396. if (this.config.container === false) {
  2397. return document.body;
  2398. }
  2399. if (Util.isElement(this.config.container)) {
  2400. return $(this.config.container);
  2401. }
  2402. return $(document).find(this.config.container);
  2403. };
  2404. _proto._getAttachment = function _getAttachment(placement) {
  2405. return AttachmentMap$1[placement.toUpperCase()];
  2406. };
  2407. _proto._setListeners = function _setListeners() {
  2408. var _this3 = this;
  2409. var triggers = this.config.trigger.split(' ');
  2410. triggers.forEach(function (trigger) {
  2411. if (trigger === 'click') {
  2412. $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
  2413. return _this3.toggle(event);
  2414. });
  2415. } else if (trigger !== Trigger.MANUAL) {
  2416. var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
  2417. var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
  2418. $(_this3.element).on(eventIn, _this3.config.selector, function (event) {
  2419. return _this3._enter(event);
  2420. }).on(eventOut, _this3.config.selector, function (event) {
  2421. return _this3._leave(event);
  2422. });
  2423. }
  2424. });
  2425. $(this.element).closest('.modal').on('hide.bs.modal', function () {
  2426. if (_this3.element) {
  2427. _this3.hide();
  2428. }
  2429. });
  2430. if (this.config.selector) {
  2431. this.config = _objectSpread({}, this.config, {
  2432. trigger: 'manual',
  2433. selector: ''
  2434. });
  2435. } else {
  2436. this._fixTitle();
  2437. }
  2438. };
  2439. _proto._fixTitle = function _fixTitle() {
  2440. var titleType = typeof this.element.getAttribute('data-original-title');
  2441. if (this.element.getAttribute('title') || titleType !== 'string') {
  2442. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  2443. this.element.setAttribute('title', '');
  2444. }
  2445. };
  2446. _proto._enter = function _enter(event, context) {
  2447. var dataKey = this.constructor.DATA_KEY;
  2448. context = context || $(event.currentTarget).data(dataKey);
  2449. if (!context) {
  2450. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2451. $(event.currentTarget).data(dataKey, context);
  2452. }
  2453. if (event) {
  2454. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  2455. }
  2456. if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
  2457. context._hoverState = HoverState.SHOW;
  2458. return;
  2459. }
  2460. clearTimeout(context._timeout);
  2461. context._hoverState = HoverState.SHOW;
  2462. if (!context.config.delay || !context.config.delay.show) {
  2463. context.show();
  2464. return;
  2465. }
  2466. context._timeout = setTimeout(function () {
  2467. if (context._hoverState === HoverState.SHOW) {
  2468. context.show();
  2469. }
  2470. }, context.config.delay.show);
  2471. };
  2472. _proto._leave = function _leave(event, context) {
  2473. var dataKey = this.constructor.DATA_KEY;
  2474. context = context || $(event.currentTarget).data(dataKey);
  2475. if (!context) {
  2476. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2477. $(event.currentTarget).data(dataKey, context);
  2478. }
  2479. if (event) {
  2480. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  2481. }
  2482. if (context._isWithActiveTrigger()) {
  2483. return;
  2484. }
  2485. clearTimeout(context._timeout);
  2486. context._hoverState = HoverState.OUT;
  2487. if (!context.config.delay || !context.config.delay.hide) {
  2488. context.hide();
  2489. return;
  2490. }
  2491. context._timeout = setTimeout(function () {
  2492. if (context._hoverState === HoverState.OUT) {
  2493. context.hide();
  2494. }
  2495. }, context.config.delay.hide);
  2496. };
  2497. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  2498. for (var trigger in this._activeTrigger) {
  2499. if (this._activeTrigger[trigger]) {
  2500. return true;
  2501. }
  2502. }
  2503. return false;
  2504. };
  2505. _proto._getConfig = function _getConfig(config) {
  2506. config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});
  2507. if (typeof config.delay === 'number') {
  2508. config.delay = {
  2509. show: config.delay,
  2510. hide: config.delay
  2511. };
  2512. }
  2513. if (typeof config.title === 'number') {
  2514. config.title = config.title.toString();
  2515. }
  2516. if (typeof config.content === 'number') {
  2517. config.content = config.content.toString();
  2518. }
  2519. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  2520. return config;
  2521. };
  2522. _proto._getDelegateConfig = function _getDelegateConfig() {
  2523. var config = {};
  2524. if (this.config) {
  2525. for (var key in this.config) {
  2526. if (this.constructor.Default[key] !== this.config[key]) {
  2527. config[key] = this.config[key];
  2528. }
  2529. }
  2530. }
  2531. return config;
  2532. };
  2533. _proto._cleanTipClass = function _cleanTipClass() {
  2534. var $tip = $(this.getTipElement());
  2535. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  2536. if (tabClass !== null && tabClass.length) {
  2537. $tip.removeClass(tabClass.join(''));
  2538. }
  2539. };
  2540. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  2541. var popperInstance = popperData.instance;
  2542. this.tip = popperInstance.popper;
  2543. this._cleanTipClass();
  2544. this.addAttachmentClass(this._getAttachment(popperData.placement));
  2545. };
  2546. _proto._fixTransition = function _fixTransition() {
  2547. var tip = this.getTipElement();
  2548. var initConfigAnimation = this.config.animation;
  2549. if (tip.getAttribute('x-placement') !== null) {
  2550. return;
  2551. }
  2552. $(tip).removeClass(ClassName$6.FADE);
  2553. this.config.animation = false;
  2554. this.hide();
  2555. this.show();
  2556. this.config.animation = initConfigAnimation;
  2557. }; // Static
  2558. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  2559. return this.each(function () {
  2560. var data = $(this).data(DATA_KEY$6);
  2561. var _config = typeof config === 'object' && config;
  2562. if (!data && /dispose|hide/.test(config)) {
  2563. return;
  2564. }
  2565. if (!data) {
  2566. data = new Tooltip(this, _config);
  2567. $(this).data(DATA_KEY$6, data);
  2568. }
  2569. if (typeof config === 'string') {
  2570. if (typeof data[config] === 'undefined') {
  2571. throw new TypeError("No method named \"" + config + "\"");
  2572. }
  2573. data[config]();
  2574. }
  2575. });
  2576. };
  2577. _createClass(Tooltip, null, [{
  2578. key: "VERSION",
  2579. get: function get() {
  2580. return VERSION$6;
  2581. }
  2582. }, {
  2583. key: "Default",
  2584. get: function get() {
  2585. return Default$4;
  2586. }
  2587. }, {
  2588. key: "NAME",
  2589. get: function get() {
  2590. return NAME$6;
  2591. }
  2592. }, {
  2593. key: "DATA_KEY",
  2594. get: function get() {
  2595. return DATA_KEY$6;
  2596. }
  2597. }, {
  2598. key: "Event",
  2599. get: function get() {
  2600. return Event$6;
  2601. }
  2602. }, {
  2603. key: "EVENT_KEY",
  2604. get: function get() {
  2605. return EVENT_KEY$6;
  2606. }
  2607. }, {
  2608. key: "DefaultType",
  2609. get: function get() {
  2610. return DefaultType$4;
  2611. }
  2612. }]);
  2613. return Tooltip;
  2614. }();
  2615. /**
  2616. * ------------------------------------------------------------------------
  2617. * jQuery
  2618. * ------------------------------------------------------------------------
  2619. */
  2620. $.fn[NAME$6] = Tooltip._jQueryInterface;
  2621. $.fn[NAME$6].Constructor = Tooltip;
  2622. $.fn[NAME$6].noConflict = function () {
  2623. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  2624. return Tooltip._jQueryInterface;
  2625. };
  2626. /**
  2627. * ------------------------------------------------------------------------
  2628. * Constants
  2629. * ------------------------------------------------------------------------
  2630. */
  2631. var NAME$7 = 'popover';
  2632. var VERSION$7 = '4.2.1';
  2633. var DATA_KEY$7 = 'bs.popover';
  2634. var EVENT_KEY$7 = "." + DATA_KEY$7;
  2635. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  2636. var CLASS_PREFIX$1 = 'bs-popover';
  2637. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  2638. var Default$5 = _objectSpread({}, Tooltip.Default, {
  2639. placement: 'right',
  2640. trigger: 'click',
  2641. content: '',
  2642. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  2643. });
  2644. var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {
  2645. content: '(string|element|function)'
  2646. });
  2647. var ClassName$7 = {
  2648. FADE: 'fade',
  2649. SHOW: 'show'
  2650. };
  2651. var Selector$7 = {
  2652. TITLE: '.popover-header',
  2653. CONTENT: '.popover-body'
  2654. };
  2655. var Event$7 = {
  2656. HIDE: "hide" + EVENT_KEY$7,
  2657. HIDDEN: "hidden" + EVENT_KEY$7,
  2658. SHOW: "show" + EVENT_KEY$7,
  2659. SHOWN: "shown" + EVENT_KEY$7,
  2660. INSERTED: "inserted" + EVENT_KEY$7,
  2661. CLICK: "click" + EVENT_KEY$7,
  2662. FOCUSIN: "focusin" + EVENT_KEY$7,
  2663. FOCUSOUT: "focusout" + EVENT_KEY$7,
  2664. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  2665. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  2666. /**
  2667. * ------------------------------------------------------------------------
  2668. * Class Definition
  2669. * ------------------------------------------------------------------------
  2670. */
  2671. };
  2672. var Popover =
  2673. /*#__PURE__*/
  2674. function (_Tooltip) {
  2675. _inheritsLoose(Popover, _Tooltip);
  2676. function Popover() {
  2677. return _Tooltip.apply(this, arguments) || this;
  2678. }
  2679. var _proto = Popover.prototype;
  2680. // Overrides
  2681. _proto.isWithContent = function isWithContent() {
  2682. return this.getTitle() || this._getContent();
  2683. };
  2684. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  2685. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  2686. };
  2687. _proto.getTipElement = function getTipElement() {
  2688. this.tip = this.tip || $(this.config.template)[0];
  2689. return this.tip;
  2690. };
  2691. _proto.setContent = function setContent() {
  2692. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  2693. this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
  2694. var content = this._getContent();
  2695. if (typeof content === 'function') {
  2696. content = content.call(this.element);
  2697. }
  2698. this.setElementContent($tip.find(Selector$7.CONTENT), content);
  2699. $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
  2700. }; // Private
  2701. _proto._getContent = function _getContent() {
  2702. return this.element.getAttribute('data-content') || this.config.content;
  2703. };
  2704. _proto._cleanTipClass = function _cleanTipClass() {
  2705. var $tip = $(this.getTipElement());
  2706. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  2707. if (tabClass !== null && tabClass.length > 0) {
  2708. $tip.removeClass(tabClass.join(''));
  2709. }
  2710. }; // Static
  2711. Popover._jQueryInterface = function _jQueryInterface(config) {
  2712. return this.each(function () {
  2713. var data = $(this).data(DATA_KEY$7);
  2714. var _config = typeof config === 'object' ? config : null;
  2715. if (!data && /dispose|hide/.test(config)) {
  2716. return;
  2717. }
  2718. if (!data) {
  2719. data = new Popover(this, _config);
  2720. $(this).data(DATA_KEY$7, data);
  2721. }
  2722. if (typeof config === 'string') {
  2723. if (typeof data[config] === 'undefined') {
  2724. throw new TypeError("No method named \"" + config + "\"");
  2725. }
  2726. data[config]();
  2727. }
  2728. });
  2729. };
  2730. _createClass(Popover, null, [{
  2731. key: "VERSION",
  2732. // Getters
  2733. get: function get() {
  2734. return VERSION$7;
  2735. }
  2736. }, {
  2737. key: "Default",
  2738. get: function get() {
  2739. return Default$5;
  2740. }
  2741. }, {
  2742. key: "NAME",
  2743. get: function get() {
  2744. return NAME$7;
  2745. }
  2746. }, {
  2747. key: "DATA_KEY",
  2748. get: function get() {
  2749. return DATA_KEY$7;
  2750. }
  2751. }, {
  2752. key: "Event",
  2753. get: function get() {
  2754. return Event$7;
  2755. }
  2756. }, {
  2757. key: "EVENT_KEY",
  2758. get: function get() {
  2759. return EVENT_KEY$7;
  2760. }
  2761. }, {
  2762. key: "DefaultType",
  2763. get: function get() {
  2764. return DefaultType$5;
  2765. }
  2766. }]);
  2767. return Popover;
  2768. }(Tooltip);
  2769. /**
  2770. * ------------------------------------------------------------------------
  2771. * jQuery
  2772. * ------------------------------------------------------------------------
  2773. */
  2774. $.fn[NAME$7] = Popover._jQueryInterface;
  2775. $.fn[NAME$7].Constructor = Popover;
  2776. $.fn[NAME$7].noConflict = function () {
  2777. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  2778. return Popover._jQueryInterface;
  2779. };
  2780. /**
  2781. * ------------------------------------------------------------------------
  2782. * Constants
  2783. * ------------------------------------------------------------------------
  2784. */
  2785. var NAME$8 = 'scrollspy';
  2786. var VERSION$8 = '4.2.1';
  2787. var DATA_KEY$8 = 'bs.scrollspy';
  2788. var EVENT_KEY$8 = "." + DATA_KEY$8;
  2789. var DATA_API_KEY$6 = '.data-api';
  2790. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  2791. var Default$6 = {
  2792. offset: 10,
  2793. method: 'auto',
  2794. target: ''
  2795. };
  2796. var DefaultType$6 = {
  2797. offset: 'number',
  2798. method: 'string',
  2799. target: '(string|element)'
  2800. };
  2801. var Event$8 = {
  2802. ACTIVATE: "activate" + EVENT_KEY$8,
  2803. SCROLL: "scroll" + EVENT_KEY$8,
  2804. LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  2805. };
  2806. var ClassName$8 = {
  2807. DROPDOWN_ITEM: 'dropdown-item',
  2808. DROPDOWN_MENU: 'dropdown-menu',
  2809. ACTIVE: 'active'
  2810. };
  2811. var Selector$8 = {
  2812. DATA_SPY: '[data-spy="scroll"]',
  2813. ACTIVE: '.active',
  2814. NAV_LIST_GROUP: '.nav, .list-group',
  2815. NAV_LINKS: '.nav-link',
  2816. NAV_ITEMS: '.nav-item',
  2817. LIST_ITEMS: '.list-group-item',
  2818. DROPDOWN: '.dropdown',
  2819. DROPDOWN_ITEMS: '.dropdown-item',
  2820. DROPDOWN_TOGGLE: '.dropdown-toggle'
  2821. };
  2822. var OffsetMethod = {
  2823. OFFSET: 'offset',
  2824. POSITION: 'position'
  2825. /**
  2826. * ------------------------------------------------------------------------
  2827. * Class Definition
  2828. * ------------------------------------------------------------------------
  2829. */
  2830. };
  2831. var ScrollSpy =
  2832. /*#__PURE__*/
  2833. function () {
  2834. function ScrollSpy(element, config) {
  2835. var _this = this;
  2836. this._element = element;
  2837. this._scrollElement = element.tagName === 'BODY' ? window : element;
  2838. this._config = this._getConfig(config);
  2839. this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
  2840. this._offsets = [];
  2841. this._targets = [];
  2842. this._activeTarget = null;
  2843. this._scrollHeight = 0;
  2844. $(this._scrollElement).on(Event$8.SCROLL, function (event) {
  2845. return _this._process(event);
  2846. });
  2847. this.refresh();
  2848. this._process();
  2849. } // Getters
  2850. var _proto = ScrollSpy.prototype;
  2851. // Public
  2852. _proto.refresh = function refresh() {
  2853. var _this2 = this;
  2854. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  2855. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  2856. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  2857. this._offsets = [];
  2858. this._targets = [];
  2859. this._scrollHeight = this._getScrollHeight();
  2860. var targets = [].slice.call(document.querySelectorAll(this._selector));
  2861. targets.map(function (element) {
  2862. var target;
  2863. var targetSelector = Util.getSelectorFromElement(element);
  2864. if (targetSelector) {
  2865. target = document.querySelector(targetSelector);
  2866. }
  2867. if (target) {
  2868. var targetBCR = target.getBoundingClientRect();
  2869. if (targetBCR.width || targetBCR.height) {
  2870. // TODO (fat): remove sketch reliance on jQuery position/offset
  2871. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  2872. }
  2873. }
  2874. return null;
  2875. }).filter(function (item) {
  2876. return item;
  2877. }).sort(function (a, b) {
  2878. return a[0] - b[0];
  2879. }).forEach(function (item) {
  2880. _this2._offsets.push(item[0]);
  2881. _this2._targets.push(item[1]);
  2882. });
  2883. };
  2884. _proto.dispose = function dispose() {
  2885. $.removeData(this._element, DATA_KEY$8);
  2886. $(this._scrollElement).off(EVENT_KEY$8);
  2887. this._element = null;
  2888. this._scrollElement = null;
  2889. this._config = null;
  2890. this._selector = null;
  2891. this._offsets = null;
  2892. this._targets = null;
  2893. this._activeTarget = null;
  2894. this._scrollHeight = null;
  2895. }; // Private
  2896. _proto._getConfig = function _getConfig(config) {
  2897. config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});
  2898. if (typeof config.target !== 'string') {
  2899. var id = $(config.target).attr('id');
  2900. if (!id) {
  2901. id = Util.getUID(NAME$8);
  2902. $(config.target).attr('id', id);
  2903. }
  2904. config.target = "#" + id;
  2905. }
  2906. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  2907. return config;
  2908. };
  2909. _proto._getScrollTop = function _getScrollTop() {
  2910. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  2911. };
  2912. _proto._getScrollHeight = function _getScrollHeight() {
  2913. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  2914. };
  2915. _proto._getOffsetHeight = function _getOffsetHeight() {
  2916. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  2917. };
  2918. _proto._process = function _process() {
  2919. var scrollTop = this._getScrollTop() + this._config.offset;
  2920. var scrollHeight = this._getScrollHeight();
  2921. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  2922. if (this._scrollHeight !== scrollHeight) {
  2923. this.refresh();
  2924. }
  2925. if (scrollTop >= maxScroll) {
  2926. var target = this._targets[this._targets.length - 1];
  2927. if (this._activeTarget !== target) {
  2928. this._activate(target);
  2929. }
  2930. return;
  2931. }
  2932. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  2933. this._activeTarget = null;
  2934. this._clear();
  2935. return;
  2936. }
  2937. var offsetLength = this._offsets.length;
  2938. for (var i = offsetLength; i--;) {
  2939. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  2940. if (isActiveTarget) {
  2941. this._activate(this._targets[i]);
  2942. }
  2943. }
  2944. };
  2945. _proto._activate = function _activate(target) {
  2946. this._activeTarget = target;
  2947. this._clear();
  2948. var queries = this._selector.split(',').map(function (selector) {
  2949. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  2950. });
  2951. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  2952. if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
  2953. $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
  2954. $link.addClass(ClassName$8.ACTIVE);
  2955. } else {
  2956. // Set triggered link as active
  2957. $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
  2958. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  2959. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
  2960. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
  2961. }
  2962. $(this._scrollElement).trigger(Event$8.ACTIVATE, {
  2963. relatedTarget: target
  2964. });
  2965. };
  2966. _proto._clear = function _clear() {
  2967. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  2968. return node.classList.contains(ClassName$8.ACTIVE);
  2969. }).forEach(function (node) {
  2970. return node.classList.remove(ClassName$8.ACTIVE);
  2971. });
  2972. }; // Static
  2973. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  2974. return this.each(function () {
  2975. var data = $(this).data(DATA_KEY$8);
  2976. var _config = typeof config === 'object' && config;
  2977. if (!data) {
  2978. data = new ScrollSpy(this, _config);
  2979. $(this).data(DATA_KEY$8, data);
  2980. }
  2981. if (typeof config === 'string') {
  2982. if (typeof data[config] === 'undefined') {
  2983. throw new TypeError("No method named \"" + config + "\"");
  2984. }
  2985. data[config]();
  2986. }
  2987. });
  2988. };
  2989. _createClass(ScrollSpy, null, [{
  2990. key: "VERSION",
  2991. get: function get() {
  2992. return VERSION$8;
  2993. }
  2994. }, {
  2995. key: "Default",
  2996. get: function get() {
  2997. return Default$6;
  2998. }
  2999. }]);
  3000. return ScrollSpy;
  3001. }();
  3002. /**
  3003. * ------------------------------------------------------------------------
  3004. * Data Api implementation
  3005. * ------------------------------------------------------------------------
  3006. */
  3007. $(window).on(Event$8.LOAD_DATA_API, function () {
  3008. var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
  3009. var scrollSpysLength = scrollSpys.length;
  3010. for (var i = scrollSpysLength; i--;) {
  3011. var $spy = $(scrollSpys[i]);
  3012. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  3013. }
  3014. });
  3015. /**
  3016. * ------------------------------------------------------------------------
  3017. * jQuery
  3018. * ------------------------------------------------------------------------
  3019. */
  3020. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  3021. $.fn[NAME$8].Constructor = ScrollSpy;
  3022. $.fn[NAME$8].noConflict = function () {
  3023. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  3024. return ScrollSpy._jQueryInterface;
  3025. };
  3026. /**
  3027. * ------------------------------------------------------------------------
  3028. * Constants
  3029. * ------------------------------------------------------------------------
  3030. */
  3031. var NAME$9 = 'tab';
  3032. var VERSION$9 = '4.2.1';
  3033. var DATA_KEY$9 = 'bs.tab';
  3034. var EVENT_KEY$9 = "." + DATA_KEY$9;
  3035. var DATA_API_KEY$7 = '.data-api';
  3036. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  3037. var Event$9 = {
  3038. HIDE: "hide" + EVENT_KEY$9,
  3039. HIDDEN: "hidden" + EVENT_KEY$9,
  3040. SHOW: "show" + EVENT_KEY$9,
  3041. SHOWN: "shown" + EVENT_KEY$9,
  3042. CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  3043. };
  3044. var ClassName$9 = {
  3045. DROPDOWN_MENU: 'dropdown-menu',
  3046. ACTIVE: 'active',
  3047. DISABLED: 'disabled',
  3048. FADE: 'fade',
  3049. SHOW: 'show'
  3050. };
  3051. var Selector$9 = {
  3052. DROPDOWN: '.dropdown',
  3053. NAV_LIST_GROUP: '.nav, .list-group',
  3054. ACTIVE: '.active',
  3055. ACTIVE_UL: '> li > .active',
  3056. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  3057. DROPDOWN_TOGGLE: '.dropdown-toggle',
  3058. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  3059. /**
  3060. * ------------------------------------------------------------------------
  3061. * Class Definition
  3062. * ------------------------------------------------------------------------
  3063. */
  3064. };
  3065. var Tab =
  3066. /*#__PURE__*/
  3067. function () {
  3068. function Tab(element) {
  3069. this._element = element;
  3070. } // Getters
  3071. var _proto = Tab.prototype;
  3072. // Public
  3073. _proto.show = function show() {
  3074. var _this = this;
  3075. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
  3076. return;
  3077. }
  3078. var target;
  3079. var previous;
  3080. var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
  3081. var selector = Util.getSelectorFromElement(this._element);
  3082. if (listElement) {
  3083. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
  3084. previous = $.makeArray($(listElement).find(itemSelector));
  3085. previous = previous[previous.length - 1];
  3086. }
  3087. var hideEvent = $.Event(Event$9.HIDE, {
  3088. relatedTarget: this._element
  3089. });
  3090. var showEvent = $.Event(Event$9.SHOW, {
  3091. relatedTarget: previous
  3092. });
  3093. if (previous) {
  3094. $(previous).trigger(hideEvent);
  3095. }
  3096. $(this._element).trigger(showEvent);
  3097. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  3098. return;
  3099. }
  3100. if (selector) {
  3101. target = document.querySelector(selector);
  3102. }
  3103. this._activate(this._element, listElement);
  3104. var complete = function complete() {
  3105. var hiddenEvent = $.Event(Event$9.HIDDEN, {
  3106. relatedTarget: _this._element
  3107. });
  3108. var shownEvent = $.Event(Event$9.SHOWN, {
  3109. relatedTarget: previous
  3110. });
  3111. $(previous).trigger(hiddenEvent);
  3112. $(_this._element).trigger(shownEvent);
  3113. };
  3114. if (target) {
  3115. this._activate(target, target.parentNode, complete);
  3116. } else {
  3117. complete();
  3118. }
  3119. };
  3120. _proto.dispose = function dispose() {
  3121. $.removeData(this._element, DATA_KEY$9);
  3122. this._element = null;
  3123. }; // Private
  3124. _proto._activate = function _activate(element, container, callback) {
  3125. var _this2 = this;
  3126. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
  3127. var active = activeElements[0];
  3128. var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
  3129. var complete = function complete() {
  3130. return _this2._transitionComplete(element, active, callback);
  3131. };
  3132. if (active && isTransitioning) {
  3133. var transitionDuration = Util.getTransitionDurationFromElement(active);
  3134. $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3135. } else {
  3136. complete();
  3137. }
  3138. };
  3139. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  3140. if (active) {
  3141. $(active).removeClass(ClassName$9.ACTIVE);
  3142. var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
  3143. if (dropdownChild) {
  3144. $(dropdownChild).removeClass(ClassName$9.ACTIVE);
  3145. }
  3146. if (active.getAttribute('role') === 'tab') {
  3147. active.setAttribute('aria-selected', false);
  3148. }
  3149. }
  3150. $(element).addClass(ClassName$9.ACTIVE);
  3151. if (element.getAttribute('role') === 'tab') {
  3152. element.setAttribute('aria-selected', true);
  3153. }
  3154. Util.reflow(element);
  3155. $(element).addClass(ClassName$9.SHOW);
  3156. if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
  3157. var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
  3158. if (dropdownElement) {
  3159. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
  3160. $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
  3161. }
  3162. element.setAttribute('aria-expanded', true);
  3163. }
  3164. if (callback) {
  3165. callback();
  3166. }
  3167. }; // Static
  3168. Tab._jQueryInterface = function _jQueryInterface(config) {
  3169. return this.each(function () {
  3170. var $this = $(this);
  3171. var data = $this.data(DATA_KEY$9);
  3172. if (!data) {
  3173. data = new Tab(this);
  3174. $this.data(DATA_KEY$9, data);
  3175. }
  3176. if (typeof config === 'string') {
  3177. if (typeof data[config] === 'undefined') {
  3178. throw new TypeError("No method named \"" + config + "\"");
  3179. }
  3180. data[config]();
  3181. }
  3182. });
  3183. };
  3184. _createClass(Tab, null, [{
  3185. key: "VERSION",
  3186. get: function get() {
  3187. return VERSION$9;
  3188. }
  3189. }]);
  3190. return Tab;
  3191. }();
  3192. /**
  3193. * ------------------------------------------------------------------------
  3194. * Data Api implementation
  3195. * ------------------------------------------------------------------------
  3196. */
  3197. $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  3198. event.preventDefault();
  3199. Tab._jQueryInterface.call($(this), 'show');
  3200. });
  3201. /**
  3202. * ------------------------------------------------------------------------
  3203. * jQuery
  3204. * ------------------------------------------------------------------------
  3205. */
  3206. $.fn[NAME$9] = Tab._jQueryInterface;
  3207. $.fn[NAME$9].Constructor = Tab;
  3208. $.fn[NAME$9].noConflict = function () {
  3209. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  3210. return Tab._jQueryInterface;
  3211. };
  3212. /**
  3213. * ------------------------------------------------------------------------
  3214. * Constants
  3215. * ------------------------------------------------------------------------
  3216. */
  3217. var NAME$a = 'toast';
  3218. var VERSION$a = '4.2.1';
  3219. var DATA_KEY$a = 'bs.toast';
  3220. var EVENT_KEY$a = "." + DATA_KEY$a;
  3221. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  3222. var Event$a = {
  3223. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  3224. HIDE: "hide" + EVENT_KEY$a,
  3225. HIDDEN: "hidden" + EVENT_KEY$a,
  3226. SHOW: "show" + EVENT_KEY$a,
  3227. SHOWN: "shown" + EVENT_KEY$a
  3228. };
  3229. var ClassName$a = {
  3230. FADE: 'fade',
  3231. HIDE: 'hide',
  3232. SHOW: 'show',
  3233. SHOWING: 'showing'
  3234. };
  3235. var DefaultType$7 = {
  3236. animation: 'boolean',
  3237. autohide: 'boolean',
  3238. delay: 'number'
  3239. };
  3240. var Default$7 = {
  3241. animation: true,
  3242. autohide: true,
  3243. delay: 500
  3244. };
  3245. var Selector$a = {
  3246. DATA_DISMISS: '[data-dismiss="toast"]'
  3247. /**
  3248. * ------------------------------------------------------------------------
  3249. * Class Definition
  3250. * ------------------------------------------------------------------------
  3251. */
  3252. };
  3253. var Toast =
  3254. /*#__PURE__*/
  3255. function () {
  3256. function Toast(element, config) {
  3257. this._element = element;
  3258. this._config = this._getConfig(config);
  3259. this._timeout = null;
  3260. this._setListeners();
  3261. } // Getters
  3262. var _proto = Toast.prototype;
  3263. // Public
  3264. _proto.show = function show() {
  3265. var _this = this;
  3266. $(this._element).trigger(Event$a.SHOW);
  3267. if (this._config.animation) {
  3268. this._element.classList.add(ClassName$a.FADE);
  3269. }
  3270. var complete = function complete() {
  3271. _this._element.classList.remove(ClassName$a.SHOWING);
  3272. _this._element.classList.add(ClassName$a.SHOW);
  3273. $(_this._element).trigger(Event$a.SHOWN);
  3274. if (_this._config.autohide) {
  3275. _this.hide();
  3276. }
  3277. };
  3278. this._element.classList.remove(ClassName$a.HIDE);
  3279. this._element.classList.add(ClassName$a.SHOWING);
  3280. if (this._config.animation) {
  3281. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3282. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3283. } else {
  3284. complete();
  3285. }
  3286. };
  3287. _proto.hide = function hide(withoutTimeout) {
  3288. var _this2 = this;
  3289. if (!this._element.classList.contains(ClassName$a.SHOW)) {
  3290. return;
  3291. }
  3292. $(this._element).trigger(Event$a.HIDE);
  3293. if (withoutTimeout) {
  3294. this._close();
  3295. } else {
  3296. this._timeout = setTimeout(function () {
  3297. _this2._close();
  3298. }, this._config.delay);
  3299. }
  3300. };
  3301. _proto.dispose = function dispose() {
  3302. clearTimeout(this._timeout);
  3303. this._timeout = null;
  3304. if (this._element.classList.contains(ClassName$a.SHOW)) {
  3305. this._element.classList.remove(ClassName$a.SHOW);
  3306. }
  3307. $(this._element).off(Event$a.CLICK_DISMISS);
  3308. $.removeData(this._element, DATA_KEY$a);
  3309. this._element = null;
  3310. this._config = null;
  3311. }; // Private
  3312. _proto._getConfig = function _getConfig(config) {
  3313. config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {});
  3314. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  3315. return config;
  3316. };
  3317. _proto._setListeners = function _setListeners() {
  3318. var _this3 = this;
  3319. $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
  3320. return _this3.hide(true);
  3321. });
  3322. };
  3323. _proto._close = function _close() {
  3324. var _this4 = this;
  3325. var complete = function complete() {
  3326. _this4._element.classList.add(ClassName$a.HIDE);
  3327. $(_this4._element).trigger(Event$a.HIDDEN);
  3328. };
  3329. this._element.classList.remove(ClassName$a.SHOW);
  3330. if (this._config.animation) {
  3331. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3332. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3333. } else {
  3334. complete();
  3335. }
  3336. }; // Static
  3337. Toast._jQueryInterface = function _jQueryInterface(config) {
  3338. return this.each(function () {
  3339. var $element = $(this);
  3340. var data = $element.data(DATA_KEY$a);
  3341. var _config = typeof config === 'object' && config;
  3342. if (!data) {
  3343. data = new Toast(this, _config);
  3344. $element.data(DATA_KEY$a, data);
  3345. }
  3346. if (typeof config === 'string') {
  3347. if (typeof data[config] === 'undefined') {
  3348. throw new TypeError("No method named \"" + config + "\"");
  3349. }
  3350. data[config](this);
  3351. }
  3352. });
  3353. };
  3354. _createClass(Toast, null, [{
  3355. key: "VERSION",
  3356. get: function get() {
  3357. return VERSION$a;
  3358. }
  3359. }, {
  3360. key: "DefaultType",
  3361. get: function get() {
  3362. return DefaultType$7;
  3363. }
  3364. }]);
  3365. return Toast;
  3366. }();
  3367. /**
  3368. * ------------------------------------------------------------------------
  3369. * jQuery
  3370. * ------------------------------------------------------------------------
  3371. */
  3372. $.fn[NAME$a] = Toast._jQueryInterface;
  3373. $.fn[NAME$a].Constructor = Toast;
  3374. $.fn[NAME$a].noConflict = function () {
  3375. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  3376. return Toast._jQueryInterface;
  3377. };
  3378. /**
  3379. * --------------------------------------------------------------------------
  3380. * Bootstrap (v4.2.1): index.js
  3381. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3382. * --------------------------------------------------------------------------
  3383. */
  3384. (function () {
  3385. if (typeof $ === 'undefined') {
  3386. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  3387. }
  3388. var version = $.fn.jquery.split(' ')[0].split('.');
  3389. var minMajor = 1;
  3390. var ltMajor = 2;
  3391. var minMinor = 9;
  3392. var minPatch = 1;
  3393. var maxMajor = 4;
  3394. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  3395. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  3396. }
  3397. })();
  3398. exports.Util = Util;
  3399. exports.Alert = Alert;
  3400. exports.Button = Button;
  3401. exports.Carousel = Carousel;
  3402. exports.Collapse = Collapse;
  3403. exports.Dropdown = Dropdown;
  3404. exports.Modal = Modal;
  3405. exports.Popover = Popover;
  3406. exports.Scrollspy = ScrollSpy;
  3407. exports.Tab = Tab;
  3408. exports.Toast = Toast;
  3409. exports.Tooltip = Tooltip;
  3410. Object.defineProperty(exports, '__esModule', { value: true });
  3411. })));
  3412. //# sourceMappingURL=bootstrap.js.map