bootstrap.js 148 KB

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