bootstrap.js 162 KB

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