bootstrap.bundle.js 205 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650
  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() :
  8. typeof define === 'function' && define.amd ? define(factory) :
  9. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory());
  10. }(this, (function () { 'use strict';
  11. function _defineProperties(target, props) {
  12. for (var i = 0; i < props.length; i++) {
  13. var descriptor = props[i];
  14. descriptor.enumerable = descriptor.enumerable || false;
  15. descriptor.configurable = true;
  16. if ("value" in descriptor) descriptor.writable = true;
  17. Object.defineProperty(target, descriptor.key, descriptor);
  18. }
  19. }
  20. function _createClass(Constructor, protoProps, staticProps) {
  21. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  22. if (staticProps) _defineProperties(Constructor, staticProps);
  23. return Constructor;
  24. }
  25. function _extends() {
  26. _extends = Object.assign || function (target) {
  27. for (var i = 1; i < arguments.length; i++) {
  28. var source = arguments[i];
  29. for (var key in source) {
  30. if (Object.prototype.hasOwnProperty.call(source, key)) {
  31. target[key] = source[key];
  32. }
  33. }
  34. }
  35. return target;
  36. };
  37. return _extends.apply(this, arguments);
  38. }
  39. function _inheritsLoose(subClass, superClass) {
  40. subClass.prototype = Object.create(superClass.prototype);
  41. subClass.prototype.constructor = subClass;
  42. _setPrototypeOf(subClass, superClass);
  43. }
  44. function _setPrototypeOf(o, p) {
  45. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  46. o.__proto__ = p;
  47. return o;
  48. };
  49. return _setPrototypeOf(o, p);
  50. }
  51. /**
  52. * --------------------------------------------------------------------------
  53. * Bootstrap (v5.0.0-beta2): util/index.js
  54. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  55. * --------------------------------------------------------------------------
  56. */
  57. var MAX_UID = 1000000;
  58. var MILLISECONDS_MULTIPLIER = 1000;
  59. var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  60. var toType = function toType(obj) {
  61. if (obj === null || obj === undefined) {
  62. return "" + obj;
  63. }
  64. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  65. };
  66. /**
  67. * --------------------------------------------------------------------------
  68. * Public Util Api
  69. * --------------------------------------------------------------------------
  70. */
  71. var getUID = function getUID(prefix) {
  72. do {
  73. prefix += Math.floor(Math.random() * MAX_UID);
  74. } while (document.getElementById(prefix));
  75. return prefix;
  76. };
  77. var getSelector = function getSelector(element) {
  78. var selector = element.getAttribute('data-bs-target');
  79. if (!selector || selector === '#') {
  80. var hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
  81. // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
  82. // `document.querySelector` will rightfully complain it is invalid.
  83. // See https://github.com/twbs/bootstrap/issues/32273
  84. if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
  85. return null;
  86. } // Just in case some CMS puts out a full URL with the anchor appended
  87. if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
  88. hrefAttr = '#' + hrefAttr.split('#')[1];
  89. }
  90. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
  91. }
  92. return selector;
  93. };
  94. var getSelectorFromElement = function getSelectorFromElement(element) {
  95. var selector = getSelector(element);
  96. if (selector) {
  97. return document.querySelector(selector) ? selector : null;
  98. }
  99. return null;
  100. };
  101. var getElementFromSelector = function getElementFromSelector(element) {
  102. var selector = getSelector(element);
  103. return selector ? document.querySelector(selector) : null;
  104. };
  105. var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
  106. if (!element) {
  107. return 0;
  108. } // Get transition-duration of the element
  109. var _window$getComputedSt = window.getComputedStyle(element),
  110. transitionDuration = _window$getComputedSt.transitionDuration,
  111. transitionDelay = _window$getComputedSt.transitionDelay;
  112. var floatTransitionDuration = Number.parseFloat(transitionDuration);
  113. var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  114. if (!floatTransitionDuration && !floatTransitionDelay) {
  115. return 0;
  116. } // If multiple durations are defined, take the first
  117. transitionDuration = transitionDuration.split(',')[0];
  118. transitionDelay = transitionDelay.split(',')[0];
  119. return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  120. };
  121. var triggerTransitionEnd = function triggerTransitionEnd(element) {
  122. element.dispatchEvent(new Event(TRANSITION_END));
  123. };
  124. var isElement = function isElement(obj) {
  125. return (obj[0] || obj).nodeType;
  126. };
  127. var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
  128. var called = false;
  129. var durationPadding = 5;
  130. var emulatedDuration = duration + durationPadding;
  131. function listener() {
  132. called = true;
  133. element.removeEventListener(TRANSITION_END, listener);
  134. }
  135. element.addEventListener(TRANSITION_END, listener);
  136. setTimeout(function () {
  137. if (!called) {
  138. triggerTransitionEnd(element);
  139. }
  140. }, emulatedDuration);
  141. };
  142. var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
  143. Object.keys(configTypes).forEach(function (property) {
  144. var expectedTypes = configTypes[property];
  145. var value = config[property];
  146. var valueType = value && isElement(value) ? 'element' : toType(value);
  147. if (!new RegExp(expectedTypes).test(valueType)) {
  148. throw new TypeError(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  149. }
  150. });
  151. };
  152. var isVisible = function isVisible(element) {
  153. if (!element) {
  154. return false;
  155. }
  156. if (element.style && element.parentNode && element.parentNode.style) {
  157. var elementStyle = getComputedStyle(element);
  158. var parentNodeStyle = getComputedStyle(element.parentNode);
  159. return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden';
  160. }
  161. return false;
  162. };
  163. var findShadowRoot = function findShadowRoot(element) {
  164. if (!document.documentElement.attachShadow) {
  165. return null;
  166. } // Can find the shadow root otherwise it'll return the document
  167. if (typeof element.getRootNode === 'function') {
  168. var root = element.getRootNode();
  169. return root instanceof ShadowRoot ? root : null;
  170. }
  171. if (element instanceof ShadowRoot) {
  172. return element;
  173. } // when we don't find a shadow root
  174. if (!element.parentNode) {
  175. return null;
  176. }
  177. return findShadowRoot(element.parentNode);
  178. };
  179. var noop = function noop() {
  180. return function () {};
  181. };
  182. var reflow = function reflow(element) {
  183. return element.offsetHeight;
  184. };
  185. var getjQuery = function getjQuery() {
  186. var _window = window,
  187. jQuery = _window.jQuery;
  188. if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
  189. return jQuery;
  190. }
  191. return null;
  192. };
  193. var onDOMContentLoaded = function onDOMContentLoaded(callback) {
  194. if (document.readyState === 'loading') {
  195. document.addEventListener('DOMContentLoaded', callback);
  196. } else {
  197. callback();
  198. }
  199. };
  200. var isRTL = document.documentElement.dir === 'rtl';
  201. var defineJQueryPlugin = function defineJQueryPlugin(name, plugin) {
  202. onDOMContentLoaded(function () {
  203. var $ = getjQuery();
  204. /* istanbul ignore if */
  205. if ($) {
  206. var JQUERY_NO_CONFLICT = $.fn[name];
  207. $.fn[name] = plugin.jQueryInterface;
  208. $.fn[name].Constructor = plugin;
  209. $.fn[name].noConflict = function () {
  210. $.fn[name] = JQUERY_NO_CONFLICT;
  211. return plugin.jQueryInterface;
  212. };
  213. }
  214. });
  215. };
  216. /**
  217. * --------------------------------------------------------------------------
  218. * Bootstrap (v5.0.0-beta2): dom/data.js
  219. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  220. * --------------------------------------------------------------------------
  221. */
  222. /**
  223. * ------------------------------------------------------------------------
  224. * Constants
  225. * ------------------------------------------------------------------------
  226. */
  227. var mapData = function () {
  228. var storeData = {};
  229. var id = 1;
  230. return {
  231. set: function set(element, key, data) {
  232. if (typeof element.bsKey === 'undefined') {
  233. element.bsKey = {
  234. key: key,
  235. id: id
  236. };
  237. id++;
  238. }
  239. storeData[element.bsKey.id] = data;
  240. },
  241. get: function get(element, key) {
  242. if (!element || typeof element.bsKey === 'undefined') {
  243. return null;
  244. }
  245. var keyProperties = element.bsKey;
  246. if (keyProperties.key === key) {
  247. return storeData[keyProperties.id];
  248. }
  249. return null;
  250. },
  251. delete: function _delete(element, key) {
  252. if (typeof element.bsKey === 'undefined') {
  253. return;
  254. }
  255. var keyProperties = element.bsKey;
  256. if (keyProperties.key === key) {
  257. delete storeData[keyProperties.id];
  258. delete element.bsKey;
  259. }
  260. }
  261. };
  262. }();
  263. var Data = {
  264. setData: function setData(instance, key, data) {
  265. mapData.set(instance, key, data);
  266. },
  267. getData: function getData(instance, key) {
  268. return mapData.get(instance, key);
  269. },
  270. removeData: function removeData(instance, key) {
  271. mapData.delete(instance, key);
  272. }
  273. };
  274. /**
  275. * --------------------------------------------------------------------------
  276. * Bootstrap (v5.0.0-beta2): dom/event-handler.js
  277. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  278. * --------------------------------------------------------------------------
  279. */
  280. /**
  281. * ------------------------------------------------------------------------
  282. * Constants
  283. * ------------------------------------------------------------------------
  284. */
  285. var namespaceRegex = /[^.]*(?=\..*)\.|.*/;
  286. var stripNameRegex = /\..*/;
  287. var stripUidRegex = /::\d+$/;
  288. var eventRegistry = {}; // Events storage
  289. var uidEvent = 1;
  290. var customEvents = {
  291. mouseenter: 'mouseover',
  292. mouseleave: 'mouseout'
  293. };
  294. 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']);
  295. /**
  296. * ------------------------------------------------------------------------
  297. * Private methods
  298. * ------------------------------------------------------------------------
  299. */
  300. function getUidEvent(element, uid) {
  301. return uid && uid + "::" + uidEvent++ || element.uidEvent || uidEvent++;
  302. }
  303. function getEvent(element) {
  304. var uid = getUidEvent(element);
  305. element.uidEvent = uid;
  306. eventRegistry[uid] = eventRegistry[uid] || {};
  307. return eventRegistry[uid];
  308. }
  309. function bootstrapHandler(element, fn) {
  310. return function handler(event) {
  311. event.delegateTarget = element;
  312. if (handler.oneOff) {
  313. EventHandler.off(element, event.type, fn);
  314. }
  315. return fn.apply(element, [event]);
  316. };
  317. }
  318. function bootstrapDelegationHandler(element, selector, fn) {
  319. return function handler(event) {
  320. var domElements = element.querySelectorAll(selector);
  321. for (var target = event.target; target && target !== this; target = target.parentNode) {
  322. for (var i = domElements.length; i--;) {
  323. if (domElements[i] === target) {
  324. event.delegateTarget = target;
  325. if (handler.oneOff) {
  326. // eslint-disable-next-line unicorn/consistent-destructuring
  327. EventHandler.off(element, event.type, fn);
  328. }
  329. return fn.apply(target, [event]);
  330. }
  331. }
  332. } // To please ESLint
  333. return null;
  334. };
  335. }
  336. function findHandler(events, handler, delegationSelector) {
  337. if (delegationSelector === void 0) {
  338. delegationSelector = null;
  339. }
  340. var uidEventList = Object.keys(events);
  341. for (var i = 0, len = uidEventList.length; i < len; i++) {
  342. var event = events[uidEventList[i]];
  343. if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
  344. return event;
  345. }
  346. }
  347. return null;
  348. }
  349. function normalizeParams(originalTypeEvent, handler, delegationFn) {
  350. var delegation = typeof handler === 'string';
  351. var originalHandler = delegation ? delegationFn : handler; // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
  352. var typeEvent = originalTypeEvent.replace(stripNameRegex, '');
  353. var custom = customEvents[typeEvent];
  354. if (custom) {
  355. typeEvent = custom;
  356. }
  357. var isNative = nativeEvents.has(typeEvent);
  358. if (!isNative) {
  359. typeEvent = originalTypeEvent;
  360. }
  361. return [delegation, originalHandler, typeEvent];
  362. }
  363. function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
  364. if (typeof originalTypeEvent !== 'string' || !element) {
  365. return;
  366. }
  367. if (!handler) {
  368. handler = delegationFn;
  369. delegationFn = null;
  370. }
  371. var _normalizeParams = normalizeParams(originalTypeEvent, handler, delegationFn),
  372. delegation = _normalizeParams[0],
  373. originalHandler = _normalizeParams[1],
  374. typeEvent = _normalizeParams[2];
  375. var events = getEvent(element);
  376. var handlers = events[typeEvent] || (events[typeEvent] = {});
  377. var previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
  378. if (previousFn) {
  379. previousFn.oneOff = previousFn.oneOff && oneOff;
  380. return;
  381. }
  382. var uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
  383. var fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
  384. fn.delegationSelector = delegation ? handler : null;
  385. fn.originalHandler = originalHandler;
  386. fn.oneOff = oneOff;
  387. fn.uidEvent = uid;
  388. handlers[uid] = fn;
  389. element.addEventListener(typeEvent, fn, delegation);
  390. }
  391. function removeHandler(element, events, typeEvent, handler, delegationSelector) {
  392. var fn = findHandler(events[typeEvent], handler, delegationSelector);
  393. if (!fn) {
  394. return;
  395. }
  396. element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
  397. delete events[typeEvent][fn.uidEvent];
  398. }
  399. function removeNamespacedHandlers(element, events, typeEvent, namespace) {
  400. var storeElementEvent = events[typeEvent] || {};
  401. Object.keys(storeElementEvent).forEach(function (handlerKey) {
  402. if (handlerKey.includes(namespace)) {
  403. var event = storeElementEvent[handlerKey];
  404. removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
  405. }
  406. });
  407. }
  408. var EventHandler = {
  409. on: function on(element, event, handler, delegationFn) {
  410. addHandler(element, event, handler, delegationFn, false);
  411. },
  412. one: function one(element, event, handler, delegationFn) {
  413. addHandler(element, event, handler, delegationFn, true);
  414. },
  415. off: function off(element, originalTypeEvent, handler, delegationFn) {
  416. if (typeof originalTypeEvent !== 'string' || !element) {
  417. return;
  418. }
  419. var _normalizeParams2 = normalizeParams(originalTypeEvent, handler, delegationFn),
  420. delegation = _normalizeParams2[0],
  421. originalHandler = _normalizeParams2[1],
  422. typeEvent = _normalizeParams2[2];
  423. var inNamespace = typeEvent !== originalTypeEvent;
  424. var events = getEvent(element);
  425. var isNamespace = originalTypeEvent.startsWith('.');
  426. if (typeof originalHandler !== 'undefined') {
  427. // Simplest case: handler is passed, remove that listener ONLY.
  428. if (!events || !events[typeEvent]) {
  429. return;
  430. }
  431. removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
  432. return;
  433. }
  434. if (isNamespace) {
  435. Object.keys(events).forEach(function (elementEvent) {
  436. removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
  437. });
  438. }
  439. var storeElementEvent = events[typeEvent] || {};
  440. Object.keys(storeElementEvent).forEach(function (keyHandlers) {
  441. var handlerKey = keyHandlers.replace(stripUidRegex, '');
  442. if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
  443. var event = storeElementEvent[keyHandlers];
  444. removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
  445. }
  446. });
  447. },
  448. trigger: function trigger(element, event, args) {
  449. if (typeof event !== 'string' || !element) {
  450. return null;
  451. }
  452. var $ = getjQuery();
  453. var typeEvent = event.replace(stripNameRegex, '');
  454. var inNamespace = event !== typeEvent;
  455. var isNative = nativeEvents.has(typeEvent);
  456. var jQueryEvent;
  457. var bubbles = true;
  458. var nativeDispatch = true;
  459. var defaultPrevented = false;
  460. var evt = null;
  461. if (inNamespace && $) {
  462. jQueryEvent = $.Event(event, args);
  463. $(element).trigger(jQueryEvent);
  464. bubbles = !jQueryEvent.isPropagationStopped();
  465. nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
  466. defaultPrevented = jQueryEvent.isDefaultPrevented();
  467. }
  468. if (isNative) {
  469. evt = document.createEvent('HTMLEvents');
  470. evt.initEvent(typeEvent, bubbles, true);
  471. } else {
  472. evt = new CustomEvent(event, {
  473. bubbles: bubbles,
  474. cancelable: true
  475. });
  476. } // merge custom information in our event
  477. if (typeof args !== 'undefined') {
  478. Object.keys(args).forEach(function (key) {
  479. Object.defineProperty(evt, key, {
  480. get: function get() {
  481. return args[key];
  482. }
  483. });
  484. });
  485. }
  486. if (defaultPrevented) {
  487. evt.preventDefault();
  488. }
  489. if (nativeDispatch) {
  490. element.dispatchEvent(evt);
  491. }
  492. if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
  493. jQueryEvent.preventDefault();
  494. }
  495. return evt;
  496. }
  497. };
  498. /**
  499. * ------------------------------------------------------------------------
  500. * Constants
  501. * ------------------------------------------------------------------------
  502. */
  503. var VERSION = '5.0.0-beta2';
  504. var BaseComponent = /*#__PURE__*/function () {
  505. function BaseComponent(element) {
  506. if (!element) {
  507. return;
  508. }
  509. this._element = element;
  510. Data.setData(element, this.constructor.DATA_KEY, this);
  511. }
  512. var _proto = BaseComponent.prototype;
  513. _proto.dispose = function dispose() {
  514. Data.removeData(this._element, this.constructor.DATA_KEY);
  515. this._element = null;
  516. }
  517. /** Static */
  518. ;
  519. BaseComponent.getInstance = function getInstance(element) {
  520. return Data.getData(element, this.DATA_KEY);
  521. };
  522. _createClass(BaseComponent, null, [{
  523. key: "VERSION",
  524. get: function get() {
  525. return VERSION;
  526. }
  527. }]);
  528. return BaseComponent;
  529. }();
  530. /**
  531. * ------------------------------------------------------------------------
  532. * Constants
  533. * ------------------------------------------------------------------------
  534. */
  535. var NAME = 'alert';
  536. var DATA_KEY = 'bs.alert';
  537. var EVENT_KEY = "." + DATA_KEY;
  538. var DATA_API_KEY = '.data-api';
  539. var SELECTOR_DISMISS = '[data-bs-dismiss="alert"]';
  540. var EVENT_CLOSE = "close" + EVENT_KEY;
  541. var EVENT_CLOSED = "closed" + EVENT_KEY;
  542. var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
  543. var CLASS_NAME_ALERT = 'alert';
  544. var CLASS_NAME_FADE = 'fade';
  545. var CLASS_NAME_SHOW = 'show';
  546. /**
  547. * ------------------------------------------------------------------------
  548. * Class Definition
  549. * ------------------------------------------------------------------------
  550. */
  551. var Alert = /*#__PURE__*/function (_BaseComponent) {
  552. _inheritsLoose(Alert, _BaseComponent);
  553. function Alert() {
  554. return _BaseComponent.apply(this, arguments) || this;
  555. }
  556. var _proto = Alert.prototype;
  557. // Public
  558. _proto.close = function close(element) {
  559. var rootElement = element ? this._getRootElement(element) : this._element;
  560. var customEvent = this._triggerCloseEvent(rootElement);
  561. if (customEvent === null || customEvent.defaultPrevented) {
  562. return;
  563. }
  564. this._removeElement(rootElement);
  565. } // Private
  566. ;
  567. _proto._getRootElement = function _getRootElement(element) {
  568. return getElementFromSelector(element) || element.closest("." + CLASS_NAME_ALERT);
  569. };
  570. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  571. return EventHandler.trigger(element, EVENT_CLOSE);
  572. };
  573. _proto._removeElement = function _removeElement(element) {
  574. var _this = this;
  575. element.classList.remove(CLASS_NAME_SHOW);
  576. if (!element.classList.contains(CLASS_NAME_FADE)) {
  577. this._destroyElement(element);
  578. return;
  579. }
  580. var transitionDuration = getTransitionDurationFromElement(element);
  581. EventHandler.one(element, 'transitionend', function () {
  582. return _this._destroyElement(element);
  583. });
  584. emulateTransitionEnd(element, transitionDuration);
  585. };
  586. _proto._destroyElement = function _destroyElement(element) {
  587. if (element.parentNode) {
  588. element.parentNode.removeChild(element);
  589. }
  590. EventHandler.trigger(element, EVENT_CLOSED);
  591. } // Static
  592. ;
  593. Alert.jQueryInterface = function jQueryInterface(config) {
  594. return this.each(function () {
  595. var data = Data.getData(this, DATA_KEY);
  596. if (!data) {
  597. data = new Alert(this);
  598. }
  599. if (config === 'close') {
  600. data[config](this);
  601. }
  602. });
  603. };
  604. Alert.handleDismiss = function handleDismiss(alertInstance) {
  605. return function (event) {
  606. if (event) {
  607. event.preventDefault();
  608. }
  609. alertInstance.close(this);
  610. };
  611. };
  612. _createClass(Alert, null, [{
  613. key: "DATA_KEY",
  614. get: // Getters
  615. function get() {
  616. return DATA_KEY;
  617. }
  618. }]);
  619. return Alert;
  620. }(BaseComponent);
  621. /**
  622. * ------------------------------------------------------------------------
  623. * Data Api implementation
  624. * ------------------------------------------------------------------------
  625. */
  626. EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()));
  627. /**
  628. * ------------------------------------------------------------------------
  629. * jQuery
  630. * ------------------------------------------------------------------------
  631. * add .Alert to jQuery only if jQuery is present
  632. */
  633. defineJQueryPlugin(NAME, Alert);
  634. /**
  635. * ------------------------------------------------------------------------
  636. * Constants
  637. * ------------------------------------------------------------------------
  638. */
  639. var NAME$1 = 'button';
  640. var DATA_KEY$1 = 'bs.button';
  641. var EVENT_KEY$1 = "." + DATA_KEY$1;
  642. var DATA_API_KEY$1 = '.data-api';
  643. var CLASS_NAME_ACTIVE = 'active';
  644. var SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
  645. var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
  646. /**
  647. * ------------------------------------------------------------------------
  648. * Class Definition
  649. * ------------------------------------------------------------------------
  650. */
  651. var Button = /*#__PURE__*/function (_BaseComponent) {
  652. _inheritsLoose(Button, _BaseComponent);
  653. function Button() {
  654. return _BaseComponent.apply(this, arguments) || this;
  655. }
  656. var _proto = Button.prototype;
  657. // Public
  658. _proto.toggle = function toggle() {
  659. // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
  660. this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
  661. } // Static
  662. ;
  663. Button.jQueryInterface = function jQueryInterface(config) {
  664. return this.each(function () {
  665. var data = Data.getData(this, DATA_KEY$1);
  666. if (!data) {
  667. data = new Button(this);
  668. }
  669. if (config === 'toggle') {
  670. data[config]();
  671. }
  672. });
  673. };
  674. _createClass(Button, null, [{
  675. key: "DATA_KEY",
  676. get: // Getters
  677. function get() {
  678. return DATA_KEY$1;
  679. }
  680. }]);
  681. return Button;
  682. }(BaseComponent);
  683. /**
  684. * ------------------------------------------------------------------------
  685. * Data Api implementation
  686. * ------------------------------------------------------------------------
  687. */
  688. EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE, function (event) {
  689. event.preventDefault();
  690. var button = event.target.closest(SELECTOR_DATA_TOGGLE);
  691. var data = Data.getData(button, DATA_KEY$1);
  692. if (!data) {
  693. data = new Button(button);
  694. }
  695. data.toggle();
  696. });
  697. /**
  698. * ------------------------------------------------------------------------
  699. * jQuery
  700. * ------------------------------------------------------------------------
  701. * add .Button to jQuery only if jQuery is present
  702. */
  703. defineJQueryPlugin(NAME$1, Button);
  704. /**
  705. * --------------------------------------------------------------------------
  706. * Bootstrap (v5.0.0-beta2): dom/manipulator.js
  707. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  708. * --------------------------------------------------------------------------
  709. */
  710. function normalizeData(val) {
  711. if (val === 'true') {
  712. return true;
  713. }
  714. if (val === 'false') {
  715. return false;
  716. }
  717. if (val === Number(val).toString()) {
  718. return Number(val);
  719. }
  720. if (val === '' || val === 'null') {
  721. return null;
  722. }
  723. return val;
  724. }
  725. function normalizeDataKey(key) {
  726. return key.replace(/[A-Z]/g, function (chr) {
  727. return "-" + chr.toLowerCase();
  728. });
  729. }
  730. var Manipulator = {
  731. setDataAttribute: function setDataAttribute(element, key, value) {
  732. element.setAttribute("data-bs-" + normalizeDataKey(key), value);
  733. },
  734. removeDataAttribute: function removeDataAttribute(element, key) {
  735. element.removeAttribute("data-bs-" + normalizeDataKey(key));
  736. },
  737. getDataAttributes: function getDataAttributes(element) {
  738. if (!element) {
  739. return {};
  740. }
  741. var attributes = {};
  742. Object.keys(element.dataset).filter(function (key) {
  743. return key.startsWith('bs');
  744. }).forEach(function (key) {
  745. var pureKey = key.replace(/^bs/, '');
  746. pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
  747. attributes[pureKey] = normalizeData(element.dataset[key]);
  748. });
  749. return attributes;
  750. },
  751. getDataAttribute: function getDataAttribute(element, key) {
  752. return normalizeData(element.getAttribute("data-bs-" + normalizeDataKey(key)));
  753. },
  754. offset: function offset(element) {
  755. var rect = element.getBoundingClientRect();
  756. return {
  757. top: rect.top + document.body.scrollTop,
  758. left: rect.left + document.body.scrollLeft
  759. };
  760. },
  761. position: function position(element) {
  762. return {
  763. top: element.offsetTop,
  764. left: element.offsetLeft
  765. };
  766. }
  767. };
  768. /**
  769. * --------------------------------------------------------------------------
  770. * Bootstrap (v5.0.0-beta2): dom/selector-engine.js
  771. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  772. * --------------------------------------------------------------------------
  773. */
  774. /**
  775. * ------------------------------------------------------------------------
  776. * Constants
  777. * ------------------------------------------------------------------------
  778. */
  779. var NODE_TEXT = 3;
  780. var SelectorEngine = {
  781. find: function find(selector, element) {
  782. var _ref;
  783. if (element === void 0) {
  784. element = document.documentElement;
  785. }
  786. return (_ref = []).concat.apply(_ref, Element.prototype.querySelectorAll.call(element, selector));
  787. },
  788. findOne: function findOne(selector, element) {
  789. if (element === void 0) {
  790. element = document.documentElement;
  791. }
  792. return Element.prototype.querySelector.call(element, selector);
  793. },
  794. children: function children(element, selector) {
  795. var _ref2;
  796. return (_ref2 = []).concat.apply(_ref2, element.children).filter(function (child) {
  797. return child.matches(selector);
  798. });
  799. },
  800. parents: function parents(element, selector) {
  801. var parents = [];
  802. var ancestor = element.parentNode;
  803. while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
  804. if (ancestor.matches(selector)) {
  805. parents.push(ancestor);
  806. }
  807. ancestor = ancestor.parentNode;
  808. }
  809. return parents;
  810. },
  811. prev: function prev(element, selector) {
  812. var previous = element.previousElementSibling;
  813. while (previous) {
  814. if (previous.matches(selector)) {
  815. return [previous];
  816. }
  817. previous = previous.previousElementSibling;
  818. }
  819. return [];
  820. },
  821. next: function next(element, selector) {
  822. var next = element.nextElementSibling;
  823. while (next) {
  824. if (next.matches(selector)) {
  825. return [next];
  826. }
  827. next = next.nextElementSibling;
  828. }
  829. return [];
  830. }
  831. };
  832. /**
  833. * ------------------------------------------------------------------------
  834. * Constants
  835. * ------------------------------------------------------------------------
  836. */
  837. var NAME$2 = 'carousel';
  838. var DATA_KEY$2 = 'bs.carousel';
  839. var EVENT_KEY$2 = "." + DATA_KEY$2;
  840. var DATA_API_KEY$2 = '.data-api';
  841. var ARROW_LEFT_KEY = 'ArrowLeft';
  842. var ARROW_RIGHT_KEY = 'ArrowRight';
  843. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  844. var SWIPE_THRESHOLD = 40;
  845. var Default = {
  846. interval: 5000,
  847. keyboard: true,
  848. slide: false,
  849. pause: 'hover',
  850. wrap: true,
  851. touch: true
  852. };
  853. var DefaultType = {
  854. interval: '(number|boolean)',
  855. keyboard: 'boolean',
  856. slide: '(boolean|string)',
  857. pause: '(string|boolean)',
  858. wrap: 'boolean',
  859. touch: 'boolean'
  860. };
  861. var DIRECTION_NEXT = 'next';
  862. var DIRECTION_PREV = 'prev';
  863. var DIRECTION_LEFT = 'left';
  864. var DIRECTION_RIGHT = 'right';
  865. var EVENT_SLIDE = "slide" + EVENT_KEY$2;
  866. var EVENT_SLID = "slid" + EVENT_KEY$2;
  867. var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2;
  868. var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2;
  869. var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2;
  870. var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2;
  871. var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2;
  872. var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2;
  873. var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2;
  874. var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2;
  875. var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2;
  876. var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$2;
  877. var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2;
  878. var CLASS_NAME_CAROUSEL = 'carousel';
  879. var CLASS_NAME_ACTIVE$1 = 'active';
  880. var CLASS_NAME_SLIDE = 'slide';
  881. var CLASS_NAME_END = 'carousel-item-end';
  882. var CLASS_NAME_START = 'carousel-item-start';
  883. var CLASS_NAME_NEXT = 'carousel-item-next';
  884. var CLASS_NAME_PREV = 'carousel-item-prev';
  885. var CLASS_NAME_POINTER_EVENT = 'pointer-event';
  886. var SELECTOR_ACTIVE = '.active';
  887. var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
  888. var SELECTOR_ITEM = '.carousel-item';
  889. var SELECTOR_ITEM_IMG = '.carousel-item img';
  890. var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
  891. var SELECTOR_INDICATORS = '.carousel-indicators';
  892. var SELECTOR_INDICATOR = '[data-bs-target]';
  893. var SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';
  894. var SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]';
  895. var POINTER_TYPE_TOUCH = 'touch';
  896. var POINTER_TYPE_PEN = 'pen';
  897. /**
  898. * ------------------------------------------------------------------------
  899. * Class Definition
  900. * ------------------------------------------------------------------------
  901. */
  902. var Carousel = /*#__PURE__*/function (_BaseComponent) {
  903. _inheritsLoose(Carousel, _BaseComponent);
  904. function Carousel(element, config) {
  905. var _this;
  906. _this = _BaseComponent.call(this, element) || this;
  907. _this._items = null;
  908. _this._interval = null;
  909. _this._activeElement = null;
  910. _this._isPaused = false;
  911. _this._isSliding = false;
  912. _this.touchTimeout = null;
  913. _this.touchStartX = 0;
  914. _this.touchDeltaX = 0;
  915. _this._config = _this._getConfig(config);
  916. _this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, _this._element);
  917. _this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  918. _this._pointerEvent = Boolean(window.PointerEvent);
  919. _this._addEventListeners();
  920. return _this;
  921. } // Getters
  922. var _proto = Carousel.prototype;
  923. // Public
  924. _proto.next = function next() {
  925. if (!this._isSliding) {
  926. this._slide(DIRECTION_NEXT);
  927. }
  928. };
  929. _proto.nextWhenVisible = function nextWhenVisible() {
  930. // Don't call next when the page isn't visible
  931. // or the carousel or its parent isn't visible
  932. if (!document.hidden && isVisible(this._element)) {
  933. this.next();
  934. }
  935. };
  936. _proto.prev = function prev() {
  937. if (!this._isSliding) {
  938. this._slide(DIRECTION_PREV);
  939. }
  940. };
  941. _proto.pause = function pause(event) {
  942. if (!event) {
  943. this._isPaused = true;
  944. }
  945. if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {
  946. triggerTransitionEnd(this._element);
  947. this.cycle(true);
  948. }
  949. clearInterval(this._interval);
  950. this._interval = null;
  951. };
  952. _proto.cycle = function cycle(event) {
  953. if (!event) {
  954. this._isPaused = false;
  955. }
  956. if (this._interval) {
  957. clearInterval(this._interval);
  958. this._interval = null;
  959. }
  960. if (this._config && this._config.interval && !this._isPaused) {
  961. this._updateInterval();
  962. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  963. }
  964. };
  965. _proto.to = function to(index) {
  966. var _this2 = this;
  967. this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
  968. var activeIndex = this._getItemIndex(this._activeElement);
  969. if (index > this._items.length - 1 || index < 0) {
  970. return;
  971. }
  972. if (this._isSliding) {
  973. EventHandler.one(this._element, EVENT_SLID, function () {
  974. return _this2.to(index);
  975. });
  976. return;
  977. }
  978. if (activeIndex === index) {
  979. this.pause();
  980. this.cycle();
  981. return;
  982. }
  983. var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
  984. this._slide(direction, this._items[index]);
  985. };
  986. _proto.dispose = function dispose() {
  987. _BaseComponent.prototype.dispose.call(this);
  988. EventHandler.off(this._element, EVENT_KEY$2);
  989. this._items = null;
  990. this._config = null;
  991. this._interval = null;
  992. this._isPaused = null;
  993. this._isSliding = null;
  994. this._activeElement = null;
  995. this._indicatorsElement = null;
  996. } // Private
  997. ;
  998. _proto._getConfig = function _getConfig(config) {
  999. config = _extends({}, Default, config);
  1000. typeCheckConfig(NAME$2, config, DefaultType);
  1001. return config;
  1002. };
  1003. _proto._handleSwipe = function _handleSwipe() {
  1004. var absDeltax = Math.abs(this.touchDeltaX);
  1005. if (absDeltax <= SWIPE_THRESHOLD) {
  1006. return;
  1007. }
  1008. var direction = absDeltax / this.touchDeltaX;
  1009. this.touchDeltaX = 0; // swipe left
  1010. if (direction > 0) {
  1011. if (isRTL) {
  1012. this.next();
  1013. } else {
  1014. this.prev();
  1015. }
  1016. } // swipe right
  1017. if (direction < 0) {
  1018. if (isRTL) {
  1019. this.prev();
  1020. } else {
  1021. this.next();
  1022. }
  1023. }
  1024. };
  1025. _proto._addEventListeners = function _addEventListeners() {
  1026. var _this3 = this;
  1027. if (this._config.keyboard) {
  1028. EventHandler.on(this._element, EVENT_KEYDOWN, function (event) {
  1029. return _this3._keydown(event);
  1030. });
  1031. }
  1032. if (this._config.pause === 'hover') {
  1033. EventHandler.on(this._element, EVENT_MOUSEENTER, function (event) {
  1034. return _this3.pause(event);
  1035. });
  1036. EventHandler.on(this._element, EVENT_MOUSELEAVE, function (event) {
  1037. return _this3.cycle(event);
  1038. });
  1039. }
  1040. if (this._config.touch && this._touchSupported) {
  1041. this._addTouchEventListeners();
  1042. }
  1043. };
  1044. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  1045. var _this4 = this;
  1046. var start = function start(event) {
  1047. if (_this4._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
  1048. _this4.touchStartX = event.clientX;
  1049. } else if (!_this4._pointerEvent) {
  1050. _this4.touchStartX = event.touches[0].clientX;
  1051. }
  1052. };
  1053. var move = function move(event) {
  1054. // ensure swiping with one touch and not pinching
  1055. if (event.touches && event.touches.length > 1) {
  1056. _this4.touchDeltaX = 0;
  1057. } else {
  1058. _this4.touchDeltaX = event.touches[0].clientX - _this4.touchStartX;
  1059. }
  1060. };
  1061. var end = function end(event) {
  1062. if (_this4._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
  1063. _this4.touchDeltaX = event.clientX - _this4.touchStartX;
  1064. }
  1065. _this4._handleSwipe();
  1066. if (_this4._config.pause === 'hover') {
  1067. // If it's a touch-enabled device, mouseenter/leave are fired as
  1068. // part of the mouse compatibility events on first tap - the carousel
  1069. // would stop cycling until user tapped out of it;
  1070. // here, we listen for touchend, explicitly pause the carousel
  1071. // (as if it's the second time we tap on it, mouseenter compat event
  1072. // is NOT fired) and after a timeout (to allow for mouse compatibility
  1073. // events to fire) we explicitly restart cycling
  1074. _this4.pause();
  1075. if (_this4.touchTimeout) {
  1076. clearTimeout(_this4.touchTimeout);
  1077. }
  1078. _this4.touchTimeout = setTimeout(function (event) {
  1079. return _this4.cycle(event);
  1080. }, TOUCHEVENT_COMPAT_WAIT + _this4._config.interval);
  1081. }
  1082. };
  1083. SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(function (itemImg) {
  1084. EventHandler.on(itemImg, EVENT_DRAG_START, function (e) {
  1085. return e.preventDefault();
  1086. });
  1087. });
  1088. if (this._pointerEvent) {
  1089. EventHandler.on(this._element, EVENT_POINTERDOWN, function (event) {
  1090. return start(event);
  1091. });
  1092. EventHandler.on(this._element, EVENT_POINTERUP, function (event) {
  1093. return end(event);
  1094. });
  1095. this._element.classList.add(CLASS_NAME_POINTER_EVENT);
  1096. } else {
  1097. EventHandler.on(this._element, EVENT_TOUCHSTART, function (event) {
  1098. return start(event);
  1099. });
  1100. EventHandler.on(this._element, EVENT_TOUCHMOVE, function (event) {
  1101. return move(event);
  1102. });
  1103. EventHandler.on(this._element, EVENT_TOUCHEND, function (event) {
  1104. return end(event);
  1105. });
  1106. }
  1107. };
  1108. _proto._keydown = function _keydown(event) {
  1109. if (/input|textarea/i.test(event.target.tagName)) {
  1110. return;
  1111. }
  1112. if (event.key === ARROW_LEFT_KEY) {
  1113. event.preventDefault();
  1114. if (isRTL) {
  1115. this.next();
  1116. } else {
  1117. this.prev();
  1118. }
  1119. } else if (event.key === ARROW_RIGHT_KEY) {
  1120. event.preventDefault();
  1121. if (isRTL) {
  1122. this.prev();
  1123. } else {
  1124. this.next();
  1125. }
  1126. }
  1127. };
  1128. _proto._getItemIndex = function _getItemIndex(element) {
  1129. this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : [];
  1130. return this._items.indexOf(element);
  1131. };
  1132. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  1133. var isNextDirection = direction === DIRECTION_NEXT;
  1134. var isPrevDirection = direction === DIRECTION_PREV;
  1135. var activeIndex = this._getItemIndex(activeElement);
  1136. var lastItemIndex = this._items.length - 1;
  1137. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  1138. if (isGoingToWrap && !this._config.wrap) {
  1139. return activeElement;
  1140. }
  1141. var delta = direction === DIRECTION_PREV ? -1 : 1;
  1142. var itemIndex = (activeIndex + delta) % this._items.length;
  1143. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  1144. };
  1145. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  1146. var targetIndex = this._getItemIndex(relatedTarget);
  1147. var fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element));
  1148. return EventHandler.trigger(this._element, EVENT_SLIDE, {
  1149. relatedTarget: relatedTarget,
  1150. direction: eventDirectionName,
  1151. from: fromIndex,
  1152. to: targetIndex
  1153. });
  1154. };
  1155. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  1156. if (this._indicatorsElement) {
  1157. var activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);
  1158. activeIndicator.classList.remove(CLASS_NAME_ACTIVE$1);
  1159. activeIndicator.removeAttribute('aria-current');
  1160. var indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);
  1161. for (var i = 0; i < indicators.length; i++) {
  1162. if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
  1163. indicators[i].classList.add(CLASS_NAME_ACTIVE$1);
  1164. indicators[i].setAttribute('aria-current', 'true');
  1165. break;
  1166. }
  1167. }
  1168. }
  1169. };
  1170. _proto._updateInterval = function _updateInterval() {
  1171. var element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
  1172. if (!element) {
  1173. return;
  1174. }
  1175. var elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);
  1176. if (elementInterval) {
  1177. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  1178. this._config.interval = elementInterval;
  1179. } else {
  1180. this._config.interval = this._config.defaultInterval || this._config.interval;
  1181. }
  1182. };
  1183. _proto._slide = function _slide(direction, element) {
  1184. var _this5 = this;
  1185. var activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
  1186. var activeElementIndex = this._getItemIndex(activeElement);
  1187. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  1188. var nextElementIndex = this._getItemIndex(nextElement);
  1189. var isCycling = Boolean(this._interval);
  1190. var directionalClassName = direction === DIRECTION_NEXT ? CLASS_NAME_START : CLASS_NAME_END;
  1191. var orderClassName = direction === DIRECTION_NEXT ? CLASS_NAME_NEXT : CLASS_NAME_PREV;
  1192. var eventDirectionName = direction === DIRECTION_NEXT ? DIRECTION_LEFT : DIRECTION_RIGHT;
  1193. if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE$1)) {
  1194. this._isSliding = false;
  1195. return;
  1196. }
  1197. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  1198. if (slideEvent.defaultPrevented) {
  1199. return;
  1200. }
  1201. if (!activeElement || !nextElement) {
  1202. // Some weirdness is happening, so we bail
  1203. return;
  1204. }
  1205. this._isSliding = true;
  1206. if (isCycling) {
  1207. this.pause();
  1208. }
  1209. this._setActiveIndicatorElement(nextElement);
  1210. this._activeElement = nextElement;
  1211. if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
  1212. nextElement.classList.add(orderClassName);
  1213. reflow(nextElement);
  1214. activeElement.classList.add(directionalClassName);
  1215. nextElement.classList.add(directionalClassName);
  1216. var transitionDuration = getTransitionDurationFromElement(activeElement);
  1217. EventHandler.one(activeElement, 'transitionend', function () {
  1218. nextElement.classList.remove(directionalClassName, orderClassName);
  1219. nextElement.classList.add(CLASS_NAME_ACTIVE$1);
  1220. activeElement.classList.remove(CLASS_NAME_ACTIVE$1, orderClassName, directionalClassName);
  1221. _this5._isSliding = false;
  1222. setTimeout(function () {
  1223. EventHandler.trigger(_this5._element, EVENT_SLID, {
  1224. relatedTarget: nextElement,
  1225. direction: eventDirectionName,
  1226. from: activeElementIndex,
  1227. to: nextElementIndex
  1228. });
  1229. }, 0);
  1230. });
  1231. emulateTransitionEnd(activeElement, transitionDuration);
  1232. } else {
  1233. activeElement.classList.remove(CLASS_NAME_ACTIVE$1);
  1234. nextElement.classList.add(CLASS_NAME_ACTIVE$1);
  1235. this._isSliding = false;
  1236. EventHandler.trigger(this._element, EVENT_SLID, {
  1237. relatedTarget: nextElement,
  1238. direction: eventDirectionName,
  1239. from: activeElementIndex,
  1240. to: nextElementIndex
  1241. });
  1242. }
  1243. if (isCycling) {
  1244. this.cycle();
  1245. }
  1246. } // Static
  1247. ;
  1248. Carousel.carouselInterface = function carouselInterface(element, config) {
  1249. var data = Data.getData(element, DATA_KEY$2);
  1250. var _config = _extends({}, Default, Manipulator.getDataAttributes(element));
  1251. if (typeof config === 'object') {
  1252. _config = _extends({}, _config, config);
  1253. }
  1254. var action = typeof config === 'string' ? config : _config.slide;
  1255. if (!data) {
  1256. data = new Carousel(element, _config);
  1257. }
  1258. if (typeof config === 'number') {
  1259. data.to(config);
  1260. } else if (typeof action === 'string') {
  1261. if (typeof data[action] === 'undefined') {
  1262. throw new TypeError("No method named \"" + action + "\"");
  1263. }
  1264. data[action]();
  1265. } else if (_config.interval && _config.ride) {
  1266. data.pause();
  1267. data.cycle();
  1268. }
  1269. };
  1270. Carousel.jQueryInterface = function jQueryInterface(config) {
  1271. return this.each(function () {
  1272. Carousel.carouselInterface(this, config);
  1273. });
  1274. };
  1275. Carousel.dataApiClickHandler = function dataApiClickHandler(event) {
  1276. var target = getElementFromSelector(this);
  1277. if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
  1278. return;
  1279. }
  1280. var config = _extends({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this));
  1281. var slideIndex = this.getAttribute('data-bs-slide-to');
  1282. if (slideIndex) {
  1283. config.interval = false;
  1284. }
  1285. Carousel.carouselInterface(target, config);
  1286. if (slideIndex) {
  1287. Data.getData(target, DATA_KEY$2).to(slideIndex);
  1288. }
  1289. event.preventDefault();
  1290. };
  1291. _createClass(Carousel, null, [{
  1292. key: "Default",
  1293. get: function get() {
  1294. return Default;
  1295. }
  1296. }, {
  1297. key: "DATA_KEY",
  1298. get: function get() {
  1299. return DATA_KEY$2;
  1300. }
  1301. }]);
  1302. return Carousel;
  1303. }(BaseComponent);
  1304. /**
  1305. * ------------------------------------------------------------------------
  1306. * Data Api implementation
  1307. * ------------------------------------------------------------------------
  1308. */
  1309. EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler);
  1310. EventHandler.on(window, EVENT_LOAD_DATA_API, function () {
  1311. var carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
  1312. for (var i = 0, len = carousels.length; i < len; i++) {
  1313. Carousel.carouselInterface(carousels[i], Data.getData(carousels[i], DATA_KEY$2));
  1314. }
  1315. });
  1316. /**
  1317. * ------------------------------------------------------------------------
  1318. * jQuery
  1319. * ------------------------------------------------------------------------
  1320. * add .Carousel to jQuery only if jQuery is present
  1321. */
  1322. defineJQueryPlugin(NAME$2, Carousel);
  1323. /**
  1324. * ------------------------------------------------------------------------
  1325. * Constants
  1326. * ------------------------------------------------------------------------
  1327. */
  1328. var NAME$3 = 'collapse';
  1329. var DATA_KEY$3 = 'bs.collapse';
  1330. var EVENT_KEY$3 = "." + DATA_KEY$3;
  1331. var DATA_API_KEY$3 = '.data-api';
  1332. var Default$1 = {
  1333. toggle: true,
  1334. parent: ''
  1335. };
  1336. var DefaultType$1 = {
  1337. toggle: 'boolean',
  1338. parent: '(string|element)'
  1339. };
  1340. var EVENT_SHOW = "show" + EVENT_KEY$3;
  1341. var EVENT_SHOWN = "shown" + EVENT_KEY$3;
  1342. var EVENT_HIDE = "hide" + EVENT_KEY$3;
  1343. var EVENT_HIDDEN = "hidden" + EVENT_KEY$3;
  1344. var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3;
  1345. var CLASS_NAME_SHOW$1 = 'show';
  1346. var CLASS_NAME_COLLAPSE = 'collapse';
  1347. var CLASS_NAME_COLLAPSING = 'collapsing';
  1348. var CLASS_NAME_COLLAPSED = 'collapsed';
  1349. var WIDTH = 'width';
  1350. var HEIGHT = 'height';
  1351. var SELECTOR_ACTIVES = '.show, .collapsing';
  1352. var SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="collapse"]';
  1353. /**
  1354. * ------------------------------------------------------------------------
  1355. * Class Definition
  1356. * ------------------------------------------------------------------------
  1357. */
  1358. var Collapse = /*#__PURE__*/function (_BaseComponent) {
  1359. _inheritsLoose(Collapse, _BaseComponent);
  1360. function Collapse(element, config) {
  1361. var _this;
  1362. _this = _BaseComponent.call(this, element) || this;
  1363. _this._isTransitioning = false;
  1364. _this._config = _this._getConfig(config);
  1365. _this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-bs-target=\"#" + element.id + "\"]"));
  1366. var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1);
  1367. for (var i = 0, len = toggleList.length; i < len; i++) {
  1368. var elem = toggleList[i];
  1369. var selector = getSelectorFromElement(elem);
  1370. var filterElement = SelectorEngine.find(selector).filter(function (foundElem) {
  1371. return foundElem === element;
  1372. });
  1373. if (selector !== null && filterElement.length) {
  1374. _this._selector = selector;
  1375. _this._triggerArray.push(elem);
  1376. }
  1377. }
  1378. _this._parent = _this._config.parent ? _this._getParent() : null;
  1379. if (!_this._config.parent) {
  1380. _this._addAriaAndCollapsedClass(_this._element, _this._triggerArray);
  1381. }
  1382. if (_this._config.toggle) {
  1383. _this.toggle();
  1384. }
  1385. return _this;
  1386. } // Getters
  1387. var _proto = Collapse.prototype;
  1388. // Public
  1389. _proto.toggle = function toggle() {
  1390. if (this._element.classList.contains(CLASS_NAME_SHOW$1)) {
  1391. this.hide();
  1392. } else {
  1393. this.show();
  1394. }
  1395. };
  1396. _proto.show = function show() {
  1397. var _this2 = this;
  1398. if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW$1)) {
  1399. return;
  1400. }
  1401. var actives;
  1402. var activesData;
  1403. if (this._parent) {
  1404. actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(function (elem) {
  1405. if (typeof _this2._config.parent === 'string') {
  1406. return elem.getAttribute('data-bs-parent') === _this2._config.parent;
  1407. }
  1408. return elem.classList.contains(CLASS_NAME_COLLAPSE);
  1409. });
  1410. if (actives.length === 0) {
  1411. actives = null;
  1412. }
  1413. }
  1414. var container = SelectorEngine.findOne(this._selector);
  1415. if (actives) {
  1416. var tempActiveData = actives.find(function (elem) {
  1417. return container !== elem;
  1418. });
  1419. activesData = tempActiveData ? Data.getData(tempActiveData, DATA_KEY$3) : null;
  1420. if (activesData && activesData._isTransitioning) {
  1421. return;
  1422. }
  1423. }
  1424. var startEvent = EventHandler.trigger(this._element, EVENT_SHOW);
  1425. if (startEvent.defaultPrevented) {
  1426. return;
  1427. }
  1428. if (actives) {
  1429. actives.forEach(function (elemActive) {
  1430. if (container !== elemActive) {
  1431. Collapse.collapseInterface(elemActive, 'hide');
  1432. }
  1433. if (!activesData) {
  1434. Data.setData(elemActive, DATA_KEY$3, null);
  1435. }
  1436. });
  1437. }
  1438. var dimension = this._getDimension();
  1439. this._element.classList.remove(CLASS_NAME_COLLAPSE);
  1440. this._element.classList.add(CLASS_NAME_COLLAPSING);
  1441. this._element.style[dimension] = 0;
  1442. if (this._triggerArray.length) {
  1443. this._triggerArray.forEach(function (element) {
  1444. element.classList.remove(CLASS_NAME_COLLAPSED);
  1445. element.setAttribute('aria-expanded', true);
  1446. });
  1447. }
  1448. this.setTransitioning(true);
  1449. var complete = function complete() {
  1450. _this2._element.classList.remove(CLASS_NAME_COLLAPSING);
  1451. _this2._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$1);
  1452. _this2._element.style[dimension] = '';
  1453. _this2.setTransitioning(false);
  1454. EventHandler.trigger(_this2._element, EVENT_SHOWN);
  1455. };
  1456. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  1457. var scrollSize = "scroll" + capitalizedDimension;
  1458. var transitionDuration = getTransitionDurationFromElement(this._element);
  1459. EventHandler.one(this._element, 'transitionend', complete);
  1460. emulateTransitionEnd(this._element, transitionDuration);
  1461. this._element.style[dimension] = this._element[scrollSize] + "px";
  1462. };
  1463. _proto.hide = function hide() {
  1464. var _this3 = this;
  1465. if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW$1)) {
  1466. return;
  1467. }
  1468. var startEvent = EventHandler.trigger(this._element, EVENT_HIDE);
  1469. if (startEvent.defaultPrevented) {
  1470. return;
  1471. }
  1472. var dimension = this._getDimension();
  1473. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  1474. reflow(this._element);
  1475. this._element.classList.add(CLASS_NAME_COLLAPSING);
  1476. this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$1);
  1477. var triggerArrayLength = this._triggerArray.length;
  1478. if (triggerArrayLength > 0) {
  1479. for (var i = 0; i < triggerArrayLength; i++) {
  1480. var trigger = this._triggerArray[i];
  1481. var elem = getElementFromSelector(trigger);
  1482. if (elem && !elem.classList.contains(CLASS_NAME_SHOW$1)) {
  1483. trigger.classList.add(CLASS_NAME_COLLAPSED);
  1484. trigger.setAttribute('aria-expanded', false);
  1485. }
  1486. }
  1487. }
  1488. this.setTransitioning(true);
  1489. var complete = function complete() {
  1490. _this3.setTransitioning(false);
  1491. _this3._element.classList.remove(CLASS_NAME_COLLAPSING);
  1492. _this3._element.classList.add(CLASS_NAME_COLLAPSE);
  1493. EventHandler.trigger(_this3._element, EVENT_HIDDEN);
  1494. };
  1495. this._element.style[dimension] = '';
  1496. var transitionDuration = getTransitionDurationFromElement(this._element);
  1497. EventHandler.one(this._element, 'transitionend', complete);
  1498. emulateTransitionEnd(this._element, transitionDuration);
  1499. };
  1500. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  1501. this._isTransitioning = isTransitioning;
  1502. };
  1503. _proto.dispose = function dispose() {
  1504. _BaseComponent.prototype.dispose.call(this);
  1505. this._config = null;
  1506. this._parent = null;
  1507. this._triggerArray = null;
  1508. this._isTransitioning = null;
  1509. } // Private
  1510. ;
  1511. _proto._getConfig = function _getConfig(config) {
  1512. config = _extends({}, Default$1, config);
  1513. config.toggle = Boolean(config.toggle); // Coerce string values
  1514. typeCheckConfig(NAME$3, config, DefaultType$1);
  1515. return config;
  1516. };
  1517. _proto._getDimension = function _getDimension() {
  1518. return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
  1519. };
  1520. _proto._getParent = function _getParent() {
  1521. var _this4 = this;
  1522. var parent = this._config.parent;
  1523. if (isElement(parent)) {
  1524. // it's a jQuery object
  1525. if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
  1526. parent = parent[0];
  1527. }
  1528. } else {
  1529. parent = SelectorEngine.findOne(parent);
  1530. }
  1531. var selector = SELECTOR_DATA_TOGGLE$1 + "[data-bs-parent=\"" + parent + "\"]";
  1532. SelectorEngine.find(selector, parent).forEach(function (element) {
  1533. var selected = getElementFromSelector(element);
  1534. _this4._addAriaAndCollapsedClass(selected, [element]);
  1535. });
  1536. return parent;
  1537. };
  1538. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  1539. if (!element || !triggerArray.length) {
  1540. return;
  1541. }
  1542. var isOpen = element.classList.contains(CLASS_NAME_SHOW$1);
  1543. triggerArray.forEach(function (elem) {
  1544. if (isOpen) {
  1545. elem.classList.remove(CLASS_NAME_COLLAPSED);
  1546. } else {
  1547. elem.classList.add(CLASS_NAME_COLLAPSED);
  1548. }
  1549. elem.setAttribute('aria-expanded', isOpen);
  1550. });
  1551. } // Static
  1552. ;
  1553. Collapse.collapseInterface = function collapseInterface(element, config) {
  1554. var data = Data.getData(element, DATA_KEY$3);
  1555. var _config = _extends({}, Default$1, Manipulator.getDataAttributes(element), typeof config === 'object' && config ? config : {});
  1556. if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
  1557. _config.toggle = false;
  1558. }
  1559. if (!data) {
  1560. data = new Collapse(element, _config);
  1561. }
  1562. if (typeof config === 'string') {
  1563. if (typeof data[config] === 'undefined') {
  1564. throw new TypeError("No method named \"" + config + "\"");
  1565. }
  1566. data[config]();
  1567. }
  1568. };
  1569. Collapse.jQueryInterface = function jQueryInterface(config) {
  1570. return this.each(function () {
  1571. Collapse.collapseInterface(this, config);
  1572. });
  1573. };
  1574. _createClass(Collapse, null, [{
  1575. key: "Default",
  1576. get: function get() {
  1577. return Default$1;
  1578. }
  1579. }, {
  1580. key: "DATA_KEY",
  1581. get: function get() {
  1582. return DATA_KEY$3;
  1583. }
  1584. }]);
  1585. return Collapse;
  1586. }(BaseComponent);
  1587. /**
  1588. * ------------------------------------------------------------------------
  1589. * Data Api implementation
  1590. * ------------------------------------------------------------------------
  1591. */
  1592. EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {
  1593. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  1594. if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
  1595. event.preventDefault();
  1596. }
  1597. var triggerData = Manipulator.getDataAttributes(this);
  1598. var selector = getSelectorFromElement(this);
  1599. var selectorElements = SelectorEngine.find(selector);
  1600. selectorElements.forEach(function (element) {
  1601. var data = Data.getData(element, DATA_KEY$3);
  1602. var config;
  1603. if (data) {
  1604. // update parent attribute
  1605. if (data._parent === null && typeof triggerData.parent === 'string') {
  1606. data._config.parent = triggerData.parent;
  1607. data._parent = data._getParent();
  1608. }
  1609. config = 'toggle';
  1610. } else {
  1611. config = triggerData;
  1612. }
  1613. Collapse.collapseInterface(element, config);
  1614. });
  1615. });
  1616. /**
  1617. * ------------------------------------------------------------------------
  1618. * jQuery
  1619. * ------------------------------------------------------------------------
  1620. * add .Collapse to jQuery only if jQuery is present
  1621. */
  1622. defineJQueryPlugin(NAME$3, Collapse);
  1623. var top = 'top';
  1624. var bottom = 'bottom';
  1625. var right = 'right';
  1626. var left = 'left';
  1627. var auto = 'auto';
  1628. var basePlacements = [top, bottom, right, left];
  1629. var start = 'start';
  1630. var end = 'end';
  1631. var clippingParents = 'clippingParents';
  1632. var viewport = 'viewport';
  1633. var popper = 'popper';
  1634. var reference = 'reference';
  1635. var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
  1636. return acc.concat([placement + "-" + start, placement + "-" + end]);
  1637. }, []);
  1638. var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
  1639. return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
  1640. }, []); // modifiers that need to read the DOM
  1641. var beforeRead = 'beforeRead';
  1642. var read = 'read';
  1643. var afterRead = 'afterRead'; // pure-logic modifiers
  1644. var beforeMain = 'beforeMain';
  1645. var main = 'main';
  1646. var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
  1647. var beforeWrite = 'beforeWrite';
  1648. var write = 'write';
  1649. var afterWrite = 'afterWrite';
  1650. var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
  1651. function getNodeName(element) {
  1652. return element ? (element.nodeName || '').toLowerCase() : null;
  1653. }
  1654. /*:: import type { Window } from '../types'; */
  1655. /*:: declare function getWindow(node: Node | Window): Window; */
  1656. function getWindow(node) {
  1657. if (node.toString() !== '[object Window]') {
  1658. var ownerDocument = node.ownerDocument;
  1659. return ownerDocument ? ownerDocument.defaultView || window : window;
  1660. }
  1661. return node;
  1662. }
  1663. /*:: declare function isElement(node: mixed): boolean %checks(node instanceof
  1664. Element); */
  1665. function isElement$1(node) {
  1666. var OwnElement = getWindow(node).Element;
  1667. return node instanceof OwnElement || node instanceof Element;
  1668. }
  1669. /*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
  1670. HTMLElement); */
  1671. function isHTMLElement(node) {
  1672. var OwnElement = getWindow(node).HTMLElement;
  1673. return node instanceof OwnElement || node instanceof HTMLElement;
  1674. }
  1675. /*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof
  1676. ShadowRoot); */
  1677. function isShadowRoot(node) {
  1678. var OwnElement = getWindow(node).ShadowRoot;
  1679. return node instanceof OwnElement || node instanceof ShadowRoot;
  1680. }
  1681. // and applies them to the HTMLElements such as popper and arrow
  1682. function applyStyles(_ref) {
  1683. var state = _ref.state;
  1684. Object.keys(state.elements).forEach(function (name) {
  1685. var style = state.styles[name] || {};
  1686. var attributes = state.attributes[name] || {};
  1687. var element = state.elements[name]; // arrow is optional + virtual elements
  1688. if (!isHTMLElement(element) || !getNodeName(element)) {
  1689. return;
  1690. } // Flow doesn't support to extend this property, but it's the most
  1691. // effective way to apply styles to an HTMLElement
  1692. // $FlowFixMe[cannot-write]
  1693. Object.assign(element.style, style);
  1694. Object.keys(attributes).forEach(function (name) {
  1695. var value = attributes[name];
  1696. if (value === false) {
  1697. element.removeAttribute(name);
  1698. } else {
  1699. element.setAttribute(name, value === true ? '' : value);
  1700. }
  1701. });
  1702. });
  1703. }
  1704. function effect(_ref2) {
  1705. var state = _ref2.state;
  1706. var initialStyles = {
  1707. popper: {
  1708. position: state.options.strategy,
  1709. left: '0',
  1710. top: '0',
  1711. margin: '0'
  1712. },
  1713. arrow: {
  1714. position: 'absolute'
  1715. },
  1716. reference: {}
  1717. };
  1718. Object.assign(state.elements.popper.style, initialStyles.popper);
  1719. if (state.elements.arrow) {
  1720. Object.assign(state.elements.arrow.style, initialStyles.arrow);
  1721. }
  1722. return function () {
  1723. Object.keys(state.elements).forEach(function (name) {
  1724. var element = state.elements[name];
  1725. var attributes = state.attributes[name] || {};
  1726. var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
  1727. var style = styleProperties.reduce(function (style, property) {
  1728. style[property] = '';
  1729. return style;
  1730. }, {}); // arrow is optional + virtual elements
  1731. if (!isHTMLElement(element) || !getNodeName(element)) {
  1732. return;
  1733. }
  1734. Object.assign(element.style, style);
  1735. Object.keys(attributes).forEach(function (attribute) {
  1736. element.removeAttribute(attribute);
  1737. });
  1738. });
  1739. };
  1740. } // eslint-disable-next-line import/no-unused-modules
  1741. var applyStyles$1 = {
  1742. name: 'applyStyles',
  1743. enabled: true,
  1744. phase: 'write',
  1745. fn: applyStyles,
  1746. effect: effect,
  1747. requires: ['computeStyles']
  1748. };
  1749. function getBasePlacement(placement) {
  1750. return placement.split('-')[0];
  1751. }
  1752. // Returns the layout rect of an element relative to its offsetParent. Layout
  1753. // means it doesn't take into account transforms.
  1754. function getLayoutRect(element) {
  1755. return {
  1756. x: element.offsetLeft,
  1757. y: element.offsetTop,
  1758. width: element.offsetWidth,
  1759. height: element.offsetHeight
  1760. };
  1761. }
  1762. function contains(parent, child) {
  1763. var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
  1764. if (parent.contains(child)) {
  1765. return true;
  1766. } // then fallback to custom implementation with Shadow DOM support
  1767. else if (rootNode && isShadowRoot(rootNode)) {
  1768. var next = child;
  1769. do {
  1770. if (next && parent.isSameNode(next)) {
  1771. return true;
  1772. } // $FlowFixMe[prop-missing]: need a better way to handle this...
  1773. next = next.parentNode || next.host;
  1774. } while (next);
  1775. } // Give up, the result is false
  1776. return false;
  1777. }
  1778. function getComputedStyle$1(element) {
  1779. return getWindow(element).getComputedStyle(element);
  1780. }
  1781. function isTableElement(element) {
  1782. return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
  1783. }
  1784. function getDocumentElement(element) {
  1785. // $FlowFixMe[incompatible-return]: assume body is always available
  1786. return ((isElement$1(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
  1787. element.document) || window.document).documentElement;
  1788. }
  1789. function getParentNode(element) {
  1790. if (getNodeName(element) === 'html') {
  1791. return element;
  1792. }
  1793. return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
  1794. // $FlowFixMe[incompatible-return]
  1795. // $FlowFixMe[prop-missing]
  1796. element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
  1797. element.parentNode || // DOM Element detected
  1798. // $FlowFixMe[incompatible-return]: need a better way to handle this...
  1799. element.host || // ShadowRoot detected
  1800. // $FlowFixMe[incompatible-call]: HTMLElement is a Node
  1801. getDocumentElement(element) // fallback
  1802. );
  1803. }
  1804. function getTrueOffsetParent(element) {
  1805. if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
  1806. getComputedStyle$1(element).position === 'fixed') {
  1807. return null;
  1808. }
  1809. var offsetParent = element.offsetParent;
  1810. if (offsetParent) {
  1811. var html = getDocumentElement(offsetParent);
  1812. if (getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && getComputedStyle$1(html).position !== 'static') {
  1813. return html;
  1814. }
  1815. }
  1816. return offsetParent;
  1817. } // `.offsetParent` reports `null` for fixed elements, while absolute elements
  1818. // return the containing block
  1819. function getContainingBlock(element) {
  1820. var currentNode = getParentNode(element);
  1821. while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
  1822. var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
  1823. // create a containing block.
  1824. if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== 'auto') {
  1825. return currentNode;
  1826. } else {
  1827. currentNode = currentNode.parentNode;
  1828. }
  1829. }
  1830. return null;
  1831. } // Gets the closest ancestor positioned element. Handles some edge cases,
  1832. // such as table ancestors and cross browser bugs.
  1833. function getOffsetParent(element) {
  1834. var window = getWindow(element);
  1835. var offsetParent = getTrueOffsetParent(element);
  1836. while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
  1837. offsetParent = getTrueOffsetParent(offsetParent);
  1838. }
  1839. if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static') {
  1840. return window;
  1841. }
  1842. return offsetParent || getContainingBlock(element) || window;
  1843. }
  1844. function getMainAxisFromPlacement(placement) {
  1845. return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
  1846. }
  1847. function within(min, value, max) {
  1848. return Math.max(min, Math.min(value, max));
  1849. }
  1850. function getFreshSideObject() {
  1851. return {
  1852. top: 0,
  1853. right: 0,
  1854. bottom: 0,
  1855. left: 0
  1856. };
  1857. }
  1858. function mergePaddingObject(paddingObject) {
  1859. return Object.assign(Object.assign({}, getFreshSideObject()), paddingObject);
  1860. }
  1861. function expandToHashMap(value, keys) {
  1862. return keys.reduce(function (hashMap, key) {
  1863. hashMap[key] = value;
  1864. return hashMap;
  1865. }, {});
  1866. }
  1867. function arrow(_ref) {
  1868. var _state$modifiersData$;
  1869. var state = _ref.state,
  1870. name = _ref.name;
  1871. var arrowElement = state.elements.arrow;
  1872. var popperOffsets = state.modifiersData.popperOffsets;
  1873. var basePlacement = getBasePlacement(state.placement);
  1874. var axis = getMainAxisFromPlacement(basePlacement);
  1875. var isVertical = [left, right].indexOf(basePlacement) >= 0;
  1876. var len = isVertical ? 'height' : 'width';
  1877. if (!arrowElement || !popperOffsets) {
  1878. return;
  1879. }
  1880. var paddingObject = state.modifiersData[name + "#persistent"].padding;
  1881. var arrowRect = getLayoutRect(arrowElement);
  1882. var minProp = axis === 'y' ? top : left;
  1883. var maxProp = axis === 'y' ? bottom : right;
  1884. var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
  1885. var startDiff = popperOffsets[axis] - state.rects.reference[axis];
  1886. var arrowOffsetParent = getOffsetParent(arrowElement);
  1887. var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
  1888. var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
  1889. // outside of the popper bounds
  1890. var min = paddingObject[minProp];
  1891. var max = clientSize - arrowRect[len] - paddingObject[maxProp];
  1892. var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
  1893. var offset = within(min, center, max); // Prevents breaking syntax highlighting...
  1894. var axisProp = axis;
  1895. state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
  1896. }
  1897. function effect$1(_ref2) {
  1898. var state = _ref2.state,
  1899. options = _ref2.options,
  1900. name = _ref2.name;
  1901. var _options$element = options.element,
  1902. arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element,
  1903. _options$padding = options.padding,
  1904. padding = _options$padding === void 0 ? 0 : _options$padding;
  1905. if (arrowElement == null) {
  1906. return;
  1907. } // CSS selector
  1908. if (typeof arrowElement === 'string') {
  1909. arrowElement = state.elements.popper.querySelector(arrowElement);
  1910. if (!arrowElement) {
  1911. return;
  1912. }
  1913. }
  1914. if (!contains(state.elements.popper, arrowElement)) {
  1915. return;
  1916. }
  1917. state.elements.arrow = arrowElement;
  1918. state.modifiersData[name + "#persistent"] = {
  1919. padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))
  1920. };
  1921. } // eslint-disable-next-line import/no-unused-modules
  1922. var arrow$1 = {
  1923. name: 'arrow',
  1924. enabled: true,
  1925. phase: 'main',
  1926. fn: arrow,
  1927. effect: effect$1,
  1928. requires: ['popperOffsets'],
  1929. requiresIfExists: ['preventOverflow']
  1930. };
  1931. var unsetSides = {
  1932. top: 'auto',
  1933. right: 'auto',
  1934. bottom: 'auto',
  1935. left: 'auto'
  1936. }; // Round the offsets to the nearest suitable subpixel based on the DPR.
  1937. // Zooming can change the DPR, but it seems to report a value that will
  1938. // cleanly divide the values into the appropriate subpixels.
  1939. function roundOffsetsByDPR(_ref) {
  1940. var x = _ref.x,
  1941. y = _ref.y;
  1942. var win = window;
  1943. var dpr = win.devicePixelRatio || 1;
  1944. return {
  1945. x: Math.round(x * dpr) / dpr || 0,
  1946. y: Math.round(y * dpr) / dpr || 0
  1947. };
  1948. }
  1949. function mapToStyles(_ref2) {
  1950. var _Object$assign2;
  1951. var popper = _ref2.popper,
  1952. popperRect = _ref2.popperRect,
  1953. placement = _ref2.placement,
  1954. offsets = _ref2.offsets,
  1955. position = _ref2.position,
  1956. gpuAcceleration = _ref2.gpuAcceleration,
  1957. adaptive = _ref2.adaptive,
  1958. roundOffsets = _ref2.roundOffsets;
  1959. var _ref3 = roundOffsets ? roundOffsetsByDPR(offsets) : offsets,
  1960. _ref3$x = _ref3.x,
  1961. x = _ref3$x === void 0 ? 0 : _ref3$x,
  1962. _ref3$y = _ref3.y,
  1963. y = _ref3$y === void 0 ? 0 : _ref3$y;
  1964. var hasX = offsets.hasOwnProperty('x');
  1965. var hasY = offsets.hasOwnProperty('y');
  1966. var sideX = left;
  1967. var sideY = top;
  1968. var win = window;
  1969. if (adaptive) {
  1970. var offsetParent = getOffsetParent(popper);
  1971. if (offsetParent === getWindow(popper)) {
  1972. offsetParent = getDocumentElement(popper);
  1973. } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
  1974. /*:: offsetParent = (offsetParent: Element); */
  1975. if (placement === top) {
  1976. sideY = bottom;
  1977. y -= offsetParent.clientHeight - popperRect.height;
  1978. y *= gpuAcceleration ? 1 : -1;
  1979. }
  1980. if (placement === left) {
  1981. sideX = right;
  1982. x -= offsetParent.clientWidth - popperRect.width;
  1983. x *= gpuAcceleration ? 1 : -1;
  1984. }
  1985. }
  1986. var commonStyles = Object.assign({
  1987. position: position
  1988. }, adaptive && unsetSides);
  1989. if (gpuAcceleration) {
  1990. var _Object$assign;
  1991. return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
  1992. }
  1993. return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
  1994. }
  1995. function computeStyles(_ref4) {
  1996. var state = _ref4.state,
  1997. options = _ref4.options;
  1998. var _options$gpuAccelerat = options.gpuAcceleration,
  1999. gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
  2000. _options$adaptive = options.adaptive,
  2001. adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
  2002. _options$roundOffsets = options.roundOffsets,
  2003. roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  2004. var commonStyles = {
  2005. placement: getBasePlacement(state.placement),
  2006. popper: state.elements.popper,
  2007. popperRect: state.rects.popper,
  2008. gpuAcceleration: gpuAcceleration
  2009. };
  2010. if (state.modifiersData.popperOffsets != null) {
  2011. state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {
  2012. offsets: state.modifiersData.popperOffsets,
  2013. position: state.options.strategy,
  2014. adaptive: adaptive,
  2015. roundOffsets: roundOffsets
  2016. })));
  2017. }
  2018. if (state.modifiersData.arrow != null) {
  2019. state.styles.arrow = Object.assign(Object.assign({}, state.styles.arrow), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {
  2020. offsets: state.modifiersData.arrow,
  2021. position: 'absolute',
  2022. adaptive: false,
  2023. roundOffsets: roundOffsets
  2024. })));
  2025. }
  2026. state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {
  2027. 'data-popper-placement': state.placement
  2028. });
  2029. } // eslint-disable-next-line import/no-unused-modules
  2030. var computeStyles$1 = {
  2031. name: 'computeStyles',
  2032. enabled: true,
  2033. phase: 'beforeWrite',
  2034. fn: computeStyles,
  2035. data: {}
  2036. };
  2037. var passive = {
  2038. passive: true
  2039. };
  2040. function effect$2(_ref) {
  2041. var state = _ref.state,
  2042. instance = _ref.instance,
  2043. options = _ref.options;
  2044. var _options$scroll = options.scroll,
  2045. scroll = _options$scroll === void 0 ? true : _options$scroll,
  2046. _options$resize = options.resize,
  2047. resize = _options$resize === void 0 ? true : _options$resize;
  2048. var window = getWindow(state.elements.popper);
  2049. var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
  2050. if (scroll) {
  2051. scrollParents.forEach(function (scrollParent) {
  2052. scrollParent.addEventListener('scroll', instance.update, passive);
  2053. });
  2054. }
  2055. if (resize) {
  2056. window.addEventListener('resize', instance.update, passive);
  2057. }
  2058. return function () {
  2059. if (scroll) {
  2060. scrollParents.forEach(function (scrollParent) {
  2061. scrollParent.removeEventListener('scroll', instance.update, passive);
  2062. });
  2063. }
  2064. if (resize) {
  2065. window.removeEventListener('resize', instance.update, passive);
  2066. }
  2067. };
  2068. } // eslint-disable-next-line import/no-unused-modules
  2069. var eventListeners = {
  2070. name: 'eventListeners',
  2071. enabled: true,
  2072. phase: 'write',
  2073. fn: function fn() {},
  2074. effect: effect$2,
  2075. data: {}
  2076. };
  2077. var hash = {
  2078. left: 'right',
  2079. right: 'left',
  2080. bottom: 'top',
  2081. top: 'bottom'
  2082. };
  2083. function getOppositePlacement(placement) {
  2084. return placement.replace(/left|right|bottom|top/g, function (matched) {
  2085. return hash[matched];
  2086. });
  2087. }
  2088. var hash$1 = {
  2089. start: 'end',
  2090. end: 'start'
  2091. };
  2092. function getOppositeVariationPlacement(placement) {
  2093. return placement.replace(/start|end/g, function (matched) {
  2094. return hash$1[matched];
  2095. });
  2096. }
  2097. function getBoundingClientRect(element) {
  2098. var rect = element.getBoundingClientRect();
  2099. return {
  2100. width: rect.width,
  2101. height: rect.height,
  2102. top: rect.top,
  2103. right: rect.right,
  2104. bottom: rect.bottom,
  2105. left: rect.left,
  2106. x: rect.left,
  2107. y: rect.top
  2108. };
  2109. }
  2110. function getWindowScroll(node) {
  2111. var win = getWindow(node);
  2112. var scrollLeft = win.pageXOffset;
  2113. var scrollTop = win.pageYOffset;
  2114. return {
  2115. scrollLeft: scrollLeft,
  2116. scrollTop: scrollTop
  2117. };
  2118. }
  2119. function getWindowScrollBarX(element) {
  2120. // If <html> has a CSS width greater than the viewport, then this will be
  2121. // incorrect for RTL.
  2122. // Popper 1 is broken in this case and never had a bug report so let's assume
  2123. // it's not an issue. I don't think anyone ever specifies width on <html>
  2124. // anyway.
  2125. // Browsers where the left scrollbar doesn't cause an issue report `0` for
  2126. // this (e.g. Edge 2019, IE11, Safari)
  2127. return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
  2128. }
  2129. function getViewportRect(element) {
  2130. var win = getWindow(element);
  2131. var html = getDocumentElement(element);
  2132. var visualViewport = win.visualViewport;
  2133. var width = html.clientWidth;
  2134. var height = html.clientHeight;
  2135. var x = 0;
  2136. var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
  2137. // can be obscured underneath it.
  2138. // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
  2139. // if it isn't open, so if this isn't available, the popper will be detected
  2140. // to overflow the bottom of the screen too early.
  2141. if (visualViewport) {
  2142. width = visualViewport.width;
  2143. height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
  2144. // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
  2145. // errors due to floating point numbers, so we need to check precision.
  2146. // Safari returns a number <= 0, usually < -1 when pinch-zoomed
  2147. // Feature detection fails in mobile emulation mode in Chrome.
  2148. // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
  2149. // 0.001
  2150. // Fallback here: "Not Safari" userAgent
  2151. if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
  2152. x = visualViewport.offsetLeft;
  2153. y = visualViewport.offsetTop;
  2154. }
  2155. }
  2156. return {
  2157. width: width,
  2158. height: height,
  2159. x: x + getWindowScrollBarX(element),
  2160. y: y
  2161. };
  2162. }
  2163. // of the `<html>` and `<body>` rect bounds if horizontally scrollable
  2164. function getDocumentRect(element) {
  2165. var html = getDocumentElement(element);
  2166. var winScroll = getWindowScroll(element);
  2167. var body = element.ownerDocument.body;
  2168. var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
  2169. var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
  2170. var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
  2171. var y = -winScroll.scrollTop;
  2172. if (getComputedStyle$1(body || html).direction === 'rtl') {
  2173. x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;
  2174. }
  2175. return {
  2176. width: width,
  2177. height: height,
  2178. x: x,
  2179. y: y
  2180. };
  2181. }
  2182. function isScrollParent(element) {
  2183. // Firefox wants us to check `-x` and `-y` variations as well
  2184. var _getComputedStyle = getComputedStyle$1(element),
  2185. overflow = _getComputedStyle.overflow,
  2186. overflowX = _getComputedStyle.overflowX,
  2187. overflowY = _getComputedStyle.overflowY;
  2188. return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
  2189. }
  2190. function getScrollParent(node) {
  2191. if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
  2192. // $FlowFixMe[incompatible-return]: assume body is always available
  2193. return node.ownerDocument.body;
  2194. }
  2195. if (isHTMLElement(node) && isScrollParent(node)) {
  2196. return node;
  2197. }
  2198. return getScrollParent(getParentNode(node));
  2199. }
  2200. /*
  2201. given a DOM element, return the list of all scroll parents, up the list of ancesors
  2202. until we get to the top window object. This list is what we attach scroll listeners
  2203. to, because if any of these parent elements scroll, we'll need to re-calculate the
  2204. reference element's position.
  2205. */
  2206. function listScrollParents(element, list) {
  2207. if (list === void 0) {
  2208. list = [];
  2209. }
  2210. var scrollParent = getScrollParent(element);
  2211. var isBody = getNodeName(scrollParent) === 'body';
  2212. var win = getWindow(scrollParent);
  2213. var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
  2214. var updatedList = list.concat(target);
  2215. return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
  2216. updatedList.concat(listScrollParents(getParentNode(target)));
  2217. }
  2218. function rectToClientRect(rect) {
  2219. return Object.assign(Object.assign({}, rect), {}, {
  2220. left: rect.x,
  2221. top: rect.y,
  2222. right: rect.x + rect.width,
  2223. bottom: rect.y + rect.height
  2224. });
  2225. }
  2226. function getInnerBoundingClientRect(element) {
  2227. var rect = getBoundingClientRect(element);
  2228. rect.top = rect.top + element.clientTop;
  2229. rect.left = rect.left + element.clientLeft;
  2230. rect.bottom = rect.top + element.clientHeight;
  2231. rect.right = rect.left + element.clientWidth;
  2232. rect.width = element.clientWidth;
  2233. rect.height = element.clientHeight;
  2234. rect.x = rect.left;
  2235. rect.y = rect.top;
  2236. return rect;
  2237. }
  2238. function getClientRectFromMixedType(element, clippingParent) {
  2239. return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
  2240. } // A "clipping parent" is an overflowable container with the characteristic of
  2241. // clipping (or hiding) overflowing elements with a position different from
  2242. // `initial`
  2243. function getClippingParents(element) {
  2244. var clippingParents = listScrollParents(getParentNode(element));
  2245. var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0;
  2246. var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
  2247. if (!isElement$1(clipperElement)) {
  2248. return [];
  2249. } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
  2250. return clippingParents.filter(function (clippingParent) {
  2251. return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
  2252. });
  2253. } // Gets the maximum area that the element is visible in due to any number of
  2254. // clipping parents
  2255. function getClippingRect(element, boundary, rootBoundary) {
  2256. var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
  2257. var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
  2258. var firstClippingParent = clippingParents[0];
  2259. var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
  2260. var rect = getClientRectFromMixedType(element, clippingParent);
  2261. accRect.top = Math.max(rect.top, accRect.top);
  2262. accRect.right = Math.min(rect.right, accRect.right);
  2263. accRect.bottom = Math.min(rect.bottom, accRect.bottom);
  2264. accRect.left = Math.max(rect.left, accRect.left);
  2265. return accRect;
  2266. }, getClientRectFromMixedType(element, firstClippingParent));
  2267. clippingRect.width = clippingRect.right - clippingRect.left;
  2268. clippingRect.height = clippingRect.bottom - clippingRect.top;
  2269. clippingRect.x = clippingRect.left;
  2270. clippingRect.y = clippingRect.top;
  2271. return clippingRect;
  2272. }
  2273. function getVariation(placement) {
  2274. return placement.split('-')[1];
  2275. }
  2276. function computeOffsets(_ref) {
  2277. var reference = _ref.reference,
  2278. element = _ref.element,
  2279. placement = _ref.placement;
  2280. var basePlacement = placement ? getBasePlacement(placement) : null;
  2281. var variation = placement ? getVariation(placement) : null;
  2282. var commonX = reference.x + reference.width / 2 - element.width / 2;
  2283. var commonY = reference.y + reference.height / 2 - element.height / 2;
  2284. var offsets;
  2285. switch (basePlacement) {
  2286. case top:
  2287. offsets = {
  2288. x: commonX,
  2289. y: reference.y - element.height
  2290. };
  2291. break;
  2292. case bottom:
  2293. offsets = {
  2294. x: commonX,
  2295. y: reference.y + reference.height
  2296. };
  2297. break;
  2298. case right:
  2299. offsets = {
  2300. x: reference.x + reference.width,
  2301. y: commonY
  2302. };
  2303. break;
  2304. case left:
  2305. offsets = {
  2306. x: reference.x - element.width,
  2307. y: commonY
  2308. };
  2309. break;
  2310. default:
  2311. offsets = {
  2312. x: reference.x,
  2313. y: reference.y
  2314. };
  2315. }
  2316. var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
  2317. if (mainAxis != null) {
  2318. var len = mainAxis === 'y' ? 'height' : 'width';
  2319. switch (variation) {
  2320. case start:
  2321. offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
  2322. break;
  2323. case end:
  2324. offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
  2325. break;
  2326. }
  2327. }
  2328. return offsets;
  2329. }
  2330. function detectOverflow(state, options) {
  2331. if (options === void 0) {
  2332. options = {};
  2333. }
  2334. var _options = options,
  2335. _options$placement = _options.placement,
  2336. placement = _options$placement === void 0 ? state.placement : _options$placement,
  2337. _options$boundary = _options.boundary,
  2338. boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
  2339. _options$rootBoundary = _options.rootBoundary,
  2340. rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
  2341. _options$elementConte = _options.elementContext,
  2342. elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
  2343. _options$altBoundary = _options.altBoundary,
  2344. altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
  2345. _options$padding = _options.padding,
  2346. padding = _options$padding === void 0 ? 0 : _options$padding;
  2347. var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
  2348. var altContext = elementContext === popper ? reference : popper;
  2349. var referenceElement = state.elements.reference;
  2350. var popperRect = state.rects.popper;
  2351. var element = state.elements[altBoundary ? altContext : elementContext];
  2352. var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
  2353. var referenceClientRect = getBoundingClientRect(referenceElement);
  2354. var popperOffsets = computeOffsets({
  2355. reference: referenceClientRect,
  2356. element: popperRect,
  2357. strategy: 'absolute',
  2358. placement: placement
  2359. });
  2360. var popperClientRect = rectToClientRect(Object.assign(Object.assign({}, popperRect), popperOffsets));
  2361. var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
  2362. // 0 or negative = within the clipping rect
  2363. var overflowOffsets = {
  2364. top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
  2365. bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
  2366. left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
  2367. right: elementClientRect.right - clippingClientRect.right + paddingObject.right
  2368. };
  2369. var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
  2370. if (elementContext === popper && offsetData) {
  2371. var offset = offsetData[placement];
  2372. Object.keys(overflowOffsets).forEach(function (key) {
  2373. var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
  2374. var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
  2375. overflowOffsets[key] += offset[axis] * multiply;
  2376. });
  2377. }
  2378. return overflowOffsets;
  2379. }
  2380. /*:: type OverflowsMap = { [ComputedPlacement]: number }; */
  2381. /*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */
  2382. function computeAutoPlacement(state, options) {
  2383. if (options === void 0) {
  2384. options = {};
  2385. }
  2386. var _options = options,
  2387. placement = _options.placement,
  2388. boundary = _options.boundary,
  2389. rootBoundary = _options.rootBoundary,
  2390. padding = _options.padding,
  2391. flipVariations = _options.flipVariations,
  2392. _options$allowedAutoP = _options.allowedAutoPlacements,
  2393. allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
  2394. var variation = getVariation(placement);
  2395. var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
  2396. return getVariation(placement) === variation;
  2397. }) : basePlacements;
  2398. var allowedPlacements = placements$1.filter(function (placement) {
  2399. return allowedAutoPlacements.indexOf(placement) >= 0;
  2400. });
  2401. if (allowedPlacements.length === 0) {
  2402. allowedPlacements = placements$1;
  2403. } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
  2404. var overflows = allowedPlacements.reduce(function (acc, placement) {
  2405. acc[placement] = detectOverflow(state, {
  2406. placement: placement,
  2407. boundary: boundary,
  2408. rootBoundary: rootBoundary,
  2409. padding: padding
  2410. })[getBasePlacement(placement)];
  2411. return acc;
  2412. }, {});
  2413. return Object.keys(overflows).sort(function (a, b) {
  2414. return overflows[a] - overflows[b];
  2415. });
  2416. }
  2417. function getExpandedFallbackPlacements(placement) {
  2418. if (getBasePlacement(placement) === auto) {
  2419. return [];
  2420. }
  2421. var oppositePlacement = getOppositePlacement(placement);
  2422. return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
  2423. }
  2424. function flip(_ref) {
  2425. var state = _ref.state,
  2426. options = _ref.options,
  2427. name = _ref.name;
  2428. if (state.modifiersData[name]._skip) {
  2429. return;
  2430. }
  2431. var _options$mainAxis = options.mainAxis,
  2432. checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
  2433. _options$altAxis = options.altAxis,
  2434. checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
  2435. specifiedFallbackPlacements = options.fallbackPlacements,
  2436. padding = options.padding,
  2437. boundary = options.boundary,
  2438. rootBoundary = options.rootBoundary,
  2439. altBoundary = options.altBoundary,
  2440. _options$flipVariatio = options.flipVariations,
  2441. flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
  2442. allowedAutoPlacements = options.allowedAutoPlacements;
  2443. var preferredPlacement = state.options.placement;
  2444. var basePlacement = getBasePlacement(preferredPlacement);
  2445. var isBasePlacement = basePlacement === preferredPlacement;
  2446. var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
  2447. var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
  2448. return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
  2449. placement: placement,
  2450. boundary: boundary,
  2451. rootBoundary: rootBoundary,
  2452. padding: padding,
  2453. flipVariations: flipVariations,
  2454. allowedAutoPlacements: allowedAutoPlacements
  2455. }) : placement);
  2456. }, []);
  2457. var referenceRect = state.rects.reference;
  2458. var popperRect = state.rects.popper;
  2459. var checksMap = new Map();
  2460. var makeFallbackChecks = true;
  2461. var firstFittingPlacement = placements[0];
  2462. for (var i = 0; i < placements.length; i++) {
  2463. var placement = placements[i];
  2464. var _basePlacement = getBasePlacement(placement);
  2465. var isStartVariation = getVariation(placement) === start;
  2466. var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
  2467. var len = isVertical ? 'width' : 'height';
  2468. var overflow = detectOverflow(state, {
  2469. placement: placement,
  2470. boundary: boundary,
  2471. rootBoundary: rootBoundary,
  2472. altBoundary: altBoundary,
  2473. padding: padding
  2474. });
  2475. var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
  2476. if (referenceRect[len] > popperRect[len]) {
  2477. mainVariationSide = getOppositePlacement(mainVariationSide);
  2478. }
  2479. var altVariationSide = getOppositePlacement(mainVariationSide);
  2480. var checks = [];
  2481. if (checkMainAxis) {
  2482. checks.push(overflow[_basePlacement] <= 0);
  2483. }
  2484. if (checkAltAxis) {
  2485. checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
  2486. }
  2487. if (checks.every(function (check) {
  2488. return check;
  2489. })) {
  2490. firstFittingPlacement = placement;
  2491. makeFallbackChecks = false;
  2492. break;
  2493. }
  2494. checksMap.set(placement, checks);
  2495. }
  2496. if (makeFallbackChecks) {
  2497. // `2` may be desired in some cases – research later
  2498. var numberOfChecks = flipVariations ? 3 : 1;
  2499. var _loop = function _loop(_i) {
  2500. var fittingPlacement = placements.find(function (placement) {
  2501. var checks = checksMap.get(placement);
  2502. if (checks) {
  2503. return checks.slice(0, _i).every(function (check) {
  2504. return check;
  2505. });
  2506. }
  2507. });
  2508. if (fittingPlacement) {
  2509. firstFittingPlacement = fittingPlacement;
  2510. return "break";
  2511. }
  2512. };
  2513. for (var _i = numberOfChecks; _i > 0; _i--) {
  2514. var _ret = _loop(_i);
  2515. if (_ret === "break") break;
  2516. }
  2517. }
  2518. if (state.placement !== firstFittingPlacement) {
  2519. state.modifiersData[name]._skip = true;
  2520. state.placement = firstFittingPlacement;
  2521. state.reset = true;
  2522. }
  2523. } // eslint-disable-next-line import/no-unused-modules
  2524. var flip$1 = {
  2525. name: 'flip',
  2526. enabled: true,
  2527. phase: 'main',
  2528. fn: flip,
  2529. requiresIfExists: ['offset'],
  2530. data: {
  2531. _skip: false
  2532. }
  2533. };
  2534. function getSideOffsets(overflow, rect, preventedOffsets) {
  2535. if (preventedOffsets === void 0) {
  2536. preventedOffsets = {
  2537. x: 0,
  2538. y: 0
  2539. };
  2540. }
  2541. return {
  2542. top: overflow.top - rect.height - preventedOffsets.y,
  2543. right: overflow.right - rect.width + preventedOffsets.x,
  2544. bottom: overflow.bottom - rect.height + preventedOffsets.y,
  2545. left: overflow.left - rect.width - preventedOffsets.x
  2546. };
  2547. }
  2548. function isAnySideFullyClipped(overflow) {
  2549. return [top, right, bottom, left].some(function (side) {
  2550. return overflow[side] >= 0;
  2551. });
  2552. }
  2553. function hide(_ref) {
  2554. var state = _ref.state,
  2555. name = _ref.name;
  2556. var referenceRect = state.rects.reference;
  2557. var popperRect = state.rects.popper;
  2558. var preventedOffsets = state.modifiersData.preventOverflow;
  2559. var referenceOverflow = detectOverflow(state, {
  2560. elementContext: 'reference'
  2561. });
  2562. var popperAltOverflow = detectOverflow(state, {
  2563. altBoundary: true
  2564. });
  2565. var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
  2566. var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
  2567. var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
  2568. var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
  2569. state.modifiersData[name] = {
  2570. referenceClippingOffsets: referenceClippingOffsets,
  2571. popperEscapeOffsets: popperEscapeOffsets,
  2572. isReferenceHidden: isReferenceHidden,
  2573. hasPopperEscaped: hasPopperEscaped
  2574. };
  2575. state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {
  2576. 'data-popper-reference-hidden': isReferenceHidden,
  2577. 'data-popper-escaped': hasPopperEscaped
  2578. });
  2579. } // eslint-disable-next-line import/no-unused-modules
  2580. var hide$1 = {
  2581. name: 'hide',
  2582. enabled: true,
  2583. phase: 'main',
  2584. requiresIfExists: ['preventOverflow'],
  2585. fn: hide
  2586. };
  2587. function distanceAndSkiddingToXY(placement, rects, offset) {
  2588. var basePlacement = getBasePlacement(placement);
  2589. var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
  2590. var _ref = typeof offset === 'function' ? offset(Object.assign(Object.assign({}, rects), {}, {
  2591. placement: placement
  2592. })) : offset,
  2593. skidding = _ref[0],
  2594. distance = _ref[1];
  2595. skidding = skidding || 0;
  2596. distance = (distance || 0) * invertDistance;
  2597. return [left, right].indexOf(basePlacement) >= 0 ? {
  2598. x: distance,
  2599. y: skidding
  2600. } : {
  2601. x: skidding,
  2602. y: distance
  2603. };
  2604. }
  2605. function offset(_ref2) {
  2606. var state = _ref2.state,
  2607. options = _ref2.options,
  2608. name = _ref2.name;
  2609. var _options$offset = options.offset,
  2610. offset = _options$offset === void 0 ? [0, 0] : _options$offset;
  2611. var data = placements.reduce(function (acc, placement) {
  2612. acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
  2613. return acc;
  2614. }, {});
  2615. var _data$state$placement = data[state.placement],
  2616. x = _data$state$placement.x,
  2617. y = _data$state$placement.y;
  2618. if (state.modifiersData.popperOffsets != null) {
  2619. state.modifiersData.popperOffsets.x += x;
  2620. state.modifiersData.popperOffsets.y += y;
  2621. }
  2622. state.modifiersData[name] = data;
  2623. } // eslint-disable-next-line import/no-unused-modules
  2624. var offset$1 = {
  2625. name: 'offset',
  2626. enabled: true,
  2627. phase: 'main',
  2628. requires: ['popperOffsets'],
  2629. fn: offset
  2630. };
  2631. function popperOffsets(_ref) {
  2632. var state = _ref.state,
  2633. name = _ref.name;
  2634. // Offsets are the actual position the popper needs to have to be
  2635. // properly positioned near its reference element
  2636. // This is the most basic placement, and will be adjusted by
  2637. // the modifiers in the next step
  2638. state.modifiersData[name] = computeOffsets({
  2639. reference: state.rects.reference,
  2640. element: state.rects.popper,
  2641. strategy: 'absolute',
  2642. placement: state.placement
  2643. });
  2644. } // eslint-disable-next-line import/no-unused-modules
  2645. var popperOffsets$1 = {
  2646. name: 'popperOffsets',
  2647. enabled: true,
  2648. phase: 'read',
  2649. fn: popperOffsets,
  2650. data: {}
  2651. };
  2652. function getAltAxis(axis) {
  2653. return axis === 'x' ? 'y' : 'x';
  2654. }
  2655. function preventOverflow(_ref) {
  2656. var state = _ref.state,
  2657. options = _ref.options,
  2658. name = _ref.name;
  2659. var _options$mainAxis = options.mainAxis,
  2660. checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
  2661. _options$altAxis = options.altAxis,
  2662. checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
  2663. boundary = options.boundary,
  2664. rootBoundary = options.rootBoundary,
  2665. altBoundary = options.altBoundary,
  2666. padding = options.padding,
  2667. _options$tether = options.tether,
  2668. tether = _options$tether === void 0 ? true : _options$tether,
  2669. _options$tetherOffset = options.tetherOffset,
  2670. tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
  2671. var overflow = detectOverflow(state, {
  2672. boundary: boundary,
  2673. rootBoundary: rootBoundary,
  2674. padding: padding,
  2675. altBoundary: altBoundary
  2676. });
  2677. var basePlacement = getBasePlacement(state.placement);
  2678. var variation = getVariation(state.placement);
  2679. var isBasePlacement = !variation;
  2680. var mainAxis = getMainAxisFromPlacement(basePlacement);
  2681. var altAxis = getAltAxis(mainAxis);
  2682. var popperOffsets = state.modifiersData.popperOffsets;
  2683. var referenceRect = state.rects.reference;
  2684. var popperRect = state.rects.popper;
  2685. var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(Object.assign({}, state.rects), {}, {
  2686. placement: state.placement
  2687. })) : tetherOffset;
  2688. var data = {
  2689. x: 0,
  2690. y: 0
  2691. };
  2692. if (!popperOffsets) {
  2693. return;
  2694. }
  2695. if (checkMainAxis) {
  2696. var mainSide = mainAxis === 'y' ? top : left;
  2697. var altSide = mainAxis === 'y' ? bottom : right;
  2698. var len = mainAxis === 'y' ? 'height' : 'width';
  2699. var offset = popperOffsets[mainAxis];
  2700. var min = popperOffsets[mainAxis] + overflow[mainSide];
  2701. var max = popperOffsets[mainAxis] - overflow[altSide];
  2702. var additive = tether ? -popperRect[len] / 2 : 0;
  2703. var minLen = variation === start ? referenceRect[len] : popperRect[len];
  2704. var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
  2705. // outside the reference bounds
  2706. var arrowElement = state.elements.arrow;
  2707. var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
  2708. width: 0,
  2709. height: 0
  2710. };
  2711. var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
  2712. var arrowPaddingMin = arrowPaddingObject[mainSide];
  2713. var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
  2714. // to include its full size in the calculation. If the reference is small
  2715. // and near the edge of a boundary, the popper can overflow even if the
  2716. // reference is not overflowing as well (e.g. virtual elements with no
  2717. // width or height)
  2718. var arrowLen = within(0, referenceRect[len], arrowRect[len]);
  2719. var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
  2720. var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
  2721. var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
  2722. var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
  2723. var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
  2724. var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
  2725. var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
  2726. var preventedOffset = within(tether ? Math.min(min, tetherMin) : min, offset, tether ? Math.max(max, tetherMax) : max);
  2727. popperOffsets[mainAxis] = preventedOffset;
  2728. data[mainAxis] = preventedOffset - offset;
  2729. }
  2730. if (checkAltAxis) {
  2731. var _mainSide = mainAxis === 'x' ? top : left;
  2732. var _altSide = mainAxis === 'x' ? bottom : right;
  2733. var _offset = popperOffsets[altAxis];
  2734. var _min = _offset + overflow[_mainSide];
  2735. var _max = _offset - overflow[_altSide];
  2736. var _preventedOffset = within(_min, _offset, _max);
  2737. popperOffsets[altAxis] = _preventedOffset;
  2738. data[altAxis] = _preventedOffset - _offset;
  2739. }
  2740. state.modifiersData[name] = data;
  2741. } // eslint-disable-next-line import/no-unused-modules
  2742. var preventOverflow$1 = {
  2743. name: 'preventOverflow',
  2744. enabled: true,
  2745. phase: 'main',
  2746. fn: preventOverflow,
  2747. requiresIfExists: ['offset']
  2748. };
  2749. function getHTMLElementScroll(element) {
  2750. return {
  2751. scrollLeft: element.scrollLeft,
  2752. scrollTop: element.scrollTop
  2753. };
  2754. }
  2755. function getNodeScroll(node) {
  2756. if (node === getWindow(node) || !isHTMLElement(node)) {
  2757. return getWindowScroll(node);
  2758. } else {
  2759. return getHTMLElementScroll(node);
  2760. }
  2761. }
  2762. // Composite means it takes into account transforms as well as layout.
  2763. function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
  2764. if (isFixed === void 0) {
  2765. isFixed = false;
  2766. }
  2767. var documentElement = getDocumentElement(offsetParent);
  2768. var rect = getBoundingClientRect(elementOrVirtualElement);
  2769. var isOffsetParentAnElement = isHTMLElement(offsetParent);
  2770. var scroll = {
  2771. scrollLeft: 0,
  2772. scrollTop: 0
  2773. };
  2774. var offsets = {
  2775. x: 0,
  2776. y: 0
  2777. };
  2778. if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
  2779. if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
  2780. isScrollParent(documentElement)) {
  2781. scroll = getNodeScroll(offsetParent);
  2782. }
  2783. if (isHTMLElement(offsetParent)) {
  2784. offsets = getBoundingClientRect(offsetParent);
  2785. offsets.x += offsetParent.clientLeft;
  2786. offsets.y += offsetParent.clientTop;
  2787. } else if (documentElement) {
  2788. offsets.x = getWindowScrollBarX(documentElement);
  2789. }
  2790. }
  2791. return {
  2792. x: rect.left + scroll.scrollLeft - offsets.x,
  2793. y: rect.top + scroll.scrollTop - offsets.y,
  2794. width: rect.width,
  2795. height: rect.height
  2796. };
  2797. }
  2798. function order(modifiers) {
  2799. var map = new Map();
  2800. var visited = new Set();
  2801. var result = [];
  2802. modifiers.forEach(function (modifier) {
  2803. map.set(modifier.name, modifier);
  2804. }); // On visiting object, check for its dependencies and visit them recursively
  2805. function sort(modifier) {
  2806. visited.add(modifier.name);
  2807. var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
  2808. requires.forEach(function (dep) {
  2809. if (!visited.has(dep)) {
  2810. var depModifier = map.get(dep);
  2811. if (depModifier) {
  2812. sort(depModifier);
  2813. }
  2814. }
  2815. });
  2816. result.push(modifier);
  2817. }
  2818. modifiers.forEach(function (modifier) {
  2819. if (!visited.has(modifier.name)) {
  2820. // check for visited object
  2821. sort(modifier);
  2822. }
  2823. });
  2824. return result;
  2825. }
  2826. function orderModifiers(modifiers) {
  2827. // order based on dependencies
  2828. var orderedModifiers = order(modifiers); // order based on phase
  2829. return modifierPhases.reduce(function (acc, phase) {
  2830. return acc.concat(orderedModifiers.filter(function (modifier) {
  2831. return modifier.phase === phase;
  2832. }));
  2833. }, []);
  2834. }
  2835. function debounce(fn) {
  2836. var pending;
  2837. return function () {
  2838. if (!pending) {
  2839. pending = new Promise(function (resolve) {
  2840. Promise.resolve().then(function () {
  2841. pending = undefined;
  2842. resolve(fn());
  2843. });
  2844. });
  2845. }
  2846. return pending;
  2847. };
  2848. }
  2849. function mergeByName(modifiers) {
  2850. var merged = modifiers.reduce(function (merged, current) {
  2851. var existing = merged[current.name];
  2852. merged[current.name] = existing ? Object.assign(Object.assign(Object.assign({}, existing), current), {}, {
  2853. options: Object.assign(Object.assign({}, existing.options), current.options),
  2854. data: Object.assign(Object.assign({}, existing.data), current.data)
  2855. }) : current;
  2856. return merged;
  2857. }, {}); // IE11 does not support Object.values
  2858. return Object.keys(merged).map(function (key) {
  2859. return merged[key];
  2860. });
  2861. }
  2862. var DEFAULT_OPTIONS = {
  2863. placement: 'bottom',
  2864. modifiers: [],
  2865. strategy: 'absolute'
  2866. };
  2867. function areValidElements() {
  2868. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2869. args[_key] = arguments[_key];
  2870. }
  2871. return !args.some(function (element) {
  2872. return !(element && typeof element.getBoundingClientRect === 'function');
  2873. });
  2874. }
  2875. function popperGenerator(generatorOptions) {
  2876. if (generatorOptions === void 0) {
  2877. generatorOptions = {};
  2878. }
  2879. var _generatorOptions = generatorOptions,
  2880. _generatorOptions$def = _generatorOptions.defaultModifiers,
  2881. defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
  2882. _generatorOptions$def2 = _generatorOptions.defaultOptions,
  2883. defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
  2884. return function createPopper(reference, popper, options) {
  2885. if (options === void 0) {
  2886. options = defaultOptions;
  2887. }
  2888. var state = {
  2889. placement: 'bottom',
  2890. orderedModifiers: [],
  2891. options: Object.assign(Object.assign({}, DEFAULT_OPTIONS), defaultOptions),
  2892. modifiersData: {},
  2893. elements: {
  2894. reference: reference,
  2895. popper: popper
  2896. },
  2897. attributes: {},
  2898. styles: {}
  2899. };
  2900. var effectCleanupFns = [];
  2901. var isDestroyed = false;
  2902. var instance = {
  2903. state: state,
  2904. setOptions: function setOptions(options) {
  2905. cleanupModifierEffects();
  2906. state.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), state.options), options);
  2907. state.scrollParents = {
  2908. reference: isElement$1(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
  2909. popper: listScrollParents(popper)
  2910. }; // Orders the modifiers based on their dependencies and `phase`
  2911. // properties
  2912. var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
  2913. state.orderedModifiers = orderedModifiers.filter(function (m) {
  2914. return m.enabled;
  2915. }); // Validate the provided modifiers so that the consumer will get warned
  2916. runModifierEffects();
  2917. return instance.update();
  2918. },
  2919. // Sync update – it will always be executed, even if not necessary. This
  2920. // is useful for low frequency updates where sync behavior simplifies the
  2921. // logic.
  2922. // For high frequency updates (e.g. `resize` and `scroll` events), always
  2923. // prefer the async Popper#update method
  2924. forceUpdate: function forceUpdate() {
  2925. if (isDestroyed) {
  2926. return;
  2927. }
  2928. var _state$elements = state.elements,
  2929. reference = _state$elements.reference,
  2930. popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
  2931. // anymore
  2932. if (!areValidElements(reference, popper)) {
  2933. return;
  2934. } // Store the reference and popper rects to be read by modifiers
  2935. state.rects = {
  2936. reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
  2937. popper: getLayoutRect(popper)
  2938. }; // Modifiers have the ability to reset the current update cycle. The
  2939. // most common use case for this is the `flip` modifier changing the
  2940. // placement, which then needs to re-run all the modifiers, because the
  2941. // logic was previously ran for the previous placement and is therefore
  2942. // stale/incorrect
  2943. state.reset = false;
  2944. state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
  2945. // is filled with the initial data specified by the modifier. This means
  2946. // it doesn't persist and is fresh on each update.
  2947. // To ensure persistent data, use `${name}#persistent`
  2948. state.orderedModifiers.forEach(function (modifier) {
  2949. return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
  2950. });
  2951. for (var index = 0; index < state.orderedModifiers.length; index++) {
  2952. if (state.reset === true) {
  2953. state.reset = false;
  2954. index = -1;
  2955. continue;
  2956. }
  2957. var _state$orderedModifie = state.orderedModifiers[index],
  2958. fn = _state$orderedModifie.fn,
  2959. _state$orderedModifie2 = _state$orderedModifie.options,
  2960. _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
  2961. name = _state$orderedModifie.name;
  2962. if (typeof fn === 'function') {
  2963. state = fn({
  2964. state: state,
  2965. options: _options,
  2966. name: name,
  2967. instance: instance
  2968. }) || state;
  2969. }
  2970. }
  2971. },
  2972. // Async and optimistically optimized update – it will not be executed if
  2973. // not necessary (debounced to run at most once-per-tick)
  2974. update: debounce(function () {
  2975. return new Promise(function (resolve) {
  2976. instance.forceUpdate();
  2977. resolve(state);
  2978. });
  2979. }),
  2980. destroy: function destroy() {
  2981. cleanupModifierEffects();
  2982. isDestroyed = true;
  2983. }
  2984. };
  2985. if (!areValidElements(reference, popper)) {
  2986. return instance;
  2987. }
  2988. instance.setOptions(options).then(function (state) {
  2989. if (!isDestroyed && options.onFirstUpdate) {
  2990. options.onFirstUpdate(state);
  2991. }
  2992. }); // Modifiers have the ability to execute arbitrary code before the first
  2993. // update cycle runs. They will be executed in the same order as the update
  2994. // cycle. This is useful when a modifier adds some persistent data that
  2995. // other modifiers need to use, but the modifier is run after the dependent
  2996. // one.
  2997. function runModifierEffects() {
  2998. state.orderedModifiers.forEach(function (_ref3) {
  2999. var name = _ref3.name,
  3000. _ref3$options = _ref3.options,
  3001. options = _ref3$options === void 0 ? {} : _ref3$options,
  3002. effect = _ref3.effect;
  3003. if (typeof effect === 'function') {
  3004. var cleanupFn = effect({
  3005. state: state,
  3006. name: name,
  3007. instance: instance,
  3008. options: options
  3009. });
  3010. var noopFn = function noopFn() {};
  3011. effectCleanupFns.push(cleanupFn || noopFn);
  3012. }
  3013. });
  3014. }
  3015. function cleanupModifierEffects() {
  3016. effectCleanupFns.forEach(function (fn) {
  3017. return fn();
  3018. });
  3019. effectCleanupFns = [];
  3020. }
  3021. return instance;
  3022. };
  3023. }
  3024. var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
  3025. var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
  3026. var createPopper$1 = /*#__PURE__*/popperGenerator({
  3027. defaultModifiers: defaultModifiers
  3028. }); // eslint-disable-next-line import/no-unused-modules
  3029. var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
  3030. var createPopper$2 = /*#__PURE__*/popperGenerator({
  3031. defaultModifiers: defaultModifiers$1
  3032. }); // eslint-disable-next-line import/no-unused-modules
  3033. var Popper = /*#__PURE__*/Object.freeze({
  3034. __proto__: null,
  3035. popperGenerator: popperGenerator,
  3036. detectOverflow: detectOverflow,
  3037. createPopperBase: createPopper,
  3038. createPopper: createPopper$2,
  3039. createPopperLite: createPopper$1,
  3040. top: top,
  3041. bottom: bottom,
  3042. right: right,
  3043. left: left,
  3044. auto: auto,
  3045. basePlacements: basePlacements,
  3046. start: start,
  3047. end: end,
  3048. clippingParents: clippingParents,
  3049. viewport: viewport,
  3050. popper: popper,
  3051. reference: reference,
  3052. variationPlacements: variationPlacements,
  3053. placements: placements,
  3054. beforeRead: beforeRead,
  3055. read: read,
  3056. afterRead: afterRead,
  3057. beforeMain: beforeMain,
  3058. main: main,
  3059. afterMain: afterMain,
  3060. beforeWrite: beforeWrite,
  3061. write: write,
  3062. afterWrite: afterWrite,
  3063. modifierPhases: modifierPhases,
  3064. applyStyles: applyStyles$1,
  3065. arrow: arrow$1,
  3066. computeStyles: computeStyles$1,
  3067. eventListeners: eventListeners,
  3068. flip: flip$1,
  3069. hide: hide$1,
  3070. offset: offset$1,
  3071. popperOffsets: popperOffsets$1,
  3072. preventOverflow: preventOverflow$1
  3073. });
  3074. /**
  3075. * ------------------------------------------------------------------------
  3076. * Constants
  3077. * ------------------------------------------------------------------------
  3078. */
  3079. var NAME$4 = 'dropdown';
  3080. var DATA_KEY$4 = 'bs.dropdown';
  3081. var EVENT_KEY$4 = "." + DATA_KEY$4;
  3082. var DATA_API_KEY$4 = '.data-api';
  3083. var ESCAPE_KEY = 'Escape';
  3084. var SPACE_KEY = 'Space';
  3085. var TAB_KEY = 'Tab';
  3086. var ARROW_UP_KEY = 'ArrowUp';
  3087. var ARROW_DOWN_KEY = 'ArrowDown';
  3088. var RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
  3089. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEY + "|" + ARROW_DOWN_KEY + "|" + ESCAPE_KEY);
  3090. var EVENT_HIDE$1 = "hide" + EVENT_KEY$4;
  3091. var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4;
  3092. var EVENT_SHOW$1 = "show" + EVENT_KEY$4;
  3093. var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4;
  3094. var EVENT_CLICK = "click" + EVENT_KEY$4;
  3095. var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4;
  3096. var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4;
  3097. var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4;
  3098. var CLASS_NAME_DISABLED = 'disabled';
  3099. var CLASS_NAME_SHOW$2 = 'show';
  3100. var CLASS_NAME_DROPUP = 'dropup';
  3101. var CLASS_NAME_DROPEND = 'dropend';
  3102. var CLASS_NAME_DROPSTART = 'dropstart';
  3103. var CLASS_NAME_NAVBAR = 'navbar';
  3104. var SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="dropdown"]';
  3105. var SELECTOR_FORM_CHILD = '.dropdown form';
  3106. var SELECTOR_MENU = '.dropdown-menu';
  3107. var SELECTOR_NAVBAR_NAV = '.navbar-nav';
  3108. var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
  3109. var PLACEMENT_TOP = isRTL ? 'top-end' : 'top-start';
  3110. var PLACEMENT_TOPEND = isRTL ? 'top-start' : 'top-end';
  3111. var PLACEMENT_BOTTOM = isRTL ? 'bottom-end' : 'bottom-start';
  3112. var PLACEMENT_BOTTOMEND = isRTL ? 'bottom-start' : 'bottom-end';
  3113. var PLACEMENT_RIGHT = isRTL ? 'left-start' : 'right-start';
  3114. var PLACEMENT_LEFT = isRTL ? 'right-start' : 'left-start';
  3115. var Default$2 = {
  3116. offset: [0, 2],
  3117. flip: true,
  3118. boundary: 'clippingParents',
  3119. reference: 'toggle',
  3120. display: 'dynamic',
  3121. popperConfig: null
  3122. };
  3123. var DefaultType$2 = {
  3124. offset: '(array|string|function)',
  3125. flip: 'boolean',
  3126. boundary: '(string|element)',
  3127. reference: '(string|element|object)',
  3128. display: 'string',
  3129. popperConfig: '(null|object|function)'
  3130. };
  3131. /**
  3132. * ------------------------------------------------------------------------
  3133. * Class Definition
  3134. * ------------------------------------------------------------------------
  3135. */
  3136. var Dropdown = /*#__PURE__*/function (_BaseComponent) {
  3137. _inheritsLoose(Dropdown, _BaseComponent);
  3138. function Dropdown(element, config) {
  3139. var _this;
  3140. _this = _BaseComponent.call(this, element) || this;
  3141. _this._popper = null;
  3142. _this._config = _this._getConfig(config);
  3143. _this._menu = _this._getMenuElement();
  3144. _this._inNavbar = _this._detectNavbar();
  3145. _this._addEventListeners();
  3146. return _this;
  3147. } // Getters
  3148. var _proto = Dropdown.prototype;
  3149. // Public
  3150. _proto.toggle = function toggle() {
  3151. if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED)) {
  3152. return;
  3153. }
  3154. var isActive = this._element.classList.contains(CLASS_NAME_SHOW$2);
  3155. Dropdown.clearMenus();
  3156. if (isActive) {
  3157. return;
  3158. }
  3159. this.show();
  3160. };
  3161. _proto.show = function show() {
  3162. if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED) || this._menu.classList.contains(CLASS_NAME_SHOW$2)) {
  3163. return;
  3164. }
  3165. var parent = Dropdown.getParentFromElement(this._element);
  3166. var relatedTarget = {
  3167. relatedTarget: this._element
  3168. };
  3169. var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, relatedTarget);
  3170. if (showEvent.defaultPrevented) {
  3171. return;
  3172. } // Totally disable Popper for Dropdowns in Navbar
  3173. if (this._inNavbar) {
  3174. Manipulator.setDataAttribute(this._menu, 'popper', 'none');
  3175. } else {
  3176. if (typeof Popper === 'undefined') {
  3177. throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
  3178. }
  3179. var referenceElement = this._element;
  3180. if (this._config.reference === 'parent') {
  3181. referenceElement = parent;
  3182. } else if (isElement(this._config.reference)) {
  3183. referenceElement = this._config.reference; // Check if it's jQuery element
  3184. if (typeof this._config.reference.jquery !== 'undefined') {
  3185. referenceElement = this._config.reference[0];
  3186. }
  3187. } else if (typeof this._config.reference === 'object') {
  3188. referenceElement = this._config.reference;
  3189. }
  3190. var popperConfig = this._getPopperConfig();
  3191. var isDisplayStatic = popperConfig.modifiers.find(function (modifier) {
  3192. return modifier.name === 'applyStyles' && modifier.enabled === false;
  3193. });
  3194. this._popper = createPopper$2(referenceElement, this._menu, popperConfig);
  3195. if (isDisplayStatic) {
  3196. Manipulator.setDataAttribute(this._menu, 'popper', 'static');
  3197. }
  3198. } // If this is a touch-enabled device we add extra
  3199. // empty mouseover listeners to the body's immediate children;
  3200. // only needed because of broken event delegation on iOS
  3201. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  3202. if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {
  3203. var _ref;
  3204. (_ref = []).concat.apply(_ref, document.body.children).forEach(function (elem) {
  3205. return EventHandler.on(elem, 'mouseover', null, noop());
  3206. });
  3207. }
  3208. this._element.focus();
  3209. this._element.setAttribute('aria-expanded', true);
  3210. this._menu.classList.toggle(CLASS_NAME_SHOW$2);
  3211. this._element.classList.toggle(CLASS_NAME_SHOW$2);
  3212. EventHandler.trigger(this._element, EVENT_SHOWN$1, relatedTarget);
  3213. };
  3214. _proto.hide = function hide() {
  3215. if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED) || !this._menu.classList.contains(CLASS_NAME_SHOW$2)) {
  3216. return;
  3217. }
  3218. var relatedTarget = {
  3219. relatedTarget: this._element
  3220. };
  3221. var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$1, relatedTarget);
  3222. if (hideEvent.defaultPrevented) {
  3223. return;
  3224. }
  3225. if (this._popper) {
  3226. this._popper.destroy();
  3227. }
  3228. this._menu.classList.toggle(CLASS_NAME_SHOW$2);
  3229. this._element.classList.toggle(CLASS_NAME_SHOW$2);
  3230. Manipulator.removeDataAttribute(this._menu, 'popper');
  3231. EventHandler.trigger(this._element, EVENT_HIDDEN$1, relatedTarget);
  3232. };
  3233. _proto.dispose = function dispose() {
  3234. _BaseComponent.prototype.dispose.call(this);
  3235. EventHandler.off(this._element, EVENT_KEY$4);
  3236. this._menu = null;
  3237. if (this._popper) {
  3238. this._popper.destroy();
  3239. this._popper = null;
  3240. }
  3241. };
  3242. _proto.update = function update() {
  3243. this._inNavbar = this._detectNavbar();
  3244. if (this._popper) {
  3245. this._popper.update();
  3246. }
  3247. } // Private
  3248. ;
  3249. _proto._addEventListeners = function _addEventListeners() {
  3250. var _this2 = this;
  3251. EventHandler.on(this._element, EVENT_CLICK, function (event) {
  3252. event.preventDefault();
  3253. event.stopPropagation();
  3254. _this2.toggle();
  3255. });
  3256. };
  3257. _proto._getConfig = function _getConfig(config) {
  3258. config = _extends({}, this.constructor.Default, Manipulator.getDataAttributes(this._element), config);
  3259. typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  3260. if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
  3261. // Popper virtual elements require a getBoundingClientRect method
  3262. throw new TypeError(NAME$4.toUpperCase() + ": Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.");
  3263. }
  3264. return config;
  3265. };
  3266. _proto._getMenuElement = function _getMenuElement() {
  3267. return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
  3268. };
  3269. _proto._getPlacement = function _getPlacement() {
  3270. var parentDropdown = this._element.parentNode;
  3271. if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
  3272. return PLACEMENT_RIGHT;
  3273. }
  3274. if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
  3275. return PLACEMENT_LEFT;
  3276. } // We need to trim the value because custom properties can also include spaces
  3277. var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
  3278. if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
  3279. return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
  3280. }
  3281. return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
  3282. };
  3283. _proto._detectNavbar = function _detectNavbar() {
  3284. return this._element.closest("." + CLASS_NAME_NAVBAR) !== null;
  3285. };
  3286. _proto._getOffset = function _getOffset() {
  3287. var _this3 = this;
  3288. var offset = this._config.offset;
  3289. if (typeof offset === 'string') {
  3290. return offset.split(',').map(function (val) {
  3291. return Number.parseInt(val, 10);
  3292. });
  3293. }
  3294. if (typeof offset === 'function') {
  3295. return function (popperData) {
  3296. return offset(popperData, _this3._element);
  3297. };
  3298. }
  3299. return offset;
  3300. };
  3301. _proto._getPopperConfig = function _getPopperConfig() {
  3302. var defaultBsPopperConfig = {
  3303. placement: this._getPlacement(),
  3304. modifiers: [{
  3305. name: 'preventOverflow',
  3306. options: {
  3307. altBoundary: this._config.flip,
  3308. boundary: this._config.boundary
  3309. }
  3310. }, {
  3311. name: 'offset',
  3312. options: {
  3313. offset: this._getOffset()
  3314. }
  3315. }]
  3316. }; // Disable Popper if we have a static display
  3317. if (this._config.display === 'static') {
  3318. defaultBsPopperConfig.modifiers = [{
  3319. name: 'applyStyles',
  3320. enabled: false
  3321. }];
  3322. }
  3323. return _extends({}, defaultBsPopperConfig, typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig);
  3324. } // Static
  3325. ;
  3326. Dropdown.dropdownInterface = function dropdownInterface(element, config) {
  3327. var data = Data.getData(element, DATA_KEY$4);
  3328. var _config = typeof config === 'object' ? config : null;
  3329. if (!data) {
  3330. data = new Dropdown(element, _config);
  3331. }
  3332. if (typeof config === 'string') {
  3333. if (typeof data[config] === 'undefined') {
  3334. throw new TypeError("No method named \"" + config + "\"");
  3335. }
  3336. data[config]();
  3337. }
  3338. };
  3339. Dropdown.jQueryInterface = function jQueryInterface(config) {
  3340. return this.each(function () {
  3341. Dropdown.dropdownInterface(this, config);
  3342. });
  3343. };
  3344. Dropdown.clearMenus = function clearMenus(event) {
  3345. if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
  3346. return;
  3347. }
  3348. var toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$2);
  3349. for (var i = 0, len = toggles.length; i < len; i++) {
  3350. var context = Data.getData(toggles[i], DATA_KEY$4);
  3351. var relatedTarget = {
  3352. relatedTarget: toggles[i]
  3353. };
  3354. if (event && event.type === 'click') {
  3355. relatedTarget.clickEvent = event;
  3356. }
  3357. if (!context) {
  3358. continue;
  3359. }
  3360. var dropdownMenu = context._menu;
  3361. if (!toggles[i].classList.contains(CLASS_NAME_SHOW$2)) {
  3362. continue;
  3363. }
  3364. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.key === TAB_KEY) && dropdownMenu.contains(event.target)) {
  3365. continue;
  3366. }
  3367. var hideEvent = EventHandler.trigger(toggles[i], EVENT_HIDE$1, relatedTarget);
  3368. if (hideEvent.defaultPrevented) {
  3369. continue;
  3370. } // If this is a touch-enabled device we remove the extra
  3371. // empty mouseover listeners we added for iOS support
  3372. if ('ontouchstart' in document.documentElement) {
  3373. var _ref2;
  3374. (_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (elem) {
  3375. return EventHandler.off(elem, 'mouseover', null, noop());
  3376. });
  3377. }
  3378. toggles[i].setAttribute('aria-expanded', 'false');
  3379. if (context._popper) {
  3380. context._popper.destroy();
  3381. }
  3382. dropdownMenu.classList.remove(CLASS_NAME_SHOW$2);
  3383. toggles[i].classList.remove(CLASS_NAME_SHOW$2);
  3384. Manipulator.removeDataAttribute(dropdownMenu, 'popper');
  3385. EventHandler.trigger(toggles[i], EVENT_HIDDEN$1, relatedTarget);
  3386. }
  3387. };
  3388. Dropdown.getParentFromElement = function getParentFromElement(element) {
  3389. return getElementFromSelector(element) || element.parentNode;
  3390. };
  3391. Dropdown.dataApiKeydownHandler = function dataApiKeydownHandler(event) {
  3392. // If not input/textarea:
  3393. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  3394. // If input/textarea:
  3395. // - If space key => not a dropdown command
  3396. // - If key is other than escape
  3397. // - If key is not up or down => not a dropdown command
  3398. // - If trigger inside the menu => not a dropdown command
  3399. 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)) {
  3400. return;
  3401. }
  3402. event.preventDefault();
  3403. event.stopPropagation();
  3404. if (this.disabled || this.classList.contains(CLASS_NAME_DISABLED)) {
  3405. return;
  3406. }
  3407. var parent = Dropdown.getParentFromElement(this);
  3408. var isActive = this.classList.contains(CLASS_NAME_SHOW$2);
  3409. if (event.key === ESCAPE_KEY) {
  3410. var button = this.matches(SELECTOR_DATA_TOGGLE$2) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$2)[0];
  3411. button.focus();
  3412. Dropdown.clearMenus();
  3413. return;
  3414. }
  3415. if (!isActive && (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY)) {
  3416. var _button = this.matches(SELECTOR_DATA_TOGGLE$2) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$2)[0];
  3417. _button.click();
  3418. return;
  3419. }
  3420. if (!isActive || event.key === SPACE_KEY) {
  3421. Dropdown.clearMenus();
  3422. return;
  3423. }
  3424. var items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, parent).filter(isVisible);
  3425. if (!items.length) {
  3426. return;
  3427. }
  3428. var index = items.indexOf(event.target); // Up
  3429. if (event.key === ARROW_UP_KEY && index > 0) {
  3430. index--;
  3431. } // Down
  3432. if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
  3433. index++;
  3434. } // index is -1 if the first keydown is an ArrowUp
  3435. index = index === -1 ? 0 : index;
  3436. items[index].focus();
  3437. };
  3438. _createClass(Dropdown, null, [{
  3439. key: "Default",
  3440. get: function get() {
  3441. return Default$2;
  3442. }
  3443. }, {
  3444. key: "DefaultType",
  3445. get: function get() {
  3446. return DefaultType$2;
  3447. }
  3448. }, {
  3449. key: "DATA_KEY",
  3450. get: function get() {
  3451. return DATA_KEY$4;
  3452. }
  3453. }]);
  3454. return Dropdown;
  3455. }(BaseComponent);
  3456. /**
  3457. * ------------------------------------------------------------------------
  3458. * Data Api implementation
  3459. * ------------------------------------------------------------------------
  3460. */
  3461. EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown.dataApiKeydownHandler);
  3462. EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
  3463. EventHandler.on(document, EVENT_CLICK_DATA_API$4, Dropdown.clearMenus);
  3464. EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
  3465. EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {
  3466. event.preventDefault();
  3467. event.stopPropagation();
  3468. Dropdown.dropdownInterface(this, 'toggle');
  3469. });
  3470. EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {
  3471. return e.stopPropagation();
  3472. });
  3473. /**
  3474. * ------------------------------------------------------------------------
  3475. * jQuery
  3476. * ------------------------------------------------------------------------
  3477. * add .Dropdown to jQuery only if jQuery is present
  3478. */
  3479. defineJQueryPlugin(NAME$4, Dropdown);
  3480. /**
  3481. * ------------------------------------------------------------------------
  3482. * Constants
  3483. * ------------------------------------------------------------------------
  3484. */
  3485. var NAME$5 = 'modal';
  3486. var DATA_KEY$5 = 'bs.modal';
  3487. var EVENT_KEY$5 = "." + DATA_KEY$5;
  3488. var DATA_API_KEY$5 = '.data-api';
  3489. var ESCAPE_KEY$1 = 'Escape';
  3490. var Default$3 = {
  3491. backdrop: true,
  3492. keyboard: true,
  3493. focus: true
  3494. };
  3495. var DefaultType$3 = {
  3496. backdrop: '(boolean|string)',
  3497. keyboard: 'boolean',
  3498. focus: 'boolean'
  3499. };
  3500. var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
  3501. var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
  3502. var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;
  3503. var EVENT_SHOW$2 = "show" + EVENT_KEY$5;
  3504. var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;
  3505. var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;
  3506. var EVENT_RESIZE = "resize" + EVENT_KEY$5;
  3507. var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5;
  3508. var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;
  3509. var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;
  3510. var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;
  3511. var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5;
  3512. var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
  3513. var CLASS_NAME_BACKDROP = 'modal-backdrop';
  3514. var CLASS_NAME_OPEN = 'modal-open';
  3515. var CLASS_NAME_FADE$1 = 'fade';
  3516. var CLASS_NAME_SHOW$3 = 'show';
  3517. var CLASS_NAME_STATIC = 'modal-static';
  3518. var SELECTOR_DIALOG = '.modal-dialog';
  3519. var SELECTOR_MODAL_BODY = '.modal-body';
  3520. var SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="modal"]';
  3521. var SELECTOR_DATA_DISMISS = '[data-bs-dismiss="modal"]';
  3522. var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
  3523. var SELECTOR_STICKY_CONTENT = '.sticky-top';
  3524. /**
  3525. * ------------------------------------------------------------------------
  3526. * Class Definition
  3527. * ------------------------------------------------------------------------
  3528. */
  3529. var Modal = /*#__PURE__*/function (_BaseComponent) {
  3530. _inheritsLoose(Modal, _BaseComponent);
  3531. function Modal(element, config) {
  3532. var _this;
  3533. _this = _BaseComponent.call(this, element) || this;
  3534. _this._config = _this._getConfig(config);
  3535. _this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
  3536. _this._backdrop = null;
  3537. _this._isShown = false;
  3538. _this._isBodyOverflowing = false;
  3539. _this._ignoreBackdropClick = false;
  3540. _this._isTransitioning = false;
  3541. _this._scrollbarWidth = 0;
  3542. return _this;
  3543. } // Getters
  3544. var _proto = Modal.prototype;
  3545. // Public
  3546. _proto.toggle = function toggle(relatedTarget) {
  3547. return this._isShown ? this.hide() : this.show(relatedTarget);
  3548. };
  3549. _proto.show = function show(relatedTarget) {
  3550. var _this2 = this;
  3551. if (this._isShown || this._isTransitioning) {
  3552. return;
  3553. }
  3554. if (this._element.classList.contains(CLASS_NAME_FADE$1)) {
  3555. this._isTransitioning = true;
  3556. }
  3557. var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, {
  3558. relatedTarget: relatedTarget
  3559. });
  3560. if (this._isShown || showEvent.defaultPrevented) {
  3561. return;
  3562. }
  3563. this._isShown = true;
  3564. this._checkScrollbar();
  3565. this._setScrollbar();
  3566. this._adjustDialog();
  3567. this._setEscapeEvent();
  3568. this._setResizeEvent();
  3569. EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
  3570. return _this2.hide(event);
  3571. });
  3572. EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
  3573. EventHandler.one(_this2._element, EVENT_MOUSEUP_DISMISS, function (event) {
  3574. if (event.target === _this2._element) {
  3575. _this2._ignoreBackdropClick = true;
  3576. }
  3577. });
  3578. });
  3579. this._showBackdrop(function () {
  3580. return _this2._showElement(relatedTarget);
  3581. });
  3582. };
  3583. _proto.hide = function hide(event) {
  3584. var _this3 = this;
  3585. if (event) {
  3586. event.preventDefault();
  3587. }
  3588. if (!this._isShown || this._isTransitioning) {
  3589. return;
  3590. }
  3591. var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$2);
  3592. if (hideEvent.defaultPrevented) {
  3593. return;
  3594. }
  3595. this._isShown = false;
  3596. var transition = this._element.classList.contains(CLASS_NAME_FADE$1);
  3597. if (transition) {
  3598. this._isTransitioning = true;
  3599. }
  3600. this._setEscapeEvent();
  3601. this._setResizeEvent();
  3602. EventHandler.off(document, EVENT_FOCUSIN);
  3603. this._element.classList.remove(CLASS_NAME_SHOW$3);
  3604. EventHandler.off(this._element, EVENT_CLICK_DISMISS);
  3605. EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
  3606. if (transition) {
  3607. var transitionDuration = getTransitionDurationFromElement(this._element);
  3608. EventHandler.one(this._element, 'transitionend', function (event) {
  3609. return _this3._hideModal(event);
  3610. });
  3611. emulateTransitionEnd(this._element, transitionDuration);
  3612. } else {
  3613. this._hideModal();
  3614. }
  3615. };
  3616. _proto.dispose = function dispose() {
  3617. [window, this._element, this._dialog].forEach(function (htmlElement) {
  3618. return EventHandler.off(htmlElement, EVENT_KEY$5);
  3619. });
  3620. _BaseComponent.prototype.dispose.call(this);
  3621. /**
  3622. * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
  3623. * Do not move `document` in `htmlElements` array
  3624. * It will remove `EVENT_CLICK_DATA_API` event that should remain
  3625. */
  3626. EventHandler.off(document, EVENT_FOCUSIN);
  3627. this._config = null;
  3628. this._dialog = null;
  3629. this._backdrop = null;
  3630. this._isShown = null;
  3631. this._isBodyOverflowing = null;
  3632. this._ignoreBackdropClick = null;
  3633. this._isTransitioning = null;
  3634. this._scrollbarWidth = null;
  3635. };
  3636. _proto.handleUpdate = function handleUpdate() {
  3637. this._adjustDialog();
  3638. } // Private
  3639. ;
  3640. _proto._getConfig = function _getConfig(config) {
  3641. config = _extends({}, Default$3, config);
  3642. typeCheckConfig(NAME$5, config, DefaultType$3);
  3643. return config;
  3644. };
  3645. _proto._showElement = function _showElement(relatedTarget) {
  3646. var _this4 = this;
  3647. var transition = this._element.classList.contains(CLASS_NAME_FADE$1);
  3648. var modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
  3649. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  3650. // Don't move modal's DOM position
  3651. document.body.appendChild(this._element);
  3652. }
  3653. this._element.style.display = 'block';
  3654. this._element.removeAttribute('aria-hidden');
  3655. this._element.setAttribute('aria-modal', true);
  3656. this._element.setAttribute('role', 'dialog');
  3657. this._element.scrollTop = 0;
  3658. if (modalBody) {
  3659. modalBody.scrollTop = 0;
  3660. }
  3661. if (transition) {
  3662. reflow(this._element);
  3663. }
  3664. this._element.classList.add(CLASS_NAME_SHOW$3);
  3665. if (this._config.focus) {
  3666. this._enforceFocus();
  3667. }
  3668. var transitionComplete = function transitionComplete() {
  3669. if (_this4._config.focus) {
  3670. _this4._element.focus();
  3671. }
  3672. _this4._isTransitioning = false;
  3673. EventHandler.trigger(_this4._element, EVENT_SHOWN$2, {
  3674. relatedTarget: relatedTarget
  3675. });
  3676. };
  3677. if (transition) {
  3678. var transitionDuration = getTransitionDurationFromElement(this._dialog);
  3679. EventHandler.one(this._dialog, 'transitionend', transitionComplete);
  3680. emulateTransitionEnd(this._dialog, transitionDuration);
  3681. } else {
  3682. transitionComplete();
  3683. }
  3684. };
  3685. _proto._enforceFocus = function _enforceFocus() {
  3686. var _this5 = this;
  3687. EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
  3688. EventHandler.on(document, EVENT_FOCUSIN, function (event) {
  3689. if (document !== event.target && _this5._element !== event.target && !_this5._element.contains(event.target)) {
  3690. _this5._element.focus();
  3691. }
  3692. });
  3693. };
  3694. _proto._setEscapeEvent = function _setEscapeEvent() {
  3695. var _this6 = this;
  3696. if (this._isShown) {
  3697. EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
  3698. if (_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
  3699. event.preventDefault();
  3700. _this6.hide();
  3701. } else if (!_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
  3702. _this6._triggerBackdropTransition();
  3703. }
  3704. });
  3705. } else {
  3706. EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS);
  3707. }
  3708. };
  3709. _proto._setResizeEvent = function _setResizeEvent() {
  3710. var _this7 = this;
  3711. if (this._isShown) {
  3712. EventHandler.on(window, EVENT_RESIZE, function () {
  3713. return _this7._adjustDialog();
  3714. });
  3715. } else {
  3716. EventHandler.off(window, EVENT_RESIZE);
  3717. }
  3718. };
  3719. _proto._hideModal = function _hideModal() {
  3720. var _this8 = this;
  3721. this._element.style.display = 'none';
  3722. this._element.setAttribute('aria-hidden', true);
  3723. this._element.removeAttribute('aria-modal');
  3724. this._element.removeAttribute('role');
  3725. this._isTransitioning = false;
  3726. this._showBackdrop(function () {
  3727. document.body.classList.remove(CLASS_NAME_OPEN);
  3728. _this8._resetAdjustments();
  3729. _this8._resetScrollbar();
  3730. EventHandler.trigger(_this8._element, EVENT_HIDDEN$2);
  3731. });
  3732. };
  3733. _proto._removeBackdrop = function _removeBackdrop() {
  3734. this._backdrop.parentNode.removeChild(this._backdrop);
  3735. this._backdrop = null;
  3736. };
  3737. _proto._showBackdrop = function _showBackdrop(callback) {
  3738. var _this9 = this;
  3739. var animate = this._element.classList.contains(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : '';
  3740. if (this._isShown && this._config.backdrop) {
  3741. this._backdrop = document.createElement('div');
  3742. this._backdrop.className = CLASS_NAME_BACKDROP;
  3743. if (animate) {
  3744. this._backdrop.classList.add(animate);
  3745. }
  3746. document.body.appendChild(this._backdrop);
  3747. EventHandler.on(this._element, EVENT_CLICK_DISMISS, function (event) {
  3748. if (_this9._ignoreBackdropClick) {
  3749. _this9._ignoreBackdropClick = false;
  3750. return;
  3751. }
  3752. if (event.target !== event.currentTarget) {
  3753. return;
  3754. }
  3755. if (_this9._config.backdrop === 'static') {
  3756. _this9._triggerBackdropTransition();
  3757. } else {
  3758. _this9.hide();
  3759. }
  3760. });
  3761. if (animate) {
  3762. reflow(this._backdrop);
  3763. }
  3764. this._backdrop.classList.add(CLASS_NAME_SHOW$3);
  3765. if (!animate) {
  3766. callback();
  3767. return;
  3768. }
  3769. var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
  3770. EventHandler.one(this._backdrop, 'transitionend', callback);
  3771. emulateTransitionEnd(this._backdrop, backdropTransitionDuration);
  3772. } else if (!this._isShown && this._backdrop) {
  3773. this._backdrop.classList.remove(CLASS_NAME_SHOW$3);
  3774. var callbackRemove = function callbackRemove() {
  3775. _this9._removeBackdrop();
  3776. callback();
  3777. };
  3778. if (this._element.classList.contains(CLASS_NAME_FADE$1)) {
  3779. var _backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
  3780. EventHandler.one(this._backdrop, 'transitionend', callbackRemove);
  3781. emulateTransitionEnd(this._backdrop, _backdropTransitionDuration);
  3782. } else {
  3783. callbackRemove();
  3784. }
  3785. } else {
  3786. callback();
  3787. }
  3788. };
  3789. _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
  3790. var _this10 = this;
  3791. var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
  3792. if (hideEvent.defaultPrevented) {
  3793. return;
  3794. }
  3795. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  3796. if (!isModalOverflowing) {
  3797. this._element.style.overflowY = 'hidden';
  3798. }
  3799. this._element.classList.add(CLASS_NAME_STATIC);
  3800. var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
  3801. EventHandler.off(this._element, 'transitionend');
  3802. EventHandler.one(this._element, 'transitionend', function () {
  3803. _this10._element.classList.remove(CLASS_NAME_STATIC);
  3804. if (!isModalOverflowing) {
  3805. EventHandler.one(_this10._element, 'transitionend', function () {
  3806. _this10._element.style.overflowY = '';
  3807. });
  3808. emulateTransitionEnd(_this10._element, modalTransitionDuration);
  3809. }
  3810. });
  3811. emulateTransitionEnd(this._element, modalTransitionDuration);
  3812. this._element.focus();
  3813. } // ----------------------------------------------------------------------
  3814. // the following methods are used to handle overflowing modals
  3815. // ----------------------------------------------------------------------
  3816. ;
  3817. _proto._adjustDialog = function _adjustDialog() {
  3818. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  3819. if (!this._isBodyOverflowing && isModalOverflowing && !isRTL || this._isBodyOverflowing && !isModalOverflowing && isRTL) {
  3820. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  3821. }
  3822. if (this._isBodyOverflowing && !isModalOverflowing && !isRTL || !this._isBodyOverflowing && isModalOverflowing && isRTL) {
  3823. this._element.style.paddingRight = this._scrollbarWidth + "px";
  3824. }
  3825. };
  3826. _proto._resetAdjustments = function _resetAdjustments() {
  3827. this._element.style.paddingLeft = '';
  3828. this._element.style.paddingRight = '';
  3829. };
  3830. _proto._checkScrollbar = function _checkScrollbar() {
  3831. var rect = document.body.getBoundingClientRect();
  3832. this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
  3833. this._scrollbarWidth = this._getScrollbarWidth();
  3834. };
  3835. _proto._setScrollbar = function _setScrollbar() {
  3836. var _this11 = this;
  3837. if (this._isBodyOverflowing) {
  3838. this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', function (calculatedValue) {
  3839. return calculatedValue + _this11._scrollbarWidth;
  3840. });
  3841. this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', function (calculatedValue) {
  3842. return calculatedValue - _this11._scrollbarWidth;
  3843. });
  3844. this._setElementAttributes('body', 'paddingRight', function (calculatedValue) {
  3845. return calculatedValue + _this11._scrollbarWidth;
  3846. });
  3847. }
  3848. document.body.classList.add(CLASS_NAME_OPEN);
  3849. };
  3850. _proto._setElementAttributes = function _setElementAttributes(selector, styleProp, callback) {
  3851. SelectorEngine.find(selector).forEach(function (element) {
  3852. var actualValue = element.style[styleProp];
  3853. var calculatedValue = window.getComputedStyle(element)[styleProp];
  3854. Manipulator.setDataAttribute(element, styleProp, actualValue);
  3855. element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px';
  3856. });
  3857. };
  3858. _proto._resetScrollbar = function _resetScrollbar() {
  3859. this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
  3860. this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
  3861. this._resetElementAttributes('body', 'paddingRight');
  3862. };
  3863. _proto._resetElementAttributes = function _resetElementAttributes(selector, styleProp) {
  3864. SelectorEngine.find(selector).forEach(function (element) {
  3865. var value = Manipulator.getDataAttribute(element, styleProp);
  3866. if (typeof value === 'undefined' && element === document.body) {
  3867. element.style[styleProp] = '';
  3868. } else {
  3869. Manipulator.removeDataAttribute(element, styleProp);
  3870. element.style[styleProp] = value;
  3871. }
  3872. });
  3873. };
  3874. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  3875. // thx d.walsh
  3876. var scrollDiv = document.createElement('div');
  3877. scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
  3878. document.body.appendChild(scrollDiv);
  3879. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  3880. document.body.removeChild(scrollDiv);
  3881. return scrollbarWidth;
  3882. } // Static
  3883. ;
  3884. Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) {
  3885. return this.each(function () {
  3886. var data = Data.getData(this, DATA_KEY$5);
  3887. var _config = _extends({}, Default$3, Manipulator.getDataAttributes(this), typeof config === 'object' && config ? config : {});
  3888. if (!data) {
  3889. data = new Modal(this, _config);
  3890. }
  3891. if (typeof config === 'string') {
  3892. if (typeof data[config] === 'undefined') {
  3893. throw new TypeError("No method named \"" + config + "\"");
  3894. }
  3895. data[config](relatedTarget);
  3896. }
  3897. });
  3898. };
  3899. _createClass(Modal, null, [{
  3900. key: "Default",
  3901. get: function get() {
  3902. return Default$3;
  3903. }
  3904. }, {
  3905. key: "DATA_KEY",
  3906. get: function get() {
  3907. return DATA_KEY$5;
  3908. }
  3909. }]);
  3910. return Modal;
  3911. }(BaseComponent);
  3912. /**
  3913. * ------------------------------------------------------------------------
  3914. * Data Api implementation
  3915. * ------------------------------------------------------------------------
  3916. */
  3917. EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
  3918. var _this12 = this;
  3919. var target = getElementFromSelector(this);
  3920. if (this.tagName === 'A' || this.tagName === 'AREA') {
  3921. event.preventDefault();
  3922. }
  3923. EventHandler.one(target, EVENT_SHOW$2, function (showEvent) {
  3924. if (showEvent.defaultPrevented) {
  3925. // only register focus restorer if modal will actually get shown
  3926. return;
  3927. }
  3928. EventHandler.one(target, EVENT_HIDDEN$2, function () {
  3929. if (isVisible(_this12)) {
  3930. _this12.focus();
  3931. }
  3932. });
  3933. });
  3934. var data = Data.getData(target, DATA_KEY$5);
  3935. if (!data) {
  3936. var config = _extends({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this));
  3937. data = new Modal(target, config);
  3938. }
  3939. data.toggle(this);
  3940. });
  3941. /**
  3942. * ------------------------------------------------------------------------
  3943. * jQuery
  3944. * ------------------------------------------------------------------------
  3945. * add .Modal to jQuery only if jQuery is present
  3946. */
  3947. defineJQueryPlugin(NAME$5, Modal);
  3948. /**
  3949. * --------------------------------------------------------------------------
  3950. * Bootstrap (v5.0.0-beta2): util/sanitizer.js
  3951. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  3952. * --------------------------------------------------------------------------
  3953. */
  3954. var uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
  3955. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  3956. /**
  3957. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  3958. *
  3959. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  3960. */
  3961. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
  3962. /**
  3963. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  3964. *
  3965. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  3966. */
  3967. 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;
  3968. var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
  3969. var attrName = attr.nodeName.toLowerCase();
  3970. if (allowedAttributeList.includes(attrName)) {
  3971. if (uriAttrs.has(attrName)) {
  3972. return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
  3973. }
  3974. return true;
  3975. }
  3976. var regExp = allowedAttributeList.filter(function (attrRegex) {
  3977. return attrRegex instanceof RegExp;
  3978. }); // Check if a regular expression validates the attribute.
  3979. for (var i = 0, len = regExp.length; i < len; i++) {
  3980. if (regExp[i].test(attrName)) {
  3981. return true;
  3982. }
  3983. }
  3984. return false;
  3985. };
  3986. var DefaultAllowlist = {
  3987. // Global attributes allowed on any supplied element below.
  3988. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  3989. a: ['target', 'href', 'title', 'rel'],
  3990. area: [],
  3991. b: [],
  3992. br: [],
  3993. col: [],
  3994. code: [],
  3995. div: [],
  3996. em: [],
  3997. hr: [],
  3998. h1: [],
  3999. h2: [],
  4000. h3: [],
  4001. h4: [],
  4002. h5: [],
  4003. h6: [],
  4004. i: [],
  4005. img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
  4006. li: [],
  4007. ol: [],
  4008. p: [],
  4009. pre: [],
  4010. s: [],
  4011. small: [],
  4012. span: [],
  4013. sub: [],
  4014. sup: [],
  4015. strong: [],
  4016. u: [],
  4017. ul: []
  4018. };
  4019. function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
  4020. var _ref;
  4021. if (!unsafeHtml.length) {
  4022. return unsafeHtml;
  4023. }
  4024. if (sanitizeFn && typeof sanitizeFn === 'function') {
  4025. return sanitizeFn(unsafeHtml);
  4026. }
  4027. var domParser = new window.DOMParser();
  4028. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  4029. var allowlistKeys = Object.keys(allowList);
  4030. var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
  4031. var _loop = function _loop(i, len) {
  4032. var _ref2;
  4033. var el = elements[i];
  4034. var elName = el.nodeName.toLowerCase();
  4035. if (!allowlistKeys.includes(elName)) {
  4036. el.parentNode.removeChild(el);
  4037. return "continue";
  4038. }
  4039. var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);
  4040. var allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
  4041. attributeList.forEach(function (attr) {
  4042. if (!allowedAttribute(attr, allowedAttributes)) {
  4043. el.removeAttribute(attr.nodeName);
  4044. }
  4045. });
  4046. };
  4047. for (var i = 0, len = elements.length; i < len; i++) {
  4048. var _ret = _loop(i);
  4049. if (_ret === "continue") continue;
  4050. }
  4051. return createdDocument.body.innerHTML;
  4052. }
  4053. /**
  4054. * ------------------------------------------------------------------------
  4055. * Constants
  4056. * ------------------------------------------------------------------------
  4057. */
  4058. var NAME$6 = 'tooltip';
  4059. var DATA_KEY$6 = 'bs.tooltip';
  4060. var EVENT_KEY$6 = "." + DATA_KEY$6;
  4061. var CLASS_PREFIX = 'bs-tooltip';
  4062. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  4063. var DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
  4064. var DefaultType$4 = {
  4065. animation: 'boolean',
  4066. template: 'string',
  4067. title: '(string|element|function)',
  4068. trigger: 'string',
  4069. delay: '(number|object)',
  4070. html: 'boolean',
  4071. selector: '(string|boolean)',
  4072. placement: '(string|function)',
  4073. offset: '(array|string|function)',
  4074. container: '(string|element|boolean)',
  4075. fallbackPlacements: 'array',
  4076. boundary: '(string|element)',
  4077. customClass: '(string|function)',
  4078. sanitize: 'boolean',
  4079. sanitizeFn: '(null|function)',
  4080. allowList: 'object',
  4081. popperConfig: '(null|object|function)'
  4082. };
  4083. var AttachmentMap = {
  4084. AUTO: 'auto',
  4085. TOP: 'top',
  4086. RIGHT: isRTL ? 'left' : 'right',
  4087. BOTTOM: 'bottom',
  4088. LEFT: isRTL ? 'right' : 'left'
  4089. };
  4090. var Default$4 = {
  4091. animation: true,
  4092. template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
  4093. trigger: 'hover focus',
  4094. title: '',
  4095. delay: 0,
  4096. html: false,
  4097. selector: false,
  4098. placement: 'top',
  4099. offset: [0, 0],
  4100. container: false,
  4101. fallbackPlacements: ['top', 'right', 'bottom', 'left'],
  4102. boundary: 'clippingParents',
  4103. customClass: '',
  4104. sanitize: true,
  4105. sanitizeFn: null,
  4106. allowList: DefaultAllowlist,
  4107. popperConfig: null
  4108. };
  4109. var Event$1 = {
  4110. HIDE: "hide" + EVENT_KEY$6,
  4111. HIDDEN: "hidden" + EVENT_KEY$6,
  4112. SHOW: "show" + EVENT_KEY$6,
  4113. SHOWN: "shown" + EVENT_KEY$6,
  4114. INSERTED: "inserted" + EVENT_KEY$6,
  4115. CLICK: "click" + EVENT_KEY$6,
  4116. FOCUSIN: "focusin" + EVENT_KEY$6,
  4117. FOCUSOUT: "focusout" + EVENT_KEY$6,
  4118. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  4119. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  4120. };
  4121. var CLASS_NAME_FADE$2 = 'fade';
  4122. var CLASS_NAME_MODAL = 'modal';
  4123. var CLASS_NAME_SHOW$4 = 'show';
  4124. var HOVER_STATE_SHOW = 'show';
  4125. var HOVER_STATE_OUT = 'out';
  4126. var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
  4127. var TRIGGER_HOVER = 'hover';
  4128. var TRIGGER_FOCUS = 'focus';
  4129. var TRIGGER_CLICK = 'click';
  4130. var TRIGGER_MANUAL = 'manual';
  4131. /**
  4132. * ------------------------------------------------------------------------
  4133. * Class Definition
  4134. * ------------------------------------------------------------------------
  4135. */
  4136. var Tooltip = /*#__PURE__*/function (_BaseComponent) {
  4137. _inheritsLoose(Tooltip, _BaseComponent);
  4138. function Tooltip(element, config) {
  4139. var _this;
  4140. if (typeof Popper === 'undefined') {
  4141. throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
  4142. }
  4143. _this = _BaseComponent.call(this, element) || this; // private
  4144. _this._isEnabled = true;
  4145. _this._timeout = 0;
  4146. _this._hoverState = '';
  4147. _this._activeTrigger = {};
  4148. _this._popper = null; // Protected
  4149. _this.config = _this._getConfig(config);
  4150. _this.tip = null;
  4151. _this._setListeners();
  4152. return _this;
  4153. } // Getters
  4154. var _proto = Tooltip.prototype;
  4155. // Public
  4156. _proto.enable = function enable() {
  4157. this._isEnabled = true;
  4158. };
  4159. _proto.disable = function disable() {
  4160. this._isEnabled = false;
  4161. };
  4162. _proto.toggleEnabled = function toggleEnabled() {
  4163. this._isEnabled = !this._isEnabled;
  4164. };
  4165. _proto.toggle = function toggle(event) {
  4166. if (!this._isEnabled) {
  4167. return;
  4168. }
  4169. if (event) {
  4170. var context = this._initializeOnDelegatedTarget(event);
  4171. context._activeTrigger.click = !context._activeTrigger.click;
  4172. if (context._isWithActiveTrigger()) {
  4173. context._enter(null, context);
  4174. } else {
  4175. context._leave(null, context);
  4176. }
  4177. } else {
  4178. if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$4)) {
  4179. this._leave(null, this);
  4180. return;
  4181. }
  4182. this._enter(null, this);
  4183. }
  4184. };
  4185. _proto.dispose = function dispose() {
  4186. clearTimeout(this._timeout);
  4187. EventHandler.off(this._element, this.constructor.EVENT_KEY);
  4188. EventHandler.off(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
  4189. if (this.tip && this.tip.parentNode) {
  4190. this.tip.parentNode.removeChild(this.tip);
  4191. }
  4192. this._isEnabled = null;
  4193. this._timeout = null;
  4194. this._hoverState = null;
  4195. this._activeTrigger = null;
  4196. if (this._popper) {
  4197. this._popper.destroy();
  4198. }
  4199. this._popper = null;
  4200. this.config = null;
  4201. this.tip = null;
  4202. _BaseComponent.prototype.dispose.call(this);
  4203. };
  4204. _proto.show = function show() {
  4205. var _this2 = this;
  4206. if (this._element.style.display === 'none') {
  4207. throw new Error('Please use show on visible elements');
  4208. }
  4209. if (!(this.isWithContent() && this._isEnabled)) {
  4210. return;
  4211. }
  4212. var showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);
  4213. var shadowRoot = findShadowRoot(this._element);
  4214. var isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
  4215. if (showEvent.defaultPrevented || !isInTheDom) {
  4216. return;
  4217. }
  4218. var tip = this.getTipElement();
  4219. var tipId = getUID(this.constructor.NAME);
  4220. tip.setAttribute('id', tipId);
  4221. this._element.setAttribute('aria-describedby', tipId);
  4222. this.setContent();
  4223. if (this.config.animation) {
  4224. tip.classList.add(CLASS_NAME_FADE$2);
  4225. }
  4226. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
  4227. var attachment = this._getAttachment(placement);
  4228. this._addAttachmentClass(attachment);
  4229. var container = this._getContainer();
  4230. Data.setData(tip, this.constructor.DATA_KEY, this);
  4231. if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
  4232. container.appendChild(tip);
  4233. }
  4234. EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
  4235. this._popper = createPopper$2(this._element, tip, this._getPopperConfig(attachment));
  4236. tip.classList.add(CLASS_NAME_SHOW$4);
  4237. var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
  4238. if (customClass) {
  4239. var _tip$classList;
  4240. (_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
  4241. } // If this is a touch-enabled device we add extra
  4242. // empty mouseover listeners to the body's immediate children;
  4243. // only needed because of broken event delegation on iOS
  4244. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4245. if ('ontouchstart' in document.documentElement) {
  4246. var _ref;
  4247. (_ref = []).concat.apply(_ref, document.body.children).forEach(function (element) {
  4248. EventHandler.on(element, 'mouseover', noop());
  4249. });
  4250. }
  4251. var complete = function complete() {
  4252. var prevHoverState = _this2._hoverState;
  4253. _this2._hoverState = null;
  4254. EventHandler.trigger(_this2._element, _this2.constructor.Event.SHOWN);
  4255. if (prevHoverState === HOVER_STATE_OUT) {
  4256. _this2._leave(null, _this2);
  4257. }
  4258. };
  4259. if (this.tip.classList.contains(CLASS_NAME_FADE$2)) {
  4260. var transitionDuration = getTransitionDurationFromElement(this.tip);
  4261. EventHandler.one(this.tip, 'transitionend', complete);
  4262. emulateTransitionEnd(this.tip, transitionDuration);
  4263. } else {
  4264. complete();
  4265. }
  4266. };
  4267. _proto.hide = function hide() {
  4268. var _this3 = this;
  4269. if (!this._popper) {
  4270. return;
  4271. }
  4272. var tip = this.getTipElement();
  4273. var complete = function complete() {
  4274. if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
  4275. tip.parentNode.removeChild(tip);
  4276. }
  4277. _this3._cleanTipClass();
  4278. _this3._element.removeAttribute('aria-describedby');
  4279. EventHandler.trigger(_this3._element, _this3.constructor.Event.HIDDEN);
  4280. if (_this3._popper) {
  4281. _this3._popper.destroy();
  4282. _this3._popper = null;
  4283. }
  4284. };
  4285. var hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
  4286. if (hideEvent.defaultPrevented) {
  4287. return;
  4288. }
  4289. tip.classList.remove(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra
  4290. // empty mouseover listeners we added for iOS support
  4291. if ('ontouchstart' in document.documentElement) {
  4292. var _ref2;
  4293. (_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (element) {
  4294. return EventHandler.off(element, 'mouseover', noop);
  4295. });
  4296. }
  4297. this._activeTrigger[TRIGGER_CLICK] = false;
  4298. this._activeTrigger[TRIGGER_FOCUS] = false;
  4299. this._activeTrigger[TRIGGER_HOVER] = false;
  4300. if (this.tip.classList.contains(CLASS_NAME_FADE$2)) {
  4301. var transitionDuration = getTransitionDurationFromElement(tip);
  4302. EventHandler.one(tip, 'transitionend', complete);
  4303. emulateTransitionEnd(tip, transitionDuration);
  4304. } else {
  4305. complete();
  4306. }
  4307. this._hoverState = '';
  4308. };
  4309. _proto.update = function update() {
  4310. if (this._popper !== null) {
  4311. this._popper.update();
  4312. }
  4313. } // Protected
  4314. ;
  4315. _proto.isWithContent = function isWithContent() {
  4316. return Boolean(this.getTitle());
  4317. };
  4318. _proto.getTipElement = function getTipElement() {
  4319. if (this.tip) {
  4320. return this.tip;
  4321. }
  4322. var element = document.createElement('div');
  4323. element.innerHTML = this.config.template;
  4324. this.tip = element.children[0];
  4325. return this.tip;
  4326. };
  4327. _proto.setContent = function setContent() {
  4328. var tip = this.getTipElement();
  4329. this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
  4330. tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$4);
  4331. };
  4332. _proto.setElementContent = function setElementContent(element, content) {
  4333. if (element === null) {
  4334. return;
  4335. }
  4336. if (typeof content === 'object' && isElement(content)) {
  4337. if (content.jquery) {
  4338. content = content[0];
  4339. } // content is a DOM node or a jQuery
  4340. if (this.config.html) {
  4341. if (content.parentNode !== element) {
  4342. element.innerHTML = '';
  4343. element.appendChild(content);
  4344. }
  4345. } else {
  4346. element.textContent = content.textContent;
  4347. }
  4348. return;
  4349. }
  4350. if (this.config.html) {
  4351. if (this.config.sanitize) {
  4352. content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
  4353. }
  4354. element.innerHTML = content;
  4355. } else {
  4356. element.textContent = content;
  4357. }
  4358. };
  4359. _proto.getTitle = function getTitle() {
  4360. var title = this._element.getAttribute('data-bs-original-title');
  4361. if (!title) {
  4362. title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
  4363. }
  4364. return title;
  4365. };
  4366. _proto.updateAttachment = function updateAttachment(attachment) {
  4367. if (attachment === 'right') {
  4368. return 'end';
  4369. }
  4370. if (attachment === 'left') {
  4371. return 'start';
  4372. }
  4373. return attachment;
  4374. } // Private
  4375. ;
  4376. _proto._initializeOnDelegatedTarget = function _initializeOnDelegatedTarget(event, context) {
  4377. var dataKey = this.constructor.DATA_KEY;
  4378. context = context || Data.getData(event.delegateTarget, dataKey);
  4379. if (!context) {
  4380. context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
  4381. Data.setData(event.delegateTarget, dataKey, context);
  4382. }
  4383. return context;
  4384. };
  4385. _proto._getOffset = function _getOffset() {
  4386. var _this4 = this;
  4387. var offset = this.config.offset;
  4388. if (typeof offset === 'string') {
  4389. return offset.split(',').map(function (val) {
  4390. return Number.parseInt(val, 10);
  4391. });
  4392. }
  4393. if (typeof offset === 'function') {
  4394. return function (popperData) {
  4395. return offset(popperData, _this4._element);
  4396. };
  4397. }
  4398. return offset;
  4399. };
  4400. _proto._getPopperConfig = function _getPopperConfig(attachment) {
  4401. var _this5 = this;
  4402. var defaultBsPopperConfig = {
  4403. placement: attachment,
  4404. modifiers: [{
  4405. name: 'flip',
  4406. options: {
  4407. altBoundary: true,
  4408. fallbackPlacements: this.config.fallbackPlacements
  4409. }
  4410. }, {
  4411. name: 'offset',
  4412. options: {
  4413. offset: this._getOffset()
  4414. }
  4415. }, {
  4416. name: 'preventOverflow',
  4417. options: {
  4418. boundary: this.config.boundary
  4419. }
  4420. }, {
  4421. name: 'arrow',
  4422. options: {
  4423. element: "." + this.constructor.NAME + "-arrow"
  4424. }
  4425. }, {
  4426. name: 'onChange',
  4427. enabled: true,
  4428. phase: 'afterWrite',
  4429. fn: function fn(data) {
  4430. return _this5._handlePopperPlacementChange(data);
  4431. }
  4432. }],
  4433. onFirstUpdate: function onFirstUpdate(data) {
  4434. if (data.options.placement !== data.placement) {
  4435. _this5._handlePopperPlacementChange(data);
  4436. }
  4437. }
  4438. };
  4439. return _extends({}, defaultBsPopperConfig, typeof this.config.popperConfig === 'function' ? this.config.popperConfig(defaultBsPopperConfig) : this.config.popperConfig);
  4440. };
  4441. _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
  4442. this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment));
  4443. };
  4444. _proto._getContainer = function _getContainer() {
  4445. if (this.config.container === false) {
  4446. return document.body;
  4447. }
  4448. if (isElement(this.config.container)) {
  4449. return this.config.container;
  4450. }
  4451. return SelectorEngine.findOne(this.config.container);
  4452. };
  4453. _proto._getAttachment = function _getAttachment(placement) {
  4454. return AttachmentMap[placement.toUpperCase()];
  4455. };
  4456. _proto._setListeners = function _setListeners() {
  4457. var _this6 = this;
  4458. var triggers = this.config.trigger.split(' ');
  4459. triggers.forEach(function (trigger) {
  4460. if (trigger === 'click') {
  4461. EventHandler.on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
  4462. return _this6.toggle(event);
  4463. });
  4464. } else if (trigger !== TRIGGER_MANUAL) {
  4465. var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
  4466. var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
  4467. EventHandler.on(_this6._element, eventIn, _this6.config.selector, function (event) {
  4468. return _this6._enter(event);
  4469. });
  4470. EventHandler.on(_this6._element, eventOut, _this6.config.selector, function (event) {
  4471. return _this6._leave(event);
  4472. });
  4473. }
  4474. });
  4475. this._hideModalHandler = function () {
  4476. if (_this6._element) {
  4477. _this6.hide();
  4478. }
  4479. };
  4480. EventHandler.on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
  4481. if (this.config.selector) {
  4482. this.config = _extends({}, this.config, {
  4483. trigger: 'manual',
  4484. selector: ''
  4485. });
  4486. } else {
  4487. this._fixTitle();
  4488. }
  4489. };
  4490. _proto._fixTitle = function _fixTitle() {
  4491. var title = this._element.getAttribute('title');
  4492. var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
  4493. if (title || originalTitleType !== 'string') {
  4494. this._element.setAttribute('data-bs-original-title', title || '');
  4495. if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
  4496. this._element.setAttribute('aria-label', title);
  4497. }
  4498. this._element.setAttribute('title', '');
  4499. }
  4500. };
  4501. _proto._enter = function _enter(event, context) {
  4502. context = this._initializeOnDelegatedTarget(event, context);
  4503. if (event) {
  4504. context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
  4505. }
  4506. if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) {
  4507. context._hoverState = HOVER_STATE_SHOW;
  4508. return;
  4509. }
  4510. clearTimeout(context._timeout);
  4511. context._hoverState = HOVER_STATE_SHOW;
  4512. if (!context.config.delay || !context.config.delay.show) {
  4513. context.show();
  4514. return;
  4515. }
  4516. context._timeout = setTimeout(function () {
  4517. if (context._hoverState === HOVER_STATE_SHOW) {
  4518. context.show();
  4519. }
  4520. }, context.config.delay.show);
  4521. };
  4522. _proto._leave = function _leave(event, context) {
  4523. context = this._initializeOnDelegatedTarget(event, context);
  4524. if (event) {
  4525. context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
  4526. }
  4527. if (context._isWithActiveTrigger()) {
  4528. return;
  4529. }
  4530. clearTimeout(context._timeout);
  4531. context._hoverState = HOVER_STATE_OUT;
  4532. if (!context.config.delay || !context.config.delay.hide) {
  4533. context.hide();
  4534. return;
  4535. }
  4536. context._timeout = setTimeout(function () {
  4537. if (context._hoverState === HOVER_STATE_OUT) {
  4538. context.hide();
  4539. }
  4540. }, context.config.delay.hide);
  4541. };
  4542. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  4543. for (var trigger in this._activeTrigger) {
  4544. if (this._activeTrigger[trigger]) {
  4545. return true;
  4546. }
  4547. }
  4548. return false;
  4549. };
  4550. _proto._getConfig = function _getConfig(config) {
  4551. var dataAttributes = Manipulator.getDataAttributes(this._element);
  4552. Object.keys(dataAttributes).forEach(function (dataAttr) {
  4553. if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
  4554. delete dataAttributes[dataAttr];
  4555. }
  4556. });
  4557. if (config && typeof config.container === 'object' && config.container.jquery) {
  4558. config.container = config.container[0];
  4559. }
  4560. config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
  4561. if (typeof config.delay === 'number') {
  4562. config.delay = {
  4563. show: config.delay,
  4564. hide: config.delay
  4565. };
  4566. }
  4567. if (typeof config.title === 'number') {
  4568. config.title = config.title.toString();
  4569. }
  4570. if (typeof config.content === 'number') {
  4571. config.content = config.content.toString();
  4572. }
  4573. typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  4574. if (config.sanitize) {
  4575. config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
  4576. }
  4577. return config;
  4578. };
  4579. _proto._getDelegateConfig = function _getDelegateConfig() {
  4580. var config = {};
  4581. if (this.config) {
  4582. for (var key in this.config) {
  4583. if (this.constructor.Default[key] !== this.config[key]) {
  4584. config[key] = this.config[key];
  4585. }
  4586. }
  4587. }
  4588. return config;
  4589. };
  4590. _proto._cleanTipClass = function _cleanTipClass() {
  4591. var tip = this.getTipElement();
  4592. var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
  4593. if (tabClass !== null && tabClass.length > 0) {
  4594. tabClass.map(function (token) {
  4595. return token.trim();
  4596. }).forEach(function (tClass) {
  4597. return tip.classList.remove(tClass);
  4598. });
  4599. }
  4600. };
  4601. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  4602. var state = popperData.state;
  4603. if (!state) {
  4604. return;
  4605. }
  4606. this.tip = state.elements.popper;
  4607. this._cleanTipClass();
  4608. this._addAttachmentClass(this._getAttachment(state.placement));
  4609. } // Static
  4610. ;
  4611. Tooltip.jQueryInterface = function jQueryInterface(config) {
  4612. return this.each(function () {
  4613. var data = Data.getData(this, DATA_KEY$6);
  4614. var _config = typeof config === 'object' && config;
  4615. if (!data && /dispose|hide/.test(config)) {
  4616. return;
  4617. }
  4618. if (!data) {
  4619. data = new Tooltip(this, _config);
  4620. }
  4621. if (typeof config === 'string') {
  4622. if (typeof data[config] === 'undefined') {
  4623. throw new TypeError("No method named \"" + config + "\"");
  4624. }
  4625. data[config]();
  4626. }
  4627. });
  4628. };
  4629. _createClass(Tooltip, null, [{
  4630. key: "Default",
  4631. get: function get() {
  4632. return Default$4;
  4633. }
  4634. }, {
  4635. key: "NAME",
  4636. get: function get() {
  4637. return NAME$6;
  4638. }
  4639. }, {
  4640. key: "DATA_KEY",
  4641. get: function get() {
  4642. return DATA_KEY$6;
  4643. }
  4644. }, {
  4645. key: "Event",
  4646. get: function get() {
  4647. return Event$1;
  4648. }
  4649. }, {
  4650. key: "EVENT_KEY",
  4651. get: function get() {
  4652. return EVENT_KEY$6;
  4653. }
  4654. }, {
  4655. key: "DefaultType",
  4656. get: function get() {
  4657. return DefaultType$4;
  4658. }
  4659. }]);
  4660. return Tooltip;
  4661. }(BaseComponent);
  4662. /**
  4663. * ------------------------------------------------------------------------
  4664. * jQuery
  4665. * ------------------------------------------------------------------------
  4666. * add .Tooltip to jQuery only if jQuery is present
  4667. */
  4668. defineJQueryPlugin(NAME$6, Tooltip);
  4669. /**
  4670. * ------------------------------------------------------------------------
  4671. * Constants
  4672. * ------------------------------------------------------------------------
  4673. */
  4674. var NAME$7 = 'popover';
  4675. var DATA_KEY$7 = 'bs.popover';
  4676. var EVENT_KEY$7 = "." + DATA_KEY$7;
  4677. var CLASS_PREFIX$1 = 'bs-popover';
  4678. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  4679. var Default$5 = _extends({}, Tooltip.Default, {
  4680. placement: 'right',
  4681. offset: [0, 8],
  4682. trigger: 'click',
  4683. content: '',
  4684. template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>'
  4685. });
  4686. var DefaultType$5 = _extends({}, Tooltip.DefaultType, {
  4687. content: '(string|element|function)'
  4688. });
  4689. var Event$2 = {
  4690. HIDE: "hide" + EVENT_KEY$7,
  4691. HIDDEN: "hidden" + EVENT_KEY$7,
  4692. SHOW: "show" + EVENT_KEY$7,
  4693. SHOWN: "shown" + EVENT_KEY$7,
  4694. INSERTED: "inserted" + EVENT_KEY$7,
  4695. CLICK: "click" + EVENT_KEY$7,
  4696. FOCUSIN: "focusin" + EVENT_KEY$7,
  4697. FOCUSOUT: "focusout" + EVENT_KEY$7,
  4698. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  4699. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  4700. };
  4701. var CLASS_NAME_FADE$3 = 'fade';
  4702. var CLASS_NAME_SHOW$5 = 'show';
  4703. var SELECTOR_TITLE = '.popover-header';
  4704. var SELECTOR_CONTENT = '.popover-body';
  4705. /**
  4706. * ------------------------------------------------------------------------
  4707. * Class Definition
  4708. * ------------------------------------------------------------------------
  4709. */
  4710. var Popover = /*#__PURE__*/function (_Tooltip) {
  4711. _inheritsLoose(Popover, _Tooltip);
  4712. function Popover() {
  4713. return _Tooltip.apply(this, arguments) || this;
  4714. }
  4715. var _proto = Popover.prototype;
  4716. // Overrides
  4717. _proto.isWithContent = function isWithContent() {
  4718. return this.getTitle() || this._getContent();
  4719. };
  4720. _proto.setContent = function setContent() {
  4721. var tip = this.getTipElement(); // we use append for html objects to maintain js events
  4722. this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
  4723. var content = this._getContent();
  4724. if (typeof content === 'function') {
  4725. content = content.call(this._element);
  4726. }
  4727. this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
  4728. tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$5);
  4729. } // Private
  4730. ;
  4731. _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
  4732. this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + this.updateAttachment(attachment));
  4733. };
  4734. _proto._getContent = function _getContent() {
  4735. return this._element.getAttribute('data-bs-content') || this.config.content;
  4736. };
  4737. _proto._cleanTipClass = function _cleanTipClass() {
  4738. var tip = this.getTipElement();
  4739. var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
  4740. if (tabClass !== null && tabClass.length > 0) {
  4741. tabClass.map(function (token) {
  4742. return token.trim();
  4743. }).forEach(function (tClass) {
  4744. return tip.classList.remove(tClass);
  4745. });
  4746. }
  4747. } // Static
  4748. ;
  4749. Popover.jQueryInterface = function jQueryInterface(config) {
  4750. return this.each(function () {
  4751. var data = Data.getData(this, DATA_KEY$7);
  4752. var _config = typeof config === 'object' ? config : null;
  4753. if (!data && /dispose|hide/.test(config)) {
  4754. return;
  4755. }
  4756. if (!data) {
  4757. data = new Popover(this, _config);
  4758. Data.setData(this, DATA_KEY$7, data);
  4759. }
  4760. if (typeof config === 'string') {
  4761. if (typeof data[config] === 'undefined') {
  4762. throw new TypeError("No method named \"" + config + "\"");
  4763. }
  4764. data[config]();
  4765. }
  4766. });
  4767. };
  4768. _createClass(Popover, null, [{
  4769. key: "Default",
  4770. get: // Getters
  4771. function get() {
  4772. return Default$5;
  4773. }
  4774. }, {
  4775. key: "NAME",
  4776. get: function get() {
  4777. return NAME$7;
  4778. }
  4779. }, {
  4780. key: "DATA_KEY",
  4781. get: function get() {
  4782. return DATA_KEY$7;
  4783. }
  4784. }, {
  4785. key: "Event",
  4786. get: function get() {
  4787. return Event$2;
  4788. }
  4789. }, {
  4790. key: "EVENT_KEY",
  4791. get: function get() {
  4792. return EVENT_KEY$7;
  4793. }
  4794. }, {
  4795. key: "DefaultType",
  4796. get: function get() {
  4797. return DefaultType$5;
  4798. }
  4799. }]);
  4800. return Popover;
  4801. }(Tooltip);
  4802. /**
  4803. * ------------------------------------------------------------------------
  4804. * jQuery
  4805. * ------------------------------------------------------------------------
  4806. * add .Popover to jQuery only if jQuery is present
  4807. */
  4808. defineJQueryPlugin(NAME$7, Popover);
  4809. /**
  4810. * ------------------------------------------------------------------------
  4811. * Constants
  4812. * ------------------------------------------------------------------------
  4813. */
  4814. var NAME$8 = 'scrollspy';
  4815. var DATA_KEY$8 = 'bs.scrollspy';
  4816. var EVENT_KEY$8 = "." + DATA_KEY$8;
  4817. var DATA_API_KEY$6 = '.data-api';
  4818. var Default$6 = {
  4819. offset: 10,
  4820. method: 'auto',
  4821. target: ''
  4822. };
  4823. var DefaultType$6 = {
  4824. offset: 'number',
  4825. method: 'string',
  4826. target: '(string|element)'
  4827. };
  4828. var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
  4829. var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
  4830. var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
  4831. var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
  4832. var CLASS_NAME_ACTIVE$2 = 'active';
  4833. var SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]';
  4834. var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
  4835. var SELECTOR_NAV_LINKS = '.nav-link';
  4836. var SELECTOR_NAV_ITEMS = '.nav-item';
  4837. var SELECTOR_LIST_ITEMS = '.list-group-item';
  4838. var SELECTOR_DROPDOWN = '.dropdown';
  4839. var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
  4840. var METHOD_OFFSET = 'offset';
  4841. var METHOD_POSITION = 'position';
  4842. /**
  4843. * ------------------------------------------------------------------------
  4844. * Class Definition
  4845. * ------------------------------------------------------------------------
  4846. */
  4847. var ScrollSpy = /*#__PURE__*/function (_BaseComponent) {
  4848. _inheritsLoose(ScrollSpy, _BaseComponent);
  4849. function ScrollSpy(element, config) {
  4850. var _this;
  4851. _this = _BaseComponent.call(this, element) || this;
  4852. _this._scrollElement = element.tagName === 'BODY' ? window : element;
  4853. _this._config = _this._getConfig(config);
  4854. _this._selector = _this._config.target + " " + SELECTOR_NAV_LINKS + ", " + _this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + _this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
  4855. _this._offsets = [];
  4856. _this._targets = [];
  4857. _this._activeTarget = null;
  4858. _this._scrollHeight = 0;
  4859. EventHandler.on(_this._scrollElement, EVENT_SCROLL, function () {
  4860. return _this._process();
  4861. });
  4862. _this.refresh();
  4863. _this._process();
  4864. return _this;
  4865. } // Getters
  4866. var _proto = ScrollSpy.prototype;
  4867. // Public
  4868. _proto.refresh = function refresh() {
  4869. var _this2 = this;
  4870. var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
  4871. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  4872. var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
  4873. this._offsets = [];
  4874. this._targets = [];
  4875. this._scrollHeight = this._getScrollHeight();
  4876. var targets = SelectorEngine.find(this._selector);
  4877. targets.map(function (element) {
  4878. var targetSelector = getSelectorFromElement(element);
  4879. var target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
  4880. if (target) {
  4881. var targetBCR = target.getBoundingClientRect();
  4882. if (targetBCR.width || targetBCR.height) {
  4883. return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
  4884. }
  4885. }
  4886. return null;
  4887. }).filter(function (item) {
  4888. return item;
  4889. }).sort(function (a, b) {
  4890. return a[0] - b[0];
  4891. }).forEach(function (item) {
  4892. _this2._offsets.push(item[0]);
  4893. _this2._targets.push(item[1]);
  4894. });
  4895. };
  4896. _proto.dispose = function dispose() {
  4897. _BaseComponent.prototype.dispose.call(this);
  4898. EventHandler.off(this._scrollElement, EVENT_KEY$8);
  4899. this._scrollElement = null;
  4900. this._config = null;
  4901. this._selector = null;
  4902. this._offsets = null;
  4903. this._targets = null;
  4904. this._activeTarget = null;
  4905. this._scrollHeight = null;
  4906. } // Private
  4907. ;
  4908. _proto._getConfig = function _getConfig(config) {
  4909. config = _extends({}, Default$6, typeof config === 'object' && config ? config : {});
  4910. if (typeof config.target !== 'string' && isElement(config.target)) {
  4911. var id = config.target.id;
  4912. if (!id) {
  4913. id = getUID(NAME$8);
  4914. config.target.id = id;
  4915. }
  4916. config.target = "#" + id;
  4917. }
  4918. typeCheckConfig(NAME$8, config, DefaultType$6);
  4919. return config;
  4920. };
  4921. _proto._getScrollTop = function _getScrollTop() {
  4922. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  4923. };
  4924. _proto._getScrollHeight = function _getScrollHeight() {
  4925. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  4926. };
  4927. _proto._getOffsetHeight = function _getOffsetHeight() {
  4928. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  4929. };
  4930. _proto._process = function _process() {
  4931. var scrollTop = this._getScrollTop() + this._config.offset;
  4932. var scrollHeight = this._getScrollHeight();
  4933. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  4934. if (this._scrollHeight !== scrollHeight) {
  4935. this.refresh();
  4936. }
  4937. if (scrollTop >= maxScroll) {
  4938. var target = this._targets[this._targets.length - 1];
  4939. if (this._activeTarget !== target) {
  4940. this._activate(target);
  4941. }
  4942. return;
  4943. }
  4944. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  4945. this._activeTarget = null;
  4946. this._clear();
  4947. return;
  4948. }
  4949. for (var i = this._offsets.length; i--;) {
  4950. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  4951. if (isActiveTarget) {
  4952. this._activate(this._targets[i]);
  4953. }
  4954. }
  4955. };
  4956. _proto._activate = function _activate(target) {
  4957. this._activeTarget = target;
  4958. this._clear();
  4959. var queries = this._selector.split(',').map(function (selector) {
  4960. return selector + "[data-bs-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  4961. });
  4962. var link = SelectorEngine.findOne(queries.join(','));
  4963. if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
  4964. SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$2);
  4965. link.classList.add(CLASS_NAME_ACTIVE$2);
  4966. } else {
  4967. // Set triggered link as active
  4968. link.classList.add(CLASS_NAME_ACTIVE$2);
  4969. SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP).forEach(function (listGroup) {
  4970. // Set triggered links parents as active
  4971. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  4972. SelectorEngine.prev(listGroup, SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).forEach(function (item) {
  4973. return item.classList.add(CLASS_NAME_ACTIVE$2);
  4974. }); // Handle special case when .nav-link is inside .nav-item
  4975. SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(function (navItem) {
  4976. SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(function (item) {
  4977. return item.classList.add(CLASS_NAME_ACTIVE$2);
  4978. });
  4979. });
  4980. });
  4981. }
  4982. EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
  4983. relatedTarget: target
  4984. });
  4985. };
  4986. _proto._clear = function _clear() {
  4987. SelectorEngine.find(this._selector).filter(function (node) {
  4988. return node.classList.contains(CLASS_NAME_ACTIVE$2);
  4989. }).forEach(function (node) {
  4990. return node.classList.remove(CLASS_NAME_ACTIVE$2);
  4991. });
  4992. } // Static
  4993. ;
  4994. ScrollSpy.jQueryInterface = function jQueryInterface(config) {
  4995. return this.each(function () {
  4996. var data = Data.getData(this, DATA_KEY$8);
  4997. var _config = typeof config === 'object' && config;
  4998. if (!data) {
  4999. data = new ScrollSpy(this, _config);
  5000. }
  5001. if (typeof config === 'string') {
  5002. if (typeof data[config] === 'undefined') {
  5003. throw new TypeError("No method named \"" + config + "\"");
  5004. }
  5005. data[config]();
  5006. }
  5007. });
  5008. };
  5009. _createClass(ScrollSpy, null, [{
  5010. key: "Default",
  5011. get: function get() {
  5012. return Default$6;
  5013. }
  5014. }, {
  5015. key: "DATA_KEY",
  5016. get: function get() {
  5017. return DATA_KEY$8;
  5018. }
  5019. }]);
  5020. return ScrollSpy;
  5021. }(BaseComponent);
  5022. /**
  5023. * ------------------------------------------------------------------------
  5024. * Data Api implementation
  5025. * ------------------------------------------------------------------------
  5026. */
  5027. EventHandler.on(window, EVENT_LOAD_DATA_API$1, function () {
  5028. SelectorEngine.find(SELECTOR_DATA_SPY).forEach(function (spy) {
  5029. return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
  5030. });
  5031. });
  5032. /**
  5033. * ------------------------------------------------------------------------
  5034. * jQuery
  5035. * ------------------------------------------------------------------------
  5036. * add .ScrollSpy to jQuery only if jQuery is present
  5037. */
  5038. defineJQueryPlugin(NAME$8, ScrollSpy);
  5039. /**
  5040. * ------------------------------------------------------------------------
  5041. * Constants
  5042. * ------------------------------------------------------------------------
  5043. */
  5044. var NAME$9 = 'tab';
  5045. var DATA_KEY$9 = 'bs.tab';
  5046. var EVENT_KEY$9 = "." + DATA_KEY$9;
  5047. var DATA_API_KEY$7 = '.data-api';
  5048. var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
  5049. var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
  5050. var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
  5051. var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
  5052. var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
  5053. var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
  5054. var CLASS_NAME_ACTIVE$3 = 'active';
  5055. var CLASS_NAME_DISABLED$1 = 'disabled';
  5056. var CLASS_NAME_FADE$4 = 'fade';
  5057. var CLASS_NAME_SHOW$6 = 'show';
  5058. var SELECTOR_DROPDOWN$1 = '.dropdown';
  5059. var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
  5060. var SELECTOR_ACTIVE$1 = '.active';
  5061. var SELECTOR_ACTIVE_UL = ':scope > li > .active';
  5062. var SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
  5063. var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
  5064. var SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
  5065. /**
  5066. * ------------------------------------------------------------------------
  5067. * Class Definition
  5068. * ------------------------------------------------------------------------
  5069. */
  5070. var Tab = /*#__PURE__*/function (_BaseComponent) {
  5071. _inheritsLoose(Tab, _BaseComponent);
  5072. function Tab() {
  5073. return _BaseComponent.apply(this, arguments) || this;
  5074. }
  5075. var _proto = Tab.prototype;
  5076. // Public
  5077. _proto.show = function show() {
  5078. var _this = this;
  5079. 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)) {
  5080. return;
  5081. }
  5082. var previous;
  5083. var target = getElementFromSelector(this._element);
  5084. var listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP$1);
  5085. if (listElement) {
  5086. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$1;
  5087. previous = SelectorEngine.find(itemSelector, listElement);
  5088. previous = previous[previous.length - 1];
  5089. }
  5090. var hideEvent = previous ? EventHandler.trigger(previous, EVENT_HIDE$3, {
  5091. relatedTarget: this._element
  5092. }) : null;
  5093. var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
  5094. relatedTarget: previous
  5095. });
  5096. if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
  5097. return;
  5098. }
  5099. this._activate(this._element, listElement);
  5100. var complete = function complete() {
  5101. EventHandler.trigger(previous, EVENT_HIDDEN$3, {
  5102. relatedTarget: _this._element
  5103. });
  5104. EventHandler.trigger(_this._element, EVENT_SHOWN$3, {
  5105. relatedTarget: previous
  5106. });
  5107. };
  5108. if (target) {
  5109. this._activate(target, target.parentNode, complete);
  5110. } else {
  5111. complete();
  5112. }
  5113. } // Private
  5114. ;
  5115. _proto._activate = function _activate(element, container, callback) {
  5116. var _this2 = this;
  5117. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE$1);
  5118. var active = activeElements[0];
  5119. var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$4);
  5120. var complete = function complete() {
  5121. return _this2._transitionComplete(element, active, callback);
  5122. };
  5123. if (active && isTransitioning) {
  5124. var transitionDuration = getTransitionDurationFromElement(active);
  5125. active.classList.remove(CLASS_NAME_SHOW$6);
  5126. EventHandler.one(active, 'transitionend', complete);
  5127. emulateTransitionEnd(active, transitionDuration);
  5128. } else {
  5129. complete();
  5130. }
  5131. };
  5132. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  5133. if (active) {
  5134. active.classList.remove(CLASS_NAME_ACTIVE$3);
  5135. var dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
  5136. if (dropdownChild) {
  5137. dropdownChild.classList.remove(CLASS_NAME_ACTIVE$3);
  5138. }
  5139. if (active.getAttribute('role') === 'tab') {
  5140. active.setAttribute('aria-selected', false);
  5141. }
  5142. }
  5143. element.classList.add(CLASS_NAME_ACTIVE$3);
  5144. if (element.getAttribute('role') === 'tab') {
  5145. element.setAttribute('aria-selected', true);
  5146. }
  5147. reflow(element);
  5148. if (element.classList.contains(CLASS_NAME_FADE$4)) {
  5149. element.classList.add(CLASS_NAME_SHOW$6);
  5150. }
  5151. if (element.parentNode && element.parentNode.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
  5152. var dropdownElement = element.closest(SELECTOR_DROPDOWN$1);
  5153. if (dropdownElement) {
  5154. SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE$1).forEach(function (dropdown) {
  5155. return dropdown.classList.add(CLASS_NAME_ACTIVE$3);
  5156. });
  5157. }
  5158. element.setAttribute('aria-expanded', true);
  5159. }
  5160. if (callback) {
  5161. callback();
  5162. }
  5163. } // Static
  5164. ;
  5165. Tab.jQueryInterface = function jQueryInterface(config) {
  5166. return this.each(function () {
  5167. var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
  5168. if (typeof config === 'string') {
  5169. if (typeof data[config] === 'undefined') {
  5170. throw new TypeError("No method named \"" + config + "\"");
  5171. }
  5172. data[config]();
  5173. }
  5174. });
  5175. };
  5176. _createClass(Tab, null, [{
  5177. key: "DATA_KEY",
  5178. get: // Getters
  5179. function get() {
  5180. return DATA_KEY$9;
  5181. }
  5182. }]);
  5183. return Tab;
  5184. }(BaseComponent);
  5185. /**
  5186. * ------------------------------------------------------------------------
  5187. * Data Api implementation
  5188. * ------------------------------------------------------------------------
  5189. */
  5190. EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
  5191. event.preventDefault();
  5192. var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
  5193. data.show();
  5194. });
  5195. /**
  5196. * ------------------------------------------------------------------------
  5197. * jQuery
  5198. * ------------------------------------------------------------------------
  5199. * add .Tab to jQuery only if jQuery is present
  5200. */
  5201. defineJQueryPlugin(NAME$9, Tab);
  5202. /**
  5203. * ------------------------------------------------------------------------
  5204. * Constants
  5205. * ------------------------------------------------------------------------
  5206. */
  5207. var NAME$a = 'toast';
  5208. var DATA_KEY$a = 'bs.toast';
  5209. var EVENT_KEY$a = "." + DATA_KEY$a;
  5210. var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
  5211. var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
  5212. var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
  5213. var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
  5214. var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
  5215. var CLASS_NAME_FADE$5 = 'fade';
  5216. var CLASS_NAME_HIDE = 'hide';
  5217. var CLASS_NAME_SHOW$7 = 'show';
  5218. var CLASS_NAME_SHOWING = 'showing';
  5219. var DefaultType$7 = {
  5220. animation: 'boolean',
  5221. autohide: 'boolean',
  5222. delay: 'number'
  5223. };
  5224. var Default$7 = {
  5225. animation: true,
  5226. autohide: true,
  5227. delay: 5000
  5228. };
  5229. var SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="toast"]';
  5230. /**
  5231. * ------------------------------------------------------------------------
  5232. * Class Definition
  5233. * ------------------------------------------------------------------------
  5234. */
  5235. var Toast = /*#__PURE__*/function (_BaseComponent) {
  5236. _inheritsLoose(Toast, _BaseComponent);
  5237. function Toast(element, config) {
  5238. var _this;
  5239. _this = _BaseComponent.call(this, element) || this;
  5240. _this._config = _this._getConfig(config);
  5241. _this._timeout = null;
  5242. _this._setListeners();
  5243. return _this;
  5244. } // Getters
  5245. var _proto = Toast.prototype;
  5246. // Public
  5247. _proto.show = function show() {
  5248. var _this2 = this;
  5249. var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4);
  5250. if (showEvent.defaultPrevented) {
  5251. return;
  5252. }
  5253. this._clearTimeout();
  5254. if (this._config.animation) {
  5255. this._element.classList.add(CLASS_NAME_FADE$5);
  5256. }
  5257. var complete = function complete() {
  5258. _this2._element.classList.remove(CLASS_NAME_SHOWING);
  5259. _this2._element.classList.add(CLASS_NAME_SHOW$7);
  5260. EventHandler.trigger(_this2._element, EVENT_SHOWN$4);
  5261. if (_this2._config.autohide) {
  5262. _this2._timeout = setTimeout(function () {
  5263. _this2.hide();
  5264. }, _this2._config.delay);
  5265. }
  5266. };
  5267. this._element.classList.remove(CLASS_NAME_HIDE);
  5268. reflow(this._element);
  5269. this._element.classList.add(CLASS_NAME_SHOWING);
  5270. if (this._config.animation) {
  5271. var transitionDuration = getTransitionDurationFromElement(this._element);
  5272. EventHandler.one(this._element, 'transitionend', complete);
  5273. emulateTransitionEnd(this._element, transitionDuration);
  5274. } else {
  5275. complete();
  5276. }
  5277. };
  5278. _proto.hide = function hide() {
  5279. var _this3 = this;
  5280. if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  5281. return;
  5282. }
  5283. var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);
  5284. if (hideEvent.defaultPrevented) {
  5285. return;
  5286. }
  5287. var complete = function complete() {
  5288. _this3._element.classList.add(CLASS_NAME_HIDE);
  5289. EventHandler.trigger(_this3._element, EVENT_HIDDEN$4);
  5290. };
  5291. this._element.classList.remove(CLASS_NAME_SHOW$7);
  5292. if (this._config.animation) {
  5293. var transitionDuration = getTransitionDurationFromElement(this._element);
  5294. EventHandler.one(this._element, 'transitionend', complete);
  5295. emulateTransitionEnd(this._element, transitionDuration);
  5296. } else {
  5297. complete();
  5298. }
  5299. };
  5300. _proto.dispose = function dispose() {
  5301. this._clearTimeout();
  5302. if (this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  5303. this._element.classList.remove(CLASS_NAME_SHOW$7);
  5304. }
  5305. EventHandler.off(this._element, EVENT_CLICK_DISMISS$1);
  5306. _BaseComponent.prototype.dispose.call(this);
  5307. this._config = null;
  5308. } // Private
  5309. ;
  5310. _proto._getConfig = function _getConfig(config) {
  5311. config = _extends({}, Default$7, Manipulator.getDataAttributes(this._element), typeof config === 'object' && config ? config : {});
  5312. typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  5313. return config;
  5314. };
  5315. _proto._setListeners = function _setListeners() {
  5316. var _this4 = this;
  5317. EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
  5318. return _this4.hide();
  5319. });
  5320. };
  5321. _proto._clearTimeout = function _clearTimeout() {
  5322. clearTimeout(this._timeout);
  5323. this._timeout = null;
  5324. } // Static
  5325. ;
  5326. Toast.jQueryInterface = function jQueryInterface(config) {
  5327. return this.each(function () {
  5328. var data = Data.getData(this, DATA_KEY$a);
  5329. var _config = typeof config === 'object' && config;
  5330. if (!data) {
  5331. data = new Toast(this, _config);
  5332. }
  5333. if (typeof config === 'string') {
  5334. if (typeof data[config] === 'undefined') {
  5335. throw new TypeError("No method named \"" + config + "\"");
  5336. }
  5337. data[config](this);
  5338. }
  5339. });
  5340. };
  5341. _createClass(Toast, null, [{
  5342. key: "DefaultType",
  5343. get: function get() {
  5344. return DefaultType$7;
  5345. }
  5346. }, {
  5347. key: "Default",
  5348. get: function get() {
  5349. return Default$7;
  5350. }
  5351. }, {
  5352. key: "DATA_KEY",
  5353. get: function get() {
  5354. return DATA_KEY$a;
  5355. }
  5356. }]);
  5357. return Toast;
  5358. }(BaseComponent);
  5359. /**
  5360. * ------------------------------------------------------------------------
  5361. * jQuery
  5362. * ------------------------------------------------------------------------
  5363. * add .Toast to jQuery only if jQuery is present
  5364. */
  5365. defineJQueryPlugin(NAME$a, Toast);
  5366. /**
  5367. * --------------------------------------------------------------------------
  5368. * Bootstrap (v5.0.0-beta2): index.umd.js
  5369. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  5370. * --------------------------------------------------------------------------
  5371. */
  5372. var index_umd = {
  5373. Alert: Alert,
  5374. Button: Button,
  5375. Carousel: Carousel,
  5376. Collapse: Collapse,
  5377. Dropdown: Dropdown,
  5378. Modal: Modal,
  5379. Popover: Popover,
  5380. ScrollSpy: ScrollSpy,
  5381. Tab: Tab,
  5382. Toast: Toast,
  5383. Tooltip: Tooltip
  5384. };
  5385. return index_umd;
  5386. })));
  5387. //# sourceMappingURL=bootstrap.bundle.js.map