foundation.js 502 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("jquery"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["jquery"], factory);
  6. else {
  7. var a = typeof exports === 'object' ? factory(require("jquery")) : factory(root["jQuery"]);
  8. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  9. }
  10. })(window, function(__WEBPACK_EXTERNAL_MODULE_jquery__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = 0);
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "./js/entries/foundation.js":
  99. /*!**********************************!*\
  100. !*** ./js/entries/foundation.js ***!
  101. \**********************************/
  102. /*! exports provided: Foundation, CoreUtils, Box, onImagesLoaded, Keyboard, MediaQuery, Motion, Nest, Timer, Touch, Triggers, Abide, Accordion, AccordionMenu, Drilldown, Dropdown, DropdownMenu, Equalizer, Interchange, Magellan, OffCanvas, Orbit, ResponsiveMenu, ResponsiveToggle, Reveal, Slider, SmoothScroll, Sticky, Tabs, Toggler, Tooltip, ResponsiveAccordionTabs, default */
  103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104. "use strict";
  105. __webpack_require__.r(__webpack_exports__);
  106. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  107. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  108. /* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../foundation.core */ "./js/foundation.core.js");
  109. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]; });
  110. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../foundation.core.utils */ "./js/foundation.core.utils.js");
  111. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "CoreUtils", function() { return _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__; });
  112. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../foundation.util.box */ "./js/foundation.util.box.js");
  113. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__["Box"]; });
  114. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  115. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"]; });
  116. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  117. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__["Keyboard"]; });
  118. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  119. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"]; });
  120. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../foundation.util.motion */ "./js/foundation.util.motion.js");
  121. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Motion"]; });
  122. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../foundation.util.nest */ "./js/foundation.util.nest.js");
  123. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__["Nest"]; });
  124. /* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../foundation.util.timer */ "./js/foundation.util.timer.js");
  125. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__["Timer"]; });
  126. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../foundation.util.touch */ "./js/foundation.util.touch.js");
  127. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__["Touch"]; });
  128. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../foundation.util.triggers */ "./js/foundation.util.triggers.js");
  129. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__["Triggers"]; });
  130. /* harmony import */ var _foundation_abide__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../foundation.abide */ "./js/foundation.abide.js");
  131. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return _foundation_abide__WEBPACK_IMPORTED_MODULE_12__["Abide"]; });
  132. /* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../foundation.accordion */ "./js/foundation.accordion.js");
  133. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _foundation_accordion__WEBPACK_IMPORTED_MODULE_13__["Accordion"]; });
  134. /* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../foundation.accordionMenu */ "./js/foundation.accordionMenu.js");
  135. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__["AccordionMenu"]; });
  136. /* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../foundation.drilldown */ "./js/foundation.drilldown.js");
  137. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return _foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__["Drilldown"]; });
  138. /* harmony import */ var _foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../foundation.dropdown */ "./js/foundation.dropdown.js");
  139. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return _foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__["Dropdown"]; });
  140. /* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js");
  141. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__["DropdownMenu"]; });
  142. /* harmony import */ var _foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../foundation.equalizer */ "./js/foundation.equalizer.js");
  143. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return _foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__["Equalizer"]; });
  144. /* harmony import */ var _foundation_interchange__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../foundation.interchange */ "./js/foundation.interchange.js");
  145. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return _foundation_interchange__WEBPACK_IMPORTED_MODULE_19__["Interchange"]; });
  146. /* harmony import */ var _foundation_magellan__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../foundation.magellan */ "./js/foundation.magellan.js");
  147. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return _foundation_magellan__WEBPACK_IMPORTED_MODULE_20__["Magellan"]; });
  148. /* harmony import */ var _foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../foundation.offcanvas */ "./js/foundation.offcanvas.js");
  149. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return _foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__["OffCanvas"]; });
  150. /* harmony import */ var _foundation_orbit__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../foundation.orbit */ "./js/foundation.orbit.js");
  151. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return _foundation_orbit__WEBPACK_IMPORTED_MODULE_22__["Orbit"]; });
  152. /* harmony import */ var _foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../foundation.responsiveMenu */ "./js/foundation.responsiveMenu.js");
  153. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return _foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__["ResponsiveMenu"]; });
  154. /* harmony import */ var _foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../foundation.responsiveToggle */ "./js/foundation.responsiveToggle.js");
  155. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return _foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__["ResponsiveToggle"]; });
  156. /* harmony import */ var _foundation_reveal__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../foundation.reveal */ "./js/foundation.reveal.js");
  157. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return _foundation_reveal__WEBPACK_IMPORTED_MODULE_25__["Reveal"]; });
  158. /* harmony import */ var _foundation_slider__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../foundation.slider */ "./js/foundation.slider.js");
  159. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return _foundation_slider__WEBPACK_IMPORTED_MODULE_26__["Slider"]; });
  160. /* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../foundation.smoothScroll */ "./js/foundation.smoothScroll.js");
  161. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__["SmoothScroll"]; });
  162. /* harmony import */ var _foundation_sticky__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../foundation.sticky */ "./js/foundation.sticky.js");
  163. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return _foundation_sticky__WEBPACK_IMPORTED_MODULE_28__["Sticky"]; });
  164. /* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../foundation.tabs */ "./js/foundation.tabs.js");
  165. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return _foundation_tabs__WEBPACK_IMPORTED_MODULE_29__["Tabs"]; });
  166. /* harmony import */ var _foundation_toggler__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../foundation.toggler */ "./js/foundation.toggler.js");
  167. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return _foundation_toggler__WEBPACK_IMPORTED_MODULE_30__["Toggler"]; });
  168. /* harmony import */ var _foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../foundation.tooltip */ "./js/foundation.tooltip.js");
  169. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__["Tooltip"]; });
  170. /* harmony import */ var _foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../foundation.responsiveAccordionTabs */ "./js/foundation.responsiveAccordionTabs.js");
  171. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return _foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__["ResponsiveAccordionTabs"]; });
  172. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].addToJquery(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Add Foundation Utils to Foundation global namespace for backwards
  173. // compatibility.
  174. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].rtl = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"];
  175. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].GetYoDigits = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"];
  176. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].transitionend = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"];
  177. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].RegExpEscape = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["RegExpEscape"];
  178. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].onLoad = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"];
  179. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Box = _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__["Box"];
  180. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].onImagesLoaded = _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"];
  181. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Keyboard = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__["Keyboard"];
  182. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].MediaQuery = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"];
  183. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Motion = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Motion"];
  184. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Move = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Move"];
  185. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Nest = _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__["Nest"];
  186. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Timer = _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__["Timer"]; // Touch and Triggers previously were almost purely sede effect driven,
  187. // so no need to add it to Foundation, just init them.
  188. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  189. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a, _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]);
  190. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"]._init();
  191. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_abide__WEBPACK_IMPORTED_MODULE_12__["Abide"], 'Abide');
  192. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_accordion__WEBPACK_IMPORTED_MODULE_13__["Accordion"], 'Accordion');
  193. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__["AccordionMenu"], 'AccordionMenu');
  194. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__["Drilldown"], 'Drilldown');
  195. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__["Dropdown"], 'Dropdown');
  196. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__["DropdownMenu"], 'DropdownMenu');
  197. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__["Equalizer"], 'Equalizer');
  198. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_interchange__WEBPACK_IMPORTED_MODULE_19__["Interchange"], 'Interchange');
  199. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_magellan__WEBPACK_IMPORTED_MODULE_20__["Magellan"], 'Magellan');
  200. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__["OffCanvas"], 'OffCanvas');
  201. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_orbit__WEBPACK_IMPORTED_MODULE_22__["Orbit"], 'Orbit');
  202. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__["ResponsiveMenu"], 'ResponsiveMenu');
  203. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__["ResponsiveToggle"], 'ResponsiveToggle');
  204. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_reveal__WEBPACK_IMPORTED_MODULE_25__["Reveal"], 'Reveal');
  205. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_slider__WEBPACK_IMPORTED_MODULE_26__["Slider"], 'Slider');
  206. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__["SmoothScroll"], 'SmoothScroll');
  207. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_sticky__WEBPACK_IMPORTED_MODULE_28__["Sticky"], 'Sticky');
  208. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_tabs__WEBPACK_IMPORTED_MODULE_29__["Tabs"], 'Tabs');
  209. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_toggler__WEBPACK_IMPORTED_MODULE_30__["Toggler"], 'Toggler');
  210. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__["Tooltip"], 'Tooltip');
  211. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__["ResponsiveAccordionTabs"], 'ResponsiveAccordionTabs');
  212. /* harmony default export */ __webpack_exports__["default"] = (_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]);
  213. /***/ }),
  214. /***/ "./js/foundation.abide.js":
  215. /*!********************************!*\
  216. !*** ./js/foundation.abide.js ***!
  217. \********************************/
  218. /*! exports provided: Abide */
  219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  220. "use strict";
  221. __webpack_require__.r(__webpack_exports__);
  222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return Abide; });
  223. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  224. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  225. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  226. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  227. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  228. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  229. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  230. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  231. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  232. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  233. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  234. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  235. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  236. /**
  237. * Abide module.
  238. * @module foundation.abide
  239. */
  240. var Abide =
  241. /*#__PURE__*/
  242. function (_Plugin) {
  243. _inherits(Abide, _Plugin);
  244. function Abide() {
  245. _classCallCheck(this, Abide);
  246. return _possibleConstructorReturn(this, _getPrototypeOf(Abide).apply(this, arguments));
  247. }
  248. _createClass(Abide, [{
  249. key: "_setup",
  250. /**
  251. * Creates a new instance of Abide.
  252. * @class
  253. * @name Abide
  254. * @fires Abide#init
  255. * @param {Object} element - jQuery object to add the trigger to.
  256. * @param {Object} options - Overrides to the default plugin settings.
  257. */
  258. value: function _setup(element) {
  259. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  260. this.$element = element;
  261. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(true, {}, Abide.defaults, this.$element.data(), options);
  262. this.isEnabled = true;
  263. this.formnovalidate = null;
  264. this.className = 'Abide'; // ie9 back compat
  265. this._init();
  266. }
  267. /**
  268. * Initializes the Abide plugin and calls functions to get Abide functioning on load.
  269. * @private
  270. */
  271. }, {
  272. key: "_init",
  273. value: function _init() {
  274. var _this2 = this;
  275. this.$inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.merge( // Consider as input to validate:
  276. this.$element.find('input').not('[type="submit"]'), // * all input fields expect submit
  277. this.$element.find('textarea, select') // * all textareas and select fields
  278. );
  279. this.$submits = this.$element.find('[type="submit"]');
  280. var $globalErrors = this.$element.find('[data-abide-error]'); // Add a11y attributes to all fields
  281. if (this.options.a11yAttributes) {
  282. this.$inputs.each(function (i, input) {
  283. return _this2.addA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(input));
  284. });
  285. $globalErrors.each(function (i, error) {
  286. return _this2.addGlobalErrorA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(error));
  287. });
  288. }
  289. this._events();
  290. }
  291. /**
  292. * Initializes events for Abide.
  293. * @private
  294. */
  295. }, {
  296. key: "_events",
  297. value: function _events() {
  298. var _this3 = this;
  299. this.$element.off('.abide').on('reset.zf.abide', function () {
  300. _this3.resetForm();
  301. }).on('submit.zf.abide', function () {
  302. return _this3.validateForm();
  303. });
  304. this.$submits.off('click.zf.abide keydown.zf.abide').on('click.zf.abide keydown.zf.abide', function (e) {
  305. if (!e.key || e.key === ' ' || e.key === 'Enter') {
  306. e.preventDefault();
  307. _this3.formnovalidate = e.target.getAttribute('formnovalidate') !== null;
  308. _this3.$element.submit();
  309. }
  310. });
  311. if (this.options.validateOn === 'fieldChange') {
  312. this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) {
  313. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  314. });
  315. }
  316. if (this.options.liveValidate) {
  317. this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) {
  318. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  319. });
  320. }
  321. if (this.options.validateOnBlur) {
  322. this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) {
  323. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  324. });
  325. }
  326. }
  327. /**
  328. * Calls necessary functions to update Abide upon DOM change
  329. * @private
  330. */
  331. }, {
  332. key: "_reflow",
  333. value: function _reflow() {
  334. this._init();
  335. }
  336. /**
  337. * Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled
  338. * @returns {Boolean}
  339. * @private
  340. */
  341. }, {
  342. key: "_validationIsDisabled",
  343. value: function _validationIsDisabled() {
  344. if (this.isEnabled === false) {
  345. // whole validation disabled
  346. return true;
  347. } else if (typeof this.formnovalidate === 'boolean') {
  348. // triggered by $submit
  349. return this.formnovalidate;
  350. } // triggered by Enter in non-submit input
  351. return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;
  352. }
  353. /**
  354. * Enables the whole validation
  355. */
  356. }, {
  357. key: "enableValidation",
  358. value: function enableValidation() {
  359. this.isEnabled = true;
  360. }
  361. /**
  362. * Disables the whole validation
  363. */
  364. }, {
  365. key: "disableValidation",
  366. value: function disableValidation() {
  367. this.isEnabled = false;
  368. }
  369. /**
  370. * Checks whether or not a form element has the required attribute and if it's checked or not
  371. * @param {Object} element - jQuery object to check for required attribute
  372. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  373. */
  374. }, {
  375. key: "requiredCheck",
  376. value: function requiredCheck($el) {
  377. if (!$el.attr('required')) return true;
  378. var isGood = true;
  379. switch ($el[0].type) {
  380. case 'checkbox':
  381. isGood = $el[0].checked;
  382. break;
  383. case 'select':
  384. case 'select-one':
  385. case 'select-multiple':
  386. var opt = $el.find('option:selected');
  387. if (!opt.length || !opt.val()) isGood = false;
  388. break;
  389. default:
  390. if (!$el.val() || !$el.val().length) isGood = false;
  391. }
  392. return isGood;
  393. }
  394. /**
  395. * Get:
  396. * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:
  397. * 1. The element's direct sibling('s).
  398. * 2. The element's parent's children.
  399. * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.
  400. *
  401. * This allows for multiple form errors per input, though if none are found, no form errors will be shown.
  402. *
  403. * @param {Object} $el - jQuery object to use as reference to find the form error selector.
  404. * @param {String[]} [failedValidators] - List of failed validators.
  405. * @returns {Object} jQuery object with the selector.
  406. */
  407. }, {
  408. key: "findFormError",
  409. value: function findFormError($el, failedValidators) {
  410. var _this4 = this;
  411. var id = $el.length ? $el[0].id : '';
  412. var $error = $el.siblings(this.options.formErrorSelector);
  413. if (!$error.length) {
  414. $error = $el.parent().find(this.options.formErrorSelector);
  415. }
  416. if (id) {
  417. $error = $error.add(this.$element.find("[data-form-error-for=\"".concat(id, "\"]")));
  418. }
  419. if (!!failedValidators) {
  420. $error = $error.not('[data-form-error-on]');
  421. failedValidators.forEach(function (v) {
  422. $error = $error.add($el.siblings("[data-form-error-on=\"".concat(v, "\"]")));
  423. $error = $error.add(_this4.$element.find("[data-form-error-for=\"".concat(id, "\"][data-form-error-on=\"").concat(v, "\"]")));
  424. });
  425. }
  426. return $error;
  427. }
  428. /**
  429. * Get the first element in this order:
  430. * 2. The <label> with the attribute `[for="someInputId"]`
  431. * 3. The `.closest()` <label>
  432. *
  433. * @param {Object} $el - jQuery object to check for required attribute
  434. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  435. */
  436. }, {
  437. key: "findLabel",
  438. value: function findLabel($el) {
  439. var id = $el[0].id;
  440. var $label = this.$element.find("label[for=\"".concat(id, "\"]"));
  441. if (!$label.length) {
  442. return $el.closest('label');
  443. }
  444. return $label;
  445. }
  446. /**
  447. * Get the set of labels associated with a set of radio els in this order
  448. * 2. The <label> with the attribute `[for="someInputId"]`
  449. * 3. The `.closest()` <label>
  450. *
  451. * @param {Object} $el - jQuery object to check for required attribute
  452. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  453. */
  454. }, {
  455. key: "findRadioLabels",
  456. value: function findRadioLabels($els) {
  457. var _this5 = this;
  458. var labels = $els.map(function (i, el) {
  459. var id = el.id;
  460. var $label = _this5.$element.find("label[for=\"".concat(id, "\"]"));
  461. if (!$label.length) {
  462. $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label');
  463. }
  464. return $label[0];
  465. });
  466. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels);
  467. }
  468. /**
  469. * Get the set of labels associated with a set of checkbox els in this order
  470. * 2. The <label> with the attribute `[for="someInputId"]`
  471. * 3. The `.closest()` <label>
  472. *
  473. * @param {Object} $el - jQuery object to check for required attribute
  474. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  475. */
  476. }, {
  477. key: "findCheckboxLabels",
  478. value: function findCheckboxLabels($els) {
  479. var _this6 = this;
  480. var labels = $els.map(function (i, el) {
  481. var id = el.id;
  482. var $label = _this6.$element.find("label[for=\"".concat(id, "\"]"));
  483. if (!$label.length) {
  484. $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label');
  485. }
  486. return $label[0];
  487. });
  488. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels);
  489. }
  490. /**
  491. * Adds the CSS error class as specified by the Abide settings to the label, input, and the form
  492. * @param {Object} $el - jQuery object to add the class to
  493. * @param {String[]} [failedValidators] - List of failed validators.
  494. */
  495. }, {
  496. key: "addErrorClasses",
  497. value: function addErrorClasses($el, failedValidators) {
  498. var $label = this.findLabel($el);
  499. var $formError = this.findFormError($el, failedValidators);
  500. if ($label.length) {
  501. $label.addClass(this.options.labelErrorClass);
  502. }
  503. if ($formError.length) {
  504. $formError.addClass(this.options.formErrorClass);
  505. }
  506. $el.addClass(this.options.inputErrorClass).attr({
  507. 'data-invalid': '',
  508. 'aria-invalid': true
  509. });
  510. }
  511. /**
  512. * Adds [for] and [role=alert] attributes to all form error targetting $el,
  513. * and [aria-describedby] attribute to $el toward the first form error.
  514. * @param {Object} $el - jQuery object
  515. */
  516. }, {
  517. key: "addA11yAttributes",
  518. value: function addA11yAttributes($el) {
  519. var $errors = this.findFormError($el);
  520. var $labels = $errors.filter('label');
  521. var $error = $errors.first();
  522. if (!$errors.length) return; // Set [aria-describedby] on the input toward the first form error if it is not set
  523. if (typeof $el.attr('aria-describedby') === 'undefined') {
  524. // Get the first error ID or create one
  525. var errorId = $error.attr('id');
  526. if (typeof errorId === 'undefined') {
  527. errorId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-error');
  528. $error.attr('id', errorId);
  529. }
  530. $el.attr('aria-describedby', errorId);
  531. }
  532. if ($labels.filter('[for]').length < $labels.length) {
  533. // Get the input ID or create one
  534. var elemId = $el.attr('id');
  535. if (typeof elemId === 'undefined') {
  536. elemId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-input');
  537. $el.attr('id', elemId);
  538. } // For each label targeting $el, set [for] if it is not set.
  539. $labels.each(function (i, label) {
  540. var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
  541. if (typeof $label.attr('for') === 'undefined') $label.attr('for', elemId);
  542. });
  543. } // For each error targeting $el, set [role=alert] if it is not set.
  544. $errors.each(function (i, label) {
  545. var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
  546. if (typeof $label.attr('role') === 'undefined') $label.attr('role', 'alert');
  547. }).end();
  548. }
  549. /**
  550. * Adds [aria-live] attribute to the given global form error $el.
  551. * @param {Object} $el - jQuery object to add the attribute to
  552. */
  553. }, {
  554. key: "addGlobalErrorA11yAttributes",
  555. value: function addGlobalErrorA11yAttributes($el) {
  556. if (typeof $el.attr('aria-live') === 'undefined') $el.attr('aria-live', this.options.a11yErrorLevel);
  557. }
  558. /**
  559. * Remove CSS error classes etc from an entire radio button group
  560. * @param {String} groupName - A string that specifies the name of a radio button group
  561. *
  562. */
  563. }, {
  564. key: "removeRadioErrorClasses",
  565. value: function removeRadioErrorClasses(groupName) {
  566. var $els = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
  567. var $labels = this.findRadioLabels($els);
  568. var $formErrors = this.findFormError($els);
  569. if ($labels.length) {
  570. $labels.removeClass(this.options.labelErrorClass);
  571. }
  572. if ($formErrors.length) {
  573. $formErrors.removeClass(this.options.formErrorClass);
  574. }
  575. $els.removeClass(this.options.inputErrorClass).attr({
  576. 'data-invalid': null,
  577. 'aria-invalid': null
  578. });
  579. }
  580. /**
  581. * Remove CSS error classes etc from an entire checkbox group
  582. * @param {String} groupName - A string that specifies the name of a checkbox group
  583. *
  584. */
  585. }, {
  586. key: "removeCheckboxErrorClasses",
  587. value: function removeCheckboxErrorClasses(groupName) {
  588. var $els = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]"));
  589. var $labels = this.findCheckboxLabels($els);
  590. var $formErrors = this.findFormError($els);
  591. if ($labels.length) {
  592. $labels.removeClass(this.options.labelErrorClass);
  593. }
  594. if ($formErrors.length) {
  595. $formErrors.removeClass(this.options.formErrorClass);
  596. }
  597. $els.removeClass(this.options.inputErrorClass).attr({
  598. 'data-invalid': null,
  599. 'aria-invalid': null
  600. });
  601. }
  602. /**
  603. * Removes CSS error class as specified by the Abide settings from the label, input, and the form
  604. * @param {Object} $el - jQuery object to remove the class from
  605. */
  606. }, {
  607. key: "removeErrorClasses",
  608. value: function removeErrorClasses($el) {
  609. // radios need to clear all of the els
  610. if ($el[0].type == 'radio') {
  611. return this.removeRadioErrorClasses($el.attr('name'));
  612. } // checkboxes need to clear all of the els
  613. else if ($el[0].type == 'checkbox') {
  614. return this.removeCheckboxErrorClasses($el.attr('name'));
  615. }
  616. var $label = this.findLabel($el);
  617. var $formError = this.findFormError($el);
  618. if ($label.length) {
  619. $label.removeClass(this.options.labelErrorClass);
  620. }
  621. if ($formError.length) {
  622. $formError.removeClass(this.options.formErrorClass);
  623. }
  624. $el.removeClass(this.options.inputErrorClass).attr({
  625. 'data-invalid': null,
  626. 'aria-invalid': null
  627. });
  628. }
  629. /**
  630. * Goes through a form to find inputs and proceeds to validate them in ways specific to their type.
  631. * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set
  632. * @fires Abide#invalid
  633. * @fires Abide#valid
  634. * @param {Object} element - jQuery object to validate, should be an HTML input
  635. * @returns {Boolean} goodToGo - If the input is valid or not.
  636. */
  637. }, {
  638. key: "validateInput",
  639. value: function validateInput($el) {
  640. var _this7 = this;
  641. var clearRequire = this.requiredCheck($el),
  642. validator = $el.attr('data-validator'),
  643. failedValidators = [],
  644. manageErrorClasses = true; // skip validation if disabled
  645. if (this._validationIsDisabled()) {
  646. return true;
  647. } // don't validate ignored inputs or hidden inputs or disabled inputs
  648. if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) {
  649. return true;
  650. }
  651. switch ($el[0].type) {
  652. case 'radio':
  653. this.validateRadio($el.attr('name')) || failedValidators.push('required');
  654. break;
  655. case 'checkbox':
  656. this.validateCheckbox($el.attr('name')) || failedValidators.push('required'); // validateCheckbox() adds/removes error classes
  657. manageErrorClasses = false;
  658. break;
  659. case 'select':
  660. case 'select-one':
  661. case 'select-multiple':
  662. clearRequire || failedValidators.push('required');
  663. break;
  664. default:
  665. clearRequire || failedValidators.push('required');
  666. this.validateText($el) || failedValidators.push('pattern');
  667. }
  668. if (validator) {
  669. var required = $el.attr('required') ? true : false;
  670. validator.split(' ').forEach(function (v) {
  671. _this7.options.validators[v]($el, required, $el.parent()) || failedValidators.push(v);
  672. });
  673. }
  674. if ($el.attr('data-equalto')) {
  675. this.options.validators.equalTo($el) || failedValidators.push('equalTo');
  676. }
  677. var goodToGo = failedValidators.length === 0;
  678. var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide';
  679. if (goodToGo) {
  680. // Re-validate inputs that depend on this one with equalto
  681. var dependentElements = this.$element.find("[data-equalto=\"".concat($el.attr('id'), "\"]"));
  682. if (dependentElements.length) {
  683. var _this = this;
  684. dependentElements.each(function () {
  685. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()) {
  686. _this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  687. }
  688. });
  689. }
  690. }
  691. if (manageErrorClasses) {
  692. this.removeErrorClasses($el);
  693. if (!goodToGo) {
  694. this.addErrorClasses($el, failedValidators);
  695. }
  696. }
  697. /**
  698. * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide`
  699. * Trigger includes the DOM element of the input.
  700. * @event Abide#valid
  701. * @event Abide#invalid
  702. */
  703. $el.trigger(message, [$el]);
  704. return goodToGo;
  705. }
  706. /**
  707. * Goes through a form and if there are any invalid inputs, it will display the form error element
  708. * @returns {Boolean} noError - true if no errors were detected...
  709. * @fires Abide#formvalid
  710. * @fires Abide#forminvalid
  711. */
  712. }, {
  713. key: "validateForm",
  714. value: function validateForm() {
  715. var _this8 = this;
  716. var acc = [];
  717. var _this = this;
  718. var checkboxGroupName; // Remember first form submission to prevent specific checkbox validation (more than one required) until form got initially submitted
  719. if (!this.initialized) {
  720. this.initialized = true;
  721. } // skip validation if disabled
  722. if (this._validationIsDisabled()) {
  723. this.formnovalidate = null;
  724. return true;
  725. }
  726. this.$inputs.each(function () {
  727. // Only use one checkbox per group since validateCheckbox() iterates over all associated checkboxes
  728. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].type === 'checkbox') {
  729. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name') === checkboxGroupName) return true;
  730. checkboxGroupName = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name');
  731. }
  732. acc.push(_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)));
  733. });
  734. var noError = acc.indexOf(false) === -1;
  735. this.$element.find('[data-abide-error]').each(function (i, elem) {
  736. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem); // Ensure a11y attributes are set
  737. if (_this8.options.a11yAttributes) _this8.addGlobalErrorA11yAttributes($elem); // Show or hide the error
  738. $elem.css('display', noError ? 'none' : 'block');
  739. });
  740. /**
  741. * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`.
  742. * Trigger includes the element of the form.
  743. * @event Abide#formvalid
  744. * @event Abide#forminvalid
  745. */
  746. this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]);
  747. return noError;
  748. }
  749. /**
  750. * Determines whether or a not a text input is valid based on the pattern specified in the attribute. If no matching pattern is found, returns true.
  751. * @param {Object} $el - jQuery object to validate, should be a text input HTML element
  752. * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns
  753. * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified
  754. */
  755. }, {
  756. key: "validateText",
  757. value: function validateText($el, pattern) {
  758. // A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute
  759. pattern = pattern || $el.attr('data-pattern') || $el.attr('pattern') || $el.attr('type');
  760. var inputText = $el.val();
  761. var valid = true;
  762. if (inputText.length) {
  763. // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp
  764. if (this.options.patterns.hasOwnProperty(pattern)) {
  765. valid = this.options.patterns[pattern].test(inputText);
  766. } // If the pattern name isn't also the type attribute of the field, then test it as a regexp
  767. else if (pattern !== $el.attr('type')) {
  768. valid = new RegExp(pattern).test(inputText);
  769. }
  770. }
  771. return valid;
  772. }
  773. /**
  774. * Determines whether or a not a radio input is valid based on whether or not it is required and selected. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all radio buttons in its group.
  775. * @param {String} groupName - A string that specifies the name of a radio button group
  776. * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required)
  777. */
  778. }, {
  779. key: "validateRadio",
  780. value: function validateRadio(groupName) {
  781. // If at least one radio in the group has the `required` attribute, the group is considered required
  782. // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice
  783. var $group = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
  784. var valid = false,
  785. required = false; // For the group to be required, at least one radio needs to be required
  786. $group.each(function (i, e) {
  787. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) {
  788. required = true;
  789. }
  790. });
  791. if (!required) valid = true;
  792. if (!valid) {
  793. // For the group to be valid, at least one radio needs to be checked
  794. $group.each(function (i, e) {
  795. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) {
  796. valid = true;
  797. }
  798. });
  799. }
  800. return valid;
  801. }
  802. /**
  803. * Determines whether or a not a checkbox input is valid based on whether or not it is required and checked. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all checkboxes in its group.
  804. * @param {String} groupName - A string that specifies the name of a checkbox group
  805. * @returns {Boolean} Boolean value depends on whether or not at least one checkbox input has been checked (if it's required)
  806. */
  807. }, {
  808. key: "validateCheckbox",
  809. value: function validateCheckbox(groupName) {
  810. var _this9 = this;
  811. // If at least one checkbox in the group has the `required` attribute, the group is considered required
  812. // Per W3C spec, all checkboxes in a group should have `required`, but we're being nice
  813. var $group = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]"));
  814. var valid = false,
  815. required = false,
  816. minRequired = 1,
  817. checked = 0; // For the group to be required, at least one checkbox needs to be required
  818. $group.each(function (i, e) {
  819. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) {
  820. required = true;
  821. }
  822. });
  823. if (!required) valid = true;
  824. if (!valid) {
  825. // Count checked checkboxes within the group
  826. // Use data-min-required if available (default: 1)
  827. $group.each(function (i, e) {
  828. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) {
  829. checked++;
  830. }
  831. if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required') !== 'undefined') {
  832. minRequired = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required'));
  833. }
  834. }); // For the group to be valid, the minRequired amount of checkboxes have to be checked
  835. if (checked >= minRequired) {
  836. valid = true;
  837. }
  838. } // Skip validation if more than 1 checkbox have to be checked AND if the form hasn't got submitted yet (otherwise it will already show an error during the first fill in)
  839. if (this.initialized !== true && minRequired > 1) {
  840. return true;
  841. } // Refresh error class for all input
  842. $group.each(function (i, e) {
  843. if (!valid) {
  844. _this9.addErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e), ['required']);
  845. } else {
  846. _this9.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e));
  847. }
  848. });
  849. return valid;
  850. }
  851. /**
  852. * Determines if a selected input passes a custom validation function. Multiple validations can be used, if passed to the element with `data-validator="foo bar baz"` in a space separated listed.
  853. * @param {Object} $el - jQuery input element.
  854. * @param {String} validators - a string of function names matching functions in the Abide.options.validators object.
  855. * @param {Boolean} required - self explanatory?
  856. * @returns {Boolean} - true if validations passed.
  857. */
  858. }, {
  859. key: "matchValidation",
  860. value: function matchValidation($el, validators, required) {
  861. var _this10 = this;
  862. required = required ? true : false;
  863. var clear = validators.split(' ').map(function (v) {
  864. return _this10.options.validators[v]($el, required, $el.parent());
  865. });
  866. return clear.indexOf(false) === -1;
  867. }
  868. /**
  869. * Resets form inputs and styles
  870. * @fires Abide#formreset
  871. */
  872. }, {
  873. key: "resetForm",
  874. value: function resetForm() {
  875. var $form = this.$element,
  876. opts = this.options;
  877. jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.labelErrorClass), $form).not('small').removeClass(opts.labelErrorClass);
  878. jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.inputErrorClass), $form).not('small').removeClass(opts.inputErrorClass);
  879. jquery__WEBPACK_IMPORTED_MODULE_0___default()("".concat(opts.formErrorSelector, ".").concat(opts.formErrorClass)).removeClass(opts.formErrorClass);
  880. $form.find('[data-abide-error]').css('display', 'none');
  881. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({
  882. 'data-invalid': null,
  883. 'aria-invalid': null
  884. });
  885. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).attr({
  886. 'data-invalid': null,
  887. 'aria-invalid': null
  888. });
  889. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).attr({
  890. 'data-invalid': null,
  891. 'aria-invalid': null
  892. });
  893. /**
  894. * Fires when the form has been reset.
  895. * @event Abide#formreset
  896. */
  897. $form.trigger('formreset.zf.abide', [$form]);
  898. }
  899. /**
  900. * Destroys an instance of Abide.
  901. * Removes error styles and classes from elements, without resetting their values.
  902. */
  903. }, {
  904. key: "_destroy",
  905. value: function _destroy() {
  906. var _this = this;
  907. this.$element.off('.abide').find('[data-abide-error]').css('display', 'none');
  908. this.$inputs.off('.abide').each(function () {
  909. _this.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  910. });
  911. this.$submits.off('.abide');
  912. }
  913. }]);
  914. return Abide;
  915. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  916. /**
  917. * Default settings for plugin
  918. */
  919. Abide.defaults = {
  920. /**
  921. * The default event to validate inputs. Checkboxes and radios validate immediately.
  922. * Remove or change this value for manual validation.
  923. * @option
  924. * @type {?string}
  925. * @default 'fieldChange'
  926. */
  927. validateOn: 'fieldChange',
  928. /**
  929. * Class to be applied to input labels on failed validation.
  930. * @option
  931. * @type {string}
  932. * @default 'is-invalid-label'
  933. */
  934. labelErrorClass: 'is-invalid-label',
  935. /**
  936. * Class to be applied to inputs on failed validation.
  937. * @option
  938. * @type {string}
  939. * @default 'is-invalid-input'
  940. */
  941. inputErrorClass: 'is-invalid-input',
  942. /**
  943. * Class selector to use to target Form Errors for show/hide.
  944. * @option
  945. * @type {string}
  946. * @default '.form-error'
  947. */
  948. formErrorSelector: '.form-error',
  949. /**
  950. * Class added to Form Errors on failed validation.
  951. * @option
  952. * @type {string}
  953. * @default 'is-visible'
  954. */
  955. formErrorClass: 'is-visible',
  956. /**
  957. * If true, automatically insert when possible:
  958. * - `[aria-describedby]` on fields
  959. * - `[role=alert]` on form errors and `[for]` on form error labels
  960. * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`).
  961. * @option
  962. * @type {boolean}
  963. * @default true
  964. */
  965. a11yAttributes: true,
  966. /**
  967. * [aria-live] attribute value to be applied on global errors `[data-abide-error]`.
  968. * Options are: 'assertive', 'polite' and 'off'/null
  969. * @option
  970. * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
  971. * @type {string}
  972. * @default 'assertive'
  973. */
  974. a11yErrorLevel: 'assertive',
  975. /**
  976. * Set to true to validate text inputs on any value change.
  977. * @option
  978. * @type {boolean}
  979. * @default false
  980. */
  981. liveValidate: false,
  982. /**
  983. * Set to true to validate inputs on blur.
  984. * @option
  985. * @type {boolean}
  986. * @default false
  987. */
  988. validateOnBlur: false,
  989. patterns: {
  990. alpha: /^[a-zA-Z]+$/,
  991. alpha_numeric: /^[a-zA-Z0-9]+$/,
  992. integer: /^[-+]?\d+$/,
  993. number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
  994. // amex, visa, diners
  995. card: /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(?:222[1-9]|2[3-6][0-9]{2}|27[0-1][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
  996. cvv: /^([0-9]){3,4}$/,
  997. // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
  998. email: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
  999. // From CommonRegexJS (@talyssonoc)
  1000. // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76
  1001. // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex.
  1002. url: /^((?:(https?|ftps?|file|ssh|sftp):\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))$/,
  1003. // abc.de
  1004. domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
  1005. datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
  1006. // YYYY-MM-DD
  1007. date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
  1008. // HH:MM:SS
  1009. time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
  1010. dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
  1011. // MM/DD/YYYY
  1012. month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
  1013. // DD/MM/YYYY
  1014. day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
  1015. // #FFF or #FFFFFF
  1016. color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,
  1017. // Domain || URL
  1018. website: {
  1019. test: function test(text) {
  1020. return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text);
  1021. }
  1022. }
  1023. },
  1024. /**
  1025. * Optional validation functions to be used. `equalTo` being the only default included function.
  1026. * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:
  1027. * el : The jQuery element to validate.
  1028. * required : Boolean value of the required attribute be present or not.
  1029. * parent : The direct parent of the input.
  1030. * @option
  1031. */
  1032. validators: {
  1033. equalTo: function equalTo(el, required, parent) {
  1034. return jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(el.attr('data-equalto'))).val() === el.val();
  1035. }
  1036. }
  1037. };
  1038. /***/ }),
  1039. /***/ "./js/foundation.accordion.js":
  1040. /*!************************************!*\
  1041. !*** ./js/foundation.accordion.js ***!
  1042. \************************************/
  1043. /*! exports provided: Accordion */
  1044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1045. "use strict";
  1046. __webpack_require__.r(__webpack_exports__);
  1047. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; });
  1048. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  1049. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  1050. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  1051. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  1052. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  1053. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1054. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1055. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1056. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1057. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1058. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1059. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1060. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1061. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1062. /**
  1063. * Accordion module.
  1064. * @module foundation.accordion
  1065. * @requires foundation.util.keyboard
  1066. */
  1067. var Accordion =
  1068. /*#__PURE__*/
  1069. function (_Plugin) {
  1070. _inherits(Accordion, _Plugin);
  1071. function Accordion() {
  1072. _classCallCheck(this, Accordion);
  1073. return _possibleConstructorReturn(this, _getPrototypeOf(Accordion).apply(this, arguments));
  1074. }
  1075. _createClass(Accordion, [{
  1076. key: "_setup",
  1077. /**
  1078. * Creates a new instance of an accordion.
  1079. * @class
  1080. * @name Accordion
  1081. * @fires Accordion#init
  1082. * @param {jQuery} element - jQuery object to make into an accordion.
  1083. * @param {Object} options - a plain object with settings to override the default options.
  1084. */
  1085. value: function _setup(element, options) {
  1086. this.$element = element;
  1087. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Accordion.defaults, this.$element.data(), options);
  1088. this.className = 'Accordion'; // ie9 back compat
  1089. this._init();
  1090. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Accordion', {
  1091. 'ENTER': 'toggle',
  1092. 'SPACE': 'toggle',
  1093. 'ARROW_DOWN': 'next',
  1094. 'ARROW_UP': 'previous'
  1095. });
  1096. }
  1097. /**
  1098. * Initializes the accordion by animating the preset active pane(s).
  1099. * @private
  1100. */
  1101. }, {
  1102. key: "_init",
  1103. value: function _init() {
  1104. var _this2 = this;
  1105. this._isInitializing = true;
  1106. this.$element.attr('role', 'tablist');
  1107. this.$tabs = this.$element.children('[data-accordion-item]');
  1108. this.$tabs.attr({
  1109. 'role': 'presentation'
  1110. });
  1111. this.$tabs.each(function (idx, el) {
  1112. var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el),
  1113. $content = $el.children('[data-tab-content]'),
  1114. id = $content[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion'),
  1115. linkId = el.id ? "".concat(el.id, "-label") : "".concat(id, "-label");
  1116. $el.find('a:first').attr({
  1117. 'aria-controls': id,
  1118. 'role': 'tab',
  1119. 'id': linkId,
  1120. 'aria-expanded': false,
  1121. 'aria-selected': false
  1122. });
  1123. $content.attr({
  1124. 'role': 'tabpanel',
  1125. 'aria-labelledby': linkId,
  1126. 'aria-hidden': true,
  1127. 'id': id
  1128. });
  1129. });
  1130. var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
  1131. if ($initActive.length) {
  1132. // Save up the initial hash to return to it later when going back in history
  1133. this._initialAnchor = $initActive.prev('a').attr('href');
  1134. this._openSingleTab($initActive);
  1135. }
  1136. this._checkDeepLink = function () {
  1137. var anchor = window.location.hash;
  1138. if (!anchor.length) {
  1139. // If we are still initializing and there is no anchor, then there is nothing to do
  1140. if (_this2._isInitializing) return; // Otherwise, move to the initial anchor
  1141. if (_this2._initialAnchor) anchor = _this2._initialAnchor;
  1142. }
  1143. var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor);
  1144. var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"]")); // Whether the anchor element that has been found is part of this element
  1145. var isOwnAnchor = !!($anchor.length && $link.length);
  1146. if (isOwnAnchor) {
  1147. // If there is an anchor for the hash, open it (if not already active)
  1148. if ($anchor && $link && $link.length) {
  1149. if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {
  1150. _this2._openSingleTab($anchor);
  1151. }
  1152. } // Otherwise, close everything
  1153. else {
  1154. _this2._closeAllTabs();
  1155. } // Roll up a little to show the titles
  1156. if (_this2.options.deepLinkSmudge) {
  1157. Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  1158. var offset = _this2.$element.offset();
  1159. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
  1160. scrollTop: offset.top - _this2.options.deepLinkSmudgeOffset
  1161. }, _this2.options.deepLinkSmudgeDelay);
  1162. });
  1163. }
  1164. /**
  1165. * Fires when the plugin has deeplinked at pageload
  1166. * @event Accordion#deeplink
  1167. */
  1168. _this2.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);
  1169. }
  1170. }; //use browser to open a tab, if it exists in this tabset
  1171. if (this.options.deepLink) {
  1172. this._checkDeepLink();
  1173. }
  1174. this._events();
  1175. this._isInitializing = false;
  1176. }
  1177. /**
  1178. * Adds event handlers for items within the accordion.
  1179. * @private
  1180. */
  1181. }, {
  1182. key: "_events",
  1183. value: function _events() {
  1184. var _this = this;
  1185. this.$tabs.each(function () {
  1186. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  1187. var $tabContent = $elem.children('[data-tab-content]');
  1188. if ($tabContent.length) {
  1189. $elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) {
  1190. e.preventDefault();
  1191. _this.toggle($tabContent);
  1192. }).on('keydown.zf.accordion', function (e) {
  1193. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Accordion', {
  1194. toggle: function toggle() {
  1195. _this.toggle($tabContent);
  1196. },
  1197. next: function next() {
  1198. var $a = $elem.next().find('a').focus();
  1199. if (!_this.options.multiExpand) {
  1200. $a.trigger('click.zf.accordion');
  1201. }
  1202. },
  1203. previous: function previous() {
  1204. var $a = $elem.prev().find('a').focus();
  1205. if (!_this.options.multiExpand) {
  1206. $a.trigger('click.zf.accordion');
  1207. }
  1208. },
  1209. handled: function handled() {
  1210. e.preventDefault();
  1211. }
  1212. });
  1213. });
  1214. }
  1215. });
  1216. if (this.options.deepLink) {
  1217. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink);
  1218. }
  1219. }
  1220. /**
  1221. * Toggles the selected content pane's open/close state.
  1222. * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).
  1223. * @function
  1224. */
  1225. }, {
  1226. key: "toggle",
  1227. value: function toggle($target) {
  1228. if ($target.closest('[data-accordion]').is('[disabled]')) {
  1229. console.info('Cannot toggle an accordion that is disabled.');
  1230. return;
  1231. }
  1232. if ($target.parent().hasClass('is-active')) {
  1233. this.up($target);
  1234. } else {
  1235. this.down($target);
  1236. } //either replace or update browser history
  1237. if (this.options.deepLink) {
  1238. var anchor = $target.prev('a').attr('href');
  1239. if (this.options.updateHistory) {
  1240. history.pushState({}, '', anchor);
  1241. } else {
  1242. history.replaceState({}, '', anchor);
  1243. }
  1244. }
  1245. }
  1246. /**
  1247. * Opens the accordion tab defined by `$target`.
  1248. * @param {jQuery} $target - Accordion pane to open (`.accordion-content`).
  1249. * @fires Accordion#down
  1250. * @function
  1251. */
  1252. }, {
  1253. key: "down",
  1254. value: function down($target) {
  1255. if ($target.closest('[data-accordion]').is('[disabled]')) {
  1256. console.info('Cannot call down on an accordion that is disabled.');
  1257. return;
  1258. }
  1259. if (this.options.multiExpand) this._openTab($target);else this._openSingleTab($target);
  1260. }
  1261. /**
  1262. * Closes the tab defined by `$target`.
  1263. * It may be ignored if the Accordion options don't allow it.
  1264. *
  1265. * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
  1266. * @fires Accordion#up
  1267. * @function
  1268. */
  1269. }, {
  1270. key: "up",
  1271. value: function up($target) {
  1272. if (this.$element.is('[disabled]')) {
  1273. console.info('Cannot call up on an accordion that is disabled.');
  1274. return;
  1275. } // Don't close the item if it is already closed
  1276. var $targetItem = $target.parent();
  1277. if (!$targetItem.hasClass('is-active')) return; // Don't close the item if there is no other active item (unless with `allowAllClosed`)
  1278. var $othersItems = $targetItem.siblings();
  1279. if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return;
  1280. this._closeTab($target);
  1281. }
  1282. /**
  1283. * Make the tab defined by `$target` the only opened tab, closing all others tabs.
  1284. * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).
  1285. * @function
  1286. * @private
  1287. */
  1288. }, {
  1289. key: "_openSingleTab",
  1290. value: function _openSingleTab($target) {
  1291. // Close all the others active tabs.
  1292. var $activeContents = this.$element.children('.is-active').children('[data-tab-content]');
  1293. if ($activeContents.length) {
  1294. this._closeTab($activeContents.not($target));
  1295. } // Then open the target.
  1296. this._openTab($target);
  1297. }
  1298. /**
  1299. * Opens the tab defined by `$target`.
  1300. * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).
  1301. * @fires Accordion#down
  1302. * @function
  1303. * @private
  1304. */
  1305. }, {
  1306. key: "_openTab",
  1307. value: function _openTab($target) {
  1308. var _this3 = this;
  1309. var $targetItem = $target.parent();
  1310. var targetContentId = $target.attr('aria-labelledby');
  1311. $target.attr('aria-hidden', false);
  1312. $targetItem.addClass('is-active');
  1313. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({
  1314. 'aria-expanded': true,
  1315. 'aria-selected': true
  1316. });
  1317. $target.finish().slideDown(this.options.slideSpeed, function () {
  1318. /**
  1319. * Fires when the tab is done opening.
  1320. * @event Accordion#down
  1321. */
  1322. _this3.$element.trigger('down.zf.accordion', [$target]);
  1323. });
  1324. }
  1325. /**
  1326. * Closes the tab defined by `$target`.
  1327. * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
  1328. * @fires Accordion#up
  1329. * @function
  1330. * @private
  1331. */
  1332. }, {
  1333. key: "_closeTab",
  1334. value: function _closeTab($target) {
  1335. var _this4 = this;
  1336. var $targetItem = $target.parent();
  1337. var targetContentId = $target.attr('aria-labelledby');
  1338. $target.attr('aria-hidden', true);
  1339. $targetItem.removeClass('is-active');
  1340. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({
  1341. 'aria-expanded': false,
  1342. 'aria-selected': false
  1343. });
  1344. $target.finish().slideUp(this.options.slideSpeed, function () {
  1345. /**
  1346. * Fires when the tab is done collapsing up.
  1347. * @event Accordion#up
  1348. */
  1349. _this4.$element.trigger('up.zf.accordion', [$target]);
  1350. });
  1351. }
  1352. /**
  1353. * Closes all active tabs
  1354. * @fires Accordion#up
  1355. * @function
  1356. * @private
  1357. */
  1358. }, {
  1359. key: "_closeAllTabs",
  1360. value: function _closeAllTabs() {
  1361. var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]');
  1362. if ($activeTabs.length) {
  1363. this._closeTab($activeTabs);
  1364. }
  1365. }
  1366. /**
  1367. * Destroys an instance of an accordion.
  1368. * @fires Accordion#destroyed
  1369. * @function
  1370. */
  1371. }, {
  1372. key: "_destroy",
  1373. value: function _destroy() {
  1374. this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
  1375. this.$element.find('a').off('.zf.accordion');
  1376. if (this.options.deepLink) {
  1377. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink);
  1378. }
  1379. }
  1380. }]);
  1381. return Accordion;
  1382. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  1383. Accordion.defaults = {
  1384. /**
  1385. * Amount of time to animate the opening of an accordion pane.
  1386. * @option
  1387. * @type {number}
  1388. * @default 250
  1389. */
  1390. slideSpeed: 250,
  1391. /**
  1392. * Allow the accordion to have multiple open panes.
  1393. * @option
  1394. * @type {boolean}
  1395. * @default false
  1396. */
  1397. multiExpand: false,
  1398. /**
  1399. * Allow the accordion to close all panes.
  1400. * @option
  1401. * @type {boolean}
  1402. * @default false
  1403. */
  1404. allowAllClosed: false,
  1405. /**
  1406. * Link the location hash to the open pane.
  1407. * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes.
  1408. * @option
  1409. * @type {boolean}
  1410. * @default false
  1411. */
  1412. deepLink: false,
  1413. /**
  1414. * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible
  1415. * @option
  1416. * @type {boolean}
  1417. * @default false
  1418. */
  1419. deepLinkSmudge: false,
  1420. /**
  1421. * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment
  1422. * @option
  1423. * @type {number}
  1424. * @default 300
  1425. */
  1426. deepLinkSmudgeDelay: 300,
  1427. /**
  1428. * If `deepLinkSmudge` is enabled, the offset for scrollToTtop to prevent overlap by a sticky element at the top of the page
  1429. * @option
  1430. * @type {number}
  1431. * @default 0
  1432. */
  1433. deepLinkSmudgeOffset: 0,
  1434. /**
  1435. * If `deepLink` is enabled, update the browser history with the open accordion
  1436. * @option
  1437. * @type {boolean}
  1438. * @default false
  1439. */
  1440. updateHistory: false
  1441. };
  1442. /***/ }),
  1443. /***/ "./js/foundation.accordionMenu.js":
  1444. /*!****************************************!*\
  1445. !*** ./js/foundation.accordionMenu.js ***!
  1446. \****************************************/
  1447. /*! exports provided: AccordionMenu */
  1448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1449. "use strict";
  1450. __webpack_require__.r(__webpack_exports__);
  1451. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return AccordionMenu; });
  1452. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  1453. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  1454. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  1455. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js");
  1456. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  1457. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  1458. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1459. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1460. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1461. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1462. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1463. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1464. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1465. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1466. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1467. /**
  1468. * AccordionMenu module.
  1469. * @module foundation.accordionMenu
  1470. * @requires foundation.util.keyboard
  1471. * @requires foundation.util.nest
  1472. */
  1473. var AccordionMenu =
  1474. /*#__PURE__*/
  1475. function (_Plugin) {
  1476. _inherits(AccordionMenu, _Plugin);
  1477. function AccordionMenu() {
  1478. _classCallCheck(this, AccordionMenu);
  1479. return _possibleConstructorReturn(this, _getPrototypeOf(AccordionMenu).apply(this, arguments));
  1480. }
  1481. _createClass(AccordionMenu, [{
  1482. key: "_setup",
  1483. /**
  1484. * Creates a new instance of an accordion menu.
  1485. * @class
  1486. * @name AccordionMenu
  1487. * @fires AccordionMenu#init
  1488. * @param {jQuery} element - jQuery object to make into an accordion menu.
  1489. * @param {Object} options - Overrides to the default plugin settings.
  1490. */
  1491. value: function _setup(element, options) {
  1492. this.$element = element;
  1493. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options);
  1494. this.className = 'AccordionMenu'; // ie9 back compat
  1495. this._init();
  1496. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('AccordionMenu', {
  1497. 'ENTER': 'toggle',
  1498. 'SPACE': 'toggle',
  1499. 'ARROW_RIGHT': 'open',
  1500. 'ARROW_UP': 'up',
  1501. 'ARROW_DOWN': 'down',
  1502. 'ARROW_LEFT': 'close',
  1503. 'ESCAPE': 'closeAll'
  1504. });
  1505. }
  1506. /**
  1507. * Initializes the accordion menu by hiding all nested menus.
  1508. * @private
  1509. */
  1510. }, {
  1511. key: "_init",
  1512. value: function _init() {
  1513. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'accordion');
  1514. var _this = this;
  1515. this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem');
  1516. this.$element.attr({
  1517. 'role': 'tree',
  1518. 'aria-multiselectable': this.options.multiOpen
  1519. });
  1520. this.$menuLinks = this.$element.find('.is-accordion-submenu-parent');
  1521. this.$menuLinks.each(function () {
  1522. var linkId = this.id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu-link'),
  1523. $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  1524. $sub = $elem.children('[data-submenu]'),
  1525. subId = $sub[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu'),
  1526. isActive = $sub.hasClass('is-active');
  1527. if (_this.options.parentLink) {
  1528. var $anchor = $elem.children('a');
  1529. $anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-accordion-submenu-item"></li>');
  1530. }
  1531. if (_this.options.submenuToggle) {
  1532. $elem.addClass('has-submenu-toggle');
  1533. $elem.children('a').after('<button id="' + linkId + '" class="submenu-toggle" aria-controls="' + subId + '" aria-expanded="' + isActive + '" title="' + _this.options.submenuToggleText + '"><span class="submenu-toggle-text">' + _this.options.submenuToggleText + '</span></button>');
  1534. } else {
  1535. $elem.attr({
  1536. 'aria-controls': subId,
  1537. 'aria-expanded': isActive,
  1538. 'id': linkId
  1539. });
  1540. }
  1541. $sub.attr({
  1542. 'aria-labelledby': linkId,
  1543. 'aria-hidden': !isActive,
  1544. 'role': 'group',
  1545. 'id': subId
  1546. });
  1547. });
  1548. this.$element.find('li').attr({
  1549. 'role': 'treeitem'
  1550. });
  1551. var initPanes = this.$element.find('.is-active');
  1552. if (initPanes.length) {
  1553. initPanes.each(function () {
  1554. _this.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  1555. });
  1556. }
  1557. this._events();
  1558. }
  1559. /**
  1560. * Adds event handlers for items within the menu.
  1561. * @private
  1562. */
  1563. }, {
  1564. key: "_events",
  1565. value: function _events() {
  1566. var _this = this;
  1567. this.$element.find('li').each(function () {
  1568. var $submenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]');
  1569. if ($submenu.length) {
  1570. if (_this.options.submenuToggle) {
  1571. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
  1572. _this.toggle($submenu);
  1573. });
  1574. } else {
  1575. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
  1576. e.preventDefault();
  1577. _this.toggle($submenu);
  1578. });
  1579. }
  1580. }
  1581. }).on('keydown.zf.accordionMenu', function (e) {
  1582. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  1583. $elements = $element.parent('ul').children('li'),
  1584. $prevElement,
  1585. $nextElement,
  1586. $target = $element.children('[data-submenu]');
  1587. $elements.each(function (i) {
  1588. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  1589. $prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first();
  1590. $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first();
  1591. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]:visible').length) {
  1592. // has open sub menu
  1593. $nextElement = $element.find('li:first-child').find('a').first();
  1594. }
  1595. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':first-child')) {
  1596. // is first element of sub menu
  1597. $prevElement = $element.parents('li').first().find('a').first();
  1598. } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) {
  1599. // if previous element has open sub menu
  1600. $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();
  1601. }
  1602. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':last-child')) {
  1603. // is last element of sub menu
  1604. $nextElement = $element.parents('li').first().next('li').find('a').first();
  1605. }
  1606. return;
  1607. }
  1608. });
  1609. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'AccordionMenu', {
  1610. open: function open() {
  1611. if ($target.is(':hidden')) {
  1612. _this.down($target);
  1613. $target.find('li').first().find('a').first().focus();
  1614. }
  1615. },
  1616. close: function close() {
  1617. if ($target.length && !$target.is(':hidden')) {
  1618. // close active sub of this item
  1619. _this.up($target);
  1620. } else if ($element.parent('[data-submenu]').length) {
  1621. // close currently open sub
  1622. _this.up($element.parent('[data-submenu]'));
  1623. $element.parents('li').first().find('a').first().focus();
  1624. }
  1625. },
  1626. up: function up() {
  1627. $prevElement.focus();
  1628. return true;
  1629. },
  1630. down: function down() {
  1631. $nextElement.focus();
  1632. return true;
  1633. },
  1634. toggle: function toggle() {
  1635. if (_this.options.submenuToggle) {
  1636. return false;
  1637. }
  1638. if ($element.children('[data-submenu]').length) {
  1639. _this.toggle($element.children('[data-submenu]'));
  1640. return true;
  1641. }
  1642. },
  1643. closeAll: function closeAll() {
  1644. _this.hideAll();
  1645. },
  1646. handled: function handled(preventDefault) {
  1647. if (preventDefault) {
  1648. e.preventDefault();
  1649. }
  1650. }
  1651. });
  1652. }); //.attr('tabindex', 0);
  1653. }
  1654. /**
  1655. * Closes all panes of the menu.
  1656. * @function
  1657. */
  1658. }, {
  1659. key: "hideAll",
  1660. value: function hideAll() {
  1661. this.up(this.$element.find('[data-submenu]'));
  1662. }
  1663. /**
  1664. * Opens all panes of the menu.
  1665. * @function
  1666. */
  1667. }, {
  1668. key: "showAll",
  1669. value: function showAll() {
  1670. this.down(this.$element.find('[data-submenu]'));
  1671. }
  1672. /**
  1673. * Toggles the open/close state of a submenu.
  1674. * @function
  1675. * @param {jQuery} $target - the submenu to toggle
  1676. */
  1677. }, {
  1678. key: "toggle",
  1679. value: function toggle($target) {
  1680. if (!$target.is(':animated')) {
  1681. if (!$target.is(':hidden')) {
  1682. this.up($target);
  1683. } else {
  1684. this.down($target);
  1685. }
  1686. }
  1687. }
  1688. /**
  1689. * Opens the sub-menu defined by `$target`.
  1690. * @param {jQuery} $target - Sub-menu to open.
  1691. * @fires AccordionMenu#down
  1692. */
  1693. }, {
  1694. key: "down",
  1695. value: function down($target) {
  1696. var _this2 = this;
  1697. // If having multiple submenus active is disabled, close all the submenus
  1698. // that are not parents or children of the targeted submenu.
  1699. if (!this.options.multiOpen) {
  1700. // The "branch" of the targetted submenu, from the component root to
  1701. // the active submenus nested in it.
  1702. var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch.
  1703. var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch);
  1704. this.up($othersActiveSubmenus);
  1705. }
  1706. $target.addClass('is-active').attr({
  1707. 'aria-hidden': false
  1708. });
  1709. if (this.options.submenuToggle) {
  1710. $target.prev('.submenu-toggle').attr({
  1711. 'aria-expanded': true
  1712. });
  1713. } else {
  1714. $target.parent('.is-accordion-submenu-parent').attr({
  1715. 'aria-expanded': true
  1716. });
  1717. }
  1718. $target.slideDown(this.options.slideSpeed, function () {
  1719. /**
  1720. * Fires when the menu is done opening.
  1721. * @event AccordionMenu#down
  1722. */
  1723. _this2.$element.trigger('down.zf.accordionMenu', [$target]);
  1724. });
  1725. }
  1726. /**
  1727. * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well.
  1728. * @param {jQuery} $target - Sub-menu to close.
  1729. * @fires AccordionMenu#up
  1730. */
  1731. }, {
  1732. key: "up",
  1733. value: function up($target) {
  1734. var _this3 = this;
  1735. var $submenus = $target.find('[data-submenu]');
  1736. var $allmenus = $target.add($submenus);
  1737. $submenus.slideUp(0);
  1738. $allmenus.removeClass('is-active').attr('aria-hidden', true);
  1739. if (this.options.submenuToggle) {
  1740. $allmenus.prev('.submenu-toggle').attr('aria-expanded', false);
  1741. } else {
  1742. $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false);
  1743. }
  1744. $target.slideUp(this.options.slideSpeed, function () {
  1745. /**
  1746. * Fires when the menu is done collapsing up.
  1747. * @event AccordionMenu#up
  1748. */
  1749. _this3.$element.trigger('up.zf.accordionMenu', [$target]);
  1750. });
  1751. }
  1752. /**
  1753. * Destroys an instance of accordion menu.
  1754. * @fires AccordionMenu#destroyed
  1755. */
  1756. }, {
  1757. key: "_destroy",
  1758. value: function _destroy() {
  1759. this.$element.find('[data-submenu]').slideDown(0).css('display', '');
  1760. this.$element.find('a').off('click.zf.accordionMenu');
  1761. this.$element.find('[data-is-parent-link]').detach();
  1762. if (this.options.submenuToggle) {
  1763. this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle');
  1764. this.$element.find('.submenu-toggle').remove();
  1765. }
  1766. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'accordion');
  1767. }
  1768. }]);
  1769. return AccordionMenu;
  1770. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  1771. AccordionMenu.defaults = {
  1772. /**
  1773. * Adds the parent link to the submenu.
  1774. * @option
  1775. * @type {boolean}
  1776. * @default false
  1777. */
  1778. parentLink: false,
  1779. /**
  1780. * Amount of time to animate the opening of a submenu in ms.
  1781. * @option
  1782. * @type {number}
  1783. * @default 250
  1784. */
  1785. slideSpeed: 250,
  1786. /**
  1787. * Adds a separate submenu toggle button. This allows the parent item to have a link.
  1788. * @option
  1789. * @example true
  1790. */
  1791. submenuToggle: false,
  1792. /**
  1793. * The text used for the submenu toggle if enabled. This is used for screen readers only.
  1794. * @option
  1795. * @example true
  1796. */
  1797. submenuToggleText: 'Toggle menu',
  1798. /**
  1799. * Allow the menu to have multiple open panes.
  1800. * @option
  1801. * @type {boolean}
  1802. * @default true
  1803. */
  1804. multiOpen: true
  1805. };
  1806. /***/ }),
  1807. /***/ "./js/foundation.core.js":
  1808. /*!*******************************!*\
  1809. !*** ./js/foundation.core.js ***!
  1810. \*******************************/
  1811. /*! exports provided: Foundation */
  1812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1813. "use strict";
  1814. __webpack_require__.r(__webpack_exports__);
  1815. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return Foundation; });
  1816. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  1817. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  1818. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  1819. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  1820. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1821. var FOUNDATION_VERSION = '6.6.3'; // Global Foundation object
  1822. // This is attached to the window, or used as a module for AMD/Browserify
  1823. var Foundation = {
  1824. version: FOUNDATION_VERSION,
  1825. /**
  1826. * Stores initialized plugins.
  1827. */
  1828. _plugins: {},
  1829. /**
  1830. * Stores generated unique ids for plugin instances
  1831. */
  1832. _uuids: [],
  1833. /**
  1834. * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.
  1835. * @param {Object} plugin - The constructor of the plugin.
  1836. */
  1837. plugin: function plugin(_plugin, name) {
  1838. // Object key to use when adding to global Foundation object
  1839. // Examples: Foundation.Reveal, Foundation.OffCanvas
  1840. var className = name || functionName(_plugin); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin
  1841. // Examples: data-reveal, data-off-canvas
  1842. var attrName = hyphenate(className); // Add to the Foundation object and the plugins list (for reflowing)
  1843. this._plugins[attrName] = this[className] = _plugin;
  1844. },
  1845. /**
  1846. * @function
  1847. * Populates the _uuids array with pointers to each individual plugin instance.
  1848. * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.
  1849. * Also fires the initialization event for each plugin, consolidating repetitive code.
  1850. * @param {Object} plugin - an instance of a plugin, usually `this` in context.
  1851. * @param {String} name - the name of the plugin, passed as a camelCased string.
  1852. * @fires Plugin#init
  1853. */
  1854. registerPlugin: function registerPlugin(plugin, name) {
  1855. var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();
  1856. plugin.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName);
  1857. if (!plugin.$element.attr("data-".concat(pluginName))) {
  1858. plugin.$element.attr("data-".concat(pluginName), plugin.uuid);
  1859. }
  1860. if (!plugin.$element.data('zfPlugin')) {
  1861. plugin.$element.data('zfPlugin', plugin);
  1862. }
  1863. /**
  1864. * Fires when the plugin has initialized.
  1865. * @event Plugin#init
  1866. */
  1867. plugin.$element.trigger("init.zf.".concat(pluginName));
  1868. this._uuids.push(plugin.uuid);
  1869. return;
  1870. },
  1871. /**
  1872. * @function
  1873. * Removes the plugins uuid from the _uuids array.
  1874. * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.
  1875. * Also fires the destroyed event for the plugin, consolidating repetitive code.
  1876. * @param {Object} plugin - an instance of a plugin, usually `this` in context.
  1877. * @fires Plugin#destroyed
  1878. */
  1879. unregisterPlugin: function unregisterPlugin(plugin) {
  1880. var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));
  1881. this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);
  1882. plugin.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin')
  1883. /**
  1884. * Fires when the plugin has been destroyed.
  1885. * @event Plugin#destroyed
  1886. */
  1887. .trigger("destroyed.zf.".concat(pluginName));
  1888. for (var prop in plugin) {
  1889. plugin[prop] = null; //clean up script to prep for garbage collection.
  1890. }
  1891. return;
  1892. },
  1893. /**
  1894. * @function
  1895. * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.
  1896. * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'`
  1897. * @default If no argument is passed, reflow all currently active plugins.
  1898. */
  1899. reInit: function reInit(plugins) {
  1900. var isJQ = plugins instanceof jquery__WEBPACK_IMPORTED_MODULE_0___default.a;
  1901. try {
  1902. if (isJQ) {
  1903. plugins.each(function () {
  1904. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('zfPlugin')._init();
  1905. });
  1906. } else {
  1907. var type = _typeof(plugins),
  1908. _this = this,
  1909. fns = {
  1910. 'object': function object(plgs) {
  1911. plgs.forEach(function (p) {
  1912. p = hyphenate(p);
  1913. jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + p + ']').foundation('_init');
  1914. });
  1915. },
  1916. 'string': function string() {
  1917. plugins = hyphenate(plugins);
  1918. jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + plugins + ']').foundation('_init');
  1919. },
  1920. 'undefined': function undefined() {
  1921. this['object'](Object.keys(_this._plugins));
  1922. }
  1923. };
  1924. fns[type](plugins);
  1925. }
  1926. } catch (err) {
  1927. console.error(err);
  1928. } finally {
  1929. return plugins;
  1930. }
  1931. },
  1932. /**
  1933. * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.
  1934. * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.
  1935. * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.
  1936. */
  1937. reflow: function reflow(elem, plugins) {
  1938. // If plugins is undefined, just grab everything
  1939. if (typeof plugins === 'undefined') {
  1940. plugins = Object.keys(this._plugins);
  1941. } // If plugins is a string, convert it to an array with one item
  1942. else if (typeof plugins === 'string') {
  1943. plugins = [plugins];
  1944. }
  1945. var _this = this; // Iterate through each plugin
  1946. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(plugins, function (i, name) {
  1947. // Get the current plugin
  1948. var plugin = _this._plugins[name]; // Localize the search to all elements inside elem, as well as elem itself, unless elem === document
  1949. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem).find('[data-' + name + ']').addBack('[data-' + name + ']').filter(function () {
  1950. return typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data("zfPlugin") === 'undefined';
  1951. }); // For each plugin found, initialize it
  1952. $elem.each(function () {
  1953. var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  1954. opts = {
  1955. reflow: true
  1956. };
  1957. if ($el.attr('data-options')) {
  1958. $el.attr('data-options').split(';').forEach(function (option, _index) {
  1959. var opt = option.split(':').map(function (el) {
  1960. return el.trim();
  1961. });
  1962. if (opt[0]) opts[opt[0]] = parseValue(opt[1]);
  1963. });
  1964. }
  1965. try {
  1966. $el.data('zfPlugin', new plugin(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), opts));
  1967. } catch (er) {
  1968. console.error(er);
  1969. } finally {
  1970. return;
  1971. }
  1972. });
  1973. });
  1974. },
  1975. getFnName: functionName,
  1976. addToJquery: function addToJquery($) {
  1977. // TODO: consider not making this a jQuery function
  1978. // TODO: need way to reflow vs. re-initialize
  1979. /**
  1980. * The Foundation jQuery method.
  1981. * @param {String|Array} method - An action to perform on the current jQuery object.
  1982. */
  1983. var foundation = function foundation(method) {
  1984. var type = _typeof(method),
  1985. $noJS = $('.no-js');
  1986. if ($noJS.length) {
  1987. $noJS.removeClass('no-js');
  1988. }
  1989. if (type === 'undefined') {
  1990. //needs to initialize the Foundation object, or an individual plugin.
  1991. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init();
  1992. Foundation.reflow(this);
  1993. } else if (type === 'string') {
  1994. //an individual method to invoke on a plugin or group of plugins
  1995. var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary
  1996. var plugClass = this.data('zfPlugin'); //determine the class of plugin
  1997. if (typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined') {
  1998. //make sure both the class and method exist
  1999. if (this.length === 1) {
  2000. //if there's only one, call it directly.
  2001. plugClass[method].apply(plugClass, args);
  2002. } else {
  2003. this.each(function (i, el) {
  2004. //otherwise loop through the jQuery collection and invoke the method on each
  2005. plugClass[method].apply($(el).data('zfPlugin'), args);
  2006. });
  2007. }
  2008. } else {
  2009. //error for no class or no method
  2010. throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.');
  2011. }
  2012. } else {
  2013. //error for invalid argument type
  2014. throw new TypeError("We're sorry, ".concat(type, " is not a valid parameter. You must use a string representing the method you wish to invoke."));
  2015. }
  2016. return this;
  2017. };
  2018. $.fn.foundation = foundation;
  2019. return $;
  2020. }
  2021. };
  2022. Foundation.util = {
  2023. /**
  2024. * Function for applying a debounce effect to a function call.
  2025. * @function
  2026. * @param {Function} func - Function to be called at end of timeout.
  2027. * @param {Number} delay - Time in ms to delay the call of `func`.
  2028. * @returns function
  2029. */
  2030. throttle: function throttle(func, delay) {
  2031. var timer = null;
  2032. return function () {
  2033. var context = this,
  2034. args = arguments;
  2035. if (timer === null) {
  2036. timer = setTimeout(function () {
  2037. func.apply(context, args);
  2038. timer = null;
  2039. }, delay);
  2040. }
  2041. };
  2042. }
  2043. };
  2044. window.Foundation = Foundation; // Polyfill for requestAnimationFrame
  2045. (function () {
  2046. if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () {
  2047. return new Date().getTime();
  2048. };
  2049. var vendors = ['webkit', 'moz'];
  2050. for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
  2051. var vp = vendors[i];
  2052. window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
  2053. window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame'];
  2054. }
  2055. if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
  2056. var lastTime = 0;
  2057. window.requestAnimationFrame = function (callback) {
  2058. var now = Date.now();
  2059. var nextTime = Math.max(lastTime + 16, now);
  2060. return setTimeout(function () {
  2061. callback(lastTime = nextTime);
  2062. }, nextTime - now);
  2063. };
  2064. window.cancelAnimationFrame = clearTimeout;
  2065. }
  2066. /**
  2067. * Polyfill for performance.now, required by rAF
  2068. */
  2069. if (!window.performance || !window.performance.now) {
  2070. window.performance = {
  2071. start: Date.now(),
  2072. now: function now() {
  2073. return Date.now() - this.start;
  2074. }
  2075. };
  2076. }
  2077. })();
  2078. if (!Function.prototype.bind) {
  2079. Function.prototype.bind = function (oThis) {
  2080. if (typeof this !== 'function') {
  2081. // closest thing possible to the ECMAScript 5
  2082. // internal IsCallable function
  2083. throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
  2084. }
  2085. var aArgs = Array.prototype.slice.call(arguments, 1),
  2086. fToBind = this,
  2087. fNOP = function fNOP() {},
  2088. fBound = function fBound() {
  2089. return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  2090. };
  2091. if (this.prototype) {
  2092. // native functions don't have a prototype
  2093. fNOP.prototype = this.prototype;
  2094. }
  2095. fBound.prototype = new fNOP();
  2096. return fBound;
  2097. };
  2098. } // Polyfill to get the name of a function in IE9
  2099. function functionName(fn) {
  2100. if (typeof Function.prototype.name === 'undefined') {
  2101. var funcNameRegex = /function\s([^(]{1,})\(/;
  2102. var results = funcNameRegex.exec(fn.toString());
  2103. return results && results.length > 1 ? results[1].trim() : "";
  2104. } else if (typeof fn.prototype === 'undefined') {
  2105. return fn.constructor.name;
  2106. } else {
  2107. return fn.prototype.constructor.name;
  2108. }
  2109. }
  2110. function parseValue(str) {
  2111. if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str);
  2112. return str;
  2113. } // Convert PascalCase to kebab-case
  2114. // Thank you: http://stackoverflow.com/a/8955580
  2115. function hyphenate(str) {
  2116. return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
  2117. }
  2118. /***/ }),
  2119. /***/ "./js/foundation.core.plugin.js":
  2120. /*!**************************************!*\
  2121. !*** ./js/foundation.core.plugin.js ***!
  2122. \**************************************/
  2123. /*! exports provided: Plugin */
  2124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2125. "use strict";
  2126. __webpack_require__.r(__webpack_exports__);
  2127. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return Plugin; });
  2128. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  2129. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  2130. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  2131. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2132. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2133. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2134. // Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST
  2135. // {function} _setup (replaces previous constructor),
  2136. // {function} _destroy (replaces previous destroy)
  2137. var Plugin =
  2138. /*#__PURE__*/
  2139. function () {
  2140. function Plugin(element, options) {
  2141. _classCallCheck(this, Plugin);
  2142. this._setup(element, options);
  2143. var pluginName = getPluginName(this);
  2144. this.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName);
  2145. if (!this.$element.attr("data-".concat(pluginName))) {
  2146. this.$element.attr("data-".concat(pluginName), this.uuid);
  2147. }
  2148. if (!this.$element.data('zfPlugin')) {
  2149. this.$element.data('zfPlugin', this);
  2150. }
  2151. /**
  2152. * Fires when the plugin has initialized.
  2153. * @event Plugin#init
  2154. */
  2155. this.$element.trigger("init.zf.".concat(pluginName));
  2156. }
  2157. _createClass(Plugin, [{
  2158. key: "destroy",
  2159. value: function destroy() {
  2160. this._destroy();
  2161. var pluginName = getPluginName(this);
  2162. this.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin')
  2163. /**
  2164. * Fires when the plugin has been destroyed.
  2165. * @event Plugin#destroyed
  2166. */
  2167. .trigger("destroyed.zf.".concat(pluginName));
  2168. for (var prop in this) {
  2169. this[prop] = null; //clean up script to prep for garbage collection.
  2170. }
  2171. }
  2172. }]);
  2173. return Plugin;
  2174. }(); // Convert PascalCase to kebab-case
  2175. // Thank you: http://stackoverflow.com/a/8955580
  2176. function hyphenate(str) {
  2177. return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
  2178. }
  2179. function getPluginName(obj) {
  2180. return hyphenate(obj.className);
  2181. }
  2182. /***/ }),
  2183. /***/ "./js/foundation.core.utils.js":
  2184. /*!*************************************!*\
  2185. !*** ./js/foundation.core.utils.js ***!
  2186. \*************************************/
  2187. /*! exports provided: rtl, GetYoDigits, RegExpEscape, transitionend, onLoad, ignoreMousedisappear */
  2188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2189. "use strict";
  2190. __webpack_require__.r(__webpack_exports__);
  2191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtl", function() { return rtl; });
  2192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetYoDigits", function() { return GetYoDigits; });
  2193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegExpEscape", function() { return RegExpEscape; });
  2194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transitionend", function() { return transitionend; });
  2195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return onLoad; });
  2196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreMousedisappear", function() { return ignoreMousedisappear; });
  2197. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  2198. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  2199. // Core Foundation Utilities, utilized in a number of places.
  2200. /**
  2201. * Returns a boolean for RTL support
  2202. */
  2203. function rtl() {
  2204. return jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').attr('dir') === 'rtl';
  2205. }
  2206. /**
  2207. * returns a random base-36 uid with namespacing
  2208. * @function
  2209. * @param {Number} length - number of random base-36 digits desired. Increase for more random strings.
  2210. * @param {String} namespace - name of plugin to be incorporated in uid, optional.
  2211. * @default {String} '' - if no plugin name is provided, nothing is appended to the uid.
  2212. * @returns {String} - unique id
  2213. */
  2214. function GetYoDigits() {
  2215. var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
  2216. var namespace = arguments.length > 1 ? arguments[1] : undefined;
  2217. var str = '';
  2218. var chars = '0123456789abcdefghijklmnopqrstuvwxyz';
  2219. var charsLength = chars.length;
  2220. for (var i = 0; i < length; i++) {
  2221. str += chars[Math.floor(Math.random() * charsLength)];
  2222. }
  2223. return namespace ? "".concat(str, "-").concat(namespace) : str;
  2224. }
  2225. /**
  2226. * Escape a string so it can be used as a regexp pattern
  2227. * @function
  2228. * @see https://stackoverflow.com/a/9310752/4317384
  2229. *
  2230. * @param {String} str - string to escape.
  2231. * @returns {String} - escaped string
  2232. */
  2233. function RegExpEscape(str) {
  2234. return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
  2235. }
  2236. function transitionend($elem) {
  2237. var transitions = {
  2238. 'transition': 'transitionend',
  2239. 'WebkitTransition': 'webkitTransitionEnd',
  2240. 'MozTransition': 'transitionend',
  2241. 'OTransition': 'otransitionend'
  2242. };
  2243. var elem = document.createElement('div'),
  2244. end;
  2245. for (var transition in transitions) {
  2246. if (typeof elem.style[transition] !== 'undefined') {
  2247. end = transitions[transition];
  2248. }
  2249. }
  2250. if (end) {
  2251. return end;
  2252. } else {
  2253. setTimeout(function () {
  2254. $elem.triggerHandler('transitionend', [$elem]);
  2255. }, 1);
  2256. return 'transitionend';
  2257. }
  2258. }
  2259. /**
  2260. * Return an event type to listen for window load.
  2261. *
  2262. * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered.
  2263. * If `handler` is passed, attach it to the event on `$elem`.
  2264. * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself.
  2265. * @function
  2266. *
  2267. * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed.
  2268. * @param {Function} [] handler - function to attach to the event.
  2269. * @returns {String} - event type that should or will be triggered.
  2270. */
  2271. function onLoad($elem, handler) {
  2272. var didLoad = document.readyState === 'complete';
  2273. var eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad';
  2274. var cb = function cb() {
  2275. return $elem.triggerHandler(eventType);
  2276. };
  2277. if ($elem) {
  2278. if (handler) $elem.one(eventType, handler);
  2279. if (didLoad) setTimeout(cb);else jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', cb);
  2280. }
  2281. return eventType;
  2282. }
  2283. /**
  2284. * Retuns an handler for the `mouseleave` that ignore disappeared mouses.
  2285. *
  2286. * If the mouse "disappeared" from the document (like when going on a browser UI element, See https://git.io/zf-11410),
  2287. * the event is ignored.
  2288. * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window
  2289. * (like by switching to an other window with [Alt]+[Tab]).
  2290. * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document
  2291. * outside of the element it left.
  2292. *
  2293. * @function
  2294. *
  2295. * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch.
  2296. * @param {Object} [] options - object of options:
  2297. * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows.
  2298. * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left.
  2299. * @returns {Function} - filtered handler to use to listen on the `mouseleave` event.
  2300. */
  2301. function ignoreMousedisappear(handler) {
  2302. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2303. _ref$ignoreLeaveWindo = _ref.ignoreLeaveWindow,
  2304. ignoreLeaveWindow = _ref$ignoreLeaveWindo === void 0 ? false : _ref$ignoreLeaveWindo,
  2305. _ref$ignoreReappear = _ref.ignoreReappear,
  2306. ignoreReappear = _ref$ignoreReappear === void 0 ? false : _ref$ignoreReappear;
  2307. return function leaveEventHandler(eLeave) {
  2308. for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2309. rest[_key - 1] = arguments[_key];
  2310. }
  2311. var callback = handler.bind.apply(handler, [this, eLeave].concat(rest)); // The mouse left: call the given callback if the mouse entered elsewhere
  2312. if (eLeave.relatedTarget !== null) {
  2313. return callback();
  2314. } // Otherwise, check if the mouse actually left the window.
  2315. // In firefox if the user switched between windows, the window sill have the focus by the time
  2316. // the event is triggered. We have to debounce the event to test this case.
  2317. setTimeout(function leaveEventDebouncer() {
  2318. if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) {
  2319. return callback();
  2320. } // Otherwise, wait for the mouse to reeapear outside of the element,
  2321. if (!ignoreReappear) {
  2322. jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).one('mouseenter', function reenterEventHandler(eReenter) {
  2323. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(eLeave.currentTarget).has(eReenter.target).length) {
  2324. // Fill where the mouse finally entered.
  2325. eLeave.relatedTarget = eReenter.target;
  2326. callback();
  2327. }
  2328. });
  2329. }
  2330. }, 0);
  2331. };
  2332. }
  2333. /***/ }),
  2334. /***/ "./js/foundation.drilldown.js":
  2335. /*!************************************!*\
  2336. !*** ./js/foundation.drilldown.js ***!
  2337. \************************************/
  2338. /*! exports provided: Drilldown */
  2339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2340. "use strict";
  2341. __webpack_require__.r(__webpack_exports__);
  2342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return Drilldown; });
  2343. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  2344. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  2345. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  2346. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js");
  2347. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  2348. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js");
  2349. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  2350. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2351. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2352. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2353. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2354. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2355. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2356. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2357. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2358. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2359. /**
  2360. * Drilldown module.
  2361. * @module foundation.drilldown
  2362. * @requires foundation.util.keyboard
  2363. * @requires foundation.util.nest
  2364. * @requires foundation.util.box
  2365. */
  2366. var Drilldown =
  2367. /*#__PURE__*/
  2368. function (_Plugin) {
  2369. _inherits(Drilldown, _Plugin);
  2370. function Drilldown() {
  2371. _classCallCheck(this, Drilldown);
  2372. return _possibleConstructorReturn(this, _getPrototypeOf(Drilldown).apply(this, arguments));
  2373. }
  2374. _createClass(Drilldown, [{
  2375. key: "_setup",
  2376. /**
  2377. * Creates a new instance of a drilldown menu.
  2378. * @class
  2379. * @name Drilldown
  2380. * @param {jQuery} element - jQuery object to make into an accordion menu.
  2381. * @param {Object} options - Overrides to the default plugin settings.
  2382. */
  2383. value: function _setup(element, options) {
  2384. this.$element = element;
  2385. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Drilldown.defaults, this.$element.data(), options);
  2386. this.className = 'Drilldown'; // ie9 back compat
  2387. this._init();
  2388. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Drilldown', {
  2389. 'ENTER': 'open',
  2390. 'SPACE': 'open',
  2391. 'ARROW_RIGHT': 'next',
  2392. 'ARROW_UP': 'up',
  2393. 'ARROW_DOWN': 'down',
  2394. 'ARROW_LEFT': 'previous',
  2395. 'ESCAPE': 'close',
  2396. 'TAB': 'down',
  2397. 'SHIFT_TAB': 'up'
  2398. });
  2399. }
  2400. /**
  2401. * Initializes the drilldown by creating jQuery collections of elements
  2402. * @private
  2403. */
  2404. }, {
  2405. key: "_init",
  2406. value: function _init() {
  2407. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'drilldown');
  2408. if (this.options.autoApplyClass) {
  2409. this.$element.addClass('drilldown');
  2410. }
  2411. this.$element.attr({
  2412. 'role': 'tree',
  2413. 'aria-multiselectable': false
  2414. });
  2415. this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');
  2416. this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');
  2417. this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a'); // Set the main menu as current by default (unless a submenu is selected)
  2418. // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu
  2419. this.$currentMenu = this.$element;
  2420. this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'drilldown'));
  2421. this._prepareMenu();
  2422. this._registerEvents();
  2423. this._keyboardEvents();
  2424. }
  2425. /**
  2426. * prepares drilldown menu by setting attributes to links and elements
  2427. * sets a min height to prevent content jumping
  2428. * wraps the element if not already wrapped
  2429. * @private
  2430. * @function
  2431. */
  2432. }, {
  2433. key: "_prepareMenu",
  2434. value: function _prepareMenu() {
  2435. var _this = this; // if(!this.options.holdOpen){
  2436. // this._menuLinkEvents();
  2437. // }
  2438. this.$submenuAnchors.each(function () {
  2439. var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  2440. var $sub = $link.parent();
  2441. if (_this.options.parentLink) {
  2442. $link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="none"></li>');
  2443. }
  2444. $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);
  2445. $link.children('[data-submenu]').attr({
  2446. 'aria-hidden': true,
  2447. 'tabindex': 0,
  2448. 'role': 'group'
  2449. });
  2450. _this._events($link);
  2451. });
  2452. this.$submenus.each(function () {
  2453. var $menu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  2454. $back = $menu.find('.js-drilldown-back');
  2455. if (!$back.length) {
  2456. switch (_this.options.backButtonPosition) {
  2457. case "bottom":
  2458. $menu.append(_this.options.backButton);
  2459. break;
  2460. case "top":
  2461. $menu.prepend(_this.options.backButton);
  2462. break;
  2463. default:
  2464. console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'");
  2465. }
  2466. }
  2467. _this._back($menu);
  2468. });
  2469. this.$submenus.addClass('invisible');
  2470. if (!this.options.autoHeight) {
  2471. this.$submenus.addClass('drilldown-submenu-cover-previous');
  2472. } // create a wrapper on element if it doesn't exist.
  2473. if (!this.$element.parent().hasClass('is-drilldown')) {
  2474. this.$wrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.wrapper).addClass('is-drilldown');
  2475. if (this.options.animateHeight) this.$wrapper.addClass('animate-height');
  2476. this.$element.wrap(this.$wrapper);
  2477. } // set wrapper
  2478. this.$wrapper = this.$element.parent();
  2479. this.$wrapper.css(this._getMaxDims());
  2480. }
  2481. }, {
  2482. key: "_resize",
  2483. value: function _resize() {
  2484. this.$wrapper.css({
  2485. 'max-width': 'none',
  2486. 'min-height': 'none'
  2487. }); // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths
  2488. this.$wrapper.css(this._getMaxDims());
  2489. }
  2490. /**
  2491. * Adds event handlers to elements in the menu.
  2492. * @function
  2493. * @private
  2494. * @param {jQuery} $elem - the current menu item to add handlers to.
  2495. */
  2496. }, {
  2497. key: "_events",
  2498. value: function _events($elem) {
  2499. var _this = this;
  2500. $elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
  2501. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) {
  2502. e.preventDefault();
  2503. } // if(e.target !== e.currentTarget.firstElementChild){
  2504. // return false;
  2505. // }
  2506. _this._show($elem.parent('li'));
  2507. if (_this.options.closeOnClick) {
  2508. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body');
  2509. $body.off('.zf.drilldown').on('click.zf.drilldown', function (e) {
  2510. if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target)) {
  2511. return;
  2512. }
  2513. e.preventDefault();
  2514. _this._hideAll();
  2515. $body.off('.zf.drilldown');
  2516. });
  2517. }
  2518. });
  2519. }
  2520. /**
  2521. * Adds event handlers to the menu element.
  2522. * @function
  2523. * @private
  2524. */
  2525. }, {
  2526. key: "_registerEvents",
  2527. value: function _registerEvents() {
  2528. if (this.options.scrollTop) {
  2529. this._bindHandler = this._scrollTop.bind(this);
  2530. this.$element.on('open.zf.drilldown hide.zf.drilldown close.zf.drilldown closed.zf.drilldown', this._bindHandler);
  2531. }
  2532. this.$element.on('mutateme.zf.trigger', this._resize.bind(this));
  2533. }
  2534. /**
  2535. * Scroll to Top of Element or data-scroll-top-element
  2536. * @function
  2537. * @fires Drilldown#scrollme
  2538. */
  2539. }, {
  2540. key: "_scrollTop",
  2541. value: function _scrollTop() {
  2542. var _this = this;
  2543. var $scrollTopElement = _this.options.scrollTopElement != '' ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this.options.scrollTopElement) : _this.$element,
  2544. scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10);
  2545. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({
  2546. scrollTop: scrollPos
  2547. }, _this.options.animationDuration, _this.options.animationEasing, function () {
  2548. /**
  2549. * Fires after the menu has scrolled
  2550. * @event Drilldown#scrollme
  2551. */
  2552. if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown');
  2553. });
  2554. }
  2555. /**
  2556. * Adds keydown event listener to `li`'s in the menu.
  2557. * @private
  2558. */
  2559. }, {
  2560. key: "_keyboardEvents",
  2561. value: function _keyboardEvents() {
  2562. var _this = this;
  2563. this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) {
  2564. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  2565. $elements = $element.parent('li').parent('ul').children('li').children('a'),
  2566. $prevElement,
  2567. $nextElement;
  2568. $elements.each(function (i) {
  2569. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  2570. $prevElement = $elements.eq(Math.max(0, i - 1));
  2571. $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
  2572. return;
  2573. }
  2574. });
  2575. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Drilldown', {
  2576. next: function next() {
  2577. if ($element.is(_this.$submenuAnchors)) {
  2578. _this._show($element.parent('li'));
  2579. $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2580. $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();
  2581. });
  2582. return true;
  2583. }
  2584. },
  2585. previous: function previous() {
  2586. _this._hide($element.parent('li').parent('ul'));
  2587. $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2588. setTimeout(function () {
  2589. $element.parent('li').parent('ul').parent('li').children('a').first().focus();
  2590. }, 1);
  2591. });
  2592. return true;
  2593. },
  2594. up: function up() {
  2595. $prevElement.focus(); // Don't tap focus on first element in root ul
  2596. return !$element.is(_this.$element.find('> li:first-child > a'));
  2597. },
  2598. down: function down() {
  2599. $nextElement.focus(); // Don't tap focus on last element in root ul
  2600. return !$element.is(_this.$element.find('> li:last-child > a'));
  2601. },
  2602. close: function close() {
  2603. // Don't close on element in root ul
  2604. if (!$element.is(_this.$element.find('> li > a'))) {
  2605. _this._hide($element.parent().parent());
  2606. $element.parent().parent().siblings('a').focus();
  2607. }
  2608. },
  2609. open: function open() {
  2610. if (_this.options.parentLink && $element.attr('href')) {
  2611. // Link with href
  2612. return false;
  2613. } else if (!$element.is(_this.$menuItems)) {
  2614. // not menu item means back button
  2615. _this._hide($element.parent('li').parent('ul'));
  2616. $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2617. setTimeout(function () {
  2618. $element.parent('li').parent('ul').parent('li').children('a').first().focus();
  2619. }, 1);
  2620. });
  2621. return true;
  2622. } else if ($element.is(_this.$submenuAnchors)) {
  2623. // Sub menu item
  2624. _this._show($element.parent('li'));
  2625. $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2626. $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();
  2627. });
  2628. return true;
  2629. }
  2630. },
  2631. handled: function handled(preventDefault) {
  2632. if (preventDefault) {
  2633. e.preventDefault();
  2634. }
  2635. }
  2636. });
  2637. }); // end keyboardAccess
  2638. }
  2639. /**
  2640. * Closes all open elements, and returns to root menu.
  2641. * @function
  2642. * @fires Drilldown#close
  2643. * @fires Drilldown#closed
  2644. */
  2645. }, {
  2646. key: "_hideAll",
  2647. value: function _hideAll() {
  2648. var _this2 = this;
  2649. var $elem = this.$element.find('.is-drilldown-submenu.is-active');
  2650. $elem.addClass('is-closing');
  2651. if (this.options.autoHeight) {
  2652. var calcHeight = $elem.parent().closest('ul').data('calcHeight');
  2653. this.$wrapper.css({
  2654. height: calcHeight
  2655. });
  2656. }
  2657. /**
  2658. * Fires when the menu is closing.
  2659. * @event Drilldown#close
  2660. */
  2661. this.$element.trigger('close.zf.drilldown');
  2662. $elem.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () {
  2663. $elem.removeClass('is-active is-closing');
  2664. /**
  2665. * Fires when the menu is fully closed.
  2666. * @event Drilldown#closed
  2667. */
  2668. _this2.$element.trigger('closed.zf.drilldown');
  2669. });
  2670. }
  2671. /**
  2672. * Adds event listener for each `back` button, and closes open menus.
  2673. * @function
  2674. * @fires Drilldown#back
  2675. * @param {jQuery} $elem - the current sub-menu to add `back` event.
  2676. */
  2677. }, {
  2678. key: "_back",
  2679. value: function _back($elem) {
  2680. var _this = this;
  2681. $elem.off('click.zf.drilldown');
  2682. $elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) {
  2683. // console.log('mouseup on back');
  2684. _this._hide($elem); // If there is a parent submenu, call show
  2685. var parentSubMenu = $elem.parent('li').parent('ul').parent('li');
  2686. if (parentSubMenu.length) {
  2687. _this._show(parentSubMenu);
  2688. }
  2689. });
  2690. }
  2691. /**
  2692. * Adds event listener to menu items w/o submenus to close open menus on click.
  2693. * @function
  2694. * @private
  2695. */
  2696. }, {
  2697. key: "_menuLinkEvents",
  2698. value: function _menuLinkEvents() {
  2699. var _this = this;
  2700. this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
  2701. setTimeout(function () {
  2702. _this._hideAll();
  2703. }, 0);
  2704. });
  2705. }
  2706. /**
  2707. * Sets the CSS classes for submenu to show it.
  2708. * @function
  2709. * @private
  2710. * @param {jQuery} $elem - the target submenu (`ul` tag)
  2711. * @param {boolean} trigger - trigger drilldown event
  2712. */
  2713. }, {
  2714. key: "_setShowSubMenuClasses",
  2715. value: function _setShowSubMenuClasses($elem, trigger) {
  2716. $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
  2717. $elem.parent('li').attr('aria-expanded', true);
  2718. if (trigger === true) {
  2719. this.$element.trigger('open.zf.drilldown', [$elem]);
  2720. }
  2721. }
  2722. /**
  2723. * Sets the CSS classes for submenu to hide it.
  2724. * @function
  2725. * @private
  2726. * @param {jQuery} $elem - the target submenu (`ul` tag)
  2727. * @param {boolean} trigger - trigger drilldown event
  2728. */
  2729. }, {
  2730. key: "_setHideSubMenuClasses",
  2731. value: function _setHideSubMenuClasses($elem, trigger) {
  2732. $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true);
  2733. $elem.parent('li').attr('aria-expanded', false);
  2734. if (trigger === true) {
  2735. $elem.trigger('hide.zf.drilldown', [$elem]);
  2736. }
  2737. }
  2738. /**
  2739. * Opens a specific drilldown (sub)menu no matter which (sub)menu in it is currently visible.
  2740. * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it.
  2741. * @function
  2742. * @fires Drilldown#open
  2743. * @param {jQuery} $elem - the target (sub)menu (`ul` tag)
  2744. * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused
  2745. */
  2746. }, {
  2747. key: "_showMenu",
  2748. value: function _showMenu($elem, autoFocus) {
  2749. var _this = this; // Reset drilldown
  2750. var $expandedSubmenus = this.$element.find('li[aria-expanded="true"] > ul[data-submenu]');
  2751. $expandedSubmenus.each(function (index) {
  2752. _this._setHideSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  2753. }); // Save the menu as the currently displayed one.
  2754. this.$currentMenu = $elem; // If target menu is root, focus first link & exit
  2755. if ($elem.is('[data-drilldown]')) {
  2756. if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus();
  2757. if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));
  2758. return;
  2759. } // Find all submenus on way to root incl. the element itself
  2760. var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]'); // Open target menu and all submenus on its way to root
  2761. $submenus.each(function (index) {
  2762. // Update height of first child (target menu) if autoHeight option true
  2763. if (index === 0 && _this.options.autoHeight) {
  2764. _this.$wrapper.css('height', jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight'));
  2765. }
  2766. var isLastChild = index == $submenus.length - 1; // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link
  2767. // Last child makes sure the event gets always triggered even if going through several menus
  2768. if (isLastChild === true) {
  2769. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)), function () {
  2770. if (autoFocus === true) {
  2771. $elem.find('li[role="treeitem"] > a').first().focus();
  2772. }
  2773. });
  2774. }
  2775. _this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild);
  2776. });
  2777. }
  2778. /**
  2779. * Opens a submenu.
  2780. * @function
  2781. * @fires Drilldown#open
  2782. * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.
  2783. */
  2784. }, {
  2785. key: "_show",
  2786. value: function _show($elem) {
  2787. var $submenu = $elem.children('[data-submenu]');
  2788. $elem.attr('aria-expanded', true);
  2789. this.$currentMenu = $submenu;
  2790. $submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
  2791. if (this.options.autoHeight) {
  2792. this.$wrapper.css({
  2793. height: $submenu.data('calcHeight')
  2794. });
  2795. }
  2796. /**
  2797. * Fires when the submenu has opened.
  2798. * @event Drilldown#open
  2799. */
  2800. this.$element.trigger('open.zf.drilldown', [$elem]);
  2801. }
  2802. /**
  2803. * Hides a submenu
  2804. * @function
  2805. * @fires Drilldown#hide
  2806. * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.
  2807. */
  2808. }, {
  2809. key: "_hide",
  2810. value: function _hide($elem) {
  2811. if (this.options.autoHeight) this.$wrapper.css({
  2812. height: $elem.parent().closest('ul').data('calcHeight')
  2813. });
  2814. var _this = this;
  2815. $elem.parent('li').attr('aria-expanded', false);
  2816. $elem.attr('aria-hidden', true);
  2817. $elem.addClass('is-closing').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () {
  2818. $elem.removeClass('is-active is-closing');
  2819. $elem.blur().addClass('invisible');
  2820. });
  2821. /**
  2822. * Fires when the submenu has closed.
  2823. * @event Drilldown#hide
  2824. */
  2825. $elem.trigger('hide.zf.drilldown', [$elem]);
  2826. }
  2827. /**
  2828. * Iterates through the nested menus to calculate the min-height, and max-width for the menu.
  2829. * Prevents content jumping.
  2830. * @function
  2831. * @private
  2832. */
  2833. }, {
  2834. key: "_getMaxDims",
  2835. value: function _getMaxDims() {
  2836. var maxHeight = 0,
  2837. result = {},
  2838. _this = this; // Recalculate menu heights and total max height
  2839. this.$submenus.add(this.$element).each(function () {
  2840. var numOfElems = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('li').length;
  2841. var height = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].GetDimensions(this).height;
  2842. maxHeight = height > maxHeight ? height : maxHeight;
  2843. if (_this.options.autoHeight) {
  2844. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight', height);
  2845. }
  2846. });
  2847. if (this.options.autoHeight) result['height'] = this.$currentMenu.data('calcHeight');else result['min-height'] = "".concat(maxHeight, "px");
  2848. result['max-width'] = "".concat(this.$element[0].getBoundingClientRect().width, "px");
  2849. return result;
  2850. }
  2851. /**
  2852. * Destroys the Drilldown Menu
  2853. * @function
  2854. */
  2855. }, {
  2856. key: "_destroy",
  2857. value: function _destroy() {
  2858. if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler);
  2859. this._hideAll();
  2860. this.$element.off('mutateme.zf.trigger');
  2861. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'drilldown');
  2862. this.$element.unwrap().find('.js-drilldown-back, .is-submenu-parent-item').remove().end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');
  2863. this.$submenuAnchors.each(function () {
  2864. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off('.zf.drilldown');
  2865. });
  2866. this.$element.find('[data-is-parent-link]').detach();
  2867. this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');
  2868. this.$element.find('a').each(function () {
  2869. var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  2870. $link.removeAttr('tabindex');
  2871. if ($link.data('savedHref')) {
  2872. $link.attr('href', $link.data('savedHref')).removeData('savedHref');
  2873. } else {
  2874. return;
  2875. }
  2876. });
  2877. }
  2878. }]);
  2879. return Drilldown;
  2880. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__["Plugin"]);
  2881. Drilldown.defaults = {
  2882. /**
  2883. * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are
  2884. * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.
  2885. * @option
  2886. * @type {boolean}
  2887. * @default true
  2888. */
  2889. autoApplyClass: true,
  2890. /**
  2891. * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting.
  2892. * @option
  2893. * @type {string}
  2894. * @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>'
  2895. */
  2896. backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>',
  2897. /**
  2898. * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.
  2899. * @option
  2900. * @type {string}
  2901. * @default top
  2902. */
  2903. backButtonPosition: 'top',
  2904. /**
  2905. * Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\`) if copy and pasting.
  2906. * @option
  2907. * @type {string}
  2908. * @default '<div></div>'
  2909. */
  2910. wrapper: '<div></div>',
  2911. /**
  2912. * Adds the parent link to the submenu.
  2913. * @option
  2914. * @type {boolean}
  2915. * @default false
  2916. */
  2917. parentLink: false,
  2918. /**
  2919. * Allow the menu to return to root list on body click.
  2920. * @option
  2921. * @type {boolean}
  2922. * @default false
  2923. */
  2924. closeOnClick: false,
  2925. /**
  2926. * Allow the menu to auto adjust height.
  2927. * @option
  2928. * @type {boolean}
  2929. * @default false
  2930. */
  2931. autoHeight: false,
  2932. /**
  2933. * Animate the auto adjust height.
  2934. * @option
  2935. * @type {boolean}
  2936. * @default false
  2937. */
  2938. animateHeight: false,
  2939. /**
  2940. * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button
  2941. * @option
  2942. * @type {boolean}
  2943. * @default false
  2944. */
  2945. scrollTop: false,
  2946. /**
  2947. * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken
  2948. * @option
  2949. * @type {string}
  2950. * @default ''
  2951. */
  2952. scrollTopElement: '',
  2953. /**
  2954. * ScrollTop offset
  2955. * @option
  2956. * @type {number}
  2957. * @default 0
  2958. */
  2959. scrollTopOffset: 0,
  2960. /**
  2961. * Scroll animation duration
  2962. * @option
  2963. * @type {number}
  2964. * @default 500
  2965. */
  2966. animationDuration: 500,
  2967. /**
  2968. * Scroll animation easing. Can be `'swing'` or `'linear'`.
  2969. * @option
  2970. * @type {string}
  2971. * @see {@link https://api.jquery.com/animate|JQuery animate}
  2972. * @default 'swing'
  2973. */
  2974. animationEasing: 'swing' // holdOpen: false
  2975. };
  2976. /***/ }),
  2977. /***/ "./js/foundation.dropdown.js":
  2978. /*!***********************************!*\
  2979. !*** ./js/foundation.dropdown.js ***!
  2980. \***********************************/
  2981. /*! exports provided: Dropdown */
  2982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2983. "use strict";
  2984. __webpack_require__.r(__webpack_exports__);
  2985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return Dropdown; });
  2986. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  2987. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  2988. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  2989. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  2990. /* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js");
  2991. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  2992. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  2993. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2994. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2995. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2996. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2997. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2998. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2999. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  3000. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  3001. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3002. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3003. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3004. /**
  3005. * Dropdown module.
  3006. * @module foundation.dropdown
  3007. * @requires foundation.util.keyboard
  3008. * @requires foundation.util.box
  3009. * @requires foundation.util.touch
  3010. * @requires foundation.util.triggers
  3011. */
  3012. var Dropdown =
  3013. /*#__PURE__*/
  3014. function (_Positionable) {
  3015. _inherits(Dropdown, _Positionable);
  3016. function Dropdown() {
  3017. _classCallCheck(this, Dropdown);
  3018. return _possibleConstructorReturn(this, _getPrototypeOf(Dropdown).apply(this, arguments));
  3019. }
  3020. _createClass(Dropdown, [{
  3021. key: "_setup",
  3022. /**
  3023. * Creates a new instance of a dropdown.
  3024. * @class
  3025. * @name Dropdown
  3026. * @param {jQuery} element - jQuery object to make into a dropdown.
  3027. * Object should be of the dropdown panel, rather than its anchor.
  3028. * @param {Object} options - Overrides to the default plugin settings.
  3029. */
  3030. value: function _setup(element, options) {
  3031. this.$element = element;
  3032. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Dropdown.defaults, this.$element.data(), options);
  3033. this.className = 'Dropdown'; // ie9 back compat
  3034. // Touch and Triggers init are idempotent, just need to make sure they are initialized
  3035. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  3036. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  3037. this._init();
  3038. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Dropdown', {
  3039. 'ENTER': 'toggle',
  3040. 'SPACE': 'toggle',
  3041. 'ESCAPE': 'close'
  3042. });
  3043. }
  3044. /**
  3045. * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor.
  3046. * @function
  3047. * @private
  3048. */
  3049. }, {
  3050. key: "_init",
  3051. value: function _init() {
  3052. var $id = this.$element.attr('id');
  3053. this.$anchors = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat($id, "\"]")).length ? jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat($id, "\"]")) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat($id, "\"]"));
  3054. this.$anchors.attr({
  3055. 'aria-controls': $id,
  3056. 'data-is-focus': false,
  3057. 'data-yeti-box': $id,
  3058. 'aria-haspopup': true,
  3059. 'aria-expanded': false
  3060. });
  3061. this._setCurrentAnchor(this.$anchors.first());
  3062. if (this.options.parentClass) {
  3063. this.$parent = this.$element.parents('.' + this.options.parentClass);
  3064. } else {
  3065. this.$parent = null;
  3066. } // Set [aria-labelledby] on the Dropdown if it is not set
  3067. if (typeof this.$element.attr('aria-labelledby') === 'undefined') {
  3068. // Get the anchor ID or create one
  3069. if (typeof this.$currentAnchor.attr('id') === 'undefined') {
  3070. this.$currentAnchor.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'dd-anchor'));
  3071. }
  3072. this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id'));
  3073. }
  3074. this.$element.attr({
  3075. 'aria-hidden': 'true',
  3076. 'data-yeti-box': $id,
  3077. 'data-resize': $id
  3078. });
  3079. _get(_getPrototypeOf(Dropdown.prototype), "_init", this).call(this);
  3080. this._events();
  3081. }
  3082. }, {
  3083. key: "_getDefaultPosition",
  3084. value: function _getDefaultPosition() {
  3085. // handle legacy classnames
  3086. var position = this.$element[0].className.match(/(top|left|right|bottom)/g);
  3087. if (position) {
  3088. return position[0];
  3089. } else {
  3090. return 'bottom';
  3091. }
  3092. }
  3093. }, {
  3094. key: "_getDefaultAlignment",
  3095. value: function _getDefaultAlignment() {
  3096. // handle legacy float approach
  3097. var horizontalPosition = /float-(\S+)/.exec(this.$currentAnchor.attr('class'));
  3098. if (horizontalPosition) {
  3099. return horizontalPosition[1];
  3100. }
  3101. return _get(_getPrototypeOf(Dropdown.prototype), "_getDefaultAlignment", this).call(this);
  3102. }
  3103. /**
  3104. * Sets the position and orientation of the dropdown pane, checks for collisions if allow-overlap is not true.
  3105. * Recursively calls itself if a collision is detected, with a new position class.
  3106. * @function
  3107. * @private
  3108. */
  3109. }, {
  3110. key: "_setPosition",
  3111. value: function _setPosition() {
  3112. this.$element.removeClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment));
  3113. _get(_getPrototypeOf(Dropdown.prototype), "_setPosition", this).call(this, this.$currentAnchor, this.$element, this.$parent);
  3114. this.$element.addClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment));
  3115. }
  3116. /**
  3117. * Make it a current anchor.
  3118. * Current anchor as the reference for the position of Dropdown panes.
  3119. * @param {HTML} el - DOM element of the anchor.
  3120. * @function
  3121. * @private
  3122. */
  3123. }, {
  3124. key: "_setCurrentAnchor",
  3125. value: function _setCurrentAnchor(el) {
  3126. this.$currentAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el);
  3127. }
  3128. /**
  3129. * Adds event listeners to the element utilizing the triggers utility library.
  3130. * @function
  3131. * @private
  3132. */
  3133. }, {
  3134. key: "_events",
  3135. value: function _events() {
  3136. var _this = this,
  3137. hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined';
  3138. this.$element.on({
  3139. 'open.zf.trigger': this.open.bind(this),
  3140. 'close.zf.trigger': this.close.bind(this),
  3141. 'toggle.zf.trigger': this.toggle.bind(this),
  3142. 'resizeme.zf.trigger': this._setPosition.bind(this)
  3143. });
  3144. this.$anchors.off('click.zf.trigger').on('click.zf.trigger', function (e) {
  3145. _this._setCurrentAnchor(this);
  3146. if ( // if forceFollow false, always prevent default action
  3147. _this.options.forceFollow === false || // if forceFollow true and hover option true, only prevent default action on 1st click
  3148. // on 2nd click (dropown opened) the default action (e.g. follow a href) gets executed
  3149. hasTouch && _this.options.hover && _this.$element.hasClass('is-open') === false) {
  3150. e.preventDefault();
  3151. }
  3152. });
  3153. if (this.options.hover) {
  3154. this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () {
  3155. _this._setCurrentAnchor(this);
  3156. var bodyData = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').data();
  3157. if (typeof bodyData.whatinput === 'undefined' || bodyData.whatinput === 'mouse') {
  3158. clearTimeout(_this.timeout);
  3159. _this.timeout = setTimeout(function () {
  3160. _this.open();
  3161. _this.$anchors.data('hover', true);
  3162. }, _this.options.hoverDelay);
  3163. }
  3164. }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () {
  3165. clearTimeout(_this.timeout);
  3166. _this.timeout = setTimeout(function () {
  3167. _this.close();
  3168. _this.$anchors.data('hover', false);
  3169. }, _this.options.hoverDelay);
  3170. }));
  3171. if (this.options.hoverPane) {
  3172. this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () {
  3173. clearTimeout(_this.timeout);
  3174. }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () {
  3175. clearTimeout(_this.timeout);
  3176. _this.timeout = setTimeout(function () {
  3177. _this.close();
  3178. _this.$anchors.data('hover', false);
  3179. }, _this.options.hoverDelay);
  3180. }));
  3181. }
  3182. }
  3183. this.$anchors.add(this.$element).on('keydown.zf.dropdown', function (e) {
  3184. var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  3185. visibleFocusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(_this.$element);
  3186. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Dropdown', {
  3187. open: function open() {
  3188. if ($target.is(_this.$anchors) && !$target.is('input, textarea')) {
  3189. _this.open();
  3190. _this.$element.attr('tabindex', -1).focus();
  3191. e.preventDefault();
  3192. }
  3193. },
  3194. close: function close() {
  3195. _this.close();
  3196. _this.$anchors.focus();
  3197. }
  3198. });
  3199. });
  3200. }
  3201. /**
  3202. * Adds an event handler to the body to close any dropdowns on a click.
  3203. * @function
  3204. * @private
  3205. */
  3206. }, {
  3207. key: "_addBodyHandler",
  3208. value: function _addBodyHandler() {
  3209. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).not(this.$element),
  3210. _this = this;
  3211. $body.off('click.zf.dropdown tap.zf.dropdown').on('click.zf.dropdown tap.zf.dropdown', function (e) {
  3212. if (_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) {
  3213. return;
  3214. }
  3215. if (_this.$element.is(e.target) || _this.$element.find(e.target).length) {
  3216. return;
  3217. }
  3218. _this.close();
  3219. $body.off('click.zf.dropdown tap.zf.dropdown');
  3220. });
  3221. }
  3222. /**
  3223. * Opens the dropdown pane, and fires a bubbling event to close other dropdowns.
  3224. * @function
  3225. * @fires Dropdown#closeme
  3226. * @fires Dropdown#show
  3227. */
  3228. }, {
  3229. key: "open",
  3230. value: function open() {
  3231. // var _this = this;
  3232. /**
  3233. * Fires to close other open dropdowns, typically when dropdown is opening
  3234. * @event Dropdown#closeme
  3235. */
  3236. this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id'));
  3237. this.$anchors.addClass('hover').attr({
  3238. 'aria-expanded': true
  3239. }); // this.$element/*.show()*/;
  3240. this.$element.addClass('is-opening');
  3241. this._setPosition();
  3242. this.$element.removeClass('is-opening').addClass('is-open').attr({
  3243. 'aria-hidden': false
  3244. });
  3245. if (this.options.autoFocus) {
  3246. var $focusable = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(this.$element);
  3247. if ($focusable.length) {
  3248. $focusable.eq(0).focus();
  3249. }
  3250. }
  3251. if (this.options.closeOnClick) {
  3252. this._addBodyHandler();
  3253. }
  3254. if (this.options.trapFocus) {
  3255. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].trapFocus(this.$element);
  3256. }
  3257. /**
  3258. * Fires once the dropdown is visible.
  3259. * @event Dropdown#show
  3260. */
  3261. this.$element.trigger('show.zf.dropdown', [this.$element]);
  3262. }
  3263. /**
  3264. * Closes the open dropdown pane.
  3265. * @function
  3266. * @fires Dropdown#hide
  3267. */
  3268. }, {
  3269. key: "close",
  3270. value: function close() {
  3271. if (!this.$element.hasClass('is-open')) {
  3272. return false;
  3273. }
  3274. this.$element.removeClass('is-open').attr({
  3275. 'aria-hidden': true
  3276. });
  3277. this.$anchors.removeClass('hover').attr('aria-expanded', false);
  3278. /**
  3279. * Fires once the dropdown is no longer visible.
  3280. * @event Dropdown#hide
  3281. */
  3282. this.$element.trigger('hide.zf.dropdown', [this.$element]);
  3283. if (this.options.trapFocus) {
  3284. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].releaseFocus(this.$element);
  3285. }
  3286. }
  3287. /**
  3288. * Toggles the dropdown pane's visibility.
  3289. * @function
  3290. */
  3291. }, {
  3292. key: "toggle",
  3293. value: function toggle() {
  3294. if (this.$element.hasClass('is-open')) {
  3295. if (this.$anchors.data('hover')) return;
  3296. this.close();
  3297. } else {
  3298. this.open();
  3299. }
  3300. }
  3301. /**
  3302. * Destroys the dropdown.
  3303. * @function
  3304. */
  3305. }, {
  3306. key: "_destroy",
  3307. value: function _destroy() {
  3308. this.$element.off('.zf.trigger').hide();
  3309. this.$anchors.off('.zf.dropdown');
  3310. jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdown tap.zf.dropdown');
  3311. }
  3312. }]);
  3313. return Dropdown;
  3314. }(_foundation_positionable__WEBPACK_IMPORTED_MODULE_3__["Positionable"]);
  3315. Dropdown.defaults = {
  3316. /**
  3317. * Class that designates bounding container of Dropdown (default: window)
  3318. * @option
  3319. * @type {?string}
  3320. * @default null
  3321. */
  3322. parentClass: null,
  3323. /**
  3324. * Amount of time to delay opening a submenu on hover event.
  3325. * @option
  3326. * @type {number}
  3327. * @default 250
  3328. */
  3329. hoverDelay: 250,
  3330. /**
  3331. * Allow submenus to open on hover events
  3332. * @option
  3333. * @type {boolean}
  3334. * @default false
  3335. */
  3336. hover: false,
  3337. /**
  3338. * Don't close dropdown when hovering over dropdown pane
  3339. * @option
  3340. * @type {boolean}
  3341. * @default false
  3342. */
  3343. hoverPane: false,
  3344. /**
  3345. * Number of pixels between the dropdown pane and the triggering element on open.
  3346. * @option
  3347. * @type {number}
  3348. * @default 0
  3349. */
  3350. vOffset: 0,
  3351. /**
  3352. * Number of pixels between the dropdown pane and the triggering element on open.
  3353. * @option
  3354. * @type {number}
  3355. * @default 0
  3356. */
  3357. hOffset: 0,
  3358. /**
  3359. * Position of dropdown. Can be left, right, bottom, top, or auto.
  3360. * @option
  3361. * @type {string}
  3362. * @default 'auto'
  3363. */
  3364. position: 'auto',
  3365. /**
  3366. * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto.
  3367. * @option
  3368. * @type {string}
  3369. * @default 'auto'
  3370. */
  3371. alignment: 'auto',
  3372. /**
  3373. * Allow overlap of container/window. If false, dropdown will first try to position as defined by data-position and data-alignment, but reposition if it would cause an overflow.
  3374. * @option
  3375. * @type {boolean}
  3376. * @default false
  3377. */
  3378. allowOverlap: false,
  3379. /**
  3380. * Allow overlap of only the bottom of the container. This is the most common
  3381. * behavior for dropdowns, allowing the dropdown to extend the bottom of the
  3382. * screen but not otherwise influence or break out of the container.
  3383. * @option
  3384. * @type {boolean}
  3385. * @default true
  3386. */
  3387. allowBottomOverlap: true,
  3388. /**
  3389. * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands.
  3390. * @option
  3391. * @type {boolean}
  3392. * @default false
  3393. */
  3394. trapFocus: false,
  3395. /**
  3396. * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening.
  3397. * @option
  3398. * @type {boolean}
  3399. * @default false
  3400. */
  3401. autoFocus: false,
  3402. /**
  3403. * Allows a click on the body to close the dropdown.
  3404. * @option
  3405. * @type {boolean}
  3406. * @default false
  3407. */
  3408. closeOnClick: false,
  3409. /**
  3410. * If true the default action of the toggle (e.g. follow a link with href) gets executed on click. If hover option is also true the default action gets prevented on first click for mobile / touch devices and executed on second click.
  3411. * @option
  3412. * @type {boolean}
  3413. * @default true
  3414. */
  3415. forceFollow: true
  3416. };
  3417. /***/ }),
  3418. /***/ "./js/foundation.dropdownMenu.js":
  3419. /*!***************************************!*\
  3420. !*** ./js/foundation.dropdownMenu.js ***!
  3421. \***************************************/
  3422. /*! exports provided: DropdownMenu */
  3423. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3424. "use strict";
  3425. __webpack_require__.r(__webpack_exports__);
  3426. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; });
  3427. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  3428. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  3429. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  3430. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  3431. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  3432. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js");
  3433. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js");
  3434. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  3435. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3436. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3437. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3438. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3439. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3440. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3441. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3442. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3443. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3444. /**
  3445. * DropdownMenu module.
  3446. * @module foundation.dropdownMenu
  3447. * @requires foundation.util.keyboard
  3448. * @requires foundation.util.box
  3449. * @requires foundation.util.nest
  3450. * @requires foundation.util.touch
  3451. */
  3452. var DropdownMenu =
  3453. /*#__PURE__*/
  3454. function (_Plugin) {
  3455. _inherits(DropdownMenu, _Plugin);
  3456. function DropdownMenu() {
  3457. _classCallCheck(this, DropdownMenu);
  3458. return _possibleConstructorReturn(this, _getPrototypeOf(DropdownMenu).apply(this, arguments));
  3459. }
  3460. _createClass(DropdownMenu, [{
  3461. key: "_setup",
  3462. /**
  3463. * Creates a new instance of DropdownMenu.
  3464. * @class
  3465. * @name DropdownMenu
  3466. * @fires DropdownMenu#init
  3467. * @param {jQuery} element - jQuery object to make into a dropdown menu.
  3468. * @param {Object} options - Overrides to the default plugin settings.
  3469. */
  3470. value: function _setup(element, options) {
  3471. this.$element = element;
  3472. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options);
  3473. this.className = 'DropdownMenu'; // ie9 back compat
  3474. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Touch init is idempotent, we just need to make sure it's initialied.
  3475. this._init();
  3476. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('DropdownMenu', {
  3477. 'ENTER': 'open',
  3478. 'SPACE': 'open',
  3479. 'ARROW_RIGHT': 'next',
  3480. 'ARROW_UP': 'up',
  3481. 'ARROW_DOWN': 'down',
  3482. 'ARROW_LEFT': 'previous',
  3483. 'ESCAPE': 'close'
  3484. });
  3485. }
  3486. /**
  3487. * Initializes the plugin, and calls _prepareMenu
  3488. * @private
  3489. * @function
  3490. */
  3491. }, {
  3492. key: "_init",
  3493. value: function _init() {
  3494. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Feather(this.$element, 'dropdown');
  3495. var subs = this.$element.find('li.is-dropdown-submenu-parent');
  3496. this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub');
  3497. this.$menuItems = this.$element.find('li[role="none"]');
  3498. this.$tabs = this.$element.children('li[role="none"]');
  3499. this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass);
  3500. if (this.options.alignment === 'auto') {
  3501. if (this.$element.hasClass(this.options.rightClass) || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() || this.$element.parents('.top-bar-right').is('*')) {
  3502. this.options.alignment = 'right';
  3503. subs.addClass('opens-left');
  3504. } else {
  3505. this.options.alignment = 'left';
  3506. subs.addClass('opens-right');
  3507. }
  3508. } else {
  3509. if (this.options.alignment === 'right') {
  3510. subs.addClass('opens-left');
  3511. } else {
  3512. subs.addClass('opens-right');
  3513. }
  3514. }
  3515. this.changed = false;
  3516. this._events();
  3517. }
  3518. }, {
  3519. key: "_isVertical",
  3520. value: function _isVertical() {
  3521. return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column';
  3522. }
  3523. }, {
  3524. key: "_isRtl",
  3525. value: function _isRtl() {
  3526. return this.$element.hasClass('align-right') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() && !this.$element.hasClass('align-left');
  3527. }
  3528. /**
  3529. * Adds event listeners to elements within the menu
  3530. * @private
  3531. * @function
  3532. */
  3533. }, {
  3534. key: "_events",
  3535. value: function _events() {
  3536. var _this = this,
  3537. hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined',
  3538. parClass = 'is-dropdown-submenu-parent'; // used for onClick and in the keyboard handlers
  3539. var handleClickFn = function handleClickFn(e) {
  3540. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', ".".concat(parClass)),
  3541. hasSub = $elem.hasClass(parClass),
  3542. hasClicked = $elem.attr('data-is-click') === 'true',
  3543. $sub = $elem.children('.is-dropdown-submenu');
  3544. if (hasSub) {
  3545. if (hasClicked) {
  3546. if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) {
  3547. return;
  3548. }
  3549. e.stopImmediatePropagation();
  3550. e.preventDefault();
  3551. _this._hide($elem);
  3552. } else {
  3553. e.stopImmediatePropagation();
  3554. e.preventDefault();
  3555. _this._show($sub);
  3556. $elem.add($elem.parentsUntil(_this.$element, ".".concat(parClass))).attr('data-is-click', true);
  3557. }
  3558. }
  3559. };
  3560. if (this.options.clickOpen || hasTouch) {
  3561. this.$menuItems.on('click.zf.dropdownMenu touchstart.zf.dropdownMenu', handleClickFn);
  3562. } // Handle Leaf element Clicks
  3563. if (_this.options.closeOnClickInside) {
  3564. this.$menuItems.on('click.zf.dropdownMenu', function (e) {
  3565. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  3566. hasSub = $elem.hasClass(parClass);
  3567. if (!hasSub) {
  3568. _this._hide();
  3569. }
  3570. });
  3571. }
  3572. if (!this.options.disableHover) {
  3573. this.$menuItems.on('mouseenter.zf.dropdownMenu', function (e) {
  3574. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  3575. hasSub = $elem.hasClass(parClass);
  3576. if (hasSub) {
  3577. clearTimeout($elem.data('_delay'));
  3578. $elem.data('_delay', setTimeout(function () {
  3579. _this._show($elem.children('.is-dropdown-submenu'));
  3580. }, _this.options.hoverDelay));
  3581. }
  3582. }).on('mouseleave.zf.dropdownMenu', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function (e) {
  3583. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  3584. hasSub = $elem.hasClass(parClass);
  3585. if (hasSub && _this.options.autoclose) {
  3586. if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) {
  3587. return false;
  3588. }
  3589. clearTimeout($elem.data('_delay'));
  3590. $elem.data('_delay', setTimeout(function () {
  3591. _this._hide($elem);
  3592. }, _this.options.closingTime));
  3593. }
  3594. }));
  3595. }
  3596. this.$menuItems.on('keydown.zf.dropdownMenu', function (e) {
  3597. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', '[role="none"]'),
  3598. isTab = _this.$tabs.index($element) > -1,
  3599. $elements = isTab ? _this.$tabs : $element.siblings('li').add($element),
  3600. $prevElement,
  3601. $nextElement;
  3602. $elements.each(function (i) {
  3603. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  3604. $prevElement = $elements.eq(i - 1);
  3605. $nextElement = $elements.eq(i + 1);
  3606. return;
  3607. }
  3608. });
  3609. var nextSibling = function nextSibling() {
  3610. $nextElement.children('a:first').focus();
  3611. e.preventDefault();
  3612. },
  3613. prevSibling = function prevSibling() {
  3614. $prevElement.children('a:first').focus();
  3615. e.preventDefault();
  3616. },
  3617. openSub = function openSub() {
  3618. var $sub = $element.children('ul.is-dropdown-submenu');
  3619. if ($sub.length) {
  3620. _this._show($sub);
  3621. $element.find('li > a:first').focus();
  3622. e.preventDefault();
  3623. } else {
  3624. return;
  3625. }
  3626. },
  3627. closeSub = function closeSub() {
  3628. //if ($element.is(':first-child')) {
  3629. var close = $element.parent('ul').parent('li');
  3630. close.children('a:first').focus();
  3631. _this._hide(close);
  3632. e.preventDefault(); //}
  3633. };
  3634. var functions = {
  3635. open: openSub,
  3636. close: function close() {
  3637. _this._hide(_this.$element);
  3638. _this.$menuItems.eq(0).children('a').focus(); // focus to first element
  3639. e.preventDefault();
  3640. }
  3641. };
  3642. if (isTab) {
  3643. if (_this._isVertical()) {
  3644. // vertical menu
  3645. if (_this._isRtl()) {
  3646. // right aligned
  3647. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3648. down: nextSibling,
  3649. up: prevSibling,
  3650. next: closeSub,
  3651. previous: openSub
  3652. });
  3653. } else {
  3654. // left aligned
  3655. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3656. down: nextSibling,
  3657. up: prevSibling,
  3658. next: openSub,
  3659. previous: closeSub
  3660. });
  3661. }
  3662. } else {
  3663. // horizontal menu
  3664. if (_this._isRtl()) {
  3665. // right aligned
  3666. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3667. next: prevSibling,
  3668. previous: nextSibling,
  3669. down: openSub,
  3670. up: closeSub
  3671. });
  3672. } else {
  3673. // left aligned
  3674. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3675. next: nextSibling,
  3676. previous: prevSibling,
  3677. down: openSub,
  3678. up: closeSub
  3679. });
  3680. }
  3681. }
  3682. } else {
  3683. // not tabs -> one sub
  3684. if (_this._isRtl()) {
  3685. // right aligned
  3686. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3687. next: closeSub,
  3688. previous: openSub,
  3689. down: nextSibling,
  3690. up: prevSibling
  3691. });
  3692. } else {
  3693. // left aligned
  3694. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3695. next: openSub,
  3696. previous: closeSub,
  3697. down: nextSibling,
  3698. up: prevSibling
  3699. });
  3700. }
  3701. }
  3702. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'DropdownMenu', functions);
  3703. });
  3704. }
  3705. /**
  3706. * Adds an event handler to the body to close any dropdowns on a click.
  3707. * @function
  3708. * @private
  3709. */
  3710. }, {
  3711. key: "_addBodyHandler",
  3712. value: function _addBodyHandler() {
  3713. var _this2 = this;
  3714. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body);
  3715. this._removeBodyHandler();
  3716. $body.on('click.zf.dropdownMenu tap.zf.dropdownMenu', function (e) {
  3717. var isItself = !!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).closest(_this2.$element).length;
  3718. if (isItself) return;
  3719. _this2._hide();
  3720. _this2._removeBodyHandler();
  3721. });
  3722. }
  3723. /**
  3724. * Remove the body event handler. See `_addBodyHandler`.
  3725. * @function
  3726. * @private
  3727. */
  3728. }, {
  3729. key: "_removeBodyHandler",
  3730. value: function _removeBodyHandler() {
  3731. jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdownMenu tap.zf.dropdownMenu');
  3732. }
  3733. /**
  3734. * Opens a dropdown pane, and checks for collisions first.
  3735. * @param {jQuery} $sub - ul element that is a submenu to show
  3736. * @function
  3737. * @private
  3738. * @fires DropdownMenu#show
  3739. */
  3740. }, {
  3741. key: "_show",
  3742. value: function _show($sub) {
  3743. var idx = this.$tabs.index(this.$tabs.filter(function (i, el) {
  3744. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).find($sub).length > 0;
  3745. }));
  3746. var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent');
  3747. this._hide($sibs, idx);
  3748. $sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active');
  3749. var clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true);
  3750. if (!clear) {
  3751. var oldClass = this.options.alignment === 'left' ? '-right' : '-left',
  3752. $parentLi = $sub.parent('.is-dropdown-submenu-parent');
  3753. $parentLi.removeClass("opens".concat(oldClass)).addClass("opens-".concat(this.options.alignment));
  3754. clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true);
  3755. if (!clear) {
  3756. $parentLi.removeClass("opens-".concat(this.options.alignment)).addClass('opens-inner');
  3757. }
  3758. this.changed = true;
  3759. }
  3760. $sub.css('visibility', '');
  3761. if (this.options.closeOnClick) {
  3762. this._addBodyHandler();
  3763. }
  3764. /**
  3765. * Fires when the new dropdown pane is visible.
  3766. * @event DropdownMenu#show
  3767. */
  3768. this.$element.trigger('show.zf.dropdownMenu', [$sub]);
  3769. }
  3770. /**
  3771. * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything.
  3772. * @function
  3773. * @param {jQuery} $elem - element with a submenu to hide
  3774. * @param {Number} idx - index of the $tabs collection to hide
  3775. * @fires DropdownMenu#hide
  3776. * @private
  3777. */
  3778. }, {
  3779. key: "_hide",
  3780. value: function _hide($elem, idx) {
  3781. var $toClose;
  3782. if ($elem && $elem.length) {
  3783. $toClose = $elem;
  3784. } else if (typeof idx !== 'undefined') {
  3785. $toClose = this.$tabs.not(function (i, el) {
  3786. return i === idx;
  3787. });
  3788. } else {
  3789. $toClose = this.$element;
  3790. }
  3791. var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0;
  3792. if (somethingToClose) {
  3793. var $activeItem = $toClose.find('li.is-active');
  3794. $activeItem.add($toClose).attr({
  3795. 'data-is-click': false
  3796. }).removeClass('is-active');
  3797. $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active');
  3798. if (this.changed || $toClose.find('opens-inner').length) {
  3799. var oldClass = this.options.alignment === 'left' ? 'right' : 'left';
  3800. $toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass("opens-inner opens-".concat(this.options.alignment)).addClass("opens-".concat(oldClass));
  3801. this.changed = false;
  3802. }
  3803. clearTimeout($activeItem.data('_delay'));
  3804. this._removeBodyHandler();
  3805. /**
  3806. * Fires when the open menus are closed.
  3807. * @event DropdownMenu#hide
  3808. */
  3809. this.$element.trigger('hide.zf.dropdownMenu', [$toClose]);
  3810. }
  3811. }
  3812. /**
  3813. * Destroys the plugin.
  3814. * @function
  3815. */
  3816. }, {
  3817. key: "_destroy",
  3818. value: function _destroy() {
  3819. this.$menuItems.off('.zf.dropdownMenu').removeAttr('data-is-click').removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner');
  3820. jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('.zf.dropdownMenu');
  3821. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Burn(this.$element, 'dropdown');
  3822. }
  3823. }]);
  3824. return DropdownMenu;
  3825. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  3826. /**
  3827. * Default settings for plugin
  3828. */
  3829. DropdownMenu.defaults = {
  3830. /**
  3831. * Disallows hover events from opening submenus
  3832. * @option
  3833. * @type {boolean}
  3834. * @default false
  3835. */
  3836. disableHover: false,
  3837. /**
  3838. * Allow a submenu to automatically close on a mouseleave event, if not clicked open.
  3839. * @option
  3840. * @type {boolean}
  3841. * @default true
  3842. */
  3843. autoclose: true,
  3844. /**
  3845. * Amount of time to delay opening a submenu on hover event.
  3846. * @option
  3847. * @type {number}
  3848. * @default 50
  3849. */
  3850. hoverDelay: 50,
  3851. /**
  3852. * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu.
  3853. * @option
  3854. * @type {boolean}
  3855. * @default false
  3856. */
  3857. clickOpen: false,
  3858. /**
  3859. * Amount of time to delay closing a submenu on a mouseleave event.
  3860. * @option
  3861. * @type {number}
  3862. * @default 500
  3863. */
  3864. closingTime: 500,
  3865. /**
  3866. * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`.
  3867. * @option
  3868. * @type {string}
  3869. * @default 'auto'
  3870. */
  3871. alignment: 'auto',
  3872. /**
  3873. * Allow clicks on the body to close any open submenus.
  3874. * @option
  3875. * @type {boolean}
  3876. * @default true
  3877. */
  3878. closeOnClick: true,
  3879. /**
  3880. * Allow clicks on leaf anchor links to close any open submenus.
  3881. * @option
  3882. * @type {boolean}
  3883. * @default true
  3884. */
  3885. closeOnClickInside: true,
  3886. /**
  3887. * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class.
  3888. * @option
  3889. * @type {string}
  3890. * @default 'vertical'
  3891. */
  3892. verticalClass: 'vertical',
  3893. /**
  3894. * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class.
  3895. * @option
  3896. * @type {string}
  3897. * @default 'align-right'
  3898. */
  3899. rightClass: 'align-right',
  3900. /**
  3901. * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile.
  3902. * @option
  3903. * @type {boolean}
  3904. * @default true
  3905. */
  3906. forceFollow: true
  3907. };
  3908. /***/ }),
  3909. /***/ "./js/foundation.equalizer.js":
  3910. /*!************************************!*\
  3911. !*** ./js/foundation.equalizer.js ***!
  3912. \************************************/
  3913. /*! exports provided: Equalizer */
  3914. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3915. "use strict";
  3916. __webpack_require__.r(__webpack_exports__);
  3917. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return Equalizer; });
  3918. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  3919. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  3920. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  3921. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  3922. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  3923. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  3924. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3925. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3926. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3927. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3928. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3929. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3930. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3931. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3932. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3933. /**
  3934. * Equalizer module.
  3935. * @module foundation.equalizer
  3936. * @requires foundation.util.mediaQuery
  3937. * @requires foundation.util.imageLoader if equalizer contains images
  3938. */
  3939. var Equalizer =
  3940. /*#__PURE__*/
  3941. function (_Plugin) {
  3942. _inherits(Equalizer, _Plugin);
  3943. function Equalizer() {
  3944. _classCallCheck(this, Equalizer);
  3945. return _possibleConstructorReturn(this, _getPrototypeOf(Equalizer).apply(this, arguments));
  3946. }
  3947. _createClass(Equalizer, [{
  3948. key: "_setup",
  3949. /**
  3950. * Creates a new instance of Equalizer.
  3951. * @class
  3952. * @name Equalizer
  3953. * @fires Equalizer#init
  3954. * @param {Object} element - jQuery object to add the trigger to.
  3955. * @param {Object} options - Overrides to the default plugin settings.
  3956. */
  3957. value: function _setup(element, options) {
  3958. this.$element = element;
  3959. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Equalizer.defaults, this.$element.data(), options);
  3960. this.className = 'Equalizer'; // ie9 back compat
  3961. this._init();
  3962. }
  3963. /**
  3964. * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load.
  3965. * @private
  3966. */
  3967. }, {
  3968. key: "_init",
  3969. value: function _init() {
  3970. var eqId = this.$element.attr('data-equalizer') || '';
  3971. var $watched = this.$element.find("[data-equalizer-watch=\"".concat(eqId, "\"]"));
  3972. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
  3973. this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');
  3974. this.$element.attr('data-resize', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq'));
  3975. this.$element.attr('data-mutate', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq'));
  3976. this.hasNested = this.$element.find('[data-equalizer]').length > 0;
  3977. this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0;
  3978. this.isOn = false;
  3979. this._bindHandler = {
  3980. onResizeMeBound: this._onResizeMe.bind(this),
  3981. onPostEqualizedBound: this._onPostEqualized.bind(this)
  3982. };
  3983. var imgs = this.$element.find('img');
  3984. var tooSmall;
  3985. if (this.options.equalizeOn) {
  3986. tooSmall = this._checkMQ();
  3987. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this));
  3988. } else {
  3989. this._events();
  3990. }
  3991. if (typeof tooSmall !== 'undefined' && tooSmall === false || typeof tooSmall === 'undefined') {
  3992. if (imgs.length) {
  3993. Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__["onImagesLoaded"])(imgs, this._reflow.bind(this));
  3994. } else {
  3995. this._reflow();
  3996. }
  3997. }
  3998. }
  3999. /**
  4000. * Removes event listeners if the breakpoint is too small.
  4001. * @private
  4002. */
  4003. }, {
  4004. key: "_pauseEvents",
  4005. value: function _pauseEvents() {
  4006. this.isOn = false;
  4007. this.$element.off({
  4008. '.zf.equalizer': this._bindHandler.onPostEqualizedBound,
  4009. 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound,
  4010. 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound
  4011. });
  4012. }
  4013. /**
  4014. * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound
  4015. * @private
  4016. */
  4017. }, {
  4018. key: "_onResizeMe",
  4019. value: function _onResizeMe(e) {
  4020. this._reflow();
  4021. }
  4022. /**
  4023. * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound
  4024. * @private
  4025. */
  4026. }, {
  4027. key: "_onPostEqualized",
  4028. value: function _onPostEqualized(e) {
  4029. if (e.target !== this.$element[0]) {
  4030. this._reflow();
  4031. }
  4032. }
  4033. /**
  4034. * Initializes events for Equalizer.
  4035. * @private
  4036. */
  4037. }, {
  4038. key: "_events",
  4039. value: function _events() {
  4040. var _this = this;
  4041. this._pauseEvents();
  4042. if (this.hasNested) {
  4043. this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);
  4044. } else {
  4045. this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);
  4046. this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);
  4047. }
  4048. this.isOn = true;
  4049. }
  4050. /**
  4051. * Checks the current breakpoint to the minimum required size.
  4052. * @private
  4053. */
  4054. }, {
  4055. key: "_checkMQ",
  4056. value: function _checkMQ() {
  4057. var tooSmall = !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].is(this.options.equalizeOn);
  4058. if (tooSmall) {
  4059. if (this.isOn) {
  4060. this._pauseEvents();
  4061. this.$watched.css('height', 'auto');
  4062. }
  4063. } else {
  4064. if (!this.isOn) {
  4065. this._events();
  4066. }
  4067. }
  4068. return tooSmall;
  4069. }
  4070. /**
  4071. * A noop version for the plugin
  4072. * @private
  4073. */
  4074. }, {
  4075. key: "_killswitch",
  4076. value: function _killswitch() {
  4077. return;
  4078. }
  4079. /**
  4080. * Calls necessary functions to update Equalizer upon DOM change
  4081. * @private
  4082. */
  4083. }, {
  4084. key: "_reflow",
  4085. value: function _reflow() {
  4086. if (!this.options.equalizeOnStack) {
  4087. if (this._isStacked()) {
  4088. this.$watched.css('height', 'auto');
  4089. return false;
  4090. }
  4091. }
  4092. if (this.options.equalizeByRow) {
  4093. this.getHeightsByRow(this.applyHeightByRow.bind(this));
  4094. } else {
  4095. this.getHeights(this.applyHeight.bind(this));
  4096. }
  4097. }
  4098. /**
  4099. * Manually determines if the first 2 elements are *NOT* stacked.
  4100. * @private
  4101. */
  4102. }, {
  4103. key: "_isStacked",
  4104. value: function _isStacked() {
  4105. if (!this.$watched[0] || !this.$watched[1]) {
  4106. return true;
  4107. }
  4108. return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top;
  4109. }
  4110. /**
  4111. * Finds the outer heights of children contained within an Equalizer parent and returns them in an array
  4112. * @param {Function} cb - A non-optional callback to return the heights array to.
  4113. * @returns {Array} heights - An array of heights of children within Equalizer container
  4114. */
  4115. }, {
  4116. key: "getHeights",
  4117. value: function getHeights(cb) {
  4118. var heights = [];
  4119. for (var i = 0, len = this.$watched.length; i < len; i++) {
  4120. this.$watched[i].style.height = 'auto';
  4121. heights.push(this.$watched[i].offsetHeight);
  4122. }
  4123. cb(heights);
  4124. }
  4125. /**
  4126. * Finds the outer heights of children contained within an Equalizer parent and returns them in an array
  4127. * @param {Function} cb - A non-optional callback to return the heights array to.
  4128. * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
  4129. */
  4130. }, {
  4131. key: "getHeightsByRow",
  4132. value: function getHeightsByRow(cb) {
  4133. var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0,
  4134. groups = [],
  4135. group = 0; //group by Row
  4136. groups[group] = [];
  4137. for (var i = 0, len = this.$watched.length; i < len; i++) {
  4138. this.$watched[i].style.height = 'auto'; //maybe could use this.$watched[i].offsetTop
  4139. var elOffsetTop = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$watched[i]).offset().top;
  4140. if (elOffsetTop != lastElTopOffset) {
  4141. group++;
  4142. groups[group] = [];
  4143. lastElTopOffset = elOffsetTop;
  4144. }
  4145. groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]);
  4146. }
  4147. for (var j = 0, ln = groups.length; j < ln; j++) {
  4148. var heights = jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[j]).map(function () {
  4149. return this[1];
  4150. }).get();
  4151. var max = Math.max.apply(null, heights);
  4152. groups[j].push(max);
  4153. }
  4154. cb(groups);
  4155. }
  4156. /**
  4157. * Changes the CSS height property of each child in an Equalizer parent to match the tallest
  4158. * @param {array} heights - An array of heights of children within Equalizer container
  4159. * @fires Equalizer#preequalized
  4160. * @fires Equalizer#postequalized
  4161. */
  4162. }, {
  4163. key: "applyHeight",
  4164. value: function applyHeight(heights) {
  4165. var max = Math.max.apply(null, heights);
  4166. /**
  4167. * Fires before the heights are applied
  4168. * @event Equalizer#preequalized
  4169. */
  4170. this.$element.trigger('preequalized.zf.equalizer');
  4171. this.$watched.css('height', max);
  4172. /**
  4173. * Fires when the heights have been applied
  4174. * @event Equalizer#postequalized
  4175. */
  4176. this.$element.trigger('postequalized.zf.equalizer');
  4177. }
  4178. /**
  4179. * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row
  4180. * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
  4181. * @fires Equalizer#preequalized
  4182. * @fires Equalizer#preequalizedrow
  4183. * @fires Equalizer#postequalizedrow
  4184. * @fires Equalizer#postequalized
  4185. */
  4186. }, {
  4187. key: "applyHeightByRow",
  4188. value: function applyHeightByRow(groups) {
  4189. /**
  4190. * Fires before the heights are applied
  4191. */
  4192. this.$element.trigger('preequalized.zf.equalizer');
  4193. for (var i = 0, len = groups.length; i < len; i++) {
  4194. var groupsILength = groups[i].length,
  4195. max = groups[i][groupsILength - 1];
  4196. if (groupsILength <= 2) {
  4197. jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][0][0]).css({
  4198. 'height': 'auto'
  4199. });
  4200. continue;
  4201. }
  4202. /**
  4203. * Fires before the heights per row are applied
  4204. * @event Equalizer#preequalizedrow
  4205. */
  4206. this.$element.trigger('preequalizedrow.zf.equalizer');
  4207. for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) {
  4208. jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][j][0]).css({
  4209. 'height': max
  4210. });
  4211. }
  4212. /**
  4213. * Fires when the heights per row have been applied
  4214. * @event Equalizer#postequalizedrow
  4215. */
  4216. this.$element.trigger('postequalizedrow.zf.equalizer');
  4217. }
  4218. /**
  4219. * Fires when the heights have been applied
  4220. */
  4221. this.$element.trigger('postequalized.zf.equalizer');
  4222. }
  4223. /**
  4224. * Destroys an instance of Equalizer.
  4225. * @function
  4226. */
  4227. }, {
  4228. key: "_destroy",
  4229. value: function _destroy() {
  4230. this._pauseEvents();
  4231. this.$watched.css('height', 'auto');
  4232. }
  4233. }]);
  4234. return Equalizer;
  4235. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  4236. /**
  4237. * Default settings for plugin
  4238. */
  4239. Equalizer.defaults = {
  4240. /**
  4241. * Enable height equalization when stacked on smaller screens.
  4242. * @option
  4243. * @type {boolean}
  4244. * @default false
  4245. */
  4246. equalizeOnStack: false,
  4247. /**
  4248. * Enable height equalization row by row.
  4249. * @option
  4250. * @type {boolean}
  4251. * @default false
  4252. */
  4253. equalizeByRow: false,
  4254. /**
  4255. * String representing the minimum breakpoint size the plugin should equalize heights on.
  4256. * @option
  4257. * @type {string}
  4258. * @default ''
  4259. */
  4260. equalizeOn: ''
  4261. };
  4262. /***/ }),
  4263. /***/ "./js/foundation.interchange.js":
  4264. /*!**************************************!*\
  4265. !*** ./js/foundation.interchange.js ***!
  4266. \**************************************/
  4267. /*! exports provided: Interchange */
  4268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4269. "use strict";
  4270. __webpack_require__.r(__webpack_exports__);
  4271. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return Interchange; });
  4272. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  4273. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  4274. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  4275. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  4276. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  4277. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  4278. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4279. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4280. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4281. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4282. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4283. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4284. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4285. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4286. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4287. /**
  4288. * Interchange module.
  4289. * @module foundation.interchange
  4290. * @requires foundation.util.mediaQuery
  4291. */
  4292. var Interchange =
  4293. /*#__PURE__*/
  4294. function (_Plugin) {
  4295. _inherits(Interchange, _Plugin);
  4296. function Interchange() {
  4297. _classCallCheck(this, Interchange);
  4298. return _possibleConstructorReturn(this, _getPrototypeOf(Interchange).apply(this, arguments));
  4299. }
  4300. _createClass(Interchange, [{
  4301. key: "_setup",
  4302. /**
  4303. * Creates a new instance of Interchange.
  4304. * @class
  4305. * @name Interchange
  4306. * @fires Interchange#init
  4307. * @param {Object} element - jQuery object to add the trigger to.
  4308. * @param {Object} options - Overrides to the default plugin settings.
  4309. */
  4310. value: function _setup(element, options) {
  4311. this.$element = element;
  4312. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Interchange.defaults, this.$element.data(), options);
  4313. this.rules = [];
  4314. this.currentPath = '';
  4315. this.className = 'Interchange'; // ie9 back compat
  4316. // Triggers init is idempotent, just need to make sure it is initialized
  4317. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  4318. this._init();
  4319. this._events();
  4320. }
  4321. /**
  4322. * Initializes the Interchange plugin and calls functions to get interchange functioning on load.
  4323. * @function
  4324. * @private
  4325. */
  4326. }, {
  4327. key: "_init",
  4328. value: function _init() {
  4329. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
  4330. var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'interchange');
  4331. this.$element.attr({
  4332. 'data-resize': id,
  4333. 'id': id
  4334. });
  4335. this._parseOptions();
  4336. this._addBreakpoints();
  4337. this._generateRules();
  4338. this._reflow();
  4339. }
  4340. /**
  4341. * Initializes events for Interchange.
  4342. * @function
  4343. * @private
  4344. */
  4345. }, {
  4346. key: "_events",
  4347. value: function _events() {
  4348. var _this = this;
  4349. this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () {
  4350. return _this._reflow();
  4351. });
  4352. }
  4353. /**
  4354. * Calls necessary functions to update Interchange upon DOM change
  4355. * @function
  4356. * @private
  4357. */
  4358. }, {
  4359. key: "_reflow",
  4360. value: function _reflow() {
  4361. var match; // Iterate through each rule, but only save the last match
  4362. for (var i in this.rules) {
  4363. if (this.rules.hasOwnProperty(i)) {
  4364. var rule = this.rules[i];
  4365. if (window.matchMedia(rule.query).matches) {
  4366. match = rule;
  4367. }
  4368. }
  4369. }
  4370. if (match) {
  4371. this.replace(match.path);
  4372. }
  4373. }
  4374. /**
  4375. * Check options valifity and set defaults for:
  4376. * - `data-interchange-type`: if set, enforce the type of replacement (auto, src, background or html)
  4377. * @function
  4378. * @private
  4379. */
  4380. }, {
  4381. key: "_parseOptions",
  4382. value: function _parseOptions() {
  4383. var types = ['auto', 'src', 'background', 'html'];
  4384. if (typeof this.options.type === 'undefined') this.options.type = 'auto';else if (types.indexOf(this.options.type) === -1) {
  4385. console.log("Warning: invalid value \"".concat(this.options.type, "\" for Interchange option \"type\""));
  4386. this.options.type = 'auto';
  4387. }
  4388. }
  4389. /**
  4390. * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.
  4391. * @function
  4392. * @private
  4393. */
  4394. }, {
  4395. key: "_addBreakpoints",
  4396. value: function _addBreakpoints() {
  4397. for (var i in _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries) {
  4398. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries.hasOwnProperty(i)) {
  4399. var query = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries[i];
  4400. Interchange.SPECIAL_QUERIES[query.name] = query.value;
  4401. }
  4402. }
  4403. }
  4404. /**
  4405. * Checks the Interchange element for the provided media query + content pairings
  4406. * @function
  4407. * @private
  4408. * @param {Object} element - jQuery object that is an Interchange instance
  4409. * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys
  4410. */
  4411. }, {
  4412. key: "_generateRules",
  4413. value: function _generateRules(element) {
  4414. var rulesList = [];
  4415. var rules;
  4416. if (this.options.rules) {
  4417. rules = this.options.rules;
  4418. } else {
  4419. rules = this.$element.data('interchange');
  4420. }
  4421. rules = typeof rules === 'string' ? rules.match(/\[.*?, .*?\]/g) : rules;
  4422. for (var i in rules) {
  4423. if (rules.hasOwnProperty(i)) {
  4424. var rule = rules[i].slice(1, -1).split(', ');
  4425. var path = rule.slice(0, -1).join('');
  4426. var query = rule[rule.length - 1];
  4427. if (Interchange.SPECIAL_QUERIES[query]) {
  4428. query = Interchange.SPECIAL_QUERIES[query];
  4429. }
  4430. rulesList.push({
  4431. path: path,
  4432. query: query
  4433. });
  4434. }
  4435. }
  4436. this.rules = rulesList;
  4437. }
  4438. /**
  4439. * Update the `src` property of an image, or change the HTML of a container, to the specified path.
  4440. * @function
  4441. * @param {String} path - Path to the image or HTML partial.
  4442. * @fires Interchange#replaced
  4443. */
  4444. }, {
  4445. key: "replace",
  4446. value: function replace(path) {
  4447. var _this2 = this;
  4448. if (this.currentPath === path) return;
  4449. var trigger = 'replaced.zf.interchange';
  4450. var type = this.options.type;
  4451. if (type === 'auto') {
  4452. if (this.$element[0].nodeName === 'IMG') type = 'src';else if (path.match(/\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i)) type = 'background';else type = 'html';
  4453. } // Replacing images
  4454. if (type === 'src') {
  4455. this.$element.attr('src', path).on('load', function () {
  4456. _this2.currentPath = path;
  4457. }).trigger(trigger);
  4458. } // Replacing background images
  4459. else if (type === 'background') {
  4460. path = path.replace(/\(/g, '%28').replace(/\)/g, '%29');
  4461. this.$element.css({
  4462. 'background-image': 'url(' + path + ')'
  4463. }).trigger(trigger);
  4464. } // Replacing HTML
  4465. else if (type === 'html') {
  4466. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.get(path, function (response) {
  4467. _this2.$element.html(response).trigger(trigger);
  4468. jquery__WEBPACK_IMPORTED_MODULE_0___default()(response).foundation();
  4469. _this2.currentPath = path;
  4470. });
  4471. }
  4472. /**
  4473. * Fires when content in an Interchange element is done being loaded.
  4474. * @event Interchange#replaced
  4475. */
  4476. // this.$element.trigger('replaced.zf.interchange');
  4477. }
  4478. /**
  4479. * Destroys an instance of interchange.
  4480. * @function
  4481. */
  4482. }, {
  4483. key: "_destroy",
  4484. value: function _destroy() {
  4485. this.$element.off('resizeme.zf.trigger');
  4486. }
  4487. }]);
  4488. return Interchange;
  4489. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
  4490. /**
  4491. * Default settings for plugin
  4492. */
  4493. Interchange.defaults = {
  4494. /**
  4495. * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.
  4496. * @option
  4497. * @type {?array}
  4498. * @default null
  4499. */
  4500. rules: null,
  4501. /**
  4502. * Type of the responsive ressource to replace. It can take the following options:
  4503. * - `auto` (default): choose the type according to the element tag or the ressource extension,
  4504. * - `src`: replace the `[src]` attribute, recommended for images `<img>`.
  4505. * - `background`: replace the `background-image` CSS property.
  4506. * - `html`: replace the element content.
  4507. * @option
  4508. * @type {string}
  4509. * @default 'auto'
  4510. */
  4511. type: 'auto'
  4512. };
  4513. Interchange.SPECIAL_QUERIES = {
  4514. 'landscape': 'screen and (orientation: landscape)',
  4515. 'portrait': 'screen and (orientation: portrait)',
  4516. 'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)'
  4517. };
  4518. /***/ }),
  4519. /***/ "./js/foundation.magellan.js":
  4520. /*!***********************************!*\
  4521. !*** ./js/foundation.magellan.js ***!
  4522. \***********************************/
  4523. /*! exports provided: Magellan */
  4524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4525. "use strict";
  4526. __webpack_require__.r(__webpack_exports__);
  4527. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return Magellan; });
  4528. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  4529. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  4530. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  4531. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  4532. /* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.smoothScroll */ "./js/foundation.smoothScroll.js");
  4533. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  4534. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4535. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4536. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4537. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4538. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4539. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4540. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4541. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4542. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4543. /**
  4544. * Magellan module.
  4545. * @module foundation.magellan
  4546. * @requires foundation.smoothScroll
  4547. * @requires foundation.util.triggers
  4548. */
  4549. var Magellan =
  4550. /*#__PURE__*/
  4551. function (_Plugin) {
  4552. _inherits(Magellan, _Plugin);
  4553. function Magellan() {
  4554. _classCallCheck(this, Magellan);
  4555. return _possibleConstructorReturn(this, _getPrototypeOf(Magellan).apply(this, arguments));
  4556. }
  4557. _createClass(Magellan, [{
  4558. key: "_setup",
  4559. /**
  4560. * Creates a new instance of Magellan.
  4561. * @class
  4562. * @name Magellan
  4563. * @fires Magellan#init
  4564. * @param {Object} element - jQuery object to add the trigger to.
  4565. * @param {Object} options - Overrides to the default plugin settings.
  4566. */
  4567. value: function _setup(element, options) {
  4568. this.$element = element;
  4569. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Magellan.defaults, this.$element.data(), options);
  4570. this.className = 'Magellan'; // ie9 back compat
  4571. // Triggers init is idempotent, just need to make sure it is initialized
  4572. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  4573. this._init();
  4574. this.calcPoints();
  4575. }
  4576. /**
  4577. * Initializes the Magellan plugin and calls functions to get equalizer functioning on load.
  4578. * @private
  4579. */
  4580. }, {
  4581. key: "_init",
  4582. value: function _init() {
  4583. var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'magellan');
  4584. var _this = this;
  4585. this.$targets = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-magellan-target]');
  4586. this.$links = this.$element.find('a');
  4587. this.$element.attr({
  4588. 'data-resize': id,
  4589. 'data-scroll': id,
  4590. 'id': id
  4591. });
  4592. this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4593. this.scrollPos = parseInt(window.pageYOffset, 10);
  4594. this._events();
  4595. }
  4596. /**
  4597. * Calculates an array of pixel values that are the demarcation lines between locations on the page.
  4598. * Can be invoked if new elements are added or the size of a location changes.
  4599. * @function
  4600. */
  4601. }, {
  4602. key: "calcPoints",
  4603. value: function calcPoints() {
  4604. var _this = this,
  4605. body = document.body,
  4606. html = document.documentElement;
  4607. this.points = [];
  4608. this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));
  4609. this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));
  4610. this.$targets.each(function () {
  4611. var $tar = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  4612. pt = Math.round($tar.offset().top - _this.options.threshold);
  4613. $tar.targetPoint = pt;
  4614. _this.points.push(pt);
  4615. });
  4616. }
  4617. /**
  4618. * Initializes events for Magellan.
  4619. * @private
  4620. */
  4621. }, {
  4622. key: "_events",
  4623. value: function _events() {
  4624. var _this = this;
  4625. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', function () {
  4626. if (_this.options.deepLinking) {
  4627. if (location.hash) {
  4628. _this.scrollToLoc(location.hash);
  4629. }
  4630. }
  4631. _this.calcPoints();
  4632. _this._updateActive();
  4633. });
  4634. _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  4635. _this.$element.on({
  4636. 'resizeme.zf.trigger': _this.reflow.bind(_this),
  4637. 'scrollme.zf.trigger': _this._updateActive.bind(_this)
  4638. }).on('click.zf.magellan', 'a[href^="#"]', function (e) {
  4639. e.preventDefault();
  4640. var arrival = this.getAttribute('href');
  4641. _this.scrollToLoc(arrival);
  4642. });
  4643. });
  4644. this._deepLinkScroll = function (e) {
  4645. if (_this.options.deepLinking) {
  4646. _this.scrollToLoc(window.location.hash);
  4647. }
  4648. };
  4649. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._deepLinkScroll);
  4650. }
  4651. /**
  4652. * Function to scroll to a given location on the page.
  4653. * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo'
  4654. * @function
  4655. */
  4656. }, {
  4657. key: "scrollToLoc",
  4658. value: function scrollToLoc(loc) {
  4659. this._inTransition = true;
  4660. var _this = this;
  4661. var options = {
  4662. animationEasing: this.options.animationEasing,
  4663. animationDuration: this.options.animationDuration,
  4664. threshold: this.options.threshold,
  4665. offset: this.options.offset
  4666. };
  4667. _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__["SmoothScroll"].scrollToLoc(loc, options, function () {
  4668. _this._inTransition = false;
  4669. });
  4670. }
  4671. /**
  4672. * Calls necessary functions to update Magellan upon DOM change
  4673. * @function
  4674. */
  4675. }, {
  4676. key: "reflow",
  4677. value: function reflow() {
  4678. this.calcPoints();
  4679. this._updateActive();
  4680. }
  4681. /**
  4682. * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.
  4683. * @private
  4684. * @function
  4685. * @fires Magellan#update
  4686. */
  4687. }, {
  4688. key: "_updateActive",
  4689. value: function _updateActive()
  4690. /*evt, elem, scrollPos*/
  4691. {
  4692. var _this2 = this;
  4693. if (this._inTransition) return;
  4694. var newScrollPos = parseInt(window.pageYOffset, 10);
  4695. var isScrollingUp = this.scrollPos > newScrollPos;
  4696. this.scrollPos = newScrollPos;
  4697. var activeIdx; // Before the first point: no link
  4698. if (newScrollPos < this.points[0]) {}
  4699. /* do nothing */
  4700. // At the bottom of the page: last link
  4701. else if (newScrollPos + this.winHeight === this.docHeight) {
  4702. activeIdx = this.points.length - 1;
  4703. } // Otherwhise, use the last visible link
  4704. else {
  4705. var visibleLinks = this.points.filter(function (p, i) {
  4706. return p - _this2.options.offset - (isScrollingUp ? _this2.options.threshold : 0) <= newScrollPos;
  4707. });
  4708. activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0;
  4709. } // Get the new active link
  4710. var $oldActive = this.$active;
  4711. var activeHash = '';
  4712. if (typeof activeIdx !== 'undefined') {
  4713. this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]');
  4714. if (this.$active.length) activeHash = this.$active[0].getAttribute('href');
  4715. } else {
  4716. this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4717. }
  4718. var isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive);
  4719. var isNewHash = activeHash !== window.location.hash; // Update the active link element
  4720. if (isNewActive) {
  4721. $oldActive.removeClass(this.options.activeClass);
  4722. this.$active.addClass(this.options.activeClass);
  4723. } // Update the hash (it may have changed with the same active link)
  4724. if (this.options.deepLinking && isNewHash) {
  4725. if (window.history.pushState) {
  4726. // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384
  4727. var url = activeHash ? activeHash : window.location.pathname + window.location.search;
  4728. if (this.options.updateHistory) {
  4729. window.history.pushState({}, '', url);
  4730. } else {
  4731. window.history.replaceState({}, '', url);
  4732. }
  4733. } else {
  4734. window.location.hash = activeHash;
  4735. }
  4736. }
  4737. if (isNewActive) {
  4738. /**
  4739. * Fires when magellan is finished updating to the new active element.
  4740. * @event Magellan#update
  4741. */
  4742. this.$element.trigger('update.zf.magellan', [this.$active]);
  4743. }
  4744. }
  4745. /**
  4746. * Destroys an instance of Magellan and resets the url of the window.
  4747. * @function
  4748. */
  4749. }, {
  4750. key: "_destroy",
  4751. value: function _destroy() {
  4752. this.$element.off('.zf.trigger .zf.magellan').find(".".concat(this.options.activeClass)).removeClass(this.options.activeClass);
  4753. if (this.options.deepLinking) {
  4754. var hash = this.$active[0].getAttribute('href');
  4755. window.location.hash.replace(hash, '');
  4756. }
  4757. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._deepLinkScroll);
  4758. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  4759. }
  4760. }]);
  4761. return Magellan;
  4762. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  4763. /**
  4764. * Default settings for plugin
  4765. */
  4766. Magellan.defaults = {
  4767. /**
  4768. * Amount of time, in ms, the animated scrolling should take between locations.
  4769. * @option
  4770. * @type {number}
  4771. * @default 500
  4772. */
  4773. animationDuration: 500,
  4774. /**
  4775. * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
  4776. * @option
  4777. * @type {string}
  4778. * @default 'linear'
  4779. * @see {@link https://api.jquery.com/animate|Jquery animate}
  4780. */
  4781. animationEasing: 'linear',
  4782. /**
  4783. * Number of pixels to use as a marker for location changes.
  4784. * @option
  4785. * @type {number}
  4786. * @default 50
  4787. */
  4788. threshold: 50,
  4789. /**
  4790. * Class applied to the active locations link on the magellan container.
  4791. * @option
  4792. * @type {string}
  4793. * @default 'is-active'
  4794. */
  4795. activeClass: 'is-active',
  4796. /**
  4797. * Allows the script to manipulate the url of the current page, and if supported, alter the history.
  4798. * @option
  4799. * @type {boolean}
  4800. * @default false
  4801. */
  4802. deepLinking: false,
  4803. /**
  4804. * Update the browser history with the active link, if deep linking is enabled.
  4805. * @option
  4806. * @type {boolean}
  4807. * @default false
  4808. */
  4809. updateHistory: false,
  4810. /**
  4811. * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
  4812. * @option
  4813. * @type {number}
  4814. * @default 0
  4815. */
  4816. offset: 0
  4817. };
  4818. /***/ }),
  4819. /***/ "./js/foundation.offcanvas.js":
  4820. /*!************************************!*\
  4821. !*** ./js/foundation.offcanvas.js ***!
  4822. \************************************/
  4823. /*! exports provided: OffCanvas */
  4824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4825. "use strict";
  4826. __webpack_require__.r(__webpack_exports__);
  4827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return OffCanvas; });
  4828. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  4829. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  4830. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  4831. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  4832. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  4833. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  4834. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  4835. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4836. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4837. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4838. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4839. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4840. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4841. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4842. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4843. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4844. /**
  4845. * OffCanvas module.
  4846. * @module foundation.offCanvas
  4847. * @requires foundation.util.keyboard
  4848. * @requires foundation.util.mediaQuery
  4849. * @requires foundation.util.triggers
  4850. */
  4851. var OffCanvas =
  4852. /*#__PURE__*/
  4853. function (_Plugin) {
  4854. _inherits(OffCanvas, _Plugin);
  4855. function OffCanvas() {
  4856. _classCallCheck(this, OffCanvas);
  4857. return _possibleConstructorReturn(this, _getPrototypeOf(OffCanvas).apply(this, arguments));
  4858. }
  4859. _createClass(OffCanvas, [{
  4860. key: "_setup",
  4861. /**
  4862. * Creates a new instance of an off-canvas wrapper.
  4863. * @class
  4864. * @name OffCanvas
  4865. * @fires OffCanvas#init
  4866. * @param {Object} element - jQuery object to initialize.
  4867. * @param {Object} options - Overrides to the default plugin settings.
  4868. */
  4869. value: function _setup(element, options) {
  4870. var _this2 = this;
  4871. this.className = 'OffCanvas'; // ie9 back compat
  4872. this.$element = element;
  4873. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, OffCanvas.defaults, this.$element.data(), options);
  4874. this.contentClasses = {
  4875. base: [],
  4876. reveal: []
  4877. };
  4878. this.$lastTrigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4879. this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4880. this.position = 'left';
  4881. this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4882. this.nested = !!this.options.nested;
  4883. this.$sticky = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4884. this.isInCanvas = false; // Defines the CSS transition/position classes of the off-canvas content container.
  4885. jquery__WEBPACK_IMPORTED_MODULE_0___default()(['push', 'overlap']).each(function (index, val) {
  4886. _this2.contentClasses.base.push('has-transition-' + val);
  4887. });
  4888. jquery__WEBPACK_IMPORTED_MODULE_0___default()(['left', 'right', 'top', 'bottom']).each(function (index, val) {
  4889. _this2.contentClasses.base.push('has-position-' + val);
  4890. _this2.contentClasses.reveal.push('has-reveal-' + val);
  4891. }); // Triggers init is idempotent, just need to make sure it is initialized
  4892. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  4893. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"]._init();
  4894. this._init();
  4895. this._events();
  4896. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('OffCanvas', {
  4897. 'ESCAPE': 'close'
  4898. });
  4899. }
  4900. /**
  4901. * Initializes the off-canvas wrapper by adding the exit overlay (if needed).
  4902. * @function
  4903. * @private
  4904. */
  4905. }, {
  4906. key: "_init",
  4907. value: function _init() {
  4908. var id = this.$element.attr('id');
  4909. this.$element.attr('aria-hidden', 'true'); // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback)
  4910. if (this.options.contentId) {
  4911. this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + this.options.contentId);
  4912. } else if (this.$element.siblings('[data-off-canvas-content]').length) {
  4913. this.$content = this.$element.siblings('[data-off-canvas-content]').first();
  4914. } else {
  4915. this.$content = this.$element.closest('[data-off-canvas-content]').first();
  4916. }
  4917. if (!this.options.contentId) {
  4918. // Assume that the off-canvas element is nested if it isn't a sibling of the content
  4919. this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0;
  4920. } else if (this.options.contentId && this.options.nested === null) {
  4921. // Warning if using content ID without setting the nested option
  4922. // Once the element is nested it is required to work properly in this case
  4923. console.warn('Remember to use the nested option if using the content ID option!');
  4924. }
  4925. if (this.nested === true) {
  4926. // Force transition overlap if nested
  4927. this.options.transition = 'overlap'; // Remove appropriate classes if already assigned in markup
  4928. this.$element.removeClass('is-transition-push');
  4929. }
  4930. this.$element.addClass("is-transition-".concat(this.options.transition, " is-closed")); // Find triggers that affect this element and add aria-expanded to them
  4931. this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).find('[data-open="' + id + '"], [data-close="' + id + '"], [data-toggle="' + id + '"]').attr('aria-expanded', 'false').attr('aria-controls', id); // Get position by checking for related CSS class
  4932. this.position = this.$element.is('.position-left, .position-top, .position-right, .position-bottom') ? this.$element.attr('class').match(/position\-(left|top|right|bottom)/)[1] : this.position; // Add an overlay over the content if necessary
  4933. if (this.options.contentOverlay === true) {
  4934. var overlay = document.createElement('div');
  4935. var overlayPosition = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$element).css("position") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute';
  4936. overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition);
  4937. this.$overlay = jquery__WEBPACK_IMPORTED_MODULE_0___default()(overlay);
  4938. if (overlayPosition === 'is-overlay-fixed') {
  4939. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$overlay).insertAfter(this.$element);
  4940. } else {
  4941. this.$content.append(this.$overlay);
  4942. }
  4943. } // Get the revealOn option from the class.
  4944. var revealOnRegExp = new RegExp(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["RegExpEscape"])(this.options.revealClass) + '([^\\s]+)', 'g');
  4945. var revealOnClass = revealOnRegExp.exec(this.$element[0].className);
  4946. if (revealOnClass) {
  4947. this.options.isRevealed = true;
  4948. this.options.revealOn = this.options.revealOn || revealOnClass[1];
  4949. } // Ensure the `reveal-on-*` class is set.
  4950. if (this.options.isRevealed === true && this.options.revealOn) {
  4951. this.$element.first().addClass("".concat(this.options.revealClass).concat(this.options.revealOn));
  4952. this._setMQChecker();
  4953. }
  4954. if (this.options.transitionTime) {
  4955. this.$element.css('transition-duration', this.options.transitionTime);
  4956. } // Find fixed elements that should stay fixed while off-canvas is opened
  4957. this.$sticky = this.$content.find('[data-off-canvas-sticky]');
  4958. if (this.$sticky.length > 0 && this.options.transition === 'push') {
  4959. // If there's at least one match force contentScroll:false because the absolute top value doesn't get recalculated on scroll
  4960. // Limit to push transition since there's no transform scope for overlap
  4961. this.options.contentScroll = false;
  4962. }
  4963. var inCanvasFor = this.$element.attr('class').match(/\bin-canvas-for-(\w+)/);
  4964. if (inCanvasFor && inCanvasFor.length === 2) {
  4965. // Set `inCanvasOn` option if found in-canvas-for-[BREAKPONT] CSS class
  4966. this.options.inCanvasOn = inCanvasFor[1];
  4967. } else if (this.options.inCanvasOn) {
  4968. // Ensure the CSS class is set
  4969. this.$element.addClass("in-canvas-for-".concat(this.options.inCanvasOn));
  4970. }
  4971. if (this.options.inCanvasOn) {
  4972. this._checkInCanvas();
  4973. } // Initally remove all transition/position CSS classes from off-canvas content container.
  4974. this._removeContentClasses();
  4975. }
  4976. /**
  4977. * Adds event handlers to the off-canvas wrapper and the exit overlay.
  4978. * @function
  4979. * @private
  4980. */
  4981. }, {
  4982. key: "_events",
  4983. value: function _events() {
  4984. var _this3 = this;
  4985. this.$element.off('.zf.trigger .zf.offCanvas').on({
  4986. 'open.zf.trigger': this.open.bind(this),
  4987. 'close.zf.trigger': this.close.bind(this),
  4988. 'toggle.zf.trigger': this.toggle.bind(this),
  4989. 'keydown.zf.offCanvas': this._handleKeyboard.bind(this)
  4990. });
  4991. if (this.options.closeOnClick === true) {
  4992. var $target = this.options.contentOverlay ? this.$overlay : this.$content;
  4993. $target.on({
  4994. 'click.zf.offCanvas': this.close.bind(this)
  4995. });
  4996. }
  4997. if (this.options.inCanvasOn) {
  4998. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () {
  4999. _this3._checkInCanvas();
  5000. });
  5001. }
  5002. }
  5003. /**
  5004. * Applies event listener for elements that will reveal at certain breakpoints.
  5005. * @private
  5006. */
  5007. }, {
  5008. key: "_setMQChecker",
  5009. value: function _setMQChecker() {
  5010. var _this = this;
  5011. this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  5012. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(_this.options.revealOn)) {
  5013. _this.reveal(true);
  5014. }
  5015. });
  5016. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () {
  5017. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(_this.options.revealOn)) {
  5018. _this.reveal(true);
  5019. } else {
  5020. _this.reveal(false);
  5021. }
  5022. });
  5023. }
  5024. /**
  5025. * Checks if InCanvas on current breakpoint and adjust off-canvas accordingly
  5026. * @private
  5027. */
  5028. }, {
  5029. key: "_checkInCanvas",
  5030. value: function _checkInCanvas() {
  5031. this.isInCanvas = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(this.options.inCanvasOn);
  5032. if (this.isInCanvas === true) {
  5033. this.close();
  5034. }
  5035. }
  5036. /**
  5037. * Removes the CSS transition/position classes of the off-canvas content container.
  5038. * Removing the classes is important when another off-canvas gets opened that uses the same content container.
  5039. * @param {Boolean} hasReveal - true if related off-canvas element is revealed.
  5040. * @private
  5041. */
  5042. }, {
  5043. key: "_removeContentClasses",
  5044. value: function _removeContentClasses(hasReveal) {
  5045. if (typeof hasReveal !== 'boolean') {
  5046. this.$content.removeClass(this.contentClasses.base.join(' '));
  5047. } else if (hasReveal === false) {
  5048. this.$content.removeClass("has-reveal-".concat(this.position));
  5049. }
  5050. }
  5051. /**
  5052. * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element.
  5053. * Beforehand any transition/position class gets removed.
  5054. * @param {Boolean} hasReveal - true if related off-canvas element is revealed.
  5055. * @private
  5056. */
  5057. }, {
  5058. key: "_addContentClasses",
  5059. value: function _addContentClasses(hasReveal) {
  5060. this._removeContentClasses(hasReveal);
  5061. if (typeof hasReveal !== 'boolean') {
  5062. this.$content.addClass("has-transition-".concat(this.options.transition, " has-position-").concat(this.position));
  5063. } else if (hasReveal === true) {
  5064. this.$content.addClass("has-reveal-".concat(this.position));
  5065. }
  5066. }
  5067. /**
  5068. * Preserves the fixed behavior of sticky elements on opening an off-canvas with push transition.
  5069. * Since the off-canvas container has got a transform scope in such a case, it is done by calculating position absolute values.
  5070. * @private
  5071. */
  5072. }, {
  5073. key: "_fixStickyElements",
  5074. value: function _fixStickyElements() {
  5075. this.$sticky.each(function (_, el) {
  5076. var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el); // If sticky element is currently fixed, adjust its top value to match absolute position due to transform scope
  5077. // Limit to push transition because postion:fixed works without problems for overlap (no transform scope)
  5078. if ($el.css('position') === 'fixed') {
  5079. // Save current inline styling to restore it if undoing the absolute fixing
  5080. var topVal = parseInt($el.css('top'), 10);
  5081. $el.data('offCanvasSticky', {
  5082. top: topVal
  5083. });
  5084. var absoluteTopVal = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).scrollTop() + topVal;
  5085. $el.css({
  5086. top: "".concat(absoluteTopVal, "px"),
  5087. width: '100%',
  5088. transition: 'none'
  5089. });
  5090. }
  5091. });
  5092. }
  5093. /**
  5094. * Restores the original fixed styling of sticky elements after having closed an off-canvas that got pseudo fixed beforehand.
  5095. * This reverts the changes of _fixStickyElements()
  5096. * @private
  5097. */
  5098. }, {
  5099. key: "_unfixStickyElements",
  5100. value: function _unfixStickyElements() {
  5101. this.$sticky.each(function (_, el) {
  5102. var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el);
  5103. var stickyData = $el.data('offCanvasSticky'); // If sticky element has got data object with prior values (meaning it was originally fixed) restore these values once off-canvas is closed
  5104. if (_typeof(stickyData) === 'object') {
  5105. $el.css({
  5106. top: "".concat(stickyData.top, "px"),
  5107. width: '',
  5108. transition: ''
  5109. });
  5110. $el.data('offCanvasSticky', '');
  5111. }
  5112. });
  5113. }
  5114. /**
  5115. * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open.
  5116. * @param {Boolean} isRevealed - true if element should be revealed.
  5117. * @function
  5118. */
  5119. }, {
  5120. key: "reveal",
  5121. value: function reveal(isRevealed) {
  5122. if (isRevealed) {
  5123. this.close();
  5124. this.isRevealed = true;
  5125. this.$element.attr('aria-hidden', 'false');
  5126. this.$element.off('open.zf.trigger toggle.zf.trigger');
  5127. this.$element.removeClass('is-closed');
  5128. } else {
  5129. this.isRevealed = false;
  5130. this.$element.attr('aria-hidden', 'true');
  5131. this.$element.off('open.zf.trigger toggle.zf.trigger').on({
  5132. 'open.zf.trigger': this.open.bind(this),
  5133. 'toggle.zf.trigger': this.toggle.bind(this)
  5134. });
  5135. this.$element.addClass('is-closed');
  5136. }
  5137. this._addContentClasses(isRevealed);
  5138. }
  5139. /**
  5140. * Stops scrolling of the body when OffCanvas is open on mobile Safari and other troublesome browsers.
  5141. * @function
  5142. * @private
  5143. */
  5144. }, {
  5145. key: "_stopScrolling",
  5146. value: function _stopScrolling(event) {
  5147. return false;
  5148. }
  5149. /**
  5150. * Tag the element given as context whether it can be scrolled up and down.
  5151. * Used to allow or prevent it to scroll. See `_stopScrollPropagation`.
  5152. *
  5153. * Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios
  5154. * Only really works for y, not sure how to extend to x or if we need to.
  5155. *
  5156. * @function
  5157. * @private
  5158. */
  5159. }, {
  5160. key: "_recordScrollable",
  5161. value: function _recordScrollable(event) {
  5162. var elem = this; // called from event handler context with this as elem
  5163. // If the element is scrollable (content overflows), then...
  5164. if (elem.scrollHeight !== elem.clientHeight) {
  5165. // If we're at the top, scroll down one pixel to allow scrolling up
  5166. if (elem.scrollTop === 0) {
  5167. elem.scrollTop = 1;
  5168. } // If we're at the bottom, scroll up one pixel to allow scrolling down
  5169. if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) {
  5170. elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1;
  5171. }
  5172. }
  5173. elem.allowUp = elem.scrollTop > 0;
  5174. elem.allowDown = elem.scrollTop < elem.scrollHeight - elem.clientHeight;
  5175. elem.lastY = event.originalEvent.pageY;
  5176. }
  5177. /**
  5178. * Prevent the given event propagation if the element given as context can scroll.
  5179. * Used to preserve the element scrolling on mobile (`touchmove`) when the document
  5180. * scrolling is prevented. See https://git.io/zf-9707.
  5181. * @function
  5182. * @private
  5183. */
  5184. }, {
  5185. key: "_stopScrollPropagation",
  5186. value: function _stopScrollPropagation(event) {
  5187. var elem = this; // called from event handler context with this as elem
  5188. var parent; // off-canvas elem if called from inner scrollbox
  5189. var up = event.pageY < elem.lastY;
  5190. var down = !up;
  5191. elem.lastY = event.pageY;
  5192. if (up && elem.allowUp || down && elem.allowDown) {
  5193. // It is not recommended to stop event propagation (the user cannot watch it),
  5194. // but in this case this is the only solution we have.
  5195. event.stopPropagation(); // If elem is inner scrollbox we are scrolling the outer off-canvas down/up once the box end has been reached
  5196. // This lets the user continue to touch move the off-canvas without the need to place the finger outside the scrollbox
  5197. if (elem.hasAttribute('data-off-canvas-scrollbox')) {
  5198. parent = elem.closest('[data-off-canvas], [data-off-canvas-scrollbox-outer]');
  5199. if (elem.scrollTop <= 1 && parent.scrollTop > 0) {
  5200. parent.scrollTop--;
  5201. } else if (elem.scrollTop >= elem.scrollHeight - elem.clientHeight - 1 && parent.scrollTop < parent.scrollHeight - parent.clientHeight) {
  5202. parent.scrollTop++;
  5203. }
  5204. }
  5205. } else {
  5206. event.preventDefault();
  5207. }
  5208. }
  5209. /**
  5210. * Opens the off-canvas menu.
  5211. * @function
  5212. * @param {Object} event - Event object passed from listener.
  5213. * @param {jQuery} trigger - element that triggered the off-canvas to open.
  5214. * @fires OffCanvas#opened
  5215. * @todo also trigger 'open' event?
  5216. */
  5217. }, {
  5218. key: "open",
  5219. value: function open(event, trigger) {
  5220. var _this4 = this;
  5221. if (this.$element.hasClass('is-open') || this.isRevealed || this.isInCanvas) {
  5222. return;
  5223. }
  5224. var _this = this;
  5225. if (trigger) {
  5226. this.$lastTrigger = trigger;
  5227. }
  5228. if (this.options.forceTo === 'top') {
  5229. window.scrollTo(0, 0);
  5230. } else if (this.options.forceTo === 'bottom') {
  5231. window.scrollTo(0, document.body.scrollHeight);
  5232. }
  5233. if (this.options.transitionTime && this.options.transition !== 'overlap') {
  5234. this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime);
  5235. } else {
  5236. this.$element.siblings('[data-off-canvas-content]').css('transition-duration', '');
  5237. }
  5238. this.$element.addClass('is-open').removeClass('is-closed');
  5239. this.$triggers.attr('aria-expanded', 'true');
  5240. this.$element.attr('aria-hidden', 'false');
  5241. this.$content.addClass('is-open-' + this.position); // If `contentScroll` is set to false, add class and disable scrolling on touch devices.
  5242. if (this.options.contentScroll === false) {
  5243. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling);
  5244. this.$element.on('touchstart', this._recordScrollable);
  5245. this.$element.on('touchmove', this._stopScrollPropagation);
  5246. this.$element.on('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable);
  5247. this.$element.on('touchmove', '[data-off-canvas-scrollbox]', this._stopScrollPropagation);
  5248. }
  5249. if (this.options.contentOverlay === true) {
  5250. this.$overlay.addClass('is-visible');
  5251. }
  5252. if (this.options.closeOnClick === true && this.options.contentOverlay === true) {
  5253. this.$overlay.addClass('is-closable');
  5254. }
  5255. if (this.options.autoFocus === true) {
  5256. this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function () {
  5257. if (!_this.$element.hasClass('is-open')) {
  5258. return; // exit if prematurely closed
  5259. }
  5260. var canvasFocus = _this.$element.find('[data-autofocus]');
  5261. if (canvasFocus.length) {
  5262. canvasFocus.eq(0).focus();
  5263. } else {
  5264. _this.$element.find('a, button').eq(0).focus();
  5265. }
  5266. });
  5267. }
  5268. if (this.options.trapFocus === true) {
  5269. this.$content.attr('tabindex', '-1');
  5270. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(this.$element);
  5271. }
  5272. if (this.options.transition === 'push') {
  5273. this._fixStickyElements();
  5274. }
  5275. this._addContentClasses();
  5276. /**
  5277. * Fires when the off-canvas menu opens.
  5278. * @event OffCanvas#opened
  5279. */
  5280. this.$element.trigger('opened.zf.offCanvas');
  5281. /**
  5282. * Fires when the off-canvas menu open transition is done.
  5283. * @event OffCanvas#openedEnd
  5284. */
  5285. this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function () {
  5286. _this4.$element.trigger('openedEnd.zf.offCanvas');
  5287. });
  5288. }
  5289. /**
  5290. * Closes the off-canvas menu.
  5291. * @function
  5292. * @param {Function} cb - optional cb to fire after closure.
  5293. * @fires OffCanvas#close
  5294. * @fires OffCanvas#closed
  5295. */
  5296. }, {
  5297. key: "close",
  5298. value: function close(cb) {
  5299. var _this5 = this;
  5300. if (!this.$element.hasClass('is-open') || this.isRevealed) {
  5301. return;
  5302. }
  5303. /**
  5304. * Fires when the off-canvas menu closes.
  5305. * @event OffCanvas#close
  5306. */
  5307. this.$element.trigger('close.zf.offCanvas');
  5308. var _this = this;
  5309. this.$element.removeClass('is-open');
  5310. this.$element.attr('aria-hidden', 'true');
  5311. this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom');
  5312. if (this.options.contentOverlay === true) {
  5313. this.$overlay.removeClass('is-visible');
  5314. }
  5315. if (this.options.closeOnClick === true && this.options.contentOverlay === true) {
  5316. this.$overlay.removeClass('is-closable');
  5317. }
  5318. this.$triggers.attr('aria-expanded', 'false'); // Listen to transitionEnd: add class, re-enable scrolling and release focus when done.
  5319. this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function (e) {
  5320. _this5.$element.addClass('is-closed');
  5321. _this5._removeContentClasses();
  5322. if (_this5.options.transition === 'push') {
  5323. _this5._unfixStickyElements();
  5324. } // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices.
  5325. if (_this5.options.contentScroll === false) {
  5326. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').removeClass('is-off-canvas-open').off('touchmove', _this5._stopScrolling);
  5327. _this5.$element.off('touchstart', _this5._recordScrollable);
  5328. _this5.$element.off('touchmove', _this5._stopScrollPropagation);
  5329. _this5.$element.off('touchstart', '[data-off-canvas-scrollbox]', _this5._recordScrollable);
  5330. _this5.$element.off('touchmove', '[data-off-canvas-scrollbox]', _this5._stopScrollPropagation);
  5331. }
  5332. if (_this5.options.trapFocus === true) {
  5333. _this5.$content.removeAttr('tabindex');
  5334. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].releaseFocus(_this5.$element);
  5335. }
  5336. /**
  5337. * Fires when the off-canvas menu close transition is done.
  5338. * @event OffCanvas#closed
  5339. */
  5340. _this5.$element.trigger('closed.zf.offCanvas');
  5341. });
  5342. }
  5343. /**
  5344. * Toggles the off-canvas menu open or closed.
  5345. * @function
  5346. * @param {Object} event - Event object passed from listener.
  5347. * @param {jQuery} trigger - element that triggered the off-canvas to open.
  5348. */
  5349. }, {
  5350. key: "toggle",
  5351. value: function toggle(event, trigger) {
  5352. if (this.$element.hasClass('is-open')) {
  5353. this.close(event, trigger);
  5354. } else {
  5355. this.open(event, trigger);
  5356. }
  5357. }
  5358. /**
  5359. * Handles keyboard input when detected. When the escape key is pressed, the off-canvas menu closes, and focus is restored to the element that opened the menu.
  5360. * @function
  5361. * @private
  5362. */
  5363. }, {
  5364. key: "_handleKeyboard",
  5365. value: function _handleKeyboard(e) {
  5366. var _this6 = this;
  5367. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'OffCanvas', {
  5368. close: function close() {
  5369. _this6.close();
  5370. _this6.$lastTrigger.focus();
  5371. return true;
  5372. },
  5373. handled: function handled() {
  5374. e.preventDefault();
  5375. }
  5376. });
  5377. }
  5378. /**
  5379. * Destroys the OffCanvas plugin.
  5380. * @function
  5381. */
  5382. }, {
  5383. key: "_destroy",
  5384. value: function _destroy() {
  5385. this.close();
  5386. this.$element.off('.zf.trigger .zf.offCanvas');
  5387. this.$overlay.off('.zf.offCanvas');
  5388. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  5389. }
  5390. }]);
  5391. return OffCanvas;
  5392. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  5393. OffCanvas.defaults = {
  5394. /**
  5395. * Allow the user to click outside of the menu to close it.
  5396. * @option
  5397. * @type {boolean}
  5398. * @default true
  5399. */
  5400. closeOnClick: true,
  5401. /**
  5402. * Adds an overlay on top of `[data-off-canvas-content]`.
  5403. * @option
  5404. * @type {boolean}
  5405. * @default true
  5406. */
  5407. contentOverlay: true,
  5408. /**
  5409. * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken.
  5410. * @option
  5411. * @type {?string}
  5412. * @default null
  5413. */
  5414. contentId: null,
  5415. /**
  5416. * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element.
  5417. * @option
  5418. * @type {boolean}
  5419. * @default null
  5420. */
  5421. nested: null,
  5422. /**
  5423. * Enable/disable scrolling of the main content when an off canvas panel is open.
  5424. * @option
  5425. * @type {boolean}
  5426. * @default true
  5427. */
  5428. contentScroll: true,
  5429. /**
  5430. * Amount of time the open and close transition requires, including the appropriate milliseconds (`ms`) or seconds (`s`) unit (e.g. `500ms`, `.75s`) If none selected, pulls from body style.
  5431. * @option
  5432. * @type {string}
  5433. * @default null
  5434. */
  5435. transitionTime: null,
  5436. /**
  5437. * Type of transition for the OffCanvas menu. Options are 'push', 'detached' or 'slide'.
  5438. * @option
  5439. * @type {string}
  5440. * @default push
  5441. */
  5442. transition: 'push',
  5443. /**
  5444. * Force the page to scroll to top or bottom on open.
  5445. * @option
  5446. * @type {?string}
  5447. * @default null
  5448. */
  5449. forceTo: null,
  5450. /**
  5451. * Allow the OffCanvas to remain open for certain breakpoints.
  5452. * @option
  5453. * @type {boolean}
  5454. * @default false
  5455. */
  5456. isRevealed: false,
  5457. /**
  5458. * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option.
  5459. * @option
  5460. * @type {?string}
  5461. * @default null
  5462. */
  5463. revealOn: null,
  5464. /**
  5465. * Breakpoint at which the off-canvas gets moved into canvas content and acts as regular page element.
  5466. * @option
  5467. * @type {?string}
  5468. * @default null
  5469. */
  5470. inCanvasOn: null,
  5471. /**
  5472. * Force focus to the offcanvas on open. If true, will focus the opening trigger on close.
  5473. * @option
  5474. * @type {boolean}
  5475. * @default true
  5476. */
  5477. autoFocus: true,
  5478. /**
  5479. * Class used to force an OffCanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`.
  5480. * @option
  5481. * @type {string}
  5482. * @default reveal-for-
  5483. * @todo improve the regex testing for this.
  5484. */
  5485. revealClass: 'reveal-for-',
  5486. /**
  5487. * Triggers optional focus trapping when opening an OffCanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes.
  5488. * @option
  5489. * @type {boolean}
  5490. * @default false
  5491. */
  5492. trapFocus: false
  5493. };
  5494. /***/ }),
  5495. /***/ "./js/foundation.orbit.js":
  5496. /*!********************************!*\
  5497. !*** ./js/foundation.orbit.js ***!
  5498. \********************************/
  5499. /*! exports provided: Orbit */
  5500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5501. "use strict";
  5502. __webpack_require__.r(__webpack_exports__);
  5503. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return Orbit; });
  5504. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  5505. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  5506. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  5507. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  5508. /* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.timer */ "./js/foundation.util.timer.js");
  5509. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  5510. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  5511. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  5512. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  5513. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5514. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5515. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5516. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5517. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5518. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5519. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5520. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5521. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5522. /**
  5523. * Orbit module.
  5524. * @module foundation.orbit
  5525. * @requires foundation.util.keyboard
  5526. * @requires foundation.util.motion
  5527. * @requires foundation.util.timer
  5528. * @requires foundation.util.imageLoader
  5529. * @requires foundation.util.touch
  5530. */
  5531. var Orbit =
  5532. /*#__PURE__*/
  5533. function (_Plugin) {
  5534. _inherits(Orbit, _Plugin);
  5535. function Orbit() {
  5536. _classCallCheck(this, Orbit);
  5537. return _possibleConstructorReturn(this, _getPrototypeOf(Orbit).apply(this, arguments));
  5538. }
  5539. _createClass(Orbit, [{
  5540. key: "_setup",
  5541. /**
  5542. * Creates a new instance of an orbit carousel.
  5543. * @class
  5544. * @name Orbit
  5545. * @param {jQuery} element - jQuery object to make into an Orbit Carousel.
  5546. * @param {Object} options - Overrides to the default plugin settings.
  5547. */
  5548. value: function _setup(element, options) {
  5549. this.$element = element;
  5550. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Orbit.defaults, this.$element.data(), options);
  5551. this.className = 'Orbit'; // ie9 back compat
  5552. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Touch init is idempotent, we just need to make sure it's initialied.
  5553. this._init();
  5554. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Orbit', {
  5555. 'ltr': {
  5556. 'ARROW_RIGHT': 'next',
  5557. 'ARROW_LEFT': 'previous'
  5558. },
  5559. 'rtl': {
  5560. 'ARROW_LEFT': 'next',
  5561. 'ARROW_RIGHT': 'previous'
  5562. }
  5563. });
  5564. }
  5565. /**
  5566. * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation.
  5567. * @function
  5568. * @private
  5569. */
  5570. }, {
  5571. key: "_init",
  5572. value: function _init() {
  5573. // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide
  5574. this._reset();
  5575. this.$wrapper = this.$element.find(".".concat(this.options.containerClass));
  5576. this.$slides = this.$element.find(".".concat(this.options.slideClass));
  5577. var $images = this.$element.find('img'),
  5578. initActive = this.$slides.filter('.is-active'),
  5579. id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["GetYoDigits"])(6, 'orbit');
  5580. this.$element.attr({
  5581. 'data-resize': id,
  5582. 'id': id
  5583. });
  5584. if (!initActive.length) {
  5585. this.$slides.eq(0).addClass('is-active');
  5586. }
  5587. if (!this.options.useMUI) {
  5588. this.$slides.addClass('no-motionui');
  5589. }
  5590. if ($images.length) {
  5591. Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this));
  5592. } else {
  5593. this._prepareForOrbit(); //hehe
  5594. }
  5595. if (this.options.bullets) {
  5596. this._loadBullets();
  5597. }
  5598. this._events();
  5599. if (this.options.autoPlay && this.$slides.length > 1) {
  5600. this.geoSync();
  5601. }
  5602. if (this.options.accessible) {
  5603. // allow wrapper to be focusable to enable arrow navigation
  5604. this.$wrapper.attr('tabindex', 0);
  5605. }
  5606. }
  5607. /**
  5608. * Creates a jQuery collection of bullets, if they are being used.
  5609. * @function
  5610. * @private
  5611. */
  5612. }, {
  5613. key: "_loadBullets",
  5614. value: function _loadBullets() {
  5615. this.$bullets = this.$element.find(".".concat(this.options.boxOfBullets)).find('button');
  5616. }
  5617. /**
  5618. * Sets a `timer` object on the orbit, and starts the counter for the next slide.
  5619. * @function
  5620. */
  5621. }, {
  5622. key: "geoSync",
  5623. value: function geoSync() {
  5624. var _this = this;
  5625. this.timer = new _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__["Timer"](this.$element, {
  5626. duration: this.options.timerDelay,
  5627. infinite: false
  5628. }, function () {
  5629. _this.changeSlide(true);
  5630. });
  5631. this.timer.start();
  5632. }
  5633. /**
  5634. * Sets wrapper and slide heights for the orbit.
  5635. * @function
  5636. * @private
  5637. */
  5638. }, {
  5639. key: "_prepareForOrbit",
  5640. value: function _prepareForOrbit() {
  5641. var _this = this;
  5642. this._setWrapperHeight();
  5643. }
  5644. /**
  5645. * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height.
  5646. * @function
  5647. * @private
  5648. * @param {Function} cb - a callback function to fire when complete.
  5649. */
  5650. }, {
  5651. key: "_setWrapperHeight",
  5652. value: function _setWrapperHeight(cb) {
  5653. //rewrite this to `for` loop
  5654. var max = 0,
  5655. temp,
  5656. counter = 0,
  5657. _this = this;
  5658. this.$slides.each(function () {
  5659. temp = this.getBoundingClientRect().height;
  5660. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-slide', counter); // hide all slides but the active one
  5661. if (!/mui/g.test(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {
  5662. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css({
  5663. 'display': 'none'
  5664. });
  5665. }
  5666. max = temp > max ? temp : max;
  5667. counter++;
  5668. });
  5669. if (counter === this.$slides.length) {
  5670. this.$wrapper.css({
  5671. 'height': max
  5672. }); //only change the wrapper height property once.
  5673. if (cb) {
  5674. cb(max);
  5675. } //fire callback with max height dimension.
  5676. }
  5677. }
  5678. /**
  5679. * Sets the max-height of each slide.
  5680. * @function
  5681. * @private
  5682. */
  5683. }, {
  5684. key: "_setSlideHeight",
  5685. value: function _setSlideHeight(height) {
  5686. this.$slides.each(function () {
  5687. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css('max-height', height);
  5688. });
  5689. }
  5690. /**
  5691. * Adds event listeners to basically everything within the element.
  5692. * @function
  5693. * @private
  5694. */
  5695. }, {
  5696. key: "_events",
  5697. value: function _events() {
  5698. var _this = this; //***************************************
  5699. //**Now using custom event - thanks to:**
  5700. //** Yohai Ararat of Toronto **
  5701. //***************************************
  5702. //
  5703. this.$element.off('.resizeme.zf.trigger').on({
  5704. 'resizeme.zf.trigger': this._prepareForOrbit.bind(this)
  5705. });
  5706. if (this.$slides.length > 1) {
  5707. if (this.options.swipe) {
  5708. this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) {
  5709. e.preventDefault();
  5710. _this.changeSlide(true);
  5711. }).on('swiperight.zf.orbit', function (e) {
  5712. e.preventDefault();
  5713. _this.changeSlide(false);
  5714. });
  5715. } //***************************************
  5716. if (this.options.autoPlay) {
  5717. this.$slides.on('click.zf.orbit', function () {
  5718. _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);
  5719. _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();
  5720. });
  5721. if (this.options.pauseOnHover) {
  5722. this.$element.on('mouseenter.zf.orbit', function () {
  5723. _this.timer.pause();
  5724. }).on('mouseleave.zf.orbit', function () {
  5725. if (!_this.$element.data('clickedOn')) {
  5726. _this.timer.start();
  5727. }
  5728. });
  5729. }
  5730. }
  5731. if (this.options.navButtons) {
  5732. var $controls = this.$element.find(".".concat(this.options.nextClass, ", .").concat(this.options.prevClass));
  5733. $controls.attr('tabindex', 0) //also need to handle enter/return and spacebar key presses
  5734. .on('click.zf.orbit touchend.zf.orbit', function (e) {
  5735. e.preventDefault();
  5736. _this.changeSlide(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).hasClass(_this.options.nextClass));
  5737. });
  5738. }
  5739. if (this.options.bullets) {
  5740. this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () {
  5741. if (/is-active/g.test(this.className)) {
  5742. return false;
  5743. } //if this is active, kick out of function.
  5744. var idx = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('slide'),
  5745. ltr = idx > _this.$slides.filter('.is-active').data('slide'),
  5746. $slide = _this.$slides.eq(idx);
  5747. _this.changeSlide(ltr, $slide, idx);
  5748. });
  5749. }
  5750. if (this.options.accessible) {
  5751. this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) {
  5752. // handle keyboard event with keyboard util
  5753. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Orbit', {
  5754. next: function next() {
  5755. _this.changeSlide(true);
  5756. },
  5757. previous: function previous() {
  5758. _this.changeSlide(false);
  5759. },
  5760. handled: function handled() {
  5761. // if bullet is focused, make sure focus moves
  5762. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is(_this.$bullets)) {
  5763. _this.$bullets.filter('.is-active').focus();
  5764. }
  5765. }
  5766. });
  5767. });
  5768. }
  5769. }
  5770. }
  5771. /**
  5772. * Resets Orbit so it can be reinitialized
  5773. */
  5774. }, {
  5775. key: "_reset",
  5776. value: function _reset() {
  5777. // Don't do anything if there are no slides (first run)
  5778. if (typeof this.$slides == 'undefined') {
  5779. return;
  5780. }
  5781. if (this.$slides.length > 1) {
  5782. // Remove old events
  5783. this.$element.off('.zf.orbit').find('*').off('.zf.orbit'); // Restart timer if autoPlay is enabled
  5784. if (this.options.autoPlay) {
  5785. this.timer.restart();
  5786. } // Reset all sliddes
  5787. this.$slides.each(function (el) {
  5788. jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide();
  5789. }); // Show the first slide
  5790. this.$slides.first().addClass('is-active').show(); // Triggers when the slide has finished animating
  5791. this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]); // Select first bullet if bullets are present
  5792. if (this.options.bullets) {
  5793. this._updateBullets(0);
  5794. }
  5795. }
  5796. }
  5797. /**
  5798. * Changes the current slide to a new one.
  5799. * @function
  5800. * @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right.
  5801. * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected.
  5802. * @param {Number} idx - the index of the new slide in its collection, if one chosen.
  5803. * @fires Orbit#slidechange
  5804. */
  5805. }, {
  5806. key: "changeSlide",
  5807. value: function changeSlide(isLTR, chosenSlide, idx) {
  5808. if (!this.$slides) {
  5809. return;
  5810. } // Don't freak out if we're in the middle of cleanup
  5811. var $curSlide = this.$slides.filter('.is-active').eq(0);
  5812. if (/mui/g.test($curSlide[0].className)) {
  5813. return false;
  5814. } //if the slide is currently animating, kick out of the function
  5815. var $firstSlide = this.$slides.first(),
  5816. $lastSlide = this.$slides.last(),
  5817. dirIn = isLTR ? 'Right' : 'Left',
  5818. dirOut = isLTR ? 'Left' : 'Right',
  5819. _this = this,
  5820. $newSlide;
  5821. if (!chosenSlide) {
  5822. //most of the time, this will be auto played or clicked from the navButtons.
  5823. $newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!!
  5824. this.options.infiniteWrap ? $curSlide.next(".".concat(this.options.slideClass)).length ? $curSlide.next(".".concat(this.options.slideClass)) : $firstSlide : $curSlide.next(".".concat(this.options.slideClass)) : //pick next slide if moving left to right
  5825. this.options.infiniteWrap ? $curSlide.prev(".".concat(this.options.slideClass)).length ? $curSlide.prev(".".concat(this.options.slideClass)) : $lastSlide : $curSlide.prev(".".concat(this.options.slideClass)); //pick prev slide if moving right to left
  5826. } else {
  5827. $newSlide = chosenSlide;
  5828. }
  5829. if ($newSlide.length) {
  5830. /**
  5831. * Triggers before the next slide starts animating in and only if a next slide has been found.
  5832. * @event Orbit#beforeslidechange
  5833. */
  5834. this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);
  5835. if (this.options.bullets) {
  5836. idx = idx || this.$slides.index($newSlide); //grab index to update bullets
  5837. this._updateBullets(idx);
  5838. }
  5839. if (this.options.useMUI && !this.$element.is(':hidden')) {
  5840. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn($newSlide.addClass('is-active'), this.options["animInFrom".concat(dirIn)], function () {
  5841. $newSlide.css({
  5842. 'display': 'block'
  5843. }).attr('aria-live', 'polite');
  5844. });
  5845. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options["animOutTo".concat(dirOut)], function () {
  5846. $curSlide.removeAttr('aria-live');
  5847. if (_this.options.autoPlay && !_this.timer.isPaused) {
  5848. _this.timer.restart();
  5849. } //do stuff?
  5850. });
  5851. } else {
  5852. $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();
  5853. $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();
  5854. if (this.options.autoPlay && !this.timer.isPaused) {
  5855. this.timer.restart();
  5856. }
  5857. }
  5858. /**
  5859. * Triggers when the slide has finished animating in.
  5860. * @event Orbit#slidechange
  5861. */
  5862. this.$element.trigger('slidechange.zf.orbit', [$newSlide]);
  5863. }
  5864. }
  5865. /**
  5866. * Updates the active state of the bullets, if displayed.
  5867. * Move the descriptor of the current slide `[data-slide-active-label]` to the newly active bullet.
  5868. * If no `[data-slide-active-label]` is set, will move the exceeding `span` element.
  5869. *
  5870. * @function
  5871. * @private
  5872. * @param {Number} idx - the index of the current slide.
  5873. */
  5874. }, {
  5875. key: "_updateBullets",
  5876. value: function _updateBullets(idx) {
  5877. var $oldBullet = this.$bullets.filter('.is-active');
  5878. var $othersBullets = this.$bullets.not('.is-active');
  5879. var $newBullet = this.$bullets.eq(idx);
  5880. $oldBullet.removeClass('is-active').blur();
  5881. $newBullet.addClass('is-active'); // Find the descriptor for the current slide to move it to the new slide button
  5882. var activeStateDescriptor = $oldBullet.children('[data-slide-active-label]').last(); // If not explicitely given, search for the last "exceeding" span element (compared to others bullets).
  5883. if (!activeStateDescriptor.length) {
  5884. var spans = $oldBullet.children('span');
  5885. var spanCountInOthersBullets = $othersBullets.toArray().map(function (b) {
  5886. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).children('span').length;
  5887. }); // If there is an exceeding span element, use it as current slide descriptor
  5888. if (spanCountInOthersBullets.every(function (count) {
  5889. return count < spans.length;
  5890. })) {
  5891. activeStateDescriptor = spans.last();
  5892. activeStateDescriptor.attr('data-slide-active-label', '');
  5893. }
  5894. } // Move the current slide descriptor to the new slide button
  5895. if (activeStateDescriptor.length) {
  5896. activeStateDescriptor.detach();
  5897. $newBullet.append(activeStateDescriptor);
  5898. }
  5899. }
  5900. /**
  5901. * Destroys the carousel and hides the element.
  5902. * @function
  5903. */
  5904. }, {
  5905. key: "_destroy",
  5906. value: function _destroy() {
  5907. this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();
  5908. }
  5909. }]);
  5910. return Orbit;
  5911. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__["Plugin"]);
  5912. Orbit.defaults = {
  5913. /**
  5914. * Tells the JS to look for and loadBullets.
  5915. * @option
  5916. * @type {boolean}
  5917. * @default true
  5918. */
  5919. bullets: true,
  5920. /**
  5921. * Tells the JS to apply event listeners to nav buttons
  5922. * @option
  5923. * @type {boolean}
  5924. * @default true
  5925. */
  5926. navButtons: true,
  5927. /**
  5928. * motion-ui animation class to apply
  5929. * @option
  5930. * @type {string}
  5931. * @default 'slide-in-right'
  5932. */
  5933. animInFromRight: 'slide-in-right',
  5934. /**
  5935. * motion-ui animation class to apply
  5936. * @option
  5937. * @type {string}
  5938. * @default 'slide-out-right'
  5939. */
  5940. animOutToRight: 'slide-out-right',
  5941. /**
  5942. * motion-ui animation class to apply
  5943. * @option
  5944. * @type {string}
  5945. * @default 'slide-in-left'
  5946. *
  5947. */
  5948. animInFromLeft: 'slide-in-left',
  5949. /**
  5950. * motion-ui animation class to apply
  5951. * @option
  5952. * @type {string}
  5953. * @default 'slide-out-left'
  5954. */
  5955. animOutToLeft: 'slide-out-left',
  5956. /**
  5957. * Allows Orbit to automatically animate on page load.
  5958. * @option
  5959. * @type {boolean}
  5960. * @default true
  5961. */
  5962. autoPlay: true,
  5963. /**
  5964. * Amount of time, in ms, between slide transitions
  5965. * @option
  5966. * @type {number}
  5967. * @default 5000
  5968. */
  5969. timerDelay: 5000,
  5970. /**
  5971. * Allows Orbit to infinitely loop through the slides
  5972. * @option
  5973. * @type {boolean}
  5974. * @default true
  5975. */
  5976. infiniteWrap: true,
  5977. /**
  5978. * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library
  5979. * @option
  5980. * @type {boolean}
  5981. * @default true
  5982. */
  5983. swipe: true,
  5984. /**
  5985. * Allows the timing function to pause animation on hover.
  5986. * @option
  5987. * @type {boolean}
  5988. * @default true
  5989. */
  5990. pauseOnHover: true,
  5991. /**
  5992. * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys
  5993. * @option
  5994. * @type {boolean}
  5995. * @default true
  5996. */
  5997. accessible: true,
  5998. /**
  5999. * Class applied to the container of Orbit
  6000. * @option
  6001. * @type {string}
  6002. * @default 'orbit-container'
  6003. */
  6004. containerClass: 'orbit-container',
  6005. /**
  6006. * Class applied to individual slides.
  6007. * @option
  6008. * @type {string}
  6009. * @default 'orbit-slide'
  6010. */
  6011. slideClass: 'orbit-slide',
  6012. /**
  6013. * Class applied to the bullet container. You're welcome.
  6014. * @option
  6015. * @type {string}
  6016. * @default 'orbit-bullets'
  6017. */
  6018. boxOfBullets: 'orbit-bullets',
  6019. /**
  6020. * Class applied to the `next` navigation button.
  6021. * @option
  6022. * @type {string}
  6023. * @default 'orbit-next'
  6024. */
  6025. nextClass: 'orbit-next',
  6026. /**
  6027. * Class applied to the `previous` navigation button.
  6028. * @option
  6029. * @type {string}
  6030. * @default 'orbit-previous'
  6031. */
  6032. prevClass: 'orbit-previous',
  6033. /**
  6034. * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility.
  6035. * @option
  6036. * @type {boolean}
  6037. * @default true
  6038. */
  6039. useMUI: true
  6040. };
  6041. /***/ }),
  6042. /***/ "./js/foundation.positionable.js":
  6043. /*!***************************************!*\
  6044. !*** ./js/foundation.positionable.js ***!
  6045. \***************************************/
  6046. /*! exports provided: Positionable */
  6047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6048. "use strict";
  6049. __webpack_require__.r(__webpack_exports__);
  6050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Positionable", function() { return Positionable; });
  6051. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js");
  6052. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6053. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  6054. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6055. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6056. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6057. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6058. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6059. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6060. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6061. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6062. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6063. var POSITIONS = ['left', 'right', 'top', 'bottom'];
  6064. var VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center'];
  6065. var HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center'];
  6066. var ALIGNMENTS = {
  6067. 'left': VERTICAL_ALIGNMENTS,
  6068. 'right': VERTICAL_ALIGNMENTS,
  6069. 'top': HORIZONTAL_ALIGNMENTS,
  6070. 'bottom': HORIZONTAL_ALIGNMENTS
  6071. };
  6072. function nextItem(item, array) {
  6073. var currentIdx = array.indexOf(item);
  6074. if (currentIdx === array.length - 1) {
  6075. return array[0];
  6076. } else {
  6077. return array[currentIdx + 1];
  6078. }
  6079. }
  6080. var Positionable =
  6081. /*#__PURE__*/
  6082. function (_Plugin) {
  6083. _inherits(Positionable, _Plugin);
  6084. function Positionable() {
  6085. _classCallCheck(this, Positionable);
  6086. return _possibleConstructorReturn(this, _getPrototypeOf(Positionable).apply(this, arguments));
  6087. }
  6088. _createClass(Positionable, [{
  6089. key: "_init",
  6090. /**
  6091. * Abstract class encapsulating the tether-like explicit positioning logic
  6092. * including repositioning based on overlap.
  6093. * Expects classes to define defaults for vOffset, hOffset, position,
  6094. * alignment, allowOverlap, and allowBottomOverlap. They can do this by
  6095. * extending the defaults, or (for now recommended due to the way docs are
  6096. * generated) by explicitly declaring them.
  6097. *
  6098. **/
  6099. value: function _init() {
  6100. this.triedPositions = {};
  6101. this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position;
  6102. this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment;
  6103. this.originalPosition = this.position;
  6104. this.originalAlignment = this.alignment;
  6105. }
  6106. }, {
  6107. key: "_getDefaultPosition",
  6108. value: function _getDefaultPosition() {
  6109. return 'bottom';
  6110. }
  6111. }, {
  6112. key: "_getDefaultAlignment",
  6113. value: function _getDefaultAlignment() {
  6114. switch (this.position) {
  6115. case 'bottom':
  6116. case 'top':
  6117. return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() ? 'right' : 'left';
  6118. case 'left':
  6119. case 'right':
  6120. return 'bottom';
  6121. }
  6122. }
  6123. /**
  6124. * Adjusts the positionable possible positions by iterating through alignments
  6125. * and positions.
  6126. * @function
  6127. * @private
  6128. */
  6129. }, {
  6130. key: "_reposition",
  6131. value: function _reposition() {
  6132. if (this._alignmentsExhausted(this.position)) {
  6133. this.position = nextItem(this.position, POSITIONS);
  6134. this.alignment = ALIGNMENTS[this.position][0];
  6135. } else {
  6136. this._realign();
  6137. }
  6138. }
  6139. /**
  6140. * Adjusts the dropdown pane possible positions by iterating through alignments
  6141. * on the current position.
  6142. * @function
  6143. * @private
  6144. */
  6145. }, {
  6146. key: "_realign",
  6147. value: function _realign() {
  6148. this._addTriedPosition(this.position, this.alignment);
  6149. this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position]);
  6150. }
  6151. }, {
  6152. key: "_addTriedPosition",
  6153. value: function _addTriedPosition(position, alignment) {
  6154. this.triedPositions[position] = this.triedPositions[position] || [];
  6155. this.triedPositions[position].push(alignment);
  6156. }
  6157. }, {
  6158. key: "_positionsExhausted",
  6159. value: function _positionsExhausted() {
  6160. var isExhausted = true;
  6161. for (var i = 0; i < POSITIONS.length; i++) {
  6162. isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]);
  6163. }
  6164. return isExhausted;
  6165. }
  6166. }, {
  6167. key: "_alignmentsExhausted",
  6168. value: function _alignmentsExhausted(position) {
  6169. return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length;
  6170. } // When we're trying to center, we don't want to apply offset that's going to
  6171. // take us just off center, so wrap around to return 0 for the appropriate
  6172. // offset in those alignments. TODO: Figure out if we want to make this
  6173. // configurable behavior... it feels more intuitive, especially for tooltips, but
  6174. // it's possible someone might actually want to start from center and then nudge
  6175. // slightly off.
  6176. }, {
  6177. key: "_getVOffset",
  6178. value: function _getVOffset() {
  6179. return this.options.vOffset;
  6180. }
  6181. }, {
  6182. key: "_getHOffset",
  6183. value: function _getHOffset() {
  6184. return this.options.hOffset;
  6185. }
  6186. }, {
  6187. key: "_setPosition",
  6188. value: function _setPosition($anchor, $element, $parent) {
  6189. if ($anchor.attr('aria-expanded') === 'false') {
  6190. return false;
  6191. }
  6192. if (!this.options.allowOverlap) {
  6193. // restore original position & alignment before checking overlap
  6194. this.position = this.originalPosition;
  6195. this.alignment = this.originalAlignment;
  6196. }
  6197. $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
  6198. if (!this.options.allowOverlap) {
  6199. var minOverlap = 100000000; // default coordinates to how we start, in case we can't figure out better
  6200. var minCoordinates = {
  6201. position: this.position,
  6202. alignment: this.alignment
  6203. };
  6204. while (!this._positionsExhausted()) {
  6205. var overlap = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap);
  6206. if (overlap === 0) {
  6207. return;
  6208. }
  6209. if (overlap < minOverlap) {
  6210. minOverlap = overlap;
  6211. minCoordinates = {
  6212. position: this.position,
  6213. alignment: this.alignment
  6214. };
  6215. }
  6216. this._reposition();
  6217. $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
  6218. } // If we get through the entire loop, there was no non-overlapping
  6219. // position available. Pick the version with least overlap.
  6220. this.position = minCoordinates.position;
  6221. this.alignment = minCoordinates.alignment;
  6222. $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
  6223. }
  6224. }
  6225. }]);
  6226. return Positionable;
  6227. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  6228. Positionable.defaults = {
  6229. /**
  6230. * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto.
  6231. * @option
  6232. * @type {string}
  6233. * @default 'auto'
  6234. */
  6235. position: 'auto',
  6236. /**
  6237. * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto.
  6238. * @option
  6239. * @type {string}
  6240. * @default 'auto'
  6241. */
  6242. alignment: 'auto',
  6243. /**
  6244. * Allow overlap of container/window. If false, dropdown positionable first
  6245. * try to position as defined by data-position and data-alignment, but
  6246. * reposition if it would cause an overflow.
  6247. * @option
  6248. * @type {boolean}
  6249. * @default false
  6250. */
  6251. allowOverlap: false,
  6252. /**
  6253. * Allow overlap of only the bottom of the container. This is the most common
  6254. * behavior for dropdowns, allowing the dropdown to extend the bottom of the
  6255. * screen but not otherwise influence or break out of the container.
  6256. * @option
  6257. * @type {boolean}
  6258. * @default true
  6259. */
  6260. allowBottomOverlap: true,
  6261. /**
  6262. * Number of pixels the positionable should be separated vertically from anchor
  6263. * @option
  6264. * @type {number}
  6265. * @default 0
  6266. */
  6267. vOffset: 0,
  6268. /**
  6269. * Number of pixels the positionable should be separated horizontally from anchor
  6270. * @option
  6271. * @type {number}
  6272. * @default 0
  6273. */
  6274. hOffset: 0
  6275. };
  6276. /***/ }),
  6277. /***/ "./js/foundation.responsiveAccordionTabs.js":
  6278. /*!**************************************************!*\
  6279. !*** ./js/foundation.responsiveAccordionTabs.js ***!
  6280. \**************************************************/
  6281. /*! exports provided: ResponsiveAccordionTabs */
  6282. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6283. "use strict";
  6284. __webpack_require__.r(__webpack_exports__);
  6285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return ResponsiveAccordionTabs; });
  6286. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  6287. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  6288. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  6289. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  6290. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6291. /* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.accordion */ "./js/foundation.accordion.js");
  6292. /* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.tabs */ "./js/foundation.tabs.js");
  6293. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6294. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6295. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6296. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6297. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6298. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6299. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6300. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6301. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6302. // The plugin matches the plugin classes with these plugin instances.
  6303. var MenuPlugins = {
  6304. tabs: {
  6305. cssClass: 'tabs',
  6306. plugin: _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__["Tabs"],
  6307. open: function open(plugin, target) {
  6308. return plugin.selectTab(target);
  6309. },
  6310. close: null
  6311. /* not supported */
  6312. ,
  6313. toggle: null
  6314. /* not supported */
  6315. },
  6316. accordion: {
  6317. cssClass: 'accordion',
  6318. plugin: _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__["Accordion"],
  6319. open: function open(plugin, target) {
  6320. return plugin.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target));
  6321. },
  6322. close: function close(plugin, target) {
  6323. return plugin.up(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target));
  6324. },
  6325. toggle: function toggle(plugin, target) {
  6326. return plugin.toggle(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target));
  6327. }
  6328. }
  6329. };
  6330. /**
  6331. * ResponsiveAccordionTabs module.
  6332. * @module foundation.responsiveAccordionTabs
  6333. * @requires foundation.util.motion
  6334. * @requires foundation.accordion
  6335. * @requires foundation.tabs
  6336. */
  6337. var ResponsiveAccordionTabs =
  6338. /*#__PURE__*/
  6339. function (_Plugin) {
  6340. _inherits(ResponsiveAccordionTabs, _Plugin);
  6341. function ResponsiveAccordionTabs(element, options) {
  6342. var _this2;
  6343. _classCallCheck(this, ResponsiveAccordionTabs);
  6344. _this2 = _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveAccordionTabs).call(this, element, options));
  6345. return _possibleConstructorReturn(_this2, _this2.options.reflow && _this2.storezfData || _assertThisInitialized(_this2));
  6346. }
  6347. /**
  6348. * Creates a new instance of a responsive accordion tabs.
  6349. * @class
  6350. * @name ResponsiveAccordionTabs
  6351. * @fires ResponsiveAccordionTabs#init
  6352. * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs.
  6353. * @param {Object} options - Overrides to the default plugin settings.
  6354. */
  6355. _createClass(ResponsiveAccordionTabs, [{
  6356. key: "_setup",
  6357. value: function _setup(element, options) {
  6358. this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
  6359. this.$element.data('zfPluginBase', this);
  6360. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveAccordionTabs.defaults, this.$element.data(), options);
  6361. this.rules = this.$element.data('responsive-accordion-tabs');
  6362. this.currentMq = null;
  6363. this.currentRule = null;
  6364. this.currentPlugin = null;
  6365. this.className = 'ResponsiveAccordionTabs'; // ie9 back compat
  6366. if (!this.$element.attr('id')) {
  6367. this.$element.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsiveaccordiontabs'));
  6368. }
  6369. this._init();
  6370. this._events();
  6371. }
  6372. /**
  6373. * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element.
  6374. * @function
  6375. * @private
  6376. */
  6377. }, {
  6378. key: "_init",
  6379. value: function _init() {
  6380. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
  6381. if (typeof this.rules === 'string') {
  6382. var rulesTree = {}; // Parse rules from "classes" pulled from data attribute
  6383. var rules = this.rules.split(' '); // Iterate through every rule found
  6384. for (var i = 0; i < rules.length; i++) {
  6385. var rule = rules[i].split('-');
  6386. var ruleSize = rule.length > 1 ? rule[0] : 'small';
  6387. var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
  6388. if (MenuPlugins[rulePlugin] !== null) {
  6389. rulesTree[ruleSize] = MenuPlugins[rulePlugin];
  6390. }
  6391. }
  6392. this.rules = rulesTree;
  6393. }
  6394. this._getAllOptions();
  6395. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) {
  6396. this._checkMediaQueries();
  6397. }
  6398. }
  6399. }, {
  6400. key: "_getAllOptions",
  6401. value: function _getAllOptions() {
  6402. //get all defaults and options
  6403. var _this = this;
  6404. _this.allOptions = {};
  6405. for (var key in MenuPlugins) {
  6406. if (MenuPlugins.hasOwnProperty(key)) {
  6407. var obj = MenuPlugins[key];
  6408. try {
  6409. var dummyPlugin = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<ul></ul>');
  6410. var tmpPlugin = new obj.plugin(dummyPlugin, _this.options);
  6411. for (var keyKey in tmpPlugin.options) {
  6412. if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') {
  6413. var objObj = tmpPlugin.options[keyKey];
  6414. _this.allOptions[keyKey] = objObj;
  6415. }
  6416. }
  6417. tmpPlugin.destroy();
  6418. } catch (e) {}
  6419. }
  6420. }
  6421. }
  6422. /**
  6423. * Initializes events for the Menu.
  6424. * @function
  6425. * @private
  6426. */
  6427. }, {
  6428. key: "_events",
  6429. value: function _events() {
  6430. this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this);
  6431. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler);
  6432. }
  6433. /**
  6434. * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.
  6435. * @function
  6436. * @private
  6437. */
  6438. }, {
  6439. key: "_checkMediaQueries",
  6440. value: function _checkMediaQueries() {
  6441. var matchedMq,
  6442. _this = this; // Iterate through each rule and find the last matching rule
  6443. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) {
  6444. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) {
  6445. matchedMq = key;
  6446. }
  6447. }); // No match? No dice
  6448. if (!matchedMq) return; // Plugin already initialized? We good
  6449. if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes
  6450. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) {
  6451. _this.$element.removeClass(value.cssClass);
  6452. }); // Add the CSS class for the new plugin
  6453. this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin
  6454. if (this.currentPlugin) {
  6455. //don't know why but on nested elements data zfPlugin get's lost
  6456. if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData);
  6457. this.currentPlugin.destroy();
  6458. }
  6459. this._handleMarkup(this.rules[matchedMq].cssClass);
  6460. this.currentRule = this.rules[matchedMq];
  6461. this.currentPlugin = new this.currentRule.plugin(this.$element, this.options);
  6462. this.storezfData = this.currentPlugin.$element.data('zfPlugin');
  6463. }
  6464. }, {
  6465. key: "_handleMarkup",
  6466. value: function _handleMarkup(toSet) {
  6467. var _this = this,
  6468. fromString = 'accordion';
  6469. var $panels = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + this.$element.attr('id') + ']');
  6470. if ($panels.length) fromString = 'tabs';
  6471. if (fromString === toSet) {
  6472. return;
  6473. }
  6474. var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title';
  6475. var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel';
  6476. this.$element.removeAttr('role');
  6477. var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item');
  6478. var $liHeadsA = $liHeads.children('a').removeClass('accordion-title');
  6479. if (fromString === 'tabs') {
  6480. $panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby');
  6481. $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected');
  6482. } else {
  6483. $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content');
  6484. }
  6485. $panels.css({
  6486. display: '',
  6487. visibility: ''
  6488. });
  6489. $liHeads.css({
  6490. display: '',
  6491. visibility: ''
  6492. });
  6493. if (toSet === 'accordion') {
  6494. $panels.each(function (key, value) {
  6495. jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({
  6496. height: ''
  6497. });
  6498. jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach();
  6499. $liHeads.addClass('accordion-item').attr('data-accordion-item', '');
  6500. $liHeadsA.addClass('accordion-title');
  6501. });
  6502. } else if (toSet === 'tabs') {
  6503. var $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']');
  6504. var $placeholder = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs-placeholder-' + _this.$element.attr('id'));
  6505. if ($placeholder.length) {
  6506. $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id'));
  6507. $placeholder.remove();
  6508. } else {
  6509. $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id'));
  6510. }
  6511. $panels.each(function (key, value) {
  6512. var tempValue = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($tabsContent).addClass(tabsPanel);
  6513. var hash = $liHeadsA.get(key).hash.slice(1);
  6514. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion');
  6515. if (hash !== id) {
  6516. if (hash !== '') {
  6517. jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash);
  6518. } else {
  6519. hash = id;
  6520. jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash);
  6521. jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href', jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash);
  6522. }
  6523. }
  6524. var isActive = jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeads.get(key)).hasClass('is-active');
  6525. if (isActive) {
  6526. tempValue.addClass('is-active');
  6527. }
  6528. });
  6529. $liHeads.addClass(tabsTitle);
  6530. }
  6531. ;
  6532. }
  6533. /**
  6534. * Opens the plugin pane defined by `target`.
  6535. * @param {jQuery | String} target - jQuery object or string of the id of the pane to open.
  6536. * @see Accordion.down
  6537. * @see Tabs.selectTab
  6538. * @function
  6539. */
  6540. }, {
  6541. key: "open",
  6542. value: function open(_target) {
  6543. if (this.currentRule && typeof this.currentRule.open === 'function') {
  6544. var _this$currentRule;
  6545. return (_this$currentRule = this.currentRule).open.apply(_this$currentRule, [this.currentPlugin].concat(Array.prototype.slice.call(arguments)));
  6546. }
  6547. }
  6548. /**
  6549. * Closes the plugin pane defined by `target`. Not availaible for Tabs.
  6550. * @param {jQuery | String} target - jQuery object or string of the id of the pane to close.
  6551. * @see Accordion.up
  6552. * @function
  6553. */
  6554. }, {
  6555. key: "close",
  6556. value: function close(_target) {
  6557. if (this.currentRule && typeof this.currentRule.close === 'function') {
  6558. var _this$currentRule2;
  6559. return (_this$currentRule2 = this.currentRule).close.apply(_this$currentRule2, [this.currentPlugin].concat(Array.prototype.slice.call(arguments)));
  6560. }
  6561. }
  6562. /**
  6563. * Toggles the plugin pane defined by `target`. Not availaible for Tabs.
  6564. * @param {jQuery | String} target - jQuery object or string of the id of the pane to toggle.
  6565. * @see Accordion.toggle
  6566. * @function
  6567. */
  6568. }, {
  6569. key: "toggle",
  6570. value: function toggle(_target) {
  6571. if (this.currentRule && typeof this.currentRule.toggle === 'function') {
  6572. var _this$currentRule3;
  6573. return (_this$currentRule3 = this.currentRule).toggle.apply(_this$currentRule3, [this.currentPlugin].concat(Array.prototype.slice.call(arguments)));
  6574. }
  6575. }
  6576. /**
  6577. * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
  6578. * @function
  6579. */
  6580. }, {
  6581. key: "_destroy",
  6582. value: function _destroy() {
  6583. if (this.currentPlugin) this.currentPlugin.destroy();
  6584. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler);
  6585. }
  6586. }]);
  6587. return ResponsiveAccordionTabs;
  6588. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  6589. ResponsiveAccordionTabs.defaults = {};
  6590. /***/ }),
  6591. /***/ "./js/foundation.responsiveMenu.js":
  6592. /*!*****************************************!*\
  6593. !*** ./js/foundation.responsiveMenu.js ***!
  6594. \*****************************************/
  6595. /*! exports provided: ResponsiveMenu */
  6596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6597. "use strict";
  6598. __webpack_require__.r(__webpack_exports__);
  6599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return ResponsiveMenu; });
  6600. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  6601. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  6602. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  6603. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  6604. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6605. /* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js");
  6606. /* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.drilldown */ "./js/foundation.drilldown.js");
  6607. /* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.accordionMenu */ "./js/foundation.accordionMenu.js");
  6608. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6609. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6610. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6611. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6612. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6613. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6614. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6615. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6616. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6617. var MenuPlugins = {
  6618. dropdown: {
  6619. cssClass: 'dropdown',
  6620. plugin: _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__["DropdownMenu"]
  6621. },
  6622. drilldown: {
  6623. cssClass: 'drilldown',
  6624. plugin: _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__["Drilldown"]
  6625. },
  6626. accordion: {
  6627. cssClass: 'accordion-menu',
  6628. plugin: _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__["AccordionMenu"]
  6629. }
  6630. }; // import "foundation.util.triggers.js";
  6631. /**
  6632. * ResponsiveMenu module.
  6633. * @module foundation.responsiveMenu
  6634. * @requires foundation.util.triggers
  6635. * @requires foundation.util.mediaQuery
  6636. */
  6637. var ResponsiveMenu =
  6638. /*#__PURE__*/
  6639. function (_Plugin) {
  6640. _inherits(ResponsiveMenu, _Plugin);
  6641. function ResponsiveMenu() {
  6642. _classCallCheck(this, ResponsiveMenu);
  6643. return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveMenu).apply(this, arguments));
  6644. }
  6645. _createClass(ResponsiveMenu, [{
  6646. key: "_setup",
  6647. /**
  6648. * Creates a new instance of a responsive menu.
  6649. * @class
  6650. * @name ResponsiveMenu
  6651. * @fires ResponsiveMenu#init
  6652. * @param {jQuery} element - jQuery object to make into a dropdown menu.
  6653. * @param {Object} options - Overrides to the default plugin settings.
  6654. */
  6655. value: function _setup(element, options) {
  6656. this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
  6657. this.rules = this.$element.data('responsive-menu');
  6658. this.currentMq = null;
  6659. this.currentPlugin = null;
  6660. this.className = 'ResponsiveMenu'; // ie9 back compat
  6661. this._init();
  6662. this._events();
  6663. }
  6664. /**
  6665. * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element.
  6666. * @function
  6667. * @private
  6668. */
  6669. }, {
  6670. key: "_init",
  6671. value: function _init() {
  6672. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
  6673. if (typeof this.rules === 'string') {
  6674. var rulesTree = {}; // Parse rules from "classes" pulled from data attribute
  6675. var rules = this.rules.split(' '); // Iterate through every rule found
  6676. for (var i = 0; i < rules.length; i++) {
  6677. var rule = rules[i].split('-');
  6678. var ruleSize = rule.length > 1 ? rule[0] : 'small';
  6679. var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
  6680. if (MenuPlugins[rulePlugin] !== null) {
  6681. rulesTree[ruleSize] = MenuPlugins[rulePlugin];
  6682. }
  6683. }
  6684. this.rules = rulesTree;
  6685. }
  6686. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) {
  6687. this._checkMediaQueries();
  6688. } // Add data-mutate since children may need it.
  6689. this.$element.attr('data-mutate', this.$element.attr('data-mutate') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsive-menu'));
  6690. }
  6691. /**
  6692. * Initializes events for the Menu.
  6693. * @function
  6694. * @private
  6695. */
  6696. }, {
  6697. key: "_events",
  6698. value: function _events() {
  6699. var _this = this;
  6700. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () {
  6701. _this._checkMediaQueries();
  6702. }); // $(window).on('resize.zf.ResponsiveMenu', function() {
  6703. // _this._checkMediaQueries();
  6704. // });
  6705. }
  6706. /**
  6707. * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.
  6708. * @function
  6709. * @private
  6710. */
  6711. }, {
  6712. key: "_checkMediaQueries",
  6713. value: function _checkMediaQueries() {
  6714. var matchedMq,
  6715. _this = this; // Iterate through each rule and find the last matching rule
  6716. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) {
  6717. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) {
  6718. matchedMq = key;
  6719. }
  6720. }); // No match? No dice
  6721. if (!matchedMq) return; // Plugin already initialized? We good
  6722. if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes
  6723. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) {
  6724. _this.$element.removeClass(value.cssClass);
  6725. }); // Add the CSS class for the new plugin
  6726. this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin
  6727. if (this.currentPlugin) this.currentPlugin.destroy();
  6728. this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});
  6729. }
  6730. /**
  6731. * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
  6732. * @function
  6733. */
  6734. }, {
  6735. key: "_destroy",
  6736. value: function _destroy() {
  6737. this.currentPlugin.destroy();
  6738. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('.zf.ResponsiveMenu');
  6739. }
  6740. }]);
  6741. return ResponsiveMenu;
  6742. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  6743. ResponsiveMenu.defaults = {};
  6744. /***/ }),
  6745. /***/ "./js/foundation.responsiveToggle.js":
  6746. /*!*******************************************!*\
  6747. !*** ./js/foundation.responsiveToggle.js ***!
  6748. \*******************************************/
  6749. /*! exports provided: ResponsiveToggle */
  6750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6751. "use strict";
  6752. __webpack_require__.r(__webpack_exports__);
  6753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return ResponsiveToggle; });
  6754. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  6755. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  6756. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  6757. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  6758. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6759. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6760. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6761. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6762. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6763. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6764. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6765. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6766. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6767. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6768. /**
  6769. * ResponsiveToggle module.
  6770. * @module foundation.responsiveToggle
  6771. * @requires foundation.util.mediaQuery
  6772. * @requires foundation.util.motion
  6773. */
  6774. var ResponsiveToggle =
  6775. /*#__PURE__*/
  6776. function (_Plugin) {
  6777. _inherits(ResponsiveToggle, _Plugin);
  6778. function ResponsiveToggle() {
  6779. _classCallCheck(this, ResponsiveToggle);
  6780. return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveToggle).apply(this, arguments));
  6781. }
  6782. _createClass(ResponsiveToggle, [{
  6783. key: "_setup",
  6784. /**
  6785. * Creates a new instance of Tab Bar.
  6786. * @class
  6787. * @name ResponsiveToggle
  6788. * @fires ResponsiveToggle#init
  6789. * @param {jQuery} element - jQuery object to attach tab bar functionality to.
  6790. * @param {Object} options - Overrides to the default plugin settings.
  6791. */
  6792. value: function _setup(element, options) {
  6793. this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
  6794. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options);
  6795. this.className = 'ResponsiveToggle'; // ie9 back compat
  6796. this._init();
  6797. this._events();
  6798. }
  6799. /**
  6800. * Initializes the tab bar by finding the target element, toggling element, and running update().
  6801. * @function
  6802. * @private
  6803. */
  6804. }, {
  6805. key: "_init",
  6806. value: function _init() {
  6807. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
  6808. var targetID = this.$element.data('responsive-toggle');
  6809. if (!targetID) {
  6810. console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');
  6811. }
  6812. this.$targetMenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetID));
  6813. this.$toggler = this.$element.find('[data-toggle]').filter(function () {
  6814. var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle');
  6815. return target === targetID || target === "";
  6816. });
  6817. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.options, this.$targetMenu.data()); // If they were set, parse the animation classes
  6818. if (this.options.animate) {
  6819. var input = this.options.animate.split(' ');
  6820. this.animationIn = input[0];
  6821. this.animationOut = input[1] || null;
  6822. }
  6823. this._update();
  6824. }
  6825. /**
  6826. * Adds necessary event handlers for the tab bar to work.
  6827. * @function
  6828. * @private
  6829. */
  6830. }, {
  6831. key: "_events",
  6832. value: function _events() {
  6833. var _this = this;
  6834. this._updateMqHandler = this._update.bind(this);
  6835. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._updateMqHandler);
  6836. this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));
  6837. }
  6838. /**
  6839. * Checks the current media query to determine if the tab bar should be visible or hidden.
  6840. * @function
  6841. * @private
  6842. */
  6843. }, {
  6844. key: "_update",
  6845. value: function _update() {
  6846. // Mobile
  6847. if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) {
  6848. this.$element.show();
  6849. this.$targetMenu.hide();
  6850. } // Desktop
  6851. else {
  6852. this.$element.hide();
  6853. this.$targetMenu.show();
  6854. }
  6855. }
  6856. /**
  6857. * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it.
  6858. * @function
  6859. * @fires ResponsiveToggle#toggled
  6860. */
  6861. }, {
  6862. key: "toggleMenu",
  6863. value: function toggleMenu() {
  6864. var _this2 = this;
  6865. if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) {
  6866. /**
  6867. * Fires when the element attached to the tab bar toggles.
  6868. * @event ResponsiveToggle#toggled
  6869. */
  6870. if (this.options.animate) {
  6871. if (this.$targetMenu.is(':hidden')) {
  6872. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn(this.$targetMenu, this.animationIn, function () {
  6873. _this2.$element.trigger('toggled.zf.responsiveToggle');
  6874. _this2.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');
  6875. });
  6876. } else {
  6877. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(this.$targetMenu, this.animationOut, function () {
  6878. _this2.$element.trigger('toggled.zf.responsiveToggle');
  6879. });
  6880. }
  6881. } else {
  6882. this.$targetMenu.toggle(0);
  6883. this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');
  6884. this.$element.trigger('toggled.zf.responsiveToggle');
  6885. }
  6886. }
  6887. }
  6888. }, {
  6889. key: "_destroy",
  6890. value: function _destroy() {
  6891. this.$element.off('.zf.responsiveToggle');
  6892. this.$toggler.off('.zf.responsiveToggle');
  6893. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._updateMqHandler);
  6894. }
  6895. }]);
  6896. return ResponsiveToggle;
  6897. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  6898. ResponsiveToggle.defaults = {
  6899. /**
  6900. * The breakpoint after which the menu is always shown, and the tab bar is hidden.
  6901. * @option
  6902. * @type {string}
  6903. * @default 'medium'
  6904. */
  6905. hideFor: 'medium',
  6906. /**
  6907. * To decide if the toggle should be animated or not.
  6908. * @option
  6909. * @type {boolean}
  6910. * @default false
  6911. */
  6912. animate: false
  6913. };
  6914. /***/ }),
  6915. /***/ "./js/foundation.reveal.js":
  6916. /*!*********************************!*\
  6917. !*** ./js/foundation.reveal.js ***!
  6918. \*********************************/
  6919. /*! exports provided: Reveal */
  6920. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6921. "use strict";
  6922. __webpack_require__.r(__webpack_exports__);
  6923. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return Reveal; });
  6924. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  6925. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  6926. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6927. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  6928. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  6929. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  6930. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  6931. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  6932. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  6933. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6934. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6935. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6936. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6937. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6938. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6939. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6940. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6941. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6942. /**
  6943. * Reveal module.
  6944. * @module foundation.reveal
  6945. * @requires foundation.util.keyboard
  6946. * @requires foundation.util.touch
  6947. * @requires foundation.util.triggers
  6948. * @requires foundation.util.mediaQuery
  6949. * @requires foundation.util.motion if using animations
  6950. */
  6951. var Reveal =
  6952. /*#__PURE__*/
  6953. function (_Plugin) {
  6954. _inherits(Reveal, _Plugin);
  6955. function Reveal() {
  6956. _classCallCheck(this, Reveal);
  6957. return _possibleConstructorReturn(this, _getPrototypeOf(Reveal).apply(this, arguments));
  6958. }
  6959. _createClass(Reveal, [{
  6960. key: "_setup",
  6961. /**
  6962. * Creates a new instance of Reveal.
  6963. * @class
  6964. * @name Reveal
  6965. * @param {jQuery} element - jQuery object to use for the modal.
  6966. * @param {Object} options - optional parameters.
  6967. */
  6968. value: function _setup(element, options) {
  6969. this.$element = element;
  6970. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Reveal.defaults, this.$element.data(), options);
  6971. this.className = 'Reveal'; // ie9 back compat
  6972. this._init(); // Touch and Triggers init are idempotent, just need to make sure they are initialized
  6973. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  6974. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  6975. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Reveal', {
  6976. 'ESCAPE': 'close'
  6977. });
  6978. }
  6979. /**
  6980. * Initializes the modal by adding the overlay and close buttons, (if selected).
  6981. * @private
  6982. */
  6983. }, {
  6984. key: "_init",
  6985. value: function _init() {
  6986. var _this2 = this;
  6987. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"]._init();
  6988. this.id = this.$element.attr('id');
  6989. this.isActive = false;
  6990. this.cached = {
  6991. mq: _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].current
  6992. };
  6993. this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")).length ? jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat(this.id, "\"]"));
  6994. this.$anchor.attr({
  6995. 'aria-controls': this.id,
  6996. 'aria-haspopup': true,
  6997. 'tabindex': 0
  6998. });
  6999. if (this.options.fullScreen || this.$element.hasClass('full')) {
  7000. this.options.fullScreen = true;
  7001. this.options.overlay = false;
  7002. }
  7003. if (this.options.overlay && !this.$overlay) {
  7004. this.$overlay = this._makeOverlay(this.id);
  7005. }
  7006. this.$element.attr({
  7007. 'role': 'dialog',
  7008. 'aria-hidden': true,
  7009. 'data-yeti-box': this.id,
  7010. 'data-resize': this.id
  7011. });
  7012. if (this.$overlay) {
  7013. this.$element.detach().appendTo(this.$overlay);
  7014. } else {
  7015. this.$element.detach().appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo));
  7016. this.$element.addClass('without-overlay');
  7017. }
  7018. this._events();
  7019. if (this.options.deepLink && window.location.hash === "#".concat(this.id)) {
  7020. this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  7021. return _this2.open();
  7022. });
  7023. }
  7024. }
  7025. /**
  7026. * Creates an overlay div to display behind the modal.
  7027. * @private
  7028. */
  7029. }, {
  7030. key: "_makeOverlay",
  7031. value: function _makeOverlay() {
  7032. var additionalOverlayClasses = '';
  7033. if (this.options.additionalOverlayClasses) {
  7034. additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses;
  7035. }
  7036. return jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass('reveal-overlay' + additionalOverlayClasses).appendTo(this.options.appendTo);
  7037. }
  7038. /**
  7039. * Updates position of modal
  7040. * TODO: Figure out if we actually need to cache these values or if it doesn't matter
  7041. * @private
  7042. */
  7043. }, {
  7044. key: "_updatePosition",
  7045. value: function _updatePosition() {
  7046. var width = this.$element.outerWidth();
  7047. var outerWidth = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).width();
  7048. var height = this.$element.outerHeight();
  7049. var outerHeight = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height();
  7050. var left,
  7051. top = null;
  7052. if (this.options.hOffset === 'auto') {
  7053. left = parseInt((outerWidth - width) / 2, 10);
  7054. } else {
  7055. left = parseInt(this.options.hOffset, 10);
  7056. }
  7057. if (this.options.vOffset === 'auto') {
  7058. if (height > outerHeight) {
  7059. top = parseInt(Math.min(100, outerHeight / 10), 10);
  7060. } else {
  7061. top = parseInt((outerHeight - height) / 4, 10);
  7062. }
  7063. } else if (this.options.vOffset !== null) {
  7064. top = parseInt(this.options.vOffset, 10);
  7065. }
  7066. if (top !== null) {
  7067. this.$element.css({
  7068. top: top + 'px'
  7069. });
  7070. } // only worry about left if we don't have an overlay or we have a horizontal offset,
  7071. // otherwise we're perfectly in the middle
  7072. if (!this.$overlay || this.options.hOffset !== 'auto') {
  7073. this.$element.css({
  7074. left: left + 'px'
  7075. });
  7076. this.$element.css({
  7077. margin: '0px'
  7078. });
  7079. }
  7080. }
  7081. /**
  7082. * Adds event handlers for the modal.
  7083. * @private
  7084. */
  7085. }, {
  7086. key: "_events",
  7087. value: function _events() {
  7088. var _this3 = this;
  7089. var _this = this;
  7090. this.$element.on({
  7091. 'open.zf.trigger': this.open.bind(this),
  7092. 'close.zf.trigger': function closeZfTrigger(event, $element) {
  7093. if (event.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).parents('[data-closable]')[0] === $element) {
  7094. // only close reveal when it's explicitly called
  7095. return _this3.close.apply(_this3);
  7096. }
  7097. },
  7098. 'toggle.zf.trigger': this.toggle.bind(this),
  7099. 'resizeme.zf.trigger': function resizemeZfTrigger() {
  7100. _this._updatePosition();
  7101. }
  7102. });
  7103. if (this.options.closeOnClick && this.options.overlay) {
  7104. this.$overlay.off('.zf.reveal').on('click.zf.dropdown tap.zf.dropdown', function (e) {
  7105. if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) {
  7106. return;
  7107. }
  7108. _this.close();
  7109. });
  7110. }
  7111. if (this.options.deepLink) {
  7112. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on("hashchange.zf.reveal:".concat(this.id), this._handleState.bind(this));
  7113. }
  7114. }
  7115. /**
  7116. * Handles modal methods on back/forward button clicks or any other event that triggers hashchange.
  7117. * @private
  7118. */
  7119. }, {
  7120. key: "_handleState",
  7121. value: function _handleState(e) {
  7122. if (window.location.hash === '#' + this.id && !this.isActive) {
  7123. this.open();
  7124. } else {
  7125. this.close();
  7126. }
  7127. }
  7128. /**
  7129. * Disables the scroll when Reveal is shown to prevent the background from shifting
  7130. * @param {number} scrollTop - Scroll to visually apply, window current scroll by default
  7131. */
  7132. }, {
  7133. key: "_disableScroll",
  7134. value: function _disableScroll(scrollTop) {
  7135. scrollTop = scrollTop || jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop();
  7136. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) {
  7137. jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", -scrollTop);
  7138. }
  7139. }
  7140. /**
  7141. * Reenables the scroll when Reveal closes
  7142. * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`)
  7143. */
  7144. }, {
  7145. key: "_enableScroll",
  7146. value: function _enableScroll(scrollTop) {
  7147. scrollTop = scrollTop || parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"));
  7148. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) {
  7149. jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", "");
  7150. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(-scrollTop);
  7151. }
  7152. }
  7153. /**
  7154. * Opens the modal controlled by `this.$anchor`, and closes all others by default.
  7155. * @function
  7156. * @fires Reveal#closeme
  7157. * @fires Reveal#open
  7158. */
  7159. }, {
  7160. key: "open",
  7161. value: function open() {
  7162. var _this4 = this;
  7163. // either update or replace browser history
  7164. var hash = "#".concat(this.id);
  7165. if (this.options.deepLink && window.location.hash !== hash) {
  7166. if (window.history.pushState) {
  7167. if (this.options.updateHistory) {
  7168. window.history.pushState({}, '', hash);
  7169. } else {
  7170. window.history.replaceState({}, '', hash);
  7171. }
  7172. } else {
  7173. window.location.hash = hash;
  7174. }
  7175. } // Remember anchor that opened it to set focus back later, have general anchors as fallback
  7176. this.$activeAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement).is(this.$anchor) ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement) : this.$anchor;
  7177. this.isActive = true; // Make elements invisible, but remove display: none so we can get size and positioning
  7178. this.$element.css({
  7179. 'visibility': 'hidden'
  7180. }).show().scrollTop(0);
  7181. if (this.options.overlay) {
  7182. this.$overlay.css({
  7183. 'visibility': 'hidden'
  7184. }).show();
  7185. }
  7186. this._updatePosition();
  7187. this.$element.hide().css({
  7188. 'visibility': ''
  7189. });
  7190. if (this.$overlay) {
  7191. this.$overlay.css({
  7192. 'visibility': ''
  7193. }).hide();
  7194. if (this.$element.hasClass('fast')) {
  7195. this.$overlay.addClass('fast');
  7196. } else if (this.$element.hasClass('slow')) {
  7197. this.$overlay.addClass('slow');
  7198. }
  7199. }
  7200. if (!this.options.multipleOpened) {
  7201. /**
  7202. * Fires immediately before the modal opens.
  7203. * Closes any other modals that are currently open
  7204. * @event Reveal#closeme
  7205. */
  7206. this.$element.trigger('closeme.zf.reveal', this.id);
  7207. }
  7208. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
  7209. this._disableScroll();
  7210. }
  7211. var _this = this; // Motion UI method of reveal
  7212. if (this.options.animationIn) {
  7213. var afterAnimation = function afterAnimation() {
  7214. _this.$element.attr({
  7215. 'aria-hidden': false,
  7216. 'tabindex': -1
  7217. }).focus();
  7218. _this._addGlobalClasses();
  7219. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(_this.$element);
  7220. };
  7221. if (this.options.overlay) {
  7222. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateIn(this.$overlay, 'fade-in');
  7223. }
  7224. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateIn(this.$element, this.options.animationIn, function () {
  7225. if (_this4.$element) {
  7226. // protect against object having been removed
  7227. _this4.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].findFocusable(_this4.$element);
  7228. afterAnimation();
  7229. }
  7230. });
  7231. } // jQuery method of reveal
  7232. else {
  7233. if (this.options.overlay) {
  7234. this.$overlay.show(0);
  7235. }
  7236. this.$element.show(this.options.showDelay);
  7237. } // handle accessibility
  7238. this.$element.attr({
  7239. 'aria-hidden': false,
  7240. 'tabindex': -1
  7241. }).focus();
  7242. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(this.$element);
  7243. this._addGlobalClasses();
  7244. this._addGlobalListeners();
  7245. /**
  7246. * Fires when the modal has successfully opened.
  7247. * @event Reveal#open
  7248. */
  7249. this.$element.trigger('open.zf.reveal');
  7250. }
  7251. /**
  7252. * Adds classes and listeners on document required by open modals.
  7253. *
  7254. * The following classes are added and updated:
  7255. * - `.is-reveal-open` - Prevents the scroll on document
  7256. * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the
  7257. * scroll was not disabled. This prevent a "shift" of the page content due
  7258. * the scrollbar disappearing when the modal opens.
  7259. *
  7260. * @private
  7261. */
  7262. }, {
  7263. key: "_addGlobalClasses",
  7264. value: function _addGlobalClasses() {
  7265. var updateScrollbarClass = function updateScrollbarClass() {
  7266. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').toggleClass('zf-has-scroll', !!(jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()));
  7267. };
  7268. this.$element.on('resizeme.zf.trigger.revealScrollbarListener', function () {
  7269. return updateScrollbarClass();
  7270. });
  7271. updateScrollbarClass();
  7272. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').addClass('is-reveal-open');
  7273. }
  7274. /**
  7275. * Removes classes and listeners on document that were required by open modals.
  7276. * @private
  7277. */
  7278. }, {
  7279. key: "_removeGlobalClasses",
  7280. value: function _removeGlobalClasses() {
  7281. this.$element.off('resizeme.zf.trigger.revealScrollbarListener');
  7282. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('is-reveal-open');
  7283. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('zf-has-scroll');
  7284. }
  7285. /**
  7286. * Adds extra event handlers for the body and window if necessary.
  7287. * @private
  7288. */
  7289. }, {
  7290. key: "_addGlobalListeners",
  7291. value: function _addGlobalListeners() {
  7292. var _this = this;
  7293. if (!this.$element) {
  7294. return;
  7295. } // If we're in the middle of cleanup, don't freak out
  7296. this.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].findFocusable(this.$element);
  7297. if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) {
  7298. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click.zf.dropdown tap.zf.dropdown', function (e) {
  7299. if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) {
  7300. return;
  7301. }
  7302. _this.close();
  7303. });
  7304. }
  7305. if (this.options.closeOnEsc) {
  7306. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('keydown.zf.reveal', function (e) {
  7307. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Reveal', {
  7308. close: function close() {
  7309. if (_this.options.closeOnEsc) {
  7310. _this.close();
  7311. }
  7312. }
  7313. });
  7314. });
  7315. }
  7316. }
  7317. /**
  7318. * Closes the modal.
  7319. * @function
  7320. * @fires Reveal#closed
  7321. */
  7322. }, {
  7323. key: "close",
  7324. value: function close() {
  7325. if (!this.isActive || !this.$element.is(':visible')) {
  7326. return false;
  7327. }
  7328. var _this = this; // Motion UI method of hiding
  7329. if (this.options.animationOut) {
  7330. if (this.options.overlay) {
  7331. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateOut(this.$overlay, 'fade-out');
  7332. }
  7333. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateOut(this.$element, this.options.animationOut, finishUp);
  7334. } // jQuery method of hiding
  7335. else {
  7336. this.$element.hide(this.options.hideDelay);
  7337. if (this.options.overlay) {
  7338. this.$overlay.hide(0, finishUp);
  7339. } else {
  7340. finishUp();
  7341. }
  7342. } // Conditionals to remove extra event listeners added on open
  7343. if (this.options.closeOnEsc) {
  7344. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('keydown.zf.reveal');
  7345. }
  7346. if (!this.options.overlay && this.options.closeOnClick) {
  7347. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('click.zf.dropdown tap.zf.dropdown');
  7348. }
  7349. this.$element.off('keydown.zf.reveal');
  7350. function finishUp() {
  7351. // Get the current top before the modal is closed and restore the scroll after.
  7352. // TODO: use component properties instead of HTML properties
  7353. // See https://github.com/foundation/foundation-sites/pull/10786
  7354. var scrollTop = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"));
  7355. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
  7356. _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
  7357. }
  7358. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].releaseFocus(_this.$element);
  7359. _this.$element.attr('aria-hidden', true);
  7360. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
  7361. _this._enableScroll(scrollTop);
  7362. }
  7363. /**
  7364. * Fires when the modal is done closing.
  7365. * @event Reveal#closed
  7366. */
  7367. _this.$element.trigger('closed.zf.reveal');
  7368. }
  7369. /**
  7370. * Resets the modal content
  7371. * This prevents a running video to keep going in the background
  7372. */
  7373. if (this.options.resetOnClose) {
  7374. this.$element.html(this.$element.html());
  7375. }
  7376. this.isActive = false; // If deepLink and we did not switched to an other modal...
  7377. if (_this.options.deepLink && window.location.hash === "#".concat(this.id)) {
  7378. // Remove the history hash
  7379. if (window.history.replaceState) {
  7380. var urlWithoutHash = window.location.pathname + window.location.search;
  7381. if (this.options.updateHistory) {
  7382. window.history.pushState({}, '', urlWithoutHash); // remove the hash
  7383. } else {
  7384. window.history.replaceState('', document.title, urlWithoutHash);
  7385. }
  7386. } else {
  7387. window.location.hash = '';
  7388. }
  7389. }
  7390. this.$activeAnchor.focus();
  7391. }
  7392. /**
  7393. * Toggles the open/closed state of a modal.
  7394. * @function
  7395. */
  7396. }, {
  7397. key: "toggle",
  7398. value: function toggle() {
  7399. if (this.isActive) {
  7400. this.close();
  7401. } else {
  7402. this.open();
  7403. }
  7404. }
  7405. }, {
  7406. key: "_destroy",
  7407. /**
  7408. * Destroys an instance of a modal.
  7409. * @function
  7410. */
  7411. value: function _destroy() {
  7412. if (this.options.overlay) {
  7413. this.$element.appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin()
  7414. this.$overlay.hide().off().remove();
  7415. }
  7416. this.$element.hide().off();
  7417. this.$anchor.off('.zf');
  7418. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(".zf.reveal:".concat(this.id));
  7419. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  7420. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
  7421. this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
  7422. }
  7423. }
  7424. }]);
  7425. return Reveal;
  7426. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  7427. Reveal.defaults = {
  7428. /**
  7429. * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.
  7430. * @option
  7431. * @type {string}
  7432. * @default ''
  7433. */
  7434. animationIn: '',
  7435. /**
  7436. * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.
  7437. * @option
  7438. * @type {string}
  7439. * @default ''
  7440. */
  7441. animationOut: '',
  7442. /**
  7443. * Time, in ms, to delay the opening of a modal after a click if no animation used.
  7444. * @option
  7445. * @type {number}
  7446. * @default 0
  7447. */
  7448. showDelay: 0,
  7449. /**
  7450. * Time, in ms, to delay the closing of a modal after a click if no animation used.
  7451. * @option
  7452. * @type {number}
  7453. * @default 0
  7454. */
  7455. hideDelay: 0,
  7456. /**
  7457. * Allows a click on the body/overlay to close the modal.
  7458. * @option
  7459. * @type {boolean}
  7460. * @default true
  7461. */
  7462. closeOnClick: true,
  7463. /**
  7464. * Allows the modal to close if the user presses the `ESCAPE` key.
  7465. * @option
  7466. * @type {boolean}
  7467. * @default true
  7468. */
  7469. closeOnEsc: true,
  7470. /**
  7471. * If true, allows multiple modals to be displayed at once.
  7472. * @option
  7473. * @type {boolean}
  7474. * @default false
  7475. */
  7476. multipleOpened: false,
  7477. /**
  7478. * Distance, in pixels, the modal should push down from the top of the screen.
  7479. * @option
  7480. * @type {number|string}
  7481. * @default auto
  7482. */
  7483. vOffset: 'auto',
  7484. /**
  7485. * Distance, in pixels, the modal should push in from the side of the screen.
  7486. * @option
  7487. * @type {number|string}
  7488. * @default auto
  7489. */
  7490. hOffset: 'auto',
  7491. /**
  7492. * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well.
  7493. * @option
  7494. * @type {boolean}
  7495. * @default false
  7496. */
  7497. fullScreen: false,
  7498. /**
  7499. * Allows the modal to generate an overlay div, which will cover the view when modal opens.
  7500. * @option
  7501. * @type {boolean}
  7502. * @default true
  7503. */
  7504. overlay: true,
  7505. /**
  7506. * Allows the modal to remove and reinject markup on close. Should be true if using video elements w/o using provider's api, otherwise, videos will continue to play in the background.
  7507. * @option
  7508. * @type {boolean}
  7509. * @default false
  7510. */
  7511. resetOnClose: false,
  7512. /**
  7513. * Link the location hash to the modal.
  7514. * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes.
  7515. * @option
  7516. * @type {boolean}
  7517. * @default false
  7518. */
  7519. deepLink: false,
  7520. /**
  7521. * If `deepLink` is enabled, update the browser history with the open modal
  7522. * @option
  7523. * @default false
  7524. */
  7525. updateHistory: false,
  7526. /**
  7527. * Allows the modal to append to custom div.
  7528. * @option
  7529. * @type {string}
  7530. * @default "body"
  7531. */
  7532. appendTo: "body",
  7533. /**
  7534. * Allows adding additional class names to the reveal overlay.
  7535. * @option
  7536. * @type {string}
  7537. * @default ''
  7538. */
  7539. additionalOverlayClasses: ''
  7540. };
  7541. /***/ }),
  7542. /***/ "./js/foundation.slider.js":
  7543. /*!*********************************!*\
  7544. !*** ./js/foundation.slider.js ***!
  7545. \*********************************/
  7546. /*! exports provided: Slider */
  7547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7548. "use strict";
  7549. __webpack_require__.r(__webpack_exports__);
  7550. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return Slider; });
  7551. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  7552. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  7553. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  7554. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  7555. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  7556. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  7557. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  7558. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  7559. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7560. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7561. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7562. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7563. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7564. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7565. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7566. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7567. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7568. /**
  7569. * Slider module.
  7570. * @module foundation.slider
  7571. * @requires foundation.util.motion
  7572. * @requires foundation.util.triggers
  7573. * @requires foundation.util.keyboard
  7574. * @requires foundation.util.touch
  7575. */
  7576. var Slider =
  7577. /*#__PURE__*/
  7578. function (_Plugin) {
  7579. _inherits(Slider, _Plugin);
  7580. function Slider() {
  7581. _classCallCheck(this, Slider);
  7582. return _possibleConstructorReturn(this, _getPrototypeOf(Slider).apply(this, arguments));
  7583. }
  7584. _createClass(Slider, [{
  7585. key: "_setup",
  7586. /**
  7587. * Creates a new instance of a slider control.
  7588. * @class
  7589. * @name Slider
  7590. * @param {jQuery} element - jQuery object to make into a slider control.
  7591. * @param {Object} options - Overrides to the default plugin settings.
  7592. */
  7593. value: function _setup(element, options) {
  7594. this.$element = element;
  7595. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Slider.defaults, this.$element.data(), options);
  7596. this.className = 'Slider'; // ie9 back compat
  7597. // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.
  7598. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  7599. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  7600. this._init();
  7601. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Slider', {
  7602. 'ltr': {
  7603. 'ARROW_RIGHT': 'increase',
  7604. 'ARROW_UP': 'increase',
  7605. 'ARROW_DOWN': 'decrease',
  7606. 'ARROW_LEFT': 'decrease',
  7607. 'SHIFT_ARROW_RIGHT': 'increase_fast',
  7608. 'SHIFT_ARROW_UP': 'increase_fast',
  7609. 'SHIFT_ARROW_DOWN': 'decrease_fast',
  7610. 'SHIFT_ARROW_LEFT': 'decrease_fast',
  7611. 'HOME': 'min',
  7612. 'END': 'max'
  7613. },
  7614. 'rtl': {
  7615. 'ARROW_LEFT': 'increase',
  7616. 'ARROW_RIGHT': 'decrease',
  7617. 'SHIFT_ARROW_LEFT': 'increase_fast',
  7618. 'SHIFT_ARROW_RIGHT': 'decrease_fast'
  7619. }
  7620. });
  7621. }
  7622. /**
  7623. * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s).
  7624. * @function
  7625. * @private
  7626. */
  7627. }, {
  7628. key: "_init",
  7629. value: function _init() {
  7630. this.inputs = this.$element.find('input');
  7631. this.handles = this.$element.find('[data-slider-handle]');
  7632. this.$handle = this.handles.eq(0);
  7633. this.$input = this.inputs.length ? this.inputs.eq(0) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle.attr('aria-controls')));
  7634. this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0);
  7635. var _this = this;
  7636. if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) {
  7637. this.options.disabled = true;
  7638. this.$element.addClass(this.options.disabledClass);
  7639. }
  7640. if (!this.inputs.length) {
  7641. this.inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default()().add(this.$input);
  7642. this.options.binding = true;
  7643. }
  7644. this._setInitAttr(0);
  7645. if (this.handles[1]) {
  7646. this.options.doubleSided = true;
  7647. this.$handle2 = this.handles.eq(1);
  7648. this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle2.attr('aria-controls')));
  7649. if (!this.inputs[1]) {
  7650. this.inputs = this.inputs.add(this.$input2);
  7651. } // this.$handle.triggerHandler('click.zf.slider');
  7652. this._setInitAttr(1);
  7653. } // Set handle positions
  7654. this.setHandles();
  7655. this._events();
  7656. }
  7657. }, {
  7658. key: "setHandles",
  7659. value: function setHandles() {
  7660. var _this2 = this;
  7661. if (this.handles[1]) {
  7662. this._setHandlePos(this.$handle, this.inputs.eq(0).val(), function () {
  7663. _this2._setHandlePos(_this2.$handle2, _this2.inputs.eq(1).val());
  7664. });
  7665. } else {
  7666. this._setHandlePos(this.$handle, this.inputs.eq(0).val());
  7667. }
  7668. }
  7669. }, {
  7670. key: "_reflow",
  7671. value: function _reflow() {
  7672. this.setHandles();
  7673. }
  7674. /**
  7675. * @function
  7676. * @private
  7677. * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value)
  7678. */
  7679. }, {
  7680. key: "_pctOfBar",
  7681. value: function _pctOfBar(value) {
  7682. var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start);
  7683. switch (this.options.positionValueFunction) {
  7684. case "pow":
  7685. pctOfBar = this._logTransform(pctOfBar);
  7686. break;
  7687. case "log":
  7688. pctOfBar = this._powTransform(pctOfBar);
  7689. break;
  7690. }
  7691. return pctOfBar.toFixed(2);
  7692. }
  7693. /**
  7694. * @function
  7695. * @private
  7696. * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value
  7697. */
  7698. }, {
  7699. key: "_value",
  7700. value: function _value(pctOfBar) {
  7701. switch (this.options.positionValueFunction) {
  7702. case "pow":
  7703. pctOfBar = this._powTransform(pctOfBar);
  7704. break;
  7705. case "log":
  7706. pctOfBar = this._logTransform(pctOfBar);
  7707. break;
  7708. }
  7709. var value;
  7710. if (this.options.vertical) {
  7711. // linear interpolation which is working with negative values for start
  7712. // https://math.stackexchange.com/a/1019084
  7713. value = parseFloat(this.options.end) + pctOfBar * (this.options.start - this.options.end);
  7714. } else {
  7715. value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start);
  7716. }
  7717. return value;
  7718. }
  7719. /**
  7720. * @function
  7721. * @private
  7722. * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function
  7723. */
  7724. }, {
  7725. key: "_logTransform",
  7726. value: function _logTransform(value) {
  7727. return baseLog(this.options.nonLinearBase, value * (this.options.nonLinearBase - 1) + 1);
  7728. }
  7729. /**
  7730. * @function
  7731. * @private
  7732. * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function
  7733. */
  7734. }, {
  7735. key: "_powTransform",
  7736. value: function _powTransform(value) {
  7737. return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1);
  7738. }
  7739. /**
  7740. * Sets the position of the selected handle and fill bar.
  7741. * @function
  7742. * @private
  7743. * @param {jQuery} $hndl - the selected handle to move.
  7744. * @param {Number} location - floating point between the start and end values of the slider bar.
  7745. * @param {Function} cb - callback function to fire on completion.
  7746. * @fires Slider#moved
  7747. * @fires Slider#changed
  7748. */
  7749. }, {
  7750. key: "_setHandlePos",
  7751. value: function _setHandlePos($hndl, location, cb) {
  7752. // don't move if the slider has been disabled since its initialization
  7753. if (this.$element.hasClass(this.options.disabledClass)) {
  7754. return;
  7755. } //might need to alter that slightly for bars that will have odd number selections.
  7756. location = parseFloat(location); //on input change events, convert string to number...grumble.
  7757. // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max
  7758. if (location < this.options.start) {
  7759. location = this.options.start;
  7760. } else if (location > this.options.end) {
  7761. location = this.options.end;
  7762. }
  7763. var isDbl = this.options.doubleSided;
  7764. if (isDbl) {
  7765. //this block is to prevent 2 handles from crossing eachother. Could/should be improved.
  7766. if (this.handles.index($hndl) === 0) {
  7767. var h2Val = parseFloat(this.$handle2.attr('aria-valuenow'));
  7768. location = location >= h2Val ? h2Val - this.options.step : location;
  7769. } else {
  7770. var h1Val = parseFloat(this.$handle.attr('aria-valuenow'));
  7771. location = location <= h1Val ? h1Val + this.options.step : location;
  7772. }
  7773. }
  7774. var _this = this,
  7775. vert = this.options.vertical,
  7776. hOrW = vert ? 'height' : 'width',
  7777. lOrT = vert ? 'top' : 'left',
  7778. handleDim = $hndl[0].getBoundingClientRect()[hOrW],
  7779. elemDim = this.$element[0].getBoundingClientRect()[hOrW],
  7780. //percentage of bar min/max value based on click or drag point
  7781. pctOfBar = this._pctOfBar(location),
  7782. //number of actual pixels to shift the handle, based on the percentage obtained above
  7783. pxToMove = (elemDim - handleDim) * pctOfBar,
  7784. //percentage of bar to shift the handle
  7785. movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal); //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value
  7786. location = parseFloat(location.toFixed(this.options.decimal)); // declare empty object for css adjustments, only used with 2 handled-sliders
  7787. var css = {};
  7788. this._setValues($hndl, location); // TODO update to calculate based on values set to respective inputs??
  7789. if (isDbl) {
  7790. var isLeftHndl = this.handles.index($hndl) === 0,
  7791. //empty variable, will be used for min-height/width for fill bar
  7792. dim,
  7793. //percentage w/h of the handle compared to the slider bar
  7794. handlePct = ~~(percent(handleDim, elemDim) * 100); //if left handle, the math is slightly different than if it's the right handle, and the left/top property needs to be changed for the fill bar
  7795. if (isLeftHndl) {
  7796. //left or top percentage value to apply to the fill bar.
  7797. css[lOrT] = "".concat(movement, "%"); //calculate the new min-height/width for the fill bar.
  7798. dim = parseFloat(this.$handle2[0].style[lOrT]) - movement + handlePct; //this callback is necessary to prevent errors and allow the proper placement and initialization of a 2-handled slider
  7799. //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future.
  7800. if (cb && typeof cb === 'function') {
  7801. cb();
  7802. } //this is only needed for the initialization of 2 handled sliders
  7803. } else {
  7804. //just caching the value of the left/bottom handle's left/top property
  7805. var handlePos = parseFloat(this.$handle[0].style[lOrT]); //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0
  7806. //based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself
  7807. dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start) / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct;
  7808. } // assign the min-height/width to our css object
  7809. css["min-".concat(hOrW)] = "".concat(dim, "%");
  7810. }
  7811. this.$element.one('finished.zf.animate', function () {
  7812. /**
  7813. * Fires when the handle is done moving.
  7814. * @event Slider#moved
  7815. */
  7816. _this.$element.trigger('moved.zf.slider', [$hndl]);
  7817. }); //because we don't know exactly how the handle will be moved, check the amount of time it should take to move.
  7818. var moveTime = this.$element.data('dragging') ? 1000 / 60 : this.options.moveTime;
  7819. Object(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Move"])(moveTime, $hndl, function () {
  7820. // adjusting the left/top property of the handle, based on the percentage calculated above
  7821. // if movement isNaN, that is because the slider is hidden and we cannot determine handle width,
  7822. // fall back to next best guess.
  7823. if (isNaN(movement)) {
  7824. $hndl.css(lOrT, "".concat(pctOfBar * 100, "%"));
  7825. } else {
  7826. $hndl.css(lOrT, "".concat(movement, "%"));
  7827. }
  7828. if (!_this.options.doubleSided) {
  7829. //if single-handled, a simple method to expand the fill bar
  7830. _this.$fill.css(hOrW, "".concat(pctOfBar * 100, "%"));
  7831. } else {
  7832. //otherwise, use the css object we created above
  7833. _this.$fill.css(css);
  7834. }
  7835. });
  7836. /**
  7837. * Fires when the value has not been change for a given time.
  7838. * @event Slider#changed
  7839. */
  7840. clearTimeout(_this.timeout);
  7841. _this.timeout = setTimeout(function () {
  7842. _this.$element.trigger('changed.zf.slider', [$hndl]);
  7843. }, _this.options.changedDelay);
  7844. }
  7845. /**
  7846. * Sets the initial attribute for the slider element.
  7847. * @function
  7848. * @private
  7849. * @param {Number} idx - index of the current handle/input to use.
  7850. */
  7851. }, {
  7852. key: "_setInitAttr",
  7853. value: function _setInitAttr(idx) {
  7854. var initVal = idx === 0 ? this.options.initialStart : this.options.initialEnd;
  7855. var id = this.inputs.eq(idx).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'slider');
  7856. this.inputs.eq(idx).attr({
  7857. 'id': id,
  7858. 'max': this.options.end,
  7859. 'min': this.options.start,
  7860. 'step': this.options.step
  7861. });
  7862. this.inputs.eq(idx).val(initVal);
  7863. this.handles.eq(idx).attr({
  7864. 'role': 'slider',
  7865. 'aria-controls': id,
  7866. 'aria-valuemax': this.options.end,
  7867. 'aria-valuemin': this.options.start,
  7868. 'aria-valuenow': initVal,
  7869. 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal',
  7870. 'tabindex': 0
  7871. });
  7872. }
  7873. /**
  7874. * Sets the input and `aria-valuenow` values for the slider element.
  7875. * @function
  7876. * @private
  7877. * @param {jQuery} $handle - the currently selected handle.
  7878. * @param {Number} val - floating point of the new value.
  7879. */
  7880. }, {
  7881. key: "_setValues",
  7882. value: function _setValues($handle, val) {
  7883. var idx = this.options.doubleSided ? this.handles.index($handle) : 0;
  7884. this.inputs.eq(idx).val(val);
  7885. $handle.attr('aria-valuenow', val);
  7886. }
  7887. /**
  7888. * Handles events on the slider element.
  7889. * Calculates the new location of the current handle.
  7890. * If there are two handles and the bar was clicked, it determines which handle to move.
  7891. * @function
  7892. * @private
  7893. * @param {Object} e - the `event` object passed from the listener.
  7894. * @param {jQuery} $handle - the current handle to calculate for, if selected.
  7895. * @param {Number} val - floating point number for the new value of the slider.
  7896. * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn.
  7897. */
  7898. }, {
  7899. key: "_handleEvent",
  7900. value: function _handleEvent(e, $handle, val) {
  7901. var value, hasVal;
  7902. if (!val) {
  7903. //click or drag events
  7904. e.preventDefault();
  7905. var _this = this,
  7906. vertical = this.options.vertical,
  7907. param = vertical ? 'height' : 'width',
  7908. direction = vertical ? 'top' : 'left',
  7909. eventOffset = vertical ? e.pageY : e.pageX,
  7910. barDim = this.$element[0].getBoundingClientRect()[param],
  7911. windowScroll = vertical ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop() : jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollLeft();
  7912. var elemOffset = this.$element.offset()[direction]; // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates...
  7913. // best way to guess this is simulated is if clientY == pageY
  7914. if (e.clientY === e.pageY) {
  7915. eventOffset = eventOffset + windowScroll;
  7916. }
  7917. var eventFromBar = eventOffset - elemOffset;
  7918. var barXY;
  7919. if (eventFromBar < 0) {
  7920. barXY = 0;
  7921. } else if (eventFromBar > barDim) {
  7922. barXY = barDim;
  7923. } else {
  7924. barXY = eventFromBar;
  7925. }
  7926. var offsetPct = percent(barXY, barDim);
  7927. value = this._value(offsetPct); // turn everything around for RTL, yay math!
  7928. if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["rtl"])() && !this.options.vertical) {
  7929. value = this.options.end - value;
  7930. }
  7931. value = _this._adjustValue(null, value); //boolean flag for the setHandlePos fn, specifically for vertical sliders
  7932. hasVal = false;
  7933. if (!$handle) {
  7934. //figure out which handle it is, pass it to the next function.
  7935. var firstHndlPos = absPosition(this.$handle, direction, barXY, param),
  7936. secndHndlPos = absPosition(this.$handle2, direction, barXY, param);
  7937. $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2;
  7938. }
  7939. } else {
  7940. //change event on input
  7941. value = this._adjustValue(null, val);
  7942. hasVal = true;
  7943. }
  7944. this._setHandlePos($handle, value);
  7945. }
  7946. /**
  7947. * Adjustes value for handle in regard to step value. returns adjusted value
  7948. * @function
  7949. * @private
  7950. * @param {jQuery} $handle - the selected handle.
  7951. * @param {Number} value - value to adjust. used if $handle is falsy
  7952. */
  7953. }, {
  7954. key: "_adjustValue",
  7955. value: function _adjustValue($handle, value) {
  7956. var val,
  7957. step = this.options.step,
  7958. div = parseFloat(step / 2),
  7959. left,
  7960. prev_val,
  7961. next_val;
  7962. if (!!$handle) {
  7963. val = parseFloat($handle.attr('aria-valuenow'));
  7964. } else {
  7965. val = value;
  7966. }
  7967. if (val >= 0) {
  7968. left = val % step;
  7969. } else {
  7970. left = step + val % step;
  7971. }
  7972. prev_val = val - left;
  7973. next_val = prev_val + step;
  7974. if (left === 0) {
  7975. return val;
  7976. }
  7977. val = val >= prev_val + div ? next_val : prev_val;
  7978. return val;
  7979. }
  7980. /**
  7981. * Adds event listeners to the slider elements.
  7982. * @function
  7983. * @private
  7984. */
  7985. }, {
  7986. key: "_events",
  7987. value: function _events() {
  7988. this._eventsForHandle(this.$handle);
  7989. if (this.handles[1]) {
  7990. this._eventsForHandle(this.$handle2);
  7991. }
  7992. }
  7993. /**
  7994. * Adds event listeners a particular handle
  7995. * @function
  7996. * @private
  7997. * @param {jQuery} $handle - the current handle to apply listeners to.
  7998. */
  7999. }, {
  8000. key: "_eventsForHandle",
  8001. value: function _eventsForHandle($handle) {
  8002. var _this = this,
  8003. curHandle;
  8004. var handleChangeEvent = function handleChangeEvent(e) {
  8005. var idx = _this.inputs.index(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  8006. _this._handleEvent(e, _this.handles.eq(idx), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val());
  8007. }; // IE only triggers the change event when the input loses focus which strictly follows the HTML specification
  8008. // listen for the enter key and trigger a change
  8009. // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events
  8010. this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) {
  8011. if (e.keyCode == 13) handleChangeEvent.call(this, e);
  8012. });
  8013. this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent);
  8014. if (this.options.clickSelect) {
  8015. this.$element.off('click.zf.slider').on('click.zf.slider', function (e) {
  8016. if (_this.$element.data('dragging')) {
  8017. return false;
  8018. }
  8019. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is('[data-slider-handle]')) {
  8020. if (_this.options.doubleSided) {
  8021. _this._handleEvent(e);
  8022. } else {
  8023. _this._handleEvent(e, _this.$handle);
  8024. }
  8025. }
  8026. });
  8027. }
  8028. if (this.options.draggable) {
  8029. this.handles.addTouch();
  8030. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body');
  8031. $handle.off('mousedown.zf.slider').on('mousedown.zf.slider', function (e) {
  8032. $handle.addClass('is-dragging');
  8033. _this.$fill.addClass('is-dragging'); //
  8034. _this.$element.data('dragging', true);
  8035. curHandle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget);
  8036. $body.on('mousemove.zf.slider', function (e) {
  8037. e.preventDefault();
  8038. _this._handleEvent(e, curHandle);
  8039. }).on('mouseup.zf.slider', function (e) {
  8040. _this._handleEvent(e, curHandle);
  8041. $handle.removeClass('is-dragging');
  8042. _this.$fill.removeClass('is-dragging');
  8043. _this.$element.data('dragging', false);
  8044. $body.off('mousemove.zf.slider mouseup.zf.slider');
  8045. });
  8046. }) // prevent events triggered by touch
  8047. .on('selectstart.zf.slider touchmove.zf.slider', function (e) {
  8048. e.preventDefault();
  8049. });
  8050. }
  8051. $handle.off('keydown.zf.slider').on('keydown.zf.slider', function (e) {
  8052. var _$handle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  8053. idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0,
  8054. oldValue = parseFloat(_this.inputs.eq(idx).val()),
  8055. newValue; // handle keyboard event with keyboard util
  8056. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Slider', {
  8057. decrease: function decrease() {
  8058. newValue = oldValue - _this.options.step;
  8059. },
  8060. increase: function increase() {
  8061. newValue = oldValue + _this.options.step;
  8062. },
  8063. decrease_fast: function decrease_fast() {
  8064. newValue = oldValue - _this.options.step * 10;
  8065. },
  8066. increase_fast: function increase_fast() {
  8067. newValue = oldValue + _this.options.step * 10;
  8068. },
  8069. min: function min() {
  8070. newValue = _this.options.start;
  8071. },
  8072. max: function max() {
  8073. newValue = _this.options.end;
  8074. },
  8075. handled: function handled() {
  8076. // only set handle pos when event was handled specially
  8077. e.preventDefault();
  8078. _this._setHandlePos(_$handle, newValue);
  8079. }
  8080. });
  8081. /*if (newValue) { // if pressed key has special function, update value
  8082. e.preventDefault();
  8083. _this._setHandlePos(_$handle, newValue);
  8084. }*/
  8085. });
  8086. }
  8087. /**
  8088. * Destroys the slider plugin.
  8089. */
  8090. }, {
  8091. key: "_destroy",
  8092. value: function _destroy() {
  8093. this.handles.off('.zf.slider');
  8094. this.inputs.off('.zf.slider');
  8095. this.$element.off('.zf.slider');
  8096. clearTimeout(this.timeout);
  8097. }
  8098. }]);
  8099. return Slider;
  8100. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  8101. Slider.defaults = {
  8102. /**
  8103. * Minimum value for the slider scale.
  8104. * @option
  8105. * @type {number}
  8106. * @default 0
  8107. */
  8108. start: 0,
  8109. /**
  8110. * Maximum value for the slider scale.
  8111. * @option
  8112. * @type {number}
  8113. * @default 100
  8114. */
  8115. end: 100,
  8116. /**
  8117. * Minimum value change per change event.
  8118. * @option
  8119. * @type {number}
  8120. * @default 1
  8121. */
  8122. step: 1,
  8123. /**
  8124. * Value at which the handle/input *(left handle/first input)* should be set to on initialization.
  8125. * @option
  8126. * @type {number}
  8127. * @default 0
  8128. */
  8129. initialStart: 0,
  8130. /**
  8131. * Value at which the right handle/second input should be set to on initialization.
  8132. * @option
  8133. * @type {number}
  8134. * @default 100
  8135. */
  8136. initialEnd: 100,
  8137. /**
  8138. * Allows the input to be located outside the container and visible. Set to by the JS
  8139. * @option
  8140. * @type {boolean}
  8141. * @default false
  8142. */
  8143. binding: false,
  8144. /**
  8145. * Allows the user to click/tap on the slider bar to select a value.
  8146. * @option
  8147. * @type {boolean}
  8148. * @default true
  8149. */
  8150. clickSelect: true,
  8151. /**
  8152. * Set to true and use the `vertical` class to change alignment to vertical.
  8153. * @option
  8154. * @type {boolean}
  8155. * @default false
  8156. */
  8157. vertical: false,
  8158. /**
  8159. * Allows the user to drag the slider handle(s) to select a value.
  8160. * @option
  8161. * @type {boolean}
  8162. * @default true
  8163. */
  8164. draggable: true,
  8165. /**
  8166. * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`.
  8167. * @option
  8168. * @type {boolean}
  8169. * @default false
  8170. */
  8171. disabled: false,
  8172. /**
  8173. * Allows the use of two handles. Double checked by the JS. Changes some logic handling.
  8174. * @option
  8175. * @type {boolean}
  8176. * @default false
  8177. */
  8178. doubleSided: false,
  8179. /**
  8180. * Potential future feature.
  8181. */
  8182. // steps: 100,
  8183. /**
  8184. * Number of decimal places the plugin should go to for floating point precision.
  8185. * @option
  8186. * @type {number}
  8187. * @default 2
  8188. */
  8189. decimal: 2,
  8190. /**
  8191. * Time delay for dragged elements.
  8192. */
  8193. // dragDelay: 0,
  8194. /**
  8195. * Time, in ms, to animate the movement of a slider handle if user clicks/taps on the bar. Needs to be manually set if updating the transition time in the Sass settings.
  8196. * @option
  8197. * @type {number}
  8198. * @default 200
  8199. */
  8200. moveTime: 200,
  8201. //update this if changing the transition time in the sass
  8202. /**
  8203. * Class applied to disabled sliders.
  8204. * @option
  8205. * @type {string}
  8206. * @default 'disabled'
  8207. */
  8208. disabledClass: 'disabled',
  8209. /**
  8210. * Will invert the default layout for a vertical<span data-tooltip title="who would do this???"> </span>slider.
  8211. * @option
  8212. * @type {boolean}
  8213. * @default false
  8214. */
  8215. invertVertical: false,
  8216. /**
  8217. * Milliseconds before the `changed.zf-slider` event is triggered after value change.
  8218. * @option
  8219. * @type {number}
  8220. * @default 500
  8221. */
  8222. changedDelay: 500,
  8223. /**
  8224. * Basevalue for non-linear sliders
  8225. * @option
  8226. * @type {number}
  8227. * @default 5
  8228. */
  8229. nonLinearBase: 5,
  8230. /**
  8231. * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting.
  8232. * @option
  8233. * @type {string}
  8234. * @default 'linear'
  8235. */
  8236. positionValueFunction: 'linear'
  8237. };
  8238. function percent(frac, num) {
  8239. return frac / num;
  8240. }
  8241. function absPosition($handle, dir, clickPos, param) {
  8242. return Math.abs($handle.position()[dir] + $handle[param]() / 2 - clickPos);
  8243. }
  8244. function baseLog(base, value) {
  8245. return Math.log(value) / Math.log(base);
  8246. }
  8247. /***/ }),
  8248. /***/ "./js/foundation.smoothScroll.js":
  8249. /*!***************************************!*\
  8250. !*** ./js/foundation.smoothScroll.js ***!
  8251. \***************************************/
  8252. /*! exports provided: SmoothScroll */
  8253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8254. "use strict";
  8255. __webpack_require__.r(__webpack_exports__);
  8256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return SmoothScroll; });
  8257. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  8258. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  8259. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  8260. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  8261. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8262. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8263. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8264. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8265. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8266. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8267. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8268. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8269. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8270. /**
  8271. * SmoothScroll module.
  8272. * @module foundation.smoothScroll
  8273. */
  8274. var SmoothScroll =
  8275. /*#__PURE__*/
  8276. function (_Plugin) {
  8277. _inherits(SmoothScroll, _Plugin);
  8278. function SmoothScroll() {
  8279. _classCallCheck(this, SmoothScroll);
  8280. return _possibleConstructorReturn(this, _getPrototypeOf(SmoothScroll).apply(this, arguments));
  8281. }
  8282. _createClass(SmoothScroll, [{
  8283. key: "_setup",
  8284. /**
  8285. * Creates a new instance of SmoothScroll.
  8286. * @class
  8287. * @name SmoothScroll
  8288. * @fires SmoothScroll#init
  8289. * @param {Object} element - jQuery object to add the trigger to.
  8290. * @param {Object} options - Overrides to the default plugin settings.
  8291. */
  8292. value: function _setup(element, options) {
  8293. this.$element = element;
  8294. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options);
  8295. this.className = 'SmoothScroll'; // ie9 back compat
  8296. this._init();
  8297. }
  8298. /**
  8299. * Initialize the SmoothScroll plugin
  8300. * @private
  8301. */
  8302. }, {
  8303. key: "_init",
  8304. value: function _init() {
  8305. var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'smooth-scroll');
  8306. this.$element.attr({
  8307. id: id
  8308. });
  8309. this._events();
  8310. }
  8311. /**
  8312. * Initializes events for SmoothScroll.
  8313. * @private
  8314. */
  8315. }, {
  8316. key: "_events",
  8317. value: function _events() {
  8318. this._linkClickListener = this._handleLinkClick.bind(this);
  8319. this.$element.on('click.zf.smoothScroll', this._linkClickListener);
  8320. this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
  8321. }
  8322. /**
  8323. * Handle the given event to smoothly scroll to the anchor pointed by the event target.
  8324. * @param {*} e - event
  8325. * @function
  8326. * @private
  8327. */
  8328. }, {
  8329. key: "_handleLinkClick",
  8330. value: function _handleLinkClick(e) {
  8331. var _this = this;
  8332. // Follow the link if it does not point to an anchor.
  8333. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget).is('a[href^="#"]')) return;
  8334. var arrival = e.currentTarget.getAttribute('href');
  8335. this._inTransition = true;
  8336. SmoothScroll.scrollToLoc(arrival, this.options, function () {
  8337. _this._inTransition = false;
  8338. });
  8339. e.preventDefault();
  8340. }
  8341. }, {
  8342. key: "_destroy",
  8343. /**
  8344. * Destroys the SmoothScroll instance.
  8345. * @function
  8346. */
  8347. value: function _destroy() {
  8348. this.$element.off('click.zf.smoothScroll', this._linkClickListener);
  8349. this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
  8350. }
  8351. }], [{
  8352. key: "scrollToLoc",
  8353. /**
  8354. * Function to scroll to a given location on the page.
  8355. * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'
  8356. * @param {Object} options - The options to use.
  8357. * @param {Function} callback - The callback function.
  8358. * @static
  8359. * @function
  8360. */
  8361. value: function scrollToLoc(loc) {
  8362. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults;
  8363. var callback = arguments.length > 2 ? arguments[2] : undefined;
  8364. var $loc = jquery__WEBPACK_IMPORTED_MODULE_0___default()(loc); // Do nothing if target does not exist to prevent errors
  8365. if (!$loc.length) return false;
  8366. var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset);
  8367. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({
  8368. scrollTop: scrollPos
  8369. }, options.animationDuration, options.animationEasing, function () {
  8370. if (typeof callback === 'function') {
  8371. callback();
  8372. }
  8373. });
  8374. }
  8375. }]);
  8376. return SmoothScroll;
  8377. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
  8378. /**
  8379. * Default settings for plugin.
  8380. */
  8381. SmoothScroll.defaults = {
  8382. /**
  8383. * Amount of time, in ms, the animated scrolling should take between locations.
  8384. * @option
  8385. * @type {number}
  8386. * @default 500
  8387. */
  8388. animationDuration: 500,
  8389. /**
  8390. * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
  8391. * @option
  8392. * @type {string}
  8393. * @default 'linear'
  8394. * @see {@link https://api.jquery.com/animate|Jquery animate}
  8395. */
  8396. animationEasing: 'linear',
  8397. /**
  8398. * Number of pixels to use as a marker for location changes.
  8399. * @option
  8400. * @type {number}
  8401. * @default 50
  8402. */
  8403. threshold: 50,
  8404. /**
  8405. * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
  8406. * @option
  8407. * @type {number}
  8408. * @default 0
  8409. */
  8410. offset: 0
  8411. };
  8412. /***/ }),
  8413. /***/ "./js/foundation.sticky.js":
  8414. /*!*********************************!*\
  8415. !*** ./js/foundation.sticky.js ***!
  8416. \*********************************/
  8417. /*! exports provided: Sticky */
  8418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8419. "use strict";
  8420. __webpack_require__.r(__webpack_exports__);
  8421. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return Sticky; });
  8422. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  8423. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  8424. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  8425. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  8426. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  8427. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  8428. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8429. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8430. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8431. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8432. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8433. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8434. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8435. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8436. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8437. /**
  8438. * Sticky module.
  8439. * @module foundation.sticky
  8440. * @requires foundation.util.triggers
  8441. * @requires foundation.util.mediaQuery
  8442. */
  8443. var Sticky =
  8444. /*#__PURE__*/
  8445. function (_Plugin) {
  8446. _inherits(Sticky, _Plugin);
  8447. function Sticky() {
  8448. _classCallCheck(this, Sticky);
  8449. return _possibleConstructorReturn(this, _getPrototypeOf(Sticky).apply(this, arguments));
  8450. }
  8451. _createClass(Sticky, [{
  8452. key: "_setup",
  8453. /**
  8454. * Creates a new instance of a sticky thing.
  8455. * @class
  8456. * @name Sticky
  8457. * @param {jQuery} element - jQuery object to make sticky.
  8458. * @param {Object} options - options object passed when creating the element programmatically.
  8459. */
  8460. value: function _setup(element, options) {
  8461. this.$element = element;
  8462. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Sticky.defaults, this.$element.data(), options);
  8463. this.className = 'Sticky'; // ie9 back compat
  8464. // Triggers init is idempotent, just need to make sure it is initialized
  8465. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  8466. this._init();
  8467. }
  8468. /**
  8469. * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes
  8470. * @function
  8471. * @private
  8472. */
  8473. }, {
  8474. key: "_init",
  8475. value: function _init() {
  8476. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init();
  8477. var $parent = this.$element.parent('[data-sticky-container]'),
  8478. id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'sticky'),
  8479. _this = this;
  8480. if ($parent.length) {
  8481. this.$container = $parent;
  8482. } else {
  8483. this.wasWrapped = true;
  8484. this.$element.wrap(this.options.container);
  8485. this.$container = this.$element.parent();
  8486. }
  8487. this.$container.addClass(this.options.containerClass);
  8488. this.$element.addClass(this.options.stickyClass).attr({
  8489. 'data-resize': id,
  8490. 'data-mutate': id
  8491. });
  8492. if (this.options.anchor !== '') {
  8493. jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor).attr({
  8494. 'data-mutate': id
  8495. });
  8496. }
  8497. this.scrollCount = this.options.checkEvery;
  8498. this.isStuck = false;
  8499. this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  8500. //We calculate the container height to have correct values for anchor points offset calculation.
  8501. _this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height;
  8502. _this.$container.css('height', _this.containerHeight);
  8503. _this.elemHeight = _this.containerHeight;
  8504. if (_this.options.anchor !== '') {
  8505. _this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor);
  8506. } else {
  8507. _this._parsePoints();
  8508. }
  8509. _this._setSizes(function () {
  8510. var scroll = window.pageYOffset;
  8511. _this._calc(false, scroll); //Unstick the element will ensure that proper classes are set.
  8512. if (!_this.isStuck) {
  8513. _this._removeSticky(scroll >= _this.topPoint ? false : true);
  8514. }
  8515. });
  8516. _this._events(id.split('-').reverse().join('-'));
  8517. });
  8518. }
  8519. /**
  8520. * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on.
  8521. * @function
  8522. * @private
  8523. */
  8524. }, {
  8525. key: "_parsePoints",
  8526. value: function _parsePoints() {
  8527. var top = this.options.topAnchor == "" ? 1 : this.options.topAnchor,
  8528. btm = this.options.btmAnchor == "" ? document.documentElement.scrollHeight : this.options.btmAnchor,
  8529. pts = [top, btm],
  8530. breaks = {};
  8531. for (var i = 0, len = pts.length; i < len && pts[i]; i++) {
  8532. var pt;
  8533. if (typeof pts[i] === 'number') {
  8534. pt = pts[i];
  8535. } else {
  8536. var place = pts[i].split(':'),
  8537. anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(place[0]));
  8538. pt = anchor.offset().top;
  8539. if (place[1] && place[1].toLowerCase() === 'bottom') {
  8540. pt += anchor[0].getBoundingClientRect().height;
  8541. }
  8542. }
  8543. breaks[i] = pt;
  8544. }
  8545. this.points = breaks;
  8546. return;
  8547. }
  8548. /**
  8549. * Adds event handlers for the scrolling element.
  8550. * @private
  8551. * @param {String} id - pseudo-random id for unique scroll event listener.
  8552. */
  8553. }, {
  8554. key: "_events",
  8555. value: function _events(id) {
  8556. var _this = this,
  8557. scrollListener = this.scrollListener = "scroll.zf.".concat(id);
  8558. if (this.isOn) {
  8559. return;
  8560. }
  8561. if (this.canStick) {
  8562. this.isOn = true;
  8563. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener).on(scrollListener, function (e) {
  8564. if (_this.scrollCount === 0) {
  8565. _this.scrollCount = _this.options.checkEvery;
  8566. _this._setSizes(function () {
  8567. _this._calc(false, window.pageYOffset);
  8568. });
  8569. } else {
  8570. _this.scrollCount--;
  8571. _this._calc(false, window.pageYOffset);
  8572. }
  8573. });
  8574. }
  8575. this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function (e, el) {
  8576. _this._eventsHandler(id);
  8577. });
  8578. this.$element.on('mutateme.zf.trigger', function (e, el) {
  8579. _this._eventsHandler(id);
  8580. });
  8581. if (this.$anchor) {
  8582. this.$anchor.on('mutateme.zf.trigger', function (e, el) {
  8583. _this._eventsHandler(id);
  8584. });
  8585. }
  8586. }
  8587. /**
  8588. * Handler for events.
  8589. * @private
  8590. * @param {String} id - pseudo-random id for unique scroll event listener.
  8591. */
  8592. }, {
  8593. key: "_eventsHandler",
  8594. value: function _eventsHandler(id) {
  8595. var _this = this,
  8596. scrollListener = this.scrollListener = "scroll.zf.".concat(id);
  8597. _this._setSizes(function () {
  8598. _this._calc(false);
  8599. if (_this.canStick) {
  8600. if (!_this.isOn) {
  8601. _this._events(id);
  8602. }
  8603. } else if (_this.isOn) {
  8604. _this._pauseListeners(scrollListener);
  8605. }
  8606. });
  8607. }
  8608. /**
  8609. * Removes event handlers for scroll and change events on anchor.
  8610. * @fires Sticky#pause
  8611. * @param {String} scrollListener - unique, namespaced scroll listener attached to `window`
  8612. */
  8613. }, {
  8614. key: "_pauseListeners",
  8615. value: function _pauseListeners(scrollListener) {
  8616. this.isOn = false;
  8617. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener);
  8618. /**
  8619. * Fires when the plugin is paused due to resize event shrinking the view.
  8620. * @event Sticky#pause
  8621. * @private
  8622. */
  8623. this.$element.trigger('pause.zf.sticky');
  8624. }
  8625. /**
  8626. * Called on every `scroll` event and on `_init`
  8627. * fires functions based on booleans and cached values
  8628. * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints.
  8629. * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`.
  8630. */
  8631. }, {
  8632. key: "_calc",
  8633. value: function _calc(checkSizes, scroll) {
  8634. if (checkSizes) {
  8635. this._setSizes();
  8636. }
  8637. if (!this.canStick) {
  8638. if (this.isStuck) {
  8639. this._removeSticky(true);
  8640. }
  8641. return false;
  8642. }
  8643. if (!scroll) {
  8644. scroll = window.pageYOffset;
  8645. }
  8646. if (scroll >= this.topPoint) {
  8647. if (scroll <= this.bottomPoint) {
  8648. if (!this.isStuck) {
  8649. this._setSticky();
  8650. }
  8651. } else {
  8652. if (this.isStuck) {
  8653. this._removeSticky(false);
  8654. }
  8655. }
  8656. } else {
  8657. if (this.isStuck) {
  8658. this._removeSticky(true);
  8659. }
  8660. }
  8661. }
  8662. /**
  8663. * Causes the $element to become stuck.
  8664. * Adds `position: fixed;`, and helper classes.
  8665. * @fires Sticky#stuckto
  8666. * @function
  8667. * @private
  8668. */
  8669. }, {
  8670. key: "_setSticky",
  8671. value: function _setSticky() {
  8672. var _this = this,
  8673. stickTo = this.options.stickTo,
  8674. mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom',
  8675. notStuckTo = stickTo === 'top' ? 'bottom' : 'top',
  8676. css = {};
  8677. css[mrgn] = "".concat(this.options[mrgn], "em");
  8678. css[stickTo] = 0;
  8679. css[notStuckTo] = 'auto';
  8680. this.isStuck = true;
  8681. this.$element.removeClass("is-anchored is-at-".concat(notStuckTo)).addClass("is-stuck is-at-".concat(stickTo)).css(css)
  8682. /**
  8683. * Fires when the $element has become `position: fixed;`
  8684. * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top`
  8685. * @event Sticky#stuckto
  8686. */
  8687. .trigger("sticky.zf.stuckto:".concat(stickTo));
  8688. this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function () {
  8689. _this._setSizes();
  8690. });
  8691. }
  8692. /**
  8693. * Causes the $element to become unstuck.
  8694. * Removes `position: fixed;`, and helper classes.
  8695. * Adds other helper classes.
  8696. * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element.
  8697. * @fires Sticky#unstuckfrom
  8698. * @private
  8699. */
  8700. }, {
  8701. key: "_removeSticky",
  8702. value: function _removeSticky(isTop) {
  8703. var stickTo = this.options.stickTo,
  8704. stickToTop = stickTo === 'top',
  8705. css = {},
  8706. anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight,
  8707. mrgn = stickToTop ? 'marginTop' : 'marginBottom',
  8708. topOrBottom = isTop ? 'top' : 'bottom';
  8709. css[mrgn] = 0;
  8710. css['bottom'] = 'auto';
  8711. if (isTop) {
  8712. css['top'] = 0;
  8713. } else {
  8714. css['top'] = anchorPt;
  8715. }
  8716. this.isStuck = false;
  8717. this.$element.removeClass("is-stuck is-at-".concat(stickTo)).addClass("is-anchored is-at-".concat(topOrBottom)).css(css)
  8718. /**
  8719. * Fires when the $element has become anchored.
  8720. * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom`
  8721. * @event Sticky#unstuckfrom
  8722. */
  8723. .trigger("sticky.zf.unstuckfrom:".concat(topOrBottom));
  8724. }
  8725. /**
  8726. * Sets the $element and $container sizes for plugin.
  8727. * Calls `_setBreakPoints`.
  8728. * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`.
  8729. * @private
  8730. */
  8731. }, {
  8732. key: "_setSizes",
  8733. value: function _setSizes(cb) {
  8734. this.canStick = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].is(this.options.stickyOn);
  8735. if (!this.canStick) {
  8736. if (cb && typeof cb === 'function') {
  8737. cb();
  8738. }
  8739. }
  8740. var _this = this,
  8741. newElemWidth = this.$container[0].getBoundingClientRect().width,
  8742. comp = window.getComputedStyle(this.$container[0]),
  8743. pdngl = parseInt(comp['padding-left'], 10),
  8744. pdngr = parseInt(comp['padding-right'], 10);
  8745. if (this.$anchor && this.$anchor.length) {
  8746. this.anchorHeight = this.$anchor[0].getBoundingClientRect().height;
  8747. } else {
  8748. this._parsePoints();
  8749. }
  8750. this.$element.css({
  8751. 'max-width': "".concat(newElemWidth - pdngl - pdngr, "px")
  8752. }); // Recalculate the height only if it is "dynamic"
  8753. if (this.options.dynamicHeight || !this.containerHeight) {
  8754. // Get the sticked element height and apply it to the container to "hold the place"
  8755. var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;
  8756. newContainerHeight = this.$element.css("display") == "none" ? 0 : newContainerHeight;
  8757. this.$container.css('height', newContainerHeight);
  8758. this.containerHeight = newContainerHeight;
  8759. }
  8760. this.elemHeight = this.containerHeight;
  8761. if (!this.isStuck) {
  8762. if (this.$element.hasClass('is-at-bottom')) {
  8763. var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;
  8764. this.$element.css('top', anchorPt);
  8765. }
  8766. }
  8767. this._setBreakPoints(this.containerHeight, function () {
  8768. if (cb && typeof cb === 'function') {
  8769. cb();
  8770. }
  8771. });
  8772. }
  8773. /**
  8774. * Sets the upper and lower breakpoints for the element to become sticky/unsticky.
  8775. * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`.
  8776. * @param {Function} cb - optional callback function to be called on completion.
  8777. * @private
  8778. */
  8779. }, {
  8780. key: "_setBreakPoints",
  8781. value: function _setBreakPoints(elemHeight, cb) {
  8782. if (!this.canStick) {
  8783. if (cb && typeof cb === 'function') {
  8784. cb();
  8785. } else {
  8786. return false;
  8787. }
  8788. }
  8789. var mTop = emCalc(this.options.marginTop),
  8790. mBtm = emCalc(this.options.marginBottom),
  8791. topPoint = this.points ? this.points[0] : this.$anchor.offset().top,
  8792. bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight,
  8793. // topPoint = this.$anchor.offset().top || this.points[0],
  8794. // bottomPoint = topPoint + this.anchorHeight || this.points[1],
  8795. winHeight = window.innerHeight;
  8796. if (this.options.stickTo === 'top') {
  8797. topPoint -= mTop;
  8798. bottomPoint -= elemHeight + mTop;
  8799. } else if (this.options.stickTo === 'bottom') {
  8800. topPoint -= winHeight - (elemHeight + mBtm);
  8801. bottomPoint -= winHeight - mBtm;
  8802. } else {//this would be the stickTo: both option... tricky
  8803. }
  8804. this.topPoint = topPoint;
  8805. this.bottomPoint = bottomPoint;
  8806. if (cb && typeof cb === 'function') {
  8807. cb();
  8808. }
  8809. }
  8810. /**
  8811. * Destroys the current sticky element.
  8812. * Resets the element to the top position first.
  8813. * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container.
  8814. * @function
  8815. */
  8816. }, {
  8817. key: "_destroy",
  8818. value: function _destroy() {
  8819. this._removeSticky(true);
  8820. this.$element.removeClass("".concat(this.options.stickyClass, " is-anchored is-at-top")).css({
  8821. height: '',
  8822. top: '',
  8823. bottom: '',
  8824. 'max-width': ''
  8825. }).off('resizeme.zf.trigger').off('mutateme.zf.trigger');
  8826. if (this.$anchor && this.$anchor.length) {
  8827. this.$anchor.off('change.zf.sticky');
  8828. }
  8829. if (this.scrollListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.scrollListener);
  8830. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  8831. if (this.wasWrapped) {
  8832. this.$element.unwrap();
  8833. } else {
  8834. this.$container.removeClass(this.options.containerClass).css({
  8835. height: ''
  8836. });
  8837. }
  8838. }
  8839. }]);
  8840. return Sticky;
  8841. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  8842. Sticky.defaults = {
  8843. /**
  8844. * Customizable container template. Add your own classes for styling and sizing.
  8845. * @option
  8846. * @type {string}
  8847. * @default '&lt;div data-sticky-container&gt;&lt;/div&gt;'
  8848. */
  8849. container: '<div data-sticky-container></div>',
  8850. /**
  8851. * Location in the view the element sticks to. Can be `'top'` or `'bottom'`.
  8852. * @option
  8853. * @type {string}
  8854. * @default 'top'
  8855. */
  8856. stickTo: 'top',
  8857. /**
  8858. * If anchored to a single element, the id of that element.
  8859. * @option
  8860. * @type {string}
  8861. * @default ''
  8862. */
  8863. anchor: '',
  8864. /**
  8865. * If using more than one element as anchor points, the id of the top anchor.
  8866. * @option
  8867. * @type {string}
  8868. * @default ''
  8869. */
  8870. topAnchor: '',
  8871. /**
  8872. * If using more than one element as anchor points, the id of the bottom anchor.
  8873. * @option
  8874. * @type {string}
  8875. * @default ''
  8876. */
  8877. btmAnchor: '',
  8878. /**
  8879. * Margin, in `em`'s to apply to the top of the element when it becomes sticky.
  8880. * @option
  8881. * @type {number}
  8882. * @default 1
  8883. */
  8884. marginTop: 1,
  8885. /**
  8886. * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky.
  8887. * @option
  8888. * @type {number}
  8889. * @default 1
  8890. */
  8891. marginBottom: 1,
  8892. /**
  8893. * Breakpoint string that is the minimum screen size an element should become sticky.
  8894. * @option
  8895. * @type {string}
  8896. * @default 'medium'
  8897. */
  8898. stickyOn: 'medium',
  8899. /**
  8900. * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`.
  8901. * @option
  8902. * @type {string}
  8903. * @default 'sticky'
  8904. */
  8905. stickyClass: 'sticky',
  8906. /**
  8907. * Class applied to sticky container. Foundation defaults to `sticky-container`.
  8908. * @option
  8909. * @type {string}
  8910. * @default 'sticky-container'
  8911. */
  8912. containerClass: 'sticky-container',
  8913. /**
  8914. * If true (by default), keep the sticky container the same height as the element. Otherwise, the container height is set once and does not change.
  8915. * @option
  8916. * @type {boolean}
  8917. * @default true
  8918. */
  8919. dynamicHeight: true,
  8920. /**
  8921. * Number of scroll events between the plugin's recalculating sticky points. Setting it to `0` will cause it to recalc every scroll event, setting it to `-1` will prevent recalc on scroll.
  8922. * @option
  8923. * @type {number}
  8924. * @default -1
  8925. */
  8926. checkEvery: -1
  8927. };
  8928. /**
  8929. * Helper function to calculate em values
  8930. * @param Number {em} - number of em's to calculate into pixels
  8931. */
  8932. function emCalc(em) {
  8933. return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em;
  8934. }
  8935. /***/ }),
  8936. /***/ "./js/foundation.tabs.js":
  8937. /*!*******************************!*\
  8938. !*** ./js/foundation.tabs.js ***!
  8939. \*******************************/
  8940. /*! exports provided: Tabs */
  8941. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8942. "use strict";
  8943. __webpack_require__.r(__webpack_exports__);
  8944. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return Tabs; });
  8945. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  8946. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  8947. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  8948. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  8949. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  8950. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  8951. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8952. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8953. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8954. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8955. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8956. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8957. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8958. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8959. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8960. /**
  8961. * Tabs module.
  8962. * @module foundation.tabs
  8963. * @requires foundation.util.keyboard
  8964. * @requires foundation.util.imageLoader if tabs contain images
  8965. */
  8966. var Tabs =
  8967. /*#__PURE__*/
  8968. function (_Plugin) {
  8969. _inherits(Tabs, _Plugin);
  8970. function Tabs() {
  8971. _classCallCheck(this, Tabs);
  8972. return _possibleConstructorReturn(this, _getPrototypeOf(Tabs).apply(this, arguments));
  8973. }
  8974. _createClass(Tabs, [{
  8975. key: "_setup",
  8976. /**
  8977. * Creates a new instance of tabs.
  8978. * @class
  8979. * @name Tabs
  8980. * @fires Tabs#init
  8981. * @param {jQuery} element - jQuery object to make into tabs.
  8982. * @param {Object} options - Overrides to the default plugin settings.
  8983. */
  8984. value: function _setup(element, options) {
  8985. this.$element = element;
  8986. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tabs.defaults, this.$element.data(), options);
  8987. this.className = 'Tabs'; // ie9 back compat
  8988. this._init();
  8989. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Tabs', {
  8990. 'ENTER': 'open',
  8991. 'SPACE': 'open',
  8992. 'ARROW_RIGHT': 'next',
  8993. 'ARROW_UP': 'previous',
  8994. 'ARROW_DOWN': 'next',
  8995. 'ARROW_LEFT': 'previous' // 'TAB': 'next',
  8996. // 'SHIFT_TAB': 'previous'
  8997. });
  8998. }
  8999. /**
  9000. * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab.
  9001. * @private
  9002. */
  9003. }, {
  9004. key: "_init",
  9005. value: function _init() {
  9006. var _this2 = this;
  9007. var _this = this;
  9008. this._isInitializing = true;
  9009. this.$element.attr({
  9010. 'role': 'tablist'
  9011. });
  9012. this.$tabTitles = this.$element.find(".".concat(this.options.linkClass));
  9013. this.$tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-tabs-content=\"".concat(this.$element[0].id, "\"]"));
  9014. this.$tabTitles.each(function () {
  9015. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  9016. $link = $elem.find('a'),
  9017. isActive = $elem.hasClass("".concat(_this.options.linkActiveClass)),
  9018. hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1),
  9019. linkId = $link[0].id ? $link[0].id : "".concat(hash, "-label"),
  9020. $tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(hash));
  9021. $elem.attr({
  9022. 'role': 'presentation'
  9023. });
  9024. $link.attr({
  9025. 'role': 'tab',
  9026. 'aria-controls': hash,
  9027. 'aria-selected': isActive,
  9028. 'id': linkId,
  9029. 'tabindex': isActive ? '0' : '-1'
  9030. });
  9031. $tabContent.attr({
  9032. 'role': 'tabpanel',
  9033. 'aria-labelledby': linkId
  9034. }); // Save up the initial hash to return to it later when going back in history
  9035. if (isActive) {
  9036. _this._initialAnchor = "#".concat(hash);
  9037. }
  9038. if (!isActive) {
  9039. $tabContent.attr('aria-hidden', 'true');
  9040. }
  9041. if (isActive && _this.options.autoFocus) {
  9042. _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  9043. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
  9044. scrollTop: $elem.offset().top
  9045. }, _this.options.deepLinkSmudgeDelay, function () {
  9046. $link.focus();
  9047. });
  9048. });
  9049. }
  9050. });
  9051. if (this.options.matchHeight) {
  9052. var $images = this.$tabContent.find('img');
  9053. if ($images.length) {
  9054. Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._setHeight.bind(this));
  9055. } else {
  9056. this._setHeight();
  9057. }
  9058. } // Current context-bound function to open tabs on page load or history hashchange
  9059. this._checkDeepLink = function () {
  9060. var anchor = window.location.hash;
  9061. if (!anchor.length) {
  9062. // If we are still initializing and there is no anchor, then there is nothing to do
  9063. if (_this2._isInitializing) return; // Otherwise, move to the initial anchor
  9064. if (_this2._initialAnchor) anchor = _this2._initialAnchor;
  9065. }
  9066. var anchorNoHash = anchor.indexOf('#') >= 0 ? anchor.slice(1) : anchor;
  9067. var $anchor = anchorNoHash && jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(anchorNoHash));
  9068. var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"],[data-tabs-target=\"").concat(anchorNoHash, "\"]")).first(); // Whether the anchor element that has been found is part of this element
  9069. var isOwnAnchor = !!($anchor.length && $link.length);
  9070. if (isOwnAnchor) {
  9071. // If there is an anchor for the hash, select it
  9072. if ($anchor && $anchor.length && $link && $link.length) {
  9073. _this2.selectTab($anchor, true);
  9074. } // Otherwise, collapse everything
  9075. else {
  9076. _this2._collapse();
  9077. } // Roll up a little to show the titles
  9078. if (_this2.options.deepLinkSmudge) {
  9079. var offset = _this2.$element.offset();
  9080. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
  9081. scrollTop: offset.top
  9082. }, _this2.options.deepLinkSmudgeDelay);
  9083. }
  9084. /**
  9085. * Fires when the plugin has deeplinked at pageload
  9086. * @event Tabs#deeplink
  9087. */
  9088. _this2.$element.trigger('deeplink.zf.tabs', [$link, $anchor]);
  9089. }
  9090. }; //use browser to open a tab, if it exists in this tabset
  9091. if (this.options.deepLink) {
  9092. this._checkDeepLink();
  9093. }
  9094. this._events();
  9095. this._isInitializing = false;
  9096. }
  9097. /**
  9098. * Adds event handlers for items within the tabs.
  9099. * @private
  9100. */
  9101. }, {
  9102. key: "_events",
  9103. value: function _events() {
  9104. this._addKeyHandler();
  9105. this._addClickHandler();
  9106. this._setHeightMqHandler = null;
  9107. if (this.options.matchHeight) {
  9108. this._setHeightMqHandler = this._setHeight.bind(this);
  9109. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler);
  9110. }
  9111. if (this.options.deepLink) {
  9112. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink);
  9113. }
  9114. }
  9115. /**
  9116. * Adds click handlers for items within the tabs.
  9117. * @private
  9118. */
  9119. }, {
  9120. key: "_addClickHandler",
  9121. value: function _addClickHandler() {
  9122. var _this = this;
  9123. this.$element.off('click.zf.tabs').on('click.zf.tabs', ".".concat(this.options.linkClass), function (e) {
  9124. e.preventDefault();
  9125. _this._handleTabChange(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  9126. });
  9127. }
  9128. /**
  9129. * Adds keyboard event handlers for items within the tabs.
  9130. * @private
  9131. */
  9132. }, {
  9133. key: "_addKeyHandler",
  9134. value: function _addKeyHandler() {
  9135. var _this = this;
  9136. this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) {
  9137. if (e.which === 9) return;
  9138. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  9139. $elements = $element.parent('ul').children('li'),
  9140. $prevElement,
  9141. $nextElement;
  9142. $elements.each(function (i) {
  9143. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  9144. if (_this.options.wrapOnKeys) {
  9145. $prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1);
  9146. $nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1);
  9147. } else {
  9148. $prevElement = $elements.eq(Math.max(0, i - 1));
  9149. $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
  9150. }
  9151. return;
  9152. }
  9153. }); // handle keyboard event with keyboard util
  9154. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Tabs', {
  9155. open: function open() {
  9156. $element.find('[role="tab"]').focus();
  9157. _this._handleTabChange($element);
  9158. },
  9159. previous: function previous() {
  9160. $prevElement.find('[role="tab"]').focus();
  9161. _this._handleTabChange($prevElement);
  9162. },
  9163. next: function next() {
  9164. $nextElement.find('[role="tab"]').focus();
  9165. _this._handleTabChange($nextElement);
  9166. },
  9167. handled: function handled() {
  9168. e.preventDefault();
  9169. }
  9170. });
  9171. });
  9172. }
  9173. /**
  9174. * Opens the tab `$targetContent` defined by `$target`. Collapses active tab.
  9175. * @param {jQuery} $target - Tab to open.
  9176. * @param {boolean} historyHandled - browser has already handled a history update
  9177. * @fires Tabs#change
  9178. * @function
  9179. */
  9180. }, {
  9181. key: "_handleTabChange",
  9182. value: function _handleTabChange($target, historyHandled) {
  9183. // With `activeCollapse`, if the target is the active Tab, collapse it.
  9184. if ($target.hasClass("".concat(this.options.linkActiveClass))) {
  9185. if (this.options.activeCollapse) {
  9186. this._collapse();
  9187. }
  9188. return;
  9189. }
  9190. var $oldTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)),
  9191. $tabLink = $target.find('[role="tab"]'),
  9192. target = $tabLink.attr('data-tabs-target'),
  9193. anchor = target && target.length ? "#".concat(target) : $tabLink[0].hash,
  9194. $targetContent = this.$tabContent.find(anchor); //close old tab
  9195. this._collapseTab($oldTab); //open new tab
  9196. this._openTab($target); //either replace or update browser history
  9197. if (this.options.deepLink && !historyHandled) {
  9198. if (this.options.updateHistory) {
  9199. history.pushState({}, '', anchor);
  9200. } else {
  9201. history.replaceState({}, '', anchor);
  9202. }
  9203. }
  9204. /**
  9205. * Fires when the plugin has successfully changed tabs.
  9206. * @event Tabs#change
  9207. */
  9208. this.$element.trigger('change.zf.tabs', [$target, $targetContent]); //fire to children a mutation event
  9209. $targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger");
  9210. }
  9211. /**
  9212. * Opens the tab `$targetContent` defined by `$target`.
  9213. * @param {jQuery} $target - Tab to open.
  9214. * @function
  9215. */
  9216. }, {
  9217. key: "_openTab",
  9218. value: function _openTab($target) {
  9219. var $tabLink = $target.find('[role="tab"]'),
  9220. hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1),
  9221. $targetContent = this.$tabContent.find("#".concat(hash));
  9222. $target.addClass("".concat(this.options.linkActiveClass));
  9223. $tabLink.attr({
  9224. 'aria-selected': 'true',
  9225. 'tabindex': '0'
  9226. });
  9227. $targetContent.addClass("".concat(this.options.panelActiveClass)).removeAttr('aria-hidden');
  9228. }
  9229. /**
  9230. * Collapses `$targetContent` defined by `$target`.
  9231. * @param {jQuery} $target - Tab to collapse.
  9232. * @function
  9233. */
  9234. }, {
  9235. key: "_collapseTab",
  9236. value: function _collapseTab($target) {
  9237. var $target_anchor = $target.removeClass("".concat(this.options.linkActiveClass)).find('[role="tab"]').attr({
  9238. 'aria-selected': 'false',
  9239. 'tabindex': -1
  9240. });
  9241. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat($target_anchor.attr('aria-controls'))).removeClass("".concat(this.options.panelActiveClass)).attr({
  9242. 'aria-hidden': 'true'
  9243. });
  9244. }
  9245. /**
  9246. * Collapses the active Tab.
  9247. * @fires Tabs#collapse
  9248. * @function
  9249. */
  9250. }, {
  9251. key: "_collapse",
  9252. value: function _collapse() {
  9253. var $activeTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass));
  9254. if ($activeTab.length) {
  9255. this._collapseTab($activeTab);
  9256. /**
  9257. * Fires when the plugin has successfully collapsed tabs.
  9258. * @event Tabs#collapse
  9259. */
  9260. this.$element.trigger('collapse.zf.tabs', [$activeTab]);
  9261. }
  9262. }
  9263. /**
  9264. * Public method for selecting a content pane to display.
  9265. * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display.
  9266. * @param {boolean} historyHandled - browser has already handled a history update
  9267. * @function
  9268. */
  9269. }, {
  9270. key: "selectTab",
  9271. value: function selectTab(elem, historyHandled) {
  9272. var idStr, hashIdStr;
  9273. if (_typeof(elem) === 'object') {
  9274. idStr = elem[0].id;
  9275. } else {
  9276. idStr = elem;
  9277. }
  9278. if (idStr.indexOf('#') < 0) {
  9279. hashIdStr = "#".concat(idStr);
  9280. } else {
  9281. hashIdStr = idStr;
  9282. idStr = idStr.slice(1);
  9283. }
  9284. var $target = this.$tabTitles.has("[href$=\"".concat(hashIdStr, "\"],[data-tabs-target=\"").concat(idStr, "\"]")).first();
  9285. this._handleTabChange($target, historyHandled);
  9286. }
  9287. }, {
  9288. key: "_setHeight",
  9289. /**
  9290. * Sets the height of each panel to the height of the tallest panel.
  9291. * If enabled in options, gets called on media query change.
  9292. * If loading content via external source, can be called directly or with _reflow.
  9293. * If enabled with `data-match-height="true"`, tabs sets to equal height
  9294. * @function
  9295. * @private
  9296. */
  9297. value: function _setHeight() {
  9298. var max = 0,
  9299. _this = this; // Lock down the `this` value for the root tabs object
  9300. this.$tabContent.find(".".concat(this.options.panelClass)).css('height', '').each(function () {
  9301. var panel = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  9302. isActive = panel.hasClass("".concat(_this.options.panelActiveClass)); // get the options from the parent instead of trying to get them from the child
  9303. if (!isActive) {
  9304. panel.css({
  9305. 'visibility': 'hidden',
  9306. 'display': 'block'
  9307. });
  9308. }
  9309. var temp = this.getBoundingClientRect().height;
  9310. if (!isActive) {
  9311. panel.css({
  9312. 'visibility': '',
  9313. 'display': ''
  9314. });
  9315. }
  9316. max = temp > max ? temp : max;
  9317. }).css('height', "".concat(max, "px"));
  9318. }
  9319. /**
  9320. * Destroys an instance of tabs.
  9321. * @fires Tabs#destroyed
  9322. */
  9323. }, {
  9324. key: "_destroy",
  9325. value: function _destroy() {
  9326. this.$element.find(".".concat(this.options.linkClass)).off('.zf.tabs').hide().end().find(".".concat(this.options.panelClass)).hide();
  9327. if (this.options.matchHeight) {
  9328. if (this._setHeightMqHandler != null) {
  9329. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler);
  9330. }
  9331. }
  9332. if (this.options.deepLink) {
  9333. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink);
  9334. }
  9335. if (this.onLoadListener) {
  9336. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  9337. }
  9338. }
  9339. }]);
  9340. return Tabs;
  9341. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  9342. Tabs.defaults = {
  9343. /**
  9344. * Link the location hash to the active pane.
  9345. * Set the location hash when the active pane changes, and open the corresponding pane when the location changes.
  9346. * @option
  9347. * @type {boolean}
  9348. * @default false
  9349. */
  9350. deepLink: false,
  9351. /**
  9352. * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible
  9353. * @option
  9354. * @type {boolean}
  9355. * @default false
  9356. */
  9357. deepLinkSmudge: false,
  9358. /**
  9359. * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment
  9360. * @option
  9361. * @type {number}
  9362. * @default 300
  9363. */
  9364. deepLinkSmudgeDelay: 300,
  9365. /**
  9366. * If `deepLink` is enabled, update the browser history with the open tab
  9367. * @option
  9368. * @type {boolean}
  9369. * @default false
  9370. */
  9371. updateHistory: false,
  9372. /**
  9373. * Allows the window to scroll to content of active pane on load.
  9374. * Not recommended if more than one tab panel per page.
  9375. * @option
  9376. * @type {boolean}
  9377. * @default false
  9378. */
  9379. autoFocus: false,
  9380. /**
  9381. * Allows keyboard input to 'wrap' around the tab links.
  9382. * @option
  9383. * @type {boolean}
  9384. * @default true
  9385. */
  9386. wrapOnKeys: true,
  9387. /**
  9388. * Allows the tab content panes to match heights if set to true.
  9389. * @option
  9390. * @type {boolean}
  9391. * @default false
  9392. */
  9393. matchHeight: false,
  9394. /**
  9395. * Allows active tabs to collapse when clicked.
  9396. * @option
  9397. * @type {boolean}
  9398. * @default false
  9399. */
  9400. activeCollapse: false,
  9401. /**
  9402. * Class applied to `li`'s in tab link list.
  9403. * @option
  9404. * @type {string}
  9405. * @default 'tabs-title'
  9406. */
  9407. linkClass: 'tabs-title',
  9408. /**
  9409. * Class applied to the active `li` in tab link list.
  9410. * @option
  9411. * @type {string}
  9412. * @default 'is-active'
  9413. */
  9414. linkActiveClass: 'is-active',
  9415. /**
  9416. * Class applied to the content containers.
  9417. * @option
  9418. * @type {string}
  9419. * @default 'tabs-panel'
  9420. */
  9421. panelClass: 'tabs-panel',
  9422. /**
  9423. * Class applied to the active content container.
  9424. * @option
  9425. * @type {string}
  9426. * @default 'is-active'
  9427. */
  9428. panelActiveClass: 'is-active'
  9429. };
  9430. /***/ }),
  9431. /***/ "./js/foundation.toggler.js":
  9432. /*!**********************************!*\
  9433. !*** ./js/foundation.toggler.js ***!
  9434. \**********************************/
  9435. /*! exports provided: Toggler */
  9436. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9437. "use strict";
  9438. __webpack_require__.r(__webpack_exports__);
  9439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return Toggler; });
  9440. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  9441. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  9442. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  9443. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  9444. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  9445. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  9446. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9447. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9448. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9449. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  9450. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  9451. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9452. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  9453. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  9454. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  9455. /**
  9456. * Toggler module.
  9457. * @module foundation.toggler
  9458. * @requires foundation.util.motion
  9459. * @requires foundation.util.triggers
  9460. */
  9461. var Toggler =
  9462. /*#__PURE__*/
  9463. function (_Plugin) {
  9464. _inherits(Toggler, _Plugin);
  9465. function Toggler() {
  9466. _classCallCheck(this, Toggler);
  9467. return _possibleConstructorReturn(this, _getPrototypeOf(Toggler).apply(this, arguments));
  9468. }
  9469. _createClass(Toggler, [{
  9470. key: "_setup",
  9471. /**
  9472. * Creates a new instance of Toggler.
  9473. * @class
  9474. * @name Toggler
  9475. * @fires Toggler#init
  9476. * @param {Object} element - jQuery object to add the trigger to.
  9477. * @param {Object} options - Overrides to the default plugin settings.
  9478. */
  9479. value: function _setup(element, options) {
  9480. this.$element = element;
  9481. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Toggler.defaults, element.data(), options);
  9482. this.className = '';
  9483. this.className = 'Toggler'; // ie9 back compat
  9484. // Triggers init is idempotent, just need to make sure it is initialized
  9485. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  9486. this._init();
  9487. this._events();
  9488. }
  9489. /**
  9490. * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate.
  9491. * @function
  9492. * @private
  9493. */
  9494. }, {
  9495. key: "_init",
  9496. value: function _init() {
  9497. // Collect triggers to set ARIA attributes to
  9498. var id = this.$element[0].id,
  9499. $triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open~=\"".concat(id, "\"], [data-close~=\"").concat(id, "\"], [data-toggle~=\"").concat(id, "\"]"));
  9500. var input; // Parse animation classes if they were set
  9501. if (this.options.animate) {
  9502. input = this.options.animate.split(' ');
  9503. this.animationIn = input[0];
  9504. this.animationOut = input[1] || null; // - aria-expanded: according to the element visibility.
  9505. $triggers.attr('aria-expanded', !this.$element.is(':hidden'));
  9506. } // Otherwise, parse toggle class
  9507. else {
  9508. input = this.options.toggler;
  9509. if (typeof input !== 'string' || !input.length) {
  9510. throw new Error("The 'toogler' option containing the target class is required, got \"".concat(input, "\""));
  9511. } // Allow for a . at the beginning of the string
  9512. this.className = input[0] === '.' ? input.slice(1) : input; // - aria-expanded: according to the elements class set.
  9513. $triggers.attr('aria-expanded', this.$element.hasClass(this.className));
  9514. } // - aria-controls: adding the element id to it if not already in it.
  9515. $triggers.each(function (index, trigger) {
  9516. var $trigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(trigger);
  9517. var controls = $trigger.attr('aria-controls') || '';
  9518. var containsId = new RegExp("\\b".concat(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["RegExpEscape"])(id), "\\b")).test(controls);
  9519. if (!containsId) $trigger.attr('aria-controls', controls ? "".concat(controls, " ").concat(id) : id);
  9520. });
  9521. }
  9522. /**
  9523. * Initializes events for the toggle trigger.
  9524. * @function
  9525. * @private
  9526. */
  9527. }, {
  9528. key: "_events",
  9529. value: function _events() {
  9530. this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this));
  9531. }
  9532. /**
  9533. * Toggles the target class on the target element. An event is fired from the original trigger depending on if the resultant state was "on" or "off".
  9534. * @function
  9535. * @fires Toggler#on
  9536. * @fires Toggler#off
  9537. */
  9538. }, {
  9539. key: "toggle",
  9540. value: function toggle() {
  9541. this[this.options.animate ? '_toggleAnimate' : '_toggleClass']();
  9542. }
  9543. }, {
  9544. key: "_toggleClass",
  9545. value: function _toggleClass() {
  9546. this.$element.toggleClass(this.className);
  9547. var isOn = this.$element.hasClass(this.className);
  9548. if (isOn) {
  9549. /**
  9550. * Fires if the target element has the class after a toggle.
  9551. * @event Toggler#on
  9552. */
  9553. this.$element.trigger('on.zf.toggler');
  9554. } else {
  9555. /**
  9556. * Fires if the target element does not have the class after a toggle.
  9557. * @event Toggler#off
  9558. */
  9559. this.$element.trigger('off.zf.toggler');
  9560. }
  9561. this._updateARIA(isOn);
  9562. this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger');
  9563. }
  9564. }, {
  9565. key: "_toggleAnimate",
  9566. value: function _toggleAnimate() {
  9567. var _this = this;
  9568. if (this.$element.is(':hidden')) {
  9569. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateIn(this.$element, this.animationIn, function () {
  9570. _this._updateARIA(true);
  9571. this.trigger('on.zf.toggler');
  9572. this.find('[data-mutate]').trigger('mutateme.zf.trigger');
  9573. });
  9574. } else {
  9575. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateOut(this.$element, this.animationOut, function () {
  9576. _this._updateARIA(false);
  9577. this.trigger('off.zf.toggler');
  9578. this.find('[data-mutate]').trigger('mutateme.zf.trigger');
  9579. });
  9580. }
  9581. }
  9582. }, {
  9583. key: "_updateARIA",
  9584. value: function _updateARIA(isOn) {
  9585. var id = this.$element[0].id;
  9586. jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(id, "\"], [data-close=\"").concat(id, "\"], [data-toggle=\"").concat(id, "\"]")).attr({
  9587. 'aria-expanded': isOn ? true : false
  9588. });
  9589. }
  9590. /**
  9591. * Destroys the instance of Toggler on the element.
  9592. * @function
  9593. */
  9594. }, {
  9595. key: "_destroy",
  9596. value: function _destroy() {
  9597. this.$element.off('.zf.toggler');
  9598. }
  9599. }]);
  9600. return Toggler;
  9601. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
  9602. Toggler.defaults = {
  9603. /**
  9604. * Class of the element to toggle. It can be provided with or without "."
  9605. * @option
  9606. * @type {string}
  9607. */
  9608. toggler: undefined,
  9609. /**
  9610. * Tells the plugin if the element should animated when toggled.
  9611. * @option
  9612. * @type {boolean}
  9613. * @default false
  9614. */
  9615. animate: false
  9616. };
  9617. /***/ }),
  9618. /***/ "./js/foundation.tooltip.js":
  9619. /*!**********************************!*\
  9620. !*** ./js/foundation.tooltip.js ***!
  9621. \**********************************/
  9622. /*! exports provided: Tooltip */
  9623. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9624. "use strict";
  9625. __webpack_require__.r(__webpack_exports__);
  9626. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; });
  9627. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  9628. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  9629. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  9630. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  9631. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  9632. /* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js");
  9633. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9634. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9635. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9636. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  9637. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  9638. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9639. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  9640. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  9641. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  9642. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  9643. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  9644. /**
  9645. * Tooltip module.
  9646. * @module foundation.tooltip
  9647. * @requires foundation.util.box
  9648. * @requires foundation.util.mediaQuery
  9649. * @requires foundation.util.triggers
  9650. */
  9651. var Tooltip =
  9652. /*#__PURE__*/
  9653. function (_Positionable) {
  9654. _inherits(Tooltip, _Positionable);
  9655. function Tooltip() {
  9656. _classCallCheck(this, Tooltip);
  9657. return _possibleConstructorReturn(this, _getPrototypeOf(Tooltip).apply(this, arguments));
  9658. }
  9659. _createClass(Tooltip, [{
  9660. key: "_setup",
  9661. /**
  9662. * Creates a new instance of a Tooltip.
  9663. * @class
  9664. * @name Tooltip
  9665. * @fires Tooltip#init
  9666. * @param {jQuery} element - jQuery object to attach a tooltip to.
  9667. * @param {Object} options - object to extend the default configuration.
  9668. */
  9669. value: function _setup(element, options) {
  9670. this.$element = element;
  9671. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tooltip.defaults, this.$element.data(), options);
  9672. this.className = 'Tooltip'; // ie9 back compat
  9673. this.isActive = false;
  9674. this.isClick = false; // Triggers init is idempotent, just need to make sure it is initialized
  9675. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  9676. this._init();
  9677. }
  9678. /**
  9679. * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor.
  9680. * @private
  9681. */
  9682. }, {
  9683. key: "_init",
  9684. value: function _init() {
  9685. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init();
  9686. var elemId = this.$element.attr('aria-describedby') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'tooltip');
  9687. this.options.tipText = this.options.tipText || this.$element.attr('title');
  9688. this.template = this.options.template ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.template) : this._buildTemplate(elemId);
  9689. if (this.options.allowHtml) {
  9690. this.template.appendTo(document.body).html(this.options.tipText).hide();
  9691. } else {
  9692. this.template.appendTo(document.body).text(this.options.tipText).hide();
  9693. }
  9694. this.$element.attr({
  9695. 'title': '',
  9696. 'aria-describedby': elemId,
  9697. 'data-yeti-box': elemId,
  9698. 'data-toggle': elemId,
  9699. 'data-resize': elemId
  9700. }).addClass(this.options.triggerClass);
  9701. _get(_getPrototypeOf(Tooltip.prototype), "_init", this).call(this);
  9702. this._events();
  9703. }
  9704. }, {
  9705. key: "_getDefaultPosition",
  9706. value: function _getDefaultPosition() {
  9707. // handle legacy classnames
  9708. var elementClassName = this.$element[0].className;
  9709. if (this.$element[0] instanceof SVGElement) {
  9710. elementClassName = elementClassName.baseVal;
  9711. }
  9712. var position = elementClassName.match(/\b(top|left|right|bottom)\b/g);
  9713. return position ? position[0] : 'top';
  9714. }
  9715. }, {
  9716. key: "_getDefaultAlignment",
  9717. value: function _getDefaultAlignment() {
  9718. return 'center';
  9719. }
  9720. }, {
  9721. key: "_getHOffset",
  9722. value: function _getHOffset() {
  9723. if (this.position === 'left' || this.position === 'right') {
  9724. return this.options.hOffset + this.options.tooltipWidth;
  9725. } else {
  9726. return this.options.hOffset;
  9727. }
  9728. }
  9729. }, {
  9730. key: "_getVOffset",
  9731. value: function _getVOffset() {
  9732. if (this.position === 'top' || this.position === 'bottom') {
  9733. return this.options.vOffset + this.options.tooltipHeight;
  9734. } else {
  9735. return this.options.vOffset;
  9736. }
  9737. }
  9738. /**
  9739. * builds the tooltip element, adds attributes, and returns the template.
  9740. * @private
  9741. */
  9742. }, {
  9743. key: "_buildTemplate",
  9744. value: function _buildTemplate(id) {
  9745. var templateClasses = "".concat(this.options.tooltipClass, " ").concat(this.options.templateClasses).trim();
  9746. var $template = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass(templateClasses).attr({
  9747. 'role': 'tooltip',
  9748. 'aria-hidden': true,
  9749. 'data-is-active': false,
  9750. 'data-is-focus': false,
  9751. 'id': id
  9752. });
  9753. return $template;
  9754. }
  9755. /**
  9756. * sets the position class of an element and recursively calls itself until there are no more possible positions to attempt, or the tooltip element is no longer colliding.
  9757. * if the tooltip is larger than the screen width, default to full width - any user selected margin
  9758. * @private
  9759. */
  9760. }, {
  9761. key: "_setPosition",
  9762. value: function _setPosition() {
  9763. _get(_getPrototypeOf(Tooltip.prototype), "_setPosition", this).call(this, this.$element, this.template);
  9764. }
  9765. /**
  9766. * reveals the tooltip, and fires an event to close any other open tooltips on the page
  9767. * @fires Tooltip#closeme
  9768. * @fires Tooltip#show
  9769. * @function
  9770. */
  9771. }, {
  9772. key: "show",
  9773. value: function show() {
  9774. if (this.options.showOn !== 'all' && !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.showOn)) {
  9775. // console.error('The screen is too small to display this tooltip');
  9776. return false;
  9777. }
  9778. var _this = this;
  9779. this.template.css('visibility', 'hidden').show();
  9780. this._setPosition();
  9781. this.template.removeClass('top bottom left right').addClass(this.position);
  9782. this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment);
  9783. /**
  9784. * Fires to close all other open tooltips on the page
  9785. * @event Closeme#tooltip
  9786. */
  9787. this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));
  9788. this.template.attr({
  9789. 'data-is-active': true,
  9790. 'aria-hidden': false
  9791. });
  9792. _this.isActive = true; // console.log(this.template);
  9793. this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function () {//maybe do stuff?
  9794. });
  9795. /**
  9796. * Fires when the tooltip is shown
  9797. * @event Tooltip#show
  9798. */
  9799. this.$element.trigger('show.zf.tooltip');
  9800. }
  9801. /**
  9802. * Hides the current tooltip, and resets the positioning class if it was changed due to collision
  9803. * @fires Tooltip#hide
  9804. * @function
  9805. */
  9806. }, {
  9807. key: "hide",
  9808. value: function hide() {
  9809. // console.log('hiding', this.$element.data('yeti-box'));
  9810. var _this = this;
  9811. this.template.stop().attr({
  9812. 'aria-hidden': true,
  9813. 'data-is-active': false
  9814. }).fadeOut(this.options.fadeOutDuration, function () {
  9815. _this.isActive = false;
  9816. _this.isClick = false;
  9817. });
  9818. /**
  9819. * fires when the tooltip is hidden
  9820. * @event Tooltip#hide
  9821. */
  9822. this.$element.trigger('hide.zf.tooltip');
  9823. }
  9824. /**
  9825. * adds event listeners for the tooltip and its anchor
  9826. * TODO combine some of the listeners like focus and mouseenter, etc.
  9827. * @private
  9828. */
  9829. }, {
  9830. key: "_events",
  9831. value: function _events() {
  9832. var _this = this;
  9833. var hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined';
  9834. var $template = this.template;
  9835. var isFocus = false; // `disableForTouch: Fully disable the tooltip on touch devices
  9836. if (hasTouch && this.options.disableForTouch) return;
  9837. if (!this.options.disableHover) {
  9838. this.$element.on('mouseenter.zf.tooltip', function (e) {
  9839. if (!_this.isActive) {
  9840. _this.timeout = setTimeout(function () {
  9841. _this.show();
  9842. }, _this.options.hoverDelay);
  9843. }
  9844. }).on('mouseleave.zf.tooltip', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["ignoreMousedisappear"])(function (e) {
  9845. clearTimeout(_this.timeout);
  9846. if (!isFocus || _this.isClick && !_this.options.clickOpen) {
  9847. _this.hide();
  9848. }
  9849. }));
  9850. }
  9851. if (hasTouch) {
  9852. this.$element.on('tap.zf.tooltip touchend.zf.tooltip', function (e) {
  9853. _this.isActive ? _this.hide() : _this.show();
  9854. });
  9855. }
  9856. if (this.options.clickOpen) {
  9857. this.$element.on('mousedown.zf.tooltip', function (e) {
  9858. if (_this.isClick) {//_this.hide();
  9859. // _this.isClick = false;
  9860. } else {
  9861. _this.isClick = true;
  9862. if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {
  9863. _this.show();
  9864. }
  9865. }
  9866. });
  9867. } else {
  9868. this.$element.on('mousedown.zf.tooltip', function (e) {
  9869. _this.isClick = true;
  9870. });
  9871. }
  9872. this.$element.on({
  9873. // 'toggle.zf.trigger': this.toggle.bind(this),
  9874. // 'close.zf.trigger': this.hide.bind(this)
  9875. 'close.zf.trigger': this.hide.bind(this)
  9876. });
  9877. this.$element.on('focus.zf.tooltip', function (e) {
  9878. isFocus = true;
  9879. if (_this.isClick) {
  9880. // If we're not showing open on clicks, we need to pretend a click-launched focus isn't
  9881. // a real focus, otherwise on hover and come back we get bad behavior
  9882. if (!_this.options.clickOpen) {
  9883. isFocus = false;
  9884. }
  9885. return false;
  9886. } else {
  9887. _this.show();
  9888. }
  9889. }).on('focusout.zf.tooltip', function (e) {
  9890. isFocus = false;
  9891. _this.isClick = false;
  9892. _this.hide();
  9893. }).on('resizeme.zf.trigger', function () {
  9894. if (_this.isActive) {
  9895. _this._setPosition();
  9896. }
  9897. });
  9898. }
  9899. /**
  9900. * adds a toggle method, in addition to the static show() & hide() functions
  9901. * @function
  9902. */
  9903. }, {
  9904. key: "toggle",
  9905. value: function toggle() {
  9906. if (this.isActive) {
  9907. this.hide();
  9908. } else {
  9909. this.show();
  9910. }
  9911. }
  9912. /**
  9913. * Destroys an instance of tooltip, removes template element from the view.
  9914. * @function
  9915. */
  9916. }, {
  9917. key: "_destroy",
  9918. value: function _destroy() {
  9919. this.$element.attr('title', this.template.text()).off('.zf.trigger .zf.tooltip').removeClass(this.options.triggerClass).removeClass('top right left bottom').removeAttr('aria-describedby data-disable-hover data-resize data-toggle data-tooltip data-yeti-box');
  9920. this.template.remove();
  9921. }
  9922. }]);
  9923. return Tooltip;
  9924. }(_foundation_positionable__WEBPACK_IMPORTED_MODULE_4__["Positionable"]);
  9925. Tooltip.defaults = {
  9926. /**
  9927. * Time, in ms, before a tooltip should open on hover.
  9928. * @option
  9929. * @type {number}
  9930. * @default 200
  9931. */
  9932. hoverDelay: 200,
  9933. /**
  9934. * Time, in ms, a tooltip should take to fade into view.
  9935. * @option
  9936. * @type {number}
  9937. * @default 150
  9938. */
  9939. fadeInDuration: 150,
  9940. /**
  9941. * Time, in ms, a tooltip should take to fade out of view.
  9942. * @option
  9943. * @type {number}
  9944. * @default 150
  9945. */
  9946. fadeOutDuration: 150,
  9947. /**
  9948. * Disables hover events from opening the tooltip if set to true
  9949. * @option
  9950. * @type {boolean}
  9951. * @default false
  9952. */
  9953. disableHover: false,
  9954. /**
  9955. * Disable the tooltip for touch devices.
  9956. * This can be useful to make elements with a tooltip on it trigger their
  9957. * action on the first tap instead of displaying the tooltip.
  9958. * @option
  9959. * @type {booelan}
  9960. * @default false
  9961. */
  9962. disableForTouch: false,
  9963. /**
  9964. * Optional addtional classes to apply to the tooltip template on init.
  9965. * @option
  9966. * @type {string}
  9967. * @default ''
  9968. */
  9969. templateClasses: '',
  9970. /**
  9971. * Non-optional class added to tooltip templates. Foundation default is 'tooltip'.
  9972. * @option
  9973. * @type {string}
  9974. * @default 'tooltip'
  9975. */
  9976. tooltipClass: 'tooltip',
  9977. /**
  9978. * Class applied to the tooltip anchor element.
  9979. * @option
  9980. * @type {string}
  9981. * @default 'has-tip'
  9982. */
  9983. triggerClass: 'has-tip',
  9984. /**
  9985. * Minimum breakpoint size at which to open the tooltip.
  9986. * @option
  9987. * @type {string}
  9988. * @default 'small'
  9989. */
  9990. showOn: 'small',
  9991. /**
  9992. * Custom template to be used to generate markup for tooltip.
  9993. * @option
  9994. * @type {string}
  9995. * @default ''
  9996. */
  9997. template: '',
  9998. /**
  9999. * Text displayed in the tooltip template on open.
  10000. * @option
  10001. * @type {string}
  10002. * @default ''
  10003. */
  10004. tipText: '',
  10005. touchCloseText: 'Tap to close.',
  10006. /**
  10007. * Allows the tooltip to remain open if triggered with a click or touch event.
  10008. * @option
  10009. * @type {boolean}
  10010. * @default true
  10011. */
  10012. clickOpen: true,
  10013. /**
  10014. * Position of tooltip. Can be left, right, bottom, top, or auto.
  10015. * @option
  10016. * @type {string}
  10017. * @default 'auto'
  10018. */
  10019. position: 'auto',
  10020. /**
  10021. * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto.
  10022. * @option
  10023. * @type {string}
  10024. * @default 'auto'
  10025. */
  10026. alignment: 'auto',
  10027. /**
  10028. * Allow overlap of container/window. If false, tooltip will first try to
  10029. * position as defined by data-position and data-alignment, but reposition if
  10030. * it would cause an overflow. @option
  10031. * @type {boolean}
  10032. * @default false
  10033. */
  10034. allowOverlap: false,
  10035. /**
  10036. * Allow overlap of only the bottom of the container. This is the most common
  10037. * behavior for dropdowns, allowing the dropdown to extend the bottom of the
  10038. * screen but not otherwise influence or break out of the container.
  10039. * Less common for tooltips.
  10040. * @option
  10041. * @type {boolean}
  10042. * @default false
  10043. */
  10044. allowBottomOverlap: false,
  10045. /**
  10046. * Distance, in pixels, the template should push away from the anchor on the Y axis.
  10047. * @option
  10048. * @type {number}
  10049. * @default 0
  10050. */
  10051. vOffset: 0,
  10052. /**
  10053. * Distance, in pixels, the template should push away from the anchor on the X axis
  10054. * @option
  10055. * @type {number}
  10056. * @default 0
  10057. */
  10058. hOffset: 0,
  10059. /**
  10060. * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip
  10061. * @option
  10062. * @type {number}
  10063. * @default 14
  10064. */
  10065. tooltipHeight: 14,
  10066. /**
  10067. * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip
  10068. * @option
  10069. * @type {number}
  10070. * @default 12
  10071. */
  10072. tooltipWidth: 12,
  10073. /**
  10074. * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips,
  10075. * allowing HTML may open yourself up to XSS attacks.
  10076. * @option
  10077. * @type {boolean}
  10078. * @default false
  10079. */
  10080. allowHtml: false
  10081. };
  10082. /**
  10083. * TODO utilize resize event trigger
  10084. */
  10085. /***/ }),
  10086. /***/ "./js/foundation.util.box.js":
  10087. /*!***********************************!*\
  10088. !*** ./js/foundation.util.box.js ***!
  10089. \***********************************/
  10090. /*! exports provided: Box */
  10091. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10092. "use strict";
  10093. __webpack_require__.r(__webpack_exports__);
  10094. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return Box; });
  10095. var Box = {
  10096. ImNotTouchingYou: ImNotTouchingYou,
  10097. OverlapArea: OverlapArea,
  10098. GetDimensions: GetDimensions,
  10099. GetExplicitOffsets: GetExplicitOffsets
  10100. /**
  10101. * Compares the dimensions of an element to a container and determines collision events with container.
  10102. * @function
  10103. * @param {jQuery} element - jQuery object to test for collisions.
  10104. * @param {jQuery} parent - jQuery object to use as bounding container.
  10105. * @param {Boolean} lrOnly - set to true to check left and right values only.
  10106. * @param {Boolean} tbOnly - set to true to check top and bottom values only.
  10107. * @default if no parent object passed, detects collisions with `window`.
  10108. * @returns {Boolean} - true if collision free, false if a collision in any direction.
  10109. */
  10110. };
  10111. function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {
  10112. return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;
  10113. }
  10114. function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {
  10115. var eleDims = GetDimensions(element),
  10116. topOver,
  10117. bottomOver,
  10118. leftOver,
  10119. rightOver;
  10120. if (parent) {
  10121. var parDims = GetDimensions(parent);
  10122. bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height);
  10123. topOver = eleDims.offset.top - parDims.offset.top;
  10124. leftOver = eleDims.offset.left - parDims.offset.left;
  10125. rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width);
  10126. } else {
  10127. bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height);
  10128. topOver = eleDims.offset.top - eleDims.windowDims.offset.top;
  10129. leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;
  10130. rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);
  10131. }
  10132. bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);
  10133. topOver = Math.min(topOver, 0);
  10134. leftOver = Math.min(leftOver, 0);
  10135. rightOver = Math.min(rightOver, 0);
  10136. if (lrOnly) {
  10137. return leftOver + rightOver;
  10138. }
  10139. if (tbOnly) {
  10140. return topOver + bottomOver;
  10141. } // use sum of squares b/c we care about overlap area.
  10142. return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver);
  10143. }
  10144. /**
  10145. * Uses native methods to return an object of dimension values.
  10146. * @function
  10147. * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.
  10148. * @returns {Object} - nested object of integer pixel values
  10149. * TODO - if element is window, return only those values.
  10150. */
  10151. function GetDimensions(elem) {
  10152. elem = elem.length ? elem[0] : elem;
  10153. if (elem === window || elem === document) {
  10154. throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");
  10155. }
  10156. var rect = elem.getBoundingClientRect(),
  10157. parRect = elem.parentNode.getBoundingClientRect(),
  10158. winRect = document.body.getBoundingClientRect(),
  10159. winY = window.pageYOffset,
  10160. winX = window.pageXOffset;
  10161. return {
  10162. width: rect.width,
  10163. height: rect.height,
  10164. offset: {
  10165. top: rect.top + winY,
  10166. left: rect.left + winX
  10167. },
  10168. parentDims: {
  10169. width: parRect.width,
  10170. height: parRect.height,
  10171. offset: {
  10172. top: parRect.top + winY,
  10173. left: parRect.left + winX
  10174. }
  10175. },
  10176. windowDims: {
  10177. width: winRect.width,
  10178. height: winRect.height,
  10179. offset: {
  10180. top: winY,
  10181. left: winX
  10182. }
  10183. }
  10184. };
  10185. }
  10186. /**
  10187. * Returns an object of top and left integer pixel values for dynamically rendered elements,
  10188. * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where
  10189. * you don't know alignment, but generally from
  10190. * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.
  10191. * @function
  10192. * @param {jQuery} element - jQuery object for the element being positioned.
  10193. * @param {jQuery} anchor - jQuery object for the element's anchor point.
  10194. * @param {String} position - a string relating to the desired position of the element, relative to it's anchor
  10195. * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.
  10196. * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.
  10197. * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.
  10198. * TODO alter/rewrite to work with `em` values as well/instead of pixels
  10199. */
  10200. function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {
  10201. var $eleDims = GetDimensions(element),
  10202. $anchorDims = anchor ? GetDimensions(anchor) : null;
  10203. var topVal, leftVal;
  10204. if ($anchorDims !== null) {
  10205. // set position related attribute
  10206. switch (position) {
  10207. case 'top':
  10208. topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);
  10209. break;
  10210. case 'bottom':
  10211. topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;
  10212. break;
  10213. case 'left':
  10214. leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);
  10215. break;
  10216. case 'right':
  10217. leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;
  10218. break;
  10219. } // set alignment related attribute
  10220. switch (position) {
  10221. case 'top':
  10222. case 'bottom':
  10223. switch (alignment) {
  10224. case 'left':
  10225. leftVal = $anchorDims.offset.left + hOffset;
  10226. break;
  10227. case 'right':
  10228. leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;
  10229. break;
  10230. case 'center':
  10231. leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset;
  10232. break;
  10233. }
  10234. break;
  10235. case 'right':
  10236. case 'left':
  10237. switch (alignment) {
  10238. case 'bottom':
  10239. topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;
  10240. break;
  10241. case 'top':
  10242. topVal = $anchorDims.offset.top + vOffset;
  10243. break;
  10244. case 'center':
  10245. topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2;
  10246. break;
  10247. }
  10248. break;
  10249. }
  10250. }
  10251. return {
  10252. top: topVal,
  10253. left: leftVal
  10254. };
  10255. }
  10256. /***/ }),
  10257. /***/ "./js/foundation.util.imageLoader.js":
  10258. /*!*******************************************!*\
  10259. !*** ./js/foundation.util.imageLoader.js ***!
  10260. \*******************************************/
  10261. /*! exports provided: onImagesLoaded */
  10262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10263. "use strict";
  10264. __webpack_require__.r(__webpack_exports__);
  10265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return onImagesLoaded; });
  10266. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10267. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10268. /**
  10269. * Runs a callback function when images are fully loaded.
  10270. * @param {Object} images - Image(s) to check if loaded.
  10271. * @param {Func} callback - Function to execute when image is fully loaded.
  10272. */
  10273. function onImagesLoaded(images, callback) {
  10274. var self = this,
  10275. unloaded = images.length;
  10276. if (unloaded === 0) {
  10277. callback();
  10278. }
  10279. images.each(function () {
  10280. // Check if image is loaded
  10281. if (this.complete && typeof this.naturalWidth !== 'undefined') {
  10282. singleImageLoaded();
  10283. } else {
  10284. // If the above check failed, simulate loading on detached element.
  10285. var image = new Image(); // Still count image as loaded if it finalizes with an error.
  10286. var events = "load.zf.images error.zf.images";
  10287. jquery__WEBPACK_IMPORTED_MODULE_0___default()(image).one(events, function me(event) {
  10288. // Unbind the event listeners. We're using 'one' but only one of the two events will have fired.
  10289. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off(events, me);
  10290. singleImageLoaded();
  10291. });
  10292. image.src = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('src');
  10293. }
  10294. });
  10295. function singleImageLoaded() {
  10296. unloaded--;
  10297. if (unloaded === 0) {
  10298. callback();
  10299. }
  10300. }
  10301. }
  10302. /***/ }),
  10303. /***/ "./js/foundation.util.keyboard.js":
  10304. /*!****************************************!*\
  10305. !*** ./js/foundation.util.keyboard.js ***!
  10306. \****************************************/
  10307. /*! exports provided: Keyboard */
  10308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10309. "use strict";
  10310. __webpack_require__.r(__webpack_exports__);
  10311. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return Keyboard; });
  10312. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10313. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10314. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  10315. /*******************************************
  10316. * *
  10317. * This util was created by Marius Olbertz *
  10318. * Please thank Marius on GitHub /owlbertz *
  10319. * or the web http://www.mariusolbertz.de/ *
  10320. * *
  10321. ******************************************/
  10322. var keyCodes = {
  10323. 9: 'TAB',
  10324. 13: 'ENTER',
  10325. 27: 'ESCAPE',
  10326. 32: 'SPACE',
  10327. 35: 'END',
  10328. 36: 'HOME',
  10329. 37: 'ARROW_LEFT',
  10330. 38: 'ARROW_UP',
  10331. 39: 'ARROW_RIGHT',
  10332. 40: 'ARROW_DOWN'
  10333. };
  10334. var commands = {}; // Functions pulled out to be referenceable from internals
  10335. function findFocusable($element) {
  10336. if (!$element) {
  10337. return false;
  10338. }
  10339. return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {
  10340. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':visible') || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('tabindex') < 0) {
  10341. return false;
  10342. } //only have visible elements and those that have a tabindex greater or equal 0
  10343. return true;
  10344. });
  10345. }
  10346. function parseKey(event) {
  10347. var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase(); // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events
  10348. key = key.replace(/\W+/, '');
  10349. if (event.shiftKey) key = "SHIFT_".concat(key);
  10350. if (event.ctrlKey) key = "CTRL_".concat(key);
  10351. if (event.altKey) key = "ALT_".concat(key); // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)
  10352. key = key.replace(/_$/, '');
  10353. return key;
  10354. }
  10355. var Keyboard = {
  10356. keys: getKeyCodes(keyCodes),
  10357. /**
  10358. * Parses the (keyboard) event and returns a String that represents its key
  10359. * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
  10360. * @param {Event} event - the event generated by the event handler
  10361. * @return String key - String that represents the key pressed
  10362. */
  10363. parseKey: parseKey,
  10364. /**
  10365. * Handles the given (keyboard) event
  10366. * @param {Event} event - the event generated by the event handler
  10367. * @param {String} component - Foundation component's name, e.g. Slider or Reveal
  10368. * @param {Objects} functions - collection of functions that are to be executed
  10369. */
  10370. handleKey: function handleKey(event, component, functions) {
  10371. var commandList = commands[component],
  10372. keyCode = this.parseKey(event),
  10373. cmds,
  10374. command,
  10375. fn;
  10376. if (!commandList) return console.warn('Component not defined!'); // Ignore the event if it was already handled
  10377. if (event.zfIsKeyHandled === true) return; // This component does not differentiate between ltr and rtl
  10378. if (typeof commandList.ltr === 'undefined') {
  10379. cmds = commandList; // use plain list
  10380. } else {
  10381. // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa
  10382. if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["rtl"])()) cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.ltr, commandList.rtl);else cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.rtl, commandList.ltr);
  10383. }
  10384. command = cmds[keyCode];
  10385. fn = functions[command]; // Execute the handler if found
  10386. if (fn && typeof fn === 'function') {
  10387. var returnValue = fn.apply(); // Mark the event as "handled" to prevent future handlings
  10388. event.zfIsKeyHandled = true; // Execute function when event was handled
  10389. if (functions.handled || typeof functions.handled === 'function') {
  10390. functions.handled(returnValue);
  10391. }
  10392. } else {
  10393. // Execute function when event was not handled
  10394. if (functions.unhandled || typeof functions.unhandled === 'function') {
  10395. functions.unhandled();
  10396. }
  10397. }
  10398. },
  10399. /**
  10400. * Finds all focusable elements within the given `$element`
  10401. * @param {jQuery} $element - jQuery object to search within
  10402. * @return {jQuery} $focusable - all focusable elements within `$element`
  10403. */
  10404. findFocusable: findFocusable,
  10405. /**
  10406. * Returns the component name name
  10407. * @param {Object} component - Foundation component, e.g. Slider or Reveal
  10408. * @return String componentName
  10409. */
  10410. register: function register(componentName, cmds) {
  10411. commands[componentName] = cmds;
  10412. },
  10413. // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context?
  10414. //
  10415. /**
  10416. * Traps the focus in the given element.
  10417. * @param {jQuery} $element jQuery object to trap the foucs into.
  10418. */
  10419. trapFocus: function trapFocus($element) {
  10420. var $focusable = findFocusable($element),
  10421. $firstFocusable = $focusable.eq(0),
  10422. $lastFocusable = $focusable.eq(-1);
  10423. $element.on('keydown.zf.trapfocus', function (event) {
  10424. if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {
  10425. event.preventDefault();
  10426. $firstFocusable.focus();
  10427. } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') {
  10428. event.preventDefault();
  10429. $lastFocusable.focus();
  10430. }
  10431. });
  10432. },
  10433. /**
  10434. * Releases the trapped focus from the given element.
  10435. * @param {jQuery} $element jQuery object to release the focus for.
  10436. */
  10437. releaseFocus: function releaseFocus($element) {
  10438. $element.off('keydown.zf.trapfocus');
  10439. }
  10440. };
  10441. /*
  10442. * Constants for easier comparing.
  10443. * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
  10444. */
  10445. function getKeyCodes(kcs) {
  10446. var k = {};
  10447. for (var kc in kcs) {
  10448. k[kcs[kc]] = kcs[kc];
  10449. }
  10450. return k;
  10451. }
  10452. /***/ }),
  10453. /***/ "./js/foundation.util.mediaQuery.js":
  10454. /*!******************************************!*\
  10455. !*** ./js/foundation.util.mediaQuery.js ***!
  10456. \******************************************/
  10457. /*! exports provided: MediaQuery */
  10458. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10459. "use strict";
  10460. __webpack_require__.r(__webpack_exports__);
  10461. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return MediaQuery; });
  10462. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10463. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10464. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  10465. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
  10466. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
  10467. function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  10468. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  10469. // Default set of media queries
  10470. var defaultQueries = {
  10471. 'default': 'only screen',
  10472. landscape: 'only screen and (orientation: landscape)',
  10473. portrait: 'only screen and (orientation: portrait)',
  10474. retina: 'only screen and (-webkit-min-device-pixel-ratio: 2),' + 'only screen and (min--moz-device-pixel-ratio: 2),' + 'only screen and (-o-min-device-pixel-ratio: 2/1),' + 'only screen and (min-device-pixel-ratio: 2),' + 'only screen and (min-resolution: 192dpi),' + 'only screen and (min-resolution: 2dppx)'
  10475. }; // matchMedia() polyfill - Test a CSS media type/query in JS.
  10476. // Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license
  10477. /* eslint-disable */
  10478. window.matchMedia || (window.matchMedia = function () {
  10479. "use strict"; // For browsers that support matchMedium api such as IE 9 and webkit
  10480. var styleMedia = window.styleMedia || window.media; // For those that don't support matchMedium
  10481. if (!styleMedia) {
  10482. var style = document.createElement('style'),
  10483. script = document.getElementsByTagName('script')[0],
  10484. info = null;
  10485. style.type = 'text/css';
  10486. style.id = 'matchmediajs-test';
  10487. if (!script) {
  10488. document.head.appendChild(style);
  10489. } else {
  10490. script.parentNode.insertBefore(style, script);
  10491. } // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
  10492. info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle;
  10493. styleMedia = {
  10494. matchMedium: function matchMedium(media) {
  10495. var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
  10496. if (style.styleSheet) {
  10497. style.styleSheet.cssText = text;
  10498. } else {
  10499. style.textContent = text;
  10500. } // Test if media query is true or false
  10501. return info.width === '1px';
  10502. }
  10503. };
  10504. }
  10505. return function (media) {
  10506. return {
  10507. matches: styleMedia.matchMedium(media || 'all'),
  10508. media: media || 'all'
  10509. };
  10510. };
  10511. }());
  10512. /* eslint-enable */
  10513. var MediaQuery = {
  10514. queries: [],
  10515. current: '',
  10516. /**
  10517. * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.
  10518. * @function
  10519. * @private
  10520. */
  10521. _init: function _init() {
  10522. // make sure the initialization is only done once when calling _init() several times
  10523. if (this.isInitialized === true) {
  10524. return;
  10525. } else {
  10526. this.isInitialized = true;
  10527. }
  10528. var self = this;
  10529. var $meta = jquery__WEBPACK_IMPORTED_MODULE_0___default()('meta.foundation-mq');
  10530. if (!$meta.length) {
  10531. jquery__WEBPACK_IMPORTED_MODULE_0___default()('<meta class="foundation-mq">').appendTo(document.head);
  10532. }
  10533. var extractedStyles = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.foundation-mq').css('font-family');
  10534. var namedQueries;
  10535. namedQueries = parseStyleToObject(extractedStyles);
  10536. self.queries = []; // reset
  10537. for (var key in namedQueries) {
  10538. if (namedQueries.hasOwnProperty(key)) {
  10539. self.queries.push({
  10540. name: key,
  10541. value: "only screen and (min-width: ".concat(namedQueries[key], ")")
  10542. });
  10543. }
  10544. }
  10545. this.current = this._getCurrentSize();
  10546. this._watcher();
  10547. },
  10548. /**
  10549. * Reinitializes the media query helper.
  10550. * Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization.
  10551. * @function
  10552. * @private
  10553. */
  10554. _reInit: function _reInit() {
  10555. this.isInitialized = false;
  10556. this._init();
  10557. },
  10558. /**
  10559. * Checks if the screen is at least as wide as a breakpoint.
  10560. * @function
  10561. * @param {String} size - Name of the breakpoint to check.
  10562. * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.
  10563. */
  10564. atLeast: function atLeast(size) {
  10565. var query = this.get(size);
  10566. if (query) {
  10567. return window.matchMedia(query).matches;
  10568. }
  10569. return false;
  10570. },
  10571. /**
  10572. * Checks if the screen is within the given breakpoint.
  10573. * If smaller than the breakpoint of larger than its upper limit it returns false.
  10574. * @function
  10575. * @param {String} size - Name of the breakpoint to check.
  10576. * @returns {Boolean} `true` if the breakpoint matches, `false` otherwise.
  10577. */
  10578. only: function only(size) {
  10579. return size === this._getCurrentSize();
  10580. },
  10581. /**
  10582. * Checks if the screen is within a breakpoint or smaller.
  10583. * @function
  10584. * @param {String} size - Name of the breakpoint to check.
  10585. * @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger.
  10586. */
  10587. upTo: function upTo(size) {
  10588. var nextSize = this.next(size); // If the next breakpoint does not match, the screen is smaller than
  10589. // the upper limit of this breakpoint.
  10590. if (nextSize) {
  10591. return !this.atLeast(nextSize);
  10592. } // If there is no next breakpoint, the "size" breakpoint does not have
  10593. // an upper limit and the screen will always be within it or smaller.
  10594. return true;
  10595. },
  10596. /**
  10597. * Checks if the screen matches to a breakpoint.
  10598. * @function
  10599. * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.
  10600. * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.
  10601. */
  10602. is: function is(size) {
  10603. var parts = size.trim().split(' ').filter(function (p) {
  10604. return !!p.length;
  10605. });
  10606. var _parts = _slicedToArray(parts, 2),
  10607. bpSize = _parts[0],
  10608. _parts$ = _parts[1],
  10609. bpModifier = _parts$ === void 0 ? '' : _parts$; // Only the breakpont
  10610. if (bpModifier === 'only') {
  10611. return this.only(bpSize);
  10612. } // At least the breakpoint (included)
  10613. if (!bpModifier || bpModifier === 'up') {
  10614. return this.atLeast(bpSize);
  10615. } // Up to the breakpoint (included)
  10616. if (bpModifier === 'down') {
  10617. return this.upTo(bpSize);
  10618. }
  10619. throw new Error("\n Invalid breakpoint passed to MediaQuery.is().\n Expected a breakpoint name formatted like \"<size> <modifier>\", got \"".concat(size, "\".\n "));
  10620. },
  10621. /**
  10622. * Gets the media query of a breakpoint.
  10623. * @function
  10624. * @param {String} size - Name of the breakpoint to get.
  10625. * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.
  10626. */
  10627. get: function get(size) {
  10628. for (var i in this.queries) {
  10629. if (this.queries.hasOwnProperty(i)) {
  10630. var query = this.queries[i];
  10631. if (size === query.name) return query.value;
  10632. }
  10633. }
  10634. return null;
  10635. },
  10636. /**
  10637. * Get the breakpoint following the given breakpoint.
  10638. * @function
  10639. * @param {String} size - Name of the breakpoint.
  10640. * @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one.
  10641. */
  10642. next: function next(size) {
  10643. var _this = this;
  10644. var queryIndex = this.queries.findIndex(function (q) {
  10645. return _this._getQueryName(q) === size;
  10646. });
  10647. if (queryIndex === -1) {
  10648. throw new Error("\n Unknown breakpoint \"".concat(size, "\" passed to MediaQuery.next().\n Ensure it is present in your Sass \"$breakpoints\" setting.\n "));
  10649. }
  10650. var nextQuery = this.queries[queryIndex + 1];
  10651. return nextQuery ? nextQuery.name : null;
  10652. },
  10653. /**
  10654. * Returns the name of the breakpoint related to the given value.
  10655. * @function
  10656. * @private
  10657. * @param {String|Object} value - Breakpoint name or query object.
  10658. * @returns {String} Name of the breakpoint.
  10659. */
  10660. _getQueryName: function _getQueryName(value) {
  10661. if (typeof value === 'string') return value;
  10662. if (_typeof(value) === 'object') return value.name;
  10663. throw new TypeError("\n Invalid value passed to MediaQuery._getQueryName().\n Expected a breakpoint name (String) or a breakpoint query (Object), got \"".concat(value, "\" (").concat(_typeof(value), ")\n "));
  10664. },
  10665. /**
  10666. * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).
  10667. * @function
  10668. * @private
  10669. * @returns {String} Name of the current breakpoint.
  10670. */
  10671. _getCurrentSize: function _getCurrentSize() {
  10672. var matched;
  10673. for (var i = 0; i < this.queries.length; i++) {
  10674. var query = this.queries[i];
  10675. if (window.matchMedia(query.value).matches) {
  10676. matched = query;
  10677. }
  10678. }
  10679. return matched && this._getQueryName(matched);
  10680. },
  10681. /**
  10682. * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.
  10683. * @function
  10684. * @private
  10685. */
  10686. _watcher: function _watcher() {
  10687. var _this2 = this;
  10688. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', function () {
  10689. var newSize = _this2._getCurrentSize(),
  10690. currentSize = _this2.current;
  10691. if (newSize !== currentSize) {
  10692. // Change the current media query
  10693. _this2.current = newSize; // Broadcast the media query change on the window
  10694. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);
  10695. }
  10696. });
  10697. }
  10698. }; // Thank you: https://github.com/sindresorhus/query-string
  10699. function parseStyleToObject(str) {
  10700. var styleObject = {};
  10701. if (typeof str !== 'string') {
  10702. return styleObject;
  10703. }
  10704. str = str.trim().slice(1, -1); // browsers re-quote string style values
  10705. if (!str) {
  10706. return styleObject;
  10707. }
  10708. styleObject = str.split('&').reduce(function (ret, param) {
  10709. var parts = param.replace(/\+/g, ' ').split('=');
  10710. var key = parts[0];
  10711. var val = parts[1];
  10712. key = decodeURIComponent(key); // missing `=` should be `null`:
  10713. // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
  10714. val = typeof val === 'undefined' ? null : decodeURIComponent(val);
  10715. if (!ret.hasOwnProperty(key)) {
  10716. ret[key] = val;
  10717. } else if (Array.isArray(ret[key])) {
  10718. ret[key].push(val);
  10719. } else {
  10720. ret[key] = [ret[key], val];
  10721. }
  10722. return ret;
  10723. }, {});
  10724. return styleObject;
  10725. }
  10726. /***/ }),
  10727. /***/ "./js/foundation.util.motion.js":
  10728. /*!**************************************!*\
  10729. !*** ./js/foundation.util.motion.js ***!
  10730. \**************************************/
  10731. /*! exports provided: Move, Motion */
  10732. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10733. "use strict";
  10734. __webpack_require__.r(__webpack_exports__);
  10735. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Move", function() { return Move; });
  10736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return Motion; });
  10737. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10738. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10739. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  10740. /**
  10741. * Motion module.
  10742. * @module foundation.motion
  10743. */
  10744. var initClasses = ['mui-enter', 'mui-leave'];
  10745. var activeClasses = ['mui-enter-active', 'mui-leave-active'];
  10746. var Motion = {
  10747. animateIn: function animateIn(element, animation, cb) {
  10748. animate(true, element, animation, cb);
  10749. },
  10750. animateOut: function animateOut(element, animation, cb) {
  10751. animate(false, element, animation, cb);
  10752. }
  10753. };
  10754. function Move(duration, elem, fn) {
  10755. var anim,
  10756. prog,
  10757. start = null; // console.log('called');
  10758. if (duration === 0) {
  10759. fn.apply(elem);
  10760. elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
  10761. return;
  10762. }
  10763. function move(ts) {
  10764. if (!start) start = ts; // console.log(start, ts);
  10765. prog = ts - start;
  10766. fn.apply(elem);
  10767. if (prog < duration) {
  10768. anim = window.requestAnimationFrame(move, elem);
  10769. } else {
  10770. window.cancelAnimationFrame(anim);
  10771. elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
  10772. }
  10773. }
  10774. anim = window.requestAnimationFrame(move);
  10775. }
  10776. /**
  10777. * Animates an element in or out using a CSS transition class.
  10778. * @function
  10779. * @private
  10780. * @param {Boolean} isIn - Defines if the animation is in or out.
  10781. * @param {Object} element - jQuery or HTML object to animate.
  10782. * @param {String} animation - CSS class to use.
  10783. * @param {Function} cb - Callback to run when animation is finished.
  10784. */
  10785. function animate(isIn, element, animation, cb) {
  10786. element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).eq(0);
  10787. if (!element.length) return;
  10788. var initClass = isIn ? initClasses[0] : initClasses[1];
  10789. var activeClass = isIn ? activeClasses[0] : activeClasses[1]; // Set up the animation
  10790. reset();
  10791. element.addClass(animation).css('transition', 'none');
  10792. requestAnimationFrame(function () {
  10793. element.addClass(initClass);
  10794. if (isIn) element.show();
  10795. }); // Start the animation
  10796. requestAnimationFrame(function () {
  10797. // will trigger the browser to synchronously calculate the style and layout
  10798. // also called reflow or layout thrashing
  10799. // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a
  10800. element[0].offsetWidth;
  10801. element.css('transition', '').addClass(activeClass);
  10802. }); // Clean up the animation when it finishes
  10803. element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(element), finish); // Hides the element (for out animations), resets the element, and runs a callback
  10804. function finish() {
  10805. if (!isIn) element.hide();
  10806. reset();
  10807. if (cb) cb.apply(element);
  10808. } // Resets transitions and removes motion-specific classes
  10809. function reset() {
  10810. element[0].style.transitionDuration = 0;
  10811. element.removeClass("".concat(initClass, " ").concat(activeClass, " ").concat(animation));
  10812. }
  10813. }
  10814. /***/ }),
  10815. /***/ "./js/foundation.util.nest.js":
  10816. /*!************************************!*\
  10817. !*** ./js/foundation.util.nest.js ***!
  10818. \************************************/
  10819. /*! exports provided: Nest */
  10820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10821. "use strict";
  10822. __webpack_require__.r(__webpack_exports__);
  10823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return Nest; });
  10824. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10825. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10826. var Nest = {
  10827. Feather: function Feather(menu) {
  10828. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf';
  10829. menu.attr('role', 'menubar');
  10830. menu.find('a').attr({
  10831. 'role': 'menuitem'
  10832. });
  10833. var items = menu.find('li').attr({
  10834. 'role': 'none'
  10835. }),
  10836. subMenuClass = "is-".concat(type, "-submenu"),
  10837. subItemClass = "".concat(subMenuClass, "-item"),
  10838. hasSubClass = "is-".concat(type, "-submenu-parent"),
  10839. applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes.
  10840. items.each(function () {
  10841. var $item = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  10842. $sub = $item.children('ul');
  10843. if ($sub.length) {
  10844. $item.addClass(hasSubClass);
  10845. if (applyAria) {
  10846. $item.attr({
  10847. 'aria-haspopup': true,
  10848. 'aria-label': $item.children('a:first').text()
  10849. }); // Note: Drilldowns behave differently in how they hide, and so need
  10850. // additional attributes. We should look if this possibly over-generalized
  10851. // utility (Nest) is appropriate when we rework menus in 6.4
  10852. if (type === 'drilldown') {
  10853. $item.attr({
  10854. 'aria-expanded': false
  10855. });
  10856. }
  10857. }
  10858. $sub.addClass("submenu ".concat(subMenuClass)).attr({
  10859. 'data-submenu': '',
  10860. 'role': 'menubar'
  10861. });
  10862. if (type === 'drilldown') {
  10863. $sub.attr({
  10864. 'aria-hidden': true
  10865. });
  10866. }
  10867. }
  10868. if ($item.parent('[data-submenu]').length) {
  10869. $item.addClass("is-submenu-item ".concat(subItemClass));
  10870. }
  10871. });
  10872. return;
  10873. },
  10874. Burn: function Burn(menu, type) {
  10875. var //items = menu.find('li'),
  10876. subMenuClass = "is-".concat(type, "-submenu"),
  10877. subItemClass = "".concat(subMenuClass, "-item"),
  10878. hasSubClass = "is-".concat(type, "-submenu-parent");
  10879. menu.find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li').removeClass("".concat(subMenuClass, " ").concat(subItemClass, " ").concat(hasSubClass, " is-submenu-item submenu is-active")).removeAttr('data-submenu').css('display', '');
  10880. }
  10881. };
  10882. /***/ }),
  10883. /***/ "./js/foundation.util.timer.js":
  10884. /*!*************************************!*\
  10885. !*** ./js/foundation.util.timer.js ***!
  10886. \*************************************/
  10887. /*! exports provided: Timer */
  10888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10889. "use strict";
  10890. __webpack_require__.r(__webpack_exports__);
  10891. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; });
  10892. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10893. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10894. function Timer(elem, options, cb) {
  10895. var _this = this,
  10896. duration = options.duration,
  10897. //options is an object for easily adding features later.
  10898. nameSpace = Object.keys(elem.data())[0] || 'timer',
  10899. remain = -1,
  10900. start,
  10901. timer;
  10902. this.isPaused = false;
  10903. this.restart = function () {
  10904. remain = -1;
  10905. clearTimeout(timer);
  10906. this.start();
  10907. };
  10908. this.start = function () {
  10909. this.isPaused = false; // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
  10910. clearTimeout(timer);
  10911. remain = remain <= 0 ? duration : remain;
  10912. elem.data('paused', false);
  10913. start = Date.now();
  10914. timer = setTimeout(function () {
  10915. if (options.infinite) {
  10916. _this.restart(); //rerun the timer.
  10917. }
  10918. if (cb && typeof cb === 'function') {
  10919. cb();
  10920. }
  10921. }, remain);
  10922. elem.trigger("timerstart.zf.".concat(nameSpace));
  10923. };
  10924. this.pause = function () {
  10925. this.isPaused = true; //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
  10926. clearTimeout(timer);
  10927. elem.data('paused', true);
  10928. var end = Date.now();
  10929. remain = remain - (end - start);
  10930. elem.trigger("timerpaused.zf.".concat(nameSpace));
  10931. };
  10932. }
  10933. /***/ }),
  10934. /***/ "./js/foundation.util.touch.js":
  10935. /*!*************************************!*\
  10936. !*** ./js/foundation.util.touch.js ***!
  10937. \*************************************/
  10938. /*! exports provided: Touch */
  10939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10940. "use strict";
  10941. __webpack_require__.r(__webpack_exports__);
  10942. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; });
  10943. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10944. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10945. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10946. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10947. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  10948. //**************************************************
  10949. //**Work inspired by multiple jquery swipe plugins**
  10950. //**Done by Yohai Ararat ***************************
  10951. //**************************************************
  10952. var Touch = {};
  10953. var startPosX,
  10954. startPosY,
  10955. startTime,
  10956. elapsedTime,
  10957. startEvent,
  10958. isMoving = false,
  10959. didMoved = false;
  10960. function onTouchEnd(e) {
  10961. this.removeEventListener('touchmove', onTouchMove);
  10962. this.removeEventListener('touchend', onTouchEnd); // If the touch did not move, consider it as a "tap"
  10963. if (!didMoved) {
  10964. var tapEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('tap', startEvent || e);
  10965. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(tapEvent);
  10966. }
  10967. startEvent = null;
  10968. isMoving = false;
  10969. didMoved = false;
  10970. }
  10971. function onTouchMove(e) {
  10972. if (jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault) {
  10973. e.preventDefault();
  10974. }
  10975. if (isMoving) {
  10976. var x = e.touches[0].pageX;
  10977. var y = e.touches[0].pageY;
  10978. var dx = startPosX - x;
  10979. var dy = startPosY - y;
  10980. var dir;
  10981. didMoved = true;
  10982. elapsedTime = new Date().getTime() - startTime;
  10983. if (Math.abs(dx) >= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.moveThreshold && elapsedTime <= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.timeThreshold) {
  10984. dir = dx > 0 ? 'left' : 'right';
  10985. } // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {
  10986. // dir = dy > 0 ? 'down' : 'up';
  10987. // }
  10988. if (dir) {
  10989. e.preventDefault();
  10990. onTouchEnd.apply(this, arguments);
  10991. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('swipe', Object.assign({}, e)), dir).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event("swipe".concat(dir), Object.assign({}, e)));
  10992. }
  10993. }
  10994. }
  10995. function onTouchStart(e) {
  10996. if (e.touches.length == 1) {
  10997. startPosX = e.touches[0].pageX;
  10998. startPosY = e.touches[0].pageY;
  10999. startEvent = e;
  11000. isMoving = true;
  11001. didMoved = false;
  11002. startTime = new Date().getTime();
  11003. this.addEventListener('touchmove', onTouchMove, false);
  11004. this.addEventListener('touchend', onTouchEnd, false);
  11005. }
  11006. }
  11007. function init() {
  11008. this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
  11009. }
  11010. function teardown() {
  11011. this.removeEventListener('touchstart', onTouchStart);
  11012. }
  11013. var SpotSwipe =
  11014. /*#__PURE__*/
  11015. function () {
  11016. function SpotSwipe($) {
  11017. _classCallCheck(this, SpotSwipe);
  11018. this.version = '1.0.0';
  11019. this.enabled = 'ontouchstart' in document.documentElement;
  11020. this.preventDefault = false;
  11021. this.moveThreshold = 75;
  11022. this.timeThreshold = 200;
  11023. this.$ = $;
  11024. this._init();
  11025. }
  11026. _createClass(SpotSwipe, [{
  11027. key: "_init",
  11028. value: function _init() {
  11029. var $ = this.$;
  11030. $.event.special.swipe = {
  11031. setup: init
  11032. };
  11033. $.event.special.tap = {
  11034. setup: init
  11035. };
  11036. $.each(['left', 'up', 'down', 'right'], function () {
  11037. $.event.special["swipe".concat(this)] = {
  11038. setup: function setup() {
  11039. $(this).on('swipe', $.noop);
  11040. }
  11041. };
  11042. });
  11043. }
  11044. }]);
  11045. return SpotSwipe;
  11046. }();
  11047. /****************************************************
  11048. * As far as I can tell, both setupSpotSwipe and *
  11049. * setupTouchHandler should be idempotent, *
  11050. * because they directly replace functions & *
  11051. * values, and do not add event handlers directly. *
  11052. ****************************************************/
  11053. Touch.setupSpotSwipe = function ($) {
  11054. $.spotSwipe = new SpotSwipe($);
  11055. };
  11056. /****************************************************
  11057. * Method for adding pseudo drag events to elements *
  11058. ***************************************************/
  11059. Touch.setupTouchHandler = function ($) {
  11060. $.fn.addTouch = function () {
  11061. this.each(function (i, el) {
  11062. $(el).bind('touchstart touchmove touchend touchcancel', function (event) {
  11063. //we pass the original event object because the jQuery event
  11064. //object is normalized to w3c specs and does not provide the TouchList
  11065. handleTouch(event);
  11066. });
  11067. });
  11068. var handleTouch = function handleTouch(event) {
  11069. var touches = event.changedTouches,
  11070. first = touches[0],
  11071. eventTypes = {
  11072. touchstart: 'mousedown',
  11073. touchmove: 'mousemove',
  11074. touchend: 'mouseup'
  11075. },
  11076. type = eventTypes[event.type],
  11077. simulatedEvent;
  11078. if ('MouseEvent' in window && typeof window.MouseEvent === 'function') {
  11079. simulatedEvent = new window.MouseEvent(type, {
  11080. 'bubbles': true,
  11081. 'cancelable': true,
  11082. 'screenX': first.screenX,
  11083. 'screenY': first.screenY,
  11084. 'clientX': first.clientX,
  11085. 'clientY': first.clientY
  11086. });
  11087. } else {
  11088. simulatedEvent = document.createEvent('MouseEvent');
  11089. simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0
  11090. /*left*/
  11091. , null);
  11092. }
  11093. first.target.dispatchEvent(simulatedEvent);
  11094. };
  11095. };
  11096. };
  11097. Touch.init = function ($) {
  11098. if (typeof $.spotSwipe === 'undefined') {
  11099. Touch.setupSpotSwipe($);
  11100. Touch.setupTouchHandler($);
  11101. }
  11102. };
  11103. /***/ }),
  11104. /***/ "./js/foundation.util.triggers.js":
  11105. /*!****************************************!*\
  11106. !*** ./js/foundation.util.triggers.js ***!
  11107. \****************************************/
  11108. /*! exports provided: Triggers */
  11109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11110. "use strict";
  11111. __webpack_require__.r(__webpack_exports__);
  11112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return Triggers; });
  11113. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  11114. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  11115. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  11116. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  11117. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  11118. var MutationObserver = function () {
  11119. var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
  11120. for (var i = 0; i < prefixes.length; i++) {
  11121. if ("".concat(prefixes[i], "MutationObserver") in window) {
  11122. return window["".concat(prefixes[i], "MutationObserver")];
  11123. }
  11124. }
  11125. return false;
  11126. }();
  11127. var triggers = function triggers(el, type) {
  11128. el.data(type).split(' ').forEach(function (id) {
  11129. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler']("".concat(type, ".zf.trigger"), [el]);
  11130. });
  11131. };
  11132. var Triggers = {
  11133. Listeners: {
  11134. Basic: {},
  11135. Global: {}
  11136. },
  11137. Initializers: {}
  11138. };
  11139. Triggers.Listeners.Basic = {
  11140. openListener: function openListener() {
  11141. triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'open');
  11142. },
  11143. closeListener: function closeListener() {
  11144. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('close');
  11145. if (id) {
  11146. triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'close');
  11147. } else {
  11148. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('close.zf.trigger');
  11149. }
  11150. },
  11151. toggleListener: function toggleListener() {
  11152. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle');
  11153. if (id) {
  11154. triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'toggle');
  11155. } else {
  11156. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('toggle.zf.trigger');
  11157. }
  11158. },
  11159. closeableListener: function closeableListener(e) {
  11160. var animation = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('closable'); // Only close the first closable element. See https://git.io/zf-7833
  11161. e.stopPropagation();
  11162. if (animation !== '') {
  11163. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), animation, function () {
  11164. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('closed.zf');
  11165. });
  11166. } else {
  11167. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).fadeOut().trigger('closed.zf');
  11168. }
  11169. },
  11170. toggleFocusListener: function toggleFocusListener() {
  11171. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle-focus');
  11172. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id)).triggerHandler('toggle.zf.trigger', [jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)]);
  11173. }
  11174. }; // Elements with [data-open] will reveal a plugin that supports it when clicked.
  11175. Triggers.Initializers.addOpenListener = function ($elem) {
  11176. $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);
  11177. $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);
  11178. }; // Elements with [data-close] will close a plugin that supports it when clicked.
  11179. // If used without a value on [data-close], the event will bubble, allowing it to close a parent component.
  11180. Triggers.Initializers.addCloseListener = function ($elem) {
  11181. $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);
  11182. $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);
  11183. }; // Elements with [data-toggle] will toggle a plugin that supports it when clicked.
  11184. Triggers.Initializers.addToggleListener = function ($elem) {
  11185. $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);
  11186. $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);
  11187. }; // Elements with [data-closable] will respond to close.zf.trigger events.
  11188. Triggers.Initializers.addCloseableListener = function ($elem) {
  11189. $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);
  11190. $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);
  11191. }; // Elements with [data-toggle-focus] will respond to coming in and out of focus
  11192. Triggers.Initializers.addToggleFocusListener = function ($elem) {
  11193. $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);
  11194. $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);
  11195. }; // More Global/complex listeners and triggers
  11196. Triggers.Listeners.Global = {
  11197. resizeListener: function resizeListener($nodes) {
  11198. if (!MutationObserver) {
  11199. //fallback for IE 9
  11200. $nodes.each(function () {
  11201. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('resizeme.zf.trigger');
  11202. });
  11203. } //trigger all listening elements and signal a resize event
  11204. $nodes.attr('data-events', "resize");
  11205. },
  11206. scrollListener: function scrollListener($nodes) {
  11207. if (!MutationObserver) {
  11208. //fallback for IE 9
  11209. $nodes.each(function () {
  11210. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('scrollme.zf.trigger');
  11211. });
  11212. } //trigger all listening elements and signal a scroll event
  11213. $nodes.attr('data-events', "scroll");
  11214. },
  11215. closeMeListener: function closeMeListener(e, pluginId) {
  11216. var plugin = e.namespace.split('.')[0];
  11217. var plugins = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-".concat(plugin, "]")).not("[data-yeti-box=\"".concat(pluginId, "\"]"));
  11218. plugins.each(function () {
  11219. var _this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  11220. _this.triggerHandler('close.zf.trigger', [_this]);
  11221. });
  11222. } // Global, parses whole document.
  11223. };
  11224. Triggers.Initializers.addClosemeListener = function (pluginName) {
  11225. var yetiBoxes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-yeti-box]'),
  11226. plugNames = ['dropdown', 'tooltip', 'reveal'];
  11227. if (pluginName) {
  11228. if (typeof pluginName === 'string') {
  11229. plugNames.push(pluginName);
  11230. } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') {
  11231. plugNames = plugNames.concat(pluginName);
  11232. } else {
  11233. console.error('Plugin names must be strings');
  11234. }
  11235. }
  11236. if (yetiBoxes.length) {
  11237. var listeners = plugNames.map(function (name) {
  11238. return "closeme.zf.".concat(name);
  11239. }).join(' ');
  11240. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);
  11241. }
  11242. };
  11243. function debounceGlobalListener(debounce, trigger, listener) {
  11244. var timer,
  11245. args = Array.prototype.slice.call(arguments, 3);
  11246. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(trigger).on(trigger, function (e) {
  11247. if (timer) {
  11248. clearTimeout(timer);
  11249. }
  11250. timer = setTimeout(function () {
  11251. listener.apply(null, args);
  11252. }, debounce || 10); //default time to emit scroll event
  11253. });
  11254. }
  11255. Triggers.Initializers.addResizeListener = function (debounce) {
  11256. var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-resize]');
  11257. if ($nodes.length) {
  11258. debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);
  11259. }
  11260. };
  11261. Triggers.Initializers.addScrollListener = function (debounce) {
  11262. var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-scroll]');
  11263. if ($nodes.length) {
  11264. debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);
  11265. }
  11266. };
  11267. Triggers.Initializers.addMutationEventsListener = function ($elem) {
  11268. if (!MutationObserver) {
  11269. return false;
  11270. }
  11271. var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]'); //element callback
  11272. var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) {
  11273. var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(mutationRecordsList[0].target); //trigger the event handler for the element depending on type
  11274. switch (mutationRecordsList[0].type) {
  11275. case "attributes":
  11276. if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") {
  11277. $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);
  11278. }
  11279. if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") {
  11280. $target.triggerHandler('resizeme.zf.trigger', [$target]);
  11281. }
  11282. if (mutationRecordsList[0].attributeName === "style") {
  11283. $target.closest("[data-mutate]").attr("data-events", "mutate");
  11284. $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
  11285. }
  11286. break;
  11287. case "childList":
  11288. $target.closest("[data-mutate]").attr("data-events", "mutate");
  11289. $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
  11290. break;
  11291. default:
  11292. return false;
  11293. //nothing
  11294. }
  11295. };
  11296. if ($nodes.length) {
  11297. //for each element that needs to listen for resizing, scrolling, or mutation add a single observer
  11298. for (var i = 0; i <= $nodes.length - 1; i++) {
  11299. var elementObserver = new MutationObserver(listeningElementsMutation);
  11300. elementObserver.observe($nodes[i], {
  11301. attributes: true,
  11302. childList: true,
  11303. characterData: false,
  11304. subtree: true,
  11305. attributeFilter: ["data-events", "style"]
  11306. });
  11307. }
  11308. }
  11309. };
  11310. Triggers.Initializers.addSimpleListeners = function () {
  11311. var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document);
  11312. Triggers.Initializers.addOpenListener($document);
  11313. Triggers.Initializers.addCloseListener($document);
  11314. Triggers.Initializers.addToggleListener($document);
  11315. Triggers.Initializers.addCloseableListener($document);
  11316. Triggers.Initializers.addToggleFocusListener($document);
  11317. };
  11318. Triggers.Initializers.addGlobalListeners = function () {
  11319. var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document);
  11320. Triggers.Initializers.addMutationEventsListener($document);
  11321. Triggers.Initializers.addResizeListener();
  11322. Triggers.Initializers.addScrollListener();
  11323. Triggers.Initializers.addClosemeListener();
  11324. };
  11325. Triggers.init = function ($, Foundation) {
  11326. Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])($(window), function () {
  11327. if ($.triggersInitialized !== true) {
  11328. Triggers.Initializers.addSimpleListeners();
  11329. Triggers.Initializers.addGlobalListeners();
  11330. $.triggersInitialized = true;
  11331. }
  11332. });
  11333. if (Foundation) {
  11334. Foundation.Triggers = Triggers; // Legacy included to be backwards compatible for now.
  11335. Foundation.IHearYou = Triggers.Initializers.addGlobalListeners;
  11336. }
  11337. };
  11338. /***/ }),
  11339. /***/ 0:
  11340. /*!****************************************!*\
  11341. !*** multi ./js/entries/foundation.js ***!
  11342. \****************************************/
  11343. /*! no static exports found */
  11344. /***/ (function(module, exports, __webpack_require__) {
  11345. module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/foundation.js */"./js/entries/foundation.js");
  11346. /***/ }),
  11347. /***/ "jquery":
  11348. /*!********************************************************************************************!*\
  11349. !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***!
  11350. \********************************************************************************************/
  11351. /*! no static exports found */
  11352. /***/ (function(module, exports) {
  11353. module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
  11354. /***/ })
  11355. /******/ });
  11356. });
  11357. //# sourceMappingURL=foundation.js.map