bootstrap.bundle.js 205 KB

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