You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bootstrap.bundle.js 257KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015
  1. /*!
  2. * Bootstrap v4.3.1 (https://getbootstrap.com/)
  3. * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  8. typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  9. (global = global || self, factory(global.bootstrap = {}, global.jQuery));
  10. }(this, function (exports, $) {
  11. 'use strict';
  12. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _defineProperty(obj, key, value) {
  28. if (key in obj) {
  29. Object.defineProperty(obj, key, {
  30. value: value,
  31. enumerable: true,
  32. configurable: true,
  33. writable: true
  34. });
  35. } else {
  36. obj[key] = value;
  37. }
  38. return obj;
  39. }
  40. function _objectSpread(target) {
  41. for (var i = 1; i < arguments.length; i++) {
  42. var source = arguments[i] != null ? arguments[i] : {};
  43. var ownKeys = Object.keys(source);
  44. if (typeof Object.getOwnPropertySymbols === 'function') {
  45. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  46. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  47. }));
  48. }
  49. ownKeys.forEach(function (key) {
  50. _defineProperty(target, key, source[key]);
  51. });
  52. }
  53. return target;
  54. }
  55. function _inheritsLoose(subClass, superClass) {
  56. subClass.prototype = Object.create(superClass.prototype);
  57. subClass.prototype.constructor = subClass;
  58. subClass.__proto__ = superClass;
  59. }
  60. /**
  61. * --------------------------------------------------------------------------
  62. * Bootstrap (v4.3.1): util.js
  63. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  64. * --------------------------------------------------------------------------
  65. */
  66. /**
  67. * ------------------------------------------------------------------------
  68. * Private TransitionEnd Helpers
  69. * ------------------------------------------------------------------------
  70. */
  71. var TRANSITION_END = 'transitionend';
  72. var MAX_UID = 1000000;
  73. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  74. function toType(obj) {
  75. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  76. }
  77. function getSpecialTransitionEndEvent() {
  78. return {
  79. bindType: TRANSITION_END,
  80. delegateType: TRANSITION_END,
  81. handle: function handle(event) {
  82. if ($(event.target).is(this)) {
  83. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  84. }
  85. return undefined; // eslint-disable-line no-undefined
  86. }
  87. };
  88. }
  89. function transitionEndEmulator(duration) {
  90. var _this = this;
  91. var called = false;
  92. $(this).one(Util.TRANSITION_END, function () {
  93. called = true;
  94. });
  95. setTimeout(function () {
  96. if (!called) {
  97. Util.triggerTransitionEnd(_this);
  98. }
  99. }, duration);
  100. return this;
  101. }
  102. function setTransitionEndSupport() {
  103. $.fn.emulateTransitionEnd = transitionEndEmulator;
  104. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  105. }
  106. /**
  107. * --------------------------------------------------------------------------
  108. * Public Util Api
  109. * --------------------------------------------------------------------------
  110. */
  111. var Util = {
  112. TRANSITION_END: 'bsTransitionEnd',
  113. getUID: function getUID(prefix) {
  114. do {
  115. // eslint-disable-next-line no-bitwise
  116. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  117. } while (document.getElementById(prefix));
  118. return prefix;
  119. },
  120. getSelectorFromElement: function getSelectorFromElement(element) {
  121. var selector = element.getAttribute('data-target');
  122. if (!selector || selector === '#') {
  123. var hrefAttr = element.getAttribute('href');
  124. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  125. }
  126. try {
  127. return document.querySelector(selector) ? selector : null;
  128. } catch (err) {
  129. return null;
  130. }
  131. },
  132. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  133. if (!element) {
  134. return 0;
  135. } // Get transition-duration of the element
  136. var transitionDuration = $(element).css('transition-duration');
  137. var transitionDelay = $(element).css('transition-delay');
  138. var floatTransitionDuration = parseFloat(transitionDuration);
  139. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  140. if (!floatTransitionDuration && !floatTransitionDelay) {
  141. return 0;
  142. } // If multiple durations are defined, take the first
  143. transitionDuration = transitionDuration.split(',')[0];
  144. transitionDelay = transitionDelay.split(',')[0];
  145. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  146. },
  147. reflow: function reflow(element) {
  148. return element.offsetHeight;
  149. },
  150. triggerTransitionEnd: function triggerTransitionEnd(element) {
  151. $(element).trigger(TRANSITION_END);
  152. },
  153. // TODO: Remove in v5
  154. supportsTransitionEnd: function supportsTransitionEnd() {
  155. return Boolean(TRANSITION_END);
  156. },
  157. isElement: function isElement(obj) {
  158. return (obj[0] || obj).nodeType;
  159. },
  160. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  161. for (var property in configTypes) {
  162. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  163. var expectedTypes = configTypes[property];
  164. var value = config[property];
  165. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  166. if (!new RegExp(expectedTypes).test(valueType)) {
  167. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  168. }
  169. }
  170. }
  171. },
  172. findShadowRoot: function findShadowRoot(element) {
  173. if (!document.documentElement.attachShadow) {
  174. return null;
  175. } // Can find the shadow root otherwise it'll return the document
  176. if (typeof element.getRootNode === 'function') {
  177. var root = element.getRootNode();
  178. return root instanceof ShadowRoot ? root : null;
  179. }
  180. if (element instanceof ShadowRoot) {
  181. return element;
  182. } // when we don't find a shadow root
  183. if (!element.parentNode) {
  184. return null;
  185. }
  186. return Util.findShadowRoot(element.parentNode);
  187. }
  188. };
  189. setTransitionEndSupport();
  190. /**
  191. * ------------------------------------------------------------------------
  192. * Constants
  193. * ------------------------------------------------------------------------
  194. */
  195. var NAME = 'alert';
  196. var VERSION = '4.3.1';
  197. var DATA_KEY = 'bs.alert';
  198. var EVENT_KEY = "." + DATA_KEY;
  199. var DATA_API_KEY = '.data-api';
  200. var JQUERY_NO_CONFLICT = $.fn[NAME];
  201. var Selector = {
  202. DISMISS: '[data-dismiss="alert"]'
  203. };
  204. var Event = {
  205. CLOSE: "close" + EVENT_KEY,
  206. CLOSED: "closed" + EVENT_KEY,
  207. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  208. };
  209. var ClassName = {
  210. ALERT: 'alert',
  211. FADE: 'fade',
  212. SHOW: 'show'
  213. /**
  214. * ------------------------------------------------------------------------
  215. * Class Definition
  216. * ------------------------------------------------------------------------
  217. */
  218. };
  219. var Alert =
  220. /*#__PURE__*/
  221. function () {
  222. function Alert(element) {
  223. this._element = element;
  224. } // Getters
  225. var _proto = Alert.prototype;
  226. // Public
  227. _proto.close = function close(element) {
  228. var rootElement = this._element;
  229. if (element) {
  230. rootElement = this._getRootElement(element);
  231. }
  232. var customEvent = this._triggerCloseEvent(rootElement);
  233. if (customEvent.isDefaultPrevented()) {
  234. return;
  235. }
  236. this._removeElement(rootElement);
  237. };
  238. _proto.dispose = function dispose() {
  239. $.removeData(this._element, DATA_KEY);
  240. this._element = null;
  241. } // Private
  242. ;
  243. _proto._getRootElement = function _getRootElement(element) {
  244. var selector = Util.getSelectorFromElement(element);
  245. var parent = false;
  246. if (selector) {
  247. parent = document.querySelector(selector);
  248. }
  249. if (!parent) {
  250. parent = $(element).closest("." + ClassName.ALERT)[0];
  251. }
  252. return parent;
  253. };
  254. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  255. var closeEvent = $.Event(Event.CLOSE);
  256. $(element).trigger(closeEvent);
  257. return closeEvent;
  258. };
  259. _proto._removeElement = function _removeElement(element) {
  260. var _this = this;
  261. $(element).removeClass(ClassName.SHOW);
  262. if (!$(element).hasClass(ClassName.FADE)) {
  263. this._destroyElement(element);
  264. return;
  265. }
  266. var transitionDuration = Util.getTransitionDurationFromElement(element);
  267. $(element).one(Util.TRANSITION_END, function (event) {
  268. return _this._destroyElement(element, event);
  269. }).emulateTransitionEnd(transitionDuration);
  270. };
  271. _proto._destroyElement = function _destroyElement(element) {
  272. $(element).detach().trigger(Event.CLOSED).remove();
  273. } // Static
  274. ;
  275. Alert._jQueryInterface = function _jQueryInterface(config) {
  276. return this.each(function () {
  277. var $element = $(this);
  278. var data = $element.data(DATA_KEY);
  279. if (!data) {
  280. data = new Alert(this);
  281. $element.data(DATA_KEY, data);
  282. }
  283. if (config === 'close') {
  284. data[config](this);
  285. }
  286. });
  287. };
  288. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  289. return function (event) {
  290. if (event) {
  291. event.preventDefault();
  292. }
  293. alertInstance.close(this);
  294. };
  295. };
  296. _createClass(Alert, null, [{
  297. key: "VERSION",
  298. get: function get() {
  299. return VERSION;
  300. }
  301. }]);
  302. return Alert;
  303. }();
  304. /**
  305. * ------------------------------------------------------------------------
  306. * Data Api implementation
  307. * ------------------------------------------------------------------------
  308. */
  309. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  310. /**
  311. * ------------------------------------------------------------------------
  312. * jQuery
  313. * ------------------------------------------------------------------------
  314. */
  315. $.fn[NAME] = Alert._jQueryInterface;
  316. $.fn[NAME].Constructor = Alert;
  317. $.fn[NAME].noConflict = function () {
  318. $.fn[NAME] = JQUERY_NO_CONFLICT;
  319. return Alert._jQueryInterface;
  320. };
  321. /**
  322. * ------------------------------------------------------------------------
  323. * Constants
  324. * ------------------------------------------------------------------------
  325. */
  326. var NAME$1 = 'button';
  327. var VERSION$1 = '4.3.1';
  328. var DATA_KEY$1 = 'bs.button';
  329. var EVENT_KEY$1 = "." + DATA_KEY$1;
  330. var DATA_API_KEY$1 = '.data-api';
  331. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  332. var ClassName$1 = {
  333. ACTIVE: 'active',
  334. BUTTON: 'btn',
  335. FOCUS: 'focus'
  336. };
  337. var Selector$1 = {
  338. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  339. DATA_TOGGLE: '[data-toggle="buttons"]',
  340. INPUT: 'input:not([type="hidden"])',
  341. ACTIVE: '.active',
  342. BUTTON: '.btn'
  343. };
  344. var Event$1 = {
  345. CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  346. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
  347. /**
  348. * ------------------------------------------------------------------------
  349. * Class Definition
  350. * ------------------------------------------------------------------------
  351. */
  352. };
  353. var Button =
  354. /*#__PURE__*/
  355. function () {
  356. function Button(element) {
  357. this._element = element;
  358. } // Getters
  359. var _proto = Button.prototype;
  360. // Public
  361. _proto.toggle = function toggle() {
  362. var triggerChangeEvent = true;
  363. var addAriaPressed = true;
  364. var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];
  365. if (rootElement) {
  366. var input = this._element.querySelector(Selector$1.INPUT);
  367. if (input) {
  368. if (input.type === 'radio') {
  369. if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
  370. triggerChangeEvent = false;
  371. } else {
  372. var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
  373. if (activeElement) {
  374. $(activeElement).removeClass(ClassName$1.ACTIVE);
  375. }
  376. }
  377. }
  378. if (triggerChangeEvent) {
  379. if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
  380. return;
  381. }
  382. input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
  383. $(input).trigger('change');
  384. }
  385. input.focus();
  386. addAriaPressed = false;
  387. }
  388. }
  389. if (addAriaPressed) {
  390. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
  391. }
  392. if (triggerChangeEvent) {
  393. $(this._element).toggleClass(ClassName$1.ACTIVE);
  394. }
  395. };
  396. _proto.dispose = function dispose() {
  397. $.removeData(this._element, DATA_KEY$1);
  398. this._element = null;
  399. } // Static
  400. ;
  401. Button._jQueryInterface = function _jQueryInterface(config) {
  402. return this.each(function () {
  403. var data = $(this).data(DATA_KEY$1);
  404. if (!data) {
  405. data = new Button(this);
  406. $(this).data(DATA_KEY$1, data);
  407. }
  408. if (config === 'toggle') {
  409. data[config]();
  410. }
  411. });
  412. };
  413. _createClass(Button, null, [{
  414. key: "VERSION",
  415. get: function get() {
  416. return VERSION$1;
  417. }
  418. }]);
  419. return Button;
  420. }();
  421. /**
  422. * ------------------------------------------------------------------------
  423. * Data Api implementation
  424. * ------------------------------------------------------------------------
  425. */
  426. $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  427. event.preventDefault();
  428. var button = event.target;
  429. if (!$(button).hasClass(ClassName$1.BUTTON)) {
  430. button = $(button).closest(Selector$1.BUTTON);
  431. }
  432. Button._jQueryInterface.call($(button), 'toggle');
  433. }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  434. var button = $(event.target).closest(Selector$1.BUTTON)[0];
  435. $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  436. });
  437. /**
  438. * ------------------------------------------------------------------------
  439. * jQuery
  440. * ------------------------------------------------------------------------
  441. */
  442. $.fn[NAME$1] = Button._jQueryInterface;
  443. $.fn[NAME$1].Constructor = Button;
  444. $.fn[NAME$1].noConflict = function () {
  445. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  446. return Button._jQueryInterface;
  447. };
  448. /**
  449. * ------------------------------------------------------------------------
  450. * Constants
  451. * ------------------------------------------------------------------------
  452. */
  453. var NAME$2 = 'carousel';
  454. var VERSION$2 = '4.3.1';
  455. var DATA_KEY$2 = 'bs.carousel';
  456. var EVENT_KEY$2 = "." + DATA_KEY$2;
  457. var DATA_API_KEY$2 = '.data-api';
  458. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  459. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  460. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  461. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  462. var SWIPE_THRESHOLD = 40;
  463. var Default = {
  464. interval: 5000,
  465. keyboard: true,
  466. slide: false,
  467. pause: 'hover',
  468. wrap: true,
  469. touch: true
  470. };
  471. var DefaultType = {
  472. interval: '(number|boolean)',
  473. keyboard: 'boolean',
  474. slide: '(boolean|string)',
  475. pause: '(string|boolean)',
  476. wrap: 'boolean',
  477. touch: 'boolean'
  478. };
  479. var Direction = {
  480. NEXT: 'next',
  481. PREV: 'prev',
  482. LEFT: 'left',
  483. RIGHT: 'right'
  484. };
  485. var Event$2 = {
  486. SLIDE: "slide" + EVENT_KEY$2,
  487. SLID: "slid" + EVENT_KEY$2,
  488. KEYDOWN: "keydown" + EVENT_KEY$2,
  489. MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  490. MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  491. TOUCHSTART: "touchstart" + EVENT_KEY$2,
  492. TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  493. TOUCHEND: "touchend" + EVENT_KEY$2,
  494. POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  495. POINTERUP: "pointerup" + EVENT_KEY$2,
  496. DRAG_START: "dragstart" + EVENT_KEY$2,
  497. LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  498. CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  499. };
  500. var ClassName$2 = {
  501. CAROUSEL: 'carousel',
  502. ACTIVE: 'active',
  503. SLIDE: 'slide',
  504. RIGHT: 'carousel-item-right',
  505. LEFT: 'carousel-item-left',
  506. NEXT: 'carousel-item-next',
  507. PREV: 'carousel-item-prev',
  508. ITEM: 'carousel-item',
  509. POINTER_EVENT: 'pointer-event'
  510. };
  511. var Selector$2 = {
  512. ACTIVE: '.active',
  513. ACTIVE_ITEM: '.active.carousel-item',
  514. ITEM: '.carousel-item',
  515. ITEM_IMG: '.carousel-item img',
  516. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  517. INDICATORS: '.carousel-indicators',
  518. DATA_SLIDE: '[data-slide], [data-slide-to]',
  519. DATA_RIDE: '[data-ride="carousel"]'
  520. };
  521. var PointerType = {
  522. TOUCH: 'touch',
  523. PEN: 'pen'
  524. /**
  525. * ------------------------------------------------------------------------
  526. * Class Definition
  527. * ------------------------------------------------------------------------
  528. */
  529. };
  530. var Carousel =
  531. /*#__PURE__*/
  532. function () {
  533. function Carousel(element, config) {
  534. this._items = null;
  535. this._interval = null;
  536. this._activeElement = null;
  537. this._isPaused = false;
  538. this._isSliding = false;
  539. this.touchTimeout = null;
  540. this.touchStartX = 0;
  541. this.touchDeltaX = 0;
  542. this._config = this._getConfig(config);
  543. this._element = element;
  544. this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
  545. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  546. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  547. this._addEventListeners();
  548. } // Getters
  549. var _proto = Carousel.prototype;
  550. // Public
  551. _proto.next = function next() {
  552. if (!this._isSliding) {
  553. this._slide(Direction.NEXT);
  554. }
  555. };
  556. _proto.nextWhenVisible = function nextWhenVisible() {
  557. // Don't call next when the page isn't visible
  558. // or the carousel or its parent isn't visible
  559. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  560. this.next();
  561. }
  562. };
  563. _proto.prev = function prev() {
  564. if (!this._isSliding) {
  565. this._slide(Direction.PREV);
  566. }
  567. };
  568. _proto.pause = function pause(event) {
  569. if (!event) {
  570. this._isPaused = true;
  571. }
  572. if (this._element.querySelector(Selector$2.NEXT_PREV)) {
  573. Util.triggerTransitionEnd(this._element);
  574. this.cycle(true);
  575. }
  576. clearInterval(this._interval);
  577. this._interval = null;
  578. };
  579. _proto.cycle = function cycle(event) {
  580. if (!event) {
  581. this._isPaused = false;
  582. }
  583. if (this._interval) {
  584. clearInterval(this._interval);
  585. this._interval = null;
  586. }
  587. if (this._config.interval && !this._isPaused) {
  588. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  589. }
  590. };
  591. _proto.to = function to(index) {
  592. var _this = this;
  593. this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  594. var activeIndex = this._getItemIndex(this._activeElement);
  595. if (index > this._items.length - 1 || index < 0) {
  596. return;
  597. }
  598. if (this._isSliding) {
  599. $(this._element).one(Event$2.SLID, function () {
  600. return _this.to(index);
  601. });
  602. return;
  603. }
  604. if (activeIndex === index) {
  605. this.pause();
  606. this.cycle();
  607. return;
  608. }
  609. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  610. this._slide(direction, this._items[index]);
  611. };
  612. _proto.dispose = function dispose() {
  613. $(this._element).off(EVENT_KEY$2);
  614. $.removeData(this._element, DATA_KEY$2);
  615. this._items = null;
  616. this._config = null;
  617. this._element = null;
  618. this._interval = null;
  619. this._isPaused = null;
  620. this._isSliding = null;
  621. this._activeElement = null;
  622. this._indicatorsElement = null;
  623. } // Private
  624. ;
  625. _proto._getConfig = function _getConfig(config) {
  626. config = _objectSpread({}, Default, config);
  627. Util.typeCheckConfig(NAME$2, config, DefaultType);
  628. return config;
  629. };
  630. _proto._handleSwipe = function _handleSwipe() {
  631. var absDeltax = Math.abs(this.touchDeltaX);
  632. if (absDeltax <= SWIPE_THRESHOLD) {
  633. return;
  634. }
  635. var direction = absDeltax / this.touchDeltaX; // swipe left
  636. if (direction > 0) {
  637. this.prev();
  638. } // swipe right
  639. if (direction < 0) {
  640. this.next();
  641. }
  642. };
  643. _proto._addEventListeners = function _addEventListeners() {
  644. var _this2 = this;
  645. if (this._config.keyboard) {
  646. $(this._element).on(Event$2.KEYDOWN, function (event) {
  647. return _this2._keydown(event);
  648. });
  649. }
  650. if (this._config.pause === 'hover') {
  651. $(this._element).on(Event$2.MOUSEENTER, function (event) {
  652. return _this2.pause(event);
  653. }).on(Event$2.MOUSELEAVE, function (event) {
  654. return _this2.cycle(event);
  655. });
  656. }
  657. if (this._config.touch) {
  658. this._addTouchEventListeners();
  659. }
  660. };
  661. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  662. var _this3 = this;
  663. if (!this._touchSupported) {
  664. return;
  665. }
  666. var start = function start(event) {
  667. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  668. _this3.touchStartX = event.originalEvent.clientX;
  669. } else if (!_this3._pointerEvent) {
  670. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  671. }
  672. };
  673. var move = function move(event) {
  674. // ensure swiping with one touch and not pinching
  675. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  676. _this3.touchDeltaX = 0;
  677. } else {
  678. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  679. }
  680. };
  681. var end = function end(event) {
  682. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  683. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  684. }
  685. _this3._handleSwipe();
  686. if (_this3._config.pause === 'hover') {
  687. // If it's a touch-enabled device, mouseenter/leave are fired as
  688. // part of the mouse compatibility events on first tap - the carousel
  689. // would stop cycling until user tapped out of it;
  690. // here, we listen for touchend, explicitly pause the carousel
  691. // (as if it's the second time we tap on it, mouseenter compat event
  692. // is NOT fired) and after a timeout (to allow for mouse compatibility
  693. // events to fire) we explicitly restart cycling
  694. _this3.pause();
  695. if (_this3.touchTimeout) {
  696. clearTimeout(_this3.touchTimeout);
  697. }
  698. _this3.touchTimeout = setTimeout(function (event) {
  699. return _this3.cycle(event);
  700. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  701. }
  702. };
  703. $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
  704. return e.preventDefault();
  705. });
  706. if (this._pointerEvent) {
  707. $(this._element).on(Event$2.POINTERDOWN, function (event) {
  708. return start(event);
  709. });
  710. $(this._element).on(Event$2.POINTERUP, function (event) {
  711. return end(event);
  712. });
  713. this._element.classList.add(ClassName$2.POINTER_EVENT);
  714. } else {
  715. $(this._element).on(Event$2.TOUCHSTART, function (event) {
  716. return start(event);
  717. });
  718. $(this._element).on(Event$2.TOUCHMOVE, function (event) {
  719. return move(event);
  720. });
  721. $(this._element).on(Event$2.TOUCHEND, function (event) {
  722. return end(event);
  723. });
  724. }
  725. };
  726. _proto._keydown = function _keydown(event) {
  727. if (/input|textarea/i.test(event.target.tagName)) {
  728. return;
  729. }
  730. switch (event.which) {
  731. case ARROW_LEFT_KEYCODE:
  732. event.preventDefault();
  733. this.prev();
  734. break;
  735. case ARROW_RIGHT_KEYCODE:
  736. event.preventDefault();
  737. this.next();
  738. break;
  739. default:
  740. }
  741. };
  742. _proto._getItemIndex = function _getItemIndex(element) {
  743. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
  744. return this._items.indexOf(element);
  745. };
  746. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  747. var isNextDirection = direction === Direction.NEXT;
  748. var isPrevDirection = direction === Direction.PREV;
  749. var activeIndex = this._getItemIndex(activeElement);
  750. var lastItemIndex = this._items.length - 1;
  751. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  752. if (isGoingToWrap && !this._config.wrap) {
  753. return activeElement;
  754. }
  755. var delta = direction === Direction.PREV ? -1 : 1;
  756. var itemIndex = (activeIndex + delta) % this._items.length;
  757. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  758. };
  759. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  760. var targetIndex = this._getItemIndex(relatedTarget);
  761. var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
  762. var slideEvent = $.Event(Event$2.SLIDE, {
  763. relatedTarget: relatedTarget,
  764. direction: eventDirectionName,
  765. from: fromIndex,
  766. to: targetIndex
  767. });
  768. $(this._element).trigger(slideEvent);
  769. return slideEvent;
  770. };
  771. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  772. if (this._indicatorsElement) {
  773. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
  774. $(indicators).removeClass(ClassName$2.ACTIVE);
  775. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  776. if (nextIndicator) {
  777. $(nextIndicator).addClass(ClassName$2.ACTIVE);
  778. }
  779. }
  780. };
  781. _proto._slide = function _slide(direction, element) {
  782. var _this4 = this;
  783. var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  784. var activeElementIndex = this._getItemIndex(activeElement);
  785. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  786. var nextElementIndex = this._getItemIndex(nextElement);
  787. var isCycling = Boolean(this._interval);
  788. var directionalClassName;
  789. var orderClassName;
  790. var eventDirectionName;
  791. if (direction === Direction.NEXT) {
  792. directionalClassName = ClassName$2.LEFT;
  793. orderClassName = ClassName$2.NEXT;
  794. eventDirectionName = Direction.LEFT;
  795. } else {
  796. directionalClassName = ClassName$2.RIGHT;
  797. orderClassName = ClassName$2.PREV;
  798. eventDirectionName = Direction.RIGHT;
  799. }
  800. if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
  801. this._isSliding = false;
  802. return;
  803. }
  804. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  805. if (slideEvent.isDefaultPrevented()) {
  806. return;
  807. }
  808. if (!activeElement || !nextElement) {
  809. // Some weirdness is happening, so we bail
  810. return;
  811. }
  812. this._isSliding = true;
  813. if (isCycling) {
  814. this.pause();
  815. }
  816. this._setActiveIndicatorElement(nextElement);
  817. var slidEvent = $.Event(Event$2.SLID, {
  818. relatedTarget: nextElement,
  819. direction: eventDirectionName,
  820. from: activeElementIndex,
  821. to: nextElementIndex
  822. });
  823. if ($(this._element).hasClass(ClassName$2.SLIDE)) {
  824. $(nextElement).addClass(orderClassName);
  825. Util.reflow(nextElement);
  826. $(activeElement).addClass(directionalClassName);
  827. $(nextElement).addClass(directionalClassName);
  828. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  829. if (nextElementInterval) {
  830. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  831. this._config.interval = nextElementInterval;
  832. } else {
  833. this._config.interval = this._config.defaultInterval || this._config.interval;
  834. }
  835. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  836. $(activeElement).one(Util.TRANSITION_END, function () {
  837. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
  838. $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
  839. _this4._isSliding = false;
  840. setTimeout(function () {
  841. return $(_this4._element).trigger(slidEvent);
  842. }, 0);
  843. }).emulateTransitionEnd(transitionDuration);
  844. } else {
  845. $(activeElement).removeClass(ClassName$2.ACTIVE);
  846. $(nextElement).addClass(ClassName$2.ACTIVE);
  847. this._isSliding = false;
  848. $(this._element).trigger(slidEvent);
  849. }
  850. if (isCycling) {
  851. this.cycle();
  852. }
  853. } // Static
  854. ;
  855. Carousel._jQueryInterface = function _jQueryInterface(config) {
  856. return this.each(function () {
  857. var data = $(this).data(DATA_KEY$2);
  858. var _config = _objectSpread({}, Default, $(this).data());
  859. if (typeof config === 'object') {
  860. _config = _objectSpread({}, _config, config);
  861. }
  862. var action = typeof config === 'string' ? config : _config.slide;
  863. if (!data) {
  864. data = new Carousel(this, _config);
  865. $(this).data(DATA_KEY$2, data);
  866. }
  867. if (typeof config === 'number') {
  868. data.to(config);
  869. } else if (typeof action === 'string') {
  870. if (typeof data[action] === 'undefined') {
  871. throw new TypeError("No method named \"" + action + "\"");
  872. }
  873. data[action]();
  874. } else if (_config.interval && _config.ride) {
  875. data.pause();
  876. data.cycle();
  877. }
  878. });
  879. };
  880. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  881. var selector = Util.getSelectorFromElement(this);
  882. if (!selector) {
  883. return;
  884. }
  885. var target = $(selector)[0];
  886. if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
  887. return;
  888. }
  889. var config = _objectSpread({}, $(target).data(), $(this).data());
  890. var slideIndex = this.getAttribute('data-slide-to');
  891. if (slideIndex) {
  892. config.interval = false;
  893. }
  894. Carousel._jQueryInterface.call($(target), config);
  895. if (slideIndex) {
  896. $(target).data(DATA_KEY$2).to(slideIndex);
  897. }
  898. event.preventDefault();
  899. };
  900. _createClass(Carousel, null, [{
  901. key: "VERSION",
  902. get: function get() {
  903. return VERSION$2;
  904. }
  905. }, {
  906. key: "Default",
  907. get: function get() {
  908. return Default;
  909. }
  910. }]);
  911. return Carousel;
  912. }();
  913. /**
  914. * ------------------------------------------------------------------------
  915. * Data Api implementation
  916. * ------------------------------------------------------------------------
  917. */
  918. $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  919. $(window).on(Event$2.LOAD_DATA_API, function () {
  920. var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
  921. for (var i = 0, len = carousels.length; i < len; i++) {
  922. var $carousel = $(carousels[i]);
  923. Carousel._jQueryInterface.call($carousel, $carousel.data());
  924. }
  925. });
  926. /**
  927. * ------------------------------------------------------------------------
  928. * jQuery
  929. * ------------------------------------------------------------------------
  930. */
  931. $.fn[NAME$2] = Carousel._jQueryInterface;
  932. $.fn[NAME$2].Constructor = Carousel;
  933. $.fn[NAME$2].noConflict = function () {
  934. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  935. return Carousel._jQueryInterface;
  936. };
  937. /**
  938. * ------------------------------------------------------------------------
  939. * Constants
  940. * ------------------------------------------------------------------------
  941. */
  942. var NAME$3 = 'collapse';
  943. var VERSION$3 = '4.3.1';
  944. var DATA_KEY$3 = 'bs.collapse';
  945. var EVENT_KEY$3 = "." + DATA_KEY$3;
  946. var DATA_API_KEY$3 = '.data-api';
  947. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  948. var Default$1 = {
  949. toggle: true,
  950. parent: ''
  951. };
  952. var DefaultType$1 = {
  953. toggle: 'boolean',
  954. parent: '(string|element)'
  955. };
  956. var Event$3 = {
  957. SHOW: "show" + EVENT_KEY$3,
  958. SHOWN: "shown" + EVENT_KEY$3,
  959. HIDE: "hide" + EVENT_KEY$3,
  960. HIDDEN: "hidden" + EVENT_KEY$3,
  961. CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  962. };
  963. var ClassName$3 = {
  964. SHOW: 'show',
  965. COLLAPSE: 'collapse',
  966. COLLAPSING: 'collapsing',
  967. COLLAPSED: 'collapsed'
  968. };
  969. var Dimension = {
  970. WIDTH: 'width',
  971. HEIGHT: 'height'
  972. };
  973. var Selector$3 = {
  974. ACTIVES: '.show, .collapsing',
  975. DATA_TOGGLE: '[data-toggle="collapse"]'
  976. /**
  977. * ------------------------------------------------------------------------
  978. * Class Definition
  979. * ------------------------------------------------------------------------
  980. */
  981. };
  982. var Collapse =
  983. /*#__PURE__*/
  984. function () {
  985. function Collapse(element, config) {
  986. this._isTransitioning = false;
  987. this._element = element;
  988. this._config = this._getConfig(config);
  989. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  990. var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
  991. for (var i = 0, len = toggleList.length; i < len; i++) {
  992. var elem = toggleList[i];
  993. var selector = Util.getSelectorFromElement(elem);
  994. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  995. return foundElem === element;
  996. });
  997. if (selector !== null && filterElement.length > 0) {
  998. this._selector = selector;
  999. this._triggerArray.push(elem);
  1000. }
  1001. }
  1002. this._parent = this._config.parent ? this._getParent() : null;
  1003. if (!this._config.parent) {
  1004. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  1005. }
  1006. if (this._config.toggle) {
  1007. this.toggle();
  1008. }
  1009. } // Getters
  1010. var _proto = Collapse.prototype;
  1011. // Public
  1012. _proto.toggle = function toggle() {
  1013. if ($(this._element).hasClass(ClassName$3.SHOW)) {
  1014. this.hide();
  1015. } else {
  1016. this.show();
  1017. }
  1018. };
  1019. _proto.show = function show() {
  1020. var _this = this;
  1021. if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
  1022. return;
  1023. }
  1024. var actives;
  1025. var activesData;
  1026. if (this._parent) {
  1027. actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
  1028. if (typeof _this._config.parent === 'string') {
  1029. return elem.getAttribute('data-parent') === _this._config.parent;
  1030. }
  1031. return elem.classList.contains(ClassName$3.COLLAPSE);
  1032. });
  1033. if (actives.length === 0) {
  1034. actives = null;
  1035. }
  1036. }
  1037. if (actives) {
  1038. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  1039. if (activesData && activesData._isTransitioning) {
  1040. return;
  1041. }
  1042. }
  1043. var startEvent = $.Event(Event$3.SHOW);
  1044. $(this._element).trigger(startEvent);
  1045. if (startEvent.isDefaultPrevented()) {
  1046. return;
  1047. }
  1048. if (actives) {
  1049. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  1050. if (!activesData) {
  1051. $(actives).data(DATA_KEY$3, null);
  1052. }
  1053. }
  1054. var dimension = this._getDimension();
  1055. $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
  1056. this._element.style[dimension] = 0;
  1057. if (this._triggerArray.length) {
  1058. $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
  1059. }
  1060. this.setTransitioning(true);
  1061. var complete = function complete() {
  1062. $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
  1063. _this._element.style[dimension] = '';
  1064. _this.setTransitioning(false);
  1065. $(_this._element).trigger(Event$3.SHOWN);
  1066. };
  1067. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  1068. var scrollSize = "scroll" + capitalizedDimension;
  1069. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1070. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1071. this._element.style[dimension] = this._element[scrollSize] + "px";
  1072. };
  1073. _proto.hide = function hide() {
  1074. var _this2 = this;
  1075. if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
  1076. return;
  1077. }
  1078. var startEvent = $.Event(Event$3.HIDE);
  1079. $(this._element).trigger(startEvent);
  1080. if (startEvent.isDefaultPrevented()) {
  1081. return;
  1082. }
  1083. var dimension = this._getDimension();
  1084. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  1085. Util.reflow(this._element);
  1086. $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
  1087. var triggerArrayLength = this._triggerArray.length;
  1088. if (triggerArrayLength > 0) {
  1089. for (var i = 0; i < triggerArrayLength; i++) {
  1090. var trigger = this._triggerArray[i];
  1091. var selector = Util.getSelectorFromElement(trigger);
  1092. if (selector !== null) {
  1093. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  1094. if (!$elem.hasClass(ClassName$3.SHOW)) {
  1095. $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
  1096. }
  1097. }
  1098. }
  1099. }
  1100. this.setTransitioning(true);
  1101. var complete = function complete() {
  1102. _this2.setTransitioning(false);
  1103. $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
  1104. };
  1105. this._element.style[dimension] = '';
  1106. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1107. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1108. };
  1109. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  1110. this._isTransitioning = isTransitioning;
  1111. };
  1112. _proto.dispose = function dispose() {
  1113. $.removeData(this._element, DATA_KEY$3);
  1114. this._config = null;
  1115. this._parent = null;
  1116. this._element = null;
  1117. this._triggerArray = null;
  1118. this._isTransitioning = null;
  1119. } // Private
  1120. ;
  1121. _proto._getConfig = function _getConfig(config) {
  1122. config = _objectSpread({}, Default$1, config);
  1123. config.toggle = Boolean(config.toggle); // Coerce string values
  1124. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  1125. return config;
  1126. };
  1127. _proto._getDimension = function _getDimension() {
  1128. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  1129. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  1130. };
  1131. _proto._getParent = function _getParent() {
  1132. var _this3 = this;
  1133. var parent;
  1134. if (Util.isElement(this._config.parent)) {
  1135. parent = this._config.parent; // It's a jQuery object
  1136. if (typeof this._config.parent.jquery !== 'undefined') {
  1137. parent = this._config.parent[0];
  1138. }
  1139. } else {
  1140. parent = document.querySelector(this._config.parent);
  1141. }
  1142. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  1143. var children = [].slice.call(parent.querySelectorAll(selector));
  1144. $(children).each(function (i, element) {
  1145. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  1146. });
  1147. return parent;
  1148. };
  1149. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  1150. var isOpen = $(element).hasClass(ClassName$3.SHOW);
  1151. if (triggerArray.length) {
  1152. $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  1153. }
  1154. } // Static
  1155. ;
  1156. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  1157. var selector = Util.getSelectorFromElement(element);
  1158. return selector ? document.querySelector(selector) : null;
  1159. };
  1160. Collapse._jQueryInterface = function _jQueryInterface(config) {
  1161. return this.each(function () {
  1162. var $this = $(this);
  1163. var data = $this.data(DATA_KEY$3);
  1164. var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {});
  1165. if (!data && _config.toggle && /show|hide/.test(config)) {
  1166. _config.toggle = false;
  1167. }
  1168. if (!data) {
  1169. data = new Collapse(this, _config);
  1170. $this.data(DATA_KEY$3, data);
  1171. }
  1172. if (typeof config === 'string') {
  1173. if (typeof data[config] === 'undefined') {
  1174. throw new TypeError("No method named \"" + config + "\"");
  1175. }
  1176. data[config]();
  1177. }
  1178. });
  1179. };
  1180. _createClass(Collapse, null, [{
  1181. key: "VERSION",
  1182. get: function get() {
  1183. return VERSION$3;
  1184. }
  1185. }, {
  1186. key: "Default",
  1187. get: function get() {
  1188. return Default$1;
  1189. }
  1190. }]);
  1191. return Collapse;
  1192. }();
  1193. /**
  1194. * ------------------------------------------------------------------------
  1195. * Data Api implementation
  1196. * ------------------------------------------------------------------------
  1197. */
  1198. $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  1199. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  1200. if (event.currentTarget.tagName === 'A') {
  1201. event.preventDefault();
  1202. }
  1203. var $trigger = $(this);
  1204. var selector = Util.getSelectorFromElement(this);
  1205. var selectors = [].slice.call(document.querySelectorAll(selector));
  1206. $(selectors).each(function () {
  1207. var $target = $(this);
  1208. var data = $target.data(DATA_KEY$3);
  1209. var config = data ? 'toggle' : $trigger.data();
  1210. Collapse._jQueryInterface.call($target, config);
  1211. });
  1212. });
  1213. /**
  1214. * ------------------------------------------------------------------------
  1215. * jQuery
  1216. * ------------------------------------------------------------------------
  1217. */
  1218. $.fn[NAME$3] = Collapse._jQueryInterface;
  1219. $.fn[NAME$3].Constructor = Collapse;
  1220. $.fn[NAME$3].noConflict = function () {
  1221. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  1222. return Collapse._jQueryInterface;
  1223. };
  1224. /**!
  1225. * @fileOverview Kickass library to create and place poppers near their reference elements.
  1226. * @version 1.14.7
  1227. * @license
  1228. * Copyright (c) 2016 Federico Zivolo and contributors
  1229. *
  1230. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1231. * of this software and associated documentation files (the "Software"), to deal
  1232. * in the Software without restriction, including without limitation the rights
  1233. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1234. * copies of the Software, and to permit persons to whom the Software is
  1235. * furnished to do so, subject to the following conditions:
  1236. *
  1237. * The above copyright notice and this permission notice shall be included in all
  1238. * copies or substantial portions of the Software.
  1239. *
  1240. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1241. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1242. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1243. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1244. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1245. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  1246. * SOFTWARE.
  1247. */
  1248. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
  1249. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  1250. var timeoutDuration = 0;
  1251. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  1252. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  1253. timeoutDuration = 1;
  1254. break;
  1255. }
  1256. }
  1257. function microtaskDebounce(fn) {
  1258. var called = false;
  1259. return function () {
  1260. if (called) {
  1261. return;
  1262. }
  1263. called = true;
  1264. window.Promise.resolve().then(function () {
  1265. called = false;
  1266. fn();
  1267. });
  1268. };
  1269. }
  1270. function taskDebounce(fn) {
  1271. var scheduled = false;
  1272. return function () {
  1273. if (!scheduled) {
  1274. scheduled = true;
  1275. setTimeout(function () {
  1276. scheduled = false;
  1277. fn();
  1278. }, timeoutDuration);
  1279. }
  1280. };
  1281. }
  1282. var supportsMicroTasks = isBrowser && window.Promise;
  1283. /**
  1284. * Create a debounced version of a method, that's asynchronously deferred
  1285. * but called in the minimum time possible.
  1286. *
  1287. * @method
  1288. * @memberof Popper.Utils
  1289. * @argument {Function} fn
  1290. * @returns {Function}
  1291. */
  1292. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  1293. /**
  1294. * Check if the given variable is a function
  1295. * @method
  1296. * @memberof Popper.Utils
  1297. * @argument {Any} functionToCheck - variable to check
  1298. * @returns {Boolean} answer to: is a function?
  1299. */
  1300. function isFunction(functionToCheck) {
  1301. var getType = {};
  1302. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  1303. }
  1304. /**
  1305. * Get CSS computed property of the given element
  1306. * @method
  1307. * @memberof Popper.Utils
  1308. * @argument {Eement} element
  1309. * @argument {String} property
  1310. */
  1311. function getStyleComputedProperty(element, property) {
  1312. if (element.nodeType !== 1) {
  1313. return [];
  1314. }
  1315. // NOTE: 1 DOM access here
  1316. var window = element.ownerDocument.defaultView;
  1317. var css = window.getComputedStyle(element, null);
  1318. return property ? css[property] : css;
  1319. }
  1320. /**
  1321. * Returns the parentNode or the host of the element
  1322. * @method
  1323. * @memberof Popper.Utils
  1324. * @argument {Element} element
  1325. * @returns {Element} parent
  1326. */
  1327. function getParentNode(element) {
  1328. if (element.nodeName === 'HTML') {
  1329. return element;
  1330. }
  1331. return element.parentNode || element.host;
  1332. }
  1333. /**
  1334. * Returns the scrolling parent of the given element
  1335. * @method
  1336. * @memberof Popper.Utils
  1337. * @argument {Element} element
  1338. * @returns {Element} scroll parent
  1339. */
  1340. function getScrollParent(element) {
  1341. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  1342. if (!element) {
  1343. return document.body;
  1344. }
  1345. switch (element.nodeName) {
  1346. case 'HTML':
  1347. case 'BODY':
  1348. return element.ownerDocument.body;
  1349. case '#document':
  1350. return element.body;
  1351. }
  1352. // Firefox want us to check `-x` and `-y` variations as well
  1353. var _getStyleComputedProp = getStyleComputedProperty(element),
  1354. overflow = _getStyleComputedProp.overflow,
  1355. overflowX = _getStyleComputedProp.overflowX,
  1356. overflowY = _getStyleComputedProp.overflowY;
  1357. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  1358. return element;
  1359. }
  1360. return getScrollParent(getParentNode(element));
  1361. }
  1362. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  1363. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  1364. /**
  1365. * Determines if the browser is Internet Explorer
  1366. * @method
  1367. * @memberof Popper.Utils
  1368. * @param {Number} version to check
  1369. * @returns {Boolean} isIE
  1370. */
  1371. function isIE(version) {
  1372. if (version === 11) {
  1373. return isIE11;
  1374. }
  1375. if (version === 10) {
  1376. return isIE10;
  1377. }
  1378. return isIE11 || isIE10;
  1379. }
  1380. /**
  1381. * Returns the offset parent of the given element
  1382. * @method
  1383. * @memberof Popper.Utils
  1384. * @argument {Element} element
  1385. * @returns {Element} offset parent
  1386. */
  1387. function getOffsetParent(element) {
  1388. if (!element) {
  1389. return document.documentElement;
  1390. }
  1391. var noOffsetParent = isIE(10) ? document.body : null;
  1392. // NOTE: 1 DOM access here
  1393. var offsetParent = element.offsetParent || null;
  1394. // Skip hidden elements which don't have an offsetParent
  1395. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  1396. offsetParent = (element = element.nextElementSibling).offsetParent;
  1397. }
  1398. var nodeName = offsetParent && offsetParent.nodeName;
  1399. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  1400. return element ? element.ownerDocument.documentElement : document.documentElement;
  1401. }
  1402. // .offsetParent will return the closest TH, TD or TABLE in case
  1403. // no offsetParent is present, I hate this job...
  1404. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  1405. return getOffsetParent(offsetParent);
  1406. }
  1407. return offsetParent;
  1408. }
  1409. function isOffsetContainer(element) {
  1410. var nodeName = element.nodeName;
  1411. if (nodeName === 'BODY') {
  1412. return false;
  1413. }
  1414. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  1415. }
  1416. /**
  1417. * Finds the root node (document, shadowDOM root) of the given element
  1418. * @method
  1419. * @memberof Popper.Utils
  1420. * @argument {Element} node
  1421. * @returns {Element} root node
  1422. */
  1423. function getRoot(node) {
  1424. if (node.parentNode !== null) {
  1425. return getRoot(node.parentNode);
  1426. }
  1427. return node;
  1428. }
  1429. /**
  1430. * Finds the offset parent common to the two provided nodes
  1431. * @method
  1432. * @memberof Popper.Utils
  1433. * @argument {Element} element1
  1434. * @argument {Element} element2
  1435. * @returns {Element} common offset parent
  1436. */
  1437. function findCommonOffsetParent(element1, element2) {
  1438. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1439. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  1440. return document.documentElement;
  1441. }
  1442. // Here we make sure to give as "start" the element that comes first in the DOM
  1443. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  1444. var start = order ? element1 : element2;
  1445. var end = order ? element2 : element1;
  1446. // Get common ancestor container
  1447. var range = document.createRange();
  1448. range.setStart(start, 0);
  1449. range.setEnd(end, 0);
  1450. var commonAncestorContainer = range.commonAncestorContainer;
  1451. // Both nodes are inside #document
  1452. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  1453. if (isOffsetContainer(commonAncestorContainer)) {
  1454. return commonAncestorContainer;
  1455. }
  1456. return getOffsetParent(commonAncestorContainer);
  1457. }
  1458. // one of the nodes is inside shadowDOM, find which one
  1459. var element1root = getRoot(element1);
  1460. if (element1root.host) {
  1461. return findCommonOffsetParent(element1root.host, element2);
  1462. } else {
  1463. return findCommonOffsetParent(element1, getRoot(element2).host);
  1464. }
  1465. }
  1466. /**
  1467. * Gets the scroll value of the given element in the given side (top and left)
  1468. * @method
  1469. * @memberof Popper.Utils
  1470. * @argument {Element} element
  1471. * @argument {String} side `top` or `left`
  1472. * @returns {number} amount of scrolled pixels
  1473. */
  1474. function getScroll(element) {
  1475. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  1476. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  1477. var nodeName = element.nodeName;
  1478. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1479. var html = element.ownerDocument.documentElement;
  1480. var scrollingElement = element.ownerDocument.scrollingElement || html;
  1481. return scrollingElement[upperSide];
  1482. }
  1483. return element[upperSide];
  1484. }
  1485. /*
  1486. * Sum or subtract the element scroll values (left and top) from a given rect object
  1487. * @method
  1488. * @memberof Popper.Utils
  1489. * @param {Object} rect - Rect object you want to change
  1490. * @param {HTMLElement} element - The element from the function reads the scroll values
  1491. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  1492. * @return {Object} rect - The modifier rect object
  1493. */
  1494. function includeScroll(rect, element) {
  1495. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1496. var scrollTop = getScroll(element, 'top');
  1497. var scrollLeft = getScroll(element, 'left');
  1498. var modifier = subtract ? -1 : 1;
  1499. rect.top += scrollTop * modifier;
  1500. rect.bottom += scrollTop * modifier;
  1501. rect.left += scrollLeft * modifier;
  1502. rect.right += scrollLeft * modifier;
  1503. return rect;
  1504. }
  1505. /*
  1506. * Helper to detect borders of a given element
  1507. * @method
  1508. * @memberof Popper.Utils
  1509. * @param {CSSStyleDeclaration} styles
  1510. * Result of `getStyleComputedProperty` on the given element
  1511. * @param {String} axis - `x` or `y`
  1512. * @return {number} borders - The borders size of the given axis
  1513. */
  1514. function getBordersSize(styles, axis) {
  1515. var sideA = axis === 'x' ? 'Left' : 'Top';
  1516. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  1517. return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
  1518. }
  1519. function getSize(axis, body, html, computedStyle) {
  1520. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  1521. }
  1522. function getWindowSizes(document) {
  1523. var body = document.body;
  1524. var html = document.documentElement;
  1525. var computedStyle = isIE(10) && getComputedStyle(html);
  1526. return {
  1527. height: getSize('Height', body, html, computedStyle),
  1528. width: getSize('Width', body, html, computedStyle)
  1529. };
  1530. }
  1531. var classCallCheck = function (instance, Constructor) {
  1532. if (!(instance instanceof Constructor)) {
  1533. throw new TypeError("Cannot call a class as a function");
  1534. }
  1535. };
  1536. var createClass = function () {
  1537. function defineProperties(target, props) {
  1538. for (var i = 0; i < props.length; i++) {
  1539. var descriptor = props[i];
  1540. descriptor.enumerable = descriptor.enumerable || false;
  1541. descriptor.configurable = true;
  1542. if ("value" in descriptor) descriptor.writable = true;
  1543. Object.defineProperty(target, descriptor.key, descriptor);
  1544. }
  1545. }
  1546. return function (Constructor, protoProps, staticProps) {
  1547. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1548. if (staticProps) defineProperties(Constructor, staticProps);
  1549. return Constructor;
  1550. };
  1551. }();
  1552. var defineProperty = function (obj, key, value) {
  1553. if (key in obj) {
  1554. Object.defineProperty(obj, key, {
  1555. value: value,
  1556. enumerable: true,
  1557. configurable: true,
  1558. writable: true
  1559. });
  1560. } else {
  1561. obj[key] = value;
  1562. }
  1563. return obj;
  1564. };
  1565. var _extends = Object.assign || function (target) {
  1566. for (var i = 1; i < arguments.length; i++) {
  1567. var source = arguments[i];
  1568. for (var key in source) {
  1569. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1570. target[key] = source[key];
  1571. }
  1572. }
  1573. }
  1574. return target;
  1575. };
  1576. /**
  1577. * Given element offsets, generate an output similar to getBoundingClientRect
  1578. * @method
  1579. * @memberof Popper.Utils
  1580. * @argument {Object} offsets
  1581. * @returns {Object} ClientRect like output
  1582. */
  1583. function getClientRect(offsets) {
  1584. return _extends({}, offsets, {
  1585. right: offsets.left + offsets.width,
  1586. bottom: offsets.top + offsets.height
  1587. });
  1588. }
  1589. /**
  1590. * Get bounding client rect of given element
  1591. * @method
  1592. * @memberof Popper.Utils
  1593. * @param {HTMLElement} element
  1594. * @return {Object} client rect
  1595. */
  1596. function getBoundingClientRect(element) {
  1597. var rect = {};
  1598. // IE10 10 FIX: Please, don't ask, the element isn't
  1599. // considered in DOM in some circumstances...
  1600. // This isn't reproducible in IE10 compatibility mode of IE11
  1601. try {
  1602. if (isIE(10)) {
  1603. rect = element.getBoundingClientRect();
  1604. var scrollTop = getScroll(element, 'top');
  1605. var scrollLeft = getScroll(element, 'left');
  1606. rect.top += scrollTop;
  1607. rect.left += scrollLeft;
  1608. rect.bottom += scrollTop;
  1609. rect.right += scrollLeft;
  1610. } else {
  1611. rect = element.getBoundingClientRect();
  1612. }
  1613. } catch (e) {
  1614. }
  1615. var result = {
  1616. left: rect.left,
  1617. top: rect.top,
  1618. width: rect.right - rect.left,
  1619. height: rect.bottom - rect.top
  1620. };
  1621. // subtract scrollbar size from sizes
  1622. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  1623. var width = sizes.width || element.clientWidth || result.right - result.left;
  1624. var height = sizes.height || element.clientHeight || result.bottom - result.top;
  1625. var horizScrollbar = element.offsetWidth - width;
  1626. var vertScrollbar = element.offsetHeight - height;
  1627. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  1628. // we make this check conditional for performance reasons
  1629. if (horizScrollbar || vertScrollbar) {
  1630. var styles = getStyleComputedProperty(element);
  1631. horizScrollbar -= getBordersSize(styles, 'x');
  1632. vertScrollbar -= getBordersSize(styles, 'y');
  1633. result.width -= horizScrollbar;
  1634. result.height -= vertScrollbar;
  1635. }
  1636. return getClientRect(result);
  1637. }
  1638. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  1639. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1640. var isIE10 = isIE(10);
  1641. var isHTML = parent.nodeName === 'HTML';
  1642. var childrenRect = getBoundingClientRect(children);
  1643. var parentRect = getBoundingClientRect(parent);
  1644. var scrollParent = getScrollParent(children);
  1645. var styles = getStyleComputedProperty(parent);
  1646. var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
  1647. var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
  1648. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  1649. if (fixedPosition && isHTML) {
  1650. parentRect.top = Math.max(parentRect.top, 0);
  1651. parentRect.left = Math.max(parentRect.left, 0);
  1652. }
  1653. var offsets = getClientRect({
  1654. top: childrenRect.top - parentRect.top - borderTopWidth,
  1655. left: childrenRect.left - parentRect.left - borderLeftWidth,
  1656. width: childrenRect.width,
  1657. height: childrenRect.height
  1658. });
  1659. offsets.marginTop = 0;
  1660. offsets.marginLeft = 0;
  1661. // Subtract margins of documentElement in case it's being used as parent
  1662. // we do this only on HTML because it's the only element that behaves
  1663. // differently when margins are applied to it. The margins are included in
  1664. // the box of the documentElement, in the other cases not.
  1665. if (!isIE10 && isHTML) {
  1666. var marginTop = parseFloat(styles.marginTop, 10);
  1667. var marginLeft = parseFloat(styles.marginLeft, 10);
  1668. offsets.top -= borderTopWidth - marginTop;
  1669. offsets.bottom -= borderTopWidth - marginTop;
  1670. offsets.left -= borderLeftWidth - marginLeft;
  1671. offsets.right -= borderLeftWidth - marginLeft;
  1672. // Attach marginTop and marginLeft because in some circumstances we may need them
  1673. offsets.marginTop = marginTop;
  1674. offsets.marginLeft = marginLeft;
  1675. }
  1676. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  1677. offsets = includeScroll(offsets, parent);
  1678. }
  1679. return offsets;
  1680. }
  1681. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  1682. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1683. var html = element.ownerDocument.documentElement;
  1684. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  1685. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  1686. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  1687. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  1688. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  1689. var offset = {
  1690. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  1691. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  1692. width: width,
  1693. height: height
  1694. };
  1695. return getClientRect(offset);
  1696. }
  1697. /**
  1698. * Check if the given element is fixed or is inside a fixed parent
  1699. * @method
  1700. * @memberof Popper.Utils
  1701. * @argument {Element} element
  1702. * @argument {Element} customContainer
  1703. * @returns {Boolean} answer to "isFixed?"
  1704. */
  1705. function isFixed(element) {
  1706. var nodeName = element.nodeName;
  1707. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1708. return false;
  1709. }
  1710. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  1711. return true;
  1712. }
  1713. var parentNode = getParentNode(element);
  1714. if (!parentNode) {
  1715. return false;
  1716. }
  1717. return isFixed(parentNode);
  1718. }
  1719. /**
  1720. * Finds the first parent of an element that has a transformed property defined
  1721. * @method
  1722. * @memberof Popper.Utils
  1723. * @argument {Element} element
  1724. * @returns {Element} first transformed parent or documentElement
  1725. */
  1726. function getFixedPositionOffsetParent(element) {
  1727. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1728. if (!element || !element.parentElement || isIE()) {
  1729. return document.documentElement;
  1730. }
  1731. var el = element.parentElement;
  1732. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  1733. el = el.parentElement;
  1734. }
  1735. return el || document.documentElement;
  1736. }
  1737. /**
  1738. * Computed the boundaries limits and return them
  1739. * @method
  1740. * @memberof Popper.Utils
  1741. * @param {HTMLElement} popper
  1742. * @param {HTMLElement} reference
  1743. * @param {number} padding
  1744. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  1745. * @param {Boolean} fixedPosition - Is in fixed position mode
  1746. * @returns {Object} Coordinates of the boundaries
  1747. */
  1748. function getBoundaries(popper, reference, padding, boundariesElement) {
  1749. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1750. // NOTE: 1 DOM access here
  1751. var boundaries = {top: 0, left: 0};
  1752. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  1753. // Handle viewport case
  1754. if (boundariesElement === 'viewport') {
  1755. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  1756. } else {
  1757. // Handle other cases based on DOM element used as boundaries
  1758. var boundariesNode = void 0;
  1759. if (boundariesElement === 'scrollParent') {
  1760. boundariesNode = getScrollParent(getParentNode(reference));
  1761. if (boundariesNode.nodeName === 'BODY') {
  1762. boundariesNode = popper.ownerDocument.documentElement;
  1763. }
  1764. } else if (boundariesElement === 'window') {
  1765. boundariesNode = popper.ownerDocument.documentElement;
  1766. } else {
  1767. boundariesNode = boundariesElement;
  1768. }
  1769. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  1770. // In case of HTML, we need a different computation
  1771. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  1772. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  1773. height = _getWindowSizes.height,
  1774. width = _getWindowSizes.width;
  1775. boundaries.top += offsets.top - offsets.marginTop;
  1776. boundaries.bottom = height + offsets.top;
  1777. boundaries.left += offsets.left - offsets.marginLeft;
  1778. boundaries.right = width + offsets.left;
  1779. } else {
  1780. // for all the other DOM elements, this one is good
  1781. boundaries = offsets;
  1782. }
  1783. }
  1784. // Add paddings
  1785. padding = padding || 0;
  1786. var isPaddingNumber = typeof padding === 'number';
  1787. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  1788. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  1789. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  1790. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  1791. return boundaries;
  1792. }
  1793. function getArea(_ref) {
  1794. var width = _ref.width,
  1795. height = _ref.height;
  1796. return width * height;
  1797. }
  1798. /**
  1799. * Utility used to transform the `auto` placement to the placement with more
  1800. * available space.
  1801. * @method
  1802. * @memberof Popper.Utils
  1803. * @argument {Object} data - The data object generated by update method
  1804. * @argument {Object} options - Modifiers configuration and options
  1805. * @returns {Object} The data object, properly modified
  1806. */
  1807. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  1808. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  1809. if (placement.indexOf('auto') === -1) {
  1810. return placement;
  1811. }
  1812. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  1813. var rects = {
  1814. top: {
  1815. width: boundaries.width,
  1816. height: refRect.top - boundaries.top
  1817. },
  1818. right: {
  1819. width: boundaries.right - refRect.right,
  1820. height: boundaries.height
  1821. },
  1822. bottom: {
  1823. width: boundaries.width,
  1824. height: boundaries.bottom - refRect.bottom
  1825. },
  1826. left: {
  1827. width: refRect.left - boundaries.left,
  1828. height: boundaries.height
  1829. }
  1830. };
  1831. var sortedAreas = Object.keys(rects).map(function (key) {
  1832. return _extends({
  1833. key: key
  1834. }, rects[key], {
  1835. area: getArea(rects[key])
  1836. });
  1837. }).sort(function (a, b) {
  1838. return b.area - a.area;
  1839. });
  1840. var filteredAreas = sortedAreas.filter(function (_ref2) {
  1841. var width = _ref2.width,
  1842. height = _ref2.height;
  1843. return width >= popper.clientWidth && height >= popper.clientHeight;
  1844. });
  1845. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  1846. var variation = placement.split('-')[1];
  1847. return computedPlacement + (variation ? '-' + variation : '');
  1848. }
  1849. /**
  1850. * Get offsets to the reference element
  1851. * @method
  1852. * @memberof Popper.Utils
  1853. * @param {Object} state
  1854. * @param {Element} popper - the popper element
  1855. * @param {Element} reference - the reference element (the popper will be relative to this)
  1856. * @param {Element} fixedPosition - is in fixed position mode
  1857. * @returns {Object} An object containing the offsets which will be applied to the popper
  1858. */
  1859. function getReferenceOffsets(state, popper, reference) {
  1860. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  1861. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  1862. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  1863. }
  1864. /**
  1865. * Get the outer sizes of the given element (offset size + margins)
  1866. * @method
  1867. * @memberof Popper.Utils
  1868. * @argument {Element} element
  1869. * @returns {Object} object containing width and height properties
  1870. */
  1871. function getOuterSizes(element) {
  1872. var window = element.ownerDocument.defaultView;
  1873. var styles = window.getComputedStyle(element);
  1874. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  1875. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  1876. var result = {
  1877. width: element.offsetWidth + y,
  1878. height: element.offsetHeight + x
  1879. };
  1880. return result;
  1881. }
  1882. /**
  1883. * Get the opposite placement of the given one
  1884. * @method
  1885. * @memberof Popper.Utils
  1886. * @argument {String} placement
  1887. * @returns {String} flipped placement
  1888. */
  1889. function getOppositePlacement(placement) {
  1890. var hash = {left: 'right', right: 'left', bottom: 'top', top: 'bottom'};
  1891. return placement.replace(/left|right|bottom|top/g, function (matched) {
  1892. return hash[matched];
  1893. });
  1894. }
  1895. /**
  1896. * Get offsets to the popper
  1897. * @method
  1898. * @memberof Popper.Utils
  1899. * @param {Object} position - CSS position the Popper will get applied
  1900. * @param {HTMLElement} popper - the popper element
  1901. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  1902. * @param {String} placement - one of the valid placement options
  1903. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  1904. */
  1905. function getPopperOffsets(popper, referenceOffsets, placement) {
  1906. placement = placement.split('-')[0];
  1907. // Get popper node sizes
  1908. var popperRect = getOuterSizes(popper);
  1909. // Add position, width and height to our offsets object
  1910. var popperOffsets = {
  1911. width: popperRect.width,
  1912. height: popperRect.height
  1913. };
  1914. // depending by the popper placement we have to compute its offsets slightly differently
  1915. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  1916. var mainSide = isHoriz ? 'top' : 'left';
  1917. var secondarySide = isHoriz ? 'left' : 'top';
  1918. var measurement = isHoriz ? 'height' : 'width';
  1919. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  1920. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  1921. if (placement === secondarySide) {
  1922. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  1923. } else {
  1924. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  1925. }
  1926. return popperOffsets;
  1927. }
  1928. /**
  1929. * Mimics the `find` method of Array
  1930. * @method
  1931. * @memberof Popper.Utils
  1932. * @argument {Array} arr
  1933. * @argument prop
  1934. * @argument value
  1935. * @returns index or -1
  1936. */
  1937. function find(arr, check) {
  1938. // use native find if supported
  1939. if (Array.prototype.find) {
  1940. return arr.find(check);
  1941. }
  1942. // use `filter` to obtain the same behavior of `find`
  1943. return arr.filter(check)[0];
  1944. }
  1945. /**
  1946. * Return the index of the matching object
  1947. * @method
  1948. * @memberof Popper.Utils
  1949. * @argument {Array} arr
  1950. * @argument prop
  1951. * @argument value
  1952. * @returns index or -1
  1953. */
  1954. function findIndex(arr, prop, value) {
  1955. // use native findIndex if supported
  1956. if (Array.prototype.findIndex) {
  1957. return arr.findIndex(function (cur) {
  1958. return cur[prop] === value;
  1959. });
  1960. }
  1961. // use `find` + `indexOf` if `findIndex` isn't supported
  1962. var match = find(arr, function (obj) {
  1963. return obj[prop] === value;
  1964. });
  1965. return arr.indexOf(match);
  1966. }
  1967. /**
  1968. * Loop trough the list of modifiers and run them in order,
  1969. * each of them will then edit the data object.
  1970. * @method
  1971. * @memberof Popper.Utils
  1972. * @param {dataObject} data
  1973. * @param {Array} modifiers
  1974. * @param {String} ends - Optional modifier name used as stopper
  1975. * @returns {dataObject}
  1976. */
  1977. function runModifiers(modifiers, data, ends) {
  1978. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  1979. modifiersToRun.forEach(function (modifier) {
  1980. if (modifier['function']) {
  1981. // eslint-disable-line dot-notation
  1982. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  1983. }
  1984. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  1985. if (modifier.enabled && isFunction(fn)) {
  1986. // Add properties to offsets to make them a complete clientRect object
  1987. // we do this before each modifier to make sure the previous one doesn't
  1988. // mess with these values
  1989. data.offsets.popper = getClientRect(data.offsets.popper);
  1990. data.offsets.reference = getClientRect(data.offsets.reference);
  1991. data = fn(data, modifier);
  1992. }
  1993. });
  1994. return data;
  1995. }
  1996. /**
  1997. * Updates the position of the popper, computing the new offsets and applying
  1998. * the new style.<br />
  1999. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  2000. * @method
  2001. * @memberof Popper
  2002. */
  2003. function update() {
  2004. // if popper is destroyed, don't perform any further update
  2005. if (this.state.isDestroyed) {
  2006. return;
  2007. }
  2008. var data = {
  2009. instance: this,
  2010. styles: {},
  2011. arrowStyles: {},
  2012. attributes: {},
  2013. flipped: false,
  2014. offsets: {}
  2015. };
  2016. // compute reference element offsets
  2017. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  2018. // compute auto placement, store placement inside the data object,
  2019. // modifiers will be able to edit `placement` if needed
  2020. // and refer to originalPlacement to know the original value
  2021. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  2022. // store the computed placement inside `originalPlacement`
  2023. data.originalPlacement = data.placement;
  2024. data.positionFixed = this.options.positionFixed;
  2025. // compute the popper offsets
  2026. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  2027. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  2028. // run the modifiers
  2029. data = runModifiers(this.modifiers, data);
  2030. // the first `update` will call `onCreate` callback
  2031. // the other ones will call `onUpdate` callback
  2032. if (!this.state.isCreated) {
  2033. this.state.isCreated = true;
  2034. this.options.onCreate(data);
  2035. } else {
  2036. this.options.onUpdate(data);
  2037. }
  2038. }
  2039. /**
  2040. * Helper used to know if the given modifier is enabled.
  2041. * @method
  2042. * @memberof Popper.Utils
  2043. * @returns {Boolean}
  2044. */
  2045. function isModifierEnabled(modifiers, modifierName) {
  2046. return modifiers.some(function (_ref) {
  2047. var name = _ref.name,
  2048. enabled = _ref.enabled;
  2049. return enabled && name === modifierName;
  2050. });
  2051. }
  2052. /**
  2053. * Get the prefixed supported property name
  2054. * @method
  2055. * @memberof Popper.Utils
  2056. * @argument {String} property (camelCase)
  2057. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  2058. */
  2059. function getSupportedPropertyName(property) {
  2060. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  2061. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  2062. for (var i = 0; i < prefixes.length; i++) {
  2063. var prefix = prefixes[i];
  2064. var toCheck = prefix ? '' + prefix + upperProp : property;
  2065. if (typeof document.body.style[toCheck] !== 'undefined') {
  2066. return toCheck;
  2067. }
  2068. }
  2069. return null;
  2070. }
  2071. /**
  2072. * Destroys the popper.
  2073. * @method
  2074. * @memberof Popper
  2075. */
  2076. function destroy() {
  2077. this.state.isDestroyed = true;
  2078. // touch DOM only if `applyStyle` modifier is enabled
  2079. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  2080. this.popper.removeAttribute('x-placement');
  2081. this.popper.style.position = '';
  2082. this.popper.style.top = '';
  2083. this.popper.style.left = '';
  2084. this.popper.style.right = '';
  2085. this.popper.style.bottom = '';
  2086. this.popper.style.willChange = '';
  2087. this.popper.style[getSupportedPropertyName('transform')] = '';
  2088. }
  2089. this.disableEventListeners();
  2090. // remove the popper if user explicity asked for the deletion on destroy
  2091. // do not use `remove` because IE11 doesn't support it
  2092. if (this.options.removeOnDestroy) {
  2093. this.popper.parentNode.removeChild(this.popper);
  2094. }
  2095. return this;
  2096. }
  2097. /**
  2098. * Get the window associated with the element
  2099. * @argument {Element} element
  2100. * @returns {Window}
  2101. */
  2102. function getWindow(element) {
  2103. var ownerDocument = element.ownerDocument;
  2104. return ownerDocument ? ownerDocument.defaultView : window;
  2105. }
  2106. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  2107. var isBody = scrollParent.nodeName === 'BODY';
  2108. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  2109. target.addEventListener(event, callback, {passive: true});
  2110. if (!isBody) {
  2111. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  2112. }
  2113. scrollParents.push(target);
  2114. }
  2115. /**
  2116. * Setup needed event listeners used to update the popper position
  2117. * @method
  2118. * @memberof Popper.Utils
  2119. * @private
  2120. */
  2121. function setupEventListeners(reference, options, state, updateBound) {
  2122. // Resize event listener on window
  2123. state.updateBound = updateBound;
  2124. getWindow(reference).addEventListener('resize', state.updateBound, {passive: true});
  2125. // Scroll event listener on scroll parents
  2126. var scrollElement = getScrollParent(reference);
  2127. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  2128. state.scrollElement = scrollElement;
  2129. state.eventsEnabled = true;
  2130. return state;
  2131. }
  2132. /**
  2133. * It will add resize/scroll events and start recalculating
  2134. * position of the popper element when they are triggered.
  2135. * @method
  2136. * @memberof Popper
  2137. */
  2138. function enableEventListeners() {
  2139. if (!this.state.eventsEnabled) {
  2140. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  2141. }
  2142. }
  2143. /**
  2144. * Remove event listeners used to update the popper position
  2145. * @method
  2146. * @memberof Popper.Utils
  2147. * @private
  2148. */
  2149. function removeEventListeners(reference, state) {
  2150. // Remove resize event listener on window
  2151. getWindow(reference).removeEventListener('resize', state.updateBound);
  2152. // Remove scroll event listener on scroll parents
  2153. state.scrollParents.forEach(function (target) {
  2154. target.removeEventListener('scroll', state.updateBound);
  2155. });
  2156. // Reset state
  2157. state.updateBound = null;
  2158. state.scrollParents = [];
  2159. state.scrollElement = null;
  2160. state.eventsEnabled = false;
  2161. return state;
  2162. }
  2163. /**
  2164. * It will remove resize/scroll events and won't recalculate popper position
  2165. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  2166. * unless you call `update` method manually.
  2167. * @method
  2168. * @memberof Popper
  2169. */
  2170. function disableEventListeners() {
  2171. if (this.state.eventsEnabled) {
  2172. cancelAnimationFrame(this.scheduleUpdate);
  2173. this.state = removeEventListeners(this.reference, this.state);
  2174. }
  2175. }
  2176. /**
  2177. * Tells if a given input is a number
  2178. * @method
  2179. * @memberof Popper.Utils
  2180. * @param {*} input to check
  2181. * @return {Boolean}
  2182. */
  2183. function isNumeric(n) {
  2184. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  2185. }
  2186. /**
  2187. * Set the style to the given popper
  2188. * @method
  2189. * @memberof Popper.Utils
  2190. * @argument {Element} element - Element to apply the style to
  2191. * @argument {Object} styles
  2192. * Object with a list of properties and values which will be applied to the element
  2193. */
  2194. function setStyles(element, styles) {
  2195. Object.keys(styles).forEach(function (prop) {
  2196. var unit = '';
  2197. // add unit if the value is numeric and is one of the following
  2198. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  2199. unit = 'px';
  2200. }
  2201. element.style[prop] = styles[prop] + unit;
  2202. });
  2203. }
  2204. /**
  2205. * Set the attributes to the given popper
  2206. * @method
  2207. * @memberof Popper.Utils
  2208. * @argument {Element} element - Element to apply the attributes to
  2209. * @argument {Object} styles
  2210. * Object with a list of properties and values which will be applied to the element
  2211. */
  2212. function setAttributes(element, attributes) {
  2213. Object.keys(attributes).forEach(function (prop) {
  2214. var value = attributes[prop];
  2215. if (value !== false) {
  2216. element.setAttribute(prop, attributes[prop]);
  2217. } else {
  2218. element.removeAttribute(prop);
  2219. }
  2220. });
  2221. }
  2222. /**
  2223. * @function
  2224. * @memberof Modifiers
  2225. * @argument {Object} data - The data object generated by `update` method
  2226. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  2227. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  2228. * @argument {Object} options - Modifiers configuration and options
  2229. * @returns {Object} The same data object
  2230. */
  2231. function applyStyle(data) {
  2232. // any property present in `data.styles` will be applied to the popper,
  2233. // in this way we can make the 3rd party modifiers add custom styles to it
  2234. // Be aware, modifiers could override the properties defined in the previous
  2235. // lines of this modifier!
  2236. setStyles(data.instance.popper, data.styles);
  2237. // any property present in `data.attributes` will be applied to the popper,
  2238. // they will be set as HTML attributes of the element
  2239. setAttributes(data.instance.popper, data.attributes);
  2240. // if arrowElement is defined and arrowStyles has some properties
  2241. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  2242. setStyles(data.arrowElement, data.arrowStyles);
  2243. }
  2244. return data;
  2245. }
  2246. /**
  2247. * Set the x-placement attribute before everything else because it could be used
  2248. * to add margins to the popper margins needs to be calculated to get the
  2249. * correct popper offsets.
  2250. * @method
  2251. * @memberof Popper.modifiers
  2252. * @param {HTMLElement} reference - The reference element used to position the popper
  2253. * @param {HTMLElement} popper - The HTML element used as popper
  2254. * @param {Object} options - Popper.js options
  2255. */
  2256. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  2257. // compute reference element offsets
  2258. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  2259. // compute auto placement, store placement inside the data object,
  2260. // modifiers will be able to edit `placement` if needed
  2261. // and refer to originalPlacement to know the original value
  2262. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  2263. popper.setAttribute('x-placement', placement);
  2264. // Apply `position` to popper before anything else because
  2265. // without the position applied we can't guarantee correct computations
  2266. setStyles(popper, {position: options.positionFixed ? 'fixed' : 'absolute'});
  2267. return options;
  2268. }
  2269. /**
  2270. * @function
  2271. * @memberof Popper.Utils
  2272. * @argument {Object} data - The data object generated by `update` method
  2273. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  2274. * @returns {Object} The popper's position offsets rounded
  2275. *
  2276. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  2277. * good as it can be within reason.
  2278. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  2279. *
  2280. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  2281. * as well on High DPI screens).
  2282. *
  2283. * Firefox prefers no rounding for positioning and does not have blurriness on
  2284. * high DPI screens.
  2285. *
  2286. * Only horizontal placement and left/right values need to be considered.
  2287. */
  2288. function getRoundedOffsets(data, shouldRound) {
  2289. var _data$offsets = data.offsets,
  2290. popper = _data$offsets.popper,
  2291. reference = _data$offsets.reference;
  2292. var round = Math.round,
  2293. floor = Math.floor;
  2294. var noRound = function noRound(v) {
  2295. return v;
  2296. };
  2297. var referenceWidth = round(reference.width);
  2298. var popperWidth = round(popper.width);
  2299. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  2300. var isVariation = data.placement.indexOf('-') !== -1;
  2301. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  2302. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  2303. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  2304. var verticalToInteger = !shouldRound ? noRound : round;
  2305. return {
  2306. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  2307. top: verticalToInteger(popper.top),
  2308. bottom: verticalToInteger(popper.bottom),
  2309. right: horizontalToInteger(popper.right)
  2310. };
  2311. }
  2312. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  2313. /**
  2314. * @function
  2315. * @memberof Modifiers
  2316. * @argument {Object} data - The data object generated by `update` method
  2317. * @argument {Object} options - Modifiers configuration and options
  2318. * @returns {Object} The data object, properly modified
  2319. */
  2320. function computeStyle(data, options) {
  2321. var x = options.x,
  2322. y = options.y;
  2323. var popper = data.offsets.popper;
  2324. // Remove this legacy support in Popper.js v2
  2325. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  2326. return modifier.name === 'applyStyle';
  2327. }).gpuAcceleration;
  2328. if (legacyGpuAccelerationOption !== undefined) {
  2329. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  2330. }
  2331. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  2332. var offsetParent = getOffsetParent(data.instance.popper);
  2333. var offsetParentRect = getBoundingClientRect(offsetParent);
  2334. // Styles
  2335. var styles = {
  2336. position: popper.position
  2337. };
  2338. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  2339. var sideA = x === 'bottom' ? 'top' : 'bottom';
  2340. var sideB = y === 'right' ? 'left' : 'right';
  2341. // if gpuAcceleration is set to `true` and transform is supported,
  2342. // we use `translate3d` to apply the position to the popper we
  2343. // automatically use the supported prefixed version if needed
  2344. var prefixedProperty = getSupportedPropertyName('transform');
  2345. // now, let's make a step back and look at this code closely (wtf?)
  2346. // If the content of the popper grows once it's been positioned, it
  2347. // may happen that the popper gets misplaced because of the new content
  2348. // overflowing its reference element
  2349. // To avoid this problem, we provide two options (x and y), which allow
  2350. // the consumer to define the offset origin.
  2351. // If we position a popper on top of a reference element, we can set
  2352. // `x` to `top` to make the popper grow towards its top instead of
  2353. // its bottom.
  2354. var left = void 0,
  2355. top = void 0;
  2356. if (sideA === 'bottom') {
  2357. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  2358. // and not the bottom of the html element
  2359. if (offsetParent.nodeName === 'HTML') {
  2360. top = -offsetParent.clientHeight + offsets.bottom;
  2361. } else {
  2362. top = -offsetParentRect.height + offsets.bottom;
  2363. }
  2364. } else {
  2365. top = offsets.top;
  2366. }
  2367. if (sideB === 'right') {
  2368. if (offsetParent.nodeName === 'HTML') {
  2369. left = -offsetParent.clientWidth + offsets.right;
  2370. } else {
  2371. left = -offsetParentRect.width + offsets.right;
  2372. }
  2373. } else {
  2374. left = offsets.left;
  2375. }
  2376. if (gpuAcceleration && prefixedProperty) {
  2377. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  2378. styles[sideA] = 0;
  2379. styles[sideB] = 0;
  2380. styles.willChange = 'transform';
  2381. } else {
  2382. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  2383. var invertTop = sideA === 'bottom' ? -1 : 1;
  2384. var invertLeft = sideB === 'right' ? -1 : 1;
  2385. styles[sideA] = top * invertTop;
  2386. styles[sideB] = left * invertLeft;
  2387. styles.willChange = sideA + ', ' + sideB;
  2388. }
  2389. // Attributes
  2390. var attributes = {
  2391. 'x-placement': data.placement
  2392. };
  2393. // Update `data` attributes, styles and arrowStyles
  2394. data.attributes = _extends({}, attributes, data.attributes);
  2395. data.styles = _extends({}, styles, data.styles);
  2396. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  2397. return data;
  2398. }
  2399. /**
  2400. * Helper used to know if the given modifier depends from another one.<br />
  2401. * It checks if the needed modifier is listed and enabled.
  2402. * @method
  2403. * @memberof Popper.Utils
  2404. * @param {Array} modifiers - list of modifiers
  2405. * @param {String} requestingName - name of requesting modifier
  2406. * @param {String} requestedName - name of requested modifier
  2407. * @returns {Boolean}
  2408. */
  2409. function isModifierRequired(modifiers, requestingName, requestedName) {
  2410. var requesting = find(modifiers, function (_ref) {
  2411. var name = _ref.name;
  2412. return name === requestingName;
  2413. });
  2414. var isRequired = !!requesting && modifiers.some(function (modifier) {
  2415. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  2416. });
  2417. if (!isRequired) {
  2418. var _requesting = '`' + requestingName + '`';
  2419. var requested = '`' + requestedName + '`';
  2420. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  2421. }
  2422. return isRequired;
  2423. }
  2424. /**
  2425. * @function
  2426. * @memberof Modifiers
  2427. * @argument {Object} data - The data object generated by update method
  2428. * @argument {Object} options - Modifiers configuration and options
  2429. * @returns {Object} The data object, properly modified
  2430. */
  2431. function arrow(data, options) {
  2432. var _data$offsets$arrow;
  2433. // arrow depends on keepTogether in order to work
  2434. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  2435. return data;
  2436. }
  2437. var arrowElement = options.element;
  2438. // if arrowElement is a string, suppose it's a CSS selector
  2439. if (typeof arrowElement === 'string') {
  2440. arrowElement = data.instance.popper.querySelector(arrowElement);
  2441. // if arrowElement is not found, don't run the modifier
  2442. if (!arrowElement) {
  2443. return data;
  2444. }
  2445. } else {
  2446. // if the arrowElement isn't a query selector we must check that the
  2447. // provided DOM node is child of its popper node
  2448. if (!data.instance.popper.contains(arrowElement)) {
  2449. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  2450. return data;
  2451. }
  2452. }
  2453. var placement = data.placement.split('-')[0];
  2454. var _data$offsets = data.offsets,
  2455. popper = _data$offsets.popper,
  2456. reference = _data$offsets.reference;
  2457. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  2458. var len = isVertical ? 'height' : 'width';
  2459. var sideCapitalized = isVertical ? 'Top' : 'Left';
  2460. var side = sideCapitalized.toLowerCase();
  2461. var altSide = isVertical ? 'left' : 'top';
  2462. var opSide = isVertical ? 'bottom' : 'right';
  2463. var arrowElementSize = getOuterSizes(arrowElement)[len];
  2464. //
  2465. // extends keepTogether behavior making sure the popper and its
  2466. // reference have enough pixels in conjunction
  2467. //
  2468. // top/left side
  2469. if (reference[opSide] - arrowElementSize < popper[side]) {
  2470. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  2471. }
  2472. // bottom/right side
  2473. if (reference[side] + arrowElementSize > popper[opSide]) {
  2474. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  2475. }
  2476. data.offsets.popper = getClientRect(data.offsets.popper);
  2477. // compute center of the popper
  2478. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  2479. // Compute the sideValue using the updated popper offsets
  2480. // take popper margin in account because we don't have this info available
  2481. var css = getStyleComputedProperty(data.instance.popper);
  2482. var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
  2483. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
  2484. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  2485. // prevent arrowElement from being placed not contiguously to its popper
  2486. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  2487. data.arrowElement = arrowElement;
  2488. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  2489. return data;
  2490. }
  2491. /**
  2492. * Get the opposite placement variation of the given one
  2493. * @method
  2494. * @memberof Popper.Utils
  2495. * @argument {String} placement variation
  2496. * @returns {String} flipped placement variation
  2497. */
  2498. function getOppositeVariation(variation) {
  2499. if (variation === 'end') {
  2500. return 'start';
  2501. } else if (variation === 'start') {
  2502. return 'end';
  2503. }
  2504. return variation;
  2505. }
  2506. /**
  2507. * List of accepted placements to use as values of the `placement` option.<br />
  2508. * Valid placements are:
  2509. * - `auto`
  2510. * - `top`
  2511. * - `right`
  2512. * - `bottom`
  2513. * - `left`
  2514. *
  2515. * Each placement can have a variation from this list:
  2516. * - `-start`
  2517. * - `-end`
  2518. *
  2519. * Variations are interpreted easily if you think of them as the left to right
  2520. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  2521. * is right.<br />
  2522. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  2523. *
  2524. * Some valid examples are:
  2525. * - `top-end` (on top of reference, right aligned)
  2526. * - `right-start` (on right of reference, top aligned)
  2527. * - `bottom` (on bottom, centered)
  2528. * - `auto-end` (on the side with more space available, alignment depends by placement)
  2529. *
  2530. * @static
  2531. * @type {Array}
  2532. * @enum {String}
  2533. * @readonly
  2534. * @method placements
  2535. * @memberof Popper
  2536. */
  2537. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  2538. // Get rid of `auto` `auto-start` and `auto-end`
  2539. var validPlacements = placements.slice(3);
  2540. /**
  2541. * Given an initial placement, returns all the subsequent placements
  2542. * clockwise (or counter-clockwise).
  2543. *
  2544. * @method
  2545. * @memberof Popper.Utils
  2546. * @argument {String} placement - A valid placement (it accepts variations)
  2547. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  2548. * @returns {Array} placements including their variations
  2549. */
  2550. function clockwise(placement) {
  2551. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2552. var index = validPlacements.indexOf(placement);
  2553. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  2554. return counter ? arr.reverse() : arr;
  2555. }
  2556. var BEHAVIORS = {
  2557. FLIP: 'flip',
  2558. CLOCKWISE: 'clockwise',
  2559. COUNTERCLOCKWISE: 'counterclockwise'
  2560. };
  2561. /**
  2562. * @function
  2563. * @memberof Modifiers
  2564. * @argument {Object} data - The data object generated by update method
  2565. * @argument {Object} options - Modifiers configuration and options
  2566. * @returns {Object} The data object, properly modified
  2567. */
  2568. function flip(data, options) {
  2569. // if `inner` modifier is enabled, we can't use the `flip` modifier
  2570. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  2571. return data;
  2572. }
  2573. if (data.flipped && data.placement === data.originalPlacement) {
  2574. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  2575. return data;
  2576. }
  2577. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  2578. var placement = data.placement.split('-')[0];
  2579. var placementOpposite = getOppositePlacement(placement);
  2580. var variation = data.placement.split('-')[1] || '';
  2581. var flipOrder = [];
  2582. switch (options.behavior) {
  2583. case BEHAVIORS.FLIP:
  2584. flipOrder = [placement, placementOpposite];
  2585. break;
  2586. case BEHAVIORS.CLOCKWISE:
  2587. flipOrder = clockwise(placement);
  2588. break;
  2589. case BEHAVIORS.COUNTERCLOCKWISE:
  2590. flipOrder = clockwise(placement, true);
  2591. break;
  2592. default:
  2593. flipOrder = options.behavior;
  2594. }
  2595. flipOrder.forEach(function (step, index) {
  2596. if (placement !== step || flipOrder.length === index + 1) {
  2597. return data;
  2598. }
  2599. placement = data.placement.split('-')[0];
  2600. placementOpposite = getOppositePlacement(placement);
  2601. var popperOffsets = data.offsets.popper;
  2602. var refOffsets = data.offsets.reference;
  2603. // using floor because the reference offsets may contain decimals we are not going to consider here
  2604. var floor = Math.floor;
  2605. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  2606. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  2607. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  2608. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  2609. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  2610. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  2611. // flip the variation if required
  2612. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2613. var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  2614. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  2615. // this boolean to detect any flip loop
  2616. data.flipped = true;
  2617. if (overlapsRef || overflowsBoundaries) {
  2618. placement = flipOrder[index + 1];
  2619. }
  2620. if (flippedVariation) {
  2621. variation = getOppositeVariation(variation);
  2622. }
  2623. data.placement = placement + (variation ? '-' + variation : '');
  2624. // this object contains `position`, we want to preserve it along with
  2625. // any additional property we may add in the future
  2626. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  2627. data = runModifiers(data.instance.modifiers, data, 'flip');
  2628. }
  2629. });
  2630. return data;
  2631. }
  2632. /**
  2633. * @function
  2634. * @memberof Modifiers
  2635. * @argument {Object} data - The data object generated by update method
  2636. * @argument {Object} options - Modifiers configuration and options
  2637. * @returns {Object} The data object, properly modified
  2638. */
  2639. function keepTogether(data) {
  2640. var _data$offsets = data.offsets,
  2641. popper = _data$offsets.popper,
  2642. reference = _data$offsets.reference;
  2643. var placement = data.placement.split('-')[0];
  2644. var floor = Math.floor;
  2645. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2646. var side = isVertical ? 'right' : 'bottom';
  2647. var opSide = isVertical ? 'left' : 'top';
  2648. var measurement = isVertical ? 'width' : 'height';
  2649. if (popper[side] < floor(reference[opSide])) {
  2650. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  2651. }
  2652. if (popper[opSide] > floor(reference[side])) {
  2653. data.offsets.popper[opSide] = floor(reference[side]);
  2654. }
  2655. return data;
  2656. }
  2657. /**
  2658. * Converts a string containing value + unit into a px value number
  2659. * @function
  2660. * @memberof {modifiers~offset}
  2661. * @private
  2662. * @argument {String} str - Value + unit string
  2663. * @argument {String} measurement - `height` or `width`
  2664. * @argument {Object} popperOffsets
  2665. * @argument {Object} referenceOffsets
  2666. * @returns {Number|String}
  2667. * Value in pixels, or original string if no values were extracted
  2668. */
  2669. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  2670. // separate value from unit
  2671. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  2672. var value = +split[1];
  2673. var unit = split[2];
  2674. // If it's not a number it's an operator, I guess
  2675. if (!value) {
  2676. return str;
  2677. }
  2678. if (unit.indexOf('%') === 0) {
  2679. var element = void 0;
  2680. switch (unit) {
  2681. case '%p':
  2682. element = popperOffsets;
  2683. break;
  2684. case '%':
  2685. case '%r':
  2686. default:
  2687. element = referenceOffsets;
  2688. }
  2689. var rect = getClientRect(element);
  2690. return rect[measurement] / 100 * value;
  2691. } else if (unit === 'vh' || unit === 'vw') {
  2692. // if is a vh or vw, we calculate the size based on the viewport
  2693. var size = void 0;
  2694. if (unit === 'vh') {
  2695. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  2696. } else {
  2697. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  2698. }
  2699. return size / 100 * value;
  2700. } else {
  2701. // if is an explicit pixel unit, we get rid of the unit and keep the value
  2702. // if is an implicit unit, it's px, and we return just the value
  2703. return value;
  2704. }
  2705. }
  2706. /**
  2707. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  2708. * @function
  2709. * @memberof {modifiers~offset}
  2710. * @private
  2711. * @argument {String} offset
  2712. * @argument {Object} popperOffsets
  2713. * @argument {Object} referenceOffsets
  2714. * @argument {String} basePlacement
  2715. * @returns {Array} a two cells array with x and y offsets in numbers
  2716. */
  2717. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  2718. var offsets = [0, 0];
  2719. // Use height if placement is left or right and index is 0 otherwise use width
  2720. // in this way the first offset will use an axis and the second one
  2721. // will use the other one
  2722. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  2723. // Split the offset string to obtain a list of values and operands
  2724. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  2725. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  2726. return frag.trim();
  2727. });
  2728. // Detect if the offset string contains a pair of values or a single one
  2729. // they could be separated by comma or space
  2730. var divider = fragments.indexOf(find(fragments, function (frag) {
  2731. return frag.search(/,|\s/) !== -1;
  2732. }));
  2733. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  2734. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  2735. }
  2736. // If divider is found, we divide the list of values and operands to divide
  2737. // them by ofset X and Y.
  2738. var splitRegex = /\s*,\s*|\s+/;
  2739. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  2740. // Convert the values with units to absolute pixels to allow our computations
  2741. ops = ops.map(function (op, index) {
  2742. // Most of the units rely on the orientation of the popper
  2743. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  2744. var mergeWithPrevious = false;
  2745. return op
  2746. // This aggregates any `+` or `-` sign that aren't considered operators
  2747. // e.g.: 10 + +5 => [10, +, +5]
  2748. .reduce(function (a, b) {
  2749. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  2750. a[a.length - 1] = b;
  2751. mergeWithPrevious = true;
  2752. return a;
  2753. } else if (mergeWithPrevious) {
  2754. a[a.length - 1] += b;
  2755. mergeWithPrevious = false;
  2756. return a;
  2757. } else {
  2758. return a.concat(b);
  2759. }
  2760. }, [])
  2761. // Here we convert the string values into number values (in px)
  2762. .map(function (str) {
  2763. return toValue(str, measurement, popperOffsets, referenceOffsets);
  2764. });
  2765. });
  2766. // Loop trough the offsets arrays and execute the operations
  2767. ops.forEach(function (op, index) {
  2768. op.forEach(function (frag, index2) {
  2769. if (isNumeric(frag)) {
  2770. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  2771. }
  2772. });
  2773. });
  2774. return offsets;
  2775. }
  2776. /**
  2777. * @function
  2778. * @memberof Modifiers
  2779. * @argument {Object} data - The data object generated by update method
  2780. * @argument {Object} options - Modifiers configuration and options
  2781. * @argument {Number|String} options.offset=0
  2782. * The offset value as described in the modifier description
  2783. * @returns {Object} The data object, properly modified
  2784. */
  2785. function offset(data, _ref) {
  2786. var offset = _ref.offset;
  2787. var placement = data.placement,
  2788. _data$offsets = data.offsets,
  2789. popper = _data$offsets.popper,
  2790. reference = _data$offsets.reference;
  2791. var basePlacement = placement.split('-')[0];
  2792. var offsets = void 0;
  2793. if (isNumeric(+offset)) {
  2794. offsets = [+offset, 0];
  2795. } else {
  2796. offsets = parseOffset(offset, popper, reference, basePlacement);
  2797. }
  2798. if (basePlacement === 'left') {
  2799. popper.top += offsets[0];
  2800. popper.left -= offsets[1];
  2801. } else if (basePlacement === 'right') {
  2802. popper.top += offsets[0];
  2803. popper.left += offsets[1];
  2804. } else if (basePlacement === 'top') {
  2805. popper.left += offsets[0];
  2806. popper.top -= offsets[1];
  2807. } else if (basePlacement === 'bottom') {
  2808. popper.left += offsets[0];
  2809. popper.top += offsets[1];
  2810. }
  2811. data.popper = popper;
  2812. return data;
  2813. }
  2814. /**
  2815. * @function
  2816. * @memberof Modifiers
  2817. * @argument {Object} data - The data object generated by `update` method
  2818. * @argument {Object} options - Modifiers configuration and options
  2819. * @returns {Object} The data object, properly modified
  2820. */
  2821. function preventOverflow(data, options) {
  2822. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  2823. // If offsetParent is the reference element, we really want to
  2824. // go one step up and use the next offsetParent as reference to
  2825. // avoid to make this modifier completely useless and look like broken
  2826. if (data.instance.reference === boundariesElement) {
  2827. boundariesElement = getOffsetParent(boundariesElement);
  2828. }
  2829. // NOTE: DOM access here
  2830. // resets the popper's position so that the document size can be calculated excluding
  2831. // the size of the popper element itself
  2832. var transformProp = getSupportedPropertyName('transform');
  2833. var popperStyles = data.instance.popper.style; // assignment to help minification
  2834. var top = popperStyles.top,
  2835. left = popperStyles.left,
  2836. transform = popperStyles[transformProp];
  2837. popperStyles.top = '';
  2838. popperStyles.left = '';
  2839. popperStyles[transformProp] = '';
  2840. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  2841. // NOTE: DOM access here
  2842. // restores the original style properties after the offsets have been computed
  2843. popperStyles.top = top;
  2844. popperStyles.left = left;
  2845. popperStyles[transformProp] = transform;
  2846. options.boundaries = boundaries;
  2847. var order = options.priority;
  2848. var popper = data.offsets.popper;
  2849. var check = {
  2850. primary: function primary(placement) {
  2851. var value = popper[placement];
  2852. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  2853. value = Math.max(popper[placement], boundaries[placement]);
  2854. }
  2855. return defineProperty({}, placement, value);
  2856. },
  2857. secondary: function secondary(placement) {
  2858. var mainSide = placement === 'right' ? 'left' : 'top';
  2859. var value = popper[mainSide];
  2860. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  2861. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  2862. }
  2863. return defineProperty({}, mainSide, value);
  2864. }
  2865. };
  2866. order.forEach(function (placement) {
  2867. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  2868. popper = _extends({}, popper, check[side](placement));
  2869. });
  2870. data.offsets.popper = popper;
  2871. return data;
  2872. }
  2873. /**
  2874. * @function
  2875. * @memberof Modifiers
  2876. * @argument {Object} data - The data object generated by `update` method
  2877. * @argument {Object} options - Modifiers configuration and options
  2878. * @returns {Object} The data object, properly modified
  2879. */
  2880. function shift(data) {
  2881. var placement = data.placement;
  2882. var basePlacement = placement.split('-')[0];
  2883. var shiftvariation = placement.split('-')[1];
  2884. // if shift shiftvariation is specified, run the modifier
  2885. if (shiftvariation) {
  2886. var _data$offsets = data.offsets,
  2887. reference = _data$offsets.reference,
  2888. popper = _data$offsets.popper;
  2889. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  2890. var side = isVertical ? 'left' : 'top';
  2891. var measurement = isVertical ? 'width' : 'height';
  2892. var shiftOffsets = {
  2893. start: defineProperty({}, side, reference[side]),
  2894. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  2895. };
  2896. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  2897. }
  2898. return data;
  2899. }
  2900. /**
  2901. * @function
  2902. * @memberof Modifiers
  2903. * @argument {Object} data - The data object generated by update method
  2904. * @argument {Object} options - Modifiers configuration and options
  2905. * @returns {Object} The data object, properly modified
  2906. */
  2907. function hide(data) {
  2908. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  2909. return data;
  2910. }
  2911. var refRect = data.offsets.reference;
  2912. var bound = find(data.instance.modifiers, function (modifier) {
  2913. return modifier.name === 'preventOverflow';
  2914. }).boundaries;
  2915. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  2916. // Avoid unnecessary DOM access if visibility hasn't changed
  2917. if (data.hide === true) {
  2918. return data;
  2919. }
  2920. data.hide = true;
  2921. data.attributes['x-out-of-boundaries'] = '';
  2922. } else {
  2923. // Avoid unnecessary DOM access if visibility hasn't changed
  2924. if (data.hide === false) {
  2925. return data;
  2926. }
  2927. data.hide = false;
  2928. data.attributes['x-out-of-boundaries'] = false;
  2929. }
  2930. return data;
  2931. }
  2932. /**
  2933. * @function
  2934. * @memberof Modifiers
  2935. * @argument {Object} data - The data object generated by `update` method
  2936. * @argument {Object} options - Modifiers configuration and options
  2937. * @returns {Object} The data object, properly modified
  2938. */
  2939. function inner(data) {
  2940. var placement = data.placement;
  2941. var basePlacement = placement.split('-')[0];
  2942. var _data$offsets = data.offsets,
  2943. popper = _data$offsets.popper,
  2944. reference = _data$offsets.reference;
  2945. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  2946. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  2947. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  2948. data.placement = getOppositePlacement(placement);
  2949. data.offsets.popper = getClientRect(popper);
  2950. return data;
  2951. }
  2952. /**
  2953. * Modifier function, each modifier can have a function of this type assigned
  2954. * to its `fn` property.<br />
  2955. * These functions will be called on each update, this means that you must
  2956. * make sure they are performant enough to avoid performance bottlenecks.
  2957. *
  2958. * @function ModifierFn
  2959. * @argument {dataObject} data - The data object generated by `update` method
  2960. * @argument {Object} options - Modifiers configuration and options
  2961. * @returns {dataObject} The data object, properly modified
  2962. */
  2963. /**
  2964. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  2965. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  2966. * needed by the library.
  2967. *
  2968. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  2969. * All the other properties are configurations that could be tweaked.
  2970. * @namespace modifiers
  2971. */
  2972. var modifiers = {
  2973. /**
  2974. * Modifier used to shift the popper on the start or end of its reference
  2975. * element.<br />
  2976. * It will read the variation of the `placement` property.<br />
  2977. * It can be one either `-end` or `-start`.
  2978. * @memberof modifiers
  2979. * @inner
  2980. */
  2981. shift: {
  2982. /** @prop {number} order=100 - Index used to define the order of execution */
  2983. order: 100,
  2984. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2985. enabled: true,
  2986. /** @prop {ModifierFn} */
  2987. fn: shift
  2988. },
  2989. /**
  2990. * The `offset` modifier can shift your popper on both its axis.
  2991. *
  2992. * It accepts the following units:
  2993. * - `px` or unit-less, interpreted as pixels
  2994. * - `%` or `%r`, percentage relative to the length of the reference element
  2995. * - `%p`, percentage relative to the length of the popper element
  2996. * - `vw`, CSS viewport width unit
  2997. * - `vh`, CSS viewport height unit
  2998. *
  2999. * For length is intended the main axis relative to the placement of the popper.<br />
  3000. * This means that if the placement is `top` or `bottom`, the length will be the
  3001. * `width`. In case of `left` or `right`, it will be the `height`.
  3002. *
  3003. * You can provide a single value (as `Number` or `String`), or a pair of values
  3004. * as `String` divided by a comma or one (or more) white spaces.<br />
  3005. * The latter is a deprecated method because it leads to confusion and will be
  3006. * removed in v2.<br />
  3007. * Additionally, it accepts additions and subtractions between different units.
  3008. * Note that multiplications and divisions aren't supported.
  3009. *
  3010. * Valid examples are:
  3011. * ```
  3012. * 10
  3013. * '10%'
  3014. * '10, 10'
  3015. * '10%, 10'
  3016. * '10 + 10%'
  3017. * '10 - 5vh + 3%'
  3018. * '-10px + 5vh, 5px - 6%'
  3019. * ```
  3020. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  3021. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  3022. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  3023. *
  3024. * @memberof modifiers
  3025. * @inner
  3026. */
  3027. offset: {
  3028. /** @prop {number} order=200 - Index used to define the order of execution */
  3029. order: 200,
  3030. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3031. enabled: true,
  3032. /** @prop {ModifierFn} */
  3033. fn: offset,
  3034. /** @prop {Number|String} offset=0
  3035. * The offset value as described in the modifier description
  3036. */
  3037. offset: 0
  3038. },
  3039. /**
  3040. * Modifier used to prevent the popper from being positioned outside the boundary.
  3041. *
  3042. * A scenario exists where the reference itself is not within the boundaries.<br />
  3043. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  3044. * In this case we need to decide whether the popper should either:
  3045. *
  3046. * - detach from the reference and remain "trapped" in the boundaries, or
  3047. * - if it should ignore the boundary and "escape with its reference"
  3048. *
  3049. * When `escapeWithReference` is set to`true` and reference is completely
  3050. * outside its boundaries, the popper will overflow (or completely leave)
  3051. * the boundaries in order to remain attached to the edge of the reference.
  3052. *
  3053. * @memberof modifiers
  3054. * @inner
  3055. */
  3056. preventOverflow: {
  3057. /** @prop {number} order=300 - Index used to define the order of execution */
  3058. order: 300,
  3059. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3060. enabled: true,
  3061. /** @prop {ModifierFn} */
  3062. fn: preventOverflow,
  3063. /**
  3064. * @prop {Array} [priority=['left','right','top','bottom']]
  3065. * Popper will try to prevent overflow following these priorities by default,
  3066. * then, it could overflow on the left and on top of the `boundariesElement`
  3067. */
  3068. priority: ['left', 'right', 'top', 'bottom'],
  3069. /**
  3070. * @prop {number} padding=5
  3071. * Amount of pixel used to define a minimum distance between the boundaries
  3072. * and the popper. This makes sure the popper always has a little padding
  3073. * between the edges of its container
  3074. */
  3075. padding: 5,
  3076. /**
  3077. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  3078. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  3079. * `viewport` or any DOM element.
  3080. */
  3081. boundariesElement: 'scrollParent'
  3082. },
  3083. /**
  3084. * Modifier used to make sure the reference and its popper stay near each other
  3085. * without leaving any gap between the two. Especially useful when the arrow is
  3086. * enabled and you want to ensure that it points to its reference element.
  3087. * It cares only about the first axis. You can still have poppers with margin
  3088. * between the popper and its reference element.
  3089. * @memberof modifiers
  3090. * @inner
  3091. */
  3092. keepTogether: {
  3093. /** @prop {number} order=400 - Index used to define the order of execution */
  3094. order: 400,
  3095. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3096. enabled: true,
  3097. /** @prop {ModifierFn} */
  3098. fn: keepTogether
  3099. },
  3100. /**
  3101. * This modifier is used to move the `arrowElement` of the popper to make
  3102. * sure it is positioned between the reference element and its popper element.
  3103. * It will read the outer size of the `arrowElement` node to detect how many
  3104. * pixels of conjunction are needed.
  3105. *
  3106. * It has no effect if no `arrowElement` is provided.
  3107. * @memberof modifiers
  3108. * @inner
  3109. */
  3110. arrow: {
  3111. /** @prop {number} order=500 - Index used to define the order of execution */
  3112. order: 500,
  3113. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3114. enabled: true,
  3115. /** @prop {ModifierFn} */
  3116. fn: arrow,
  3117. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  3118. element: '[x-arrow]'
  3119. },
  3120. /**
  3121. * Modifier used to flip the popper's placement when it starts to overlap its
  3122. * reference element.
  3123. *
  3124. * Requires the `preventOverflow` modifier before it in order to work.
  3125. *
  3126. * **NOTE:** this modifier will interrupt the current update cycle and will
  3127. * restart it if it detects the need to flip the placement.
  3128. * @memberof modifiers
  3129. * @inner
  3130. */
  3131. flip: {
  3132. /** @prop {number} order=600 - Index used to define the order of execution */
  3133. order: 600,
  3134. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3135. enabled: true,
  3136. /** @prop {ModifierFn} */
  3137. fn: flip,
  3138. /**
  3139. * @prop {String|Array} behavior='flip'
  3140. * The behavior used to change the popper's placement. It can be one of
  3141. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  3142. * placements (with optional variations)
  3143. */
  3144. behavior: 'flip',
  3145. /**
  3146. * @prop {number} padding=5
  3147. * The popper will flip if it hits the edges of the `boundariesElement`
  3148. */
  3149. padding: 5,
  3150. /**
  3151. * @prop {String|HTMLElement} boundariesElement='viewport'
  3152. * The element which will define the boundaries of the popper position.
  3153. * The popper will never be placed outside of the defined boundaries
  3154. * (except if `keepTogether` is enabled)
  3155. */
  3156. boundariesElement: 'viewport'
  3157. },
  3158. /**
  3159. * Modifier used to make the popper flow toward the inner of the reference element.
  3160. * By default, when this modifier is disabled, the popper will be placed outside
  3161. * the reference element.
  3162. * @memberof modifiers
  3163. * @inner
  3164. */
  3165. inner: {
  3166. /** @prop {number} order=700 - Index used to define the order of execution */
  3167. order: 700,
  3168. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  3169. enabled: false,
  3170. /** @prop {ModifierFn} */
  3171. fn: inner
  3172. },
  3173. /**
  3174. * Modifier used to hide the popper when its reference element is outside of the
  3175. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  3176. * be used to hide with a CSS selector the popper when its reference is
  3177. * out of boundaries.
  3178. *
  3179. * Requires the `preventOverflow` modifier before it in order to work.
  3180. * @memberof modifiers
  3181. * @inner
  3182. */
  3183. hide: {
  3184. /** @prop {number} order=800 - Index used to define the order of execution */
  3185. order: 800,
  3186. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3187. enabled: true,
  3188. /** @prop {ModifierFn} */
  3189. fn: hide
  3190. },
  3191. /**
  3192. * Computes the style that will be applied to the popper element to gets
  3193. * properly positioned.
  3194. *
  3195. * Note that this modifier will not touch the DOM, it just prepares the styles
  3196. * so that `applyStyle` modifier can apply it. This separation is useful
  3197. * in case you need to replace `applyStyle` with a custom implementation.
  3198. *
  3199. * This modifier has `850` as `order` value to maintain backward compatibility
  3200. * with previous versions of Popper.js. Expect the modifiers ordering method
  3201. * to change in future major versions of the library.
  3202. *
  3203. * @memberof modifiers
  3204. * @inner
  3205. */
  3206. computeStyle: {
  3207. /** @prop {number} order=850 - Index used to define the order of execution */
  3208. order: 850,
  3209. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3210. enabled: true,
  3211. /** @prop {ModifierFn} */
  3212. fn: computeStyle,
  3213. /**
  3214. * @prop {Boolean} gpuAcceleration=true
  3215. * If true, it uses the CSS 3D transformation to position the popper.
  3216. * Otherwise, it will use the `top` and `left` properties
  3217. */
  3218. gpuAcceleration: true,
  3219. /**
  3220. * @prop {string} [x='bottom']
  3221. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  3222. * Change this if your popper should grow in a direction different from `bottom`
  3223. */
  3224. x: 'bottom',
  3225. /**
  3226. * @prop {string} [x='left']
  3227. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  3228. * Change this if your popper should grow in a direction different from `right`
  3229. */
  3230. y: 'right'
  3231. },
  3232. /**
  3233. * Applies the computed styles to the popper element.
  3234. *
  3235. * All the DOM manipulations are limited to this modifier. This is useful in case
  3236. * you want to integrate Popper.js inside a framework or view library and you
  3237. * want to delegate all the DOM manipulations to it.
  3238. *
  3239. * Note that if you disable this modifier, you must make sure the popper element
  3240. * has its position set to `absolute` before Popper.js can do its work!
  3241. *
  3242. * Just disable this modifier and define your own to achieve the desired effect.
  3243. *
  3244. * @memberof modifiers
  3245. * @inner
  3246. */
  3247. applyStyle: {
  3248. /** @prop {number} order=900 - Index used to define the order of execution */
  3249. order: 900,
  3250. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3251. enabled: true,
  3252. /** @prop {ModifierFn} */
  3253. fn: applyStyle,
  3254. /** @prop {Function} */
  3255. onLoad: applyStyleOnLoad,
  3256. /**
  3257. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  3258. * @prop {Boolean} gpuAcceleration=true
  3259. * If true, it uses the CSS 3D transformation to position the popper.
  3260. * Otherwise, it will use the `top` and `left` properties
  3261. */
  3262. gpuAcceleration: undefined
  3263. }
  3264. };
  3265. /**
  3266. * The `dataObject` is an object containing all the information used by Popper.js.
  3267. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  3268. * @name dataObject
  3269. * @property {Object} data.instance The Popper.js instance
  3270. * @property {String} data.placement Placement applied to popper
  3271. * @property {String} data.originalPlacement Placement originally defined on init
  3272. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  3273. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  3274. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  3275. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  3276. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  3277. * @property {Object} data.boundaries Offsets of the popper boundaries
  3278. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  3279. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  3280. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  3281. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  3282. */
  3283. /**
  3284. * Default options provided to Popper.js constructor.<br />
  3285. * These can be overridden using the `options` argument of Popper.js.<br />
  3286. * To override an option, simply pass an object with the same
  3287. * structure of the `options` object, as the 3rd argument. For example:
  3288. * ```
  3289. * new Popper(ref, pop, {
  3290. * modifiers: {
  3291. * preventOverflow: { enabled: false }
  3292. * }
  3293. * })
  3294. * ```
  3295. * @type {Object}
  3296. * @static
  3297. * @memberof Popper
  3298. */
  3299. var Defaults = {
  3300. /**
  3301. * Popper's placement.
  3302. * @prop {Popper.placements} placement='bottom'
  3303. */
  3304. placement: 'bottom',
  3305. /**
  3306. * Set this to true if you want popper to position it self in 'fixed' mode
  3307. * @prop {Boolean} positionFixed=false
  3308. */
  3309. positionFixed: false,
  3310. /**
  3311. * Whether events (resize, scroll) are initially enabled.
  3312. * @prop {Boolean} eventsEnabled=true
  3313. */
  3314. eventsEnabled: true,
  3315. /**
  3316. * Set to true if you want to automatically remove the popper when
  3317. * you call the `destroy` method.
  3318. * @prop {Boolean} removeOnDestroy=false
  3319. */
  3320. removeOnDestroy: false,
  3321. /**
  3322. * Callback called when the popper is created.<br />
  3323. * By default, it is set to no-op.<br />
  3324. * Access Popper.js instance with `data.instance`.
  3325. * @prop {onCreate}
  3326. */
  3327. onCreate: function onCreate() {
  3328. },
  3329. /**
  3330. * Callback called when the popper is updated. This callback is not called
  3331. * on the initialization/creation of the popper, but only on subsequent
  3332. * updates.<br />
  3333. * By default, it is set to no-op.<br />
  3334. * Access Popper.js instance with `data.instance`.
  3335. * @prop {onUpdate}
  3336. */
  3337. onUpdate: function onUpdate() {
  3338. },
  3339. /**
  3340. * List of modifiers used to modify the offsets before they are applied to the popper.
  3341. * They provide most of the functionalities of Popper.js.
  3342. * @prop {modifiers}
  3343. */
  3344. modifiers: modifiers
  3345. };
  3346. /**
  3347. * @callback onCreate
  3348. * @param {dataObject} data
  3349. */
  3350. /**
  3351. * @callback onUpdate
  3352. * @param {dataObject} data
  3353. */
  3354. // Utils
  3355. // Methods
  3356. var Popper = function () {
  3357. /**
  3358. * Creates a new Popper.js instance.
  3359. * @class Popper
  3360. * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
  3361. * @param {HTMLElement} popper - The HTML element used as the popper
  3362. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  3363. * @return {Object} instance - The generated Popper.js instance
  3364. */
  3365. function Popper(reference, popper) {
  3366. var _this = this;
  3367. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3368. classCallCheck(this, Popper);
  3369. this.scheduleUpdate = function () {
  3370. return requestAnimationFrame(_this.update);
  3371. };
  3372. // make update() debounced, so that it only runs at most once-per-tick
  3373. this.update = debounce(this.update.bind(this));
  3374. // with {} we create a new object with the options inside it
  3375. this.options = _extends({}, Popper.Defaults, options);
  3376. // init state
  3377. this.state = {
  3378. isDestroyed: false,
  3379. isCreated: false,
  3380. scrollParents: []
  3381. };
  3382. // get reference and popper elements (allow jQuery wrappers)
  3383. this.reference = reference && reference.jquery ? reference[0] : reference;
  3384. this.popper = popper && popper.jquery ? popper[0] : popper;
  3385. // Deep merge modifiers options
  3386. this.options.modifiers = {};
  3387. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  3388. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  3389. });
  3390. // Refactoring modifiers' list (Object => Array)
  3391. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  3392. return _extends({
  3393. name: name
  3394. }, _this.options.modifiers[name]);
  3395. })
  3396. // sort the modifiers by order
  3397. .sort(function (a, b) {
  3398. return a.order - b.order;
  3399. });
  3400. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  3401. // such code is executed in the same order of its modifier
  3402. // they could add new properties to their options configuration
  3403. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  3404. this.modifiers.forEach(function (modifierOptions) {
  3405. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  3406. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  3407. }
  3408. });
  3409. // fire the first update to position the popper in the right place
  3410. this.update();
  3411. var eventsEnabled = this.options.eventsEnabled;
  3412. if (eventsEnabled) {
  3413. // setup event listeners, they will take care of update the position in specific situations
  3414. this.enableEventListeners();
  3415. }
  3416. this.state.eventsEnabled = eventsEnabled;
  3417. }
  3418. // We can't use class properties because they don't get listed in the
  3419. // class prototype and break stuff like Sinon stubs
  3420. createClass(Popper, [{
  3421. key: 'update',
  3422. value: function update$$1() {
  3423. return update.call(this);
  3424. }
  3425. }, {
  3426. key: 'destroy',
  3427. value: function destroy$$1() {
  3428. return destroy.call(this);
  3429. }
  3430. }, {
  3431. key: 'enableEventListeners',
  3432. value: function enableEventListeners$$1() {
  3433. return enableEventListeners.call(this);
  3434. }
  3435. }, {
  3436. key: 'disableEventListeners',
  3437. value: function disableEventListeners$$1() {
  3438. return disableEventListeners.call(this);
  3439. }
  3440. /**
  3441. * Schedules an update. It will run on the next UI update available.
  3442. * @method scheduleUpdate
  3443. * @memberof Popper
  3444. */
  3445. /**
  3446. * Collection of utilities useful when writing custom modifiers.
  3447. * Starting from version 1.7, this method is available only if you
  3448. * include `popper-utils.js` before `popper.js`.
  3449. *
  3450. * **DEPRECATION**: This way to access PopperUtils is deprecated
  3451. * and will be removed in v2! Use the PopperUtils module directly instead.
  3452. * Due to the high instability of the methods contained in Utils, we can't
  3453. * guarantee them to follow semver. Use them at your own risk!
  3454. * @static
  3455. * @private
  3456. * @type {Object}
  3457. * @deprecated since version 1.8
  3458. * @member Utils
  3459. * @memberof Popper
  3460. */
  3461. }]);
  3462. return Popper;
  3463. }();
  3464. /**
  3465. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  3466. * and lets you use it as replacement of a real DOM node.<br />
  3467. * You can use this method to position a popper relatively to a set of coordinates
  3468. * in case you don't have a DOM node to use as reference.
  3469. *
  3470. * ```
  3471. * new Popper(referenceObject, popperNode);
  3472. * ```
  3473. *
  3474. * NB: This feature isn't supported in Internet Explorer 10.
  3475. * @name referenceObject
  3476. * @property {Function} data.getBoundingClientRect
  3477. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  3478. * @property {number} data.clientWidth
  3479. * An ES6 getter that will return the width of the virtual reference element.
  3480. * @property {number} data.clientHeight
  3481. * An ES6 getter that will return the height of the virtual reference element.
  3482. */
  3483. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  3484. Popper.placements = placements;
  3485. Popper.Defaults = Defaults;
  3486. /**
  3487. * ------------------------------------------------------------------------
  3488. * Constants
  3489. * ------------------------------------------------------------------------
  3490. */
  3491. var NAME$4 = 'dropdown';
  3492. var VERSION$4 = '4.3.1';
  3493. var DATA_KEY$4 = 'bs.dropdown';
  3494. var EVENT_KEY$4 = "." + DATA_KEY$4;
  3495. var DATA_API_KEY$4 = '.data-api';
  3496. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  3497. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  3498. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  3499. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  3500. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  3501. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  3502. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  3503. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  3504. var Event$4 = {
  3505. HIDE: "hide" + EVENT_KEY$4,
  3506. HIDDEN: "hidden" + EVENT_KEY$4,
  3507. SHOW: "show" + EVENT_KEY$4,
  3508. SHOWN: "shown" + EVENT_KEY$4,
  3509. CLICK: "click" + EVENT_KEY$4,
  3510. CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  3511. KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  3512. KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  3513. };
  3514. var ClassName$4 = {
  3515. DISABLED: 'disabled',
  3516. SHOW: 'show',
  3517. DROPUP: 'dropup',
  3518. DROPRIGHT: 'dropright',
  3519. DROPLEFT: 'dropleft',
  3520. MENURIGHT: 'dropdown-menu-right',
  3521. MENULEFT: 'dropdown-menu-left',
  3522. POSITION_STATIC: 'position-static'
  3523. };
  3524. var Selector$4 = {
  3525. DATA_TOGGLE: '[data-toggle="dropdown"]',
  3526. FORM_CHILD: '.dropdown form',
  3527. MENU: '.dropdown-menu',
  3528. NAVBAR_NAV: '.navbar-nav',
  3529. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  3530. };
  3531. var AttachmentMap = {
  3532. TOP: 'top-start',
  3533. TOPEND: 'top-end',
  3534. BOTTOM: 'bottom-start',
  3535. BOTTOMEND: 'bottom-end',
  3536. RIGHT: 'right-start',
  3537. RIGHTEND: 'right-end',
  3538. LEFT: 'left-start',
  3539. LEFTEND: 'left-end'
  3540. };
  3541. var Default$2 = {
  3542. offset: 0,
  3543. flip: true,
  3544. boundary: 'scrollParent',
  3545. reference: 'toggle',
  3546. display: 'dynamic'
  3547. };
  3548. var DefaultType$2 = {
  3549. offset: '(number|string|function)',
  3550. flip: 'boolean',
  3551. boundary: '(string|element)',
  3552. reference: '(string|element)',
  3553. display: 'string'
  3554. /**
  3555. * ------------------------------------------------------------------------
  3556. * Class Definition
  3557. * ------------------------------------------------------------------------
  3558. */
  3559. };
  3560. var Dropdown =
  3561. /*#__PURE__*/
  3562. function () {
  3563. function Dropdown(element, config) {
  3564. this._element = element;
  3565. this._popper = null;
  3566. this._config = this._getConfig(config);
  3567. this._menu = this._getMenuElement();
  3568. this._inNavbar = this._detectNavbar();
  3569. this._addEventListeners();
  3570. } // Getters
  3571. var _proto = Dropdown.prototype;
  3572. // Public
  3573. _proto.toggle = function toggle() {
  3574. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
  3575. return;
  3576. }
  3577. var parent = Dropdown._getParentFromElement(this._element);
  3578. var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
  3579. Dropdown._clearMenus();
  3580. if (isActive) {
  3581. return;
  3582. }
  3583. var relatedTarget = {
  3584. relatedTarget: this._element
  3585. };
  3586. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  3587. $(parent).trigger(showEvent);
  3588. if (showEvent.isDefaultPrevented()) {
  3589. return;
  3590. } // Disable totally Popper.js for Dropdown in Navbar
  3591. if (!this._inNavbar) {
  3592. /**
  3593. * Check for Popper dependency
  3594. * Popper - https://popper.js.org
  3595. */
  3596. if (typeof Popper === 'undefined') {
  3597. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  3598. }
  3599. var referenceElement = this._element;
  3600. if (this._config.reference === 'parent') {
  3601. referenceElement = parent;
  3602. } else if (Util.isElement(this._config.reference)) {
  3603. referenceElement = this._config.reference; // Check if it's jQuery element
  3604. if (typeof this._config.reference.jquery !== 'undefined') {
  3605. referenceElement = this._config.reference[0];
  3606. }
  3607. } // If boundary is not `scrollParent`, then set position to `static`
  3608. // to allow the menu to "escape" the scroll parent's boundaries
  3609. // https://github.com/twbs/bootstrap/issues/24251
  3610. if (this._config.boundary !== 'scrollParent') {
  3611. $(parent).addClass(ClassName$4.POSITION_STATIC);
  3612. }
  3613. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  3614. } // If this is a touch-enabled device we add extra
  3615. // empty mouseover listeners to the body's immediate children;
  3616. // only needed because of broken event delegation on iOS
  3617. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  3618. if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
  3619. $(document.body).children().on('mouseover', null, $.noop);
  3620. }
  3621. this._element.focus();
  3622. this._element.setAttribute('aria-expanded', true);
  3623. $(this._menu).toggleClass(ClassName$4.SHOW);
  3624. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  3625. };
  3626. _proto.show = function show() {
  3627. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
  3628. return;
  3629. }
  3630. var relatedTarget = {
  3631. relatedTarget: this._element
  3632. };
  3633. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  3634. var parent = Dropdown._getParentFromElement(this._element);
  3635. $(parent).trigger(showEvent);
  3636. if (showEvent.isDefaultPrevented()) {
  3637. return;
  3638. }
  3639. $(this._menu).toggleClass(ClassName$4.SHOW);
  3640. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  3641. };
  3642. _proto.hide = function hide() {
  3643. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
  3644. return;
  3645. }
  3646. var relatedTarget = {
  3647. relatedTarget: this._element
  3648. };
  3649. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  3650. var parent = Dropdown._getParentFromElement(this._element);
  3651. $(parent).trigger(hideEvent);
  3652. if (hideEvent.isDefaultPrevented()) {
  3653. return;
  3654. }
  3655. $(this._menu).toggleClass(ClassName$4.SHOW);
  3656. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  3657. };
  3658. _proto.dispose = function dispose() {
  3659. $.removeData(this._element, DATA_KEY$4);
  3660. $(this._element).off(EVENT_KEY$4);
  3661. this._element = null;
  3662. this._menu = null;
  3663. if (this._popper !== null) {
  3664. this._popper.destroy();
  3665. this._popper = null;
  3666. }
  3667. };
  3668. _proto.update = function update() {
  3669. this._inNavbar = this._detectNavbar();
  3670. if (this._popper !== null) {
  3671. this._popper.scheduleUpdate();
  3672. }
  3673. } // Private
  3674. ;
  3675. _proto._addEventListeners = function _addEventListeners() {
  3676. var _this = this;
  3677. $(this._element).on(Event$4.CLICK, function (event) {
  3678. event.preventDefault();
  3679. event.stopPropagation();
  3680. _this.toggle();
  3681. });
  3682. };
  3683. _proto._getConfig = function _getConfig(config) {
  3684. config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
  3685. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  3686. return config;
  3687. };
  3688. _proto._getMenuElement = function _getMenuElement() {
  3689. if (!this._menu) {
  3690. var parent = Dropdown._getParentFromElement(this._element);
  3691. if (parent) {
  3692. this._menu = parent.querySelector(Selector$4.MENU);
  3693. }
  3694. }
  3695. return this._menu;
  3696. };
  3697. _proto._getPlacement = function _getPlacement() {
  3698. var $parentDropdown = $(this._element.parentNode);
  3699. var placement = AttachmentMap.BOTTOM; // Handle dropup
  3700. if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
  3701. placement = AttachmentMap.TOP;
  3702. if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  3703. placement = AttachmentMap.TOPEND;
  3704. }
  3705. } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
  3706. placement = AttachmentMap.RIGHT;
  3707. } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
  3708. placement = AttachmentMap.LEFT;
  3709. } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  3710. placement = AttachmentMap.BOTTOMEND;
  3711. }
  3712. return placement;
  3713. };
  3714. _proto._detectNavbar = function _detectNavbar() {
  3715. return $(this._element).closest('.navbar').length > 0;
  3716. };
  3717. _proto._getOffset = function _getOffset() {
  3718. var _this2 = this;
  3719. var offset = {};
  3720. if (typeof this._config.offset === 'function') {
  3721. offset.fn = function (data) {
  3722. data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
  3723. return data;
  3724. };
  3725. } else {
  3726. offset.offset = this._config.offset;
  3727. }
  3728. return offset;
  3729. };
  3730. _proto._getPopperConfig = function _getPopperConfig() {
  3731. var popperConfig = {
  3732. placement: this._getPlacement(),
  3733. modifiers: {
  3734. offset: this._getOffset(),
  3735. flip: {
  3736. enabled: this._config.flip
  3737. },
  3738. preventOverflow: {
  3739. boundariesElement: this._config.boundary
  3740. }
  3741. } // Disable Popper.js if we have a static display
  3742. };
  3743. if (this._config.display === 'static') {
  3744. popperConfig.modifiers.applyStyle = {
  3745. enabled: false
  3746. };
  3747. }
  3748. return popperConfig;
  3749. } // Static
  3750. ;
  3751. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  3752. return this.each(function () {
  3753. var data = $(this).data(DATA_KEY$4);
  3754. var _config = typeof config === 'object' ? config : null;
  3755. if (!data) {
  3756. data = new Dropdown(this, _config);
  3757. $(this).data(DATA_KEY$4, data);
  3758. }
  3759. if (typeof config === 'string') {
  3760. if (typeof data[config] === 'undefined') {
  3761. throw new TypeError("No method named \"" + config + "\"");
  3762. }
  3763. data[config]();
  3764. }
  3765. });
  3766. };
  3767. Dropdown._clearMenus = function _clearMenus(event) {
  3768. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  3769. return;
  3770. }
  3771. var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
  3772. for (var i = 0, len = toggles.length; i < len; i++) {
  3773. var parent = Dropdown._getParentFromElement(toggles[i]);
  3774. var context = $(toggles[i]).data(DATA_KEY$4);
  3775. var relatedTarget = {
  3776. relatedTarget: toggles[i]
  3777. };
  3778. if (event && event.type === 'click') {
  3779. relatedTarget.clickEvent = event;
  3780. }
  3781. if (!context) {
  3782. continue;
  3783. }
  3784. var dropdownMenu = context._menu;
  3785. if (!$(parent).hasClass(ClassName$4.SHOW)) {
  3786. continue;
  3787. }
  3788. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  3789. continue;
  3790. }
  3791. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  3792. $(parent).trigger(hideEvent);
  3793. if (hideEvent.isDefaultPrevented()) {
  3794. continue;
  3795. } // If this is a touch-enabled device we remove the extra
  3796. // empty mouseover listeners we added for iOS support
  3797. if ('ontouchstart' in document.documentElement) {
  3798. $(document.body).children().off('mouseover', null, $.noop);
  3799. }
  3800. toggles[i].setAttribute('aria-expanded', 'false');
  3801. $(dropdownMenu).removeClass(ClassName$4.SHOW);
  3802. $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  3803. }
  3804. };
  3805. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  3806. var parent;
  3807. var selector = Util.getSelectorFromElement(element);
  3808. if (selector) {
  3809. parent = document.querySelector(selector);
  3810. }
  3811. return parent || element.parentNode;
  3812. } // eslint-disable-next-line complexity
  3813. ;
  3814. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  3815. // If not input/textarea:
  3816. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  3817. // If input/textarea:
  3818. // - If space key => not a dropdown command
  3819. // - If key is other than escape
  3820. // - If key is not up or down => not a dropdown command
  3821. // - If trigger inside the menu => not a dropdown command
  3822. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  3823. return;
  3824. }
  3825. event.preventDefault();
  3826. event.stopPropagation();
  3827. if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
  3828. return;
  3829. }
  3830. var parent = Dropdown._getParentFromElement(this);
  3831. var isActive = $(parent).hasClass(ClassName$4.SHOW);
  3832. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  3833. if (event.which === ESCAPE_KEYCODE) {
  3834. var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
  3835. $(toggle).trigger('focus');
  3836. }
  3837. $(this).trigger('click');
  3838. return;
  3839. }
  3840. var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS));
  3841. if (items.length === 0) {
  3842. return;
  3843. }
  3844. var index = items.indexOf(event.target);
  3845. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  3846. // Up
  3847. index--;
  3848. }
  3849. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  3850. // Down
  3851. index++;
  3852. }
  3853. if (index < 0) {
  3854. index = 0;
  3855. }
  3856. items[index].focus();
  3857. };
  3858. _createClass(Dropdown, null, [{
  3859. key: "VERSION",
  3860. get: function get() {
  3861. return VERSION$4;
  3862. }
  3863. }, {
  3864. key: "Default",
  3865. get: function get() {
  3866. return Default$2;
  3867. }
  3868. }, {
  3869. key: "DefaultType",
  3870. get: function get() {
  3871. return DefaultType$2;
  3872. }
  3873. }]);
  3874. return Dropdown;
  3875. }();
  3876. /**
  3877. * ------------------------------------------------------------------------
  3878. * Data Api implementation
  3879. * ------------------------------------------------------------------------
  3880. */
  3881. $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  3882. event.preventDefault();
  3883. event.stopPropagation();
  3884. Dropdown._jQueryInterface.call($(this), 'toggle');
  3885. }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  3886. e.stopPropagation();
  3887. });
  3888. /**
  3889. * ------------------------------------------------------------------------
  3890. * jQuery
  3891. * ------------------------------------------------------------------------
  3892. */
  3893. $.fn[NAME$4] = Dropdown._jQueryInterface;
  3894. $.fn[NAME$4].Constructor = Dropdown;
  3895. $.fn[NAME$4].noConflict = function () {
  3896. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  3897. return Dropdown._jQueryInterface;
  3898. };
  3899. /**
  3900. * ------------------------------------------------------------------------
  3901. * Constants
  3902. * ------------------------------------------------------------------------
  3903. */
  3904. var NAME$5 = 'modal';
  3905. var VERSION$5 = '4.3.1';
  3906. var DATA_KEY$5 = 'bs.modal';
  3907. var EVENT_KEY$5 = "." + DATA_KEY$5;
  3908. var DATA_API_KEY$5 = '.data-api';
  3909. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  3910. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  3911. var Default$3 = {
  3912. backdrop: true,
  3913. keyboard: true,
  3914. focus: true,
  3915. show: true
  3916. };
  3917. var DefaultType$3 = {
  3918. backdrop: '(boolean|string)',
  3919. keyboard: 'boolean',
  3920. focus: 'boolean',
  3921. show: 'boolean'
  3922. };
  3923. var Event$5 = {
  3924. HIDE: "hide" + EVENT_KEY$5,
  3925. HIDDEN: "hidden" + EVENT_KEY$5,
  3926. SHOW: "show" + EVENT_KEY$5,
  3927. SHOWN: "shown" + EVENT_KEY$5,
  3928. FOCUSIN: "focusin" + EVENT_KEY$5,
  3929. RESIZE: "resize" + EVENT_KEY$5,
  3930. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  3931. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  3932. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  3933. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  3934. CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  3935. };
  3936. var ClassName$5 = {
  3937. SCROLLABLE: 'modal-dialog-scrollable',
  3938. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  3939. BACKDROP: 'modal-backdrop',
  3940. OPEN: 'modal-open',
  3941. FADE: 'fade',
  3942. SHOW: 'show'
  3943. };
  3944. var Selector$5 = {
  3945. DIALOG: '.modal-dialog',
  3946. MODAL_BODY: '.modal-body',
  3947. DATA_TOGGLE: '[data-toggle="modal"]',
  3948. DATA_DISMISS: '[data-dismiss="modal"]',
  3949. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  3950. STICKY_CONTENT: '.sticky-top'
  3951. /**
  3952. * ------------------------------------------------------------------------
  3953. * Class Definition
  3954. * ------------------------------------------------------------------------
  3955. */
  3956. };
  3957. var Modal =
  3958. /*#__PURE__*/
  3959. function () {
  3960. function Modal(element, config) {
  3961. this._config = this._getConfig(config);
  3962. this._element = element;
  3963. this._dialog = element.querySelector(Selector$5.DIALOG);
  3964. this._backdrop = null;
  3965. this._isShown = false;
  3966. this._isBodyOverflowing = false;
  3967. this._ignoreBackdropClick = false;
  3968. this._isTransitioning = false;
  3969. this._scrollbarWidth = 0;
  3970. } // Getters
  3971. var _proto = Modal.prototype;
  3972. // Public
  3973. _proto.toggle = function toggle(relatedTarget) {
  3974. return this._isShown ? this.hide() : this.show(relatedTarget);
  3975. };
  3976. _proto.show = function show(relatedTarget) {
  3977. var _this = this;
  3978. if (this._isShown || this._isTransitioning) {
  3979. return;
  3980. }
  3981. if ($(this._element).hasClass(ClassName$5.FADE)) {
  3982. this._isTransitioning = true;
  3983. }
  3984. var showEvent = $.Event(Event$5.SHOW, {
  3985. relatedTarget: relatedTarget
  3986. });
  3987. $(this._element).trigger(showEvent);
  3988. if (this._isShown || showEvent.isDefaultPrevented()) {
  3989. return;
  3990. }
  3991. this._isShown = true;
  3992. this._checkScrollbar();
  3993. this._setScrollbar();
  3994. this._adjustDialog();
  3995. this._setEscapeEvent();
  3996. this._setResizeEvent();
  3997. $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
  3998. return _this.hide(event);
  3999. });
  4000. $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
  4001. $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
  4002. if ($(event.target).is(_this._element)) {
  4003. _this._ignoreBackdropClick = true;
  4004. }
  4005. });
  4006. });
  4007. this._showBackdrop(function () {
  4008. return _this._showElement(relatedTarget);
  4009. });
  4010. };
  4011. _proto.hide = function hide(event) {
  4012. var _this2 = this;
  4013. if (event) {
  4014. event.preventDefault();
  4015. }
  4016. if (!this._isShown || this._isTransitioning) {
  4017. return;
  4018. }
  4019. var hideEvent = $.Event(Event$5.HIDE);
  4020. $(this._element).trigger(hideEvent);
  4021. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  4022. return;
  4023. }
  4024. this._isShown = false;
  4025. var transition = $(this._element).hasClass(ClassName$5.FADE);
  4026. if (transition) {
  4027. this._isTransitioning = true;
  4028. }
  4029. this._setEscapeEvent();
  4030. this._setResizeEvent();
  4031. $(document).off(Event$5.FOCUSIN);
  4032. $(this._element).removeClass(ClassName$5.SHOW);
  4033. $(this._element).off(Event$5.CLICK_DISMISS);
  4034. $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
  4035. if (transition) {
  4036. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4037. $(this._element).one(Util.TRANSITION_END, function (event) {
  4038. return _this2._hideModal(event);
  4039. }).emulateTransitionEnd(transitionDuration);
  4040. } else {
  4041. this._hideModal();
  4042. }
  4043. };
  4044. _proto.dispose = function dispose() {
  4045. [window, this._element, this._dialog].forEach(function (htmlElement) {
  4046. return $(htmlElement).off(EVENT_KEY$5);
  4047. });
  4048. /**
  4049. * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
  4050. * Do not move `document` in `htmlElements` array
  4051. * It will remove `Event.CLICK_DATA_API` event that should remain
  4052. */
  4053. $(document).off(Event$5.FOCUSIN);
  4054. $.removeData(this._element, DATA_KEY$5);
  4055. this._config = null;
  4056. this._element = null;
  4057. this._dialog = null;
  4058. this._backdrop = null;
  4059. this._isShown = null;
  4060. this._isBodyOverflowing = null;
  4061. this._ignoreBackdropClick = null;
  4062. this._isTransitioning = null;
  4063. this._scrollbarWidth = null;
  4064. };
  4065. _proto.handleUpdate = function handleUpdate() {
  4066. this._adjustDialog();
  4067. } // Private
  4068. ;
  4069. _proto._getConfig = function _getConfig(config) {
  4070. config = _objectSpread({}, Default$3, config);
  4071. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  4072. return config;
  4073. };
  4074. _proto._showElement = function _showElement(relatedTarget) {
  4075. var _this3 = this;
  4076. var transition = $(this._element).hasClass(ClassName$5.FADE);
  4077. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  4078. // Don't move modal's DOM position
  4079. document.body.appendChild(this._element);
  4080. }
  4081. this._element.style.display = 'block';
  4082. this._element.removeAttribute('aria-hidden');
  4083. this._element.setAttribute('aria-modal', true);
  4084. if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) {
  4085. this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0;
  4086. } else {
  4087. this._element.scrollTop = 0;
  4088. }
  4089. if (transition) {
  4090. Util.reflow(this._element);
  4091. }
  4092. $(this._element).addClass(ClassName$5.SHOW);
  4093. if (this._config.focus) {
  4094. this._enforceFocus();
  4095. }
  4096. var shownEvent = $.Event(Event$5.SHOWN, {
  4097. relatedTarget: relatedTarget
  4098. });
  4099. var transitionComplete = function transitionComplete() {
  4100. if (_this3._config.focus) {
  4101. _this3._element.focus();
  4102. }
  4103. _this3._isTransitioning = false;
  4104. $(_this3._element).trigger(shownEvent);
  4105. };
  4106. if (transition) {
  4107. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  4108. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  4109. } else {
  4110. transitionComplete();
  4111. }
  4112. };
  4113. _proto._enforceFocus = function _enforceFocus() {
  4114. var _this4 = this;
  4115. $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
  4116. .on(Event$5.FOCUSIN, function (event) {
  4117. if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
  4118. _this4._element.focus();
  4119. }
  4120. });
  4121. };
  4122. _proto._setEscapeEvent = function _setEscapeEvent() {
  4123. var _this5 = this;
  4124. if (this._isShown && this._config.keyboard) {
  4125. $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
  4126. if (event.which === ESCAPE_KEYCODE$1) {
  4127. event.preventDefault();
  4128. _this5.hide();
  4129. }
  4130. });
  4131. } else if (!this._isShown) {
  4132. $(this._element).off(Event$5.KEYDOWN_DISMISS);
  4133. }
  4134. };
  4135. _proto._setResizeEvent = function _setResizeEvent() {
  4136. var _this6 = this;
  4137. if (this._isShown) {
  4138. $(window).on(Event$5.RESIZE, function (event) {
  4139. return _this6.handleUpdate(event);
  4140. });
  4141. } else {
  4142. $(window).off(Event$5.RESIZE);
  4143. }
  4144. };
  4145. _proto._hideModal = function _hideModal() {
  4146. var _this7 = this;
  4147. this._element.style.display = 'none';
  4148. this._element.setAttribute('aria-hidden', true);
  4149. this._element.removeAttribute('aria-modal');
  4150. this._isTransitioning = false;
  4151. this._showBackdrop(function () {
  4152. $(document.body).removeClass(ClassName$5.OPEN);
  4153. _this7._resetAdjustments();
  4154. _this7._resetScrollbar();
  4155. $(_this7._element).trigger(Event$5.HIDDEN);
  4156. });
  4157. };
  4158. _proto._removeBackdrop = function _removeBackdrop() {
  4159. if (this._backdrop) {
  4160. $(this._backdrop).remove();
  4161. this._backdrop = null;
  4162. }
  4163. };
  4164. _proto._showBackdrop = function _showBackdrop(callback) {
  4165. var _this8 = this;
  4166. var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
  4167. if (this._isShown && this._config.backdrop) {
  4168. this._backdrop = document.createElement('div');
  4169. this._backdrop.className = ClassName$5.BACKDROP;
  4170. if (animate) {
  4171. this._backdrop.classList.add(animate);
  4172. }
  4173. $(this._backdrop).appendTo(document.body);
  4174. $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
  4175. if (_this8._ignoreBackdropClick) {
  4176. _this8._ignoreBackdropClick = false;
  4177. return;
  4178. }
  4179. if (event.target !== event.currentTarget) {
  4180. return;
  4181. }
  4182. if (_this8._config.backdrop === 'static') {
  4183. _this8._element.focus();
  4184. } else {
  4185. _this8.hide();
  4186. }
  4187. });
  4188. if (animate) {
  4189. Util.reflow(this._backdrop);
  4190. }
  4191. $(this._backdrop).addClass(ClassName$5.SHOW);
  4192. if (!callback) {
  4193. return;
  4194. }
  4195. if (!animate) {
  4196. callback();
  4197. return;
  4198. }
  4199. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  4200. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  4201. } else if (!this._isShown && this._backdrop) {
  4202. $(this._backdrop).removeClass(ClassName$5.SHOW);
  4203. var callbackRemove = function callbackRemove() {
  4204. _this8._removeBackdrop();
  4205. if (callback) {
  4206. callback();
  4207. }
  4208. };
  4209. if ($(this._element).hasClass(ClassName$5.FADE)) {
  4210. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  4211. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  4212. } else {
  4213. callbackRemove();
  4214. }
  4215. } else if (callback) {
  4216. callback();
  4217. }
  4218. } // ----------------------------------------------------------------------
  4219. // the following methods are used to handle overflowing modals
  4220. // todo (fat): these should probably be refactored out of modal.js
  4221. // ----------------------------------------------------------------------
  4222. ;
  4223. _proto._adjustDialog = function _adjustDialog() {
  4224. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  4225. if (!this._isBodyOverflowing && isModalOverflowing) {
  4226. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  4227. }
  4228. if (this._isBodyOverflowing && !isModalOverflowing) {
  4229. this._element.style.paddingRight = this._scrollbarWidth + "px";
  4230. }
  4231. };
  4232. _proto._resetAdjustments = function _resetAdjustments() {
  4233. this._element.style.paddingLeft = '';
  4234. this._element.style.paddingRight = '';
  4235. };
  4236. _proto._checkScrollbar = function _checkScrollbar() {
  4237. var rect = document.body.getBoundingClientRect();
  4238. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  4239. this._scrollbarWidth = this._getScrollbarWidth();
  4240. };
  4241. _proto._setScrollbar = function _setScrollbar() {
  4242. var _this9 = this;
  4243. if (this._isBodyOverflowing) {
  4244. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  4245. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  4246. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  4247. var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
  4248. $(fixedContent).each(function (index, element) {
  4249. var actualPadding = element.style.paddingRight;
  4250. var calculatedPadding = $(element).css('padding-right');
  4251. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
  4252. }); // Adjust sticky content margin
  4253. $(stickyContent).each(function (index, element) {
  4254. var actualMargin = element.style.marginRight;
  4255. var calculatedMargin = $(element).css('margin-right');
  4256. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
  4257. }); // Adjust body padding
  4258. var actualPadding = document.body.style.paddingRight;
  4259. var calculatedPadding = $(document.body).css('padding-right');
  4260. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  4261. }
  4262. $(document.body).addClass(ClassName$5.OPEN);
  4263. };
  4264. _proto._resetScrollbar = function _resetScrollbar() {
  4265. // Restore fixed content padding
  4266. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  4267. $(fixedContent).each(function (index, element) {
  4268. var padding = $(element).data('padding-right');
  4269. $(element).removeData('padding-right');
  4270. element.style.paddingRight = padding ? padding : '';
  4271. }); // Restore sticky content
  4272. var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
  4273. $(elements).each(function (index, element) {
  4274. var margin = $(element).data('margin-right');
  4275. if (typeof margin !== 'undefined') {
  4276. $(element).css('margin-right', margin).removeData('margin-right');
  4277. }
  4278. }); // Restore body padding
  4279. var padding = $(document.body).data('padding-right');
  4280. $(document.body).removeData('padding-right');
  4281. document.body.style.paddingRight = padding ? padding : '';
  4282. };
  4283. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  4284. // thx d.walsh
  4285. var scrollDiv = document.createElement('div');
  4286. scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
  4287. document.body.appendChild(scrollDiv);
  4288. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  4289. document.body.removeChild(scrollDiv);
  4290. return scrollbarWidth;
  4291. } // Static
  4292. ;
  4293. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  4294. return this.each(function () {
  4295. var data = $(this).data(DATA_KEY$5);
  4296. var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {});
  4297. if (!data) {
  4298. data = new Modal(this, _config);
  4299. $(this).data(DATA_KEY$5, data);
  4300. }
  4301. if (typeof config === 'string') {
  4302. if (typeof data[config] === 'undefined') {
  4303. throw new TypeError("No method named \"" + config + "\"");
  4304. }
  4305. data[config](relatedTarget);
  4306. } else if (_config.show) {
  4307. data.show(relatedTarget);
  4308. }
  4309. });
  4310. };
  4311. _createClass(Modal, null, [{
  4312. key: "VERSION",
  4313. get: function get() {
  4314. return VERSION$5;
  4315. }
  4316. }, {
  4317. key: "Default",
  4318. get: function get() {
  4319. return Default$3;
  4320. }
  4321. }]);
  4322. return Modal;
  4323. }();
  4324. /**
  4325. * ------------------------------------------------------------------------
  4326. * Data Api implementation
  4327. * ------------------------------------------------------------------------
  4328. */
  4329. $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
  4330. var _this10 = this;
  4331. var target;
  4332. var selector = Util.getSelectorFromElement(this);
  4333. if (selector) {
  4334. target = document.querySelector(selector);
  4335. }
  4336. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
  4337. if (this.tagName === 'A' || this.tagName === 'AREA') {
  4338. event.preventDefault();
  4339. }
  4340. var $target = $(target).one(Event$5.SHOW, function (showEvent) {
  4341. if (showEvent.isDefaultPrevented()) {
  4342. // Only register focus restorer if modal will actually get shown
  4343. return;
  4344. }
  4345. $target.one(Event$5.HIDDEN, function () {
  4346. if ($(_this10).is(':visible')) {
  4347. _this10.focus();
  4348. }
  4349. });
  4350. });
  4351. Modal._jQueryInterface.call($(target), config, this);
  4352. });
  4353. /**
  4354. * ------------------------------------------------------------------------
  4355. * jQuery
  4356. * ------------------------------------------------------------------------
  4357. */
  4358. $.fn[NAME$5] = Modal._jQueryInterface;
  4359. $.fn[NAME$5].Constructor = Modal;
  4360. $.fn[NAME$5].noConflict = function () {
  4361. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  4362. return Modal._jQueryInterface;
  4363. };
  4364. /**
  4365. * --------------------------------------------------------------------------
  4366. * Bootstrap (v4.3.1): tools/sanitizer.js
  4367. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4368. * --------------------------------------------------------------------------
  4369. */
  4370. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  4371. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  4372. var DefaultWhitelist = {
  4373. // Global attributes allowed on any supplied element below.
  4374. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  4375. a: ['target', 'href', 'title', 'rel'],
  4376. area: [],
  4377. b: [],
  4378. br: [],
  4379. col: [],
  4380. code: [],
  4381. div: [],
  4382. em: [],
  4383. hr: [],
  4384. h1: [],
  4385. h2: [],
  4386. h3: [],
  4387. h4: [],
  4388. h5: [],
  4389. h6: [],
  4390. i: [],
  4391. img: ['src', 'alt', 'title', 'width', 'height'],
  4392. li: [],
  4393. ol: [],
  4394. p: [],
  4395. pre: [],
  4396. s: [],
  4397. small: [],
  4398. span: [],
  4399. sub: [],
  4400. sup: [],
  4401. strong: [],
  4402. u: [],
  4403. ul: []
  4404. /**
  4405. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  4406. *
  4407. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  4408. */
  4409. };
  4410. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  4411. /**
  4412. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  4413. *
  4414. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  4415. */
  4416. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
  4417. function allowedAttribute(attr, allowedAttributeList) {
  4418. var attrName = attr.nodeName.toLowerCase();
  4419. if (allowedAttributeList.indexOf(attrName) !== -1) {
  4420. if (uriAttrs.indexOf(attrName) !== -1) {
  4421. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  4422. }
  4423. return true;
  4424. }
  4425. var regExp = allowedAttributeList.filter(function (attrRegex) {
  4426. return attrRegex instanceof RegExp;
  4427. }); // Check if a regular expression validates the attribute.
  4428. for (var i = 0, l = regExp.length; i < l; i++) {
  4429. if (attrName.match(regExp[i])) {
  4430. return true;
  4431. }
  4432. }
  4433. return false;
  4434. }
  4435. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  4436. if (unsafeHtml.length === 0) {
  4437. return unsafeHtml;
  4438. }
  4439. if (sanitizeFn && typeof sanitizeFn === 'function') {
  4440. return sanitizeFn(unsafeHtml);
  4441. }
  4442. var domParser = new window.DOMParser();
  4443. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  4444. var whitelistKeys = Object.keys(whiteList);
  4445. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  4446. var _loop = function _loop(i, len) {
  4447. var el = elements[i];
  4448. var elName = el.nodeName.toLowerCase();
  4449. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  4450. el.parentNode.removeChild(el);
  4451. return "continue";
  4452. }
  4453. var attributeList = [].slice.call(el.attributes);
  4454. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  4455. attributeList.forEach(function (attr) {
  4456. if (!allowedAttribute(attr, whitelistedAttributes)) {
  4457. el.removeAttribute(attr.nodeName);
  4458. }
  4459. });
  4460. };
  4461. for (var i = 0, len = elements.length; i < len; i++) {
  4462. var _ret = _loop(i, len);
  4463. if (_ret === "continue")
  4464. }
  4465. return createdDocument.body.innerHTML;
  4466. }
  4467. /**
  4468. * ------------------------------------------------------------------------
  4469. * Constants
  4470. * ------------------------------------------------------------------------
  4471. */
  4472. var NAME$6 = 'tooltip';
  4473. var VERSION$6 = '4.3.1';
  4474. var DATA_KEY$6 = 'bs.tooltip';
  4475. var EVENT_KEY$6 = "." + DATA_KEY$6;
  4476. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  4477. var CLASS_PREFIX = 'bs-tooltip';
  4478. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  4479. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  4480. var DefaultType$4 = {
  4481. animation: 'boolean',
  4482. template: 'string',
  4483. title: '(string|element|function)',
  4484. trigger: 'string',
  4485. delay: '(number|object)',
  4486. html: 'boolean',
  4487. selector: '(string|boolean)',
  4488. placement: '(string|function)',
  4489. offset: '(number|string|function)',
  4490. container: '(string|element|boolean)',
  4491. fallbackPlacement: '(string|array)',
  4492. boundary: '(string|element)',
  4493. sanitize: 'boolean',
  4494. sanitizeFn: '(null|function)',
  4495. whiteList: 'object'
  4496. };
  4497. var AttachmentMap$1 = {
  4498. AUTO: 'auto',
  4499. TOP: 'top',
  4500. RIGHT: 'right',
  4501. BOTTOM: 'bottom',
  4502. LEFT: 'left'
  4503. };
  4504. var Default$4 = {
  4505. animation: true,
  4506. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  4507. trigger: 'hover focus',
  4508. title: '',
  4509. delay: 0,
  4510. html: false,
  4511. selector: false,
  4512. placement: 'top',
  4513. offset: 0,
  4514. container: false,
  4515. fallbackPlacement: 'flip',
  4516. boundary: 'scrollParent',
  4517. sanitize: true,
  4518. sanitizeFn: null,
  4519. whiteList: DefaultWhitelist
  4520. };
  4521. var HoverState = {
  4522. SHOW: 'show',
  4523. OUT: 'out'
  4524. };
  4525. var Event$6 = {
  4526. HIDE: "hide" + EVENT_KEY$6,
  4527. HIDDEN: "hidden" + EVENT_KEY$6,
  4528. SHOW: "show" + EVENT_KEY$6,
  4529. SHOWN: "shown" + EVENT_KEY$6,
  4530. INSERTED: "inserted" + EVENT_KEY$6,
  4531. CLICK: "click" + EVENT_KEY$6,
  4532. FOCUSIN: "focusin" + EVENT_KEY$6,
  4533. FOCUSOUT: "focusout" + EVENT_KEY$6,
  4534. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  4535. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  4536. };
  4537. var ClassName$6 = {
  4538. FADE: 'fade',
  4539. SHOW: 'show'
  4540. };
  4541. var Selector$6 = {
  4542. TOOLTIP: '.tooltip',
  4543. TOOLTIP_INNER: '.tooltip-inner',
  4544. ARROW: '.arrow'
  4545. };
  4546. var Trigger = {
  4547. HOVER: 'hover',
  4548. FOCUS: 'focus',
  4549. CLICK: 'click',
  4550. MANUAL: 'manual'
  4551. /**
  4552. * ------------------------------------------------------------------------
  4553. * Class Definition
  4554. * ------------------------------------------------------------------------
  4555. */
  4556. };
  4557. var Tooltip =
  4558. /*#__PURE__*/
  4559. function () {
  4560. function Tooltip(element, config) {
  4561. /**
  4562. * Check for Popper dependency
  4563. * Popper - https://popper.js.org
  4564. */
  4565. if (typeof Popper === 'undefined') {
  4566. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  4567. } // private
  4568. this._isEnabled = true;
  4569. this._timeout = 0;
  4570. this._hoverState = '';
  4571. this._activeTrigger = {};
  4572. this._popper = null; // Protected
  4573. this.element = element;
  4574. this.config = this._getConfig(config);
  4575. this.tip = null;
  4576. this._setListeners();
  4577. } // Getters
  4578. var _proto = Tooltip.prototype;
  4579. // Public
  4580. _proto.enable = function enable() {
  4581. this._isEnabled = true;
  4582. };
  4583. _proto.disable = function disable() {
  4584. this._isEnabled = false;
  4585. };
  4586. _proto.toggleEnabled = function toggleEnabled() {
  4587. this._isEnabled = !this._isEnabled;
  4588. };
  4589. _proto.toggle = function toggle(event) {
  4590. if (!this._isEnabled) {
  4591. return;
  4592. }
  4593. if (event) {
  4594. var dataKey = this.constructor.DATA_KEY;
  4595. var context = $(event.currentTarget).data(dataKey);
  4596. if (!context) {
  4597. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4598. $(event.currentTarget).data(dataKey, context);
  4599. }
  4600. context._activeTrigger.click = !context._activeTrigger.click;
  4601. if (context._isWithActiveTrigger()) {
  4602. context._enter(null, context);
  4603. } else {
  4604. context._leave(null, context);
  4605. }
  4606. } else {
  4607. if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
  4608. this._leave(null, this);
  4609. return;
  4610. }
  4611. this._enter(null, this);
  4612. }
  4613. };
  4614. _proto.dispose = function dispose() {
  4615. clearTimeout(this._timeout);
  4616. $.removeData(this.element, this.constructor.DATA_KEY);
  4617. $(this.element).off(this.constructor.EVENT_KEY);
  4618. $(this.element).closest('.modal').off('hide.bs.modal');
  4619. if (this.tip) {
  4620. $(this.tip).remove();
  4621. }
  4622. this._isEnabled = null;
  4623. this._timeout = null;
  4624. this._hoverState = null;
  4625. this._activeTrigger = null;
  4626. if (this._popper !== null) {
  4627. this._popper.destroy();
  4628. }
  4629. this._popper = null;
  4630. this.element = null;
  4631. this.config = null;
  4632. this.tip = null;
  4633. };
  4634. _proto.show = function show() {
  4635. var _this = this;
  4636. if ($(this.element).css('display') === 'none') {
  4637. throw new Error('Please use show on visible elements');
  4638. }
  4639. var showEvent = $.Event(this.constructor.Event.SHOW);
  4640. if (this.isWithContent() && this._isEnabled) {
  4641. $(this.element).trigger(showEvent);
  4642. var shadowRoot = Util.findShadowRoot(this.element);
  4643. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  4644. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  4645. return;
  4646. }
  4647. var tip = this.getTipElement();
  4648. var tipId = Util.getUID(this.constructor.NAME);
  4649. tip.setAttribute('id', tipId);
  4650. this.element.setAttribute('aria-describedby', tipId);
  4651. this.setContent();
  4652. if (this.config.animation) {
  4653. $(tip).addClass(ClassName$6.FADE);
  4654. }
  4655. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  4656. var attachment = this._getAttachment(placement);
  4657. this.addAttachmentClass(attachment);
  4658. var container = this._getContainer();
  4659. $(tip).data(this.constructor.DATA_KEY, this);
  4660. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  4661. $(tip).appendTo(container);
  4662. }
  4663. $(this.element).trigger(this.constructor.Event.INSERTED);
  4664. this._popper = new Popper(this.element, tip, {
  4665. placement: attachment,
  4666. modifiers: {
  4667. offset: this._getOffset(),
  4668. flip: {
  4669. behavior: this.config.fallbackPlacement
  4670. },
  4671. arrow: {
  4672. element: Selector$6.ARROW
  4673. },
  4674. preventOverflow: {
  4675. boundariesElement: this.config.boundary
  4676. }
  4677. },
  4678. onCreate: function onCreate(data) {
  4679. if (data.originalPlacement !== data.placement) {
  4680. _this._handlePopperPlacementChange(data);
  4681. }
  4682. },
  4683. onUpdate: function onUpdate(data) {
  4684. return _this._handlePopperPlacementChange(data);
  4685. }
  4686. });
  4687. $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
  4688. // empty mouseover listeners to the body's immediate children;
  4689. // only needed because of broken event delegation on iOS
  4690. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4691. if ('ontouchstart' in document.documentElement) {
  4692. $(document.body).children().on('mouseover', null, $.noop);
  4693. }
  4694. var complete = function complete() {
  4695. if (_this.config.animation) {
  4696. _this._fixTransition();
  4697. }
  4698. var prevHoverState = _this._hoverState;
  4699. _this._hoverState = null;
  4700. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  4701. if (prevHoverState === HoverState.OUT) {
  4702. _this._leave(null, _this);
  4703. }
  4704. };
  4705. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  4706. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  4707. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4708. } else {
  4709. complete();
  4710. }
  4711. }
  4712. };
  4713. _proto.hide = function hide(callback) {
  4714. var _this2 = this;
  4715. var tip = this.getTipElement();
  4716. var hideEvent = $.Event(this.constructor.Event.HIDE);
  4717. var complete = function complete() {
  4718. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  4719. tip.parentNode.removeChild(tip);
  4720. }
  4721. _this2._cleanTipClass();
  4722. _this2.element.removeAttribute('aria-describedby');
  4723. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  4724. if (_this2._popper !== null) {
  4725. _this2._popper.destroy();
  4726. }
  4727. if (callback) {
  4728. callback();
  4729. }
  4730. };
  4731. $(this.element).trigger(hideEvent);
  4732. if (hideEvent.isDefaultPrevented()) {
  4733. return;
  4734. }
  4735. $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
  4736. // empty mouseover listeners we added for iOS support
  4737. if ('ontouchstart' in document.documentElement) {
  4738. $(document.body).children().off('mouseover', null, $.noop);
  4739. }
  4740. this._activeTrigger[Trigger.CLICK] = false;
  4741. this._activeTrigger[Trigger.FOCUS] = false;
  4742. this._activeTrigger[Trigger.HOVER] = false;
  4743. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  4744. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  4745. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4746. } else {
  4747. complete();
  4748. }
  4749. this._hoverState = '';
  4750. };
  4751. _proto.update = function update() {
  4752. if (this._popper !== null) {
  4753. this._popper.scheduleUpdate();
  4754. }
  4755. } // Protected
  4756. ;
  4757. _proto.isWithContent = function isWithContent() {
  4758. return Boolean(this.getTitle());
  4759. };
  4760. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  4761. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  4762. };
  4763. _proto.getTipElement = function getTipElement() {
  4764. this.tip = this.tip || $(this.config.template)[0];
  4765. return this.tip;
  4766. };
  4767. _proto.setContent = function setContent() {
  4768. var tip = this.getTipElement();
  4769. this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
  4770. $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
  4771. };
  4772. _proto.setElementContent = function setElementContent($element, content) {
  4773. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  4774. // Content is a DOM node or a jQuery
  4775. if (this.config.html) {
  4776. if (!$(content).parent().is($element)) {
  4777. $element.empty().append(content);
  4778. }
  4779. } else {
  4780. $element.text($(content).text());
  4781. }
  4782. return;
  4783. }
  4784. if (this.config.html) {
  4785. if (this.config.sanitize) {
  4786. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  4787. }
  4788. $element.html(content);
  4789. } else {
  4790. $element.text(content);
  4791. }
  4792. };
  4793. _proto.getTitle = function getTitle() {
  4794. var title = this.element.getAttribute('data-original-title');
  4795. if (!title) {
  4796. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  4797. }
  4798. return title;
  4799. } // Private
  4800. ;
  4801. _proto._getOffset = function _getOffset() {
  4802. var _this3 = this;
  4803. var offset = {};
  4804. if (typeof this.config.offset === 'function') {
  4805. offset.fn = function (data) {
  4806. data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
  4807. return data;
  4808. };
  4809. } else {
  4810. offset.offset = this.config.offset;
  4811. }
  4812. return offset;
  4813. };
  4814. _proto._getContainer = function _getContainer() {
  4815. if (this.config.container === false) {
  4816. return document.body;
  4817. }
  4818. if (Util.isElement(this.config.container)) {
  4819. return $(this.config.container);
  4820. }
  4821. return $(document).find(this.config.container);
  4822. };
  4823. _proto._getAttachment = function _getAttachment(placement) {
  4824. return AttachmentMap$1[placement.toUpperCase()];
  4825. };
  4826. _proto._setListeners = function _setListeners() {
  4827. var _this4 = this;
  4828. var triggers = this.config.trigger.split(' ');
  4829. triggers.forEach(function (trigger) {
  4830. if (trigger === 'click') {
  4831. $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
  4832. return _this4.toggle(event);
  4833. });
  4834. } else if (trigger !== Trigger.MANUAL) {
  4835. var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
  4836. var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
  4837. $(_this4.element).on(eventIn, _this4.config.selector, function (event) {
  4838. return _this4._enter(event);
  4839. }).on(eventOut, _this4.config.selector, function (event) {
  4840. return _this4._leave(event);
  4841. });
  4842. }
  4843. });
  4844. $(this.element).closest('.modal').on('hide.bs.modal', function () {
  4845. if (_this4.element) {
  4846. _this4.hide();
  4847. }
  4848. });
  4849. if (this.config.selector) {
  4850. this.config = _objectSpread({}, this.config, {
  4851. trigger: 'manual',
  4852. selector: ''
  4853. });
  4854. } else {
  4855. this._fixTitle();
  4856. }
  4857. };
  4858. _proto._fixTitle = function _fixTitle() {
  4859. var titleType = typeof this.element.getAttribute('data-original-title');
  4860. if (this.element.getAttribute('title') || titleType !== 'string') {
  4861. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  4862. this.element.setAttribute('title', '');
  4863. }
  4864. };
  4865. _proto._enter = function _enter(event, context) {
  4866. var dataKey = this.constructor.DATA_KEY;
  4867. context = context || $(event.currentTarget).data(dataKey);
  4868. if (!context) {
  4869. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4870. $(event.currentTarget).data(dataKey, context);
  4871. }
  4872. if (event) {
  4873. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  4874. }
  4875. if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
  4876. context._hoverState = HoverState.SHOW;
  4877. return;
  4878. }
  4879. clearTimeout(context._timeout);
  4880. context._hoverState = HoverState.SHOW;
  4881. if (!context.config.delay || !context.config.delay.show) {
  4882. context.show();
  4883. return;
  4884. }
  4885. context._timeout = setTimeout(function () {
  4886. if (context._hoverState === HoverState.SHOW) {
  4887. context.show();
  4888. }
  4889. }, context.config.delay.show);
  4890. };
  4891. _proto._leave = function _leave(event, context) {
  4892. var dataKey = this.constructor.DATA_KEY;
  4893. context = context || $(event.currentTarget).data(dataKey);
  4894. if (!context) {
  4895. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4896. $(event.currentTarget).data(dataKey, context);
  4897. }
  4898. if (event) {
  4899. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  4900. }
  4901. if (context._isWithActiveTrigger()) {
  4902. return;
  4903. }
  4904. clearTimeout(context._timeout);
  4905. context._hoverState = HoverState.OUT;
  4906. if (!context.config.delay || !context.config.delay.hide) {
  4907. context.hide();
  4908. return;
  4909. }
  4910. context._timeout = setTimeout(function () {
  4911. if (context._hoverState === HoverState.OUT) {
  4912. context.hide();
  4913. }
  4914. }, context.config.delay.hide);
  4915. };
  4916. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  4917. for (var trigger in this._activeTrigger) {
  4918. if (this._activeTrigger[trigger]) {
  4919. return true;
  4920. }
  4921. }
  4922. return false;
  4923. };
  4924. _proto._getConfig = function _getConfig(config) {
  4925. var dataAttributes = $(this.element).data();
  4926. Object.keys(dataAttributes).forEach(function (dataAttr) {
  4927. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  4928. delete dataAttributes[dataAttr];
  4929. }
  4930. });
  4931. config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
  4932. if (typeof config.delay === 'number') {
  4933. config.delay = {
  4934. show: config.delay,
  4935. hide: config.delay
  4936. };
  4937. }
  4938. if (typeof config.title === 'number') {
  4939. config.title = config.title.toString();
  4940. }
  4941. if (typeof config.content === 'number') {
  4942. config.content = config.content.toString();
  4943. }
  4944. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  4945. if (config.sanitize) {
  4946. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  4947. }
  4948. return config;
  4949. };
  4950. _proto._getDelegateConfig = function _getDelegateConfig() {
  4951. var config = {};
  4952. if (this.config) {
  4953. for (var key in this.config) {
  4954. if (this.constructor.Default[key] !== this.config[key]) {
  4955. config[key] = this.config[key];
  4956. }
  4957. }
  4958. }
  4959. return config;
  4960. };
  4961. _proto._cleanTipClass = function _cleanTipClass() {
  4962. var $tip = $(this.getTipElement());
  4963. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  4964. if (tabClass !== null && tabClass.length) {
  4965. $tip.removeClass(tabClass.join(''));
  4966. }
  4967. };
  4968. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  4969. var popperInstance = popperData.instance;
  4970. this.tip = popperInstance.popper;
  4971. this._cleanTipClass();
  4972. this.addAttachmentClass(this._getAttachment(popperData.placement));
  4973. };
  4974. _proto._fixTransition = function _fixTransition() {
  4975. var tip = this.getTipElement();
  4976. var initConfigAnimation = this.config.animation;
  4977. if (tip.getAttribute('x-placement') !== null) {
  4978. return;
  4979. }
  4980. $(tip).removeClass(ClassName$6.FADE);
  4981. this.config.animation = false;
  4982. this.hide();
  4983. this.show();
  4984. this.config.animation = initConfigAnimation;
  4985. } // Static
  4986. ;
  4987. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  4988. return this.each(function () {
  4989. var data = $(this).data(DATA_KEY$6);
  4990. var _config = typeof config === 'object' && config;
  4991. if (!data && /dispose|hide/.test(config)) {
  4992. return;
  4993. }
  4994. if (!data) {
  4995. data = new Tooltip(this, _config);
  4996. $(this).data(DATA_KEY$6, data);
  4997. }
  4998. if (typeof config === 'string') {
  4999. if (typeof data[config] === 'undefined') {
  5000. throw new TypeError("No method named \"" + config + "\"");
  5001. }
  5002. data[config]();
  5003. }
  5004. });
  5005. };
  5006. _createClass(Tooltip, null, [{
  5007. key: "VERSION",
  5008. get: function get() {
  5009. return VERSION$6;
  5010. }
  5011. }, {
  5012. key: "Default",
  5013. get: function get() {
  5014. return Default$4;
  5015. }
  5016. }, {
  5017. key: "NAME",
  5018. get: function get() {
  5019. return NAME$6;
  5020. }
  5021. }, {
  5022. key: "DATA_KEY",
  5023. get: function get() {
  5024. return DATA_KEY$6;
  5025. }
  5026. }, {
  5027. key: "Event",
  5028. get: function get() {
  5029. return Event$6;
  5030. }
  5031. }, {
  5032. key: "EVENT_KEY",
  5033. get: function get() {
  5034. return EVENT_KEY$6;
  5035. }
  5036. }, {
  5037. key: "DefaultType",
  5038. get: function get() {
  5039. return DefaultType$4;
  5040. }
  5041. }]);
  5042. return Tooltip;
  5043. }();
  5044. /**
  5045. * ------------------------------------------------------------------------
  5046. * jQuery
  5047. * ------------------------------------------------------------------------
  5048. */
  5049. $.fn[NAME$6] = Tooltip._jQueryInterface;
  5050. $.fn[NAME$6].Constructor = Tooltip;
  5051. $.fn[NAME$6].noConflict = function () {
  5052. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  5053. return Tooltip._jQueryInterface;
  5054. };
  5055. /**
  5056. * ------------------------------------------------------------------------
  5057. * Constants
  5058. * ------------------------------------------------------------------------
  5059. */
  5060. var NAME$7 = 'popover';
  5061. var VERSION$7 = '4.3.1';
  5062. var DATA_KEY$7 = 'bs.popover';
  5063. var EVENT_KEY$7 = "." + DATA_KEY$7;
  5064. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  5065. var CLASS_PREFIX$1 = 'bs-popover';
  5066. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  5067. var Default$5 = _objectSpread({}, Tooltip.Default, {
  5068. placement: 'right',
  5069. trigger: 'click',
  5070. content: '',
  5071. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  5072. });
  5073. var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {
  5074. content: '(string|element|function)'
  5075. });
  5076. var ClassName$7 = {
  5077. FADE: 'fade',
  5078. SHOW: 'show'
  5079. };
  5080. var Selector$7 = {
  5081. TITLE: '.popover-header',
  5082. CONTENT: '.popover-body'
  5083. };
  5084. var Event$7 = {
  5085. HIDE: "hide" + EVENT_KEY$7,
  5086. HIDDEN: "hidden" + EVENT_KEY$7,
  5087. SHOW: "show" + EVENT_KEY$7,
  5088. SHOWN: "shown" + EVENT_KEY$7,
  5089. INSERTED: "inserted" + EVENT_KEY$7,
  5090. CLICK: "click" + EVENT_KEY$7,
  5091. FOCUSIN: "focusin" + EVENT_KEY$7,
  5092. FOCUSOUT: "focusout" + EVENT_KEY$7,
  5093. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  5094. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  5095. /**
  5096. * ------------------------------------------------------------------------
  5097. * Class Definition
  5098. * ------------------------------------------------------------------------
  5099. */
  5100. };
  5101. var Popover =
  5102. /*#__PURE__*/
  5103. function (_Tooltip) {
  5104. _inheritsLoose(Popover, _Tooltip);
  5105. function Popover() {
  5106. return _Tooltip.apply(this, arguments) || this;
  5107. }
  5108. var _proto = Popover.prototype;
  5109. // Overrides
  5110. _proto.isWithContent = function isWithContent() {
  5111. return this.getTitle() || this._getContent();
  5112. };
  5113. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  5114. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  5115. };
  5116. _proto.getTipElement = function getTipElement() {
  5117. this.tip = this.tip || $(this.config.template)[0];
  5118. return this.tip;
  5119. };
  5120. _proto.setContent = function setContent() {
  5121. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  5122. this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
  5123. var content = this._getContent();
  5124. if (typeof content === 'function') {
  5125. content = content.call(this.element);
  5126. }
  5127. this.setElementContent($tip.find(Selector$7.CONTENT), content);
  5128. $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
  5129. } // Private
  5130. ;
  5131. _proto._getContent = function _getContent() {
  5132. return this.element.getAttribute('data-content') || this.config.content;
  5133. };
  5134. _proto._cleanTipClass = function _cleanTipClass() {
  5135. var $tip = $(this.getTipElement());
  5136. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  5137. if (tabClass !== null && tabClass.length > 0) {
  5138. $tip.removeClass(tabClass.join(''));
  5139. }
  5140. } // Static
  5141. ;
  5142. Popover._jQueryInterface = function _jQueryInterface(config) {
  5143. return this.each(function () {
  5144. var data = $(this).data(DATA_KEY$7);
  5145. var _config = typeof config === 'object' ? config : null;
  5146. if (!data && /dispose|hide/.test(config)) {
  5147. return;
  5148. }
  5149. if (!data) {
  5150. data = new Popover(this, _config);
  5151. $(this).data(DATA_KEY$7, data);
  5152. }
  5153. if (typeof config === 'string') {
  5154. if (typeof data[config] === 'undefined') {
  5155. throw new TypeError("No method named \"" + config + "\"");
  5156. }
  5157. data[config]();
  5158. }
  5159. });
  5160. };
  5161. _createClass(Popover, null, [{
  5162. key: "VERSION",
  5163. // Getters
  5164. get: function get() {
  5165. return VERSION$7;
  5166. }
  5167. }, {
  5168. key: "Default",
  5169. get: function get() {
  5170. return Default$5;
  5171. }
  5172. }, {
  5173. key: "NAME",
  5174. get: function get() {
  5175. return NAME$7;
  5176. }
  5177. }, {
  5178. key: "DATA_KEY",
  5179. get: function get() {
  5180. return DATA_KEY$7;
  5181. }
  5182. }, {
  5183. key: "Event",
  5184. get: function get() {
  5185. return Event$7;
  5186. }
  5187. }, {
  5188. key: "EVENT_KEY",
  5189. get: function get() {
  5190. return EVENT_KEY$7;
  5191. }
  5192. }, {
  5193. key: "DefaultType",
  5194. get: function get() {
  5195. return DefaultType$5;
  5196. }
  5197. }]);
  5198. return Popover;
  5199. }(Tooltip);
  5200. /**
  5201. * ------------------------------------------------------------------------
  5202. * jQuery
  5203. * ------------------------------------------------------------------------
  5204. */
  5205. $.fn[NAME$7] = Popover._jQueryInterface;
  5206. $.fn[NAME$7].Constructor = Popover;
  5207. $.fn[NAME$7].noConflict = function () {
  5208. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  5209. return Popover._jQueryInterface;
  5210. };
  5211. /**
  5212. * ------------------------------------------------------------------------
  5213. * Constants
  5214. * ------------------------------------------------------------------------
  5215. */
  5216. var NAME$8 = 'scrollspy';
  5217. var VERSION$8 = '4.3.1';
  5218. var DATA_KEY$8 = 'bs.scrollspy';
  5219. var EVENT_KEY$8 = "." + DATA_KEY$8;
  5220. var DATA_API_KEY$6 = '.data-api';
  5221. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  5222. var Default$6 = {
  5223. offset: 10,
  5224. method: 'auto',
  5225. target: ''
  5226. };
  5227. var DefaultType$6 = {
  5228. offset: 'number',
  5229. method: 'string',
  5230. target: '(string|element)'
  5231. };
  5232. var Event$8 = {
  5233. ACTIVATE: "activate" + EVENT_KEY$8,
  5234. SCROLL: "scroll" + EVENT_KEY$8,
  5235. LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  5236. };
  5237. var ClassName$8 = {
  5238. DROPDOWN_ITEM: 'dropdown-item',
  5239. DROPDOWN_MENU: 'dropdown-menu',
  5240. ACTIVE: 'active'
  5241. };
  5242. var Selector$8 = {
  5243. DATA_SPY: '[data-spy="scroll"]',
  5244. ACTIVE: '.active',
  5245. NAV_LIST_GROUP: '.nav, .list-group',
  5246. NAV_LINKS: '.nav-link',
  5247. NAV_ITEMS: '.nav-item',
  5248. LIST_ITEMS: '.list-group-item',
  5249. DROPDOWN: '.dropdown',
  5250. DROPDOWN_ITEMS: '.dropdown-item',
  5251. DROPDOWN_TOGGLE: '.dropdown-toggle'
  5252. };
  5253. var OffsetMethod = {
  5254. OFFSET: 'offset',
  5255. POSITION: 'position'
  5256. /**
  5257. * ------------------------------------------------------------------------
  5258. * Class Definition
  5259. * ------------------------------------------------------------------------
  5260. */
  5261. };
  5262. var ScrollSpy =
  5263. /*#__PURE__*/
  5264. function () {
  5265. function ScrollSpy(element, config) {
  5266. var _this = this;
  5267. this._element = element;
  5268. this._scrollElement = element.tagName === 'BODY' ? window : element;
  5269. this._config = this._getConfig(config);
  5270. this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
  5271. this._offsets = [];
  5272. this._targets = [];
  5273. this._activeTarget = null;
  5274. this._scrollHeight = 0;
  5275. $(this._scrollElement).on(Event$8.SCROLL, function (event) {
  5276. return _this._process(event);
  5277. });
  5278. this.refresh();
  5279. this._process();
  5280. } // Getters
  5281. var _proto = ScrollSpy.prototype;
  5282. // Public
  5283. _proto.refresh = function refresh() {
  5284. var _this2 = this;
  5285. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  5286. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  5287. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  5288. this._offsets = [];
  5289. this._targets = [];
  5290. this._scrollHeight = this._getScrollHeight();
  5291. var targets = [].slice.call(document.querySelectorAll(this._selector));
  5292. targets.map(function (element) {
  5293. var target;
  5294. var targetSelector = Util.getSelectorFromElement(element);
  5295. if (targetSelector) {
  5296. target = document.querySelector(targetSelector);
  5297. }
  5298. if (target) {
  5299. var targetBCR = target.getBoundingClientRect();
  5300. if (targetBCR.width || targetBCR.height) {
  5301. // TODO (fat): remove sketch reliance on jQuery position/offset
  5302. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  5303. }
  5304. }
  5305. return null;
  5306. }).filter(function (item) {
  5307. return item;
  5308. }).sort(function (a, b) {
  5309. return a[0] - b[0];
  5310. }).forEach(function (item) {
  5311. _this2._offsets.push(item[0]);
  5312. _this2._targets.push(item[1]);
  5313. });
  5314. };
  5315. _proto.dispose = function dispose() {
  5316. $.removeData(this._element, DATA_KEY$8);
  5317. $(this._scrollElement).off(EVENT_KEY$8);
  5318. this._element = null;
  5319. this._scrollElement = null;
  5320. this._config = null;
  5321. this._selector = null;
  5322. this._offsets = null;
  5323. this._targets = null;
  5324. this._activeTarget = null;
  5325. this._scrollHeight = null;
  5326. } // Private
  5327. ;
  5328. _proto._getConfig = function _getConfig(config) {
  5329. config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});
  5330. if (typeof config.target !== 'string') {
  5331. var id = $(config.target).attr('id');
  5332. if (!id) {
  5333. id = Util.getUID(NAME$8);
  5334. $(config.target).attr('id', id);
  5335. }
  5336. config.target = "#" + id;
  5337. }
  5338. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  5339. return config;
  5340. };
  5341. _proto._getScrollTop = function _getScrollTop() {
  5342. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  5343. };
  5344. _proto._getScrollHeight = function _getScrollHeight() {
  5345. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  5346. };
  5347. _proto._getOffsetHeight = function _getOffsetHeight() {
  5348. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  5349. };
  5350. _proto._process = function _process() {
  5351. var scrollTop = this._getScrollTop() + this._config.offset;
  5352. var scrollHeight = this._getScrollHeight();
  5353. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  5354. if (this._scrollHeight !== scrollHeight) {
  5355. this.refresh();
  5356. }
  5357. if (scrollTop >= maxScroll) {
  5358. var target = this._targets[this._targets.length - 1];
  5359. if (this._activeTarget !== target) {
  5360. this._activate(target);
  5361. }
  5362. return;
  5363. }
  5364. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  5365. this._activeTarget = null;
  5366. this._clear();
  5367. return;
  5368. }
  5369. var offsetLength = this._offsets.length;
  5370. for (var i = offsetLength; i--;) {
  5371. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  5372. if (isActiveTarget) {
  5373. this._activate(this._targets[i]);
  5374. }
  5375. }
  5376. };
  5377. _proto._activate = function _activate(target) {
  5378. this._activeTarget = target;
  5379. this._clear();
  5380. var queries = this._selector.split(',').map(function (selector) {
  5381. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  5382. });
  5383. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  5384. if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
  5385. $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
  5386. $link.addClass(ClassName$8.ACTIVE);
  5387. } else {
  5388. // Set triggered link as active
  5389. $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
  5390. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  5391. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
  5392. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
  5393. }
  5394. $(this._scrollElement).trigger(Event$8.ACTIVATE, {
  5395. relatedTarget: target
  5396. });
  5397. };
  5398. _proto._clear = function _clear() {
  5399. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  5400. return node.classList.contains(ClassName$8.ACTIVE);
  5401. }).forEach(function (node) {
  5402. return node.classList.remove(ClassName$8.ACTIVE);
  5403. });
  5404. } // Static
  5405. ;
  5406. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  5407. return this.each(function () {
  5408. var data = $(this).data(DATA_KEY$8);
  5409. var _config = typeof config === 'object' && config;
  5410. if (!data) {
  5411. data = new ScrollSpy(this, _config);
  5412. $(this).data(DATA_KEY$8, data);
  5413. }
  5414. if (typeof config === 'string') {
  5415. if (typeof data[config] === 'undefined') {
  5416. throw new TypeError("No method named \"" + config + "\"");
  5417. }
  5418. data[config]();
  5419. }
  5420. });
  5421. };
  5422. _createClass(ScrollSpy, null, [{
  5423. key: "VERSION",
  5424. get: function get() {
  5425. return VERSION$8;
  5426. }
  5427. }, {
  5428. key: "Default",
  5429. get: function get() {
  5430. return Default$6;
  5431. }
  5432. }]);
  5433. return ScrollSpy;
  5434. }();
  5435. /**
  5436. * ------------------------------------------------------------------------
  5437. * Data Api implementation
  5438. * ------------------------------------------------------------------------
  5439. */
  5440. $(window).on(Event$8.LOAD_DATA_API, function () {
  5441. var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
  5442. var scrollSpysLength = scrollSpys.length;
  5443. for (var i = scrollSpysLength; i--;) {
  5444. var $spy = $(scrollSpys[i]);
  5445. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  5446. }
  5447. });
  5448. /**
  5449. * ------------------------------------------------------------------------
  5450. * jQuery
  5451. * ------------------------------------------------------------------------
  5452. */
  5453. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  5454. $.fn[NAME$8].Constructor = ScrollSpy;
  5455. $.fn[NAME$8].noConflict = function () {
  5456. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  5457. return ScrollSpy._jQueryInterface;
  5458. };
  5459. /**
  5460. * ------------------------------------------------------------------------
  5461. * Constants
  5462. * ------------------------------------------------------------------------
  5463. */
  5464. var NAME$9 = 'tab';
  5465. var VERSION$9 = '4.3.1';
  5466. var DATA_KEY$9 = 'bs.tab';
  5467. var EVENT_KEY$9 = "." + DATA_KEY$9;
  5468. var DATA_API_KEY$7 = '.data-api';
  5469. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  5470. var Event$9 = {
  5471. HIDE: "hide" + EVENT_KEY$9,
  5472. HIDDEN: "hidden" + EVENT_KEY$9,
  5473. SHOW: "show" + EVENT_KEY$9,
  5474. SHOWN: "shown" + EVENT_KEY$9,
  5475. CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  5476. };
  5477. var ClassName$9 = {
  5478. DROPDOWN_MENU: 'dropdown-menu',
  5479. ACTIVE: 'active',
  5480. DISABLED: 'disabled',
  5481. FADE: 'fade',
  5482. SHOW: 'show'
  5483. };
  5484. var Selector$9 = {
  5485. DROPDOWN: '.dropdown',
  5486. NAV_LIST_GROUP: '.nav, .list-group',
  5487. ACTIVE: '.active',
  5488. ACTIVE_UL: '> li > .active',
  5489. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  5490. DROPDOWN_TOGGLE: '.dropdown-toggle',
  5491. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  5492. /**
  5493. * ------------------------------------------------------------------------
  5494. * Class Definition
  5495. * ------------------------------------------------------------------------
  5496. */
  5497. };
  5498. var Tab =
  5499. /*#__PURE__*/
  5500. function () {
  5501. function Tab(element) {
  5502. this._element = element;
  5503. } // Getters
  5504. var _proto = Tab.prototype;
  5505. // Public
  5506. _proto.show = function show() {
  5507. var _this = this;
  5508. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
  5509. return;
  5510. }
  5511. var target;
  5512. var previous;
  5513. var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
  5514. var selector = Util.getSelectorFromElement(this._element);
  5515. if (listElement) {
  5516. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
  5517. previous = $.makeArray($(listElement).find(itemSelector));
  5518. previous = previous[previous.length - 1];
  5519. }
  5520. var hideEvent = $.Event(Event$9.HIDE, {
  5521. relatedTarget: this._element
  5522. });
  5523. var showEvent = $.Event(Event$9.SHOW, {
  5524. relatedTarget: previous
  5525. });
  5526. if (previous) {
  5527. $(previous).trigger(hideEvent);
  5528. }
  5529. $(this._element).trigger(showEvent);
  5530. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  5531. return;
  5532. }
  5533. if (selector) {
  5534. target = document.querySelector(selector);
  5535. }
  5536. this._activate(this._element, listElement);
  5537. var complete = function complete() {
  5538. var hiddenEvent = $.Event(Event$9.HIDDEN, {
  5539. relatedTarget: _this._element
  5540. });
  5541. var shownEvent = $.Event(Event$9.SHOWN, {
  5542. relatedTarget: previous
  5543. });
  5544. $(previous).trigger(hiddenEvent);
  5545. $(_this._element).trigger(shownEvent);
  5546. };
  5547. if (target) {
  5548. this._activate(target, target.parentNode, complete);
  5549. } else {
  5550. complete();
  5551. }
  5552. };
  5553. _proto.dispose = function dispose() {
  5554. $.removeData(this._element, DATA_KEY$9);
  5555. this._element = null;
  5556. } // Private
  5557. ;
  5558. _proto._activate = function _activate(element, container, callback) {
  5559. var _this2 = this;
  5560. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
  5561. var active = activeElements[0];
  5562. var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
  5563. var complete = function complete() {
  5564. return _this2._transitionComplete(element, active, callback);
  5565. };
  5566. if (active && isTransitioning) {
  5567. var transitionDuration = Util.getTransitionDurationFromElement(active);
  5568. $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5569. } else {
  5570. complete();
  5571. }
  5572. };
  5573. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  5574. if (active) {
  5575. $(active).removeClass(ClassName$9.ACTIVE);
  5576. var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
  5577. if (dropdownChild) {
  5578. $(dropdownChild).removeClass(ClassName$9.ACTIVE);
  5579. }
  5580. if (active.getAttribute('role') === 'tab') {
  5581. active.setAttribute('aria-selected', false);
  5582. }
  5583. }
  5584. $(element).addClass(ClassName$9.ACTIVE);
  5585. if (element.getAttribute('role') === 'tab') {
  5586. element.setAttribute('aria-selected', true);
  5587. }
  5588. Util.reflow(element);
  5589. if (element.classList.contains(ClassName$9.FADE)) {
  5590. element.classList.add(ClassName$9.SHOW);
  5591. }
  5592. if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
  5593. var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
  5594. if (dropdownElement) {
  5595. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
  5596. $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
  5597. }
  5598. element.setAttribute('aria-expanded', true);
  5599. }
  5600. if (callback) {
  5601. callback();
  5602. }
  5603. } // Static
  5604. ;
  5605. Tab._jQueryInterface = function _jQueryInterface(config) {
  5606. return this.each(function () {
  5607. var $this = $(this);
  5608. var data = $this.data(DATA_KEY$9);
  5609. if (!data) {
  5610. data = new Tab(this);
  5611. $this.data(DATA_KEY$9, data);
  5612. }
  5613. if (typeof config === 'string') {
  5614. if (typeof data[config] === 'undefined') {
  5615. throw new TypeError("No method named \"" + config + "\"");
  5616. }
  5617. data[config]();
  5618. }
  5619. });
  5620. };
  5621. _createClass(Tab, null, [{
  5622. key: "VERSION",
  5623. get: function get() {
  5624. return VERSION$9;
  5625. }
  5626. }]);
  5627. return Tab;
  5628. }();
  5629. /**
  5630. * ------------------------------------------------------------------------
  5631. * Data Api implementation
  5632. * ------------------------------------------------------------------------
  5633. */
  5634. $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  5635. event.preventDefault();
  5636. Tab._jQueryInterface.call($(this), 'show');
  5637. });
  5638. /**
  5639. * ------------------------------------------------------------------------
  5640. * jQuery
  5641. * ------------------------------------------------------------------------
  5642. */
  5643. $.fn[NAME$9] = Tab._jQueryInterface;
  5644. $.fn[NAME$9].Constructor = Tab;
  5645. $.fn[NAME$9].noConflict = function () {
  5646. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  5647. return Tab._jQueryInterface;
  5648. };
  5649. /**
  5650. * ------------------------------------------------------------------------
  5651. * Constants
  5652. * ------------------------------------------------------------------------
  5653. */
  5654. var NAME$a = 'toast';
  5655. var VERSION$a = '4.3.1';
  5656. var DATA_KEY$a = 'bs.toast';
  5657. var EVENT_KEY$a = "." + DATA_KEY$a;
  5658. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  5659. var Event$a = {
  5660. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  5661. HIDE: "hide" + EVENT_KEY$a,
  5662. HIDDEN: "hidden" + EVENT_KEY$a,
  5663. SHOW: "show" + EVENT_KEY$a,
  5664. SHOWN: "shown" + EVENT_KEY$a
  5665. };
  5666. var ClassName$a = {
  5667. FADE: 'fade',
  5668. HIDE: 'hide',
  5669. SHOW: 'show',
  5670. SHOWING: 'showing'
  5671. };
  5672. var DefaultType$7 = {
  5673. animation: 'boolean',
  5674. autohide: 'boolean',
  5675. delay: 'number'
  5676. };
  5677. var Default$7 = {
  5678. animation: true,
  5679. autohide: true,
  5680. delay: 500
  5681. };
  5682. var Selector$a = {
  5683. DATA_DISMISS: '[data-dismiss="toast"]'
  5684. /**
  5685. * ------------------------------------------------------------------------
  5686. * Class Definition
  5687. * ------------------------------------------------------------------------
  5688. */
  5689. };
  5690. var Toast =
  5691. /*#__PURE__*/
  5692. function () {
  5693. function Toast(element, config) {
  5694. this._element = element;
  5695. this._config = this._getConfig(config);
  5696. this._timeout = null;
  5697. this._setListeners();
  5698. } // Getters
  5699. var _proto = Toast.prototype;
  5700. // Public
  5701. _proto.show = function show() {
  5702. var _this = this;
  5703. $(this._element).trigger(Event$a.SHOW);
  5704. if (this._config.animation) {
  5705. this._element.classList.add(ClassName$a.FADE);
  5706. }
  5707. var complete = function complete() {
  5708. _this._element.classList.remove(ClassName$a.SHOWING);
  5709. _this._element.classList.add(ClassName$a.SHOW);
  5710. $(_this._element).trigger(Event$a.SHOWN);
  5711. if (_this._config.autohide) {
  5712. _this.hide();
  5713. }
  5714. };
  5715. this._element.classList.remove(ClassName$a.HIDE);
  5716. this._element.classList.add(ClassName$a.SHOWING);
  5717. if (this._config.animation) {
  5718. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5719. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5720. } else {
  5721. complete();
  5722. }
  5723. };
  5724. _proto.hide = function hide(withoutTimeout) {
  5725. var _this2 = this;
  5726. if (!this._element.classList.contains(ClassName$a.SHOW)) {
  5727. return;
  5728. }
  5729. $(this._element).trigger(Event$a.HIDE);
  5730. if (withoutTimeout) {
  5731. this._close();
  5732. } else {
  5733. this._timeout = setTimeout(function () {
  5734. _this2._close();
  5735. }, this._config.delay);
  5736. }
  5737. };
  5738. _proto.dispose = function dispose() {
  5739. clearTimeout(this._timeout);
  5740. this._timeout = null;
  5741. if (this._element.classList.contains(ClassName$a.SHOW)) {
  5742. this._element.classList.remove(ClassName$a.SHOW);
  5743. }
  5744. $(this._element).off(Event$a.CLICK_DISMISS);
  5745. $.removeData(this._element, DATA_KEY$a);
  5746. this._element = null;
  5747. this._config = null;
  5748. } // Private
  5749. ;
  5750. _proto._getConfig = function _getConfig(config) {
  5751. config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {});
  5752. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  5753. return config;
  5754. };
  5755. _proto._setListeners = function _setListeners() {
  5756. var _this3 = this;
  5757. $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
  5758. return _this3.hide(true);
  5759. });
  5760. };
  5761. _proto._close = function _close() {
  5762. var _this4 = this;
  5763. var complete = function complete() {
  5764. _this4._element.classList.add(ClassName$a.HIDE);
  5765. $(_this4._element).trigger(Event$a.HIDDEN);
  5766. };
  5767. this._element.classList.remove(ClassName$a.SHOW);
  5768. if (this._config.animation) {
  5769. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5770. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5771. } else {
  5772. complete();
  5773. }
  5774. } // Static
  5775. ;
  5776. Toast._jQueryInterface = function _jQueryInterface(config) {
  5777. return this.each(function () {
  5778. var $element = $(this);
  5779. var data = $element.data(DATA_KEY$a);
  5780. var _config = typeof config === 'object' && config;
  5781. if (!data) {
  5782. data = new Toast(this, _config);
  5783. $element.data(DATA_KEY$a, data);
  5784. }
  5785. if (typeof config === 'string') {
  5786. if (typeof data[config] === 'undefined') {
  5787. throw new TypeError("No method named \"" + config + "\"");
  5788. }
  5789. data[config](this);
  5790. }
  5791. });
  5792. };
  5793. _createClass(Toast, null, [{
  5794. key: "VERSION",
  5795. get: function get() {
  5796. return VERSION$a;
  5797. }
  5798. }, {
  5799. key: "DefaultType",
  5800. get: function get() {
  5801. return DefaultType$7;
  5802. }
  5803. }, {
  5804. key: "Default",
  5805. get: function get() {
  5806. return Default$7;
  5807. }
  5808. }]);
  5809. return Toast;
  5810. }();
  5811. /**
  5812. * ------------------------------------------------------------------------
  5813. * jQuery
  5814. * ------------------------------------------------------------------------
  5815. */
  5816. $.fn[NAME$a] = Toast._jQueryInterface;
  5817. $.fn[NAME$a].Constructor = Toast;
  5818. $.fn[NAME$a].noConflict = function () {
  5819. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  5820. return Toast._jQueryInterface;
  5821. };
  5822. /**
  5823. * --------------------------------------------------------------------------
  5824. * Bootstrap (v4.3.1): index.js
  5825. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5826. * --------------------------------------------------------------------------
  5827. */
  5828. (function () {
  5829. if (typeof $ === 'undefined') {
  5830. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  5831. }
  5832. var version = $.fn.jquery.split(' ')[0].split('.');
  5833. var minMajor = 1;
  5834. var ltMajor = 2;
  5835. var minMinor = 9;
  5836. var minPatch = 1;
  5837. var maxMajor = 4;
  5838. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  5839. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  5840. }
  5841. })();
  5842. exports.Util = Util;
  5843. exports.Alert = Alert;
  5844. exports.Button = Button;
  5845. exports.Carousel = Carousel;
  5846. exports.Collapse = Collapse;
  5847. exports.Dropdown = Dropdown;
  5848. exports.Modal = Modal;
  5849. exports.Popover = Popover;
  5850. exports.Scrollspy = ScrollSpy;
  5851. exports.Tab = Tab;
  5852. exports.Toast = Toast;
  5853. exports.Tooltip = Tooltip;
  5854. Object.defineProperty(exports, '__esModule', {value: true});
  5855. }));
  5856. //# sourceMappingURL=bootstrap.bundle.js.map